Jelajahi Sumber

增加关键词多选方式

wenmenghao321 2 tahun lalu
induk
melakukan
a30977c8c5

+ 111 - 1
src/jfw/modules/app/src/web/staticres/jyapp/dataExport/css/dataExport.css

@@ -307,4 +307,114 @@ html .match_way .box .box_bd .weui-check:checked + .weui-icon-checked:before {
   font-size: .36rem;
   font-size: .36rem;
   font-weight: 500;
   font-weight: 500;
   color: #2ABED1;
   color: #2ABED1;
-}
+}
+#checkbox_dialog .mask{
+  position: fixed;
+  z-index: 1000;
+  top: 0;
+  right: 0;
+  left: 0;
+  bottom: 0;
+  background: rgba(0,0,0,.6);
+}
+#checkbox_dialog .mask .box{
+  width: 100%;
+  position: absolute;
+  bottom: 0;
+  left: 0;
+  padding: 0 0.32rem 0.84rem 0.32rem;
+  box-sizing: border-box;
+  border-radius: 0.2rem 0.2rem 0 0;
+  background-color: #fff;
+}
+#checkbox_dialog .mask .box .head{
+ height: 1.28rem;
+ padding-top: 0.44rem;
+ box-sizing: border-box;
+}
+#checkbox_dialog .head p{
+font-size: 0.4rem;
+font-weight: 500;
+color: #171826;
+float: left;
+}
+#checkbox_dialog .head img{
+  float: right;
+  width: 0.4rem;
+  margin-top: 0.1rem;
+}
+#checkbox_dialog .content .item{
+  width: 100%;
+  height: 0.88rem;
+
+}
+#checkbox_dialog .content .item p{
+font-size: 0.28rem;
+line-height: 0.88rem;
+font-weight: 500;
+color: #5F5E64;
+float: left;
+}
+#checkbox_dialog .content .item .check,.nocheck{
+  display: inline-block;
+    vertical-align: middle;
+    font: normal normal normal 14px/1 weui;
+    font-size: inherit;
+    text-rendering: auto;
+    -webkit-font-smoothing: antialiased;
+    float: right;
+    margin-top: 0.2rem;
+}
+#checkbox_dialog .content .item .nocheck::before{
+  content: "\EA01";
+  color: rgba(0,0,0,.3);
+  font-size: 0.48rem;
+  display: block;
+  margin: 0;
+  
+}
+#checkbox_dialog .content .item .check::before{
+  color: #2CB7CA;
+  content: "\EA06";
+  font-size: 0.48rem;
+  display: block;
+  margin: 0;
+  
+}
+#checkbox_dialog .content .item .active_{
+  color: #2ABED1 !important;
+}
+#checkbox_dialog .foot{
+  width: 100%;
+  height: 1rem;
+
+}
+#checkbox_dialog .foot .reset_btn{
+  width: 3.3rem;
+height: 0.8rem;
+background: #EDEFF2;
+border-radius: 0.08rem;
+text-align: center;
+line-height: 0.8rem;
+font-size: 0.32rem;
+font-family: PingFang SC-Medium, PingFang SC;
+font-weight: 500;
+color: #5F5E64;
+float: left;
+margin-top: 0.2rem;
+}
+#checkbox_dialog .foot .ok_btn{
+  width: 3.3rem;
+height: 0.8rem;
+background: #2ABED1;
+border-radius: 0.08rem;
+text-align: center;
+line-height: 0.8rem;
+font-size: 0.32rem;
+font-family: PingFang SC-Medium, PingFang SC;
+font-weight: 500;
+color: #F7F9FA;
+float: right;
+margin-top: 0.2rem;
+
+}

+ 177 - 24
src/jfw/modules/app/src/web/templates/dataExport/dataExport.html

@@ -22,6 +22,7 @@
   <link rel="stylesheet" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/swiper.min.css">
   <link rel="stylesheet" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/swiper.min.css">
   <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/swiper.min.js"></script>
   <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/swiper.min.js"></script>
     <script src="https://cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js"></script>
     <script src="https://cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js"></script>
+    <script src="//cdn-common.jianyu360.com/cdn/lib/vue/2.6.14/vue.min.js"></script>
     <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/weui.min.js"></script>
     <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/weui.min.js"></script>
     {{include "/common/js.html"}}
     {{include "/common/js.html"}}
 </head>
 </head>
