From b6c8e7c61f0270598ba7fdbc44f79512e010d0fe Mon Sep 17 00:00:00 2001
From: TreeWish <1131093754@qq.com>
Date: 星期五, 03 三月 2023 22:03:13 +0800
Subject: [PATCH] 合并国际化配置

---
 src/views/Archive/index.vue |   58 +++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 41 insertions(+), 17 deletions(-)

diff --git a/src/views/Archive/index.vue b/src/views/Archive/index.vue
index 9c28b0f..d3189da 100644
--- a/src/views/Archive/index.vue
+++ b/src/views/Archive/index.vue
@@ -54,7 +54,7 @@
           >
             <el-option
               v-for="item in categoryOptions"
-              :key="item.value"
+              :key="item.key"
               :label="item.value"
               :value="item.key"
             >
@@ -558,6 +558,7 @@
             >
               <template slot-scope="scope">
                 <el-link
+                  v-if="matchState(scope, /[]/)"
                   @click="setAttatchDetail(scope.$index, scope.row)"
                   class="elLink"
                 >{{ $t('common.see') }}</el-link>
@@ -1216,6 +1217,15 @@
     this.signGetPublicKey();
   },
   methods: {
+    matchState(state = "", reg) {
+      var row = state.row;
+      var name = row.name;
+      if (name.indexOf('.pdf') != -1 || name.indexOf('.jpg') != -1 || name.indexOf('.gif') != -1 || name.indexOf('.png') != -1 || name.indexOf('.jpeg') != -1) {
+        return true;
+      }
+
+      return false;
+    },
     // 闄勪欢=>琛ㄦ牸閫夋嫨
     handleAttatchChange(val) {
       this.attacgSelection = val;
@@ -1993,14 +2003,19 @@
         return;
       }
       var val = data.result;
-      val = val.filter((res) => {
+      if (val) {
+        val = val.filter((res) => {
+          res.mold = "鏁版嵁搴�"
+          res.isShow = false
+          return res;
+        })
+        this.listData.count = data.count;
+        this.monthdata = data.result;
+      } else {
+        this.listData.count = 0;
+        this.monthdata = [];
+      }
 
-        res.mold = "鏁版嵁搴�"
-        res.isShow = false
-        return res;
-      })
-      this.listData.count = data.count;
-      this.monthdata = data.result;
     },
     //鏌ヨ鏂囦欢鏁版嵁
     async getQueryFileData() {
@@ -2022,16 +2037,22 @@
         this.$message.error('鏂囦欢鏁版嵁鍒楄〃璋冪敤澶辫触');
       }
       var val = data.result;
-      val = val.filter((res) => {
-        var type = "." + res.type;
-        res.name = res.name.replaceAll(type, "")
-        res.mold = "鏂囦欢"
-        res.isShow = false
-        return res;
-      })
+      if (val) {
+        val = val.filter((res) => {
+          var type = "." + res.type;
+          res.name = res.name.replaceAll(type, "")
+          res.mold = "鏂囦欢"
+          res.isShow = false
+          return res;
+        })
 
-      this.monthdata = val;
-      this.listData.count = data.count;
+        this.monthdata = val;
+        this.listData.count = data.count;
+      } else {
+        this.monthdata = [];
+        this.listData.count = 0;
+      }
+
     },
     //鏌ヨ鏁版嵁
     getAllTabesData() {
@@ -2061,6 +2082,7 @@
       if (data.code != 200) {
         this.$message.error('璧勬枡绫诲埆鍒楄〃璋冪敤澶辫触');
       }
+
       this.categoryOptions = data.result;
     },
     //鍏抽敭瀛楁煡璇�
@@ -2076,7 +2098,9 @@
     },
     //璧勬枡绫诲埆涓嬫媺妗嗗�兼敼鍙樿Е鍙�
     categorySelectChange(model, prop, options) {
+
       this.getAllTabesData();
+
     },
     // 椤圭洰鍚嶇О涓嬫媺妗嗗�兼敼鍙樿Е鍙�
     itemSelectChange(model, prop, options) {

--
Gitblit v1.9.3