From 26f2cbdbde628ac6bdc9748ac80ad337fcdde59e Mon Sep 17 00:00:00 2001
From: Tcsm <1377977403@qq.com>
Date: 星期二, 13 六月 2023 15:35:01 +0800
Subject: [PATCH] 1.各模块点击电子文件可进入详情页面 2.家根网和家谱的详情页接上数据

---
 ruoyi-ui/src/views/honor/honorInfo.vue |   96 ++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 76 insertions(+), 20 deletions(-)

diff --git a/ruoyi-ui/src/views/honor/honorInfo.vue b/ruoyi-ui/src/views/honor/honorInfo.vue
index d424aa9..7738e57 100644
--- a/ruoyi-ui/src/views/honor/honorInfo.vue
+++ b/ruoyi-ui/src/views/honor/honorInfo.vue
@@ -197,6 +197,7 @@
 import {Message} from "element-ui";
 import { download,uploadPic} from "@/api/doctor/index";
 import {listHonor,updateHonor,getHonor} from "@/api/honor/index";
+import {listRoot} from "@/api/root";
 
 export default {
   components: {},
@@ -307,33 +308,88 @@
     let _this = this
     if (id) {
       this.loading = true;
-      getHonor(id).then((response) => {
-        this.formData = response.data;
-        let paths = response.data.url.split(",");
-        for(let i = 0; i < paths.length; i++)
-        {
-          if(paths[i]!="") {
+      // getHonor(id).then((response) => {
+      //   this.formData = response.data;
+      //   let paths = response.data.url.split(",");
+      //   for(let i = 0; i < paths.length; i++)
+      //   {
+      //     if(paths[i]!="") {
+      //
+      //       let pth = paths[i].substr(paths[i].length - 4, paths[i].length)
+      //
+      //       if (_this.fot.includes(pth) === true)
+      //         _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
+      //       else {
+      //       // alert(paths[i])
+      //       let nms = paths[i].split("\/")
+      //       let nm = nms[nms.length - 1]
+      //       _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
+      //       }
+      //     }
+      //   }
+      //   this.loading = false;
+      // });
 
-            let pth = paths[i].substr(paths[i].length - 4, paths[i].length)
-
-            if (_this.fot.includes(pth) === true)
-              _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
-            else {
-              // alert(paths[i])
-              let nms = paths[i].split("\/")
-              let nm = nms[nms.length - 1]
-              _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
-            }
-          }
-        }
-        this.loading = false;
-      });
+      this.fetchData()
       this.getCateInfor()
 
     }
+      //浠ヤ笅涓簍est
+    // if (id){
+    //   this.loading =true;
+    //   getHonor(id).then((response)=> {
+    //   this.formData =response.data;
+    //   let paths=response.data.url.split(" ");
+    //   for(let i = 0; i < paths.length; i++){
+    //     if(paths[i]!=""){
+    //       let pth = paths[i].substr(paths[i].length - 4, paths[i].length);
+    //       if (_this.fot.includes(pth)) {
+    //         _this.fileList.push({
+    //           name: paths[i],
+    //           url: process.env.VUE_APP_BASE_TRUE_API + paths[i],
+    //         });
+    //       } else {
+    //             // alert(paths[i])
+    //             let nms = paths[i].split("\/")
+    //             let nm = nms[nms.length - 1]
+    //             _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
+    //             }
+    //         }
+    //       }
+    //       this.loading = false;
+    //     });
+    //
+    //   // getHonor(id).then(response => {
+    //   //     //  alert(123)
+    //   //     //  alert(123)
+    //   //     //   console.log(response.data)
+    //   //     //  alert(90)
+    //   //     this.formData = response.data;
+    //   //     this.isShow_1=true
+    //   //     //  alert(this.rootList[0].url)
+    //   //     //   this.total = response.data.total;
+    //   //     this.loading = false;
+    //   //   }
+    //   // );
+    //   this.getCateInfor()
+    //
+    // }
   },
   mounted() {},
   methods: {
+    // 鑾峰彇鏁版嵁鏂规硶
+    fetchData(id) {
+      const url = 'http://47.93.189.255:8080/zHonor/id=${id}'; // 鎺ュ彛 URL'/zHonor/id='+query
+      fetch(url)
+        .then(response => response.json())
+        .then(data => {
+          this.formData = data; // 閫氳繃灏嗚繑鍥炴暟鎹祴缁欑粍浠跺睘鎬ф潵鏇存柊瑙嗗浘
+        })
+        .catch(error => {
+          console.error('Error:', error); // 澶勭悊閿欒
+        });
+    },
+
     /** 鏌ヨ绫诲埆淇℃伅 */
     getCateInfor()
     {

--
Gitblit v1.9.1