This commit is contained in:
2019-04-16 21:57:41 +08:00
parent 368f4fc733
commit 52f5214bbd
3 changed files with 35 additions and 21 deletions

View File

@@ -3,9 +3,9 @@ const meta = {
getTableList(callback) {
red.getJSON("/meta/tablelist",{}, json => callback(json));
},
getTableDetail({name}, callback) {
/*getTableDetail({name}, callback) {
red.getJSON("/meta/tableinfo",{name}, json => callback(json));
},
},*/
getServiceList(callback) {
red.getJSON("/meta/service_list",{}, json => {
@@ -57,6 +57,7 @@ const meta = {
linkInfo({alias}) {
return red.postX('/meta/link_info', {alias})
},
tableInfo({name, alias}) {
return red.postX('/meta/tableinfo', {name, alias})
}

View File

@@ -8,8 +8,8 @@
<span class="input-group-btn">
<button class="btn btn-default" type="button">选择Table{{status}}</button>
</span>
<select class="form-control" v-model="table" style="width: 180px;">
<option v-for="item in tables" :value="item.name"> {{item.name}}&nbsp;&nbsp;&nbsp;[{{item.comment}}]</option>
<select class="form-control" v-model="metaTable" style="width: 180px;">
<option v-for="item in tables" :value="item"> {{item.name}}&nbsp;&nbsp;&nbsp;[{{item.comment}}]</option>
</select>
<span class="input-group-btn pull-left" style="padding-left: 20px">
@@ -287,7 +287,7 @@
</row>
<script>
let {getTableList, getTableDetail} = meta;
let {getTableList, tableInfo} = meta;
let {showOk} = red
var vm = new Vue({
@@ -306,7 +306,10 @@
},//完整的元数据数据,
move: false,
status: 7, //页面默认状态
table: "", //页面选择的业务类型
table: "", //页面选择的table表名称
alias: "", //页面选择的table表别名
metaTable: {},
itemSort: [], //待保存的业务属性
oldItems: [], //不被修改的字段属性
@@ -320,11 +323,15 @@
filterArr:[]
},
watch: {
metaTable(v) {
this.name = v.name
this.alias = v.alias
},
status: function (v) {
this.setMove(v)
},
table: function (table) {
this.loadDetail(table);
alias: function () {
this.loadDetail();
},
"meta.items": {
handler: function (nv, ov) {
@@ -353,23 +360,28 @@
},
tables: function (v) {
if(v.length > 0) {
vm.table = v[0]["name"];
this.metaTable = v[0]
//vm.table = v[0]["name"];
}
},
meta: function (v) {
vm.row = {key:v.key, dbPlatId: v.dbPlatId, catalog: v.catalog, name:v.name, comment:v.comment, alias: v.alias};
/*vm.filters = v.filters;
var filterArr = [];
vm.filters.forEach(function (item) {
filterArr.push(item.name);
})
vm.filterArr = filterArr;*/
},
},
methods: {
loadDetail(cate) {
getTableDetail({name: cate}, (json) => {
loadDetail() {
tableInfo({alias: this.alias}).then(res => {
let row = res;
vm.meta = row;
let oldItems = [];
row.items.forEach(item => {
oldItems.push({label, name, remark, type, inType} = item)
});
vm.oldItems = oldItems;
})
/*getTableDetail({name: cate}, (json) => {
var row = json;
vm.meta = row;
var oldItems = [];
@@ -381,12 +393,12 @@
oldItems.push(d);
});
vm.oldItems = oldItems;
});
});*/
},
tableList() {
getTableList(json => {
vm.tables = json;
getTableList(res => {
vm.tables = res;
})
},
catalogs: function() {