聚集告警记录

pull/3/head
dearlin 2024-02-28 09:56:46 +08:00
parent 4bce1b3a71
commit 0ddaedd8bb
4 changed files with 167 additions and 7 deletions

View File

@ -2,6 +2,8 @@ import { post } from "@/request/axios.js";
export const getGatheringAlarmRecordsList = (params) => export const getGatheringAlarmRecordsList = (params) =>
post("/positAlarm/getAlarmRecordList", params); // 聚集告警记录列表 post("/positAlarm/getAlarmRecordList", params); // 聚集告警记录列表
export const getGatheringAlarmRecordViewList = (params) =>
post("/positAlarm/alarmRecordgoEdit", params); // 聚集告警记录详情
export const getAggregationAlarmTrend = (params) => export const getAggregationAlarmTrend = (params) =>
post("/positAlarm/aggregateAlarmTrends", params); // 聚集报警趋势 post("/positAlarm/aggregateAlarmTrends", params); // 聚集报警趋势
export const getAggregatedDataStatistics = (params) => export const getAggregatedDataStatistics = (params) =>

View File

@ -0,0 +1,134 @@
<template>
<el-dialog v-model="visible" title="详情" :on-close="fnClose" width="80%">
<el-form
:model="searchForm"
label-width="80px"
@submit.prevent="fnResetPaginationTransfer"
>
<el-row>
<el-col :span="6">
<el-form-item label="检查周期" prop="dates">
<el-date-picker
v-model="searchForm.dates"
type="datetimerange"
value-format="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD HH:mm:ss"
time-format="A hh:mm:ss"
range-separator="至"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="10px">
<el-button type="primary" native-type="submit">搜索</el-button>
<el-button native-type="reset" @click="fnResetPaginationTransfer">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<layout-card>
<layout-table
v-model:pagination="pagination"
:data="list"
@get-data="fnGetDataTransfer"
>
<el-table-column label="序号" width="70">
<template #default="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column label="聚集等级" prop="level">
<template #default="{ row }">
<span v-if="row.level === '1'"></span>
</template>
</el-table-column>
<el-table-column label="聚集人员" prop="psnName" />
<el-table-column label="时间" prop="alarmTime" />
<el-table-column label="操作">
<template #default="{ row }">
<el-button type="primary" text link @click="fnViewLocation(row)"
>查看位置</el-button
>
</template>
</el-table-column>
</layout-table>
</layout-card>
<template #footer>
<el-button @click="fnClose"></el-button>
<el-button type="primary" @click="fnSubmit"></el-button>
</template>
</el-dialog>
</template>
<script setup>
import { useVModels } from "@vueuse/core";
import { debounce } from "throttle-debounce";
import { ElMessage } from "element-plus";
import { serialNumber } from "@/assets/js/utils.js";
import useListData from "@/assets/js/useListData.js";
import { getGatheringAlarmRecordViewList } from "@/request/aggregation_management.js";
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
form: {
type: Object,
required: true,
default: () => ({}),
},
});
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
const { visible } = useVModels(props, emits);
const { list, searchForm, pagination, fnGetData, fnResetPagination } =
useListData(getGatheringAlarmRecordViewList, {
otherParams: {
gatherId: props.form.id,
STARTTIME: props.form.startTime,
ENDTIME: props.form.endTime,
},
key: "rows",
});
const fnClose = () => {
visible.value = false;
};
const fnGetDataTransfer = () => {
fnGetData({
STARTTIME: searchForm.value.dates[0]
? searchForm.value.dates[0]
: props.form.value.dates[0],
ENDTIME: searchForm.value.dates?.[1]
? searchForm.value.dates[1]
: props.form.value.dates[1],
gatherId: props.form.id,
});
};
const fnViewLocation = (row) => {
console.log(row);
// positAlarm/getAlarmGatherPsnInfo
};
const fnResetPaginationTransfer = () => {
fnResetPagination({
STARTTIME: searchForm.value.dates?.[0],
ENDTIME: searchForm.value.dates?.[1],
gatherId: props.form.id,
});
};
const fnSubmit = debounce(
1000,
async () => {
ElMessage.success("处理成功");
fnClose();
emits("get-data");
},
{ atBegin: true }
);
</script>
<style scoped lang="scss"></style>

View File

@ -34,30 +34,56 @@
{{ serialNumber(pagination, $index) }} {{ serialNumber(pagination, $index) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="聚集地点" prop="regName" /> <el-table-column label="状态" prop="status">
<el-table-column label="开始时间" prop="regName" /> <template #default="{ row }">
<el-table-column label="结束时间" prop="regName" /> {{ row.status === "1" ? "已处理" : "待处理" }}
<el-table-column label="状态" prop="regName" /> </template>
</el-table-column>
<el-table-column label="聚集地点" prop="layerGroup" />
<el-table-column label="开始时间" prop="startTime" />
<el-table-column label="结束时间" prop="endTime" />
<el-table-column label="操作" width="200"> <el-table-column label="操作" width="200">
<template #default="{ row }"> <template #default="{ row }">
{{ row }} <el-button type="primary" text link @click="fnShowInfo(row)"
>查看详情</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</layout-table> </layout-table>
</layout-card> </layout-card>
</div> </div>
<view-info
v-if="data.viewDialog.visible"
v-model:visible="data.viewDialog.visible"
v-model:form="data.viewDialog.form"
/>
</template> </template>
<script setup> <script setup>
import useListData from "@/assets/js/useListData.js"; import useListData from "@/assets/js/useListData.js";
import ViewInfo from "./components/viewInfo.vue";
import { serialNumber } from "@/assets/js/utils.js"; import { serialNumber } from "@/assets/js/utils.js";
import { getGatheringAlarmRecordsList } from "@/request/aggregation_management.js"; import { getGatheringAlarmRecordsList } from "@/request/aggregation_management.js";
import { reactive } from "vue";
const { list, searchForm, pagination, fnGetData, fnResetPagination } = const { list, searchForm, pagination, fnGetData, fnResetPagination } =
useListData(getGatheringAlarmRecordsList, { useListData(getGatheringAlarmRecordsList, {
otherParams: { status: "" }, otherParams: { status: "" },
key: "rows", key: "rows",
}); });
const data = reactive({
viewDialog: {
visible: false,
form: {
dates:[]
},
},
});
const fnShowInfo = (row) => {
data.viewDialog.visible = true;
data.viewDialog.form = row;
};
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>

View File

@ -148,11 +148,9 @@ import { ElMessage, ElMessageBox } from "element-plus";
import { nextTick, reactive } from "vue"; import { nextTick, reactive } from "vue";
import LayoutImportFile from "@/components/import_file/index.vue"; import LayoutImportFile from "@/components/import_file/index.vue";
import Add from "./components/add.vue"; import Add from "./components/add.vue";
// import { useRouter } from "vue-router";
import QrCode from "./components/qr_code.vue"; import QrCode from "./components/qr_code.vue";
import LayoutTooltipImg from "@/components/tooltip_img/index.vue"; import LayoutTooltipImg from "@/components/tooltip_img/index.vue";
import useButtonJurisdiction from "@/assets/js/useButtonJurisdiction.js"; import useButtonJurisdiction from "@/assets/js/useButtonJurisdiction.js";
// const router = useRouter();
const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } = const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } =
useListData(getIdentifyingPartsList); useListData(getIdentifyingPartsList);
const data = reactive({ const data = reactive({