Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
saas-manage
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chehuidong
saas-manage
Commits
d8499088
Commit
d8499088
authored
Aug 20, 2024
by
wq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8.20
parent
7db8bd4e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
449 additions
and
366 deletions
+449
-366
src/common/api/sys/index.js
+5
-3
src/views/menu.vue
+153
-227
src/views/system/app.vue
+291
-136
No files found.
src/common/api/sys/index.js
View file @
d8499088
...
...
@@ -2,14 +2,16 @@ import axios from '../axios'
export
function
updateSysmenu
({
id
,
enable
,
type
})
{
return
axios
.
post
(
'/sysMenu/update'
,
null
,
{
params
:
{
id
,
enable
,
type
}
,
params
:
{
id
,
enable
,
type
}
})
}
export
function
getAllMenusTree
()
{
return
axios
.
get
(
'sysSaasMenu/getAllMenusTree'
)
}
export
function
getApplication
()
{
return
axios
.
get
(
'businessAppInfo/getAppInfo'
)
}
export
function
addMenu
(
data
)
{
return
axios
.
post
(
'sysSaasMenu/add'
,
data
)
}
...
...
@@ -24,6 +26,6 @@ export function deleteMenu(id) {
export
function
getSimpleByPage
()
{
return
axios
.
post
(
'sys/domain/getSimpleByPage'
,
{
currentPage
:
1
,
pageSize
:
100
,
pageSize
:
100
})
}
src/views/menu.vue
View file @
d8499088
<
template
>
<div
class=
'system-menu card'
>
<div
class=
'header'
>
<el-form
size=
'mini'
:inline=
'true'
label-width=
'80px'
>
<div
class=
"system-menu card"
>
<div
class=
"header"
>
<el-form
size=
"mini"
:inline=
"true"
label-width=
"80px"
>
<el-form-item
label
>
<el-button
type=
'primary'
@
click=
'showDialog(
{ id: 0 }, 2)'
>
<el-button
type=
"primary"
@
click=
"showDialog(
{ id: 0 }, 2)">
新增
</el-button>
</el-form-item>
</el-form>
</div>
<div
class=
'table-wrap'
v-loading=
'loading'
>
<div
class=
"table-wrap"
v-loading=
"loading"
>
<table-view
:tableColumns=
'tableColumns'
rowKey=
'id'
:serialNumber=
'false'
:tableColumns=
"tableColumns"
rowKey=
"id"
:serialNumber=
"false"
:treeConfig=
"
{
children: 'children',
reserve: true
,
reserve: true
}"
:sourceData='sourceData'
>
</table-view>
:sourceData="sourceData">
</table-view>
</div>
<el-dialog
:title=
"isEdit ? '修改' : '新增'"
:visible
.
sync=
'dialogVisible'
:close-on-click-modal=
'false'
:before-close=
'beforeClose'
width=
'820px'
>
:visible
.
sync=
"dialogVisible"
:close-on-click-modal=
"false"
:before-close=
"beforeClose"
width=
"820px"
>
<el-form
size=
'mini'
:inline=
'true'
label-width=
'120px'
:rules=
'rules'
ref=
'editForm'
:model=
'editForm'
>
<el-form-item
label=
'菜单名称'
prop=
'name'
required
>
<el-input
style=
'width: 220px'
v-model=
'editForm.name'
></el-input>
size=
"mini"
:inline=
"true"
label-width=
"120px"
:rules=
"rules"
ref=
"editForm"
:model=
"editForm"
>
<el-form-item
label=
"菜单名称"
prop=
"name"
required
>
<el-input
style=
"width: 220px"
v-model=
"editForm.name"
></el-input>
</el-form-item>
<el-form-item
label=
'父级菜单'
>
<el-form-item
label=
"父级菜单"
>
<el-cascader
:show-all-levels=
'false'
v-model=
'editForm.pid'
:disabled=
'editForm.type === 1'
style=
'width: 220px'
:options=
'showMenu'
:show-all-levels=
"false"
v-model=
"editForm.pid"
:disabled=
"editForm.type === 1"
style=
"width: 220px"
:options=
"showMenu"
:props=
"
{
checkStrictly: true,
label: 'name',
value: 'id',
emitPath: false
,
emitPath: false
}"
clearable
>
</el-cascader>
clearable>
</el-cascader>
</el-form-item>
<el-form-item
label=
'类型'
prop=
'type'
required
>
<div
style=
'width: 220px; display: inline-block'
class=
'radioGroup'
>
<el-radio
v-model=
'editForm.type'
:label=
'0'
>
菜单
</el-radio
>
<el-radio
v-model=
'editForm.type'
:label=
'1'
>
按钮
</el-radio
>
<el-radio
v-model=
'editForm.type'
:label=
'2'
>
左边栏
</el-radio
>
<el-form-item
label=
"类型"
prop=
"type"
required
>
<div
style=
"width: 220px; display: inline-block"
class=
"radioGroup"
>
<el-radio
v-model=
"editForm.type"
:label=
"0"
>
菜单
</el-radio>
<el-radio
v-model=
"editForm.type"
:label=
"1"
>
按钮
</el-radio>
<el-radio
v-model=
"editForm.type"
:label=
"2"
>
左边栏
</el-radio>
</div>
<!--
<el-select-->
<!-- style="width: 220px"-->
...
...
@@ -102,118 +73,89 @@
<!--
</el-select>
-->
</el-form-item>
<el-form-item
label=
'路径名称'
:required=
'editForm.pid !== 0'
prop=
'path'
>
label=
"路径名称"
:required=
"editForm.pid !== 0"
prop=
"path"
>
<el-input
style=
'width: 220px'
:disabled=
'isEdit'
v-model=
'editForm.path'
></el-input>
style=
"width: 220px"
:disabled=
"isEdit"
v-model=
"editForm.path"
></el-input>
</el-form-item>
<el-form-item
label=
'路径地址'
>
<el-input
style=
'width: 220px'
v-model=
'editForm.route'
></el-input>
<el-form-item
label=
"路径地址"
>
<el-input
style=
"width: 220px"
v-model=
"editForm.route"
></el-input>
</el-form-item>
<el-form-item
label=
'接口路径'
>
<el-input
style=
'width: 220px'
v-model=
'editForm.url'
></el-input>
<el-form-item
label=
"接口路径"
>
<el-input
style=
"width: 220px"
v-model=
"editForm.url"
></el-input>
</el-form-item>
<el-form-item
label=
'等级'
prop=
'level'
>
<el-input
style=
'width: 220px'
v-model=
'editForm.level'
/>
<el-form-item
label=
"等级"
prop=
"level"
>
<el-input
style=
"width: 220px"
v-model=
"editForm.level"
/>
</el-form-item>
<el-form-item
label=
'启用状态'
>
<div
style=
'width: 220px; display: inline-block'
>
<el-radio
v-model=
'editForm.enable'
:label=
'true'
>
启用
</el-radio
>
<el-radio
v-model=
'editForm.enable'
:label=
'false'
>
禁用
</el-radio
>
<el-form-item
label=
"启用状态"
>
<div
style=
"width: 220px; display: inline-block"
>
<el-radio
v-model=
"editForm.enable"
:label=
"true"
>
启用
</el-radio>
<el-radio
v-model=
"editForm.enable"
:label=
"false"
>
禁用
</el-radio>
</div>
</el-form-item>
<el-form-item
label=
' 排序'
>
<el-form-item
label=
" 排序"
>
<el-input
style=
'width: 220px'
v-model=
'editForm.sortNo'
placeholder
></el-input>
style=
"width: 220px"
v-model=
"editForm.sortNo"
placeholder
></el-input>
</el-form-item>
<el-form-item
label=
'标题'
>
<el-input
style=
'width: 220px'
v-model=
'editForm.title'
></el-input>
<el-form-item
label=
"标题"
>
<el-input
style=
"width: 220px"
v-model=
"editForm.title"
></el-input>
</el-form-item>
<el-form-item
label=
'备注'
>
<el-input
style=
'width: 220px'
v-model=
'editForm.describe'
></el-input>
<el-form-item
label=
"备注"
>
<el-input
style=
"width: 220px"
v-model=
"editForm.describe"
></el-input>
</el-form-item>
<el-form-item
label=
'包含的namespace'
>
<el-form-item
label=
"应用名称"
>
<el-select
v-model=
'editForm.includeNamespace'
v-model=
"editForm.appId"
style=
"width: 400px"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"(item, index) in applicationList"
:key=
"index"
filterable
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"包含的namespace"
>
<el-select
v-model=
"editForm.includeNamespace"
multiple
style=
'width: 400px'
style=
"width: 400px"
clearable
placeholder=
'请选择'
>
placeholder=
"请选择"
>
<el-option
v-for=
'(item, index) in simpleList'
:key=
'index'
v-for=
"(item, index) in simpleList"
:key=
"index"
filterable
:label=
'item.companyName'
:value=
'item.apiName'
>
</el-option>
:label=
"item.companyName"
:value=
"item.apiName"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
'排除的namespace'
>
<el-form-item
label=
"排除的namespace"
>
<el-select
v-model=
'editForm.excludeNamespace'
v-model=
"editForm.excludeNamespace"
multiple
style=
'width: 400px'
style=
"width: 400px"
clearable
filterable
placeholder=
'请选择'
>
placeholder=
"请选择"
>
<el-option
v-for=
'(item, index) in simpleList'
:key=
'index'
:label=
'item.companyName'
:value=
'item.apiName'
>
</el-option>
v-for=
"(item, index) in simpleList"
:key=
"index"
:label=
"item.companyName"
:value=
"item.apiName"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div
slot=
'footer'
>
<el-button
size=
'small'
@
click=
'clone'
>
取 消
</el-button
>
<el-button
size=
'small'
type=
'primary'
@
click=
'submit'
>
保 存
</el-button
>
<div
slot=
"footer"
>
<el-button
size=
"small"
@
click=
"clone"
>
取 消
</el-button>
<el-button
size=
"small"
type=
"primary"
@
click=
"submit"
>
保 存
</el-button>
</div>
</el-dialog>
</div>
...
...
@@ -228,16 +170,18 @@ import {
addMenu
,
deleteMenu
,
getSimpleByPage
,
getApplication
}
from
'../common/api/sys'
export
default
{
name
:
'saasMenu'
,
components
:
{
tableView
,
tableView
// myLayout,
},
data
()
{
return
{
applicationList
:
[],
loading
:
false
,
sourceData
:
[],
dialogVisible
:
false
,
...
...
@@ -252,18 +196,19 @@ export default {
enable
:
true
,
includeNamespace
:
''
,
excludeNamespace
:
''
,
appId
:
''
},
rules
:
{
type
:
[
{
required
:
true
,
message
:
' '
,
trigger
:
'change'
,
}
,
]
,
trigger
:
'change'
}
]
},
isEdit
:
false
,
simpleList
:
[]
,
simpleList
:
[]
}
},
computed
:
{
...
...
@@ -274,101 +219,91 @@ export default {
key
:
'name'
,
width
:
''
,
align
:
'left'
,
treeNode
:
true
,
treeNode
:
true
},
{
label
:
'类型'
,
key
:
'type'
,
width
:
''
,
render
:
item
=>
item
.
type
===
0
?
'菜单'
:
item
.
type
===
1
?
'按钮'
:
'左边栏'
,
render
:
(
item
)
=>
item
.
type
===
0
?
'菜单'
:
item
.
type
===
1
?
'按钮'
:
'左边栏'
},
{
label
:
'路径名称'
,
key
:
'path'
,
width
:
''
,
width
:
''
},
{
label
:
'路径地址'
,
key
:
'route'
,
width
:
''
,
width
:
''
},
{
label
:
'接口路径'
,
key
:
'url'
,
width
:
''
,
width
:
''
},
{
label
:
'排序'
,
key
:
'sortNo'
,
width
:
''
,
width
:
''
},
{
label
:
'启动状态'
,
key
:
'url'
,
width
:
''
,
render
:
item
=>
(
render
:
(
item
)
=>
(
<
el
-
checkbox
value
=
{
item
.
enable
}
onChange
=
{
v
=>
this
.
enableChange
(
item
,
v
)}
label
=
''
><
/el-checkbox
>
),
onChange
=
{(
v
)
=>
this
.
enableChange
(
item
,
v
)}
label
=
""
><
/el-checkbox
>
)
},
{
label
:
'标题'
,
key
:
'title'
,
width
:
''
,
width
:
''
},
{
label
:
'备注'
,
key
:
'describe'
,
width
:
''
,
width
:
''
},
{
label
:
'操作'
,
key
:
''
,
width
:
''
,
align
:
'left'
,
render
:
item
=>
(
render
:
(
item
)
=>
(
<
div
>
<
el
-
button
size
=
'mini'
type
=
'text'
onClick
=
{()
=>
this
.
showDialog
(
item
,
1
)}
>
size
=
"mini"
type
=
"text"
onClick
=
{()
=>
this
.
showDialog
(
item
,
1
)}
>
修改
<
/el-button
>
<
el
-
button
size
=
'mini'
type
=
'text'
onClick
=
{()
=>
this
.
remove
(
item
)}
>
size
=
"mini"
type
=
"text"
onClick
=
{()
=>
this
.
remove
(
item
)}
>
删除
<
/el-button
>
{
item
.
type
!==
1
&&
(
<
el
-
button
size
=
'mini'
type
=
'text'
onClick
=
{()
=>
this
.
showDialog
(
item
,
2
)}
>
size
=
"mini"
type
=
"text"
onClick
=
{()
=>
this
.
showDialog
(
item
,
2
)}
>
新增下级
<
/el-button
>
)}
<
/div
>
)
,
}
,
)
}
]
},
showMenu
()
{
const
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
sourceData
),
)
const
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
sourceData
))
const
arr
=
[]
for
(
const
iterator
of
data
)
{
const
children
=
[]
...
...
@@ -394,10 +329,10 @@ export default {
sortNo
:
0
,
title
:
''
,
type
:
0
,
url
:
''
,
}
,
url
:
''
}
]
}
,
}
},
mounted
()
{
this
.
getlist
()
...
...
@@ -405,7 +340,7 @@ export default {
},
methods
:
{
getSimpleByPage
()
{
getSimpleByPage
().
then
(
res
=>
{
getSimpleByPage
().
then
(
(
res
)
=>
{
if
(
res
.
code
===
200
)
{
this
.
simpleList
=
res
.
data
.
records
}
...
...
@@ -416,7 +351,7 @@ export default {
const
res
=
await
updateSysmenu
({
id
:
item
.
id
,
enable
:
v
,
type
:
item
.
type
,
type
:
item
.
type
})
if
(
res
.
code
===
200
)
{
this
.
$message
.
success
(
res
.
message
)
...
...
@@ -449,38 +384,32 @@ export default {
this
.
editForm
[
key
]
=
''
}
},
showDialog
(
item
,
t
)
{
async
showDialog
(
item
,
t
)
{
if
(
t
===
2
)
{
this
.
editForm
.
pid
=
item
.
id
this
.
isEdit
=
false
}
else
{
this
.
isEdit
=
true
if
(
item
.
excludeNamespace
&&
item
.
excludeNamespace
.
length
>
0
)
{
item
.
excludeNamespace
=
item
.
excludeNamespace
.
split
(
','
,
)
if
(
item
.
excludeNamespace
&&
item
.
excludeNamespace
.
length
>
0
)
{
item
.
excludeNamespace
=
item
.
excludeNamespace
.
split
(
','
)
}
if
(
item
.
includeNamespace
&&
item
.
includeNamespace
.
length
>
0
)
{
item
.
includeNamespace
=
item
.
includeNamespace
.
split
(
','
,
)
if
(
item
.
includeNamespace
&&
item
.
includeNamespace
.
length
>
0
)
{
item
.
includeNamespace
=
item
.
includeNamespace
.
split
(
','
)
}
this
.
editForm
=
{
...
item
,
enable
:
true
,
enable
:
true
}
}
this
.
$nextTick
(()
=>
{
this
.
$refs
.
editForm
&&
this
.
$refs
.
editForm
.
clearValidate
()
getApplication
().
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
this
.
applicationList
=
res
.
data
||
[]
this
.
$nextTick
(()
=>
{
this
.
$refs
.
editForm
&&
this
.
$refs
.
editForm
.
clearValidate
()
})
this
.
dialogVisible
=
true
}
})
this
.
dialogVisible
=
true
},
async
submit
()
{
try
{
...
...
@@ -495,9 +424,8 @@ export default {
this
.
editForm
.
includeNamespace
&&
this
.
editForm
.
includeNamespace
.
length
>
0
)
{
this
.
editForm
.
includeNamespace
=
this
.
editForm
.
includeNamespace
.
join
(
','
,
)
this
.
editForm
.
includeNamespace
=
this
.
editForm
.
includeNamespace
.
join
(
','
)
}
else
{
this
.
editForm
.
includeNamespace
=
''
}
...
...
@@ -505,9 +433,8 @@ export default {
this
.
editForm
.
excludeNamespace
&&
this
.
editForm
.
excludeNamespace
.
length
>
0
)
{
this
.
editForm
.
excludeNamespace
=
this
.
editForm
.
excludeNamespace
.
join
(
','
,
)
this
.
editForm
.
excludeNamespace
=
this
.
editForm
.
excludeNamespace
.
join
(
','
)
}
else
{
this
.
editForm
.
excludeNamespace
=
''
}
...
...
@@ -528,7 +455,7 @@ export default {
await
this
.
$confirm
(
'确认删除?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
type
:
'warning'
})
}
catch
{
return
...
...
@@ -550,11 +477,11 @@ export default {
beforeClose
(
clone
)
{
this
.
resetForm
()
clone
()
}
,
}
,
}
}
}
</
script
>
<
style
lang=
'scss'
scoped
>
<
style
lang=
"scss"
scoped
>
.system-menu
{
height
:
100%
;
display
:
flex
;
...
...
@@ -572,5 +499,4 @@ export default {
margin-right
:
15px
!important
;
}
}
</
style
>
src/views/system/app.vue
View file @
d8499088
<
template
>
<layout
class=
"row"
:leftStyle=
"
{ width: '330px' }">
<template
#
page_left
>
<el-tree
:data=
"folders"
ref=
"tree"
:props=
"
{ children: 'children', label: 'categoryName' }" highlight-current
:node-key="'id'" default-expand-all :expand-on-click-node="false" @node-click="handleNodeClick">
<el-tree
:data=
"typeList"
ref=
"tree"
:props=
"
{ children: 'children', label: 'categoryName' }"
highlight-current
:node-key="'id'"
default-expand-all
:expand-on-click-node="false"
@node-click="handleNodeClick">
<div
class=
"customize-tree-node"
slot-scope=
"
{ node, data }">
<div
@
click
.
stop=
"toggleNodeExpanded(node)"
class=
"custom-tree-node-arrow"
<div
@
click
.
stop=
"toggleNodeExpanded(node)"
class=
"custom-tree-node-arrow"
:style=
"
{ transform: node.expanded ? 'rotate(90deg)' : '' }"
v-if="data.children
&&
data.children.length > 0">
<!--
<icon
:name=
"node.expanded ? 'xe61e' : 'xe659'"
></icon>
-->
<i
:class=
"node.expanded ? 'iconfont icon-shouqi' : 'iconfont icon-tongyong-biaogezhankaitubiao'"
></i>
<i
:class=
"
node.expanded
? 'iconfont icon-shouqi'
: 'iconfont icon-tongyong-biaogezhankaitubiao'
"
></i>
</div>
<div
class=
"customize-tree-node__label"
>
<span>
{{
data
.
categoryName
}}
</span>
</div>
<div
class=
"customize-tree-node__operate"
>
<i
title=
"新增分类"
class=
"el-icon-circle-plus"
style=
"color: rgb(140 195 75); margin-right: 5px"
<i
title=
"新增分类"
class=
"el-icon-circle-plus"
style=
"color: rgb(140 195 75); margin-right: 5px"
@
click=
"addFolder(data)"
></i>
<i
title=
"修改分类"
class=
"el-icon-edit-outline"
style=
"color: #ff9800; margin-right: 5px"
<i
title=
"修改分类"
class=
"el-icon-edit-outline"
style=
"color: #ff9800; margin-right: 5px"
@
click=
"editFolder(data)"
></i>
<i
title=
"删除分类"
class=
"el-icon-remove-outline"
style=
"color: red"
@
click=
"removeFolder(data)"
></i>
<i
title=
"删除分类"
class=
"el-icon-remove-outline"
style=
"color: red"
@
click=
"removeFolder(data)"
></i>
</div>
</div>
</el-tree>
</
template
>
<
template
#
page_right
>
<el-form
ref=
"form"
:model=
"searchForm"
size=
"mini"
v-enter-submit=
"search"
@
submit
.
native
.
prevent
:inline=
"true"
>
<el-form
ref=
"form"
:model=
"searchForm"
size=
"mini"
v-enter-submit=
"search"
@
submit
.
native
.
prevent
:inline=
"true"
>
<el-form-item
label=
"创建时间"
>
<choose-time-period
v-model=
"period"
></choose-time-period>
</el-form-item>
<el-form-item
label=
"应用名称"
>
<el-input
style=
"width: 120px"
clearable
v-model=
"searchForm.name"
placeholder=
"应用名称"
></el-input>
<el-input
style=
"width: 120px"
clearable
v-model=
"searchForm.name"
placeholder=
"应用名称"
></el-input>
</el-form-item>
<el-form-item
label=
"应用类型"
>
<el-select
v-model=
"searchForm.type"
placeholder=
"请选择"
clearable
filterable
>
<el-option
v-for=
"item in applicationTypeData"
:key=
"item.id"
:label=
"item.value"
<el-select
v-model=
"searchForm.type"
placeholder=
"请选择"
clearable
filterable
>
<el-option
v-for=
"item in applicationTypeData"
:key=
"item.id"
:label=
"item.value"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label
>
<el-button
type=
"primary"
native-type=
"submit"
@
click=
"search()"
icon=
"el-icon-search"
>
<el-button
type=
"primary"
native-type=
"submit"
@
click=
"search()"
icon=
"el-icon-search"
>
查询
</el-button>
</el-form-item>
<el-form-item
label
>
<el-button
type=
"success"
@
click=
"addInfo()"
icon=
"el-icon-plus"
>
新增
<el-button
type=
"success"
@
click=
"addInfo()"
icon=
"el-icon-plus"
>
新增
</el-button>
</el-form-item>
<el-form-item
label
>
<el-button
type=
"danger"
@
click=
"deleteSection()"
icon=
"el-icon-delete"
>
批量删除
<el-button
type=
"danger"
@
click=
"deleteSection()"
icon=
"el-icon-delete"
>
批量删除
</el-button>
</el-form-item>
</el-form>
<div
class=
"table_wrap"
style=
"min-height: 50%; max-height: 80%; padding: 0"
>
<table-view
:sourceData=
"sourceData"
:serialNumber=
"true"
:tableColumns=
"tableColumns"
ref=
'multipleTable'
@
selectionChange=
'selectionChange'
:selection=
'true'
></table-view>
<div
class=
"table_wrap"
style=
"min-height: 50%; max-height: 82%; padding: 0"
>
<table-view
:sourceData=
"sourceData"
:serialNumber=
"true"
:tableColumns=
"tableColumns"
ref=
"multipleTable"
@
selectionChange=
"selectionChange"
:selection=
"true"
></table-view>
</div>
<div
slot=
"footer"
style=
"display:
flex;justify-content: center;
"
>
<div
slot=
"footer"
style=
"display:
flex; justify-content: center
"
>
<!--
<pagination
:setValue=
"setpaginationOptions"
:options=
"paginationOptions"
/>
-->
<el-pagination
layout=
"sizes, total, prev, pager, next, jumper"
background
:total=
"paginationOptions.total"
:page-size=
"paginationOptions.pageSize"
:current-page=
"paginationOptions.currentPage"
@
size-change=
"sizeChange"
@
current-change=
"onCurrentChange"
>
</el-pagination>
<el-pagination
layout=
"sizes, total, prev, pager, next, jumper"
background
:total=
"paginationOptions.total"
:page-size=
"paginationOptions.pageSize"
:current-page=
"paginationOptions.currentPage"
@
size-change=
"sizeChange"
@
current-change=
"onCurrentChange"
></el-pagination>
</div>
</
template
>
<!-- 新增、修改应用 -->
<el-dialog
:title=
"isEdit ? '编辑' : '新增'"
:visible
.
sync=
"editShowing"
width=
"1000px"
:close-on-click-modal=
"false"
>
<el-dialog
:title=
"isEdit ? '编辑' : '新增'"
:visible
.
sync=
"editShowing"
width=
"1000px"
:close-on-click-modal=
"false"
>
<div
class=
"edit-form"
>
<el-form
ref=
"editForm"
:model=
"editForm"
label-width=
"auto"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"24"
>
<el-form-item
label=
"应用图标"
>
<div
class=
"my-flex-1"
>
<upload-images
sortField=
"sort"
businessType=
"other"
uploadApiUrl=
"upload/oss"
:type=
"limitFileType"
:isFloat=
"false"
:width=
"300"
:hasWidth=
"true"
:hasOss=
"true"
:length=
"editFlag ? 1 : 50"
v-model=
"editForm.icon"
@
selectImg=
"selectImg"
>
<upload-images
sortField=
"sort"
businessType=
"other"
uploadApiUrl=
"upload/oss"
:type=
"limitFileType"
:isFloat=
"false"
:width=
"300"
:hasWidth=
"true"
:hasOss=
"true"
:length=
"editFlag ? 1 : 50"
v-model=
"editForm.icon"
@
selectImg=
"selectImg"
>
<!-- <template #other="{ index }">
<div class="other-msg" style="display: flex">
<span class="other-label" style="margin-right: 4px">
...
...
@@ -90,21 +164,38 @@
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"24"
>
<el-form-item
label=
"应用分类"
prop=
"categoryId"
:rules=
"[{ message: '请选择应用分类', required: true }]"
>
<el-cascader
style=
"width: 100%"
v-model=
"editForm.categoryId"
size=
"mini"
:options=
"folders"
clearable
<el-form-item
label=
"应用分类"
prop=
"categoryId"
:rules=
"[{ message: '请选择应用分类', required: true }]"
>
<el-cascader
style=
"width: 100%"
v-model=
"editForm.categoryId"
size=
"mini"
:options=
"typeList"
clearable
:props=
"{
label: 'categoryName',
value: 'id',
emitPath: false,
checkStrictly: true
}"
:show-all-levels=
"false"
></el-cascader>
label: 'categoryName',
value: 'id',
emitPath: false,
checkStrictly: true
}"
:show-all-levels=
"false"
></el-cascader>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"11"
>
<el-form-item
label=
"应用名称"
prop=
"name"
:rules=
"[{ message: '请输入应用名称', required: true }]"
>
<el-input
v-model=
"editForm.name"
placeholder=
"请输入应用名称"
maxlength=
"120"
size=
"mini"
clearable
<el-form-item
label=
"应用名称"
prop=
"name"
:rules=
"[{ message: '请输入应用名称', required: true }]"
>
<el-input
v-model=
"editForm.name"
placeholder=
"请输入应用名称"
maxlength=
"120"
size=
"mini"
clearable
show-word-limit
/>
</el-form-item>
</el-col>
...
...
@@ -118,39 +209,74 @@
</el-col>
</el-row>
<div
v-if=
"editForm.isCollectFee"
>
<el-row
:gutter=
"20"
v-for=
"(item, index) in editForm.salePriceList"
:key=
"index"
>
<el-row
:gutter=
"20"
v-for=
"(item, index) in editForm.salePriceList"
:key=
"index"
>
<el-col
:span=
"11"
>
<el-form-item
label=
"应用价格"
>
<el-input
v-model=
"item.price"
placeholder=
"请输入应用价格"
maxlength=
"120"
size=
"mini"
clearable
<el-input
v-model=
"item.price"
placeholder=
"请输入应用价格"
maxlength=
"120"
size=
"mini"
clearable
show-word-limit
/>
</el-form-item>
</el-col>
<el-col
:span=
"10"
>
<el-form-item
label=
"应用周期"
>
<el-select
v-model=
"item.validDays"
size=
"mini"
filterable
clearable
style=
"width: 100%"
>
<el-option
v-for=
"item in applyCycleList"
:key=
"item.value"
:label=
"item.name"
<el-select
v-model=
"item.validDays"
size=
"mini"
filterable
clearable
style=
"width: 100%"
>
<el-option
v-for=
"item in applyCycleList"
:key=
"item.value"
:label=
"item.name"
:value=
"item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col
style=
"display: flex;margin-top: 8px;"
:span=
"3"
>
<el-button
size=
"mini"
type=
"success"
icon=
"el-icon-plus"
@
click=
"addDomain"
></el-button>
<el-button
style=
"margin-left: 15px"
size=
"mini"
type=
"danger"
icon=
"el-icon-minus"
<el-col
style=
"display: flex; margin-top: 8px"
:span=
"3"
>
<el-button
size=
"mini"
type=
"success"
icon=
"el-icon-plus"
@
click=
"addDomain"
></el-button>
<el-button
style=
"margin-left: 15px"
size=
"mini"
type=
"danger"
icon=
"el-icon-minus"
@
click
.
prevent=
"removeDomain(index)"
></el-button>
</el-col>
</el-row>
</div>
<el-row
:gutter=
"20"
>
<el-col
:span=
"24"
>
<el-form-item
label=
"应用简述"
size=
"small"
prop=
"description"
<el-form-item
label=
"应用简述"
size=
"small"
prop=
"description"
:rules=
"[{ message: '请输入应用简述', required: true }]"
>
<el-input
style=
"width: 100%"
type=
"textarea"
:rows=
"4"
v-model=
"editForm.description"
<el-input
style=
"width: 100%"
type=
"textarea"
:rows=
"4"
v-model=
"editForm.description"
placeholder=
"请输入应用简述"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"24"
>
<el-form-item
label=
"应用详情"
size=
"small"
>
<v-editor
filename=
"files"
style=
"width: 100%"
v-model=
"editForm.details"
ref=
"wangeditor"
<v-editor
filename=
"files"
style=
"width: 100%"
v-model=
"editForm.details"
ref=
"wangeditor"
height=
"300px"
/>
</el-form-item>
</el-col>
...
...
@@ -159,29 +285,61 @@
</div>
<span
slot=
"footer"
>
<el-button
@
click=
"editShowing = false"
size=
"medium"
>
取消
</el-button>
<el-button
@
click=
"saveApplication"
type=
"primary"
size=
"medium"
>
确认
</el-button>
<el-button
@
click=
"saveApplication"
type=
"primary"
size=
"medium"
>
确认
</el-button>
</span>
</el-dialog>
<!-- 暂定 -->
<el-dialog
:visible
.
sync=
"releaseVisible"
:close-on-click-modal=
"false"
title=
"发布"
width=
"600px"
>
<el-checkbox
:indeterminate=
"isIndeterminate"
v-model=
"checkAll"
@
change=
"handleCheckAllChange"
>
全选
<el-dialog
:visible
.
sync=
"releaseVisible"
:close-on-click-modal=
"false"
title=
"发布"
width=
"600px"
>
<el-checkbox
:indeterminate=
"isIndeterminate"
v-model=
"checkAll"
@
change=
"handleCheckAllChange"
>
全选
</el-checkbox>
<div
style=
"margin: 15px 0"
></div>
<el-checkbox-group
v-model=
"checkedCompany"
@
change=
"handleCheckedCompanyChange"
>
<el-checkbox
style=
"width: 100px"
v-for=
"c in releaseList"
:label=
"c.id"
:key=
"c.id"
>
{{ c.apiName }}
<el-checkbox-group
v-model=
"checkedCompany"
@
change=
"handleCheckedCompanyChange"
>
<el-checkbox
style=
"width: 100px"
v-for=
"c in releaseList"
:label=
"c.id"
:key=
"c.id"
>
{{ c.apiName }}
</el-checkbox>
</el-checkbox-group>
<span
slot=
"footer"
>
<el-button
size=
"mini"
@
click=
"releaseVisible = false"
>
取消
</el-button>
<el-button
size=
"mini"
@
click=
"confirmRelease"
type=
"primary"
>
确认
</el-button>
<el-button
size=
"mini"
@
click=
"confirmRelease"
type=
"primary"
>
确认
</el-button>
</span>
</el-dialog>
<!-- 新增、修改分类 -->
<el-dialog
:title=
"editFolderId ? '编辑分类' : '新增分类'"
:visible
.
sync=
"folderVisible"
:close-on-click-modal=
"false"
<el-dialog
:title=
"editFolderId ? '编辑分类' : '新增分类'"
:visible
.
sync=
"folderVisible"
:close-on-click-modal=
"false"
width=
"600px"
>
<el-form
ref=
"folderForm"
:model=
"folderForm"
label-position=
"top"
label-width=
"80px"
>
<el-form-item
label=
"名称"
prop=
"folderName"
:rules=
"[{ required: true, message: '请输入分类名称' }]"
>
<el-input
v-model=
"folderForm.folderName"
clearable
placeholder=
"分类名称"
></el-input>
<el-form
ref=
"folderForm"
:model=
"folderForm"
label-position=
"top"
label-width=
"80px"
>
<el-form-item
label=
"名称"
prop=
"folderName"
:rules=
"[{ required: true, message: '请输入分类名称' }]"
>
<el-input
v-model=
"folderForm.folderName"
clearable
placeholder=
"分类名称"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
>
...
...
@@ -207,7 +365,7 @@ export default {
'v-editor'
:
Editor
,
tableView
,
layout
,
ChooseTimePeriod
,
ChooseTimePeriod
// ImageView
},
mixins
:
[
pagination
],
...
...
@@ -226,10 +384,10 @@ export default {
salePriceList
:
[
{
price
:
''
,
validDays
:
''
,
}
,
validDays
:
''
}
],
isCollectFee
:
true
,
// 是否收费
isCollectFee
:
true
// 是否收费
},
deepCloneForm
:
{},
limitFileType
:
[
'jpg'
,
'png'
],
...
...
@@ -239,7 +397,7 @@ export default {
children
:
'children'
,
label
:
'name'
},
folders
:
[],
typeList
:
[],
folderIds
:
''
,
parentFolderId
:
''
,
folderVisible
:
false
,
...
...
@@ -248,13 +406,16 @@ export default {
folderForm
:
{
folderName
:
''
},
applicationTypeData
:
[{
id
:
1
,
value
:
'免费'
},
{
id
:
2
,
value
:
'收费'
}],
applicationTypeData
:
[
{
id
:
1
,
value
:
'免费'
},
{
id
:
2
,
value
:
'收费'
}
],
categoryId
:
''
,
applyCycleList
:
[],
checkAll
:
false
,
...
...
@@ -268,7 +429,8 @@ export default {
},
sourceData
:
[],
searchForm
:
{
type
:
''
type
:
''
,
name
:
''
},
isEdit
:
false
,
editShowing
:
false
,
...
...
@@ -278,7 +440,7 @@ export default {
},
mounted
()
{
this
.
deepCloneForm
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
editForm
))
this
.
load
Folder
sData
()
this
.
load
Type
sData
()
},
computed
:
{
tableColumns
()
{
...
...
@@ -288,18 +450,21 @@ export default {
type
:
''
,
key
:
'icon'
,
// render: (item) =>
<
image
-
view
imgUrl
=
{
item
.
icon
}
><
/image-view>
,
render
:
(
item
)
=>
(
render
:
(
item
)
=>
item
.
icon
?
(
<
img
src
=
{
item
.
icon
}
alt
=
"应用图标"
style
=
{{
width
:
'40px'
,
height
:
'auto'
}}
/
>
<
img
src
=
{
item
.
icon
}
alt
=
"应用图标"
style
=
{{
width
:
'40px'
,
height
:
'auto'
}}
/
>
)
:
(
<
span
>
无图标
<
/span
>
)
),
),
width
:
80
},
{
label
:
'应用名称'
,
key
:
'name'
,
key
:
'name'
},
{
label
:
'应用分类'
,
...
...
@@ -308,9 +473,7 @@ export default {
{
label
:
'应用类型'
,
key
:
'isCollectFee'
,
render
:
(
item
)
=>
(
<
span
>
{
item
.
isCollectFee
?
'收费'
:
'免费'
}
<
/span
>
),
render
:
(
item
)
=>
<
span
>
{
item
.
isCollectFee
?
'收费'
:
'免费'
}
<
/span
>
},
{
label
:
'应用简述'
,
...
...
@@ -332,15 +495,13 @@ export default {
<
span
class
=
"icon-view icon-edit-view"
title
=
"编辑"
onClick
=
{()
=>
this
.
editInfo
(
item
)}
>
onClick
=
{()
=>
this
.
editInfo
(
item
)}
>
<
i
class
=
"el-icon-edit"
><
/i
>
<
/span
>
<
span
class
=
"icon-view icon-del-view"
title
=
"删除"
onClick
=
{()
=>
this
.
deleteSection
(
item
)}
>
onClick
=
{()
=>
this
.
deleteSection
(
item
)}
>
<
i
class
=
"el-icon-delete"
><
/i
>
<
/span
>
<
/div
>
...
...
@@ -366,7 +527,7 @@ export default {
addDomain
()
{
this
.
editForm
.
salePriceList
.
push
({
price
:
''
,
validDays
:
''
,
validDays
:
''
})
},
selectionChange
(
selection
)
{
...
...
@@ -375,11 +536,11 @@ export default {
deleteSection
(
v
)
{
const
arr
=
v
?
[
v
]
:
this
.
selection
if
(
arr
.
length
===
0
)
return
this
.
$message
(
'请勾选至少一条记录'
)
const
ids
=
arr
.
map
(
item
=>
item
.
id
).
join
()
const
ids
=
arr
.
map
(
(
item
)
=>
item
.
id
).
join
()
this
.
$confirm
(
'确定删除选中的信息?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
type
:
'warning'
})
.
then
(()
=>
{
const
url
=
`businessAppInfo/deleteAppInfoByIds?ids=
${
ids
}
`
...
...
@@ -387,14 +548,14 @@ export default {
if
(
res
.
code
===
200
)
{
this
.
$message
({
type
:
'success'
,
message
:
'删除成功!'
,
message
:
'删除成功!'
})
this
.
getList
()
this
.
selection
=
[]
this
.
$refs
.
multipleTable
.
clearSelectionBox
()
}
else
{
this
.
$alert
(
res
.
message
,
'错误提示'
,
{
dangerouslyUseHTMLString
:
true
,
dangerouslyUseHTMLString
:
true
})
}
})
...
...
@@ -433,22 +594,18 @@ export default {
try
{
const
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
editForm
))
data
.
icon
=
this
.
handleImage
(
data
.
icon
)
// if (!this.editId) {
// data.categoryId = this.categoryId
// } else {
// data.categoryId = this.editForm.categoryId
// }
await
post
(
'businessAppInfo/addOrUpdateAppInfo'
,
data
)
const
res
=
await
post
(
'businessAppInfo/addOrUpdateAppInfo'
,
data
)
if
(
res
.
code
!==
200
)
return
this
.
$message
.
success
(
res
.
message
)
this
.
getList
()
}
catch
(
e
)
{
throw
new
Error
(
e
)
}
finally
{
this
.
editShowing
=
false
}
catch
(
e
)
{
this
.
editShowing
=
true
}
},
handleImage
(
data
)
{
if
(
Array
.
isArray
(
data
)
&&
data
.
length
>
0
)
{
return
data
.
map
(
item
=>
item
.
imagePath
).
join
(
','
)
return
data
.
map
(
(
item
)
=>
item
.
imagePath
).
join
(
','
)
}
return
null
},
...
...
@@ -461,7 +618,10 @@ export default {
try
{
const
res
=
await
get
(
'businessAppSalePrice/getSalePriceValidDays'
)
if
(
res
.
code
!==
200
)
return
this
.
applyCycleList
=
Object
.
entries
(
res
.
data
).
map
(([
name
,
value
])
=>
({
name
,
value
}))
this
.
applyCycleList
=
Object
.
entries
(
res
.
data
).
map
(([
name
,
value
])
=>
({
name
,
value
}))
}
catch
(
e
)
{
console
.
error
(
e
)
}
...
...
@@ -485,7 +645,9 @@ export default {
this
.
editId
=
item
.
id
this
.
getapplyCycle
()
try
{
const
res
=
await
get
(
'businessAppInfo/getAppInfoById'
,
{
id
:
item
.
id
})
const
res
=
await
get
(
'businessAppInfo/getAppInfoById'
,
{
id
:
item
.
id
})
if
(
res
.
code
!==
200
)
return
// this.productionFile = [res.data.productionFile]
// res.data.labelNames = res.data.labelNames?.split(',')
...
...
@@ -501,17 +663,16 @@ export default {
})
this
.
editShowing
=
true
}
catch
(
e
)
{
console
.
error
(
e
)
this
.
$message
.
error
(
e
)
}
}
},
// 获取左侧树数据
async
load
Folder
sData
()
{
async
load
Type
sData
()
{
try
{
const
res
=
await
get
(
'businessAppCategory/getCategoryList'
)
if
(
res
.
code
!==
200
)
return
this
.
folders
=
this
.
recursiveFolder
(
res
.
data
)
this
.
typeList
=
this
.
recursiveFolder
(
res
.
data
)
this
.
categoryId
=
res
.
data
[
0
].
id
this
.
$nextTick
(()
=>
{
this
.
$refs
.
tree
.
setCurrentKey
(
this
.
categoryId
||
res
.
data
[
0
].
id
)
...
...
@@ -563,15 +724,12 @@ export default {
return
}
try
{
const
res
=
await
get
(
'businessAppCategory/deleteCategoryById'
,
{
id
:
data
.
id
}
)
const
res
=
await
get
(
'businessAppCategory/deleteCategoryById'
,
{
id
:
data
.
id
})
if
(
res
.
code
!==
200
)
return
this
.
$message
.
success
(
res
.
message
)
this
.
load
Folder
sData
()
this
.
load
Type
sData
()
}
catch
(
e
)
{
console
.
error
(
e
)
}
...
...
@@ -591,14 +749,17 @@ export default {
categoryName
:
this
.
folderForm
.
folderName
,
// 分类名称
id
:
this
.
editFolderId
}
console
.
log
(
'111'
,
params
)
try
{
const
res
=
await
post
(
'businessAppCategory/addOrUpdateCategory'
,
params
)
const
res
=
await
post
(
'businessAppCategory/addOrUpdateCategory'
,
params
)
if
(
res
.
code
!==
200
)
return
this
.
loadFoldersData
()
this
.
$message
.
success
(
res
.
message
)
this
.
loadTypesData
()
this
.
folderVisible
=
false
}
catch
(
e
)
{
console
.
error
(
e
)
this
.
folderVisible
=
true
}
},
// 左侧树每个节点点击
...
...
@@ -610,18 +771,14 @@ export default {
this
.
getList
()
},
handleCheckAllChange
(
val
)
{
this
.
checkedCompany
=
val
?
this
.
releaseList
.
map
((
e
)
=>
e
.
id
)
:
[]
this
.
checkedCompany
=
val
?
this
.
releaseList
.
map
((
e
)
=>
e
.
id
)
:
[]
this
.
isIndeterminate
=
false
},
handleCheckedCompanyChange
(
value
)
{
const
checkedCount
=
value
.
length
this
.
checkAll
=
checkedCount
===
this
.
releaseList
.
length
this
.
checkAll
=
checkedCount
===
this
.
releaseList
.
length
this
.
isIndeterminate
=
checkedCount
>
0
&&
checkedCount
<
this
.
releaseList
.
length
checkedCount
>
0
&&
checkedCount
<
this
.
releaseList
.
length
},
search
()
{
this
.
getList
()
...
...
@@ -634,23 +791,20 @@ export default {
},
async
getList
()
{
try
{
const
{
pageSize
,
currentPage
}
=
this
.
paginationOptions
const
{
pageSize
,
currentPage
}
=
this
.
paginationOptions
const
res
=
await
post
(
'businessAppInfo/getAppInfoList'
,
{
categoryId
:
this
.
categoryId
===
1
?
undefined
:
this
.
categoryId
,
pageSize
,
currentPage
,
isCollectFee
:
this
.
searchForm
.
type
===
''
?
''
:
this
.
searchForm
.
type
===
2
,
isCollectFee
:
this
.
searchForm
.
type
===
''
?
''
:
this
.
searchForm
.
type
===
2
,
name
:
this
.
searchForm
.
name
,
startTime
:
this
.
period
&&
this
.
period
[
0
],
endTime
:
this
.
period
&&
this
.
period
[
1
]
,
endTime
:
this
.
period
&&
this
.
period
[
1
]
})
if
(
res
.
code
!==
200
)
return
this
.
sourceData
=
res
.
data
.
records
||
[]
this
.
paginationOptions
.
total
=
res
.
data
.
total
||
0
this
.
sourceData
=
res
?.
data
?.
records
??
[]
this
.
paginationOptions
.
total
=
res
?.
data
?
.
total
||
0
}
catch
(
e
)
{
console
.
error
(
e
)
}
...
...
@@ -745,7 +899,10 @@ export default {
transform
:
unset
!important
;
}
.row
::v-deep
.el-tree-node.is-current
>
.el-tree-node__content
.customize-tree-node__operate
{
.row
::v-deep
.el-tree-node.is-current
>
.el-tree-node__content
.customize-tree-node__operate
{
display
:
block
;
}
...
...
@@ -774,7 +931,8 @@ export default {
flex-wrap
:
wrap
;
}
.customsize-label.el-select-dropdown.is-multiple
.el-select-dropdown__item.selected
::after
{
.customsize-label.el-select-dropdown.is-multiple
.el-select-dropdown__item.selected
::after
{
content
:
''
;
display
:
none
;
}
...
...
@@ -795,11 +953,11 @@ export default {
flex-shrink
:
0
;
}
.variant_list
>>>
.el-dialog__body
{
.variant_list
>>>
.el-dialog__body
{
border-top
:
1px
solid
#ebeef5
;
}
.variant_list
>>>
.el-dialog__headerbtn
{
.variant_list
>>>
.el-dialog__headerbtn
{
top
:
11px
;
}
...
...
@@ -849,9 +1007,7 @@ export default {
width
:
100%
;
height
:
100%
;
}
}
}
.el-row
{
...
...
@@ -861,4 +1017,4 @@ export default {
.customize-tree-node__operate
{
display
:
none
;
}
</
style
>
\ No newline at end of file
</
style
>
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