From faae0cea9d2731ae1f0185a6191f88107756b37a Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Fri, 10 Oct 2025 13:16:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(system):=20=E6=96=B0=E5=A2=9E=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E8=A7=84=E5=88=99=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增编码规则的增删改查接口 - 实现编码规则列表页面展示与交互 - 支持编码规则的搜索、新增、修改、删除操作- 添加编码规则导出功能 - 实现编码规则更新标识和激活标识的字典展示 - 支持编码规则生成下个编码功能 - 添加编码规则表单验证和权限控制 --- src/api/system/codeRule/index.ts | 89 +++++++ src/api/system/codeRule/types.ts | 176 ++++++++++++++ src/views/system/codeRule/index.vue | 365 ++++++++++++++++++++++++++++ 3 files changed, 630 insertions(+) create mode 100644 src/api/system/codeRule/index.ts create mode 100644 src/api/system/codeRule/types.ts create mode 100644 src/views/system/codeRule/index.vue diff --git a/src/api/system/codeRule/index.ts b/src/api/system/codeRule/index.ts new file mode 100644 index 0000000..e7bbc01 --- /dev/null +++ b/src/api/system/codeRule/index.ts @@ -0,0 +1,89 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { CodeRuleVO, CodeRuleForm, CodeRuleQuery } from '@/api/system/codeRule/types'; + +/** + * 查询编码规则列表 + * @param query + * @returns {*} + */ +export const listCodeRule = (query?: CodeRuleQuery): AxiosPromise => { + return request({ + url: '/system/codeRule/list', + method: 'get', + params: query + }); +}; + +/** + * 查询编码规则详细 + * @param codeRuleId + */ +export const getCodeRule = (codeRuleId: string | number): AxiosPromise => { + return request({ + url: '/system/codeRule/' + codeRuleId, + method: 'get' + }); +}; + +/** + * 新增编码规则 + * @param data + */ +export const addCodeRule = (data: CodeRuleForm) => { + return request({ + url: '/system/codeRule', + method: 'post', + data: data + }); +}; + +/** + * 修改编码规则 + * @param data + */ +export const updateCodeRule = (data: CodeRuleForm) => { + return request({ + url: '/system/codeRule', + method: 'put', + data: data + }); +}; + +/** + * 删除编码规则 + * @param codeRuleId + */ +export const delCodeRule = (codeRuleId: string | number | Array) => { + return request({ + url: '/system/codeRule/' + codeRuleId, + method: 'delete' + }); +}; + + +/** + * 下拉框查询编码规则列表 + * @param query + * @returns {*} + */ +export function getSysCodeRuleList(query) { + return request({ + url: '/system/codeRule/getSysCodeRuleList', + method: 'get', + params: query + }); +}; + +/** + * 查询编码规则列表 + * @param query + * @returns {*} + */ +export const getRuleGenerateCode = (query: CodeRuleForm) => { + return request({ + url: '/system/codeRule/getRuleGenerateCode', + method: 'get', + params: query + }); +}; diff --git a/src/api/system/codeRule/types.ts b/src/api/system/codeRule/types.ts new file mode 100644 index 0000000..86e28f9 --- /dev/null +++ b/src/api/system/codeRule/types.ts @@ -0,0 +1,176 @@ +export interface CodeRuleVO { + /** + * 编码规则ID + */ + codeRuleId: string | number; + + /** + * 编码规则编码 + */ + codeRuleCode: string; + + /** + * 编码规则字段 + */ + codeRuleName: string; + + /** + * 规则前缀 + */ + rulePrefix: string; + + /** + * 序列号初始长度 + */ + sequenceLength: number; + + /** + * 规则模板 + */ + ruleTemplate: string; + + /** + * 更新标识(1不更新 2每日更新) + */ + renewFlag: string; + + /** + * 当前编码 + */ + currentCode: string; + + /** + * 下个编码 + */ + nextCode: string; + + /** + * 激活标识(1是 0否) + */ + activeFlag: string; + + /** + * 备注 + */ + remark: string; + +} + +export interface CodeRuleForm extends BaseEntity { + /** + * 编码规则ID + */ + codeRuleId?: string | number; + + /** + * 编码规则编码 + */ + codeRuleCode?: string; + + /** + * 编码规则字段 + */ + codeRuleName?: string; + + /** + * 规则前缀 + */ + rulePrefix?: string; + + /** + * 序列号初始长度 + */ + sequenceLength?: number; + + /** + * 规则模板 + */ + ruleTemplate?: string; + + /** + * 更新标识(1不更新 2每日更新) + */ + renewFlag?: string; + + /** + * 当前编码 + */ + currentCode?: string; + + /** + * 下个编码 + */ + nextCode?: string; + + /** + * 激活标识(1是 0否) + */ + activeFlag?: string; + + /** + * 备注 + */ + remark?: string; + +} + +export interface CodeRuleQuery extends PageQuery { + + /** + * 编码规则ID + */ + codeRuleId?: string | number; + + /** + * 编码规则编码 + */ + codeRuleCode?: string; + + /** + * 编码规则字段 + */ + codeRuleName?: string; + + /** + * 规则前缀 + */ + rulePrefix?: string; + + /** + * 序列号初始长度 + */ + sequenceLength?: number; + + /** + * 规则模板 + */ + ruleTemplate?: string; + + /** + * 更新标识(1不更新 2每日更新) + */ + renewFlag?: string; + + /** + * 当前编码 + */ + currentCode?: string; + + /** + * 下个编码 + */ + nextCode?: string; + + /** + * 激活标识(1是 0否) + */ + activeFlag?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/views/system/codeRule/index.vue b/src/views/system/codeRule/index.vue new file mode 100644 index 0000000..132d2dc --- /dev/null +++ b/src/views/system/codeRule/index.vue @@ -0,0 +1,365 @@ + + +