fix(product): better layout on tablet
This commit is contained in:
@@ -191,8 +191,11 @@ defineOptions({
|
||||
const props = withDefaults(defineProps<{
|
||||
/** 指定积分规则 ID 时忽略路由参数,用于平板主从分栏的内联渲染。 */
|
||||
ruleId?: string;
|
||||
/** 在分栏中新增积分规则。 */
|
||||
create?: boolean;
|
||||
}>(), {
|
||||
ruleId: ""
|
||||
ruleId: "",
|
||||
create: false
|
||||
});
|
||||
|
||||
const route = useRoute();
|
||||
@@ -200,6 +203,9 @@ const currentId = computed(() => props.ruleId || String(route.params.id || ""));
|
||||
|
||||
const routeNavBarTitle = computed(() => {
|
||||
// 内联时路由停在列表页,标题不能只看 route.name
|
||||
if (props.create) {
|
||||
return "新增积分规则";
|
||||
}
|
||||
if (props.ruleId) {
|
||||
return "编辑积分规则";
|
||||
}
|
||||
@@ -215,11 +221,10 @@ const routeNavBarTitle = computed(() => {
|
||||
const router = useRouter();
|
||||
|
||||
// 竖屏整页编辑转横屏:回到分栏,并用 view=edit 让列表页把右栏还原成编辑。
|
||||
// 新增(Create)返回空 id,不触发——右栏没有可依附的选中项
|
||||
useExpandToMaster({
|
||||
path: "/management/points/rules",
|
||||
id: () => (route.name === "PointRuleCreate" ? "" : currentId.value),
|
||||
query: { view: "edit" }
|
||||
id: () => (route.name === "PointRuleCreate" ? "__create__" : currentId.value),
|
||||
query: route.name === "PointRuleCreate" ? {} : { view: "edit" }
|
||||
});
|
||||
/** 非空说明当前被内联在主从分栏的右栏里 */
|
||||
const pane = usePane();
|
||||
|
||||
Reference in New Issue
Block a user