Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart-office-platform
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
赵啸非
smart-office-platform
Commits
39e6d56a
Commit
39e6d56a
authored
Jun 19, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
6ceb5227
33a57415
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
398 additions
and
296 deletions
+398
-296
smart-office-manager-ui/admin/src/components/DataTable.vue
smart-office-manager-ui/admin/src/components/DataTable.vue
+1
-0
smart-office-manager-ui/admin/src/components/DataTreeTable.vue
...-office-manager-ui/admin/src/components/DataTreeTable.vue
+1
-0
smart-office-manager-ui/admin/src/views/basic/set/drawershow.vue
...ffice-manager-ui/admin/src/views/basic/set/drawershow.vue
+157
-106
smart-office-manager-ui/admin/src/views/system/menu/dialogshow.vue
...ice-manager-ui/admin/src/views/system/menu/dialogshow.vue
+110
-68
smart-office-manager-ui/admin/src/views/system/menu/list.vue
smart-office-manager-ui/admin/src/views/system/menu/list.vue
+129
-122
No files found.
smart-office-manager-ui/admin/src/components/DataTable.vue
View file @
39e6d56a
...
...
@@ -8,6 +8,7 @@
@
selection-change=
"handleSelectionChange"
@
sort-change=
"handleSortChange"
@
row-click=
"handleRowClick"
height=
"520"
:row-class-name=
"tableRowClassName"
:empty-text=
'emptyText'
border
...
...
smart-office-manager-ui/admin/src/components/DataTreeTable.vue
View file @
39e6d56a
...
...
@@ -7,6 +7,7 @@
@
row-click=
"handleRowClick"
:row-class-name=
"tableRowClassName"
:default-expand-all=
"expand"
height=
"640"
:tree-props=
"
{ children: 'children', hasChildren: 'hasChildren' }"
>
...
...
smart-office-manager-ui/admin/src/views/basic/set/drawershow.vue
View file @
39e6d56a
<
template
>
<!-- 弹出框表单 -->
<el-drawer
:title=
"title"
:visible.sync=
"open"
:direction=
"direction"
size=
"60%"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"180px"
>
<el-row>
<Field
:span=
"20"
label=
"电子门牌信息"
>
<el-checkbox
true-label=
"1"
false-label=
"0"
v-model=
"form.showPhoto"
>
照片
</el-checkbox>
<!-- 弹出框表单 -->
<el-drawer
:title=
"title"
:visible.sync=
"open"
:direction=
"direction"
size=
"60%"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"180px"
>
<el-row>
<Field
:span=
"20"
label=
"电子门牌信息"
>
<el-checkbox
true-label=
"1"
false-label=
"0"
v-model=
"form.showPhoto"
>
照片
</el-checkbox
>
<el-checkbox
true-label=
"1"
false-label=
"0"
v-model=
"form.showName"
>
姓名
</el-checkbox>
<el-checkbox
true-label=
"1"
false-label=
"0"
v-model=
"form.showName"
>
姓名
</el-checkbox
>
<el-checkbox
true-label=
"1"
false-label=
"0"
v-model=
"form.showPost"
>
职位
</el-checkbox>
<el-checkbox
true-label=
"1"
false-label=
"0"
v-model=
"form.showPost"
>
职位
</el-checkbox
>
<el-checkbox
true-label=
"1"
false-label=
"0"
v-model=
"form.showWork"
>
在岗状态
</el-checkbox>
<el-checkbox
true-label=
"1"
false-label=
"0"
v-model=
"form.showWork"
>
在岗状态
</el-checkbox
>
<el-checkbox
true-label=
"1"
false-label=
"0"
v-model=
"form.showPhone"
>
电话
</el-checkbox>
<el-checkbox
true-label=
"1"
false-label=
"0"
v-model=
"form.showPhone"
>
电话
</el-checkbox
>
</Field>
<Field
:span=
"20"
label=
"电子门牌底部信息设置"
prop=
"showElect"
v-model=
"form.showElect"
type=
"radio"
:enumData=
"dict.showElect"
placeholder=
"请选择显示电子门牌信息"
/>
<Field
:span=
"20"
label=
"自定义内容"
v-if=
"form.showElect == 1"
prop=
"showElectDesc"
type=
"textarea"
v-model=
"form.showElectDesc"
placeholder=
"请输入显示电子门牌信息自定义内容"
/>
<Field
:span=
"20"
label=
"会议室门牌底部信息设置"
prop=
"showMeet"
v-model=
"form.showMeet"
type=
"radio"
:enumData=
"dict.showMeet"
placeholder=
"请选择显示会议室门牌信息"
/>
<Field
:span=
"20"
label=
"自定义内容"
v-if=
"form.showMeet == 1"
type=
"textarea"
prop=
"showMeetDesc"
v-model=
"form.showMeetDesc"
placeholder=
"请输入显示会议室门牌信息自定义内容"
/>
<Field
:span=
"20"
label=
"备注"
prop=
"remark"
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入备注"
/>
</el-row>
</Field>
<Field
:span=
"20"
label=
"电子门牌底部信息设置"
prop=
"showElect"
v-model=
"form.showElect"
type=
"radio"
:enumData=
"dict.showElect"
placeholder=
"请选择显示电子门牌信息"
/>
<Field
:span=
"20"
label=
"自定义内容"
v-if=
"form.showElect==1"
prop=
"showElectDesc"
type=
"textarea"
v-model=
"form.showElectDesc"
placeholder=
"请输入显示电子门牌信息自定义内容"
/>
<Field
:span=
"20"
label=
"会议室门牌底部信息设置"
prop=
"showMeet"
v-model=
"form.showMeet"
type=
"radio"
:enumData=
"dict.showMeet"
placeholder=
"请选择显示会议室门牌信息"
/>
<Field
:span=
"20"
label=
"自定义内容"
v-if=
"form.showMeet==1"
type=
"textarea"
prop=
"showMeetDesc"
v-model=
"form.showMeetDesc"
placeholder=
"请输入显示会议室门牌信息自定义内容"
/>
<Field
:span=
"20"
label=
"备注"
prop=
"remark"
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入备注"
/>
<el-divider
content-position=
"center"
>
状态设置信息
</el-divider>
<br
/>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAddBasicStatus"
>
添加
</el-button
>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
icon=
"el-icon-delete"
size=
"mini"
@
click=
"handleDeleteBasicStatus"
>
删除
</el-button
>
</el-col>
</el-row>
</el-row>
<el-table
:data=
"basicStatusList"
:row-class-name=
"rowBasicStatusIndex"
@
selection-change=
"handleBasicStatusSelectionChange"
ref=
"basicStatus"
height=
"520"
>
<el-table-column
type=
"selection"
width=
"50"
align=
"center"
/>
<el-table-column
label=
"序号"
align=
"center"
prop=
"index"
width=
"50"
/>
<el-table-column
label=
"状态名称"
prop=
"statusName"
>
<template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.statusName"
placeholder=
"请输入状态名称"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"状态颜色值"
prop=
"statusColor"
>
<
template
slot-scope=
"scope"
>
<el-color-picker
v-model=
"scope.row.statusColor"
placeholder=
"请输入状态颜色值"
></el-color-picker>
</
template
>
</el-table-column>
</el-table>
<el-divider
content-position=
"center"
>
状态设置信息
</el-divider>
<br/>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAddBasicStatus"
>
添加
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
icon=
"el-icon-delete"
size=
"mini"
@
click=
"handleDeleteBasicStatus"
>
删除
</el-button>
</el-col>
</el-row>
<el-table
:data=
"basicStatusList"
:row-class-name=
"rowBasicStatusIndex"
@
selection-change=
"handleBasicStatusSelectionChange"
ref=
"basicStatus"
>
<el-table-column
type=
"selection"
width=
"50"
align=
"center"
/>
<el-table-column
label=
"序号"
align=
"center"
prop=
"index"
width=
"50"
/>
<el-table-column
label=
"状态名称"
prop=
"statusName"
>
<template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.statusName"
placeholder=
"请输入状态名称"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"状态颜色值"
prop=
"statusColor"
>
<
template
slot-scope=
"scope"
>
<el-color-picker
v-model=
"scope.row.statusColor"
placeholder=
"请输入状态颜色值"
></el-color-picker>
</
template
>
</el-table-column>
</el-table>
<form-buttons
@
submit=
'submitForm'
v-if=
"pageInfo.type!='view'"
noCancelBtn
/>
</el-form>
</el-drawer>
<form-buttons
@
submit=
"submitForm"
v-if=
"pageInfo.type != 'view'"
noCancelBtn
/>
</el-form>
</el-drawer>
</template>
<
script
>
...
...
@@ -86,11 +140,9 @@ import form from "@/assets/mixins/formdialog";
export
default
{
name
:
"
BasicSetDetail
"
,
mixins
:
[
form
],
components
:
{
},
components
:
{},
created
()
{
this
.
changePath
(
"
basic/set
"
)
this
.
changePath
(
"
basic/set
"
)
;
},
data
()
{
return
{
...
...
@@ -104,8 +156,8 @@ export default {
title
:
"
基础设置
"
,
// 是否显示弹出层
open
:
false
,
direction
:
"
rtl
"
,
toString
:[
direction
:
"
rtl
"
,
toString
:
[
"
showPhoto
"
,
"
showName
"
,
"
showPost
"
,
...
...
@@ -114,14 +166,11 @@ export default {
"
showElect
"
,
"
showMeet
"
,
],
toDate
:[
],
toDate
:
[],
// 表单校验
rules
:
{
createTime
:
[
{
required
:
true
,
message
:
"
请选择创建时间
"
},
],
}
createTime
:
[{
required
:
true
,
message
:
"
请选择创建时间
"
}],
},
};
},
...
...
@@ -145,7 +194,9 @@ export default {
/** 状态设置删除按钮操作 */
handleDeleteBasicStatus
()
{
if
(
this
.
checkedBasicStatus
.
length
==
0
)
{
this
.
$alert
(
"
请先选择要删除的状态设置数据
"
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
});
this
.
$alert
(
"
请先选择要删除的状态设置数据
"
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
});
}
else
{
this
.
basicStatusList
.
splice
(
this
.
checkedBasicStatus
[
0
].
index
-
1
,
1
);
}
...
...
@@ -161,35 +212,35 @@ export default {
},
// 渲染前置处理
beforeRender
(
data
)
{
if
(
data
.
entity
.
basicStatusList
)
{
if
(
data
.
entity
.
basicStatusList
)
{
this
.
basicStatusList
=
data
.
entity
.
basicStatusList
;
}
return
data
return
data
;
},
/** 编辑 */
edit
(
row
)
{
this
.
reset
()
this
.
reset
()
;
this
.
query
=
{
id
:
row
.
id
};
this
.
urls
.
currUrl
=
"
basic/set/edit
"
;
this
.
urls
.
currUrl
=
"
basic/set/edit
"
;
this
.
getData
();
this
.
pageInfo
.
type
=
"
edit
"
this
.
pageInfo
.
type
=
"
edit
"
;
this
.
title
=
"
修改基础设置
"
;
},
/** 新增 */
add
(
row
)
{
this
.
reset
()
this
.
reset
()
;
this
.
urls
.
currUrl
=
"
basic/set/add
"
;
this
.
getData
();
this
.
pageInfo
.
type
=
"
add
"
this
.
pageInfo
.
type
=
"
add
"
;
this
.
title
=
"
新增基础设置
"
;
},
/** 查看*/
view
(
row
)
{
this
.
reset
()
this
.
reset
()
;
this
.
query
=
{
id
:
row
.
id
};
this
.
urls
.
currUrl
=
"
basic/set/view
"
;
this
.
urls
.
currUrl
=
"
basic/set/view
"
;
this
.
getData
();
this
.
pageInfo
.
type
=
"
view
"
this
.
pageInfo
.
type
=
"
view
"
;
this
.
title
=
"
基础设置详细
"
;
},
/**取消按钮 */
...
...
@@ -209,16 +260,16 @@ export default {
// 表单重置
reset
()
{
this
.
form
=
{
showPhoto
:
0
,
showName
:
0
,
showPost
:
0
,
showWork
:
0
,
showPhone
:
0
,
showElect
:
0
,
showElectDesc
:
""
,
showMeet
:
0
,
showMeetDesc
:
""
,
remark
:
""
,
showPhoto
:
0
,
showName
:
0
,
showPost
:
0
,
showWork
:
0
,
showPhone
:
0
,
showElect
:
0
,
showElectDesc
:
""
,
showMeet
:
0
,
showMeetDesc
:
""
,
remark
:
""
,
};
this
.
resetForm
(
"
form
"
);
},
...
...
smart-office-manager-ui/admin/src/views/system/menu/dialogshow.vue
View file @
39e6d56a
...
...
@@ -6,24 +6,48 @@
<el-col
:span=
"24"
v-if=
"form.parentId !== 0"
>
<el-form-item
label=
"上级节点"
prop=
"parentId"
>
<treeselect
v-model=
"form.parentId"
:options=
"menuOptions"
:normalizer=
"normalizer"
placeholder=
"选择上级菜单信息"
v-model=
"form.parentId"
:options=
"menuOptions"
:normalizer=
"normalizer"
placeholder=
"选择上级菜单信息"
/>
</el-form-item>
</el-col>
<!--
<Field
label=
"ID"
prop=
"id"
v-model=
"form.id"
v-if=
'pageInfo.type !== "add"'
disabled
/>
-->
<Field
label=
"名称"
prop=
"name"
v-model=
"form.name"
/>
<Field
label=
"权限类型"
prop=
"authType"
v-model=
"form.authType"
:enumData=
'dict.authType'
type=
'select'
/>
<Field
label=
"访问地址"
prop=
"url"
v-model=
"form.url"
/>
<Field
label=
"状态"
prop=
"status"
v-model=
"form.status"
:enumData=
'dict.status'
type=
'radio'
/>
<Field
class=
"radio-group-container"
label=
"图标"
prop=
"imgPath"
:span=
'24'
>
<el-radio-group
v-model=
"form.imgPath"
class=
'form-el-radio-group'
>
<el-radio-button
style=
"width: 180px"
label=
""
>
不需要图标
</el-radio-button>
<el-radio-button
style=
"width: 180px"
v-for=
'(icon, index) in icons'
:key=
'index'
:label=
"icon"
>
<i
:class=
"'el-icon-'+icon"
style=
"font-size: 20px"
></i>
{{
icon
}}
<Field
label=
"名称"
prop=
"name"
v-model=
"form.name"
/>
<Field
label=
"权限类型"
prop=
"authType"
v-model=
"form.authType"
:enumData=
"dict.authType"
type=
"select"
/>
<Field
label=
"访问地址"
prop=
"url"
v-model=
"form.url"
/>
<Field
label=
"状态"
prop=
"status"
v-model=
"form.status"
:enumData=
"dict.status"
type=
"radio"
/>
<Field
class=
"radio-group-container"
label=
"图标"
prop=
"imgPath"
:span=
"24"
>
<el-radio-group
v-model=
"form.imgPath"
class=
"form-el-radio-group"
>
<el-radio-button
style=
"width: 180px"
label=
""
>
不需要图标
</el-radio-button
>
<el-radio-button
style=
"width: 180px"
v-for=
"(icon, index) in icons"
:key=
"index"
:label=
"icon"
>
<i
:class=
"'el-icon-' + icon"
style=
"font-size: 20px"
></i>
{{
icon
}}
</el-radio-button>
</el-radio-group>
</Field>
...
...
@@ -40,7 +64,7 @@
import
form
from
"
@/assets/mixins/formdialog
"
;
import
Treeselect
from
"
@riophae/vue-treeselect
"
;
import
"
@riophae/vue-treeselect/dist/vue-treeselect.css
"
;
import
axios
from
'
axios
'
import
axios
from
"
axios
"
;
export
default
{
mixins
:
[
form
],
components
:
{
...
...
@@ -48,16 +72,43 @@ export default {
},
data
()
{
return
{
fileContent
:
""
,
id
:
null
,
fileContent
:
""
,
id
:
null
,
icons
:
[
'
info
'
,
'
error
'
,
'
success
'
,
'
warning
'
,
'
question
'
,
'
tickets
'
,
'
document
'
,
'
goods
'
,
'
sold-out
'
,
'
news
'
,
'
message
'
,
'
date
'
,
'
printer
'
,
'
time
'
,
'
bell
'
,
'
mobile-phone
'
,
'
service
'
,
'
view
'
,
'
menu
'
,
'
star-on
'
,
'
location
'
,
'
phone
'
,
'
picture
'
,
'
delete
'
,
'
search
'
,
'
edit
'
,
'
rank
'
,
'
refresh
'
,
'
share
'
,
'
setting
'
,
'
upload
'
,
'
upload2
'
,
'
download
'
,
'
loading
'
,
"
info
"
,
"
error
"
,
"
success
"
,
"
warning
"
,
"
question
"
,
"
tickets
"
,
"
document
"
,
"
goods
"
,
"
sold-out
"
,
"
news
"
,
"
message
"
,
"
date
"
,
"
printer
"
,
"
time
"
,
"
bell
"
,
"
mobile-phone
"
,
"
service
"
,
"
view
"
,
"
menu
"
,
"
star-on
"
,
"
location
"
,
"
phone
"
,
"
picture
"
,
"
delete
"
,
"
search
"
,
"
edit
"
,
"
rank
"
,
"
refresh
"
,
"
share
"
,
"
setting
"
,
"
upload
"
,
"
upload2
"
,
"
download
"
,
"
loading
"
,
],
menuOptions
:
[],
// 遮罩层
...
...
@@ -66,44 +117,36 @@ export default {
title
:
"
菜单信息
"
,
// 是否显示弹出层
open
:
false
,
toString
:[
"
status
"
,
"
linkType
"
,
"
commMenu
"
,
"
menuType
"
,
"
authType
"
,
],
toString
:
[
"
status
"
,
"
linkType
"
,
"
commMenu
"
,
"
menuType
"
,
"
authType
"
],
// 表单校验
rules
:
{
}
rules
:
{},
};
},
created
()
{
axios
.
get
(
'
/icon.txt
'
)
.
then
(
response
=>
{
this
.
fileContent
=
response
.
data
this
.
icons
=
this
.
fileContent
.
split
(
'
\n
'
)
})
axios
.
get
(
"
/icon.txt
"
).
then
((
response
)
=>
{
this
.
fileContent
=
response
.
data
;
this
.
icons
=
this
.
fileContent
.
split
(
"
\n
"
);
});
},
methods
:
{
/** 编辑 */
edit
(
row
,
menuOptions
)
{
this
.
reset
()
this
.
reset
()
;
this
.
query
=
{
id
:
row
.
id
};
this
.
urls
.
currUrl
=
this
.
pageInfo
.
editUrl
;
;
this
.
urls
.
currUrl
=
this
.
pageInfo
.
editUrl
;
this
.
getData
();
this
.
menuOptions
=
menuOptions
;
this
.
title
=
"
修改菜单信息
"
;
},
/** 新增 */
add
(
row
,
menuOptions
)
{
this
.
reset
()
this
.
reset
()
;
this
.
query
=
{
id
:
row
.
id
};
this
.
urls
.
currUrl
=
this
.
pageInfo
.
addUrl
;
this
.
getData
();
if
(
row
.
id
)
{
this
.
id
=
row
.
id
this
.
form
.
parentId
=
row
.
id
if
(
row
.
id
)
{
this
.
id
=
row
.
id
;
this
.
form
.
parentId
=
row
.
id
;
}
this
.
menuOptions
=
menuOptions
;
this
.
title
=
"
新增菜单信息
"
;
...
...
@@ -111,7 +154,7 @@ export default {
/** 查看*/
view
(
row
,
menuOptions
)
{
this
.
query
=
{
id
:
row
.
id
};
this
.
urls
.
currUrl
=
this
.
pageInfo
.
viewUrl
;
;
this
.
urls
.
currUrl
=
this
.
pageInfo
.
viewUrl
;
this
.
getData
();
this
.
menuOptions
=
menuOptions
;
this
.
title
=
"
菜单信息详细
"
;
...
...
@@ -122,8 +165,8 @@ export default {
},
/**获取数据后弹框 */
afterRender
(
data
)
{
if
(
this
.
id
)
{
this
.
form
.
parentId
=
this
.
id
if
(
this
.
id
)
{
this
.
form
.
parentId
=
this
.
id
;
}
this
.
open
=
true
;
},
...
...
@@ -147,28 +190,27 @@ export default {
reset
()
{
this
.
resetForm
(
"
form
"
);
this
.
form
=
{
name
:
""
,
url
:
null
,
ancestors
:
null
,
parentId
:
null
,
orderId
:
null
,
status
:
1
,
linkType
:
0
,
groupId
:
1
,
groupName
:
null
,
imgPath
:
null
,
buttonImgPath
:
null
,
imgCommPath
:
null
,
commMenu
:
0
,
menuType
:
0
,
authType
:
3
,
createUserName
:
null
,
name
:
""
,
url
:
null
,
ancestors
:
null
,
parentId
:
null
,
orderId
:
null
,
status
:
1
,
linkType
:
0
,
groupId
:
1
,
groupName
:
null
,
imgPath
:
null
,
buttonImgPath
:
null
,
imgCommPath
:
null
,
commMenu
:
0
,
menuType
:
0
,
authType
:
3
,
createUserName
:
null
,
};
},
resetForm
(
refName
)
{
if
(
this
.
$refs
[
refName
])
{
console
.
log
(
"
重置表单
"
)
console
.
log
(
"
重置表单
"
)
;
this
.
$refs
[
refName
].
resetFields
();
}
},
...
...
@@ -196,10 +238,10 @@ export default {
box-shadow
:
none
;
}
.el-radio-button__orig-radio
:checked
+
.el-radio-button__inner
{
.el-radio-button__orig-radio
:checked
+
.el-radio-button__inner
{
background
:
rgba
(
0
,
0
,
0
,
0
);
border
:
1px
solid
#3
E7BFA
!
important
;
color
:
#3
E7BFA
;
border
:
1px
solid
#3
e7bfa
!
important
;
color
:
#3
e7bfa
;
line-height
:
14px
;
outline
:
none
;
box-shadow
:
none
;
...
...
smart-office-manager-ui/admin/src/views/system/menu/list.vue
View file @
39e6d56a
<
template
>
<div
className=
"page"
>
<div
class=
"page"
style=
"padding: 0 !important;height: 81% !important; min-height: 81% !important;"
>
<el-card>
<LayoutTable
notPagination
ref=
"layoutTable"
:data=
"tableData"
:config=
"tableConfig"
/>
<LayoutTable
notPagination
ref=
"layoutTable"
:data=
"tableData"
:config=
"tableConfig"
/>
</el-card>
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
</div>
</
template
>
<
script
>
import
{
handleTree
}
from
"
@/assets/utils/table
"
;
import
{
handleTree
}
from
"
@/assets/utils/table
"
;
import
Treeselect
from
"
@riophae/vue-treeselect
"
;
import
"
@riophae/vue-treeselect/dist/vue-treeselect.css
"
;
import
table
from
"
@/assets/mixins/table
"
;
...
...
@@ -17,15 +25,15 @@ import dialogShow from "./dialogshow";
export
default
{
name
:
"
Menu
"
,
mixins
:
[
table
],
components
:
{
Treeselect
,
dialogShow
},
components
:
{
Treeselect
,
dialogShow
},
created
()
{
this
.
query
=
{
"
page
"
:
1
,
"
size
"
:
-
1
}
this
.
query
=
{
page
:
1
,
size
:
-
1
};
},
methods
:
{
afterRender
(
data
)
{
data
.
data
=
handleTree
(
data
.
data
,
"
id
"
,
"
parentId
"
);
this
.
menuOptions
=
data
.
data
;
this
.
$refs
.
layoutTable
.
showType
=
"
treetable
"
this
.
$refs
.
layoutTable
.
showType
=
"
treetable
"
;
},
handleUp
(
data
)
{
...
...
@@ -46,17 +54,17 @@ export default {
id
:
id
,
type
:
type
,
})
.
then
((
res
)
=>
{
if
(
res
&&
res
.
code
&&
res
.
code
==
1
)
{
this
.
getData
()
this
.
loading
=
false
;
this
.
$message
.
success
(
"
更新排序成功!
"
);
}
})
.
catch
((
error
)
=>
{
.
then
((
res
)
=>
{
if
(
res
&&
res
.
code
&&
res
.
code
==
1
)
{
this
.
getData
();
this
.
loading
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
this
.
$message
.
success
(
"
更新排序成功!
"
);
}
})
.
catch
((
error
)
=>
{
this
.
loading
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
handleAdd
(
row
)
{
...
...
@@ -70,17 +78,17 @@ export default {
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
loading
=
true
;
this
.
$post
(
this
.
pageInfo
.
exclude
,
{
id
:
row
.
id
})
.
then
((
res
)
=>
{
if
(
res
&&
res
.
code
&&
res
.
code
==
1
)
{
this
.
menuOptions
=
handleTree
(
res
.
data
.
data
);
this
.
$refs
.
dialogform
.
edit
(
row
,
this
.
menuOptions
);
this
.
loading
=
false
;
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
})
this
.
$post
(
this
.
pageInfo
.
exclude
,
{
id
:
row
.
id
})
.
then
((
res
)
=>
{
if
(
res
&&
res
.
code
&&
res
.
code
==
1
)
{
this
.
menuOptions
=
handleTree
(
res
.
data
.
data
);
this
.
$refs
.
dialogform
.
edit
(
row
,
this
.
menuOptions
);
this
.
loading
=
false
;
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
},
/** 重写查看方法 */
toView
(
row
)
{
...
...
@@ -89,145 +97,144 @@ export default {
// 展示菜单图标
showIcon
(
row
,
column
)
{
return
<
i
class
=
{
'
el-icon-
'
+
row
.
imgPath
}
><
/i
>
return
<
i
class
=
{
"
el-icon-
"
+
row
.
imgPath
}
><
/i>
;
},
handleStatus
(
row
){
if
(
row
.
status
==
1
)
{
this
.
$post
(
"
/menu/change/status
"
,
{
id
:
row
.
id
,
status
:
0
})
.
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
row
.
status
=
0
;
}
})
.
catch
(
error
=>
{
this
.
$message
.
error
(
error
.
message
);
})
}
else
{
this
.
$post
(
"
/menu/change/status
"
,
{
id
:
row
.
id
,
status
:
1
})
.
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
row
.
status
=
1
;
}
})
.
catch
(
error
=>
{
this
.
$message
.
error
(
error
.
message
);
})
handleStatus
(
row
)
{
if
(
row
.
status
==
1
)
{
this
.
$post
(
"
/menu/change/status
"
,
{
id
:
row
.
id
,
status
:
0
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
row
.
status
=
0
;
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
}
else
{
this
.
$post
(
"
/menu/change/status
"
,
{
id
:
row
.
id
,
status
:
1
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
row
.
status
=
1
;
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
}
},
},
data
()
{
return
{
value
:
'
1
'
,
value
:
"
1
"
,
config
:
{
isshowTabPane
:
true
,
isshowTabPane
:
true
,
/** 树表是否默认展开 */
expand
:
false
,
showType
:
"
treetable
"
,
search
:
[],
columns
:
[
{
type
:
'
selection
'
,
type
:
"
selection
"
,
width
:
60
,
},
{
prop
:
'
id
'
,
label
:
'
ID
'
,
prop
:
"
id
"
,
label
:
"
ID
"
,
width
:
120
,
},
{
prop
:
'
name
'
,
label
:
'
名称
'
,
prop
:
"
name
"
,
label
:
"
名称
"
,
width
:
160
,
},
{
prop
:
'
imgPath
'
,
label
:
'
图标
'
,
prop
:
"
imgPath
"
,
label
:
"
图标
"
,
width
:
50
,
formatter
:
this
.
showIcon
,
},
{
prop
:
'
authType
'
,
label
:
'
权限类型
'
,
prop
:
"
authType
"
,
label
:
"
权限类型
"
,
formatter
:
this
.
formatter
,
},
{
prop
:
'
parentId
'
,
label
:
'
父ID
'
,
prop
:
"
parentId
"
,
label
:
"
父ID
"
,
width
:
160
,
},
{
prop
:
'
url
'
,
label
:
'
地址
'
,
prop
:
"
url
"
,
label
:
"
地址
"
,
width
:
160
,
},
{
prop
:
'
status
'
,
label
:
'
状态
'
,
prop
:
"
status
"
,
label
:
"
状态
"
,
width
:
100
,
formatter
:
row
=>
{
formatter
:
(
row
)
=>
{
return
(
<
el
-
switch
value
=
{
row
.
status
+
""
}
active
-
color
=
"
#13ce66
"
inactive
-
color
=
"
#ff4949
"
active
-
value
=
'
1
'
inactive
-
value
=
'
0
'
onChange
=
{()
=>
{
this
.
handleStatus
(
row
);
}}
>
<
/el-switch
>
<
el
-
switch
value
=
{
row
.
status
+
""
}
active
-
color
=
"
#13ce66
"
inactive
-
color
=
"
#ff4949
"
active
-
value
=
"
1
"
inactive
-
value
=
"
0
"
onChange
=
{()
=>
{
this
.
handleStatus
(
row
);
}}
><
/el-switch
>
);
}
},
},
{
label
:
"
操作
"
,
width
:
280
,
formatter
:
row
=>
{
formatter
:
(
row
)
=>
{
return
(
<
div
>
<
el
-
link
style
=
"
margin-right:5px;margin-left:5px
"
icon
=
"
el-icon-top
"
onClick
=
{()
=>
{
this
.
handleUp
(
row
);
}}
><
/el-link
>
<
div
>
<
el
-
link
style
=
"
margin-right:5px;margin-left:5px
"
icon
=
"
el-icon-top
"
onClick
=
{()
=>
{
this
.
handleUp
(
row
);
}}
><
/el-link
>
<
el
-
link
style
=
"
margin-right:5px;margin-left:5px
"
icon
=
"
el-icon-bottom
"
onClick
=
{()
=>
{
this
.
handleDown
(
row
);
}}
<
el
-
link
style
=
"
margin-right:5px;margin-left:5px
"
icon
=
"
el-icon-bottom
"
onClick
=
{()
=>
{
this
.
handleDown
(
row
);
}}
><
/el-link
>
><
/el-link
>
<
el
-
button
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-edit-outline
"
onClick
=
{()
=>
{
this
.
handleAdd
(
row
);
}}
>
新增
<
/el-button
>
<
table
-
buttons
noAdd
noView
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
<
/div
>
<
el
-
button
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-edit-outline
"
onClick
=
{()
=>
{
this
.
handleAdd
(
row
);
}}
>
新增
<
/el-button
>
<
table
-
buttons
noAdd
noView
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
<
/div
>
);
}
}
]
}
}
,
}
,
]
,
}
,
};
}
}
,
};
</
script
>
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