Browse Source

基础组件更新,增加图标,完善组件列表数据,优化逻辑

李文 4 years ago
parent
commit
0e17e7b2ed
66 changed files with 267 additions and 77 deletions
  1. BIN
      src/assets/img/jczj/icon-apiwg.png
  2. BIN
      src/assets/img/jczj/icon-bzdlys.png
  3. BIN
      src/assets/img/jczj/icon-bzdxsj.png
  4. BIN
      src/assets/img/jczj/icon-bzqxyx.png
  5. BIN
      src/assets/img/jczj/icon-bzslwp.png
  6. BIN
      src/assets/img/jczj/icon-bzswmx.png
  7. BIN
      src/assets/img/jczj/icon-bzyxsj.png
  8. BIN
      src/assets/img/jczj/icon-clda.png
  9. BIN
      src/assets/img/jczj/icon-czrz.png
  10. BIN
      src/assets/img/jczj/icon-dawh.png
  11. BIN
      src/assets/img/jczj/icon-dazdy.png
  12. BIN
      src/assets/img/jczj/icon-dddlfw.png
  13. BIN
      src/assets/img/jczj/icon-dpda.png
  14. BIN
      src/assets/img/jczj/icon-dwjx.png
  15. BIN
      src/assets/img/jczj/icon-fbsyykf.png
  16. BIN
      src/assets/img/jczj/icon-ffdy.png
  17. BIN
      src/assets/img/jczj/icon-fzfw.png
  18. BIN
      src/assets/img/jczj/icon-jrclyq.png
  19. BIN
      src/assets/img/jczj/icon-jsmxkj.png
  20. BIN
      src/assets/img/jczj/icon-kshfxtyxt.png
  21. BIN
      src/assets/img/jczj/icon-lcbdfw.png
  22. BIN
      src/assets/img/jczj/icon-ljskf.png
  23. BIN
      src/assets/img/jczj/icon-mxgl.png
  24. BIN
      src/assets/img/jczj/icon-qjdlxx.png
  25. BIN
      src/assets/img/jczj/icon-qyda.png
  26. BIN
      src/assets/img/jczj/icon-ryda.png
  27. BIN
      src/assets/img/jczj/icon-sjda.png
  28. BIN
      src/assets/img/jczj/icon-sjgd.png
  29. BIN
      src/assets/img/jczj/icon-sjkshfw.png
  30. BIN
      src/assets/img/jczj/icon-sjmf.png
  31. BIN
      src/assets/img/jczj/icon-sjzz.png
  32. BIN
      src/assets/img/jczj/icon-snwyth.png
  33. BIN
      src/assets/img/jczj/icon-sslxr.png
  34. BIN
      src/assets/img/jczj/icon-swdcxr.png
  35. BIN
      src/assets/img/jczj/icon-swdxfx.png
  36. BIN
      src/assets/img/jczj/icon-swsjct.png
  37. BIN
      src/assets/img/jczj/icon-swsjjz.png
  38. BIN
      src/assets/img/jczj/icon-swtxmn.png
  39. BIN
      src/assets/img/jczj/icon-tyqxrz.png
  40. BIN
      src/assets/img/jczj/icon-tysjfw.png
  41. BIN
      src/assets/img/jczj/icon-tyyhfw.png
  42. BIN
      src/assets/img/jczj/icon-wbfx.png
  43. BIN
      src/assets/img/jczj/icon-wfs.png
  44. BIN
      src/assets/img/jczj/icon-wms.png
  45. BIN
      src/assets/img/jczj/icon-wmts.png
  46. BIN
      src/assets/img/jczj/icon-xtrz.png
  47. BIN
      src/assets/img/jczj/icon-xtxtgj.png
  48. BIN
      src/assets/img/jczj/icon-xxdl.png
  49. BIN
      src/assets/img/jczj/icon-ycrz.png
  50. BIN
      src/assets/img/jczj/icon-yhjsgl.png
  51. BIN
      src/assets/img/jczj/icon-yhqxgl.png
  52. BIN
      src/assets/img/jczj/icon-yhrz.png
  53. BIN
      src/assets/img/jczj/icon-yhxxrz.png
  54. BIN
      src/assets/img/jczj/icon-yzsff.png
  55. BIN
      src/assets/img/jczj/icon-zhxss.png
  56. BIN
      src/assets/img/jczj/icon-znbq.png
  57. BIN
      src/assets/img/jczj/icon-znsb.png
  58. BIN
      src/assets/img/jczj/icon-zstp.png
  59. BIN
      src/assets/img/jczj/icon-zxfb.png
  60. BIN
      src/assets/img/jczj/icon-zzjgrz.png
  61. 34 3
      src/assets/scss/smp.scss
  62. 12 2
      src/router/index.js
  63. 1 3
      src/views/main/main-content.vue
  64. 152 60
      src/views/modules/demo/basicComponent/basic-com.vue
  65. 33 5
      src/views/modules/demo/basicComponent/com-third-menu.vue
  66. 35 4
      src/views/modules/demo/basicComponent/pubuliu.vue

