1、代码优化,重构逻辑,界面html
2、解决TplKit 因升级导致的模板文件找不到(退回原版本)
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -38,7 +38,7 @@
|
||||
<dependency>
|
||||
<groupId>com.jfinal</groupId>
|
||||
<artifactId>jfinal</artifactId>
|
||||
<version>3.8</version>
|
||||
<version>3.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -41,6 +41,12 @@ public class MetaKit {
|
||||
}
|
||||
|
||||
public static <T extends Doc> void reload(Class<T> clazz) {
|
||||
reload(clazz, null);
|
||||
}
|
||||
public static <T extends Doc> void reload(T t) {
|
||||
reload(t.getClass(), t.getKey());
|
||||
}
|
||||
public static <T extends Doc> void reload(Class<T> clazz, String key) {
|
||||
|
||||
if (MetaTable.class == clazz) metaTables = MetaTable.dao.find();
|
||||
else if (MetaLink.class == clazz) metaLinks = MetaLink.dao.find();
|
||||
@@ -48,6 +54,7 @@ public class MetaKit {
|
||||
else if (DbAccount.class == clazz) dbPlats = DbAccount.dao.find();
|
||||
else if (DbPlat.class == clazz) dbPlats = DbAccount.dao.find();
|
||||
else if (SysPlat.class == clazz) sysPlats = SysPlat.dao.find();
|
||||
// todo: 按照key 查询更新内存
|
||||
}
|
||||
|
||||
//----- get/set ----
|
||||
|
||||
@@ -14,7 +14,6 @@ public class TplKit {
|
||||
private static TplKit tplKit = null;
|
||||
private static SqlKit kit = null;
|
||||
private static boolean hadParse = false;// 标记 是否已经解析
|
||||
private static String clazzRoot = new File(FileKit.rootPath()).getPath();
|
||||
|
||||
public static TplKit use() {
|
||||
return use(false);
|
||||
@@ -22,7 +21,7 @@ public class TplKit {
|
||||
|
||||
/**
|
||||
* 获取单列的实例对象,
|
||||
*
|
||||
*
|
||||
* @param isDev
|
||||
* 是否开发模式, 多次调用只有第一次的 isDev生效
|
||||
* @return
|
||||
@@ -38,6 +37,7 @@ public class TplKit {
|
||||
|
||||
private TplKit(boolean isDev) {
|
||||
kit = new SqlKit("tplKit", isDev);
|
||||
kit.setBaseSqlTemplatePath("/");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,9 +54,9 @@ public class TplKit {
|
||||
|
||||
/**
|
||||
* 添加文件/目录 到模板解析器
|
||||
*
|
||||
*
|
||||
* @param tplFile
|
||||
* 文件/目录必须放到 resources/下面
|
||||
* 模板文件/目录
|
||||
*/
|
||||
public void addTpl(File tplFile) {
|
||||
addTpl(tplFile, null);
|
||||
@@ -65,7 +65,7 @@ public class TplKit {
|
||||
|
||||
/**
|
||||
* 添加文件/目录 到模板解析器
|
||||
*
|
||||
*
|
||||
* @param tplFile
|
||||
* 文件/目录
|
||||
* @param filter
|
||||
@@ -73,7 +73,8 @@ public class TplKit {
|
||||
*/
|
||||
public void addTpl(File tplFile, FileFilter filter) {
|
||||
if (tplFile.isFile()) {
|
||||
addTpl(tplFile.getPath().replace(clazzRoot, "")); //以classes路径开始的路径
|
||||
addTpl(tplFile.getPath());
|
||||
//addTpl(tplFile.getPath().replace(clazzRoot, "")); //以classes路径开始的路径
|
||||
} else if (tplFile.isDirectory()) {
|
||||
File[] files = tplFile.listFiles(filter);
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
|
||||
@@ -179,32 +179,35 @@ public class MetadataService extends BaseService { //arango
|
||||
|
||||
//修改item的排序
|
||||
@RestMapping(name = "itemsort", comment = "字段排序")
|
||||
public String[] itemSortSave(String serviceKey , String[] items, @RestParam(name = "platToken") String token) {
|
||||
public String[] itemSortSave(String alias , String[] items, @RestParam(name = "platToken") String token) {
|
||||
|
||||
MetaTable metaTable = MetaKit.getMetaTableByAlias(alias);
|
||||
|
||||
MetaTable metaTable = findMetaTable(serviceKey, token);
|
||||
MetaKit.sortItem.apply(metaTable, items);
|
||||
metaTable.update();
|
||||
return items;
|
||||
}
|
||||
|
||||
@RestMapping(name = "itemupdate", comment = "字段修改")
|
||||
public List<Field> itemUpdate(String serviceKey , List<Field> items, @RestParam(name = "platToken") String token) {
|
||||
MetaTable metaTable = findMetaTable(serviceKey, token);
|
||||
public JBean itemUpdate(String alias, List<Field> items, @RestParam(name = "platToken") String token) {
|
||||
MetaTable metaTable = MetaKit.getMetaTableByAlias(alias);
|
||||
|
||||
MetaKit.itemUpdate.apply(metaTable, items);
|
||||
metaTable.update();
|
||||
return items;
|
||||
MetaKit.reload(metaTable);
|
||||
return JBean.OK;
|
||||
}
|
||||
|
||||
@RestMapping(name = "showsort", comment = "展示字段修改")
|
||||
public List<String> showSort(String serviceKey , List<String> items, @RestParam(name = "platToken") String token) {
|
||||
public JBean showSort(String serviceKey , List<String> items, @RestParam(name = "platToken") String token) {
|
||||
if (items == null || items.size() == 0) return null;
|
||||
|
||||
MetaService metaService = MetaKit.getMetaService(serviceKey);
|
||||
|
||||
metaService.setShows(items);
|
||||
metaService.update();
|
||||
return items;
|
||||
MetaKit.reload(metaService);
|
||||
return JBean.OK;
|
||||
}
|
||||
|
||||
@RestMapping(name = "exportsort", comment = "导出字段排序保存")
|
||||
@@ -213,8 +216,9 @@ public class MetadataService extends BaseService { //arango
|
||||
|
||||
MetaService metaService = MetaKit.getMetaService(serviceKey);
|
||||
metaService.setExports(items);
|
||||
|
||||
metaService.update();
|
||||
|
||||
MetaKit.reload(metaService);
|
||||
return items;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import com.google.gson.Gson;
|
||||
import net.tccn.base.FileKit;
|
||||
import net.tccn.base.Kv;
|
||||
import net.tccn.base.MetaKit;
|
||||
import net.tccn.base.TplKit;
|
||||
@@ -12,6 +13,7 @@ import net.tccn.qtask.Task;
|
||||
import net.tccn.user.User;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -173,12 +175,10 @@ public class RunTest<T> {
|
||||
System.out.println(kv);
|
||||
}
|
||||
|
||||
//@Test
|
||||
@Test
|
||||
public void tplTest() {
|
||||
TplKit use = TplKit.use(true);
|
||||
//use.addTpl(new File(FileKit.rootPath(), "tpl")); ok
|
||||
//use.addTpl("/tpl/aql/db.sql"); //ok
|
||||
use.addTpl("tpl\\sql\\db.sql"); //ok
|
||||
use.addTpl(new File(FileKit.rootPath(), "tpl")); //ok
|
||||
String tpl = use.getTpl("db.table_list", Kv.of("catalogs", asList("redbbs")));
|
||||
System.out.println(tpl);
|
||||
|
||||
@@ -195,7 +195,7 @@ public class RunTest<T> {
|
||||
|
||||
@Test
|
||||
public void buildMethod() {
|
||||
tplKit.addTpl("/tpl/_t.tpl");
|
||||
tplKit.addTpl(new File(FileKit.rootPath(), "/tpl/_t.tpl"));
|
||||
|
||||
//buildMethod("table_link_list", "实体表,包含link信息的列表");
|
||||
buildMethod("link_info", "关联信息 ");
|
||||
|
||||
Reference in New Issue
Block a user