|
@@ -22,7 +22,7 @@
|
|
|
</header>
|
|
</header>
|
|
|
<section class="disaster-precaution__section">
|
|
<section class="disaster-precaution__section">
|
|
|
<div class="collapse-container" v-loading="collapseLoading">
|
|
<div class="collapse-container" v-loading="collapseLoading">
|
|
|
- <div class="empty-container" v-if="collapseList.length === 0">
|
|
|
|
|
|
|
+ <div class="empty-container" v-if="collapseList.length === 0 || isEmpty">
|
|
|
<img :src="Empty" />
|
|
<img :src="Empty" />
|
|
|
<span>暂无数据</span>
|
|
<span>暂无数据</span>
|
|
|
</div>
|
|
</div>
|
|
@@ -36,7 +36,7 @@
|
|
|
>
|
|
>
|
|
|
<template #view-operation>
|
|
<template #view-operation>
|
|
|
<el-tooltip
|
|
<el-tooltip
|
|
|
- :content="item.tableData[0].disasterReportRecordDetailList.length ? '' : '任务无损失'"
|
|
|
|
|
|
|
+ :content="item.tableData[0].disasterReportRecordDetailList.length ? '' : '暂无损失记录'"
|
|
|
placement="top"
|
|
placement="top"
|
|
|
effect="light"
|
|
effect="light"
|
|
|
:popper-class="
|
|
:popper-class="
|
|
@@ -51,7 +51,7 @@
|
|
|
]"
|
|
]"
|
|
|
@click.stop="
|
|
@click.stop="
|
|
|
item.tableData[0].disasterReportRecordDetailList.length &&
|
|
item.tableData[0].disasterReportRecordDetailList.length &&
|
|
|
- handleView(item.handleTaskId, item.taskName, 'task')
|
|
|
|
|
|
|
+ handleView(item.handleTaskId, item.taskName, item.deptId)
|
|
|
"
|
|
"
|
|
|
/>
|
|
/>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
@@ -109,19 +109,22 @@
|
|
|
/>
|
|
/>
|
|
|
<ActionButton
|
|
<ActionButton
|
|
|
text="查看"
|
|
text="查看"
|
|
|
- @click="handleView(item.handleTaskId, item.taskName, 'item', scope.row.fixTaskId)"
|
|
|
|
|
|
|
+ @click="handleView(item.handleTaskId, item.taskName, item.deptId, scope.row.fixTaskId)"
|
|
|
/>
|
|
/>
|
|
|
<ActionButton
|
|
<ActionButton
|
|
|
text="删除"
|
|
text="删除"
|
|
|
v-if="scope.row.fixStatus === FIX_STATUS.TO_BE_RECTIFIED"
|
|
v-if="scope.row.fixStatus === FIX_STATUS.TO_BE_RECTIFIED"
|
|
|
- @click="handleDelete(scope.row.id)"
|
|
|
|
|
|
|
+ :popconfirm="{
|
|
|
|
|
+ title: '确定删除吗?',
|
|
|
|
|
+ }"
|
|
|
|
|
+ @confirm="handleDelete(scope.row.id)"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="action-container" v-else>
|
|
<div class="action-container" v-else>
|
|
|
<ActionButton
|
|
<ActionButton
|
|
|
text="查看"
|
|
text="查看"
|
|
|
v-if="scope.row.fixStatus === FIX_STATUS.TEMPORARY_CLOSED"
|
|
v-if="scope.row.fixStatus === FIX_STATUS.TEMPORARY_CLOSED"
|
|
|
- @click="handleView(item.handleTaskId, item.taskName, 'item', scope.row.fixTaskId)"
|
|
|
|
|
|
|
+ @click="handleView(item.handleTaskId, item.taskName, item.deptId, scope.row.fixTaskId)"
|
|
|
/>
|
|
/>
|
|
|
<ActionButton
|
|
<ActionButton
|
|
|
text="编辑"
|
|
text="编辑"
|
|
@@ -130,7 +133,10 @@
|
|
|
/>
|
|
/>
|
|
|
<ActionButton
|
|
<ActionButton
|
|
|
text="删除"
|
|
text="删除"
|
|
|
- @click="handleDelete(scope.row.id)"
|
|
|
|
|
|
|
+ :popconfirm="{
|
|
|
|
|
+ title: '确定删除吗?',
|
|
|
|
|
+ }"
|
|
|
|
|
+ @confirm="handleDelete(scope.row.id)"
|
|
|
v-if="scope.row.fixStatus !== FIX_STATUS.TEMPORARY_CLOSED"
|
|
v-if="scope.row.fixStatus !== FIX_STATUS.TEMPORARY_CLOSED"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
@@ -159,7 +165,7 @@
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
|
- import { ref, reactive, onMounted, onUnmounted } from 'vue';
|
|
|
|
|
|
|
+ import { ref, reactive, onMounted, onUnmounted, computed } from 'vue';
|
|
|
import { Plus } from '@element-plus/icons-vue';
|
|
import { Plus } from '@element-plus/icons-vue';
|
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
|
import Search from '@/views/disaster/components/Search.vue';
|
|
import Search from '@/views/disaster/components/Search.vue';
|
|
@@ -168,7 +174,7 @@
|
|
|
import CollapseItem from './CollapseItem.vue';
|
|
import CollapseItem from './CollapseItem.vue';
|
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
|
import { useDisasterControlHook } from '../hook';
|
|
import { useDisasterControlHook } from '../hook';
|
|
|
- import { useDeptInfoHook } from '@/views/disaster/hooks';
|
|
|
|
|
|
|
+ import { useDeptInfoHook, useUserInfoHook } from '@/views/disaster/hooks';
|
|
|
import { getfixStatus, isToolTip } from '../util';
|
|
import { getfixStatus, isToolTip } from '../util';
|
|
|
import type { DisposalManagementCollapseListResponse, LossRecordTableResponse } from '@/types/disaster-control';
|
|
import type { DisposalManagementCollapseListResponse, LossRecordTableResponse } from '@/types/disaster-control';
|
|
|
import { getReportTaskList, getLossRecordTableData, deleteLossRecord } from '@/api/disaster-control';
|
|
import { getReportTaskList, getLossRecordTableData, deleteLossRecord } from '@/api/disaster-control';
|
|
@@ -183,6 +189,7 @@
|
|
|
|
|
|
|
|
const { getPriority, getPriorityDict } = useDisasterControlHook();
|
|
const { getPriority, getPriorityDict } = useDisasterControlHook();
|
|
|
const { getFirstLevelDepts, firstLevelDepts } = useDeptInfoHook();
|
|
const { getFirstLevelDepts, firstLevelDepts } = useDeptInfoHook();
|
|
|
|
|
+ const { id: reporterId } = useUserInfoHook();
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const currentPage = ref(1);
|
|
const currentPage = ref(1);
|
|
@@ -208,6 +215,9 @@
|
|
|
|
|
|
|
|
const taskIds = ref<number[]>([]);
|
|
const taskIds = ref<number[]>([]);
|
|
|
const collapseList = ref<DisposalManagementCollapseListResponse<LossRecordTableResponse>[]>([]);
|
|
const collapseList = ref<DisposalManagementCollapseListResponse<LossRecordTableResponse>[]>([]);
|
|
|
|
|
+ const isEmpty = computed(() => {
|
|
|
|
|
+ return collapseList.value.every((item) => item.tableData[0].disasterReportRecordDetailList.length === 0);
|
|
|
|
|
+ });
|
|
|
const handleCollapseToggle = (itemId: number) => {
|
|
const handleCollapseToggle = (itemId: number) => {
|
|
|
if (activeId.value === itemId) {
|
|
if (activeId.value === itemId) {
|
|
|
activeId.value = null;
|
|
activeId.value = null;
|
|
@@ -228,6 +238,7 @@
|
|
|
taskName: item.taskName,
|
|
taskName: item.taskName,
|
|
|
updatedAt: item.updatedAt,
|
|
updatedAt: item.updatedAt,
|
|
|
dueCompleteTime: item.dueCompleteTime,
|
|
dueCompleteTime: item.dueCompleteTime,
|
|
|
|
|
+ deptId: item.deptId,
|
|
|
tableData: [
|
|
tableData: [
|
|
|
{
|
|
{
|
|
|
handleTaskId: item.handleTaskId,
|
|
handleTaskId: item.handleTaskId,
|
|
@@ -249,6 +260,7 @@
|
|
|
tableConfig.loading = true;
|
|
tableConfig.loading = true;
|
|
|
const res = await getLossRecordTableData({
|
|
const res = await getLossRecordTableData({
|
|
|
handleTaskIds: taskIds.value,
|
|
handleTaskIds: taskIds.value,
|
|
|
|
|
+ reporterId,
|
|
|
...searchData,
|
|
...searchData,
|
|
|
});
|
|
});
|
|
|
collapseList.value.forEach((item) => {
|
|
collapseList.value.forEach((item) => {
|
|
@@ -294,11 +306,11 @@
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const handleView = (id: number, taskName: string, type: 'task' | 'item', fixTaskId?: number) => {
|
|
|
|
|
|
|
+ const handleView = (id: number, taskName: string, deptId: number, fixTaskId?: number) => {
|
|
|
router.push({
|
|
router.push({
|
|
|
name: defaultName,
|
|
name: defaultName,
|
|
|
params: { id },
|
|
params: { id },
|
|
|
- query: { taskName, fixTaskId, type },
|
|
|
|
|
|
|
+ query: { taskName, fixTaskId, deptId },
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|