Skip to content

Commit

Permalink
添加热搜时,防止多次操作的意外
Browse files Browse the repository at this point in the history
  • Loading branch information
Natsukawa authored and Natsukawa committed Jun 13, 2022
1 parent 707484e commit ca7425c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<el-button @click="visible = false">
{{ $t('table.cancel') }}
</el-button>
<el-button type="primary" @click="dataFormSubmit()">
<el-button type="primary" :disabled="!isCanSubmit" @click="dataFormSubmit()">
{{ $t('table.confirm') }}
</el-button>
</div>
Expand All @@ -42,6 +42,7 @@ import * as api from '@/api/platform/hot-search'
export default {
data() {
return {
isCanSubmit: true,
visible: false,
dataForm: {
hotSearchId: 0,
Expand All @@ -63,6 +64,7 @@ export default {
methods: {
init(hotSearchId) {
this.dataForm.hotSearchId = hotSearchId || 0
this.isCanSubmit = true
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
Expand All @@ -80,6 +82,7 @@ export default {
if (!valid) {
return
}
this.isCanSubmit = false
const request = this.dataForm.hotSearchId ? api.update(this.dataForm) : api.save(this.dataForm)
request.then(data => {
this.$message({
Expand Down

0 comments on commit ca7425c

Please sign in to comment.