From bae44b4541c42c952569fa11ad9f089d03d5d3f8 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 19 Jan 2023 15:29:39 +0800 Subject: [PATCH 01/59] =?UTF-8?q?feat:=20=E5=BC=95=E5=85=A5=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E6=9E=84=E9=80=A0=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-admin-vue3/package.json | 2 + yudao-ui-admin-vue3/pnpm-lock.yaml | 133 +++++++++++++++++- yudao-ui-admin-vue3/src/main.ts | 10 +- .../src/plugins/formCreate/index.ts | 43 ++++++ .../src/views/infra/build/index.vue | 8 +- 5 files changed, 191 insertions(+), 5 deletions(-) create mode 100644 yudao-ui-admin-vue3/src/plugins/formCreate/index.ts diff --git a/yudao-ui-admin-vue3/package.json b/yudao-ui-admin-vue3/package.json index e3b7700b3..7da9c5ff1 100644 --- a/yudao-ui-admin-vue3/package.json +++ b/yudao-ui-admin-vue3/package.json @@ -24,6 +24,8 @@ "lint:pretty": "pretty-quick --staged" }, "dependencies": { + "@form-create/designer": "^3.1.0", + "@form-create/element-ui": "^3.1.17", "@iconify/iconify": "^3.0.1", "@vueuse/core": "^9.11.0", "@wangeditor/editor": "^5.1.23", diff --git a/yudao-ui-admin-vue3/pnpm-lock.yaml b/yudao-ui-admin-vue3/pnpm-lock.yaml index 7c0f236be..a0f4f9787 100644 --- a/yudao-ui-admin-vue3/pnpm-lock.yaml +++ b/yudao-ui-admin-vue3/pnpm-lock.yaml @@ -3,6 +3,8 @@ lockfileVersion: 5.4 specifiers: '@commitlint/cli': ^17.4.2 '@commitlint/config-conventional': ^17.4.2 + '@form-create/designer': ^3.1.0 + '@form-create/element-ui': ^3.1.17 '@iconify/iconify': ^3.0.1 '@iconify/json': ^2.2.8 '@intlify/unplugin-vue-i18n': ^0.8.1 @@ -85,6 +87,8 @@ specifiers: xe-utils: ^3.5.7 dependencies: + '@form-create/designer': 3.1.0_vue@3.2.45 + '@form-create/element-ui': 3.1.17_vue@3.2.45 '@iconify/iconify': 3.0.1 '@vueuse/core': 9.11.0_vue@3.2.45 '@wangeditor/editor': 5.1.23 @@ -436,6 +440,14 @@ packages: - supports-color dev: true + /@babel/runtime-corejs3/7.20.7: + resolution: {integrity: sha512-jr9lCZ4RbRQmCR28Q8U8Fu49zvFqLxTY9AMOUz+iyMohMoAgpEcVxY+wJNay99oXOpOcCTODkk70NDN2aaJEeg==} + engines: {node: '>=6.9.0'} + dependencies: + core-js-pure: 3.27.2 + regenerator-runtime: 0.13.11 + dev: false + /@babel/runtime/7.20.1: resolution: {integrity: sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg==} engines: {node: '>=6.9.0'} @@ -934,6 +946,100 @@ packages: '@floating-ui/core': 1.0.2 dev: false + /@form-create/component-elm-checkbox/3.1.15: + resolution: {integrity: sha512-bAl3k0p76wwMX0OxeR8KAEiUl2RP1Jl1kAqbjD762EcSXGgaXgP94v9ag1JhUoiwZkSKWl6IF+e/utjEonRSFw==} + dependencies: + '@form-create/utils': 3.1.15 + dev: false + + /@form-create/component-elm-frame/3.1.15: + resolution: {integrity: sha512-78WbMpMLTYwTo3QP7Fa+N2VF/u1vmRuwDmiobtBtVg9EE7m6//bQV96ibnLNXX27MD41gIg+o1GUJtx/qxZ8Ew==} + dependencies: + '@form-create/utils': 3.1.15 + dev: false + + /@form-create/component-elm-group/3.1.15: + resolution: {integrity: sha512-V/oVxHf9rHqqMHRV0XRVED9EYFCVZ8Tv/EbbIN/4rORruHtzdQOH8I0QHQ9T4vZO9Q4eblApzcJb8Y7bbHX23Q==} + dependencies: + '@form-create/utils': 3.1.15 + dev: false + + /@form-create/component-elm-radio/3.1.15: + resolution: {integrity: sha512-qAf1VlhrUvMlgzkz6BYLRn0UOLahkTI/cbzt8nkp5PL1oGoSXp5xqIOtHMjbnGEkEXW57kjRKI5Q7UjzIhYmvQ==} + dependencies: + '@form-create/utils': 3.1.15 + dev: false + + /@form-create/component-elm-select/3.1.15: + resolution: {integrity: sha512-ZnvPn/TGqgFDed7bKabjRvlwlQ8RYq5WCG9Iy63d2igC8577tv5QTI2rNvfGfxxH/254MPwgNlA94JukxzEOTw==} + dependencies: + '@form-create/utils': 3.1.15 + dev: false + + /@form-create/component-elm-tree/3.1.15: + resolution: {integrity: sha512-4VPN406A8Mvannn8P/2DvStqDYFfDHZ+ILG/0JndOyfe+GdYdSA5SwD3LfC4zD6AhpGrkOJXbd4YYXlBUtzt8g==} + dependencies: + '@form-create/utils': 3.1.15 + dev: false + + /@form-create/component-elm-upload/3.1.17: + resolution: {integrity: sha512-9FToAS1rQAS1KBq5YK473i3EpGGwHAerqjuoiKiH4wlaGsJma+nGtRui1SSAF4r4QfWGKuSGZJmPtT6EMP4w8Q==} + dependencies: + '@form-create/utils': 3.1.15 + dev: false + + /@form-create/component-subform/3.1.5: + resolution: {integrity: sha512-JHNEFGuwpnjGvCJ0I0GCqPL5al0qXoN4ymnRBpm+oL+6MMo5bz1kUyoqMX1MutuC96gHTqpeqc67hssi8g2mIw==} + dev: false + + /@form-create/component-wangeditor/3.1.12: + resolution: {integrity: sha512-ncsHFCiBY4veyD0yj0kWz+hqEjvY8VGTCJYpYL/b7/8dnPAEaSn9fwOKc32eyZbb8YJXwt3BivvFBx3aMj0cTg==} + dependencies: + wangeditor: 4.7.15 + dev: false + + /@form-create/core/3.1.17_vue@3.2.45: + resolution: {integrity: sha512-XGsrmUR5nQEvDvxhB035df62iunSA91oQ77XbGvfaoi8Sz/EBos7xbVdIXNfACxdLMedy33+LBVGIrEHU8UNjw==} + peerDependencies: + vue: ^3.1.0 + dependencies: + '@form-create/utils': 3.1.15 + vue: 3.2.45 + dev: false + + /@form-create/designer/3.1.0_vue@3.2.45: + resolution: {integrity: sha512-+YH/MkInTyL1bNqX6BSeixPlNUxyeqMvy5zrC97nzf+m87SuBny+qFECEkMWhtQ4GTAIy91DjxQM2KJ6QTlB4w==} + dependencies: + '@form-create/component-wangeditor': 3.1.12 + '@form-create/element-ui': 3.1.17_vue@3.2.45 + '@form-create/utils': 3.1.15 + vuedraggable: 4.1.0_vue@3.2.45 + transitivePeerDependencies: + - vue + dev: false + + /@form-create/element-ui/3.1.17_vue@3.2.45: + resolution: {integrity: sha512-MQ/ozkH8Ckx1rgzUcrQmqqfg3SCOBb6AYIOn6YcF/H+iid7xbq16qJjPa0sAKNlO3WC6ak3ucF6KuWu4R7uChw==} + peerDependencies: + vue: ^3.1.0 + dependencies: + '@form-create/component-elm-checkbox': 3.1.15 + '@form-create/component-elm-frame': 3.1.15 + '@form-create/component-elm-group': 3.1.15 + '@form-create/component-elm-radio': 3.1.15 + '@form-create/component-elm-select': 3.1.15 + '@form-create/component-elm-tree': 3.1.15 + '@form-create/component-elm-upload': 3.1.17 + '@form-create/component-subform': 3.1.5 + '@form-create/core': 3.1.17_vue@3.2.45 + '@form-create/utils': 3.1.15 + vue: 3.2.45 + dev: false + + /@form-create/utils/3.1.15: + resolution: {integrity: sha512-tP6Z/c2XC6OYrI8D9/XWvJc2h6apsyMFTy051sY+tCcxppqyR7dBEEXmgfWOrAr980N7k10g27kwJ9TdVn+bfw==} + dev: false + /@humanwhocodes/config-array/0.11.8: resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==} engines: {node: '>=10.10.0'} @@ -2470,6 +2576,11 @@ packages: engines: {node: '>=0.10.0'} dev: true + /core-js-pure/3.27.2: + resolution: {integrity: sha512-Cf2jqAbXgWH3VVzjyaaFkY1EBazxugUepGymDoeteyYr9ByX51kD2jdHZlsEF/xnJMyN3Prua7mQuzwMg6Zc9A==} + requiresBuild: true + dev: false + /core-js/3.26.1: resolution: {integrity: sha512-21491RRQVzUn0GGM9Z1Jrpr6PNPxPi+Za8OM9q4tksTSnlbXXGKK1nXNg/QvwFYettXvSX6zWKCtHHfjN4puyA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/core-js/-/core-js-3.26.1.tgz} requiresBuild: true @@ -5369,6 +5480,10 @@ packages: - supports-color dev: true + /sortablejs/1.14.0: + resolution: {integrity: sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==} + dev: false + /source-map-js/1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} @@ -5857,7 +5972,6 @@ packages: /tslib/2.4.1: resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} - dev: true /tsutils/3.21.0_typescript@4.9.4: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} @@ -6342,6 +6456,15 @@ packages: '@vue/server-renderer': 3.2.45_vue@3.2.45 '@vue/shared': 3.2.45 + /vuedraggable/4.1.0_vue@3.2.45: + resolution: {integrity: sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==} + peerDependencies: + vue: ^3.0.1 + dependencies: + sortablejs: 1.14.0 + vue: 3.2.45 + dev: false + /vxe-table/4.3.9_vue@3.2.45+xe-utils@3.5.7: resolution: {integrity: sha512-Ns7Ooa7lOHBpks90i0k0BMNyxfMpUo39ryxTgKE41X3xVnI9tGQs2U6+klfDlsuqYfmG3ibyzHN3OCrWbbKo4Q==} peerDependencies: @@ -6352,6 +6475,14 @@ packages: xe-utils: 3.5.7 dev: false + /wangeditor/4.7.15: + resolution: {integrity: sha512-aPTdREd8BxXVyJ5MI+LU83FQ7u1EPd341iXIorRNYSOvoimNoZ4nPg+yn3FGbB93/owEa6buLw8wdhYnMCJQLg==} + dependencies: + '@babel/runtime': 7.20.1 + '@babel/runtime-corejs3': 7.20.7 + tslib: 2.4.1 + dev: false + /web-storage-cache/1.1.1: resolution: {integrity: sha512-D0MieGooOs8RpsrK+vnejXnvh4OOv/+lTFB35JRkJJQt+uOjPE08XpaE0QBLMTRu47B1KGT/Nq3Gbag3Orinzw==} dev: false diff --git a/yudao-ui-admin-vue3/src/main.ts b/yudao-ui-admin-vue3/src/main.ts index f5e3c024e..2adf9dc66 100644 --- a/yudao-ui-admin-vue3/src/main.ts +++ b/yudao-ui-admin-vue3/src/main.ts @@ -13,12 +13,15 @@ import { setupStore } from '@/store' // 全局组件 import { setupGlobCom } from '@/components' -// 引入element-plus +// 引入 element-plus import { setupElementPlus } from '@/plugins/elementPlus' -// 引入vxe-table +// 引入 vxe-table import { setupVxeTable } from '@/plugins/vxeTable' +// 引入 form-create +import { setupFormCreate } from '@/plugins/formCreate' + // 引入全局样式 import '@/styles/index.scss' @@ -39,6 +42,7 @@ import './permission' import { isDevMode } from '@/utils/env' +// 本地开发模式 全局引入 element-plus 样式,加快第一次进入速度 if (isDevMode()) { console.info(isDevMode()) import('element-plus/dist/index.css') @@ -58,6 +62,8 @@ const setupAll = async () => { setupVxeTable(app) + setupFormCreate(app) + setupRouter(app) setupAuth(app) diff --git a/yudao-ui-admin-vue3/src/plugins/formCreate/index.ts b/yudao-ui-admin-vue3/src/plugins/formCreate/index.ts new file mode 100644 index 000000000..69816d8a7 --- /dev/null +++ b/yudao-ui-admin-vue3/src/plugins/formCreate/index.ts @@ -0,0 +1,43 @@ +import type { App } from 'vue' +// 👇使用 form-create 需额外全局引入 element plus 组件 +import { + ElAside, + ElPopconfirm, + ElHeader, + ElMain, + ElContainer, + ElDivider, + ElTransfer, + ElAlert, + ElTabs, + ElTabPane +} from 'element-plus' + +import formCreate from '@form-create/element-ui' +import install from '@form-create/element-ui/auto-import' +import FcDesigner from '@form-create/designer' + +const components = [ + ElAside, + ElPopconfirm, + ElHeader, + ElMain, + ElContainer, + ElDivider, + ElTransfer, + ElAlert, + ElTabs, + ElTabPane +] + +export const setupFormCreate = (app: App) => { + components.forEach((component) => { + app.component(component.name, component) + }) + + formCreate.use(install) + + app.use(formCreate) + + app.use(FcDesigner) +} diff --git a/yudao-ui-admin-vue3/src/views/infra/build/index.vue b/yudao-ui-admin-vue3/src/views/infra/build/index.vue index 514fd656d..c682a160f 100644 --- a/yudao-ui-admin-vue3/src/views/infra/build/index.vue +++ b/yudao-ui-admin-vue3/src/views/infra/build/index.vue @@ -1,4 +1,8 @@ - + From b90b297e6fa0f5ec63a09dddb3a88838b22d60a8 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 19 Jan 2023 16:05:25 +0800 Subject: [PATCH 02/59] feat: form designer --- .../src/types/auto-components.d.ts | 1 - .../src/views/infra/build/index.vue | 79 ++++++++++++++++++- 2 files changed, 78 insertions(+), 2 deletions(-) diff --git a/yudao-ui-admin-vue3/src/types/auto-components.d.ts b/yudao-ui-admin-vue3/src/types/auto-components.d.ts index 46a1ae56c..a35bc2a30 100644 --- a/yudao-ui-admin-vue3/src/types/auto-components.d.ts +++ b/yudao-ui-admin-vue3/src/types/auto-components.d.ts @@ -51,7 +51,6 @@ declare module '@vue/runtime-core' { ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] - ElScroll: typeof import('element-plus/es')['ElScroll'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElSelect: typeof import('element-plus/es')['ElSelect'] ElSkeleton: typeof import('element-plus/es')['ElSkeleton'] diff --git a/yudao-ui-admin-vue3/src/views/infra/build/index.vue b/yudao-ui-admin-vue3/src/views/infra/build/index.vue index c682a160f..d3230a6d4 100644 --- a/yudao-ui-admin-vue3/src/views/infra/build/index.vue +++ b/yudao-ui-admin-vue3/src/views/infra/build/index.vue @@ -1,8 +1,85 @@ From af0178e8ff8afd6fabd322286c7f19cbde08e5c4 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 19 Jan 2023 16:34:33 +0800 Subject: [PATCH 03/59] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E6=9E=84=E9=80=A0=E5=99=A8=E9=A2=84=E8=A7=88=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/infra/build/index.vue | 40 ++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/yudao-ui-admin-vue3/src/views/infra/build/index.vue b/yudao-ui-admin-vue3/src/views/infra/build/index.vue index d3230a6d4..7da88f8c0 100644 --- a/yudao-ui-admin-vue3/src/views/infra/build/index.vue +++ b/yudao-ui-admin-vue3/src/views/infra/build/index.vue @@ -16,13 +16,24 @@ -
{{ formValue }}
+
+ + +
+            {{ formValue }}
+          
+
+
输入内容格式有误!
From 2d85f11f82a27c4ef09780565e06e6ad3e73538e Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 19 Jan 2023 16:49:57 +0800 Subject: [PATCH 04/59] =?UTF-8?q?bpm=EF=BC=9A=E6=B5=81=E7=A8=8B=E5=88=97?= =?UTF-8?q?=E8=A1=A8=20100%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/bpm/form/form.data.ts | 76 ++--- .../src/views/bpm/form/index.vue | 263 ++++++++---------- 2 files changed, 148 insertions(+), 191 deletions(-) diff --git a/yudao-ui-admin-vue3/src/views/bpm/form/form.data.ts b/yudao-ui-admin-vue3/src/views/bpm/form/form.data.ts index 8e2ed896c..a07a56596 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/form/form.data.ts +++ b/yudao-ui-admin-vue3/src/views/bpm/form/form.data.ts @@ -1,4 +1,5 @@ -import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +import { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' + const { t } = useI18n() // 国际化 // 表单校验 @@ -7,52 +8,33 @@ export const rules = reactive({ }) // CrudSchema -const crudSchemas = reactive([ - { - label: t('common.index'), - field: 'id', - type: 'index', - form: { - show: false +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: 'seq', + primaryTitle: '表单编号', + action: true, + columns: [ + { + title: '表单名', + field: 'name', + isSearch: true }, - detail: { - show: false - } - }, - { - label: '表单名', - field: 'name', - search: { - show: true - } - }, - { - label: t('common.status'), - field: 'status', - dictType: DICT_TYPE.COMMON_STATUS, - dictClass: 'number' - }, - { - label: '备注', - field: 'remark' - }, - { - label: t('common.createTime'), - field: 'createTime', - form: { - show: false - } - }, - { - label: t('table.action'), - field: 'action', - width: '240px', - form: { - show: false + { + title: t('common.status'), + field: 'status', + dictType: DICT_TYPE.COMMON_STATUS, + dictClass: 'number' }, - detail: { - show: false + { + title: '备注', + field: 'remark' + }, + { + title: t('common.createTime'), + field: 'createTime', + formatter: 'formatDate', + isForm: false } - } -]) -export const { allSchemas } = useCrudSchemas(crudSchemas) + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/yudao-ui-admin-vue3/src/views/bpm/form/index.vue b/yudao-ui-admin-vue3/src/views/bpm/form/index.vue index eff394704..068b60b1f 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/form/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/form/index.vue @@ -1,165 +1,140 @@ - - - From fabdccd981c442823dad0a376dfda453ce8ccc8f Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 19 Jan 2023 17:11:31 +0800 Subject: [PATCH 05/59] =?UTF-8?q?bpm=EF=BC=9A=E6=B5=81=E7=A8=8B=E5=88=86?= =?UTF-8?q?=E9=85=8D=E4=BB=BB=E5=8A=A1=E7=9A=84=E5=88=97=E8=A1=A8=2050%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-admin-vue3/package.json | 1 + .../src/router/modules/remaining.ts | 33 ++ .../src/views/bpm/taskAssignRule/index.vue | 309 +++++++++++++++++- .../bpm/taskAssignRule/taskAssignRule.data.ts | 37 +++ 4 files changed, 378 insertions(+), 2 deletions(-) create mode 100644 yudao-ui-admin-vue3/src/views/bpm/taskAssignRule/taskAssignRule.data.ts diff --git a/yudao-ui-admin-vue3/package.json b/yudao-ui-admin-vue3/package.json index 7da9c5ff1..2302aba48 100644 --- a/yudao-ui-admin-vue3/package.json +++ b/yudao-ui-admin-vue3/package.json @@ -52,6 +52,7 @@ "vue-i18n": "9.2.2", "vue-router": "^4.1.6", "vue-types": "^5.0.2", + "vue3-treeselect": "^0.1.10", "vxe-table": "^4.3.9", "web-storage-cache": "^1.1.1", "xe-utils": "^3.5.7" diff --git a/yudao-ui-admin-vue3/src/router/modules/remaining.ts b/yudao-ui-admin-vue3/src/router/modules/remaining.ts index e511e1948..1fb7c2ae8 100644 --- a/yudao-ui-admin-vue3/src/router/modules/remaining.ts +++ b/yudao-ui-admin-vue3/src/router/modules/remaining.ts @@ -177,6 +177,39 @@ const remainingRouter: AppRouteRecordRaw[] = [ title: '500', noTagsView: true } + }, + { + path: '/bpm', + component: Layout, + name: 'bpm', + meta: { + hidden: true + }, + children: [ + { + path: '/manager/definition', + component: () => import('@/views/bpm/definition/index.vue'), + name: 'BpmProcessDefinitionList', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '流程定义', + activeMenu: 'bpm/definition/index' + } + }, + { + path: '/manager/task-assign-rule', + component: () => import('@/views/bpm/taskAssignRule/index.vue'), + name: 'BpmTaskAssignRuleList', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '任务分配规则' + } + } + ] } ] diff --git a/yudao-ui-admin-vue3/src/views/bpm/taskAssignRule/index.vue b/yudao-ui-admin-vue3/src/views/bpm/taskAssignRule/index.vue index 674c390f1..7060485cd 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/taskAssignRule/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/taskAssignRule/index.vue @@ -1,4 +1,309 @@ - + diff --git a/yudao-ui-admin-vue3/src/views/bpm/taskAssignRule/taskAssignRule.data.ts b/yudao-ui-admin-vue3/src/views/bpm/taskAssignRule/taskAssignRule.data.ts new file mode 100644 index 000000000..f66a7fbe9 --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/taskAssignRule/taskAssignRule.data.ts @@ -0,0 +1,37 @@ +import { reactive } from 'vue' +import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' +import { DICT_TYPE } from '@/utils/dict' + +// CrudSchema +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: null, + action: true, + actionWidth: '200px', + columns: [ + { + title: '任务名', + field: 'taskDefinitionName' + }, + { + title: '任务标识', + field: 'taskDefinitionKey' + }, + { + title: '规则类型', + field: 'category', + dictType: DICT_TYPE.BPM_TASK_ASSIGN_RULE_TYPE, + dictClass: 'number' + }, + { + title: '规则范围', + field: 'options', + table: { + slots: { + default: 'options_default' + } + } + } + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) From c9d1100eacd139c625433aa15e7d5f62e511a211 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 19 Jan 2023 18:19:01 +0800 Subject: [PATCH 06/59] perf: task assign rule --- yudao-ui-admin-vue3/package.json | 1 - .../src/views/bpm/taskAssignRule/index.vue | 31 ++++++------------- .../bpm/taskAssignRule/taskAssignRule.data.ts | 4 +-- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/yudao-ui-admin-vue3/package.json b/yudao-ui-admin-vue3/package.json index 2302aba48..7da9c5ff1 100644 --- a/yudao-ui-admin-vue3/package.json +++ b/yudao-ui-admin-vue3/package.json @@ -52,7 +52,6 @@ "vue-i18n": "9.2.2", "vue-router": "^4.1.6", "vue-types": "^5.0.2", - "vue3-treeselect": "^0.1.10", "vxe-table": "^4.3.9", "web-storage-cache": "^1.1.1", "xe-utils": "^3.5.7" diff --git a/yudao-ui-admin-vue3/src/views/bpm/taskAssignRule/index.vue b/yudao-ui-admin-vue3/src/views/bpm/taskAssignRule/index.vue index 7060485cd..d3b6a19b3 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/taskAssignRule/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/taskAssignRule/index.vue @@ -62,14 +62,14 @@ span="24" v-if="formData.type === 20 || formData.type === 21" > - @@ -127,18 +127,13 @@ diff --git a/yudao-ui-admin-vue3/src/views/bpm/form/index.vue b/yudao-ui-admin-vue3/src/views/bpm/form/index.vue index 068b60b1f..37733533a 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/form/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/form/index.vue @@ -91,13 +91,8 @@ const [registerTable, { deleteData }] = useXTable({ // 新增操作 const handleCreate = () => { - console.log('新增') - if (true) { - message.success('动态表单开发中,预计 2 月底完成') - return - } router.push({ - path: '/manager/form/edit' + name: 'bpmFormEditor' }) } From fe6adf693b94cfe6f3292f7e0396c7114e335b23 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 20 Jan 2023 13:40:00 +0800 Subject: [PATCH 08/59] =?UTF-8?q?bpm=EF=BC=9A=E5=AE=8C=E6=88=90=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../definition/BpmFormServiceImpl.java | 9 +-- yudao-ui-admin-vue3/src/api/bpm/form/index.ts | 11 ++- yudao-ui-admin-vue3/src/api/bpm/form/types.ts | 9 --- .../src/router/modules/remaining.ts | 2 +- yudao-ui-admin-vue3/src/utils/formCreate.ts | 45 +++++++++++ .../src/views/bpm/form/formEditor.vue | 57 +++++++++++--- .../src/views/bpm/form/index.vue | 78 +++++-------------- 7 files changed, 127 insertions(+), 84 deletions(-) delete mode 100644 yudao-ui-admin-vue3/src/api/bpm/form/types.ts create mode 100644 yudao-ui-admin-vue3/src/utils/formCreate.ts diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmFormServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmFormServiceImpl.java index 967ab8f49..e68a6b489 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmFormServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmFormServiceImpl.java @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.bpm.service.definition; import cn.hutool.core.lang.Assert; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; -import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormCreateReqVO; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormPageReqVO; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormUpdateReqVO; @@ -107,17 +106,15 @@ public class BpmFormServiceImpl implements BpmFormService { return null; } - private void checkKeyNCName(String key) { - if (!ValidationUtils.isXmlNCName(key)) { - throw exception(MODEL_KEY_VALID); - } - } /** * 校验 Field,避免 field 重复 * * @param fields field 数组 */ private void checkFields(List fields) { + if (true) { // TODO 芋艿:兼容 Vue3 工作流:因为采用了新的表单设计器,所以暂时不校验 + return; + } Map fieldMap = new HashMap<>(); // key 是 vModel,value 是 label for (String field : fields) { BpmFormFieldRespDTO fieldDTO = JsonUtils.parseObject(field, BpmFormFieldRespDTO.class); diff --git a/yudao-ui-admin-vue3/src/api/bpm/form/index.ts b/yudao-ui-admin-vue3/src/api/bpm/form/index.ts index 15856c5a1..c745201f2 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/form/index.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/form/index.ts @@ -1,5 +1,14 @@ import request from '@/config/axios' -import { FormVO } from './types' + +export type FormVO = { + id: number + name: string + conf: string + fields: string[] + status: number + remark: string + createTime: string +} // 创建工作流的表单定义 export const createFormApi = async (data: FormVO) => { diff --git a/yudao-ui-admin-vue3/src/api/bpm/form/types.ts b/yudao-ui-admin-vue3/src/api/bpm/form/types.ts deleted file mode 100644 index 2bc8b6912..000000000 --- a/yudao-ui-admin-vue3/src/api/bpm/form/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type FormVO = { - id: number - name: string - conf: string - fields: string[] - status: number - remark: string - createTime: string -} diff --git a/yudao-ui-admin-vue3/src/router/modules/remaining.ts b/yudao-ui-admin-vue3/src/router/modules/remaining.ts index 43ad50aa6..c53bcb2df 100644 --- a/yudao-ui-admin-vue3/src/router/modules/remaining.ts +++ b/yudao-ui-admin-vue3/src/router/modules/remaining.ts @@ -194,7 +194,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ noCache: true, hidden: true, canTo: true, - title: '流程表单', + title: '设计流程表单', activeMenu: 'bpm/manager/form/formEditor' } }, diff --git a/yudao-ui-admin-vue3/src/utils/formCreate.ts b/yudao-ui-admin-vue3/src/utils/formCreate.ts new file mode 100644 index 000000000..e70ae39e9 --- /dev/null +++ b/yudao-ui-admin-vue3/src/utils/formCreate.ts @@ -0,0 +1,45 @@ +/** + * 针对 https://github.com/xaboy/form-create-designer 封装的工具类 + */ + +// 编码表单 Conf +export const encodeConf = (designerRef: object) => { + // @ts-ignore + return JSON.stringify(designerRef.value.getOption()) +} + +// 编码表单 Fields +export const encodeFields = (designerRef: object) => { + // @ts-ignore + const rule = designerRef.value.getRule() + const fields: string[] = [] + rule.forEach((item) => { + fields.push(JSON.stringify(item)) + }) + return fields +} + +// 解码表单 Fields +export const decodeFields = (fields: string[]) => { + const rule: object[] = [] + fields.forEach((item) => { + rule.push(JSON.parse(item)) + }) + return rule +} + +// 设置表单的 Conf 和 Fields +export const setConfAndFields = (designerRef: object, conf: string, fields: string) => { + // @ts-ignore + designerRef.value.setOption(JSON.parse(conf)) + // @ts-ignore + designerRef.value.setRule(decodeFields(fields)) +} + +// 设置表单的 Conf 和 Fields +export const setConfAndFields2 = (detailPreview: object, conf: string, fields: string) => { + // @ts-ignore + detailPreview.value.option = JSON.parse(conf) + // @ts-ignore + detailPreview.value.rule = decodeFields(fields) +} diff --git a/yudao-ui-admin-vue3/src/views/bpm/form/formEditor.vue b/yudao-ui-admin-vue3/src/views/bpm/form/formEditor.vue index 201b663f2..d53791418 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/form/formEditor.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/form/formEditor.vue @@ -8,7 +8,7 @@ - + @@ -43,22 +43,26 @@ diff --git a/yudao-ui-admin-vue3/src/views/bpm/form/index.vue b/yudao-ui-admin-vue3/src/views/bpm/form/index.vue index 37733533a..749c2416f 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/form/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/form/index.vue @@ -37,12 +37,9 @@ /> - - - - 表单详情 + + + @@ -50,21 +47,18 @@ From 9d9590212fa4d994356cd30f608bcbcd78c4c662 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 20 Jan 2023 15:12:12 +0800 Subject: [PATCH 09/59] =?UTF-8?q?bpm=EF=BC=9A=E5=AE=8C=E5=96=84=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=BB=84=E7=9A=84=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/bpm/userGroup/index.ts | 11 +- .../src/api/bpm/userGroup/types.ts | 9 - .../src/views/bpm/form/form.data.ts | 5 +- .../src/views/bpm/group/group.data.ts | 112 +++---- .../src/views/bpm/group/index.vue | 316 ++++++++---------- 5 files changed, 205 insertions(+), 248 deletions(-) delete mode 100644 yudao-ui-admin-vue3/src/api/bpm/userGroup/types.ts diff --git a/yudao-ui-admin-vue3/src/api/bpm/userGroup/index.ts b/yudao-ui-admin-vue3/src/api/bpm/userGroup/index.ts index e61ebf36d..88ee96197 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/userGroup/index.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/userGroup/index.ts @@ -1,5 +1,14 @@ import request from '@/config/axios' -import { UserGroupVO } from './types' + +export type UserGroupVO = { + id: number + name: string + description: string + memberUserIds: number[] + status: number + remark: string + createTime: string +} // 创建用户组 export const createUserGroupApi = async (data: UserGroupVO) => { diff --git a/yudao-ui-admin-vue3/src/api/bpm/userGroup/types.ts b/yudao-ui-admin-vue3/src/api/bpm/userGroup/types.ts deleted file mode 100644 index d0d67ad43..000000000 --- a/yudao-ui-admin-vue3/src/api/bpm/userGroup/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type UserGroupVO = { - id: number - name: string - description: string - memberUserIds: number[] - status: number - remark: string - createTime: string -} diff --git a/yudao-ui-admin-vue3/src/views/bpm/form/form.data.ts b/yudao-ui-admin-vue3/src/views/bpm/form/form.data.ts index a07a56596..b228ac95f 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/form/form.data.ts +++ b/yudao-ui-admin-vue3/src/views/bpm/form/form.data.ts @@ -33,7 +33,10 @@ const crudSchemas = reactive({ title: t('common.createTime'), field: 'createTime', formatter: 'formatDate', - isForm: false + isForm: false, + table: { + width: 180 + } } ] }) diff --git a/yudao-ui-admin-vue3/src/views/bpm/group/group.data.ts b/yudao-ui-admin-vue3/src/views/bpm/group/group.data.ts index 1964b1f8b..07f9b6aaf 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/group/group.data.ts +++ b/yudao-ui-admin-vue3/src/views/bpm/group/group.data.ts @@ -1,69 +1,63 @@ -import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +import { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' + const { t } = useI18n() // 国际化 // 表单校验 export const rules = reactive({ - name: [required] + name: [required], + description: [required], + memberUserIds: [required], + status: [required] }) // CrudSchema -const crudSchemas = reactive([ - { - label: t('common.index'), - field: 'id', - type: 'index', - form: { - show: false +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: 'id', + primaryTitle: '编号', + action: true, + columns: [ + { + title: '组名', + field: 'name', + isSearch: true }, - detail: { - show: false - } - }, - { - label: '组名', - field: 'name', - search: { - show: true - } - }, - { - label: '成员', - field: 'memberUserIds' - }, - { - label: '描述', - field: 'description' - }, - { - label: t('common.status'), - field: 'status', - dictType: DICT_TYPE.COMMON_STATUS, - dictClass: 'number' - }, - { - label: '备注', - field: 'remark', - table: { - show: false - } - }, - { - label: t('common.createTime'), - field: 'createTime', - form: { - show: false - } - }, - { - label: t('table.action'), - field: 'action', - width: '240px', - form: { - show: false + { + title: '成员', + field: 'memberUserIds', + table: { + slots: { + default: 'memberUserIds_default' + } + } }, - detail: { - show: false + { + title: '描述', + field: 'description' + }, + { + title: t('common.status'), + field: 'status', + dictType: DICT_TYPE.COMMON_STATUS, + dictClass: 'number', + isSearch: true + }, + { + title: t('common.createTime'), + field: 'createTime', + formatter: 'formatDate', + isForm: false, + isSearch: true, + search: { + show: true, + itemRender: { + name: 'XDataTimePicker' + } + }, + table: { + width: 180 + } } - } -]) -export const { allSchemas } = useCrudSchemas(crudSchemas) + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/yudao-ui-admin-vue3/src/views/bpm/group/index.vue b/yudao-ui-admin-vue3/src/views/bpm/group/index.vue index ee3355f93..c6d9d484c 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/group/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/group/index.vue @@ -1,172 +1,46 @@ - -