@@ -298,7 +299,7 @@
                             </a></li>
                             </a></li>
                         <li><a href="JavaScript:;">
                         <li><a href="JavaScript:;">
                                 <strong style="width: 2.2rem;">关键词匹配方式</strong>
                                 <strong style="width: 2.2rem;">关键词匹配方式</strong>
-                                <span style="width: 4rem;" class="match">标题匹配</span>
+                                <span style="width: 4rem;" class="match">标题</span>
                                 <i class="iconfont icon-arrow"></i>
                                 <i class="iconfont icon-arrow"></i>
                             </a></li>
                             </a></li>
                         <li><a href="/jyapp/front/dataExport/price">
                         <li><a href="/jyapp/front/dataExport/price">
@@ -451,6 +452,22 @@
                 </div>
                 </div>
             </div>
             </div>
         </div>
         </div>
+        <!-- 多选弹框 -->
+        <div id="checkbox_dialog">
+            <div class="mask" v-show="dialog_show">
+                <div class="box">
+                    <div class="head"><p>关键词匹配方式</p><img src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/dataExport/images/icon_delete_gray@2x.png?v={{Msg "seo" "version"}}" alt="" @click.stop="dialog_show=false"></div>
+                    <div class="content">
+                        <div class="item" v-for="(item,index) in list"><p :class="{'active':item.val}">{item.name}</p><i :class="item.val?'check':'nocheck'" @click.stop="choose(item,index)"></i></div>
+                    </div>
+                    <div class="foot">
+                        <div class="reset_btn" @click.stop="reset">重置</div>
+                        <div class="ok_btn" @click.stop="ok">确认</div>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <!-- 弹框结束 -->
     </div>
     </div>
 </div>
 </div>
 <script>
 <script>
