Ver Fonte

feat:预览数据页面优化

Signed-off-by: tsz <2417024719@qq.com>
tsz há 1 ano atrás
pai
commit
75dff3c5db

+ 1 - 1
src/web/staticres/dataExport/css/conditions.css

@@ -1253,7 +1253,7 @@ input.sm {
   justify-content: space-between;
 }
 
-.pre-search-list {
+.buyer-search-list, .winner-search-list {
   padding: 20px 0;
   position: absolute;
   z-index: 6;

+ 1 - 0
src/web/staticres/dataExport/css/previewData.css

@@ -197,6 +197,7 @@ body{
 
 .d_gj tr:nth-child(1) td.multi_packet_trd, .d_gj tr:nth-child(2) td.multi_packet_trd{
   background: transparent;
+  color: unset;
 }
 
 .d_bz tr:nth-child(odd).multi_packet_tr, .d_gj tr:nth-child(odd).multi_packet_tr{

+ 9 - 11
src/web/staticres/dataExport/js/conditions_order.js

@@ -234,15 +234,15 @@ function delAddBox(n) {
   })
 }
 /* 输入事件 */
-$(".user-input input").on('input',function () {
-  var dom = $(this)
-  var f =  $.trim(dom.val()).length> 0
-  if(f) {
-    dom.next().show()
-  } else {
-    dom.next().hide()
-  }
-})
+// $(".user-input input").on('input',function () {
+//   var dom = $(this)
+//   var f =  $.trim(dom.val()).length> 0
+//   if(f) {
+//     dom.next().show()
+//   } else {
+//     dom.next().hide()
+//   }
+// })
 /* 生成子标签 */
 function createCKey(title,arr,clazz) {
   if(arr.length === 0) {
@@ -348,8 +348,6 @@ function addDelInput(t,type) {
 /* 采购单位、中标单位 input-blur -- 添加可删除Input标签 -- 20190103*/
 function addDelInputB(t,type) {
   setTimeout(() => {
-    dataNode.buyerSearchListShow = false
-    dataNode.winnerSearchListShow = false
     $('.buyer-search-list').hide()
     $('.winner-search-list').hide()
     var d = document.createElement('div');

+ 7 - 18
src/web/templates/pc/dataExport_sieve.html

@@ -985,14 +985,8 @@
                 <div class="user-input">
                     <input oninput="getDataExportSearch('1')" class="w" type="text" placeholder="请输入采购单位" maxlength="50" id="buyerInput"
                            onblur="addDelInputB(this,1)">
-                    <div class="pre-search-list buyer-search-list" style="display: none;">
-                      <div
-                          class="pre-search-item ellipsis"
-                          v-for="(item,index) in buyerSearch.list"
-                          :key="index"
-                          @click="toDetail(item, '1')"
-                          >${ item }
-                        </div>
+                    <div class="buyer-search-list" style="display: none;">
+                      <div class="pre-search-item ellipsis" v-for="(item,index) in buyerSearch.list" :key="index" @click="toDetail(item, '1')">${ item }</div>
                     </div>
                     {{/*<button style="display: none" class="sussecc w100" onclick="addDelInput(this,1)">确定</button>*/}}
                 </div>
@@ -1012,14 +1006,8 @@
                 <div class="user-input">
                     <input oninput="getDataExportSearch('2')" class="w" type="text" placeholder="请输入中标单位" maxlength="50" id="winnerInput"
                            onblur="addDelInputB(this,2)">
-                    <div class="pre-search-list winner-search-list" style="display: none;">
-                      <div
-                          class="pre-search-item ellipsis"
-                          v-for="(item,index) in winnerSearch.list"
-                          :key="index"
-                          @click="toDetail(item, '2')"
-                          >${ item.name }
-                        </div>
+                    <div class="winner-search-list" style="display: none;">
+                      <div class="pre-search-item ellipsis" v-for="(item,index) in winnerSearch.list" :key="index" @click="toDetail(item, '2')">${ item.name }</div>
                     </div>
                     {{/*<button style="display: none" class="sussecc w100" onclick="addDelInput(this,2)">确定</button>*/}}
                 </div>
@@ -1731,7 +1719,7 @@
         if(!item.industry){
           ClassArr.arr = [];
         }else{
-          ClassArr.arr = this.formatIndustry(item.industry).split(',')
+          ClassArr.arr = item.industry.split(',')
         }
         if(!item.buyerclass){
           buyClassArr.arr = [];
@@ -2584,6 +2572,8 @@
         if (searchTimer) {
           clearTimeout(searchTimer);
         }
+        $('.buyer-search-list').hide()
+        $('.winner-search-list').hide()
         searchTimer = setTimeout(() => {
           $.ajax({
             url: `/bigmember/search/${type}/association`,
@@ -2595,7 +2585,6 @@
                     if (res.data.list && res.data.list.length > 0) {
                       if(str === '1') {
                         dataNode.buyerSearch.list = res.data.list || []
-                        dataNode.buyerSearchListShow = true
                         $('.buyer-search-list').show()
                       } else if(str === '2') {
                         dataNode.winnerSearch.list = res.data.list || []

+ 305 - 173
src/web/templates/pc/previewData.html

@@ -4,6 +4,9 @@
 		<meta charset="utf-8" />
 		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
 		<link rel="stylesheet" href="{{Msg "seo" "cdn"}}/dataExport/css/previewData.css?v={{Msg "seo" "version"}}">
+    <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/vue/2.6.11/vue.min.js></script>
+    <script src=//cdn-common.jianyu360.com/cdn/lib/element-ui/2.15.7/lib/index.js></script>
 		<script src="https://cdn.bootcss.com/js-polyfills/0.1.42/polyfill.min.js"></script>
 		<script src="https://cdn.bootcdn.net/ajax/libs/fontfaceobserver/2.1.0/fontfaceobserver.js"></script>
 		<script src="{{Msg "seo" "cdn"}}/dataExport/js/html2canvas.min.js"></script>
@@ -18,178 +21,307 @@
 				src: url('/fonts/ttf/{{.T.ttf}}.eot?#iefix') format('embedded-opentype'), /* IE Fix for IE 6-8*/
 				url("{{Msg "seo" "cdn"}}/fonts/ttf/{{.T.ttf}}.ttf") format("truetype");  /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */
 			}
-			.mosaic-text {
+			/* .mosaic-text {
 				display: inline !important;
 				color: transparent !important;
 				text-shadow: 0 0 10px rgba(0,0,0,0.5);
-			}
+			} */
 		</style>
-		<script>
-			var index=1;
-			/*document.oncontextmenu = function(){
-		   		return false;
-			}
-			document.onselectstart = function(){
-			    return false;
-			}
-			document.oncopy = function(){
-			    return false;
-			}*/
-		</script>
 	</head>
-			{{if eq .T.dataType "1"}}
-			<body style="min-width:2020px;">
-				<table class="d_bz" cellspacing="0" cellpadding="0">
-					<tr>
-            <td>序号</td>
-            <td>匹配关键词</td>
-          	<td>省份</td>
-						<td>城市</td>
-						<td>公告标题</td>
-            <td>公告类别</td>
-            <td>发布时间</td>
-            <td>采购单位</td>
-            <td>中标单位</td>
-            <td>中标金额<br>(万元)</td>
-            <td>项目名称</td>
-						<td>公告内容</td>
-            <td>剑鱼标讯地址</td>
-					</tr>
-					{{range $i, $v := .T.data}}
-						<tr>
-						<td>
-							<script>
-							document.write(index++)
-							</script>
-						</td>
-            <td>{{$v.keyword}}</td>
-            <td>{{$v.area}}</td>
-						<td>{{$v.city}}</td>
-						<td>{{$v.title}}</td>
-            <td>{{$v.subtype}}</td>
-            <td>{{$v.publishtime}}</td>
-            <td>{{$v.buyer}}</td>
-            <td>{{$v.s_winner}}</td>
-            <td name="money">{{$v.bidamount}}</td>
-            <td>{{$v.projectname}}</td>
-						<td>{{$v.detail}}</td>
-            <td>{{$v.url}}</td>
-
-					</tr>
-					{{end}}
-				</table>
-			{{else}}
-			<body style="min-width:2820px;">
-				<table class="d_gj" cellspacing="0" cellpadding="0">
-				<tr>
-					<td rowspan=2>序号</td>
-          <td rowspan=2>匹配关键词</td>
-          <td rowspan=2>省份</td>
-					<td rowspan=2>城市</td>
-          <td rowspan=2>区县</td>
-					<td rowspan=2>公告标题</td>
-          <td rowspan=2>公告类别</td>
-					<td rowspan=2>公告内容</td>
-          <td rowspan=2>发布时间</td>
-					<td rowspan=2>公告地址</td>
-          <td rowspan=2>剑鱼标讯地址</td>
-          <td rowspan=2>项目名称</td>
-		      <td rowspan=2>项目编号</td>
-          <td rowspan=2>项目范围</td>
-          <td rowspan=2>预算金额<br>(万元)</td>
-          <td rowspan=2>中标金额<br>(万元)</td>
-          <td rowspan=2>报名截止日期</td>
-          <td rowspan=2>开标日期</td>
-          <td rowspan=2>投标截止日期</td>
-          <td colspan=4>采购单位信息</td>
-          <td rowspan=2>招标代理机构</td>
-          <td colspan=3>中标单位信息(来源:招标公告网站)</td>
-          <td colspan=3>中标单位信息(来源:国家企业公示网站)</td>
-				</tr>
-        <tr>
-          <td>单位名称</td>
-					<td>联系人</td>
-					<td>联系电话</td>
-          <td>单位地址</td>
-
-          <td>单位名称</td>
-          <td>联系人</td>
-          <td>联系电话</td>
-
-          <td>联系人</td>
-          <td>联系电话</td>
-          <td>电子邮箱</td>
-        </tr>
-
-
-				{{range $i, $v := .T.data}}
-				<tr class="content">
-					<td>
-					<script>
-					document.write(index++)
-					</script>
-					</td>
-          <td>{{$v.keyword}}</td>
-          <td>{{$v.area}}</td>
-					<td>{{$v.city}}</td>
-          <td>{{$v.district}}</td>
-					<td>{{$v.title}}</td>
-          <td>{{$v.subtype}}</td>
-					<td>{{$v.detail}}</td>
-          <td>{{$v.publishtime}}</td>
-					<td>{{$v.href}}</td>
-          <td>{{$v.url}}</td>
-          <td>{{$v.projectname}}</td>
-          <td>{{$v.projectcode}}</td>
-          <td>{{$v.projectscope}}</td>
-          <td name="money">{{$v.budget}}</td>
-          <td name="money">{{$v.bidamount}}</td>
-          <td>{{$v.signendtime}}</td>
-          <td>{{$v.bidopentime}}</td>
-          <td>{{$v.bidendtime}}</td>
-          <td>{{$v.buyer}}</td>
-          <td name="name">{{$v.buyerperson}}</td>
-          <td name="phone">{{$v.buyertel}}</td>
-          <td>{{$v.buyeraddr}}</td>
-
-          <td>{{$v.agency}}</td>
-          <td>{{$v.s_winner}}</td>
-          <td name="name">{{$v.winnerperson}}</td>
-          <td name="phone">{{$v.winnertel}}</td>
-
-          <td name="name">{{$v.legal_person}}</td>
-          <td name="phone">{{$v.company_phone}}</td>
-          <td>{{$v.company_email}}</td>
-
-
-				</tr>
-				{{end}}
-			</table>
-			{{end}}
-			<div class="sy">
-			</div>
+  <body style="min-width:2020px;">
+    <div class="d_body">
+      <div class="d_bz" v-if="dataType == '1'">
+        <el-table
+          :data="getList"
+          stripe
+          style="width: 100%">
+          <el-table-column
+          v-for="(item, index) in bzInfo"
+            :key="index"
+            :width="item.width"
+            :type="index === 0 ? 'index' : undefined"
+            :prop="item.filed"
+            :label="item.title"
+            align="center"
+            >
+          </el-table-column>
+          
+        </el-table>
+      </div>
+      <div class="d_gj" v-if="dataType == '2'">
+        <el-table
+          :data="getList"
+          stripe
+          style="width: 100%">
+          <el-table-column
+          v-for="(item, index) in gjInfo"
+            :key="index"
+            :type="index === 0 ? 'index' : undefined"
+            :prop="item.filed"
+            :width="item.width"
+            :label="item.title"
+            align="center"
+            >
+            <template v-if="item.title == '采购单位信息'">
+              <el-table-column
+                prop="buyer"
+                width="82"
+                label="单位名称"
+                align="center"
+                >
+              </el-table-column>
+              <el-table-column
+                prop="s_topscopeclass"
+                width="108"
+                label="采购单位类型"
+                align="center"
+                >
+              </el-table-column>
+              <el-table-column
+                prop="buyerperson"
+                width="89"
+                label="联系人"
+                align="center"
+                >
+                <template slot-scope="scope">
+                  ${textFormatForMosaic(scope.row.buyerperson)}
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="buyertel"
+                width="143"
+                label="联系电话"
+                align="center"
+                >
+                <template slot-scope="scope">
+                  ${textFormatForMosaic(scope.row.buyertel)}
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="buyeraddr"
+                width="83"
+                label="单位地址"
+                align="center"
+                >
+              </el-table-column>
+            </template>
+            <template v-if="item.title == '中标单位信息(来源:招标公告网站)'">
+              <el-table-column
+                prop="s_winner"
+                width="154"
+                label="单位名称"
+                align="center"
+                >
+                <template slot-scope="scope">
+                  <div v-if="scope.row.winnerList && scope.row.winnerList.length">
+                    <div v-for="win in scope.row.winnerList" class="mosaic-text">
+                      ${win}<br>
+                    </div>
+                  </div>
+                  <div v-else class="mosaic-text">${scope.row.s_winner}</div>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="winnerperson"
+                width="47"
+                label="联系人"
+                align="center"
+                >
+                <template slot-scope="scope">
+                  ${textFormatForMosaic(scope.row.winnerperson)}
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="winnertel"
+                width="59"
+                label="联系电话"
+                align="center"
+                >
+                <template slot-scope="scope">
+                  ${textFormatForMosaic(scope.row.winnertel)}
+                </template>
+              </el-table-column>
+            </template>
+            <template v-if="item.title == '中标单位信息(来源:国家企业公示网站)'">
+              <el-table-column
+                prop="legal_person"
+                width="48"
+                label="联系人"
+                align="center"
+                >
+                <template slot-scope="scope">
+                  <div v-if="scope.row.personArr && scope.row.personArr.length">
+                    <div v-for="person in scope.row.personArr">
+                      ${person}<br>
+                    </div>
+                  </div>
+                  <div v-else>${scope.row.legal_person}</div>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="company_phone"
+                width="60"
+                label="联系电话"
+                align="center"
+                >
+                <template slot-scope="scope">
+                  <div v-if="scope.row.phoneArr && scope.row.phoneArr.length">
+                    <div v-for="phone in scope.row.phoneArr">
+                      ${phone}<br>
+                    </div>
+                  </div>
+                  <div v-else>${scope.row.company_phone}"></div>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="company_email"
+                width="106"
+                label="电子邮箱"
+                align="center"
+                >
+                <template slot-scope="scope">
+                  <div v-if="scope.row.emailArr && scope.row.emailArr.length">
+                    <div v-for="email in scope.row.emailArr">
+                      ${email}<br>
+                    </div>
+                  </div>
+                  <div v-else>${scope.row.company_email}"></div>
+                </template>
+              </el-table-column>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
 	</body>
 	<script>
+  var list = {{.T.data}}
+  var node = new Vue({
+    el: '.d_body',
+    delimiters: ['{', '}'],
+    data () {
+      return {
+        listInfo: list,
+        dataType: '2',
+        bzInfo: [
+          {width: '40', filed: 'index', title: '序号'},
+          {width: '70', filed: 'keyword', title: '匹配关键词'},
+          {width: '60', filed: 'area', title: '省份'},
+          {width: '60', filed: 'city', title: '城市'},
+          {width: '262', filed: 'title', title: '公告标题'},
+          {width: '60', filed: 'subtype', title: '公告类别'},
+          {width: '80', filed: 'publishtime', title: '发布时间'},
+          {width: '202', filed: 'buyer', title: '采购单位'},
+          {width: '202', filed: 's_winner', title: '中标单位'},
+          {width: '75', filed: 'bidamount', title: '中标金额'},
+          {width: '202', filed: 'projectname', title: '项目名称'},
+          {width: '484', filed: 'detail', title: '公告内容'},
+          {width: '156', filed: 'url', title: '剑鱼标讯地址'}
+        ],
+        gjInfo: [
+          {width: '40', filed: 'index', title: '序号',},
+          {width: '70', filed: 'keyword', title: '匹配关键词',},
+          {width: '50', filed: 'area', title: '省份',},
+          {width: '50', filed: 'city', title: '城市',},
+          {width: '50', filed: 'district', title: '区县',},
+          {width: '155', filed: 'title', title: '公告标题',},
+          {width: '60', filed: 'subtype', title: '公告类别',},
+          {width: '221', filed: 'detail', title: '公告内容',},
+          {width: '82', filed: 'publishtime', title: '发布时间',},
+          {width: '116', filed: 'href', title: '公告地址',},
+          {width: '123', filed: 'url', title: '剑鱼标讯地址',},
+          {width: '136', filed: 'projectname', title: '项目名称',},
+          {width: '160', filed: 'buyerclass', title: '行业',},
+          {width: '146', filed: 'projectcode', title: '项目编号',},
+          {width: '146', filed: 'projectscope', title: '项目范围',},
+          {width: '84', filed: 'budget', title: '预算金额(万元)',},
+          {width: '84', filed: 'bidamount', title: '中标金额(万元)',},
+          {width: '76', filed: 'signendtime', title: '报名截止日期',},
+          {width: '84', filed: 'bidopentime', title: '开标日期',},
+          {width: '76', filed: 'bidendtime', title: '投标截止日期',},
+          {width: '', filed: '', title: '采购单位信息',},
+          {width: '143', filed: 's_topscopeclass', title: '招标代理机构',},
+          {width: '', filed: 'buyerperson', title: '中标单位信息(来源:招标公告网站)',},
+          {width: '', filed: 'buyertel', title: '中标单位信息(来源:国家企业公示网站)',}
+        ]
+      }
+    },
+    created: function () {
+      var params = new URLSearchParams(window.location.search);
+      this.dataType = params.get('dataType')
+    },
+    computed: {
+      getList () {
+        const list = this.listInfo
+        if (list && list.length) {
+          list.forEach((v) => {
+            let persons = []
+            let phone = []
+            let email = []
+            if(v.s_winner && v.winnerMaps) {
+              if(v.s_winner.indexOf(',') !== -1) {
+                // 多个中标单位
+                v.winnerList = v.s_winner.split(',')
+                v.winnerList.forEach((m,i) => {
+                  const winnerItem = v.winnerMaps.filter(item => item.company_name == m)
+                  if(winnerItem && winnerItem.length) {
+                    persons.push(winnerItem[0].legal_person || '')
+                    phone.push(winnerItem[0].company_phone || '')
+                    email.push(winnerItem[0].company_email || '')
+                  } else {
+                    persons.push('')
+                    phone.push('')
+                    email.push('')
+                  }
+                })
+              } else {
+                // 只有一个中标单位
+                const winnerItem = v.winnerMaps.filter(item => item.company_name == v.s_winner)
+                if(winnerItem && winnerItem.length) {
+                  persons.push(winnerItem[0].legal_person || '')
+                  phone.push(winnerItem[0].company_phone || '')
+                  email.push(winnerItem[0].company_email || '')
+                }
+              }
+            }
+            if (persons && persons.length) {
+              v.personArr = persons
+            }
+            if (phone && phone.length) {
+              v.phoneArr = phone
+            }
+            if (email && email.length) {
+              v.emailArr = email
+            }
+          })
+        }
+        this.listInfo = list
+        return this.listInfo
+      }
+    },
+    methods: {
+    }
+  })
 	// 字体加载异常处理
-	try {
-		document.fonts.ready.then(function() {
-			renderImg()
-		});
-	} catch (err) {
-		console.log(err)
-	}
-	try {
-		var font = new FontFaceObserver('MyNewFont');
-		font.load().then(function () {
-			var html = document.querySelector('body');
-			html.classList.add('font-loaded');
-			renderImg()
-		}, function () {
-			console.log('Font is not available');
-		});
-	} catch (err) {
-		console.log(err)
-	}
+	// try {
+	// 	document.fonts.ready.then(function() {
+	// 		renderImg()
+	// 	});
+	// } catch (err) {
+	// 	console.log(err)
+	// }
+	// try {
+	// 	var font = new FontFaceObserver('MyNewFont');
+	// 	font.load().then(function () {
+	// 		var html = document.querySelector('body');
+	// 		html.classList.add('font-loaded');
+	// 		renderImg()
+	// 	}, function () {
+	// 		console.log('Font is not available');
+	// 	});
+	// } catch (err) {
+	// 	console.log(err)
+	// }
 	function isIE(){
 		if(!!window.ActiveXObject || "ActiveXObject" in window){
 			return true;
@@ -221,15 +353,15 @@
 		return money
 	}
 
-	$("td[name='name']").each(function () {
-		$(this).html(textFormatForMosaic($(this).text()))
-	})
-	$("td[name='phone']").each(function () {
-		$(this).html(textFormatForMosaic($(this).text(), true))
-	})
-	$("td[name='money']").each(function () {
-		$(this).html(moneyFormatForCover($(this).text()))
-	})
+	// $("td[name='name']").each(function () {
+	// 	$(this).html(textFormatForMosaic($(this).text()))
+	// })
+	// $("td[name='phone']").each(function () {
+	// 	$(this).html(textFormatForMosaic($(this).text(), true))
+	// })
+	// $("td[name='money']").each(function () {
+	// 	$(this).html(moneyFormatForCover($(this).text()))
+	// })
 
 	function renderImg () {
 		var w=$("table").width();