BIN
src/assets/img/jczj/icon-apiwg.png


BIN
src/assets/img/jczj/icon-bzdlys.png


BIN
src/assets/img/jczj/icon-bzdxsj.png


BIN
src/assets/img/jczj/icon-bzqxyx.png


BIN
src/assets/img/jczj/icon-bzslwp.png


BIN
src/assets/img/jczj/icon-bzswmx.png


BIN
src/assets/img/jczj/icon-bzyxsj.png


BIN
src/assets/img/jczj/icon-clda.png


BIN
src/assets/img/jczj/icon-czrz.png


BIN
src/assets/img/jczj/icon-dawh.png


BIN
src/assets/img/jczj/icon-dazdy.png


BIN
src/assets/img/jczj/icon-dddlfw.png


BIN
src/assets/img/jczj/icon-dpda.png


BIN
src/assets/img/jczj/icon-dwjx.png


BIN
src/assets/img/jczj/icon-fbsyykf.png


BIN
src/assets/img/jczj/icon-ffdy.png


BIN
src/assets/img/jczj/icon-fzfw.png


BIN
src/assets/img/jczj/icon-jrclyq.png


BIN
src/assets/img/jczj/icon-jsmxkj.png


BIN
src/assets/img/jczj/icon-kshfxtyxt.png


BIN
src/assets/img/jczj/icon-lcbdfw.png


BIN
src/assets/img/jczj/icon-ljskf.png


BIN
src/assets/img/jczj/icon-mxgl.png


BIN
src/assets/img/jczj/icon-qjdlxx.png


BIN
src/assets/img/jczj/icon-qyda.png


BIN
src/assets/img/jczj/icon-ryda.png


BIN
src/assets/img/jczj/icon-sjda.png


BIN
src/assets/img/jczj/icon-sjgd.png


BIN
src/assets/img/jczj/icon-sjkshfw.png


BIN
src/assets/img/jczj/icon-sjmf.png


BIN
src/assets/img/jczj/icon-sjzz.png


BIN
src/assets/img/jczj/icon-snwyth.png


BIN
src/assets/img/jczj/icon-sslxr.png


BIN
src/assets/img/jczj/icon-swdcxr.png


BIN
src/assets/img/jczj/icon-swdxfx.png


BIN
src/assets/img/jczj/icon-swsjct.png


BIN
src/assets/img/jczj/icon-swsjjz.png


BIN
src/assets/img/jczj/icon-swtxmn.png


BIN
src/assets/img/jczj/icon-tyqxrz.png


BIN
src/assets/img/jczj/icon-tysjfw.png


BIN
src/assets/img/jczj/icon-tyyhfw.png


BIN
src/assets/img/jczj/icon-wbfx.png


BIN
src/assets/img/jczj/icon-wfs.png


BIN
src/assets/img/jczj/icon-wms.png


BIN
src/assets/img/jczj/icon-wmts.png


BIN
src/assets/img/jczj/icon-xtrz.png


BIN
src/assets/img/jczj/icon-xtxtgj.png


BIN
src/assets/img/jczj/icon-xxdl.png


BIN
src/assets/img/jczj/icon-ycrz.png


BIN
src/assets/img/jczj/icon-yhjsgl.png


BIN
src/assets/img/jczj/icon-yhqxgl.png


BIN
src/assets/img/jczj/icon-yhrz.png


BIN
src/assets/img/jczj/icon-yhxxrz.png


BIN
src/assets/img/jczj/icon-yzsff.png


BIN
src/assets/img/jczj/icon-zhxss.png


BIN
src/assets/img/jczj/icon-znbq.png


BIN
src/assets/img/jczj/icon-znsb.png


BIN
src/assets/img/jczj/icon-zstp.png


BIN
src/assets/img/jczj/icon-zxfb.png


BIN
src/assets/img/jczj/icon-zzjgrz.png


+ 34 - 3
src/assets/scss/smp.scss

