qinyan 1 year ago
parent
commit
977827bd60

+ 5 - 5
src/modules/resource/actions/material.ts

@@ -19,12 +19,12 @@ export const materialActions = ResourceModule.action({
       from: "upload",
     };
     await this.https.createResource(souceObj);
-    this.store.setSourceType(souceObj.fileType);
+    // this.store.setSourceType(souceObj.fileType);
 
-    this.controls.materialListCtrl.state.query = {
-      fileType: this.store.type,
-    };
-    this.controls.materialListCtrl.loadPage(1);
+    // this.controls.materialListCtrl.state.query = {
+    //   fileType: this.store.type,
+    // };
+    // this.controls.materialListCtrl.loadPage(1);
 
     return souceObj;
   },

+ 2 - 0
src/modules/resource/index.ts

@@ -47,9 +47,11 @@ export class ResourceModule extends ModuleRoot {
     this.controls.matTempListCtrl.state.size = 20;
 
     this.controls.materialImageListCtrl.setCrudPrefix("/source")
+    this.controls.materialImageListCtrl.state.size = 18;
     this.controls.materialImageListCtrl.state.query = {fileType:"image"}
 
     this.controls.materialVideoListCtrl.setCrudPrefix("/source")
+    this.controls.materialVideoListCtrl.state.size = 18;
     this.controls.materialVideoListCtrl.state.query = {fileType:"video"}
     
   }

+ 8 - 1
src/pages/website/Material2/components/MaterialController.ts

@@ -38,4 +38,11 @@ export const BtnNames = {
     "video":"生成视频",
     "image": "生成图片",
     "upload": "上传素材"
-}
+}
+
+export const renderStatus = {
+    'succ': "",
+    'error': "渲染失败",
+    'default': "渲染中…",
+  };
+  

+ 3 - 2
src/pages/website/Material2/components/MaterialItem.tsx

@@ -4,6 +4,7 @@ import { Image, View } from "@queenjs/ui";
 import { Checkbox } from "ant-design-vue";
 import { defineUI } from "queenjs";
 import { any, bool, string } from "vue-types";
+import { renderStatus } from "./MaterialController";
 
 export default defineUI({
   props: {
@@ -36,9 +37,9 @@ export default defineUI({
                 class="!-mt-0.2em absolute top-0 left-0 text-20px text-red-200 z-3"
               />
             )}
-            {use == "task" && (
+            {use == "task" && record.status !== "succ" && (
               <div class="waiting absolute inset-0 z-2 flex items-center justify-center text-white">
-                渲染中…
+                {(renderStatus as any)[record.status || "default"]}
               </div>
             )}
             {use !== "task" && (