优化改进配置的 默认项

This commit is contained in:
2019-08-16 00:54:41 +08:00
parent c656ba349e
commit 707e9ee680
2 changed files with 17 additions and 11 deletions

View File

@@ -58,7 +58,7 @@
<div class="input-group item">
<span class="input-group-addon" style="width: 130px;">{{filter.label}}</span>
<select class="form-control" v-model="filter['type']" style="width: 100px">
<option v-for="(t, index) in filter.filterType" :value="t.name" v-text="t.remark"></option>
<option v-for="(t, i) in filter.filterType" :value="t.name" v-text="t.remark"></option>
</select>
<span class="input-group-addon fix-border fix-padding"></span>
<input v-if="!filter.inType || filter.inType == 'INPUT'" type="text" class="form-control" v-model="filter['value']">
@@ -300,7 +300,14 @@
});
},
loadCfg() {
getCfg({name: this.service}).then(res => this.cfg = res);
getCfg({name: this.service}).then(res => {
res['type'] = res.filters[0]['name']
for (i in res["filters"]) {
res["filters"][i]['type'] = res["filters"][i]['filterType'][0]['name']
}
this.cfg = res
});
},
dealFieldFmt(bean, colFmt) { //处理字典数据 及 自定义函数处理数据

View File

@@ -186,7 +186,6 @@
<td style="padding: 1px;"><input v-model="item.label" class="form-control" style="width: 130px;padding: 0px"></td>
<td style="padding: 1px;">
<select v-model="item.inType" class="form-control" style="width: 130px">
<option></option>
<option v-for="x in inTypes" :value="x">{{x}}</option>
</select>
</td>
@@ -226,7 +225,6 @@
<td style="padding: 1px;"><input v-model="item.label" class="form-control" style="padding: 0px"></td>
<td style="padding: 1px;">
<select v-model="item.inType" class="form-control" style="width: 130px">
<option></option>
<option v-for="x in exportFmtTypes" :value="x">{{x}}</option>
</select>
</td>
@@ -353,7 +351,6 @@
<td style="padding: 1px;"><input v-model="item.label" class="form-control" style="width: 130px;padding: 0px"></td>
<td style="padding: 1px;">
<select v-model="item.inType" class="form-control" style="width: 130px">
<option></option>
<option v-for="x in inTypes" :value="x">{{x}}</option>
</select>
</td>
@@ -376,7 +373,7 @@
<th>数据字段</th>
<th>展示名称</th>
<th>表单组件</th>
<th>据格式化</th>
<th>附加参</th>
<th>表单校验</th>
</tr>
</thead>
@@ -389,7 +386,6 @@
<td style="padding: 1px;"><input v-model="item.label" class="form-control" style="width: 100px;padding: 0px"></td>
<td style="padding: 1px;">
<select v-model="item.inType" class="form-control" style="width: 130px">
<option></option>
<option v-for="x in inTypes" :value="x">{{x}}</option>
</select>
</td>
@@ -542,7 +538,7 @@
shows: [],
exports: [],
imports: [],
filters: [{name: '', label: '', filterType: ['']}],
filters: [{name: '', label: '', filterType: [''], type:""}],
details: [],
edits: [],
dels: {cate: "", sql: "", qtask: ""}
@@ -676,7 +672,7 @@
}
}
let label = this.getFieldLabel(v[i])
filters.push({name: v[i], label, filterType: ["EQUAL"], checked: false})//构造filter 对象
filters.push({name: v[i], label, filterType: ["EQUAL"], checked: false, inType:"INPUT"})//构造filter 对象
}
// 去除删除的
@@ -715,6 +711,9 @@
if (!shows[j]['label']) {
shows[j]['label'] = this.getFieldLabel(v[i])
}
if (!shows[j]['inType']) {
shows[j]['inType'] = "INPUT"
}
/*if (!shows[j]['fmt']) {
shows[j]['fmt'] = this.getFiledInExt(v[i])
}*/
@@ -800,7 +799,7 @@
continue c
}
}*/
details.push({col: v[i], label: label})
details.push({col: v[i], label: label, inType: 'INPUT'})
}
//去除删除的
@@ -834,7 +833,7 @@
}
// 新的
let label = this.getFieldLabel(v[i])
edits.push({col: v[i], label: label, cks:[]})
edits.push({col: v[i], label: label, cks:[], inType: 'INPUT'})
}
//去除删除的