修复数据编目功能

This commit is contained in:
RenCheng 2025-03-09 13:33:24 +08:00
parent e1aacc13d6
commit b6906eaa63

View File

@ -3,25 +3,25 @@
<a-col :md="11" style="padding:0 20px;"> <a-col :md="11" style="padding:0 20px;">
<div class="linese"></div> <div class="linese"></div>
<!-- 查询区域 --> <!-- 查询区域 -->
<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-form-item label="关键词">
<a-input placeholder="请输入搜索关键词" v-model="queryParam.name"></a-input>
</a-form-item>
</a-col>
<a-col :md="10" :sm="2"> <a-col :md="10" :sm="2">
<a-form-item label="标签类型"> <a-form-item label="标签类型">
<a-select placeholder="选择标签类型" option-filter-prop="children" size="large" v-model="queryParam.type" style="width: 200px;"> <a-select placeholder="选择标签类型" option-filter-prop="children" size="large" v-model="queryRefsParam.tagId" style="width: 180px;">
<a-select-option v-for="d in dataTypedataSources" :key="d.id"> <a-select-option v-for="d in datatagSources" :key="d.id">
{{ d.cnName }} {{ d.tagName }}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="10" :sm="1">
<a-form-item label="关键词">
<a-input placeholder="请输入搜索关键词" v-model="queryRefsParam.tableName"></a-input>
</a-form-item>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="4" :sm="3" > <a-col :md="4" :sm="3" >
<a-button type="primary" style="left: 10px" @click="loadData" icon="search">查询</a-button> <a-button type="primary" style="left: 10px" @click="gettagTables" icon="search">查询</a-button>
</a-col> </a-col>
</span> </span>
</a-row> </a-row>
@ -29,38 +29,39 @@
<!-- table区域-begin --> <!-- table区域-begin -->
<div style="height:calc(100vh - 324px);"> <div style="height:calc(100vh - 324px);">
<a-table <a-table
ref="table" ref="tagtable"
size="middle" size="middle"
:loading="tagloading"
:row-selection="tagrowSelection"
bordered bordered
rowKey="id" rowKey="id"
:columns="columns" :pagination="false"
:dataSource="dataSource"> :scroll="{ y: dynamicHeight }"
<!-- :locale="myLocale"--> :columns="tagcolumns"
:dataSource="dataRefsSources">
<!-- 字符串超长截取省略号显示-->
</a-table> </a-table>
</div> </div>
<div class="linese"></div> <div class="linese"></div>
</a-col> </a-col>
<a-col :md="2"> <a-col :md="2">
<div style="padding-top: 100%; padding-left: 15%;"> <div style="padding-top: 100%; padding-left: 15%;">
<a-button type="primary"> <a-icon type="left" />添加标签 </a-button> <a-button type="primary" @click="addtag"> <a-icon type="left" />添加标签 </a-button>
<div style="height: 50px;"></div> <div style="height: 50px;"></div>
<a-button type="primary">移除标签<a-icon type="right" /> </a-button> <a-button type="primary" @click="detag">移除标签<a-icon type="right" /> </a-button>
</div> </div>
</a-col> </a-col>
<a-col :md="11" style="padding:0 20px;"> <a-col :md="11" style="padding:0 20px;">
<div class="linese"></div> <div class="linese"></div>
<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="关键词">
<a-input placeholder="请输入搜索关键词" v-model="queryParam.name"></a-input> <a-input placeholder="请输入搜索关键词" v-model="queryParam.tableName"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="4" :sm="3" > <a-col :md="4" :sm="3" >
<a-button type="primary" style="left: 10px" @click="loadData" icon="search">查询</a-button> <a-button type="primary" style="left: 10px" @click="getalltable" icon="search">查询</a-button>
</a-col> </a-col>
</span> </span>
</a-row> </a-row>
@ -70,13 +71,14 @@
<a-table <a-table
ref="table" ref="table"
size="middle" size="middle"
:row-selection="rowSelection"
bordered bordered
rowKey="id" :loading="loading"
:rowKey="getRowKey"
:pagination="false"
:scroll="{ y: dynamicHeight }"
:columns="columns" :columns="columns"
:dataSource="endataSource"> :dataSource="dataSource">
<!-- :locale="myLocale"-->
<!-- 字符串超长截取省略号显示-->
</a-table> </a-table>
</div> </div>
<div class="linese"></div> <div class="linese"></div>
@ -88,9 +90,11 @@
<script> <script>
import store from '@/store/' import store from '@/store/'
import {getAction} from '@/api/manage' import {getAction} from '@/api/manage'
import { import { idcTableTagRef,
dataTypePageList, getTableTagRefs,
dataTypeDeleteById } from '@/api/dataType' getAllTable,
idcTableTagRefdelete } from '@/api/idcTableTagRef'
import { idcTableTaglist } from '@/api/tag'
export default { export default {
name: "dataManage", name: "dataManage",
components: { components: {
@ -101,75 +105,108 @@
contentList:[], contentList:[],
percent:0, percent:0,
websock:{}, websock:{},
queryParam: { queryRefsParam: {
name :"", tableName :"",
type:"侦察预警" tagId:"",
pageNum :1,
pageSize:9999999,
}, },
dataTypedataSources: [], queryParam: {
tableName :"",
tagId:"",
pageNum :1,
pageSize:9999999,
},
datatagSources: [],
dataRefsSources:[],
dataSource:[ dataSource:[
],
tagloading:false,
loading:false,
columns: [
{ {
tableName:"LA_DATA_TABLE_0001", title: '表名',
data1:"舰艇综合导航信息II", align:"left",
dataIndex: 'tableName',
}, },
{ {
tableName:"LA_DATA_TABLE_0002", title: '报文名',
data1:"动力报文", align:"left",
}, dataIndex: 'tableMessName'
{
tableName:"LA_DATA_TABLE_0003",
data1:"电测试报文",
},
{
tableName:"LA_DATA_TABLE_0004",
data1:"损管测试报文",
},
{
tableName:"LA_DATA_TABLE_0005",
data1:"舰炮测试报文",
},
{
tableName:"LA_DATA_TABLE_0006",
data1:"反潜测试报文",
}, },
], ],
columns: [ tagcolumns: [
{ {
title: '#', title: '#',
dataIndex: '', dataIndex: '',
key:'id', key:'id',
width:60, width:60,
align:"id", align:"center",
customRender:function (t,r,index) { customRender:function (t,r,index) {
return parseInt(index)+1; return parseInt(index)+1;
} }
}, },
{ {
title: '表名', title: '表名',
align:"center", align:"left",
dataIndex: 'tableName', dataIndex: 'tableName',
}, },
{ {
title: '报文名', title: '报文名',
align:"center", align:"left",
dataIndex: 'data1' dataIndex: 'tableMessName'
},
],
endataSource:[
{
tableName:"LA_DATA_TABLE_0009",
data1:"舰艇综合导航信息I",
},
{
tableName:"LA_DATA_TABLE_0010",
data1:"动力报文I",
}, },
], ],
tagqueryParam: {
pageNum :1,
pageSize:20,
tagName:""
},
selectedRowKeys: [],
tagselectedRowKeys: [],
selectedRowData: [],
tagselectedRowData: [],
} }
}, },
mounted() { mounted() {
this.getselect() this.getdatatagSources()
}, },
computed: { computed: {
getRowKey(record) {
return `${record.schemaName}_${record.tableName}`
},
dynamicHeight() {
const totalOffset = this.headerHeight + this.footerHeight;
return {
height: `calc(100vh - 324px)`
}
},
rowSelection() {
return {
selectedRowKeys: this.selectedRowKeys,
onChange: this.handleSelectChange,
preserveSelectedRowKeys: true, // key
type: 'checkbox', //
columnWidth: 60, //
getCheckboxProps: record => ({
//
// disabled: record.disabled
})
}
},
tagrowSelection() {
return {
selectedRowKeys: this.tagselectedRowKeys,
onChange: this.taghandleSelectChange,
preserveSelectedRowKeys: true, // key
type: 'checkbox', //
columnWidth: 60, //
getCheckboxProps: record => ({
//
// disabled: record.disabled
})
}
}
}, },
destroyed: function () { destroyed: function () {
}, },
@ -177,6 +214,29 @@
}, },
methods: { methods: {
handleSelectChange(selectedRowKeys,row) {
this.selectedRowKeys = selectedRowKeys
this.selectedRowData = row
},
taghandleSelectChange(selectedRowKeys,row) {
this.tagselectedRowKeys = selectedRowKeys
this.tagselectedRowData = row
},
gattable(){
this.getalltable();
this.gettagTables();
},
getdatatagSources(){
idcTableTaglist(this.tagqueryParam).then((res) => {
if (res.success) {
this.datatagSources = res.result.records;
this.queryRefsParam.tagId = res.result.records[0].id;
this.gattable();
} else {
this.$message.warning(res.message);
}
});
},
dataAdd(){ dataAdd(){
getAction("/dataSpecial/special").then((res) => { getAction("/dataSpecial/special").then((res) => {
if (res.success) { if (res.success) {
@ -184,11 +244,57 @@
} }
}); });
}, },
getselect(){
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.gattable();
} else {
that.$message.warning(res.message);
}
});
})
}, },
getTables(){ detag(){
var that = this;
this.tagselectedRowKeys.forEach(item => {
idcTableTagRefdelete({id: item}).then((res) => {
if (res.success) {
that.gattable();
} else {
that.$message.warning(res.message);
}
});
});
},
getalltable(){
this.queryParam.tagId = this.queryRefsParam.tagId
this.loading = true;
getAllTable(this.queryParam).then((res) => {
if (res.success) {
this.dataSource = res.result;
} else {
this.$message.warning(res.message);
}
this.loading = false;
});
},
gettagTables(){
this.tagloading = true;
getTableTagRefs(this.queryRefsParam).then((res) => {
if (res.success) {
this.dataRefsSources = res.result.records;
} else {
this.$message.warning(res.message);
}
this.tagloading = false;
});
}, },
} }
} }