fix tablet layout
This commit is contained in:
@@ -281,6 +281,9 @@ function exit(saved = false): void {
|
||||
}
|
||||
|
||||
const routeNavBarTitle = computed(() => {
|
||||
if (pane && !routeId.value) {
|
||||
return "新增产品";
|
||||
}
|
||||
switch (route.name) {
|
||||
case "ProductCreate":
|
||||
return "新增产品";
|
||||
|
||||
@@ -115,8 +115,9 @@
|
||||
</t-pull-down-refresh>
|
||||
</template>
|
||||
<template #detail>
|
||||
<product-edit v-if="selectedId === createPaneId" :key="createPaneId" />
|
||||
<product-edit
|
||||
v-if="editing"
|
||||
v-else-if="editing"
|
||||
:key="`edit-${selectedId}`"
|
||||
:product-id="selectedId"
|
||||
/>
|
||||
@@ -154,10 +155,11 @@ const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
// 选中项、编辑态、切换方向、关闭逻辑、转屏、query 同步都在这里
|
||||
const createPaneId = "__create__";
|
||||
const { selectedId, editing, detailVersion, paneDirection, isWide, openDetail, openEdit } =
|
||||
useMasterDetailPane({
|
||||
path: "/management/products",
|
||||
detail: id => `/management/products/${id}`,
|
||||
detail: id => id === createPaneId ? "/management/products/create" : `/management/products/${id}`,
|
||||
edit: id => `/management/products/${id}/edit`
|
||||
});
|
||||
const productListRef = ref<ComponentPublicInstance | null>(null);
|
||||
@@ -413,6 +415,10 @@ function updateCategory(value: DropdownValue): void {
|
||||
}
|
||||
|
||||
async function toCreate(): Promise<void> {
|
||||
if (isWide.value && userStore.hasPermissions(permissionCodes.product.read)) {
|
||||
openDetail(createPaneId);
|
||||
return;
|
||||
}
|
||||
await router.push("/management/products/create");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user