新增节流

This commit is contained in:
wpf 2023-09-04 23:14:33 +08:00
parent f8855e3ee0
commit 464dc06d4f
2 changed files with 7 additions and 7 deletions

View File

@ -2,14 +2,14 @@ let httpApiThree;
let httpApi; let httpApi;
// 正式使用的域名 // 正式使用的域名
httpApi = 'https://ceshi-worker-task.lihaink.cn' //测试 // httpApi = 'https://ceshi-worker-task.lihaink.cn' //测试
// httpApi = 'https://preview-worker-task.lihaink.cn' //预上线 // httpApi = 'https://preview-worker-task.lihaink.cn' //预上线
// httpApi = 'https://worker-task.lihaink.cn' //正式 httpApi = 'https://worker-task.lihaink.cn' //正式
httpApiThree = 'https://ceshi-worker-task.lihaink.cn' //测试 // httpApiThree = 'https://ceshi-worker-task.lihaink.cn' //测试
// httpApiThree = 'https://preview-worker-task.lihaink.cn' //预上线 // httpApiThree = 'https://preview-worker-task.lihaink.cn' //预上线
// httpApiThree = 'https://worker-task.lihaink.cn' //正式 httpApiThree = 'https://worker-task.lihaink.cn' //正式
// #ifdef H5 // #ifdef H5
// httpApiThree = 'baseUrlTest' //生产 // httpApiThree = 'baseUrlTest' //生产
// #endif // #endif

View File

@ -55,7 +55,7 @@
keyName="name" @change="changeHandler" @cancel="demandShow = false" @confirm="changeDemand"></u-picker> keyName="name" @change="changeHandler" @cancel="demandShow = false" @confirm="changeDemand"></u-picker>
</u--form> </u--form>
<!-- <button @click="addArchives" class="btn">完成更新</button> --> <!-- <button @click="addArchives" class="btn">完成更新</button> -->
<mybtn text="完成更新" @click="addArchives"></mybtn> <mybtn text="完成更新" @click="$u.throttle(addArchives, 2000)"></mybtn>
</view> </view>
</view> </view>
</template> </template>
@ -145,7 +145,7 @@
this.formData = res.data; this.formData = res.data;
}, },
// //
addArchives: throttle(async function() { async addArchives() {
if (this.showDemandList.length == 0) return Toast('请先添加需求!'); if (this.showDemandList.length == 0) return Toast('请先添加需求!');
let refsDatas = await this.loadRefsDatas(); let refsDatas = await this.loadRefsDatas();
if (!this.updateFlag) return; if (!this.updateFlag) return;
@ -170,7 +170,7 @@
}, 1000) }, 1000)
} }
}) })
}, 1000), },
// //
async loadRefsDatas() { async loadRefsDatas() {
this.updateFlag = true; this.updateFlag = true;