|
@@ -6,13 +6,23 @@ export class MaterialController {
|
|
|
imageCtrl = new PageListController<any, any>();
|
|
|
vidoeCtrl = new PageListController<any, any>();
|
|
|
taskCtrl = new PageListController<any, any>();
|
|
|
+ tplCtrl = new PageListController<any, any>();
|
|
|
|
|
|
+ async showDialog(type:string) {
|
|
|
+ const ctrl = this.tplCtrl;
|
|
|
+ ctrl.state.query = type == "video" ? { hasVideo: true } : {}
|
|
|
+ ctrl.loadPage(1);
|
|
|
+ const record:any = await this.onShowDialog(ctrl, type);
|
|
|
+ if (record && record._id) {
|
|
|
+ const url = `${location.origin}/index.html#/create/${record._id}`;
|
|
|
+ location.href = url;
|
|
|
+ }
|
|
|
+ }
|
|
|
switchTab(name: string, fresh = true) {
|
|
|
this.state.currTab = name;
|
|
|
const ctrol = this.getCurrControl();
|
|
|
if(fresh) ctrol.fresh();
|
|
|
}
|
|
|
-
|
|
|
getCurrControl() : PageListController<any, any> {
|
|
|
switch (this.state.currTab) {
|
|
|
case "image": return this.imageCtrl;
|
|
@@ -21,12 +31,16 @@ export class MaterialController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
onBtnClick(name:string) {
|
|
|
console.log("onBtnClick", name)
|
|
|
}
|
|
|
onItemClick(name: "delete" | "download", record:any) {
|
|
|
console.log("onItemClick", name, record)
|
|
|
}
|
|
|
+ async onShowDialog(listCtrl: PageListController<any, any>, type:string) {
|
|
|
+ console.log("onShowDialog", type)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
export const TabNames = {
|