From eb3307594adbf3d6441ebf4876c4a0f5f235700f Mon Sep 17 00:00:00 2001 From: Asoka Date: Wed, 11 Jun 2025 19:17:37 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E5=8E=9F=E5=9B=A0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/admin/data-contracts.ts | 118 ++++++++ src/api/admin/revoke-reason.ts | 84 ++++++ .../uspreason/components/uspreason-form.vue | 149 ++++++++++ src/views/admin/uspreason/index.vue | 257 ++++++++++++++++++ 页面开发指南.md | 142 ---------- 5 files changed, 608 insertions(+), 142 deletions(-) create mode 100644 src/api/admin/revoke-reason.ts create mode 100644 src/views/admin/uspreason/components/uspreason-form.vue create mode 100644 src/views/admin/uspreason/index.vue delete mode 100644 页面开发指南.md diff --git a/src/api/admin/data-contracts.ts b/src/api/admin/data-contracts.ts index 4550a0f..2b2c289 100644 --- a/src/api/admin/data-contracts.ts +++ b/src/api/admin/data-contracts.ts @@ -8429,3 +8429,121 @@ export interface ResultOutputBagDtoGetOutput { message?: string | null data?: BagDto } + +/** 撤销原因分页查询输入 */ +export interface PageInputRevokeReasonGetPageInput { + dynamicFilter?: DynamicFilterInfo + /** 排序列表 */ + sortList?: SortInput[] | null + /** + * 当前页标 + * @format int32 + */ + currentPage?: number + /** + * 每页大小 + * @format int32 + */ + pageSize?: number + /** 分页请求 */ + filter?: RevokeReasonGetPageInput +} + +/** 撤销原因分页查询过滤条件 */ +export interface RevokeReasonGetPageInput { + /** 原因描述 */ + revokeReason?: string | null + /** 类型 */ + revokeType?: string | null + /** 是否下发 */ + isDown?: boolean +} + +/** 撤销原因分页查询输出 */ +export interface RevokeReasonGetPageOutput { + /** + * 编号 + * @format int64 + */ + id?: number + /** 原因描述 */ + revokeReason?: string | null + /** 类型 */ + revokeType?: string | null + /** 是否下发 */ + isDown?: boolean + /** 创建者 */ + createdUserName?: string | null + /** + * 创建时间 + * @format date-time + */ + createdTime?: string | null + /** + * 修改时间 + * @format date-time + */ + modifiedTime?: string | null +} + +export interface ResultOutputPageOutputRevokeReasonGetPageOutput { + success?: boolean + code?: string | null + message?: string | null + data?: PageOutputBagDtoGetPageOutput +} + +export interface PageOutputRevokeReasonGetPageOutput { + list?: RevokeReasonGetPageOutput[] | null + total?: number +} + +/** 撤销原因详情输出 */ +export interface RevokeReasonGetOutput { + /** 原因描述 */ + revokeReason?: string | null + /** 类型 */ + revokeType?: string | null + /** 是否下发 */ + isDown?: boolean + /** + * 主键Id + * @format int64 + */ + id: number +} + +/** 撤销原因新增/更新输入 */ +export interface RevokeReasonDto { + /** 原因描述 */ + keyWord?: string | null + + revokeReason?: string | null + /** 类型 */ + revokeType?: string | null + /** 是否下发 */ + isDown?: boolean + /** + * 主键Id + * @format int64 + */ + id?: number +} + +/** 撤回类型枚举项 */ +export interface RevokeTypeEnumItem { + /** 枚举值 */ + value: number + /** 枚举名称 */ + name: string + /** 显示名称/描述 */ + label: string +} + +/** 撤回类型枚举列表输出 */ +export interface RevokeTypeEnumListOutput { + success?: boolean + code?: string | null + message?: string | null + data?: RevokeTypeEnumItem[] +} diff --git a/src/api/admin/revoke-reason.ts b/src/api/admin/revoke-reason.ts new file mode 100644 index 0000000..98f33fc --- /dev/null +++ b/src/api/admin/revoke-reason.ts @@ -0,0 +1,84 @@ +/* eslint-disable */ +/* tslint:disable */ +/* + * --------------------------------------------------------------- + * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## + * ## ## + * ## AUTHOR: adademo / https://github.com/adademo/swagger-typescript-api ## + * ## SOURCE: https://github.com/adademo/swagger-typescript-api ## + * --------------------------------------------------------------- + */ + +import { PageInputRevokeReasonGetPageInput, RevokeReasonDto, RevokeReasonGetOutput,ResultOutputPageOutputRevokeReasonGetPageOutput, RevokeTypeEnumListOutput } from './data-contracts' +import { RequestParams } from './http-client' +import { ContentType, HttpClient } from './http-client' + +export class RevokeReasonApi extends HttpClient { + /** + * 获取分页列表 + */ + getPage = (data: PageInputRevokeReasonGetPageInput, params: RequestParams = {}) => + this.request({ + path: `/api/admin/revoke-reason/get-page`, + method: 'POST', + body: data, + type: ContentType.Json, + ...params, + }) + + /** + * 获取单条数据 + */ + get = (params: { id: number }, requestParams: RequestParams = {}) => + this.request({ + path: `/api/admin/revoke-reason/get`, + method: 'GET', + query: params, + ...requestParams, + }) + + /** + * 新增 + */ + add = (data: RevokeReasonDto, params: RequestParams = {}) => + this.request({ + path: `/api/admin/revoke-reason/add`, + method: 'POST', + body: data, + type: ContentType.Json, + ...params, + }) + + /** + * 更新 + */ + update = (data: RevokeReasonDto, params: RequestParams = {}) => + this.request({ + path: `/api/admin/revoke-reason/update`, + method: 'PUT', + body: data, + type: ContentType.Json, + ...params, + }) + + /** + * 软删除 + */ + softDelete = (params: { id: number }, requestParams: RequestParams = {}) => + this.request({ + path: `/api/admin/revoke-reason/soft-delete`, + method: 'DELETE', + query: params, + ...requestParams, + }) + + /** + * 获取撤回类型枚举列表 + */ + getRevokeTypeEnumList = (params: RequestParams = {}) => + this.request({ + path: `/api/admin/revoke-reason/get-revoke-type-enum-list`, + method: 'GET', + ...params, + }) +} diff --git a/src/views/admin/uspreason/components/uspreason-form.vue b/src/views/admin/uspreason/components/uspreason-form.vue new file mode 100644 index 0000000..e31babe --- /dev/null +++ b/src/views/admin/uspreason/components/uspreason-form.vue @@ -0,0 +1,149 @@ + + + + + diff --git a/src/views/admin/uspreason/index.vue b/src/views/admin/uspreason/index.vue new file mode 100644 index 0000000..1116105 --- /dev/null +++ b/src/views/admin/uspreason/index.vue @@ -0,0 +1,257 @@ + + + + + + + diff --git a/页面开发指南.md b/页面开发指南.md deleted file mode 100644 index 49c66e8..0000000 --- a/页面开发指南.md +++ /dev/null @@ -1,142 +0,0 @@ -# 页面开发指南 - -## 页面结构 -1. 列表页面 - - 搜索区域:关键词搜索 - - 操作按钮:新增、查询 - - 表格区域:基础字段展示 - - 分页区域:标准分页组件 - -2. 编辑页面 - - 基本信息模块 - - 网络配置模块 - - 设备配置模块 - -## 样式规范 -1. 对话框配置 - ```html - - ``` - -2. 表单布局 - ```html - -
-
模块标题
- - - - - - - -
-
- ``` - -3. 样式定义 - ```scss - .form-section { - margin-bottom: 24px; - &:last-child { margin-bottom: 0; } - } - - .section-title { - font-size: 16px; - font-weight: 600; - color: #303133; - margin-bottom: 16px; - padding-bottom: 8px; - border-bottom: 2px solid #f0f0f0; - position: relative; - &:before { - content: ''; - position: absolute; - left: 0; - bottom: -2px; - width: 40px; - height: 2px; - background: #409eff; - } - } - ``` - -## 开发规范 -1. 组件命名 - - 目录:小写字母,用横线分隔 - - 组件:PascalCase - - 组合函数:camelCase - -2. 代码组织 - ```typescript - // 1. 导入声明 - import { reactive, ref } from 'vue' - - // 2. 类型定义 - interface State { - showDialog: boolean - form: FormData - } - - // 3. 组件定义 - const props = defineProps({ - title: String - }) - - // 4. 状态定义 - const state = reactive({ - showDialog: false, - form: {} - }) - - // 5. 方法定义 - const handleSubmit = async () => { - // 处理逻辑 - } - ``` - -3. 表单验证 - ```typescript - const rules = { - fieldName: [ - { required: true, message: '请输入', trigger: ['blur', 'change'] } - ] - } - ``` - -4. API 调用 - ```typescript - const handleSave = async () => { - try { - const res = await api.save(state.form) - if (res.success) { - ElMessage.success('保存成功') - emit('refresh') - state.showDialog = false - } - } catch (error) { - console.error(error) - } - } - ``` - -## 注意事项 -1. 保持与 uspscale 页面风格一致 -2. 使用响应式布局适配不同屏幕 -3. 统一表单验证规则和错误提示 -4. 优化用户交互体验 -5. 保持代码风格统一 -6. 注意性能优化 -7. 遵循 TypeScript 类型规范 - ---- - -**注意**:此模板基于 Vue 3 + TypeScript + Element Plus + Pinia 技术栈,使用时请根据实际项目技术栈进行调整。 \ No newline at end of file