添加围栏关联区域
This commit is contained in:
parent
04f22c0aca
commit
c1738a8b33
@ -4,8 +4,9 @@ NODE_ENV = 'development'
|
|||||||
# 本地环境接口地址(/api/index.ts文件中使用)
|
# 本地环境接口地址(/api/index.ts文件中使用)
|
||||||
# 后端本地
|
# 后端本地
|
||||||
# VITE_API_URL = 'http://192.168.34.221:19111'
|
# VITE_API_URL = 'http://192.168.34.221:19111'
|
||||||
# VITE_API_URL = 'http://192.168.34.221:9111'
|
# VITE_API_URL = 'http://192.168.34.221:9111' #雄哥本地
|
||||||
VITE_API_URL = 'http://192.168.34.221:28889'
|
VITE_API_URL = 'http://182.90.224.237:51234' #雄哥远程
|
||||||
|
# VITE_API_URL = 'http://192.168.34.221:28889'
|
||||||
# VITE_API_URL = 'http://121.196.214.246/api'
|
# VITE_API_URL = 'http://121.196.214.246/api'
|
||||||
# VITE_API_URL = 'http://jxj.zhgdyun.com:100'
|
# VITE_API_URL = 'http://jxj.zhgdyun.com:100'
|
||||||
# VITE_API_URL = 'http://192.168.34.221:12360'
|
# VITE_API_URL = 'http://192.168.34.221:12360'
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
import http from "@/api";
|
import http from "@/api";
|
||||||
const BASEURL = import.meta.env.VITE_API_URL;
|
const BASEURL = import.meta.env.VITE_API_URL;
|
||||||
|
|
||||||
|
// 查询区域列表
|
||||||
|
export const getRegionListApi = (params: {}) => {
|
||||||
|
return http.post(BASEURL + `/xmgl/qualityRegion/notTreeList`, params);
|
||||||
|
};
|
||||||
|
|
||||||
// 分页列表查询车辆(人员)定位- 报警记录信息
|
// 分页列表查询车辆(人员)定位- 报警记录信息
|
||||||
export const getAlarmRecordInfo = (params: {}) => {
|
export const getAlarmRecordInfo = (params: {}) => {
|
||||||
return http.get(BASEURL + `/xmgl/vehiclePositionAlarm/list`, params);
|
return http.get(BASEURL + `/xmgl/vehiclePositionAlarm/list`, params);
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
import http from "@/api";
|
import http from "@/api";
|
||||||
const BASEURL = import.meta.env.VITE_API_URL;
|
const BASEURL = import.meta.env.VITE_API_URL;
|
||||||
|
|
||||||
|
// 查询区域列表
|
||||||
|
export const getRegionListApi = (params: {}) => {
|
||||||
|
return http.post(BASEURL + `/xmgl/qualityRegion/notTreeList`, params);
|
||||||
|
};
|
||||||
// 分页列表查询车辆(人员)定位- 实时数据信息
|
// 分页列表查询车辆(人员)定位- 实时数据信息
|
||||||
export const getRealtimeRecordInfo = (params: {}) => {
|
export const getRealtimeRecordInfo = (params: {}) => {
|
||||||
return http.get(BASEURL + `/xmgl/vehiclePositionData/page`, params);
|
return http.get(BASEURL + `/xmgl/vehiclePositionData/page`, params);
|
||||||
|
|||||||
@ -27,10 +27,10 @@ export const BASE_IMAGE_URL = import.meta.env.VITE_BASE_IMAGE_URL;
|
|||||||
// export const COMPANY: string = "zhzrf"; //中海·臻如府
|
// export const COMPANY: string = "zhzrf"; //中海·臻如府
|
||||||
// export const COMPANY: string = "zsbf"; //中水北方
|
// export const COMPANY: string = "zsbf"; //中水北方
|
||||||
// export const COMPANY: string = "as"; //鞍山项目
|
// export const COMPANY: string = "as"; //鞍山项目
|
||||||
// export const COMPANY: string = "agjt"; //鞍钢集团
|
export const COMPANY: string = "agjt"; //鞍钢集团
|
||||||
// export const COMPANY: string = "agjtCommand"; //鞍钢集团指挥部大屏
|
// export const COMPANY: string = "agjtCommand"; //鞍钢集团指挥部大屏
|
||||||
// export const COMPANY: string = "slx"; //苏立信项目
|
// export const COMPANY: string = "slx"; //苏立信项目
|
||||||
export const COMPANY: string = "hfqc"; //合肥启程项目
|
// export const COMPANY: string = "hfqc"; //合肥启程项目
|
||||||
// export const COMPANY: string = "jsyc"; // 江苏盐城项目
|
// export const COMPANY: string = "jsyc"; // 江苏盐城项目
|
||||||
// export const COMPANY: string = "syhy"; //沈阳合盈盘锦项目 (需要去src\routers\modules\staticRouter.ts更换首页)
|
// export const COMPANY: string = "syhy"; //沈阳合盈盘锦项目 (需要去src\routers\modules\staticRouter.ts更换首页)
|
||||||
// export const COMPANY: string = "jxwjj"; //嘉兴王江泾公用码头项目 (需要去src\routers\modules\staticRouter.ts更换首页)
|
// export const COMPANY: string = "jxwjj"; //嘉兴王江泾公用码头项目 (需要去src\routers\modules\staticRouter.ts更换首页)
|
||||||
|
|||||||
@ -153,7 +153,7 @@
|
|||||||
<div style="margin: 5px 0"></div>
|
<div style="margin: 5px 0"></div>
|
||||||
<el-checkbox-group v-model="checkedFence" @change="fenceCitiesChange">
|
<el-checkbox-group v-model="checkedFence" @change="fenceCitiesChange">
|
||||||
<div v-for="item in fenceList" :key="item.id">
|
<div v-for="item in fenceList" :key="item.id">
|
||||||
<el-checkbox :label="item.id" :key="item.id">{{ item.fenceName }} </el-checkbox>
|
<el-checkbox :label="item.id" :key="item.id">{{ item.regionName }} </el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
@ -207,8 +207,12 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<div style="margin-top: 15%">
|
<div style="margin-top: 15%">
|
||||||
<el-form-item class="el-form-item__label" label="围栏名称" prop="fenceName">
|
<!-- <el-form-item class="el-form-item__label" label="围栏名称" prop="qualityRegionId"> -->
|
||||||
<el-input v-model="addForm.fenceName" placeholder="请输入"></el-input>
|
<el-form-item label="围栏名称" prop="region">
|
||||||
|
<!-- <el-input v-model="addForm.fenceName" placeholder="请输入"></el-input> -->
|
||||||
|
<el-select v-model="addForm.region" filterable clearable value-key="id" placeholder="请选择" style="width: 240px">
|
||||||
|
<el-option v-for="item in regionList" :key="item.id" :label="item.regionName" :value="item"/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="范围类型" prop="rangeType">
|
<el-form-item label="范围类型" prop="rangeType">
|
||||||
<el-radio-group
|
<el-radio-group
|
||||||
@ -290,7 +294,8 @@ import {
|
|||||||
getEpRealtimeDataApi,
|
getEpRealtimeDataApi,
|
||||||
getEpDayRecordApi,
|
getEpDayRecordApi,
|
||||||
addEpPositionFence,
|
addEpPositionFence,
|
||||||
deleteEpFence
|
deleteEpFence,
|
||||||
|
getRegionListApi
|
||||||
} from "@/api/modules/equipmentPosition";
|
} from "@/api/modules/equipmentPosition";
|
||||||
// import carIcon from "@/assets/images/carPosition/carIcon.png";
|
// import carIcon from "@/assets/images/carPosition/carIcon.png";
|
||||||
import carOn from "@/assets/images/carPosition/carOn2.png";
|
import carOn from "@/assets/images/carPosition/carOn2.png";
|
||||||
@ -356,6 +361,13 @@ let addForm = ref({
|
|||||||
enterpriseId: ""
|
enterpriseId: ""
|
||||||
});
|
});
|
||||||
let formFenceRules = ref({
|
let formFenceRules = ref({
|
||||||
|
region: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "必填",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
|
],
|
||||||
fenceName: [
|
fenceName: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@ -424,6 +436,7 @@ onMounted(() => {
|
|||||||
window.addEventListener("resize", e => {
|
window.addEventListener("resize", e => {
|
||||||
resetMapSize()
|
resetMapSize()
|
||||||
});
|
});
|
||||||
|
getRegionList();
|
||||||
});
|
});
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
window.removeEventListener("resize", e => {
|
window.removeEventListener("resize", e => {
|
||||||
@ -494,6 +507,20 @@ function areaRadiusChange() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let regionList = ref([] as any);
|
||||||
|
function getRegionList() {
|
||||||
|
let data = {
|
||||||
|
projectSn: store.sn
|
||||||
|
};
|
||||||
|
getRegionListApi(data).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
checkedFence.value = [];
|
||||||
|
regionList.value = res.result
|
||||||
|
console.log(regionList.value,777777777777777777777)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function deleteFence() {
|
function deleteFence() {
|
||||||
if (checkedFence.value.length === 0) {
|
if (checkedFence.value.length === 0) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
@ -582,7 +609,9 @@ const submitFence = async (formEL: FormInstance | undefined) => {
|
|||||||
await formEL.validate((valid, fields) => {
|
await formEL.validate((valid, fields) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let params = {
|
let params = {
|
||||||
fenceName: addForm.value.fenceName,
|
qualityRegionId: addForm.value.region.id,
|
||||||
|
regionName: addForm.value.region.regionName,
|
||||||
|
// fenceName: addForm.value.fenceName,
|
||||||
areaRadius: addForm.value.areaRadius,
|
areaRadius: addForm.value.areaRadius,
|
||||||
fenceShapeArr: JSON.stringify(addForm.value.locationList),
|
fenceShapeArr: JSON.stringify(addForm.value.locationList),
|
||||||
fenceShape: fenceShape,
|
fenceShape: fenceShape,
|
||||||
|
|||||||
@ -218,7 +218,7 @@
|
|||||||
<div style="margin: 5px 0"></div>
|
<div style="margin: 5px 0"></div>
|
||||||
<el-checkbox-group v-model="checkedFence" @change="fenceCitiesChange">
|
<el-checkbox-group v-model="checkedFence" @change="fenceCitiesChange">
|
||||||
<div v-for="item in fenceList" :key="item.id">
|
<div v-for="item in fenceList" :key="item.id">
|
||||||
<el-checkbox :label="item.id" :value="item.id" :key="item.id">{{ item.fenceName }} </el-checkbox>
|
<el-checkbox :label="item.id" :value="item.id" :key="item.id">{{ item.regionName }} </el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
@ -272,8 +272,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
<div style="margin-top: 15%">
|
<div style="margin-top: 15%">
|
||||||
<el-form-item label="围栏名称" prop="fenceName">
|
<el-form-item label="围栏名称" prop="region">
|
||||||
<el-input v-model="addForm.fenceName" placeholder="请输入"></el-input>
|
<!-- <el-input v-model="addForm.fenceName" placeholder="请输入"></el-input> -->
|
||||||
|
<el-select v-model="addForm.region" filterable clearable value-key="id" placeholder="请选择" style="width: 240px">
|
||||||
|
<el-option v-for="item in regionList" :key="item.id" :label="item.regionName" :value="item"/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="范围类型" prop="rangeType">
|
<el-form-item label="范围类型" prop="rangeType">
|
||||||
@ -404,7 +407,8 @@ import {
|
|||||||
getSuroundInfoApi,
|
getSuroundInfoApi,
|
||||||
getSafeHatTypeTotalApi,
|
getSafeHatTypeTotalApi,
|
||||||
getVehiclePositionFence,
|
getVehiclePositionFence,
|
||||||
addVehiclePositionFence
|
addVehiclePositionFence,
|
||||||
|
getRegionListApi
|
||||||
} from "@/api/modules/smartSafeHat";
|
} from "@/api/modules/smartSafeHat";
|
||||||
// import carIcon from "@/assets/images/carPosition/carIcon.png";
|
// import carIcon from "@/assets/images/carPosition/carIcon.png";
|
||||||
import carOn from "@/assets/images/carPosition/carOn2.png";
|
import carOn from "@/assets/images/carPosition/carOn2.png";
|
||||||
@ -508,6 +512,13 @@ let addEditForm = ref({
|
|||||||
});
|
});
|
||||||
// const formFenceRules = reactive<FormRules<RuleForm>({
|
// const formFenceRules = reactive<FormRules<RuleForm>({
|
||||||
let formFenceRules = ref({
|
let formFenceRules = ref({
|
||||||
|
region: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "必填",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
|
],
|
||||||
fenceName: [
|
fenceName: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@ -561,6 +572,7 @@ onMounted(async () => {
|
|||||||
window.addEventListener("resize", e => {
|
window.addEventListener("resize", e => {
|
||||||
resetMapSize();
|
resetMapSize();
|
||||||
});
|
});
|
||||||
|
getRegionList();
|
||||||
});
|
});
|
||||||
const resetMapSize = () => {
|
const resetMapSize = () => {
|
||||||
console.log(666);
|
console.log(666);
|
||||||
@ -664,6 +676,20 @@ const resolveAddStr = computed(() => async (longitude: any, latitude: any) => {
|
|||||||
return "未知位置2";
|
return "未知位置2";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let regionList = ref([] as any);
|
||||||
|
function getRegionList() {
|
||||||
|
let data = {
|
||||||
|
projectSn: store.sn
|
||||||
|
};
|
||||||
|
getRegionListApi(data).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
checkedFence.value = [];
|
||||||
|
regionList.value = res.result
|
||||||
|
console.log(regionList.value,777777777777777777777)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function areaRadiusChange() {
|
function areaRadiusChange() {
|
||||||
if (addForm.value.locationList.length === 1) {
|
if (addForm.value.locationList.length === 1) {
|
||||||
drawCircle();
|
drawCircle();
|
||||||
@ -759,7 +785,8 @@ const submitFence = async (formEL: FormInstance | undefined) => {
|
|||||||
await formEL.validate((valid, fields) => {
|
await formEL.validate((valid, fields) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let params = {
|
let params = {
|
||||||
fenceName: addForm.value.fenceName,
|
qualityRegionId: addForm.value.region.id,
|
||||||
|
regionName: addForm.value.region.regionName,
|
||||||
areaRadius: addForm.value.areaRadius,
|
areaRadius: addForm.value.areaRadius,
|
||||||
fenceShapeArr: JSON.stringify(addForm.value.locationList),
|
fenceShapeArr: JSON.stringify(addForm.value.locationList),
|
||||||
fenceShape: fenceShape,
|
fenceShape: fenceShape,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user