修改:1、arangodb -> mysql,去除arangodb
2、部分字段逻辑重构
This commit is contained in:
@@ -60,12 +60,12 @@
|
||||
<th v-show="status==1">操作</th>
|
||||
</tr>
|
||||
|
||||
<tr v-show="status==0" v-for="(k, v) in linkInfo.link">
|
||||
<tr v-show="status==0" v-for="(k, v) in linkInfo.links">
|
||||
<td v-text="k.startsWith(aliasA + '.') ? k : v"></td>
|
||||
<td v-text="v.startsWith(aliasB + '.') ? v : k"></td>
|
||||
</tr>
|
||||
|
||||
<tr v-show="status==1" v-for="(linkItem, index) in link2">
|
||||
<tr v-show="status==1" v-for="(linkItem, index) in links2">
|
||||
<td>
|
||||
<select class="form-control" v-model="linkItem.f1">
|
||||
<option></option>
|
||||
@@ -107,7 +107,7 @@
|
||||
</div>
|
||||
<div class="modal-body" style="text-align: center">
|
||||
<select class="form-control" v-model="newLinkTable">
|
||||
<option v-for="x in tables" :value="x" v-text="strJoin(x.name, x.comment, '---')" v-show="!isDisable(x)"></option>
|
||||
<option v-for="x in tables" :value="x" v-text="strJoin(x.tablename, x.comment, '---')" v-show="!isDisable(x)"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
@@ -141,7 +141,7 @@
|
||||
links: [], //
|
||||
linkInfos: [],
|
||||
linkInfo: {},
|
||||
link2: [],
|
||||
links2: [],
|
||||
newLinkTable: {},
|
||||
|
||||
aliasB: '',
|
||||
@@ -184,20 +184,20 @@
|
||||
for (let i in this.links) { // 数据转换
|
||||
if (this.links[i]['tables'][0] == v || this.links[i]['tables'][1] == v) {
|
||||
linkInfo = this.links[i]
|
||||
let link = {}
|
||||
let link2 = [] // [{f1:"", f2:""}]
|
||||
for(k in linkInfo["link"]) {
|
||||
let [_k, _v] = [k, linkInfo["link"][k]]
|
||||
let links = {}
|
||||
let links2 = [] // [{f1:"", f2:""}]
|
||||
for(k in linkInfo["links"]) {
|
||||
let [_k, _v] = [k, linkInfo["links"][k]]
|
||||
if (k.startsWith(this.aliasA + '.')) {
|
||||
link[_k] = _v
|
||||
link2.push({f1: _k, f2: _v})
|
||||
links[_k] = _v
|
||||
links2.push({f1: _k, f2: _v})
|
||||
} else {
|
||||
link[_v] = _k
|
||||
link2.push({f1: _v, f2: _k})
|
||||
links[_v] = _k
|
||||
links2.push({f1: _v, f2: _k})
|
||||
}
|
||||
}
|
||||
linkInfo['link'] = link
|
||||
this.link2 = link2
|
||||
linkInfo['links'] = links
|
||||
this.link2 = links2
|
||||
}
|
||||
}
|
||||
this.linkInfo = linkInfo
|
||||
@@ -222,11 +222,11 @@
|
||||
})
|
||||
},
|
||||
dealTableLabel(table) {
|
||||
return `${table.name} (${table.comment||'-'}) [${table.linkCount}]`
|
||||
return `${table.tablename} (${table.comment||'-'}) [${table.linkCount}]`
|
||||
},
|
||||
dealFilter(table) {
|
||||
// table.name 中是否包含 thiss.filter 的值
|
||||
if (table.name.indexOf(this.filter) > -1 || table.comment.indexOf(this.filter) > -1) {
|
||||
if (table.tablename.indexOf(this.filter) > -1 || table.comment.indexOf(this.filter) > -1) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
@@ -257,28 +257,28 @@
|
||||
// 保存(同修改)
|
||||
},
|
||||
addLinkField() {
|
||||
let link2 = this.link2
|
||||
link2.push({f1: "", f2: ""})
|
||||
this.link2 = link2
|
||||
let links2 = this.links2
|
||||
links2.push({f1: "", f2: ""})
|
||||
this.links2 = links2
|
||||
},
|
||||
delLinkField(index) {
|
||||
let link2 = []
|
||||
let links2 = []
|
||||
for (let i in this.link2) {
|
||||
if (i != index) {
|
||||
link2.push(this.link2[i])
|
||||
links2.push(this.link2[i])
|
||||
}
|
||||
}
|
||||
this.link2 = link2
|
||||
this.links2 = links2
|
||||
},
|
||||
saveLink() {
|
||||
let link = {}
|
||||
for(let i in this.link2) {
|
||||
let item = this.link2[i]
|
||||
let links = {}
|
||||
for(let i in this.links2) {
|
||||
let item = this.links2[i]
|
||||
if (item['f1'] && item['f2']) {
|
||||
link[item['f1']] = item['f2']
|
||||
links[item['f1']] = item['f2']
|
||||
}
|
||||
}
|
||||
if (link.size == 0) {
|
||||
if (links.size === 0) {
|
||||
red.showError("请填写完整的关联字段信息")
|
||||
return false
|
||||
}
|
||||
@@ -288,7 +288,7 @@
|
||||
if (!linkInfo['tables']) {
|
||||
linkInfo['tables'] = [this.aliasA, this.aliasB]
|
||||
}
|
||||
linkInfo["link"] = link
|
||||
linkInfo["links"] = links
|
||||
linkSave({link: linkInfo}).then(res => {
|
||||
red.showOk()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user