From 15ccb7f0b9109aa201ac1fdef1f129ae54aa0df0 Mon Sep 17 00:00:00 2001 From: mocheng <3057647414@qq.com> Date: Thu, 24 Jul 2025 11:06:13 +0800 Subject: [PATCH] =?UTF-8?q?app=E5=8A=9F=E8=83=BD=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/api/system/funList/index.ts | 61 ++++++ .../src/api/system/funList/model.d.ts | 84 ++++++++ .../web-antd/src/views/system/funList/data.ts | 100 ++++++++++ .../views/system/funList/funList-modal.vue | 119 ++++++++++++ .../src/views/system/funList/index.vue | 181 ++++++++++++++++++ apps/web-antd/src/views/system/user/index.vue | 1 - package.json | 1 + 7 files changed, 546 insertions(+), 1 deletion(-) create mode 100644 apps/web-antd/src/api/system/funList/index.ts create mode 100644 apps/web-antd/src/api/system/funList/model.d.ts create mode 100644 apps/web-antd/src/views/system/funList/data.ts create mode 100644 apps/web-antd/src/views/system/funList/funList-modal.vue create mode 100644 apps/web-antd/src/views/system/funList/index.vue diff --git a/apps/web-antd/src/api/system/funList/index.ts b/apps/web-antd/src/api/system/funList/index.ts new file mode 100644 index 00000000..0bcb058a --- /dev/null +++ b/apps/web-antd/src/api/system/funList/index.ts @@ -0,0 +1,61 @@ +import type { FunListVO, FunListForm, FunListQuery } from './model'; + +import type { ID, IDS } from '#/api/common'; +import type { PageResult } from '#/api/common'; + +import { commonExport } from '#/api/helper'; +import { requestClient } from '#/api/request'; + +/** +* 查询APP功能列表列表 +* @param params +* @returns APP功能列表列表 +*/ +export function funListList(params?: FunListQuery) { + return requestClient.get>('/system/funList/list', { params }); +} + +/** + * 导出APP功能列表列表 + * @param params + * @returns APP功能列表列表 + */ +export function funListExport(params?: FunListQuery) { + return commonExport('/system/funList/export', params ?? {}); +} + +/** + * 查询APP功能列表详情 + * @param id id + * @returns APP功能列表详情 + */ +export function funListInfo(id: ID) { + return requestClient.get(`/system/funList/${id}`); +} + +/** + * 新增APP功能列表 + * @param data + * @returns void + */ +export function funListAdd(data: FunListForm) { + return requestClient.postWithMsg('/system/funList', data); +} + +/** + * 更新APP功能列表 + * @param data + * @returns void + */ +export function funListUpdate(data: FunListForm) { + return requestClient.putWithMsg('/system/funList', data); +} + +/** + * 删除APP功能列表 + * @param id id + * @returns void + */ +export function funListRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/system/funList/${id}`); +} diff --git a/apps/web-antd/src/api/system/funList/model.d.ts b/apps/web-antd/src/api/system/funList/model.d.ts new file mode 100644 index 00000000..ce1edd15 --- /dev/null +++ b/apps/web-antd/src/api/system/funList/model.d.ts @@ -0,0 +1,84 @@ +import type { PageQuery, BaseEntity } from '#/api/common'; + +export interface FunListVO { + /** + * 主键 + */ + id: string | number; + + /** + * 角色id + */ + roleid: string | number; + + /** + * 名称 + */ + name: string; + + /** + * icon + */ + icon: string; + + /** + * url + */ + url: string; + +} + +export interface FunListForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 角色id + */ + roleid?: string | number; + + /** + * 名称 + */ + name?: string; + + /** + * icon + */ + icon?: string; + + /** + * url + */ + url?: string; + +} + +export interface FunListQuery extends PageQuery { + /** + * 角色id + */ + roleid?: string | number; + + /** + * 名称 + */ + name?: string; + + /** + * icon + */ + icon?: string; + + /** + * url + */ + url?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/views/system/funList/data.ts b/apps/web-antd/src/views/system/funList/data.ts new file mode 100644 index 00000000..b13a2aaa --- /dev/null +++ b/apps/web-antd/src/views/system/funList/data.ts @@ -0,0 +1,100 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Select', + fieldName: 'roleid', + label: '角色', + }, + { + component: 'Input', + fieldName: 'name', + label: '名称', + }, + { + component: 'Input', + fieldName: 'icon', + label: 'icon', + }, + { + component: 'Input', + fieldName: 'url', + label: 'url', + }, +]; + +// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 +// export const columns: () => VxeGridProps['columns'] = () => [ +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '主键', + field: 'id', + }, + { + title: '角色', + field: 'roleName', + }, + { + title: '名称', + field: 'name', + }, + { + field: 'icon', + title: '头像', + slots: { default: 'icon' }, + minWidth: 80, + }, + { + title: 'url', + field: 'url', + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '操作', + width: 180, + }, +]; + +export const modalSchema: FormSchemaGetter = () => [ + { + label: '主键', + fieldName: 'id', + component: 'Input', + dependencies: { + show: () => false, + triggerFields: [''], + }, + }, + { + label: '角色', + fieldName: 'roleid', + component: 'Select', + }, + { + label: '名称', + fieldName: 'name', + component: 'Input', + }, + { + label: 'icon', + fieldName: 'icon', + component: 'FileUpload', + /** + * 注意这里获取为数组 需要自行定义回显/提交 + * 文件上传还在demo阶段 可能有重大改动! + */ + componentProps: { + // accept: 'application/pdf', // 可选拓展名或者mime类型 ,拼接 + // maxCount: 1, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型 + }, + }, + { + label: 'url', + fieldName: 'url', + component: 'Input', + }, +]; diff --git a/apps/web-antd/src/views/system/funList/funList-modal.vue b/apps/web-antd/src/views/system/funList/funList-modal.vue new file mode 100644 index 00000000..d8fbd88c --- /dev/null +++ b/apps/web-antd/src/views/system/funList/funList-modal.vue @@ -0,0 +1,119 @@ + + + diff --git a/apps/web-antd/src/views/system/funList/index.vue b/apps/web-antd/src/views/system/funList/index.vue new file mode 100644 index 00000000..ca54e527 --- /dev/null +++ b/apps/web-antd/src/views/system/funList/index.vue @@ -0,0 +1,181 @@ + + + diff --git a/apps/web-antd/src/views/system/user/index.vue b/apps/web-antd/src/views/system/user/index.vue index ee497101..83ce0eaa 100644 --- a/apps/web-antd/src/views/system/user/index.vue +++ b/apps/web-antd/src/views/system/user/index.vue @@ -11,7 +11,6 @@ import { Page, useVbenDrawer, useVbenModal, } from '@vben/common-ui'; import { $t } from '@vben/locales'; import { preferences } from '@vben/preferences'; import { getVxePopupContainer } from '@vben/utils'; - import { Avatar, Dropdown, diff --git a/package.json b/package.json index 0f94fcd2..777662d1 100644 --- a/package.json +++ b/package.json @@ -1,3 +1,4 @@ + { "name": "vben-admin-monorepo", "version": "5.5.6",