@@ -1835,17 +1835,30 @@ html,body{
     padding:0;
   }
   .csm-item{
-    background-color: #f00;
+    background-color: #fafafa;
+    // background-color: #ff0;
     @include smp-radius-normal();
     height:68px;
     display: flex;
     align-items: center;
     cursor: pointer;
+    position:relative;
+    a{
+      text-decoration: none;
+    }
+    .el-icon-arrow-right{
+      position: absolute;
+      width:12px!important;
+      height:12px;
+      font-size:12px;
+      top:28px;
+      right:0px;
+    }
     .csm-icon{
       width:38px;
       height:38px;
       border-radius:100px;
-      background-color: #ff0;
+      // background-color: #ff0;
       flex-shrink: 0;
       margin:0 6.25% 0 9.375%;
     }
@@ -1857,12 +1870,16 @@ html,body{
       max-height:60px;
       overflow:hidden;
       padding:0 8% 0 0;
-      white-space:pre-wrap;
+      // word-wrap: break-all;
+      word-break: break-all;
+      white-space: pre-wrap;
+      
     }
   }
 }
 .csm-zk-menu{
   width:auto!important;
+  border-right:none;
   .el-submenu__title{
     padding:0!important;
     height:auto;
@@ -1876,7 +1893,21 @@ html,body{
     font-size:30px;
     padding:0 5px 0 8px;
   }
+  .menuItemA{
+    flex:1;
+    text-decoration: none;
+    display: flex;
+    align-items: center;
+  }
 }
+$list: apiwg bzdlys bzdxsj bzqxyx bzslwp bzswmx bzyxsj clda czrz dawh dazdy dddlfw dpda dwjx fbsyykf ffdy fzfw jrclyq jsmxkj kshfxtyxt lcbdfw ljskf mxgl qjdlxx qyda ryda sjda sjgd sjkshfw sjmf sjzz snwyth sslxr swdcxr swdxfx swsjct swsjjz swtxmn tyqxrz tysjfw wbfx wfs wms wmts xtrz xtxtgj xxdl ycrz yhjsgl yhqxgl yhrz yhxxrz yzsff zhxss znbq znsb zstp zxfb zzjgrz tyyhfw; //$list 就是一个列表
+@each $name in $list {
+    .jczj-icon-#{$name} {
+        background: url("~@/assets/img/jczj/icon-#{$name}.png") no-repeat 0 0;
+        background-size: 100% 100%;
+    }
+}
+
 
 // 通知列表
 .notice-pop{

+ 12 - 2
src/router/index.js

@@ -68,8 +68,8 @@ router.beforeEach((to, from, next) => {
       Vue.prototype.$message.error(res.msg)
       return next({name: 'login'})
     }
-    let firstPath = getParent(res.list)
-    console.log(res.list, firstPath)
+    let toObj = findPathInHttpMenu(to, res.list)
+    let firstPath = toObj ? toObj.path : getParent(res.list)
     // console.log(firstPath)
     // if (!firstPath) {
     //   let homePage = {
@@ -93,6 +93,16 @@ router.beforeEach((to, from, next) => {
   })
 })
 
