From d5b569eefabd175cfb16ab68c7b39c366d1452ba Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 15 Apr 2023 18:52:35 +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/editor/index.vue | 5 ++- src/views/bpm/model/index.vue | 3 +- .../detail/ProcessInstanceBpmnViewer.vue | 4 +- 7 files changed, 16 insertions(+), 48 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 0fc15c2c..fc67552f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -37,13 +37,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' //导入代码高亮样式 新版 @@ -65,8 +58,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 ae260b45..c18e9a92 100644 --- a/src/views/bpm/definition/index.vue +++ b/src/views/bpm/definition/index.vue @@ -84,7 +84,7 @@ - import { DICT_TYPE } from '@/utils/dict' import { dateFormatter } from '@/utils/formatTime' +import { MyProcessViewer } from '@/components/bpmnProcessDesigner/package' import * as DefinitionApi from '@/api/bpm/definition' import { setConfAndFields2 } from '@/utils/formCreate' const { push } = useRouter() // 路由 diff --git a/src/views/bpm/model/editor/index.vue b/src/views/bpm/model/editor/index.vue index 9eade1ad..24908ae5 100644 --- a/src/views/bpm/model/editor/index.vue +++ b/src/views/bpm/model/editor/index.vue @@ -1,7 +1,7 @@