@@ -493,14 +510,17 @@
         var scrollTop = 0;
         var scrollTop = 0;
         //
         //
         $('.match').click(function () {
         $('.match').click(function () {
-            $('.match_way').slideDown('slow');
-            var selectType = $(this).text();
-            $(".read").each(function () {
-                var p = $(this).children().text();
-                if (p === selectType) {
-                    $(this).next().find("input:radio").prop("checked", true);
-                }
-            });
+            //单选原有逻辑
+            // $('.match_way').slideDown('slow');
+            // var selectType = $(this).text();
+            // $(".read").each(function () {
+            //     var p = $(this).children().text();
+            //     if (p === selectType) {
+            //         $(this).next().find("input:radio").prop("checked", true);
+            //     }
+            // });
+           var selectType = $(this).text();
+           checkboxVm.open_(selectType)
         });
         });
         /* 选择匹配方式*/
         /* 选择匹配方式*/
         $('input:radio[name="way"]').click(function () {
         $('input:radio[name="way"]').click(function () {
@@ -761,13 +781,13 @@
         //关键词选择方式
         //关键词选择方式
         if (localStorage.export_selectType !== "" && localStorage.export_selectType !== undefined) {
         if (localStorage.export_selectType !== "" && localStorage.export_selectType !== undefined) {
             var selectType = localStorage.export_selectType;
             var selectType = localStorage.export_selectType;
-            var type = "";
-            if (selectType === "title") {
-                type = "按标题匹配";
-            } else if (selectType === "all") {
-                type = "按全文匹配";
-            }
-            $(".match").text(type);
+            // var type = "";
+            // if (selectType === "title") {
+            //     type = "按标题匹配";
+            // } else if (selectType === "all") {
+            //     type = "按全文匹配";
+            // }
+            $(".match").text(selectType);
             $(".confirm").hide();
             $(".confirm").hide();
             $(".resetOne").css('display', 'flex');
             $(".resetOne").css('display', 'flex');
         }
         }
@@ -1104,15 +1124,63 @@
                 winner = localStorage.winner;
                 winner = localStorage.winner;
             }
             }
             if (localStorage.export_selectType !== undefined && localStorage.export_selectType !== "") {
             if (localStorage.export_selectType !== undefined && localStorage.export_selectType !== "") {
-                selectType = localStorage.export_selectType;
+                // selectType = localStorage.export_selectType
+                var selectType_str = localStorage.export_selectType;
+                var selectType_list =selectType_str.split(',');
+                var new_selectType_list = [];
+                selectType_list.forEach(function(ele){
+                    if(ele=='标题'){
+                        new_selectType_list.push('title')
+                    }
+                    if(ele=='正文'){
+                       
+                        new_selectType_list.push('all')
+                    }
+
+                     if(ele=='附件'){
+                        new_selectType_list.push('accessory')
+
+                    }
+                    if(ele=='项目名称/标的物'){
+                        new_selectType_list.push('subject')
+
+                    }
+
+                })
+                selectType = new_selectType_list.join(',')
+
             } else {
             } else {
+                // var type = $(".match").text();
+                // if (type === "按标题匹配") {
+                //     selectType = "title";
+                // } else if (type === "按全文匹配") {
+                //     selectType = "all";
+                // }
+                // localStorage.export_selectType = selectType;
                 var type = $(".match").text();
                 var type = $(".match").text();
-                if (type === "按标题匹配") {
-                    selectType = "title";
-                } else if (type === "按全文匹配") {
-                    selectType = "all";
-                }
-                localStorage.export_selectType = selectType;
+                localStorage.export_selectType = type;   
+                var selectType_list =type.split(',');
+                var new_selectType_list = [];
+                selectType_list.forEach(function(ele){
+                    if(ele=='标题'){
+                        new_selectType_list.push('title')
+                    }
+                    if(ele=='正文'){
+                       
+                        new_selectType_list.push('all')
+                    }
+
+                     if(ele=='附件'){
+                        new_selectType_list.push('accessory')
+
+                    }
+                    if(ele=='项目名称/标的物'){
+                        new_selectType_list.push('subject')
+
+                    }
+
+                })
+                selectType = new_selectType_list.join(',')
             }
             }
             if (localStorage.comeinfrom !== undefined && localStorage.comeinfrom !== "") {
             if (localStorage.comeinfrom !== undefined && localStorage.comeinfrom !== "") {
                 comeinfrom = localStorage.comeinfrom;
                 comeinfrom = localStorage.comeinfrom;
@@ -1185,7 +1253,7 @@
             $("#subType").text("");
             $("#subType").text("");
             $("#winner").text("");
             $("#winner").text("");
             $("#buyer").text("");
             $("#buyer").text("");
-            $(".match").text("标题匹配");
+            $(".match").text("标题");
             //
             //
             $(".chooseTime ul li").removeClass('active');
             $(".chooseTime ul li").removeClass('active');
             $(".chooseTime ul li:eq(0)").addClass('active');
             $(".chooseTime ul li:eq(0)").addClass('active');
@@ -1275,6 +1343,91 @@
             n = n.toString();
             n = n.toString();
             return n[1] ? n : '0' + n
             return n[1] ? n : '0' + n
         }
         }
+
+        var checkboxVm=new Vue({
+        el: '#checkbox_dialog',
+        delimiters: ['{', '}'],
+        data: function () {
+            return {
+                dialog_show:false,
+                list:[
+                    {name:'标题',val:true},
+                    {name:'正文',val:false},
+                    {name:'附件',val:false},
+                    {name:'项目名称/标的物',val:false}
+                ]
+            }
+        },
+        created() {
+     
+        },
+        mounted() {
+        },
+        methods: {
+            open_(str){
+                this.list=[
+                    {name:'标题',val:true},
+                    {name:'正文',val:false},
+                    {name:'附件',val:false},
+                    {name:'项目名称/标的物',val:false}
+                ]
+                let this_=this
+                let list =str.split(',')
+                list.forEach(function(ele){
+                    if(ele=='标题'){
+                        this_.list[0].val=true
+                    }
+                    if(ele=='正文'){
+                       
+                        this_.list[1].val=true
+                    }
+
+                     if(ele=='附件'){
+                        this_.list[2].val=true
+
+                    }
+                    if(ele=='项目名称/标的物'){
+                        this_.list[3].val=true
+
+                    }
+                })
+                this.dialog_show=true
+            },
+            choose(item){
+                if(item.name=='标题'){
+                    return
+                }
+                item.val=!item.val
+            },
+            reset(){
+                this.list=[
+                    {name:'标题',val:true},
+                    {name:'正文',val:false},
+                    {name:'附件',val:false},
+                    {name:'项目名称/标的物',val:false}
+                ]
+            },
+            ok(){
+                let list =this.list
+                let choose=[]
+                list.forEach(function(ele) {
+                    if(ele.val){
+                        choose.push(ele.name)
+                    }  
+                });
+                let choose_str=choose.join(',')
+                console.log(choose_str)
+                if(choose_str!=='标题'){
+                    $(".confirm").hide();
+                    $(".resetOne").css('display', 'flex');
+                }
+                $('.match').html(choose_str);
+                localStorage.export_selectType = choose_str;
+                this.dialog_show=false
+            }
+    
+        }
+      })
     })
     })
 </script>
 </script>