Browse Source

feat:页面合并

wangxiaogang 3 years ago
parent
commit
05c4e89f88

+ 1 - 1
src/api/modules/potential.js

@@ -83,4 +83,4 @@ export function custAttention (data) {
     method: 'POST',
     data
   })
-}
+}

+ 35 - 37
src/components/common/Popper.vue

@@ -18,12 +18,12 @@
 
 <script>
 export default {
-  data() {
+  data () {
     return {
       datas: []
     }
   },
-  mounted() {
+  mounted () {
     this.initCollectEvent()
   },
   methods: {
@@ -39,10 +39,11 @@ export default {
         $('.custom-toast').fadeOut().remove()
       }, duration)
     },
-    tagsShow(data) {
+    tagsShow (data) {
       this.datas = data.data
       var top = data.liHeight * (data.i + 1) + 'px'
       if (data.show) {
+        // baiduEvent('列表页认领') // 百度统计代码
         $('.tags-box').slideToggle(function () {
           window.activeTags = []
           $('.tag-labels').empty()
@@ -54,7 +55,6 @@ export default {
           right: 0
         })
       }
-      
     },
     initCollectEvent () {
       const _this = this
@@ -75,7 +75,7 @@ export default {
       // 标签输入框回车事件
       $('.tag-input .clear-input').keydown(function (event) {
         event.stopPropagation()
-        if (event.keyCode == 13) {
+        if (event.keyCode === 13) {
           if (!$('.tags-box').is(':hidden')) {
             $('.tags-inputs .add-tag-button').trigger('click')
           }
@@ -83,7 +83,7 @@ export default {
       })
       // 标签输入框失去焦点事件
       $('.tag-input .clear-input').blur(function () {
-        if ($('.tag-labels').children().length == 0 && $(this).val() == '') {
+        if ($('.tag-labels').children().length === 0 && $(this).val() === '') {
           $('.tag-placeholder').show()
         }
       })
@@ -102,10 +102,10 @@ export default {
           var lname = ''
           $('.tags-item.tags-active').each(function () {
             if ($(this).attr('data-id')) {
-              if (lids != '') {
+              if (lids !== '') {
                 lids += ','
               }
-              if (lname != '') {
+              if (lname !== '') {
                 lname += ','
               }
               lids += $(this).attr('data-id')
@@ -119,18 +119,16 @@ export default {
             label: lids
           }
           // 执行保存绑定标签操作
-          // if (params.label !== '') {
-            saveChooseTags(params, function () {
-              $('.tags-footer .button-cancel').trigger('click')
-            })
-          // }
+          saveChooseTags(params, function () {
+            $('.tags-footer .button-cancel').trigger('click')
+          })
         }
       })
 
       $('.tags-footer .button-cancel').on('click', function () {
         $('.tags-box').slideToggle(function () {
           // 标签弹框消失时 清除上次选择的标签分类
-          activeTags = []
+          window.activeTags = []
           $('.tag-labels').empty()
           $('.clear-input').val('')
           $('.tags-list').find('.tags-item').removeClass('tags-active')
@@ -143,7 +141,7 @@ export default {
       function deleteInputTag (item) {
         var index = $(item).parent().attr('data-index')
         var id = $(item).parent().attr('data-id')
-        activeTags.splice(index, 1)
+        window.activeTags.splice(index, 1)
         inputTagList()
         $('.tags-item[data-id="' + id + '"]').removeClass('tags-active')
       }
@@ -153,7 +151,7 @@ export default {
       function inputTagList () {
         var ht = ''
         $('.tag-labels').html(ht)
-        activeTags.forEach(function (v, i) {
+        window.activeTags.forEach(function (v, i) {
           ht += '<span class="tag-label" data-index=' + i + ' data-id="' + v.lid + '">'
           ht += '<em>' + v.lname + '</em>'
           ht += '<i class="tag-close" onclick="deleteInputTag(this)"></i>'
@@ -174,7 +172,7 @@ export default {
             ht += '<span class="tags-item" data-count=' + v.count + ' data-id=' + v.lid + '>' + v.lanme + '</span>'
           })
           $('.tags-list').html(ht)
-          activeTags.forEach(function (s, j) {
+          window.activeTags.forEach(function (s, j) {
             $('.tags-list .tags-item[data-id="' + s.lid + '"]').addClass('tags-active')
           })
           $('.tags-item').click(function (e) {
@@ -184,17 +182,17 @@ export default {
             var name = $(this).text()
             $(this).toggleClass('tags-active')
             if ($(this).hasClass('tags-active')) {
-              activeTags.push({
+              window.activeTags.push({
                 lid: id,
                 lname: name
               })
               inputTagList()
             } else {
-              var newArr = activeTags.filter(function (item) {
-                return item.lid != id
+              var newArr = window.activeTags.filter(function (item) {
+                return item.lid !== id
               })
-              activeTags = newArr
-              console.log(activeTags, newArr, 'quxiao')
+              window.activeTags = newArr
+              console.log(window.activeTags, newArr, 'quxiao')
               inputTagList()
             }
           })
@@ -208,7 +206,7 @@ export default {
           type: 'post',
           url: '/entnicheNew/customer/getLabel?t=' + Date.now(),
           success: function (r) {
-            if (r.error_code == 0 && $.isArray(r.data)) {
+            if (r.error_code === 0 && $.isArray(r.data)) {
               renderTagsList(r.data.reverse())
             }
           }
@@ -225,7 +223,7 @@ export default {
           data: JSON.stringify(params),
           dataType: 'json',
           success: function (r) {
-            if (r.error_code == 0 && r.data) {
+            if (r.error_code === 0 && r.data) {
               _this.$toast('认领成功!')
               _this.$emit('getClientList', true)
               callback && callback()
@@ -251,8 +249,8 @@ export default {
             if (r.data) {
               $('.tag-input .clear-input').val('')
               // 添加标签成功后 绑定标签
-              if (activeTags.length < 3) {
-                activeTags.push({
+              if (window.activeTags.length < 3) {
+                window.activeTags.push({
                   lid: r.data,
                   lname: name
                 })
@@ -267,7 +265,7 @@ export default {
       }
 
       function checkTagDisabled () {
-        if (activeTags.length >= 3) {
+        if (window.activeTags.length >= 3) {
           // 禁用标签
           $('.tags-list').find('.tags-item:not(.tags-active)').addClass('disabled')
         } else {
@@ -276,16 +274,16 @@ export default {
         }
       }
 
-      function baiduEvent (str) {
-        try {
-          // eslint-disable-next-line no-undef
-          _hmt.push(['_trackEvent', '大会员-pc', 'click', str])
-        } catch (e) {
-          console.log('未初始化百度统计')
-        }
-      }
+      // function baiduEvent (str) {
+      //   try {
+      //     // eslint-disable-next-line no-undef
+      //     _hmt.push(['_trackEvent', '大会员-pc', 'click', str])
+      //   } catch (e) {
+      //     console.log('未初始化百度统计')
+      //   }
+      // }
       getUserTags()
-    },
+    }
   }
 }
 </script>
@@ -488,4 +486,4 @@ export default {
   transform: translateX(-50%) translateY(-50%);
   z-index: 99;
 }
-</style>
+</style>

+ 1 - 1
src/components/common/Tips.vue

@@ -59,4 +59,4 @@ export default {
     background: rgba(44,183,202,0.10);
   }
 }
-</style>
+</style>

+ 3 - 3
src/components/work-desktop/MessageTips.vue

@@ -61,9 +61,9 @@ export default {
         },
         success: function () {
           // if (url) {
-            _this.aHref('/swordfish/frontPage/messageCenter/sess/index')
+          _this.aHref('/swordfish/frontPage/messageCenter/sess/index')
           // } else {
-            // _this.messageList()
+          // _this.messageList()
           // }
         }
       })
@@ -73,7 +73,7 @@ export default {
         this.readed(item.id, item.msg_type, item.link)
       } else {
         // if (item.link) {
-          this.aHref('/swordfish/frontPage/messageCenter/sess/index')
+        this.aHref('/swordfish/frontPage/messageCenter/sess/index')
         // }
       }
     },

+ 6 - 6
src/views/ent-intel/MyClient.vue

@@ -132,9 +132,9 @@ export default {
       },
       isRen: 999,
       renData: [
-        {v: 999, n: '全部'},
-        {v: 1, n: '已认领'},
-        {v: 0, n: '未认领'}
+        { v: 999, n: '全部' },
+        { v: 1, n: '已认领' },
+        { v: 0, n: '未认领' }
       ]
     }
   },
@@ -208,13 +208,13 @@ export default {
       })
     },
     // 是否认领企业
-    claimcheck(name, arrs) {
+    claimcheck (name, arrs) {
       claimchecked({
         names: name
       }).then(res => {
         if (res.error_code === 0 && res.data) {
           arrs.forEach(v => {
-            let renName = res.data.names.join(',')
+            const renName = res.data.names.join(',')
             if (renName.indexOf(v.name) > -1) {
               v.claim1 = true
             } else {
@@ -287,7 +287,7 @@ export default {
           D: true,
           label: ''
         }).then(res => {
-          if (res.error_code == 0 && res.data) {
+          if (res.error_code === 0 && res.data) {
             this.getClientList()
             this.$toast('取消认领成功!')
           } else {

+ 30 - 30
vue.config.js

@@ -80,7 +80,7 @@ module.exports = {
     },
     headers: {
       'Access-Control-Allow-Origin': '*'
-    },
+    }
     // proxy: getProxyOfDomain('https://web2-jytest.jydev.jianyu360.com') || getProxyOfIp('http://127.0.0.1')
   },
   css: {
@@ -93,33 +93,33 @@ module.exports = {
   chainWebpack: config => {
     // single-spa
     if (!process.env.VUE_APP_ALONE) {
-
+      
       if (process.env.NODE_ENV === 'production') {
-          // 生产环境配置
-          // config.externals(external)
-          // config.plugin('html').tap(args => {
-          //   // html中添加cdn
-          //   args[0].cdn = cdn
-          //   return args
-          // })
-          // config.output.filename('./js/[name].[chunkhash:8].js')
-          config.output.filename = function (pathData) {
-            return pathData.chunk.name === 'app' ? './js/[name].js' : './js/[name].[chunkhash:8].js';
-          };
-          config.output.chunkFilename('./js/[name].[chunkhash:8].js');
-          // config.output.chunkFilename = function (pathData) {
-          //   console.log(JSON.stringify(pathData.chunk), '11')
-          //   return pathData.chunk.name === 'app' ? './js/[name].js' : './js/[name].[chunkhash:8].js';
-          // };
+        // 生产环境配置
+        // config.externals(external)
+        // config.plugin('html').tap(args => {
+        //   // html中添加cdn
+        //   args[0].cdn = cdn
+        //   return args
+        // })
+        // config.output.filename('./js/[name].[chunkhash:8].js')
+        config.output.filename = function (pathData) {
+          return pathData.chunk.name === 'app' ? './js/[name].js' : './js/[name].[chunkhash:8].js'
+        }
+        config.output.chunkFilename('./js/[name].[chunkhash:8].js')
+        // config.output.chunkFilename = function (pathData) {
+        //   console.log(JSON.stringify(pathData.chunk), '11')
+        //   return pathData.chunk.name === 'app' ? './js/[name].js' : './js/[name].[chunkhash:8].js';
+        // };
 
-          config.optimization.minimize(true)
-            .minimizer('terser')
-            .tap(args => {
-              let { terserOptions } = args[0];
-              terserOptions.compress.drop_console = true;
-              terserOptions.compress.drop_debugger = true;
-              return args
-            });
+        config.optimization.minimize(true)
+          .minimizer('terser')
+          .tap(args => {
+            const { terserOptions } = args[0]
+            terserOptions.compress.drop_console = true
+            terserOptions.compress.drop_debugger = true
+            return args
+          })
       } else {
         config.devServer.set('inline', false)
         config.devServer.set('hot', true)
@@ -137,10 +137,10 @@ module.exports = {
   filenameHashing: false,
   configureWebpack: {
     plugins: [
-        new webpack.ProvidePlugin({
-            jQuery: 'jquery',
-            $: 'jquery'
-        })
+      new webpack.ProvidePlugin({
+        jQuery: 'jquery',
+        $: 'jquery'
+      })
     ]
   }
 }