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

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-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-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-form-item label="标签类型">
<a-select placeholder="选择标签类型" option-filter-prop="children" size="large" v-model="queryRefsParam.tagId" style="width: 200px;">
<a-select-option v-for="d in datatagSources" :key="d.id">
{{ d.tagName }}
</a-select-option>
</a-select>
</a-form-item>
</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">
<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>
</span>
</a-row>
@ -28,12 +28,15 @@
<!-- table区域-begin -->
<div style="height:900px;overflow-y:auto;">
<a-table
ref="table"
ref="tagtable"
size="middle"
:row-selection="tagrowSelection"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource">
:pagination="false"
:scroll="{ y: 800 }"
:columns="tagcolumns"
:dataSource="dataRefsSources">
<!-- :locale="myLocale"-->
<!-- 字符串超长截取省略号显示-->
@ -42,9 +45,9 @@
</a-col>
<a-col :md="2" :sm="2" >
<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>
<a-button type="primary">移除标签<a-icon type="right" /> </a-button>
<a-button type="primary" @click="detag">移除标签<a-icon type="right" /> </a-button>
</div>
</a-col>
<a-col :md="11" :sm="3" >
@ -52,12 +55,12 @@
<a-row :gutter="24">
<a-col :md="20" :sm="1">
<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-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<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>
</span>
</a-row>
@ -67,10 +70,13 @@
<a-table
ref="table"
size="middle"
:row-selection="rowSelection"
bordered
rowKey="id"
:rowKey="getRowKey"
:pagination="false"
:scroll="{ y: 800 }"
:columns="columns"
:dataSource="endataSource">
:dataSource="dataSource">
<!-- :locale="myLocale"-->
<!-- 字符串超长截取省略号显示-->
@ -84,9 +90,12 @@
<script>
import store from '@/store/'
import {getAction} from '@/api/manage'
import {
dataTypePageList,
dataTypeDeleteById } from '@/api/dataType'
import { idcTableTagRef,
getTableTagRefs,
getAllTable,
idcTableTagRefdelete } from '@/api/idcTableTagRef'
import { idcTableTaglist } from '@/api/tag'
import get from 'lodash.get'
export default {
name: "dataManage",
components: {
@ -97,44 +106,41 @@
contentList:[],
percent:0,
websock:{},
queryParam: {
name :"",
type:"侦察预警"
queryRefsParam: {
tableName :"",
tagId:"",
pageNum :1,
pageSize:9999999,
},
dataTypedataSources: [],
queryParam: {
tableName :"",
tagId:"",
pageNum :1,
pageSize:9999999,
},
datatagSources: [],
dataRefsSources:[],
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: [
{
title: '表名',
align:"center",
dataIndex: 'tableName',
},
{
title: '报文名',
align:"center",
dataIndex: 'tableMessName'
},
],
tagcolumns: [
{
title: '#',
dataIndex: '',
key:'id',
width:60,
align:"id",
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
@ -147,25 +153,51 @@
{
title: '报文名',
align:"center",
dataIndex: 'data1'
},
],
endataSource:[
{
tableName:"LA_DATA_TABLE_0009",
data1:"舰艇综合导航信息I",
},
{
tableName:"LA_DATA_TABLE_0010",
data1:"动力报文I",
dataIndex: 'tableMessName'
},
],
tagqueryParam: {
pageNum :1,
pageSize:20,
tagName:""
},
selectedRowKeys: [],
tagselectedRowKeys: [],
}
},
mounted() {
this.getselect()
this.getdatatagSources()
},
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 () {
},
@ -173,6 +205,25 @@
},
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(){
getAction("/dataSpecial/special").then((res) => {
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>
<style scoped>
@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>

View File

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