1、代码优化,重构逻辑,界面html
2、解决TplKit 因升级导致的模板文件找不到(退回原版本)
This commit is contained in:
@@ -65,56 +65,14 @@ const meta = {
|
||||
},
|
||||
tableInfo({name, alias}) {
|
||||
return red.postX('/meta/tableinfo', {name, alias})
|
||||
}
|
||||
},
|
||||
|
||||
// Meta-Table
|
||||
itemSort({alias, items}) {
|
||||
return red.postX('/meta/itemsort', {alias, items: JSON.stringify(items)})
|
||||
},
|
||||
itemUpdate({alias, items}) {
|
||||
return red.postX('/meta/itemupdate', {alias, items: JSON.stringify(items)})
|
||||
},
|
||||
}
|
||||
|
||||
let a = [
|
||||
{
|
||||
name: '',
|
||||
alias: '',
|
||||
link: [
|
||||
{"a.id": "b.x"}
|
||||
],
|
||||
}
|
||||
]
|
||||
|
||||
/*
|
||||
|
||||
let list = [
|
||||
{id: 1, pid:0},
|
||||
{id: 2, pid:0},
|
||||
{id: 3, pid:0},
|
||||
{id: 4, pid:1},
|
||||
{id: 5, pid:2},
|
||||
{id: 6, pid:5},
|
||||
{id: 7, pid:1},
|
||||
{id: 8, pid:0},
|
||||
]
|
||||
|
||||
|
||||
class Tree {
|
||||
constructor(id, pid) {
|
||||
this.id = id
|
||||
this.pid = pid
|
||||
this.left = undefined;
|
||||
this.right = undefined;
|
||||
this.nodes = []
|
||||
}
|
||||
add(tree) {
|
||||
this.nodes.push(tree)
|
||||
}
|
||||
}
|
||||
|
||||
let nodes = new Tree(null, 0);
|
||||
|
||||
|
||||
for (let x of list) {
|
||||
if (x.pid == 0) {
|
||||
nodes.add(x)
|
||||
continue
|
||||
}
|
||||
|
||||
for (let i = 0; i < x.nodes.length; i++) {
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
|
||||
<style>
|
||||
.item {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<row class="data-list">
|
||||
<div class="info">
|
||||
@@ -28,33 +23,46 @@
|
||||
</div>
|
||||
|
||||
|
||||
<h3>高级查询 - [测试用例]</h3>
|
||||
<!--<h3>高级查询 - [测试用例]</h3>
|
||||
<div class="col-md-6">
|
||||
<select class="form-control" v-model="service" style="width: 300px;">
|
||||
<option v-for="t in services" :value="t.name">{{t.comment}} [{{t.name}}]</option>
|
||||
</select>
|
||||
</div>-->
|
||||
|
||||
<!-- 业务列表 -->
|
||||
<div class="col-md-2">
|
||||
<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>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="input-group pull-left">
|
||||
<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" :disabled="f.checked">{{f.label}}</option>
|
||||
</select>
|
||||
|
||||
<!-- 预览功能 -->
|
||||
<div class="col-md-10">
|
||||
<div class="col-md-4 pull-right">
|
||||
<div class="input-group">
|
||||
<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" :disabled="f.checked">{{f.label}}</option>
|
||||
</select>
|
||||
|
||||
<span class="input-group-btn">
|
||||
<span class="input-group-btn">
|
||||
<button @click="findList()" class="btn btn-primary" type="button"> 查询</button>
|
||||
</span>
|
||||
<span class="input-group-btn" style="padding-left: 10px">
|
||||
<button @click="exportExcel" class="btn" type="button"> 导出</button>
|
||||
</span>
|
||||
</span>
|
||||
<span class="input-group-btn" style="padding-left: 10px">
|
||||
<button @click="exportExcel" class="btn" type="button"> 导出</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<div class="">
|
||||
<div class="col-lg-4 col-md-6 col-xs-12" v-for="(filter,index) in cfg.filters" v-if="filter.checked">
|
||||
<!-- 过滤条件 -->
|
||||
<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">
|
||||
@@ -64,53 +72,56 @@
|
||||
<input type="text" class="form-control" v-model="filter['value']">
|
||||
|
||||
<span class="input-group-addon fix-border fix-padding" style="padding: 5px" title="删除过滤条件">
|
||||
<a href="javascript:;" @click="filter.checked = false;"><i class="icon icon-trash"></i></a>
|
||||
</span>
|
||||
<a href="javascript:;" @click="filter.checked = false;"><i class="icon icon-trash"></i></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<div class="col-md-12" style="padding-top: 10px;overflow:auto;">
|
||||
<table class="table table-bordered table-hover" style="width: 100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="field in cfg.shows"
|
||||
v-text="getFieldLabel(field.col)"
|
||||
:class="{'sort':field.order>0, 'sort-up':field.col==order.col && order.desc==1, 'sort-down':field.col==order.col && order.desc!=1}"
|
||||
@click="sortEvent(field.col)"
|
||||
>
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="row in list.rows">
|
||||
<td v-for="field in cfg.shows" v-title="dealField(row, field.col)" v-text="dealField(row, field.col)"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="pager pull-right" style="margin: 5px 10px">
|
||||
|
||||
<li class="previous">
|
||||
<a style="border: 0;">共{{list.total}}条数据</a>
|
||||
</li>
|
||||
<li :class="['previous', {'disabled':limit.pn==1}]">
|
||||
<a @click="findList(-- limit.pn)" href="javascript:;">«上一页</a>
|
||||
</li>
|
||||
<li :class="['next', {'disabled':limit.pn >= limit.total}]">
|
||||
<a @click="findList(limit.pn = ++limit.pn )" href="javascript:;">»下一页</a>
|
||||
</li>
|
||||
|
||||
<li class="previous">
|
||||
<a style="border-bottom: 0;border-right: 0;border-top: 0;">到第<input v-model="limit.pn" style="width: 30px;height: 21px;">/ {{limit.total}}页</a>
|
||||
</li>
|
||||
<li class="previous">
|
||||
<a @click="findList(limit.pn)" href="javascript:;">确定</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" style="padding-top: 10px;overflow:auto;">
|
||||
<table class="table table-bordered table-hover" style="width: 100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="field in cfg.shows"
|
||||
v-text="getFieldLabel(field.col)"
|
||||
:class="{'sort':field.order>0, 'sort-up':field.col==order.col && order.desc==1, 'sort-down':field.col==order.col && order.desc!=1}"
|
||||
@click="sortEvent(field.col)"
|
||||
>
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="row in list.rows">
|
||||
<td v-for="field in cfg.shows" v-title="dealField(row, field.col)" v-text="dealField(row, field.col)"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="pager pull-right" style="margin: 5px 10px">
|
||||
|
||||
<li class="previous">
|
||||
<a style="border: 0;">共{{list.total}}条数据</a>
|
||||
</li>
|
||||
<li :class="['previous', {'disabled':limit.pn==1}]">
|
||||
<a @click="findList(-- limit.pn)" href="javascript:;">«上一页</a>
|
||||
</li>
|
||||
<li :class="['next', {'disabled':limit.pn >= limit.total}]">
|
||||
<a @click="findList(limit.pn = ++limit.pn )" href="javascript:;">»下一页</a>
|
||||
</li>
|
||||
|
||||
<li class="previous">
|
||||
<a style="border-bottom: 0;border-right: 0;border-top: 0;">到第<input v-model="limit.pn" style="width: 30px;height: 21px;">/ {{limit.total}}页</a>
|
||||
</li>
|
||||
<li class="previous">
|
||||
<a @click="findList(limit.pn)" href="javascript:;">确定</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</row>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -1,30 +1,3 @@
|
||||
<style>
|
||||
.checkbox-inline:first-child{
|
||||
left: 10px;
|
||||
margin-right: 10px!important;
|
||||
}
|
||||
.checkbox input[type=checkbox], .checkbox-inline input[type=checkbox], .radio input[type=radio], .radio-inline input[type=radio] {
|
||||
margin-top: 12px;
|
||||
}
|
||||
.hv {
|
||||
color: #ea644a!important;
|
||||
}
|
||||
.hv:focus,.hv:hover {
|
||||
color: #8b8a15!important;
|
||||
}
|
||||
.active>.hv{
|
||||
color: #8b8a15!important;
|
||||
}
|
||||
.tlist{
|
||||
height:100%; overflow: auto;
|
||||
}
|
||||
.tlist>li.active>a,
|
||||
.tlist>li.active>a:focus,
|
||||
.tlist>li.active>a:hover,
|
||||
.tlist>li>a:hover {
|
||||
background-color: #92b0cb;
|
||||
}
|
||||
</style>
|
||||
<row class="meta-link">
|
||||
<div class="info">
|
||||
<a @click="showInfo()" href="javascript:;"><i class="icon icon-info"></i></a>
|
||||
@@ -50,11 +23,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div class="col-xs-2 sheet-cell">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 实体表(Meta-Table)</div>
|
||||
<ul class="nav nav-tabs nav-stacked tlist" style="height: 100%">
|
||||
<li :class="['clearfix', {'active': aliasA == item.alias}]" v-for="item in tables" >
|
||||
<li :class="[{'active': aliasA == item.alias}]" v-for="item in tables" >
|
||||
<a href="javascript:;" @click="aliasA=item.alias" data-target="#tab3Content1" data-toggle="tab" v-text="dealTableLabel(item)"></a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -69,9 +41,9 @@
|
||||
<button @click="status=1" v-show="status==0 && aliasB" class="btn">修改关联关系</button>
|
||||
<button @click="status=0" v-show="status==1" class="btn">取消修改</button>
|
||||
<button @click="addLinkDia()" class="btn">+ 添加关联表</button>
|
||||
<button @click="saveLink()" v-show="status==1" class="btn btn-primary" style="margin-right: 15px">保存</button>
|
||||
<button @click="saveLink()" v-show="status==1" class="btn btn-primary" style="margin-left: 15px">保存</button>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<!--<div class="clearfix"></div>-->
|
||||
<table class="table-bordered" style="width: 100%;">
|
||||
<tr>
|
||||
<th v-text="tableInfo[aliasA] && tableInfo[aliasA]['comment']"></th>
|
||||
|
||||
@@ -1,21 +1,6 @@
|
||||
<style>
|
||||
.table td, .table th{
|
||||
padding: 6px;
|
||||
}
|
||||
.panel-body {
|
||||
padding: 0;
|
||||
}
|
||||
.tlist>li.active>a,
|
||||
.tlist>li.active>a:focus,
|
||||
.tlist>li.active>a:hover,
|
||||
.tlist>li>a:hover {
|
||||
background-color: #92b0cb;
|
||||
border-bottom: 2px solid #607d8b;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
<row class="meta-service">
|
||||
<div class="col-md-12" style="padding-top: 10px;">
|
||||
<div class="col-md-12">
|
||||
<div class="info" style="padding-left: 10px">
|
||||
<a @click="showInfo()" href="javascript:;"><i class="icon icon-info"></i></a>
|
||||
</div>
|
||||
@@ -67,7 +52,7 @@
|
||||
<option v-for="item in services" :value="item.name"> {{item.name}} [{{item.comment}}]</option>
|
||||
</select>
|
||||
|
||||
<span class="input-group-btn pull-left" style="padding-left: 20px">
|
||||
<span class="input-group-btn pull-left" style="padding-left: 5px">
|
||||
<button @click="createService()" :class="['btn']" type="button"> 新建业务</button>
|
||||
</span>
|
||||
|
||||
@@ -79,7 +64,7 @@
|
||||
<button @click="status=6" :class="['btn',{'btn-primary':status==6}]" type="button"> 查询配置</button>
|
||||
</span>
|
||||
|
||||
<span class="input-group-btn" style="padding-left: 20px">
|
||||
<span class="input-group-btn" style="padding-left: 10px">
|
||||
<button @click="status=3" :class="['btn',{'btn-primary':status==3}]" type="button"> 导出配置</button>
|
||||
</span>
|
||||
<!--<span class="input-group-btn">
|
||||
@@ -89,106 +74,96 @@
|
||||
<button @click="tipShow()" :class="['btn',{'btn-primary':status==7}]" type="button"> 基本属性</button>
|
||||
</span>-->
|
||||
|
||||
<span class="input-group-btn" style="padding-left: 30px">
|
||||
<span class="input-group-btn" style="padding-left: 20px">
|
||||
<button @click="save()" :class="['btn',{'btn-primary':status!=0},{'disabled':status==0}]" type="button"> 保存</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-1" style="padding-right: 0px">
|
||||
<ul class="nav nav-tabs nav-stacked tlist" style="height: 100%">
|
||||
<div class="col-md-2">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 业务相关表</div>
|
||||
<ul class="nav nav-tabs nav-stacked tlist">
|
||||
<li @click="sheet=item" :class="[{active: sheet==item }]" v-for="item in sheetArr" >
|
||||
<a href="javascript:;" data-target="#tab3Content1" data-toggle="tab" v-text="serviceDetail['tables'][item]['name']"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6" style="padding-left: 0px;">
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade active in" id="">
|
||||
<table :class="[{'table':status!=2},'table-bordered', 'table-auto']" style="width: 100%">
|
||||
<tr style="background-color: #f1f1f1">
|
||||
<td v-show="status==3 || status==4 || status==5 || status==6"><input type="checkbox"></td>
|
||||
<th v-show="status==1"></th>
|
||||
<th>字段名</th>
|
||||
<th>中文名</th>
|
||||
<th>数据类型</th>
|
||||
<th>输入类型</th>
|
||||
<th>附加属性</th>
|
||||
<th>备注</th>
|
||||
</tr>
|
||||
<tr v-for="(item, index) in serviceDetail['tables'][sheet].items">
|
||||
<td v-show="status==3"><input type="checkbox" v-model="serviceInfo.exports" :value="sheet + '$' + item.name" class=""></td>
|
||||
<td v-show="status==4"><input type="checkbox" v-model="serviceInfo.imports" :value="sheet + '$' + item.name" class=""></td>
|
||||
<td v-show="status==5"><input type="checkbox" v-model="serviceInfo.shows" :value="sheet + '$' + item.name" class=""></td>
|
||||
<td v-show="status==6"><input type="checkbox" v-model="filterArr" :value="sheet + '$' + item.name" class=""></td>
|
||||
|
||||
<td v-show="status==1" class="icon icon-move"></td>
|
||||
<td v-show="status!=2" v-text="item.name" style="background-color: rgb(235, 235, 228);"></td>
|
||||
<td v-show="status!=2" v-text="item.label"></td>
|
||||
<td v-show="status!=2" v-text="item.type"></td>
|
||||
<td v-show="status!=2" v-text="item.inType"></td>
|
||||
<td v-show="status!=2" v-text="item.inExt"></td>
|
||||
<td v-show="status!=2" v-text="item.remark"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 实体字段信息 -->
|
||||
<div class="col-md-5" style="padding-left: 0px;">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 字段信息</div>
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td v-show="status==3 || status==4 || status==5 || status==6"><input type="checkbox"></td>
|
||||
<th v-show="status==1"></th>
|
||||
<th>字段名</th>
|
||||
<th>中文名</th>
|
||||
<th>数据类型</th>
|
||||
<!--<th>输入类型</th>
|
||||
<th>附加属性</th>
|
||||
<th>备注</th>-->
|
||||
</tr>
|
||||
<tr v-for="(item, index) in serviceDetail['tables'][sheet].items">
|
||||
<td v-show="status==3"><input type="checkbox" v-model="serviceInfo.exports" :value="sheet + '$' + item.name"></td>
|
||||
<td v-show="status==4"><input type="checkbox" v-model="serviceInfo.imports" :value="sheet + '$' + item.name"></td>
|
||||
<td v-show="status==5"><input type="checkbox" v-model="serviceInfo.shows" :value="sheet + '$' + item.name"></td>
|
||||
<td v-show="status==6"><input type="checkbox" v-model="filterArr" :value="sheet + '$' + item.name"></td>
|
||||
|
||||
<td v-text="item.name" style="background-color: rgb(235, 235, 228);"></td>
|
||||
<td v-text="item.label"></td>
|
||||
<td v-text="item.type"></td>
|
||||
<!--<td v-text="item.inType"></td>
|
||||
<td v-text="item.inExt"></td>
|
||||
<td v-text="item.remark"></td>-->
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-xs-5" style="padding-left: 0px;padding-right: 0px">
|
||||
|
||||
<div class="col-md-5" style="padding-left: 0px;padding-right: 0px;">
|
||||
<!-- shows -->
|
||||
<div class="panel" v-show="status==5">
|
||||
<div class="panel-heading">列表展示的属性</div>
|
||||
<div id="show" class="panel-body">
|
||||
<table class="table-bordered table-auto" style="width: 100%">
|
||||
<thead>
|
||||
<tr style="background-color: #f1f1f1">
|
||||
<th></th>
|
||||
<th>字段名</th>
|
||||
<th>中文名</th>
|
||||
<!--<th>支持排序</th>-->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item, index) in serviceInfo.shows">
|
||||
<td class="icon icon-move">
|
||||
<input name="name" :value="item" type="hidden">
|
||||
</td>
|
||||
<td v-text="item" style="background-color: rgb(235, 235, 228);"></td>
|
||||
<td v-text="">{{getFieldLabel(item)}}</td>
|
||||
<td v-show="false"><input v-model="item.label" style="width: 100px;"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="show" v-show="status==5">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 展示字段配置</div>
|
||||
<table class="table table-bordered table-auto" style="width: 100%;background-color: #fff;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>字段名</th>
|
||||
<th>中文名</th>
|
||||
<!--<th>支持排序</th>-->
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="(item, index) in serviceInfo.shows">
|
||||
<td class="icon icon-move">
|
||||
<input name="name" :value="item" type="hidden">
|
||||
</td>
|
||||
<td v-text="item" style="background-color: rgb(235, 235, 228);"></td>
|
||||
<td v-text="">{{getFieldLabel(item)}}</td>
|
||||
<td v-show="false"><input v-model="item.label" style="width: 100px;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- exports -->
|
||||
<div class="panel" v-show="status==3">
|
||||
<div class="panel-heading">导出的属性配置</div>
|
||||
<div id="export" class="panel-body">
|
||||
<table class="table-bordered table-auto" style="width: 100%">
|
||||
<thead>
|
||||
<tr style="background-color: #f1f1f1">
|
||||
<th></th>
|
||||
<th>字段名</th>
|
||||
<th>中文名</th>
|
||||
<!--<th>展示名</th>-->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item, index) in serviceInfo.exports">
|
||||
<td class="icon icon-move">
|
||||
<input name="name" :value="item" type="hidden">
|
||||
</td>
|
||||
<td v-text="item" style="background-color: rgb(235, 235, 228);"></td>
|
||||
<td v-text="">{{getFieldLabel(item)}}</td>
|
||||
<td v-show="false"><input v-model="item.label" style="width: 100px;"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="export" v-show="status==3">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 查询配置</div>
|
||||
<table class="table table-bordered table-auto" style="width: 100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>字段名</th>
|
||||
<th>中文名</th>
|
||||
<!--<th>展示名</th>-->
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="(item, index) in serviceInfo.exports">
|
||||
<td class="icon icon-move">
|
||||
<input name="name" :value="item" type="hidden">
|
||||
</td>
|
||||
<td v-text="item" style="background-color: rgb(235, 235, 228);"></td>
|
||||
<td v-text="">{{getFieldLabel(item)}}</td>
|
||||
<td v-show="false"><input v-model="item.label" style="width: 100px;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- imports -->
|
||||
@@ -221,45 +196,39 @@
|
||||
</div>
|
||||
|
||||
<!-- filters -->
|
||||
<div class="panel" v-show="status==6">
|
||||
<div class="panel-heading">查询配置</div>
|
||||
<div id="filter" class="panel-body" style="overflow:auto;">
|
||||
<table class="table-bordered table-auto" style="width: 100%">
|
||||
<thead>
|
||||
<tr style="background-color: #f1f1f1">
|
||||
<th></th>
|
||||
<th style="width: 30px">字段名</th>
|
||||
<th style="width: 30px">中文名</th>
|
||||
<th style="width: 30px">默认展示</th>
|
||||
<th>支持查询类型</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item, index) in filterArr">
|
||||
<td class="icon icon-move">
|
||||
<input name="name" :value="item" type="hidden">
|
||||
</td>
|
||||
<td v-text="item" style="background-color: rgb(235, 235, 228);"></td>
|
||||
<td v-text="">{{getFieldLabel(item)}}</td>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" v-model="filterMap[item].checked" value="1"> 展示
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="checkbox-inline" v-for="c in filterCate">
|
||||
<input type="checkbox" v-model="filterMap[item].filterType" :value="c"> {{c}}
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filter" v-show="status==6">
|
||||
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 查询配置</div>
|
||||
<table class="table table-bordered table-auto" style="width: 100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="width: 30px">字段名</th>
|
||||
<th style="width: 30px">中文名</th>
|
||||
<th style="width: 30px">默认展示</th>
|
||||
<th>支持查询类型</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="(item, index) in filterArr">
|
||||
<td class="icon icon-move">
|
||||
<input name="name" :value="item" type="hidden">
|
||||
</td>
|
||||
<td v-text="item" style="background-color: rgb(235, 235, 228);"></td>
|
||||
<td v-text="">{{getFieldLabel(item)}}</td>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" v-model="filterMap[item].checked" value="1"> 展示
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="checkbox-inline" v-for="c in filterCate">
|
||||
<input type="checkbox" v-model="filterMap[item].filterType" :value="c"> {{c}}
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
|
||||
<!-- 新建业务 -->
|
||||
<div class="modal fade" id="createServiceDia">
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
<style>
|
||||
/* todo 提取样式 */
|
||||
.tlist{
|
||||
height:100%; overflow: auto;
|
||||
}
|
||||
.tlist>li.active>a,
|
||||
.tlist>li.active>a:focus,
|
||||
.tlist>li.active>a:hover,
|
||||
.tlist>li>a:hover {
|
||||
background-color: #92b0cb;
|
||||
}
|
||||
|
||||
</style>
|
||||
<row class="meta-list">
|
||||
<div class="col-md-12" style="padding-top: 10px;">
|
||||
<div class="col-md-12">
|
||||
<div class="input-group list-head">
|
||||
<div class="pull-left">
|
||||
<span class="input-group-btn">
|
||||
@@ -24,19 +11,19 @@
|
||||
<button @click="status=8" :class="['btn',{'btn-primary':status==8}]" type="button"> 实体关系(MetaLink)</button>
|
||||
</span>
|
||||
|
||||
<span class="input-group-btn" style="padding-left: 5px">
|
||||
<span class="input-group-btn" style="padding-left: 10px">
|
||||
<button @click="status=2" :class="['btn',{'btn-primary':status==2}]" type="button"> 字段编辑</button>
|
||||
</span>
|
||||
<span class="input-group-btn">
|
||||
<button @click="status=1" :class="['btn',{'btn-primary':status==1}]" type="button"> 排序</button>
|
||||
</span>
|
||||
|
||||
<span class="input-group-btn" style="padding-left: 20px">
|
||||
<span class="input-group-btn" style="padding-left: 10px">
|
||||
<button @click="status=7;" :class="['btn',{'btn-primary':status==7}]" type="button"> 基本属性</button>
|
||||
</span>
|
||||
<!-- fixme: 加入数据平台相关操作, 1、关联数据平台,2、表结构入库 -->
|
||||
|
||||
<span class="input-group-btn" style="padding-left: 30px">
|
||||
<span class="input-group-btn" style="padding-left: 20px">
|
||||
<button @click="save()" :class="['btn',{'btn-primary':status!=0},{'disabled':status==0}]" type="button"> 保存</button>
|
||||
</span>
|
||||
</div>
|
||||
@@ -78,7 +65,7 @@
|
||||
|
||||
<td v-show="status==2">
|
||||
<input v-model="item" type="hidden">
|
||||
<input :value="item.name" class="form-control">
|
||||
<input :value="item.name" disabled class="form-control">
|
||||
<input v-model="item.name" type="hidden">
|
||||
<input name="name" type="hidden" :value="item.name">
|
||||
</td>
|
||||
@@ -151,7 +138,7 @@
|
||||
</row>
|
||||
|
||||
<script>
|
||||
let {getTableList, tableInfo} = meta;
|
||||
let {getTableList, tableInfo, itemSort, itemUpdate} = meta;
|
||||
let {showOk} = red
|
||||
|
||||
var vm = new Vue({
|
||||
@@ -191,16 +178,17 @@
|
||||
this.loadDetail();
|
||||
},
|
||||
"meta.items": {
|
||||
handler: function (nv, ov) {
|
||||
var itemNv = nv || [];
|
||||
var itemOv = vm.oldItems || [];
|
||||
handler: function (nv) {
|
||||
let itemNv = nv || [];
|
||||
let itemOv = this.oldItems || [];
|
||||
if (itemOv.length == 0) return;
|
||||
|
||||
var itemEdit = [];
|
||||
a:for (var i = 0; i < itemOv.length; i++) {
|
||||
var attr = ["label", "name", "remark", "type", "inType","inExt"];
|
||||
for (var j = 0; j < attr.length; j++) {
|
||||
var k = attr[j];
|
||||
let attr = ["label", "name", "remark", "type", "inType","inExt"];
|
||||
let itemEdit = [];
|
||||
a:for (let i = 0; i < itemOv.length; i++) {
|
||||
for (let j = 0; j < attr.length; j++) {
|
||||
let k = attr[j];
|
||||
//console.log(itemOv[i][k], '--', itemNv[i][k])
|
||||
if (itemOv[i][k] != itemNv[i][k]) {
|
||||
itemEdit.push(itemNv[i]);
|
||||
continue a;
|
||||
@@ -208,7 +196,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
vm.itemEdit = itemEdit;
|
||||
console.log(itemEdit)
|
||||
this.itemEdit = itemEdit;
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
@@ -222,7 +211,9 @@
|
||||
}
|
||||
},
|
||||
meta: function (v) {
|
||||
vm.row = {key:v.key, dbPlatId: v.dbPlatId, catalog: v.catalog, name:v.name, comment:v.comment, alias: v.alias};
|
||||
this.row = {key:v.key, dbPlatId: v.dbPlatId, catalog: v.catalog, name:v.name, comment:v.comment, alias: v.alias};
|
||||
let oldItems = v['items'] || []
|
||||
this.oldItems = JSON.parse(JSON.stringify(oldItems))
|
||||
},
|
||||
|
||||
},
|
||||
@@ -259,7 +250,7 @@
|
||||
})
|
||||
},
|
||||
catalogs: function() {
|
||||
var dbPlats = this.dbPlats;
|
||||
let dbPlats = this.dbPlats;
|
||||
for (i in dbPlats) {
|
||||
if (dbPlats[i].key == this.row.dbPlatId) {
|
||||
return dbPlats[i]["catalogs"]
|
||||
@@ -271,10 +262,10 @@
|
||||
$('#sortableList,table>tbody').sortable({
|
||||
selector: '.item', // '.list-group-item, tr',
|
||||
finish: function (e) {
|
||||
var rows = e.list;
|
||||
let rows = e.list;
|
||||
vm.itemSort = [];
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
var item = $(rows[i]).find("input[name='name']").val();
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
let item = $(rows[i]).find("input[name='name']").val();
|
||||
vm.itemSort.push(item);
|
||||
}
|
||||
},
|
||||
@@ -311,10 +302,10 @@
|
||||
$('#export>table>tbody').sortable({
|
||||
selector: 'tr',
|
||||
finish: function (e) {
|
||||
var rows = e.list;
|
||||
var shows = [];
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
var item = $(rows[i]).find("input[name='name']").val();
|
||||
let rows = e.list;
|
||||
let shows = [];
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
let item = $(rows[i]).find("input[name='name']").val();
|
||||
shows.push(item);
|
||||
}
|
||||
vm.meta.exports = shows;
|
||||
@@ -361,20 +352,22 @@
|
||||
*
|
||||
*/
|
||||
save: function () {
|
||||
console.log(this.itemSort)
|
||||
if (vm.status == 1 && vm.itemSort.length > 0) {
|
||||
console.log(this.itemSort)
|
||||
red.postX("/meta/itemsort", {
|
||||
serviceKey: vm.table,
|
||||
itemSort({alias: this.alias, items: this.itemSort}).then(() => red.showOk())
|
||||
|
||||
/*red.postX("/meta/itemsort", {
|
||||
alias: this.alias,
|
||||
items: JSON.stringify(vm.itemSort)
|
||||
}).then(() => showOk())
|
||||
}).then(() => showOk())*/
|
||||
}
|
||||
|
||||
else if (vm.status == 2 && vm.itemEdit.length > 0) {
|
||||
red.postX("/meta/itemupdate", {
|
||||
itemUpdate({alias: this.alias, items: this.itemEdit}).then(() => red.showOk())
|
||||
|
||||
/*red.postX("/meta/itemupdate", {
|
||||
serviceKey: vm.table,
|
||||
items: JSON.stringify(vm.itemEdit)
|
||||
}).then(() => showOk())
|
||||
}).then(() => showOk())*/
|
||||
}
|
||||
/*else if (vm.status == 3 || vm.status == 4 || vm.status == 5) {
|
||||
var urls = {3: "/meta/exportsort", 4: "/meta/importsort", 5: "/meta/showsort"};
|
||||
|
||||
@@ -1,24 +1,13 @@
|
||||
body {
|
||||
/*background: url("../img/bg.jpg") no-repeat;*/
|
||||
}
|
||||
|
||||
/*.navbar-inverse {
|
||||
background-color: #65487a;
|
||||
border-color: #9361b8;
|
||||
}
|
||||
.navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus {
|
||||
background-color: #996fb8;
|
||||
}*/
|
||||
|
||||
.container-fluid {
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
#home {
|
||||
/*background-color: #fff;*/
|
||||
/*margin: 20px auto;
|
||||
padding-bottom: 20px;*/
|
||||
/*min-height: 500px;*/
|
||||
|
||||
}
|
||||
#top {
|
||||
background-color: #404a53;
|
||||
@@ -51,7 +40,7 @@ body {
|
||||
background-color: #404a53; /*padding-bottom: 0px; margin-bottom: 0px;*/
|
||||
}
|
||||
#main {
|
||||
|
||||
margin-top: 15px;
|
||||
}
|
||||
#left.col-md-1 {
|
||||
padding: 0 2px;
|
||||
@@ -156,15 +145,33 @@ th{
|
||||
.table td, .table th{
|
||||
padding: 5px;
|
||||
}
|
||||
.table td {background-color: #fff;}
|
||||
|
||||
/* 页面信息按钮样式 */
|
||||
#main .info {
|
||||
position: fixed;
|
||||
float: right;
|
||||
padding-top: 10px;
|
||||
display: none;
|
||||
right: 15px;
|
||||
bottom: 7px;
|
||||
z-index:99999;
|
||||
}
|
||||
|
||||
/* 设置对话框内容居中显示 */
|
||||
.modal-body {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tlist{
|
||||
height:100%; overflow: auto;
|
||||
}
|
||||
.tlist>li{
|
||||
margin-top: 0;
|
||||
}
|
||||
.tlist>li.active>a,
|
||||
.tlist>li.active>a:focus,
|
||||
.tlist>li.active>a:hover,
|
||||
.tlist>li>a:hover {
|
||||
background-color: #e2effc;
|
||||
border-radius: 2px 0 0 2px;
|
||||
}
|
||||
Reference in New Issue
Block a user