新增[查询-表单组件配置]
This commit is contained in:
@@ -261,8 +261,9 @@
|
||||
<th></th>
|
||||
<th style="width: 30px">字段名</th>
|
||||
<th style="width: 30px">中文名</th>
|
||||
<th style="width: 30px">默认展示</th>
|
||||
<th>支持查询类型</th>
|
||||
<th style="width: 30px">默认</th>
|
||||
<th>组件配置</th>
|
||||
<th>附加参数</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="item in serviceInfo.filters">
|
||||
@@ -271,16 +272,46 @@
|
||||
</td>
|
||||
<td v-text="item.name" style="background-color: rgb(235, 235, 228);"></td>
|
||||
<td style="padding: 1px;"><input v-model="item.label" class="form-control" style="width: 130px;padding: 0px"></td>
|
||||
<td style="padding: 1px;">
|
||||
<td style="padding: 1px;text-align: center;">
|
||||
<label>
|
||||
<input type="checkbox" v-model="item.checked" value="1"> 展示
|
||||
<input type="checkbox" v-model="item.checked" value="1">
|
||||
</label>
|
||||
</td>
|
||||
<td style="padding: 1px;overflow: inherit;">
|
||||
<select v-model="item.inType" class="form-control">
|
||||
<option v-for="x in findTypes" :value="x">{{x}}</option>
|
||||
</select>
|
||||
</td>
|
||||
<td style="padding: 1px;">
|
||||
<label class="checkbox-inline" v-for="c in filterCate">
|
||||
<input type="checkbox" v-model="item.filterType" :value="c"> {{c}}
|
||||
</label>
|
||||
<input v-show="item.inType == 'DICT' || item.inType == 'CHECKBOX' || item.inType == 'REDIO'" v-model="item.inExt" class="form-control" style="width: 130px;padding: 0px">
|
||||
<input disabled v-show="!(item.inType == 'DICT' || item.inType == 'CHECKBOX' || item.inType == 'REDIO')" v-model="item.inExt" class="form-control" style="width: 130px;padding: 0px">
|
||||
</td>
|
||||
<!--
|
||||
<td style="padding: 1px;overflow: inherit;">
|
||||
<div class="dropdown dropdown-hover">
|
||||
<button class="btn" type="button" data-toggle="dropdown">选择校验规则 <span class="caret"></span></button>
|
||||
<div class="dropdown-menu dropdown-menu-table">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>规则</th>
|
||||
<th>选择</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="c in ckTypes">
|
||||
<td v-text="c.label"></td>
|
||||
<td><input type="checkbox" v-model="item.cks" :value="c.name"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<label class="checkbox-inline" v-for="c in filterCate">
|
||||
<input type="checkbox" v-model="item.filterType" :value="c"> {{c}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
-->
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -476,6 +507,10 @@
|
||||
sheetArr: ["a"],//别名
|
||||
sheet: "a",//别名
|
||||
|
||||
filterRemarks: {
|
||||
EQUAL:"等于", NOTEQUAL:"等于", IN: "包含", NOTIN:"不包含", LIKE: "模糊查询", RANGE: "范围"
|
||||
},
|
||||
findTypes: ["INPUT", "DICT", "CHECKBOX", "RADIO", "DAY", "TIME"],
|
||||
inTypes: ["INPUT", "DICT", "INPUT_DAY", "INPUT_TIME", "FUNC", "QTASK", "HIDDEN"],
|
||||
ckTypes: [{label:"必填", name: "NOTNULL"},{label:"IP", name: "IP"},{label:"IPv4", name: "IPv4"},{label:"电话号码", name: "phone"}],
|
||||
dataTypes: ["bigint(20)", "varchar(255)", "varchar(64)", "varchar(32)", "varchar(16)", "int(11)", "int(3)", "int(2)", "datetime"],
|
||||
@@ -956,6 +991,25 @@
|
||||
let item = $(doms[i]).find("input[name='item']").val();
|
||||
filters.push(JSON.parse(item))
|
||||
}
|
||||
|
||||
for (let filter of filters) {
|
||||
let filterType = []
|
||||
let tmp = {
|
||||
INPUT: ["EQUAL", "NOTEQUAL", "LIKE"], // "IN"
|
||||
DICT: ["EQUAL", "NOTEQUAL"], //"IN"
|
||||
CHECKBOX: ["IN", "NOTIN"],
|
||||
RADIO: ["EQUAL", "NOTEQUAL"],
|
||||
DAY: ["EQUAL", "NOTEQUAL", "RANGE"], // "IN"
|
||||
TIME: ["RANGE"],
|
||||
}[filter["inType"]] || []
|
||||
|
||||
for (let k of tmp) {
|
||||
filterType.push({name:k, remark:this.filterRemarks[k]})
|
||||
}
|
||||
|
||||
filter["filterType"] = filterType
|
||||
}
|
||||
|
||||
filterSave({name: this.service, filters}).then(res => red.showOk())
|
||||
} else if (vm.status == 3) {
|
||||
let doms = $("#export>table>tbody>tr")
|
||||
|
||||
Reference in New Issue
Block a user