160 lines
4.3 KiB
Vue
160 lines
4.3 KiB
Vue
|
|
<template>
|
||
|
|
<div>
|
||
|
|
<div class="titleBox">
|
||
|
|
<PageTitle title="预警管理"> </PageTitle>
|
||
|
|
</div>
|
||
|
|
<!-- 表格 -->
|
||
|
|
<div ref="searchBox">
|
||
|
|
<Search :searchArr="searchConfiger" @submit="onSearch" />
|
||
|
|
</div>
|
||
|
|
<div class="tabBox">
|
||
|
|
<MyTable
|
||
|
|
:tableData="pageData.tableData"
|
||
|
|
:tableColumn="pageData.tableColumn"
|
||
|
|
:tableHeight="pageData.tableHeight"
|
||
|
|
:key="pageData.keyCount"
|
||
|
|
:tableConfiger="pageData.tableConfiger"
|
||
|
|
:controlsWidth="pageData.controlsWidth"
|
||
|
|
@chooseData="chooseData"
|
||
|
|
>
|
||
|
|
<template #yjTp="{ row }">
|
||
|
|
<div class="phone">
|
||
|
|
<el-image v-if="row.tp" :src="urlImg + row.yjTp" fit="cover" lazy />
|
||
|
|
<el-image v-else :src="Person" fit="cover" lazy />
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
<template #yjLx="{ row }">
|
||
|
|
<dict-tag :options="D_BZ_YJLX" :value="row.yjLx" :tag="false" />
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<!-- 操作 -->
|
||
|
|
<template #controls="{ row }">
|
||
|
|
<el-link type="primary" @click="addEdit('detail', row)">详情</el-link>
|
||
|
|
</template>
|
||
|
|
</MyTable>
|
||
|
|
<Pages
|
||
|
|
@changeNo="changeNo"
|
||
|
|
@changeSize="changeSize"
|
||
|
|
:tableHeight="pageData.tableHeight"
|
||
|
|
:pageConfiger="{
|
||
|
|
...pageData.pageConfiger,
|
||
|
|
total: pageData.total
|
||
|
|
}"
|
||
|
|
></Pages>
|
||
|
|
</div>
|
||
|
|
<!-- 编辑详情 -->
|
||
|
|
<!-- 编辑详情 -->
|
||
|
|
<EditAddForm ref="detailDiloag" :dict="{ D_BZ_YJLX, D_BZ_YJJB }" />
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script setup>
|
||
|
|
import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
||
|
|
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||
|
|
import Pages from "@/components/aboutTable/Pages.vue";
|
||
|
|
import EditAddForm from "./components/editAddForm.vue";
|
||
|
|
import Search from "@/components/aboutTable/Search.vue";
|
||
|
|
import { jczgetPageList } from "@/api/mosty-jcz.js";
|
||
|
|
import { reactive, ref, onMounted, getCurrentInstance, watch } from "vue";
|
||
|
|
const { proxy } = getCurrentInstance();
|
||
|
|
const urlImg = "/mosty-api/mosty-base/minio/image/download/";
|
||
|
|
const { D_BZ_YJLX, D_BZ_YJJB } = proxy.$dict("D_BZ_YJLX", "D_BZ_YJJB");
|
||
|
|
const searchConfiger = ref([
|
||
|
|
{
|
||
|
|
label: "预警类型",
|
||
|
|
prop: "yjLx",
|
||
|
|
placeholder: "预警类型",
|
||
|
|
showType: "select",
|
||
|
|
options: D_BZ_YJLX
|
||
|
|
},
|
||
|
|
{
|
||
|
|
label: "发生时间",
|
||
|
|
prop: "startTime",
|
||
|
|
placeholder: "发生时间",
|
||
|
|
showType: "datetimerange"
|
||
|
|
}
|
||
|
|
// {
|
||
|
|
// label: "预警对象",
|
||
|
|
// prop: "yjLx",
|
||
|
|
// placeholder: "请输入预警对象",
|
||
|
|
// showType: "input"
|
||
|
|
// }
|
||
|
|
]);
|
||
|
|
|
||
|
|
const detailDiloag = ref();
|
||
|
|
const pageData = reactive({
|
||
|
|
tableData: [], //表格数据
|
||
|
|
keyCount: 0,
|
||
|
|
tableConfiger: {
|
||
|
|
rowHieght: 61,
|
||
|
|
showSelectType: "null",
|
||
|
|
loading: false
|
||
|
|
},
|
||
|
|
total: 0,
|
||
|
|
pageConfiger: {
|
||
|
|
pageSize: 20,
|
||
|
|
pageCurrent: 1
|
||
|
|
}, //分页
|
||
|
|
controlsWidth: 250, //操作栏宽度
|
||
|
|
tableColumn: [
|
||
|
|
{ label: "预警图片", prop: "yjTp", showSolt: true },
|
||
|
|
{ label: "感知源名称", prop: "yjGzymc" },
|
||
|
|
{ label: "预警时间", prop: "yjSj" },
|
||
|
|
{ label: "预警人员", prop: "yjRyxm" },
|
||
|
|
{ label: "预警车牌号", prop: "yjClcph" },
|
||
|
|
{ label: "预警类型", prop: "yjLx", showSolt: true }
|
||
|
|
]
|
||
|
|
});
|
||
|
|
onMounted(() => {
|
||
|
|
tabHeightFn();
|
||
|
|
});
|
||
|
|
|
||
|
|
//查询条件
|
||
|
|
const queryCondition = ref({});
|
||
|
|
// 获取数据
|
||
|
|
const getjczgetXfllList = () => {
|
||
|
|
pageData.tableConfiger.loading = true;
|
||
|
|
const promes = { ...queryCondition.value, ...pageData.pageConfiger };
|
||
|
|
jczgetPageList(promes)
|
||
|
|
.then((res) => {
|
||
|
|
pageData.tableData = res.records;
|
||
|
|
pageData.total = res.total;
|
||
|
|
})
|
||
|
|
.finally(() => {
|
||
|
|
pageData.tableConfiger.loading = false;
|
||
|
|
});
|
||
|
|
};
|
||
|
|
getjczgetXfllList();
|
||
|
|
// 搜索
|
||
|
|
const onSearch = (val) => {
|
||
|
|
queryCondition.value = { ...queryCondition.value, ...val };
|
||
|
|
getjczgetXfllList();
|
||
|
|
};
|
||
|
|
|
||
|
|
const changeNo = (val) => {
|
||
|
|
pageData.pageConfiger.pageNum = val;
|
||
|
|
};
|
||
|
|
const changeSize = (val) => {
|
||
|
|
pageData.pageConfiger.pageSize = val;
|
||
|
|
};
|
||
|
|
// 新增
|
||
|
|
const addEdit = (type, row) => {
|
||
|
|
detailDiloag.value.init(type, row);
|
||
|
|
};
|
||
|
|
const searchBox = ref(null);
|
||
|
|
// 表格高度计算
|
||
|
|
const tabHeightFn = () => {
|
||
|
|
pageData.tableHeight =
|
||
|
|
window.innerHeight - searchBox.value.offsetHeight - 280;
|
||
|
|
window.onresize = function () {
|
||
|
|
tabHeightFn();
|
||
|
|
};
|
||
|
|
};
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style>
|
||
|
|
.el-loading-mask {
|
||
|
|
background: rgba(0, 0, 0, 0.5) !important;
|
||
|
|
}
|
||
|
|
</style>
|