From 8c834663344b1cc9c2ca569e6911900edd407f73 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期四, 06 六月 2024 16:44:14 +0800
Subject: [PATCH] 修改

---
 web/src/views/modules/sysPictureBase/SysPictureBase-AddOrUpdate.vue |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/web/src/views/modules/sysPictureBase/SysPictureBase-AddOrUpdate.vue b/web/src/views/modules/sysPictureBase/SysPictureBase-AddOrUpdate.vue
index 6a2a3dd..bfb24e0 100644
--- a/web/src/views/modules/sysPictureBase/SysPictureBase-AddOrUpdate.vue
+++ b/web/src/views/modules/sysPictureBase/SysPictureBase-AddOrUpdate.vue
@@ -5,7 +5,7 @@
         <el-input v-model="dataForm.name"></el-input>
       </zt-form-item>
       <zt-form-item label="浜у搧绫诲瀷" prop="productType" rules="required">
-        <zt-dict v-model="dataForm.productType" dict="product"></zt-dict>
+        <zt-dict v-model="dataForm.productType" dict="product" :additional=additional></zt-dict>
       </zt-form-item>
       <zt-form-item label="鏄惁榛樿" prop="isDefault" rules="required">
         <zt-dict v-model="dataForm.isDefault" dict="is_or_not"></zt-dict>
@@ -14,14 +14,14 @@
         <el-input v-model="dataForm.contentType"></el-input>
       </zt-form-item>
       <input type="hidden" id="svgContentId" :value="dataForm.svgContent"/>
-              <zt-form-item>
-<!--                <el-upload action="*" :on-change="uploadSvgContent">-->
-<!--                  <el-button slot="trigger" size="small" type="primary">閫夊彇鏂囦欢</el-button>-->
-<!--                </el-upload>-->
-                <label class="custom-file-upload">
-                <input type="file" @change="uploadSvgContent" />
-                </label>
-              </zt-form-item>
+      <zt-form-item>
+        <!--                <el-upload action="*" :on-change="uploadSvgContent">-->
+        <!--                  <el-button slot="trigger" size="small" type="primary">閫夊彇鏂囦欢</el-button>-->
+        <!--                </el-upload>-->
+        <label class="custom-file-upload">
+          <input type="file" @change="uploadSvgContent"/>
+        </label>
+      </zt-form-item>
     </el-form>
     <iframe :src='SVGEditorUrl' ref="myIframe" width="100%" id="iframe"
             style="height:calc(100vh - 300px)">
@@ -36,6 +36,7 @@
   export default {
     data() {
       return {
+        additional: [{dictValue: '20', dictLabel: '杩愮畻鍥惧厓', remark: ''}],
         SVGEditorUrl: `/SVGOrigin/Method-Draw-master/editor/index.html`,
         url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getProductImg?token=${Cookies.get('token')}&id=`,
         fileList: [],
@@ -62,7 +63,7 @@
             ...this.dataForm,
             ...res.data
           }
-          console.log(this.dataForm,'this.dataForm this.dataForm')
+          console.log(this.dataForm, 'this.dataForm this.dataForm')
         }
       },
       httpRequest(option) {
@@ -100,10 +101,10 @@
       async formSubmit() {
         const iframeWindow = this.$refs.myIframe.contentWindow;
         this.dataForm.svgContent = iframeWindow.getSVGContentTest()
-        console.log(this.dataForm.svgContent+'this.dataForm.svgContent')
+        console.log(this.dataForm.svgContent + 'this.dataForm.svgContent')
         this.$http.post('/sysPictureBase/save', this.dataForm).then(res => {
           if (res.success) {
-            console.log(this.dataForm,'this.dataForm')
+            console.log(this.dataForm, 'this.dataForm')
             this.$tip.success()
             this.$refs.dialog.close()
             this.$emit('refreshDataList')
@@ -114,9 +115,9 @@
       async uploadSvgContent(event) {
         const iframeWindow = this.$refs.myIframe.contentWindow
         const file = event.target.files[0];
-        console.log(file,'file file')
+        console.log(file, 'file file')
         // 鍙互鍦ㄨ繖閲岃繘琛岃繘涓�姝ョ殑鏂囦欢澶勭悊锛屾瘮濡傝鍙栨枃浠跺唴瀹圭瓑鎿嶄綔
-        if (file && file.type==='image/svg+xml') {
+        if (file && file.type === 'image/svg+xml') {
           const reader = new FileReader();
           reader.onload = (e) => {
             const fileContent = e.target.result;
@@ -124,7 +125,7 @@
             iframeWindow.setSvgContent(fileContent)
           }
           reader.readAsText(file); // 浠ユ枃鏈舰寮忚鍙栨枃浠跺唴瀹�
-        }else {
+        } else {
           this.$message({message: '璇烽�夋嫨SVG鍥剧墖', type: 'warning'})
           return false; // 鍙栨秷鎿嶄綔
         }
@@ -148,6 +149,7 @@
     cursor: pointer;
     background-color: #f9f9f9;
   }
+
   .img-sc > .el-form-item > .el-form-item__content {
     width: 100%;
   }

--
Gitblit v1.9.1