提交 ec169a2a authored 作者: liuluyu's avatar liuluyu

更新问题归档页面

上级 8dfcb3ac
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
<BasicTable @register="registerTable" :rowSelection="rowSelection"> <BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题--> <!--插槽:table标题-->
<template #tableTitle> <template #tableTitle>
<a-button type="primary" v-auth="'problem:st_problem_check_archive:add'" @click="handleAdd" preIcon="ant-design:plus-outlined">
新增</a-button
>
<a-button type="primary" v-auth="'problem:st_problem_check_archive:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> <a-button type="primary" v-auth="'problem:st_problem_check_archive:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">
导出</a-button 导出</a-button
> >
...@@ -30,7 +27,7 @@ ...@@ -30,7 +27,7 @@
<a-button v-auth="'problem:st_problem_check_archive:deleteBatch'">批量操作 </a-button> <a-button v-auth="'problem:st_problem_check_archive:deleteBatch'">批量操作 </a-button>
</a-dropdown> </a-dropdown>
<!-- 高级查询 --> <!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" /> <!-- <super-query :config="superQueryConfig" @search="handleSuperQuery" /> -->
</template> </template>
<!--操作栏--> <!--操作栏-->
<template #action="{ record }"> <template #action="{ record }">
...@@ -48,6 +45,8 @@ ...@@ -48,6 +45,8 @@
<RectifyPlanModal v-model="rectifyPlanModalVisible" :formData="rectifyPlanData" title="整改计划详情" /> <RectifyPlanModal v-model="rectifyPlanModalVisible" :formData="rectifyPlanData" title="整改计划详情" />
<!-- 执行情况详情弹窗 --> <!-- 执行情况详情弹窗 -->
<ExecutionDetailModal v-model="executionDetailModalVisible" :formData="executionDetailData" title="执行情况详情" /> <ExecutionDetailModal v-model="executionDetailModalVisible" :formData="executionDetailData" title="执行情况详情" />
<!-- 问题详情弹窗 -->
<ProblemDetailModal v-model="problemDetailModalVisible" :formData="problemDetailData" title="问题详情" />
</div> </div>
</template> </template>
...@@ -59,6 +58,7 @@ ...@@ -59,6 +58,7 @@
import StProblemCheckArchiveModal from './components/StProblemCheckArchiveModal.vue'; import StProblemCheckArchiveModal from './components/StProblemCheckArchiveModal.vue';
import RectifyPlanModal from './components/RectifyPlanModal.vue'; import RectifyPlanModal from './components/RectifyPlanModal.vue';
import ExecutionDetailModal from './components/ExecutionDetailModal.vue'; import ExecutionDetailModal from './components/ExecutionDetailModal.vue';
import ProblemDetailModal from './components/ProblemDetailModal.vue';
import { columns, searchFormSchema, superQuerySchema } from './StProblemCheckArchive.data'; import { columns, searchFormSchema, superQuerySchema } from './StProblemCheckArchive.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './StProblemCheckArchive.api'; import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './StProblemCheckArchive.api';
import FlowHistoryDrawer from '../../common/FlowHistoryDrawer.vue'; import FlowHistoryDrawer from '../../common/FlowHistoryDrawer.vue';
...@@ -81,6 +81,10 @@ ...@@ -81,6 +81,10 @@
const executionDetailModalVisible = ref(false); const executionDetailModalVisible = ref(false);
const executionDetailData = ref({}); const executionDetailData = ref({});
// 问题详情弹窗状态
const problemDetailModalVisible = ref(false);
const problemDetailData = ref({});
// 查看详情方法 // 查看详情方法
function handleViewDetail(record, type) { function handleViewDetail(record, type) {
console.log('查看详情:', type, record); console.log('查看详情:', type, record);
...@@ -92,15 +96,45 @@ ...@@ -92,15 +96,45 @@
// 打开执行情况弹窗 // 打开执行情况弹窗
executionDetailData.value = record; executionDetailData.value = record;
executionDetailModalVisible.value = true; executionDetailModalVisible.value = true;
} else if (type === 'problemDetail') {
// 打开问题详情弹窗
problemDetailData.value = record;
problemDetailModalVisible.value = true;
} }
} }
// 复制列配置并修改customRender // 复制列配置并修改customRender
const customColumns = computed(() => { const customColumns = computed(() => {
const cols = [...columns]; const cols = [...columns];
const rectifyPlanIndex = cols.findIndex((col) => col.dataIndex === 'rectifyPlan');
const rectifyPlanCol = cols.find((col) => col.dataIndex === 'rectifyPlan'); const rectifyPlanCol = cols.find((col) => col.dataIndex === 'rectifyPlan');
const execRemarkCol = cols.find((col) => col.dataIndex === 'execRemark'); const execRemarkCol = cols.find((col) => col.dataIndex === 'execRemark');
// 在整改计划列之前插入问题详情列
const problemDetailCol = {
title: '问题详情',
align: 'center',
dataIndex: 'problemDetail',
resizable: true,
width: 150,
customRender: ({ record }) => {
return {
children: h(
'a-button',
{
type: 'link',
onClick: () => handleViewDetail(record, 'problemDetail'),
},
'查看详情'
),
};
},
};
if (rectifyPlanIndex !== -1) {
cols.splice(rectifyPlanIndex, 0, problemDetailCol);
}
if (rectifyPlanCol) { if (rectifyPlanCol) {
rectifyPlanCol.customRender = ({ record }) => { rectifyPlanCol.customRender = ({ record }) => {
return { return {
...@@ -235,11 +269,11 @@ ...@@ -235,11 +269,11 @@
function getDropDownAction(record) { function getDropDownAction(record) {
let dropDownAction = [ let dropDownAction = [
{ // {
label: '编辑', // label: '编辑',
onClick: handleEdit.bind(null, record), // onClick: handleEdit.bind(null, record),
auth: 'problem:st_problem_check_archive:edit', // auth: 'problem:st_problem_check_archive:edit',
}, // },
{ {
label: '删除', label: '删除',
popConfirm: { popConfirm: {
......
<template>
<a-modal :open="modelValue" :title="title" :width="600" :footer="null" @cancel="handleCancel" @update:open="handleOpenChange">
<div class="modal-content">
<div class="form-item">
<div class="form-label">问题编号:</div>
<div class="form-value">{{ formData.problemNo || '-' }}</div>
</div>
<div class="form-item">
<div class="form-label">项目分类:</div>
<div class="form-value">{{ formData.projectCategory || '-' }}</div>
</div>
<div class="form-item">
<div class="form-label">问题发现方:</div>
<div class="form-value">{{ formData.findUser || '-' }}</div>
</div>
<div class="form-item">
<div class="form-label">问题来源:</div>
<div class="form-value">{{ formData.problemSource || '-' }}</div>
</div>
<div class="form-item">
<div class="form-label">所属领域:</div>
<div class="form-value">{{ formData.domain || '-' }}</div>
</div>
<div class="form-item">
<div class="form-label">风险等级:</div>
<div class="form-value">{{ formData.riskLevel || '-' }}</div>
</div>
<div class="form-item">
<div class="form-label">问题描述:</div>
<div class="form-value">{{ formData.problemDes || '-' }}</div>
</div>
</div>
<template #footer>
<div class="modal-footer">
<a-button type="primary" @click="handleCancel">关闭</a-button>
</div>
</template>
</a-modal>
</template>
<script setup lang="ts">
import { ref, watch } from 'vue';
// 定义组件props
const props = defineProps({
modelValue: {
type: Boolean,
default: false,
},
formData: {
type: Object,
default: () => ({}),
},
title: {
type: String,
default: '问题详情',
},
});
// 定义事件
const emit = defineEmits(['update:modelValue', 'cancel']);
// 处理modal打开状态变化
const handleOpenChange = (newVal) => {
emit('update:modelValue', newVal);
};
// 关闭弹窗
const handleCancel = () => {
emit('update:modelValue', false);
emit('cancel');
};
</script>
<style scoped lang="less">
.modal-content {
padding: 0 20px;
}
.form-item {
margin-bottom: 16px;
display: flex;
align-items: flex-start;
}
.form-label {
width: 120px;
font-weight: 500;
color: #333;
margin-right: 16px;
text-align: right;
padding-top: 6px;
}
.form-value {
flex: 1;
color: #666;
line-height: 1.5;
word-break: break-word;
}
.modal-footer {
text-align: center;
margin-top: 24px;
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论