连点限制

This commit is contained in:
zhaoxiao
2021-10-12 10:12:26 +08:00
parent e9f9ca6cab
commit 93e7e8a4f0
25 changed files with 237 additions and 141 deletions
@@ -59,11 +59,6 @@
</a-table>
</div>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -197,6 +192,10 @@ export default {
this.$forceUpdate()
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
this.form.validateFields((err, values) => {
if (!err) {
let formData = []
@@ -221,7 +220,13 @@ export default {
} else {
this.$message.warn(res.message)
}
}).finally(() => {
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -94,11 +94,6 @@
</a-table>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -341,6 +336,10 @@ export default {
})
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
this.form.validateFields((err, values) => {
if (!err) {
let bmpList = []
@@ -367,7 +366,13 @@ export default {
} else {
this.$message.warn(res.message)
}
}).finally(() => {
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -93,11 +93,6 @@
</a-row>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -205,6 +200,10 @@ export default {
this.visible = false
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
const that = this
// 触发表单验证
this.form.validateFields((err, values) => {
@@ -228,8 +227,12 @@ export default {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
} else {
this.confirmLoading = false
}
})
},
@@ -71,11 +71,6 @@
</a-table>
</div>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
@@ -197,8 +192,13 @@ export default {
},
methods: {
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
if (this.selectedRowKeys.length === 0) {
this.$message.warn('请至少选择一个项目')
this.confirmLoading = false
return
}
let projectIds = this.selectedRowKeys.join(',')
@@ -214,6 +214,10 @@ export default {
} else {
this.$message.warn(res.message)
}
}).finally(() => {
setTimeout(() => {
this.confirmLoading = false
}, 1000)
})
},
handleCancel() {