|
|
@@ -1,25 +1,32 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <m-card title="元数据新旧差异" class="pb-3">
|
|
|
- <m-table
|
|
|
- class="candidate-table"
|
|
|
- :headers="headers"
|
|
|
- :items="items"
|
|
|
- :loading="false"
|
|
|
- :is-tools="false"
|
|
|
- :disable-sort="true"
|
|
|
- :show-select="false"
|
|
|
- :can-delete="false"
|
|
|
- :show-page="false"
|
|
|
- :items-per-page="-1"
|
|
|
- :no-radius="true"
|
|
|
- >
|
|
|
- </m-table>
|
|
|
- </m-card>
|
|
|
-
|
|
|
- <m-card title="影响关系图谱" bodyStyle="flex: 1" style="height: 800px;" class="d-flex flex-column mt-3">
|
|
|
- <Graph :graphData="info.impact_graph"></Graph>
|
|
|
- </m-card>
|
|
|
+ <div style="height: calc(100% - 48px);">
|
|
|
+ <v-tabs v-model="activeIndex" background-color="#f7f8fa">
|
|
|
+ <v-tab>元数据新旧差异</v-tab>
|
|
|
+ <v-tab>影响关系图谱</v-tab>
|
|
|
+ </v-tabs>
|
|
|
+ <v-tabs-items v-model="activeIndex" style="flex: 1">
|
|
|
+ <v-tab-item>
|
|
|
+ <common-component :info="info" class="mt-3" @notesChange="handleNotesChange" />
|
|
|
+ <m-table
|
|
|
+ :headers="headers"
|
|
|
+ :items="items"
|
|
|
+ :loading="false"
|
|
|
+ :is-tools="false"
|
|
|
+ :disable-sort="true"
|
|
|
+ :show-select="false"
|
|
|
+ :can-delete="false"
|
|
|
+ :show-page="false"
|
|
|
+ :items-per-page="-1"
|
|
|
+ :no-radius="true"
|
|
|
+ >
|
|
|
+ </m-table>
|
|
|
+ </v-tab-item>
|
|
|
+ <v-tab-item>
|
|
|
+ <m-card style="height: calc(100% - 12px);" no-title class="d-flex flex-column mt-3" bodyStyle="flex: 1">
|
|
|
+ <Graph :graphData="info.impact_graph"></Graph>
|
|
|
+ </m-card>
|
|
|
+ </v-tab-item>
|
|
|
+ </v-tabs-items>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -27,13 +34,15 @@
|
|
|
import MCard from '@/components/MCard'
|
|
|
import MTable from '@/components/List/table.vue'
|
|
|
import Graph from './graph.vue'
|
|
|
+import CommonComponent from './common.vue'
|
|
|
|
|
|
export default {
|
|
|
name: 'changeComponent',
|
|
|
components: {
|
|
|
MCard,
|
|
|
MTable,
|
|
|
- Graph
|
|
|
+ Graph,
|
|
|
+ CommonComponent
|
|
|
},
|
|
|
props: {
|
|
|
info: {
|
|
|
@@ -43,16 +52,10 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- selectedCandidateMetaId: null
|
|
|
+ activeIndex: 0
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- newMetaSnapshot () {
|
|
|
- if (!this.info || !this.info.new_meta) {
|
|
|
- return {}
|
|
|
- }
|
|
|
- return this.info.new_meta
|
|
|
- },
|
|
|
headers () {
|
|
|
return [
|
|
|
{ text: '', align: 'start', value: 'title' },
|
|
|
@@ -64,97 +67,48 @@ export default {
|
|
|
if (!this.info || !this.info.new_meta || !this.info.old_meta) {
|
|
|
return []
|
|
|
}
|
|
|
+ const newMeta = this.info.new_meta || {}
|
|
|
+ const oldMeta = this.info.old_meta.snapshot || {}
|
|
|
+
|
|
|
+ const newTagIds = newMeta.tag_ids && newMeta.tag_ids.length ? newMeta.tag_ids.map(tag => tag.name_zh).join(', ') : '-'
|
|
|
+ const oldTagIds = oldMeta.tag_ids && oldMeta.tag_ids.length ? oldMeta.tag_ids.map(tag => tag.name_zh).join(', ') : '-'
|
|
|
return [
|
|
|
{
|
|
|
title: '中文名',
|
|
|
- new: this.info.new_meta.name_zh || '-',
|
|
|
- old: this.info.old_meta.snapshot.name_zh || '-'
|
|
|
+ new: newMeta?.name_zh || '-',
|
|
|
+ old: oldMeta?.name_zh || '-'
|
|
|
},
|
|
|
{
|
|
|
title: '英文名',
|
|
|
- new: this.info.new_meta.name_en || '-',
|
|
|
- old: this.info.old_meta.snapshot.name_en || '-'
|
|
|
+ new: newMeta?.name_en || '-',
|
|
|
+ old: oldMeta?.name_en || '-'
|
|
|
},
|
|
|
{
|
|
|
title: '数据类型',
|
|
|
- new: this.info.new_meta.data_type || '-',
|
|
|
- old: this.info.old_meta.snapshot.data_type || '-'
|
|
|
+ new: newMeta?.data_type || '-',
|
|
|
+ old: oldMeta?.data_type || '-'
|
|
|
},
|
|
|
{
|
|
|
title: '数据标签',
|
|
|
- new: this.info.new_meta.tag_ids?.join(', ') || '-',
|
|
|
- old: this.info.old_meta.snapshot.tag_ids?.join(', ') || '-'
|
|
|
+ new: newTagIds,
|
|
|
+ old: oldTagIds
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- handleSelect (candidateMetaId) {
|
|
|
- this.selectedCandidateMetaId = candidateMetaId
|
|
|
- this.$emit('selectCandidateMeta', candidateMetaId)
|
|
|
+ handleNotesChange (notes) {
|
|
|
+ this.$emit('notesChange', notes)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.snapshot-card {
|
|
|
- background: #f5f3f3;
|
|
|
- border-radius: 6px;
|
|
|
- padding: 16px 20px;
|
|
|
- box-shadow: 0 0 0 1px #eee;
|
|
|
-}
|
|
|
-
|
|
|
-.snapshot-title {
|
|
|
- font-weight: 700;
|
|
|
- margin-bottom: 16px;
|
|
|
- // font-size: 14px;
|
|
|
- color: #333;
|
|
|
+::v-deep .v-window {
|
|
|
+ height: 100%;
|
|
|
}
|
|
|
-
|
|
|
-.snapshot-wrapper {
|
|
|
- display: flex;
|
|
|
- align-items: flex-start;
|
|
|
-}
|
|
|
-
|
|
|
-.snapshot-labels,
|
|
|
-.snapshot-values {
|
|
|
- list-style: none;
|
|
|
- padding: 0;
|
|
|
- margin: 0;
|
|
|
- font-size: 15px;
|
|
|
- line-height: 1.6;
|
|
|
-}
|
|
|
-
|
|
|
-.snapshot-labels {
|
|
|
- // flex: 0 0 90px;
|
|
|
- text-align: right;
|
|
|
- margin-right: 12px;
|
|
|
- color: #403b3b;
|
|
|
- // font-weight: 700;
|
|
|
-}
|
|
|
-
|
|
|
-.snapshot-values {
|
|
|
- flex: 1;
|
|
|
- word-break: break-all;
|
|
|
-}
|
|
|
-
|
|
|
-.snapshot-labels li,
|
|
|
-.snapshot-values li {
|
|
|
- margin: 6px 0;
|
|
|
-}
|
|
|
-
|
|
|
-.candidate-table thead th {
|
|
|
- background-color: #f5f5f5;
|
|
|
- font-weight: 600;
|
|
|
- font-size: 13px;
|
|
|
-}
|
|
|
-
|
|
|
-.candidate-table tbody tr:hover {
|
|
|
- background-color: #f9f9f9;
|
|
|
-}
|
|
|
-
|
|
|
-.candidate-table td {
|
|
|
- font-size: 13px;
|
|
|
+::v-deep .v-window__container, .v-window-item {
|
|
|
+ height: 100%;
|
|
|
}
|
|
|
</style>
|