流程台账界面完成
This commit is contained in:
@@ -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?.()
|
||||
|
||||
Reference in New Issue
Block a user