diff --git a/frontend/src/api/device/interface/testScript.ts b/frontend/src/api/device/interface/testScript.ts index 14843bb..671ed23 100644 --- a/frontend/src/api/device/interface/testScript.ts +++ b/frontend/src/api/device/interface/testScript.ts @@ -1,26 +1,38 @@ -import type { ReqPage } from '@/api/interface' +import type { ReqPage, ResPage } from '@/api/interface' // 检测脚本模块 export namespace TestScript { + + /** + * 电能质量指标字典数据表格分页查询参数 + */ + export interface ReqTestScriptParams extends ReqPage{ + id: string; // 装置序号id 必填 + name: string; + type: string; + } + // 检测脚本接口 - export interface TestScriptBO { + export interface ResTestScript { id?: string; //检测脚本ID name: string; //检测脚本名称 type: string; //检测脚本类型(字典表Code字段,脚本还是模板) pattern: string;//检测脚本模式(字典表Code字段,数字、模拟、比对) - valueType: string;//脚本值类型(字典表Code字段,相对值脚本、绝对值脚本、无) + valueType?: string;//脚本值类型(字典表Code字段,相对值脚本、绝对值脚本、无) standardName: string;//参照标准名称 standardTime: string;//标准推行时间 state:number;// - createBy: string; - createTime: string; - updateBy: string; - updateTime: string; + createBy?: string; + createTime?: string; + updateBy?: string; + updateTime?: string; } - // 检测脚本+分页 - export interface ReqTestScriptParams extends ReqPage,TestScriptBO { + /** + * 被检设备表格查询分页返回的对象; + */ + export interface ResPqDevPage extends ResPage { - } + } } \ No newline at end of file diff --git a/frontend/src/api/device/monitor/index.ts b/frontend/src/api/device/monitor/index.ts index 241fa49..0782151 100644 --- a/frontend/src/api/device/monitor/index.ts +++ b/frontend/src/api/device/monitor/index.ts @@ -2,25 +2,25 @@ import type { Monitor } from '@/api/device/interface/monitor' import http from '@/api' /** - * @name 被检设备管理模块 + * @name 监测点管理模块 */ -//获取被检设备 +//获取监测点 export const getPqMonList = (params: Monitor.ReqPqMonParams) => { return http.post(`/pqMon/list`, params) } -//添加被检设备 +//添加监测点 export const addPqMon = (params: Monitor.ResPqMon) => { return http.post(`/pqMon/add`, params) } -//编辑被检设备 +//编辑监测点 export const updatePqMon = (params: Monitor.ResPqMon) => { return http.post(`/pqMon/update`, params) } -//删除被检设备 +//删除监测点 export const deletePqMon = (params: string[]) => { return http.post(`/pqMon/delete`, params) } diff --git a/frontend/src/api/device/testScript/index.ts b/frontend/src/api/device/testScript/index.ts index a0d2fbc..622bbaf 100644 --- a/frontend/src/api/device/testScript/index.ts +++ b/frontend/src/api/device/testScript/index.ts @@ -1,4 +1,3 @@ -import type { ResPage } from '@/api/interface' import type { TestScript } from '@/api/device/interface/testScript' import http from '@/api' @@ -6,7 +5,17 @@ import http from '@/api' * @name 检测脚本管理模块 */ // 获取检测脚本列表 -export const getTestScriptList = (params: TestScript.ReqTestScriptParams) => { - return http.post>(`/testScript/list`, params) - // return http.post>(`${rePrefix}/testScript/list`, params) +export const getPqScriptList = (params: TestScript.ReqTestScriptParams) => { + return http.post(`/pqScript/list`, params) +} + + +//升级为模版 +export const updatePqScript = (params: TestScript.ResTestScript) => { + return http.get(`/pqScript/upgradeToTemplate?id=${params.id}`) +} + +//删除检测脚本 +export const deletePqScript = (params: string[]) => { + return http.post(`/pqScript/delete`, params) } diff --git a/frontend/src/api/system/base/index.ts b/frontend/src/api/system/base/index.ts new file mode 100644 index 0000000..cc6f4ed --- /dev/null +++ b/frontend/src/api/system/base/index.ts @@ -0,0 +1,17 @@ +import http from '@/api' +import {type Base} from '@/api/system/base/interface' + +//获取检测配置 +export const getTestConfig = () => { + return http.get(`/sysTestConfig/getConfig`) +} + + +//编辑检测配置 +export const updateTestConfig = (params: Base.ResTestConfig) => { + return http.post(`/sysTestConfig/update`, params) +} + + + + diff --git a/frontend/src/api/system/base/interface/index.ts b/frontend/src/api/system/base/interface/index.ts new file mode 100644 index 0000000..cdb96cf --- /dev/null +++ b/frontend/src/api/system/base/interface/index.ts @@ -0,0 +1,19 @@ +// 检测配置表模块 +export namespace Base { + + /** + * 检测配置表查询返回的对象 + */ + export interface ResTestConfig { + id: string; //系统配置表Id + autoGenerate:number;//检测报告是否自动生成0 否;1是 + maxTime:number;//最大复检次数,默认3次 + dataRule:string;//数据处理原则,关联字典(所有值、部分值、cp95值、平均值、任意值),默认任意值 + state: number; //状态 + createBy?: string| null; //创建用户 + createTime?: string| null; //创建时间 + updateBy?: string| null; //更新用户 + updateTime?: string| null; //更新时间 + + } + } \ No newline at end of file diff --git a/frontend/src/api/system/versionRegister/index.ts b/frontend/src/api/system/versionRegister/index.ts new file mode 100644 index 0000000..de8f289 --- /dev/null +++ b/frontend/src/api/system/versionRegister/index.ts @@ -0,0 +1,13 @@ +import http from '@/api' +import {type VersionRegister} from '@/api/system/versionRegister/interface' + +//获取有效数据配置 +export const getRegRes = (params: VersionRegister.ResSys_Reg_Res) => { + return http.get(`/sysRegRes/getRegResByType?id=${params.type}`) +} + + +//编辑有效数据配置 +export const updateRegRes = (params: VersionRegister.Sys_Reg_Res) => { + return http.post(`/sysRegRes/update`, params) +} \ No newline at end of file diff --git a/frontend/src/api/system/versionRegister/interface/index.ts b/frontend/src/api/system/versionRegister/interface/index.ts new file mode 100644 index 0000000..3644039 --- /dev/null +++ b/frontend/src/api/system/versionRegister/interface/index.ts @@ -0,0 +1,31 @@ +// 检测配置表模块 +export namespace VersionRegister { + + /** + * 检测配置表查询返回的对象 + */ + export interface ResSys_Reg_Res { + id: string; //版本注册表Id + type: string; //版本类型(模拟式、数字式、比对式) + code: string; //注册码 + licenseKey: string; //密钥 + expireDate: string; //到期时间 + waveRecord?: number; + realTime?: number; + statistics?: number; + flicker?: number; + state: number; //状态 + createBy?: string| null; //创建用户 + createTime?: string| null; //创建时间 + updateBy?: string| null; //更新用户 + updateTime?: string| null; //更新时间 + } + + export interface Sys_Reg_Res { + id: string; + waveRecord?: number; + realTime?: number; + statistics?: number; + flicker?: number; + } + } \ No newline at end of file diff --git a/frontend/src/languages/modules/en.ts b/frontend/src/languages/modules/en.ts index 2ea0a70..8653fb0 100644 --- a/frontend/src/languages/modules/en.ts +++ b/frontend/src/languages/modules/en.ts @@ -25,6 +25,7 @@ export default { personalData: "Personal Data", changePassword: "Change Password", changeMode:"Change Mode", + versionRegister:"Version Register", logout: "Logout" } }; diff --git a/frontend/src/languages/modules/zh.ts b/frontend/src/languages/modules/zh.ts index ce576f1..ea95310 100644 --- a/frontend/src/languages/modules/zh.ts +++ b/frontend/src/languages/modules/zh.ts @@ -25,6 +25,7 @@ export default { personalData: "个人信息", changePassword: "修改密码", changeMode:"模式切换", + versionRegister:"版本注册", logout: "退出登录" } }; diff --git a/frontend/src/layouts/components/Header/components/Avatar.vue b/frontend/src/layouts/components/Header/components/Avatar.vue index 4beee31..7239ef9 100644 --- a/frontend/src/layouts/components/Header/components/Avatar.vue +++ b/frontend/src/layouts/components/Header/components/Avatar.vue @@ -19,6 +19,9 @@ {{ $t("header.changeMode") }} + + {{ $t("header.versionRegister") }} + @@ -29,6 +32,8 @@ + + + \ No newline at end of file diff --git a/frontend/src/views/home/components/dataCheckPopup.vue b/frontend/src/views/home/components/dataCheckPopup.vue new file mode 100644 index 0000000..579185a --- /dev/null +++ b/frontend/src/views/home/components/dataCheckPopup.vue @@ -0,0 +1,173 @@ + + + \ No newline at end of file diff --git a/frontend/src/views/home/components/dataCheckRawDataTable.vue b/frontend/src/views/home/components/dataCheckRawDataTable.vue new file mode 100644 index 0000000..470f245 --- /dev/null +++ b/frontend/src/views/home/components/dataCheckRawDataTable.vue @@ -0,0 +1,133 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/views/home/components/dataCheckResultTable.vue b/frontend/src/views/home/components/dataCheckResultTable.vue new file mode 100644 index 0000000..19b7d22 --- /dev/null +++ b/frontend/src/views/home/components/dataCheckResultTable.vue @@ -0,0 +1,102 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue new file mode 100644 index 0000000..26434fc --- /dev/null +++ b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue @@ -0,0 +1,156 @@ + + + \ No newline at end of file diff --git a/frontend/src/views/home/components/preTest.vue b/frontend/src/views/home/components/preTest.vue index 6f45ea8..a2f517c 100644 --- a/frontend/src/views/home/components/preTest.vue +++ b/frontend/src/views/home/components/preTest.vue @@ -1,64 +1,18 @@ @@ -35,11 +33,12 @@ import { useDownload } from '@/hooks/useDownload' import { useAuthButtons } from '@/hooks/useAuthButtons' import ProTable from '@/components/ProTable/index.vue' import type{ ProTableInstance, ColumnProps } from '@/components/ProTable/interface' -import { CirclePlus, Delete, EditPen, Share, Download, Upload, View, Refresh } from '@element-plus/icons-vue' +import { CirclePlus, Delete, EditPen, Share } from '@element-plus/icons-vue' import { useDictStore } from '@/stores/modules/dict' import { - getTestScriptList, + getPqScriptList,updatePqScript,deletePqScript, } from '@/api/device/testScript/index' +import { reactive, ref } from 'vue' const dictStore = useDictStore() @@ -47,41 +46,17 @@ const dictStore = useDictStore() // ProTable 实例 const proTable = ref() -// 如果表格需要初始化请求参数,直接定义传给 ProTable (之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据) -const initParam = reactive({ pattern: 1 })//表示当前用户选择的是模拟式测试,后期要读取pinia中的数据 TODO... - -// dataCallback 是对于返回的表格数据做处理,如果你后台返回的数据不是 list && total 这些字段,可以在这里进行处理成这些字段 -// 或者直接去 hooks/useTable.ts 文件中把字段改为你后端对应的就行 -const dataCallback = (data: any) => { - return { - list: data.list, - total: data.total, - pageNum: data.pageNum, - pageSize: data.pageSize, - } -} - -// 如果你想在请求之前对当前请求参数做一些操作,可以自定义如下函数:params 为当前所有的请求参数(包括分页),最后返回请求列表接口 -// 默认不做操作就直接在 ProTable 组件上绑定 :requestApi="getUserList" -const getTableList = (params: any) => { - let newParams = JSON.parse(JSON.stringify(params)) - newParams.createTime && (newParams.startTime = newParams.createTime[0]) - newParams.createTime && (newParams.endTime = newParams.createTime[1]) - delete newParams.createTime - return getTestScriptList(newParams) -} - -// 页面按钮权限(按钮权限既可以使用 hooks,也可以直接使用 v-auth 指令,指令适合直接绑定在按钮上,hooks 适合根据按钮权限显示不同的内容) -const { BUTTONS } = useAuthButtons() - +const templateTypes = reactive([ + { id: 0, name: '脚本' }, + { id: 1, name: '模版' } +]); // 表格配置项 -const columns = reactive[]>([ +const columns = reactive[]>([ { type: 'selection', fixed: 'left', width: 70 }, { type: 'index', fixed: 'left', width: 70, label: '序号' }, { prop: 'name', label: '名称', - search: { el: 'input' }, minWidth: 350, }, { @@ -97,21 +72,51 @@ const columns = reactive[]>([ { prop: 'valueType', label: '值类型', - enum: dictStore.getDictData('testScriptValueType'), - fieldNames: { label: 'label', value: 'id' }, + enum: dictStore.getDictData('Script_Value_Type'), + fieldNames: { label: 'name', value: 'id' }, search: { el: 'select' }, minWidth: 150, }, { prop: 'type', label: '模板类型', - enum: dictStore.getDictData('testScriptType'), - fieldNames: { label: 'label', value: 'id' }, - search: { el: 'select' }, minWidth: 150, + render: scope => { + return ( + {scope.row.type ? '模版' : '脚本'} + ) + }, }, { prop: 'operation', label: '操作', fixed: 'right', width: 250 }, ]) + +// 打开 drawer(新增、编辑) +const openDialog = (titleType: string, row: Partial = {}) => { + +} + + + +// 批量删除设备 +const batchDelete = async (id: string[]) => { + await useHandleData(deletePqScript, id, '删除所选脚本') + proTable.value?.clearSelection() + proTable.value?.getTableList() +} + +// 删除设备 +const handleDelete = async (params: TestScript.ResTestScript) => { + await useHandleData(deletePqScript, [params.id], `删除【${params.name}】脚本`) + proTable.value?.getTableList() +} + +// 升级为模版 +const updateType = async (params: TestScript.ResTestScript) => { + await useHandleData(updatePqScript, params, `升级【${params.name}】为模版`) + proTable.value?.getTableList() +} + + diff --git a/frontend/src/views/system/base/index.vue b/frontend/src/views/system/base/index.vue new file mode 100644 index 0000000..c6e9f85 --- /dev/null +++ b/frontend/src/views/system/base/index.vue @@ -0,0 +1,195 @@ + + + + \ No newline at end of file diff --git a/frontend/src/views/system/versionRegister/index.vue b/frontend/src/views/system/versionRegister/index.vue new file mode 100644 index 0000000..99c39be --- /dev/null +++ b/frontend/src/views/system/versionRegister/index.vue @@ -0,0 +1,54 @@ + + + \ No newline at end of file