From 2e60a33f216b267367da02fdac3628ae4ce5283d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AE=8F=E6=9D=B0?= <1943105267@qq.com> Date: Wed, 16 Aug 2023 08:56:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=89=E4=BF=9D=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../netSecurity/supervise/DbUnit/index.js | 12 +- src/views/netWorkYq/index.vue | 113 ++++++++++++------ 2 files changed, 83 insertions(+), 42 deletions(-) diff --git a/src/api/zongzhi/netSecurity/supervise/DbUnit/index.js b/src/api/zongzhi/netSecurity/supervise/DbUnit/index.js index 7434c7c..7034c5a 100644 --- a/src/api/zongzhi/netSecurity/supervise/DbUnit/index.js +++ b/src/api/zongzhi/netSecurity/supervise/DbUnit/index.js @@ -3,7 +3,7 @@ import request from "@/utils/request"; // 查询等保单位列表 export function listUnit(query) { return request({ - url: "/zongzhi/unit/list", + url: "/zongzhi/dengbaounit/list", method: "get", params: query, }); @@ -12,7 +12,7 @@ export function listUnit(query) { // 查询等保单位详细 export function getUnit(id) { return request({ - url: "/zongzhi/unit/" + id, + url: "/zongzhi/dengbaounit/" + id, method: "get", }); } @@ -20,7 +20,7 @@ export function getUnit(id) { // 新增等保单位 export function addUnit(data) { return request({ - url: "/zongzhi/unit", + url: "/zongzhi/dengbaounit", method: "post", data: data, }); @@ -29,7 +29,7 @@ export function addUnit(data) { // 修改等保单位 export function updateUnit(data) { return request({ - url: "/zongzhi/unit", + url: "/zongzhi/dengbaounit", method: "put", data: data, }); @@ -38,7 +38,7 @@ export function updateUnit(data) { // 删除等保单位 export function delUnit(id) { return request({ - url: "/zongzhi/unit/" + id, + url: "/zongzhi/dengbaounit/" + id, method: "delete", }); } @@ -46,7 +46,7 @@ export function delUnit(id) { // 导出等保单位 export function exportUnit(data) { return request({ - url: "/zongzhi/unit/export", + url: "/zongzhi/dengbaounit/export", method: "post", data, }); diff --git a/src/views/netWorkYq/index.vue b/src/views/netWorkYq/index.vue index 3433819..6d925ff 100644 --- a/src/views/netWorkYq/index.vue +++ b/src/views/netWorkYq/index.vue @@ -326,12 +326,13 @@ > - - + + + - + @@ -441,6 +444,7 @@ export default { ], data() { return { + fileList: [], tableHeigth: 0, //查看详情 infoOpen: false, @@ -555,6 +559,7 @@ export default { remark: null, }; + this.fileList = []; this.resetForm("form"); }, /** 搜索按钮操作 */ @@ -578,6 +583,8 @@ export default { this.reset(); const id = row.id || this.ids; getSentiment(id).then((response) => { + this.filterFile(2, response.data.fileName, response.data.fileUrl); + this.form = response.data; this.infoOpen = true; this.infoTitle = "查看网络舆情详情"; @@ -594,15 +601,49 @@ export default { this.reset(); const id = row.id || this.ids; getSentiment(id).then((response) => { + this.filterFile(2, response.data.fileName, response.data.fileUrl); + this.form = response.data; this.open = true; this.title = "修改网络舆情"; }); }, + filterFile(state, fileName, fileUrl) { + //1.提交 else 查看 + if (state == 1) { + let fileName = []; + let fileUrl = []; + if (this.fileList.length > 0) { + this.fileList.forEach((item) => { + fileName.push(item.name); + fileUrl.push(item.url); + }); + this.form.fileName = fileName.join(","); + this.form.fileUrl = fileUrl.join(","); + } else { + this.form.fileName = ""; + this.form.fileUrl = ""; + } + } else { + if (fileName || fileUrl) { + fileName = fileName.split(","); + fileUrl = fileUrl.split(","); + fileName.forEach((item, index) => { + this.fileList.push({ + name: item, + url: fileUrl[index], + }); + }); + } else { + this.fileList = []; + } + } + }, /** 提交按钮 */ submitForm() { this.$refs["form"].validate((valid) => { if (valid) { + this.filterFile(1); if (this.form.id != null) { updateSentiment(this.form).then((response) => { this.$modal.msgSuccess("修改成功");