|
@@ -121,7 +121,9 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="mt20">
|
|
<div class="mt20">
|
|
|
- <el-button type="primary" class="font_size16 gradient" @click="submitForm" size="large">
|
|
|
|
|
|
|
+ <el-button type="primary" class="font_size16 gradient"
|
|
|
|
|
+ :loading="isSubmiting"
|
|
|
|
|
+ @click="submitForm" size="large">
|
|
|
<el-icon><Promotion /></el-icon>
|
|
<el-icon><Promotion /></el-icon>
|
|
|
<span class="ml10">{{$t('common.fabuxuqiu')}}</span>
|
|
<span class="ml10">{{$t('common.fabuxuqiu')}}</span>
|
|
|
</el-button>
|
|
</el-button>
|
|
@@ -189,7 +191,8 @@ console.log(router,route)
|
|
|
import { ref, computed, reactive, onMounted, watchEffect } from 'vue'
|
|
import { ref, computed, reactive, onMounted, watchEffect } from 'vue'
|
|
|
import { useAppStore } from '@/pinia/appStore'
|
|
import { useAppStore } from '@/pinia/appStore'
|
|
|
const appStore = useAppStore()
|
|
const appStore = useAppStore()
|
|
|
-
|
|
|
|
|
|
|
+// 防止重复提交的加载状态
|
|
|
|
|
+const isSubmiting = ref(false)
|
|
|
//获取参数
|
|
//获取参数
|
|
|
const query = route.query;
|
|
const query = route.query;
|
|
|
// 分类列表树
|
|
// 分类列表树
|
|
@@ -263,7 +266,7 @@ onMounted(() => {
|
|
|
|
|
|
|
|
// 提交表单
|
|
// 提交表单
|
|
|
const submitForm = async () => {
|
|
const submitForm = async () => {
|
|
|
- await ruleFormRef.value.validate((valid, fields,name) => {
|
|
|
|
|
|
|
+ await ruleFormRef.value.validate(async(valid, fields,name) => {
|
|
|
console.log(valid, fields,name)
|
|
console.log(valid, fields,name)
|
|
|
if (!valid) {
|
|
if (!valid) {
|
|
|
//报错第一个key
|
|
//报错第一个key
|
|
@@ -271,14 +274,22 @@ const submitForm = async () => {
|
|
|
DGTMessage.warning(fields[firstKey][0].message)
|
|
DGTMessage.warning(fields[firstKey][0].message)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+ // 设置加载状态为true,禁用按钮
|
|
|
|
|
+ isSubmiting.value = true
|
|
|
// 新增需求工作流
|
|
// 新增需求工作流
|
|
|
- questAdd(ruleForm).then(res => {
|
|
|
|
|
|
|
+ await questAdd(ruleForm).then(res => {
|
|
|
console.log(res)
|
|
console.log(res)
|
|
|
if(res.code === 200){
|
|
if(res.code === 200){
|
|
|
DGTMessage.success(t('workflowTrade.publishSuccess'))
|
|
DGTMessage.success(t('workflowTrade.publishSuccess'))
|
|
|
goBack();
|
|
goBack();
|
|
|
}
|
|
}
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ // 提交完成后,将加载状态设置为false,启用按钮
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ isSubmiting.value = false
|
|
|
|
|
+ }, 1000)
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
})
|
|
})
|
|
|
};
|
|
};
|
|
|
const goBack = () => {
|
|
const goBack = () => {
|