From a5fc1939673d94335ceb174dce98539abfa1f3f2 Mon Sep 17 00:00:00 2001 From: yaoyn Date: Thu, 1 Aug 2024 11:07:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=B3=BB=E7=BB=9F=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E7=95=8C=E9=9D=A2=20=E5=BA=8F=E5=8F=B7=E5=88=97?= =?UTF-8?q?=E5=8F=B3=E5=AF=B9=E9=BD=90=20=E6=B5=81=E7=A8=8B=E5=85=83?= =?UTF-8?q?=E7=B4=A0=E5=90=8D=E7=A7=B0=E7=A9=BA=E6=8A=A5=E9=94=99=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/systemConfig/index.ts | 110 +++++ .../systemConfig/model/SystemConfigModel.ts | 63 +++ src/components/Table/src/hooks/useColumns.ts | 2 +- .../system/systemConfig/components/Form.vue | 174 ++++++++ .../components/SystemconfigModal.vue | 110 +++++ .../system/systemConfig/components/config.ts | 289 ++++++++++++ .../components/workflowPermission.ts | 77 ++++ src/views/system/systemConfig/index.vue | 419 ++++++++++++++++++ src/views/workflow/design/bpmn/index.vue | 5 +- 9 files changed, 1246 insertions(+), 3 deletions(-) create mode 100644 src/api/system/systemConfig/index.ts create mode 100644 src/api/system/systemConfig/model/SystemConfigModel.ts create mode 100644 src/views/system/systemConfig/components/Form.vue create mode 100644 src/views/system/systemConfig/components/SystemconfigModal.vue create mode 100644 src/views/system/systemConfig/components/config.ts create mode 100644 src/views/system/systemConfig/components/workflowPermission.ts create mode 100644 src/views/system/systemConfig/index.vue diff --git a/src/api/system/systemConfig/index.ts b/src/api/system/systemConfig/index.ts new file mode 100644 index 0000000..53f621f --- /dev/null +++ b/src/api/system/systemConfig/index.ts @@ -0,0 +1,110 @@ +import { XjrSystemConfigPageModel, XjrSystemConfigPageParams, XjrSystemConfigPageResult } from './model/SystemConfigModel'; +import { defHttp } from '/@/utils/http/axios'; +import { ErrorMessageMode } from '/#/axios'; + +enum Api { + Page = '/system/systemConfig/page', + List = '/system/systemConfig/list', + Info = '/system/systemConfig/info', + XjrSystemConfig = '/system/systemConfig', + + + Export = '/system/systemConfig/export', +} + +/** + * @description: 查询XjrSystemConfig分页列表 + */ +export async function getXjrSystemConfigPage(params: XjrSystemConfigPageParams, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.Page, + params, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 获取XjrSystemConfig信息 + */ +export async function getXjrSystemConfig(id: String, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.Info, + params: { id }, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 新增XjrSystemConfig + */ +export async function addXjrSystemConfig(xjrSystemConfig: Recordable, mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.XjrSystemConfig, + params: xjrSystemConfig, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 更新XjrSystemConfig + */ +export async function updateXjrSystemConfig(xjrSystemConfig: Recordable, mode: ErrorMessageMode = 'modal') { + return defHttp.put( + { + url: Api.XjrSystemConfig, + params: xjrSystemConfig, + }, + { + errorMessageMode: mode, + }, + ); +} + +/** + * @description: 删除XjrSystemConfig(批量删除) + */ +export async function deleteXjrSystemConfig(ids: string[], mode: ErrorMessageMode = 'modal') { + return defHttp.delete( + { + url: Api.XjrSystemConfig, + data: ids, + }, + { + errorMessageMode: mode, + }, + ); +} + + + +/** + * @description: 导出XjrSystemConfig + */ +export async function exportXjrSystemConfig( + params?: object, + mode: ErrorMessageMode = 'modal' +) { + return defHttp.download( + { + url: Api.Export, + method: 'GET', + params, + responseType: 'blob', + }, + { + errorMessageMode: mode, + }, + ); +} \ No newline at end of file diff --git a/src/api/system/systemConfig/model/SystemConfigModel.ts b/src/api/system/systemConfig/model/SystemConfigModel.ts new file mode 100644 index 0000000..425808d --- /dev/null +++ b/src/api/system/systemConfig/model/SystemConfigModel.ts @@ -0,0 +1,63 @@ +import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; + +/** + * @description: XjrSystemConfig分页参数 模型 + */ +export interface XjrSystemConfigPageParams extends BasicPageParams { + code: string; + + name: string; + + value: string; + + remark: string; +} + +/** + * @description: XjrSystemConfig分页返回值模型 + */ +export interface XjrSystemConfigPageModel { + id: string; + + code: string; + + name: string; + + value: string; + + remark: string; +} + +/** + * @description: XjrSystemConfig表类型 + */ +export interface XjrSystemConfigModel { + id: number; + + code: string; + + name: string; + + value: string; + + remark: string; + + createDate: string; + + createUserId: number; + + modifyDate: string; + + modifyUserId: number; + + deleteMark: number; + + enabledMark: number; + + tenantId: number; +} + +/** + * @description: XjrSystemConfig分页返回值结构 + */ +export type XjrSystemConfigPageResult = BasicFetchResult; \ No newline at end of file diff --git a/src/components/Table/src/hooks/useColumns.ts b/src/components/Table/src/hooks/useColumns.ts index 32e18f7..5c108dd 100644 --- a/src/components/Table/src/hooks/useColumns.ts +++ b/src/components/Table/src/hooks/useColumns.ts @@ -67,7 +67,7 @@ function handleIndexColumn( flag: INDEX_COLUMN_FLAG, width: 50, title: t('序号'), - align: 'center', + align: 'right', customRender: ({ index }) => { const getPagination = unref(getPaginationRef); if (isBoolean(getPagination)) { diff --git a/src/views/system/systemConfig/components/Form.vue b/src/views/system/systemConfig/components/Form.vue new file mode 100644 index 0000000..5044327 --- /dev/null +++ b/src/views/system/systemConfig/components/Form.vue @@ -0,0 +1,174 @@ + + \ No newline at end of file diff --git a/src/views/system/systemConfig/components/SystemconfigModal.vue b/src/views/system/systemConfig/components/SystemconfigModal.vue new file mode 100644 index 0000000..168dd47 --- /dev/null +++ b/src/views/system/systemConfig/components/SystemconfigModal.vue @@ -0,0 +1,110 @@ + + \ No newline at end of file diff --git a/src/views/system/systemConfig/components/config.ts b/src/views/system/systemConfig/components/config.ts new file mode 100644 index 0000000..80264de --- /dev/null +++ b/src/views/system/systemConfig/components/config.ts @@ -0,0 +1,289 @@ +import { FormProps, FormSchema } from '/@/components/Form'; +import { BasicColumn } from '/@/components/Table'; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'code', + label: '编码', + component: 'Input', + }, + { + field: 'name', + label: '名称', + component: 'Input', + }, + { + field: 'value', + label: '配置值', + component: 'Input', + }, + { + field: 'remark', + label: '备注', + component: 'Input', + }, +]; + +export const columns: BasicColumn[] = [ + { + dataIndex: 'code', + title: '编码', + componentType: 'input', + align: 'left', + + width: 150, + + sorter: true, + }, + + { + dataIndex: 'name', + title: '名称', + componentType: 'input', + align: 'left', + + width: 200, + + sorter: true, + }, + + { + dataIndex: 'value', + title: '配置值', + componentType: 'textarea', + align: 'left', + + sorter: true, + }, + + { + dataIndex: 'remark', + title: '备注', + componentType: 'textarea', + align: 'left', + + width: 150, + + 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 }, + labelAlign: 'right', + layout: 'horizontal', + size: 'default', + schemas: [ + { + key: '8318dab17ae34a13bd6a3838bb5b57f1', + field: '', + label: '标题', + type: 'title', + component: 'Title', + colProps: { span: 24 }, + defaultValue: '系统配置', + componentProps: { + defaultValue: '系统配置', + color: '', + align: 'left', + fontSize: 18, + isShow: true, + style: {}, + }, + }, + { + key: '34e417669da74420b74f0e9ee8caead6', + 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: '请输入编码', + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: false, + showLabel: true, + required: true, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' }, + }, + }, + { + key: '0f36e23276974c8486fbcbe2cd7a5126', + 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: '请输入名称', + prefix: '', + suffix: '', + addonBefore: '', + addonAfter: '', + disabled: false, + allowClear: false, + showLabel: true, + required: true, + rules: [], + events: {}, + isSave: false, + isShow: true, + scan: false, + style: { width: '100%' }, + }, + }, + { + key: '5a636807b3814241a9b7f9e9025acf07', + field: 'value', + label: '配置值', + type: 'textarea', + component: 'InputTextArea', + colProps: { span: 24 }, + defaultValue: '', + componentProps: { + width: '100%', + span: '', + defaultValue: '', + labelWidthMode: 'fix', + labelFixWidth: 120, + responsive: true, + respNewRow: true, + placeholder: '请输入配置值', + rows: 4, + autoSize: false, + showCount: false, + disabled: false, + showLabel: true, + allowClear: false, + required: false, + isShow: true, + rules: [], + events: {}, + style: { width: '100%' }, + }, + }, + { + key: 'd9a8a68174954ca6ba14bd86c7fbf669', + 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: '请输入备注', + 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: [], +}; \ No newline at end of file diff --git a/src/views/system/systemConfig/components/workflowPermission.ts b/src/views/system/systemConfig/components/workflowPermission.ts new file mode 100644 index 0000000..23ccdd3 --- /dev/null +++ b/src/views/system/systemConfig/components/workflowPermission.ts @@ -0,0 +1,77 @@ +export const permissionList = [ + { + required: false, + view: true, + edit: false, + disabled: true, + isSaveTable: false, + tableName: '', + fieldName: '标题', + fieldId: '', + isSubTable: false, + showChildren: true, + type: 'title', + key: '8318dab17ae34a13bd6a3838bb5b57f1', + children: [], + }, + { + required: true, + view: true, + edit: true, + disabled: false, + isSaveTable: false, + tableName: '', + fieldName: '编码', + fieldId: 'code', + isSubTable: false, + showChildren: true, + type: 'input', + key: '34e417669da74420b74f0e9ee8caead6', + children: [], + }, + { + required: true, + view: true, + edit: true, + disabled: false, + isSaveTable: false, + tableName: '', + fieldName: '名称', + fieldId: 'name', + isSubTable: false, + showChildren: true, + type: 'input', + key: '0f36e23276974c8486fbcbe2cd7a5126', + children: [], + }, + { + required: true, + view: true, + edit: true, + disabled: false, + isSaveTable: false, + tableName: '', + fieldName: '配置值', + fieldId: 'value', + isSubTable: false, + showChildren: true, + type: 'textarea', + key: '5a636807b3814241a9b7f9e9025acf07', + children: [], + }, + { + required: true, + view: true, + edit: true, + disabled: false, + isSaveTable: false, + tableName: '', + fieldName: '备注', + fieldId: 'remark', + isSubTable: false, + showChildren: true, + type: 'textarea', + key: 'd9a8a68174954ca6ba14bd86c7fbf669', + children: [], + }, +]; \ No newline at end of file diff --git a/src/views/system/systemConfig/index.vue b/src/views/system/systemConfig/index.vue new file mode 100644 index 0000000..7d7ec31 --- /dev/null +++ b/src/views/system/systemConfig/index.vue @@ -0,0 +1,419 @@ + + + \ No newline at end of file diff --git a/src/views/workflow/design/bpmn/index.vue b/src/views/workflow/design/bpmn/index.vue index 4c6b465..2374461 100644 --- a/src/views/workflow/design/bpmn/index.vue +++ b/src/views/workflow/design/bpmn/index.vue @@ -244,6 +244,7 @@ }); bpmnModeler.on('shape.removed', (e) => { if (e.element && e.element.id && e.element.id.includes('_label')) { + return; let id = e.element.id.replace('_label', ''); bpmnCanvas.removedId = id; removeProperties(id); @@ -268,9 +269,9 @@ getProperties(infoId)?.type == BpmnNodeKey.SEQUENCEFLOW) && !getProperties(infoId)?.name ) { - modeling.updateProperties(bpmnElement, { name: '_' }); + modeling.updateProperties(bpmnElement, { name: '' }); } else { - modeling.updateProperties(bpmnElement, { name: getProperties(infoId)?.name }); + modeling.updateProperties(bpmnElement, { name: getProperties(infoId)?.name }); } } // 更新xml中流程线参数