修复数据编目功能
This commit is contained in:
parent
e1aacc13d6
commit
b6906eaa63
|
@ -3,25 +3,25 @@
|
|||
<a-col :md="11" style="padding:0 20px;">
|
||||
<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-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-select placeholder="选择标签类型" option-filter-prop="children" size="large" v-model="queryRefsParam.tagId" style="width: 180px;">
|
||||
<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="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">
|
||||
<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>
|
||||
|
@ -29,38 +29,39 @@
|
|||
<!-- table区域-begin -->
|
||||
<div style="height:calc(100vh - 324px);">
|
||||
<a-table
|
||||
ref="table"
|
||||
ref="tagtable"
|
||||
size="middle"
|
||||
:loading="tagloading"
|
||||
:row-selection="tagrowSelection"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource">
|
||||
<!-- :locale="myLocale"-->
|
||||
|
||||
<!-- 字符串超长截取省略号显示-->
|
||||
:pagination="false"
|
||||
:scroll="{ y: dynamicHeight }"
|
||||
:columns="tagcolumns"
|
||||
:dataSource="dataRefsSources">
|
||||
</a-table>
|
||||
</div>
|
||||
<div class="linese"></div>
|
||||
</a-col>
|
||||
<a-col :md="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" style="padding:0 20px;">
|
||||
<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-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>
|
||||
|
@ -70,13 +71,14 @@
|
|||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
:row-selection="rowSelection"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:loading="loading"
|
||||
:rowKey="getRowKey"
|
||||
:pagination="false"
|
||||
:scroll="{ y: dynamicHeight }"
|
||||
:columns="columns"
|
||||
:dataSource="endataSource">
|
||||
<!-- :locale="myLocale"-->
|
||||
|
||||
<!-- 字符串超长截取省略号显示-->
|
||||
:dataSource="dataSource">
|
||||
</a-table>
|
||||
</div>
|
||||
<div class="linese"></div>
|
||||
|
@ -88,9 +90,11 @@
|
|||
<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'
|
||||
export default {
|
||||
name: "dataManage",
|
||||
components: {
|
||||
|
@ -101,75 +105,108 @@
|
|||
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:[
|
||||
],
|
||||
tagloading:false,
|
||||
loading:false,
|
||||
columns: [
|
||||
{
|
||||
tableName:"LA_DATA_TABLE_0001",
|
||||
data1:"舰艇综合导航信息II",
|
||||
title: '表名',
|
||||
align:"left",
|
||||
dataIndex: 'tableName',
|
||||
},
|
||||
{
|
||||
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:"反潜测试报文",
|
||||
title: '报文名',
|
||||
align:"left",
|
||||
dataIndex: 'tableMessName'
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
tagcolumns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'id',
|
||||
width:60,
|
||||
align:"id",
|
||||
align:"center",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '表名',
|
||||
align:"center",
|
||||
align:"left",
|
||||
dataIndex: 'tableName',
|
||||
},
|
||||
{
|
||||
title: '报文名',
|
||||
align:"center",
|
||||
dataIndex: 'data1'
|
||||
},
|
||||
],
|
||||
endataSource:[
|
||||
{
|
||||
tableName:"LA_DATA_TABLE_0009",
|
||||
data1:"舰艇综合导航信息I",
|
||||
},
|
||||
{
|
||||
tableName:"LA_DATA_TABLE_0010",
|
||||
data1:"动力报文I",
|
||||
align:"left",
|
||||
dataIndex: 'tableMessName'
|
||||
},
|
||||
],
|
||||
tagqueryParam: {
|
||||
pageNum :1,
|
||||
pageSize:20,
|
||||
tagName:""
|
||||
},
|
||||
selectedRowKeys: [],
|
||||
tagselectedRowKeys: [],
|
||||
selectedRowData: [],
|
||||
tagselectedRowData: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getselect()
|
||||
this.getdatatagSources()
|
||||
},
|
||||
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 () {
|
||||
},
|
||||
|
@ -177,6 +214,29 @@
|
|||
|
||||
},
|
||||
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(){
|
||||
getAction("/dataSpecial/special").then((res) => {
|
||||
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;
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user