|
|
@ -12,6 +12,7 @@ |
|
|
|
@row-update="rowUpdate" |
|
|
|
@row-update="rowUpdate" |
|
|
|
@row-save="rowSave" |
|
|
|
@row-save="rowSave" |
|
|
|
@row-del="rowDel" |
|
|
|
@row-del="rowDel" |
|
|
|
|
|
|
|
@selection-change="selectionChange" |
|
|
|
@search-change="searchChange" |
|
|
|
@search-change="searchChange" |
|
|
|
@search-reset="searchReset" |
|
|
|
@search-reset="searchReset" |
|
|
|
@current-change="currentChange" |
|
|
|
@current-change="currentChange" |
|
|
@ -27,8 +28,41 @@ |
|
|
|
@click="handleExport" |
|
|
|
@click="handleExport" |
|
|
|
>导出 |
|
|
|
>导出 |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
icon="el-icon-upload2" |
|
|
|
|
|
|
|
@click="handleImport" |
|
|
|
|
|
|
|
>导入</el-button |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
|
|
type="danger" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
icon="el-icon-delete" |
|
|
|
|
|
|
|
plain |
|
|
|
|
|
|
|
@click="handleDelete" |
|
|
|
|
|
|
|
>删 除 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</avue-crud> |
|
|
|
</avue-crud> |
|
|
|
|
|
|
|
<el-dialog |
|
|
|
|
|
|
|
title="设备数据导入" |
|
|
|
|
|
|
|
append-to-body |
|
|
|
|
|
|
|
:visible.sync="excelBox" |
|
|
|
|
|
|
|
width="555px" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<avue-form |
|
|
|
|
|
|
|
:option="excelOption" |
|
|
|
|
|
|
|
v-model="excelForm" |
|
|
|
|
|
|
|
:upload-after="uploadAfter" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<template slot="excelTemplate"> |
|
|
|
|
|
|
|
<el-button type="primary" @click="handleTemplate"> |
|
|
|
|
|
|
|
点击下载<i class="el-icon-download el-icon--right"></i> |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</avue-form> |
|
|
|
|
|
|
|
</el-dialog> |
|
|
|
</basic-container> |
|
|
|
</basic-container> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
@ -48,6 +82,8 @@ export default { |
|
|
|
form: {}, |
|
|
|
form: {}, |
|
|
|
query: {}, |
|
|
|
query: {}, |
|
|
|
loading: false, |
|
|
|
loading: false, |
|
|
|
|
|
|
|
excelBox: false, |
|
|
|
|
|
|
|
selectionList: [], |
|
|
|
page: { |
|
|
|
page: { |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 10, |
|
|
|
currentPage: 1, |
|
|
|
currentPage: 1, |
|
|
@ -64,7 +100,7 @@ export default { |
|
|
|
dialogDrag: true, //表单窗口拖拽 |
|
|
|
dialogDrag: true, //表单窗口拖拽 |
|
|
|
delBtn: true, |
|
|
|
delBtn: true, |
|
|
|
columnBtn: false, |
|
|
|
columnBtn: false, |
|
|
|
selection: false, |
|
|
|
selection: true, |
|
|
|
dialogClickModal: false, |
|
|
|
dialogClickModal: false, |
|
|
|
dialogWidth: "60%", |
|
|
|
dialogWidth: "60%", |
|
|
|
column: [ |
|
|
|
column: [ |
|
|
@ -216,8 +252,68 @@ export default { |
|
|
|
], |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
data: [], |
|
|
|
data: [], |
|
|
|
|
|
|
|
excelForm: {}, |
|
|
|
|
|
|
|
excelOption: { |
|
|
|
|
|
|
|
submitBtn: false, |
|
|
|
|
|
|
|
emptyBtn: false, |
|
|
|
|
|
|
|
column: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: "导入设备", |
|
|
|
|
|
|
|
prop: "excelFile", |
|
|
|
|
|
|
|
type: "upload", |
|
|
|
|
|
|
|
drag: true, |
|
|
|
|
|
|
|
loadText: "设备上传中,请稍等", |
|
|
|
|
|
|
|
span: 24, |
|
|
|
|
|
|
|
propsHttp: { |
|
|
|
|
|
|
|
res: "data", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
tip: "请上传 .xls,.xlsx 标准格式文件", |
|
|
|
|
|
|
|
action: "/api/iot-system/user/import-user", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: "数据覆盖", |
|
|
|
|
|
|
|
prop: "isCovered", |
|
|
|
|
|
|
|
type: "switch", |
|
|
|
|
|
|
|
align: "center", |
|
|
|
|
|
|
|
width: 80, |
|
|
|
|
|
|
|
dicData: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: "否", |
|
|
|
|
|
|
|
value: 0, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: "是", |
|
|
|
|
|
|
|
value: 1, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
value: 0, |
|
|
|
|
|
|
|
slot: true, |
|
|
|
|
|
|
|
rules: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请选择是否覆盖", |
|
|
|
|
|
|
|
trigger: "blur", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: "模板下载", |
|
|
|
|
|
|
|
prop: "excelTemplate", |
|
|
|
|
|
|
|
formslot: true, |
|
|
|
|
|
|
|
span: 24, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
|
|
|
|
"excelForm.isCovered"() { |
|
|
|
|
|
|
|
if (this.excelForm.isCovered !== "") { |
|
|
|
|
|
|
|
const column = this.findObject(this.excelOption.column, "excelFile"); |
|
|
|
|
|
|
|
column.action = `${this.baseUrl}/${this.apis}/iot-sim/device/import-device?isCovered=${this.excelForm.isCovered}`; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
...mapGetters(["permission"]), |
|
|
|
...mapGetters(["permission"]), |
|
|
|
permissionList() { |
|
|
|
permissionList() { |
|
|
@ -227,6 +323,13 @@ export default { |
|
|
|
// delBtn: this.vaildData(this.permission.sourceApi_delete, false), |
|
|
|
// delBtn: this.vaildData(this.permission.sourceApi_delete, false), |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
ids() { |
|
|
|
|
|
|
|
let ids = []; |
|
|
|
|
|
|
|
this.selectionList.forEach((ele) => { |
|
|
|
|
|
|
|
ids.push(ele.id); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return ids.join(","); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
beforeOpen(done, type) { |
|
|
|
beforeOpen(done, type) { |
|
|
@ -299,6 +402,62 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
//批量删除 |
|
|
|
|
|
|
|
handleDelete() { |
|
|
|
|
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
|
|
|
|
this.$message.warning("请选择至少一条数据"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.$confirm("确定将选择数据删除?", { |
|
|
|
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
|
|
|
type: "warning", |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.then(() => { |
|
|
|
|
|
|
|
return remove(this.ids); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.then(() => { |
|
|
|
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
|
|
|
this.$message({ |
|
|
|
|
|
|
|
type: "success", |
|
|
|
|
|
|
|
message: "操作成功!", |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//多选框 |
|
|
|
|
|
|
|
selectionChange(list) { |
|
|
|
|
|
|
|
this.selectionList = list; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//多选框清除 |
|
|
|
|
|
|
|
selectionClear() { |
|
|
|
|
|
|
|
this.selectionList = []; |
|
|
|
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleImport() { |
|
|
|
|
|
|
|
this.excelBox = true; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
uploadAfter(res, done, loading, column) { |
|
|
|
|
|
|
|
window.console.log(column); |
|
|
|
|
|
|
|
this.excelBox = false; |
|
|
|
|
|
|
|
this.refreshChange(); |
|
|
|
|
|
|
|
done(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleExport() { |
|
|
|
|
|
|
|
this.$confirm("是否导出用户数据?", "提示", { |
|
|
|
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
|
|
|
type: "warning", |
|
|
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
|
|
window.open( |
|
|
|
|
|
|
|
`/api/iot-system/user/export-user?${ |
|
|
|
|
|
|
|
this.website.tokenHeader |
|
|
|
|
|
|
|
}=${getToken()}&account=${this.search.account}&realName=${ |
|
|
|
|
|
|
|
this.search.realName |
|
|
|
|
|
|
|
}` |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
currentChange(currentPage) { |
|
|
|
currentChange(currentPage) { |
|
|
|
this.page.currentPage = currentPage; |
|
|
|
this.page.currentPage = currentPage; |
|
|
|
}, |
|
|
|
}, |
|
|
|