修改图表内容,添加标签绑定

This commit is contained in:
RenCheng 2025-03-08 12:23:48 +08:00
parent 7ca9872a8e
commit 0d4d05c40f
3 changed files with 171 additions and 75 deletions

13
src/api/idcTableTagRef.js Normal file
View File

@ -0,0 +1,13 @@
import { getAction, deleteAction, putAction, postAction, httpAction,uploadAction } from '@/api/manage'
const idcTableTagRef = (params)=>postAction("/idcTableTagRef/add",params);
const getTableTagRefs = (params)=>getAction("/idcTableTagRef/getTableTagRefs",params);
const getAllTable = (params)=>getAction("/idcTableTagRef/getAllTable",params);
const idcTableTagRefdelete = (params)=>deleteAction("/idcTableTagRef/delete",params);
export {
idcTableTagRef,
getTableTagRefs,
getAllTable,
idcTableTagRefdelete
}

View File

@ -5,22 +5,22 @@
<a-form layout="inline" @keyup.enter.native="getTables" style="margin-top: 10px; margin-left: 4px;"> <a-form layout="inline" @keyup.enter.native="getTables" 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-input placeholder="请输入搜索关键词" v-model="queryParam.name"></a-input> <a-select placeholder="选择标签类型" option-filter-prop="children" size="large" v-model="queryRefsParam.tagId" style="width: 200px;">
</a-form-item> <a-select-option v-for="d in datatagSources" :key="d.id">
</a-col> {{ d.tagName }}
<a-col :md="10" :sm="2">
<a-form-item label="标签类型">
<a-select placeholder="选择标签类型" option-filter-prop="children" size="large" v-model="queryParam.type" style="width: 200px;">
<a-select-option v-for="d in dataTypedataSources" :key="d.id">
{{ d.cnName }}
</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="2">
<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>
@ -28,12 +28,15 @@
<!-- table区域-begin --> <!-- table区域-begin -->
<div style="height:900px;overflow-y:auto;"> <div style="height:900px;overflow-y:auto;">
<a-table <a-table
ref="table" ref="tagtable"
size="middle" size="middle"
:row-selection="tagrowSelection"
bordered bordered
rowKey="id" rowKey="id"
:columns="columns" :pagination="false"
:dataSource="dataSource"> :scroll="{ y: 800 }"
:columns="tagcolumns"
:dataSource="dataRefsSources">
<!-- :locale="myLocale"--> <!-- :locale="myLocale"-->
<!-- 字符串超长截取省略号显示--> <!-- 字符串超长截取省略号显示-->
@ -42,9 +45,9 @@
</a-col> </a-col>
<a-col :md="2" :sm="2" > <a-col :md="2" :sm="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" :sm="3" > <a-col :md="11" :sm="3" >
@ -52,12 +55,12 @@
<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>
@ -67,10 +70,13 @@
<a-table <a-table
ref="table" ref="table"
size="middle" size="middle"
:row-selection="rowSelection"
bordered bordered
rowKey="id" :rowKey="getRowKey"
:pagination="false"
:scroll="{ y: 800 }"
:columns="columns" :columns="columns"
:dataSource="endataSource"> :dataSource="dataSource">
<!-- :locale="myLocale"--> <!-- :locale="myLocale"-->
<!-- 字符串超长截取省略号显示--> <!-- 字符串超长截取省略号显示-->
@ -84,9 +90,12 @@
<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'
import get from 'lodash.get'
export default { export default {
name: "dataManage", name: "dataManage",
components: { components: {
@ -97,44 +106,41 @@
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:[
{
tableName:"LA_DATA_TABLE_0001",
data1:"舰艇综合导航信息II",
},
{
tableName:"LA_DATA_TABLE_0002",
data1:"动力报文",
},
{
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: [ columns: [
{
title: '表名',
align:"center",
dataIndex: 'tableName',
},
{
title: '报文名',
align:"center",
dataIndex: 'tableMessName'
},
],
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;
} }
@ -147,25 +153,51 @@
{ {
title: '报文名', title: '报文名',
align:"center", align:"center",
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: [],
} }
}, },
mounted() { mounted() {
this.getselect() this.getdatatagSources()
}, },
computed: { computed: {
getRowKey(record) {
return `${record.schemaName}_${record.tableName}`
},
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 () {
}, },
@ -173,6 +205,25 @@
}, },
methods: { methods: {
handleSelectChange(selectedRowKeys,row) {
this.selectedRowKeys = selectedRowKeys
console.log(row);
},
taghandleSelectChange(selectedRowKeys) {
this.tagselectedRowKeys = selectedRowKeys
},
getdatatagSources(){
idcTableTaglist(this.tagqueryParam).then((res) => {
if (res.success) {
this.datatagSources = res.result.records;
this.queryRefsParam.tagId = res.result.records[0].id;
this.getalltable();
this.gettagTables();
} else {
this.$message.warning(res.message);
}
});
},
dataAdd(){ dataAdd(){
getAction("/dataSpecial/special").then((res) => { getAction("/dataSpecial/special").then((res) => {
if (res.success) { if (res.success) {
@ -180,15 +231,45 @@
} }
}); });
}, },
getselect(){ addtag(){
}, },
getTables(){ detag(){
},
getalltable(){
this.queryParam.tagId = this.queryRefsParam.tagId
getAllTable(this.queryParam).then((res) => {
if (res.success) {
this.dataSource = res.result;
} else {
this.$message.warning(res.message);
}
});
},
gettagTables(){
getTableTagRefs(this.queryRefsParam).then((res) => {
if (res.success) {
this.dataRefsSources = res.result.records;
} else {
this.$message.warning(res.message);
}
});
}, },
} }
} }
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
/deep/.ant-checkbox-inner {
border: 1px solid #000 !important;
}
/deep/.ant-checkbox-checked .ant-checkbox-inner {
background-color: #fff !important; /* 将背景颜色修改为白色 */
border-color: #000 !important; /* 将边框颜色修改为黑色 */
}
/deep/.ant-checkbox-checked .ant-checkbox-inner::after {
border-bottom: 2px solid #000;
border-right: 2px solid #000;
}
</style> </style>

View File

@ -60,7 +60,10 @@
title: { title: {
text: '数据清洗差异统计' text: '数据清洗差异统计'
}, },
legend: {}, legend: {
bottom: 10,
left: 'center'
},
tooltip: {}, tooltip: {},
dataset: { dataset: {
source: [ source: [
@ -89,7 +92,9 @@
title: { title: {
text: '数据编目总量统计' text: '数据编目总量统计'
}, },
legend: {}, legend: {
bottom: 10,
left: 'center'},
tooltip: {}, tooltip: {},
dataset: { dataset: {
source: [ source: [
@ -131,13 +136,10 @@
type: 'pie', type: 'pie',
radius: '50%', radius: '50%',
data: [ data: [
{ value: 1048, name: '平台' }, { value: 1048, name: '文档' },
{ value: 735, name: '编队' }, { value: 735, name: '视频' },
{ value: 580, name: '航空兵' }, { value: 580, name: '音频' },
{ value: 484, name: '陆战队' }, { value: 484, name: '结构化数据' },
{ value: 300, name: '作战' },
{ value: 735, name: '反潜' },
{ value: 580, name: '舰炮' }
], ],
emphasis: { emphasis: {
itemStyle: { itemStyle: {