lex 1 سال پیش
والد
کامیت
c7fad98d23

+ 1 - 1
public/version.json

@@ -1 +1 @@
-{"version":1709552479880}
+{"version":1709627330322}

+ 13 - 2
src/views/natural-resources/components/my-resources/index.tsx

@@ -1,4 +1,4 @@
-import { defineComponent, onMounted, reactive, ref } from 'vue';
+import { computed, defineComponent, onMounted, reactive, ref } from 'vue';
 import styles from './index.module.less';
 import CardType from '/src/components/card-type';
 import Pagination from '/src/components/pagination';
@@ -97,6 +97,17 @@ export default defineComponent({
       }
     };
 
+    const isEmpty = computed(() => {
+      const list = state.tableList || [];
+      let num = 0;
+      list.forEach((item: any) => {
+        if (!item.delFlag) {
+          num++;
+        }
+      });
+      return num > 0 ? false : true;
+    });
+
     // 收藏
     const onCollect = async (item: any) => {
       try {
@@ -314,7 +325,7 @@ export default defineComponent({
                 )
             )}
 
-            {!state.loading && state.tableList.length <= 0 && (
+            {!state.loading && isEmpty.value && (
               <TheEmpty style={{ minHeight: '50vh' }} description="暂无资源" />
             )}
           </div>

+ 11 - 2
src/views/natural-resources/components/my-resources/upload-modal/index.tsx

@@ -118,9 +118,18 @@ export default defineComponent({
               id: item.id || null
             });
           });
+          console.log(isUpdate.value, 'isUpdate.value', props.editStatus);
           if (isUpdate.value) {
-            // await materialUpdateAll(body);
-            emit('editAll', body);
+            if (!props.editStatus) {
+              await materialUpdateAll(body);
+              message.success('保存成功');
+              uploadForms.list = [];
+              emit('close', true);
+              emit('confirm');
+            } else {
+              emit('editAll', body);
+            }
+
             uploadForms.list = [];
           } else {
             await materialSave(body);