feat: 二创防止重复点击

This commit is contained in:
zhangyh
2025-11-25 14:05:46 +08:00
parent 0ef8b3060c
commit a81f65a5a7

View File

@@ -276,7 +276,6 @@ import { Modal,message } from "ant-design-vue";
import { useI18n } from 'vue-i18n';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import fullScreenImg from '@/component/HomePage/fullScreenImg.vue'
import { debounce } from 'lodash-es'
export default defineComponent({
components:{fullScreenImg},
@@ -438,25 +437,35 @@ export default defineComponent({
})
}
let setChoose = debounce(async()=>{
if(userDetail.value.systemList.indexOf(1) == -1){
return message.info(t('newScaleImage.jsContent1'))
}
let flag = true
let setChoose = async()=>{
if(!flag) return
flag = false
try {
if(userDetail.value.systemList.indexOf(1) == -1){
message.info(t('newScaleImage.jsContent1'))
return
}
const targetDate = new Date('2025-09-01T00:00:00');
// 解析输入日期字符串
const inputDate = new Date(imgData.scaleImageData.createDate);
if(inputDate < targetDate){
return message.info(t('newScaleImage.jsContent2'))
}
if(imgData.scaleImageData.openSource == 0){
return message.info(t('newScaleImage.jsContent2'))
}
let id = await getWorks(imgData.scaleImageData.id)
router.push(`/home/history/${id}`)
// router.push({name:'home',params: {id:imgData.scaleImageData.id,type:'Works'}})
store.commit('setChooseIsDesign',false)
},300)
const targetDate = new Date('2025-09-01T00:00:00');
// 解析输入日期字符串
const inputDate = new Date(imgData.scaleImageData.createDate);
if(inputDate < targetDate){
message.info(t('newScaleImage.jsContent2'))
return
}
if(imgData.scaleImageData.openSource == 0){
message.info(t('newScaleImage.jsContent2'))
return
}
let id = await getWorks(imgData.scaleImageData.id)
await router.push(`/home/history/${id}`)
store.commit('setChooseIsDesign',false)
} finally {
// 函数执行完成后恢复为 true确保无论成功还是失败都能再次点击
flag = true
}
}
let setCommentReply = (value:any,str:any)=>{
imgData.commentReply.leve1Id = value.id