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
dc4dba71
Commit
dc4dba71
authored
Jun 28, 2023
by
姬鋆屾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推,修改无数据的统一格式并修改表格样式问题
parent
916521e1
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
2148 additions
and
1762 deletions
+2148
-1762
smart-office-manager-ui/admin/src/assets/utils/table.js
smart-office-manager-ui/admin/src/assets/utils/table.js
+53
-38
smart-office-manager-ui/admin/src/components/DataTable.vue
smart-office-manager-ui/admin/src/components/DataTable.vue
+51
-53
smart-office-manager-ui/admin/src/components/DataTreeTable.vue
...-office-manager-ui/admin/src/components/DataTreeTable.vue
+35
-38
smart-office-manager-ui/admin/src/views/device/electron/list.vue
...ffice-manager-ui/admin/src/views/device/electron/list.vue
+275
-241
smart-office-manager-ui/admin/src/views/device/electron/view.vue
...ffice-manager-ui/admin/src/views/device/electron/view.vue
+256
-134
smart-office-manager-ui/admin/src/views/device/list.vue
smart-office-manager-ui/admin/src/views/device/list.vue
+221
-173
smart-office-manager-ui/admin/src/views/device/meet/list.vue
smart-office-manager-ui/admin/src/views/device/meet/list.vue
+269
-235
smart-office-manager-ui/admin/src/views/gocome/record/list.vue
...-office-manager-ui/admin/src/views/gocome/record/list.vue
+97
-72
smart-office-manager-ui/admin/src/views/metting/record/list.vue
...office-manager-ui/admin/src/views/metting/record/list.vue
+131
-115
smart-office-manager-ui/admin/src/views/room/list.vue
smart-office-manager-ui/admin/src/views/room/list.vue
+112
-100
smart-office-manager-ui/admin/src/views/room/workman/list.vue
...t-office-manager-ui/admin/src/views/room/workman/list.vue
+70
-57
smart-office-manager-ui/admin/src/views/system/log/list.vue
smart-office-manager-ui/admin/src/views/system/log/list.vue
+7
-3
smart-office-manager-ui/admin/src/views/system/menu/list.vue
smart-office-manager-ui/admin/src/views/system/menu/list.vue
+127
-121
smart-office-manager-ui/admin/src/views/system/param/list.vue
...t-office-manager-ui/admin/src/views/system/param/list.vue
+53
-43
smart-office-manager-ui/admin/src/views/system/resource/list.vue
...ffice-manager-ui/admin/src/views/system/resource/list.vue
+35
-29
smart-office-manager-ui/admin/src/views/system/role/list.vue
smart-office-manager-ui/admin/src/views/system/role/list.vue
+30
-32
smart-office-manager-ui/admin/src/views/system/task/list.vue
smart-office-manager-ui/admin/src/views/system/task/list.vue
+8
-5
smart-office-manager-ui/admin/src/views/system/user/list.vue
smart-office-manager-ui/admin/src/views/system/user/list.vue
+7
-6
smart-office-manager-ui/admin/src/views/system/validcode/list.vue
...fice-manager-ui/admin/src/views/system/validcode/list.vue
+48
-40
smart-office-manager-ui/admin/src/views/workman/list.vue
smart-office-manager-ui/admin/src/views/workman/list.vue
+263
-227
No files found.
smart-office-manager-ui/admin/src/assets/utils/table.js
View file @
dc4dba71
// table-list 所需的一系列操作方法
/**
* formatter
*
...
...
@@ -10,8 +9,10 @@
*/
const
formatter
=
(
tableData
,
column
,
val
)
=>
{
const
key
=
column
.
property
;
if
(
tableData
.
dict
&&
tableData
.
dict
[
key
]){
const
dict
=
tableData
.
dict
[
key
]
console
.
log
(
val
);
val
=
val
?
val
:
"
--
"
;
if
(
tableData
.
dict
&&
tableData
.
dict
[
key
])
{
const
dict
=
tableData
.
dict
[
key
];
return
dict
[
val
]
||
val
;
}
return
val
;
...
...
@@ -27,11 +28,11 @@ const formatter = (tableData, column, val) => {
const
formatterAmount
=
(
row
,
column
)
=>
{
const
property
=
column
.
property
;
const
amount
=
row
[
property
];
if
(
!
amount
)
{
return
'
0.00
'
;
if
(
!
amount
)
{
return
"
0.00
"
;
}
if
(
amount
==
0
)
{
return
'
0.00
'
;
if
(
amount
==
0
)
{
return
"
0.00
"
;
}
return
amount
;
};
...
...
@@ -46,15 +47,18 @@ const formatterAmount = (row, column) => {
const
formatterDate
=
(
row
,
column
)
=>
{
const
property
=
column
.
property
;
const
time
=
row
[
property
];
if
(
!
time
)
return
''
;
if
(
!
time
)
return
""
;
let
date
=
new
Date
(
Number
(
time
));
let
Y
=
date
.
getFullYear
()
+
'
-
'
;
let
M
=
(
date
.
getMonth
()
+
1
<
10
?
'
0
'
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
)
+
'
-
'
;
let
D
=
panLeft
(
date
.
getDate
())
+
'
'
;
let
h
=
panLeft
(
date
.
getHours
())
+
'
:
'
;
let
m
=
panLeft
(
date
.
getMinutes
())
+
'
:
'
;
let
Y
=
date
.
getFullYear
()
+
"
-
"
;
let
M
=
(
date
.
getMonth
()
+
1
<
10
?
"
0
"
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
)
+
"
-
"
;
let
D
=
panLeft
(
date
.
getDate
())
+
"
"
;
let
h
=
panLeft
(
date
.
getHours
())
+
"
:
"
;
let
m
=
panLeft
(
date
.
getMinutes
())
+
"
:
"
;
let
s
=
panLeft
(
date
.
getSeconds
());
return
Y
+
M
+
D
+
h
+
m
+
s
;
return
Y
+
M
+
D
+
h
+
m
+
s
;
};
/**
...
...
@@ -67,16 +71,19 @@ const formatterDate = (row, column) => {
const
formatterDateOnly
=
(
row
,
column
)
=>
{
const
property
=
column
.
property
;
const
time
=
row
[
property
];
if
(
!
time
)
return
''
;
if
(
!
time
)
return
""
;
let
date
=
new
Date
(
Number
(
time
));
let
Y
=
date
.
getFullYear
()
+
'
-
'
;
let
M
=
(
date
.
getMonth
()
+
1
<
10
?
'
0
'
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
)
+
'
-
'
;
let
D
=
panLeft
(
date
.
getDate
())
+
'
'
;
return
Y
+
M
+
D
;
let
Y
=
date
.
getFullYear
()
+
"
-
"
;
let
M
=
(
date
.
getMonth
()
+
1
<
10
?
"
0
"
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
)
+
"
-
"
;
let
D
=
panLeft
(
date
.
getDate
())
+
"
"
;
return
Y
+
M
+
D
;
};
function
panLeft
(
num
){
return
num
<
10
?
'
0
'
+
num
:
num
;
function
panLeft
(
num
)
{
return
num
<
10
?
"
0
"
+
num
:
num
;
}
/**
...
...
@@ -90,18 +97,18 @@ function panLeft(num){
const
find
=
(
list
,
key
,
val
)
=>
{
let
index
=
-
1
;
let
data
=
null
;
list
.
forEach
((
item
,
i
)
=>
{
if
(
item
[
key
]
===
val
)
{
list
.
forEach
((
item
,
i
)
=>
{
if
(
item
[
key
]
===
val
)
{
index
=
i
;
data
=
JSON
.
parse
(
JSON
.
stringify
(
item
));
return
;
}
})
})
;
return
{
index
,
data
,
}
}
}
;
}
;
/**
* 构造树型结构数据
...
...
@@ -112,24 +119,32 @@ const find = (list, key, val) => {
* @param {*} rootId 根Id 默认 0
*/
function
handleTree
(
data
,
id
,
parentId
,
children
,
rootId
)
{
id
=
id
||
'
id
'
parentId
=
parentId
||
'
parentId
'
children
=
children
||
'
children
'
rootId
=
rootId
||
Math
.
min
.
apply
(
Math
,
data
.
map
(
item
=>
{
return
item
[
parentId
]
}))
||
0
id
=
id
||
"
id
"
;
parentId
=
parentId
||
"
parentId
"
;
children
=
children
||
"
children
"
;
rootId
=
rootId
||
Math
.
min
.
apply
(
Math
,
data
.
map
((
item
)
=>
{
return
item
[
parentId
];
})
)
||
0
;
//对源数据深度克隆
const
cloneData
=
JSON
.
parse
(
JSON
.
stringify
(
data
))
const
cloneData
=
JSON
.
parse
(
JSON
.
stringify
(
data
))
;
//循环所有项
const
treeData
=
cloneData
.
filter
(
father
=>
{
let
branchArr
=
cloneData
.
filter
(
child
=>
{
const
treeData
=
cloneData
.
filter
(
(
father
)
=>
{
let
branchArr
=
cloneData
.
filter
(
(
child
)
=>
{
//返回每一项的子级数组
return
father
[
id
]
===
child
[
parentId
]
return
father
[
id
]
===
child
[
parentId
]
;
});
branchArr
.
length
>
0
?
father
.
children
=
branchArr
:
''
;
branchArr
.
length
>
0
?
(
father
.
children
=
branchArr
)
:
""
;
//返回第一层
return
father
[
parentId
]
===
rootId
;
});
return
treeData
!=
''
?
treeData
:
data
;
}
;
return
treeData
!=
""
?
treeData
:
data
;
}
export
{
formatter
,
...
...
@@ -137,5 +152,5 @@ export {
formatterDate
,
formatterDateOnly
,
find
,
handleTree
handleTree
,
};
smart-office-manager-ui/admin/src/components/DataTable.vue
View file @
dc4dba71
<
template
>
<el-table
size=
'small'
size=
"small"
:data=
"tableData"
:row-key=
"handleRowKeyMethod"
:span-method=
"handleSpanMethod"
...
...
@@ -8,114 +8,112 @@
@
selection-change=
"handleSelectionChange"
@
sort-change=
"handleSortChange"
@
row-click=
"handleRowClick"
height=
"560"
:row-class-name=
"tableRowClassName"
:empty-text=
'emptyText'
:empty-text=
"emptyText"
border
style=
"width: 100%"
>
style=
"width: 100%"
>
<el-table-column
v-for=
"column in columns"
:key=
"column.prop"
:type=
"column.type"
:index=
"handleIndexMethod"
:selectable=
"handleSelectableMethod"
:prop=
"column.prop"
:label=
"column.label"
:width=
"column.width"
:sortable=
"column.sortable"
:show-overflow-tooltip=
"column.tooltip"
:align=
"column.align || 'left'"
:formatter=
"column.formatter"
:reserve-selection=
"column.reserveSelection"
:subColumns=
"column.subColumns"
>
<el-table-column
v-for=
'column in columns'
:key=
'column.prop'
:type=
"column.type"
:index=
"handleIndexMethod"
:selectable=
"handleSelectableMethod"
:prop=
"column.prop"
:label=
"column.label"
:width=
"column.width"
:sortable=
"column.sortable"
:show-overflow-tooltip=
"column.tooltip"
:align=
"column.align || 'left'"
:formatter=
'column.formatter'
:reserve-selection=
'column.reserveSelection'
:subColumns=
'column.subColumns'
>
<el-table-column
v-for=
'sunColumn in column.subColumns'
:key=
'sunColumn.prop'
:type=
"sunColumn.type"
:prop=
"sunColumn.prop"
:label=
"sunColumn.label"
:width=
"sunColumn.width"
:sortable=
"sunColumn.sortable"
:align=
"sunColumn.align || 'left'"
:formatter=
'sunColumn.formatter'
/>
</el-table-column>
v-for=
"sunColumn in column.subColumns"
:key=
"sunColumn.prop"
:type=
"sunColumn.type"
:prop=
"sunColumn.prop"
:label=
"sunColumn.label"
:width=
"sunColumn.width"
:sortable=
"sunColumn.sortable"
:align=
"sunColumn.align || 'left'"
:formatter=
"sunColumn.formatter"
/>
</el-table-column>
</el-table>
</
template
>
<
script
>
export
default
{
props
:
{
handleRowKeyMethod
:
{
type
:
Function
,
required
:
false
,
default
:
row
=>
{
return
row
.
id
}
default
:
(
row
)
=>
{
return
row
.
id
;
},
},
handleSelectableMethod
:
{
type
:
Function
,
required
:
false
,
default
:
()
=>
{}
default
:
()
=>
{}
,
},
handleIndexMethod
:
{
type
:
Function
,
required
:
false
,
default
:
()
=>
{}
default
:
()
=>
{}
,
},
handleSpanMethod
:
{
type
:
Function
,
required
:
false
,
default
:
()
=>
{}
default
:
()
=>
{}
,
},
handleSelectionChange
:
{
type
:
Function
,
required
:
false
,
default
:
()
=>
{}
default
:
()
=>
{}
,
},
handleRowClick
:
{
type
:
Function
,
required
:
false
,
default
:
()
=>
{}
default
:
()
=>
{}
,
},
handleSortChange
:
{
type
:
Function
,
required
:
false
,
default
:
()
=>
{}
default
:
()
=>
{}
,
},
tableRowClassName
:
{
type
:
Function
,
required
:
false
,
default
:
()
=>
{}
default
:
()
=>
{}
,
},
loading
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
default
:
true
,
},
tableData
:
{
type
:
Array
,
required
:
false
,
default
:
()
=>
[]
default
:
()
=>
[]
,
},
columns
:
{
type
:
Array
,
required
:
false
,
default
:
()
=>
[],
}
default
:
()
=>
[],
}
,
},
computed
:
{
emptyText
()
{
return
(
!
this
.
loading
&&
!
this
.
tableData
.
length
)
?
'
暂无数据
'
:
'
加载中...
'
return
!
this
.
loading
&&
!
this
.
tableData
.
length
?
"
暂无数据
"
:
"
加载中...
"
;
},
},
methods
:{
},
methods
:
{},
data
()
{
return
{}
}
}
return
{}
;
}
,
}
;
</
script
>
smart-office-manager-ui/admin/src/components/DataTreeTable.vue
View file @
dc4dba71
<
template
>
<el-table
v-loading=
"loading"
:data=
"tableData"
row-key=
"id"
border
@
row-click=
"handleRowClick"
:row-class-name=
"tableRowClassName"
:default-expand-all=
"expand"
:tree-props=
"
{ children: 'children', hasChildren: 'hasChildren' }"
<el-table
v-loading=
"loading"
:data=
"tableData"
row-key=
"id"
border
@
row-click=
"handleRowClick"
:row-class-name=
"tableRowClassName"
:default-expand-all=
"expand"
height=
"560"
:tree-props=
"
{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table-column
v-for=
"column in columns"
:key=
"column.prop"
:type=
"column.type"
:prop=
"column.prop"
:label=
"column.label"
:width=
"column.width"
:show-overflow-tooltip=
"column.tooltip"
:align=
"column.align || 'left'"
:formatter=
"column.formatter"
>
<el-table-column
v-for=
'column in columns'
:key=
'column.prop'
:type=
"column.type"
:prop=
"column.prop"
:label=
"column.label"
:width=
"column.width"
:show-overflow-tooltip=
"column.tooltip"
:align=
"column.align || 'left'"
:formatter=
'column.formatter'
>
</el-table-column>
</el-table>
</el-table-column>
</el-table>
</
template
>
<
script
>
export
default
{
props
:
{
handleSpanMethod
:
{
type
:
Function
,
required
:
false
,
default
:
()
=>
{}
default
:
()
=>
{}
,
},
handleRowClick
:
{
type
:
Function
,
required
:
false
,
default
:
()
=>
{}
default
:
()
=>
{}
,
},
tableRowClassName
:
{
type
:
Function
,
required
:
false
,
default
:
()
=>
{}
default
:
()
=>
{}
,
},
loading
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
default
:
true
,
},
expand
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
default
:
true
,
},
tableData
:
{
type
:
Array
,
required
:
false
,
default
:
()
=>
[]
default
:
()
=>
[]
,
},
columns
:
{
type
:
Array
,
required
:
false
,
default
:
()
=>
[],
}
default
:
()
=>
[],
}
,
},
computed
:
{
emptyText
()
{
return
(
!
this
.
loading
&&
!
this
.
tableData
.
length
)
?
'
暂无数据
'
:
'
加载中...
'
return
!
this
.
loading
&&
!
this
.
tableData
.
length
?
"
暂无数据
"
:
"
加载中...
"
;
},
},
data
()
{
return
{}
}
}
return
{}
;
}
,
}
;
</
script
>
smart-office-manager-ui/admin/src/views/device/electron/list.vue
View file @
dc4dba71
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
size=
"mini"
@
click=
"handleImport"
>
导入
</el-button>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
size=
"mini"
@
click=
"doExport"
:disabled=
"isExport"
>
导出
</el-button>
</LayoutTable>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
size=
"mini"
@
click=
"handleImport"
>
导入
</el-button
>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
size=
"mini"
@
click=
"doExport"
:disabled=
"isExport"
>
导出
</el-button
>
</LayoutTable>
<!-- 设备管理导入对话框 -->
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
:disabled=
"upload.isUploading"
:on-progress=
"handleFileUploadProgress"
:on-success=
"handleFileSuccess"
:auto-upload=
"false"
drag
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em>
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的数据
<el-link
type=
"primary"
style=
"font-size: 14px"
@
click=
"downloadTemplate"
>
下载模板
</el-link
>
</div>
<div
class=
"el-upload__tip"
style=
"color: red"
slot=
"tip"
>
提示:仅允许导入“xls”或“xlsx”格式文件!
</div>
</el-upload>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitFileForm"
>
确 定
</el-button>
<el-button
@
click=
"upload.open = false"
>
取 消
</el-button>
</div>
</el-dialog>
<!-- 设备管理导入对话框 -->
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
:disabled=
"upload.isUploading"
:on-progress=
"handleFileUploadProgress"
:on-success=
"handleFileSuccess"
:auto-upload=
"false"
drag
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em>
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的数据
<el-link
type=
"primary"
style=
"font-size: 14px"
@
click=
"downloadTemplate"
>
下载模板
</el-link
>
</div>
<div
class=
"el-upload__tip"
style=
"color: red"
slot=
"tip"
>
提示:仅允许导入“xls”或“xlsx”格式文件!
</div>
</el-upload>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitFileForm"
>
确 定
</el-button>
<el-button
@
click=
"upload.open = false"
>
取 消
</el-button>
</div>
</el-dialog>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
</
template
>
<
script
>
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
DeviceList
"
,
components
:
{
drawerShow
},
mixins
:
[
table
],
created
()
{
console
.
log
(
"
route
"
,
this
.
$route
)
this
.
changePath
(
"
/device
"
)
this
.
query
=
Object
.
assign
({},
this
.
query
,
{
productCode
:
"
dzmp
"
});
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
DeviceList
"
,
components
:
{
drawerShow
,
},
mixins
:
[
table
],
created
()
{
console
.
log
(
"
route
"
,
this
.
$route
);
this
.
changePath
(
"
/device
"
);
this
.
query
=
Object
.
assign
({},
this
.
query
,
{
productCode
:
"
dzmp
"
});
},
methods
:
{
/** 导入 */
handleImport
()
{
this
.
upload
.
title
=
"
设备管理导入
"
;
this
.
upload
.
open
=
true
;
},
/** 下载模板操作 */
downloadTemplate
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/device/downloadTemplate
"
,
{},
{
type
:
"
excel
"
})
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 文件上传中处理 */
handleFileUploadProgress
(
event
,
file
,
fileList
)
{
this
.
upload
.
isUploading
=
true
;
},
/** 文件上传成功处理 */
handleFileSuccess
(
response
,
file
,
fileList
)
{
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
this
.
$alert
(
response
.
msg
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
this
.
getData
();
},
/** 提交上传文件 */
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
},
/** 导出Excel */
doExport
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/device/exportExcel
"
,
{
idList
:
this
.
selection
,
},
methods
:
{
/** 导入 */
handleImport
()
{
this
.
upload
.
title
=
"
设备管理导入
"
;
this
.
upload
.
open
=
true
;
},
/** 下载模板操作 */
downloadTemplate
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/device/downloadTemplate
"
,
{},
{
type
:
"
excel
"
})
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 文件上传中处理 */
handleFileUploadProgress
(
event
,
file
,
fileList
)
{
this
.
upload
.
isUploading
=
true
;
},
/** 文件上传成功处理 */
handleFileSuccess
(
response
,
file
,
fileList
)
{
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
this
.
$alert
(
response
.
msg
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
this
.
getData
();
},
/** 提交上传文件 */
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
},
/** 导出Excel */
doExport
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/device/exportExcel
"
,
{
"
idList
"
:
this
.
selection
,
},
{
type
:
"
excel
"
}).
then
(()
=>
this
.
isExport
=
false
).
catch
(
error
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
{
type
:
"
excel
"
}
)
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
activeDevice
(
row
)
{
this
.
$post
(
"
/device/active
"
,
{
deviceCode
:
row
.
deviceCode
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
"
激活设备成功!
"
);
this
.
getData
();
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
},
// 操作菜单状态
changeStatus
(
row
,
column
)
{
return
(
<
device
-
switch
confirm
url
=
"
/device/enable
"
row
=
{
row
}
onChange
=
{
this
.
statusChange
}
value
=
{
this
.
tableData
.
data
}
onInput
=
{(
data
)
=>
{
this
.
tableData
.
data
=
data
;
}}
/
>
);
},
statusChange
()
{
this
.
$store
.
dispatch
(
'
login
'
);
activeDevice
(
row
)
{
this
.
$post
(
"
/device/active
"
,
{
deviceCode
:
row
.
deviceCode
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
"
激活设备成功!
"
);
this
.
getData
();
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
},
// 操作菜单状态
changeStatus
(
row
,
column
)
{
return
(
<
device
-
switch
confirm
url
=
"
/device/enable
"
row
=
{
row
}
onChange
=
{
this
.
statusChange
}
value
=
{
this
.
tableData
.
data
}
onInput
=
{(
data
)
=>
{
this
.
tableData
.
data
=
data
;
}}
/
>
);
},
statusChange
()
{
this
.
$store
.
dispatch
(
"
login
"
);
},
},
data
()
{
return
{
// 用户导入参数
upload
:
{
// 是否显示弹出层(设备管理导入)
open
:
false
,
// 弹出层标题(设备管理导入)
title
:
"
导入设备管理数据
"
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的数据
updateSupport
:
0
,
// 上传的地址
url
:
"
/office/device/importData
"
,
},
isExport
:
false
,
config
:
{
search
:
[
{
name
:
"
deviceName
"
,
type
:
"
text
"
,
label
:
"
设备名称
"
,
fuzzy
:
true
,
},
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
},
data
()
{
return
{
// 用户导入参数
upload
:
{
// 是否显示弹出层(设备管理导入)
open
:
false
,
// 弹出层标题(设备管理导入)
title
:
"
导入设备管理数据
"
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的数据
updateSupport
:
0
,
// 上传的地址
url
:
"
/office/device/importData
"
,
},
isExport
:
false
,
config
:
{
search
:
[
{
name
:
"
deviceName
"
,
type
:
"
text
"
,
label
:
"
设备名称
"
,
fuzzy
:
true
},
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
设备名称
"
,
prop
:
"
deviceName
"
},
{
label
:
"
所属房间
"
,
prop
:
"
roomId
"
,
formatter
:
this
.
formatter
},
{
label
:
"
设备名称
"
,
prop
:
"
deviceName
"
,
formatter
:
(
row
)
=>
(
row
.
deviceName
?
row
.
deviceName
:
"
--
"
),
},
{
label
:
"
所属房间
"
,
prop
:
"
roomId
"
,
formatter
:
this
.
formatter
},
{
label
:
"
设备编码
"
,
prop
:
"
deviceCode
"
},
{
label
:
"
设备编码
"
,
prop
:
"
deviceCode
"
,
formatter
:
(
row
)
=>
(
row
.
deviceCode
?
row
.
deviceCode
:
"
--
"
),
},
{
label
:
"
MAC地址
"
,
prop
:
"
deviceMac
"
},
{
label
:
"
MAC地址
"
,
prop
:
"
deviceMac
"
,
formatter
:
(
row
)
=>
(
row
.
deviceMac
?
row
.
deviceMac
:
"
--
"
),
},
{
label
:
"
设备位置
"
,
prop
:
"
deviceAddr
"
},
{
label
:
"
设备位置
"
,
prop
:
"
deviceAddr
"
,
formatter
:
(
row
)
=>
(
row
.
deviceAddr
?
row
.
deviceAddr
:
"
--
"
),
},
{
label
:
"
联系电话
"
,
prop
:
"
leadingOfficialTelephone
"
},
{
label
:
"
联系电话
"
,
prop
:
"
leadingOfficialTelephone
"
,
formatter
:
(
row
)
=>
row
.
leadingOfficialTelephone
?
row
.
leadingOfficialTelephone
:
"
--
"
,
},
{
label
:
"
设备状态
"
,
prop
:
"
deviceStatus
"
,
formatter
:
this
.
formatter
},
{
label
:
"
设备状态
"
,
prop
:
"
deviceStatus
"
,
formatter
:
this
.
formatter
,
},
{
prop
:
"
enabled
"
,
align
:
"
center
"
,
label
:
"
启用/停用
"
,
width
:
100
,
formatter
:
this
.
changeStatus
,
},
{
prop
:
"
enabled
"
,
align
:
"
center
"
,
label
:
"
启用/停用
"
,
width
:
100
,
formatter
:
this
.
changeStatus
,
},
{
label
:
"
操作
"
,
width
:
240
,
formatter
:
row
=>
{
return
(
<
div
>
<
span
>
<
/span
>
{
row
.
deviceStatus
===
0
?
(
<
el
-
button
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-open
"
onClick
=
{()
=>
{
this
.
activeDevice
(
row
);
}}
>
激活
<
/el-button
>
)
:
(
""
)}
<
span
>
<
/span
>
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
<
/div
>
);
}
}
]
}
};
}
{
label
:
"
操作
"
,
width
:
240
,
formatter
:
(
row
)
=>
{
return
(
<
div
>
<
span
>
<
/span
>
{
row
.
deviceStatus
===
0
?
(
<
el
-
button
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-open
"
onClick
=
{()
=>
{
this
.
activeDevice
(
row
);
}}
>
激活
<
/el-button
>
)
:
(
""
)}
<
span
>
<
/span
>
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
<
/div
>
);
},
},
],
},
};
},
};
</
script
>
smart-office-manager-ui/admin/src/views/device/electron/view.vue
View file @
dc4dba71
<
template
>
<layout-view>
<el-descriptions
:title=
"title"
:column=
"column"
:size=
"size"
:colon=
"false"
border
>
<template
slot=
"title"
>
<i
class=
"el-icon-tickets"
></i>
基本详细信息
</
template
>
<
template
slot=
"extra"
>
<el-button
type=
"primary"
@
click=
"$router.go(-1)"
size=
"small"
>
返回
</el-button>
</
template
>
<el-descriptions-item
label=
"设备名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.deviceName}}
</el-descriptions-item>
<el-descriptions-item
label=
"所属房间id"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.roomId}}
</el-descriptions-item>
<el-descriptions-item
label=
"所属房间名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.roomName}}
</el-descriptions-item>
<el-descriptions-item
label=
"设备编码,SN码等,默认为MAC地址"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.deviceCode}}
</el-descriptions-item>
<el-descriptions-item
label=
"设备的MAC地址"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.deviceMac}}
</el-descriptions-item>
<el-descriptions-item
label=
"站点Id,来源基础服务平台"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.siteId}}
</el-descriptions-item>
<el-descriptions-item
label=
"站点编号,来源基础服务平台"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.siteCode}}
</el-descriptions-item>
<el-descriptions-item
label=
"站点名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.siteName}}
</el-descriptions-item>
<el-descriptions-item
label=
"产品编码"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.productCode}}
</el-descriptions-item>
<el-descriptions-item
label=
"产品名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.productName}}
</el-descriptions-item>
<el-descriptions-item
label=
"设备生产厂商名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.deviceFirmname}}
</el-descriptions-item>
<el-descriptions-item
label=
"分辨率"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ util_formatters("resolution", form.resolution) }}
</el-descriptions-item>
<el-descriptions-item
label=
"所属楼栋"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.deviceInBuilding}}
</el-descriptions-item>
<el-descriptions-item
label=
"所属楼层"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.deviceInFloor}}
</el-descriptions-item>
<el-descriptions-item
label=
"保修期至"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ util_formatterDate(form.defectsLiabilityPeriod)}}
</el-descriptions-item>
<el-descriptions-item
label=
"负责人"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.leadingOfficial}}
</el-descriptions-item>
<el-descriptions-item
label=
"设备位置"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.deviceAddr}}
</el-descriptions-item>
<el-descriptions-item
label=
"联系电话"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.leadingOfficialTelephone}}
</el-descriptions-item>
<el-descriptions-item
label=
"设备图片"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.devicePhotoPath}}
</el-descriptions-item>
<el-descriptions-item
label=
"设备访问ip"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.ip}}
</el-descriptions-item>
<el-descriptions-item
label=
"中心设备编码"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.centernum}}
</el-descriptions-item>
<el-descriptions-item
label=
"端口"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.port}}
</el-descriptions-item>
<el-descriptions-item
label=
"设备状态 "
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ util_formatters("deviceStatus", form.deviceStatus) }}
</el-descriptions-item>
<el-descriptions-item
label=
"启用状态 "
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ util_formatters("enabled", form.enabled) }}
</el-descriptions-item>
<el-descriptions-item
label=
"备注"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{form.deviceRemark}}
</el-descriptions-item>
<el-descriptions-item
label=
"最近上线时间"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ util_formatterDate(form.onlineTime)}}
</el-descriptions-item>
<el-descriptions-item
label=
"最近离线时间"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ util_formatterDate(form.offlineTime)}}
</el-descriptions-item>
</el-descriptions>
</layout-view>
<layout-view>
<el-descriptions
:title=
"title"
:column=
"column"
:size=
"size"
:colon=
"false"
border
>
<template
slot=
"title"
>
<i
class=
"el-icon-tickets"
></i>
基本详细信息
</
template
>
<
template
slot=
"extra"
>
<el-button
type=
"primary"
@
click=
"$router.go(-1)"
size=
"small"
>
返回
</el-button
>
</
template
>
<el-descriptions-item
label=
"设备名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.deviceName ? form.deviceName : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"所属房间id"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.roomId ? form.roomId : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"所属房间名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.roomName ? form.roomName : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"设备编码,SN码等,默认为MAC地址"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.deviceCode ? form.deviceCode : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"设备的MAC地址"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.deviceMac ? form.deviceMac : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"站点Id,来源基础服务平台"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.siteId ? form.siteId : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"站点编号,来源基础服务平台"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.siteCode ? form.siteCode : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"站点名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.siteName ? form.siteName : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"产品编码"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.productCode ? form.productCode : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"产品名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.productName ? form.productName : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"设备生产厂商名称"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.deviceFirmname ? form.deviceFirmname : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"分辨率"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{
form.resolution
? util_formatters("resolution", form.resolution)
: "--"
}}
</el-descriptions-item>
<el-descriptions-item
label=
"所属楼栋"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.deviceInBuilding ? form.deviceInBuilding : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"所属楼层"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.deviceInFloor ? form.deviceInFloor : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"保修期至"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{
form.defectsLiabilityPeriod
? util_formatterDate(form.defectsLiabilityPeriod)
: "--"
}}
</el-descriptions-item>
<el-descriptions-item
label=
"负责人"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.leadingOfficial ? form.leadingOfficial : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"设备位置"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.deviceAddr ? form.deviceAddr : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"联系电话"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{
form.leadingOfficialTelephone ? form.leadingOfficialTelephone : "--"
}}
</el-descriptions-item>
<el-descriptions-item
label=
"设备图片"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.devicePhotoPath ? form.devicePhotoPath : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"设备访问ip"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.ip ? form.ip : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"中心设备编码"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.centernum ? form.centernum : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"端口"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.port ? form.port : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"设备状态 "
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{
form.deviceStatus
? util_formatters("deviceStatus", form.deviceStatus)
: "--"
}}
</el-descriptions-item>
<el-descriptions-item
label=
"启用状态 "
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.enabled ? util_formatters("enabled", form.enabled) : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"备注"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.deviceRemark ? form.deviceRemark : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"最近上线时间"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.onlineTime ? util_formatterDate(form.onlineTime) : "--" }}
</el-descriptions-item>
<el-descriptions-item
label=
"最近离线时间"
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{ form.offlineTime ? util_formatterDate(form.offlineTime) : "--" }}
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<
script
>
import
view
from
"
@/assets/mixins/view
"
;
export
default
{
mixins
:
[
view
],
components
:
{
},
methods
:
{
},
data
()
{
return
{
size
:
"
small
"
,
column
:
2
,
toString
:[
"
resolution
"
,
"
deviceInBuilding
"
,
"
deviceInFloor
"
,
"
deviceStatus
"
,
"
enabled
"
,
],
toArrays
:
[
],
toDate
:
[
]
}
}
}
import
view
from
"
@/assets/mixins/view
"
;
export
default
{
mixins
:
[
view
],
components
:
{},
methods
:
{},
data
()
{
return
{
size
:
"
small
"
,
column
:
2
,
toString
:
[
"
resolution
"
,
"
deviceInBuilding
"
,
"
deviceInFloor
"
,
"
deviceStatus
"
,
"
enabled
"
,
],
toArrays
:
[],
toDate
:
[],
};
},
};
</
script
>
<
style
lang=
"less"
>
.labelClass{
width: 200px;
}
.el-descriptions__body{
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #FFF;
}
.contentClass{
width: 600px;
}
</
style
>
\ No newline at end of file
.labelClass {
width: 200px;
}
.el-descriptions__body {
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #fff;
}
.contentClass {
width: 600px;
}
</
style
>
smart-office-manager-ui/admin/src/views/device/list.vue
View file @
dc4dba71
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
size=
"mini"
@
click=
"handleImport"
>
导入
</el-button>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
size=
"mini"
@
click=
"doExport"
:disabled=
"isExport"
>
导出
</el-button>
</LayoutTable>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
size=
"mini"
@
click=
"handleImport"
>
导入
</el-button
>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
size=
"mini"
@
click=
"doExport"
:disabled=
"isExport"
>
导出
</el-button
>
</LayoutTable>
<!-- 设备管理导入对话框 -->
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
:disabled=
"upload.isUploading"
:on-progress=
"handleFileUploadProgress"
:on-success=
"handleFileSuccess"
:auto-upload=
"false"
drag
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em>
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的数据
<el-link
type=
"primary"
style=
"font-size: 14px"
@
click=
"downloadTemplate"
>
下载模板
</el-link
>
</div>
<div
class=
"el-upload__tip"
style=
"color: red"
slot=
"tip"
>
提示:仅允许导入“xls”或“xlsx”格式文件!
</div>
</el-upload>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitFileForm"
>
确 定
</el-button>
<el-button
@
click=
"upload.open = false"
>
取 消
</el-button>
</div>
</el-dialog>
<!-- 设备管理导入对话框 -->
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
:disabled=
"upload.isUploading"
:on-progress=
"handleFileUploadProgress"
:on-success=
"handleFileSuccess"
:auto-upload=
"false"
drag
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em>
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的数据
<el-link
type=
"primary"
style=
"font-size: 14px"
@
click=
"downloadTemplate"
>
下载模板
</el-link
>
</div>
<div
class=
"el-upload__tip"
style=
"color: red"
slot=
"tip"
>
提示:仅允许导入“xls”或“xlsx”格式文件!
</div>
</el-upload>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitFileForm"
>
确 定
</el-button>
<el-button
@
click=
"upload.open = false"
>
取 消
</el-button>
</div>
</el-dialog>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
</
template
>
<
script
>
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
DeviceList
"
,
components
:
{
drawerShow
},
mixins
:
[
table
],
created
()
{
/** 表单弹出框模式需引入 */
import
{
formatter
}
from
"
../../assets/utils/table
"
;
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
DeviceList
"
,
components
:
{
drawerShow
,
},
mixins
:
[
table
],
created
()
{},
methods
:
{
/** 导入 */
handleImport
()
{
this
.
upload
.
title
=
"
设备管理导入
"
;
this
.
upload
.
open
=
true
;
},
/** 下载模板操作 */
downloadTemplate
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/device/downloadTemplate
"
,
{},
{
type
:
"
excel
"
})
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 文件上传中处理 */
handleFileUploadProgress
(
event
,
file
,
fileList
)
{
this
.
upload
.
isUploading
=
true
;
},
/** 文件上传成功处理 */
handleFileSuccess
(
response
,
file
,
fileList
)
{
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
this
.
$alert
(
response
.
msg
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
this
.
getData
();
},
/** 提交上传文件 */
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
},
/** 导出Excel */
doExport
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/device/exportExcel
"
,
{
idList
:
this
.
selection
,
},
methods
:
{
/** 导入 */
handleImport
()
{
this
.
upload
.
title
=
"
设备管理导入
"
;
this
.
upload
.
open
=
true
;
},
/** 下载模板操作 */
downloadTemplate
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/device/downloadTemplate
"
,
{},
{
type
:
"
excel
"
})
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 文件上传中处理 */
handleFileUploadProgress
(
event
,
file
,
fileList
)
{
this
.
upload
.
isUploading
=
true
;
},
/** 文件上传成功处理 */
handleFileSuccess
(
response
,
file
,
fileList
)
{
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
this
.
$alert
(
response
.
msg
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
this
.
getData
();
},
/** 提交上传文件 */
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
},
/** 导出Excel */
doExport
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/device/exportExcel
"
,
{
"
idList
"
:
this
.
selection
,
},
{
type
:
"
excel
"
}).
then
(()
=>
this
.
isExport
=
false
).
catch
(
error
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
{
type
:
"
excel
"
}
)
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
},
data
()
{
return
{
// 用户导入参数
upload
:
{
// 是否显示弹出层(设备管理导入)
open
:
false
,
// 弹出层标题(设备管理导入)
title
:
"
导入设备管理数据
"
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的数据
updateSupport
:
0
,
// 上传的地址
url
:
"
/m/device/importData
"
,
},
isExport
:
false
,
config
:
{
search
:
[],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
},
data
()
{
return
{
// 用户导入参数
upload
:
{
// 是否显示弹出层(设备管理导入)
open
:
false
,
// 弹出层标题(设备管理导入)
title
:
"
导入设备管理数据
"
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的数据
updateSupport
:
0
,
// 上传的地址
url
:
"
/m/device/importData
"
,
},
isExport
:
false
,
config
:
{
search
:
[
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
设备名称
"
,
prop
:
"
deviceName
"
},
{
label
:
"
设备名称
"
,
prop
:
"
deviceName
"
,
formatter
:
(
row
)
=>
(
row
.
deviceName
?
row
.
deviceName
:
"
--
"
),
},
{
label
:
"
所属房间id
"
,
prop
:
"
roomId
"
,
formatter
:
this
.
formatter
},
{
label
:
"
所属房间id
"
,
prop
:
"
roomId
"
,
formatter
:
this
.
formatter
},
{
label
:
"
所属房间名称
"
,
prop
:
"
roomName
"
},
{
label
:
"
所属房间名称
"
,
prop
:
"
roomName
"
,
formatter
:
(
row
)
=>
(
row
.
roomName
?
row
.
roomName
:
"
--
"
),
},
{
label
:
"
设备编码,SN码等,默认为MAC地址
"
,
prop
:
"
deviceCode
"
},
{
label
:
"
设备编码,SN码等,默认为MAC地址
"
,
prop
:
"
deviceCode
"
,
formatter
:
(
row
)
=>
(
row
.
deviceCode
?
row
.
deviceCode
:
"
--
"
),
},
{
label
:
"
设备的MAC地址
"
,
prop
:
"
deviceMac
"
},
{
label
:
"
设备的MAC地址
"
,
prop
:
"
deviceMac
"
,
formatter
:
(
row
)
=>
(
row
.
deviceMac
?
row
.
deviceMac
:
"
--
"
),
},
{
label
:
"
设备位置
"
,
prop
:
"
deviceAddr
"
},
{
label
:
"
设备位置
"
,
prop
:
"
deviceAddr
"
,
formatter
:
(
row
)
=>
(
row
.
deviceAddr
?
row
.
deviceAddr
:
"
--
"
),
},
{
label
:
"
联系电话
"
,
prop
:
"
leadingOfficialTelephone
"
},
{
label
:
"
联系电话
"
,
prop
:
"
leadingOfficialTelephone
"
,
formatter
:
(
row
)
=>
row
.
leadingOfficialTelephone
?
row
.
leadingOfficialTelephone
:
"
--
"
,
},
{
label
:
"
设备状态
"
,
prop
:
"
deviceStatus
"
,
formatter
:
this
.
formatter
},
{
label
:
"
设备状态
"
,
prop
:
"
deviceStatus
"
,
formatter
:
this
.
formatter
,
},
{
label
:
"
启用状态
"
,
prop
:
"
enabled
"
,
formatter
:
this
.
formatter
},
{
label
:
"
启用状态
"
,
prop
:
"
enabled
"
,
formatter
:
this
.
formatter
},
{
label
:
"
创建用户
"
,
prop
:
"
createUserId
"
,
formatter
:
this
.
formatter
},
{
label
:
"
操作
"
,
width
:
240
,
formatter
:
row
=>
{
return
(
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
);
}
}
]
}
};
}
{
label
:
"
创建用户
"
,
prop
:
"
createUserId
"
,
formatter
:
this
.
formatter
,
},
{
label
:
"
操作
"
,
width
:
240
,
formatter
:
(
row
)
=>
{
return
(
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
);
},
},
],
},
};
</
script
>
\ No newline at end of file
},
};
</
script
>
smart-office-manager-ui/admin/src/views/device/meet/list.vue
View file @
dc4dba71
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
size=
"mini"
@
click=
"handleImport"
>
导入
</el-button>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
size=
"mini"
@
click=
"doExport"
:disabled=
"isExport"
>
导出
</el-button>
</LayoutTable>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
size=
"mini"
@
click=
"handleImport"
>
导入
</el-button
>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
size=
"mini"
@
click=
"doExport"
:disabled=
"isExport"
>
导出
</el-button
>
</LayoutTable>
<!-- 设备管理导入对话框 -->
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
:disabled=
"upload.isUploading"
:on-progress=
"handleFileUploadProgress"
:on-success=
"handleFileSuccess"
:auto-upload=
"false"
drag
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em>
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的数据
<el-link
type=
"primary"
style=
"font-size: 14px"
@
click=
"downloadTemplate"
>
下载模板
</el-link
>
</div>
<div
class=
"el-upload__tip"
style=
"color: red"
slot=
"tip"
>
提示:仅允许导入“xls”或“xlsx”格式文件!
</div>
</el-upload>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitFileForm"
>
确 定
</el-button>
<el-button
@
click=
"upload.open = false"
>
取 消
</el-button>
</div>
</el-dialog>
<!-- 设备管理导入对话框 -->
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
:disabled=
"upload.isUploading"
:on-progress=
"handleFileUploadProgress"
:on-success=
"handleFileSuccess"
:auto-upload=
"false"
drag
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em>
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的数据
<el-link
type=
"primary"
style=
"font-size: 14px"
@
click=
"downloadTemplate"
>
下载模板
</el-link
>
</div>
<div
class=
"el-upload__tip"
style=
"color: red"
slot=
"tip"
>
提示:仅允许导入“xls”或“xlsx”格式文件!
</div>
</el-upload>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitFileForm"
>
确 定
</el-button>
<el-button
@
click=
"upload.open = false"
>
取 消
</el-button>
</div>
</el-dialog>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
</
template
>
<
script
>
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
DeviceList
"
,
components
:
{
drawerShow
},
mixins
:
[
table
],
created
()
{
console
.
log
(
"
route
"
,
this
.
$route
)
this
.
changePath
(
"
/device
"
)
this
.
query
=
Object
.
assign
({},
this
.
query
,
{
productCode
:
"
hysdzmp
"
});
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
DeviceList
"
,
components
:
{
drawerShow
,
},
mixins
:
[
table
],
created
()
{
console
.
log
(
"
route
"
,
this
.
$route
);
this
.
changePath
(
"
/device
"
);
this
.
query
=
Object
.
assign
({},
this
.
query
,
{
productCode
:
"
hysdzmp
"
});
},
methods
:
{
/** 导入 */
handleImport
()
{
this
.
upload
.
title
=
"
设备管理导入
"
;
this
.
upload
.
open
=
true
;
},
/** 下载模板操作 */
downloadTemplate
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/device/downloadTemplate
"
,
{},
{
type
:
"
excel
"
})
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 文件上传中处理 */
handleFileUploadProgress
(
event
,
file
,
fileList
)
{
this
.
upload
.
isUploading
=
true
;
},
/** 文件上传成功处理 */
handleFileSuccess
(
response
,
file
,
fileList
)
{
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
this
.
$alert
(
response
.
msg
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
this
.
getData
();
},
/** 提交上传文件 */
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
},
/** 导出Excel */
doExport
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/device/exportExcel
"
,
{
idList
:
this
.
selection
,
},
methods
:
{
/** 导入 */
handleImport
()
{
this
.
upload
.
title
=
"
设备管理导入
"
;
this
.
upload
.
open
=
true
;
},
/** 下载模板操作 */
downloadTemplate
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/device/downloadTemplate
"
,
{},
{
type
:
"
excel
"
})
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 文件上传中处理 */
handleFileUploadProgress
(
event
,
file
,
fileList
)
{
this
.
upload
.
isUploading
=
true
;
},
/** 文件上传成功处理 */
handleFileSuccess
(
response
,
file
,
fileList
)
{
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
this
.
$alert
(
response
.
msg
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
this
.
getData
();
},
/** 提交上传文件 */
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
},
/** 导出Excel */
doExport
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/device/exportExcel
"
,
{
"
idList
"
:
this
.
selection
,
},
{
type
:
"
excel
"
}).
then
(()
=>
this
.
isExport
=
false
).
catch
(
error
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
activeDevice
(
row
)
{
this
.
$post
(
"
/device/active
"
,
{
deviceCode
:
row
.
deviceCode
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
"
激活设备成功!
"
);
this
.
getData
();
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
},
// 操作菜单状态
changeStatus
(
row
,
column
)
{
return
(
<
device
-
switch
confirm
url
=
"
/device/enable
"
row
=
{
row
}
onChange
=
{
this
.
statusChange
}
value
=
{
this
.
tableData
.
data
}
onInput
=
{(
data
)
=>
{
this
.
tableData
.
data
=
data
;
}}
/
>
);
{
type
:
"
excel
"
}
)
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
activeDevice
(
row
)
{
this
.
$post
(
"
/device/active
"
,
{
deviceCode
:
row
.
deviceCode
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
"
激活设备成功!
"
);
this
.
getData
();
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
},
// 操作菜单状态
changeStatus
(
row
,
column
)
{
return
(
<
device
-
switch
confirm
url
=
"
/device/enable
"
row
=
{
row
}
onChange
=
{
this
.
statusChange
}
value
=
{
this
.
tableData
.
data
}
onInput
=
{(
data
)
=>
{
this
.
tableData
.
data
=
data
;
}}
/
>
);
},
statusChange
()
{
this
.
$store
.
dispatch
(
"
login
"
);
},
},
data
()
{
return
{
// 用户导入参数
upload
:
{
// 是否显示弹出层(设备管理导入)
open
:
false
,
// 弹出层标题(设备管理导入)
title
:
"
导入设备管理数据
"
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的数据
updateSupport
:
0
,
// 上传的地址
url
:
"
/office/device/importData
"
,
},
isExport
:
false
,
config
:
{
search
:
[
{
name
:
"
deviceName
"
,
type
:
"
text
"
,
label
:
"
设备名称
"
,
fuzzy
:
true
,
},
statusChange
()
{
this
.
$store
.
dispatch
(
'
login
'
);
},
},
data
()
{
return
{
// 用户导入参数
upload
:
{
// 是否显示弹出层(设备管理导入)
open
:
false
,
// 弹出层标题(设备管理导入)
title
:
"
导入设备管理数据
"
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的数据
updateSupport
:
0
,
// 上传的地址
url
:
"
/office/device/importData
"
,
},
isExport
:
false
,
config
:
{
search
:
[
{
name
:
"
deviceName
"
,
type
:
"
text
"
,
label
:
"
设备名称
"
,
fuzzy
:
true
},
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
设备名称
"
,
prop
:
"
deviceName
"
},
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
所属房间
"
,
prop
:
"
roomId
"
,
formatter
:
this
.
formatter
},
{
label
:
"
设备名称
"
,
prop
:
"
deviceName
"
,
formatter
:
(
row
)
=>
(
row
.
deviceName
?
row
.
deviceName
:
"
--
"
),
},
{
label
:
"
所属房间
"
,
prop
:
"
roomId
"
,
formatter
:
this
.
formatter
},
{
label
:
"
设备编码
"
,
prop
:
"
deviceCode
"
},
{
label
:
"
设备编码
"
,
prop
:
"
deviceCode
"
,
formatter
:
(
row
)
=>
(
row
.
deviceCode
?
row
.
deviceCode
:
"
--
"
),
},
{
label
:
"
MAC地址
"
,
prop
:
"
deviceMac
"
},
{
label
:
"
MAC地址
"
,
prop
:
"
deviceMac
"
,
formatter
:
(
row
)
=>
(
row
.
deviceMac
?
row
.
deviceMac
:
"
--
"
),
},
{
label
:
"
设备位置
"
,
prop
:
"
deviceAddr
"
},
{
label
:
"
设备位置
"
,
prop
:
"
deviceAddr
"
,
formatter
:
(
row
)
=>
(
row
.
deviceAddr
?
row
.
deviceAddr
:
"
--
"
),
},
{
label
:
"
联系电话
"
,
prop
:
"
leadingOfficialTelephone
"
},
{
label
:
"
联系电话
"
,
prop
:
"
leadingOfficialTelephone
"
,
formatter
:
(
row
)
=>
row
.
leadingOfficialTelephone
?
row
.
leadingOfficialTelephone
:
"
--
"
,
},
{
label
:
"
设备状态
"
,
prop
:
"
deviceStatus
"
,
formatter
:
this
.
formatter
},
{
label
:
"
设备状态
"
,
prop
:
"
deviceStatus
"
,
formatter
:
this
.
formatter
,
},
{
label
:
"
启用状态
"
,
prop
:
"
enabled
"
,
formatter
:
this
.
formatter
},
{
label
:
"
操作
"
,
width
:
240
,
formatter
:
row
=>
{
return
(
<
div
>
<
span
>
<
/span
>
{
row
.
deviceStatus
===
0
?
(
<
el
-
button
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-open
"
onClick
=
{()
=>
{
this
.
activeDevice
(
row
);
}}
>
激活
<
/el-button
>
)
:
(
""
)}
<
span
>
<
/span
>
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
<
/div
>
);
}
}
]
}
};
}
{
label
:
"
启用状态
"
,
prop
:
"
enabled
"
,
formatter
:
this
.
formatter
},
{
label
:
"
操作
"
,
width
:
240
,
formatter
:
(
row
)
=>
{
return
(
<
div
>
<
span
>
<
/span
>
{
row
.
deviceStatus
===
0
?
(
<
el
-
button
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-open
"
onClick
=
{()
=>
{
this
.
activeDevice
(
row
);
}}
>
激活
<
/el-button
>
)
:
(
""
)}
<
span
>
<
/span
>
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
<
/div
>
);
},
},
],
},
};
},
};
</
script
>
smart-office-manager-ui/admin/src/views/gocome/record/list.vue
View file @
dc4dba71
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
notAdd
notDel
:config=
"tableConfig"
>
</LayoutTable>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
notAdd
notDel
:config=
"tableConfig"
>
</LayoutTable>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
</
template
>
<
script
>
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
GocomeRecordList
"
,
components
:
{
drawerShow
},
mixins
:
[
table
],
created
()
{
},
methods
:
{
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
},
data
()
{
return
{
config
:
{
search
:
[
{
name
:
"
userName
"
,
type
:
"
text
"
,
label
:
"
用户名称
"
,
fuzzy
:
true
},
{
name
:
"
afterStatus
"
,
type
:
"
text
"
,
label
:
"
状态
"
},
{
name
:
"
createTimeStart
"
,
type
:
"
date
"
,
label
:
"
创建时间
"
},{
name
:
"
createTimeEnd
"
,
type
:
"
date
"
,
label
:
"
结束时间
"
}
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
用户名称
"
,
prop
:
"
userName
"
},
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
GocomeRecordList
"
,
components
:
{
drawerShow
,
},
mixins
:
[
table
],
created
()
{},
methods
:
{
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
},
data
()
{
return
{
config
:
{
search
:
[
{
name
:
"
userName
"
,
type
:
"
text
"
,
label
:
"
用户名称
"
,
fuzzy
:
true
,
},
{
name
:
"
afterStatus
"
,
type
:
"
text
"
,
label
:
"
状态
"
,
},
{
name
:
"
createTimeStart
"
,
type
:
"
date
"
,
label
:
"
创建时间
"
,
},
{
name
:
"
createTimeEnd
"
,
type
:
"
date
"
,
label
:
"
结束时间
"
,
},
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
电话
"
,
prop
:
"
phone
"
},
{
label
:
"
用户名称
"
,
prop
:
"
userName
"
,
formatter
:
(
row
)
=>
(
row
.
userName
?
row
.
userName
:
"
--
"
),
},
{
label
:
"
所属部门
"
,
prop
:
"
deptName
"
},
{
label
:
"
电话
"
,
prop
:
"
phone
"
,
formatter
:
(
row
)
=>
(
row
.
phone
?
row
.
phone
:
"
--
"
),
},
{
label
:
"
所属房间名称
"
,
prop
:
"
roomName
"
},
{
label
:
"
所属部门
"
,
prop
:
"
deptName
"
,
formatter
:
(
row
)
=>
(
row
.
deptName
?
row
.
deptName
:
"
--
"
),
},
{
label
:
"
修改前状态
"
,
prop
:
"
beforeStatus
"
},
{
label
:
"
所属房间名称
"
,
prop
:
"
roomName
"
,
formatter
:
(
row
)
=>
(
row
.
roomName
?
row
.
roomName
:
"
--
"
),
},
{
label
:
"
修改后状态
"
,
prop
:
"
afterStatus
"
},
{
label
:
"
修改前状态
"
,
prop
:
"
beforeStatus
"
,
formatter
:
(
row
)
=>
(
row
.
beforeStatus
?
row
.
beforeStatus
:
"
--
"
),
},
{
label
:
"
修改时间
"
,
prop
:
"
createTime
"
,
formatter
:
this
.
formatterDate
},
{
label
:
"
修改后状态
"
,
prop
:
"
afterStatus
"
,
formatter
:
(
row
)
=>
(
row
.
afterStatus
?
row
.
afterStatus
:
"
--
"
),
},
]
}
};
}
{
label
:
"
修改时间
"
,
prop
:
"
createTime
"
,
formatter
:
this
.
formatterDate
,
},
],
},
};
},
};
</
script
>
smart-office-manager-ui/admin/src/views/metting/record/list.vue
View file @
dc4dba71
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
</LayoutTable>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
</LayoutTable>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
</
template
>
...
...
@@ -17,11 +15,10 @@ import moment from "moment/moment";
export
default
{
name
:
"
MettingRecordList
"
,
components
:
{
drawerShow
drawerShow
,
},
mixins
:
[
table
],
created
()
{
},
created
()
{},
methods
:
{
/** 重写新增方法 */
toAdd
(
row
)
{
...
...
@@ -43,158 +40,177 @@ export default {
cancelButtonText
:
"
取消
"
,
type
:
"
warning
"
,
})
.
then
(()
=>
{
that
.
$post
(
"
/metting/record/delete?id=
"
+
id
,
{})
.
then
((
res
)
=>
{
// 更新数据
if
(
res
&&
res
.
code
==
1
)
{
that
.
getData
();
that
.
afterDel
(
id
);
}
})
.
catch
((
error
)
=>
{
that
.
$message
.
error
(
error
.
message
);
});
})
.
catch
(()
=>
{
this
.
$message
({
type
:
"
info
"
,
message
:
"
已取消删除
"
,
.
then
(()
=>
{
that
.
$post
(
"
/metting/record/delete?id=
"
+
id
,
{})
.
then
((
res
)
=>
{
// 更新数据
if
(
res
&&
res
.
code
==
1
)
{
that
.
getData
();
that
.
afterDel
(
id
);
}
})
.
catch
((
error
)
=>
{
that
.
$message
.
error
(
error
.
message
);
});
})
.
catch
(()
=>
{
this
.
$message
({
type
:
"
info
"
,
message
:
"
已取消删除
"
,
});
}
});
},
,
toFinish
(
row
)
{
this
.
loading
=
true
;
this
.
$post
(
"
/metting/record/save
"
,
{
id
:
row
.
id
,
meetStatus
:
2
,
id
:
row
.
id
,
meetStatus
:
2
,
})
.
then
((
res
)
=>
{
if
(
res
&&
res
.
code
===
1
)
{
this
.
$message
.
success
(
"
结束成功!
"
);
this
.
getData
();
this
.
loading
=
false
;
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
}
.
then
((
res
)
=>
{
if
(
res
&&
res
.
code
===
1
)
{
this
.
$message
.
success
(
"
结束成功!
"
);
this
.
getData
();
this
.
loading
=
false
;
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
},
},
data
()
{
return
{
config
:
{
search
:
[
{
name
:
"
meetName
"
,
type
:
"
text
"
,
label
:
"
会议名称
"
,
fuzzy
:
true
},
search
:
[
{
name
:
"
meetName
"
,
type
:
"
text
"
,
label
:
"
会议名称
"
,
fuzzy
:
true
,
},
{
name
:
"
meetStatus
"
,
type
:
"
select
"
,
label
:
"
会议状态
"
label
:
"
会议状态
"
,
},
{
name
:
"
meetDateStart
"
,
type
:
"
date
"
,
label
:
"
会议开始日期
"
},{
label
:
"
会议开始日期
"
,
},
{
name
:
"
meetDateEnd
"
,
type
:
"
date
"
,
label
:
"
会议结束日期
"
}
],
label
:
"
会议结束日期
"
,
}
,
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
会议名称
"
,
prop
:
"
meetName
"
},
{
label
:
"
开会房间
"
,
prop
:
"
roomName
"
},
{
label
:
"
会议名称
"
,
prop
:
"
meetName
"
,
formatter
:
(
row
)
=>
(
row
.
meetName
?
row
.
meetName
:
"
--
"
),
},
{
label
:
"
开会房间
"
,
prop
:
"
roomName
"
,
formatter
:
(
row
)
=>
(
row
.
roomName
?
row
.
roomName
:
"
--
"
),
},
{
label
:
"
开会日期
"
,
prop
:
"
meetDate
"
,
label
:
"
开会日期
"
,
prop
:
"
meetDate
"
,
formatter
:
(
row
)
=>
{
let
meetDate
=
moment
(
row
.
meetDate
).
format
(
'
YYYY-MM-DD
'
);
return
(
<
span
>
{
meetDate
}
<
/span
>
);
let
meetDate
=
moment
(
row
.
meetDate
).
format
(
"
YYYY-MM-DD
"
);
return
<
span
>
{
meetDate
}
<
/span>
;
},
},
{
label
:
"
开始时间
"
,
prop
:
"
meetTimeStart
"
,
label
:
"
开始时间
"
,
prop
:
"
meetTimeStart
"
,
formatter
:
(
row
)
=>
{
let
meetTimeStart
=
moment
(
row
.
meetTimeStart
).
format
(
'
HH:mm
'
);
let
meetTimeEnd
=
moment
(
row
.
meetTimeEnd
).
format
(
'
HH:mm
'
);
let
meetTimeStart
=
moment
(
row
.
meetTimeStart
).
format
(
"
HH:mm
"
);
let
meetTimeEnd
=
moment
(
row
.
meetTimeEnd
).
format
(
"
HH:mm
"
);
return
(
<
span
>
{
meetTimeStart
}
~
{
meetTimeEnd
}
<
/span
>
<
span
>
{
meetTimeStart
}
~
{
meetTimeEnd
}
<
/span
>
);
}
},
},
{
label
:
"
开会部门
"
,
prop
:
"
meetDeptName
"
,
formatter
:
(
row
)
=>
(
row
.
meetDeptName
?
row
.
meetDeptName
:
"
--
"
),
},
{
label
:
"
开会部门
"
,
prop
:
"
meetDeptName
"
},
{
label
:
"
结束方式
"
,
prop
:
"
finishMethod
"
,
formatter
:
this
.
formatter
},
{
label
:
"
结束方式
"
,
prop
:
"
finishMethod
"
,
formatter
:
this
.
formatter
,
},
{
label
:
"
会议状态
"
,
prop
:
"
meetStatus
"
,
formatter
:
this
.
formatter
},
{
label
:
"
会议状态
"
,
prop
:
"
meetStatus
"
,
formatter
:
this
.
formatter
},
{
label
:
"
操作
"
,
width
:
240
,
formatter
:
row
=>
{
formatter
:
(
row
)
=>
{
let
editButton
=
(
<
el
-
button
size
=
"
small
"
type
=
"
text
"
icon
=
"
el-icon-edit
"
onClick
=
{()
=>
{
this
.
toEdit
(
row
);
}}
>
编辑
<
/el-button
>
<
el
-
button
size
=
"
small
"
type
=
"
text
"
icon
=
"
el-icon-edit
"
onClick
=
{()
=>
{
this
.
toEdit
(
row
);
}}
>
编辑
<
/el-button
>
);
let
viewButton
=
(
<
el
-
button
size
=
"
small
"
type
=
"
text
"
icon
=
"
el-icon-view
"
onClick
=
{()
=>
{
this
.
toView
(
row
);
}}
>
查看
<
/el-button
>
<
el
-
button
size
=
"
small
"
type
=
"
text
"
icon
=
"
el-icon-view
"
onClick
=
{()
=>
{
this
.
toView
(
row
);
}}
>
查看
<
/el-button
>
);
let
delButton
=
(
<
el
-
button
size
=
"
small
"
type
=
"
text
"
icon
=
"
el-icon-delete
"
onClick
=
{()
=>
{
this
.
toDel
(
row
.
id
);
}}
>
删除
<
/el-button
>
<
el
-
button
size
=
"
small
"
type
=
"
text
"
icon
=
"
el-icon-delete
"
onClick
=
{()
=>
{
this
.
toDel
(
row
.
id
);
}}
>
删除
<
/el-button
>
);
let
finishButton
=
(
<
el
-
button
size
=
"
small
"
type
=
"
text
"
icon
=
"
el-icon-document
"
onClick
=
{()
=>
{
this
.
toFinish
(
row
);
}}
>
结束
<
/el-button
>
<
el
-
button
size
=
"
small
"
type
=
"
text
"
icon
=
"
el-icon-document
"
onClick
=
{()
=>
{
this
.
toFinish
(
row
);
}}
>
结束
<
/el-button
>
);
let
listButtons
=
[];
if
(
row
.
meetStatus
===
0
)
{
...
...
@@ -208,11 +224,11 @@ export default {
listButtons
.
push
(
viewButton
);
}
return
<
div
>
{
listButtons
}
<
/div>
;
}
}
]
}
}
,
}
,
]
,
}
,
};
}
}
,
};
</
script
>
smart-office-manager-ui/admin/src/views/room/list.vue
View file @
dc4dba71
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
</LayoutTable>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
</LayoutTable>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
</
template
>
<
script
>
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
RoomList
"
,
components
:
{
drawerShow
},
mixins
:
[
table
],
created
()
{
},
methods
:
{
renderTable
(
tableData
)
{
return
(
<
el
-
table
stripe
data
=
{
tableData
}
class
=
"
total-table
"
>
{
this
.
columnSet
.
map
((
item
)
=>
this
.
renderTableColumn
(
item
))}
<
/el-table
>
);
},
renderTableColumn
(
options
)
{
return
(
<
el
-
table
-
column
prop
=
{
options
.
prop
}
label
=
{
options
.
label
}
width
=
{
options
.
width
}
formatter
=
{
options
.
formatter
}
>
<
/el-table-column
>
);
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
RoomList
"
,
components
:
{
drawerShow
,
},
mixins
:
[
table
],
created
()
{},
methods
:
{
renderTable
(
tableData
)
{
return
(
<
el
-
table
stripe
data
=
{
tableData
}
class
=
"
total-table
"
>
{
this
.
columnSet
.
map
((
item
)
=>
this
.
renderTableColumn
(
item
))}
<
/el-table
>
);
},
renderTableColumn
(
options
)
{
return
(
<
el
-
table
-
column
prop
=
{
options
.
prop
}
label
=
{
options
.
label
}
width
=
{
options
.
width
}
formatter
=
{
options
.
formatter
}
><
/el-table-column
>
);
},
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
},
data
()
{
return
{
/** 子表列元素 */
columnSet
:
[
{
label
:
"
设备编码
"
,
prop
:
"
deviceCode
"
,
width
:
150
},
{
label
:
"
设备名称
"
,
prop
:
"
deviceName
"
,
width
:
150
},
],
config
:
{
search
:
[
{
name
:
"
userName
"
,
type
:
"
text
"
,
label
:
"
房间名称
"
,
fuzzy
:
true
,
},
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
},
data
()
{
return
{
/** 子表列元素 */
columnSet
:[
{
label
:
"
设备编码
"
,
prop
:
"
deviceCode
"
,
width
:
150
},
{
label
:
"
设备名称
"
,
prop
:
"
deviceName
"
,
width
:
150
}
],
config
:
{
search
:
[
{
name
:
"
userName
"
,
type
:
"
text
"
,
label
:
"
房间名称
"
,
fuzzy
:
true
},
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
房间名称
"
,
prop
:
"
roomName
"
},
{
label
:
"
房间名称
"
,
prop
:
"
roomName
"
,
formatter
:
(
row
)
=>
(
row
.
roomName
?
row
.
roomName
:
"
--
"
),
},
{
label
:
"
房间编码
"
,
prop
:
"
roomCode
"
},
{
label
:
"
房间编码
"
,
prop
:
"
roomCode
"
,
formatter
:
(
row
)
=>
(
row
.
roomCode
?
row
.
roomCode
:
"
--
"
),
},
{
label
:
"
房间类型
"
,
prop
:
"
roomType
"
,
formatter
:
this
.
formatter
},
{
label
:
"
房间类型
"
,
prop
:
"
roomType
"
,
formatter
:
this
.
formatter
},
{
label
:
"
绑定设备
"
,
width
:
120
,
prop
:
"
subColumns
"
,
formatter
:
(
row
)
=>
{
let
widthsize
=
this
.
columnSet
.
reduce
((
pre
,
cur
)
=>
{
return
pre
+
Number
(
cur
.
width
);
},
50
);
return
(
<
el
-
popover
placement
=
"
right
"
width
=
{
widthsize
}
trigger
=
"
click
"
>
{
this
.
renderTable
(
row
.
roomDeviceList
)}
<
el
-
button
type
=
"
text
"
slot
=
"
reference
"
>
详细
<
/el-button
>
<
/el-popover
>
);
},
},
{
label
:
"
绑定设备
"
,
width
:
120
,
prop
:
"
subColumns
"
,
formatter
:
(
row
)
=>
{
let
widthsize
=
this
.
columnSet
.
reduce
((
pre
,
cur
)
=>
{
return
pre
+
Number
(
cur
.
width
);
},
50
);
return
(
<
el
-
popover
placement
=
"
right
"
width
=
{
widthsize
}
trigger
=
"
click
"
>
{
this
.
renderTable
(
row
.
roomDeviceList
)}
<
el
-
button
type
=
"
text
"
slot
=
"
reference
"
>
详细
<
/el-button
>
<
/el-popover
>
);
},
},
{
label
:
"
员工人数
"
,
prop
:
"
countPerson
"
,
formatter
:
this
.
formatter
},
{
label
:
"
员工人数
"
,
prop
:
"
countPerson
"
,
formatter
:
this
.
formatter
},
{
label
:
"
操作
"
,
width
:
240
,
formatter
:
row
=>
{
return
(
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
);
}
}
]
}
};
}
{
label
:
"
操作
"
,
width
:
240
,
formatter
:
(
row
)
=>
{
return
(
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
);
},
},
],
},
};
},
};
</
script
>
smart-office-manager-ui/admin/src/views/room/workman/list.vue
View file @
dc4dba71
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
</LayoutTable>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
</LayoutTable>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
</
template
>
<
script
>
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
RoomWorkmanList
"
,
components
:
{
drawerShow
},
mixins
:
[
table
],
created
()
{
},
methods
:
{
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
},
data
()
{
return
{
config
:
{
search
:
[
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
RoomWorkmanList
"
,
components
:
{
drawerShow
,
},
mixins
:
[
table
],
created
()
{},
methods
:
{
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
},
data
()
{
return
{
config
:
{
search
:
[],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
房间名称
"
,
prop
:
"
roomName
"
},
{
label
:
"
房间名称
"
,
prop
:
"
roomName
"
,
formatter
:
(
row
)
=>
(
row
.
roomName
?
row
.
roomName
:
"
--
"
),
},
{
label
:
"
工作人员名称
"
,
prop
:
"
workmanName
"
},
{
label
:
"
工作人员名称
"
,
prop
:
"
workmanName
"
,
formatter
:
(
row
)
=>
(
row
.
workmanName
?
row
.
workmanName
:
"
--
"
),
},
{
label
:
"
创建用户
"
,
prop
:
"
createUserId
"
,
formatter
:
this
.
formatter
},
{
label
:
"
操作
"
,
width
:
240
,
formatter
:
row
=>
{
return
(
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
);
}
}
]
}
};
}
{
label
:
"
创建用户
"
,
prop
:
"
createUserId
"
,
formatter
:
this
.
formatter
,
},
{
label
:
"
操作
"
,
width
:
240
,
formatter
:
(
row
)
=>
{
return
(
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
);
},
},
],
},
};
</
script
>
\ No newline at end of file
},
};
</
script
>
smart-office-manager-ui/admin/src/views/system/log/list.vue
View file @
dc4dba71
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
notAdd
notDel
:config=
"tableConfig"
/>
<LayoutTable
:data=
"tableData"
notAdd
notDel
:config=
"tableConfig"
/>
</div>
</
template
>
...
...
@@ -26,36 +25,41 @@ export default {
},
],
columns
:
[
{
type
:
"
index
"
,
label
:
"
序号
"
,
align
:
"
center
"
,
width
:
50
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
align
:
"
center
"
,
width
:
50
},
{
prop
:
"
userName
"
,
label
:
"
用户名称
"
,
align
:
"
center
"
,
formatter
:
(
row
)
=>
(
row
.
userName
?
row
.
userName
:
"
--
"
),
},
{
prop
:
"
loginName
"
,
label
:
"
用户登录名
"
,
align
:
"
center
"
,
formatter
:
(
row
)
=>
(
row
.
loginName
?
row
.
loginName
:
"
--
"
),
},
{
prop
:
"
requestUrl
"
,
label
:
"
请求地址
"
,
align
:
"
center
"
,
formatter
:
(
row
)
=>
(
row
.
requestUrl
?
row
.
requestUrl
:
"
--
"
),
},
{
prop
:
"
content
"
,
label
:
"
操作内容
"
,
align
:
"
center
"
,
formatter
:
(
row
)
=>
(
row
.
content
?
row
.
content
:
"
--
"
),
},
{
prop
:
"
ip
"
,
label
:
"
操作IP地址
"
,
align
:
"
center
"
,
formatter
:
(
row
)
=>
(
row
.
ip
?
row
.
ip
:
"
--
"
),
},
{
...
...
smart-office-manager-ui/admin/src/views/system/menu/list.vue
View file @
dc4dba71
<
template
>
<div
className=
"page"
>
<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 +22,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 +51,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 +75,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 +94,146 @@ 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
,
formatter
:
(
row
)
=>
(
row
.
id
?
row
.
id
:
"
--
"
),
},
{
prop
:
'
name
'
,
label
:
'
名称
'
,
prop
:
"
name
"
,
label
:
"
名称
"
,
width
:
160
,
formatter
:
(
row
)
=>
(
row
.
name
?
row
.
name
:
"
--
"
),
},
{
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
"
,
formatter
:
(
row
)
=>
(
row
.
parentId
?
row
.
parentId
:
"
--
"
),
},
{
prop
:
'
url
'
,
label
:
'
地址
'
,
prop
:
"
url
"
,
label
:
"
地址
"
,
formatter
:
(
row
)
=>
(
row
.
url
?
row
.
url
:
"
--
"
),
},
{
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
>
smart-office-manager-ui/admin/src/views/system/param/list.vue
View file @
dc4dba71
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
'tableData'
:config=
'tableConfig'
/>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
/>
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
</div>
</
template
>
<
script
>
import
table
from
'
@/assets/mixins/table
'
;
import
table
from
"
@/assets/mixins/table
"
;
import
dialogShow
from
"
./dialogshow
"
;
export
default
{
mixins
:
[
table
],
components
:
{
dialogShow
},
components
:
{
dialogShow
},
methods
:
{
// 新增
toAdd
(
row
)
{
...
...
@@ -21,92 +21,102 @@ export default {
this
.
$refs
.
dialogform
.
edit
(
row
);
},
// 查看
toView
(
row
,
)
{
this
.
$refs
.
dialogform
.
view
(
row
);
toView
(
row
)
{
this
.
$refs
.
dialogform
.
view
(
row
);
},
},
data
()
{
return
{
config
:
{
search
:
[
{
name
:
'
name
'
,
type
:
'
text
'
,
label
:
'
参数名称
'
,
name
:
"
name
"
,
type
:
"
text
"
,
label
:
"
参数名称
"
,
},
],
columns
:
[
{
type
:
"
selection
"
,
reserveSelection
:
true
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
align
:
"
center
"
,
width
:
50
},
{
type
:
"
selection
"
,
reserveSelection
:
true
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
align
:
"
center
"
,
width
:
50
},
{
prop
:
'
name
'
,
label
:
'
参数名称
'
,
prop
:
"
name
"
,
label
:
"
参数名称
"
,
formatter
:
(
row
)
=>
(
row
.
name
?
row
.
name
:
"
--
"
),
},
{
prop
:
'
firstOrganize
'
,
label
:
'
一级组织
'
,
prop
:
"
firstOrganize
"
,
label
:
"
一级组织
"
,
formatter
:
(
row
)
=>
(
row
.
firstOrganize
?
row
.
firstOrganize
:
"
--
"
),
},
{
prop
:
'
secondOrganize
'
,
label
:
'
二级组织
'
,
prop
:
"
secondOrganize
"
,
label
:
"
二级组织
"
,
formatter
:
(
row
)
=>
row
.
secondOrganize
?
row
.
secondOrganize
:
"
--
"
,
},
{
prop
:
'
paramKey
'
,
label
:
'
参数键
'
,
prop
:
"
paramKey
"
,
label
:
"
参数键
"
,
formatter
:
(
row
)
=>
(
row
.
paramKey
?
row
.
paramKey
:
"
--
"
),
},
{
prop
:
'
paramValue
'
,
label
:
'
参数值
'
,
prop
:
"
paramValue
"
,
label
:
"
参数值
"
,
formatter
:
(
row
)
=>
(
row
.
paramValue
?
row
.
paramValue
:
"
--
"
),
// formatter: this.util_short('paramValue', 20)
},
{
prop
:
'
validStatus
'
,
label
:
'
有效状态
'
,
prop
:
"
validStatus
"
,
label
:
"
有效状态
"
,
width
:
70
,
formatter
:
this
.
formatter
formatter
:
this
.
formatter
,
},
{
prop
:
'
modStatus
'
,
label
:
'
修改状态
'
,
prop
:
"
modStatus
"
,
label
:
"
修改状态
"
,
width
:
100
,
formatter
:
this
.
formatter
formatter
:
this
.
formatter
,
},
{
prop
:
'
displayType
'
,
label
:
'
展现类型
'
,
prop
:
"
displayType
"
,
label
:
"
展现类型
"
,
width
:
100
,
formatter
:
this
.
formatter
formatter
:
this
.
formatter
,
},
{
prop
:
'
remark
'
,
label
:
'
备注
'
,
prop
:
"
remark
"
,
label
:
"
备注
"
,
formatter
:
(
row
)
=>
(
row
.
remark
?
row
.
remark
:
"
--
"
),
},
{
label
:
'
操作
'
,
label
:
"
操作
"
,
width
:
260
,
formatter
:
(
row
)
=>
{
formatter
:
(
row
)
=>
{
return
(
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
)
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
);
},
},
],
},
}
}
}
}
;
}
,
}
;
</
script
>
<
style
lang=
"css"
>
.el-tooltip__popper
{
.el-tooltip__popper
{
display
:
inline-block
;
max-width
:
80%
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
normal
;
white-space
:
normal
;
line-height
:
18px
;
cursor
:
pointer
;
}
</
style
>
smart-office-manager-ui/admin/src/views/system/resource/list.vue
View file @
dc4dba71
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
'tableData'
:config=
'tableConfig'
/>
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
/>
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
</div>
</
template
>
<
script
>
import
table
from
'
@/assets/mixins/table
'
;
import
table
from
"
@/assets/mixins/table
"
;
import
dialogShow
from
"
./dialogshow
"
;
export
default
{
mixins
:
[
table
],
components
:
{
components
:
{
dialogShow
,
},
methods
:
{
...
...
@@ -32,56 +32,62 @@ export default {
config
:
{
search
:
[
{
name
:
'
name
'
,
type
:
'
text
'
,
label
:
'
资源名称
'
,
name
:
"
name
"
,
type
:
"
text
"
,
label
:
"
资源名称
"
,
},
{
name
:
'
authType
'
,
type
:
'
select
'
,
label
:
'
权限类型
'
,
name
:
"
authType
"
,
type
:
"
select
"
,
label
:
"
权限类型
"
,
},
],
columns
:
[
{
type
:
"
selection
"
,
reserveSelection
:
true
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
align
:
"
center
"
,
width
:
50
},
{
type
:
"
selection
"
,
reserveSelection
:
true
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
align
:
"
center
"
,
width
:
50
},
// {
// prop: 'id',
// label: 'ID',
// },
{
prop
:
'
name
'
,
label
:
'
名称
'
,
prop
:
"
name
"
,
label
:
"
名称
"
,
formatter
:
(
row
)
=>
(
row
.
name
?
row
.
name
:
"
--
"
),
},
{
prop
:
'
url
'
,
label
:
'
资源
'
,
prop
:
"
url
"
,
label
:
"
资源
"
,
formatter
:
(
row
)
=>
(
row
.
url
?
row
.
url
:
"
--
"
),
},
{
prop
:
'
authType
'
,
label
:
'
认证类型
'
,
prop
:
"
authType
"
,
label
:
"
认证类型
"
,
formatter
:
this
.
formatter
,
},
},
// {
// prop: 'userType',
// label: '用户类型',
// width: 100,
// formatter: this.formatter,
// },
// },
{
label
:
'
操作
'
,
label
:
"
操作
"
,
witdh
:
120
,
formatter
:
(
row
)
=>
{
formatter
:
(
row
)
=>
{
return
(
<
table
-
buttons
noView
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onDel
=
{
this
.
toDel
}
/
>
)
<
table
-
buttons
noView
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onDel
=
{
this
.
toDel
}
/
>
);
},
},
],
},
}
}
}
}
;
}
,
}
;
</
script
>
smart-office-manager-ui/admin/src/views/system/role/list.vue
View file @
dc4dba71
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
/>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
/>
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
<el-dialog
title=
"分配权限"
:visible.sync=
"auth.visible"
>
<el-form
:model=
"auth.form"
>
...
...
@@ -158,7 +158,7 @@ import table from "@/assets/mixins/table";
import
dialogShow
from
"
./dialogshow
"
;
export
default
{
mixins
:
[
table
],
components
:
{
dialogShow
},
components
:
{
dialogShow
},
created
()
{},
methods
:
{
beforeRender
(
data
)
{
...
...
@@ -186,7 +186,7 @@ export default {
return
this
.
allResources
;
}
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
$post
(
"
/resource/list
"
,
{
size
:
-
1
})
this
.
$post
(
"
/resource/list
"
,
{
size
:
-
1
})
.
then
(({
data
})
=>
{
resolve
(
this
.
groupByAuth
(
data
.
data
));
})
...
...
@@ -224,8 +224,8 @@ export default {
getRoleAuths
(
id
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
$post
(
"
/role/auth/list
"
,
{
"
roleId
"
:
id
,
"
size
"
:
-
1
,
roleId
:
id
,
size
:
-
1
,
})
.
then
(({
data
})
=>
{
const
result
=
data
.
data
.
map
((
i
)
=>
i
.
resourceId
);
...
...
@@ -240,7 +240,7 @@ export default {
this
.
auth
.
form
.
resourceIdList
=
this
.
auth
.
checkList
.
filter
((
i
)
=>
typeof
i
===
"
number
"
)
.
join
(
"
,
"
);
await
this
.
$post
(
"
/role/auth/distributionSource
"
,
this
.
auth
.
form
);
await
this
.
$post
(
"
/role/auth/distributionSource
"
,
this
.
auth
.
form
);
this
.
auth
.
visible
=
false
;
this
.
auth
.
form
=
this
.
initForm
();
this
.
$message
.
success
(
"
操作成功
"
);
...
...
@@ -255,7 +255,7 @@ export default {
// return this.allUsers;
// }
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
$post
(
"
/user/list
"
,
{
size
:
-
1
})
this
.
$post
(
"
/user/list
"
,
{
size
:
-
1
})
.
then
(({
data
})
=>
{
resolve
(
data
.
data
);
})
...
...
@@ -281,10 +281,10 @@ export default {
async
getUsersoo
(
userTypeIdVal
,
loginNameVal
,
realNameVal
)
{
const
query
=
{
"
size
"
:
-
1
,
"
userType
"
:
userTypeIdVal
,
"
loginName
"
:
loginNameVal
,
"
realName
"
:
realNameVal
,
size
:
-
1
,
userType
:
userTypeIdVal
,
loginName
:
loginNameVal
,
realName
:
realNameVal
,
};
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
$post
(
"
/user/list
"
,
query
)
...
...
@@ -336,8 +336,8 @@ export default {
getRoleUsers
(
id
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
$post
(
"
/role/user/list
"
,
{
"
roleId
"
:
id
,
"
size
"
:
-
1
,
roleId
:
id
,
size
:
-
1
,
})
.
then
(({
data
})
=>
{
const
result
=
data
.
data
...
...
@@ -380,8 +380,8 @@ export default {
async
saveUser
()
{
try
{
//this.user.form.userIdList = this.user.checkList.join(",");
this
.
user
.
form
.
userIdList
=
this
.
user
.
checkList
await
this
.
$post
(
"
/role/user/distributionUser
"
,
this
.
user
.
form
,
);
this
.
user
.
form
.
userIdList
=
this
.
user
.
checkList
;
await
this
.
$post
(
"
/role/user/distributionUser
"
,
this
.
user
.
form
);
this
.
user
.
visible
=
false
;
this
.
user
.
form
=
this
.
initForm
();
this
.
$message
.
success
(
"
操作成功
"
);
...
...
@@ -445,19 +445,20 @@ export default {
type
:
"
text
"
,
label
:
"
角色名
"
,
},
],
columns
:
[
{
type
:
"
selection
"
,
reserveSelection
:
true
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
align
:
"
center
"
,
width
:
50
},
{
type
:
"
selection
"
,
reserveSelection
:
true
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
align
:
"
center
"
,
width
:
50
},
{
prop
:
"
name
"
,
label
:
"
角色名
"
,
formatter
:
(
row
)
=>
(
row
.
name
?
row
.
name
:
"
--
"
),
},
{
{
prop
:
"
remark
"
,
label
:
"
备注
"
,
formatter
:
(
row
)
=>
(
row
.
remark
?
row
.
remark
:
"
--
"
),
},
// {
// prop: "roleType",
...
...
@@ -470,7 +471,7 @@ export default {
label
:
"
创建时间
"
,
formatter
:
this
.
formatterDate
,
},
{
label
:
"
操作
"
,
witdh
:
120
,
...
...
@@ -483,16 +484,15 @@ export default {
onEdit
=
{
this
.
toEdit
}
onDel
=
{
this
.
toDel
}
/>{" "
}
<
el
-
button
icon
=
"
el-icon-share
"
size
=
"
mini
"
type
=
"
text
"
onClick
=
{()
=>
this
.
setAuth
(
row
)}
>
分配权限
<
/el-button
>
{
/*
<
el
-
button
icon
=
"
el-icon-share
"
size
=
"
mini
"
type
=
"
text
"
onClick
=
{()
=>
this
.
setAuth
(
row
)}
>
分配权限
<
/el-button
>
{
/*
<el-button
icon="el-icon-goods"
size="mini"
...
...
@@ -547,5 +547,3 @@ export default {
margin-top
:
20px
;
}
</
style
>
smart-office-manager-ui/admin/src/views/system/task/list.vue
View file @
dc4dba71
...
...
@@ -41,23 +41,26 @@ export default {
},
],
columns
:
[
{
type
:
"
selection
"
,
reserveSelection
:
true
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
align
:
"
center
"
,
width
:
50
},
{
type
:
"
selection
"
,
reserveSelection
:
true
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
align
:
"
center
"
,
width
:
50
},
{
prop
:
"
name
"
,
label
:
"
任务名称
"
,
align
:
"
center
"
,
formatter
:
(
row
)
=>
(
row
.
name
?
row
.
name
:
"
--
"
),
},
{
prop
:
"
excuteHost
"
,
label
:
"
执行主机
"
,
align
:
"
center
"
,
formatter
:
(
row
)
=>
(
row
.
excuteHost
?
row
.
excuteHost
:
"
--
"
),
},
{
prop
:
"
excuteContainer
"
,
label
:
"
执行容器
"
,
align
:
"
center
"
,
formatter
:
(
row
)
=>
row
.
excuteContainer
?
row
.
excuteContainer
:
"
--
"
,
},
{
prop
:
"
excuteStrategy
"
,
...
...
@@ -69,6 +72,8 @@ export default {
prop
:
"
lastExcuteHost
"
,
label
:
"
最后执行主机
"
,
align
:
"
center
"
,
formatter
:
(
row
)
=>
row
.
lastExcuteHost
?
row
.
lastExcuteHost
:
"
--
"
,
},
{
prop
:
"
lastExcuteTime
"
,
...
...
@@ -103,5 +108,3 @@ export default {
},
};
</
script
>
smart-office-manager-ui/admin/src/views/system/user/list.vue
View file @
dc4dba71
...
...
@@ -110,8 +110,8 @@ export default {
getRoleUsers
(
id
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
$post
(
"
/role/user/list
"
,
{
"
userId
"
:
id
,
"
size
"
:
-
1
,
userId
:
id
,
size
:
-
1
,
})
.
then
(({
data
})
=>
{
const
result
=
data
.
data
...
...
@@ -152,22 +152,25 @@ export default {
},
config
:
{
columns
:
[
{
type
:
"
selection
"
,
reserveSelection
:
true
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
align
:
"
center
"
,
width
:
50
},
{
type
:
"
selection
"
,
reserveSelection
:
true
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
align
:
"
center
"
,
width
:
50
},
{
prop
:
"
loginName
"
,
label
:
"
登录名称
"
,
align
:
"
center
"
,
formatter
:
(
row
)
=>
(
row
.
loginName
?
row
.
loginName
:
"
--
"
),
},
{
prop
:
"
realName
"
,
label
:
"
用户名称
"
,
align
:
"
center
"
,
formatter
:
(
row
)
=>
(
row
.
realName
?
row
.
realName
:
"
--
"
),
},
{
prop
:
"
mobile
"
,
label
:
"
手机号码
"
,
align
:
"
center
"
,
formatter
:
(
row
)
=>
(
row
.
mobile
?
row
.
mobile
:
"
--
"
),
},
{
prop
:
"
roleIds
"
,
...
...
@@ -237,5 +240,3 @@ export default {
},
};
</
script
>
smart-office-manager-ui/admin/src/views/system/validcode/list.vue
View file @
dc4dba71
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
'tableData'
:config=
'tableConfig'
notAdd
notDel
/>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
notAdd
notDel
/>
</div>
</
template
>
<
script
>
import
table
from
'
@/assets/mixins/table
'
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
mixins
:
[
table
],
methods
:
{
},
methods
:
{},
data
()
{
return
{
config
:
{
columns
:
[
{
type
:
'
selection
'
,
type
:
"
selection
"
,
width
:
60
,
},
{
prop
:
'
id
'
,
label
:
'
ID
'
,
prop
:
"
id
"
,
label
:
"
ID
"
,
width
:
60
,
formatter
:
(
row
)
=>
(
row
.
id
?
row
.
id
:
"
--
"
),
},
{
prop
:
'
code
'
,
label
:
'
验证码
'
,
prop
:
"
code
"
,
label
:
"
验证码
"
,
formatter
:
(
row
)
=>
(
row
.
code
?
row
.
code
:
"
--
"
),
},
{
prop
:
'
url
'
,
label
:
'
校验地址
'
,
prop
:
"
url
"
,
label
:
"
校验地址
"
,
formatter
:
(
row
)
=>
(
row
.
url
?
row
.
url
:
"
--
"
),
},
{
prop
:
'
mobile
'
,
label
:
'
手机号码
'
,
prop
:
"
mobile
"
,
label
:
"
手机号码
"
,
formatter
:
(
row
)
=>
(
row
.
mobile
?
row
.
mobile
:
"
--
"
),
},
{
prop
:
'
email
'
,
label
:
'
校验邮箱
'
,
prop
:
"
email
"
,
label
:
"
校验邮箱
"
,
formatter
:
(
row
)
=>
(
row
.
email
?
row
.
email
:
"
--
"
),
},
{
prop
:
'
type
'
,
label
:
'
校验方式
'
,
prop
:
"
type
"
,
label
:
"
校验方式
"
,
width
:
130
,
formatter
:
this
.
formatter
,
},
{
prop
:
'
sessionId
'
,
label
:
'
会话ID
'
prop
:
"
sessionId
"
,
label
:
"
会话ID
"
,
formatter
:
(
row
)
=>
(
row
.
sessionId
?
row
.
sessionId
:
"
--
"
),
},
{
prop
:
'
ip
'
,
label
:
'
IP地址
'
prop
:
"
ip
"
,
label
:
"
IP地址
"
,
formatter
:
(
row
)
=>
(
row
.
ip
?
row
.
ip
:
"
--
"
),
},
{
prop
:
'
createTime
'
,
label
:
'
创建时间
'
prop
:
"
createTime
"
,
label
:
"
创建时间
"
,
formatter
:
(
row
)
=>
(
row
.
createTime
?
row
.
createTime
:
"
--
"
),
},
{
prop
:
'
lapseTime
'
,
label
:
'
失效时间
'
prop
:
"
lapseTime
"
,
label
:
"
失效时间
"
,
formatter
:
(
row
)
=>
(
row
.
lapseTime
?
row
.
lapseTime
:
"
--
"
),
},
{
label
:
'
操作
'
,
formatter
:
(
row
)
=>
{
label
:
"
操作
"
,
formatter
:
(
row
)
=>
{
return
(
<
table
-
buttons
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onDel
=
{
this
.
toDel
}
/
>
)
<
table
-
buttons
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onDel
=
{
this
.
toDel
}
/
>
);
},
},
],
search
:
[
{
name
:
'
mobile
'
,
type
:
'
text
'
,
label
:
'
手机号码
'
,
name
:
"
mobile
"
,
type
:
"
text
"
,
label
:
"
手机号码
"
,
},
]
]
,
},
}
}
}
};
},
};
</
script
>
smart-office-manager-ui/admin/src/views/workman/list.vue
View file @
dc4dba71
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
<!--
<el-button
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
<!--
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
...
...
@@ -16,250 +16,286 @@
@
click=
"doExport"
:disabled=
"isExport"
>
导出
</el-button>
-->
</LayoutTable>
<!-- 工作人员导入对话框 -->
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
:disabled=
"upload.isUploading"
:on-progress=
"handleFileUploadProgress"
:on-success=
"handleFileSuccess"
:auto-upload=
"false"
drag
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em>
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的数据
<el-link
type=
"primary"
style=
"font-size: 14px"
@
click=
"downloadTemplate"
>
下载模板
</el-link
>
</div>
<div
class=
"el-upload__tip"
style=
"color: red"
slot=
"tip"
>
提示:仅允许导入“xls”或“xlsx”格式文件!
</div>
</el-upload>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitFileForm"
>
确 定
</el-button>
<el-button
@
click=
"upload.open = false"
>
取 消
</el-button>
</div>
</el-dialog>
<el-dialog
:title=
"user.title"
:visible.sync=
"user.open"
width=
"400px"
append-to-body
</LayoutTable>
<!-- 工作人员导入对话框 -->
<el-dialog
:title=
"upload.title"
:visible.sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
:disabled=
"upload.isUploading"
:on-progress=
"handleFileUploadProgress"
:on-success=
"handleFileSuccess"
:auto-upload=
"false"
drag
>
<el-form
label-width=
"80px"
>
<el-form-item
label=
"新密码"
>
<el-input
v-model=
"newPwd"
></el-input>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitUserForm"
>
确 定
</el-button>
<el-button
@
click=
"user.open = false"
>
取 消
</el-button>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em>
</div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的数据
<el-link
type=
"primary"
style=
"font-size: 14px"
@
click=
"downloadTemplate"
>
下载模板
</el-link
>
</div>
<div
class=
"el-upload__tip"
style=
"color: red"
slot=
"tip"
>
提示:仅允许导入“xls”或“xlsx”格式文件!
</div>
</el-dialog>
</el-upload>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitFileForm"
>
确 定
</el-button>
<el-button
@
click=
"upload.open = false"
>
取 消
</el-button>
</div>
</el-dialog>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
<el-dialog
:title=
"user.title"
:visible.sync=
"user.open"
width=
"400px"
append-to-body
>
<el-form
label-width=
"80px"
>
<el-form-item
label=
"新密码"
>
<el-input
v-model=
"newPwd"
></el-input>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitUserForm"
>
确 定
</el-button>
<el-button
@
click=
"user.open = false"
>
取 消
</el-button>
</div>
</el-dialog>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
</
template
>
<
script
>
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
WorkmanList
"
,
components
:
{
drawerShow
},
mixins
:
[
table
],
created
()
{
/** 表单弹出框模式需引入 */
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
WorkmanList
"
,
components
:
{
drawerShow
,
},
mixins
:
[
table
],
created
()
{},
methods
:
{
/** 导入 */
handleImport
()
{
this
.
upload
.
title
=
"
工作人员导入
"
;
this
.
upload
.
open
=
true
;
},
/** 下载模板操作 */
downloadTemplate
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/workman/downloadTemplate
"
,
{},
{
type
:
"
excel
"
})
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 文件上传中处理 */
handleFileUploadProgress
(
event
,
file
,
fileList
)
{
this
.
upload
.
isUploading
=
true
;
},
/** 文件上传成功处理 */
handleFileSuccess
(
response
,
file
,
fileList
)
{
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
this
.
$alert
(
response
.
msg
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
this
.
getData
();
},
/** 提交上传文件 */
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
},
/** 导出Excel */
doExport
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/workman/exportExcel
"
,
{
idList
:
this
.
selection
,
},
methods
:
{
/** 导入 */
handleImport
()
{
this
.
upload
.
title
=
"
工作人员导入
"
;
this
.
upload
.
open
=
true
;
},
/** 下载模板操作 */
downloadTemplate
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/workman/downloadTemplate
"
,
{},
{
type
:
"
excel
"
})
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 文件上传中处理 */
handleFileUploadProgress
(
event
,
file
,
fileList
)
{
this
.
upload
.
isUploading
=
true
;
},
/** 文件上传成功处理 */
handleFileSuccess
(
response
,
file
,
fileList
)
{
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
this
.
$alert
(
response
.
msg
,
"
导入结果
"
,
{
dangerouslyUseHTMLString
:
true
});
this
.
getData
();
},
/** 提交上传文件 */
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
},
/** 导出Excel */
doExport
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/workman/exportExcel
"
,
{
"
idList
"
:
this
.
selection
,
},
{
type
:
"
excel
"
}).
then
(()
=>
this
.
isExport
=
false
).
catch
(
error
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
{
type
:
"
excel
"
}
)
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
toView
(
row
)
{
this
.
$refs
.
drawerform
.
view
(
row
);
},
handleChangePwd
(
row
)
{
this
.
user
.
title
=
"
修改密码
"
;
handleChangePwd
(
row
)
{
this
.
user
.
title
=
"
修改密码
"
;
this
.
loginName
=
row
.
loginName
;
this
.
newPwd
=
null
;
this
.
loginName
=
row
.
loginName
;
this
.
newPwd
=
null
;
this
.
user
.
open
=
true
;
},
this
.
user
.
open
=
true
;
},
submitUserForm
()
{
this
.
$post
(
"
/workman/change/password
"
,
{
loginName
:
this
.
loginName
,
newPwd
:
this
.
newPwd
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
"
批量更新大厅设备成功!
"
);
this
.
user
.
open
=
false
;
submitUserForm
()
{
this
.
$post
(
"
/workman/change/password
"
,
{
loginName
:
this
.
loginName
,
newPwd
:
this
.
newPwd
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
.
success
(
"
批量更新大厅设备成功!
"
);
this
.
user
.
open
=
false
;
this
.
getData
();
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
},
this
.
getData
();
}
})
.
catch
((
error
)
=>
{
this
.
$message
.
error
(
error
.
message
);
});
},
},
data
()
{
return
{
loginName
:
null
,
newPwd
:
null
,
// 用户导入参数
upload
:
{
// 是否显示弹出层(工作人员导入)
open
:
false
,
// 弹出层标题(工作人员导入)
title
:
"
导入工作人员数据
"
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的数据
updateSupport
:
0
,
// 上传的地址
url
:
"
/m/workman/importData
"
,
},
user
:
{
// 是否显示弹出层(工作人员导入)
open
:
false
,
// 弹出层标题(工作人员导入)
title
:
"
修改密码
"
,
},
isExport
:
false
,
config
:
{
search
:
[],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
},
data
()
{
return
{
loginName
:
null
,
newPwd
:
null
,
// 用户导入参数
upload
:
{
// 是否显示弹出层(工作人员导入)
open
:
false
,
// 弹出层标题(工作人员导入)
title
:
"
导入工作人员数据
"
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的数据
updateSupport
:
0
,
// 上传的地址
url
:
"
/m/workman/importData
"
,
},
user
:
{
// 是否显示弹出层(工作人员导入)
open
:
false
,
// 弹出层标题(工作人员导入)
title
:
"
修改密码
"
,
},
isExport
:
false
,
config
:
{
search
:
[
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
照片
"
,
prop
:
"
photoPath
"
,
formatter
:
(
row
)
=>
{
return
row
.
photoPath
!=
""
?
(
<
el
-
image
style
=
"
width: 70px; height: 70px
"
src
=
{
row
.
photoPath
}
preview
-
src
-
list
=
{[
row
.
photoPath
]}
><
/el-image
>
)
:
(
"
--
"
);
},},
{
label
:
"
姓名
"
,
prop
:
"
name
"
},
{
label
:
"
所属部门
"
,
prop
:
"
deptName
"
},
{
label
:
"
所属房间
"
,
prop
:
"
roomName
"
},
{
label
:
"
职位
"
,
prop
:
"
userPost
"
},
{
label
:
"
照片
"
,
prop
:
"
photoPath
"
,
formatter
:
(
row
)
=>
{
return
row
.
photoPath
!=
""
?
(
<
el
-
image
style
=
"
width: 70px; height: 70px
"
src
=
{
row
.
photoPath
}
preview
-
src
-
list
=
{[
row
.
photoPath
]}
><
/el-image
>
)
:
(
"
--
"
);
},
},
{
label
:
"
电话
"
,
prop
:
"
phone
"
},
{
label
:
"
手机
"
,
prop
:
"
mobile
"
},
{
label
:
"
姓名
"
,
prop
:
"
name
"
,
formatter
:
(
row
)
=>
(
row
.
name
?
row
.
name
:
"
--
"
),
},
{
label
:
"
所属部门
"
,
prop
:
"
deptName
"
,
formatter
:
(
row
)
=>
(
row
.
deptName
?
row
.
deptName
:
"
--
"
),
},
{
label
:
"
工作状态
"
,
prop
:
"
workStatus
"
},
{
label
:
"
所属房间
"
,
prop
:
"
roomName
"
,
formatter
:
(
row
)
=>
(
row
.
roomName
?
row
.
roomName
:
"
--
"
),
},
{
label
:
"
操作
"
,
width
:
240
,
formatter
:
row
=>
{
return
(
<
div
>
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
{
label
:
"
职位
"
,
prop
:
"
userPost
"
,
formatter
:
(
row
)
=>
(
row
.
userPost
?
row
.
userPost
:
"
--
"
),
},
<
span
>
<
/span
>
<
el
-
button
type
=
"
text
"
size
=
"
mini
"
onClick
=
{()
=>
this
.
handleChangePwd
(
row
)}
>
修改密码
<
/el-button
>
{
label
:
"
电话
"
,
prop
:
"
phone
"
,
formatter
:
(
row
)
=>
(
row
.
phone
?
row
.
phone
:
"
--
"
),
},
{
label
:
"
手机
"
,
prop
:
"
mobile
"
,
formatter
:
(
row
)
=>
(
row
.
mobile
?
row
.
mobile
:
"
--
"
),
},
{
label
:
"
工作状态
"
,
prop
:
"
workStatus
"
,
formatter
:
(
row
)
=>
(
row
.
workStatus
?
row
.
workStatus
:
"
--
"
),
},
<
/div
>
{
label
:
"
操作
"
,
width
:
240
,
formatter
:
(
row
)
=>
{
return
(
<
div
>
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
);
}
}
]
}
};
}
<
span
>
<
/span
>
<
el
-
button
type
=
"
text
"
size
=
"
mini
"
onClick
=
{()
=>
this
.
handleChangePwd
(
row
)}
>
修改密码
<
/el-button
>
<
/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