fix: bug#10514

This commit is contained in:
xieyonghong 2023-03-25 11:00:10 +08:00
parent 532c82afe6
commit 620a3a4ae8
2 changed files with 28 additions and 14 deletions

View File

@ -237,7 +237,7 @@ const columns = [
scopedSlots: true, scopedSlots: true,
width: 200, width: 200,
search: { search: {
type: 'string', type: 'number',
}, },
}, },
{ {

View File

@ -246,21 +246,35 @@ const getDetail = () => {
} }
}; };
watch( // watch(
() => route.params?.id, // () => route.params?.id,
async (newId) => { // async (newId) => {
if (newId) { // if (newId) {
await instanceStore.refresh(String(newId)); // await instanceStore.refresh(String(newId));
getStatus(String(newId)); // getStatus(String(newId));
list.value = [...initList]; // list.value = [...initList];
getDetail(); // console.log('watch', route.params?.id)
instanceStore.tabActiveKey = 'Info'; // getDetail();
} // instanceStore.tabActiveKey = 'Info';
}, // }
{ immediate: true, deep: true }, // },
); // { immediate: true, deep: true },
// );
const getDetailFn = async () => {
const _id = route.params?.id
if (_id) {
await instanceStore.refresh(String(_id));
getStatus(String(_id));
list.value = [...initList];
console.log('watch', route.params?.id)
getDetail();
instanceStore.tabActiveKey = history.state?.params?.tab || 'Info';
}
}
onMounted(() => { onMounted(() => {
getDetailFn()
instanceStore.tabActiveKey = history.state?.params?.tab || 'Info'; instanceStore.tabActiveKey = history.state?.params?.tab || 'Info';
}); });