From f9c2850d6b71d6d26e5de887a998bd57938b8a15 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 15 Apr 2023 17:28:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=20BPMNJS=20=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=BC=95=E5=85=A5=EF=BC=8C=E6=94=B9=E6=88=90=E5=B1=80=E9=83=A8?= =?UTF-8?q?=E5=BC=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.test | 2 +- .../bpmnProcessDesigner/package/index.ts | 38 +++---------------- src/main.ts | 9 ----- src/views/bpm/definition/index.vue | 3 +- src/views/bpm/model/index.vue | 3 +- src/views/bpm/model/modelEditor.vue | 7 ++-- .../detail/ProcessInstanceBpmnViewer.vue | 4 +- 7 files changed, 17 insertions(+), 49 deletions(-) diff --git a/.env.test b/.env.test index 85e2cf54..0793af25 100644 --- a/.env.test +++ b/.env.test @@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=false VITE_SOURCEMAP=true # 打包路径 -VITE_BASE_PATH=/dist-test/ +VITE_BASE_PATH=/ # 输出路径 VITE_OUT_DIR=dist-test diff --git a/src/components/bpmnProcessDesigner/package/index.ts b/src/components/bpmnProcessDesigner/package/index.ts index 23c77346..ce44a3c5 100644 --- a/src/components/bpmnProcessDesigner/package/index.ts +++ b/src/components/bpmnProcessDesigner/package/index.ts @@ -1,37 +1,11 @@ -import { App } from 'vue' import MyProcessDesigner from './designer' import MyProcessPenal from './penal' import MyProcessViewer from './designer/index2' -const components = [MyProcessDesigner, MyProcessPenal, MyProcessViewer] +import './theme/index.scss' +import 'bpmn-js/dist/assets/diagram-js.css' +import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css' +import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css' +import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css' -// const install = function (Vue) { -// components.forEach(component => { -// Vue.component(component.name, component) -// }) -// } - -// if (typeof window !== "undefined" && window.Vue) { -// install(window.Vue) -// } -// components.forEach(component => { -// Vue.component(component.name, component) -// }) -const componentss = { - install: (Vue: App): void => { - components.forEach((component) => { - Vue.component(component.name, component) - }) - } -} -// let version = "0.0.1" -export const MyPD = (app) => { - // export default { - // app.use(version) - // app.use(install) - // app.use(MyProcessDesigner) - // app.use(MyProcessPenal) - // app.use(MyProcessViewer) - // app.use(components) - app.use(componentss) -} +export { MyProcessDesigner, MyProcessPenal, MyProcessViewer } diff --git a/src/main.ts b/src/main.ts index 1ef9e006..37da0d2b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -40,13 +40,6 @@ import App from './App.vue' import './permission' -import { MyPD } from '@/components/bpmnProcessDesigner/package/index.js' -import '@/components/bpmnProcessDesigner/package/theme/index.scss' -import 'bpmn-js/dist/assets/diagram-js.css' -import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css' -import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css' -import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css' - import hljs from 'highlight.js' //导入代码高亮文件 import 'highlight.js/styles/github.css' //导入代码高亮样式 新版 @@ -66,8 +59,6 @@ const setupAll = async () => { await setupI18n(app) - MyPD(app) - setupStore(app) setupGlobCom(app) diff --git a/src/views/bpm/definition/index.vue b/src/views/bpm/definition/index.vue index f2ef640c..f6df8564 100644 --- a/src/views/bpm/definition/index.vue +++ b/src/views/bpm/definition/index.vue @@ -49,7 +49,7 @@ - - // 全局相关的 import import { DICT_TYPE, getDictOptions } from '@/utils/dict' +import { MyProcessViewer } from '@/components/bpmnProcessDesigner/package' import { FormInstance, UploadInstance } from 'element-plus' // 业务相关的 import diff --git a/src/views/bpm/model/modelEditor.vue b/src/views/bpm/model/modelEditor.vue index 43836976..5cfbd264 100644 --- a/src/views/bpm/model/modelEditor.vue +++ b/src/views/bpm/model/modelEditor.vue @@ -2,7 +2,7 @@
- -