定位管理

pull/1/head
LiuJiaNan 2024-02-23 16:54:19 +08:00
parent dd513a4120
commit ff65a74e6d
8 changed files with 387 additions and 170 deletions

View File

@ -406,3 +406,7 @@
--el-notification-close-hover-color: #000 !important; --el-notification-close-hover-color: #000 !important;
} }
} }
.el-color-predefine__color-selector.selected {
--el-color-primary: #fff !important;
}

View File

@ -0,0 +1,9 @@
<template>
<index-view type="3" />
</template>
<script setup>
import IndexView from "@/views/map_settings/assignment_ticket_area_settings/index.vue";
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,9 @@
<template>
<index-view is-gathering-alarm="1" />
</template>
<script setup>
import IndexView from "@/views/alarm_configuration/other_alarm_configurations/index.vue";
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,9 @@
<template>
<index-view type="2" />
</template>
<script setup>
import IndexView from "@/views/map_settings/assignment_ticket_area_settings/index.vue";
</script>
<style scoped lang="scss"></style>

View File

@ -11,6 +11,7 @@
<el-input v-model="form.eleName" /> <el-input v-model="form.eleName" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<template v-if="isGatheringAlarm === '0'">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="所属图层" prop="regId"> <el-form-item label="所属图层" prop="regId">
<el-select v-model="form.regId" filterable multiple> <el-select v-model="form.regId" filterable multiple>
@ -50,17 +51,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="围栏颜色" prop="color"> <el-form-item label="围栏颜色" prop="color">
<el-color-picker <el-color-picker v-model="form.color" :predefine="predefine" />
v-model="form.color"
:predefine="[
'#ff1900',
'#ff8c00',
'#fff200',
'#006aff',
'#00ff1e',
'#000000',
]"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<template v-if="form.eleType.includes('1')"> <template v-if="form.eleType.includes('1')">
@ -127,7 +118,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="最大人数" prop="overNum"> <el-form-item label="最大人数" prop="overNum">
<el-input v-model="form.overNum" /> <el-input v-model.number="form.overNum" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</template> </template>
@ -149,7 +140,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="最小人数" prop="lackNum"> <el-form-item label="最小人数" prop="lackNum">
<el-input v-model="form.lackNum" /> <el-input v-model.number="form.lackNum" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</template> </template>
@ -199,6 +190,102 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</template> </template>
</template>
<template v-if="isGatheringAlarm === '1'">
<el-col :span="12">
<el-form-item label="聚集告警区域" prop="regGatherId">
<el-select v-model="form.regGatherId" multiple>
<el-option
v-for="item in clusterAlarmAreaList"
:key="item.id"
:label="`${item.regName}${item.layName}`"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="围栏颜色" prop="gatherColor">
<el-color-picker
v-model="form.gatherColor"
:predefine="predefine"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="聚集静默区域" prop="regId">
<el-select v-model="form.regId" multiple>
<el-option
v-for="item in gatheringSilentAreasList"
:key="item.id"
:label="`${item.regName}${item.layName}`"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="围栏颜色" prop="color">
<el-color-picker v-model="form.color" :predefine="predefine" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="聚集半径(米)" prop="triggerRadius">
<el-input v-model.number="form.triggerRadius" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="聚集时间(秒)" prop="eleTimeGather">
<el-select v-model="form.eleTimeGather">
<el-option
v-for="item in timeList"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="一级聚集阈值" prop="gatherParameterA">
<el-input v-model.number="form.gatherParameterA" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="一级聚集颜色" prop="gatherParameterColorA">
<el-color-picker
v-model="form.gatherParameterColorA"
:predefine="predefine"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="二级聚集阈值" prop="gatherParameterB">
<el-input v-model.number="form.gatherParameterB" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="二级聚集颜色" prop="gatherParameterColorB">
<el-color-picker
v-model="form.gatherParameterColorB"
:predefine="predefine"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="三级聚集阈值" prop="gatherParameterC">
<el-input v-model.number="form.gatherParameterC" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="三级聚集颜色" prop="gatherParameterColorC">
<el-color-picker
v-model="form.gatherParameterColorC"
:predefine="predefine"
/>
</el-form-item>
</el-col>
</template>
</el-row> </el-row>
</el-form> </el-form>
<template #footer> <template #footer>
@ -236,6 +323,11 @@ const props = defineProps({
required: true, required: true,
default: "", default: "",
}, },
isGatheringAlarm: {
type: String,
required: true,
default: "",
},
}); });
const emits = defineEmits(["update:visible", "update:form", "get-data"]); const emits = defineEmits(["update:visible", "update:form", "get-data"]);
const { visible, form } = useVModels(props, emits); const { visible, form } = useVModels(props, emits);
@ -248,9 +340,23 @@ const alarmTypeList = [
{ id: "7", label: "越界报警" }, { id: "7", label: "越界报警" },
]; ];
const timeList = [10, 20, 30, 60, 120, 300, 600]; const timeList = [10, 20, 30, 60, 120, 300, 600];
const predefine = [
"#ff1900",
"#ff8c00",
"#fff200",
"#006aff",
"#00ff1e",
"#000000",
];
const rules = { const rules = {
eleName: [{ required: true, message: "请输入名称", trigger: "blur" }], eleName: [{ required: true, message: "请输入名称", trigger: "blur" }],
regId: [{ required: true, message: "请选择所属图层", trigger: "change" }], regId: [
{
required: props.isGatheringAlarm === "0",
message: "请选择所属图层",
trigger: "change",
},
],
eleType: [{ required: true, message: "请选择告警类型", trigger: "change" }], eleType: [{ required: true, message: "请选择告警类型", trigger: "change" }],
color: [{ required: true, message: "请选择围栏颜色", trigger: "change" }], color: [{ required: true, message: "请选择围栏颜色", trigger: "change" }],
resTime: [{ required: true, message: "请选择滞留时间", trigger: "change" }], resTime: [{ required: true, message: "请选择滞留时间", trigger: "change" }],
@ -275,18 +381,58 @@ const rules = {
eleTimeDept: [ eleTimeDept: [
{ required: true, message: "请选择告警间隔", trigger: "change" }, { required: true, message: "请选择告警间隔", trigger: "change" },
], ],
regGatherId: [
{ required: true, message: "请选择聚集告警区域", trigger: "change" },
],
gatherColor: [
{ required: true, message: "请选择围栏颜色", trigger: "change" },
],
triggerRadius: [
{ required: true, message: "请输入聚集半径", trigger: "blur" },
{ type: "number", message: "请输入数字", trigger: "blur" },
],
eleTimeGather: [
{ required: true, message: "请选择聚集时间", trigger: "change" },
],
gatherParameterA: [
{ required: true, message: "请输入一级聚集阈值", trigger: "blur" },
{ type: "number", message: "请输入数字", trigger: "blur" },
],
gatherParameterColorA: [
{ required: true, message: "请选择一级聚集颜色", trigger: "change" },
],
gatherParameterB: [
{ required: true, message: "请输入二级聚集阈值", trigger: "blur" },
{ type: "number", message: "请输入数字", trigger: "blur" },
],
gatherParameterColorB: [
{ required: true, message: "请选择二级聚集颜色", trigger: "change" },
],
gatherParameterC: [
{ required: true, message: "请输入三级聚集阈值", trigger: "blur" },
{ type: "number", message: "请输入数字", trigger: "blur" },
],
gatherParameterColorC: [
{ required: true, message: "请选择三级聚集颜色", trigger: "change" },
],
}; };
const formRef = ref(null); const formRef = ref(null);
const regionList = ref([]); const regionList = ref([]);
const fnGetRegionList = async () => { const clusterAlarmAreaList = ref([]);
const gatheringSilentAreasList = ref([]);
const fnGetRegionList = async (type) => {
const resData = await getAssignmentTicketAreaSettingsList({ const resData = await getAssignmentTicketAreaSettingsList({
currentPage: 1, currentPage: 1,
showCount: 99999, showCount: 99999,
type: 0, type,
}); });
regionList.value = resData.rows; if (type === 0) regionList.value = resData.rows;
if (type === 2) gatheringSilentAreasList.value = resData.rows;
if (type === 3) clusterAlarmAreaList.value = resData.rows;
}; };
fnGetRegionList(); props.isGatheringAlarm === "0" && fnGetRegionList(0);
props.isGatheringAlarm === "1" && fnGetRegionList(2);
props.isGatheringAlarm === "1" && fnGetRegionList(3);
const fnClose = () => { const fnClose = () => {
formRef.value.resetFields(); formRef.value.resetFields();
visible.value = false; visible.value = false;
@ -297,12 +443,13 @@ const fnSubmit = debounce(
await useFormValidate(formRef); await useFormValidate(formRef);
const params = { const params = {
...form.value, ...form.value,
isGatheringAlarm: props.isGatheringAlarm,
regId: JSON.stringify(form.value.regId), regId: JSON.stringify(form.value.regId),
eleType: JSON.stringify(form.value.eleType), eleType: JSON.stringify(form.value.eleType),
eleCrossed: JSON.stringify(form.value.eleCrossed), eleCrossed: JSON.stringify(form.value.eleCrossed),
eleDept: JSON.stringify(form.value.eleDept), eleDept: JSON.stringify(form.value.eleDept),
regGatherId: JSON.stringify(form.value.regGatherId),
}; };
console.log(params);
props.type === "add" props.type === "add"
? await setOtherAlarmConfigurationsAdd(params) ? await setOtherAlarmConfigurationsAdd(params)
: await setOtherAlarmConfigurationsEdit(params); : await setOtherAlarmConfigurationsEdit(params);

View File

@ -40,10 +40,12 @@
<el-table-column label="名称" prop="eleName" /> <el-table-column label="名称" prop="eleName" />
<el-table-column label="所属图层区域"> <el-table-column label="所属图层区域">
<template #default="{ row }"> <template #default="{ row }">
{{ row.regions.map((item) => item.regName).join("、") }} {{ row.regions?.map((item) => item.regName).join("、") }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="类型">其它告警</el-table-column> <el-table-column label="类型">
{{ typeList[isGatheringAlarm] }}
</el-table-column>
<el-table-column label="状态" width="100"> <el-table-column label="状态" width="100">
<template #default="{ row }"> <template #default="{ row }">
{{ row.status === "1" ? "停用" : "启用" }} {{ row.status === "1" ? "停用" : "启用" }}
@ -86,6 +88,7 @@
v-model:visible="data.addOrEditDialog.visible" v-model:visible="data.addOrEditDialog.visible"
v-model:form="data.addOrEditDialog.form" v-model:form="data.addOrEditDialog.form"
:type="data.addOrEditDialog.type" :type="data.addOrEditDialog.type"
:is-gathering-alarm="isGatheringAlarm"
@get-data="fnResetPagination" @get-data="fnResetPagination"
/> />
</div> </div>
@ -105,9 +108,20 @@ import {
import Add from "./components/add.vue"; import Add from "./components/add.vue";
import { nextTick, reactive } from "vue"; import { nextTick, reactive } from "vue";
const props = defineProps({
isGatheringAlarm: {
type: String,
required: true,
default: "0",
},
});
const typeList = {
0: "其它告警",
1: "聚集告警",
};
const { list, searchForm, tableRef, pagination, fnGetData, fnResetPagination } = const { list, searchForm, tableRef, pagination, fnGetData, fnResetPagination } =
useListData(getOtherAlarmConfigurationsList, { useListData(getOtherAlarmConfigurationsList, {
otherParams: { isGatheringAlarm: 0 }, otherParams: { isGatheringAlarm: props.isGatheringAlarm },
defaultSearchForm: { str: "" }, defaultSearchForm: { str: "" },
key: "rows", key: "rows",
}); });
@ -130,6 +144,16 @@ const data = reactive({
stillTime: "", stillTime: "",
eleTimeDept: "", eleTimeDept: "",
eleDept: [], eleDept: [],
regGatherId: [],
gatherColor: "#ff1900",
triggerRadius: "",
eleTimeGather: "",
gatherParameterA: "",
gatherParameterColorA: "#ff1900",
gatherParameterB: "",
gatherParameterColorB: "#ff8c00",
gatherParameterC: "",
gatherParameterColorC: "#fff200",
}, },
}, },
}); });
@ -177,6 +201,7 @@ const fnAddOrEdit = async (id, type) => {
if (type === "edit") { if (type === "edit") {
const resData = await getOtherAlarmConfigurationsView({ id }); const resData = await getOtherAlarmConfigurationsView({ id });
resData.data.regId = resData.data.regId.map(Number); resData.data.regId = resData.data.regId.map(Number);
resData.data.regGatherId = resData.data.regGatherId.map(Number);
data.addOrEditDialog.form = resData.data; data.addOrEditDialog.form = resData.data;
} }
}; };

