代码提交

This commit is contained in:
userName 2024-02-23 14:00:00 +08:00
parent c833d79778
commit 6e2c7023cb
1 changed files with 17 additions and 6 deletions

View File

@ -88,20 +88,20 @@
</el-button> </el-button>
</el-tooltip> --> </el-tooltip> -->
<el-popover v-if="scope.row.record.length > 0" @before-enter="handleHistory(scope.row, scope.column)" placement="bottom" <el-popover v-if="handleHisShow(scope.row, scope.column)" @before-enter="handleHistory(scope.row, scope.column)"
title="修改历史留痕" :width="200" trigger="hover"> placement="bottom" title="修改历史留痕" :width="200" trigger="hover">
<template #reference> <template #reference>
<el-button link @click="handleDate(scope.column, scope.row)"> <el-button link @click="handleDate(scope.column, scope.row)">
{{ handleDateColumn(scope.row, scope.column) }} {{ handleDateColumn(scope.row, scope.column) }}
</el-button> </el-button>
</template> </template>
<template #default> <template #default>
<li v-for="his in hisRecord">{{ his }}</li> <li v-for="his in hisRecord">{{ his.createTime }}: {{ his.remark }}</li>
</template> </template>
</el-popover> </el-popover>
<el-button v-else link @click="handleDate(scope.column, scope.row)"> <el-button link @click="handleDate(scope.column, scope.row)" style="opacity:0;" v-else>
{{ handleDateColumn(scope.row, scope.column) }} {{ item.label }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -314,6 +314,17 @@ function handleDateColumn(row, column) {
return remark return remark
} }
function handleHisShow(row, column) {
if (row.record.length > 0) {
for (const item of row.record) {
if (item.recordDate == column.label) {
return true
}
}
}
return false
}
const hisRecord = ref([]) const hisRecord = ref([])
async function handleHistory(row, column) { async function handleHistory(row, column) {
let res = [] let res = []
@ -323,7 +334,7 @@ async function handleHistory(row, column) {
const hisList = await listPlanRecordHistory({ recordId: item.id }) const hisList = await listPlanRecordHistory({ recordId: item.id })
for (const his of hisList.rows) { for (const his of hisList.rows) {
res.push(his.remark) res.push(his)
} }
break; break;
} }