This commit is contained in:
lcw
2026-01-28 11:18:47 +08:00
parent 57f1e2a1e5
commit c724ff9e12
78 changed files with 1001 additions and 745 deletions

View File

@ -219,6 +219,7 @@
import { ref, reactive, watch } from "vue";
import * as MOSTY from "@/components/MyComponents/index";
import { jczsavel, Xfbbupdate } from "@/api/mosty-jcz.js";
import { qcckGet } from "@/api/qcckApi";
import { ElMessage } from "element-plus";
import ChooseTable from "@/components/chooseList/chooseTable.vue";
import { timeValidate } from "@/utils/tools.js";
@ -253,8 +254,18 @@ let pageType = ref("add");
const mjData = ref([]);
const fjData = ref([]);
const isDetail=ref(false)
//
const getjyqx = () => {
qcckGet({}, "/mosty-jcz/tpJczJyqx/getJyqxList").then((res) => {
console.log(res);
listQuery.value.qxList = res;
});
}
// 初始化数据
const init = (type, row) => {
getjyqx()
pageType.value = type;
dialogForm.value = true;
// 根据type和row初始化表单数据

View File

@ -3,116 +3,30 @@
<div class="head_box">
<span class="title">{{ pageInfo[pageType].title }}</span>
<div>
<el-button
size="small"
type="primary"
v-if="['add', 'edit'].includes(pageType)"
@click="_onSave"
>保存</el-button
>
<el-button size="small" type="primary" v-if="['add', 'edit'].includes(pageType)" @click="_onSave">保存</el-button>
<el-button size="small" @click="close">关闭</el-button>
</div>
</div>
<div class="cntinfo">
<el-form ref="elform" :model="form" :inline="true" label-position="top">
<el-form-item prop="ssbmdm" label="预警类型" style="width: 40%">
<el-select
clearable
disabled
v-model="listQuery.yjLx"
placeholder="请选择"
style="width: 100%"
>
<el-option
v-for="(item, index) in dict.D_BZ_YJLX"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="感知源名称" style="width: 40%">
<el-input
v-model="listQuery.yjGzymc"
placeholder="感知源名称"
clearable
disabled
style="width: 100%"
/>
</el-form-item>
<el-form-item prop="scode" label="预警发生时间" style="width: 40%">
<el-date-picker
v-model="listQuery.yjSj"
type="datetime"
placeholder="请选中开始时间"
format="YYYY-MM-DD hh:mm:ss"
disabled
value-format="YYYY-MM-DD hh:mm:ss"
/>
</el-form-item>
<el-form-item prop="sbmc" label="预警对象" style="width: 40%">
<el-input
v-model="DX"
placeholder="请输入装备名称"
clearable
disabled
style="width: 100%"
/>
</el-form-item>
<el-form-item label="预警地址" style="width: 40%">
<el-input
v-model="listQuery.yjDz"
placeholder="请输入预警地址"
disabled
clearable
style="width: 100%"
/>
</el-form-item>
<el-form-item label="预警级别" style="width: 40%">
<el-select
clearable
disabled
v-model="listQuery.yjJb"
placeholder="请选择"
style="width: 100%"
>
<el-option
v-for="(item, index) in dict.D_BZ_YJJB"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="预警内容" style="width: 100%">
<el-input
v-model="listQuery.yjNr"
disabled
placeholder="请输入关键字"
show-word-limit
type="textarea"
/>
</el-form-item>
<el-form-item label="预警图片">
<el-image
:preview-src-list="[listQuery.yjTp]"
fit="cover"
style="width: 100px; height: 100px"
:src="listQuery.yjTp"
></el-image>
</el-form-item>
</el-form>
<FormMessage :disabled="true" v-model="listQuery" :formList="formData" ref="elform" :rules="rules" position="top">
<template #yjRyxm="{ row }">
<el-input v-if="listQuery.yjLx == '1'" v-model="listQuery.yjRyxm" placeholder="请输入预警接收人姓名" clearable
style="width: 100%" />
<el-input v-else v-model="listQuery.yjClcph" placeholder="请输入预警接收人手机号" clearable style="width: 100%" />
</template>
<template #yjTp="{ row }">
<el-image :preview-src-list="[listQuery.yjTp]" fit="cover" style="width: 100px; height: 100px"
:src="listQuery.yjTp"></el-image>
</template>
</FormMessage>
</div>
</div>
</template>
<script setup>
import { ref, reactive, onMounted } from "vue";
import { ref, reactive, onMounted, watch } from "vue";
import * as MOSTY from "@/components/MyComponents/index";
import FormMessage from "@/components/aboutTable/FormMessage.vue";
import { TcsbsaveTcsbsave, Tcsbupdate } from "@/api/mosty-jcz.js";
import { Right, Back } from "@element-plus/icons-vue";
import { baseselectPage } from "@/api/mosty-base";
@ -120,7 +34,7 @@ import { ElMessage } from "element-plus";
const props = defineProps({
dict: {
type: Object,
default: () => {}
default: () => { }
}
});
@ -147,14 +61,12 @@ const propsTree = ref({
multiple: false
});
// 初始化数据
const DX = ref();
const init = (type, row) => {
pageType.value = type;
dialogForm.value = true;
// 根据type和row初始化表单数据
tabHeightFn();
if (type == "edit" || type == "detail") {
DX.value = row.yjRyxm ? row.yjRyxm : row.yjClcph;
listQuery.value = { ...row };
} else {
listQuery.value = {};
@ -165,8 +77,26 @@ const init = (type, row) => {
const close = () => {
dialogForm.value = false;
listQuery.value = {};
DX.value = "";
};
const formData = ref()
watch(() => props.dict, (newVal, oldVal) => {
if (newVal) {
formData.value = [
{ label: "预警类型", prop: "yjLx", type: "select", options: props.dict.D_BZ_YJLX, width: '45%' },
{ label: "感知源名称", prop: "yjGzymc", type: "input", width: '45%' },
{ label: "请选中开始时间", prop: "yjSj", type: "datetime", width: '45%' },
{ label: "预警对象", prop: "yjRyxm", type: "slot", width: '45%' },
{ label: "预警标签", prop: "yjbqmc", type: "input", width: '45%' },
{ label: "所属部门", prop: "ssbm", type: "input", width: '45%' },
{ label: "预警地址", prop: "yjDz", type: "input", width: '45%' },
{ label: "预警级别", prop: "yjJb", type: "select", options: props.dict.D_BZ_YJJB, width: '45%' },
{ label: "预警内容", prop: "yjNr", type: "textarea", width: '100%' },
{ label: "预警图片", prop: "yjTp", type: "slot", width: '100%' }
]
}
});
// 表格高度计算
const tableHeight1 = ref();
const tabHeightFn = () => {
@ -179,21 +109,25 @@ defineExpose({ init });
<style lang="scss" scoped>
.dialog {
padding: 20px;
.head_box {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.cntinfo {
height: calc(100% - 70px);
overflow: hidden;
overflow-y: auto;
}
}
.my_transfer {
height: calc(100% - 50px);
display: flex;
.btn {
width: 50px;
display: flex;
@ -201,53 +135,65 @@ defineExpose({ init });
justify-content: center;
margin: 0 10px;
}
.left {
margin: 12px;
flex: 1;
position: relative;
.tableBox {
position: absolute;
width: 100%;
}
.serch {
position: relative;
width: 100%;
// height: 96px;
> .el-form--inline {
>.el-form--inline {
display: block;
width: 100%;
padding: 0;
> .el-form-item--default {
>.el-form-item--default {
width: 31%;
}
}
}
.tableBox {
width: 100%;
}
}
.right {
width: 380px;
margin: 12px;
}
}
.phone {
width: 95px;
height: 120px;
.el-image {
width: 95px;
max-height: 120px;
}
}
::v-deep .el-upload {
width: 90px;
height: 100px;
border: 1px dashed #e0e0e0;
margin-bottom: 14px;
.el-icon {
margin-top: 34px;
font-size: 26px;
}
.el-image {
width: 100%;
height: 100%;

View File

@ -8,15 +8,9 @@
<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"
>
<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 />
@ -32,15 +26,10 @@
<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>
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
...pageData.pageConfiger,
total: pageData.total
}"></Pages>
</div>
<!-- 编辑详情 -->
<!-- 编辑详情 -->
@ -54,11 +43,12 @@ 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 { jczgetPageList, selectJczFullList } 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 jczList = ref()
const searchConfiger = ref([
{
label: "预警类型",
@ -66,6 +56,12 @@ const searchConfiger = ref([
placeholder: "预警类型",
showType: "select",
options: D_BZ_YJLX
}, {
label: "所属检查站",
prop: "jczid",
placeholder: "所属检查站",
showType: "select",
options: {}
},
{
label: "发生时间",
@ -73,12 +69,6 @@ const searchConfiger = ref([
placeholder: "发生时间",
showType: "datetimerange"
}
// {
// label: "预警对象",
// prop: "yjLx",
// placeholder: "请输入预警对象",
// showType: "input"
// }
]);
const detailDiloag = ref();
@ -107,6 +97,8 @@ const pageData = reactive({
});
onMounted(() => {
tabHeightFn();
getselectJczFullList()
});
//查询条件
@ -124,17 +116,34 @@ const getjczgetXfllList = () => {
pageData.tableConfiger.loading = false;
});
};
// 获取检查站数据
const getselectJczFullList = () => {
selectJczFullList().then((res) => {
console.log(res);
jczList.value = res.map(item => ({
label: item.jczmc,
value: item.id
}))
searchConfiger.value[1].options = jczList.value
})
}
getjczgetXfllList();
// 搜索
const onSearch = (val) => {
console.log(val);
const startTime = {
startTime : val.startTime[0],
endTime : val.startTime[1]
...val,
startTime: val.startTime ? val.startTime[0] : "",
endTime: val.startTime ? val.startTime[1] : ""
}
queryCondition.value = { ...queryCondition.value,...startTime};
queryCondition.value = { ...queryCondition.value, ...startTime };
getjczgetXfllList();
};