From d5efa1b1cdbab10b034357ae3e7b65c21754a123 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期六, 11 二月 2023 11:47:01 +0800
Subject: [PATCH] 样式管理界面修改,数据上传添加附件

---
 src/views/datamanage/styleManage.vue |   53 +++++++++++++++++++++++++++++++++++------------------
 1 files changed, 35 insertions(+), 18 deletions(-)

diff --git a/src/views/datamanage/styleManage.vue b/src/views/datamanage/styleManage.vue
index 7c1d8f5..786a6f0 100644
--- a/src/views/datamanage/styleManage.vue
+++ b/src/views/datamanage/styleManage.vue
@@ -216,7 +216,7 @@
         <el-divider></el-divider>
         <p>
           <label> {{ $t('dataManage.styleObj.fileguid') }}:</label>
-          <label class="boxlabel">{{ itemdetail.fileGuid }}</label>
+          <label class="boxlabel">{{ itemdetail.fname }}</label>
         </p>
         <el-divider></el-divider>
         <p>
@@ -729,7 +729,7 @@
           <div class="BoxFlex">
             <div class="BoxFlexinput">
               <el-input
-                v-model="insertform.fileGuid"
+                v-model="insertFileGuid"
                 disabled
                 autocomplete="off"
                 style="width:100%"
@@ -742,7 +742,7 @@
                 id="insertFile"
                 multiple="multiple"
                 style="display: none"
-                @change="insertFile(0)"
+                @change="insertFileData(0)"
               />
               <el-button
                 style="margin-left: 6px;"
@@ -780,7 +780,7 @@
           <div class="BoxFlex">
             <div class="BoxFlexinput">
               <el-input
-                v-model="insertform.viewGuid"
+                v-model="insertViewGuid"
                 disabled
                 autocomplete="off"
                 style="width:100%"
@@ -793,7 +793,7 @@
                 id="insertimageFile"
                 multiple="multiple"
                 style="display: none"
-                @change="insertFile(1)"
+                @change="insertFileData(1)"
               />
               <el-button
                 style="margin-left: 6px;"
@@ -922,6 +922,14 @@
   components: { MyBread, styleDirTree, styleDepTree },
   data() {
     return {
+      insertFileGuid: "",
+      insertViewGuid: "",
+      insertFileName: "",
+      insertViewName: "",
+
+      insertform: {
+
+      },
       dialogFormVisible: false,
       InsertFormdialog: false,
       showCata: false,
@@ -940,10 +948,7 @@
       showDirCata: false,
       showDepCata: false,
       tableData: [],
-      insertform: {
-        fileGuid: null,
-        viewGuid: null,
-      },
+
       dirFlag: null,
       depFlag: null,
       guidFile: null,
@@ -1012,15 +1017,19 @@
         $("#insertimageFile").click();
       }
     },
-    insertFile(res) {
+    insertFileData: function (res) {
+
+
       if (res == 0) {
-        var val = document.getElementById("insertFile").files;
-        if (!val || !val.length) return;
-        this.insertform.fileGuid = val[0].name;
+        let val = document.getElementById("insertFile").files;
+
+        this.insertFileGuid = val[0].name;
+        this.insertFileName = val[0].name;
       } else if (res == 1) {
-        var val = document.getElementById("insertimageFile").files;
-        if (!val || !val.length) return;
-        this.insertform.viewGuid = val[0].name;
+        let val = document.getElementById("insertimageFile").files;
+
+        this.insertViewGuid = val[0].name;
+          this.insertViewName = val[0].name;
       }
     },
     async setinsertFile(res) {
@@ -1208,9 +1217,10 @@
     insertFromDataClose() {
       this.InsertFormdialog = false;
       this.insertform = {
-        fileGuid: null,
-        viewGuid: null,
+
       }
+      this.insertFileGuid = "";
+      this.insertViewGuid = ""
       this.filesReset();
     },
     handleClose() {
@@ -1231,10 +1241,13 @@
       }
       if (this.guidFile != null) {
         this.insertform.fileGuid = this.guidFile;
+        this.insertform.fname = this.insertFileName;
       }
       if (this.viewFile != null) {
         this.insertform.viewGuid = this.viewFile;
+         this.insertform.vname = this.insertViewName;
       }
+    
       const data = await insertStyle(this.insertform);
       if (data.code == 200) {
         this.InsertFormdialog = false;
@@ -1242,6 +1255,8 @@
           fileGuid: null,
           viewGuid: null,
         }
+        this.insertFileGuid = "";
+        this.insertViewGuid = ""
         this.filesReset();
         this.$message({
           message: "娣诲姞鎴愬姛锛�",
@@ -1261,6 +1276,7 @@
       }
       this.listData.name = this.ruleForm.name;
       const data = await select_Style_ByPageAndCount(this.listData);
+      debugger
       if (data.code != 200) {
         this.$message.error("鍒楄〃璋冪敤澶辫触");
       }
@@ -1466,6 +1482,7 @@
     showDetail(index, row) {
       var token = getToken();
       this.showinfoBox = true;
+   
       this.itemdetail = row;
       this.itemdetail.createTime = this.formomentTime(
         this.itemdetail.createTime

--
Gitblit v1.9.3