feat: 操作按钮根据项目状态条件渲染
This commit is contained in:
@@ -106,24 +106,45 @@
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<!-- 进行中状态 (status = '0') -->
|
||||
<el-button
|
||||
v-if="scope.row.status === '0'"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-right"
|
||||
@click="handleEnter(scope.row)"
|
||||
>进入项目</el-button>
|
||||
|
||||
<!-- 已完成状态 (status = '1') -->
|
||||
<template v-if="scope.row.status === '1'">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleViewResult(scope.row)"
|
||||
>查看结果</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-refresh"
|
||||
@click="handleReAnalyze(scope.row)"
|
||||
>重新分析</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-folder"
|
||||
@click="handleArchive(scope.row)"
|
||||
>归档</el-button>
|
||||
</template>
|
||||
|
||||
<!-- 已归档状态 (status = '2') -->
|
||||
<el-button
|
||||
v-if="scope.row.status === '2'"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleDetail(scope.row)"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope.row)"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
@click="handleViewResult(scope.row)"
|
||||
>查看结果</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -190,16 +211,20 @@ export default {
|
||||
return ''
|
||||
},
|
||||
|
||||
handleDetail(row) {
|
||||
this.$emit('detail', row)
|
||||
handleEnter(row) {
|
||||
this.$emit('enter', row)
|
||||
},
|
||||
|
||||
handleEdit(row) {
|
||||
this.$emit('edit', row)
|
||||
handleViewResult(row) {
|
||||
this.$emit('view-result', row)
|
||||
},
|
||||
|
||||
handleDelete(row) {
|
||||
this.$emit('delete', row)
|
||||
handleReAnalyze(row) {
|
||||
this.$emit('re-analyze', row)
|
||||
},
|
||||
|
||||
handleArchive(row) {
|
||||
this.$emit('archive', row)
|
||||
},
|
||||
|
||||
handleSizeChange(val) {
|
||||
|
||||
Reference in New Issue
Block a user