修改页面初始化规则

This commit is contained in:
RenCheng 2025-03-08 12:43:26 +08:00
parent 0d4d05c40f
commit a65954bcd4
3 changed files with 47 additions and 16 deletions

View File

@ -125,12 +125,12 @@ import get from 'lodash.get'
columns: [ columns: [
{ {
title: '表名', title: '表名',
align:"center", align:"left",
dataIndex: 'tableName', dataIndex: 'tableName',
}, },
{ {
title: '报文名', title: '报文名',
align:"center", align:"left",
dataIndex: 'tableMessName' dataIndex: 'tableMessName'
}, },
], ],
@ -147,12 +147,12 @@ import get from 'lodash.get'
}, },
{ {
title: '表名', title: '表名',
align:"center", align:"left",
dataIndex: 'tableName', dataIndex: 'tableName',
}, },
{ {
title: '报文名', title: '报文名',
align:"center", align:"left",
dataIndex: 'tableMessName' dataIndex: 'tableMessName'
}, },
], ],
@ -163,6 +163,8 @@ import get from 'lodash.get'
}, },
selectedRowKeys: [], selectedRowKeys: [],
tagselectedRowKeys: [], tagselectedRowKeys: [],
selectedRowData: [],
tagselectedRowData: [],
} }
}, },
mounted() { mounted() {
@ -207,10 +209,11 @@ import get from 'lodash.get'
methods: { methods: {
handleSelectChange(selectedRowKeys,row) { handleSelectChange(selectedRowKeys,row) {
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
console.log(row); this.selectedRowData = row
}, },
taghandleSelectChange(selectedRowKeys) { taghandleSelectChange(selectedRowKeys,row) {
this.tagselectedRowKeys = selectedRowKeys this.tagselectedRowKeys = selectedRowKeys
this.tagselectedRowData = row
}, },
getdatatagSources(){ getdatatagSources(){
idcTableTaglist(this.tagqueryParam).then((res) => { idcTableTaglist(this.tagqueryParam).then((res) => {
@ -232,10 +235,34 @@ import get from 'lodash.get'
}); });
}, },
addtag(){ addtag(){
var that = this;
this.selectedRowData.forEach(item => {
idcTableTagRef({
"tagId": that.queryParam.tagId,
"tableName": item.tableName,
"schemaName": item.schemaName
}).then((res) => {
if (res.success) {
that.getalltable();
that.gettagTables();
} else {
that.$message.warning(res.message);
}
});
})
}, },
detag(){ detag(){
var that = this;
this.tagselectedRowKeys.forEach(item => {
idcTableTagRefdelete({id: item}).then((res) => {
if (res.success) {
that.getalltable();
that.gettagTables();
} else {
that.$message.warning(res.message);
}
});
});
}, },
getalltable(){ getalltable(){
this.queryParam.tagId = this.queryRefsParam.tagId this.queryParam.tagId = this.queryRefsParam.tagId

View File

@ -3,7 +3,7 @@
<a-col :md="12" :sm="1" > <a-col :md="12" :sm="1" >
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-select placeholder="选择数据类型" option-filter-prop="children" @change="getTables" style="width: 40%;"> <a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.datatype" @change="getTables" style="width: 40%;">
<a-select-option v-for="d in dataTypedataSources" :key="d.id"> <a-select-option v-for="d in dataTypedataSources" :key="d.id">
{{ d.cnName }} {{ d.cnName }}
</a-select-option> </a-select-option>
@ -15,6 +15,8 @@
ref="table" ref="table"
size="middle" size="middle"
bordered bordered
:pagination="false"
:scroll="{ y: 800 }"
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:dataSource="dataSource"> :dataSource="dataSource">
@ -65,8 +67,7 @@
percent:0, percent:0,
websock:{}, websock:{},
queryParam: { queryParam: {
pageNum :1, datatype:""
pageSize:20
}, },
dataTypedataSources: [], dataTypedataSources: [],
dataSource:[ dataSource:[
@ -154,8 +155,8 @@
}, },
mounted() { mounted() {
//websocket //websocket
this.initWebSocket() this.initWebSocket()
this.getselect() this.getselect()
}, },
computed: { computed: {
}, },
@ -212,6 +213,7 @@
dataTypePageList(this.queryParam).then((res) => { dataTypePageList(this.queryParam).then((res) => {
if (res.success) { if (res.success) {
this.dataTypedataSources = res.result.rows||res.result; this.dataTypedataSources = res.result.rows||res.result;
this.queryParam.datatype = res.result.rows[0].cnName
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }

View File

@ -3,7 +3,7 @@
<a-col :md="12" :sm="1" > <a-col :md="12" :sm="1" >
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-select placeholder="选择数据类型" option-filter-prop="children" @change="getTables" style="width: 40%;"> <a-select placeholder="选择数据类型" option-filter-prop="children" v-model="queryParam.datatype" @change="getTables" style="width: 40%;">
<a-select-option v-for="d in dataTypedataSources" :key="d.id"> <a-select-option v-for="d in dataTypedataSources" :key="d.id">
{{ d.cnName }} {{ d.cnName }}
</a-select-option> </a-select-option>
@ -15,6 +15,8 @@
ref="table" ref="table"
size="middle" size="middle"
bordered bordered
:pagination="false"
:scroll="{ y: 800 }"
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:dataSource="dataSource"> :dataSource="dataSource">
@ -71,8 +73,7 @@
percent:0, percent:0,
websock:{}, websock:{},
queryParam: { queryParam: {
pageNum :1, datatype:""
pageSize:20
}, },
dataTypedataSources: [], dataTypedataSources: [],
dataSource:[ dataSource:[
@ -215,6 +216,7 @@
dataTypePageList(this.queryParam).then((res) => { dataTypePageList(this.queryParam).then((res) => {
if (res.success) { if (res.success) {
this.dataTypedataSources = res.result.rows||res.result; this.dataTypedataSources = res.result.rows||res.result;
this.queryParam.datatype = res.result.rows[0].cnName
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }