|
@@ -43,6 +43,7 @@ import FormDesignTab from './components/FormDesign.vue'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import process from '@/api/flow/process'
|
|
|
import useStore from '@/store'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
const { tagsView } = useStore()
|
|
|
const router = useRouter()
|
|
|
const route = useRoute()
|
|
@@ -116,7 +117,7 @@ const submitHandler = async () => {
|
|
|
removeCurTab()
|
|
|
}
|
|
|
|
|
|
-// 切换选项卡
|
|
|
+// 切换选项卡之前,做相应的保存操作
|
|
|
const changeTab = () => {
|
|
|
if (activeName.value === '表单设计') {
|
|
|
dyncComponent.value.exportJsonEv()
|
|
@@ -127,6 +128,13 @@ const changeTab = () => {
|
|
|
|
|
|
const activeComponent = item => {
|
|
|
changeTab()
|
|
|
+ // 这里针对表单设计单独处理,如果不符合条件,则不允许切换
|
|
|
+ if (activeName.value === '表单设计') {
|
|
|
+ const leavePageFlag = dyncComponent.value.validateOnlyEv() // FormDesign.vue中的方法
|
|
|
+ if (leavePageFlag) {
|
|
|
+ return ElMessage.error(`请确认当前表单中的字段Id值是唯一的`)
|
|
|
+ }
|
|
|
+ }
|
|
|
activeName.value = item.label
|
|
|
}
|
|
|
|