添加交互优化

This commit is contained in:
RenCheng 2025-03-08 12:53:29 +08:00
parent a65954bcd4
commit dd918b4d08

View File

@ -2,11 +2,11 @@
<a-row :gutter="30"> <a-row :gutter="30">
<a-col :md="11" :sm="1" > <a-col :md="11" :sm="1" >
<!-- 查询区域 --> <!-- 查询区域 -->
<a-form layout="inline" @keyup.enter.native="getTables" style="margin-top: 10px; margin-left: 4px;"> <a-form layout="inline" @keyup.enter.native="gettagTables" style="margin-top: 10px; margin-left: 4px;">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="10" :sm="1"> <a-col :md="10" :sm="1">
<a-form-item label="标签类型"> <a-form-item label="标签类型">
<a-select placeholder="选择标签类型" option-filter-prop="children" size="large" v-model="queryRefsParam.tagId" style="width: 200px;"> <a-select placeholder="选择标签类型" option-filter-prop="children" size="large" @change="gattable" v-model="queryRefsParam.tagId" style="width: 200px;">
<a-select-option v-for="d in datatagSources" :key="d.id"> <a-select-option v-for="d in datatagSources" :key="d.id">
{{ d.tagName }} {{ d.tagName }}
</a-select-option> </a-select-option>
@ -30,6 +30,7 @@
<a-table <a-table
ref="tagtable" ref="tagtable"
size="middle" size="middle"
:loading="tagloading"
:row-selection="tagrowSelection" :row-selection="tagrowSelection"
bordered bordered
rowKey="id" rowKey="id"
@ -51,7 +52,7 @@
</div> </div>
</a-col> </a-col>
<a-col :md="11" :sm="3" > <a-col :md="11" :sm="3" >
<a-form layout="inline" @keyup.enter.native="getTables" style="margin-top: 10px; margin-left: 4px;"> <a-form layout="inline" @keyup.enter.native="getalltable" style="margin-top: 10px; margin-left: 4px;">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="20" :sm="1"> <a-col :md="20" :sm="1">
<a-form-item label="关键词"> <a-form-item label="关键词">
@ -72,6 +73,7 @@
size="middle" size="middle"
:row-selection="rowSelection" :row-selection="rowSelection"
bordered bordered
:loading="loading"
:rowKey="getRowKey" :rowKey="getRowKey"
:pagination="false" :pagination="false"
:scroll="{ y: 800 }" :scroll="{ y: 800 }"
@ -122,6 +124,8 @@ import get from 'lodash.get'
dataRefsSources:[], dataRefsSources:[],
dataSource:[ dataSource:[
], ],
tagloading:false,
loading:false,
columns: [ columns: [
{ {
title: '表名', title: '表名',
@ -215,13 +219,16 @@ import get from 'lodash.get'
this.tagselectedRowKeys = selectedRowKeys this.tagselectedRowKeys = selectedRowKeys
this.tagselectedRowData = row this.tagselectedRowData = row
}, },
gattable(){
this.getalltable();
this.gettagTables();
},
getdatatagSources(){ getdatatagSources(){
idcTableTaglist(this.tagqueryParam).then((res) => { idcTableTaglist(this.tagqueryParam).then((res) => {
if (res.success) { if (res.success) {
this.datatagSources = res.result.records; this.datatagSources = res.result.records;
this.queryRefsParam.tagId = res.result.records[0].id; this.queryRefsParam.tagId = res.result.records[0].id;
this.getalltable(); this.gattable();
this.gettagTables();
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }
@ -234,6 +241,7 @@ import get from 'lodash.get'
} }
}); });
}, },
addtag(){ addtag(){
var that = this; var that = this;
this.selectedRowData.forEach(item => { this.selectedRowData.forEach(item => {
@ -243,8 +251,7 @@ import get from 'lodash.get'
"schemaName": item.schemaName "schemaName": item.schemaName
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
that.getalltable(); that.gattable();
that.gettagTables();
} else { } else {
that.$message.warning(res.message); that.$message.warning(res.message);
} }
@ -256,8 +263,7 @@ import get from 'lodash.get'
this.tagselectedRowKeys.forEach(item => { this.tagselectedRowKeys.forEach(item => {
idcTableTagRefdelete({id: item}).then((res) => { idcTableTagRefdelete({id: item}).then((res) => {
if (res.success) { if (res.success) {
that.getalltable(); that.gattable();
that.gettagTables();
} else { } else {
that.$message.warning(res.message); that.$message.warning(res.message);
} }
@ -266,21 +272,25 @@ import get from 'lodash.get'
}, },
getalltable(){ getalltable(){
this.queryParam.tagId = this.queryRefsParam.tagId this.queryParam.tagId = this.queryRefsParam.tagId
this.loading = true;
getAllTable(this.queryParam).then((res) => { getAllTable(this.queryParam).then((res) => {
if (res.success) { if (res.success) {
this.dataSource = res.result; this.dataSource = res.result;
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }
this.loading = false;
}); });
}, },
gettagTables(){ gettagTables(){
this.tagloading = true;
getTableTagRefs(this.queryRefsParam).then((res) => { getTableTagRefs(this.queryRefsParam).then((res) => {
if (res.success) { if (res.success) {
this.dataRefsSources = res.result.records; this.dataRefsSources = res.result.records;
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
} }
this.tagloading = false;
}); });
}, },
} }