|
@@ -3,18 +3,18 @@
|
|
|
<el-form label-position="left" :label-width="labelWidth" :model="form">
|
|
|
<div v-for="(titem, tkey) in inputTypeList" :key="tkey">
|
|
|
<h4>{{ tkey }}</h4>
|
|
|
- <el-form-item v-for="(item, key) in titem" :key="key" :label="item.InfoPointName" class="input-item">
|
|
|
- <el-input v-model="item.inputValue" v-if="item.InputMode == 'A1'|| item.InputMode == 'A2'" type="number">
|
|
|
+ <el-form-item v-for="(item, key) in titem" :key="key" :label="item.name" class="input-item">
|
|
|
+ <el-input v-model="item.inputValue" v-if="item.inputMode == 'A1'|| item.inputMode == 'A2'" type="number">
|
|
|
<template slot="append" v-if="item.Unit">{{item.Unit}}</template>
|
|
|
</el-input>
|
|
|
- <el-input v-model="item.inputValue" v-else-if="item.InputMode == 'B1' || item.InputMode == 'L' || item.InputMode == 'M'"></el-input>
|
|
|
- <el-select v-model="item.inputValue" v-else-if="item.InputMode == 'D1'" placeholder="请选择">
|
|
|
- <el-option v-for="(soption,skey) in item.options" :key="skey" :label="soption.Name" :value="soption.Code">
|
|
|
+ <el-input v-model="item.inputValue" v-else-if="item.inputMode == 'B1' || item.inputMode == 'L' || item.inputMode == 'M'"></el-input>
|
|
|
+ <el-select v-model="item.inputValue" v-else-if="item.inputMode == 'D1'" placeholder="请选择">
|
|
|
+ <el-option v-for="(soption,skey) in item.options" :key="skey" :label="soption.name" :value="soption.code">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- <el-cascader v-model="item.inputValue" v-else-if="item.InputMode == 'D1L'" placeholder="请在台账中维护该类型信息点"
|
|
|
+ <el-cascader v-model="item.inputValue" v-else-if="item.inputMode == 'D1L'" placeholder="请在台账中维护该类型信息点"
|
|
|
:props="item.props" :options="item.options" filterable clearable disabled :show-all-levels="false"></el-cascader>
|
|
|
- <el-input v-model="item.inputValue" v-else></el-input>
|
|
|
+ <el-input v-model="item.inputValue" v-else disabled placeholder="请在台账中维护该类型信息点"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-form>
|
|
@@ -51,31 +51,41 @@ export default {
|
|
|
//数据过滤
|
|
|
filterInput() {
|
|
|
this.inputData = this.inputData.filter(item => {
|
|
|
- return item.Editable == true && item.Visible == true && item.FirstName && item.InfoPointCode;
|
|
|
+ return item.editable == true && item.visible == true && item.code;
|
|
|
})
|
|
|
let numbersInput = ['A1', 'A2'];
|
|
|
let stringInput = ['B1', 'L', 'M'];
|
|
|
let arrayInput = ['D1'];
|
|
|
let cascaderInput = ['D1L'];
|
|
|
this.inputData.map(item => {
|
|
|
- if (numbersInput.indexOf(item.InputMode) != -1) {
|
|
|
+ if (numbersInput.indexOf(item.inputMode) != -1) {
|
|
|
item.inputValue = null;
|
|
|
}
|
|
|
- else if (stringInput.indexOf(item.InputMode) != -1) {
|
|
|
+ else if (stringInput.indexOf(item.inputMode) != -1) {
|
|
|
item.inputValue = '';
|
|
|
}
|
|
|
- else if (arrayInput.indexOf(item.InputMode) != -1) {
|
|
|
- let options = JSON.parse(item.DataSource)
|
|
|
+ else if (arrayInput.indexOf(item.inputMode) != -1) {
|
|
|
+ let options;
|
|
|
+ if (item.dataSource instanceof Array) {
|
|
|
+ options = item.dataSource;
|
|
|
+ } else {
|
|
|
+ options = JSON.parse(item.dataSource)
|
|
|
+ }
|
|
|
item.inputValue = '';
|
|
|
item.options = options;
|
|
|
}
|
|
|
- else if(cascaderInput.indexOf(item.InputMode) != -1){
|
|
|
- let options = JSON.parse(item.DataSource);
|
|
|
- if (options[0] && options[0].Content) {
|
|
|
+ else if(cascaderInput.indexOf(item.inputMode) != -1){
|
|
|
+ let options;
|
|
|
+ if (item.dataSource instanceof Array) {
|
|
|
+ options = item.dataSource;
|
|
|
+ } else {
|
|
|
+ options = JSON.parse(item.dataSource)
|
|
|
+ }
|
|
|
+ if (options[0] && options[0].content) {
|
|
|
item.props = {
|
|
|
- value: 'Code',
|
|
|
- label: 'Name',
|
|
|
- children: 'Content',
|
|
|
+ value: 'code',
|
|
|
+ label: 'name',
|
|
|
+ children: 'content',
|
|
|
checkStrictly: true
|
|
|
}
|
|
|
}
|
|
@@ -86,19 +96,27 @@ export default {
|
|
|
item.inputValue = '';
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
},
|
|
|
//数据分组
|
|
|
inputGroup() {
|
|
|
+ this.inputTypeList['item.firstName']
|
|
|
this.inputData.map(item => {
|
|
|
- if (!this.inputTypeList[item.FirstName]) {
|
|
|
- this.inputTypeList[item.FirstName] = [];
|
|
|
+ if (item.firstName) {
|
|
|
+ if (!this.inputTypeList[item.firstName]) {
|
|
|
+ this.inputTypeList[item.firstName] = [];
|
|
|
+ }
|
|
|
+ this.inputTypeList[item.firstName].push(item)
|
|
|
+ } else {
|
|
|
+ item.firstName = "信息"
|
|
|
+ if (!this.inputTypeList[item.firstName]) {
|
|
|
+ this.inputTypeList[item.firstName] = [];
|
|
|
+ }
|
|
|
+ this.inputTypeList[item.firstName].push(item)
|
|
|
}
|
|
|
- this.inputTypeList[item.FirstName].push(item)
|
|
|
})
|
|
|
for (let key in this.inputTypeList) {
|
|
|
if (this.inputTypeList[key] instanceof Array) {
|
|
|
- this.inputTypeList[key].sort((item1, item2) => { return item1.Sort < item2.Sort });
|
|
|
+ this.inputTypeList[key].sort((item1, item2) => { return item1.sort < item2.sort });
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -109,10 +127,10 @@ export default {
|
|
|
this.inputTypeList[key].map(item => {
|
|
|
if (item.inputValue != '' && item.inputValue != null) {
|
|
|
if (item.inputValue instanceof Array) {
|
|
|
- tools.setDataForKey(f, item.Path, item.inputValue.pop());
|
|
|
+ tools.setDataForKey(f, item.path, item.inputValue.pop());
|
|
|
}
|
|
|
else {
|
|
|
- tools.setDataForKey(f, item.Path, item.inputValue);
|
|
|
+ tools.setDataForKey(f, item.path, item.inputValue);
|
|
|
}
|
|
|
}
|
|
|
})
|