From 051ee3f204285264a20ae6cffc7a14b955204ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AE=8F=E6=9D=B0?= <1943105267@qq.com> Date: Tue, 12 Sep 2023 16:26:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9D=A5=E6=BA=90=E4=B8=8E?= =?UTF-8?q?=E7=9B=91=E7=AE=A1=E5=AF=B9=E8=B1=A1=E9=A1=B5=E9=9D=A2=E5=8C=BA?= =?UTF-8?q?=E5=88=86=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/netSecurity/DataSource/index.vue | 70 +++++++++++++++++----- 1 file changed, 55 insertions(+), 15 deletions(-) diff --git a/src/views/netSecurity/DataSource/index.vue b/src/views/netSecurity/DataSource/index.vue index d6e7a08..2f490fb 100644 --- a/src/views/netSecurity/DataSource/index.vue +++ b/src/views/netSecurity/DataSource/index.vue @@ -16,11 +16,12 @@ size="small" > + v-show="filterShow(dict.dictValue)" + v-for="dict in sourceType" + :key="dict.dictValue" + :label="dict.dictLabel" + :value="parseInt(dict.dictValue)" + > @@ -223,10 +224,11 @@ @@ -423,7 +425,7 @@ export default { }, name: "Source", //注释字典 - dicts: ["tc_yes_no", "tc_data_source_type", "tc_net_safety_level", "tc_os"], + dicts: ["tc_yes_no", "tc_net_safety_level", "tc_data_source_type", "tc_os"], data() { return { tableHeigth: 0, @@ -456,15 +458,15 @@ export default { pageNum: 1, pageSize: 20, type: null, - assetName: null, - affUnit: null, + notType: null, }, // 表单参数 form: {}, // 表单校验 rules: {}, + sourceType: [], }; }, watch: { @@ -472,6 +474,7 @@ export default { // $route可以用引号,也可以不用引号 handler(to, from) { if (to.name == "DataSource") { + this.queryParams.notType = "5,6"; //不显示type 5,6 } else if (to.name == "Jgdw") { // 显示type5 @@ -484,6 +487,9 @@ export default { }, }, created() { + this.getDicts("tc_data_source_type").then((response) => { + this.sourceType = response.data; + }); // //给表格一个固定值 this.$nextTick(() => { this.tableHeigth = @@ -495,6 +501,37 @@ export default { }); }, methods: { + /**过滤显示 */ + filterShow(value) { + let routeName = this.$route.name; + + if (routeName == "DataSource") { + if (value == 3 || value == 4 || value == 7) { + return true; + } else { + return false; + } + } else if (routeName == "Jgdw") { + if (value == 3 || value == 4 || value == 6 || value == 7) { + return false; + } else { + return true; + } + } else if (routeName == "Webjc") { + if (value == 3 || value == 4 || value == 5 || value == 7) { + return false; + } else { + return true; + } + } + }, + /**过滤显示 */ + filterTitle(name, key) { + let routeName = this.$route.meta.title; + + this[key] = name + routeName; + console.log(this.infoTitle); + }, /** 查询数据来源列表 */ getList() { this.loading = true; @@ -578,14 +615,16 @@ export default { response.data.areaId = JSON.parse(response.data.areaId); this.form = response.data; this.infoOpen = true; - this.infoTitle = "查看数据来源详情"; + // this.infoTitle = "查看数据来源详情"; + this.filterTitle("查看", "infoTitle"); }); }, /** 新增按钮操作 */ handleAdd() { this.reset(); this.open = true; - this.title = "添加数据来源"; + // this.title = "添加数据来源"; + this.filterTitle("添加", "title"); }, /** 修改按钮操作 */ handleUpdate(row) { @@ -595,7 +634,8 @@ export default { response.data.areaId = JSON.parse(response.data.areaId); this.form = response.data; this.open = true; - this.title = "修改数据来源"; + // this.title = "修改数据来源"; + this.filterTitle("修改", "title"); }); }, /** 提交按钮 */