.
This commit is contained in:
@@ -24,9 +24,6 @@
|
|||||||
.tlist>li>a:hover {
|
.tlist>li>a:hover {
|
||||||
background-color: #92b0cb;
|
background-color: #92b0cb;
|
||||||
}
|
}
|
||||||
th,td {
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
<row class="meta-link">
|
<row class="meta-link">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
@@ -65,7 +62,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-xs-8">
|
<div class="col-xs-8">
|
||||||
<button v-for="link in linkInfos" @click="aliasB=link.alias" :class="['btn', {'primary' :aliasB==link.alias}]" v-text="link.comment" style="margin-right: 5px"> </button>
|
<button v-for="link in linkInfos" @click="aliasB=link.alias" :class="['btn', {'primary' :aliasB==link.alias}]" v-text="link.comment" style="margin-right: 5px"> </button>
|
||||||
<button class="btn btn-primary" style="margin-right: 15px">+ 添加关联表</button>
|
|
||||||
|
<div class="pull-right">
|
||||||
|
<button @click="status=1" class="btn">修改关联关系</button>
|
||||||
|
<button class="btn">+ 添加关联表</button>
|
||||||
|
<button class="btn btn-primary" style="margin-right: 15px">保存</button>
|
||||||
|
</div>
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
<table class="table-bordered" style="width: 100%; margin-top: 10px">
|
<table class="table-bordered" style="width: 100%; margin-top: 10px">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -73,11 +76,37 @@
|
|||||||
<th v-text="tableInfo[aliasB] && tableInfo[aliasB]['comment']"></th>
|
<th v-text="tableInfo[aliasB] && tableInfo[aliasB]['comment']"></th>
|
||||||
<th>操作</th>
|
<th>操作</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="(k, v) in linkInfo.link">
|
|
||||||
<td v-text="k.startsWith(aliasA + '\.') ? k : v"></td>
|
<tr v-show="status==0" v-for="(k, v) in linkInfo.link">
|
||||||
<td v-text="v.startsWith(aliasB + '\.') ? v : k"></td>
|
<td v-text="k.startsWith(aliasA + '.') ? k : v"></td>
|
||||||
<td>修改</td>
|
<td v-text="v.startsWith(aliasB + '.') ? v : k"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr v-show="status==1" v-for="linkItem in link2">
|
||||||
|
<td>
|
||||||
|
<select class="form-control" v-model="linkItem.f1">
|
||||||
|
<option></option>
|
||||||
|
<option v-for="item in tableInfoA.items"
|
||||||
|
:value="aliasA + '.' +item.name" v-text="item.name"></option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select class="form-control" v-model="linkItem.f2">
|
||||||
|
<option></option>
|
||||||
|
<option v-for="item in tableInfoB.items"
|
||||||
|
|
||||||
|
:value="aliasB + '.' +item.name" v-text="aliasB + '.' +item.name">
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td style="text-align: center;">
|
||||||
|
<a href="javascript:;">删除</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="3" style="text-align: center"> <a href="javascript:;">+添加更多</a> </td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</row>
|
</row>
|
||||||
@@ -91,10 +120,11 @@
|
|||||||
* 4、点击点击关联后选择,关联表和关联字段 保持建立关联信息
|
* 4、点击点击关联后选择,关联表和关联字段 保持建立关联信息
|
||||||
* 5、已经建立的关联,点击编辑后,进入关联字段编辑状态
|
* 5、已经建立的关联,点击编辑后,进入关联字段编辑状态
|
||||||
*/
|
*/
|
||||||
let {tableLinkList,linkList, linkInfoList} = meta
|
let {tableLinkList,linkList, linkInfoList, tableInfo} = meta
|
||||||
var vm = new Vue({
|
let vm = new Vue({
|
||||||
el: ".meta-link",
|
el: ".meta-link",
|
||||||
data: {
|
data: {
|
||||||
|
status: 1,
|
||||||
tables: [], //所有的表数据{name,comment, alias, linkCount}
|
tables: [], //所有的表数据{name,comment, alias, linkCount}
|
||||||
aliasA: '', //选中的主体表别名
|
aliasA: '', //选中的主体表别名
|
||||||
tableInfo:{a:{}},
|
tableInfo:{a:{}},
|
||||||
@@ -102,33 +132,57 @@
|
|||||||
links: [], //
|
links: [], //
|
||||||
linkInfos: [],
|
linkInfos: [],
|
||||||
linkInfo: {},
|
linkInfo: {},
|
||||||
|
link2: [],
|
||||||
|
|
||||||
aliasB: ''
|
aliasB: '',
|
||||||
|
|
||||||
|
tableInfoA: {},
|
||||||
|
tableInfoB: {},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
aliasA(v) {
|
aliasA(v) {
|
||||||
//tableInfo({alias: v}).then(res => this.tableInfo = res)
|
tableInfo({alias: v}).then(res => this.tableInfoA = res)
|
||||||
linkList({alias: v}).then(res => {
|
linkList({alias: v}).then(res => {
|
||||||
this.links = res
|
this.links = res
|
||||||
this.aliasB = '' // 如果不置空,存在变更主体表,但数据不刷新的异常
|
this.aliasB = '' // 如果不置空,存在变更主体表,但数据不刷新的异常
|
||||||
})
|
})
|
||||||
linkInfoList({alias: v}).then(res => {
|
linkInfoList({alias: v}).then(res => {
|
||||||
this.linkInfos = res
|
this.linkInfos = res
|
||||||
|
if (res && res.length > 0) {
|
||||||
this.aliasB = res[0]['alias']
|
this.aliasB = res[0]['alias']
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
aliasB(v) {
|
aliasB(v) {
|
||||||
|
tableInfo({alias: v}).then(res => {
|
||||||
|
this.tableInfoB = res
|
||||||
|
|
||||||
let linkInfo = {}
|
let linkInfo = {}
|
||||||
for (let i in this.links) { // 数据转换
|
for (let i in this.links) { // 数据转换
|
||||||
if (this.links[i]['tables'][0] == v || this.links[i]['tables'][1] == v) {
|
if (this.links[i]['tables'][0] == v || this.links[i]['tables'][1] == v) {
|
||||||
linkInfo = this.links[i]
|
linkInfo = this.links[i]
|
||||||
|
let link = {}
|
||||||
|
let link2 = [] // [{f1:"", f2:""}]
|
||||||
|
for(k in linkInfo["link"]) {
|
||||||
|
let [_k, _v] = [k, linkInfo["link"][k]]
|
||||||
|
if (k.startsWith(this.aliasA + '.')) {
|
||||||
|
link[_k] = _v
|
||||||
|
link2.push({f1: _k, f2: _v})
|
||||||
|
} else {
|
||||||
|
link[_v] = _k
|
||||||
|
link2.push({f1: _v, f2: _k})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
linkInfo['link'] = link
|
||||||
|
this.link2 = link2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.linkInfo = linkInfo
|
this.linkInfo = linkInfo
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
linkInfo(v) {
|
linkInfo(v) {
|
||||||
console.log(v)
|
//console.log(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -40,10 +40,12 @@
|
|||||||
<button @click="save()" :class="['btn',{'btn-primary':status!=0},{'disabled':status==0}]" type="button"> 保存</button>
|
<button @click="save()" :class="['btn',{'btn-primary':status!=0},{'disabled':status==0}]" type="button"> 保存</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
<hr style="margin: 0px 5px 5px">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 实体列表 -->
|
<!-- 实体列表 -->
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
|
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 实体表(Meta-Table)</div>
|
||||||
<ul class="nav nav-tabs nav-stacked tlist" style="height: 100%">
|
<ul class="nav nav-tabs nav-stacked tlist" style="height: 100%">
|
||||||
<li :class="['clearfix',{'active':alias==item.alias}]" v-for="item in tables" >
|
<li :class="['clearfix',{'active':alias==item.alias}]" v-for="item in tables" >
|
||||||
<a @click="alias=item.alias" :title="dealTableLabel(item)" v-text="dealTableLabel(item)" href="javascript:;"></a>
|
<a @click="alias=item.alias" :title="dealTableLabel(item)" v-text="dealTableLabel(item)" href="javascript:;"></a>
|
||||||
@@ -53,6 +55,7 @@
|
|||||||
|
|
||||||
<!-- 实体表信息 -->
|
<!-- 实体表信息 -->
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
|
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 实体字段信息</div>
|
||||||
<table :class="[{'table':status!=2},'table-bordered']" style="width: 100%">
|
<table :class="[{'table':status!=2},'table-bordered']" style="width: 100%">
|
||||||
<tr style="background-color: #f1f1f1">
|
<tr style="background-color: #f1f1f1">
|
||||||
<td v-show="status==3 || status==4 || status==5 || status==6"><input type="checkbox"></td>
|
<td v-show="status==3 || status==4 || status==5 || status==6"><input type="checkbox"></td>
|
||||||
@@ -97,7 +100,8 @@
|
|||||||
|
|
||||||
<!-- baseInfo -->
|
<!-- baseInfo -->
|
||||||
<div class="panel" v-show="status==7">
|
<div class="panel" v-show="status==7">
|
||||||
<div class="panel-heading">基本属性配置</div>
|
<div style="padding-left: 10px;background-color: #ccc;width: 100%"> 基本属性配置</div>
|
||||||
|
<!--<div class="panel-heading">基本属性配置</div>-->
|
||||||
<div class="panel-body" style="overflow:auto;">
|
<div class="panel-body" style="overflow:auto;">
|
||||||
<form class="form-horizontal">
|
<form class="form-horizontal">
|
||||||
<input type="hidden" v-model="row.key">
|
<input type="hidden" v-model="row.key">
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package net.tccn.dbq.parser;
|
package net.tccn.dbq.parser;
|
||||||
|
|
||||||
import net.tccn.base.Kv;
|
import net.tccn.base.Kv;
|
||||||
import net.tccn.dbq.fbean.*;
|
|
||||||
import net.tccn.base.MetaKit;
|
import net.tccn.base.MetaKit;
|
||||||
|
import net.tccn.dbq.fbean.*;
|
||||||
import net.tccn.meta.MetaLink;
|
import net.tccn.meta.MetaLink;
|
||||||
import net.tccn.meta.MetaService;
|
import net.tccn.meta.MetaService;
|
||||||
import net.tccn.meta.MetaTable;
|
import net.tccn.meta.MetaTable;
|
||||||
|
|||||||
Reference in New Issue
Block a user