150 lines
4.3 KiB
Vue
150 lines
4.3 KiB
Vue
<template>
|
|
<a-row :gutter="30">
|
|
<a-col :md="24" :sm="1" >
|
|
<div class="table-page-search-wrapper"style="background: #e6e9f1;padding:10px;">
|
|
<a-select placeholder="选择数据类型" option-filter-prop="children" v-model="datatypequeryParam.schemaMass" @change="getTables()" style="width: 40%;">
|
|
<a-select-option v-for="d in dataTypedataSources" :key="d.enName">
|
|
{{ d.cnName }}
|
|
</a-select-option>
|
|
</a-select>
|
|
</div>
|
|
<!-- table区域-begin -->
|
|
<div ref="tableContainer" style="height:calc(100vh - 347px);background:#e6e9f1;padding:10px;">
|
|
<a-table
|
|
ref="table"
|
|
size="middle"
|
|
bordered
|
|
:pagination="false"
|
|
:scroll="{ y: tableScrollY }"
|
|
rowKey="id"
|
|
:columns="columns"
|
|
:dataSource="dataSource">
|
|
<!-- :locale="myLocale"-->
|
|
|
|
<!-- 字符串超长截取省略号显示-->
|
|
</a-table>
|
|
</div>
|
|
</a-col>
|
|
</a-row>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
import store from '@/store/'
|
|
import {getAction} from '@/api/manage'
|
|
import {
|
|
dataTypePageList,
|
|
dataTypeDeleteById } from '@/api/dataType'
|
|
export default {
|
|
name: "thematicLibrary",
|
|
components: {
|
|
},
|
|
data () {
|
|
return {
|
|
description: '专题库',
|
|
contentList:[],
|
|
datatypequeryParam: {
|
|
schemaMass:"",
|
|
schemaDesc:"",
|
|
sourceType:3
|
|
},
|
|
queryParam: {
|
|
pageNum :1,
|
|
pageSize:9999999,
|
|
},
|
|
dataTypedataSources: [],
|
|
dataSource:[
|
|
],
|
|
columns: [
|
|
{
|
|
title: '#',
|
|
dataIndex: '',
|
|
key:'id',
|
|
width:60,
|
|
align:"id",
|
|
customRender:function (t,r,index) {
|
|
return parseInt(index)+1;
|
|
}
|
|
},
|
|
{
|
|
title: '表名',
|
|
align:"center",
|
|
dataIndex: 'tableName',
|
|
},
|
|
{
|
|
title: '报文名',
|
|
align:"center",
|
|
dataIndex: 'tableMessName'
|
|
},
|
|
{
|
|
title: '数据类型',
|
|
align: "center",
|
|
dataIndex: 'tableMessName',
|
|
customRender: () => {
|
|
return this.datatypequeryParam.schemaDesc;
|
|
}
|
|
},
|
|
{
|
|
title: '标签类型',
|
|
align:"center",
|
|
dataIndex: 'tagNames'
|
|
},
|
|
],
|
|
tableScrollY: 0,
|
|
}
|
|
},
|
|
mounted() {
|
|
this.getselect()
|
|
this.calculateScrollY();
|
|
},
|
|
computed: {
|
|
},
|
|
destroyed: function () {
|
|
},
|
|
created () {
|
|
|
|
},
|
|
methods: {
|
|
calculateScrollY() {
|
|
// 获取父容器高度(需减去表格内其他元素的高度,如分页栏)
|
|
const container = this.$refs.tableContainer;
|
|
const paginationHeight = 64; // 根据实际分页栏高度调整
|
|
this.tableScrollY = container.clientHeight - paginationHeight;
|
|
},
|
|
getselect(){
|
|
getAction("/dataType/getExistingDataTypes", {}).then((res) => {
|
|
if (res.success) {
|
|
this.dataTypedataSources = res.result.result.DATA_CONN_SPECIAL
|
|
if(res.result.result.DATA_CONN_SPECIAL.length > 0){
|
|
this.datatypequeryParam.schemaMass = res.result.result.DATA_CONN_SPECIAL[0].enName
|
|
this.datatypequeryParam.schemaDesc = res.result.result.DATA_CONN_SPECIAL[0].cnName
|
|
}
|
|
this.getTables();
|
|
} else {
|
|
this.$message.warning(res.message);
|
|
}
|
|
});
|
|
},
|
|
getTables(){
|
|
getAction("/dataManager/getDataManagerInfo",this.datatypequeryParam).then((res) => {
|
|
if (res.result) {
|
|
// 根据 enName 查找对应的 cnName
|
|
const selectedOption = this.dataTypedataSources.find(
|
|
(d) => d.enName === this.datatypequeryParam.schemaMass
|
|
)
|
|
this.datatypequeryParam.schemaDesc = selectedOption?selectedOption.cnName:""
|
|
this.dataSource = res.result;
|
|
} else {
|
|
this.$message.warning(res.message);
|
|
}
|
|
});
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
<style scoped>
|
|
/deep/ .ant-table-bordered .ant-table-header > table {
|
|
border: none !important;
|
|
}
|
|
|
|
</style> |