|
@@ -5,7 +5,7 @@
|
|
|
<div class="page-header">
|
|
<div class="page-header">
|
|
|
<div>
|
|
<div>
|
|
|
<div class="page-title">待办预警</div>
|
|
<div class="page-title">待办预警</div>
|
|
|
- <div class="page-subtitle">展示当前登录用户需处置的预警列表,支持“我的待办”和“我的已办”快速查阅与筛选</div>
|
|
|
|
|
|
|
+ <div class="page-subtitle">预警任务与督办通知</div>
|
|
|
</div>
|
|
</div>
|
|
|
<el-button type="primary" icon="Refresh" @click="loadCurrentTabData">刷新</el-button>
|
|
<el-button type="primary" icon="Refresh" @click="loadCurrentTabData">刷新</el-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -24,7 +24,7 @@
|
|
|
</el-card>
|
|
</el-card>
|
|
|
<el-card shadow="hover" class="summary-card primary">
|
|
<el-card shadow="hover" class="summary-card primary">
|
|
|
<div class="summary-label">当前视图</div>
|
|
<div class="summary-label">当前视图</div>
|
|
|
- <div class="summary-value">{{ filteredList.length }}</div>
|
|
|
|
|
|
|
+ <div class="summary-value">{{ pagedList.length }}</div>
|
|
|
<div class="summary-desc">本页筛选后可查看记录数</div>
|
|
<div class="summary-desc">本页筛选后可查看记录数</div>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
</div>
|
|
</div>
|
|
@@ -103,6 +103,7 @@
|
|
|
<el-tabs v-model="activeTab" @tab-change="handleTabChange">
|
|
<el-tabs v-model="activeTab" @tab-change="handleTabChange">
|
|
|
<el-tab-pane :label="`我的待办 (${todoCount})`" name="TODO" />
|
|
<el-tab-pane :label="`我的待办 (${todoCount})`" name="TODO" />
|
|
|
<el-tab-pane :label="`我的已办 (${doneCount})`" name="DONE" />
|
|
<el-tab-pane :label="`我的已办 (${doneCount})`" name="DONE" />
|
|
|
|
|
+ <el-tab-pane :label="`系统通知 (${noticeCount})`" name="NOTICE" />
|
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
|
|
|
|
|
<el-table :data="pagedList" @row-click="handleViewDetail">
|
|
<el-table :data="pagedList" @row-click="handleViewDetail">
|
|
@@ -112,6 +113,10 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="预警名称" prop="warningName" min-width="180" show-overflow-tooltip />
|
|
<el-table-column label="预警名称" prop="warningName" min-width="180" show-overflow-tooltip />
|
|
|
|
|
+ <el-table-column v-if="activeTab === 'NOTICE'" label="督办通知" prop="taskName" min-width="250" show-overflow-tooltip />
|
|
|
|
|
+ <el-table-column v-if="activeTab === 'NOTICE'" label="阅读状态" width="90">
|
|
|
|
|
+ <template #default="scope">{{ scope.row.readStatus === 'READ' ? '已读' : '未读' }}</template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="预警编号" prop="warningNo" width="170" />
|
|
<el-table-column label="预警编号" prop="warningNo" width="170" />
|
|
|
<el-table-column label="预警专项" prop="warningSpecial" width="140" show-overflow-tooltip />
|
|
<el-table-column label="预警专项" prop="warningSpecial" width="140" show-overflow-tooltip />
|
|
|
<el-table-column label="预警类型" prop="warningTypeText" width="120" />
|
|
<el-table-column label="预警类型" prop="warningTypeText" width="120" />
|
|
@@ -131,29 +136,29 @@
|
|
|
</el-tag>
|
|
</el-tag>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="发布时间" prop="publishTime" width="180" />
|
|
|
|
|
|
|
+ <el-table-column label="发布时间" width="180">
|
|
|
|
|
+ <template #default="scope">{{ formatDateTime(scope.row.publishTime) }}</template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="状态" width="100" align="center">
|
|
<el-table-column label="状态" width="100" align="center">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <el-tag :type="activeTab === 'TODO' ? 'danger' : 'success'">
|
|
|
|
|
- {{ activeTab === "TODO" ? "待办" : "已办" }}
|
|
|
|
|
|
|
+ <el-tag :type="getStatusTagType(scope.row.status)">
|
|
|
|
|
+ {{ getStatusText(scope.row.status) }}
|
|
|
</el-tag>
|
|
</el-tag>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" fixed="right" width="220" align="center">
|
|
|
|
|
|
|
+ <el-table-column label="操作" fixed="right" width="300" align="center">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<el-button link type="primary" @click.stop="handleViewDetail(scope.row)">查看详情</el-button>
|
|
<el-button link type="primary" @click.stop="handleViewDetail(scope.row)">查看详情</el-button>
|
|
|
<template v-if="activeTab === 'TODO'">
|
|
<template v-if="activeTab === 'TODO'">
|
|
|
- <el-button link type="warning" @click.stop="openUpgradeDialog(scope.row)">升级</el-button>
|
|
|
|
|
- <el-button link type="success" @click.stop="openResolveDialog(scope.row)">解除</el-button>
|
|
|
|
|
- <el-button link type="danger" @click.stop="openReturnDialog(scope.row)">退回</el-button>
|
|
|
|
|
|
|
+ <WarningWorkflowActions :row="scope.row" @changed="refreshLists" />
|
|
|
</template>
|
|
</template>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
<pagination
|
|
<pagination
|
|
|
- v-show="filteredList.length > 0"
|
|
|
|
|
- :total="filteredList.length"
|
|
|
|
|
|
|
+ v-show="currentTotal > 0"
|
|
|
|
|
+ :total="currentTotal"
|
|
|
v-model:page="pagination.pageNum"
|
|
v-model:page="pagination.pageNum"
|
|
|
v-model:limit="pagination.pageSize"
|
|
v-model:limit="pagination.pageSize"
|
|
|
@pagination="handlePageChange"
|
|
@pagination="handlePageChange"
|
|
@@ -161,6 +166,7 @@
|
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
|
|
|
<el-drawer v-model="detailVisible" title="预警详情" size="760px" append-to-body direction="rtl" class="detail-drawer">
|
|
<el-drawer v-model="detailVisible" title="预警详情" size="760px" append-to-body direction="rtl" class="detail-drawer">
|
|
|
|
|
+ <el-alert v-if="activeTab === 'NOTICE' && selectedNotice" :title="selectedNotice" type="info" :closable="false" style="margin-bottom: 16px" />
|
|
|
<template v-if="detailData.basicInfo">
|
|
<template v-if="detailData.basicInfo">
|
|
|
<el-descriptions :column="2" border>
|
|
<el-descriptions :column="2" border>
|
|
|
<el-descriptions-item label="预警名称">{{ detailBasic.warningName || "-" }}</el-descriptions-item>
|
|
<el-descriptions-item label="预警名称">{{ detailBasic.warningName || "-" }}</el-descriptions-item>
|
|
@@ -172,7 +178,7 @@
|
|
|
<el-descriptions-item label="发布人">{{ detailBasic.publisher || "-" }}</el-descriptions-item>
|
|
<el-descriptions-item label="发布人">{{ detailBasic.publisher || "-" }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="权属单位">{{ detailBasic.ownershipUnit || "-" }}</el-descriptions-item>
|
|
<el-descriptions-item label="权属单位">{{ detailBasic.ownershipUnit || "-" }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="报警位置" :span="2">{{ detailBasic.location || "-" }}</el-descriptions-item>
|
|
<el-descriptions-item label="报警位置" :span="2">{{ detailBasic.location || "-" }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="发布时间">{{ detailBasic.publishTime || "-" }}</el-descriptions-item>
|
|
|
|
|
|
|
+ <el-descriptions-item label="发布时间">{{ formatDateTime(detailBasic.publishTime) }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="经纬度">{{ detailBasic.longitude || "-" }} / {{ detailBasic.latitude || "-" }}</el-descriptions-item>
|
|
<el-descriptions-item label="经纬度">{{ detailBasic.longitude || "-" }} / {{ detailBasic.latitude || "-" }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="预警内容" :span="2">{{ detailBasic.warningContent || "-" }}</el-descriptions-item>
|
|
<el-descriptions-item label="预警内容" :span="2">{{ detailBasic.warningContent || "-" }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="备注" :span="2">{{ detailBasic.remark || "-" }}</el-descriptions-item>
|
|
<el-descriptions-item label="备注" :span="2">{{ detailBasic.remark || "-" }}</el-descriptions-item>
|
|
@@ -192,55 +198,17 @@
|
|
|
<el-timeline-item
|
|
<el-timeline-item
|
|
|
v-for="(item, index) in detailData.disposalHistory"
|
|
v-for="(item, index) in detailData.disposalHistory"
|
|
|
:key="index"
|
|
:key="index"
|
|
|
- :timestamp="item.createTime || item.disposalTime || '-'"
|
|
|
|
|
|
|
+ :timestamp="formatDateTime(item.createTime || item.create_time || item.disposalTime || item.disposal_time)"
|
|
|
>
|
|
>
|
|
|
- {{ item.disposalContent || item.content || "-" }}
|
|
|
|
|
|
|
+ {{ item.disposalTypeName || item.disposal_type_name || item.disposalType || item.disposal_type || "处置记录" }}
|
|
|
|
|
+ <span v-if="item.disposalContent || item.disposal_content || item.content">:{{ item.disposalContent || item.disposal_content || item.content }}</span>
|
|
|
|
|
+ <span v-if="item.disposalUser || item.disposal_user">({{ item.disposalUser || item.disposal_user }})</span>
|
|
|
</el-timeline-item>
|
|
</el-timeline-item>
|
|
|
</el-timeline>
|
|
</el-timeline>
|
|
|
<el-empty v-else description="暂无处置记录" />
|
|
<el-empty v-else description="暂无处置记录" />
|
|
|
</template>
|
|
</template>
|
|
|
</el-drawer>
|
|
</el-drawer>
|
|
|
|
|
|
|
|
- <!-- 预警升级对话框 -->
|
|
|
|
|
- <el-dialog v-model="upgradeDialog.visible" title="预警升级" width="500px" append-to-body>
|
|
|
|
|
- <el-form label-width="100px">
|
|
|
|
|
- <el-form-item label="预警名称">
|
|
|
|
|
- <el-input :model-value="upgradeDialog.row?.warningName || '-'" disabled />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="当前级别">
|
|
|
|
|
- <el-tag :type="getLevelTagType(upgradeDialog.row?.warningLevel)">
|
|
|
|
|
- {{ upgradeDialog.row?.warningLevelText || "-" }}
|
|
|
|
|
- </el-tag>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="新预警级别" required>
|
|
|
|
|
- <el-select v-model="upgradeDialog.newLevel" placeholder="请选择新级别" style="width: 100%">
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in warningLevelOptions"
|
|
|
|
|
- :key="item.dictValue"
|
|
|
|
|
- :label="item.dictLabel"
|
|
|
|
|
- :value="item.dictValue"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="处置说明" required>
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="upgradeDialog.disposalContent"
|
|
|
|
|
- type="textarea"
|
|
|
|
|
- :rows="4"
|
|
|
|
|
- maxlength="500"
|
|
|
|
|
- show-word-limit
|
|
|
|
|
- placeholder="请输入处置说明"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-form>
|
|
|
|
|
- <template #footer>
|
|
|
|
|
- <div class="dialog-footer">
|
|
|
|
|
- <el-button @click="upgradeDialog.visible = false">取 消</el-button>
|
|
|
|
|
- <el-button type="primary" :loading="actionLoading" @click="confirmUpgrade">确 定</el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-dialog>
|
|
|
|
|
-
|
|
|
|
|
<!-- 预警解除对话框 -->
|
|
<!-- 预警解除对话框 -->
|
|
|
<el-dialog v-model="resolveDialog.visible" title="解除预警" width="500px" append-to-body>
|
|
<el-dialog v-model="resolveDialog.visible" title="解除预警" width="500px" append-to-body>
|
|
|
<el-form label-width="100px">
|
|
<el-form label-width="100px">
|
|
@@ -290,34 +258,33 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import { computed, onMounted, reactive, ref } from "vue";
|
|
import { computed, onMounted, reactive, ref } from "vue";
|
|
|
-import useUserStore from "@/store/modules/user";
|
|
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
-import { getAlertTypeDictionaryData, getTodoListData, getWarningDetailData, upgradeWarningData, resolveWarningData, returnWarningData } from "@/api/smxyjldczxt/yjxxfb/yjfb.js";
|
|
|
|
|
|
|
+import { parseTime } from "@/utils/ruoyi";
|
|
|
|
|
+import WarningWorkflowActions from "../WarningWorkflowActions.vue";
|
|
|
|
|
+import { warningStatusLabels } from "../warningWorkflow";
|
|
|
|
|
+import { getAlertTypeDictionaryData, getTodoListData, getWarningDetailData, readWarningNotification, resolveWarningData, returnWarningData } from "@/api/smxyjldczxt/yjxxfb/yjfb.js";
|
|
|
|
|
|
|
|
-const userStore = useUserStore();
|
|
|
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
|
const activeTab = ref("TODO");
|
|
const activeTab = ref("TODO");
|
|
|
const todoList = ref([]);
|
|
const todoList = ref([]);
|
|
|
const doneList = ref([]);
|
|
const doneList = ref([]);
|
|
|
|
|
+const noticeList = ref([]);
|
|
|
|
|
+const todoTotal = ref(0);
|
|
|
|
|
+const doneTotal = ref(0);
|
|
|
|
|
+const noticeTotal = ref(0);
|
|
|
const warningTypeOptions = ref([]);
|
|
const warningTypeOptions = ref([]);
|
|
|
const warningLevelOptions = ref([]);
|
|
const warningLevelOptions = ref([]);
|
|
|
-const warningStatusOptions = ref([]);
|
|
|
|
|
const detailVisible = ref(false);
|
|
const detailVisible = ref(false);
|
|
|
const detailData = ref({});
|
|
const detailData = ref({});
|
|
|
|
|
+const selectedNotice = ref("");
|
|
|
const actionLoading = ref(false);
|
|
const actionLoading = ref(false);
|
|
|
|
|
|
|
|
-const upgradeDialog = reactive({
|
|
|
|
|
- visible: false,
|
|
|
|
|
- row: null,
|
|
|
|
|
- newLevel: "",
|
|
|
|
|
- disposalContent: ""
|
|
|
|
|
-});
|
|
|
|
|
-
|
|
|
|
|
const resolveDialog = reactive({
|
|
const resolveDialog = reactive({
|
|
|
visible: false,
|
|
visible: false,
|
|
|
row: null,
|
|
row: null,
|
|
@@ -363,41 +330,23 @@ const warningLevelLabelMap = computed(() => {
|
|
|
}, {});
|
|
}, {});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const warningStatusLabelMap = computed(() => {
|
|
|
|
|
- return warningStatusOptions.value.reduce((acc, item) => {
|
|
|
|
|
- acc[item.dictValue] = item.dictLabel;
|
|
|
|
|
- return acc;
|
|
|
|
|
- }, {});
|
|
|
|
|
-});
|
|
|
|
|
|
|
+const currentList = computed(() => ({ TODO: todoList.value, DONE: doneList.value, NOTICE: noticeList.value })[activeTab.value] || []);
|
|
|
|
|
+const currentTotal = computed(() => ({ TODO: todoTotal.value, DONE: doneTotal.value, NOTICE: noticeTotal.value })[activeTab.value] || 0);
|
|
|
|
|
+const todoCount = computed(() => todoTotal.value);
|
|
|
|
|
+const doneCount = computed(() => doneTotal.value);
|
|
|
|
|
+const noticeCount = computed(() => noticeTotal.value);
|
|
|
|
|
|
|
|
-const currentList = computed(() => (activeTab.value === "TODO" ? todoList.value : doneList.value));
|
|
|
|
|
-const todoCount = computed(() => todoList.value.length);
|
|
|
|
|
-const doneCount = computed(() => doneList.value.length);
|
|
|
|
|
-
|
|
|
|
|
-const filteredList = computed(() => {
|
|
|
|
|
- return currentList.value.filter((item) => {
|
|
|
|
|
- const publishTime = item.publishTime || "";
|
|
|
|
|
- const [start, end] = queryParams.dateRange || [];
|
|
|
|
|
- if (queryParams.warningName && !String(item.warningName || "").includes(queryParams.warningName)) return false;
|
|
|
|
|
- if (queryParams.warningNo && !String(item.warningNo || "").includes(queryParams.warningNo)) return false;
|
|
|
|
|
- if (queryParams.warningSpecial && !String(item.warningSpecial || "").includes(queryParams.warningSpecial)) return false;
|
|
|
|
|
- if (queryParams.warningType && item.warningType !== queryParams.warningType) return false;
|
|
|
|
|
- if (queryParams.warningLevel && item.warningLevel !== queryParams.warningLevel) return false;
|
|
|
|
|
- if (queryParams.handler && !String(item.handler || "").includes(queryParams.handler)) return false;
|
|
|
|
|
- if (queryParams.publisher && !String(item.publisher || "").includes(queryParams.publisher)) return false;
|
|
|
|
|
- if (queryParams.location && !String(item.location || "").includes(queryParams.location)) return false;
|
|
|
|
|
- if (queryParams.ownershipUnit && !String(item.ownershipUnit || "").includes(queryParams.ownershipUnit)) return false;
|
|
|
|
|
- if (queryParams.alarmCode && !item.alarmCodeList.some((code) => String(code).includes(queryParams.alarmCode))) return false;
|
|
|
|
|
- if (start && publishTime && publishTime < start) return false;
|
|
|
|
|
- if (end && publishTime && publishTime > end) return false;
|
|
|
|
|
- return true;
|
|
|
|
|
- });
|
|
|
|
|
-});
|
|
|
|
|
|
|
+const pagedList = computed(() => currentList.value);
|
|
|
|
|
|
|
|
-const pagedList = computed(() => {
|
|
|
|
|
- const start = (pagination.pageNum - 1) * pagination.pageSize;
|
|
|
|
|
- return filteredList.value.slice(start, start + pagination.pageSize);
|
|
|
|
|
-});
|
|
|
|
|
|
|
+function getStatusText(status) {
|
|
|
|
|
+ return warningStatusLabels[status] || status || "-";
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function getStatusTagType(status) {
|
|
|
|
|
+ if (status === "CLOSED") return "success";
|
|
|
|
|
+ if (status === "DRAFT" || status === "PENDING") return "info";
|
|
|
|
|
+ return "warning";
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const detailBasic = computed(() => {
|
|
const detailBasic = computed(() => {
|
|
|
const basic = detailData.value.basicInfo || {};
|
|
const basic = detailData.value.basicInfo || {};
|
|
@@ -421,6 +370,10 @@ const detailBasic = computed(() => {
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+function formatDateTime(value) {
|
|
|
|
|
+ return value ? parseTime(value) : "-";
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
function getLevelTagType(level) {
|
|
function getLevelTagType(level) {
|
|
|
return {
|
|
return {
|
|
|
"1": "danger",
|
|
"1": "danger",
|
|
@@ -430,81 +383,87 @@ function getLevelTagType(level) {
|
|
|
}[level] || "info";
|
|
}[level] || "info";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-async function ensureUserName() {
|
|
|
|
|
- if (userStore.name) {
|
|
|
|
|
- return userStore.name;
|
|
|
|
|
- }
|
|
|
|
|
- await userStore.getInfo();
|
|
|
|
|
- return userStore.name;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
async function loadDicts() {
|
|
async function loadDicts() {
|
|
|
- const [typeRes, levelRes, statusRes] = await Promise.all([
|
|
|
|
|
|
|
+ const [typeResult, levelResult] = await Promise.allSettled([
|
|
|
getAlertTypeDictionaryData({ dictType: "alert_type" }),
|
|
getAlertTypeDictionaryData({ dictType: "alert_type" }),
|
|
|
- getAlertTypeDictionaryData({ dictType: "alert_level" }),
|
|
|
|
|
- getAlertTypeDictionaryData({ dictType: "pre_alarm_status" })
|
|
|
|
|
|
|
+ getAlertTypeDictionaryData({ dictType: "alert_level" })
|
|
|
]);
|
|
]);
|
|
|
- warningTypeOptions.value = typeRes.rows || [];
|
|
|
|
|
- warningLevelOptions.value = levelRes.rows || [];
|
|
|
|
|
- warningStatusOptions.value = statusRes.rows || [];
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-async function enrichTodoRows(records) {
|
|
|
|
|
- const rows = await Promise.all(
|
|
|
|
|
- (records || []).map(async (item) => {
|
|
|
|
|
- const warningId = item.warningId || item.warning_id;
|
|
|
|
|
- const detailRes = await getWarningDetailData(warningId);
|
|
|
|
|
- const detail = detailRes.data || {};
|
|
|
|
|
- const basic = detail.basicInfo || {};
|
|
|
|
|
- const alarmList = detail.alarmList || [];
|
|
|
|
|
- const warningType = basic.warningType || basic.warning_type || item.warning_type || "";
|
|
|
|
|
- const warningLevel = basic.warningLevel || basic.warning_level || item.warning_level || "";
|
|
|
|
|
- return {
|
|
|
|
|
- todoId: item.todoId || item.todo_id,
|
|
|
|
|
- warningId,
|
|
|
|
|
- warningName: basic.warningName || basic.warning_name || item.warning_name || "",
|
|
|
|
|
- warningNo: basic.warningNo || basic.warning_no || "",
|
|
|
|
|
- warningSpecial: basic.warningSpecial || basic.warning_special || "",
|
|
|
|
|
- warningType,
|
|
|
|
|
- warningTypeText: warningTypeLabelMap.value[warningType] || warningType || "-",
|
|
|
|
|
- warningLevel,
|
|
|
|
|
- warningLevelText: warningLevelLabelMap.value[warningLevel] || warningLevel || "-",
|
|
|
|
|
- handler: basic.handler || item.handler || "",
|
|
|
|
|
- publisher: basic.publisher || item.publisher || "",
|
|
|
|
|
- location: basic.location || item.location || "",
|
|
|
|
|
- ownershipUnit: basic.ownershipUnit || basic.ownership_unit || item.ownership_unit || "",
|
|
|
|
|
- publishTime: basic.publishTime || basic.publish_time || item.publish_time || "",
|
|
|
|
|
- alarmCodeList: alarmList.map((alarm) => alarm.warning_code || alarm.warningCode || alarm.alarmId || alarm.alarm_id).filter(Boolean),
|
|
|
|
|
- detail
|
|
|
|
|
- };
|
|
|
|
|
- })
|
|
|
|
|
- );
|
|
|
|
|
- return rows;
|
|
|
|
|
|
|
+ if (typeResult.status === "fulfilled") {
|
|
|
|
|
+ warningTypeOptions.value = typeResult.value.rows || [];
|
|
|
|
|
+ }
|
|
|
|
|
+ if (levelResult.status === "fulfilled") {
|
|
|
|
|
+ warningLevelOptions.value = levelResult.value.rows || [];
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function enrichTodoRows(records) {
|
|
|
|
|
+ return (records || []).map(item => {
|
|
|
|
|
+ const warningType = item.warning_type || item.warningType || "";
|
|
|
|
|
+ const warningLevel = item.warning_level || item.warningLevel || "";
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ todoId: item.todo_id || item.todoId,
|
|
|
|
|
+ warningId: item.warning_id || item.warningId,
|
|
|
|
|
+ warningName: item.warning_name || item.warningName || "",
|
|
|
|
|
+ warningNo: item.warning_no || item.warningNo || "",
|
|
|
|
|
+ warningSpecial: item.warning_special || item.warningSpecial || "",
|
|
|
|
|
+ warningType,
|
|
|
|
|
+ warningTypeText: warningTypeLabelMap.value[warningType] || warningType || "-",
|
|
|
|
|
+ warningLevel,
|
|
|
|
|
+ warningLevelText: warningLevelLabelMap.value[warningLevel] || warningLevel || "-",
|
|
|
|
|
+ ownershipUnit: item.ownership_unit || item.ownershipUnit || "",
|
|
|
|
|
+ publishTime: item.publish_time || item.publishTime || "",
|
|
|
|
|
+ reviewer: item.reviewer || item.publisher || "",
|
|
|
|
|
+ alarmCodeList: String(item.alarm_numbers || item.alarmNumbers || "").split(",").filter(Boolean),
|
|
|
|
|
+ availableActions: item.availableActions || [],
|
|
|
|
|
+ todoType: item.todo_type || item.todoType,
|
|
|
|
|
+ actionType: item.action_type || item.actionType,
|
|
|
|
|
+ taskName: item.task_name || item.taskName || "",
|
|
|
|
|
+ readStatus: item.read_status || item.readStatus || ""
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async function loadTodoList(type) {
|
|
async function loadTodoList(type) {
|
|
|
- const userName = await ensureUserName();
|
|
|
|
|
|
|
+ const [startTime, endTime] = queryParams.dateRange || [];
|
|
|
const res = await getTodoListData({
|
|
const res = await getTodoListData({
|
|
|
- pageNum: 1,
|
|
|
|
|
- pageSize: 100,
|
|
|
|
|
- userName,
|
|
|
|
|
|
|
+ pageNum: pagination.pageNum,
|
|
|
|
|
+ pageSize: pagination.pageSize,
|
|
|
todoType: type,
|
|
todoType: type,
|
|
|
- warningName: queryParams.warningName || undefined
|
|
|
|
|
|
|
+ warningName: queryParams.warningName || undefined,
|
|
|
|
|
+ warningNo: queryParams.warningNo || undefined,
|
|
|
|
|
+ warningSpecial: queryParams.warningSpecial || undefined,
|
|
|
|
|
+ warningType: queryParams.warningType || undefined,
|
|
|
|
|
+ warningLevel: queryParams.warningLevel || undefined,
|
|
|
|
|
+ handler: queryParams.handler || undefined,
|
|
|
|
|
+ publisher: queryParams.publisher || undefined,
|
|
|
|
|
+ alarmCode: queryParams.alarmCode || undefined,
|
|
|
|
|
+ location: queryParams.location || undefined,
|
|
|
|
|
+ ownershipUnit: queryParams.ownershipUnit || undefined,
|
|
|
|
|
+ startTime: startTime || undefined,
|
|
|
|
|
+ endTime: endTime || undefined
|
|
|
});
|
|
});
|
|
|
- const records = res.data?.records || res.data || [];
|
|
|
|
|
- return enrichTodoRows(records);
|
|
|
|
|
|
|
+ const records = res.data?.records || [];
|
|
|
|
|
+ return { rows: enrichTodoRows(records), total: Number(res.data?.total || 0) };
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async function loadCurrentTabData() {
|
|
async function loadCurrentTabData() {
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
try {
|
|
try {
|
|
|
if (activeTab.value === "TODO") {
|
|
if (activeTab.value === "TODO") {
|
|
|
- todoList.value = await loadTodoList("TODO");
|
|
|
|
|
|
|
+ const result = await loadTodoList("TODO");
|
|
|
|
|
+ todoList.value = result.rows;
|
|
|
|
|
+ todoTotal.value = result.total;
|
|
|
} else {
|
|
} else {
|
|
|
- doneList.value = await loadTodoList("DONE");
|
|
|
|
|
|
|
+ const result = await loadTodoList(activeTab.value);
|
|
|
|
|
+ if (activeTab.value === "NOTICE") {
|
|
|
|
|
+ noticeList.value = result.rows;
|
|
|
|
|
+ noticeTotal.value = result.total;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ doneList.value = result.rows;
|
|
|
|
|
+ doneTotal.value = result.total;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- pagination.pageNum = 1;
|
|
|
|
|
- ElMessage.success("列表已刷新");
|
|
|
|
|
} finally {
|
|
} finally {
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
}
|
|
}
|
|
@@ -513,9 +472,19 @@ async function loadCurrentTabData() {
|
|
|
async function preloadCounts() {
|
|
async function preloadCounts() {
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
try {
|
|
try {
|
|
|
- const [todoRows, doneRows] = await Promise.all([loadTodoList("TODO"), loadTodoList("DONE")]);
|
|
|
|
|
- todoList.value = todoRows;
|
|
|
|
|
- doneList.value = doneRows;
|
|
|
|
|
|
|
+ const [todoResult, doneResult, noticeResult] = await Promise.allSettled([loadTodoList("TODO"), loadTodoList("DONE"), loadTodoList("NOTICE")]);
|
|
|
|
|
+ if (todoResult.status === "fulfilled") {
|
|
|
|
|
+ todoList.value = todoResult.value.rows;
|
|
|
|
|
+ todoTotal.value = todoResult.value.total;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (doneResult.status === "fulfilled") {
|
|
|
|
|
+ doneList.value = doneResult.value.rows;
|
|
|
|
|
+ doneTotal.value = doneResult.value.total;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (noticeResult.status === "fulfilled") {
|
|
|
|
|
+ noticeList.value = noticeResult.value.rows;
|
|
|
|
|
+ noticeTotal.value = noticeResult.value.total;
|
|
|
|
|
+ }
|
|
|
} finally {
|
|
} finally {
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
}
|
|
}
|
|
@@ -523,6 +492,7 @@ async function preloadCounts() {
|
|
|
|
|
|
|
|
function handleQuery() {
|
|
function handleQuery() {
|
|
|
pagination.pageNum = 1;
|
|
pagination.pageNum = 1;
|
|
|
|
|
+ refreshLists();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function resetQuery() {
|
|
function resetQuery() {
|
|
@@ -538,26 +508,35 @@ function resetQuery() {
|
|
|
queryParams.ownershipUnit = "";
|
|
queryParams.ownershipUnit = "";
|
|
|
queryParams.dateRange = [];
|
|
queryParams.dateRange = [];
|
|
|
pagination.pageNum = 1;
|
|
pagination.pageNum = 1;
|
|
|
|
|
+ refreshLists();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function handlePageChange() {
|
|
function handlePageChange() {
|
|
|
- // pagination component sync only
|
|
|
|
|
|
|
+ loadCurrentTabData();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function handleTabChange() {
|
|
function handleTabChange() {
|
|
|
pagination.pageNum = 1;
|
|
pagination.pageNum = 1;
|
|
|
|
|
+ loadCurrentTabData();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function handleViewDetail(row) {
|
|
|
|
|
- detailData.value = row.detail || {};
|
|
|
|
|
- detailVisible.value = true;
|
|
|
|
|
|
|
+async function refreshLists() {
|
|
|
|
|
+ await preloadCounts();
|
|
|
|
|
+ if (pagination.pageNum > 1 && currentList.value.length === 0) {
|
|
|
|
|
+ pagination.pageNum = Math.max(1, Math.ceil(currentTotal.value / pagination.pageSize));
|
|
|
|
|
+ await preloadCounts();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function openUpgradeDialog(row) {
|
|
|
|
|
- upgradeDialog.row = row;
|
|
|
|
|
- upgradeDialog.newLevel = "";
|
|
|
|
|
- upgradeDialog.disposalContent = "";
|
|
|
|
|
- upgradeDialog.visible = true;
|
|
|
|
|
|
|
+async function handleViewDetail(row) {
|
|
|
|
|
+ const res = await getWarningDetailData(row.warningId);
|
|
|
|
|
+ detailData.value = res.data || {};
|
|
|
|
|
+ selectedNotice.value = activeTab.value === "NOTICE" ? row.taskName : "";
|
|
|
|
|
+ detailVisible.value = true;
|
|
|
|
|
+ if (activeTab.value === "NOTICE" && row.readStatus !== "READ") {
|
|
|
|
|
+ await readWarningNotification(row.todoId);
|
|
|
|
|
+ row.readStatus = "READ";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function openResolveDialog(row) {
|
|
function openResolveDialog(row) {
|
|
@@ -572,34 +551,6 @@ function openReturnDialog(row) {
|
|
|
returnDialog.visible = true;
|
|
returnDialog.visible = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-async function confirmUpgrade() {
|
|
|
|
|
- if (!upgradeDialog.newLevel) {
|
|
|
|
|
- ElMessage.warning("请选择新预警级别");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- if (!upgradeDialog.disposalContent) {
|
|
|
|
|
- ElMessage.warning("请输入处置说明");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- actionLoading.value = true;
|
|
|
|
|
- try {
|
|
|
|
|
- const res = await upgradeWarningData({
|
|
|
|
|
- warningId: upgradeDialog.row.warningId,
|
|
|
|
|
- newLevel: upgradeDialog.newLevel,
|
|
|
|
|
- disposalContent: upgradeDialog.disposalContent
|
|
|
|
|
- });
|
|
|
|
|
- if (res.code === 200) {
|
|
|
|
|
- ElMessage.success("升级成功");
|
|
|
|
|
- upgradeDialog.visible = false;
|
|
|
|
|
- await loadCurrentTabData();
|
|
|
|
|
- } else {
|
|
|
|
|
- ElMessage.error(res.msg || "升级失败");
|
|
|
|
|
- }
|
|
|
|
|
- } finally {
|
|
|
|
|
- actionLoading.value = false;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
async function confirmResolve() {
|
|
async function confirmResolve() {
|
|
|
if (!resolveDialog.disposalContent) {
|
|
if (!resolveDialog.disposalContent) {
|
|
|
ElMessage.warning("请输入处置说明");
|
|
ElMessage.warning("请输入处置说明");
|
|
@@ -614,7 +565,7 @@ async function confirmResolve() {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
ElMessage.success("解除成功");
|
|
ElMessage.success("解除成功");
|
|
|
resolveDialog.visible = false;
|
|
resolveDialog.visible = false;
|
|
|
- await loadCurrentTabData();
|
|
|
|
|
|
|
+ await refreshLists();
|
|
|
} else {
|
|
} else {
|
|
|
ElMessage.error(res.msg || "解除失败");
|
|
ElMessage.error(res.msg || "解除失败");
|
|
|
}
|
|
}
|
|
@@ -637,7 +588,7 @@ async function confirmReturn() {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
ElMessage.success("退回成功");
|
|
ElMessage.success("退回成功");
|
|
|
returnDialog.visible = false;
|
|
returnDialog.visible = false;
|
|
|
- await loadCurrentTabData();
|
|
|
|
|
|
|
+ await refreshLists();
|
|
|
} else {
|
|
} else {
|
|
|
ElMessage.error(res.msg || "退回失败");
|
|
ElMessage.error(res.msg || "退回失败");
|
|
|
}
|
|
}
|