This commit is contained in:
lizhenhua 2025-07-15 17:23:48 +08:00
parent 01a2628cbf
commit 22780b97d4
2 changed files with 41 additions and 22 deletions

View File

@ -52,15 +52,14 @@
row-key="id"
v-loading="loading"
:data="modelList"
:tree-props="{ children: 'nodes', hasChildren: 'hasChildren' }"
:tree-props="{ children: 'nodes' }"
>
<el-table-column label="序号" align="center" type="index" />
<el-table-column label="项目名称">
<template slot-scope="{ row }">
<span>
{{ row.proName }}
</span>
<span>{{ row.name }}</span>
<el-tag style="margin-left: 10px" size="mini" type="primary">节点{{ row.level }}</el-tag>
</template>
</el-table-column>
@ -206,7 +205,27 @@ export default {
getModelList() {
this.loading = true
getModelListApi(this.queryParams).then((response) => {
this.modelList = response.rows
const rawList = response.rows
// nodes
const formatNodes = (nodes = []) => {
return nodes.map(item => ({
...item,
id: item.nodeId, // row-key 使 id
name: item.nodeName, // 使 name
nodes: formatNodes(item.nodes || [])
}))
}
// proName formatNodes
const formatted = rawList.map(project => ({
...project,
id: project.projectId,
name: project.proName,
nodes: formatNodes(project.children || [])
}))
this.modelList = formatted
this.total = response.total
this.loading = false
})

View File

@ -9,7 +9,7 @@ const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || '水运工程设计施工AR应用平台' // 网页标题
const baseUrl = 'http://192.168.0.60:58080' // 后端接口
const baseUrl = 'http://127.0.0.1:58080' // 后端接口
const port = process.env.port || process.env.npm_config_port || 80 // 端口