初步完善模型发布流程

This commit is contained in:
yunlong.li
2021-11-18 18:23:56 +08:00
parent 3f90e79d8a
commit a829e8d083
9 changed files with 236 additions and 148 deletions

View File

@ -2,10 +2,7 @@
<div>
<el-button-group>
<el-tooltip class="item" effect="dark" content="保存并发布" placement="bottom">
<el-button type="primary" size="small" @click="deploy"><i class="fa fa-save"> 保存并发布</i></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="保存草稿" placement="bottom">
<el-button type="primary" size="small" @click="save"><i class="fa fa-save"> 保存草稿</i></el-button>
<el-button type="primary" size="small" @click="save"><i class="fa fa-save"> 保存</i></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="打开流程文件" placement="bottom">
<el-button type="primary" size="small" @click="importXml"><i class="fa fa-folder-open"></i></el-button>
@ -32,10 +29,13 @@
<el-tooltip class="item" effect="dark" content="缩小" placement="bottom">
<el-button size="small" @click="zoom(-0.05)"><i class="fa fa-search-minus"></i></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="重置" placement="bottom">
<el-tooltip class="item" effect="dark" content="重置大小" placement="bottom">
<el-button size="small" @click="zoom(0)"><i class="fa fa-arrows"></i></el-button>
</el-tooltip>
</el-button-group>
<div class="closeClass" @click="beforeClose()"><i class="el-icon-close"></i></div>
</div>
</template>
@ -74,15 +74,15 @@
}
_svg = svg;
})
that.post(this.Apis.deployProcess, {
processKey: "s1111",
processName: "阿达达",
resourceName: "test01",
xml: _xml,
svg: _svg
}, function (data) {
console.log(data)
});
// that.post(this.Apis.deployProcess, {
// processKey: "s1111",
// processName: "阿达达",
// resourceName: "test01",
// xml: _xml,
// svg: _svg
// }, function (data) {
// console.log(data)
// });
},
save(){
let that = this;
@ -129,11 +129,24 @@
let newScale = !val ? 1.0 : ((this.scale + val) <= 0.2) ? 0.2 : (this.scale + val);
this.modeler.get('canvas').zoom(newScale);
this.scale = newScale;
},
beforeClose(val) {
this.$emit("beforeClose");
}
}
}
</script>
<style scoped>
.closeClass{
float: right;
width: 50px;
height: 50px;
font-size: 20px;
}
.closeClass:hover{
cursor:pointer;
}
</style>

View File

@ -4,7 +4,7 @@
<el-row>
<el-col :span="24">
<vue-header class="bpmn-viewer-header" :processData="initData" :modeler="bpmnModeler" @restart="restart" @importXml="importXml"
@handleExportSvg="handleExportSvg" @handleExportBpmn="handleExportBpmn" @processSave="processSave"></vue-header>
@handleExportSvg="handleExportSvg" @handleExportBpmn="handleExportBpmn" @processSave="processSave" @beforeClose="beforeClose"></vue-header>
</el-col>
</el-row>
<el-row style="margin-left: 1%">
@ -61,6 +61,7 @@
},
props: {
product: String,
bpmnData: Object,
bpmnXml: {
type: String,
required: false
@ -80,8 +81,13 @@
mounted() {
let processId = new Date().getTime();
this.initTemplate = templateXml.initTemplate(processId)
this.initData = {key: "process" + processId, name: "流程" + processId, xml: this.initTemplate}
if (this.bpmnXml != null) {
this.initData = {
key: this.bpmnData.key ? this.bpmnData.key : "process" + processId,
name: this.bpmnData.name ? this.bpmnData.name : "流程" + processId,
description: this.bpmnData.metaInfo ? JSON.parse(this.bpmnData.metaInfo).description : "" ,
xml: this.initTemplate}
if (this.bpmnXml != null && this.bpmnXml !== "") {
this.initTemplate = this.bpmnXml
}
this.init();
@ -205,14 +211,21 @@
},
processSave(data){
let initData = this.initData;
data.procId = initData.key;
data.name = initData.name;
this.$emit("processSave",data);
const dataXml = this.bpmnData
dataXml.bpmnXml = this.xmlShow;
dataXml.name = initData.name;
dataXml.key = initData.key;
dataXml.description = initData.description;
this.$emit("processSave",dataXml);
},
restart() {
let processId = new Date().getTime();
this.initTemplate = templateXml.initTemplate(processId)
this.initData = {key: "process" + processId, name: "流程" + processId, xml: this.initTemplate}
this.initData = {
key: this.bpmnData.key ? this.bpmnData.key : "process" + processId,
name: this.bpmnData.name ? this.bpmnData.name : "流程" + processId,
description: this.bpmnData.metaInfo ? JSON.parse(this.bpmnData.metaInfo).description : "" ,
xml: this.initTemplate}
this.initDiagram(this.initTemplate)
},
importXml() {
@ -244,6 +257,9 @@
}
}
return moddleExtensions;
},
beforeClose() {
this.$emit("beforeClose");
}
}
}