From adb81b53cb66ca4914d4f66e9b8ba76e01ec95d4 Mon Sep 17 00:00:00 2001 From: "825299534@qq.com" Date: Wed, 26 Mar 2025 10:57:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?add:=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=BB=84=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/group/index.ts | 149 ++++++ src/api/system/group/model/GroupModel.ts | 36 ++ src/views/system/group/components/Form.vue | 179 +++++++ .../system/group/components/GroupModal.vue | 110 ++++ .../system/group/components/RoleListModal.vue | 34 ++ .../system/group/components/UserCard.vue | 190 +++++++ src/views/system/group/components/config.ts | 291 ++++++++++ .../group/components/workflowPermission.ts | 62 +++ src/views/system/group/index.vue | 505 ++++++++++++++++++ 9 files changed, 1556 insertions(+) create mode 100644 src/api/system/group/index.ts create mode 100644 src/api/system/group/model/GroupModel.ts create mode 100644 src/views/system/group/components/Form.vue create mode 100644 src/views/system/group/components/GroupModal.vue create mode 100644 src/views/system/group/components/RoleListModal.vue create mode 100644 src/views/system/group/components/UserCard.vue create mode 100644 src/views/system/group/components/config.ts create mode 100644 src/views/system/group/components/workflowPermission.ts create mode 100644 src/views/system/group/index.vue diff --git a/src/api/system/group/index.ts b/src/api/system/group/index.ts new file mode 100644 index 0000000..8fc9372 --- /dev/null +++ b/src/api/system/group/index.ts @@ -0,0 +1,149 @@ +import { XjrGroupPageModel, XjrGroupPageParams, XjrGroupPageResult } from './model/GroupModel'; +import { defHttp } from '/@/utils/http/axios'; +import { ErrorMessageMode } from '/#/axios'; +import {RoleUserModel} from "/@/api/system/role/model"; + +enum Api { + Page = '/organization/group/page', + List = '/organization/group/list', + Info = '/organization/group/info', + XjrGroup = '/organization/group', + GroupUser = '/organization/group/user', + GroupRole = '/organization/group/role', + + +} + +/** + * @description: 查询XjrGroup分页列表 + */ +export async function getXjrGroupPage(params: XjrGroupPageParams, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.Page, + params, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 新增用户组用户 + */ +export async function addGroupUser(params, mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.GroupUser, + data: params, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 新增用户组角色 + */ +export async function addGroupRole(params, mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.GroupRole, + data: params, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 查询用户组用户 + */ +export async function getGroupUser(id: string, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.GroupUser, + params: { id }, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 查询用户组角色 + */ +export async function getGroupRole(id: string, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.GroupRole, + params: { id }, + }, + { + errorMessageMode: mode, + }, + ); +} +/** + * @description: 获取XjrGroup信息 + */ +export async function getXjrGroup(id: String, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.Info, + params: { id }, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 新增XjrGroup + */ +export async function addXjrGroup(xjrGroup: Recordable, mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.XjrGroup, + params: xjrGroup, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 更新XjrGroup + */ +export async function updateXjrGroup(xjrGroup: Recordable, mode: ErrorMessageMode = 'modal') { + return defHttp.put( + { + url: Api.XjrGroup, + params: xjrGroup, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 删除XjrGroup(批量删除) + */ +export async function deleteXjrGroup(ids: string[], mode: ErrorMessageMode = 'modal') { + return defHttp.delete( + { + url: Api.XjrGroup, + data: ids, + }, + { + errorMessageMode: mode, + }, + ); +} diff --git a/src/api/system/group/model/GroupModel.ts b/src/api/system/group/model/GroupModel.ts new file mode 100644 index 0000000..9c03792 --- /dev/null +++ b/src/api/system/group/model/GroupModel.ts @@ -0,0 +1,36 @@ +import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; + +/** + * @description: XjrGroup分页参数 模型 + */ +export interface XjrGroupPageParams extends BasicPageParams { + name: string; + + code: string; + + enabledMark: string; + + remark: string; +} + +/** + * @description: XjrGroup分页返回值模型 + */ +export interface XjrGroupPageModel { + id: string; + + name: string; + + code: string; + + enabledMark: string; + + remark: string; +} + +0; + +/** + * @description: XjrGroup分页返回值结构 + */ +export type XjrGroupPageResult = BasicFetchResult; diff --git a/src/views/system/group/components/Form.vue b/src/views/system/group/components/Form.vue new file mode 100644 index 0000000..315841f --- /dev/null +++ b/src/views/system/group/components/Form.vue @@ -0,0 +1,179 @@ + + diff --git a/src/views/system/group/components/GroupModal.vue b/src/views/system/group/components/GroupModal.vue new file mode 100644 index 0000000..abd9296 --- /dev/null +++ b/src/views/system/group/components/GroupModal.vue @@ -0,0 +1,110 @@ + + diff --git a/src/views/system/group/components/RoleListModal.vue b/src/views/system/group/components/RoleListModal.vue new file mode 100644 index 0000000..29964e0 --- /dev/null +++ b/src/views/system/group/components/RoleListModal.vue @@ -0,0 +1,34 @@ + + diff --git a/src/views/system/group/components/UserCard.vue b/src/views/system/group/components/UserCard.vue new file mode 100644 index 0000000..ae3aa74 --- /dev/null +++ b/src/views/system/group/components/UserCard.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/src/views/system/group/components/config.ts b/src/views/system/group/components/config.ts new file mode 100644 index 0000000..b6e4dab --- /dev/null +++ b/src/views/system/group/components/config.ts @@ -0,0 +1,291 @@ +import { FormProps, FormSchema } from '/@/components/Form'; +import { BasicColumn } from '/@/components/Table'; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'name', + label: '用户组名称', + component: 'Input', + }, + { + field: 'code', + label: '用户组编码', + component: 'Input', + }, + { + field: 'enabledMark', + label: '状态', + component: 'XjrSelect', + componentProps: { + datasourceType: 'staticData', + staticOptions: [ + { key: 1, label: '启用', value: '0' }, + { key: 2, label: '停用', value: '1' }, + ], + labelField: 'label', + valueField: 'value', + + getPopupContainer: () => document.body, + }, + } +]; + +export const columns: BasicColumn[] = [ + { + dataIndex: 'name', + title: '用户组名称', + componentType: 'input', + align: 'left', + + sorter: true, + }, + + { + dataIndex: 'code', + title: '用户组编码', + componentType: 'input', + align: 'left', + + sorter: true, + }, + + { + dataIndex: 'enabledMark', + title: '状态', + componentType: 'radio', + align: 'left', + + customRender: ({ record }) => { + const staticOptions = [ + { key: 1, label: '启用', value: 0 }, + { key: 2, label: '停用', value: 1 }, + ]; + return staticOptions.filter((x) => x.value === record.enabledMark)[0]?.label; + }, + + sorter: true, + }, + + { + dataIndex: 'remark', + title: '备注', + componentType: 'textarea', + align: 'left', + + sorter: true, + }, +]; +//表单事件 +export const formEventConfigs = { + 0: [ + { + type: 'circle', + color: '#2774ff', + text: '开始节点', + icon: '#icon-kaishi', + bgcColor: '#D8E5FF', + isUserDefined: false, + }, + { + color: '#F6AB01', + icon: '#icon-chushihua', + text: '初始化表单', + bgcColor: '#f9f5ea', + isUserDefined: false, + nodeInfo: { processEvent: [] }, + }, + ], + 1: [ + { + color: '#B36EDB', + icon: '#icon-shujufenxi', + text: '获取表单数据', + detail: '(新增无此操作)', + bgcColor: '#F8F2FC', + isUserDefined: false, + nodeInfo: { processEvent: [] }, + }, + ], + 2: [ + { + color: '#F8625C', + icon: '#icon-jiazai', + text: '加载表单', + bgcColor: '#FFF1F1', + isUserDefined: false, + nodeInfo: { processEvent: [] }, + }, + ], + 3: [ + { + color: '#6C6AE0', + icon: '#icon-jsontijiao', + text: '提交表单', + bgcColor: '#F5F4FF', + isUserDefined: false, + nodeInfo: { processEvent: [] }, + }, + ], + 4: [ + { + type: 'circle', + color: '#F8625C', + text: '结束节点', + icon: '#icon-jieshuzhiliao', + bgcColor: '#FFD6D6', + isLast: true, + isUserDefined: false, + }, + ], +}; +export const formProps: FormProps = { + labelCol: { span: 3, offset: 0, labelWidthMode: 'flex' }, + labelAlign: 'right', + layout: 'horizontal', + size: 'default', + schemas: [ + { + key: '78982448aafb4c6aa670af77d3c81671', + field: 'name', + label: '用户组名称', + type: 'input', + component: 'Input', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: true, + respNewRow: false, + placeholder: '请输入用户组名称', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: false, + showLabel: true, + required: true, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' }, + }, + }, + { + key: '5042a508994f4b73a6e6ff826bfc90a3', + field: 'code', + label: '用户组编码', + type: 'input', + component: 'Input', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: true, + respNewRow: false, + placeholder: '请输入用户组编码', + maxlength: null, + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: false, + showLabel: true, + required: true, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' }, + }, + }, + { + key: 'f236824d858c43cfb801762f2a585f75', + field: 'enabledMark', + label: '状态', + type: 'radio', + component: 'ApiRadioGroup', + colProps: { span: 24 }, + componentProps: { + span: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: true, + respNewRow: false, + showLabel: true, + disabled: false, + optionType: 'default', + staticOptions: [ + { key: 1, label: '启用', value: 0 }, + { key: 2, label: '停用', value: 1 }, + ], + datasourceType: 'staticData', + labelField: 'label', + valueField: 'value', + defaultSelect: '0', + apiConfig: { + path: 'CodeGeneration/selection', + method: 'GET', + apiId: '93d735dcb7364a0f8102188ec4d77ac7', + }, + dicOptions: [], + required: false, + rules: [], + events: {}, + isShow: true, + params: null, + style: {}, + }, + }, + { + key: '06f7026e60a14d07a0e53043caf99437', + field: 'remark', + label: '备注', + type: 'textarea', + component: 'InputTextArea', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: true, + respNewRow: true, + placeholder: '请输入备注', + maxlength: null, + rows: 4, + autoSize: false, + showCount: false, + disabled: false, + showLabel: true, + allowClear: false, + required: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' }, + }, + }, + ], + showActionButtonGroup: false, + buttonLocation: 'center', + actionColOptions: { span: 24 }, + showResetButton: false, + showSubmitButton: false, + hiddenComponent: [], +}; diff --git a/src/views/system/group/components/workflowPermission.ts b/src/views/system/group/components/workflowPermission.ts new file mode 100644 index 0000000..fd8c3b2 --- /dev/null +++ b/src/views/system/group/components/workflowPermission.ts @@ -0,0 +1,62 @@ +export const permissionList = [ + { + required: true, + view: true, + edit: true, + disabled: false, + isSaveTable: false, + tableName: '', + fieldName: '用户组名称', + fieldId: 'name', + isSubTable: false, + showChildren: true, + type: 'input', + key: '78982448aafb4c6aa670af77d3c81671', + children: [], + }, + { + required: true, + view: true, + edit: true, + disabled: false, + isSaveTable: false, + tableName: '', + fieldName: '用户组编码', + fieldId: 'code', + isSubTable: false, + showChildren: true, + type: 'input', + key: '5042a508994f4b73a6e6ff826bfc90a3', + children: [], + }, + { + required: true, + view: true, + edit: true, + disabled: false, + isSaveTable: false, + tableName: '', + fieldName: '状态', + fieldId: 'enabledMark', + isSubTable: false, + showChildren: true, + type: 'radio', + key: 'f236824d858c43cfb801762f2a585f75', + children: [], + }, + { + required: true, + view: true, + edit: true, + disabled: false, + isSaveTable: false, + tableName: '', + fieldName: '备注', + fieldId: 'remark', + isSubTable: false, + showChildren: true, + type: 'textarea', + key: '06f7026e60a14d07a0e53043caf99437', + children: [], + }, +]; diff --git a/src/views/system/group/index.vue b/src/views/system/group/index.vue new file mode 100644 index 0000000..9e87f1e --- /dev/null +++ b/src/views/system/group/index.vue @@ -0,0 +1,505 @@ + + + From 9f432e2b33b1388461b43610cf0491b457b7e085 Mon Sep 17 00:00:00 2001 From: "825299534@qq.com" Date: Wed, 26 Mar 2025 11:05:01 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=201.=E4=BF=AE=E5=A4=8D=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=8F=91=E5=B8=83=E7=9A=84=E5=8A=9F=E8=83=BD=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=B5=81=E7=A8=8B=E5=AE=A1=E6=89=B9=E6=9C=89=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E4=B8=BA=E6=9C=80=E6=96=B0=E5=8F=91=E8=B5=B7=E6=B5=81?= =?UTF-8?q?=E7=A8=8B2.=E8=A1=A8=E5=8D=95=E8=AE=BE=E8=AE=A1=E4=B8=8B?= =?UTF-8?q?=E7=94=9F=E6=88=90=E4=BB=A3=E7=A0=81,=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=B8=A6=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/components/CodeGeneratorModal.vue | 2 +- src/views/form/template/index.vue | 245 ++++++++++++------ 2 files changed, 161 insertions(+), 86 deletions(-) diff --git a/src/views/form/design/components/CodeGeneratorModal.vue b/src/views/form/design/components/CodeGeneratorModal.vue index 568bf2c..1a6f4c6 100644 --- a/src/views/form/design/components/CodeGeneratorModal.vue +++ b/src/views/form/design/components/CodeGeneratorModal.vue @@ -161,6 +161,7 @@ generatorConfig.tableStructureConfigs = formJson.tableStructureConfigs; generatorConfig.formEventConfig = formJson.formEventConfig; generatorConfig.outputConfig.dataAuthList = formJson.dataAuthList; + generatorConfig.outputConfig.type =res.formDesignType generatorConfig.outputConfig.isDataAuth = formJson.isDataAuth; isGetInfo.value = true; }); @@ -200,7 +201,6 @@ tableInfo.value, buildOption(generatorConfig.formJson) as FormProps, ); - await dataFirstGeneratorCode(data); closeModal(); emits('success'); diff --git a/src/views/form/template/index.vue b/src/views/form/template/index.vue index 64683a3..cde5c0a 100644 --- a/src/views/form/template/index.vue +++ b/src/views/form/template/index.vue @@ -8,7 +8,8 @@ :clickRowToExpand="true" :treeData="treeData" :fieldNames="fieldNames" - @select="handleSelect" + @row-dbClick="dbClickRow" + :row-selection="rowSelection" >