View File

@ -8,7 +8,11 @@
<el-form-item label="名称" prop="regName"> <el-form-item label="名称" prop="regName">
<el-input v-model="form.regName" /> <el-input v-model="form.regName" />
</el-form-item> </el-form-item>
<el-form-item label="所属图层" prop="layId"> <el-form-item
v-if="queryType === '1' || queryType === '0'"
label="所属图层"
prop="layId"
>
<el-select v-model="form.layId" filterable> <el-select v-model="form.layId" filterable>
<el-option <el-option
v-for="item in selectRegionTreeVoList" v-for="item in selectRegionTreeVoList"
@ -72,7 +76,8 @@ const fnGetSelectRegionTreeVo = async () => {
const resData = await getSelectRegionTreeVo(); const resData = await getSelectRegionTreeVo();
selectRegionTreeVoList.value = resData.data; selectRegionTreeVoList.value = resData.data;
}; };
fnGetSelectRegionTreeVo(); (props.queryType === "1" || props.queryType === "0") &&
fnGetSelectRegionTreeVo();
const fnClose = () => { const fnClose = () => {
formRef.value.resetFields(); formRef.value.resetFields();
visible.value = false; visible.value = false;

View File

@ -38,10 +38,12 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="名称" prop="regName" /> <el-table-column label="名称" prop="regName" />
<el-table-column label="类型"> <el-table-column label="类型">{{ typeList[type] }}</el-table-column>
{{ type === 1 ? "作业票区域" : "告警区域" }} <el-table-column
</el-table-column> v-if="type === '1' || type === '0'"
<el-table-column label="所属图层" prop="layName" /> label="所属图层"
prop="layName"
/>
<el-table-column label="定位状态" width="100"> <el-table-column label="定位状态" width="100">
<template #default="{ row }"> <template #default="{ row }">
{{ row.list.length > 0 ? "已定位" : "未选点" }} {{ row.list.length > 0 ? "已定位" : "未选点" }}
@ -126,9 +128,16 @@ import SelectingPoints from "./components/selecting_points.vue";
const props = defineProps({ const props = defineProps({
type: { type: {
type: String, type: String,
required: true,
default: "1", default: "1",
}, },
}); });
const typeList = {
1: "作业票区域",
0: "告警区域",
3: "聚集告警区域",
2: "聚集静默区域",
};
const { list, searchForm, tableRef, pagination, fnGetData, fnResetPagination } = const { list, searchForm, tableRef, pagination, fnGetData, fnResetPagination } =
useListData(getAssignmentTicketAreaSettingsList, { useListData(getAssignmentTicketAreaSettingsList, {
otherParams: { type: props.type }, otherParams: { type: props.type },