修改技术监督按钮重复点击问题

This commit is contained in:
GGJ
2024-10-17 13:29:51 +08:00
parent e470554b7c
commit 96ea25d0a6
6 changed files with 57 additions and 58 deletions

View File

@@ -36,7 +36,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" v-loading="loading">确认</el-button>
</span>
</template>
</el-dialog>
@@ -51,6 +51,7 @@ const emit = defineEmits(['getTree'])
const dialogVisible = ref(false)
const title = ref('')
const formRef = ref()
const loading = ref(false)
const dataTree = ref([])
const TreeList: any = ref({})
const List = ref({})
@@ -110,7 +111,8 @@ const open = (row: any) => {
// row.row
}
}
const submit = () => {
const submit = async () => {
loading.value = true
formRef.value.validate(async (valid: boolean) => {
if (valid) {
if (title.value == '新增算法') {
@@ -121,7 +123,7 @@ const submit = () => {
forms.name = form.name
forms.pid = form.pid
}
addAlgorithm(forms).then(res => {
await addAlgorithm(forms).then(res => {
ElMessage.success('新增成功')
dialogVisible.value = false
emit('getTree')
@@ -135,7 +137,7 @@ const submit = () => {
forms.id = form.id
}
forms.pid = null
updateAlgorithmLibrary(forms).then(res => {
await updateAlgorithmLibrary(forms).then(res => {
ElMessage.success('修改成功')
dialogVisible.value = false
emit('getTree')
@@ -143,6 +145,9 @@ const submit = () => {
}
}
})
await setTimeout(() => {
loading.value=false
},0)
}
const getTheTree = () => {
queryAllAlgorithmLibrary().then(res => {