diff --git a/src/api/home/tool/index.ts b/src/api/home/tool/index.ts new file mode 100644 index 0000000..16d3f7f --- /dev/null +++ b/src/api/home/tool/index.ts @@ -0,0 +1,38 @@ +/** + * 诺成新设备指示带 + */ +import request from '@/api/index' + +// 基础列表 -分页 +export function getNcxPositionList(data: any) { + return request({ + url: `/system/ncxPosition/list`, + method: 'post', + data, + }) +} + +// 新建 +export function addNcxPosition(data: any) { + return request({ + url: `/system/ncxPosition/add`, + method: 'post', + data, + }) +} +// 编辑 +export function editNcxPosition(data: any) { + return request({ + url: `/system/ncxPosition/edit`, + method: 'post', + data, + }) +} +// 删除 +export function deleteNcxPosition(data: any) { + return request({ + url: `/system/ncxPosition/batchDelete`, + method: 'post', + data, + }) +} \ No newline at end of file diff --git a/src/api/home/tool/index.ts b/src/api/home/tool/index.ts new file mode 100644 index 0000000..16d3f7f --- /dev/null +++ b/src/api/home/tool/index.ts @@ -0,0 +1,38 @@ +/** + * 诺成新设备指示带 + */ +import request from '@/api/index' + +// 基础列表 -分页 +export function getNcxPositionList(data: any) { + return request({ + url: `/system/ncxPosition/list`, + method: 'post', + data, + }) +} + +// 新建 +export function addNcxPosition(data: any) { + return request({ + url: `/system/ncxPosition/add`, + method: 'post', + data, + }) +} +// 编辑 +export function editNcxPosition(data: any) { + return request({ + url: `/system/ncxPosition/edit`, + method: 'post', + data, + }) +} +// 删除 +export function deleteNcxPosition(data: any) { + return request({ + url: `/system/ncxPosition/batchDelete`, + method: 'post', + data, + }) +} \ No newline at end of file diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 040fb16..61ecf1c 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -26,7 +26,7 @@ default: false, }, }) -const $emits = defineEmits(['complete', 'marke', 'mapClick', 'markerClick', 'lineClick', 'polygonClick', 'massMarksClick', 'polygonDbClick', 'textClick']) +const $emits = defineEmits(['complete', 'marke', 'mapClick', 'markerClick', 'lineClick', 'polygonClick', 'massMarksClick', 'polygonDbClick', 'textClick', 'massMarksOver', 'massMarksOut']) const loading = ref(true) const publicPath = window.location.href.split('#')[0] // 设置安全密钥 @@ -101,7 +101,7 @@ AMapLoader.load({ key: localStorage.getItem('JsKey')!, // 后期需替换 version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 - plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.IndexCluster'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 + plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.IndexCluster', 'AMap.PolylineEditor'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 }) .then((AMap1: any) => { // console.log($props.center, '$props.center') @@ -487,13 +487,14 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { -console.log('添加海量点标记', data) +// console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 style: data.style.map((item: any) => ({ ...item, - anchor: new AMap.value.Pixel(0, 0), + // anchor: new AMap.value.Pixel(0, 0), + anchor:'bottom-center', size: new AMap.value.Size(data.size ? data.size : 25, data.size ? data.size : 25) })), // 设置样式对象 }) @@ -503,6 +504,14 @@ console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks, type: 'marks' }) }) + massMarks.on('mouseover', (e) => { + console.log('移入了海量点标记') + $emits('massMarksOver', { event: e, map: map.value, data, massMarks, type: 'marks' }) + }) + massMarks.on('mouseout', (e) => { + console.log('移出了海量点标记') + $emits('massMarksOut', { event: e, map: map.value, data, massMarks, type: 'marks' }) + }) } // 移除点标记(海量点) const removeMassMarks = () => { diff --git a/src/api/home/tool/index.ts b/src/api/home/tool/index.ts new file mode 100644 index 0000000..16d3f7f --- /dev/null +++ b/src/api/home/tool/index.ts @@ -0,0 +1,38 @@ +/** + * 诺成新设备指示带 + */ +import request from '@/api/index' + +// 基础列表 -分页 +export function getNcxPositionList(data: any) { + return request({ + url: `/system/ncxPosition/list`, + method: 'post', + data, + }) +} + +// 新建 +export function addNcxPosition(data: any) { + return request({ + url: `/system/ncxPosition/add`, + method: 'post', + data, + }) +} +// 编辑 +export function editNcxPosition(data: any) { + return request({ + url: `/system/ncxPosition/edit`, + method: 'post', + data, + }) +} +// 删除 +export function deleteNcxPosition(data: any) { + return request({ + url: `/system/ncxPosition/batchDelete`, + method: 'post', + data, + }) +} \ No newline at end of file diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 040fb16..61ecf1c 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -26,7 +26,7 @@ default: false, }, }) -const $emits = defineEmits(['complete', 'marke', 'mapClick', 'markerClick', 'lineClick', 'polygonClick', 'massMarksClick', 'polygonDbClick', 'textClick']) +const $emits = defineEmits(['complete', 'marke', 'mapClick', 'markerClick', 'lineClick', 'polygonClick', 'massMarksClick', 'polygonDbClick', 'textClick', 'massMarksOver', 'massMarksOut']) const loading = ref(true) const publicPath = window.location.href.split('#')[0] // 设置安全密钥 @@ -101,7 +101,7 @@ AMapLoader.load({ key: localStorage.getItem('JsKey')!, // 后期需替换 version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 - plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.IndexCluster'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 + plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.IndexCluster', 'AMap.PolylineEditor'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 }) .then((AMap1: any) => { // console.log($props.center, '$props.center') @@ -487,13 +487,14 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { -console.log('添加海量点标记', data) +// console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 style: data.style.map((item: any) => ({ ...item, - anchor: new AMap.value.Pixel(0, 0), + // anchor: new AMap.value.Pixel(0, 0), + anchor:'bottom-center', size: new AMap.value.Size(data.size ? data.size : 25, data.size ? data.size : 25) })), // 设置样式对象 }) @@ -503,6 +504,14 @@ console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks, type: 'marks' }) }) + massMarks.on('mouseover', (e) => { + console.log('移入了海量点标记') + $emits('massMarksOver', { event: e, map: map.value, data, massMarks, type: 'marks' }) + }) + massMarks.on('mouseout', (e) => { + console.log('移出了海量点标记') + $emits('massMarksOut', { event: e, map: map.value, data, massMarks, type: 'marks' }) + }) } // 移除点标记(海量点) const removeMassMarks = () => { diff --git a/src/router/modules/pc.ts b/src/router/modules/pc.ts index 0f7359d..1c5e45b 100644 --- a/src/router/modules/pc.ts +++ b/src/router/modules/pc.ts @@ -572,6 +572,7 @@ auth: '/device/count', }, }, + ], }, { @@ -663,6 +664,20 @@ auth: '/operation/manufacturer', }, }, + // 诺成新画线工具 + { + path: 'tool', + component: () => import('@/views/home/tool/index.vue'), + name: 'tool', + meta: { + title: '监测范围标注工具', + icon: 'ep:key', + sidebar: true, + breadcrumb: true, + activeMenu: '/device/tool', + auth: '/device/tool', + }, + }, ], }, ...sysRoutes, diff --git a/src/api/home/tool/index.ts b/src/api/home/tool/index.ts new file mode 100644 index 0000000..16d3f7f --- /dev/null +++ b/src/api/home/tool/index.ts @@ -0,0 +1,38 @@ +/** + * 诺成新设备指示带 + */ +import request from '@/api/index' + +// 基础列表 -分页 +export function getNcxPositionList(data: any) { + return request({ + url: `/system/ncxPosition/list`, + method: 'post', + data, + }) +} + +// 新建 +export function addNcxPosition(data: any) { + return request({ + url: `/system/ncxPosition/add`, + method: 'post', + data, + }) +} +// 编辑 +export function editNcxPosition(data: any) { + return request({ + url: `/system/ncxPosition/edit`, + method: 'post', + data, + }) +} +// 删除 +export function deleteNcxPosition(data: any) { + return request({ + url: `/system/ncxPosition/batchDelete`, + method: 'post', + data, + }) +} \ No newline at end of file diff --git a/src/components/map/index.vue b/src/components/map/index.vue index 040fb16..61ecf1c 100644 --- a/src/components/map/index.vue +++ b/src/components/map/index.vue @@ -26,7 +26,7 @@ default: false, }, }) -const $emits = defineEmits(['complete', 'marke', 'mapClick', 'markerClick', 'lineClick', 'polygonClick', 'massMarksClick', 'polygonDbClick', 'textClick']) +const $emits = defineEmits(['complete', 'marke', 'mapClick', 'markerClick', 'lineClick', 'polygonClick', 'massMarksClick', 'polygonDbClick', 'textClick', 'massMarksOver', 'massMarksOut']) const loading = ref(true) const publicPath = window.location.href.split('#')[0] // 设置安全密钥 @@ -101,7 +101,7 @@ AMapLoader.load({ key: localStorage.getItem('JsKey')!, // 后期需替换 version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 - plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.IndexCluster'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 + plugins: ['AMap.Scale', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.IndexCluster', 'AMap.PolylineEditor'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 }) .then((AMap1: any) => { // console.log($props.center, '$props.center') @@ -487,13 +487,14 @@ const massMarksAllList = ref([]) // 添加点标记(海量点) const addMassMarks = (data: any) => { -console.log('添加海量点标记', data) +// console.log('添加海量点标记', data) var massMarks = new AMap.value.MassMarks(data.path, { zIndex: data.zIndex, // 海量点图层叠加的顺序 zooms: data.zooms || [], // 在指定地图缩放级别范围内展示海量点图层 style: data.style.map((item: any) => ({ ...item, - anchor: new AMap.value.Pixel(0, 0), + // anchor: new AMap.value.Pixel(0, 0), + anchor:'bottom-center', size: new AMap.value.Size(data.size ? data.size : 25, data.size ? data.size : 25) })), // 设置样式对象 }) @@ -503,6 +504,14 @@ console.log('点击了海量点标记') $emits('massMarksClick', { event: e, map: map.value, data, massMarks, type: 'marks' }) }) + massMarks.on('mouseover', (e) => { + console.log('移入了海量点标记') + $emits('massMarksOver', { event: e, map: map.value, data, massMarks, type: 'marks' }) + }) + massMarks.on('mouseout', (e) => { + console.log('移出了海量点标记') + $emits('massMarksOut', { event: e, map: map.value, data, massMarks, type: 'marks' }) + }) } // 移除点标记(海量点) const removeMassMarks = () => { diff --git a/src/router/modules/pc.ts b/src/router/modules/pc.ts index 0f7359d..1c5e45b 100644 --- a/src/router/modules/pc.ts +++ b/src/router/modules/pc.ts @@ -572,6 +572,7 @@ auth: '/device/count', }, }, + ], }, { @@ -663,6 +664,20 @@ auth: '/operation/manufacturer', }, }, + // 诺成新画线工具 + { + path: 'tool', + component: () => import('@/views/home/tool/index.vue'), + name: 'tool', + meta: { + title: '监测范围标注工具', + icon: 'ep:key', + sidebar: true, + breadcrumb: true, + activeMenu: '/device/tool', + auth: '/device/tool', + }, + }, ], }, ...sysRoutes, diff --git a/src/views/home/alarm/current/components/confirmSituation.vue b/src/views/home/alarm/current/components/confirmSituation.vue index 398a9bc..de2cf9f 100644 --- a/src/views/home/alarm/current/components/confirmSituation.vue +++ b/src/views/home/alarm/current/components/confirmSituation.vue @@ -53,6 +53,19 @@ flowStatus1: '', approvalTime1: '', }) // 表单 +// 自定义校验规则 +const validateTimeRange = (rule, value, callback) => { + if (!value || !dataForm.value.approvalTime) { + callback(); // 由非空校验处理 + return; + } + + if (new Date(value) <= new Date(dataForm.value.approvalTime)) { + callback(new Error('处置时间必须大于现场确认时间')); + } else { + callback(); + } +}; const rules: FormRules = { confirmValue: [{ required: true, message: '现场浓度值不能为空', trigger: ['blur', 'change'] }], approvalStatus: [{ required: true, message: '现场确认情况不能为空', trigger: ['blur', 'change'] }], @@ -65,7 +78,7 @@ approvalPerson1: [{ required: true, message: '处置人员不能为空', trigger: ['blur', 'change'] }], descn1: [{ required: true, message: '处置情况记录不能为空', trigger: ['blur', 'change'] }], - approvalTime1: [{ required: true, message: '处置时间不能为空', trigger: ['blur', 'change'] }], + approvalTime1: [{ required: true, message: '处置时间不能为空', trigger: ['blur', 'change'] },{ validator: validateTimeRange, trigger: 'change' }], } // 前端校验规则 @@ -93,6 +106,7 @@ }) const record = ref([]) const initDialog = (row: any) => { + console.log(row, '111') record.value = [] isDispose.value = false isFirstLoading.value = true @@ -199,6 +213,13 @@ // 确认 const confirm = () => { + // 判断处置中7时间是否早于待处置6 + if(dataForm.value.approvalTime && dataForm.value.approvalTime1) { + if(new Date(dataForm.value.approvalTime1) <= new Date(dataForm.value.approvalTime)) { + ElMessage.warning('处置中时间不能早于待处置时间') + return + } + } dataFormRef.value.validate((valid: any) => { if (valid) { const handler = (data: any[]) => { @@ -367,7 +388,7 @@