hookehuyr

fix

Showing 1 changed file with 46 additions and 36 deletions
......@@ -93,7 +93,7 @@
<span class="name">节点名称</span>
<span class="node-index"> 节点索引:{{ state.node_idx }} </span>
</div>
<el-input v-model="state.node_name" style="margin-top: 5px;" />
<el-input v-model="state.node_name" @input="handleNodeNameChange" style="margin-top: 5px;" />
</el-form-item>
<div v-if="state.user_attr_set" class="node-user">
<div class="name">节点负责人</div>
......@@ -1114,6 +1114,11 @@ export default {
}
/******************* END *******************/
const handleNodeNameChange = (val) => {
state.detailModel.text = val; // 更新节点名称显示
editor.updateModel(state.detailModel); // 更新流程图信息
}
/***************** 用户选择控件弹框 ****************/
/**
......@@ -1373,25 +1378,26 @@ export default {
*
*/
function cancel() {
if (!checkFormEdited()) {
ElMessageBox.confirm(
'您刚才修改过表单内容还未保存,是否离开?',
'温馨提示',
{
confirmButtonText: '离开',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
editor.closeModel()
})
.catch(() => {
})
} else {
// if (!checkFormEdited()) {
// ElMessageBox.confirm(
// '您刚才修改过表单内容还未保存,是否离开?',
// '温馨提示',
// {
// confirmButtonText: '离开',
// cancelButtonText: '取消',
// type: 'warning',
// }
// )
// .then(() => {
// editor.closeModel()
// })
// .catch(() => {
// })
// } else {
// editor.closeModel()
// }
editor.closeModel()
}
}
/**
* 打开更多属性细节回调
......@@ -1630,27 +1636,29 @@ export default {
}
function onClickCanvas(e: myEvent) {
if (!checkFormEdited() && state.detailModel) {
ElMessageBox.confirm(
'您刚才修改过表单内容还未保存,是否离开?',
'温馨提示',
{
confirmButtonText: '离开',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
state.detailModel = null;
editor.closeModel()
})
.catch(() => {
})
} else {
// if (!checkFormEdited() && state.detailModel) {
// ElMessageBox.confirm(
// '您刚才修改过表单内容还未保存,是否离开?',
// '温馨提示',
// {
// confirmButtonText: '离开',
// cancelButtonText: '取消',
// type: 'warning',
// }
// )
// .then(() => {
// state.detailModel = null;
// editor.closeModel()
// })
// .catch(() => {
// })
// } else {
// state.detailModel = null;
// editor.closeModel()
// }
state.detailModel = null;
editor.closeModel()
}
}
const checkFormEdited = () => { // 检查表单是否修改过内容
state.field_extend.forEach(ele => {
......@@ -1871,6 +1879,8 @@ export default {
onAuthAllEditChange,
onSearchAuthInput,
handleNodeNameChange,
openUserForm,
onCloseUserView,
onConfirmUserView,
......