Browse Source

feat:PC 数据导出需求开发

tsz 3 years ago
parent
commit
b13894596e

+ 8 - 5
src/web/staticres/dataExport/css/conditions.css

@@ -776,7 +776,7 @@ input.sm {
   position: fixed;
   top: 0;
   margin: 114px auto;
-  z-index: 999;
+  z-index: 11;
   width: 1200px;
   overflow-x: auto;
   overflow-y: hidden;
@@ -797,7 +797,7 @@ input.sm {
   top: 0;
   margin: 64px auto;
   width: 1200px;
-  z-index: 999;
+  z-index: 11;
 }
 .data_op_left{
   padding-left: 14px;
@@ -852,14 +852,17 @@ input.sm {
   color: #FFFFFF;
   line-height: 18px;
 }
-.noDataDialog{
-  /* width: 380px;
+.noDataDialog.el-dialog__wrapper{
+  margin: auto;
+  width: 380px;
   height: 202px;
   background: #fff;
-  border-radius: 8px; */
+  border-radius: 8px;
 }
 .noDataDialog .el-dialog{
   padding: 32px;
+  margin-top: 0!important;
+  margin: 0;
   display: flex;
   flex-direction: column;
   justify-content: space-between;

+ 58 - 35
src/web/templates/pc/dataExport_sieve.html

@@ -21,9 +21,8 @@
     href="{{Msg "seo" "cdn"}}/pccss/public-nav-1200.css?v={{Msg "seo" "version"}}"/>
     <script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
     <link href="//cdn-common.jianyu360.com/cdn/lib/element-ui/2.15.7/lib/theme-chalk/index.css" rel="stylesheet" />
-    <script src=//cdn-common.jianyu360.com/cdn/lib/element-ui/2.15.7/lib/index.js></script>
     <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/dataExport/css/previewData.css?v={{Msg "seo" "version"}}">
-    <script src="{{Msg "seo" "cdn"}}/dataExport/js/html2canvas.min.js"></script>
+    <script src="//cdn-common.jianyu360.com/cdn/lib/html2canvas/1.4.0/dist/html2canvas.js"></script>
     <script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/public-nav.js?v={{Msg "seo" "version"}}"></script>
     <script src="{{Msg "seo" "cdn"}}/swiper/swiper.min.js?v={{Msg "seo" "version"}}"></script>
     <title>数据导出_拟建项目导出_招标采购数据导出_中标数据导出-剑鱼标讯</title>
@@ -543,7 +542,7 @@
 </head>
 <body>
 {{include "/common/pchead.html"}}
-<section class="conditions-box w" style="min-height: calc(100vh - 364px);">
+<section id="conditions-box" class="conditions-box w" style="min-height: calc(100vh - 364px);">
     <!-- 数据导出功能文案 -->
     <div class="dataExportFun">
       <div class="data_export_left data_export_common">
@@ -875,7 +874,7 @@
             <button id="reset">重置</button>
         </div>
     </div>
-    <div id="dataExport_table"  v-if="tableShow" class="dataExport_table">
+    <div id="dataExport_table" v-loading="loading"  v-if="tableShow" class="dataExport_table">
       <div class="dataExport_option" v-if="isfixed" :class="isfixed? 'data_fixed' : ''">
         <div class="data_op_left">
           为您筛选到 <span style="color:#2CB7CA">${dataInfo.total}</span> 条数据
@@ -944,7 +943,7 @@
             </tr>
           </table> -->
         </div>
-        <table v-if="dataType === '1'" class="d_bz" cellspacing="0" cellpadding="0">  
+        <table v-if="dataType === '1'" class="d_bz" cellspacing="0" cellpadding="0">
           <tr id="firstTr">
             <td :rowspan="item.rowspan" :colspan="item.colspan" v-for="(item, index) in title" :key="index">
               <span v-if="index===8&&dataType === '1'">${item.title}<br/>(万元)</span>
@@ -977,11 +976,9 @@
               <td>单位名称</td>
               <td>联系人</td>
               <td>联系电话</td>
-    
               <td>单位名称</td>
               <td>联系人</td>
               <td>联系电话</td>
-    
               <td>联系人</td>
               <td>联系电话</td>
               <td>电子邮箱</td>
@@ -1017,19 +1014,6 @@
         <div class="sy" :class="dataType==='2'?'sy_gj':''"></div>
         <div class="dataMore-main" v-if="dataInfo.total>20"></div>
       </div>
-      <el-dialog
-      class="noDataDialog"
-        :visible.sync="noDataDialog"
-        width="30%"
-        center>
-        <div class="no-data-text">
-          <p>未匹配到数据</p>
-          <p>对不起,没有匹配到数据,请修改数据导出条件</p>
-        </div>
-        <span slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="noDataDialog = false">立即修改</el-button>
-        </span>
-      </el-dialog>
     </div>
     <div class="dataMore-out" style="display: none;">
       <div class="dataMore-content">
@@ -1039,6 +1023,19 @@
         </div>
       </div>
     </div>
+    <el-dialog
+      :visible.sync="noDataDialog"
+      class="noDataDialog"
+      width="30%"
+      center>
+      <div class="no-data-text">
+        <p>未匹配到数据</p>
+        <p>对不起,没有匹配到数据,请修改数据导出条件</p>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="goModify">立即修改</el-button>
+      </span>
+    </el-dialog>
     <!--底部banner-->
     <div class="banner" style="height: 120px;margin-top:32px;">
       <div class="swiper-container lunbo" id="swiper1">
@@ -1105,10 +1102,11 @@
 </div>
 {{include "/common/pcbottom.html"}}
 {{include "/common/baiducc.html"}}
+<script src=//cdn-common.jianyu360.com/cdn/lib/element-ui/2.15.7/lib/index.js></script>
 <script>
   var dataNode = new Vue({
     delimiters: ['${', '}'],
-    el: '#dataExport_table',
+    el: '#conditions-box',
     data: {
       title: [
         {rowspan: 1,colspan: 1,title: '序号',},
@@ -1124,6 +1122,7 @@
         {rowspan: 1,colspan: 1,title: '公告内容',},
         {rowspan: 1,colspan: 1,title: '剑鱼标讯地址',}
       ],
+      loading: false,
       bottomfixed: false,
       isfixed: false,
       tableShow: false,
@@ -1157,11 +1156,13 @@
         if(dataNode._data.dataType === '2') {
           whichDom = document.querySelector(".d_bz")
         }
-        html2canvas().then(function(canvas){
-          var url=canvas.toDataURL('image/png');
-          $(".d_bz").append("<img class=\"fimg\" src=\""+url+"\">")
-          $(".d_bz img").width(w);
-        });
+        if(whichDom) {
+          html2canvas().then(function(canvas){
+            var url=canvas.toDataURL('image/png');
+            $(".d_bz").append("<img class=\"fimg\" src=\""+url+"\">")
+            $(".d_bz img").width(w);
+          });
+        }
       },
       setHtmlCanvas (type) {
         var proNode = document.getElementById('previewData_bz')
@@ -1181,10 +1182,10 @@
             height: height,
             backgroundColor: '#EBF5FE',
             scale: 2,
-            X: 0,
-            Y: 0,
+            // X: 0,
+            // Y: 0,
             // scrollX: -3, // 如果左边多个白边 设置该偏移-3 或者更多
-            // scrollY: -10,
+            // scrollY: 10,
             useCORS: true, // 是否使用CORS从服务器加载图像 !!!
             allowTaint: true // 是否允许跨域图像污染画布  !!!
           }).then(function(canvas){
@@ -1192,6 +1193,12 @@
           });
         }
       },
+      // 修改筛选条件
+      goModify () {
+        this.noDataDialog = false
+        var node = document.getElementById('progress_')
+        node.scrollIntoView()
+      },
       // 监听滚动
       handleScroll () {
         var st =
@@ -1203,8 +1210,14 @@
         var $height = $(window).height()
         if ($bottomDom - 750 >= st) {
           $('.footer-two').addClass('bottomfixed')
-          if(this.dataInfo.list.length > 0) {
-            $('.footer-two').show()
+          if (this.dataInfo.list) {
+            if(this.dataInfo.list.length > 0) {
+              $('.footer-two').show()
+            } else {
+              $('.footer-two').removeClass('bottomfixed').hide()
+            }
+          } else {
+            $('.footer-two').removeClass('bottomfixed').hide()
           }
         } else {
           $('.footer-two').removeClass('bottomfixed').hide()
@@ -1923,6 +1936,7 @@
     });
 
     $("#sieve").click(function () {
+        dataNode._data.loading = true
         $("#sieve").addClass("sussecc");
         $("#reset").removeClass("sussecc");
         var date = getDate();
@@ -1967,9 +1981,12 @@
         // console.log(param);
         $.post("/front/dataExport/sieveData", param, function (res) {
           if(res.error_code == 0) {
-            if(res.data.list.length > 0) {
+            dataNode._data.dataInfo = res.data
+            if(res.data.list) {
+              setTimeout(function() {
+                dataNode._data.loading = false
+              }, 500)
               dataNode._data.tableShow = true
-              dataNode._data.dataInfo = res.data
               if(res.data.total == -1) {
                 res.data.total = 20000
               }
@@ -1980,11 +1997,17 @@
               }
               $(function(){
                 dataNode.renderImg()
-                var ele = document.getElementById("dataExport_table");
-                ele.scrollIntoView()
                 dataNode.setHtmlCanvas(dataType)
               })
+              setTimeout(function(){
+                var ele = document.getElementById("dataExport_table");
+                ele.scrollIntoView(true)
+              },100)
             } else {
+              $('.dataExport-footer').hide()
+              $('.dataMore-out').hide()
+              dataNode._data.loading = false
+              dataNode._data.tableShow = false
               dataNode._data.noDataDialog = true
             }
           }