刘向辉 3 years ago
parent
commit
97bb4351f7
  1. 5
      src/app/babylon/controller/serve-manager.ts
  2. 3
      src/app/babylon/model/data/mark/mark-template-data.ts
  3. 6
      src/app/babylon/view/mark-window/mark-window.ts

5
src/app/babylon/controller/serve-manager.ts

@ -170,10 +170,13 @@ export class ServeManager {
.subscribe(data => {
console.log("得到所有模板", data);
if (onSuccess) {
// onSuccess( JSON.parse((data as any).result));
onSuccess(JSON.parse((data as any).items));
}
}, error => {
console.error("From serve:AllMarkTemplate", error);
if (onSuccess) {
onSuccess(null);
}
})
}

3
src/app/babylon/model/data/mark/mark-template-data.ts

@ -1,3 +1,4 @@
import { Type } from "class-transformer";
import { MarkPlanData } from "./mark-plan-data";
/**
@ -6,4 +7,6 @@ import { MarkPlanData } from "./mark-plan-data";
export class MarkTemplate {
id: number;
name: string;
@Type(() => MarkPlanData)
value: MarkPlanData;
}

6
src/app/babylon/view/mark-window/mark-window.ts

@ -179,6 +179,7 @@ export class MarkWindow extends UIBase {
onShow() {
super.onShow();
let instance = this;
instance.getAllSandBoxTemplate();//获取模板
if (this.allMarkPlanData == null) {
DataManager.initMarkData((data: AllMarkPlanData) => {
instance.onGetAllMarkPlanData(data);
@ -1597,7 +1598,12 @@ export class MarkWindow extends UIBase {
let instance = this;
this.allSandBoxTemplate = [];
ServeManager.instance.getAllMarkTemplate((data: string) => {
if (data == null) {
instance.allSandBoxTemplate = [];
}
else {
}
});
}

Loading…
Cancel
Save