代码提交
This commit is contained in:
parent
ebadce3ee0
commit
f1dbf12b96
|
@ -1,7 +1,9 @@
|
|||
package com.ruoyi.mts.domain.vo;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -49,5 +51,6 @@ public class MesPlanRecordHistoryVo implements Serializable {
|
|||
@ExcelProperty(value = "oss_id")
|
||||
private Long ossId;
|
||||
|
||||
@JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
|
||||
private Date createTime;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,6 @@ public class MesPlanRecordHistoryServiceImpl implements IMesPlanRecordHistorySer
|
|||
}
|
||||
|
||||
private LambdaQueryWrapper<MesPlanRecordHistory> buildQueryWrapper(MesPlanRecordHistoryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<MesPlanRecordHistory> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getRecordId() != null, MesPlanRecordHistory::getRecordId, bo.getRecordId());
|
||||
lqw.orderByDesc(MesPlanRecordHistory::getCreateTime);
|
||||
|
|
|
@ -143,7 +143,7 @@ const buttonLoading = ref(false);
|
|||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const title = ref("");
|
||||
const isExpandAll = ref(true);
|
||||
const isExpandAll = ref(false);
|
||||
const refreshTable = ref(true);
|
||||
|
||||
const data = reactive({
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
</el-row>
|
||||
|
||||
<el-table v-if="refreshTable" v-loading="loading" :data="planDetailList" :row-key="(row, index) => row.id + index"
|
||||
height="800" :default-expand-all="isExpandAll" :span-method="objectSpanMethod" :cell-style="handleChangeCellStyle"
|
||||
height="1000" :default-expand-all="isExpandAll" :span-method="objectSpanMethod" :cell-style="handleChangeCellStyle"
|
||||
border>
|
||||
<el-table-column fixed="left" label="名称" align="left" prop="name" width="180">
|
||||
<!-- <template #default="scope">
|
||||
|
@ -89,14 +89,19 @@
|
|||
</el-tooltip> -->
|
||||
|
||||
<el-popover v-if="handleHisShow(scope.row, scope.column)" @before-enter="handleHistory(scope.row, scope.column)"
|
||||
placement="bottom" title="修改历史留痕" :width="200" trigger="hover">
|
||||
placement="bottom" title="修改历史留痕" :width="400" trigger="hover">
|
||||
<template #reference>
|
||||
<el-button link @click="handleDate(scope.column, scope.row)">
|
||||
{{ handleDateColumn(scope.row, scope.column) }}
|
||||
</el-button>
|
||||
</template>
|
||||
<template #default>
|
||||
<li v-for="his in hisRecord">{{ his.createTime }}: {{ his.remark }}</li>
|
||||
<!-- <li v-for="his in hisRecord">{{ his.createTime }}: {{ his.remark }}</li> -->
|
||||
|
||||
<el-table :data="hisRecord" :show-header="false">
|
||||
<el-table-column width="200" property="createTime" label="创建时间" />
|
||||
<el-table-column width="200" property="remark" label="日志记录" />
|
||||
</el-table>
|
||||
</template>
|
||||
</el-popover>
|
||||
|
||||
|
@ -271,12 +276,14 @@ function getDays(start, end) {
|
|||
*/
|
||||
function handleChangeCellStyle({ row, column, rowIndex, columnIndex }) {
|
||||
let cellStyle = {}
|
||||
|
||||
for (const item of row.record) {
|
||||
if (item.recordDate == column.label) {
|
||||
cellStyle.backgroundColor = item.ganttColor
|
||||
if (row.record) {
|
||||
for (const item of row.record) {
|
||||
if (item.recordDate == column.label) {
|
||||
cellStyle.backgroundColor = item.ganttColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取两个日期之间的所有日期
|
||||
//column.label == dayjs(row.planStartDate).format('YYYY-MM-DD')
|
||||
// const planDates = row.record.map(v => v.recordDate)
|
||||
|
@ -315,7 +322,7 @@ function handleDateColumn(row, column) {
|
|||
}
|
||||
|
||||
function handleHisShow(row, column) {
|
||||
if (row.record.length > 0) {
|
||||
if (row.record && row.record.length > 0) {
|
||||
for (const item of row.record) {
|
||||
if (item.recordDate == column.label) {
|
||||
return true
|
||||
|
@ -328,7 +335,7 @@ function handleHisShow(row, column) {
|
|||
const hisRecord = ref([])
|
||||
async function handleHistory(row, column) {
|
||||
let res = []
|
||||
if (row.record.length > 0) {
|
||||
if (row.record && row.record.length > 0) {
|
||||
for (const item of row.record) {
|
||||
if (item.recordDate == column.label) {
|
||||
const hisList = await listPlanRecordHistory({ recordId: item.id })
|
||||
|
|
Loading…
Reference in New Issue