diff --git a/.vscode/settings.json b/.vscode/settings.json index 70cc437..c8ff8fc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { "cSpell.words": [ "Chns", + "Combox", "daterange", "devicedata", "errordata", diff --git a/frontend/src/api/system/dictData.ts b/frontend/src/api/system/dictData.ts index 17ce9e1..18ac6c1 100644 --- a/frontend/src/api/system/dictData.ts +++ b/frontend/src/api/system/dictData.ts @@ -1,7 +1,11 @@ + /** * 模拟字典静态数据,有后端接口后,需要删除 todo... */ -import { Dict } from '@/api/interface' +/** + * 模拟字典静态数据,有后端接口后,需要删除 todo... + */ +import type { Dict } from '@/api/interface' const dictData: Dict[] = [ { diff --git a/frontend/src/api/system/dictionary/dictPq/index.ts b/frontend/src/api/system/dictionary/dictPq/index.ts new file mode 100644 index 0000000..c57e6db --- /dev/null +++ b/frontend/src/api/system/dictionary/dictPq/index.ts @@ -0,0 +1,22 @@ +import http from '@/api' +import { type Dict } from '@/api/system/dictionary/interface' + +//获取字典类型 +export const getDictPqList = (params: Dict.ReqDictPqParams) => { + return http.post(`/dictPq/list`, params) +} + +//添加字典类型 +export const addDictPq = (params: Dict.ResDictPq) => { + return http.post(`/dictPq/add`, params) +} + +//编辑字典类型 +export const updateDictPq = (params: Dict.ResDictPq) => { + return http.post(`/dictPq/update`, params) +} + +//删除字典类型 +export const deleteDictPq = (params: string[]) => { + return http.post(`/dictPq/delete`, params) +} \ No newline at end of file diff --git a/frontend/src/api/system/dictionary/interface/index.ts b/frontend/src/api/system/dictionary/interface/index.ts index 6b6fec8..e60fa6f 100644 --- a/frontend/src/api/system/dictionary/interface/index.ts +++ b/frontend/src/api/system/dictionary/interface/index.ts @@ -80,4 +80,63 @@ export namespace Dict { } + + + /** + * 电能质量指标字典数据表格分页查询参数 + */ + export interface ReqDictPqParams extends ReqPage{ + id: string; // 类型id 必填 + name?: string; // 名称 + phase?: string;//相别 + dataType?: string;//数据模型(epd、pqd...) + } + + /** + * 电能质量指标字典数据新增、修改、根据id查询返回的对象 + */ + export interface ResDictPq { + id: string;//指标字典表Id + name: string;//指标名称 + phase: string;//相别 + dataType: string;//数据模型(epd、pqd...) + otherName?: string | null;//别名(默认与Name相同,主要是为了适配不同数据库里面字段) + showName?:string | null;//显示名称 + sort:number;//排序 + type?: string | null;//指标数据类型(整型、浮点型、枚举型这些的) + unit?: string | null;//单位 + harmStart?:number | null;//起始次数 + harmEnd?:number | null;//结束次数 + classId?: string | null;//数据表表名 + statMethod?:string | null;//数据统计类型(最大、最小、平均、CP95) + systemType?:string | null;//系统类别(区分用能/电能) + tranFlag?:number | null;//数据是否上送(0:不上送 1:上送) + tranRule?:string | null;//上送规则 变化:“change”周期 :“ period” + eventType?:string | null;//evt的事件类别 "1"、"2"; + storeFlag?:string | null;//sts、di的是否存储 1:存储 0:不存 储; + curSts?:number | null;//sts、do的当前值; + ctlSts?:number | null;//do的是否可远程控制 1:是 0:否; + maxNum?:number | null;//设置最大值 + minNum?: number | null;//设置最小值 + setValue?:string | null;//参数为enum可设置的所有值序列 + strlen?:number | null;//参数string可设置字符串的长度上 限 + defaultValue?:string | null; //参数缺省值、告警code值 + resourcesId?:string | null; //报表数据来源(统计表表名) + limitName?:string | null; //限值字段名称 + limitTable?:string | null;//限值表名 + formula?:string | null;//超标判断方式 + primaryFormula?:string | null;//二次值转一次值公式 + state:number;//状态:0-删除 1-正常 + createBy?:string | null;//创建用户 + createTime?:string | null;//创建时间 + updateBy?:string | null;//更新用户 + updateTime?:string | null;//更新时间 + } + + /** + * 电能质量指标字典数据表格查询分页返回的对象; + */ + export interface ResDictPqPage extends ResPage { + + } } diff --git a/frontend/src/api/user/login.ts b/frontend/src/api/user/login.ts index 10f52fb..026d172 100644 --- a/frontend/src/api/user/login.ts +++ b/frontend/src/api/user/login.ts @@ -1,6 +1,7 @@ import { Login } from './interface' import { ADMIN as rePrefix } from '@/api/config/serviceName' import http from '@/api' +import type { Dict } from '../interface' /** * @name 登录模块 */ @@ -22,4 +23,10 @@ export const getAuthButtonListApi = () => { // 用户退出登录 export const logoutApi = () => { return http.post(`${rePrefix}/logout`) -} \ No newline at end of file +} + +//获取下拉框列表 +export const getDictList = (params:string) =>{ + return http.post('/dictData/dictDataCache',params) +} + diff --git a/frontend/src/stores/modules/auth.ts b/frontend/src/stores/modules/auth.ts index 8e9ddcd..097375e 100644 --- a/frontend/src/stores/modules/auth.ts +++ b/frontend/src/stores/modules/auth.ts @@ -45,6 +45,7 @@ export const useAuthStore = defineStore({ async getAuthMenuList() { const { data } = await getAuthMenuListApi(); this.authMenuList = data; + }, // Set RouteName async setRouteName(name: string) { diff --git a/frontend/src/stores/modules/dict.ts b/frontend/src/stores/modules/dict.ts index 06aab62..c97c629 100644 --- a/frontend/src/stores/modules/dict.ts +++ b/frontend/src/stores/modules/dict.ts @@ -4,6 +4,9 @@ import { DICT_STORE_KEY } from '@/stores/constant' // 模拟数据 import dictData from '@/api/system/dictData' +//import { getDictList } from '@/api/user/login.ts' +//const dictData = getDictList + export const useDictStore = defineStore({ id: DICT_STORE_KEY, state: () => ({ diff --git a/frontend/src/views/system/dictionary/dictPq/components/pqPopup.vue b/frontend/src/views/system/dictionary/dictPq/components/pqPopup.vue new file mode 100644 index 0000000..0f9dede --- /dev/null +++ b/frontend/src/views/system/dictionary/dictPq/components/pqPopup.vue @@ -0,0 +1,240 @@ + + \ No newline at end of file diff --git a/frontend/src/views/system/dictionary/dictPq/index.vue b/frontend/src/views/system/dictionary/dictPq/index.vue new file mode 100644 index 0000000..e4ab234 --- /dev/null +++ b/frontend/src/views/system/dictionary/dictPq/index.vue @@ -0,0 +1,154 @@ + + + + \ No newline at end of file diff --git a/frontend/src/views/system/dictionary/dictType/index.vue b/frontend/src/views/system/dictionary/dictType/index.vue index 5176cc9..cf87743 100644 --- a/frontend/src/views/system/dictionary/dictType/index.vue +++ b/frontend/src/views/system/dictionary/dictType/index.vue @@ -22,7 +22,7 @@ - +