From a3b4a152610b822817976e48e361c8b5ec56c4f7 Mon Sep 17 00:00:00 2001 From: Teo <2642673902@qq.com> Date: Tue, 17 Jun 2025 15:36:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A2=84=E8=AE=BE=E7=82=B9,?= =?UTF-8?q?=E6=8E=A5=E5=85=A5=E8=90=A4=E7=9F=B3=E6=91=84=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- package.json | 1 + src/api/other/devicePreset/index.ts | 74 +++ src/api/other/devicePreset/types.ts | 80 +++ src/api/other/ys7Device/index.ts | 11 + src/views/other/ys7Device/component/add.vue | 145 ----- .../other/ys7Device/component/bindPro.vue | 10 +- .../other/ys7Device/component/detail.vue | 149 ----- src/views/other/ys7Device/component/edit.vue | 259 ++++----- .../other/ys7Device/component/presetAdd.vue | 547 +++++++++--------- src/views/other/ys7Device/index.vue | 18 +- 11 files changed, 570 insertions(+), 726 deletions(-) create mode 100644 src/api/other/devicePreset/index.ts create mode 100644 src/api/other/devicePreset/types.ts delete mode 100644 src/views/other/ys7Device/component/add.vue delete mode 100644 src/views/other/ys7Device/component/detail.vue diff --git a/.env.development b/.env.development index ad4efa7..8c542b5 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ VITE_APP_TITLE = 新能源项目管理平台 VITE_APP_ENV = 'development' # 开发环境 -VITE_APP_BASE_API = 'http://192.168.110.126:8899' +VITE_APP_BASE_API = 'http://192.168.110.119:8899' # 无人机接口地址 diff --git a/package.json b/package.json index 7dd773c..153726b 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "echarts": "5.5.0", "element-plus": "2.8.8", "esbuild": "^0.25.0", + "ezuikit-js": "^8.1.10", "file-saver": "2.0.5", "fuse.js": "7.0.0", "highlight.js": "11.9.0", diff --git a/src/api/other/devicePreset/index.ts b/src/api/other/devicePreset/index.ts new file mode 100644 index 0000000..25b830b --- /dev/null +++ b/src/api/other/devicePreset/index.ts @@ -0,0 +1,74 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { DevicePresetVO, DevicePresetForm, DevicePresetQuery } from '@/api/other/devicePreset/types'; + +/** + * 查询摄像头预置位列表 + * @param query + * @returns {*} + */ + +export const listDevicePreset = (query?: DevicePresetQuery): AxiosPromise => { + return request({ + url: '/other/devicePreset/list', + method: 'get', + params: query + }); +}; + +/** + * 查询摄像头预置位详细 + * @param id + */ +export const getDevicePreset = (id: string | number): AxiosPromise => { + return request({ + url: '/other/devicePreset/' + id, + method: 'get' + }); +}; + +/** + * 新增摄像头预置位 + * @param data + */ +export const addDevicePreset = (data: DevicePresetForm) => { + return request({ + url: '/other/devicePreset', + method: 'post', + data: data + }); +}; + +/** + * 修改摄像头预置位 + * @param data + */ +export const updateDevicePreset = (data: DevicePresetForm) => { + return request({ + url: '/other/devicePreset', + method: 'put', + data: data + }); +}; + +/** + * 删除摄像头预置位 + * @param id + */ +export const delDevicePreset = (id: string | number | Array) => { + return request({ + url: '/other/devicePreset/' + id, + method: 'delete' + }); +}; + +/** + * 调用摄像头预置位 + * @param data + */ +export const callDevicePreset = (id: number | string) => { + return request({ + url: '/other/devicePreset/move/' + id, + method: 'put' + }); +}; diff --git a/src/api/other/devicePreset/types.ts b/src/api/other/devicePreset/types.ts new file mode 100644 index 0000000..797be90 --- /dev/null +++ b/src/api/other/devicePreset/types.ts @@ -0,0 +1,80 @@ +export interface DevicePresetVO { + /** + * 主键id + */ + id: string | number; + + /** + * 设备序列号 + */ + deviceSerial: string; + + /** + * 通道号 + */ + channelNo: number; + + /** + * 预置点序号 + */ + index: number; + + /** + * 预置点 + */ + name: string; +} + +export interface DevicePresetForm extends BaseEntity { + /** + * 主键id + */ + id?: string | number; + + /** + * 设备序列号 + */ + deviceSerial?: string; + + /** + * 通道号 + */ + channelNo?: number | string; + + /** + * 预置点序号 + */ + index?: number; + + /** + * 预置点 + */ + name?: string; +} + +export interface DevicePresetQuery extends PageQuery { + /** + * 设备序列号 + */ + deviceSerial?: string; + + /** + * 通道号 + */ + channelNo?: number; + + /** + * 预置点序号 + */ + index?: number; + + /** + * 预置点 + */ + name?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/other/ys7Device/index.ts b/src/api/other/ys7Device/index.ts index 585ccfa..e94e93a 100644 --- a/src/api/other/ys7Device/index.ts +++ b/src/api/other/ys7Device/index.ts @@ -78,3 +78,14 @@ export const devicesLinkPro = (data: { id: string | number; projectId: string | data }); }; + +/** + * 获取 token + * @param id + */ +export const getAccessToken = () => { + return request({ + url: '/other/ys7Device/get/token', + method: 'get' + }); +}; diff --git a/src/views/other/ys7Device/component/add.vue b/src/views/other/ys7Device/component/add.vue deleted file mode 100644 index 6555dc0..0000000 --- a/src/views/other/ys7Device/component/add.vue +++ /dev/null @@ -1,145 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/other/ys7Device/component/bindPro.vue b/src/views/other/ys7Device/component/bindPro.vue index 88231cb..2caa07c 100644 --- a/src/views/other/ys7Device/component/bindPro.vue +++ b/src/views/other/ys7Device/component/bindPro.vue @@ -49,10 +49,14 @@ const state = reactive({ const openDialog = (row: any) => { resetForm(); - - if (row.row && row.row.id) { - state.formData.id = row.row.id; + if (row.serials.length) { + state.formData.id = row.serials; } + if (row.row && row.row.id) { + state.formData.id = [row.row.id]; + } + console.log('🚀 ~ openDialog ~ state.formData:', state.formData); + state.isShowDialog = true; }; diff --git a/src/views/other/ys7Device/component/detail.vue b/src/views/other/ys7Device/component/detail.vue deleted file mode 100644 index 1cdfa93..0000000 --- a/src/views/other/ys7Device/component/detail.vue +++ /dev/null @@ -1,149 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/other/ys7Device/component/edit.vue b/src/views/other/ys7Device/component/edit.vue index 0cda562..63afcf2 100644 --- a/src/views/other/ys7Device/component/edit.vue +++ b/src/views/other/ys7Device/component/edit.vue @@ -1,20 +1,22 @@ -