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");
});
},
/** 提交按钮 */