优化:1、mtable、mlink、mservice、qtask 展示的排序最新展示到前面

2、其他修改
This commit is contained in:
2024-04-01 22:20:51 +08:00
parent 28813e1231
commit c5ea3cb944
12 changed files with 68 additions and 73 deletions

View File

@@ -70,7 +70,7 @@
<div class="col-xs-3">
<button @click="createService()" class="btn btn-primary" type="button"> 新建业务</button>
<button @click="createService({})" class="btn btn-primary" type="button"> 新建业务</button>
<hr>
<table class="table">
<tr>
@@ -82,8 +82,8 @@
<td>{{item.name}}</td>
<td>{{item.comment}}</td>
<td>
<a href="javascript:">编辑</a>
<a href="javascript:">删除</a>
<a @click="createService(item)" href="javascript:">编辑</a>
<!--<a href="javascript:">删除</a>-->
</td>
</tr>
@@ -174,7 +174,7 @@
<div class="base-info">字段信息</div>
<table class="table table-bordered">
<tr>
<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 || status=='detail' || status=='edit'"><input type="checkbox"></td>
<th v-show="status==1"></th>
<th>数据字段</th>
<th>注释</th>
@@ -1105,8 +1105,8 @@
red.showMsg();
}
},
createService() {
this.createRow = {}
createService(row) {
this.createRow = row
if (this.tables.length == 0) {
tableLinkList().then(res => {
this.tables = res
@@ -1116,7 +1116,7 @@
},
saveService() {
serviceSave({service: this.createRow}).then(res => {
red.showOk("创建成功, 请对业务进行配置")
red.showOk(this.createRow['servid'] ? "操作成功" : "创建成功, 请对业务进行配置")
$('#createServiceDia').modal('hide')
this.service = this.createRow.name
@@ -1133,7 +1133,7 @@
},
dealTableName(item) {
let table = this.serviceDetail['tables'][item]
return `[${table.alias}] ${table.name} (${table.comment})`
return `[${table.alias}] ${table.tablename} (${table.comment})`
}
},

View File

@@ -185,7 +185,7 @@
<label class="col-md-1 col-sm-1" style="padding-bottom: 10px;padding-top: 5px;">数据源选择</label>
<div class="col-md-2 col-sm-10" style="padding-bottom: 10px">
<select class="form-control" v-model="dbPlat">
<option v-for="item in dbPlats" :value="item" v-text="item.name"></option>
<option v-for="item in dbPlats" :value="item" v-text="item.dbname"></option>
</select>
</div>
<div class="col-md-2 col-sm-10" style="padding-bottom: 10px">
@@ -204,7 +204,7 @@
<!-- || tableData[item]['hv']==1 -->
<input type="checkbox"
v-model="ckTable"
:value="tableData[item]['name']"
:value="tableData[item]['tablename']"
:disabled="item=='表说明' || item=='表名称'"
>
<a :class="[{hv: tableData[item]['hv']==1 }]" href="javascript:;" @click="tableName=item" data-target="#tab3Content1" data-toggle="tab" v-text="item"></a>
@@ -292,7 +292,7 @@
tableData: {},
tableArr: [],
dbPlat: red.getData("dbPlat",{}),
dbid: red.getData("dbPlatId",''),
dbid: red.getData("dbid",''),
catalog: '',
tableName: '',
ckTable: [],
@@ -324,7 +324,7 @@
}
},
dbPlat(v) {
this.dbPlatId = v['key']
this.dbid = v['dbid']
this.catalogs = v['catalogs']
},
catalog() {
@@ -332,7 +332,7 @@
//cache
red.setData("dbPlat", this.dbPlat)
red.setData("dbPlatId", this.dbPlatId)
red.setData("dbid", this.dbid)
red.setData("catalog", this.catalog)
},
tableName() {
@@ -391,8 +391,8 @@
},
//------从mysql导入使用的相关方法-------
loadTables() { // 查询table列表
let [dbPlatId, catalog] = [this.dbPlatId, this.catalog]
sheetMySql({dbPlatId, catalog}).then(res => { // 数据转换
let [dbid, catalog] = [this.dbid, this.catalog]
sheetMySql({dbid, catalog}).then(res => { // 数据转换
this.tableData = res
let tableArr = []
let ckTable = []
@@ -413,7 +413,7 @@
this.tableInfo = this.tableData[this.tableName]
if (!this.tableInfo['load']) {
tableInfo({dbPlatId: this.dbPlatId, catalog: this.catalog, tableName: this.tableName}).then(res => {
tableInfo({dbid: this.dbid, catalog: this.catalog, tableName: this.tableName}).then(res => {
res['hv'] = this.tableData[this.tableName]['hv']
res['load'] = 1
@@ -424,8 +424,8 @@
},
saveTable() { // 保存数据
if (this.cate == 'mysql') {
let [dbPlatId, catalog, tableArr] = [this.dbPlatId, this.catalog, this.ckTable]
saveTable({dbPlatId, catalog, tableArr}).then(res => {
let [dbid, catalog, tableArr] = [this.dbid, this.catalog, this.ckTable]
saveTable({dbid, catalog, tableArr}).then(res => {
red.showOk()
this.loadTables()
})

View File

@@ -7,7 +7,7 @@
<span class="input-group-btn">
<button class="btn btn-default" type="button">数据平台</button>
</span>
<select class="form-control" v-model="filter.dbPlatId" style="width: 150px;">
<select class="form-control" v-model="filter.dbid" style="width: 150px;">
<option></option>
<option v-for="item in dbPlats" :value="item.key">{{item.name}}</option>
</select>
@@ -65,7 +65,7 @@
},
dbPlats:[],
list:{rows:[{name:"user", comment:"[用户表]", dataCount: 23}]},
filter: {dbPlatId: "", catalog: "", name: ""},
filter: {dbid: "", catalog: "", name: ""},
},
watch: {
filter: {
@@ -81,7 +81,7 @@
catalogs: function () {
var dbPlats = this.dbPlats;
for (i in dbPlats) {
if (dbPlats[i].key == this.filter.dbPlatId) {
if (dbPlats[i].key == this.filter.dbid) {
return dbPlats[i]["catalogs"]
}
}

View File

@@ -79,13 +79,15 @@
<table :class="['table','table-bordered']">
<tr>
<th style="width: 100px">表名</th>
<td><span class="label label-outline" title="表别名alias">{{row.alias}}</span> {{row.name}}</td>
<td><span class="label label-outline" title="表别名alias">{{row.alias}}</span> {{row.tablename}}</td>
<th>数据平台</th>
<td>{{dealDbPlatName(row)}}</td>
</tr>
<tr>
<th>描述</th>
<td>{{row.comment}}</td>
<td></td>
<td></td>
</tr>
</table>
@@ -169,7 +171,7 @@
<div class="form-group">
<label for="name" class="col-md-2">表名</label>
<div class="col-md-4 col-sm-8">
<input v-model="row.name" class="form-control" id="name" placeholder="请输入Table名称">
<input v-model="row.tablename" class="form-control" id="name" placeholder="请输入Table名称">
</div>
</div>
<div class="form-group">
@@ -184,7 +186,7 @@
<div class="col-sm-2">
<select v-model="row.dbid" class="form-control">
<option></option>
<option v-for="item in dbPlats" :value="item.key" v-text="item.name"></option>
<option v-for="item in dbPlats" :value="item.dbid" v-text="item.dbname"></option>
</select>
</div>
<div class="col-sm-2">
@@ -514,8 +516,8 @@
dealDbPlatName(row) {
let name = ""
this.dbPlats.forEach(function (item) {
if (item.key == row.dbPlatId) {
name = item.name
if (item.dbid === row.dbid) {
name = item.dbname
}
})
name += "." + row.catalog