修改前端显示配置项
This commit is contained in:
parent
640f36842f
commit
1cca675506
@ -50,23 +50,18 @@
|
||||
placeholder="请输入内容"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单客户端:" prop="singleClient">
|
||||
<el-checkbox v-model="ruleForm.singleClient" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单角色类型:" prop="singleMember">
|
||||
<el-checkbox v-model="ruleForm.singleMember" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="含有实训:" prop="hasTraining">
|
||||
<el-checkbox v-model="ruleForm.hasTraining" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="Object.values(mapConfigData)" style="width: 100%;" size="small" max-height="180">
|
||||
<el-table-column prop="configKey" label="key" />
|
||||
<el-table-column prop="configValue" label="value">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.type === 'boolean'">
|
||||
<el-radio v-model="scope.row.configValue" :label="true">是</el-radio>
|
||||
<el-radio v-model="scope.row.configValue" :label="false">否</el-radio>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="描述" />
|
||||
</el-table>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="close">取 消</el-button>
|
||||
@ -92,6 +87,13 @@ export default {
|
||||
title: '',
|
||||
mapSystemId: '',
|
||||
memberList: [],
|
||||
mapConfigData: {
|
||||
singleClient: {configKey: 'singleClient', configValue: false, defaultValue: false, type: 'boolean', remark: '是否单客户端'},
|
||||
singleMember: {configKey: 'singleMember', configValue: false, defaultValue: false, type: 'boolean', remark: '是否单角色类型'},
|
||||
hasExam: {configKey: 'hasExam', configValue: false, defaultValue: false, type: 'boolean', remark: '是否含有考试'},
|
||||
hasTraining: {configKey: 'hasTraining', configValue: false, defaultValue: false, type: 'boolean', remark: '是否含有实训'},
|
||||
trainingDesign: {configKey: 'trainingDesign', configValue: false, defaultValue: false, type: 'boolean', remark: '是否含有实训设计'}
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入子系统名称', trigger: 'blur' }
|
||||
@ -111,10 +113,10 @@ export default {
|
||||
client: '',
|
||||
function: '',
|
||||
trainingId: '',
|
||||
trainingName: '',
|
||||
singleMember: false,
|
||||
singleClient: false,
|
||||
hasTraining: false
|
||||
trainingName: ''
|
||||
// singleMember: false,
|
||||
// singleClient: false,
|
||||
// hasTraining: false
|
||||
},
|
||||
clientList: [
|
||||
{ label: '中心ATS工作站', value: 'C_ATS' },
|
||||
@ -174,6 +176,7 @@ export default {
|
||||
this.ruleForm.type = row.paramVO.type;
|
||||
this.ruleForm.client = row.paramVO.client || '';
|
||||
this.ruleForm.memberId = row.paramVO.memberId || '';
|
||||
this.setConfigData(row.paramVO.domConfig || {});
|
||||
this.clientChange(this.ruleForm.client);
|
||||
if (row.paramVO.functionInfoMap) {
|
||||
const functionList = Object.keys(row.paramVO.functionInfoMap);
|
||||
@ -191,6 +194,15 @@ export default {
|
||||
}
|
||||
this.visible = true;
|
||||
},
|
||||
setConfigData(obj) {
|
||||
Object.keys(this.mapConfigData).forEach(key => {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
this.mapConfigData[key].configValue = obj[key];
|
||||
} else {
|
||||
this.mapConfigData[key].configValue = this.mapConfigData[key].defaultValue;
|
||||
}
|
||||
});
|
||||
},
|
||||
typeChange(val) {
|
||||
if (val === 'METRO') {
|
||||
this.memberList = [...this.memberMetroList];
|
||||
@ -294,11 +306,12 @@ export default {
|
||||
client: '',
|
||||
function: '',
|
||||
trainingId: '',
|
||||
trainingName: '',
|
||||
singleClient: false,
|
||||
singleMember: false,
|
||||
hasTraining: false
|
||||
trainingName: ''
|
||||
// singleClient: false,
|
||||
// singleMember: false,
|
||||
// hasTraining: false
|
||||
};
|
||||
this.setConfigData({});
|
||||
this.visible = false;
|
||||
this.$refs.ruleForm.resetFields();
|
||||
},
|
||||
@ -313,6 +326,10 @@ export default {
|
||||
functionMap = {};
|
||||
functionMap[this.ruleForm.function] = { function: this.ruleForm.function };
|
||||
}
|
||||
const configData = {};
|
||||
Object.values(this.mapConfigData).forEach(item => {
|
||||
configData[item.configKey] = item.configValue;
|
||||
});
|
||||
const data = {
|
||||
mapId: this.$route.query.mapId,
|
||||
name: this.ruleForm.name,
|
||||
@ -323,9 +340,10 @@ export default {
|
||||
memberId: this.ruleForm.memberId,
|
||||
functionInfoMap: functionMap,
|
||||
domConfig: {
|
||||
singleClient: this.ruleForm.singleClient,
|
||||
singleMember: this.ruleForm.singleMember,
|
||||
hasTraining: this.ruleForm.hasTraining
|
||||
// singleClient: this.ruleForm.singleClient,
|
||||
// singleMember: this.ruleForm.singleMember,
|
||||
// hasTraining: this.ruleForm.hasTraining
|
||||
...configData
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user