lcw
This commit is contained in:
@ -63,11 +63,10 @@
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 85%" prop="jd" label="坐标位置">
|
||||
<div class="latlng flex">
|
||||
<el-input :disabled="true" v-model="listQuery.jd" clearable placeholder="请选择坐标"
|
||||
<el-input :disabled="false" v-model="listQuery.jd" clearable placeholder="请选择坐标"
|
||||
style="width: 42%"></el-input>
|
||||
<el-input :disabled="true" v-model="listQuery.wd" clearable placeholder="请选择坐标"
|
||||
<el-input :disabled="false" v-model="listQuery.wd" clearable placeholder="请选择坐标"
|
||||
style="width: 42%; margin-left: 1%"></el-input>
|
||||
|
||||
<el-button @click="selectLocation" :disabled="forbidden">选择定位</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
@ -213,16 +212,24 @@ const selectLocation = () => {
|
||||
//获取经纬度
|
||||
const chackLat = () => {
|
||||
const { jd, wd } = listQuery.value;
|
||||
console.log(jd, wd);
|
||||
|
||||
let icon = require("@/assets/images/bi/gzy.png");
|
||||
emitter.emit("deletePointArea", "jczMap_Gzy");
|
||||
|
||||
if (listQuery.value.zqlx == '2') {
|
||||
icon = require("@/assets/images/bi/gzy.png");
|
||||
} else {
|
||||
icon = require("@/assets/images/z.png");
|
||||
}
|
||||
|
||||
if (jd && wd) {
|
||||
setTimeout(() => {
|
||||
emitter.emit("deletePointArea", "jczMap_Gzy");
|
||||
emitter.emit("addPointArea", {
|
||||
coords: [{ jd, wd }],
|
||||
icon: require("@/assets/images/bi/gzy.png"),
|
||||
icon,
|
||||
flag: "jczMap_Gzy"
|
||||
});
|
||||
emitter.emit("setMapCenter", { location: [jd, wd], zoomLevel: 10 });
|
||||
}, 1000);
|
||||
}
|
||||
};
|
||||
|
||||
@ -23,7 +23,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn_bom">
|
||||
<button class="dp-default small" @click="chooceItem(item)" style="margin-right: 10px;">选择</button>
|
||||
<button class="dp-default small" @click="chooceItem(item,'cl')" style="margin-right: 10px;">设置出林</button>
|
||||
<button class="dp-default small" @click="chooceItem(item,'rl')" style="margin-right: 10px;">设置入林</button>
|
||||
<button class="dp-default small" @click="openVideo(item)">视频播放</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -40,8 +41,7 @@ const info = ref([]); //警情数据
|
||||
const emits = defineEmits(['chooseVideo'])
|
||||
onMounted(() => {
|
||||
emitter.on("showGzyInfo", (res) => {
|
||||
console.log(res, 'resresresres')
|
||||
info.value = [res];
|
||||
info.value =res ;
|
||||
show.value = true;
|
||||
});
|
||||
});
|
||||
@ -49,14 +49,16 @@ onUnmounted(() => {
|
||||
emitter.off("showGzyInfo");
|
||||
});
|
||||
|
||||
function chooceItem(item) {
|
||||
emits('chooseVideo', item)
|
||||
}
|
||||
function chooceItem(item,type) {
|
||||
if (type === 'cl') {
|
||||
emits('chooseVideo', {...item,gzyfx:'02'})
|
||||
} else {
|
||||
emits('chooseVideo', {...item,gzyfx:'01'})
|
||||
}
|
||||
|
||||
}
|
||||
// 打开视频
|
||||
function openVideo(item) {
|
||||
console.log(item, 'item');
|
||||
|
||||
let params = {
|
||||
...item,
|
||||
splitNum: 1
|
||||
@ -91,7 +93,7 @@ function close() {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0;
|
||||
|
||||
background: #052342;
|
||||
.close {
|
||||
font-size: 20px;
|
||||
font-weight: 200;
|
||||
|
||||
@ -8,18 +8,26 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="cntinfo">
|
||||
<el-form ref="formRef" :model="listQuery" :rules="rules" :inline="true" label-position="top">
|
||||
<el-form-item style="width: 40%" label="感知源">
|
||||
<el-form ref="formRef" :model="listQuery" :rules="rules" label-position="top">
|
||||
<el-form-item label="检查站名称">
|
||||
<el-input v-model="JczMc" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 40%" label="感知源">
|
||||
<!-- <div class="diviput" @click="showJcz = true"> -->
|
||||
<div class="diviput">
|
||||
<span v-if="listQuery.sxtList && listQuery.sxtList.length > 0">
|
||||
<el-tag closable @close="handleClose(index)" v-for="(item, index) in listQuery.sxtList" :key="index"> {{
|
||||
<el-form-item label="入林感知源">
|
||||
<div class="diviput" @click="openCl('rl')">
|
||||
<span v-if="RlGzy && RlGzy.length > 0">
|
||||
<el-tag closable @close="handleClose(index,'rl')" v-for="(item, index) in RlGzy" :key="index"> {{
|
||||
item.sbmc }} </el-tag>
|
||||
</span>
|
||||
<span class="placeholder" v-else> 请选择感知源</span>
|
||||
<span class="placeholder" v-else> 请选择入林感知源</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="出林感知源">
|
||||
<div class="diviput" @click="openCl('cl')">
|
||||
<span v-if="ClGzy && ClGzy.length > 0">
|
||||
<el-tag closable @close="handleClose(index,'cl')" v-for="(item, index) in ClGzy" :key="index"> {{
|
||||
item.sbmc }} </el-tag>
|
||||
</span>
|
||||
<span class="placeholder" v-else> 请选择出林感知源</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -41,15 +49,16 @@ import { sxtBatch, JczselectById } from '@/api/mosty-jcz'
|
||||
import { ElMessage } from "element-plus";
|
||||
import GdMap from "@/components/GdMap/index.vue";
|
||||
import gzyInfo from "./gzyInfo.vue";
|
||||
import { ysSxtGetList } from '@/api/yszx.js'
|
||||
import { ysSxtGetList, ysSxtgetPageList } from '@/api/yszx.js'
|
||||
import emitter from "@/utils/eventBus.js";
|
||||
const emit = defineEmits(['getjczgetXfllList'])
|
||||
const search = ref(null)
|
||||
|
||||
const ClGzy = ref([])
|
||||
const RlGzy = ref([])
|
||||
const listQuery = ref({})
|
||||
onMounted(() => {
|
||||
tabHeightFn()
|
||||
console.log("xxxx");
|
||||
|
||||
});
|
||||
const data = ref([])
|
||||
|
||||
@ -63,14 +72,26 @@ const init = (row) => {
|
||||
JczMc.value = row.jczmc
|
||||
JczselectById({ id: row.id }).then(res => {
|
||||
if (res) {
|
||||
listQuery.value.sxtList = res.sxtList ? res.sxtList : [];
|
||||
ClGzy.value=res.sxtList.filter(item => item.gzyfx=='02')
|
||||
RlGzy.value=res.sxtList.filter(item => item.gzyfx=='01')
|
||||
const icon = require("@/assets/images/z.png");
|
||||
const iconjcz = require("@/assets/point/sp.png");
|
||||
emitter.emit("setMapCenter", { location: [res.jd, res.wd], zoomLevel: 10 });
|
||||
if (res.jczlx == '01') {
|
||||
emitter.emit("addPointArea", { coords: [res], icon, flag: "jczMap_hm" });
|
||||
} else {
|
||||
emitter.emit("addPointArea", { coords: [res], icon: iconjcz, flag: "jczMap_hm" });
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
//保存
|
||||
const _onSave = () => {
|
||||
sxtBatch(listQuery.value).then((res) => {
|
||||
console.log(res);
|
||||
const promes = {
|
||||
...listQuery.value,
|
||||
sxtList: [...RlGzy.value, ...ClGzy.value]
|
||||
}
|
||||
sxtBatch(promes).then((res) => {
|
||||
ElMessage({ message: "新增成功", type: "success" });
|
||||
emit("getjczgetXfllList");
|
||||
close()
|
||||
@ -114,6 +135,7 @@ const pageDatas = reactive({
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
//页面关闭
|
||||
const close = () => {
|
||||
dialogGzy.value = false;
|
||||
@ -121,9 +143,16 @@ const close = () => {
|
||||
};
|
||||
// 选择视频
|
||||
function chooseVideo(sxt) {
|
||||
console.log(sxt, 'sxt');
|
||||
listQuery.value.sxtList.push(sxt)
|
||||
if (sxt.gzyfx=='01') {
|
||||
RlGzy.value.find(item => item.sbbh === sxt.sbbh)? ElMessage({ message: "入林感知源已选择", type: "warning" }) : RlGzy.value.push(sxt)
|
||||
} else {
|
||||
ClGzy.value.find(item => item.sbbh === sxt.sbbh)? ElMessage({ message: "出林感知源已选择", type: "warning" }) : ClGzy.value.push(sxt)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// listQuery.value.sxtList.find(item => item.sbbh === sxt.sbbh) ? ElMessage({ message: "感知源已选择", type: "warning" }) : listQuery.value.sxtList.push(sxt)
|
||||
// 表格高度计算
|
||||
const tabHeightFn = () => {
|
||||
console.log(search.value);
|
||||
@ -134,22 +163,60 @@ const tabHeightFn = () => {
|
||||
};
|
||||
};
|
||||
const sxtGetList = () => {
|
||||
const icon = require("@/assets/point/kk.png")
|
||||
ysSxtGetList().then(res => {
|
||||
emitter.emit("addPointArea", {
|
||||
coords: res,
|
||||
icon: require("@/assets/point/sp.png"),
|
||||
flag: "sp"
|
||||
});
|
||||
|
||||
// 筛选出有效的地理坐标数据,经度范围(-180, 180),纬度范围(-90, 90)
|
||||
const coords = res.filter(item => {
|
||||
// 确保经纬度存在且为有效数字,并在合理范围内
|
||||
const jd = Number(item.jd)
|
||||
const wd = Number(item.wd)
|
||||
return !isNaN(jd) && jd > 0 && !isNaN(wd) && wd > 0
|
||||
})
|
||||
emitter.emit("addPoint",
|
||||
{
|
||||
coords: coords,
|
||||
icon: icon,
|
||||
flag: 'sp',
|
||||
scale: 0.6,
|
||||
fontColor: "#FF0000"
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
defineExpose({ init });
|
||||
// 打开弹窗
|
||||
const lxSxt = ref('')
|
||||
const openCl = (val) => {
|
||||
showJcz.value = true
|
||||
lxSxt.value = val
|
||||
}
|
||||
|
||||
const showJcz = ref(false)
|
||||
const GzyMsg = (val) => {
|
||||
listQuery.value.sxtList = val
|
||||
if (lxSxt.value == 'cl') {
|
||||
ClGzy.value = val.map(item => {
|
||||
return {
|
||||
...item,
|
||||
gzyfx: '02'
|
||||
}
|
||||
|
||||
})
|
||||
} else if (lxSxt.value == 'rl') {
|
||||
RlGzy.value = val.map(item => {
|
||||
return {
|
||||
...item,
|
||||
gzyfx: '01'
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
const handleClose = (idx) => {
|
||||
listQuery.value.sxtList.splice(idx, 1)
|
||||
const handleClose = (idx,type) => {
|
||||
if (type == 'cl') {
|
||||
ClGzy.value.splice(idx, 1)
|
||||
} else if (type == 'rl') {
|
||||
RlGzy.value.splice(idx, 1)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -261,6 +328,8 @@ const handleClose = (idx) => {
|
||||
border: 1px solid #c0c4cc;
|
||||
color: #000;
|
||||
min-height: 32px;
|
||||
max-height: 100px;
|
||||
overflow: auto;
|
||||
// line-height: 32px;
|
||||
padding: 0 10px;
|
||||
border-radius: 5px;
|
||||
|
||||
Reference in New Issue
Block a user