2026-03-18 11:07:40 +08:00
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<!-- 搜索 -->
|
|
|
|
|
<div ref="searchBox" class="mt10">
|
|
|
|
|
<Search :searchArr="searchConfiger" @submit="onSearch">
|
2026-04-07 11:12:09 +08:00
|
|
|
<el-button type="primary" size="small" @click="handleAdd('add', null)"
|
|
|
|
|
>添加规则</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button type="danger" size="small" @click="handleRow()"
|
|
|
|
|
>批量删除</el-button
|
|
|
|
|
>
|
2026-03-18 11:07:40 +08:00
|
|
|
</Search>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 按钮组 -->
|
|
|
|
|
<div class="content">
|
|
|
|
|
<!-- 表格 -->
|
|
|
|
|
<div class="margTop">
|
2026-04-07 11:12:09 +08:00
|
|
|
<MyTable
|
|
|
|
|
:tableData="pageData.tableData"
|
|
|
|
|
:tableColumn="pageData.tableColumn"
|
|
|
|
|
:tableHeight="pageData.tableHeight"
|
|
|
|
|
:key="pageData.keyCount"
|
|
|
|
|
:tableConfiger="pageData.tableConfiger"
|
|
|
|
|
:controlsWidth="pageData.controlsWidth"
|
|
|
|
|
@chooseData="handleChooseData"
|
|
|
|
|
>
|
2026-03-18 11:07:40 +08:00
|
|
|
<template #jqdjdm="{ row }">
|
2026-04-07 11:12:09 +08:00
|
|
|
<DictTag
|
|
|
|
|
:options="D_BZ_JQDJ"
|
|
|
|
|
:tag="false"
|
|
|
|
|
:value="row.jqdjdm"
|
|
|
|
|
></DictTag>
|
2026-03-18 11:07:40 +08:00
|
|
|
</template>
|
|
|
|
|
<template #jqzldm="{ row }">
|
|
|
|
|
{{ getJqName(row.jqzldm) }}
|
|
|
|
|
</template>
|
|
|
|
|
<!-- 操作 -->
|
|
|
|
|
<template #controls="{ row }">
|
2026-04-07 11:12:09 +08:00
|
|
|
<el-link type="primary" size="small" @click="handleGljq(row)"
|
|
|
|
|
>关联警情</el-link
|
|
|
|
|
>
|
|
|
|
|
<el-link type="primary" size="small" @click="handleAdd('edit', row)"
|
|
|
|
|
>编辑</el-link
|
|
|
|
|
>
|
|
|
|
|
<el-link
|
|
|
|
|
type="primary"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="handleAdd('detail', row)"
|
|
|
|
|
>详情</el-link
|
|
|
|
|
>
|
|
|
|
|
<el-link type="danger" size="small" @click="handleRow(row.id)"
|
|
|
|
|
>删除</el-link
|
|
|
|
|
>
|
2026-03-18 11:07:40 +08:00
|
|
|
</template>
|
|
|
|
|
</MyTable>
|
2026-04-07 11:12:09 +08:00
|
|
|
<Pages
|
|
|
|
|
@changeNo="changeNo"
|
|
|
|
|
@changeSize="changeSize"
|
|
|
|
|
:tableHeight="pageData.tableHeight"
|
|
|
|
|
:pageConfiger="{
|
|
|
|
|
...pageData.pageConfiger,
|
|
|
|
|
total: pageData.total
|
|
|
|
|
}"
|
|
|
|
|
></Pages>
|
2026-03-18 11:07:40 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<AddForm ref="addForm" @getList="getList" :dict="{ D_BZ_JQDJ, jqTree }" />
|
2026-04-07 11:12:09 +08:00
|
|
|
<GljqLod v-model="gljqShow" :dict="{ D_GS_BQ_DJ, JQLB }" :zdsjLod="zdsjLod" />
|
2026-03-18 11:07:40 +08:00
|
|
|
</template>
|
|
|
|
|
<script setup>
|
|
|
|
|
import MyTable from "@/components/aboutTable/MyTable.vue";
|
|
|
|
|
import Pages from "@/components/aboutTable/Pages.vue";
|
|
|
|
|
import Search from "@/components/aboutTable/Search.vue";
|
|
|
|
|
import { qcckGet, qcckPost, qcckDelete } from "@/api/qcckApi.js";
|
|
|
|
|
import { reactive, ref, onMounted, getCurrentInstance } from "vue";
|
|
|
|
|
import GljqLod from "./gljqLod.vue";
|
|
|
|
|
import AddForm from "./addForm.vue";
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
2026-04-07 11:12:09 +08:00
|
|
|
const { D_BZ_JQDJ, D_GS_BQ_DJ, JQLB } = proxy.$dict(
|
|
|
|
|
"D_BZ_JQDJ",
|
|
|
|
|
"D_GS_BQ_DJ",
|
|
|
|
|
"JQLB"
|
|
|
|
|
);
|
2026-03-18 11:07:40 +08:00
|
|
|
const searchBox = ref(); //搜索框
|
|
|
|
|
const searchConfiger = ref([
|
|
|
|
|
{
|
|
|
|
|
label: "内容关键字",
|
|
|
|
|
prop: "jqgjz",
|
|
|
|
|
placeholder: "请输入警情内容关键字",
|
2026-04-07 11:12:09 +08:00
|
|
|
showType: "input"
|
2026-03-18 11:07:40 +08:00
|
|
|
},
|
|
|
|
|
{
|
2026-04-07 11:12:09 +08:00
|
|
|
label: "监测时间",
|
2026-03-18 11:07:40 +08:00
|
|
|
prop: "startTime",
|
2026-04-07 11:12:09 +08:00
|
|
|
placeholder: "请选择监测时间",
|
|
|
|
|
showType: "datetimerange"
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-03-18 11:07:40 +08:00
|
|
|
label: "警情等级",
|
|
|
|
|
prop: "jqdjdm",
|
|
|
|
|
placeholder: "请选择警情等级",
|
|
|
|
|
showType: "select",
|
2026-04-07 11:12:09 +08:00
|
|
|
options: D_BZ_JQDJ
|
2026-03-18 11:07:40 +08:00
|
|
|
}
|
|
|
|
|
]);
|
|
|
|
|
const queryFrom = ref({});
|
|
|
|
|
const pageData = reactive({
|
|
|
|
|
tableData: [], //表格数据
|
|
|
|
|
keyCount: 0,
|
|
|
|
|
tableConfiger: {
|
|
|
|
|
rowHieght: 61,
|
|
|
|
|
showSelectType: "checkbox", //选择类型
|
|
|
|
|
loading: false
|
|
|
|
|
},
|
|
|
|
|
total: 0,
|
|
|
|
|
pageConfiger: {
|
|
|
|
|
pageSize: 20,
|
|
|
|
|
pageCurrent: 1
|
|
|
|
|
}, //分页
|
|
|
|
|
controlsWidth: 250, //操作栏宽度
|
|
|
|
|
tableColumn: [
|
|
|
|
|
{ label: "规则描述", prop: "gzms", showOverflowTooltip: true },
|
|
|
|
|
{ label: "内容关键字", prop: "jqgjz", showOverflowTooltip: true },
|
2026-04-07 11:12:09 +08:00
|
|
|
{
|
|
|
|
|
label: "警情等级",
|
|
|
|
|
prop: "jqdjdm",
|
|
|
|
|
showOverflowTooltip: true,
|
|
|
|
|
showSolt: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "警情类型",
|
|
|
|
|
prop: "jqzldm",
|
|
|
|
|
showOverflowTooltip: true,
|
|
|
|
|
showSolt: true
|
|
|
|
|
},
|
2026-03-18 11:07:40 +08:00
|
|
|
{ label: "录入人姓名", prop: "lrrXm", showOverflowTooltip: true },
|
|
|
|
|
{ label: "录入人身份证号", prop: "lrrSfzh", showOverflowTooltip: true },
|
2026-04-07 11:12:09 +08:00
|
|
|
{ label: "所属部门", prop: "ssbm" }
|
2026-03-18 11:07:40 +08:00
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
2026-04-07 11:12:09 +08:00
|
|
|
getJqTree();
|
2026-03-18 11:07:40 +08:00
|
|
|
getList();
|
|
|
|
|
tabHeightFn();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 搜索
|
|
|
|
|
const onSearch = (val) => {
|
|
|
|
|
queryFrom.value = {
|
|
|
|
|
...val,
|
2026-04-07 11:12:09 +08:00
|
|
|
kssj: val.startTime ? val.startTime[0] : "",
|
|
|
|
|
jssj: val.startTime ? val.startTime[1] : ""
|
2026-03-18 11:07:40 +08:00
|
|
|
};
|
|
|
|
|
pageData.pageConfiger.pageCurrent = 1;
|
|
|
|
|
getList();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const changeNo = (val) => {
|
|
|
|
|
pageData.pageConfiger.pageCurrent = val;
|
|
|
|
|
getList();
|
|
|
|
|
};
|
|
|
|
|
const changeSize = (val) => {
|
|
|
|
|
pageData.pageConfiger.pageSize = val;
|
|
|
|
|
getList();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 获取列表
|
|
|
|
|
const getList = () => {
|
|
|
|
|
const promes = {
|
|
|
|
|
...pageData.pageConfiger,
|
2026-04-07 11:12:09 +08:00
|
|
|
...queryFrom.value
|
|
|
|
|
};
|
|
|
|
|
qcckGet(promes, "/mosty-gsxt/jqjczg/getPageList")
|
|
|
|
|
.then((res) => {
|
|
|
|
|
pageData.tableData = res.records || [];
|
|
|
|
|
pageData.total = res.total;
|
|
|
|
|
pageData.tableConfiger.loading = false;
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
pageData.tableConfiger.loading = false;
|
|
|
|
|
});
|
2026-03-18 11:07:40 +08:00
|
|
|
};
|
|
|
|
|
// 获取警情树
|
|
|
|
|
|
2026-04-07 11:12:09 +08:00
|
|
|
const jqTree = ref([]);
|
2026-03-18 11:07:40 +08:00
|
|
|
const getJqTree = () => {
|
|
|
|
|
qcckGet({}, "/mosty-gsxt/lzJcjPjdb/getDictTree").then((res) => {
|
2026-04-07 11:12:09 +08:00
|
|
|
jqTree.value = res;
|
2026-03-18 11:07:40 +08:00
|
|
|
});
|
2026-04-07 11:12:09 +08:00
|
|
|
};
|
2026-03-18 11:07:40 +08:00
|
|
|
|
|
|
|
|
// 根据值获取警情名称
|
|
|
|
|
const getJqName = (value) => {
|
|
|
|
|
if (!value || !jqTree.value || jqTree.value.length === 0) {
|
2026-04-07 11:12:09 +08:00
|
|
|
return value || "";
|
2026-03-18 11:07:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const findName = (tree, targetValue) => {
|
|
|
|
|
for (const node of tree) {
|
|
|
|
|
if (node.dm === targetValue) {
|
|
|
|
|
return node.zdmc;
|
|
|
|
|
}
|
|
|
|
|
if (node.itemList && node.itemList.length > 0) {
|
|
|
|
|
const result = findName(node.itemList, targetValue);
|
|
|
|
|
if (result) {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const name = findName(jqTree.value, value);
|
|
|
|
|
return name || value;
|
|
|
|
|
};
|
|
|
|
|
// 删除
|
2026-04-07 11:12:09 +08:00
|
|
|
const ids = ref([]);
|
2026-03-18 11:07:40 +08:00
|
|
|
const handleChooseData = (val) => {
|
2026-04-07 11:12:09 +08:00
|
|
|
ids.value = val.map((item) => item.id);
|
|
|
|
|
};
|
2026-03-18 11:07:40 +08:00
|
|
|
const handleRow = (id) => {
|
|
|
|
|
const promes = {
|
|
|
|
|
ids: id ? [id] : ids.value
|
2026-04-07 11:12:09 +08:00
|
|
|
};
|
2026-03-18 11:07:40 +08:00
|
|
|
proxy.$confirm("确定要删除?", "警告", { type: "warning" }).then(() => {
|
|
|
|
|
qcckDelete(promes, "/mosty-gsxt/jqjczg/deleteEntity").then(() => {
|
|
|
|
|
proxy.$message({ type: "success", message: "删除成功" });
|
|
|
|
|
getList();
|
|
|
|
|
});
|
2026-04-07 11:12:09 +08:00
|
|
|
});
|
2026-03-18 11:07:40 +08:00
|
|
|
};
|
|
|
|
|
// 值班操作
|
|
|
|
|
const addForm = ref(null);
|
|
|
|
|
const handleAdd = (type, row) => {
|
|
|
|
|
addForm.value.init(type, row);
|
|
|
|
|
};
|
|
|
|
|
// 关联警情
|
2026-04-07 11:12:09 +08:00
|
|
|
const gljqShow = ref(false);
|
|
|
|
|
const zdsjLod = ref();
|
2026-03-18 11:07:40 +08:00
|
|
|
const handleGljq = (row) => {
|
2026-04-07 11:12:09 +08:00
|
|
|
gljqShow.value = true;
|
|
|
|
|
zdsjLod.value = row;
|
|
|
|
|
};
|
2026-03-18 11:07:40 +08:00
|
|
|
|
|
|
|
|
// 表格高度计算
|
|
|
|
|
const tabHeightFn = () => {
|
2026-04-07 11:12:09 +08:00
|
|
|
pageData.tableHeight =
|
|
|
|
|
window.innerHeight - searchBox.value.offsetHeight - 220;
|
2026-03-18 11:07:40 +08:00
|
|
|
window.onresize = function () {
|
|
|
|
|
tabHeightFn();
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.el-loading-mask {
|
|
|
|
|
background: rgba(0, 0, 0, 0.5) !important;
|
|
|
|
|
}
|
|
|
|
|
</style>
|