From 1624332f01c2c86a527154a089b7649e9e99ecce Mon Sep 17 00:00:00 2001 From: dhy1725534722 <1725534722@qq.com> Date: Thu, 19 Oct 2023 14:59:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=89=B9=E9=87=8F=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E7=A6=81=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/tcZz/netWorkYq/yqbg.js | 16 + src/api/tcZz/netWorkYq/yqxxltj.js | 16 + src/api/tcZz/netWorkYq/yqyj.js | 16 + src/api/tcZz/netWorkYq/zbxq.js | 16 + src/api/tcZz/networkSecurity/bmtb.js | 16 + src/api/tcZz/networkSecurity/cybersecurity.js | 16 + src/api/tcZz/networkSecurity/dbdw.js | 16 + src/api/tcZz/networkSecurity/dbxt.js | 16 + src/api/tcZz/networkSecurity/idcdw.js | 16 + src/api/tcZz/networkSecurity/jgdw.js | 16 + src/api/tcZz/networkSecurity/sdtb.js | 16 + src/api/tcZz/networkSecurity/tbcz.js | 16 + src/api/tcZz/networkSecurity/xtjc.js | 18 +- src/api/tcZz/networkSecurity/zfwz.js | 16 + src/api/tcZz/networkSecurity/zxyh.js | 16 + src/views/tcZz/netWorkYq/yqbg/index.vue | 1023 ++++++++++------- src/views/tcZz/netWorkYq/yqxxltj/index.vue | 187 +-- src/views/tcZz/netWorkYq/yqyj/index.vue | 109 +- src/views/tcZz/netWorkYq/zbxq/index.vue | 939 +++++++++------ src/views/tcZz/networkSecurity/bmtb/index.vue | 110 +- .../networkSecurity/cybersecurity/index.vue | 116 +- src/views/tcZz/networkSecurity/dbdw/index.vue | 112 +- src/views/tcZz/networkSecurity/dbxt/index.vue | 108 +- .../tcZz/networkSecurity/idcdw/index.vue | 110 +- src/views/tcZz/networkSecurity/jgdw/index.vue | 111 +- src/views/tcZz/networkSecurity/ryz/index.vue | 10 +- src/views/tcZz/networkSecurity/sdtb/index.vue | 106 +- src/views/tcZz/networkSecurity/tbcz/index.vue | 113 +- src/views/tcZz/networkSecurity/xtjc/index.vue | 113 +- src/views/tcZz/networkSecurity/zfwz/index.vue | 109 +- src/views/tcZz/networkSecurity/zxyh/index.vue | 113 +- 31 files changed, 2807 insertions(+), 924 deletions(-) diff --git a/src/api/tcZz/netWorkYq/yqbg.js b/src/api/tcZz/netWorkYq/yqbg.js index d1b351b..794cab0 100644 --- a/src/api/tcZz/netWorkYq/yqbg.js +++ b/src/api/tcZz/netWorkYq/yqbg.js @@ -42,3 +42,19 @@ export function delYqbg(id) { method: 'delete' }) } +//批量启用禁用 +export function isStatusYqbg(params) { + return request({ + url: '/tcZz/netWorkYq/yqbg/isStatus', + method: 'get', + params + }) +} +//通用导入信息 +export function importYqbg(data) { + return request({ + url: '/tcZz/netWorkYq/yqbg/common/importExcel', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/api/tcZz/netWorkYq/yqxxltj.js b/src/api/tcZz/netWorkYq/yqxxltj.js index 1d63537..330c40a 100644 --- a/src/api/tcZz/netWorkYq/yqxxltj.js +++ b/src/api/tcZz/netWorkYq/yqxxltj.js @@ -42,3 +42,19 @@ export function delYqxxltj(id) { method: 'delete' }) } +//批量启用禁用 +export function isStatusYqxxltj(params) { + return request({ + url: '/tcZz/netWorkYq/yqxxltj/isStatus', + method: 'get', + params + }) +} +//通用导入信息 +export function importYqxxltj(data) { + return request({ + url: '/tcZz/netWorkYq/yqxxltj/common/importExcel', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/api/tcZz/netWorkYq/yqyj.js b/src/api/tcZz/netWorkYq/yqyj.js index d23edeb..2cedd9c 100644 --- a/src/api/tcZz/netWorkYq/yqyj.js +++ b/src/api/tcZz/netWorkYq/yqyj.js @@ -42,3 +42,19 @@ export function delYqyj(id) { method: 'delete' }) } +//批量启用禁用 +export function isStatusYqyj(params) { + return request({ + url: '/tcZz/netWorkYq/yqyj/isStatus', + method: 'get', + params + }) +} +//通用导入信息 +export function importYqyj(data) { + return request({ + url: '/tcZz/netWorkYq/yqyj/common/importExcel', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/api/tcZz/netWorkYq/zbxq.js b/src/api/tcZz/netWorkYq/zbxq.js index 52c0392..d9e2e97 100644 --- a/src/api/tcZz/netWorkYq/zbxq.js +++ b/src/api/tcZz/netWorkYq/zbxq.js @@ -42,3 +42,19 @@ export function delZbxq(id) { method: 'delete' }) } +//批量启用禁用 +export function isStatusZbxq(params) { + return request({ + url: '/tcZz/netWorkYq/zbxq/isStatus', + method: 'get', + params + }) +} +//通用导入信息 +export function importZbxq(data) { + return request({ + url: '/tcZz/netWorkYq/zbxq/common/importExcel', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/api/tcZz/networkSecurity/bmtb.js b/src/api/tcZz/networkSecurity/bmtb.js index be2c042..2c47bc4 100644 --- a/src/api/tcZz/networkSecurity/bmtb.js +++ b/src/api/tcZz/networkSecurity/bmtb.js @@ -42,3 +42,19 @@ export function delBmtb(id) { method: 'delete' }) } +//批量启用禁用 +export function isStatusBmtb(params) { + return request({ + url: '/tcZz/networkSecurity/bmtb/isStatus', + method: 'get', + params + }) +} +//通用导入信息 +export function importBmtb(data) { + return request({ + url: '/tcZz/networkSecurity/bmtb/common/importExcel', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/api/tcZz/networkSecurity/cybersecurity.js b/src/api/tcZz/networkSecurity/cybersecurity.js index 0b42051..31526f6 100644 --- a/src/api/tcZz/networkSecurity/cybersecurity.js +++ b/src/api/tcZz/networkSecurity/cybersecurity.js @@ -42,3 +42,19 @@ export function delCybersecurity(id) { method: 'delete' }) } +//批量启用禁用 +export function isStatusCybersecurity(params) { + return request({ + url: '/tcZz/networkSecurity/cybersecurity/isStatus', + method: 'get', + params + }) +} +//通用导入信息 +export function importCybersecurity(data) { + return request({ + url: '/tcZz/networkSecurity/cybersecurity/common/importExcel', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/api/tcZz/networkSecurity/dbdw.js b/src/api/tcZz/networkSecurity/dbdw.js index 359a526..d48be41 100644 --- a/src/api/tcZz/networkSecurity/dbdw.js +++ b/src/api/tcZz/networkSecurity/dbdw.js @@ -42,3 +42,19 @@ export function delDbdw(id) { method: 'delete' }) } +//批量启用禁用 +export function isStatusDbdw(params) { + return request({ + url: '/tcZz/networkSecurity/dbdw/isStatus', + method: 'get', + params + }) +} +//通用导入信息 +export function importDbdw(data) { + return request({ + url: '/tcZz/networkSecurity/dbdw/common/importExcel', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/api/tcZz/networkSecurity/dbxt.js b/src/api/tcZz/networkSecurity/dbxt.js index 6ef455d..84385c2 100644 --- a/src/api/tcZz/networkSecurity/dbxt.js +++ b/src/api/tcZz/networkSecurity/dbxt.js @@ -42,3 +42,19 @@ export function delDbxt(id) { method: 'delete' }) } +//批量启用禁用 +export function isStatusDbxt(params) { + return request({ + url: '/tcZz/networkSecurity/dbxt/isStatus', + method: 'get', + params + }) +} +//通用导入信息 +export function importDbxt(data) { + return request({ + url: '/tcZz/networkSecurity/dbxt/common/importExcel', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/api/tcZz/networkSecurity/idcdw.js b/src/api/tcZz/networkSecurity/idcdw.js index 1dd205d..1eb94cf 100644 --- a/src/api/tcZz/networkSecurity/idcdw.js +++ b/src/api/tcZz/networkSecurity/idcdw.js @@ -42,3 +42,19 @@ export function delIdcdw(id) { method: 'delete' }) } +//批量启用禁用 +export function isStatusIdcdw(params) { + return request({ + url: '/tcZz/networkSecurity/idcdw/isStatus', + method: 'get', + params + }) +} +//通用导入信息 +export function importIdcdw(data) { + return request({ + url: '/tcZz/networkSecurity/idcdw/common/importExcel', + method: 'post', + data + }) +} diff --git a/src/api/tcZz/networkSecurity/jgdw.js b/src/api/tcZz/networkSecurity/jgdw.js index af7a912..f927aec 100644 --- a/src/api/tcZz/networkSecurity/jgdw.js +++ b/src/api/tcZz/networkSecurity/jgdw.js @@ -42,3 +42,19 @@ export function delJgdw(id) { method: 'delete' }) } +//批量启用禁用 +export function isStatusJgdw(params) { + return request({ + url: '/tcZz/networkSecurity/jgdw/isStatus', + method: 'get', + params + }) +} +//通用导入信息 +export function importJgdw(data) { + return request({ + url: '/tcZz/networkSecurity/jgdw/common/importExcel', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/api/tcZz/networkSecurity/sdtb.js b/src/api/tcZz/networkSecurity/sdtb.js index 801f667..c25dcc4 100644 --- a/src/api/tcZz/networkSecurity/sdtb.js +++ b/src/api/tcZz/networkSecurity/sdtb.js @@ -42,3 +42,19 @@ export function delSdtb(id) { method: 'delete' }) } +//批量启用禁用 +export function isStatusSdtb(params) { + return request({ + url: '/tcZz/networkSecurity/sdtb/isStatus', + method: 'get', + params + }) +} +//通用导入信息 +export function importSdtb(data) { + return request({ + url: '/tcZz/networkSecurity/sdtb/common/importExcel', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/api/tcZz/networkSecurity/tbcz.js b/src/api/tcZz/networkSecurity/tbcz.js index ad7ae11..d4745a0 100644 --- a/src/api/tcZz/networkSecurity/tbcz.js +++ b/src/api/tcZz/networkSecurity/tbcz.js @@ -42,3 +42,19 @@ export function delTbcz(id) { method: 'delete' }) } +//批量启用禁用 +export function isStatusTbcz(params) { + return request({ + url: '/tcZz/networkSecurity/tbcz/isStatus', + method: 'get', + params + }) +} +//通用导入信息 +export function importTbcz(data) { + return request({ + url: '/tcZz/networkSecurity/tbcz/common/importExcel', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/api/tcZz/networkSecurity/xtjc.js b/src/api/tcZz/networkSecurity/xtjc.js index 799d4d0..22eada8 100644 --- a/src/api/tcZz/networkSecurity/xtjc.js +++ b/src/api/tcZz/networkSecurity/xtjc.js @@ -3,7 +3,7 @@ import request from '@/utils/request' // 查询系统监测列表 export function listXtjc(query) { return request({ - url: '/tcZz/networkSecurity/xtjc/list', + url: '/tcZz/networkSecurity/xtjc/ListNoToken', method: 'get', params: query }) @@ -42,3 +42,19 @@ export function delXtjc(id) { method: 'delete' }) } +//批量启用禁用 +export function isStatusXtjc(params) { + return request({ + url: '/tcZz/networkSecurity/xtjc/isStatus', + method: 'get', + params + }) +} +//通用导入信息 +export function importXtjc(data) { + return request({ + url: '/tcZz/networkSecurity/xtjc/common/importExcel', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/api/tcZz/networkSecurity/zfwz.js b/src/api/tcZz/networkSecurity/zfwz.js index 916992f..1526ce9 100644 --- a/src/api/tcZz/networkSecurity/zfwz.js +++ b/src/api/tcZz/networkSecurity/zfwz.js @@ -42,3 +42,19 @@ export function delZfwz(id) { method: 'delete' }) } +//批量启用禁用 +export function isStatusZfwz(params) { + return request({ + url: '/tcZz/networkSecurity/zfwz/isStatus', + method: 'get', + params + }) +} +//通用导入信息 +export function importZfwz(data) { + return request({ + url: '/tcZz/networkSecurity/zfwz/common/importExcel', + method: 'post', + data + }) +} diff --git a/src/api/tcZz/networkSecurity/zxyh.js b/src/api/tcZz/networkSecurity/zxyh.js index 6a2533b..3e107b2 100644 --- a/src/api/tcZz/networkSecurity/zxyh.js +++ b/src/api/tcZz/networkSecurity/zxyh.js @@ -42,3 +42,19 @@ export function delZxyh(id) { method: 'delete' }) } +//批量启用禁用 +export function isStatusZxyh(params) { + return request({ + url: '/tcZz/networkSecurity/zxyh/isStatus', + method: 'get', + params + }) +} +//通用导入信息 +export function importZxyh(data) { + return request({ + url: '/tcZz/networkSecurity/zxyh/common/importExcel', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/views/tcZz/netWorkYq/yqbg/index.vue b/src/views/tcZz/netWorkYq/yqbg/index.vue index f272940..45b7793 100644 --- a/src/views/tcZz/netWorkYq/yqbg/index.vue +++ b/src/views/tcZz/netWorkYq/yqbg/index.vue @@ -1,47 +1,68 @@ diff --git a/src/views/tcZz/netWorkYq/yqxxltj/index.vue b/src/views/tcZz/netWorkYq/yqxxltj/index.vue index 8f8b8b2..cb62bfa 100644 --- a/src/views/tcZz/netWorkYq/yqxxltj/index.vue +++ b/src/views/tcZz/netWorkYq/yqxxltj/index.vue @@ -62,87 +62,6 @@ /> - - - - - - - - - - 导出 + + 导入 + + 启用 + 禁用 { + this.getList(); + downloadLoadingInstance.close(); + this.$modal.msgSuccess("导入成功"); + this.getList(); + this.fileList = []; + }) + .catch(() => { + downloadLoadingInstance.close(); + this.getList(); + this.fileList = []; + }); + }, + //批量启用 + enable(row) { + this.isStatusFuc(row, 1); + }, + //批量禁用 + banned(row) { + this.isStatusFuc(row, 2); + }, + isStatusFuc(row, e) { + const ids = row.id || this.ids.join(","); + const src = e == 1 ? "启动" : "禁用"; + this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(function () { + return isStatusYqxxltj({ ids: ids, isStatus: e }); + }) + .then(() => { + this.getList(e); + }) + .catch(() => {}); + }, /** 查询舆情信息量统计明細列表 */ - getList() { + getList(e) { this.loading = true; this.queryParams.params = {}; if (null != this.daterangeDateTime && "" != this.daterangeDateTime) { @@ -511,6 +529,11 @@ export default { this.yqxxltjList = response.rows; this.total = response.total; this.loading = false; + if (e == 1) { + this.$modal.msgSuccess("启动成功"); + } else if (e == 2) { + this.$modal.msgSuccess("禁用成功"); + } }); }, // 取消按钮 diff --git a/src/views/tcZz/netWorkYq/yqyj/index.vue b/src/views/tcZz/netWorkYq/yqyj/index.vue index d6d7d3b..69b69b0 100644 --- a/src/views/tcZz/netWorkYq/yqyj/index.vue +++ b/src/views/tcZz/netWorkYq/yqyj/index.vue @@ -47,7 +47,7 @@ /> - + 导出 + + 导入 + + 启用 + 禁用 { + this.getList(); + downloadLoadingInstance.close(); + this.$modal.msgSuccess("导入成功"); + this.getList(); + this.fileList = []; + }) + .catch(() => { + downloadLoadingInstance.close(); + this.getList(); + this.fileList = []; + }); + }, + //批量启用 + enable(row) { + this.isStatusFuc(row, 1); + }, + //批量禁用 + banned(row) { + this.isStatusFuc(row, 2); + }, + isStatusFuc(row, e) { + const ids = row.id || this.ids.join(","); + const src = e == 1 ? "启动" : "禁用"; + this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(function () { + return isStatusYqyj({ ids: ids, isStatus: e }); + }) + .then(() => { + this.getList(e); + }) + .catch(() => {}); + }, /** 查询舆情预警列表 */ - getList() { + getList(e) { this.loading = true; this.queryParams.params = {}; if (null != this.daterangeDateTime && "" != this.daterangeDateTime) { @@ -476,6 +574,11 @@ export default { this.yqyjList = response.rows; this.total = response.total; this.loading = false; + if (e == 1) { + this.$modal.msgSuccess("启动成功"); + } else if (e == 2) { + this.$modal.msgSuccess("禁用成功"); + } }); }, // 取消按钮 diff --git a/src/views/tcZz/netWorkYq/zbxq/index.vue b/src/views/tcZz/netWorkYq/zbxq/index.vue index a12d6ac..a242c2a 100644 --- a/src/views/tcZz/netWorkYq/zbxq/index.vue +++ b/src/views/tcZz/netWorkYq/zbxq/index.vue @@ -1,8 +1,14 @@ diff --git a/src/views/tcZz/networkSecurity/bmtb/index.vue b/src/views/tcZz/networkSecurity/bmtb/index.vue index d8feebb..1302817 100644 --- a/src/views/tcZz/networkSecurity/bmtb/index.vue +++ b/src/views/tcZz/networkSecurity/bmtb/index.vue @@ -79,6 +79,31 @@ v-hasPermi="['tcZz/networkSecurity:bmtb:export']" >导出 + + 导入 + + 启用 + 禁用 - + @@ -207,7 +232,7 @@ labelClassName="desLable" > {{ - selectDictLabel(dict.type.tc_start,form.isStatus) + selectDictLabel(dict.type.tc_start, form.isStatus) }} {{ @@ -238,7 +263,11 @@ import { addBmtb, updateBmtb, exportBmtb, + isStatusBmtb, + importBmtb, } from "@/api/tcZz/networkSecurity/bmtb"; +import { Loading } from "element-ui"; + export default { name: "Bmtb", //注释字典 @@ -303,6 +332,10 @@ export default { // 表单校验 rules: {}, fileNameS: [], + //=========== + fileList: [], + limit: 1, + accept: ".xls,.xlsx", }; }, created() { @@ -315,8 +348,74 @@ export default { this.$modal.msgSuccess("修改成功"); }); }, + //导入 + handleBeforeUpload(file) { + // 校检文件类型 + const fileName = file.name.split("."); + const fileExt = fileName[fileName.length - 1]; + const isTypeOk = this.accept.includes(fileExt); + if (!isTypeOk) { + this.$modal.msgError(`文件格式不正确, 请上传${this.accept}格式文件!`); + return false; + } + // 校检文件大小 + const isLt = file.size / 1024 / 1024 < 5; + if (!isLt) { + this.$modal.msgError(`上传文件大小不能超过5 MB!`); + return false; + } + }, + handleExceed() { + this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`); + }, + handleFile(data) { + let downloadLoadingInstance = Loading.service({ + text: "正在导入数据,请稍候", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + let form = new FormData(); + form.append("file", data.file); + importBmtb(form) + .then((res) => { + this.getList(); + downloadLoadingInstance.close(); + this.$modal.msgSuccess("导入成功"); + this.getList(); + this.fileList = []; + }) + .catch(() => { + downloadLoadingInstance.close(); + this.getList(); + this.fileList = []; + }); + }, + //批量启用 + enable(row) { + this.isStatusFuc(row, 1); + }, + //批量禁用 + banned(row) { + this.isStatusFuc(row, 2); + }, + isStatusFuc(row, e) { + const ids = row.id || this.ids.join(","); + const src = e == 1 ? "启动" : "禁用"; + this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(function () { + return isStatusBmtb({ ids: ids, isStatus: e }); + }) + .then(() => { + this.getList(e); + }) + .catch(() => {}); + }, /** 查询部门通报列表 */ - getList() { + getList(e) { this.loading = true; this.queryParams.params = {}; if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) { @@ -333,6 +432,11 @@ export default { this.bmtbList = response.rows; this.total = response.total; this.loading = false; + if (e == 1) { + this.$modal.msgSuccess("启动成功"); + } else if (e == 2) { + this.$modal.msgSuccess("禁用成功"); + } }); }, // 取消按钮 diff --git a/src/views/tcZz/networkSecurity/cybersecurity/index.vue b/src/views/tcZz/networkSecurity/cybersecurity/index.vue index e1d3f17..ffa5f0e 100644 --- a/src/views/tcZz/networkSecurity/cybersecurity/index.vue +++ b/src/views/tcZz/networkSecurity/cybersecurity/index.vue @@ -85,6 +85,31 @@ v-hasPermi="['tcZz/networkSecurity:cybersecurity:export']" >导出 + + 导入 + + 启用 + 禁用 + + + @@ -261,11 +292,11 @@ labelClassName="desLable" > {{ - selectDictLabel(dict.type.tc_area,form.areaId) + selectDictLabel(dict.type.tc_area, form.areaId) }} {{ - selectDictLabel(dict.type.tc_start,form.isStatus) + selectDictLabel(dict.type.tc_start, form.isStatus) }} {{ @@ -328,7 +359,11 @@ import { addCybersecurity, updateCybersecurity, exportCybersecurity, + isStatusCybersecurity, + importCybersecurity, } from "@/api/tcZz/networkSecurity/cybersecurity"; +import { Loading } from "element-ui"; + export default { name: "Cybersecurity", //注释字典 @@ -412,6 +447,10 @@ export default { form: {}, // 表单校验 rules: {}, + //=========== + fileList: [], + limit: 1, + accept: ".xls,.xlsx", }; }, created() { @@ -423,9 +462,75 @@ export default { this.getList(); this.$modal.msgSuccess("修改成功"); }); + }, + //导入 + handleBeforeUpload(file) { + // 校检文件类型 + const fileName = file.name.split("."); + const fileExt = fileName[fileName.length - 1]; + const isTypeOk = this.accept.includes(fileExt); + if (!isTypeOk) { + this.$modal.msgError(`文件格式不正确, 请上传${this.accept}格式文件!`); + return false; + } + // 校检文件大小 + const isLt = file.size / 1024 / 1024 < 5; + if (!isLt) { + this.$modal.msgError(`上传文件大小不能超过5 MB!`); + return false; + } + }, + handleExceed() { + this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`); + }, + handleFile(data) { + let downloadLoadingInstance = Loading.service({ + text: "正在导入数据,请稍候", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + let form = new FormData(); + form.append("file", data.file); + importCybersecurity(form) + .then((res) => { + this.getList(); + downloadLoadingInstance.close(); + this.$modal.msgSuccess("导入成功"); + this.getList(); + this.fileList = []; + }) + .catch(() => { + downloadLoadingInstance.close(); + this.getList(); + this.fileList = []; + }); + }, + //批量启用 + enable(row) { + this.isStatusFuc(row, 1); + }, + //批量禁用 + banned(row) { + this.isStatusFuc(row, 2); + }, + isStatusFuc(row, e) { + const ids = row.id || this.ids.join(","); + const src = e == 1 ? "启动" : "禁用"; + this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(function () { + return isStatusCybersecurity({ ids: ids, isStatus: e }); + }) + .then(() => { + this.getList(e); + }) + .catch(() => {}); }, /** 查询网络监测列表 */ - getList() { + getList(e) { this.loading = true; this.queryParams.params = {}; if (null != this.daterangeStartTime && "" != this.daterangeStartTime) { @@ -446,6 +551,11 @@ export default { this.cybersecurityList = response.rows; this.total = response.total; this.loading = false; + if (e == 1) { + this.$modal.msgSuccess("启动成功"); + } else if (e == 2) { + this.$modal.msgSuccess("禁用成功"); + } }); }, // 取消按钮 diff --git a/src/views/tcZz/networkSecurity/dbdw/index.vue b/src/views/tcZz/networkSecurity/dbdw/index.vue index eb20144..88bf33b 100644 --- a/src/views/tcZz/networkSecurity/dbdw/index.vue +++ b/src/views/tcZz/networkSecurity/dbdw/index.vue @@ -103,6 +103,31 @@ v-hasPermi="['tcZz/networkSecurity:dbdw:export']" >导出 + + 导入 + + 启用 + 禁用 - + @@ -297,7 +322,7 @@ labelClassName="desLable" > {{ - selectDictLabel(dict.type.tc_area,form.areaId) + selectDictLabel(dict.type.tc_area, form.areaId) }} {{ @@ -357,7 +382,7 @@ }} {{ - selectDictLabel(dict.type.tc_start,form.isStatus) + selectDictLabel(dict.type.tc_start, form.isStatus) }} {{ @@ -376,7 +401,11 @@ import { addDbdw, updateDbdw, exportDbdw, + isStatusDbdw, + importDbdw, } from "@/api/tcZz/networkSecurity/dbdw"; +import { Loading } from "element-ui"; + export default { name: "Dbdw", //注释字典 @@ -464,6 +493,10 @@ export default { form: {}, // 表单校验 rules: {}, + //=========== + fileList: [], + limit: 1, + accept: ".xls,.xlsx", }; }, created() { @@ -476,8 +509,74 @@ export default { this.$modal.msgSuccess("修改成功"); }); }, + //导入 + handleBeforeUpload(file) { + // 校检文件类型 + const fileName = file.name.split("."); + const fileExt = fileName[fileName.length - 1]; + const isTypeOk = this.accept.includes(fileExt); + if (!isTypeOk) { + this.$modal.msgError(`文件格式不正确, 请上传${this.accept}格式文件!`); + return false; + } + // 校检文件大小 + const isLt = file.size / 1024 / 1024 < 5; + if (!isLt) { + this.$modal.msgError(`上传文件大小不能超过5 MB!`); + return false; + } + }, + handleExceed() { + this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`); + }, + handleFile(data) { + let downloadLoadingInstance = Loading.service({ + text: "正在导入数据,请稍候", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + let form = new FormData(); + form.append("file", data.file); + importDbdw(form) + .then((res) => { + this.getList(); + downloadLoadingInstance.close(); + this.$modal.msgSuccess("导入成功"); + this.getList(); + this.fileList = []; + }) + .catch(() => { + downloadLoadingInstance.close(); + this.getList(); + this.fileList = []; + }); + }, + //批量启用 + enable(row) { + this.isStatusFuc(row, 1); + }, + //批量禁用 + banned(row) { + this.isStatusFuc(row, 2); + }, + isStatusFuc(row, e) { + const ids = row.id || this.ids.join(","); + const src = e == 1 ? "启动" : "禁用"; + this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(function () { + return isStatusDbdw({ ids: ids, isStatus: e }); + }) + .then(() => { + this.getList(e); + }) + .catch(() => {}); + }, /** 查询等保单位列表 */ - getList() { + getList(e) { this.loading = true; this.queryParams.params = {}; if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) { @@ -494,6 +593,11 @@ export default { this.dbdwList = response.rows; this.total = response.total; this.loading = false; + if (e == 1) { + this.$modal.msgSuccess("启动成功"); + } else if (e == 2) { + this.$modal.msgSuccess("禁用成功"); + } }); }, // 取消按钮 diff --git a/src/views/tcZz/networkSecurity/dbxt/index.vue b/src/views/tcZz/networkSecurity/dbxt/index.vue index bc232eb..8b4d8bf 100644 --- a/src/views/tcZz/networkSecurity/dbxt/index.vue +++ b/src/views/tcZz/networkSecurity/dbxt/index.vue @@ -32,7 +32,7 @@ @keyup.enter.native="handleQuery" /> - + 导出 + + 导入 + + 启用 + 禁用 { + this.getList(); + downloadLoadingInstance.close(); + this.$modal.msgSuccess("导入成功"); + this.getList(); + this.fileList = []; + }) + .catch(() => { + downloadLoadingInstance.close(); + this.getList(); + this.fileList = []; + }); + }, + //批量启用 + enable(row) { + this.isStatusFuc(row, 1); + }, + //批量禁用 + banned(row) { + this.isStatusFuc(row, 2); + }, + isStatusFuc(row, e) { + const ids = row.id || this.ids.join(","); + const src = e == 1 ? "启动" : "禁用"; + this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(function () { + return isStatusDbxt({ ids: ids, isStatus: e }); + }) + .then(() => { + this.getList(e); + }) + .catch(() => {}); + }, alter(e) { updateDbxt(e).then(() => { this.getList(); @@ -495,7 +594,7 @@ export default { }); }, /** 查询等保系统列表 */ - getList() { + getList(e) { this.loading = true; this.queryParams.params = {}; if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) { @@ -512,6 +611,11 @@ export default { this.dbxtList = response.rows; this.total = response.total; this.loading = false; + if (e == 1) { + this.$modal.msgSuccess("启动成功"); + } else if (e == 2) { + this.$modal.msgSuccess("禁用成功"); + } }); }, // 取消按钮 diff --git a/src/views/tcZz/networkSecurity/idcdw/index.vue b/src/views/tcZz/networkSecurity/idcdw/index.vue index 9cd2175..1ea64e1 100644 --- a/src/views/tcZz/networkSecurity/idcdw/index.vue +++ b/src/views/tcZz/networkSecurity/idcdw/index.vue @@ -103,6 +103,31 @@ v-hasPermi="['tcZz/networkSecurity:idcdw:export']" >导出 + + 导入 + + 启用 + 禁用 {{ - selectDictLabel(dict.type.tc_area,form.areaId) + selectDictLabel(dict.type.tc_area, form.areaId) }} {{ - selectDictLabel(dict.type.tc_start,form.isStatus) + selectDictLabel(dict.type.tc_start, form.isStatus) }} {{ @@ -272,7 +297,11 @@ import { addIdcdw, updateIdcdw, exportIdcdw, + isStatusIdcdw, + importIdcdw, } from "@/api/tcZz/networkSecurity/idcdw"; +import { Loading } from "element-ui"; + export default { name: "Idcdw", //注释字典 @@ -336,6 +365,10 @@ export default { form: {}, // 表单校验 rules: {}, + //=========== + fileList: [], + limit: 1, + accept: ".xls,.xlsx", }; }, created() { @@ -348,8 +381,74 @@ export default { this.$modal.msgSuccess("修改成功"); }); }, + //导入 + handleBeforeUpload(file) { + // 校检文件类型 + const fileName = file.name.split("."); + const fileExt = fileName[fileName.length - 1]; + const isTypeOk = this.accept.includes(fileExt); + if (!isTypeOk) { + this.$modal.msgError(`文件格式不正确, 请上传${this.accept}格式文件!`); + return false; + } + // 校检文件大小 + const isLt = file.size / 1024 / 1024 < 5; + if (!isLt) { + this.$modal.msgError(`上传文件大小不能超过5 MB!`); + return false; + } + }, + handleExceed() { + this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`); + }, + handleFile(data) { + let downloadLoadingInstance = Loading.service({ + text: "正在导入数据,请稍候", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + let form = new FormData(); + form.append("file", data.file); + importIdcdw(form) + .then((res) => { + this.getList(); + downloadLoadingInstance.close(); + this.$modal.msgSuccess("导入成功"); + this.getList(); + this.fileList = []; + }) + .catch(() => { + downloadLoadingInstance.close(); + this.getList(); + this.fileList = []; + }); + }, + //批量启用 + enable(row) { + this.isStatusFuc(row, 1); + }, + //批量禁用 + banned(row) { + this.isStatusFuc(row, 2); + }, + isStatusFuc(row, e) { + const ids = row.id || this.ids.join(","); + const src = e == 1 ? "启动" : "禁用"; + this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(function () { + return isStatusIdcdw({ ids: ids, isStatus: e }); + }) + .then(() => { + this.getList(e); + }) + .catch(() => {}); + }, /** 查询 IDC单位列表 */ - getList() { + getList(e) { this.loading = true; this.queryParams.params = {}; if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) { @@ -366,6 +465,11 @@ export default { this.idcdwList = response.rows; this.total = response.total; this.loading = false; + if (e == 1) { + this.$modal.msgSuccess("启动成功"); + } else if (e == 2) { + this.$modal.msgSuccess("禁用成功"); + } }); }, // 取消按钮 diff --git a/src/views/tcZz/networkSecurity/jgdw/index.vue b/src/views/tcZz/networkSecurity/jgdw/index.vue index 52079f3..675d1c6 100644 --- a/src/views/tcZz/networkSecurity/jgdw/index.vue +++ b/src/views/tcZz/networkSecurity/jgdw/index.vue @@ -103,6 +103,31 @@ v-hasPermi="['tcZz/networkSecurity:jgdw:export']" >导出 + + 导入 + + 启用 + 禁用 {{ - selectDictLabel(dict.type.tc_area,form.areaId) + selectDictLabel(dict.type.tc_area, form.areaId) }} {{ - selectDictLabel(dict.type.tc_start,form.isStatus) + selectDictLabel(dict.type.tc_start, form.isStatus) }} {{ @@ -304,7 +329,7 @@ }} {{ - selectDictLabel(dict.type.tc_jslx,form.type) + selectDictLabel(dict.type.tc_jslx, form.type) }} {{ @@ -323,7 +348,10 @@ import { addJgdw, updateJgdw, exportJgdw, + isStatusJgdw, + importJgdw, } from "@/api/tcZz/networkSecurity/jgdw"; +import { Loading } from "element-ui"; export default { name: "Jgdw", //注释字典 @@ -397,6 +425,10 @@ export default { form: {}, // 表单校验 rules: {}, + //=========== + fileList: [], + limit: 1, + accept: ".xls,.xlsx", }; }, created() { @@ -409,8 +441,74 @@ export default { this.$modal.msgSuccess("修改成功"); }); }, + //导入 + handleBeforeUpload(file) { + // 校检文件类型 + const fileName = file.name.split("."); + const fileExt = fileName[fileName.length - 1]; + const isTypeOk = this.accept.includes(fileExt); + if (!isTypeOk) { + this.$modal.msgError(`文件格式不正确, 请上传${this.accept}格式文件!`); + return false; + } + // 校检文件大小 + const isLt = file.size / 1024 / 1024 < 5; + if (!isLt) { + this.$modal.msgError(`上传文件大小不能超过5 MB!`); + return false; + } + }, + handleExceed() { + this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`); + }, + handleFile(data) { + let downloadLoadingInstance = Loading.service({ + text: "正在导入数据,请稍候", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + let form = new FormData(); + form.append("file", data.file); + importJgdw(form) + .then((res) => { + this.getList(); + downloadLoadingInstance.close(); + this.$modal.msgSuccess("导入成功"); + this.getList(); + this.fileList = []; + }) + .catch(() => { + downloadLoadingInstance.close(); + this.getList(); + this.fileList = []; + }); + }, + //批量启用 + enable(row) { + this.isStatusFuc(row, 1); + }, + //批量禁用 + banned(row) { + this.isStatusFuc(row, 2); + }, + isStatusFuc(row, e) { + const ids = row.id || this.ids.join(","); + const src = e == 1 ? "启动" : "禁用"; + this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(function () { + return isStatusJgdw({ ids: ids, isStatus: e }); + }) + .then(() => { + this.getList(e); + }) + .catch(() => {}); + }, /** 查询监管单位列表 */ - getList() { + getList(e) { this.loading = true; this.queryParams.params = {}; if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) { @@ -427,6 +525,11 @@ export default { this.jgdwList = response.rows; this.total = response.total; this.loading = false; + if (e == 1) { + this.$modal.msgSuccess("启动成功"); + } else if (e == 2) { + this.$modal.msgSuccess("禁用成功"); + } }); }, // 取消按钮 diff --git a/src/views/tcZz/networkSecurity/ryz/index.vue b/src/views/tcZz/networkSecurity/ryz/index.vue index 3d2f351..78e025c 100644 --- a/src/views/tcZz/networkSecurity/ryz/index.vue +++ b/src/views/tcZz/networkSecurity/ryz/index.vue @@ -101,7 +101,7 @@ > - 导入 + 导入 启用 { this.getList(); downloadLoadingInstance.close(); - this.fileList = []; this.$modal.msgSuccess("导入成功"); this.getList(); + this.fileList = []; }) .catch(() => { downloadLoadingInstance.close(); - this.fileList = []; - this.$modal.msgSuccess("导入失败"); this.getList(); + this.fileList = []; }); }, //批量启用 diff --git a/src/views/tcZz/networkSecurity/sdtb/index.vue b/src/views/tcZz/networkSecurity/sdtb/index.vue index d5418c5..eef1dd7 100644 --- a/src/views/tcZz/networkSecurity/sdtb/index.vue +++ b/src/views/tcZz/networkSecurity/sdtb/index.vue @@ -86,6 +86,31 @@ v-hasPermi="['tcZz/networkSecurity:sdtb:export']" >导出 + + 导入 + + 启用 + 禁用 { + this.getList(); + downloadLoadingInstance.close(); + this.$modal.msgSuccess("导入成功"); + this.getList(); + this.fileList = []; + }) + .catch(() => { + downloadLoadingInstance.close(); + this.getList(); + this.fileList = []; + }); + }, + //批量启用 + enable(row) { + this.isStatusFuc(row, 1); + }, + //批量禁用 + banned(row) { + this.isStatusFuc(row, 2); + }, + isStatusFuc(row, e) { + const ids = row.id || this.ids.join(","); + const src = e == 1 ? "启动" : "禁用"; + this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(function () { + return isStatusSdtb({ ids: ids, isStatus: e }); + }) + .then(() => { + this.getList(e); + }) + .catch(() => {}); }, /** 查询属地通报列表 */ - getList() { + getList(e) { this.loading = true; this.queryParams.params = {}; if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) { @@ -353,6 +452,11 @@ export default { this.sdtbList = response.rows; this.total = response.total; this.loading = false; + if (e == 1) { + this.$modal.msgSuccess("启动成功"); + } else if (e == 2) { + this.$modal.msgSuccess("禁用成功"); + } }); }, // 取消按钮 diff --git a/src/views/tcZz/networkSecurity/tbcz/index.vue b/src/views/tcZz/networkSecurity/tbcz/index.vue index 4f96e41..4719b1e 100644 --- a/src/views/tcZz/networkSecurity/tbcz/index.vue +++ b/src/views/tcZz/networkSecurity/tbcz/index.vue @@ -103,6 +103,31 @@ v-hasPermi="['tcZz/networkSecurity:tbcz:export']" >导出 + + 导入 + + 启用 + 禁用 - + @@ -248,11 +273,11 @@ labelClassName="desLable" > {{ - selectDictLabel(dict.type.tc_area,form.areaId) + selectDictLabel(dict.type.tc_area, form.areaId) }} {{ - selectDictLabel(dict.type.tc_start,form.isStatus) + selectDictLabel(dict.type.tc_start, form.isStatus) }} {{ @@ -291,7 +316,11 @@ import { addTbcz, updateTbcz, exportTbcz, + isStatusTbcz, + importTbcz, } from "@/api/tcZz/networkSecurity/tbcz"; +import { Loading } from "element-ui"; + export default { name: "Tbcz", //注释字典 @@ -362,7 +391,10 @@ export default { // 表单校验 rules: {}, fileNameS: [], - + //=========== + fileList: [], + limit: 1, + accept: ".xls,.xlsx", }; }, created() { @@ -374,9 +406,75 @@ export default { this.getList(); this.$modal.msgSuccess("修改成功"); }); + }, + //导入 + handleBeforeUpload(file) { + // 校检文件类型 + const fileName = file.name.split("."); + const fileExt = fileName[fileName.length - 1]; + const isTypeOk = this.accept.includes(fileExt); + if (!isTypeOk) { + this.$modal.msgError(`文件格式不正确, 请上传${this.accept}格式文件!`); + return false; + } + // 校检文件大小 + const isLt = file.size / 1024 / 1024 < 5; + if (!isLt) { + this.$modal.msgError(`上传文件大小不能超过5 MB!`); + return false; + } + }, + handleExceed() { + this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`); + }, + handleFile(data) { + let downloadLoadingInstance = Loading.service({ + text: "正在导入数据,请稍候", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + let form = new FormData(); + form.append("file", data.file); + importTbcz(form) + .then((res) => { + this.getList(); + downloadLoadingInstance.close(); + this.$modal.msgSuccess("导入成功"); + this.getList(); + this.fileList = []; + }) + .catch(() => { + downloadLoadingInstance.close(); + this.getList(); + this.fileList = []; + }); + }, + //批量启用 + enable(row) { + this.isStatusFuc(row, 1); + }, + //批量禁用 + banned(row) { + this.isStatusFuc(row, 2); + }, + isStatusFuc(row, e) { + const ids = row.id || this.ids.join(","); + const src = e == 1 ? "启动" : "禁用"; + this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(function () { + return isStatusTbcz({ ids: ids, isStatus: e }); + }) + .then(() => { + this.getList(e); + }) + .catch(() => {}); }, /** 查询通报处置列表 */ - getList() { + getList(e) { this.loading = true; this.queryParams.params = {}; if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) { @@ -393,6 +491,11 @@ export default { this.tbczList = response.rows; this.total = response.total; this.loading = false; + if (e == 1) { + this.$modal.msgSuccess("启动成功"); + } else if (e == 2) { + this.$modal.msgSuccess("禁用成功"); + } }); }, // 取消按钮 diff --git a/src/views/tcZz/networkSecurity/xtjc/index.vue b/src/views/tcZz/networkSecurity/xtjc/index.vue index fa1c65a..0269ebb 100644 --- a/src/views/tcZz/networkSecurity/xtjc/index.vue +++ b/src/views/tcZz/networkSecurity/xtjc/index.vue @@ -8,7 +8,6 @@ v-show="showSearch" label-width="auto" > - 导出 + + 导入 + + 启用 + 禁用 - + @@ -250,11 +274,11 @@ labelClassName="desLable" > {{ - selectDictLabel(dict.type.tc_area,form.areaId) + selectDictLabel(dict.type.tc_area, form.areaId) }} {{ - selectDictLabel(dict.type.tc_start,form.isStatus) + selectDictLabel(dict.type.tc_start, form.isStatus) }} {{ @@ -297,7 +321,11 @@ import { addXtjc, updateXtjc, exportXtjc, + isStatusXtjc, + importXtjc } from "@/api/tcZz/networkSecurity/xtjc"; +import { Loading } from "element-ui"; + export default { name: "Xtjc", //注释字典 @@ -359,6 +387,10 @@ export default { form: {}, // 表单校验 rules: {}, + //=========== + fileList: [], + limit: 1, + accept: ".xls,.xlsx", }; }, created() { @@ -371,8 +403,74 @@ export default { this.$modal.msgSuccess("修改成功"); }); }, + //导入 + handleBeforeUpload(file) { + // 校检文件类型 + const fileName = file.name.split("."); + const fileExt = fileName[fileName.length - 1]; + const isTypeOk = this.accept.includes(fileExt); + if (!isTypeOk) { + this.$modal.msgError(`文件格式不正确, 请上传${this.accept}格式文件!`); + return false; + } + // 校检文件大小 + const isLt = file.size / 1024 / 1024 < 5; + if (!isLt) { + this.$modal.msgError(`上传文件大小不能超过5 MB!`); + return false; + } + }, + handleExceed() { + this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`); + }, + handleFile(data) { + let downloadLoadingInstance = Loading.service({ + text: "正在导入数据,请稍候", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + let form = new FormData(); + form.append("file", data.file); + importXtjc(form) + .then((res) => { + this.getList(); + downloadLoadingInstance.close(); + this.$modal.msgSuccess("导入成功"); + this.getList(); + this.fileList = []; + }) + .catch(() => { + downloadLoadingInstance.close(); + this.getList(); + this.fileList = []; + }); + }, + //批量启用 + enable(row) { + this.isStatusFuc(row, 1); + }, + //批量禁用 + banned(row) { + this.isStatusFuc(row, 2); + }, + isStatusFuc(row, e) { + const ids = row.id || this.ids.join(","); + const src = e == 1 ? "启动" : "禁用"; + this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(function () { + return isStatusXtjc({ ids: ids, isStatus: e }); + }) + .then(() => { + this.getList(e); + }) + .catch(() => {}); + }, /** 查询系统监测列表 */ - getList() { + getList(e) { this.loading = true; this.queryParams.params = {}; if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) { @@ -389,6 +487,11 @@ export default { this.xtjcList = response.rows; this.total = response.total; this.loading = false; + if (e == 1) { + this.$modal.msgSuccess("启动成功"); + } else if (e == 2) { + this.$modal.msgSuccess("禁用成功"); + } }); }, // 取消按钮 diff --git a/src/views/tcZz/networkSecurity/zfwz/index.vue b/src/views/tcZz/networkSecurity/zfwz/index.vue index c93d1bb..d3fa3c5 100644 --- a/src/views/tcZz/networkSecurity/zfwz/index.vue +++ b/src/views/tcZz/networkSecurity/zfwz/index.vue @@ -95,6 +95,31 @@ v-hasPermi="['tcZz/networkSecurity:zfwz:export']" >导出 + + 导入 + + 启用 + 禁用 {{ - selectDictLabel(dict.type.tc_area,form.areaId) + selectDictLabel(dict.type.tc_area, form.areaId) }} {{ - selectDictLabel(dict.type.tc_start,form.isStatus) + selectDictLabel(dict.type.tc_start, form.isStatus) }} {{ @@ -275,7 +300,10 @@ import { addZfwz, updateZfwz, exportZfwz, + isStatusZfwz, + importZfwz, } from "@/api/tcZz/networkSecurity/zfwz"; +import { Loading } from "element-ui"; export default { name: "Zfwz", //注释字典 @@ -341,6 +369,10 @@ export default { form: {}, // 表单校验 rules: {}, + //=========== + fileList: [], + limit: 1, + accept: ".xls,.xlsx", }; }, created() { @@ -352,9 +384,75 @@ export default { this.getList(); this.$modal.msgSuccess("修改成功"); }); + }, + //导入 + handleBeforeUpload(file) { + // 校检文件类型 + const fileName = file.name.split("."); + const fileExt = fileName[fileName.length - 1]; + const isTypeOk = this.accept.includes(fileExt); + if (!isTypeOk) { + this.$modal.msgError(`文件格式不正确, 请上传${this.accept}格式文件!`); + return false; + } + // 校检文件大小 + const isLt = file.size / 1024 / 1024 < 5; + if (!isLt) { + this.$modal.msgError(`上传文件大小不能超过5 MB!`); + return false; + } + }, + handleExceed() { + this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`); + }, + handleFile(data) { + let downloadLoadingInstance = Loading.service({ + text: "正在导入数据,请稍候", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + let form = new FormData(); + form.append("file", data.file); + importZfwz(form) + .then((res) => { + this.getList(); + downloadLoadingInstance.close(); + this.$modal.msgSuccess("导入成功"); + this.getList(); + this.fileList = []; + }) + .catch(() => { + downloadLoadingInstance.close(); + this.getList(); + this.fileList = []; + }); + }, + //批量启用 + enable(row) { + this.isStatusFuc(row, 1); + }, + //批量禁用 + banned(row) { + this.isStatusFuc(row, 2); + }, + isStatusFuc(row, e) { + const ids = row.id || this.ids.join(","); + const src = e == 1 ? "启动" : "禁用"; + this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(function () { + return isStatusZfwz({ ids: ids, isStatus: e }); + }) + .then(() => { + this.getList(e); + }) + .catch(() => {}); }, /** 查询政府网站列表 */ - getList() { + getList(e) { this.loading = true; this.queryParams.params = {}; if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) { @@ -371,6 +469,11 @@ export default { this.zfwzList = response.rows; this.total = response.total; this.loading = false; + if (e == 1) { + this.$modal.msgSuccess("启动成功"); + } else if (e == 2) { + this.$modal.msgSuccess("禁用成功"); + } }); }, // 取消按钮 diff --git a/src/views/tcZz/networkSecurity/zxyh/index.vue b/src/views/tcZz/networkSecurity/zxyh/index.vue index 7c1c963..c323981 100644 --- a/src/views/tcZz/networkSecurity/zxyh/index.vue +++ b/src/views/tcZz/networkSecurity/zxyh/index.vue @@ -103,6 +103,31 @@ v-hasPermi="['tcZz/networkSecurity:zxyh:export']" >导出 + + 导入 + + 启用 + 禁用 - + @@ -251,11 +276,11 @@ labelClassName="desLable" > {{ - selectDictLabel(dict.type.tc_area,form.areaId) + selectDictLabel(dict.type.tc_area, form.areaId) }} {{ - selectDictLabel(dict.type.tc_start,form.isStatus) + selectDictLabel(dict.type.tc_start, form.isStatus) }} {{ @@ -298,7 +323,11 @@ import { addZxyh, updateZxyh, exportZxyh, + isStatusZxyh, + importZxyh, } from "@/api/tcZz/networkSecurity/zxyh"; +import { Loading } from "element-ui"; + export default { name: "Zxyh", //注释字典 @@ -371,7 +400,10 @@ export default { // 表单校验 rules: {}, fileNameS: [], - + //=========== + fileList: [], + limit: 1, + accept: ".xls,.xlsx", }; }, created() { @@ -383,9 +415,75 @@ export default { this.getList(); this.$modal.msgSuccess("修改成功"); }); + }, + //导入 + handleBeforeUpload(file) { + // 校检文件类型 + const fileName = file.name.split("."); + const fileExt = fileName[fileName.length - 1]; + const isTypeOk = this.accept.includes(fileExt); + if (!isTypeOk) { + this.$modal.msgError(`文件格式不正确, 请上传${this.accept}格式文件!`); + return false; + } + // 校检文件大小 + const isLt = file.size / 1024 / 1024 < 5; + if (!isLt) { + this.$modal.msgError(`上传文件大小不能超过5 MB!`); + return false; + } + }, + handleExceed() { + this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`); + }, + handleFile(data) { + let downloadLoadingInstance = Loading.service({ + text: "正在导入数据,请稍候", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + let form = new FormData(); + form.append("file", data.file); + importZxyh(form) + .then((res) => { + this.getList(); + downloadLoadingInstance.close(); + this.$modal.msgSuccess("导入成功"); + this.getList(); + this.fileList = []; + }) + .catch(() => { + downloadLoadingInstance.close(); + this.getList(); + this.fileList = []; + }); + }, + //批量启用 + enable(row) { + this.isStatusFuc(row, 1); + }, + //批量禁用 + banned(row) { + this.isStatusFuc(row, 2); + }, + isStatusFuc(row, e) { + const ids = row.id || this.ids.join(","); + const src = e == 1 ? "启动" : "禁用"; + this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(function () { + return isStatusZxyh({ ids: ids, isStatus: e }); + }) + .then(() => { + this.getList(e); + }) + .catch(() => {}); }, /** 查询最新隐患列表 */ - getList() { + getList(e) { this.loading = true; this.queryParams.params = {}; if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) { @@ -402,6 +500,11 @@ export default { this.zxyhList = response.rows; this.total = response.total; this.loading = false; + if (e == 1) { + this.$modal.msgSuccess("启动成功"); + } else if (e == 2) { + this.$modal.msgSuccess("禁用成功"); + } }); }, // 取消按钮