import { PageListController } from "@queenjs/controllers"; import { reactive } from "vue"; export class MaterialController { state = reactive({currTab: "image", tabs:["image", "video", "task"], btns:["upload", "image","video"] , uploadType:"Default" as "image"|"video"|"Default"}); imageCtrl = new PageListController(); vidoeCtrl = new PageListController(); taskCtrl = new PageListController(); switchTab(name: string, fresh = true) { this.state.currTab = name; const ctrol = this.getCurrControl(); if(fresh) ctrol.fresh(); } getCurrControl() : PageListController { switch (this.state.currTab) { case "image": return this.imageCtrl; case "video": return this.vidoeCtrl; default: return this.taskCtrl; } } onBtnClick(name:string) { console.log("onBtnClick", name) } onItemClick(name: "delete" | "download", record:any) { console.log("onItemClick", name, record) } } export const TabNames = { "video":"视频", "image": "图片", "task": "渲染任务" } export const BtnNames = { "video":"生成视频", "image": "生成图片", "upload": "上传素材" }