diff --git a/src/views/communicationmanage/basiccard/basiccard.vue b/src/views/communicationmanage/basiccard/basiccard.vue index a834357..c5f9a07 100644 --- a/src/views/communicationmanage/basiccard/basiccard.vue +++ b/src/views/communicationmanage/basiccard/basiccard.vue @@ -42,12 +42,14 @@ @click="handleAllocate" >分拨 - + icon="el-icon-delete" + plain + @click="handleDelete" + >删 除 + { @@ -344,18 +346,18 @@ export default { delBtn: true, excelBtn: false, columnBtn: false, - selection: false, + selection: true, dialogClickModal: false, dialogWidth: "60%", column: [ - { + { label: "id", prop: "id", type: "input", search: false, - addDisplay:false, - editDisplay:false, - width:170, + addDisplay: false, + editDisplay: false, + width: 170, }, { label: "通道名称", @@ -364,7 +366,7 @@ export default { dataType: "String", span: 12, labelWidth: 130, - width:100, + width: 100, search: true, dicUrl: "/api/iot-sim/channel/fillData", props: { @@ -438,7 +440,7 @@ export default { span: 12, labelWidth: 130, search: true, - width:115, + width: 115, addDisplay: false, rules: [ { @@ -483,7 +485,7 @@ export default { prop: "msisdn", span: 12, labelWidth: 130, - width:110, + width: 110, search: true, rules: [ { @@ -522,8 +524,8 @@ export default { dataType: "number", span: 12, labelWidth: 130, - addDisplay:false, - editDisplay:false, + addDisplay: false, + editDisplay: false, width: 70, search: true, rules: [ @@ -721,6 +723,29 @@ 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; @@ -743,16 +768,6 @@ export default { refreshChange() { this.onLoad(this.page, this.query); }, - //批量出库 - delivery() { - if (this.selectionList.length === 0) { - this.$message.warning("请选择至少一条数据"); - return; - } else { - this.$message.error(this.ids); - console.log(this.ids, typeof this.ids); - } - }, //导出 handleExport() { window.open( diff --git a/src/views/communicationmanage/device/device.vue b/src/views/communicationmanage/device/device.vue index d497b13..17da7cb 100644 --- a/src/views/communicationmanage/device/device.vue +++ b/src/views/communicationmanage/device/device.vue @@ -12,6 +12,7 @@ @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel" + @selection-change="selectionChange" @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange" @@ -27,8 +28,41 @@ @click="handleExport" >导出 + 导入 + 删 除 + + + + + + @@ -48,6 +82,8 @@ export default { form: {}, query: {}, loading: false, + excelBox: false, + selectionList: [], page: { pageSize: 10, currentPage: 1, @@ -64,7 +100,7 @@ export default { dialogDrag: true, //表单窗口拖拽 delBtn: true, columnBtn: false, - selection: false, + selection: true, dialogClickModal: false, dialogWidth: "60%", column: [ @@ -216,8 +252,68 @@ export default { ], }, 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: { ...mapGetters(["permission"]), permissionList() { @@ -227,6 +323,13 @@ export default { // delBtn: this.vaildData(this.permission.sourceApi_delete, false), }; }, + ids() { + let ids = []; + this.selectionList.forEach((ele) => { + ids.push(ele.id); + }); + return ids.join(","); + }, }, methods: { 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) { this.page.currentPage = currentPage; }, diff --git a/src/views/communicationmanage/outbound/outbound.vue b/src/views/communicationmanage/outbound/outbound.vue index 04e55d1..74d88ae 100644 --- a/src/views/communicationmanage/outbound/outbound.vue +++ b/src/views/communicationmanage/outbound/outbound.vue @@ -13,6 +13,7 @@ @row-save="rowSave" @row-del="rowDel" @search-change="searchChange" + @selection-change="selectionChange" @search-reset="searchReset" @current-change="currentChange" @size-change="sizeChange" @@ -27,6 +28,14 @@ @click="handleExport" >导出 + 删 除 + @@ -47,6 +56,7 @@ export default { return { form: {}, query: {}, + selectionList: [], loading: true, page: { pageSize: 10, @@ -64,7 +74,7 @@ export default { delBtn: true, dialogDrag: true, columnBtn: false, - selection: false, + selection: true, dialogClickModal: false, dialogWidth: "60%", column: [ @@ -153,11 +163,11 @@ export default { }, ], }, - { + { label: "基础套餐", prop: "dataPlanId", type: "select", - dicUrl: "/api/iot-sim/dataplan/fillData?isSource="+2, + dicUrl: "/api/iot-sim/dataplan/fillData?isSource=" + 2, props: { label: "name", value: "id", @@ -166,7 +176,7 @@ export default { span: 12, labelWidth: 130, searchLabelWidth: 110, - width:110, + width: 110, search: true, rules: [ { @@ -286,7 +296,7 @@ export default { labelWidth: 130, searchLabelWidth: 124, search: false, - width:120, + width: 120, rules: [ { required: true, @@ -452,6 +462,13 @@ export default { // delBtn: this.vaildData(this.permission.sourceApi_delete, false), }; }, + ids() { + let ids = []; + this.selectionList.forEach((ele) => { + ids.push(ele.id); + }); + return ids.join(","); + }, }, methods: { beforeOpen(done, type) { @@ -525,6 +542,38 @@ 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(); + }, currentChange(currentPage) { this.page.currentPage = currentPage; }, @@ -537,7 +586,9 @@ export default { //导出 handleExport() { window.open( - `${this.baseUrl}/${this.apis}iot-sim/simcarddeliver/export-simCardDeliver?${ + `${this.baseUrl}/${ + this.apis + }iot-sim/simcarddeliver/export-simCardDeliver?${ this.website.tokenHeader }=${getToken()}` );