yxk-20260508-党委会的反馈情况直接点击表格即可展开显示
This commit is contained in:
@@ -19,7 +19,8 @@ export const columns: BasicColumn[] = [
|
|||||||
{
|
{
|
||||||
title: '年份',
|
title: '年份',
|
||||||
align:"center",
|
align:"center",
|
||||||
dataIndex: 'year_dictText',
|
dataIndex: 'year',
|
||||||
|
width: '60px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<!--引用表格-->
|
<!--引用表格-->
|
||||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
<BasicTable @register="registerTable" :expandedRowKeys="expandedRowKeys" @expand="handleExpand">
|
||||||
<!--插槽:table标题-->
|
<!--插槽:table标题-->
|
||||||
<template #tableTitle>
|
<template #tableTitle>
|
||||||
<a-button type="primary" v-auth="'bgpartymatter:bg_partymatter:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
<a-button type="primary" v-auth="'bgpartymatter:bg_partymatter:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||||
@@ -34,18 +34,31 @@
|
|||||||
</template>
|
</template>
|
||||||
<!--操作栏-->
|
<!--操作栏-->
|
||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
<TableAction stopButtonPropagation :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||||
</template>
|
</template>
|
||||||
<!--字段回显插槽-->
|
<!--字段回显插槽-->
|
||||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
</template>
|
</template>
|
||||||
|
<!--嵌套子表-->
|
||||||
|
<template #expandedRowRender="{ record }">
|
||||||
|
<div class="feedback-expand-table">
|
||||||
|
<BasicTable
|
||||||
|
bordered
|
||||||
|
size="small"
|
||||||
|
rowKey="id"
|
||||||
|
:canResize="false"
|
||||||
|
:showIndexColumn="false"
|
||||||
|
:showActionColumn="false"
|
||||||
|
:showTableSetting="false"
|
||||||
|
:clickToRowSelect="false"
|
||||||
|
:columns="bgPartymatterFeedbackColumns"
|
||||||
|
:dataSource="getFeedbackTableData(record)"
|
||||||
|
:loading="getFeedbackTableLoading(record)"
|
||||||
|
:pagination="false"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<!--子表表格tab-->
|
|
||||||
<a-tabs defaultActiveKey="1" style="margin: 10px">
|
|
||||||
<a-tab-pane tab="党委会反馈表" key="1" >
|
|
||||||
<BgPartymatterFeedbackList />
|
|
||||||
</a-tab-pane>
|
|
||||||
</a-tabs>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<BgPartymatterModal ref="registerModal" @success="handleSuccess" />
|
<BgPartymatterModal ref="registerModal" @success="handleSuccess" />
|
||||||
@@ -57,20 +70,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" name="bgpartymatter-bgPartymatter" setup>
|
<script lang="ts" name="bgpartymatter-bgPartymatter" setup>
|
||||||
import { computed, reactive, ref, unref, provide } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { BasicTable, TableAction } from '/@/components/Table';
|
import { BasicTable, TableAction } from '/@/components/Table';
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
import { useModal } from '/@/components/Modal';
|
import { useModal } from '/@/components/Modal';
|
||||||
import { dateUtil } from '/@/utils/dateUtil';
|
import { dateUtil } from '/@/utils/dateUtil';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
|
||||||
import { startProcessSchedules } from '/@/api/common/api';
|
import { startProcessSchedules } from '/@/api/common/api';
|
||||||
import BgPartymatterModal from './components/BgPartymatterModal.vue';
|
import BgPartymatterModal from './components/BgPartymatterModal.vue';
|
||||||
import BgPartymatterFeedbackList from './BgPartymatterFeedbackList.vue';
|
|
||||||
import BusinessProcessListModal from '/src/components/semri/process/BusinessProcessListModal.vue';
|
import BusinessProcessListModal from '/src/components/semri/process/BusinessProcessListModal.vue';
|
||||||
import FlowScheduleStartModal from '/src/components/semri/process/FlowScheduleStartModal.vue';
|
import FlowScheduleStartModal from '/src/components/semri/process/FlowScheduleStartModal.vue';
|
||||||
import { columns as taskTaskColumns } from '/@/views/taskProcess/TaskTask.data';
|
import { columns, superQuerySchema, bgPartymatterFeedbackColumns } from './BgPartymatter.data';
|
||||||
import { columns, superQuerySchema } from './BgPartymatter.data';
|
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, bgPartymatterFeedbackList } from './BgPartymatter.api';
|
||||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BgPartymatter.api';
|
|
||||||
|
|
||||||
const FLOW_CODE = 'dev_task_task_001';
|
const FLOW_CODE = 'dev_task_task_001';
|
||||||
const FLOW_NAME = '党委会决议事项';
|
const FLOW_NAME = '党委会决议事项';
|
||||||
@@ -83,7 +93,9 @@
|
|||||||
const flowScheduleModalRef = ref();
|
const flowScheduleModalRef = ref();
|
||||||
const businessProcessListModalRef = ref();
|
const businessProcessListModalRef = ref();
|
||||||
const queryParam = reactive<any>({});
|
const queryParam = reactive<any>({});
|
||||||
const processColumns = taskTaskColumns;
|
const expandedRowKeys = ref<Array<string | number>>([]);
|
||||||
|
const feedbackTableData = reactive<Record<string, Recordable[]>>({});
|
||||||
|
const feedbackTableLoading = reactive<Record<string, boolean>>({});
|
||||||
|
|
||||||
interface DeptOption {
|
interface DeptOption {
|
||||||
label: string;
|
label: string;
|
||||||
@@ -97,6 +109,7 @@
|
|||||||
columns,
|
columns,
|
||||||
canResize:false,
|
canResize:false,
|
||||||
useSearchForm: false,
|
useSearchForm: false,
|
||||||
|
expandRowByClick: true,
|
||||||
clickToRowSelect: true,
|
clickToRowSelect: true,
|
||||||
rowSelection: {type: 'radio'},
|
rowSelection: {type: 'radio'},
|
||||||
actionColumn: {
|
actionColumn: {
|
||||||
@@ -124,13 +137,63 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||||
const mainId = computed(() => (unref(selectedRowKeys).length > 0 ? unref(selectedRowKeys)[0] : ''));
|
|
||||||
//下发 mainId,子组件接收
|
|
||||||
provide('mainId', mainId);
|
|
||||||
|
|
||||||
// 高级查询配置
|
// 高级查询配置
|
||||||
const superQueryConfig = reactive(superQuerySchema);
|
const superQueryConfig = reactive(superQuerySchema);
|
||||||
|
|
||||||
|
function getFeedbackKey(record: Recordable) {
|
||||||
|
return String(record?.id ?? '');
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFeedbackTableData(record: Recordable) {
|
||||||
|
return feedbackTableData[getFeedbackKey(record)] || [];
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFeedbackTableLoading(record: Recordable) {
|
||||||
|
return !!feedbackTableLoading[getFeedbackKey(record)];
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearFeedbackTableData() {
|
||||||
|
Object.keys(feedbackTableData).forEach((key) => {
|
||||||
|
delete feedbackTableData[key];
|
||||||
|
});
|
||||||
|
Object.keys(feedbackTableLoading).forEach((key) => {
|
||||||
|
delete feedbackTableLoading[key];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetFeedbackExpand() {
|
||||||
|
expandedRowKeys.value = [];
|
||||||
|
clearFeedbackTableData();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function loadFeedbackTableData(mainId: string | number) {
|
||||||
|
const key = String(mainId);
|
||||||
|
feedbackTableLoading[key] = true;
|
||||||
|
try {
|
||||||
|
const res = await bgPartymatterFeedbackList({
|
||||||
|
mainId,
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 9999,
|
||||||
|
column: 'createTime',
|
||||||
|
order: 'desc',
|
||||||
|
});
|
||||||
|
feedbackTableData[key] = Array.isArray(res) ? res : res?.records || [];
|
||||||
|
} finally {
|
||||||
|
feedbackTableLoading[key] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleExpand(expanded: boolean, record: Recordable) {
|
||||||
|
const mainId = record?.id;
|
||||||
|
expandedRowKeys.value = [];
|
||||||
|
if (!expanded || mainId === undefined || mainId === null || mainId === '') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
expandedRowKeys.value = [mainId];
|
||||||
|
await loadFeedbackTableData(mainId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 高级查询事件
|
* 高级查询事件
|
||||||
*/
|
*/
|
||||||
@@ -138,6 +201,7 @@
|
|||||||
Object.keys(params).map((k) => {
|
Object.keys(params).map((k) => {
|
||||||
queryParam[k] = params[k];
|
queryParam[k] = params[k];
|
||||||
});
|
});
|
||||||
|
resetFeedbackExpand();
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,7 +247,9 @@
|
|||||||
* 成功回调
|
* 成功回调
|
||||||
*/
|
*/
|
||||||
function handleSuccess() {
|
function handleSuccess() {
|
||||||
(selectedRowKeys.value = []) && reload();
|
selectedRowKeys.value = [];
|
||||||
|
resetFeedbackExpand();
|
||||||
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -269,7 +335,7 @@
|
|||||||
title: '流程列表',
|
title: '流程列表',
|
||||||
businessId: record.id,
|
businessId: record.id,
|
||||||
columns:''
|
columns:''
|
||||||
// columns: processColumns,默认值
|
// 默认使用 BusinessProcessListModal 内部列配置
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,6 +399,7 @@
|
|||||||
function searchReset() {
|
function searchReset() {
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
selectedRowKeys.value = [];
|
selectedRowKeys.value = [];
|
||||||
|
resetFeedbackExpand();
|
||||||
//刷新数据
|
//刷新数据
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
@@ -385,5 +452,14 @@
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.feedback-expand-table {
|
||||||
|
padding: 8px 16px 12px;
|
||||||
|
background: #fafafa;
|
||||||
|
|
||||||
|
:deep(.jeecg-basic-table) {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user