|
@ -10,7 +10,6 @@ export default { |
|
|
setup() { |
|
|
setup() { |
|
|
const config = ref(null); |
|
|
const config = ref(null); |
|
|
const route = useRoute(); |
|
|
const route = useRoute(); |
|
|
const messageCount = ref(-1); |
|
|
|
|
|
const onCommand = async (item, rows) => { |
|
|
const onCommand = async (item, rows) => { |
|
|
console.log(item.path, item, rows); |
|
|
console.log(item.path, item, rows); |
|
|
}; |
|
|
}; |
|
@ -19,16 +18,18 @@ export default { |
|
|
const model = "vmi/balance"; |
|
|
const model = "vmi/balance"; |
|
|
const useConfig = (await import(`../../models/${model}.js`)).default; |
|
|
const useConfig = (await import(`../../models/${model}.js`)).default; |
|
|
config.value = useConfig(route.meta?.businessType, route.meta); |
|
|
config.value = useConfig(route.meta?.businessType, route.meta); |
|
|
|
|
|
let notify = null; |
|
|
PubSub.subscribe(event, async (_, data) => { |
|
|
PubSub.subscribe(event, async (_, data) => { |
|
|
messageCount.value = parseInt(data); |
|
|
notify?.close(); |
|
|
}); |
|
|
notify = ElNotification({ |
|
|
ElNotification({ |
|
|
position: "bottom-right", |
|
|
title: "Prompt", |
|
|
title: "待同步库存数量", |
|
|
message: messageCount.value, |
|
|
message: data, |
|
|
duration: 0, |
|
|
duration: 0, |
|
|
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
onUnmounted(() => PubSub.unsubscribe(event)); |
|
|
onUnmounted(() => PubSub.unsubscribe(event)); |
|
|
return { config, onCommand, messageCount }; |
|
|
return { config, onCommand }; |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|