qianlishi 3 years ago
parent e9f3d44167
commit 51c8bfa19e

@ -28,7 +28,8 @@ export default {
name: "GetDictionary", name: "GetDictionary",
props: { props: {
dictKey: String, // code dictKey: String, // code
updataDict: String // updataDict: String, //
value: String
}, },
data() { data() {
return { return {
@ -43,19 +44,17 @@ export default {
this.getSystem(); this.getSystem();
} }
}, },
updataDict: { value: {
immediate: true, handler(val) {
handler() { this.dictionary = val;
this.dictionary = this.updataDict; },
} deep: true
} }
}, },
created() { created() {
this.getSystem(); this.getSystem();
}, },
mounted() { mounted() {},
this.dictionary = this.updataDict;
},
methods: { methods: {
// //
async getSystem() { async getSystem() {

@ -26,7 +26,7 @@
</el-form-item> </el-form-item>
<el-form-item v-for="item in setParamList" :key="item" :label="item"> <el-form-item v-for="item in setParamList" :key="item" :label="item">
<Dictionary <Dictionary
v-model="params" v-model="params[item]"
:dict-key="getDictKey()" :dict-key="getDictKey()"
@input="selectParams($event, item)" @input="selectParams($event, item)"
/> />
@ -58,7 +58,7 @@ export default {
props: { props: {
chartType: String, chartType: String,
dictKey: String, dictKey: String,
props: ["formData"] formData: Object
}, },
data() { data() {
return { return {
@ -67,9 +67,17 @@ export default {
userNameList: [], // userNameList: [], //
setParamList: [], // setParamList: [], //
params: {}, params: {},
chartProperties: {}, chartProperties: {}
}; };
}, },
watch: {
formData: {
handler(val) {
this.echoDataSet(val);
},
deep: true
}
},
computed: { computed: {
setCode() { setCode() {
let code = ""; let code = "";
@ -83,6 +91,7 @@ export default {
}, },
mounted() { mounted() {
this.loadDataSet(); this.loadDataSet();
this.echoDataSet(this.formData);
}, },
methods: { methods: {
async loadDataSet() { async loadDataSet() {
@ -116,7 +125,38 @@ export default {
this.chartProperties[key] = val; this.chartProperties[key] = val;
}, },
getDictKey() { getDictKey() {
return this.dictKey == null ? 'CHART_PROPERTIES' : this.dictKey return this.dictKey == null ? "CHART_PROPERTIES" : this.dictKey;
},
//
async echoDataSet(val) {
console.log(val);
const setCode = val.setCode;
await this.loadDataSet();
this.dataSetValue = this.dataSet.filter(
el => setCode == el.setCode
)[0].id;
await this.selectDataSet();
this.echoDynamicData(val);
},
echoDynamicData(val) {
const chartProperties = val.chartProperties;
if (this.userNameList.length > 0) {
}
if (this.setParamList.length > 0) {
for (let i = 0; i < this.setParamList.length; i++) {
const item = this.setParamList[i];
if (chartProperties.hasOwnProperty(item)) {
this.params[item] = chartProperties[item];
}
}
}
console.log(this.params);
// console.log(this.userNameList);
// console.log(this.setParamList);
} }
} }
}; };

@ -25,7 +25,6 @@
style="width:100%" style="width:100%"
v-model.trim="formData[item.name]" v-model.trim="formData[item.name]"
controls-position="right" controls-position="right"
:placeholder="item.placeholder"
@change="changed($event, item.name)" @change="changed($event, item.name)"
/> />
@ -137,7 +136,7 @@
v-if="item.type == 'dycustComponents' && inputShow[item.name]" v-if="item.type == 'dycustComponents' && inputShow[item.name]"
v-model="formData[item.name]" v-model="formData[item.name]"
:chart-type="item.chartType" :chart-type="item.chartType"
:dict-key='item.dictKey' :dict-key="item.dictKey"
@change="changed($event, item.name)" @change="changed($event, item.name)"
/> />
<dynamic-add-table <dynamic-add-table

Loading…
Cancel
Save