+function findPathInHttpMenu (to, list) {
+  let obj = ''
+  list.forEach((e) => {
+    if ('/' + e.path === to.path) {
+      obj = e
+    }
+  })
+  return obj
+}
+
 function getParent (list) {
   let arr = list.filter((e) => {
     if (!e.path) {

+ 1 - 3
src/views/main/main-content.vue

@@ -1,9 +1,7 @@
 <template>
   <main class="smp-content" :class="{'isIframe':isIframe}">
     <iframe v-if="isIframe" :src="iframeURL" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>
-    <keep-alive v-else>
-      <router-view />
-    </keep-alive>
+    <router-view v-else />
   </main>
 </template>
 

File diff suppressed because it is too large
+ 152 - 60
src/views/modules/demo/basicComponent/basic-com.vue


+ 33 - 5
src/views/modules/demo/basicComponent/com-third-menu.vue

@@ -3,8 +3,9 @@
     <template slot="title">
       <template v-if="menuItem.lv===1" class="cs">
         <div class="csm-item">
-          <i class="csm-icon"></i>
+          <i class="csm-icon" :class="menuItem.icon"></i>
           <div class="csm-name" :title="menuItem.name">{{menuItem.name}}</div>
+          <i class="el-icon-arrow-right"></i>
         </div>
       </template>
       <template v-if="menuItem.lv>=2">
@@ -16,18 +17,22 @@
     </template>
     <com-thirdmenu v-for="item in menuItem.children" :key="item.id+'sub'" :menuItem="item"></com-thirdmenu>
   </el-submenu>
-  <el-menu-item v-else :index="menuItem.id+'sub'" @click="gotoRouteHandle(menuItem)">
+  <el-menu-item v-else :index="menuItem.id+'sub'">
     <template v-if="menuItem.lv===1">
       <div class="csm-item">
-        <i class="csm-icon"></i>
-        <div class="csm-name" :title="menuItem.name">{{menuItem.name}}</div>
+        <a class="menuItemA" :href="getHref(menuItem)" :target="getTarget(menuItem)">
+          <i class="csm-icon" :class="menuItem.icon"></i>
+          <div class="csm-name" :title="menuItem.name">{{menuItem.name}}</div>
+        </a>
       </div>
     </template>
     <template v-if="menuItem.lv>=2">
+      <a class="menuItemA" :href="getHref(menuItem)" :target="getTarget(menuItem)">
       <em class="csm-point">&middot;</em>
       <span class="csm-sec-name" :title=" menuItem.name">
         {{ menuItem.name }}
       </span>
+      </a>
     </template>
   </el-menu-item>
 </template>
@@ -50,11 +55,34 @@ export default {
   components: {
     comThirdmenu
   },
+  mounted () {
+    // console.log(this.menuItem)
+  },
   methods: {
+    getHref (item) {
+      // console.log(item.url, window.location)
+      let host = window.location.host
+      let href = window.location.href
+      if (!item.url) {
+        return 'javascript:void(0);'
+      } else if (item.url.indexOf('http') > -1) {
+        return item.url
+      } else if (href.indexOf(host + '/#') > -1) {
+        return '/#' + item.url
+      }
+    },
+    getTarget (item) {
+      if (!item.url) {
+        return '_self'
+      } else {
+        return '_blank'
+      }
+    },
     gotoRouteHandle (item) {
       console.log(item)
       if (item.url) {
-        this.$router.push({ path: item.url })
+        // this.$router.push({ path: item.url })
+        // window.open("http://www.jb51.net")
       }
     }
   }

+ 35 - 4
src/views/modules/demo/basicComponent/pubuliu.vue

@@ -28,25 +28,53 @@ export default {
       boxW: document.body.clientWidth // 屏幕宽度
     }
   },
-  computed: {},
+  watch: {
+    list () {
+      this.$nextTick(() => {
+        this.setPosition()
+      })
+    }
+  },
   created () {
 
   },
   mounted () {
-    this.init()
+    this.windowResize()
     this.$nextTick(() => {
-      this.setPosition()
+      this.init()
     })
+    // $('.bc-wraper').on('resize', a)
+    // setTimeout(function () {
+    //   console.log('off click')
+    //   $('.bc-wraper').off('resize', a)
+    // }, 5000)
+    // function a () {
+    //   console.log(2222)
+    // }
+  },
+  beforeDestroy () {
+    window.$(window).off('resize', this.resizeFunc)
   },
   methods: {
+    resizeFunc () {
+      // console.log(123132)
+      this.init()
+      this.setPosition()
+    },
+    windowResize () {
+      let _this = this
+      // debugger
+      window.$(window).on('resize', _this.resizeFunc)
+    },
     init () {
       this.boxW = document.querySelector('.water-fall').getBoundingClientRect().width
       this.wfitemW = (this.boxW - this.gap * (this.colNum - 1)) / this.colNum
     },
     setPosition () {
+      // console.log(this.list)
       let nodeList = document.querySelectorAll('.wf-item')
       nodeList.forEach((e, i) => {
-        console.log(e.getBoundingClientRect())
+        // console.log(e.getBoundingClientRect())
         let itemH = e.getBoundingClientRect().height
         let itemW = this.wfitemW
         let itemT = 0
@@ -56,12 +84,14 @@ export default {
         // let itemT = rowIndex*itemW +
         if (i < 3) {
           itemL = i * (itemW + this.gap)
+          // console.log(itemL)
           this.lastItem.push({
             t: itemT + itemH + this.gap,
             l: itemL
           })
         } else {
           let minItem = this.findMinTopItem()
+          // console.log(minItem)
           itemL = minItem.item.l
           itemT = minItem.item.t
           this.lastItem[minItem.index] = {
@@ -75,6 +105,7 @@ export default {
           top: `${itemT}px`,
           left: `${itemL}px`
         }
+        // console.log(this.list)
         // this.list[i].style.width =
         // this.list[i].style.height = `${itemH}px`
         // this.list[i].style.top = `${itemT}px`