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
7a738e81
Commit
7a738e81
authored
May 11, 2020
by
徐一鸣
Browse files
Options
Browse Files
Download
Plain Diff
merge xym
parents
7ff6c47e
f2d05d19
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
974 additions
and
824 deletions
+974
-824
src/components/table-um.vue
src/components/table-um.vue
+92
-62
src/pages/fwgl.vue
src/pages/fwgl.vue
+10
-55
src/pages/fwglList.vue
src/pages/fwglList.vue
+319
-158
src/store/index.js
src/store/index.js
+10
-7
static/data.json
static/data.json
+543
-542
No files found.
src/components/table-um.vue
View file @
7a738e81
...
...
@@ -24,7 +24,8 @@
type=
"primary"
@
click=
"addRow()"
class=
"ces_toolbar_btn"
>
新增
</el-button>
>
新增
</el-button
>
<el-input
prefix-icon=
"el-icon-search"
v-if=
"searchShow"
...
...
@@ -95,9 +96,19 @@
:header-cell-class-name="headerCellClassName"
v-cloak
>
<el-table-column
v-if=
"isSelection"
type=
"selection"
align=
"center"
></el-table-column>
<el-table-column
v-if=
"isSelection"
type=
"selection"
align=
"center"
></el-table-column>
<!-- 序号 -->
<el-table-column
v-if=
"isIndex"
type=
"index"
:label=
"indexLabel"
width=
"80"
align=
"center"
></el-table-column>
<el-table-column
v-if=
"isIndex"
type=
"index"
:label=
"indexLabel"
width=
"80"
align=
"center"
></el-table-column>
<!-- 数据栏 -->
<el-table-column
...
...
@@ -114,28 +125,45 @@
<!-- 操作按钮 -->
<span
v-if=
"item.type === 'Button'"
>
<b
v-for=
"(btn, key) in item.btnList"
:key=
"key"
>
<em
class=
"action"
v-if=
"btn.label == '分配'||btn.label == '已分配'"
>
<em
v-if=
"btn.label == '分配'&&scope.row.state == 0"
style=
"color: #0f2683"
@
click=
"handleClick(btn.type, scope.row)"
>
{{
btn
.
label
}}
</em>
<em
v-if=
"btn.label == '已分配'&&scope.row.state == 1"
>
{{
btn
.
label
}}
</em>
<em
v-if=
"btn.label == '分配'"
>
<em
v-if=
"btn.label == '分配' && scope.row.state == 0"
class=
"cur_pointer"
style=
"color: #0f2683"
@
click=
"handleClick(btn.type, scope.row)"
>
分配
</em>
<em
v-if=
"btn.label == '分配' && scope.row.state == 1"
>
已分配
</em>
</em>
<em
class=
"
action
"
v-else-if=
"btn.label == '删除'
&&
btn.local"
class=
"
cur_pointer
"
v-else-if=
"btn.label == '删除'
&&
btn.local"
:class=
"btn.type"
:style=
"
{color: btn.label=='删除' ? '#830f53' : '#0f2683'}"
:style=
"
{
color: btn.label == '删除' ? '#830f53' : '#0f2683',
}"
@click="deleteLocal(scope)"
>
{{
btn
.
label
}}
</em>
>
{{
btn
.
label
}}
</em
>
<em
class=
"
action
"
class=
"
cur_pointer
"
v-else
:class=
"btn.type"
:style=
"
{color: btn.label=='删除' ? '#830f53' : '#0f2683'}"
:style=
"
{
color: btn.label == '删除' ? '#830f53' : '#0f2683',
}"
@click="handleClick(btn.type, scope.row)"
>
{{
btn
.
label
}}
</em>
<em
v-if=
"btn.line"
style=
"padding:0 20px;color:#edf0ff"
>
{{
btn
.
line
}}
</em>
>
{{
btn
.
label
}}
</em
>
<em
v-if=
"btn.line"
style=
"padding:0 20px;color:#edf0ff"
>
{{
btn
.
line
}}
</em>
</b>
</span>
<!--href 链接-->
...
...
@@ -171,7 +199,9 @@
trigger=
"hover"
:content=
"scope.row[item.prop]"
>
<div
slot=
"reference"
class=
"overlit"
>
{{
scope
.
row
[
item
.
prop
]
}}
</div>
<div
slot=
"reference"
class=
"overlit"
>
{{
scope
.
row
[
item
.
prop
]
}}
</div>
</el-popover>
<!-- others -->
<span
v-else
>
{{
scope
.
row
[
item
.
prop
]
}}
</span>
...
...
@@ -210,7 +240,7 @@
:disabled=
"pagination.page == 1"
></el-button>
第{{ pagination.page }}页 / 共{{
Math.ceil(pagination.total / pagination.rowsPerPage)
Math.ceil(pagination.total / pagination.rowsPerPage)
}}页
<el-button
icon=
"el-icon-arrow-right"
...
...
@@ -218,9 +248,9 @@
size=
"mini"
@
click=
"handleCurrentChange(1)"
:disabled=
"
pagination.page >=
Math.ceil(pagination.total / pagination.rowsPerPage)
"
pagination.page >=
Math.ceil(pagination.total / pagination.rowsPerPage)
"
></el-button>
</div>
</div>
...
...
@@ -240,7 +270,7 @@ export default {
"
v-apaas-table-input
"
:
tableInput
,
"
v-apaas-table-select
"
:
tableSelect
,
"
v-apaas-table-umhref
"
:
tableUmhref
,
"
d-confirm
"
:
DConfirm
"
d-confirm
"
:
DConfirm
,
},
props
:
{
// 表格型号:mini,medium,small
...
...
@@ -265,78 +295,78 @@ export default {
// },
searchShow
:
{
type
:
Boolean
,
default
:
false
default
:
false
,
},
url
:
{
type
:
String
,
default
:
""
default
:
""
,
},
detailsUrl
:
{
type
:
String
,
default
:
""
default
:
""
,
},
rowprop
:
{
type
:
String
,
default
:
""
default
:
""
,
},
ready
:
{
type
:
Boolean
,
default
:
false
default
:
false
,
},
addRowBtn
:
{
type
:
Boolean
,
default
:
false
default
:
false
,
},
couldNotEdit
:
{
type
:
Boolean
,
default
:
false
default
:
false
,
},
refreshInit
:
{
type
:
Boolean
},
sortBy
:
{
type
:
String
,
default
:
""
default
:
""
,
},
searchNoName
:
{
type
:
Boolean
,
default
:
false
},
emptyText
:
{
type
:
String
,
default
:
"
暂无数据
"
default
:
"
暂无数据
"
,
},
autoAdd
:
{
type
:
Boolean
,
default
:
false
default
:
false
,
},
border
:
{
type
:
Boolean
,
default
:
false
default
:
false
,
},
stripe
:
{
type
:
Boolean
,
default
:
false
default
:
false
,
},
radius
:
{
type
:
Boolean
,
default
:
false
default
:
false
,
},
pageSizeShow
:
{
type
:
Boolean
,
default
:
false
default
:
false
,
},
paginationShow
:
{
type
:
Boolean
,
default
:
false
default
:
false
,
},
headerCellClassName
:
{
type
:
String
,
default
:
""
default
:
""
,
},
filterList
:
{
type
:
Array
,
default
:
null
default
:
null
,
},
showHeader
:
{
type
:
Boolean
,
default
:
true
}
default
:
true
,
}
,
},
data
()
{
return
{
...
...
@@ -344,7 +374,7 @@ export default {
pagination
:
{
rowsPerPage
:
10
,
page
:
1
,
total
:
0
total
:
0
,
},
delSelect
:
null
,
helper
:
helper
,
...
...
@@ -353,23 +383,23 @@ export default {
pageOptions
:
[
{
value
:
"
10
"
,
label
:
"
10
"
label
:
"
10
"
,
},
{
value
:
"
20
"
,
label
:
"
20
"
label
:
"
20
"
,
},
{
value
:
"
50
"
,
label
:
"
50
"
}
label
:
"
50
"
,
}
,
],
search
:
""
,
times
:
null
,
showFliterList
:
false
,
filterData
:
null
,
// 筛选条件
filterToggle
:
null
,
// 控制筛选条件的展开和收起
filterLength
:
0
// 每行最多可容纳多少个过滤条件
filterLength
:
0
,
// 每行最多可容纳多少个过滤条件
};
},
mounted
()
{
...
...
@@ -387,25 +417,25 @@ export default {
if
(
val
)
{
this
.
getDataFromApiSync
();
}
}
}
,
},
url
:
{
handler
(
val
)
{
this
.
getDataFromApiSync
();
},
deep
:
true
deep
:
true
,
},
filterList
:
{
handler
(
val
)
{
this
.
initFilterData
();
},
deep
:
true
}
deep
:
true
,
}
,
},
methods
:
{
//本地删除
deleteLocal
(
val
){
this
.
selectedTabsPage
.
splice
(
val
.
$index
,
1
)
deleteLocal
(
val
)
{
this
.
selectedTabsPage
.
splice
(
val
.
$index
,
1
)
;
},
// get data
getDataFromApiSync
()
{
...
...
@@ -420,14 +450,14 @@ export default {
}
}
else
{
this
.
getDataFromApi
().
then
(
data
=>
{
(
data
)
=>
{
this
.
selectedTabsPage
=
JSON
.
parse
(
JSON
.
stringify
(
data
.
newArr
));
this
.
pagination
.
total
=
data
.
total
;
if
(
this
.
autoAdd
)
{
this
.
addRow
();
}
},
err
=>
{
(
err
)
=>
{
console
.
log
(
"
失败
"
+
err
);
}
);
...
...
@@ -440,7 +470,7 @@ export default {
this
.
all_url
=
`/static/data.json`
;
this
.
$http
.
get
(
this
.
all_url
)
.
then
(
response
=>
{
.
then
(
(
response
)
=>
{
let
newArr
=
response
.
data
.
data
[
this
.
url
];
// if it is true url, total is response's total
let
total
=
newArr
.
length
;
...
...
@@ -485,7 +515,7 @@ export default {
this
.
$message
({
showClose
:
true
,
message
:
this
.
label
+
"
成功
"
,
type
:
"
success
"
type
:
"
success
"
,
});
},
switchChange
(
val
)
{
...
...
@@ -557,7 +587,7 @@ export default {
if
(
this
.
filterList
&&
this
.
filterList
.
length
)
{
this
.
filterData
=
{};
this
.
filterToggle
=
{};
this
.
filterList
.
forEach
(
item
=>
{
this
.
filterList
.
forEach
(
(
item
)
=>
{
this
.
$set
(
this
.
filterData
,
item
.
prop
,
[]);
this
.
$set
(
this
.
filterToggle
,
item
.
prop
,
false
);
});
...
...
@@ -570,8 +600,8 @@ export default {
this
.
filterData
[
prop
].
push
(
filter
);
}
console
.
log
(
this
.
filterData
);
}
}
}
,
}
,
};
</
script
>
...
...
@@ -621,7 +651,7 @@ em {
font-style
:
normal
;
user-select
:
none
;
}
em
.action
{
.cur_pointer
{
cursor
:
pointer
;
}
.ces-table
.el-table--mini
td
,
...
...
src/pages/fwgl.vue
View file @
7a738e81
...
...
@@ -14,6 +14,7 @@
<
script
>
import
sideNavBar
from
"
@/components/side-nav-bar
"
;
import
{
mapState
}
from
"
vuex
"
;
export
default
{
components
:
{
...
...
@@ -22,6 +23,11 @@ export default {
data
:
()
=>
({
navList
:
[],
}),
computed
:
{
...
mapState
({
fwglNav
:
"
fwglNav
"
,
}),
},
watch
:
{
"
$route.fullPath
"
(
path
)
{
this
.
initNavList
();
...
...
@@ -31,61 +37,10 @@ export default {
initNavList
()
{
let
level
=
parseInt
(
this
.
$route
.
params
.
level
);
// 普通用户
if
(
level
==
0
)
{
this
.
navList
=
[
{
name
:
"
注册发布的服务
"
,
path
:
`/fwgl/list/
${
level
}
/0`
,
},
{
name
:
"
申请的服务
"
,
path
:
`/fwgl/list/
${
level
}
/1`
,
},
{
name
:
"
审批的服务
"
,
path
:
`/fwgl/list/
${
level
}
/2`
,
},
{
name
:
"
云资源服务
"
,
path
:
`/fwgl/list/
${
level
}
/3`
,
},
];
}
// 组织管理员
else
if
(
level
==
1
)
{
this
.
navList
=
[
{
name
:
"
组织服务管理
"
,
path
:
`/fwgl/list/
${
level
}
/0`
,
},
{
name
:
"
服务审批管理
"
,
path
:
`/fwgl/list/
${
level
}
/1`
,
},
{
name
:
"
云资源管理
"
,
path
:
`/fwgl/list/
${
level
}
/2`
,
},
];
}
// 超级管理员
else
if
(
level
==
2
)
{
this
.
navList
=
[
{
name
:
"
平台服务管理
"
,
path
:
`/fwgl/list/
${
level
}
/0`
,
},
{
name
:
"
服务审批管理
"
,
path
:
`/fwgl/list/
${
level
}
/1`
,
},
{
name
:
"
云资源管理
"
,
path
:
`/fwgl/list/
${
level
}
/2`
,
},
];
}
this
.
navList
=
this
.
fwglNav
[
level
].
map
((
item
,
index
)
=>
({
name
:
item
,
path
:
`/fwgl/list/
${
level
}
/
${
index
}
`
,
}));
},
},
mounted
()
{
...
...
src/pages/fwglList.vue
View file @
7a738e81
This diff is collapsed.
Click to expand it.
src/store/index.js
View file @
7a738e81
import
Vuex
from
'
vuex
'
import
Vue
from
'
vue
'
import
Vuex
from
"
vuex
"
;
import
Vue
from
"
vue
"
;
Vue
.
use
(
Vuex
);
const
store
=
new
Vuex
.
Store
({
state
:
{
role
:
1
,
//
0:普通用户,1:组织管理员,2:超级管理员
role
:
1
,
//
0:普通用户,1:组织管理员,2:超级管理员
serviceShopMenu
:
"
shopDataList
"
,
// 服务超市侧边栏
fwglNav
:
[
[
"
注册发布的服务
"
,
"
申请的服务
"
,
"
审批的服务
"
,
"
云资源服务
"
],
//普通用户
[
"
组织服务管理
"
,
"
服务审批管理
"
,
"
云资源管理
"
],
//组织管理员
[
"
平台服务管理
"
,
"
服务审批管理
"
,
"
云资源管理
"
],
//超级管理员
],
// 服务管理列表,onlyRead
},
modules
:
{
},
modules
:
{},
mutations
:
{
rolefun
(
state
,
newValue
)
{
state
.
role
=
newValue
;
...
...
@@ -20,4 +23,4 @@ const store = new Vuex.Store({
},
});
export
default
store
\ No newline at end of file
export
default
store
;
static/data.json
View file @
7a738e81
This diff is collapsed.
Click to expand it.
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