新增:1、qtask-debug结果渲染为表格
2、mdict 存贮到MySQL, meta 业务预览支持字典渲染验证
3、其他交互优化
This commit is contained in:
@@ -3,12 +3,25 @@
|
||||
<h3 class="pull-left">业务预览</h3>
|
||||
<div class="col-xs-4 pull-right">
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn">
|
||||
<!--<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button">添加过滤条件</button>
|
||||
</span>
|
||||
<select class="form-control" v-model="addFilter" style="width: 130px;">
|
||||
<option v-for="f in cfg.filters" :value="f.name" v-show="!f.checked">{{f.label}}</option>
|
||||
</select>
|
||||
</select>-->
|
||||
<div></div>
|
||||
<div class="dropdown dropdown-hover pull-right" style="padding-right: 20px;max-width: 160px;">
|
||||
<button class="btn" type="button" data-toggle="dropdown">
|
||||
<i class="icon icon-filter"></i> 过滤条件 <span class="caret"></span></button>
|
||||
<div class="dropdown-menu dropdown-menu-table" style="padding: 0">
|
||||
<div class="checkbox" v-for="f in cfg.filters">
|
||||
<label>
|
||||
<input type="checkbox" v-model="f.checked" :value="f.name"> {{f.label}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<span class="input-group-btn">
|
||||
<button @click="findList()" class="btn btn-primary" type="button"> 查询</button>
|
||||
@@ -46,32 +59,46 @@
|
||||
<div class="col-xs-2">
|
||||
<div style="padding-left: 10px;/*background-color: #ccc;*/width: 100%"> 业务列表(Meta-Service)</div>
|
||||
<ul class="nav nav-tabs nav-stacked dlist" style="height: 100%">
|
||||
<li :class="[{'active':service==item.alias}]" v-for="item in services" >
|
||||
<li :class="[{'active':service==item.name}]" v-for="item in services" >
|
||||
<a @click="service=item.name" :title="`${item.name}`" v-text="`${item.comment}`" href="javascript:;"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- 预览功能 -->
|
||||
<div class="col-xs-10">
|
||||
|
||||
<div class="col-xs-10" style="margin-top: 15px">
|
||||
|
||||
<!-- 过滤条件 -->
|
||||
<div class="col-lg-4 col-xs-6" v-for="(filter,index) in cfg.filters" v-if="filter.checked">
|
||||
<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;">
|
||||
|
||||
<!--<div class="input-group col-xs-4" v-for="(filter,index) in cfg.filters" v-if="filter.checked">
|
||||
<span class="input-group-addon">{{filter.label}}</span>
|
||||
<select class="form-control input-group-addon">
|
||||
<option>xxx</option>
|
||||
<option>yyy</option>
|
||||
</select>
|
||||
<span class="input-group-addon fix-border fix-padding"></span>
|
||||
|
||||
<input type="text" class="form-control" placeholder="输入电话号码">
|
||||
|
||||
<span class="input-group-addon fix-border fix-padding"></span>
|
||||
<span class="input-group-addon"><i class="icon icon-trash"></i></span>
|
||||
</div>-->
|
||||
|
||||
<div class="col-xs-4" v-for="(filter,index) in cfg.filters" v-if="filter.checked">
|
||||
<div class="input-group " style="padding-top: 3px">
|
||||
<span class="input-group-addon" style="max-width: 100px;">{{filter.label}}</span>
|
||||
<select class="form-control" v-model="filter['type']">
|
||||
<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']">
|
||||
<select v-if="filter.inType == 'DICT'" class="form-control" v-model="filter['value']" style="width: 100px">
|
||||
<select v-if="filter.inType == 'DICT'" class="form-control" v-model="filter['value']">
|
||||
<!-- option v-for="(t, index) in filter.filterType" :value="t.name" v-text="t.remark"></option -->
|
||||
<option value=""> 字典值一</option>
|
||||
<option value=""> 字典值二</option>
|
||||
</select>
|
||||
|
||||
<span class="input-group-addon fix-border fix-padding" style="padding: 5px" title="删除过滤条件">
|
||||
<span class="input-group-addon" title="删除过滤条件">
|
||||
<a href="javascript:;" @click="filter.checked = false;"><i class="icon icon-trash"></i></a>
|
||||
</span>
|
||||
</div>
|
||||
@@ -238,7 +265,7 @@
|
||||
return {1:"男",2:"女"}[v] || "未知性别"
|
||||
}
|
||||
|
||||
let {getServiceList, getCfg, getDataList, exportData, dataDel, dataSave} = meta
|
||||
let {getServiceList, getDataList, exportData, dataDel, dataSave} = meta
|
||||
let {showOk} = red
|
||||
let vm = new Vue({
|
||||
el:".data-list",
|
||||
@@ -259,12 +286,13 @@
|
||||
limit: {pn: 1, ps: 20, total: 0},
|
||||
order: {col: "", desc: 1},
|
||||
pk: "",
|
||||
detailData: {}
|
||||
detailData: {},
|
||||
dictData: {}, // 存放字典数据
|
||||
},
|
||||
watch: {
|
||||
addFilter(v) {
|
||||
this.cfg.filters.forEach(function (f) {
|
||||
if (f.name == v) {
|
||||
if (f.name === v) {
|
||||
f["checked"] = true;
|
||||
vm.addFilter = "";
|
||||
}
|
||||
@@ -272,8 +300,7 @@
|
||||
},
|
||||
service() {
|
||||
this.loadCfg(function () {
|
||||
this.limit = {pn: 1, ps: 20, total: 0};
|
||||
this.order = {col:"", desc:1};
|
||||
vm.limit = {pn: 1, ps: 20, total: 0};
|
||||
vm.findList();
|
||||
});
|
||||
},
|
||||
@@ -305,7 +332,7 @@
|
||||
});
|
||||
},
|
||||
loadCfg(back) {
|
||||
getCfg({name: this.service}).then(res => {
|
||||
meta.getCfg({name: this.service}).then(res => {
|
||||
// res['type'] = res.filters[0]['name']
|
||||
|
||||
for (i in res["filters"]) {
|
||||
@@ -328,6 +355,11 @@
|
||||
})
|
||||
}
|
||||
}
|
||||
if (fbean['orders'] && fbean['orders'].length > 0) {
|
||||
this.order = fbean['orders'][0]
|
||||
} else {
|
||||
this.order = {col: "", desc: 0};
|
||||
}
|
||||
|
||||
if (back) {
|
||||
back();
|
||||
@@ -337,8 +369,25 @@
|
||||
dealFieldFmt(bean, colFmt) { //处理字典数据 及 自定义函数处理数据
|
||||
|
||||
let v = bean[colFmt["col"]]
|
||||
if (colFmt.inType == "DICT") {
|
||||
if (colFmt.inType === "DICT") {
|
||||
// 取字典值返回
|
||||
let dicttype = colFmt['inExt']
|
||||
let dictArr = this.dictData[dicttype]
|
||||
if (!dictArr) {
|
||||
/*dict.list({type: dicttype}).then(res => {
|
||||
dictArr = res
|
||||
this.dictData[dicttype] = res
|
||||
console.log(res)
|
||||
})*/
|
||||
return v
|
||||
}
|
||||
|
||||
for (let i in dictArr) {
|
||||
if (dictArr[i].value + "" === v + "") {
|
||||
return dictArr[i].label
|
||||
}
|
||||
}
|
||||
return v
|
||||
} else if (colFmt.inType == "INPUT_DAY") {
|
||||
return red.timeFmt(new Date(v), 'yyyy-MM-dd')
|
||||
} else if (colFmt.inType == "INPUT_TIME") {
|
||||
@@ -395,8 +444,12 @@
|
||||
return str;
|
||||
},
|
||||
sortEvent(col) {
|
||||
if (vm.order.col == col) {
|
||||
if (vm.order.col === col) {
|
||||
vm.order.desc = -vm.order.desc
|
||||
// 第一次 1、第二次 -1、第三次点击的时候回到1(这个时候取消排序)
|
||||
if (vm.order.desc === 1) {
|
||||
vm.order.col = ''
|
||||
}
|
||||
} else {
|
||||
vm.order.col = col;
|
||||
vm.order.desc = 1;
|
||||
@@ -487,6 +540,9 @@
|
||||
},
|
||||
mounted() {
|
||||
this.serviceList();
|
||||
dict.list({}).then(res => {
|
||||
this.dictData = res
|
||||
})
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user