.
This commit is contained in:
@@ -88,13 +88,13 @@
|
|||||||
sysPlats: red.getData('sysPlats'),
|
sysPlats: red.getData('sysPlats'),
|
||||||
pages: [
|
pages: [
|
||||||
/*{name: "DDL", url: "/qtask/ddl.html"},*/
|
/*{name: "DDL", url: "/qtask/ddl.html"},*/
|
||||||
{name: "MetaData", url: "/meta", nodes: [
|
{name: "元服务", url: "/meta", nodes: [
|
||||||
/*{url:"/metadata/metatable/list.html", name:"TableList"},*/
|
/*{url:"/metadata/metatable/list.html", name:"TableList"},*/
|
||||||
{url:"/metadata/metatable/metaTable.html", name:"MetaTable", icon: "icon-table"},
|
{url:"/metadata/metatable/metaTable.html", name:"实体管理", icon: "icon-table"},
|
||||||
{url:"/metadata/metatable/import.html", name:"导入实体"},
|
/*{url:"/metadata/metatable/import.html", name:"导入实体"},*/
|
||||||
{url:"/metadata/metaLink.html", name:"MetaLink"},
|
{url:"/metadata/metaLink.html", name:"实体关系"},
|
||||||
{url:"/metadata/metaService.html", name:"MetaService", icon:"icon-usecase"},
|
{url:"/metadata/metaService.html", name:"业务管理", icon:"icon-usecase"},
|
||||||
{url:"/metadata/dataList.html", name:"数据查询", icon:"icon-bug"},
|
{url:"/metadata/dataList.html", name:"业务预览", icon:"icon-bug"},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,42 +1,36 @@
|
|||||||
<style>
|
<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>
|
</style>
|
||||||
<row class="meta-list">
|
<row class="meta-list">
|
||||||
<div class="col-md-12" style="padding-top: 10px;">
|
<div class="col-md-12" style="padding-top: 10px;">
|
||||||
<div class="input-group list-head">
|
<div class="input-group list-head">
|
||||||
|
<div class="pull-left">
|
||||||
|
<span class="input-group-btn">
|
||||||
|
<button @click="loadImportPage()" :class="['btn']" type="button"> 导入实体</button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn" style="padding-left: 5px">
|
||||||
<button class="btn btn-default" type="button">选择Table{{status}}</button>
|
<button @click="status=8" :class="['btn',{'btn-primary':status==8}]" type="button"> 实体关系(MetaLink)</button>
|
||||||
</span>
|
|
||||||
<select class="form-control" v-model="metaTable" style="width: 180px;">
|
|
||||||
<option v-for="item in tables" :value="item"> {{item.name}} [{{item.comment}}]</option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<span class="input-group-btn pull-left" style="padding-left: 20px">
|
|
||||||
<button @click="loadImportPage()" :class="['btn']" type="button"> 导入实体</button>
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn" style="padding-left: 5px">
|
||||||
<button @click="status=2" :class="['btn',{'btn-primary':status==2}]" type="button"> 字段编辑</button>
|
<button @click="status=2" :class="['btn',{'btn-primary':status==2}]" type="button"> 字段编辑</button>
|
||||||
</span>
|
</span>
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button @click="status=1" :class="['btn',{'btn-primary':status==1}]" type="button"> 排序</button>
|
<button @click="status=1" :class="['btn',{'btn-primary':status==1}]" type="button"> 排序</button>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<!--<span class="input-group-btn" style="padding-left: 20px">
|
|
||||||
<button @click="status=5" :class="['btn',{'btn-primary':status==5}]" type="button"> 列表配置</button>
|
|
||||||
</span>
|
|
||||||
<span class="input-group-btn">
|
|
||||||
<button @click="status=6" :class="['btn',{'btn-primary':status==6}]" type="button"> 查询配置</button>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span class="input-group-btn" style="padding-left: 20px">
|
|
||||||
<button @click="status=3" :class="['btn',{'btn-primary':status==3}]" type="button"> 导出配置</button>
|
|
||||||
</span>
|
|
||||||
<span class="input-group-btn">
|
|
||||||
<button @click="status=4" :class="['btn',{'btn-primary':status==4}]" type="button"> 导入配置</button>
|
|
||||||
</span>-->
|
|
||||||
|
|
||||||
<span class="input-group-btn" style="padding-left: 20px">
|
<span class="input-group-btn" style="padding-left: 20px">
|
||||||
<button @click="status=7;" :class="['btn',{'btn-primary':status==7}]" type="button"> 基本属性</button>
|
<button @click="status=7;" :class="['btn',{'btn-primary':status==7}]" type="button"> 基本属性</button>
|
||||||
</span>
|
</span>
|
||||||
@@ -48,7 +42,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-7">
|
<!-- 实体列表 -->
|
||||||
|
<div class="col-md-2">
|
||||||
|
<ul class="nav nav-tabs nav-stacked tlist" style="height: 100%">
|
||||||
|
<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>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 实体表信息 -->
|
||||||
|
<div class="col-md-5">
|
||||||
<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>
|
||||||
@@ -61,10 +65,6 @@
|
|||||||
<th>备注</th>
|
<th>备注</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="(item, index) in meta.items" class="item">
|
<tr v-for="(item, index) in meta.items" class="item">
|
||||||
<td v-show="status==3"><input type="checkbox" v-model="meta.exports" :value="item.name" class="form-control"></td>
|
|
||||||
<td v-show="status==4"><input type="checkbox" v-model="meta.imports" :value="item.name" class="form-control"></td>
|
|
||||||
<td v-show="status==5"><input type="checkbox" v-model="meta.shows" :value="item.name" class="form-control"></td>
|
|
||||||
<td v-show="status==6"><input type="checkbox" v-model="filterArr" :value="item.name" class="form-control"></td>
|
|
||||||
<td v-show="status==1" class="icon icon-move"></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.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.label"></td>
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
<td v-show="status==2">
|
<td v-show="status==2">
|
||||||
<input v-model="item" type="hidden">
|
<input v-model="item" type="hidden">
|
||||||
<input :value="item.name" disabled class="form-control">
|
<input :value="item.name" class="form-control">
|
||||||
<input v-model="item.name" type="hidden">
|
<input v-model="item.name" type="hidden">
|
||||||
<input name="name" type="hidden" :value="item.name">
|
<input name="name" type="hidden" :value="item.name">
|
||||||
</td>
|
</td>
|
||||||
@@ -93,156 +93,10 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-5" v-show="false">
|
<div class="col-md-5">
|
||||||
<table class="table-bordered table-auto">
|
|
||||||
<thead>
|
|
||||||
<tr style="background-color: #f1f1f1">
|
|
||||||
<th></th>
|
|
||||||
<th>字段名</th>
|
|
||||||
<th>中文名</th>
|
|
||||||
<th>展示名</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr v-for="(item, index) in meta.items">
|
|
||||||
<td v-show="status!=2" 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"><input v-model="item.label" style="width: 100px;"></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-5" v-show="status==5">
|
|
||||||
<div class="panel">
|
|
||||||
<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 meta.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>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- exports -->
|
<!-- baseInfo -->
|
||||||
<div class="col-md-5" v-show="status==3">
|
<div class="panel" v-show="status==7">
|
||||||
<div class="panel">
|
|
||||||
<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 meta.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>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- imports -->
|
|
||||||
<div class="col-md-5" v-show="status==4">
|
|
||||||
<div class="panel">
|
|
||||||
<div class="panel-heading">
|
|
||||||
导入的属性配置
|
|
||||||
</div>
|
|
||||||
<div id="import" class="panel-body" style="/*padding-top: 10px;*/overflow:auto;">
|
|
||||||
<table class="table-bordered table-auto" style="width: 100%;height: 100%">
|
|
||||||
<thead>
|
|
||||||
<tr style="background-color: #f1f1f1">
|
|
||||||
<th></th>
|
|
||||||
<th>字段名</th>
|
|
||||||
<th>中文名</th>
|
|
||||||
<!--<th>展示名</th>-->
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr v-for="(item, index) in meta.imports">
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- filters -->
|
|
||||||
<div class="col-md-5" v-show="status==6">
|
|
||||||
<div class="panel">
|
|
||||||
<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 filters">
|
|
||||||
<td class="icon icon-move">
|
|
||||||
<input name="name" :value="item.name" type="hidden">
|
|
||||||
</td>
|
|
||||||
<td v-text="item.name" style="background-color: rgb(235, 235, 228);"></td>
|
|
||||||
<td v-text="">{{getFieldLabel(item.name)}}</td>
|
|
||||||
<td>
|
|
||||||
<label>
|
|
||||||
<input type="checkbox" v-model="item.checked" value="1"> 展示
|
|
||||||
</label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<label class="checkbox-inline" v-for="c in filterCate">
|
|
||||||
<input type="checkbox" v-model="item.filterType" :value="c"> {{c}}
|
|
||||||
</label>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- dbPlat -->
|
|
||||||
<div class="col-lg-5" v-show="status==7">
|
|
||||||
<div class="panel">
|
|
||||||
<div class="panel-heading">基本属性配置</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">
|
||||||
@@ -299,10 +153,6 @@
|
|||||||
tables: [],//所有的业务类型,【测试用】
|
tables: [],//所有的业务类型,【测试用】
|
||||||
meta: {
|
meta: {
|
||||||
items: [],
|
items: [],
|
||||||
shows: [],
|
|
||||||
exports: [],
|
|
||||||
imports: [],
|
|
||||||
filters: [{name:"", filterType:[""]}]
|
|
||||||
},//完整的元数据数据,
|
},//完整的元数据数据,
|
||||||
move: false,
|
move: false,
|
||||||
status: 7, //页面默认状态
|
status: 7, //页面默认状态
|
||||||
@@ -318,9 +168,6 @@
|
|||||||
dbPlats:[],
|
dbPlats:[],
|
||||||
row: {key: "", platId: "", dbPlatId:"", catalog: "", name:"", comment:"", alias: ""},
|
row: {key: "", platId: "", dbPlatId:"", catalog: "", name:"", comment:"", alias: ""},
|
||||||
filter: {db: "", catalog: "", name: ""},//tableList 过滤条件
|
filter: {db: "", catalog: "", name: ""},//tableList 过滤条件
|
||||||
|
|
||||||
filters:[],//查询配置
|
|
||||||
filterArr:[]
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
metaTable(v) {
|
metaTable(v) {
|
||||||
@@ -554,6 +401,9 @@
|
|||||||
red.showMsg();
|
red.showMsg();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
dealTableLabel(table) {
|
||||||
|
return `${table.name} [${table.comment}] (${table.linkCount})`
|
||||||
|
},
|
||||||
getFieldLabel: function (col) {
|
getFieldLabel: function (col) {
|
||||||
if (!col) {
|
if (!col) {
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
@@ -109,10 +109,6 @@ body {
|
|||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.meta-list .col-md-5 .panel-body {
|
|
||||||
padding: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
table td,th{
|
table td,th{
|
||||||
white-space:nowrap;
|
white-space:nowrap;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
|
|||||||
@@ -12,10 +12,8 @@ public class Liangs {
|
|||||||
|
|
||||||
public static <T> Set<T> streamConcat(Stream<T> ... streams) {
|
public static <T> Set<T> streamConcat(Stream<T> ... streams) {
|
||||||
Stream<T> stream = Stream.empty();
|
Stream<T> stream = Stream.empty();
|
||||||
for (int i = 0; i < streams.length-1; i++) {
|
for (int i = 0; i < streams.length; i++) {
|
||||||
stream = Stream.concat(
|
stream = Stream.concat(stream, streams[i]);
|
||||||
stream, streams[i]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return stream.collect(Collectors.toSet());
|
return stream.collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,14 +148,16 @@ public class ParseMysql implements Parser {
|
|||||||
if (!isEmpty.test(links)) {
|
if (!isEmpty.test(links)) {
|
||||||
links.forEach(x -> {
|
links.forEach(x -> {
|
||||||
MetaTable rightTable = tables.get(metaTable.getAlias().equals(x.getTables()[0]) ? x.getTables()[1] : x.getTables()[0]);
|
MetaTable rightTable = tables.get(metaTable.getAlias().equals(x.getTables()[0]) ? x.getTables()[1] : x.getTables()[0]);
|
||||||
bufFrom.append(" left join ").append(rightTable.getCatalog()).append(".").append(rightTable.getName()).append(" ").append(rightTable.getAlias()).append(" on ");
|
if (rightTable != null) {
|
||||||
int tag = bufFrom.length();
|
bufFrom.append(" left join ").append(rightTable.getCatalog()).append(".").append(rightTable.getName()).append(" ").append(rightTable.getAlias()).append(" on ");
|
||||||
x.getLink().forEach((k,v) -> {
|
int tag = bufFrom.length();
|
||||||
if (bufFrom.length() > tag) {
|
x.getLink().forEach((k, v) -> {
|
||||||
bufFrom.append(" and ");
|
if (bufFrom.length() > tag) {
|
||||||
}
|
bufFrom.append(" and ");
|
||||||
bufFrom.append(k).append("=").append(v);
|
}
|
||||||
});
|
bufFrom.append(k).append("=").append(v);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,10 @@ public class MetadataService extends BaseService { //arango
|
|||||||
.set("catalog", x.getCatalog())
|
.set("catalog", x.getCatalog())
|
||||||
.set("alias", x.getAlias())
|
.set("alias", x.getAlias())
|
||||||
.set("dbPlatId", x.getDbPlatId())
|
.set("dbPlatId", x.getDbPlatId())
|
||||||
|
.set("linkCount", MetaKit.getMetaLinks().stream().filter(link -> { // 关联表数量
|
||||||
|
String[] tables = link.getTables();
|
||||||
|
return x.getAlias().equals(tables[0]) || x.getAlias().equals(tables[1]);
|
||||||
|
}).count())
|
||||||
).collect(Collectors.toList());
|
).collect(Collectors.toList());
|
||||||
jBean.setBody(list);
|
jBean.setBody(list);
|
||||||
return jBean;
|
return jBean;
|
||||||
|
|||||||
Reference in New Issue
Block a user