This commit is contained in:
lxy
2020-05-10 23:18:59 +08:00
parent 707e9ee680
commit 68eea7b27d
42 changed files with 5969 additions and 361 deletions

View File

@@ -27,7 +27,7 @@
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 业务列表(Meta-Service)</div>
<ul class="nav nav-tabs nav-stacked tlist" style="height: 100%">
<li :class="['clearfix',{'active':service==item.alias}]" v-for="item in services" >
<a @click="service=item.name" :title="`${item.name}`" v-text="`${item.name} [${item.comment}]`" href="javascript:;"></a>
<a @click="service=item.name" :title="`${item.name}`" v-text="`${item.comment}`" href="javascript:;"></a>
</li>
</ul>
</div>
@@ -55,9 +55,9 @@
<!-- 过滤条件 -->
<div class="col-lg-4 col-md-6" v-for="(filter,index) in cfg.filters" v-if="filter.checked">
<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">
<div class="input-group item" style="padding-top: 3px">
<span class="input-group-addon" style="max-width: 130px;">{{filter.label}}</span>
<select class="form-control" v-model="filter['type']" style="width: 95px;">
<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>
@@ -236,7 +236,7 @@
let {getServiceList, getCfg, getDataList, exportData, dataDel, dataSave} = meta
let {showOk} = red
var vm = new Vue({
let vm = new Vue({
el:".data-list",
data: {
cfg: {
@@ -252,7 +252,7 @@
addFilter: "",
para: {},
list: {rows: [], total: 0},
limit: {pn: 1, ps: 10, total: 0},
limit: {pn: 1, ps: 20, total: 0},
order: {col: "id", desc: 1},
pk: "",
detailData: {}
@@ -268,7 +268,7 @@
},
service() {
this.loadCfg();
this.limit = {pn: 1, ps: 10, total: 0};
this.limit = {pn: 1, ps: 20, total: 0};
this.order = {col:"", desc:1};
this.findList();
},
@@ -301,7 +301,7 @@
},
loadCfg() {
getCfg({name: this.service}).then(res => {
res['type'] = res.filters[0]['name']
// res['type'] = res.filters[0]['name']
for (i in res["filters"]) {
res["filters"][i]['type'] = res["filters"][i]['filterType'][0]['name']
@@ -311,59 +311,28 @@
},
dealFieldFmt(bean, colFmt) { //处理字典数据 及 自定义函数处理数据
let v = ""
let v = bean[colFmt["col"]]
if (colFmt.inType == "DICT") {
// 取字典值返回
v = bean[colFmt["col"]]
}
else if (colFmt.inType == "INPUT_DAY") {
v = bean[colFmt["col"]]
}
else if (colFmt.inType == "INPUT_TIME") {
v = bean[colFmt["col"]]
// 时间戳格式化
return red.timeFmt(new Date(v))
}
else if (colFmt.inType == "INPUT_FUNC") {
v = bean[colFmt["col"]]
}
else if (colFmt.inType == "FILE" && v) {
return '<a href="{0}" target="_blank">查看</a>'.format(v)
}
else {
v = bean[colFmt["col"]]
}
if (colFmt.inType && colFmt.inType != "INPUT") {
v += " -> "+colFmt.inType
}
return v
/*if (colFmt["fmt"]) {
let fmt = colFmt["fmt"]
let cate = ""
if (fmt.indexOf("|") > 0) {
cate = fmt.split("|")[0]
fmt = fmt.split("|")[1]
}
if (cate == "Dict") {
//console.log(`Dict:${fmt}-${bean[colFmt["col"]]}`)
}
else {
//console.log(`func:${fmt}-${bean[colFmt["col"]]}`)
let evl = `${fmt}(${JSON.stringify(bean)},'${bean[colFmt["col"]]}')`
//console.log("evl", evl)
return (new Function("","return "+ evl))()
}
return bean[colFmt["col"]];
} else {
//console.log(`k-v:${colFmt["col"]}-${bean[colFmt["col"]]}`)
return bean[colFmt["col"]]
}*/
},
dealField(bean, field) {
let str = "";
@@ -438,12 +407,12 @@
let orders = [];
//截取真实字段名,(考虑如果多表关联情况,是否需要加入真实字段名)
if (vm.order.col) {
var end = vm.order.col.indexOf("\|");
let end = vm.order.col.indexOf("\|");
if (end < 0) {
end = vm.order.col.indexOf("=")
}
var col = vm.order.col;
let col = vm.order.col;
if (end > 0) {
col = vm.order.col.substring(0, end);
}
@@ -497,4 +466,4 @@
this.serviceList();
}
});
</script>
</script>