|
@@ -21,12 +21,12 @@
|
|
|
</el-card>
|
|
</el-card>
|
|
|
<el-card shadow="hover" class="summary-card success">
|
|
<el-card shadow="hover" class="summary-card success">
|
|
|
<div class="summary-label">已关联</div>
|
|
<div class="summary-label">已关联</div>
|
|
|
- <div class="summary-value">{{ stats.linkedCount }}</div>
|
|
|
|
|
|
|
+ <div class="summary-value">{{ canViewRelations ? stats.linkedCount : '-' }}</div>
|
|
|
<div class="summary-desc">已建立报警与预警关联关系</div>
|
|
<div class="summary-desc">已建立报警与预警关联关系</div>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
<el-card shadow="hover" class="summary-card warning">
|
|
<el-card shadow="hover" class="summary-card warning">
|
|
|
<div class="summary-label">未关联</div>
|
|
<div class="summary-label">未关联</div>
|
|
|
- <div class="summary-value">{{ stats.unlinkedCount }}</div>
|
|
|
|
|
|
|
+ <div class="summary-value">{{ canViewRelations ? stats.unlinkedCount : '-' }}</div>
|
|
|
<div class="summary-desc">仍待人工选择预警进行关联</div>
|
|
<div class="summary-desc">仍待人工选择预警进行关联</div>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
<el-card shadow="hover" class="summary-card info">
|
|
<el-card shadow="hover" class="summary-card info">
|
|
@@ -62,7 +62,7 @@
|
|
|
<el-option label="已处理" :value="1" />
|
|
<el-option label="已处理" :value="1" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="关联状态">
|
|
|
|
|
|
|
+ <el-form-item v-if="canViewRelations" label="关联状态">
|
|
|
<el-select v-model="queryParams.associationStatus" placeholder="请选择关联状态" clearable style="width: 180px">
|
|
<el-select v-model="queryParams.associationStatus" placeholder="请选择关联状态" clearable style="width: 180px">
|
|
|
<el-option label="已关联" value="linked" />
|
|
<el-option label="已关联" value="linked" />
|
|
|
<el-option label="未关联" value="unlinked" />
|
|
<el-option label="未关联" value="unlinked" />
|
|
@@ -93,7 +93,8 @@
|
|
|
</el-table-column>
|
|
</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="scope.row.linkedWarning ? 'success' : 'info'">
|
|
|
|
|
|
|
+ <span v-if="!canViewRelations" class="empty-text">无查看权限</span>
|
|
|
|
|
+ <el-tag v-else :type="scope.row.linkedWarning ? 'success' : 'info'">
|
|
|
{{ scope.row.linkedWarning ? "已关联" : "未关联" }}
|
|
{{ scope.row.linkedWarning ? "已关联" : "未关联" }}
|
|
|
</el-tag>
|
|
</el-tag>
|
|
|
</template>
|
|
</template>
|
|
@@ -102,6 +103,7 @@
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<span
|
|
<span
|
|
|
v-if="scope.row.linkedWarning"
|
|
v-if="scope.row.linkedWarning"
|
|
|
|
|
+ v-hasPermi="['warning:warning:query']"
|
|
|
class="warning-link"
|
|
class="warning-link"
|
|
|
@click="openWarningDetail(scope.row.linkedWarning.warningId)"
|
|
@click="openWarningDetail(scope.row.linkedWarning.warningId)"
|
|
|
>
|
|
>
|
|
@@ -112,10 +114,10 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" fixed="right" width="220" align="center">
|
|
<el-table-column label="操作" fixed="right" width="220" align="center">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <el-button link type="primary" @click="openAssociationDialog(scope.row)" v-if="!scope.row.linkedWarning">
|
|
|
|
|
|
|
+ <el-button v-hasPermi="['warning:warning:edit']" link type="primary" @click="openAssociationDialog(scope.row)" v-if="!scope.row.linkedWarning && auth.hasPermi('warning:warning:query')">
|
|
|
关联预警
|
|
关联预警
|
|
|
</el-button>
|
|
</el-button>
|
|
|
- <el-button link type="success" @click="openWarningDetail(scope.row.linkedWarning.warningId)" v-if="scope.row.linkedWarning">
|
|
|
|
|
|
|
+ <el-button v-hasPermi="['warning:warning:query']" link type="success" @click="openWarningDetail(scope.row.linkedWarning.warningId)" v-if="scope.row.linkedWarning">
|
|
|
查看预警
|
|
查看预警
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-button link type="info" @click="openAlarmDetail(scope.row)">报警详情</el-button>
|
|
<el-button link type="info" @click="openAlarmDetail(scope.row)">报警详情</el-button>
|
|
@@ -132,7 +134,7 @@
|
|
|
/>
|
|
/>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
|
|
|
- <div class="batch-bar" v-if="selectedRows.length">
|
|
|
|
|
|
|
+ <div class="batch-bar" v-if="selectedRows.length && auth.hasPermi('warning:warning:query')" v-hasPermi="['warning:warning:edit']">
|
|
|
<span>已选择 {{ selectedRows.length }} 条报警</span>
|
|
<span>已选择 {{ selectedRows.length }} 条报警</span>
|
|
|
<el-button type="primary" @click="openBatchAssociationDialog">批量关联预警</el-button>
|
|
<el-button type="primary" @click="openBatchAssociationDialog">批量关联预警</el-button>
|
|
|
<el-button @click="selectedRows = []">清空选择</el-button>
|
|
<el-button @click="selectedRows = []">清空选择</el-button>
|
|
@@ -168,7 +170,7 @@
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
|
<el-button @click="associationDialog.visible = false">取 消</el-button>
|
|
<el-button @click="associationDialog.visible = false">取 消</el-button>
|
|
|
- <el-button type="primary" :loading="submitLoading" @click="confirmAssociation">确 定</el-button>
|
|
|
|
|
|
|
+ <el-button v-hasPermi="['warning:warning:edit']" type="primary" :loading="submitLoading" @click="confirmAssociation">确 定</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -192,7 +194,7 @@
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
|
<el-button @click="batchDialog.visible = false">取 消</el-button>
|
|
<el-button @click="batchDialog.visible = false">取 消</el-button>
|
|
|
- <el-button type="primary" :loading="submitLoading" @click="confirmBatchAssociation">确 定</el-button>
|
|
|
|
|
|
|
+ <el-button v-hasPermi="['warning:warning:edit']" type="primary" :loading="submitLoading" @click="confirmBatchAssociation">确 定</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -238,6 +240,7 @@
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import { computed, onMounted, reactive, ref } from "vue";
|
|
import { computed, onMounted, reactive, ref } from "vue";
|
|
|
|
|
+import auth from '@/plugins/auth';
|
|
|
import { ElMessage } from "element-plus";
|
|
import { ElMessage } from "element-plus";
|
|
|
import {
|
|
import {
|
|
|
getAlarmPageData,
|
|
getAlarmPageData,
|
|
@@ -255,6 +258,7 @@ const availableWarnings = ref([]);
|
|
|
const rawAlarmList = ref([]);
|
|
const rawAlarmList = ref([]);
|
|
|
const selectedRows = ref([]);
|
|
const selectedRows = ref([]);
|
|
|
const linkedAlarmMap = ref({});
|
|
const linkedAlarmMap = ref({});
|
|
|
|
|
+const canViewRelations = computed(() => auth.hasPermi('warning:warning:query'));
|
|
|
|
|
|
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
|
const warningDetailVisible = ref(false);
|
|
const warningDetailVisible = ref(false);
|
|
@@ -399,6 +403,10 @@ async function loadWarnings() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async function buildLinkedAlarmMap() {
|
|
async function buildLinkedAlarmMap() {
|
|
|
|
|
+ if (!auth.hasPermi('warning:warning:query')) {
|
|
|
|
|
+ linkedAlarmMap.value = {};
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
const map = {};
|
|
const map = {};
|
|
|
await Promise.all(
|
|
await Promise.all(
|
|
|
availableWarnings.value.map(async (warning) => {
|
|
availableWarnings.value.map(async (warning) => {
|