From 6d34bcfde7eabbcd72cafe9370d2737c6612b734 Mon Sep 17 00:00:00 2001 From: sjl <1716605279@qq.com> Date: Thu, 28 Nov 2024 14:30:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=B5=8B=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/device/interface/testScript.ts | 6 +- .../src/api/device/interface/testSource.ts | 33 +++- frontend/src/api/device/testSource/index.ts | 25 ++- .../src/views/authority/resource/index.vue | 11 +- .../testSource/components/parameterPopup.vue | 13 ++ .../testSource/components/parameterTable.vue | 116 ++++++++++++ .../testSource/components/testSourcePopup.vue | 167 ++++++++++++++++++ .../src/views/machine/testSource/index.vue | 62 +++++-- 8 files changed, 395 insertions(+), 38 deletions(-) create mode 100644 frontend/src/views/machine/testSource/components/parameterPopup.vue create mode 100644 frontend/src/views/machine/testSource/components/parameterTable.vue create mode 100644 frontend/src/views/machine/testSource/components/testSourcePopup.vue diff --git a/frontend/src/api/device/interface/testScript.ts b/frontend/src/api/device/interface/testScript.ts index 671ed23..2356bfc 100644 --- a/frontend/src/api/device/interface/testScript.ts +++ b/frontend/src/api/device/interface/testScript.ts @@ -5,7 +5,7 @@ export namespace TestScript { /** - * 电能质量指标字典数据表格分页查询参数 + * 检测脚本表格分页查询参数 */ export interface ReqTestScriptParams extends ReqPage{ id: string; // 装置序号id 必填 @@ -30,9 +30,9 @@ export namespace TestScript { } /** - * 被检设备表格查询分页返回的对象; + * 检测脚本查询分页返回的对象; */ - export interface ResPqDevPage extends ResPage { + export interface ResTestScriptPage extends ResPage { } } \ No newline at end of file diff --git a/frontend/src/api/device/interface/testSource.ts b/frontend/src/api/device/interface/testSource.ts index 61ca413..cbe45a1 100644 --- a/frontend/src/api/device/interface/testSource.ts +++ b/frontend/src/api/device/interface/testSource.ts @@ -1,20 +1,35 @@ -import type { ReqPage } from '@/api/interface' +import type { ReqPage, ResPage } from '@/api/interface' // 检测源模块 export namespace TestSource { + /** + * 检测脚本表格分页查询参数 + */ + export interface ReqTestSourceParams extends ReqPage{ + id: string; // 装置序号id 必填 + name: string; + pattern: string; + } + // 检测源接口 - export interface TestSourceBO { - id?: string; //检测源ID - name: string; //检测源名称 + export interface ResTestSource { + id: string; //检测源ID + name: string; //检测源名称(检测源类型 + 设备类型 + 数字自动生成) pattern: string;//检测源模式(字典表Code字段,数字、模拟、比对) type: string; //检测源类型(字典表Code字段,标准源、高精度设备) devType: string;//检测源设备类型(字典表Code字段) - parameters: string;//源参数(JSON字符串) + parameter?: string;//源参数(JSON字符串) + state:number;// + createBy?: string; + createTime?: string; + updateBy?: string; + updateTime?: string; } - // 检测源+分页 - export interface ReqTestSourceParams extends ReqPage,TestSourceBO { - - } + /* 检测脚本查询分页返回的对象; + */ + export interface ResTestSourcePage extends ResPage { + + } } \ No newline at end of file diff --git a/frontend/src/api/device/testSource/index.ts b/frontend/src/api/device/testSource/index.ts index 1bcf3d2..c4a3ebb 100644 --- a/frontend/src/api/device/testSource/index.ts +++ b/frontend/src/api/device/testSource/index.ts @@ -5,8 +5,27 @@ import http from '@/api' /** * @name 检测源管理模块 */ -// 获取检测脚本列表 +// 获取检测源列表 export const getTestSourceList = (params: TestSource.ReqTestSourceParams) => { - return http.post>(`/testSource/list`, params) - // return http.post>(`${rePrefix}/testSource/list`, params) + return http.post(`/pqSource/list`, params) +} + +//根据id查询检测源 +export const getTestSourceById = (params: TestSource.ResTestSource) => { + return http.get(`/pqSource/getById?id=${params.id}`) +} + +//添加检测源 +export const addTestSource = (params: TestSource.ResTestSource) => { + return http.post(`/pqSource/add`, params) +} + +//编辑检测源 +export const updateTestSource = (params: TestSource.ResTestSource) => { + return http.post(`/pqSource/update`, params) +} + +//删除检测源 +export const deleteTestSource = (params: string[]) => { + return http.post(`/pqSource/delete`, params) } diff --git a/frontend/src/views/authority/resource/index.vue b/frontend/src/views/authority/resource/index.vue index 89e7b13..8cd37f2 100644 --- a/frontend/src/views/authority/resource/index.vue +++ b/frontend/src/views/authority/resource/index.vue @@ -124,19 +124,20 @@ // 打开 drawer(新增、编辑) const openDialog = (titleType: string, row: Partial = {}) => { resourcePopup.value?.open(titleType, row) + } - // 删除用户信息 + // 删除菜单信息 const handleDelete = async (params: Function.ResFunction) => { - await useHandleData(deleteFunction, params , `删除【${params.name}】用户`) - proTable.value?.getTableList() + await useHandleData(deleteFunction, params , `删除【${params.name}】菜单`) + proTable.value?.getTableList() } - // 批量删除用户信息 + // 批量删除菜单信息 const batchDelete = async (id: string[]) => { - await useHandleData(deleteFunction, { id }, '删除所选用户信息') + await useHandleData(deleteFunction, { id }, '删除所选菜单信息') proTable.value?.clearSelection() proTable.value?.getTableList() } diff --git a/frontend/src/views/machine/testSource/components/parameterPopup.vue b/frontend/src/views/machine/testSource/components/parameterPopup.vue new file mode 100644 index 0000000..8e8347f --- /dev/null +++ b/frontend/src/views/machine/testSource/components/parameterPopup.vue @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/views/machine/testSource/components/parameterTable.vue b/frontend/src/views/machine/testSource/components/parameterTable.vue new file mode 100644 index 0000000..44a2b76 --- /dev/null +++ b/frontend/src/views/machine/testSource/components/parameterTable.vue @@ -0,0 +1,116 @@ + + + + \ No newline at end of file diff --git a/frontend/src/views/machine/testSource/components/testSourcePopup.vue b/frontend/src/views/machine/testSource/components/testSourcePopup.vue new file mode 100644 index 0000000..6b86c16 --- /dev/null +++ b/frontend/src/views/machine/testSource/components/testSourcePopup.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/frontend/src/views/machine/testSource/index.vue b/frontend/src/views/machine/testSource/index.vue index 29dbaec..5416bca 100644 --- a/frontend/src/views/machine/testSource/index.vue +++ b/frontend/src/views/machine/testSource/index.vue @@ -8,22 +8,22 @@ - + + \ No newline at end of file