fix: remove duplicate permissionMap declaration and eliminate infinite polling interval in stocktake page
This commit is contained in:
@ -473,9 +473,6 @@ const inputQty = ref<number | undefined>(undefined)
|
||||
const inputRemark = ref('')
|
||||
const qtyInputRef = ref()
|
||||
|
||||
// ★ 新增: 多人协同心跳刷新定时器
|
||||
let syncTimer: any = null
|
||||
|
||||
// ★ 新增: 静默刷新数据(不弹loading)
|
||||
const syncData = async () => {
|
||||
try {
|
||||
@ -592,19 +589,8 @@ async function fetchBorrowedQuantities(items: StockItem[]): Promise<void> {
|
||||
|
||||
onMounted(async () => {
|
||||
await checkServerDraft()
|
||||
// ★ 启动多人协同心跳轮询(每5秒静默刷新)
|
||||
syncTimer = setInterval(() => {
|
||||
syncData()
|
||||
}, 5000)
|
||||
})
|
||||
|
||||
// ★ 新增: 组件卸载时清除定时器
|
||||
onUnmounted(() => {
|
||||
if (syncTimer) {
|
||||
clearInterval(syncTimer)
|
||||
syncTimer = null
|
||||
}
|
||||
})
|
||||
|
||||
const checkServerDraft = async () => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user