chore(package): detail slot for add package config on tablet
This commit is contained in:
@@ -169,11 +169,16 @@ const props = withDefaults(defineProps<{
|
||||
configId: ""
|
||||
});
|
||||
|
||||
const emit = defineEmits<{ saved: [] }>();
|
||||
|
||||
const route = useRoute();
|
||||
/** 内联渲染时 id 来自 prop,整页渲染时来自路由参数 */
|
||||
const currentId = computed(() => props.configId || String(route.params.id || ""));
|
||||
|
||||
const routeNavBarTitle = computed(() => {
|
||||
if (pane && !currentId.value) {
|
||||
return "新增套餐配置";
|
||||
}
|
||||
// 内联时路由停在列表页,标题只能看当前是新增还是编辑
|
||||
if (props.configId) {
|
||||
return "编辑套餐配置";
|
||||
@@ -452,6 +457,7 @@ async function save(): Promise<void> {
|
||||
const id = await PackageAPI.configCreate(payload);
|
||||
Message.success("套餐配置已创建");
|
||||
if (pane) {
|
||||
emit("saved");
|
||||
pane.close(true);
|
||||
return;
|
||||
}
|
||||
@@ -461,6 +467,7 @@ async function save(): Promise<void> {
|
||||
await PackageAPI.configUpdate(payload);
|
||||
Message.success("套餐配置已保存");
|
||||
if (pane) {
|
||||
emit("saved");
|
||||
pane.close(true);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user