|
@@ -89,7 +89,7 @@ export class ScreenCtrl extends ModuleControl<EditorModule> {
|
|
|
|
|
|
applyScreen() {
|
|
applyScreen() {
|
|
const option = this.getRightScreenId();
|
|
const option = this.getRightScreenId();
|
|
- if ( this.store.designData.compScreenMap?.[option.sreenId] ) {
|
|
|
|
|
|
+ if ( this.isScreenExit(option.sreenId) ) {
|
|
this.restorScreenPage(option.sreenId);
|
|
this.restorScreenPage(option.sreenId);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -97,7 +97,7 @@ export class ScreenCtrl extends ModuleControl<EditorModule> {
|
|
let n= AllSize.length;
|
|
let n= AllSize.length;
|
|
while(n--) {
|
|
while(n--) {
|
|
const screenId = option.device + option.pageMode + AllSize[n];
|
|
const screenId = option.device + option.pageMode + AllSize[n];
|
|
- if ( this.store.designData.compScreenMap?.[screenId] ) {
|
|
|
|
|
|
+ if ( this.isScreenExit(screenId) ) {
|
|
this.restorScreenPage(screenId);
|
|
this.restorScreenPage(screenId);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -111,7 +111,7 @@ export class ScreenCtrl extends ModuleControl<EditorModule> {
|
|
let n= AllSize.length;
|
|
let n= AllSize.length;
|
|
while(n--) {
|
|
while(n--) {
|
|
const screenId = option.device + "short" + AllSize[n];
|
|
const screenId = option.device + "short" + AllSize[n];
|
|
- if ( this.store.designData.compScreenMap?.[screenId] ) {
|
|
|
|
|
|
+ if ( this.isScreenExit(screenId) ) {
|
|
this.restorScreenPage(screenId);
|
|
this.restorScreenPage(screenId);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -160,6 +160,11 @@ export class ScreenCtrl extends ModuleControl<EditorModule> {
|
|
|
|
|
|
this.state.safeFactor = this.state.screen.useFor == "pc" ? PCConst.factor : MobileConst.factor;
|
|
this.state.safeFactor = this.state.screen.useFor == "pc" ? PCConst.factor : MobileConst.factor;
|
|
}
|
|
}
|
|
|
|
+ isScreenExit(screenId:string) {
|
|
|
|
+ return !!this.store.designData.compScreenMap[screenId] &&
|
|
|
|
+ this.store.designData.compScreenMap[screenId].length > 0 &&
|
|
|
|
+ this.store.designData.compScreenMap[screenId][1].children.length > 0;
|
|
|
|
+ }
|
|
|
|
|
|
restorScreenPage(screenId = "") {
|
|
restorScreenPage(screenId = "") {
|
|
if (!this.store.rootPage) return;
|
|
if (!this.store.rootPage) return;
|
|
@@ -168,7 +173,7 @@ export class ScreenCtrl extends ModuleControl<EditorModule> {
|
|
//获取当前screen的配置
|
|
//获取当前screen的配置
|
|
screenId = screenId ? screenId : this.state.screen.useFor + this.state.screen.pageMode + this.state.screen.pageSizeType;
|
|
screenId = screenId ? screenId : this.state.screen.useFor + this.state.screen.pageMode + this.state.screen.pageSizeType;
|
|
const screenCards = this.store.designData.compScreenMap[screenId] || [];
|
|
const screenCards = this.store.designData.compScreenMap[screenId] || [];
|
|
-
|
|
|
|
|
|
+
|
|
console.log("apply screen=>", screenId);
|
|
console.log("apply screen=>", screenId);
|
|
|
|
|
|
//刷新当前card的配置
|
|
//刷新当前card的配置
|