|
|
@@ -1,6 +1,5 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <MDialog :visible="visible" title="数据预览" widthType="1" :footer="false" max-width="90%" @update:visible="handleVisibleChange">
|
|
|
<div v-if="previewData.product" class="mb-4">
|
|
|
<v-card outlined>
|
|
|
<v-card-text>
|
|
|
@@ -30,7 +29,6 @@
|
|
|
multiple
|
|
|
dense
|
|
|
style="max-width: 300px;"
|
|
|
- @change="handleColumnChange"
|
|
|
>
|
|
|
<template v-slot:selection="{ item, index }">
|
|
|
<v-chip v-if="index === 0" small>
|
|
|
@@ -78,34 +76,18 @@
|
|
|
:loading="false"
|
|
|
>
|
|
|
<template #actions="{ item }">
|
|
|
- <v-btn text color="primary" @click="handleVisualize(item)">可视化</v-btn>
|
|
|
+ <v-btn text color="primary" @click="handleVisualize(item)">数据溯源</v-btn>
|
|
|
</template>
|
|
|
</TableList>
|
|
|
<div v-else class="text-center pa-10 text--secondary">
|
|
|
- 暂无数据
|
|
|
+ 暂无数据
|
|
|
</div>
|
|
|
<div v-if="previewData.preview_count > 0 && selectedColumns.length > 0" class="text-end text--secondary">
|
|
|
- <span>已加载 {{ previewData.preview_count || 0 }} / {{ previewData.total_count || 0 }} 条</span>
|
|
|
+ <span>已加载 {{ previewData.preview_count || 0 }} / {{ previewData.total_count || 0 }} 条</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <template #footer>
|
|
|
- <v-divider></v-divider>
|
|
|
- <v-card-actions>
|
|
|
- <v-spacer></v-spacer>
|
|
|
- <v-btn
|
|
|
- v-if="previewData.preview_count < previewData.total_count && limit < 1000"
|
|
|
- text
|
|
|
- color="primary"
|
|
|
- @click="handleLoadMore"
|
|
|
- >
|
|
|
- 加载更多
|
|
|
- </v-btn>
|
|
|
- <v-btn v-if="previewData?.data?.length > 0" text color="success" @click="handleDownload">下载Excel</v-btn>
|
|
|
- <v-btn text @click="handleClose">关闭</v-btn>
|
|
|
- </v-card-actions>
|
|
|
- </template>
|
|
|
- </MDialog>
|
|
|
- <!-- 可视化图谱弹窗 -->
|
|
|
+
|
|
|
+ <!-- 关系图谱弹窗 -->
|
|
|
<MDialog
|
|
|
:visible="graphDialogVisible"
|
|
|
title="数据加工可视化"
|
|
|
@@ -135,10 +117,6 @@ export default {
|
|
|
TableList
|
|
|
},
|
|
|
props: {
|
|
|
- visible: {
|
|
|
- type: Boolean,
|
|
|
- default: false
|
|
|
- },
|
|
|
loading: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
@@ -210,14 +188,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- visible (val) {
|
|
|
- if (!val) {
|
|
|
- // 关闭时重置
|
|
|
- this.selectedColumns = []
|
|
|
- }
|
|
|
- },
|
|
|
'previewData.columns' (val) {
|
|
|
- if (val && val.length && this.visible) {
|
|
|
+ if (val && val.length) {
|
|
|
// 只在首次加载(selectedColumns为空)时,默认选中前6条
|
|
|
// 如果已经有选中的列,则保持用户的选择
|
|
|
if (this.selectedColumns.length === 0) {
|
|
|
@@ -238,62 +210,6 @@ export default {
|
|
|
} catch (error) {
|
|
|
this.$snackbar.error(error.message)
|
|
|
}
|
|
|
-
|
|
|
- // const data = {
|
|
|
- // nodes: [
|
|
|
- // {
|
|
|
- // id: 212,
|
|
|
- // name_zh: '用户标签库',
|
|
|
- // name_en: 'user_tag_library',
|
|
|
- // node_type: 'BusinessDomain',
|
|
|
- // labels: ['BusinessDomain'],
|
|
|
- // is_target: true,
|
|
|
- // is_source: false,
|
|
|
- // matched_data: [row, row, row, row, row, row, row, row, row, row, row, row, row, row]
|
|
|
- // },
|
|
|
- // {
|
|
|
- // id: 183,
|
|
|
- // name_zh: '用户标签生成',
|
|
|
- // name_en: 'user_tag_generate',
|
|
|
- // node_type: 'DataFlow',
|
|
|
- // labels: ['DataFlow'],
|
|
|
- // is_target: false,
|
|
|
- // is_source: false
|
|
|
- // },
|
|
|
- // {
|
|
|
- // id: 159,
|
|
|
- // name_zh: '用户画像',
|
|
|
- // name_en: 'user_profile',
|
|
|
- // node_type: 'BusinessDomain',
|
|
|
- // labels: ['BusinessDomain'],
|
|
|
- // is_target: false,
|
|
|
- // is_source: false,
|
|
|
- // matched_data: [row]
|
|
|
- // },
|
|
|
- // {
|
|
|
- // id: 154,
|
|
|
- // name_zh: '用户基础数据',
|
|
|
- // name_en: 'user_base_info',
|
|
|
- // node_type: 'DataResource',
|
|
|
- // labels: ['DataResource', 'BusinessDomain'],
|
|
|
- // is_target: false,
|
|
|
- // is_source: true,
|
|
|
- // matched_data: row
|
|
|
- // }
|
|
|
- // ],
|
|
|
- // lines: [
|
|
|
- // { from: '183', to: '212', text: 'OUTPUT' },
|
|
|
- // { from: '159', to: '183', text: 'INPUT' },
|
|
|
- // { from: '156', to: '159', text: 'OUTPUT' },
|
|
|
- // { from: '154', to: '156', text: 'INPUT' }
|
|
|
- // ],
|
|
|
- // lineage_depth: 2
|
|
|
- // }
|
|
|
- // this.graphData = data
|
|
|
- // this.graphDialogVisible = true
|
|
|
- },
|
|
|
- handleColumnChange () {
|
|
|
- this.$emit('column-change', this.selectedColumns)
|
|
|
},
|
|
|
// 表头项全选/取消全选
|
|
|
handleSelectAll () {
|
|
|
@@ -303,21 +219,8 @@ export default {
|
|
|
} else {
|
|
|
this.selectedColumns = this.previewData.columns.map(col => col.name)
|
|
|
}
|
|
|
- this.handleColumnChange()
|
|
|
})
|
|
|
},
|
|
|
- handleLoadMore () {
|
|
|
- this.$emit('load-more')
|
|
|
- },
|
|
|
- handleDownload () {
|
|
|
- this.$emit('download', this.previewData.total_count > 10000 ? 10000 : this.previewData.total_count)
|
|
|
- },
|
|
|
- handleVisibleChange (val) {
|
|
|
- this.$emit('update:visible', val)
|
|
|
- },
|
|
|
- handleClose () {
|
|
|
- this.$emit('update:visible', false)
|
|
|
- },
|
|
|
handleGraphDialogVisibleChange (val) {
|
|
|
this.graphDialogVisible = val
|
|
|
if (!val) {
|