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

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

@ -16,11 +16,12 @@
size="small" size="small"
> >
<el-option <el-option
v-for="dict in dict.type.tc_data_source_type" v-show="filterShow(dict.dictValue)"
:key="dict.value" v-for="dict in sourceType"
:label="dict.label" :key="dict.dictValue"
:value="dict.value" :label="dict.dictLabel"
/> :value="parseInt(dict.dictValue)"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="资产名称" prop="assetName"> <el-form-item label="资产名称" prop="assetName">
@ -223,10 +224,11 @@
<el-form-item label="来源类型" prop="type"> <el-form-item label="来源类型" prop="type">
<el-select v-model="form.type" placeholder="请选择来源类型"> <el-select v-model="form.type" placeholder="请选择来源类型">
<el-option <el-option
v-for="dict in dict.type.tc_data_source_type" v-show="filterShow(dict.dictValue)"
:key="dict.value" v-for="dict in sourceType"
:label="dict.label" :key="dict.dictValue"
:value="parseInt(dict.value)" :label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
></el-option> ></el-option>
</el-select> </el-form-item </el-select> </el-form-item
></el-col> ></el-col>
@ -423,7 +425,7 @@ export default {
}, },
name: "Source", 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() { data() {
return { return {
tableHeigth: 0, tableHeigth: 0,
@ -456,15 +458,15 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
type: null, type: null,
assetName: null, assetName: null,
affUnit: null, affUnit: null,
notType: null,
}, },
// //
form: {}, form: {},
// //
rules: {}, rules: {},
sourceType: [],
}; };
}, },
watch: { watch: {
@ -472,6 +474,7 @@ export default {
// $route // $route
handler(to, from) { handler(to, from) {
if (to.name == "DataSource") { if (to.name == "DataSource") {
this.queryParams.notType = "5,6";
//type 5,6 //type 5,6
} else if (to.name == "Jgdw") { } else if (to.name == "Jgdw") {
// type5 // type5
@ -484,6 +487,9 @@ export default {
}, },
}, },
created() { created() {
this.getDicts("tc_data_source_type").then((response) => {
this.sourceType = response.data;
});
// // // //
this.$nextTick(() => { this.$nextTick(() => {
this.tableHeigth = this.tableHeigth =
@ -495,6 +501,37 @@ export default {
}); });
}, },
methods: { 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() { getList() {
this.loading = true; this.loading = true;
@ -578,14 +615,16 @@ export default {
response.data.areaId = JSON.parse(response.data.areaId); response.data.areaId = JSON.parse(response.data.areaId);
this.form = response.data; this.form = response.data;
this.infoOpen = true; this.infoOpen = true;
this.infoTitle = "查看数据来源详情"; // this.infoTitle = "";
this.filterTitle("查看", "infoTitle");
}); });
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加数据来源"; // this.title = "";
this.filterTitle("添加", "title");
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -595,7 +634,8 @@ export default {
response.data.areaId = JSON.parse(response.data.areaId); response.data.areaId = JSON.parse(response.data.areaId);
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改数据来源"; // this.title = "";
this.filterTitle("修改", "title");
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */

Loading…
Cancel
Save