fix -- 修复工作流模块流程分类为空时,前端报错,导致无法显示条目。

This commit is contained in:
konbai
2022-04-25 22:23:17 +08:00
parent ee8d2d5b58
commit f203421ff7
3 changed files with 25 additions and 26 deletions

View File

@@ -79,11 +79,7 @@
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="流程分类" align="center" prop="categoryName"> <el-table-column label="流程分类" align="center" prop="categoryName" :formatter="categoryFormat" />
<template slot-scope="scope">
<span>{{ categoryOptions.find(k => k.code === scope.row.category).categoryName }}</span>
</template>
</el-table-column>
<el-table-column label="业务表单" align="center" :show-overflow-tooltip="true"> <el-table-column label="业务表单" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.formId" type="text" @click="handleForm(scope.row.formId)"> <el-button v-if="scope.row.formId" type="text" @click="handleForm(scope.row.formId)">
@@ -425,12 +421,14 @@ export default {
}; };
}, },
created() { created() {
listCategory().then(response => { this.getCategoryList();
this.categoryOptions = response.rows
})
this.getList(); this.getList();
}, },
methods: { methods: {
/** 查询流程分类列表 */
getCategoryList() {
listCategory().then(response => this.categoryOptions = response.rows)
},
/** 查询流程定义列表 */ /** 查询流程定义列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@@ -640,6 +638,9 @@ export default {
// 提交上传文件 // 提交上传文件
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit();
},
categoryFormat(row, column) {
return this.categoryOptions.find(k => k.code === row.category)?.categoryName ?? '';
} }
} }
}; };

View File

@@ -36,11 +36,7 @@
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="流程分类" align="center" prop="categoryName"> <el-table-column label="流程分类" align="center" prop="categoryName" :formatter="categoryFormat" />
<template slot-scope="scope">
<span>{{ categoryOptions.find(k => k.code === scope.row.category).categoryName }}</span>
</template>
</el-table-column>
<el-table-column label="流程版本" align="center"> <el-table-column label="流程版本" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag size="medium" >v{{ scope.row.version }}</el-tag> <el-tag size="medium" >v{{ scope.row.version }}</el-tag>
@@ -121,15 +117,13 @@ export default {
} }
}, },
created() { created() {
this.getTreeselect(); this.getCategoryList();
this.getList(); this.getList();
}, },
methods: { methods: {
/** 查询流程分类列表 */ /** 查询流程分类列表 */
getTreeselect() { getCategoryList() {
listCategory().then(response => { listCategory().then(response => this.categoryOptions = response.rows)
this.categoryOptions = response.rows;
})
}, },
/** 查询流程定义列表 */ /** 查询流程定义列表 */
getList() { getList() {
@@ -168,6 +162,9 @@ export default {
deployId: row.deploymentId, deployId: row.deploymentId,
} }
}) })
},
categoryFormat(row, column) {
return this.categoryOptions.find(k => k.code === row.category)?.categoryName ?? '';
} }
} }
} }

View File

@@ -51,11 +51,7 @@
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="流程编号" align="center" prop="procInsId" :show-overflow-tooltip="true"/> <el-table-column label="流程编号" align="center" prop="procInsId" :show-overflow-tooltip="true"/>
<el-table-column label="流程名称" align="center" prop="procDefName" :show-overflow-tooltip="true"/> <el-table-column label="流程名称" align="center" prop="procDefName" :show-overflow-tooltip="true"/>
<el-table-column label="流程类别" align="center" prop="category" width="100px"> <el-table-column label="流程类别" align="center" prop="category" :formatter="categoryFormat" />
<template slot-scope="scope">
<span>{{ categoryOptions.find(k => k.code === scope.row.category).categoryName }}</span>
</template>
</el-table-column>
<el-table-column label="流程版本" align="center" width="80px"> <el-table-column label="流程版本" align="center" width="80px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag size="medium" >v{{ scope.row.procDefVersion }}</el-tag> <el-tag size="medium" >v{{ scope.row.procDefVersion }}</el-tag>
@@ -163,12 +159,14 @@ export default {
}; };
}, },
created() { created() {
listCategory().then(response => { this.getCategoryList();
this.categoryOptions = response.rows
})
this.getList(); this.getList();
}, },
methods: { methods: {
/** 查询流程分类列表 */
getCategoryList() {
listCategory().then(response => this.categoryOptions = response.rows)
},
/** 查询流程定义列表 */ /** 查询流程定义列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@@ -263,6 +261,9 @@ export default {
}).then(response => { }).then(response => {
this.download(response.msg); this.download(response.msg);
}) })
},
categoryFormat(row, column) {
return this.categoryOptions.find(k => k.code === row.category)?.categoryName ?? '';
} }
} }
}; };