|
|
@@ -28,11 +28,11 @@
|
|
|
</div>
|
|
|
<template v-else>
|
|
|
<CollapseItem
|
|
|
- ref="collapseItemRef"
|
|
|
v-for="item in collapseList"
|
|
|
:key="item.id"
|
|
|
:name="item.taskName"
|
|
|
- :defaultOpen="item.id === collapseList[0].id"
|
|
|
+ :isActive="activeId === item.id"
|
|
|
+ @toggle="handleCollapseToggle(item.id)"
|
|
|
>
|
|
|
<template #viewOperation>
|
|
|
<el-tooltip
|
|
|
@@ -50,76 +50,78 @@
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
<template #main-table>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- :icon="Plus"
|
|
|
- class="main-table__button"
|
|
|
- v-if="isOverdue(item.dueCompleteTime)"
|
|
|
- @click="handleReport(item.id, item.taskName)"
|
|
|
- >新增</el-button
|
|
|
- >
|
|
|
- <BasicTable :tableData="item.tableData[0]?.disasterReportRecordDetailList" :tableConfig="tableConfig">
|
|
|
- <template #affectedArea="scope">
|
|
|
- <div class="affected-area-container">
|
|
|
- <span>{{ scope.row.buildingNo }}-{{ scope.row.floorNo }}-{{ scope.row.roomNo }}</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template #affectedItems="scope">
|
|
|
- <el-tooltip
|
|
|
- :content="scope.row.affectedItems"
|
|
|
- placement="top-start"
|
|
|
- effect="light"
|
|
|
- v-if="scope.row.isLoss"
|
|
|
- >
|
|
|
- <div class="affected-items-container">
|
|
|
- <span>{{ scope.row.affectedItems }}</span>
|
|
|
+ <div class="mian-table-container">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :icon="Plus"
|
|
|
+ class="main-table__button"
|
|
|
+ v-if="isOverdue(item.dueCompleteTime)"
|
|
|
+ @click="handleReport(item.id, item.taskName)"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
+ <BasicTable :tableData="item.tableData[0]?.disasterReportRecordDetailList" :tableConfig="tableConfig">
|
|
|
+ <template #affectedArea="scope">
|
|
|
+ <div class="affected-area-container">
|
|
|
+ <span>{{ scope.row.buildingNo }}-{{ scope.row.floorNo }}-{{ scope.row.roomNo }}</span>
|
|
|
</div>
|
|
|
- </el-tooltip>
|
|
|
- <span v-else>无损失</span>
|
|
|
- </template>
|
|
|
- <template #responsibleDeptName="scope">
|
|
|
- <span v-if="scope.row.isLoss">{{ scope.row.responsibleDeptName }}</span>
|
|
|
- <span v-else>--</span>
|
|
|
- </template>
|
|
|
- <template #priority="scope">
|
|
|
- <span v-if="scope.row.isLoss">{{ getPriority(scope.row.priority) }}</span>
|
|
|
- <span v-else>--</span>
|
|
|
- </template>
|
|
|
- <template #fixStatus="scope">
|
|
|
- <div class="fix-status-container">
|
|
|
- <span v-if="scope.row.isLoss">{{ getfixStatus(scope.row.fixStatus) }}</span>
|
|
|
+ </template>
|
|
|
+ <template #affectedItems="scope">
|
|
|
+ <el-tooltip
|
|
|
+ :content="scope.row.affectedItems"
|
|
|
+ placement="top-start"
|
|
|
+ effect="light"
|
|
|
+ v-if="scope.row.isLoss"
|
|
|
+ >
|
|
|
+ <div class="affected-items-container">
|
|
|
+ <span>{{ scope.row.affectedItems }}</span>
|
|
|
+ </div>
|
|
|
+ </el-tooltip>
|
|
|
+ <span v-else>无损失</span>
|
|
|
+ </template>
|
|
|
+ <template #responsibleDeptName="scope">
|
|
|
+ <span v-if="scope.row.isLoss">{{ scope.row.responsibleDeptName }}</span>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </template>
|
|
|
+ <template #priority="scope">
|
|
|
+ <span v-if="scope.row.isLoss">{{ getPriority(scope.row.priority) }}</span>
|
|
|
<span v-else>--</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template #action="scope">
|
|
|
- <div class="action-container" v-if="scope.row.isLoss">
|
|
|
- <ActionButton
|
|
|
- text="编辑"
|
|
|
- v-if="isOverdue(item.dueCompleteTime) && scope.row.fixStatus === FIX_STATUS.TO_BE_RECTIFIED"
|
|
|
- @click="handleEdit(scope.row.id, item.id)"
|
|
|
- />
|
|
|
- <ActionButton text="查看" />
|
|
|
- <ActionButton
|
|
|
- text="删除"
|
|
|
- v-if="scope.row.fixStatus === FIX_STATUS.TO_BE_RECTIFIED"
|
|
|
- @click="handleDelete(scope.row.id)"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class="action-container" v-else>
|
|
|
- <ActionButton text="查看" v-if="scope.row.fixStatus === FIX_STATUS.TEMPORARY_CLOSED" />
|
|
|
- <ActionButton
|
|
|
- text="编辑"
|
|
|
- @click="handleEdit(scope.row.id, item.id)"
|
|
|
- v-if="isOverdue(item.dueCompleteTime) && scope.row.fixStatus !== FIX_STATUS.TEMPORARY_CLOSED"
|
|
|
- />
|
|
|
- <ActionButton
|
|
|
- text="删除"
|
|
|
- @click="handleDelete(scope.row.id)"
|
|
|
- v-if="scope.row.fixStatus !== FIX_STATUS.TEMPORARY_CLOSED"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </BasicTable>
|
|
|
+ </template>
|
|
|
+ <template #fixStatus="scope">
|
|
|
+ <div class="fix-status-container">
|
|
|
+ <span v-if="scope.row.isLoss">{{ getfixStatus(scope.row.fixStatus) }}</span>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #action="scope">
|
|
|
+ <div class="action-container" v-if="scope.row.isLoss">
|
|
|
+ <ActionButton
|
|
|
+ text="编辑"
|
|
|
+ v-if="isOverdue(item.dueCompleteTime) && scope.row.fixStatus === FIX_STATUS.TO_BE_RECTIFIED"
|
|
|
+ @click="handleEdit(scope.row.id, item.handleTaskId)"
|
|
|
+ />
|
|
|
+ <ActionButton text="查看" />
|
|
|
+ <ActionButton
|
|
|
+ text="删除"
|
|
|
+ v-if="scope.row.fixStatus === FIX_STATUS.TO_BE_RECTIFIED"
|
|
|
+ @click="handleDelete(scope.row.id)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="action-container" v-else>
|
|
|
+ <ActionButton text="查看" v-if="scope.row.fixStatus === FIX_STATUS.TEMPORARY_CLOSED" />
|
|
|
+ <ActionButton
|
|
|
+ text="编辑"
|
|
|
+ @click="handleEdit(scope.row.id, item.id)"
|
|
|
+ v-if="isOverdue(item.dueCompleteTime) && scope.row.fixStatus !== FIX_STATUS.TEMPORARY_CLOSED"
|
|
|
+ />
|
|
|
+ <ActionButton
|
|
|
+ text="删除"
|
|
|
+ @click="handleDelete(scope.row.id)"
|
|
|
+ v-if="scope.row.fixStatus !== FIX_STATUS.TEMPORARY_CLOSED"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </BasicTable>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</CollapseItem>
|
|
|
</template>
|
|
|
@@ -142,7 +144,7 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import ViewDocument from '../svg/view-document.svg';
|
|
|
- import { ref, reactive, onMounted, nextTick, onUnmounted } from 'vue';
|
|
|
+ import { ref, reactive, onMounted, onUnmounted } from 'vue';
|
|
|
import { Plus } from '@element-plus/icons-vue';
|
|
|
import Search from '@/views/disaster/components/Search.vue';
|
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
|
@@ -174,7 +176,7 @@
|
|
|
const pageSize = ref(DEFAULT_PAGE_SIZE);
|
|
|
const total = ref(0);
|
|
|
const collapseLoading = ref(false);
|
|
|
- const collapseItemRef = ref<InstanceType<typeof CollapseItem>[]>([]);
|
|
|
+ const activeId = ref<number | null>(null);
|
|
|
const { tableConfig } = useTableConfig(LOSS_RECORD_TABLE_COLUMNS, DISPOSAL_MANAGEMENT_TABLE_OPTIONS, false);
|
|
|
const searchData = reactive({
|
|
|
handleDeptIds: null,
|
|
|
@@ -193,6 +195,13 @@
|
|
|
|
|
|
const taskIds = ref<number[]>([]);
|
|
|
const collapseList = ref<DisposalManagementCollapseListResponse<LossRecordTableResponse>[]>([]);
|
|
|
+ const handleCollapseToggle = (itemId: number) => {
|
|
|
+ if (activeId.value === itemId) {
|
|
|
+ activeId.value = null;
|
|
|
+ } else {
|
|
|
+ activeId.value = itemId;
|
|
|
+ }
|
|
|
+ };
|
|
|
const getDisposalData = async () => {
|
|
|
collapseLoading.value = true;
|
|
|
const res = await getReportTaskList({
|
|
|
@@ -216,9 +225,11 @@
|
|
|
taskIds.value = res.records.map((item) => item.handleTaskId);
|
|
|
total.value = res.totalRow;
|
|
|
collapseLoading.value = false;
|
|
|
- nextTick(() => {
|
|
|
- collapseItemRef.value[0]?.openFirstCollapseItem();
|
|
|
- });
|
|
|
+ if (collapseList.value.length > 0) {
|
|
|
+ activeId.value = collapseList.value[0].id;
|
|
|
+ } else {
|
|
|
+ activeId.value = null;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
const getDisposalTableData = async () => {
|