数据来源与监管对象页面区分处理

lijinlong^2
许宏杰 1 year ago
parent 05d3d30a19
commit 051ee3f204

@ -16,11 +16,12 @@
size="small"
>
<el-option
v-for="dict in dict.type.tc_data_source_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
v-show="filterShow(dict.dictValue)"
v-for="dict in sourceType"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="资产名称" prop="assetName">
@ -223,10 +224,11 @@
<el-form-item label="来源类型" prop="type">
<el-select v-model="form.type" placeholder="请选择来源类型">
<el-option
v-for="dict in dict.type.tc_data_source_type"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
v-show="filterShow(dict.dictValue)"
v-for="dict in sourceType"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
></el-option>
</el-select> </el-form-item
></el-col>
@ -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");
});
},
/** 提交按钮 */

Loading…
Cancel
Save