能正确显示反馈信息,并且能够显示树形表单,不过树形表单没有缩进,需继续修改
This commit is contained in:
@@ -37,13 +37,53 @@
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }"> </template>
|
||||
<!--嵌套子表-->
|
||||
<template #expandedRowRender="{ record }">
|
||||
<div class="feedback-expand-table" v-if="selectedFeedbackId === record.id">
|
||||
<div class="feedback-expand-header">
|
||||
<div class="feedback-expand-title">
|
||||
<span class="feedback-expand-icon">
|
||||
<Icon icon="ant-design:message-outlined" />
|
||||
</span>
|
||||
<span>反馈信息</span>
|
||||
<a-tag class="feedback-expand-count" color="processing">
|
||||
{{ feedbackTableLoading ? '加载中' : `${getFeedbackCount(record)} 条` }}
|
||||
</a-tag>
|
||||
</div>
|
||||
<div class="feedback-expand-actions">
|
||||
<a-button type="link" size="small" @click="handleCloseFeedback">收起</a-button>
|
||||
</div>
|
||||
</div>
|
||||
<BasicTable
|
||||
class="feedback-inner-table"
|
||||
bordered
|
||||
size="small"
|
||||
rowKey="id"
|
||||
:canResize="false"
|
||||
:showIndexColumn="false"
|
||||
:showActionColumn="false"
|
||||
:showTableSetting="false"
|
||||
:clickToRowSelect="false"
|
||||
:columns="feedbackExpandColumns"
|
||||
:dataSource="feedbackTableData[record.id] || []"
|
||||
:loading="feedbackTableLoading"
|
||||
:pagination="false"
|
||||
:scroll="{ x: 1220 }"
|
||||
>
|
||||
<template #feedbackAttachments="{ record: feedbackRecord }">
|
||||
<SUploadFile
|
||||
v-if="feedbackRecord.id"
|
||||
class="feedback-attachment-list"
|
||||
:bussiness-id="feedbackRecord.id"
|
||||
:disabled="true"
|
||||
:multiple="true"
|
||||
/>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!--子表表格tab-->
|
||||
<a-tabs defaultActiveKey="1">
|
||||
<a-tab-pane tab="习总书记重要讲话反馈表" key="1">
|
||||
<BgXiSpeakFeedbackList />
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</div>
|
||||
<!-- 表单区域 -->
|
||||
<BgXiSpeakModal ref="registerModal" @success="handleSuccess"></BgXiSpeakModal>
|
||||
@@ -57,23 +97,24 @@
|
||||
<script lang="ts" name="bg.xispeak-bgXiSpeak" setup>
|
||||
import { ref, reactive, unref, computed, provide } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import type { BasicColumn } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { startProcessSchedules } from '/@/api/common/api';
|
||||
import { dateUtil } from '/@/utils/dateUtil';
|
||||
import Icon from '/@/components/Icon/index';
|
||||
import BgXiSpeakModal from './components/BgXiSpeakModal.vue';
|
||||
import BgXiSpeakFeedbackList from './BgXiSpeakFeedbackList.vue';
|
||||
import SUploadFile from '/@/components/semri/fileComponent/SUploadFile.vue';
|
||||
import BusinessProcessListModal from '/src/components/semri/process/BusinessProcessListModal.vue';
|
||||
import FlowScheduleStartModal from '/src/components/semri/process/FlowScheduleStartModal.vue';
|
||||
import { columns as taskTaskColumns } from '/@/views/taskProcess/TaskTask.data';
|
||||
import { columns, superQuerySchema } from './BgXiSpeak.data';
|
||||
import { list, deleteBgXiSpeak, batchDeleteBgXiSpeak, getExportUrl, getImportUrl, getChildList, getChildListBatch } from './BgXiSpeak.api';
|
||||
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
|
||||
import JSelectUser from '/@/components/Form/src/jeecg/components/JSelectUser.vue';
|
||||
import { columns, superQuerySchema, bgXiSpeakFeedbackColumns } from './BgXiSpeak.data';
|
||||
import { list, deleteBgXiSpeak, batchDeleteBgXiSpeak, getExportUrl, getImportUrl, getChildList, getChildListBatch, updateLaunchType, bgXiSpeakFeedbackList } from './BgXiSpeak.api';
|
||||
|
||||
const FLOW_CODE = 'dev_bg_xi_speak_001';
|
||||
const FLOW_NAME = '习总书记重要讲话指示批示';
|
||||
const FLOW_CODE_JBR = 'process_1778315114392';
|
||||
const BUSINESS_TABLE_NAME = 'bg_xi_speak';
|
||||
const FORM_URL = 'bg/xispeak/components/BgXiSpeakBPMForm';
|
||||
|
||||
@@ -86,6 +127,22 @@
|
||||
const flowScheduleModalRef = ref();
|
||||
const businessProcessListModalRef = ref();
|
||||
const processColumns = taskTaskColumns;
|
||||
const selectedFeedbackId = ref<string | number | null>(null);
|
||||
const feedbackTableData = reactive<Record<string, Recordable[]>>({});
|
||||
const feedbackTableLoading = ref(false);
|
||||
|
||||
// 注册table数据
|
||||
const feedbackExpandColumns: BasicColumn[] = [
|
||||
...bgXiSpeakFeedbackColumns,
|
||||
{
|
||||
title: '附件下载',
|
||||
dataIndex: 'id',
|
||||
key: 'attachments',
|
||||
align: 'left',
|
||||
width: 340,
|
||||
slots: { customRender: 'feedbackAttachments' },
|
||||
},
|
||||
];
|
||||
|
||||
// 是否显示DW领导列表选择
|
||||
const showSdwLeaderSelect = computed(() => queryParam.value.needSdwApproval === '1');
|
||||
@@ -98,6 +155,8 @@
|
||||
canResize: false,
|
||||
useSearchForm: false,
|
||||
isTreeTable: true,
|
||||
indentSize: 30,
|
||||
expandIconColumnIndex: 1,
|
||||
clickToRowSelect: true,
|
||||
rowSelection: { type: 'radio' },
|
||||
actionColumn: {
|
||||
@@ -108,10 +167,21 @@
|
||||
params.hasQuery = 'true';
|
||||
return Object.assign(params, queryParam.value);
|
||||
},
|
||||
afterFetch: (result) => {
|
||||
if (result && result.length > 0) {
|
||||
// 为有子节点的记录设置 children(用于显示展开图标)
|
||||
result.forEach((item) => {
|
||||
if (item.hasChild == '1' && (!item.children || item.children.length === 0)) {
|
||||
item.children = [{ id: item.id + '_loadChild', name: 'loading...', isLoading: true }];
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
},
|
||||
pagination: {
|
||||
current: 1,
|
||||
pageSize: 5,
|
||||
pageSizeOptions: ['5', '10', '20'],
|
||||
pageSize: 10,
|
||||
pageSizeOptions: ['10', '20', '30'],
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
@@ -227,11 +297,43 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加下级
|
||||
* 树节点展开合并
|
||||
*/
|
||||
function handleAddSub(record) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add(record);
|
||||
async function handleExpand(expanded, record) {
|
||||
if (expanded) {
|
||||
expandedRowKeys.value.push(record.id);
|
||||
// 懒加载子节点
|
||||
if (record.children && record.children.length > 0 && record.children[0].isLoading) {
|
||||
let result = await getChildList({ pid: record.id });
|
||||
result = result.records ? result.records : result;
|
||||
if (result && result.length > 0) {
|
||||
record.children = getDataByResult(result);
|
||||
} else {
|
||||
record.children = null;
|
||||
record.hasChild = '0';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let keyIndex = expandedRowKeys.value.indexOf(record.id);
|
||||
if (keyIndex >= 0) {
|
||||
expandedRowKeys.value.splice(keyIndex, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理数据集,标记有子节点的记录
|
||||
*/
|
||||
function getDataByResult(result) {
|
||||
if (result && result.length > 0) {
|
||||
return result.map((item) => {
|
||||
if (item['hasChild'] == '1') {
|
||||
let loadChild = { id: item.id + '_loadChild', name: 'loading...', isLoading: true };
|
||||
item.children = [loadChild];
|
||||
}
|
||||
return item;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -277,59 +379,31 @@
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理数据集
|
||||
*/
|
||||
function getDataByResult(result) {
|
||||
if (result && result.length > 0) {
|
||||
return result.map((item) => {
|
||||
if (item['hasChild'] == '1') {
|
||||
let loadChild = { id: item.id + '_loadChild', name: 'loading...', isLoading: true };
|
||||
item.children = [loadChild];
|
||||
}
|
||||
return item;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 树节点展开合并
|
||||
*/
|
||||
async function handleExpand(expanded, record) {
|
||||
if (expanded) {
|
||||
expandedRowKeys.value.push(record.id);
|
||||
if (record.children.length > 0 && !!record.children[0].isLoading) {
|
||||
let result = await getChildList({ pid: record.id });
|
||||
result = result.records ? result.records : result;
|
||||
if (result && result.length > 0) {
|
||||
record.children = getDataByResult(result);
|
||||
} else {
|
||||
record.children = null;
|
||||
record.hasChild = '0';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let keyIndex = expandedRowKeys.value.indexOf(record.id);
|
||||
if (keyIndex >= 0) {
|
||||
expandedRowKeys.value.splice(keyIndex, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作表格后处理树节点展开合并
|
||||
*/
|
||||
async function expandTreeNode(key) {
|
||||
let record = findTableDataRecord(key);
|
||||
expandedRowKeys.value.push(key);
|
||||
let result = await getChildList({ pid: key });
|
||||
if (result && result.length > 0) {
|
||||
record.children = getDataByResult(result);
|
||||
} else {
|
||||
record.children = null;
|
||||
record.hasChild = '0';
|
||||
if (record) {
|
||||
expandedRowKeys.value.push(key);
|
||||
let result = await getChildList({ pid: key });
|
||||
result = result.records ? result.records : result;
|
||||
if (result && result.length > 0) {
|
||||
record.children = getDataByResult(result);
|
||||
} else {
|
||||
record.children = null;
|
||||
record.hasChild = '0';
|
||||
}
|
||||
updateTableDataRecord(key, record);
|
||||
}
|
||||
updateTableDataRecord(key, record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加下级
|
||||
*/
|
||||
function handleAddSub(record) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add(record);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -376,13 +450,21 @@
|
||||
label: '查询督办流程',
|
||||
onClick: handleQueryProcess.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '查看反馈',
|
||||
onClick: handleViewFeedback.bind(null, record),
|
||||
},
|
||||
];
|
||||
|
||||
if (record.bpmStatus == '1' || !record.bpmStatus) {
|
||||
dropDownAction.push({
|
||||
label: '发起流程',
|
||||
label: '发起督办计划收集流程',
|
||||
onClick: handleProcess.bind(null, record),
|
||||
});
|
||||
dropDownAction.push({
|
||||
label: '发起经办人执行反馈流程',
|
||||
onClick: handleProcessJbr.bind(null, record),
|
||||
});
|
||||
}
|
||||
|
||||
return dropDownAction;
|
||||
@@ -390,11 +472,18 @@
|
||||
|
||||
function handleProcess(record) {
|
||||
flowScheduleModalRef.value?.open({
|
||||
title: '发起流程',
|
||||
title: '发起督办计划收集流程',
|
||||
payload: { record },
|
||||
});
|
||||
}
|
||||
|
||||
function handleProcessJbr(record) {
|
||||
flowScheduleModalRef.value?.open({
|
||||
title: '发起落实部门经办人执行反馈流程',
|
||||
payload: { record, flowCode: FLOW_CODE_JBR },
|
||||
});
|
||||
}
|
||||
|
||||
function handleQueryProcess(record) {
|
||||
businessProcessListModalRef.value?.open({
|
||||
title: '流程列表',
|
||||
@@ -405,10 +494,19 @@
|
||||
|
||||
async function handleFlowScheduleConfirm({ payload, options }) {
|
||||
const record = payload?.record || {};
|
||||
const flowCode = payload?.flowCode || FLOW_CODE;
|
||||
const formatDate = (value, format) => {
|
||||
return value ? dateUtil(value).format(format) : undefined;
|
||||
};
|
||||
|
||||
// triggerType: 1=立即发起, 2=重复发起; launchType: 0=收集后直接发起, 1=收集后周期性发起
|
||||
const launchType = options.triggerType === 2 ? 1 : 0;
|
||||
|
||||
// 先保存 launchType 到主表
|
||||
if (flowCode === FLOW_CODE) {
|
||||
await updateLaunchType({ id: record.id, launchType });
|
||||
}
|
||||
|
||||
// 合并选中的DW领导列表到record中
|
||||
const recordWithSdwLeader = {
|
||||
...record,
|
||||
@@ -422,7 +520,7 @@
|
||||
taskTask: {
|
||||
triggerType: options.triggerType,
|
||||
startTime: options.intervalStartTime,
|
||||
flowCode: FLOW_CODE,
|
||||
flowCode: flowCode,
|
||||
formUrl: FORM_URL,
|
||||
flowName: FLOW_NAME,
|
||||
jsonData: recordWithSdwLeader,
|
||||
@@ -439,6 +537,7 @@
|
||||
};
|
||||
|
||||
await startProcessSchedules(params);
|
||||
createMessage.success('发起成功');
|
||||
handleSuccess({ isUpdate: false, values: {}, expandedArr: [], changeParent: false });
|
||||
}
|
||||
|
||||
@@ -449,6 +548,42 @@
|
||||
});
|
||||
}
|
||||
|
||||
function getFeedbackCount(record: Recordable) {
|
||||
return (feedbackTableData[record.id] || []).length;
|
||||
}
|
||||
|
||||
function handleCloseFeedback() {
|
||||
selectedFeedbackId.value = null;
|
||||
}
|
||||
|
||||
async function loadFeedbackTableData(mainId: string | number) {
|
||||
feedbackTableLoading.value = true;
|
||||
try {
|
||||
const res = await bgXiSpeakFeedbackList({
|
||||
mainId,
|
||||
pageNo: 1,
|
||||
pageSize: 9999,
|
||||
column: 'createTime',
|
||||
order: 'desc',
|
||||
});
|
||||
feedbackTableData[mainId] = Array.isArray(res) ? res : res?.records || [];
|
||||
} finally {
|
||||
feedbackTableLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function handleViewFeedback(record: Recordable) {
|
||||
const mainId = record.id;
|
||||
if (selectedFeedbackId.value === mainId) {
|
||||
selectedFeedbackId.value = null;
|
||||
} else {
|
||||
selectedFeedbackId.value = mainId;
|
||||
if (!feedbackTableData[mainId] || feedbackTableData[mainId].length === 0) {
|
||||
await loadFeedbackTableData(mainId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@@ -626,6 +761,108 @@
|
||||
}
|
||||
}
|
||||
|
||||
.feedback-expand-table {
|
||||
margin: 4px 10px 12px 42px;
|
||||
padding: 12px 14px 14px;
|
||||
background: #f6fbff;
|
||||
border: 1px solid #d6e8ff;
|
||||
border-left: 4px solid #1677ff;
|
||||
border-radius: 6px;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
|
||||
|
||||
.feedback-expand-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.feedback-expand-title {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
color: #1f2937;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.feedback-expand-icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin-right: 8px;
|
||||
color: #1677ff;
|
||||
background: #e6f4ff;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.feedback-expand-count {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.feedback-expand-desc {
|
||||
color: #64748b;
|
||||
font-size: 13px;
|
||||
line-height: 22px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.feedback-expand-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
:deep(.jeecg-basic-table) {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
:deep(.feedback-inner-table .ant-table-wrapper) {
|
||||
padding: 0;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
:deep(.feedback-inner-table .ant-table-thead > tr > th) {
|
||||
background: #eef6ff;
|
||||
color: #334155;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
:deep(.feedback-inner-table .ant-table-tbody > tr > td) {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
:deep(.feedback-inner-table .ant-table-tbody > tr:hover > td) {
|
||||
background: #f8fbff;
|
||||
}
|
||||
|
||||
.feedback-attachment-list {
|
||||
min-width: 300px;
|
||||
|
||||
:deep(.file-list-wrapper) {
|
||||
min-height: auto;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
:deep(.file-list-header) {
|
||||
margin-bottom: 6px;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
|
||||
:deep(.file-list .file-item) {
|
||||
padding: 8px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
:deep(.ant-empty) {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 响应式适配
|
||||
@media (max-width: 768px) {
|
||||
.erpNativeList {
|
||||
|
||||
Reference in New Issue
Block a user