新增[查询-表单组件配置]

This commit is contained in:
2019-06-14 17:10:13 +08:00
parent 2ea2f5129e
commit f73a025abf
3 changed files with 69 additions and 13 deletions

View File

@@ -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")

View File

@@ -2,10 +2,9 @@ package net.tccn.base;
import lombok.Getter;
import net.tccn.base.arango.Doc;
import net.tccn.dbq.table.Field;
import net.tccn.dbq.fbean.FilterType;
import net.tccn.dbq.jdbc.api.DbAccount;
import net.tccn.dbq.jdbc.api.DbKit;
import net.tccn.dbq.table.Field;
import net.tccn.meta.*;
import net.tccn.plat.DbPlat;
import net.tccn.plat.SysPlat;
@@ -261,7 +260,7 @@ public final class MetaKit {
//filters
List<Map> _filters = new ArrayList<>();
/*List<Map> _filters = new ArrayList<>();
filters.forEach(x -> {
String col = String.valueOf(x.getName());
MetaTable metaTable = metaTables.get(col.split("[.]")[0]); // 表别名
@@ -289,7 +288,7 @@ public final class MetaKit {
filter.set("checked", x.isChecked());
});
_filters.add(filter);
});
});*/
//edits
//List _edits = new ArrayList();//edits;
@@ -350,7 +349,7 @@ public final class MetaKit {
.set("title", comment)
//.set("items", _items2)
.set("shows", shows)
.set("filters", _filters)
.set("filters", filters)
.set("edits", edits)
.set("details", details);
}

View File

@@ -3,6 +3,7 @@ package net.tccn.meta;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @author: liangxianyou
@@ -12,5 +13,7 @@ public class Filter {
private String name;
private String label;
private boolean checked;
private List<String> filterType;
private String inType;
private String inExt;
private List<Map<String, String>> filterType;
}