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