流程台账界面完成

This commit is contained in:
aixianling
2022-08-10 17:41:42 +08:00
parent bf1348fa63
commit 55da7871ee
4 changed files with 104 additions and 13 deletions

View File

@@ -52,26 +52,23 @@ export default {
loadLib() {
this.$injectCss("https://cdn.cunwuyun.cn/logicflow/index.css")
const load = url => new Promise(resolve => this.$injectLib(url, () => resolve()))
let libs = ["https://cdn.cunwuyun.cn/logicflow/logic-flow.js"]
let libs = ["https://cdn.cunwuyun.cn/logicflow/logic-flow.js", "https://cdn.jsdelivr.net/npm/@logicflow/extension/lib/BpmnElement.js"]
if (!this.readonly) {
this.$injectCss("https://cdn.jsdelivr.net/npm/@logicflow/extension/lib/style/index.css")
libs = [
libs,
"https://cdn.jsdelivr.net/npm/@logicflow/extension/lib/Menu.js",
"https://cdn.jsdelivr.net/npm/@logicflow/extension/lib/DndPanel.js",
"https://cdn.jsdelivr.net/npm/@logicflow/extension/lib/BpmnElement.js"
"https://cdn.jsdelivr.net/npm/@logicflow/extension/lib/DndPanel.js"
].flat()
}
return Promise.all(libs.map(e => load(e)))
},
initFlow(count = 0) {
const {LogicFlow, Menu, DndPanel, BpmnElement} = window
if (!!LogicFlow && this.$refs.lfIns && !!Menu && !!DndPanel) {
this.flow = new LogicFlow({
container: this.$refs.lfIns,
plugins: [Menu, DndPanel, BpmnElement]
})
this.flow.extension.dndPanel.setPatternItems(this.dndPanel)
let plugins = [BpmnElement, this.readonly ? [] : [Menu, DndPanel]].flat()
if (!!LogicFlow && this.$refs.lfIns && plugins.reduce((r, e) => r && !!e, true)) {
this.flow = new LogicFlow({container: this.$refs.lfIns, plugins})
this.flow.extension.dndPanel?.setPatternItems(this.dndPanel)
this.initValue()
this.flow.on('history:change', evt => {
this.configWatch?.()