|
|
|
|
@ -1,10 +1,16 @@ |
|
|
|
|
<template> |
|
|
|
|
<basic-container> |
|
|
|
|
<avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" :permission="permissionList" |
|
|
|
|
@search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" |
|
|
|
|
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
|
|
|
|
<avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" |
|
|
|
|
:permission="permissionList" @search-change="searchChange" @search-reset="searchReset" |
|
|
|
|
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" @on-load="onLoad"> |
|
|
|
|
<template #menu-left="{}"> |
|
|
|
|
<el-button>新增</el-button> |
|
|
|
|
<el-button type="prmary" icon="el-icon-plus" size="small">新增</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template #menu="{ row, index, size }"> |
|
|
|
|
<el-button type="text" :size="size" icon="el-icon-view" @click="$refs.crud.rowEdit(row, index)">详情</el-button> |
|
|
|
|
<el-button type="text" :size="size" icon="el-icon-edit" @click="$refs.crud.rowEdit(row, index)">编辑</el-button> |
|
|
|
|
<el-button type="text" :size="size" icon="el-icon-delete" @click="$refs.crud.rowDel(row, index)">删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
</basic-container> |
|
|
|
|
@ -64,7 +70,7 @@ export default { |
|
|
|
|
prop: "nodeLabel", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "创建时间时间", |
|
|
|
|
label: "创建时间", |
|
|
|
|
prop: "createTime", |
|
|
|
|
labelWidth: 120, |
|
|
|
|
}, { |
|
|
|
|
@ -96,7 +102,6 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
// this.loadDict(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
//字典加载 |
|
|
|
|
@ -116,11 +121,11 @@ export default { |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
bizDeviceStatus(token).then(res => { |
|
|
|
|
if(res.data.code == 401){ |
|
|
|
|
if (res.data.code == 401) { |
|
|
|
|
window.sessionStorage.removeItem('bizToken'); |
|
|
|
|
this.loadDict(); |
|
|
|
|
} |
|
|
|
|
else if(res.data.code == 200){ |
|
|
|
|
else if (res.data.code == 200) { |
|
|
|
|
const column = this.findObject(this.option.column, "status"); |
|
|
|
|
column.dicData = res.data.data; |
|
|
|
|
} |
|
|
|
|
@ -132,7 +137,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//节点类型转换 |
|
|
|
|
renderLabel(node,col) { |
|
|
|
|
renderLabel(node, col) { |
|
|
|
|
const column = this.findObject(this.option.column, col); |
|
|
|
|
let idx = column.dicData.findIndex(item => item.dictValue == node); |
|
|
|
|
return idx > -1 ? column.dicData[idx].dictLabel : ''; |
|
|
|
|
@ -264,18 +269,18 @@ export default { |
|
|
|
|
bizDeviceList(token, { ...values, pageSize: page.pageSize, pageNo: page.currentPage }).then(res2 => { |
|
|
|
|
this.loading = false; |
|
|
|
|
this.selectionClear(); |
|
|
|
|
if(res2.data.code == 401){ |
|
|
|
|
if (res2.data.code == 401) { |
|
|
|
|
console.log(res2.data.code) |
|
|
|
|
window.sessionStorage.removeItem('bizToken'); |
|
|
|
|
this.onLoad(); |
|
|
|
|
} |
|
|
|
|
else if(res2.data.code == 200){ |
|
|
|
|
else if (res2.data.code == 200) { |
|
|
|
|
const data = res2.data; |
|
|
|
|
this.page.total = data.total; |
|
|
|
|
data.rows.map(item => { |
|
|
|
|
item.node = item.bizProduct.node; |
|
|
|
|
item.nodeLabel = this.renderLabel(item.node,'node'); |
|
|
|
|
item.statusLabel = this.renderLabel(item.status,'status') |
|
|
|
|
// item.nodeLabel = this.renderLabel(item.node,'node'); |
|
|
|
|
// item.statusLabel = this.renderLabel(item.status,'status') |
|
|
|
|
}) |
|
|
|
|
this.data = data.rows; |
|
|
|
|
} |
|
|
|
|
|