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

@ -47,22 +47,21 @@
</el-col> </el-col>
</el-row> --> </el-row> -->
<el-table <el-table
border border
row-key="id" row-key="id"
v-loading="loading" v-loading="loading"
:data="modelList" :data="modelList"
:tree-props="{ children: 'nodes', hasChildren: 'hasChildren' }" :tree-props="{ children: 'nodes' }"
> >
<el-table-column label="序号" align="center" type="index" /> <el-table-column label="序号" align="center" type="index" />
<el-table-column label="项目名称"> <el-table-column label="项目名称">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<span> <span>{{ row.name }}</span>
{{ row.proName }} <el-tag style="margin-left: 10px" size="mini" type="primary">节点{{ row.level }}</el-tag>
</span> </template>
<el-tag style="margin-left: 10px" size="mini" type="primary">节点{{ row.level }}</el-tag>
</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="240"> <el-table-column label="操作" align="center" width="240">
@ -203,14 +202,34 @@ export default {
}, },
// //
getModelList() { getModelList() {
this.loading = true this.loading = true
getModelListApi(this.queryParams).then((response) => { getModelListApi(this.queryParams).then((response) => {
this.modelList = response.rows const rawList = response.rows
this.total = response.total
this.loading = false // 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
})
},
// //
handleUploadModel(row) { handleUploadModel(row) {

View File

@ -9,7 +9,7 @@ const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || '水运工程设计施工AR应用平台' // 网页标题 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 // 端口 const port = process.env.port || process.env.npm_config_port || 80 // 端口