Compare commits

...

2 Commits

Author SHA1 Message Date
wangchengming
80852d66a8 Merge branch 'main' of http://git.hivekion.com:3000/IDCDatasync/IDCDatasync-vue 2025-04-19 15:05:27 +08:00
wangchengming
23fe88212f 对接元数据 2025-04-19 15:04:59 +08:00
2 changed files with 100 additions and 41 deletions

9
src/api/metaData.js Normal file
View File

@ -0,0 +1,9 @@
import { getAction, deleteAction, putAction, postAction } from '@/api/manage'
const metaDataTypeTree = (params)=>getAction("/dataManager/getAllTable",params);
const metaDatalist = (params)=>getAction("/dataManager/getTableColumns",params);
export {
metaDataTypeTree,
metaDatalist
}

View File

@ -13,33 +13,36 @@
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="数据类型"> <a-form-item label="数据类型">
<a-select placeholder="选择同步状态" option-filter-prop="children" size="large" <a-select placeholder="选择同步状态" option-filter-prop="children" size="large"
v-model="queryParam.syncState"> v-model="queryParam.schemaMass" @change="handleTypeChange">
<a-select-option key=""> <a-select-option key="平台">
全部 平台
</a-select-option> </a-select-option>
<a-select-option key="0"> <a-select-option key="编队">
未同步 编队
</a-select-option> </a-select-option>
<a-select-option key="1"> <a-select-option key="航空兵">
进行中 航空兵
</a-select-option> </a-select-option>
<a-select-option key="2"> <a-select-option key="陆战队">
已结束 陆战队
</a-select-option>
<a-select-option key="作战">
作战
</a-select-option>
<a-select-option key="反潜">
反潜
</a-select-option>
<a-select-option key="舰炮">
舰炮
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="关键词"> <a-form-item label="关键词">
<a-input placeholder="请输入搜索关键词" v-model="queryParam.databaseName"></a-input> <a-input placeholder="请输入搜索关键词" v-model="queryParam.massKey"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a-button type="primary" style="left: 10px" icon="search">查询</a-button>
</a-col>
</span>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
@ -49,7 +52,7 @@
<div class="linese"></div> <div class="linese"></div>
<!-- 分类区域 --> <!-- 分类区域 -->
<div style="height:calc(100vh - 300px);background: #e6e9f1;padding:10px;"> <div style="height:calc(100vh - 300px);background: #e6e9f1;padding:10px;">
<a-tree :tree-data="treeDate" @select="onSelect" />
</div> </div>
<div class="linese"></div> <div class="linese"></div>
</a-col> </a-col>
@ -57,8 +60,8 @@
<div class="linese"></div> <div class="linese"></div>
<!-- 表格区域 --> <!-- 表格区域 -->
<div style="height:calc(100vh - 300px);background: #e6e9f1;overflow:hidden;padding: 15px;"> <div style="height:calc(100vh - 300px);background: #e6e9f1;overflow:hidden;padding: 15px;">
<a-table ref="table" size="middle" style="height:calc(100vh - 344px);" bordered rowKey="id" <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
:columns="columns" :dataSource="dataSource" :loading="loading"> :pagination="false" :loading="loading" :scroll="{y: 'calc(100vh - 380px)' }">
<!-- 字符串超长截取省略号显示--> <!-- 字符串超长截取省略号显示-->
<!-- <span slot="name" slot-scope="text"> <!-- <span slot="name" slot-scope="text">
@ -75,6 +78,7 @@
</a-card> </a-card>
</template> </template>
<script> <script>
import { metaDataTypeTree, metaDatalist } from '@/api/metaData'
export default { export default {
name: "metadata", name: "metadata",
components: { components: {
@ -84,55 +88,57 @@ export default {
loading: false, loading: false,
// //
queryParam: { queryParam: {
databaseName: null, sourceType: 1,
syncState: null, schemaMass: null,
pageNum: 1, massKey: null
pageSize: 9999999,
}, },
tableParams: {
schemaMass: null,
tableName: null
},
treeDate: [],
dataSource: [], dataSource: [],
columns: [ columns: [
{ {
title: '序号', title: '序号',
dataIndex: '', dataIndex: 'columnId',
key: 'id',
width: 60, width: 60,
align: "center", align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
}, },
{ {
title: '字段名称', title: '字段名称',
width: 200,
align: "center", align: "center",
dataIndex: 'name', dataIndex: 'columnName',
}, },
{ {
title: '索引类型', title: '数据类型',
width: 130,
align: "center", align: "center",
dataIndex: 'name', dataIndex: 'dataType',
}, },
{ {
title: '数据长度', title: '数据长度',
width: 100,
align: "center", align: "center",
dataIndex: 'name', dataIndex: 'dataLength',
}, },
{ {
title: '数据精度', title: '是否为空',
width: 100,
align: "center", align: "center",
dataIndex: 'name', dataIndex: 'nullable',
}, },
{ {
title: '描述', title: '默认值',
align: "center", align: "center",
dataIndex: 'issuingTime', dataIndex: 'dataDefault',
} }
] ]
} }
}, },
watch: {
'queryParam.massKey'(value) {
this.queryParam.massKey = value
this.getMetaDataTypeTree()
}
},
mounted() { mounted() {
}, },
@ -140,10 +146,54 @@ export default {
}, },
created() { created() {
this.getMetaDataTypeTree()
}, },
methods: { methods: {
getMetaDataTypeTree() {
metaDataTypeTree(this.queryParam).then(res => {
if (res.code == 200) {
this.treeDate = []
var keys = Object.keys(res.result)
keys.forEach((element, index) => {
const _children = res.result[element]
var childrenList = []
_children.forEach((childrenNode, chil) => {
childrenList.push({
key: 'children_' + chil,
type: 'childern',
title: childrenNode
})
});
this.treeDate.push({
key: 'type_' + index,
type: 'parentType',
title: element,
children: childrenList
})
});
}
})
},
handleTypeChange(value) {
this.queryParam.schemaMass = value
this.getMetaDataTypeTree()
},
onSelect(selectedKeys, info) {
if (info.node.dataRef.type && info.node.dataRef.type == 'childern') {
this.tableParams.schemaMass = info.node.$parent.dataRef.title
this.tableParams.tableName = info.node.dataRef.title
this.getMetaDatalist()
}
},
getMetaDatalist() {
metaDatalist(this.tableParams).then(res => {
if (res.code == 200) {
this.dataSource = []
this.dataSource = res.result
}
})
}
} }
} }
</script> </script>