|
@ -81,7 +81,15 @@ |
|
|
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange"> |
|
|
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange"> |
|
|
<el-table-column type="selection" width="50" align="center" /> |
|
|
<el-table-column type="selection" width="50" align="center" /> |
|
|
<el-table-column label="资产编号" align="center" key="" prop="astNo" v-if="columns[0].visible" /> |
|
|
<el-table-column label="资产编号" align="center" key="" prop="astNo" v-if="columns[0].visible" /> |
|
|
<el-table-column label="表来源系统" align="center" width="150" key="" prop="dataAstSrc" v-if="columns[1].visible" /> |
|
|
<el-table-column label="表来源系统" align="center" width="150" key="" prop="dataAstSrc" v-if="columns[1].visible" > |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<span > |
|
|
|
|
|
{{ |
|
|
|
|
|
getSrcSysName(scope.row.dataAstSrc) |
|
|
|
|
|
}} |
|
|
|
|
|
</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
<el-table-column label="表英文名称" align="center" width="200" key="" prop="dataAstEngName" v-if="columns[2].visible" /> |
|
|
<el-table-column label="表英文名称" align="center" width="200" key="" prop="dataAstEngName" v-if="columns[2].visible" /> |
|
|
<el-table-column label="表中文名称" align="center" width="200" key="" prop="dataAstCnName" v-if="columns[3].visible" /> |
|
|
<el-table-column label="表中文名称" align="center" width="200" key="" prop="dataAstCnName" v-if="columns[3].visible" /> |
|
|
<el-table-column label="表类型" align="center" width="100" key="" prop="dataAstType" v-if="columns[4].visible" /> |
|
|
<el-table-column label="表类型" align="center" width="100" key="" prop="dataAstType" v-if="columns[4].visible" /> |
|
@ -201,22 +209,50 @@ import { getSearch, batch, deptTreeSelect } from "@/api/dataAsset/assetDetail"; |
|
|
const { proxy } = getCurrentInstance() |
|
|
const { proxy } = getCurrentInstance() |
|
|
const defaultProps = { |
|
|
const defaultProps = { |
|
|
children: 'children', |
|
|
children: 'children', |
|
|
label: 'name', |
|
|
label: 'label', |
|
|
} |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import useUserStore from '@/store/modules/user'; // 注意路径是否正确 |
|
|
|
|
|
|
|
|
|
|
|
const userStore = useUserStore(); // 正确调用 |
|
|
|
|
|
const dsSysList = userStore.dsSysList; // 访问属性 |
|
|
const currentNode = ref({}) |
|
|
const currentNode = ref({}) |
|
|
const treeData = ref([]) |
|
|
const treeData = ref([]) |
|
|
const treeDataChildren = ref([]); |
|
|
const treeDataChildren = ref([]); |
|
|
|
|
|
const getSrcSysName = (id) => { |
|
|
|
|
|
if (id === null || id === undefined) return ''; |
|
|
|
|
|
|
|
|
|
|
|
const getName = (val) => { |
|
|
|
|
|
const match = dsSysList.find(item => item.id == String(val).trim()); |
|
|
|
|
|
return match ? match.name : val; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
return getName(id); |
|
|
|
|
|
}; |
|
|
|
|
|
function addLabel(nodes) { |
|
|
|
|
|
if (!nodes) return; |
|
|
|
|
|
nodes.forEach(node => { |
|
|
|
|
|
node.label = getSrcSysName(node.name); // 给每个节点加 label |
|
|
|
|
|
if (node.children && node.children.length > 0) { |
|
|
|
|
|
addLabel(node.children); // 递归处理子节点 |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 查询部门下拉树结构 */ |
|
|
/** 查询部门下拉树结构 */ |
|
|
function getDeptTree() { |
|
|
function getDeptTree() { |
|
|
deptTreeSelect().then(response => { |
|
|
deptTreeSelect().then(response => { |
|
|
treeData.value = response.data; |
|
|
const data = response.data || []; |
|
|
if (response.data && response.data[0] && response.data[0].children) { |
|
|
addLabel(data); // 先给所有节点加 label |
|
|
treeDataChildren.value = response.data[0].children |
|
|
treeData.value = data; |
|
|
|
|
|
if (data[0] && data[0].children) { |
|
|
|
|
|
treeDataChildren.value = data[0].children; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 节点单击事件 */ |
|
|
/** 节点单击事件 */ |
|
|
function handleNodeClick(data) { |
|
|
function handleNodeClick(data) { |
|
|
queryParams.value.dataAstSrc = data.name; |
|
|
queryParams.value.dataAstSrc = data.name; |
|
@ -234,7 +270,7 @@ watch(filterText, val => { |
|
|
/** 通过条件过滤节点 */ |
|
|
/** 通过条件过滤节点 */ |
|
|
const filterNode = (value, data) => { |
|
|
const filterNode = (value, data) => { |
|
|
if (!value) return true; |
|
|
if (!value) return true; |
|
|
return data.name.indexOf(value) !== -1; |
|
|
return data.label.indexOf(value) !== -1; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const columns = ref([ |
|
|
const columns = ref([ |
|
|