fix 站点更新后刷新站点列表

This commit is contained in:
thsrite
2023-08-16 18:48:03 +08:00
parent f1244fb25e
commit d6a6ff662b
2 changed files with 6 additions and 4 deletions
+5 -4
View File
@@ -15,7 +15,7 @@ const cardProps = defineProps({
}) })
// 定义触发的自定义事件 // 定义触发的自定义事件
const emit = defineEmits(['remove']) const emit = defineEmits(['remove', 'update'])
// 密码输入 // 密码输入
const isPasswordVisible = ref(false) const isPasswordVisible = ref(false)
@@ -204,10 +204,11 @@ async function updateSiteInfo() {
siteInfoDialog.value = false siteInfoDialog.value = false
const result: { [key: string]: any } = await api.put('site', siteForm) const result: { [key: string]: any } = await api.put('site', siteForm)
if (result.success) if (result.success) {
$toast.success(`${cardProps.site?.name} 更新成功!`) $toast.success(`${cardProps.site?.name} 更新成功!`)
else emit('update')
$toast.error(`${cardProps.site?.name} 更新失败:${result.message}`) }
else { $toast.error(`${cardProps.site?.name} 更新失败:${result.message}`) }
} }
catch (error) { catch (error) {
$toast.error(`${cardProps.site?.name} 更新失败!`) $toast.error(`${cardProps.site?.name} 更新失败!`)
+1
View File
@@ -46,6 +46,7 @@ onBeforeMount(fetchData)
:key="data.id" :key="data.id"
:site="data" :site="data"
@remove="fetchData" @remove="fetchData"
@update="fetchData"
/> />
</div> </div>
<NoDataFound <NoDataFound