Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apaas-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gzga-jzapi
apaas-ui
Commits
70f51a12
Commit
70f51a12
authored
Jul 13, 2020
by
刘殿昕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
云资源权限
parent
34d478a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
105 additions
and
120 deletions
+105
-120
src/pages/workbench/fwgl/cloud-detail.vue
src/pages/workbench/fwgl/cloud-detail.vue
+105
-120
No files found.
src/pages/workbench/fwgl/cloud-detail.vue
View file @
70f51a12
...
...
@@ -418,43 +418,10 @@ export default {
align
:
"
center
"
}
],
appList
:
[
{
id
:
"
123
"
,
app_name
:
"
单文件啊
"
},
{
id
:
"
1223
"
,
app_name
:
"
单文件啊
"
},
{
id
:
"
1313
"
,
app_name
:
"
单文件啊
"
},
{
id
:
"
124563
"
,
app_name
:
"
单文件啊
"
},
{
id
:
"
126783
"
,
app_name
:
"
单文件啊
"
},
{
id
:
"
1225673
"
,
app_name
:
"
单文件啊
"
},
{
id
:
"
13134563
"
,
app_name
:
"
单文件啊
"
},
{
id
:
"
12234563
"
,
app_name
:
"
单文件啊
"
}
],
appList
:
[],
now_user
:
""
,
activeName
:
null
,
tabShow
:
tru
e
,
tabShow
:
fals
e
,
cloudData
:
{
namespace
:
""
,
workplace
:
""
,
...
...
@@ -519,10 +486,7 @@ export default {
this
.
user_id
=
this
.
$route
.
query
.
user_id
||
""
;
this
.
apply_type
=
this
.
$route
.
query
.
apply_type
||
0
;
this
.
use_uid
=
this
.
$route
.
query
.
use_uid
||
""
;
this
.
id
=
this
.
$route
.
query
.
id
||
""
;
if
(
this
.
use_uid
!=
""
)
{
this
.
getCloudApplication
();
}
this
.
id
=
this
.
$route
.
params
.
id
||
""
;
},
getUrl
()
{
return
this
.
$route
.
path
.
substring
(
0
,
9
);
...
...
@@ -615,17 +579,17 @@ export default {
})
.
then
(
response
=>
{
if
(
response
.
data
.
success
==
1
)
{
this
.
$message
({
message
:
"
该资源已删除
"
,
type
:
"
success
"
});
this
.
$router
.
push
(
this
.
getUrl
());
}
else
{
this
.
$message
({
message
:
"
资源删除失败
"
,
type
:
"
error
"
});
}
this
.
$message
({
message
:
"
该资源已删除
"
,
type
:
"
success
"
});
this
.
$router
.
push
(
this
.
getUrl
());
}
else
{
this
.
$message
({
message
:
"
资源删除失败
"
,
type
:
"
error
"
});
}
});
},
getCurrentUser
()
{
...
...
@@ -644,49 +608,63 @@ export default {
clickTab
()
{},
// 根据列表参数来判断显示什么
setListWithRole
()
{
console
.
log
(
this
.
now_user
+
"
..
"
+
this
.
apply_type
);
if
(
this
.
now_user
==
0
)
{
// 普通用户
if
(
this
.
apply_type
==
0
)
{
//
申请类型0
if
(
this
.
use_uid
==
""
)
{
//
没分配
let
index
=
this
.
list_arr
.
findIndex
(
item
=>
item
.
title
==
"
资源使用情况:
"
);
this
.
list_arr
.
splice
(
index
);
this
.
tabShow
=
false
;
}
if
(
this
.
apply_type
==
0
)
{
// 申请类型0
this
.
list_arr
.
splice
(
2
,
1
);
}
else
if
(
this
.
apply_type
!=
0
)
{
// 申请类型1
this
.
tabShow
=
false
;
}
this
.
tabShow
=
false
;
this
.
activeName
=
"
0
"
;
}
else
if
(
this
.
now_user
==
1
)
{
// 组织
if
(
this
.
apply_type
==
0
)
{
//
申请类型
if
(
this
.
use_uid
==
""
)
{
//
没分配
let
index
=
this
.
list_arr
.
findIndex
(
item
=>
item
.
title
==
"
资源使用情况:
"
);
this
.
list_arr
.
splice
(
index
);
}
if
(
this
.
apply_type
==
0
)
{
// 申请类型0
this
.
list_arr
.
splice
(
2
,
1
);
}
else
if
(
this
.
apply_type
!=
0
)
{
}
if
(
this
.
apploy_msg
.
first_level
==
0
)
{
// 没
分配
// 没
审批
this
.
tabShow
=
false
;
}
else
if
(
this
.
apploy_msg
.
first_level
!=
0
)
{
//
分配
//
组织审批了
this
.
tabShow
=
true
;
}
this
.
activeName
=
"
0
"
;
}
else
if
(
this
.
now_user
==
2
)
{
// 超管
if
(
this
.
apply_type
==
0
)
{
if
(
this
.
use_uid
==
""
)
{
// 没分配
let
index
=
this
.
list_arr
.
findIndex
(
item
=>
item
.
title
==
"
资源使用情况:
"
);
this
.
list_arr
.
splice
(
index
);
this
.
tabShow
=
false
;
}
if
(
this
.
apply_type
==
0
)
{
// 申请类型0
this
.
list_arr
.
splice
(
2
,
1
);
}
else
if
(
this
.
apply_type
!=
0
)
{
this
.
tabShow
=
false
;
}
this
.
tabShow
=
false
;
this
.
activeName
=
"
0
"
;
}
this
.
activeName
=
"
0
"
;
},
getCloudDetail
()
{
let
query
=
{
...
...
@@ -696,65 +674,72 @@ export default {
};
this
.
$api
.
workbench
.
getCloudDetail
(
query
).
then
(
response
=>
{
let
data
=
response
.
data
.
data
;
console
.
log
(
data
);
this
.
list_arr
[
3
].
info
=
helper
.
downloadFileFormat
(
data
.
apply_file
?
data
.
apply_file
:
""
);
// application file name
this
.
list_arr
[
3
].
url
=
data
.
apply_file
;
// application file url
this
.
list_arr
[
6
].
info
=
data
.
bgn_time
;
// get time
this
.
list_arr
[
7
].
info
=
data
.
time_remaining
;
// remaining days
this
.
list_arr
[
8
].
info
=
data
.
end_time
;
// maturity time
this
.
list_arr_my
[
0
].
info
=
data
.
first_level_time
;
// submit application time
this
.
list_arr_my
[
1
].
info
=
data
.
second_level_time
;
// super get time
this
.
super_status
=
data
.
second_leve
;
// super status
this
.
desc
=
data
.
workplacedesc
;
// workplace description
let
count
=
data
.
cloud_resource_count
;
// resource usage
if
(
count
)
{
this
.
data1
.
total
=
count
.
cpu_total
;
this
.
data1
.
remaining
=
count
.
cpu_total
-
count
.
cpu_use
;
this
.
data1
.
data
=
Math
.
round
((
count
.
cpu_total
/
count
.
cpu_use
)
*
100
);
this
.
data2
.
total
=
count
.
memory_total
;
this
.
data2
.
remaining
=
count
.
memory_total
-
count
.
memory_use
;
this
.
data2
.
data
=
Math
.
round
(
(
count
.
memory_total
/
count
.
memory_use
)
*
100
);
this
.
data3
.
total
=
count
.
disk_total
;
this
.
data3
.
remaining
=
count
.
disk_total
-
count
.
disk_use
;
this
.
data3
.
data
=
Math
.
round
(
(
count
.
disk_total
/
count
.
disk_use
)
*
100
);
this
.
data4
.
total
=
count
.
containers_total
;
this
.
data4
.
remaining
=
count
.
containers_total
-
count
.
containers_use
;
this
.
data4
.
data
=
Math
.
round
(
(
count
.
containers_total
/
count
.
containers_use
)
*
100
);
if
(
data
)
{
this
.
list_arr
[
3
].
info
=
helper
.
downloadFileFormat
(
data
.
apply_file
?
data
.
apply_file
:
""
);
// application file name
this
.
list_arr
[
3
].
url
=
data
.
apply_file
;
// application file url
this
.
list_arr
[
6
].
info
=
data
.
bgn_time
;
// get time
this
.
list_arr
[
7
].
info
=
data
.
time_remaining
;
// remaining days
this
.
list_arr
[
8
].
info
=
data
.
end_time
;
// maturity time
this
.
list_arr_my
[
0
].
info
=
data
.
first_level_time
;
// submit application time
this
.
list_arr_my
[
1
].
info
=
data
.
second_level_time
;
// super get time
this
.
super_status
=
data
.
second_leve
;
// super status
this
.
desc
=
data
.
workplacedesc
;
// workplace description
let
count
=
data
.
cloud_resource_count
;
// resource usage
if
(
count
)
{
this
.
data1
.
total
=
count
.
cpu_total
;
this
.
data1
.
remaining
=
count
.
cpu_total
-
count
.
cpu_use
;
this
.
data1
.
data
=
Math
.
round
(
(
count
.
cpu_total
/
count
.
cpu_use
)
*
100
);
this
.
data2
.
total
=
count
.
memory_total
;
this
.
data2
.
remaining
=
count
.
memory_total
-
count
.
memory_use
;
this
.
data2
.
data
=
Math
.
round
(
(
count
.
memory_total
/
count
.
memory_use
)
*
100
);
this
.
data3
.
total
=
count
.
disk_total
;
this
.
data3
.
remaining
=
count
.
disk_total
-
count
.
disk_use
;
this
.
data3
.
data
=
Math
.
round
(
(
count
.
disk_total
/
count
.
disk_use
)
*
100
);
this
.
data4
.
total
=
count
.
containers_total
;
this
.
data4
.
remaining
=
count
.
containers_total
-
count
.
containers_use
;
this
.
data4
.
data
=
Math
.
round
(
(
count
.
containers_total
/
count
.
containers_use
)
*
100
);
}
this
.
cloudDteail
.
containers
=
data
.
containers
;
this
.
cloudDteail
.
cpu
=
data
.
cpu
;
this
.
cloudDteail
.
disk
=
data
.
disk
;
this
.
cloudDteail
.
memory
=
data
.
memory
;
this
.
cloudDteail
.
apply_duration_time
=
data
.
apply_duration_time
;
this
.
cloudDteail
.
one_cpu_max
=
data
.
one_cpu_max
;
this
.
cloudDteail
.
one_cpu_min
=
data
.
one_cpu_min
;
this
.
cloudDteail
.
one_memory_max
=
data
.
one_memory_max
;
this
.
cloudDteail
.
one_memory_min
=
data
.
one_memory_min
;
this
.
cloudDetailNew
.
adjust_containers
=
data
.
adjust_containers
;
this
.
cloudDetailNew
.
adjust_cpu
=
data
.
adjust_cpu
;
this
.
cloudDetailNew
.
adjust_disk
=
data
.
adjust_disk
;
this
.
cloudDetailNew
.
adjust_memory
=
data
.
adjust_memory
;
this
.
cloudDteail
.
adjust_duration_time
=
data
.
adjust_duration_time
;
this
.
cloudDteail
.
adjust_one_cpu_max
=
data
.
adjust_one_cpu_max
;
this
.
cloudDteail
.
adjust_one_cpu_min
=
data
.
adjust_one_cpu_min
;
this
.
cloudDteail
.
adjust_one_memory_max
=
data
.
adjust_one_memory_max
;
this
.
cloudDteail
.
adjust_one_memory_min
=
data
.
adjust_one_memory_min
;
this
.
apploy_msg
.
first_level
=
data
.
first_level
;
this
.
apploy_msg
.
second_level
=
data
.
second_level
;
this
.
cloudData
.
namespace
=
data
.
namespace
;
this
.
cloudData
.
workplace
=
data
.
workplace
;
this
.
cloudData
.
user_name
=
data
.
user_name
;
this
.
cloudData
.
phone
=
data
.
phone
;
this
.
cloudData
.
apply_time
=
data
.
apply_time
;
this
.
cloudData
.
system_name
=
data
.
system_name
;
}
if
(
this
.
use_uid
!=
""
)
{
this
.
getCloudApplication
();
}
this
.
cloudDteail
.
containers
=
data
.
containers
;
this
.
cloudDteail
.
cpu
=
data
.
cpu
;
this
.
cloudDteail
.
disk
=
data
.
disk
;
this
.
cloudDteail
.
memory
=
data
.
memory
;
this
.
cloudDteail
.
apply_duration_time
=
data
.
apply_duration_time
;
this
.
cloudDteail
.
one_cpu_max
=
data
.
one_cpu_max
;
this
.
cloudDteail
.
one_cpu_min
=
data
.
one_cpu_min
;
this
.
cloudDteail
.
one_memory_max
=
data
.
one_memory_max
;
this
.
cloudDteail
.
one_memory_min
=
data
.
one_memory_min
;
this
.
cloudDetailNew
.
adjust_containers
=
data
.
adjust_containers
;
this
.
cloudDetailNew
.
adjust_cpu
=
data
.
adjust_cpu
;
this
.
cloudDetailNew
.
adjust_disk
=
data
.
adjust_disk
;
this
.
cloudDetailNew
.
adjust_memory
=
data
.
adjust_memory
;
this
.
cloudDteail
.
adjust_duration_time
=
data
.
adjust_duration_time
;
this
.
cloudDteail
.
adjust_one_cpu_max
=
data
.
adjust_one_cpu_max
;
this
.
cloudDteail
.
adjust_one_cpu_min
=
data
.
adjust_one_cpu_min
;
this
.
cloudDteail
.
adjust_one_memory_max
=
data
.
adjust_one_memory_max
;
this
.
cloudDteail
.
adjust_one_memory_min
=
data
.
adjust_one_memory_min
;
this
.
apploy_msg
.
first_level
=
data
.
first_level
;
this
.
apploy_msg
.
second_level
=
data
.
second_level
;
this
.
cloudData
.
namespace
=
data
.
namespace
;
this
.
cloudData
.
workplace
=
data
.
workplace
;
this
.
cloudData
.
user_name
=
data
.
user_name
;
this
.
cloudData
.
phone
=
data
.
phone
;
this
.
cloudData
.
apply_time
=
data
.
apply_time
;
this
.
cloudData
.
system_name
=
data
.
system_name
;
this
.
setListWithRole
();
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment