浏览代码

二维码管理显示样式调整

qymljy 5 天之前
父节点
当前提交
6a5a521e91
共有 3 个文件被更改,包括 4 次插入144 次删除
  1. 3 8
      public/codeToFile.html
  2. 0 135
      public/codeToFileCopy.html
  3. 1 1
      src/HDrpManagement/codeManage/index.vue

+ 3 - 8
public/codeToFile.html

@@ -12,7 +12,7 @@
             .title-div{
                 width:100%;
                 height:50px;
-                margin:0 0 20pt 30pt
+                margin:0 0 60px 30pt
             }
             .title-font{
                 font-size: 40pt;
@@ -48,7 +48,7 @@
         </style>
     </head>
     <body>
-        <img src="./img/bnBag.png" width="85%" height="180px" class="img-margin">
+        <img src="./img/bnBag.png" width="90%" height="20%" class="img-margin">
         <div class="title-div">
             <div class="title-font" >产品技术资料</div>
         </div>
@@ -84,16 +84,12 @@
                 console.log(urlNew)
                 axios.post(urlNew, param)
                 .then(function (response) {
-                    console.log(response)
-                    console.log(response.data.data.length)
                     response.data.data.forEach((item,index) => {
-                        console.log(item.attinfos)
                         item.attinfos.forEach((data,rowindex) => {
-                            console.log(data,'数据data的数据',rowindex)
                             const div = document.createElement('div');
                             div.className = 'div-border';
                             let iconSrc = '';
-                            if (data.postfix == 'word' || data.postfix == 'Word') {
+                            if (data.postfix == 'doc' || data.postfix == 'DOC' || data.postfix == 'docx' || data.postfix == 'DOCX') {
                                 iconSrc = './img/word.svg';
                             } else if (data.postfix == 'pdf' || data.postfix == 'PDF') {
                                 iconSrc = './img/pdfType.svg';
@@ -110,7 +106,6 @@
                                 iconSrc = './img/default.svg';
                             }
                             let remarks = data.document.split('.')[0]
-                            console.log(remarks,'remarks')
                             div.innerHTML = `
                             <div class="div-border" >
                                 <img src="${iconSrc}" class="img-style">

+ 0 - 135
public/codeToFileCopy.html

@@ -1,135 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-    <head>
-        <meta charset="UTF-8">
-        <title>商品资料页</title>
-        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
-        <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
-        <style>
-            .img-margin{
-                margin: 60pt 0 30pt 30pt;
-            }
-            .title-div{
-                width:100%;
-                height:50px;
-                margin:0 0 20pt 30pt
-            }
-            .title-font{
-                font-size: 40pt;
-                height:50px;
-                line-height: 50px;
-                vertical-align: auto;
-                text-align: left;
-                color: #333333;
-                font-weight: bold
-            }
-            .margin-style{
-                margin:0 30pt 20pt 30pt
-            }
-            .div-border{
-                width: 100%;
-                height: 150px;
-                border-radius: 8pt;
-                border: #cccccc solid 1px;
-                display: flex;
-                justify-content: left;
-                margin-bottom: 20px;
-            }
-            .img-style{
-                width: 90px;
-                height: 90px;
-                margin: 28px 0 0 20px;
-            }
-            .content-style{
-                font-size: 30px;
-                color: #333333;
-                margin: 30px 20px 0 20px;
-            }
-        </style>
-    </head>
-    <body>
-        <img src="./img/bnBag.png" width="85%" height="180px" class="img-margin">
-        <div class="title-div">
-            <div class="title-font" >产品技术资料</div>
-        </div>
-        <div class="margin-style" id="dataContainer"></div>
-        <script>
-            window.onload = async function(){
-                var loc=location.href;
-                var n1=loc.length;
-                var n2=loc.indexOf('=');
-                var code=loc.slice(n2+1,n1)
-                let that = this
-                console.log(code)
-                let param = {
-                    "id": 2025082515112802,
-                    "content": {
-                        "code": code
-                    },
-                }
-                var str = window.location.href;
-                var index = str.indexOf('/');
-                var num = 0;
-                var strNew = ''
-                while(index !== -1) {
-                    num++;
-                    index = str.indexOf('/',index + 1);
-                    if (num++ === 3) {
-                        this.url = str.slice(0, index) + '/yosweb/codeToFile.html'
-                        strNew = str.slice(0, index)
-                    }
-                }
-                console.log(strNew)
-                var urlNew = strNew + '/yos/rest/index'
-                console.log(urlNew)
-                axios.post(urlNew, param)
-                .then(function (response) {
-                    console.log(response)
-                    console.log(response.data.data.length)
-                    response.data.data.forEach((item,index) => {
-                        const div = document.createElement('div');
-                        div.className = 'div-border';
-                        let iconSrc = '';
-                        if (item.attinfos[index].postfix == 'word' || item.attinfos[index].postfix == 'Word') {
-                            iconSrc = './img/word.svg';
-                        } else if (item.attinfos[index].postfix == 'pdf' || item.attinfos[index].postfix == 'PDF') {
-                            iconSrc = './img/pdfType.svg';
-                        } else if (item.attinfos[index].postfix == 'png' || item.attinfos[index].postfix == 'PNG' || item.attinfos[index].postfix == 'JPG' || item.attinfos[index].postfix == 'jpg') {
-                            iconSrc = './img/pngType.svg';
-                        }else if (item.attinfos[index].postfix == 'ppt' || item.attinfos[index].postfix == 'PPT') {
-                            iconSrc = './img/ppt.svg';
-                        }else if (item.attinfos[index].postfix == 'mp3' || item.attinfos[index].postfix == 'MP3' || item.attinfos[index].postfix == 'MP4' || item.attinfos[index].postfix == 'mp4'
-                            || item.attinfos[index].postfix == 'mov' || item.attinfos[index].postfix == 'MOV') {
-                            iconSrc = './img/mov.svg';
-                        }else if (item.attinfos[index].postfix == 'EXCEL' || item.attinfos[index].postfix == 'excel' || item.attinfos[index].postfix == 'xlsx' || item.attinfos[index].postfix == 'XLSX') {
-                            iconSrc = './img/excel.svg';
-                        } else {
-                            iconSrc = './img/default.svg';
-                        }
-                        div.innerHTML = `
-                            <div class="div-border" >
-                                <img src="${iconSrc}" class="img-style">
-                                <div class="content-style">${item.remarks}</div>
-                            </div>
-                `;
-                        dataContainer.appendChild(div);
-                        div.addEventListener('click', function() {
-                            console.log(item.attinfos[index].url)
-                            downloadFile(item.attinfos[index].url)
-                        });
-                    })
-                })
-                .catch(function (error) {
-                    console.log(error);
-                });
-            }
-            function downloadFile(fileUrl, fileType){
-                const link = document.createElement('a');
-                link.href = fileUrl
-                document.body.appendChild(link);
-                link.click();
-                document.body.removeChild(link);
-            }
-        </script>
-    </body>
-</html>

+ 1 - 1
src/HDrpManagement/codeManage/index.vue

@@ -9,7 +9,7 @@
         :apiId="{query:2025082513210302,del:2025082513211502}">
       <template v-slot:tbList="scope">
         <div v-if="scope.data.column.columnname == 'codeImg'" >
-          <div  @click="codeClick(scope.data.column.data.code)">
+          <div  @click="codeClick(scope.data.column.data.code)" style="margin-top: 10px">
             <vue-qr  :text="url + '?code=' + scope.data.column.data.code" :size="36" @callback="callback"></vue-qr>
           </div>
         </div>