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,
width: 200,
search: {
type: 'string',
type: 'number',
},
},
{

View File

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