hookehuyr

调整保存按钮位置

...@@ -297,18 +297,21 @@ ...@@ -297,18 +297,21 @@
297 <span style="font-size: 12px; transform: scale(0.8); margin-top: 2px;">复制</span> 297 <span style="font-size: 12px; transform: scale(0.8); margin-top: 2px;">复制</span>
298 </div> 298 </div>
299 </el-tooltip> 299 </el-tooltip>
300 - <el-tooltip content="保存流程图数据"> 300 + <!-- <el-tooltip content="保存流程图数据">
301 <div class="vue-flow-editor-toolbar-item" @click="saveData"> 301 <div class="vue-flow-editor-toolbar-item" @click="saveData">
302 <i class="el-icon-coin" style=" margin-top: 4px;" /> 302 <i class="el-icon-coin" style=" margin-top: 4px;" />
303 <span style="font-size: 12px; transform: scale(0.8); margin-top: 2px;">保存流程</span> 303 <span style="font-size: 12px; transform: scale(0.8); margin-top: 2px;">保存流程</span>
304 </div> 304 </div>
305 - </el-tooltip> 305 + </el-tooltip> -->
306 <!-- <el-tooltip content="启用流程图数据"> 306 <!-- <el-tooltip content="启用流程图数据">
307 <div class="vue-flow-editor-toolbar-item" @click="startFlow"> 307 <div class="vue-flow-editor-toolbar-item" @click="startFlow">
308 <i class="el-icon-check" style=" margin-top: 4px;" /> 308 <i class="el-icon-check" style=" margin-top: 4px;" />
309 <span style="font-size: 12px; transform: scale(0.8); margin-top: 2px;">启用</span> 309 <span style="font-size: 12px; transform: scale(0.8); margin-top: 2px;">启用</span>
310 </div> 310 </div>
311 </el-tooltip> --> 311 </el-tooltip> -->
312 + <div style="position: absolute; top: 15px; right: 160px; width: 80px;">
313 + <div @click="saveData" style="border: 1px solid #009688; width: 100%; height: 25px; border-radius: 5px; color: #009688; text-align: center; line-height: 25px; cursor: pointer;">保存</div>
314 + </div>
312 <div class="select-version-wrapper"> 315 <div class="select-version-wrapper">
313 <el-dropdown trigger="click"> 316 <el-dropdown trigger="click">
314 <div class="select-version-show"> 317 <div class="select-version-show">
...@@ -411,12 +414,12 @@ ...@@ -411,12 +414,12 @@
411 </el-dialog> 414 </el-dialog>
412 </template> 415 </template>
413 <!-- 表单底部按钮 --> 416 <!-- 表单底部按钮 -->
414 - <template v-slot:foot> 417 + <!-- <template v-slot:foot>
415 <div v-if="state.main_attr_set" style="width: 100%; text-align: center;"> 418 <div v-if="state.main_attr_set" style="width: 100%; text-align: center;">
416 <el-button type="primary" color="#009688" @click="saveForm" style="width: 40%;">保存</el-button> 419 <el-button type="primary" color="#009688" @click="saveForm" style="width: 40%;">保存</el-button>
417 <el-button @click="cancel" style="width: 40%;">关闭</el-button> 420 <el-button @click="cancel" style="width: 40%;">关闭</el-button>
418 </div> 421 </div>
419 - </template> 422 + </template> -->
420 </vue-flow-editor> 423 </vue-flow-editor>
421 <div v-if="state.reloadLoading" style="position: absolute; top: 0; right: 0; left: 0; bottom: 0; background-color: rgba(255, 255, 255, 0.5);width: 100%; height: 100%; z-index: 2006;"> 424 <div v-if="state.reloadLoading" style="position: absolute; top: 0; right: 0; left: 0; bottom: 0; background-color: rgba(255, 255, 255, 0.5);width: 100%; height: 100%; z-index: 2006;">
422 <div class="el-loading-spinner"> 425 <div class="el-loading-spinner">
...@@ -1573,9 +1576,6 @@ export default { ...@@ -1573,9 +1576,6 @@ export default {
1573 } 1576 }
1574 }) 1577 })
1575 }); 1578 });
1576 - console.warn(state.node_attr);
1577 - console.warn({name: state.node_name, user: state.userTags, field: state.field_extend, property: state.more_attr});
1578 -
1579 1579
1580 return _.isEqual(state.node_attr, {name: state.node_name, user: state.userTags, field: state.field_extend, property: state.more_attr}) 1580 return _.isEqual(state.node_attr, {name: state.node_name, user: state.userTags, field: state.field_extend, property: state.more_attr})
1581 } 1581 }
...@@ -1609,7 +1609,26 @@ export default { ...@@ -1609,7 +1609,26 @@ export default {
1609 * 1609 *
1610 * @return {void} No return value. 1610 * @return {void} No return value.
1611 */ 1611 */
1612 - function saveData(type): void { 1612 + function saveData(): void {
1613 + // 如果表单打开状态,走表单保存逻辑
1614 + if (state.detailModel) {
1615 + ElMessageBox.confirm(
1616 + '是否确定保存流程图?',
1617 + '温馨提示',
1618 + {
1619 + confirmButtonText: '确认',
1620 + cancelButtonText: '取消',
1621 + type: 'warning',
1622 + }
1623 + )
1624 + .then(async () => {
1625 + saveForm();
1626 + })
1627 + .catch(() => {
1628 + });
1629 + return;
1630 + }
1631 +
1613 let { nodes, edges } = editor.editorState.graph.save(); 1632 let { nodes, edges } = editor.editorState.graph.save();
1614 1633
1615 // 使用时需要把自定义节点的类型带过去 activity/control 1634 // 使用时需要把自定义节点的类型带过去 activity/control
......