diff --git a/frontend/src/api/system/dictionary/dictData/index.ts b/frontend/src/api/system/dictionary/dictData/index.ts index bee0146..afa9c7c 100644 --- a/frontend/src/api/system/dictionary/dictData/index.ts +++ b/frontend/src/api/system/dictionary/dictData/index.ts @@ -1,5 +1,6 @@ import http from '@/api' import {type Dict} from '@/api/system/dictionary/interface' +import type {ResultData} from "@/api/interface"; //获取字典数据 export const getDictDataListByTypeId = (params: Dict.ReqDictDataParams) => { diff --git a/frontend/src/api/system/dictionary/dictExample.ts b/frontend/src/api/system/dictionary/dictExample.ts deleted file mode 100644 index 16a4145..0000000 --- a/frontend/src/api/system/dictionary/dictExample.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { type Dict } from "@/api/system/dictionary/interface"; - -export const dictTypeList: Dict.ResDictType[] = [ - { - id: "1", - name: "用户性别", - code: "EXAMPLE_CODE1", - sort: 100, - openLevel: 1, - openDescribe: 1, - remark: "示例描述示例描述示例描述12231", - state: 1, - createBy: "admin", - createTime: "2023-10-01 12:00:00", - updateBy: "admin", - updateTime: "2023-10-12 14:40:00", - }, - { - id: "231", - name: "菜单状态", - code: "EXAMPLE_CODE2", - sort: 100, - openLevel: 1, - openDescribe: 1, - remark: "示例描述示例描述示例描述11133", - state: 0, - createBy: "admin", - createTime: "2023-10-01 12:00:00", - updateBy: "admin", - updateTime: "2023-10-10 12:00:00", - }, - { - id: "33", - name: "系统开关", - code: "EXAMPLE_CODE3", - sort: 100, - openLevel: 1, - openDescribe: 1, - remark: "示例描述示例描述示例描述11144", - state: 1, - createBy: "admin", - createTime: "2023-10-01 12:00:00", - updateBy: "admin", - updateTime: "2023-10-10 12:00:00", - }, -]; - -export const dictDataList: Dict.ResDictData[] = [ - { - id: "210", - typeId: "101", - name: "字典项1", - code: "EXAMPLE_00111", - sort:100, - level: 1, - algoDescribe: null, - value: "字典值1", - state: 1, - createBy: "admin", - createTime: "2023-10-01 12:00:00", - updateBy: "admin", - updateTime: "2023-10-01 14:43:03", - }, - { - id: "2210", - typeId: "101", - name: "字典项2", - code: "EXAMPLE_00121", - sort:100, - level: 2, - algoDescribe: null, - value: "字典值2", - state: 1, - createBy: "admin", - createTime: "2023-10-03 12:00:00", - updateBy: "admin", - updateTime: "2023-10-05 14:43:03", - }, - { - id: "212", - typeId: "101", - name: "字典项3", - code: "EXAMPLE_00141", - sort:100, - level: 3, - algoDescribe: null, - value: "字典值3", - state: 0, - createBy: "admin", - createTime: "2023-10-01 11:00:00", - updateBy: "admin", - updateTime: "2023-10-05 16:43:03", - }, - { - id: "210", - typeId: "101", - name: "字典项4", - code: "EXAMPLE_00311", - sort:100, - level: null, - algoDescribe: null, - value: "字典值4", - state: 0, - createBy: "admin", - createTime: "2023-10-03 12:40:00", - updateBy: "admin", - updateTime: "2023-10-04 14:43:03", - }, - { - id: "217", - typeId: "101", - name: "字典项5", - code: "EXAMPLE_00341", - sort:100, - level: undefined, - algoDescribe: null, - value: "字典值5", - state: 1, - createBy: "admin", - createTime: "2023-10-06 12:45:03", - updateBy: "admin", - updateTime: "2023-10-07 19:37:03", - }, - { - id: "237", - typeId: "101", - name: "字典项6", - code: "EXAMPLE_00318", - sort:100, - level: 0, - algoDescribe: null, - value: "字典值6", - state: 1, - createBy: "admin", - createTime: "2023-10-16 10:45:03", - updateBy: "admin", - updateTime: "2023-10-17 19:37:03", - }, -]; diff --git a/frontend/src/api/system/dictionary/index.ts b/frontend/src/api/system/dictionary/index.ts deleted file mode 100644 index 1a98d7b..0000000 --- a/frontend/src/api/system/dictionary/index.ts +++ /dev/null @@ -1,70 +0,0 @@ -import http from "@/api"; -import { ADMIN as rePrefix } from "@/api/config/serviceName"; -import { type Dict } from "@/api/system/dictionary/interface"; - -//获取字典类型 -export const getDictTypeList = (params: Dict.ReqDictTypeParams) => { - return http.post(`${rePrefix}/dict/list`, params); -}; - -//添加字典类型 -export const addDictType = (params: Dict.ReqDictTypeParams) => { - return http.post(`${rePrefix}/dict/add`,params); -}; - -//删除字典类型 -export const deleteDictType = (params: { id: string[] }) => { - return http.post(`${rePrefix}/dict/delete`, { data: params }); -}; - -//编辑字典类型 -export const updateDictType = (params: Dict.ReqDictTypeParams) => { - return http.post(`${rePrefix}/dict/update`, params); -}; - -//导出字典类型 -export const exportDictType = (params: Dict.ResDictType) => { - return http.download(`${rePrefix}/dict/export`, params); -}; - -//批量添加字典类型 -export const batchAddDictType = (params: FormData) => { - return http.post(`${rePrefix}/dict/import`, params); -}; - - - - - -//获取字典数据 -export const getDictDataList = (params: Dict.ReqDictDataParams) => { - return http.post(`${rePrefix}/dict-data/list`, params); -}; - -//添加字典数据 -export const addDictData = (params: Dict.ReqDictDataParams) => { - return http.post(`${rePrefix}/dict-data/add`, params); -}; - -//删除字典数据 -export const deleteDictData = (params: { id: string[] }) => { - return http.post(`${rePrefix}/dict-data/delete`, { data: params }); -}; - -//编辑字典数据 -export const updateDictData = (params: Dict.ReqDictDataParams) => { - return http.post(`${rePrefix}/dict-data/update`, params); -}; - -//导出字典数据 -export const exportDictData = (params: Dict.ResDictData) => { - return http.download(`${rePrefix}/dict-data/export`, params); -}; - -//批量添加字典数据 -export const batchAddDictData = (params: FormData) => { - return http.post(`${rePrefix}/dict-data/import`, params); -}; - - - diff --git a/frontend/src/api/system/dictionary/interface/index.ts b/frontend/src/api/system/dictionary/interface/index.ts index db8b700..6b6fec8 100644 --- a/frontend/src/api/system/dictionary/interface/index.ts +++ b/frontend/src/api/system/dictionary/interface/index.ts @@ -65,6 +65,7 @@ export namespace Dict { level?: number | null; // 事件等级:0-普通;1-中等;2-严重 (默认为0) algoDescribe?: number | null; // 与高级算法内部Id描述对应 value?: string | null; // 字典针对电压等级 + dictValue?:string|null; state: number; // 状态:0-删除 1-正常 createBy?: string | null; // 创建用户 createTime?: string | null; // 创建时间 diff --git a/frontend/src/api/user/userData.ts b/frontend/src/api/user/userData.ts index d22e8ba..3c777ac 100644 --- a/frontend/src/api/user/userData.ts +++ b/frontend/src/api/user/userData.ts @@ -15,118 +15,118 @@ const data = [ 'status': 1, 'rolename': '管理员', }, - { - 'id': '652286556713195552', - 'username': 'operator_A', - 'password': '12345678', - 'realname': '潘霞', - 'status': 1, - 'rolename': '操作员', - }, - { - 'id': '373930342176416776', - 'username': 'operator_B', - 'password': '12345678', - 'realname': '郝秀英', - 'status': 0, - 'rolename': '操作员', - }, - { - 'id': '429621442453555775', - 'username': 'operator_C', - 'password': '12345678', - 'realname': '吕洋', - 'status': 1, - 'rolename': '操作员', - }, - { - 'id': '387231964476618937', - 'username': 'operator_D', - 'password': '12345678', - 'realname': '江磊', - 'status': 0, - 'rolename': '操作员', - }, - { - 'id': '604013348875476647', - 'username': 'operator_E', - 'password': '12345678', - 'realname': '姚静', - 'status': 0, - 'rolename': '操作员', - }, - { - 'id': '028222596330483467', - 'username': 'operator_F', - 'password': '12345678', - 'realname': '龙艳', - 'status': 1, - 'rolename': '操作员', - }, - { - 'id': '739427478368274267', - 'username': 'operator_G', - 'password': '12345678', - 'realname': '武涛', - 'status': 1, - 'rolename': '操作员', - }, - { - 'id': '448686878612127243', - 'username': 'operator_H', - 'password': '12345678', - 'realname': '孙芳', - 'status': 0, - 'rolename': '操作员', - }, - { - 'id': '448686878612127244', - 'username': 'operator_I', - 'password': '12345678', - 'realname': '孙芳1', - 'status': 0, - 'rolename': '操作员', - }, - { - 'id': '448686878612127245', - 'username': 'operator_J', - 'password': '12345678', - 'realname': '孙芳2', - 'status': 1, - 'rolename': '操作员', - }, - { - 'id': '448686878612127245', - 'username': 'operator_J', - 'password': '12345678', - 'realname': '孙芳2', - 'status': 1, - 'rolename': '操作员', - }, - { - 'id': '448686878612127245', - 'username': 'operator_J', - 'password': '12345678', - 'realname': '孙芳2', - 'status': 1, - 'rolename': '操作员', - }, - { - 'id': '448686878612127245', - 'username': 'operator_J', - 'password': '12345678', - 'realname': '孙芳2', - 'status': 1, - 'rolename': '操作员', - }, - { - 'id': '448686878612127245', - 'username': 'operator_J', - 'password': '12345678', - 'realname': '孙芳2', - 'status': 1, - 'rolename': '操作员', - } + // { + // 'id': '652286556713195552', + // 'username': 'operator_A', + // 'password': '12345678', + // 'realname': '潘霞', + // 'status': 1, + // 'rolename': '操作员', + // }, + // { + // 'id': '373930342176416776', + // 'username': 'operator_B', + // 'password': '12345678', + // 'realname': '郝秀英', + // 'status': 0, + // 'rolename': '操作员', + // }, + // { + // 'id': '429621442453555775', + // 'username': 'operator_C', + // 'password': '12345678', + // 'realname': '吕洋', + // 'status': 1, + // 'rolename': '操作员', + // }, + // { + // 'id': '387231964476618937', + // 'username': 'operator_D', + // 'password': '12345678', + // 'realname': '江磊', + // 'status': 0, + // 'rolename': '操作员', + // }, + // { + // 'id': '604013348875476647', + // 'username': 'operator_E', + // 'password': '12345678', + // 'realname': '姚静', + // 'status': 0, + // 'rolename': '操作员', + // }, + // { + // 'id': '028222596330483467', + // 'username': 'operator_F', + // 'password': '12345678', + // 'realname': '龙艳', + // 'status': 1, + // 'rolename': '操作员', + // }, + // { + // 'id': '739427478368274267', + // 'username': 'operator_G', + // 'password': '12345678', + // 'realname': '武涛', + // 'status': 1, + // 'rolename': '操作员', + // }, + // { + // 'id': '448686878612127243', + // 'username': 'operator_H', + // 'password': '12345678', + // 'realname': '孙芳', + // 'status': 0, + // 'rolename': '操作员', + // }, + // { + // 'id': '448686878612127244', + // 'username': 'operator_I', + // 'password': '12345678', + // 'realname': '孙芳1', + // 'status': 0, + // 'rolename': '操作员', + // }, + // { + // 'id': '448686878612127245', + // 'username': 'operator_J', + // 'password': '12345678', + // 'realname': '孙芳2', + // 'status': 1, + // 'rolename': '操作员', + // }, + // { + // 'id': '448686878612127245', + // 'username': 'operator_J', + // 'password': '12345678', + // 'realname': '孙芳2', + // 'status': 1, + // 'rolename': '操作员', + // }, + // { + // 'id': '448686878612127245', + // 'username': 'operator_J', + // 'password': '12345678', + // 'realname': '孙芳2', + // 'status': 1, + // 'rolename': '操作员', + // }, + // { + // 'id': '448686878612127245', + // 'username': 'operator_J', + // 'password': '12345678', + // 'realname': '孙芳2', + // 'status': 1, + // 'rolename': '操作员', + // }, + // { + // 'id': '448686878612127245', + // 'username': 'operator_J', + // 'password': '12345678', + // 'realname': '孙芳2', + // 'status': 1, + // 'rolename': '操作员', + // } ] diff --git a/frontend/src/hooks/useViewSize.ts b/frontend/src/hooks/useViewSize.ts index 5ab9197..0eb4e53 100644 --- a/frontend/src/hooks/useViewSize.ts +++ b/frontend/src/hooks/useViewSize.ts @@ -3,17 +3,16 @@ import { ref } from 'vue' export const useViewSize = () => { const popupBaseView = ref(null) - const viewWidth = ref("0") - const viewHeight = ref("0") - const unit = 'px' + const viewWidth = ref(0) + const viewHeight = ref(0) /** * 更新宽和高的数据 */ const updateDimensions = () => { if (popupBaseView.value) { - viewWidth.value = popupBaseView.value.offsetWidth + unit - viewHeight.value = popupBaseView.value.offsetHeight + unit + viewWidth.value = popupBaseView.value.offsetWidth + viewHeight.value = popupBaseView.value.offsetHeight } } diff --git a/frontend/src/views/demo/proTable/open.vue b/frontend/src/views/demo/proTable/open.vue index 308b5dc..f32e1d2 100644 --- a/frontend/src/views/demo/proTable/open.vue +++ b/frontend/src/views/demo/proTable/open.vue @@ -3,11 +3,11 @@ -
+
- -
- - - - - -
-
- -
- - - - - - - - - - - - - - - - - -
- -
- - - diff --git a/frontend/src/views/system/dictionary/dictData/components/dataPopup.vue b/frontend/src/views/system/dictionary/dictData/components/dataPopup.vue index 67af5df..ff78606 100644 --- a/frontend/src/views/system/dictionary/dictData/components/dataPopup.vue +++ b/frontend/src/views/system/dictionary/dictData/components/dataPopup.vue @@ -1,6 +1,130 @@ \ No newline at end of file diff --git a/frontend/src/views/system/dictionary/dictData/index.vue b/frontend/src/views/system/dictionary/dictData/index.vue index 7a7423f..ba5c5a7 100644 --- a/frontend/src/views/system/dictionary/dictData/index.vue +++ b/frontend/src/views/system/dictionary/dictData/index.vue @@ -1,9 +1,139 @@ - \ No newline at end of file +const props = defineProps({ + width: { + type: String, + default: '800px', + }, + height: { + type: String, + default: '744px', + }, +}) + +const columns = reactive[]>([ + {type: 'selection', fixed: 'left', width: 70}, + {type: 'index', fixed: 'left', width: 70, label: '序号'}, + { + prop: 'name', + label: '名称', + width: 180, + search: { + el: 'input' + } + }, + { + prop: 'code', + label: '编码', + width: 180, + search: { + el: 'input' + } + }, + { + prop: 'value', + label: '值', + width: 180 + }, + { + prop: 'level', + label: '事件等级', + width: 180, + render: scope => { + return ( + <> + {scope.row.level === 0 || scope.row.level === null || scope.row.level === undefined ? + () : + ( + {scope.row.level === 1 ? '普通' : scope.row.level === 2 ? '警告' : '危险'} + ) + } + + ) + } + }, + { + prop: 'createTime', + label: '创建时间', + width: 180 + }, + { + prop: 'operation', + label: '操作', + fixed: 'right', + minWidth: 300 + }, +]) + +const open = (row: Dict.ResDictType) => { + dialogVisible.value = true + dictTypeId.value = row.id + dictTypeCode.value = row.code + initParam.typeId = row.id +} + +defineExpose({open}) + +// 打开 dialog(新增、查看、编辑) +const openDialog = (titleType: string, row: Partial = {}) => { + dataPopup.value?.open(titleType, dictTypeId.value, dictTypeCode.value, row) +} + +// 批量删除字典数据 +const batchDelete = async (id: string[]) => { + await useHandleData(deleteDictData, id, '删除所选字典数据') + proTable.value?.clearSelection() + proTable.value?.getTableList() +} + +// 删除字典数据 +const handleDelete = async (params: Dict.ResDictData) => { + await useHandleData(deleteDictData, [params.id], `删除【${params.name}】字典数据`) + proTable.value?.getTableList() +} + diff --git a/frontend/src/views/system/dictionary/dictType/index.vue b/frontend/src/views/system/dictionary/dictType/index.vue index d97df93..5176cc9 100644 --- a/frontend/src/views/system/dictionary/dictType/index.vue +++ b/frontend/src/views/system/dictionary/dictType/index.vue @@ -21,34 +21,34 @@
- - + +