gjy 2 lat temu
rodzic
commit
fb20f6c9b3
37 zmienionych plików z 2250 dodań i 999 usunięć
  1. 1 1
      .env.production
  2. 3 3
      public/index.html
  3. 1 0
      src/api/operationLog.js
  4. 14 1
      src/api/user.js
  5. 185 156
      src/global/directive.js
  6. 2 1
      src/global/index.js
  7. 5 76
      src/layout/components/Sidebar/index.vue
  8. 4 1
      src/main.js
  9. 76 0
      src/permission - 副本.js
  10. 7 8
      src/permission.js
  11. 38 31
      src/router/cargoOwnerManagement/index.js
  12. 8 6
      src/router/contractManagement/index.js
  13. 36 28
      src/router/driverManagement/index.js
  14. 8 6
      src/router/enterpriseManagement/index.js
  15. 8 6
      src/router/feedbackManagement/index.js
  16. 85 92
      src/router/index.js
  17. 132 120
      src/router/officialWebsiteManagement/index.js
  18. 9 8
      src/router/operationLog/index.js
  19. 25 21
      src/router/orderManagement/index.js
  20. 12 5
      src/router/parkReportManagement/index.js
  21. 36 29
      src/router/platformManagement/index.js
  22. 12 6
      src/router/settlementManagement/index.js
  23. 8 8
      src/store/getters.js
  24. 70 116
      src/store/modules/permission.js
  25. 259 0
      src/store/modules/user - 副本.js
  26. 139 147
      src/store/modules/user.js
  27. 4 0
      src/utils/auth.js
  28. 4 2
      src/utils/request.js
  29. 339 26
      src/utils/validate.js
  30. 2 2
      src/views/driverManagement/identityExamine.vue
  31. 375 0
      src/views/login/index - 副本.vue
  32. 117 12
      src/views/login/index.vue
  33. 142 0
      src/views/login/sidentify.vue
  34. 39 44
      src/views/operationLog/logManagement.vue
  35. 8 1
      src/views/parkReportManagement/driverInformationReporting.vue
  36. 35 34
      src/views/permissionSetting/permissionSetting.vue
  37. 2 2
      vue.config.js

+ 1 - 1
.env.production

@@ -2,6 +2,6 @@
 ENV = 'production'
 
 # base api
-VUE_APP_BASE_API = 'https://apitest.eliangeyun.com'
+VUE_APP_BASE_API = 'https://api.changyuntong56.com'
 # VUE_APP_BASE_API = 'http://192.168.1.114:8091'
 

+ 3 - 3
public/index.html

@@ -4,14 +4,14 @@
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
-    
-  <meta http-equiv="Content-Security-Policy" >
+    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title><%= webpackConfig.name %></title>
   </head>
   <body>
     <noscript>
-      <strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
+      <strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable
+        it to continue.</strong>
     </noscript>
     <div id="app"></div>
     <!-- built files will be auto injected -->

+ 1 - 0
src/api/operationLog.js

@@ -22,5 +22,6 @@ export function exportInfo(data) {
       url: '/hyOperLog/api/export',
       method: 'post',
       data: data,
+      responseType: 'arraybuffer'
     })
   }

+ 14 - 1
src/api/user.js

@@ -15,7 +15,20 @@ export function getInfo() {
     // params: { token }
   })
 }
-
+export function isLandBased() {
+  return request({
+    url: '/system/query/isLandBased',
+    method: 'get'
+    // params: { token }
+  })
+}
+export function companyInfo() {
+  return request({
+    url: '/company/query/companyInfo',
+    method: 'get'
+    // params: { token }
+  })
+}
 export function logout() {
   return request({
     url: '/auth/api/logout',

+ 185 - 156
src/global/directive.js

@@ -1,179 +1,208 @@
+// bind 只调用一次,指令第一次绑定到元素时候调用,用这个钩子可以定义一个绑定时执行一次的初始化动作。
+// inserted:被绑定的元素插入父节点的时候调用(父节点存在即可调用,不必存在document中)
+// update: 被绑定与元素所在模板更新时调用,而且无论绑定值是否有变化,通过比较更新前后的绑定值,忽略不必要的模板更新
+// componentUpdate :被绑定的元素所在模板完成一次更新更新周期的时候调用
+// unbind: 只调用一次,指令月元素解绑的时候调用
+// demo
+// Vue.directive("hello",{
+//   bind:function(el,bingind,vnode){
+//     el.style["color"] = bingind.value;
+//     console.log("1-bind");
+// },
+// inserted:function(){
+//     console.log("2-insert");
+// },
+// update:function(){
+//     console.log("3-update");
+// },
+// componentUpdated:function(){
+//     console.log('4 - componentUpdated');
+// },
+// unbind:function(){
+//     console.log('5 - unbind');
+// }
+// })
+// 输入框只允许输入数字  v-number-input.float
+
+/**
+ * 拖动
+ */
 const drag = {
-  install(Vue, options = {}) {
-    Vue.directive('drag', {
-      bind(el, binding, vnode) {
-        const dialogHeaderEl = el.querySelector('.el-dialog__header')
-        const dragDom = el.querySelector('.el-dialog')
-        dialogHeaderEl.style.cssText += ';cursor:move;'
-        dragDom.style.cssText += ';top:0px;'
-
-        // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
-        const getStyle = (function() {
-          if (window.document.currentStyle) {
-            return (dom, attr) => dom.currentStyle[attr]
-          } else {
-            return (dom, attr) => getComputedStyle(dom, false)[attr]
-          }
-        })()
-
-        dialogHeaderEl.onmousedown = e => {
-          // 鼠标按下,计算当前元素距离可视区的距离
-          const disX = e.clientX - dialogHeaderEl.offsetLeft
-          const disY = e.clientY - dialogHeaderEl.offsetTop
-
-          const dragDomWidth = dragDom.offsetWidth
-          const dragDomHeight = dragDom.offsetHeight
-
-          const screenWidth = document.body.clientWidth
-          const screenHeight = document.body.scrollHeight
-
-          const minDragDomLeft = dragDom.offsetLeft
-          const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth
-
-          const minDragDomTop = dragDom.offsetTop
-          const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomHeight
-
-          // 获取到的值带px 正则匹配替换
-          let styL = getStyle(dragDom, 'left')
-          let styT = getStyle(dragDom, 'top')
-
-          if (styL.includes('%')) {
-            styL = +document.body.clientWidth * (+styL.replace(/\\%/g, '') / 100)
-            styT = +document.body.scrollHeight * (+styT.replace(/\\%/g, '') / 100)
-          } else {
-            styL = +styL.replace(/\px/g, '')
-            styT = +styT.replace(/\px/g, '')
-          }
-
-          document.onmousemove = function(e) {
-            // 通过事件委托,计算移动的距离
-            let left = e.clientX - disX
-            let top = e.clientY - disY
-            if ((left <= 5 && left >= -5) || (top <= 5 && top >= -5)) {
-              return
+    install(Vue, options = {}) {
+        Vue.directive('drag', {
+            bind(el, binding, vnode) {
+                const dialogHeaderEl = el.querySelector('.el-dialog__header')
+                const dragDom = el.querySelector('.el-dialog')
+                dialogHeaderEl.style.cssText += ';cursor:move;'
+                dragDom.style.cssText += ';top:0px;'
+
+                // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
+                const getStyle = (function() {
+                    if (window.document.currentStyle) {
+                        return (dom, attr) => dom.currentStyle[attr]
+                    } else {
+                        return (dom, attr) => getComputedStyle(dom, false)[attr]
+                    }
+                })()
+
+                dialogHeaderEl.onmousedown = e => {
+                    // 鼠标按下,计算当前元素距离可视区的距离
+                    const disX = e.clientX - dialogHeaderEl.offsetLeft
+                    const disY = e.clientY - dialogHeaderEl.offsetTop
+
+                    const dragDomWidth = dragDom.offsetWidth
+                    const dragDomHeight = dragDom.offsetHeight
+
+                    const screenWidth = document.body.clientWidth
+                    const screenHeight = document.body.scrollHeight
+
+                    const minDragDomLeft = dragDom.offsetLeft
+                    const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth
+
+                    const minDragDomTop = dragDom.offsetTop
+                    const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomHeight
+
+                    // 获取到的值带px 正则匹配替换
+                    let styL = getStyle(dragDom, 'left')
+                    let styT = getStyle(dragDom, 'top')
+
+                    if (styL.includes('%')) {
+                        styL = +document.body.clientWidth * (+styL.replace(/\\%/g, '') / 100)
+                        styT = +document.body.scrollHeight * (+styT.replace(/\\%/g, '') / 100)
+                    } else {
+                        styL = +styL.replace(/\px/g, '')
+                        styT = +styT.replace(/\px/g, '')
+                    }
+
+                    document.onmousemove = function(e) {
+                        // 通过事件委托,计算移动的距离
+                        let left = e.clientX - disX
+                        let top = e.clientY - disY
+                        if ((left <= 5 && left >= -5) || (top <= 5 && top >= -5)) {
+                            return
+                        }
+
+                        // 边界处理
+                        if (-left > minDragDomLeft) {
+                            left = -minDragDomLeft
+                        } else if (left > maxDragDomLeft) {
+                            left = maxDragDomLeft
+                        }
+
+                        if (-top > minDragDomTop) {
+                            top = -minDragDomTop
+                        } else if (top > maxDragDomTop) {
+                            top = maxDragDomTop
+                        }
+
+                        // 移动当前元素
+                        dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
+                        console.info(dragDom.style.cssText)
+
+                        // emit onDrag event
+                        vnode.child.$emit('dragDialog')
+                    }
+
+                    document.onmouseup = function(e) {
+                        document.onmousemove = null
+                        document.onmouseup = null
+                    }
+                }
             }
-
-            // 边界处理
-            if (-left > minDragDomLeft) {
-              left = -minDragDomLeft
-            } else if (left > maxDragDomLeft) {
-              left = maxDragDomLeft
-            }
-
-            if (-top > minDragDomTop) {
-              top = -minDragDomTop
-            } else if (top > maxDragDomTop) {
-              top = maxDragDomTop
-            }
-
-            // 移动当前元素
-            dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
-            console.info(dragDom.style.cssText)
-
-            // emit onDrag event
-            vnode.child.$emit('dragDialog')
-          }
-
-          document.onmouseup = function(e) {
-            document.onmousemove = null
-            document.onmouseup = null
-          }
-        }
-      }
-    })
-  }
+        })
+    }
 }
 
 function onInput(el, ele, binding, vnode) {
-  function handle() {
-    let val = ele.value
-    // modifiers为修饰符对象, 传入了float, 则其float属性为true
-    if (binding.modifiers.float) {
-      // 清除"数字"和"."以外的字符
-      val = val.replace(/[^\d.]/g, '')
-      // 只保留第一个, 清除多余的
-      val = val.replace(/\.{2,}/g, '.')
-      // 第一个字符如果是.号,则补充前缀0
-      val = val.replace(/^\./g, '0.')
-      if (typeof binding.value !== 'undefined') {
-        // 期望保留的最大小数位数
-        let pointKeep = 0
-        if (typeof binding.value === 'string' ||
-          typeof binding.value === 'number') {
-          pointKeep = parseInt(binding.value)
+    function handle() {
+        let val = ele.value
+            // modifiers为修饰符对象, 传入了float, 则其float属性为true
+        if (binding.modifiers.float) {
+            // 清除"数字"和"."以外的字符
+            val = val.replace(/[^\d.]/g, '')
+                // 只保留第一个, 清除多余的
+            val = val.replace(/\.{2,}/g, '.')
+                // 第一个字符如果是.号,则补充前缀0
+            val = val.replace(/^\./g, '0.')
+            if (typeof binding.value !== 'undefined') {
+                // 期望保留的最大小数位数
+                let pointKeep = 0
+                if (typeof binding.value === 'string' ||
+                    typeof binding.value === 'number') {
+                    pointKeep = parseInt(binding.value)
+                }
+                const str = '^(\\d+)\\.(\\d\\{' + pointKeep + '}).*$'
+                const reg = new RegExp(str)
+                if (pointKeep === 0) {
+                    // 不需要小数点
+                    val = val.replace(reg, '$1')
+                } else {
+                    // 通过正则保留小数点后指定的位数
+                    val = val.replace(reg, '$1.$2')
+                }
+            }
         }
-        const str = '^(\\d+)\\.(\\d\\{' + pointKeep + '}).*$'
-        const reg = new RegExp(str)
-        if (pointKeep === 0) {
-          // 不需要小数点
-          val = val.replace(reg, '$1')
+        ele.value = val
+        if (vnode.componentInstance) {
+            vnode.componentInstance.$emit('input', ele.value)
         } else {
-          // 通过正则保留小数点后指定的位数
-          val = val.replace(reg, '$1.$2')
+            vnode.elm.dispatchEvent(new CustomEvent('input', ele.value))
         }
-      }
     }
-    ele.value = val
-    if (vnode.componentInstance) {
-      vnode.componentInstance.$emit('input', ele.value)
-    } else {
-      vnode.elm.dispatchEvent(new CustomEvent('input', ele.value))
-    }
-  }
-  return handle
+    return handle
 }
 
 const numberInput = {
-  install(Vue, options = {}) {
-    Vue.directive('number-input', {
-      bind(el, binding, vnode) {
-        const ele = (el && el.tagName === 'INPUT') ? el : el.querySelector('input')
-        ele.addEventListener('input', onInput(el, ele, binding, vnode), true)
-      },
-    })
-  }
+    install(Vue, options = {}) {
+        Vue.directive('number-input', {
+            bind(el, binding, vnode) {
+                const ele = (el && el.tagName === 'INPUT') ? el : el.querySelector('input')
+                ele.addEventListener('input', onInput(el, ele, binding, vnode), true)
+            },
+        })
+    }
 }
 
 const loadmore = {
-  install(Vue, options = {}) {
-    Vue.directive('loadmore', {
-      bind(el, binding, vnode) {
-        const selectWrap = el.querySelector('.el-table__body-wrapper')
-        selectWrap.addEventListener('scroll', function() {
-          let sign = 0;
-          const scrollDistance = this.scrollHeight - this.scrollTop - this.clientHeight
-          if (scrollDistance <= sign) {
-            binding.value()
-          }
+    install(Vue, options = {}) {
+        Vue.directive('loadmore', {
+            bind(el, binding, vnode) {
+                const selectWrap = el.querySelector('.el-table__body-wrapper')
+                selectWrap.addEventListener('scroll', function() {
+                    let sign = 0;
+                    const scrollDistance = this.scrollHeight - this.scrollTop - this.clientHeight
+                    if (scrollDistance <= sign) {
+                        binding.value()
+                    }
+                })
+            }
         })
-      }
-    })
-  }
+    }
 }
 const permission = (el, binding, vnode) => {
-  const roles = vnode.context.$store.getters.roles;
-  if (!roles) {
-    return;
-  }
-
-  let userPermissionList = Array.isArray(binding.value) ? binding.value : [binding.value];
-  // 当前用户的权限列表
-  if (!userPermissionList.some(e => roles.includes(e))) {
-    el.parentNode && el.parentNode.removeChild(el);
-  }
+    const roles = vnode.context.$store.getters.roles;
+    if (!roles) {
+        return;
+    }
+
+    let userPermissionList = Array.isArray(binding.value) ? binding.value : [binding.value];
+    // 当前用户的权限列表
+    if (!userPermissionList.some(e => roles.includes(e))) {
+        el.parentNode && el.parentNode.removeChild(el);
+    }
 }
 
 const permissionCheck = {
-  install(Vue, options = {}) {
-    Vue.directive('hasPermission', {
-      inserted: permission,
-      componentUpdated: permission
-    })
-  }
+    install(Vue, options = {}) {
+        Vue.directive('hasPermission', {
+            inserted: permission,
+            componentUpdated: permission
+        })
+    }
 }
 export default {
-  numberInput,
-  loadmore,
-  drag,
-  permissionCheck
-}
+    numberInput,
+    loadmore,
+    drag,
+    permissionCheck
+}

+ 2 - 1
src/global/index.js

@@ -1,7 +1,8 @@
-import './prototypes'
+// import './prototypes'
 import directive from './directive'
 import Vue from 'vue'
 // import filters from '@/global/filters';
+// debugger
 Object.values(directive).forEach(value => Vue.use(value))
 // const install = () => {
 

+ 5 - 76
src/layout/components/Sidebar/index.vue

@@ -26,86 +26,15 @@
     },
     computed: {
       ...mapGetters([
-        'sidebar'
+        'sidebar',
+        'menu'
       ]),
       routes() {
         console.log('----------------------', this.$router.options.routes)
+          console.log('----------------------', this.menu)
         // this.socketInfo()
-        return this.$router.options.routes
-      },
-      socketInfo() {
-        // var staffId = JSON.parse(localStorage.getItem('winseaview-userInfo')).content.staffId
-        var staffId = '84f62127b7384dcdbaeaddfe460329fc'
-
-        // getAdminId().toPromise().then(response => {console.log(11111)})
-        this.loading = false
-        // WebSocket
-        // this.$store.dispatch('setAdminId', response.data.data)
-        if ('WebSocket' in window) {
-          if (process.env.NODE_ENV === 'production') {
-            this.websocket = new WebSocket('wss://www.zthymaoyi.com/wss/websocket/' + staffId)
-          } else {
-            //  this.websocket = new WebSocket('ws://192.168.1.115:8090/commonUser/api/onOpen?adminId=84f62127b7384dcdbaeaddfe460329fc' )
-            // this.websocket = new WebSocket('ws://192.168.1.119:9100/websocket/' + staffId)
-            this.websocket = new WebSocket('ws://192.168.1.114:8090/websocket/' + staffId)
-          }
-          console.log('knjhdfkhedfkh',process.env.NODE_ENV)
-          this.initWebSocket()
-        } else {
-          alert('当前浏览器不支持websocket')
-        }
-      },
-      initWebSocket() {
-        console.log('有该方法·',this.websocket)
-        // 连接错误
-        this.websocket.onerror = this.setErrorMessage
-        // 连接成功
-        this.websocket.onopen = this.setOnopenMessage
-
-        // 收到消息的回调
-        this.websocket.onmessage = this.setOnmessageMessage
-
-        // 连接关闭的回调
-        this.websocket.onclose = this.setOncloseMessage
-
-        // 监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
-        window.onbeforeunload = this.onbeforeunload
-      },
-      setErrorMessage() {
-        console.log('WebSocket连接发生错误   状态码:' + this.websocket.readyState)
-      },
-      setOnopenMessage() {
-        // console.log(this.websocket)
-        console.log('WebSocket连接成功    状态码:' + this.websocket.readyState)
-      },
-      setOnmessageMessage(event) {
-        // console.log(3333)
-        // 根据服务器推送的消息做自己的业务处理
-        console.log('服务端返回:' + event.data)
-        // var msg = event.data.split('$')
-        // var that = this
-
-        // this.$notify.warning({
-        //   title: '新消息提醒',
-        //   message: msg[0],
-        //   duration: 0,
-        //   onClick() {
-        //     that.$router.push({
-        //       path: msg[1]
-        //     }) // 你要跳转的路由 还可以传参 当然也可以通过其他方式跳转
-        //   }
-        // })
-        // var currentPage = that.$router.history.current.path
-        // that.$router.push({
-        //   path: '/'
-        // })
-        // that.$router.push({
-        //   path: currentPage
-        // })
-      },
-      setOncloseMessage() {
-        // console.log(this.websocket)
-        console.log('WebSocket连接关闭    状态码:' + this.websocket.readyState)
+        // return this.$router.options.routes
+        return this.menu
       },
       activeMenu() {
         const route = this.$route

+ 4 - 1
src/main.js

@@ -21,6 +21,7 @@ import 'quill/dist/quill.core.css'
 import 'quill/dist/quill.snow.css'
 import 'quill/dist/quill.bubble.css'
 Vue.use(VueQuillEditor)
+import './global/index'
 /**
  * If you don't want to use mock-server
  * you want to use MockJs for mock api
@@ -35,7 +36,9 @@ Vue.use(VueQuillEditor)
 // }
 
 // set ElementUI lang to EN
-Vue.use(ElementUI, { locale })
+Vue.use(ElementUI, {
+  locale
+})
 // 如果想要中文版 element-ui,按如下方式声明
 // Vue.use(ElementUI)
 

+ 76 - 0
src/permission - 副本.js

@@ -0,0 +1,76 @@
+import router from './router'
+import store from './store'
+import {
+  Message
+} from 'element-ui'
+import NProgress from 'nprogress' // progress bar
+import 'nprogress/nprogress.css' // progress bar style
+import {
+  getToken
+} from '@/utils/auth' // get token from cookie
+import getPageTitle from '@/utils/get-page-title'
+
+NProgress.configure({
+  showSpinner: false
+}) // NProgress Configuration
+
+const whiteList = ['/login', '/dashboard'] // no redirect whitelist
+
+router.beforeEach(async (to, from, next) => {
+  // start progress bar
+  NProgress.start()
+
+  // set page title
+  document.title = getPageTitle(to.meta.title)
+
+  // determine whether the user has logged in
+  const hasToken = getToken()
+  debugger
+  if (hasToken) {
+    if (to.path === '/login') {
+      // if is logged in, redirect to the home page
+      next({
+        path: '/'
+      })
+      NProgress.done()
+    } else {
+      const hasGetUserInfo = store.getters.name
+      if (store.getters.token) {
+        next()
+      } else {
+        try {
+          // get user info
+          const accessRoutes = await store.dispatch('permission/generateRoutes');
+          router.addRoutes(accessRoutes);
+          // const {
+          //   roles
+          // } = await store.dispatch('user/getInfo')
+
+          next()
+        } catch (error) {
+          // remove token and go to login page to re-login
+          await store.dispatch('user/resetToken')
+          Message.error(error || 'Has Error')
+          next(`/login?redirect=${to.path}`)
+          NProgress.done()
+        }
+      }
+    }
+  } else {
+    /* has no token*/
+
+    if (whiteList.indexOf(to.path) !== -1) {
+      // in the free login whitelist, go directly
+      next()
+    } else {
+      // other pages that do not have permission to access are redirected to the login page.
+      next(`/login?redirect=${to.path}`)
+      NProgress.done()
+    }
+  }
+})
+
+router.afterEach(() => {
+  // finish progress bar
+  NProgress.done()
+})

+ 7 - 8
src/permission.js

@@ -14,8 +14,7 @@ NProgress.configure({
   showSpinner: false
 }) // NProgress Configuration
 
-const whiteList = ['/login'] // no redirect whitelist
-
+const whiteList = ['/login', '/dashboard'] // no redirect whitelist
 router.beforeEach(async (to, from, next) => {
   // start progress bar
   NProgress.start()
@@ -39,11 +38,11 @@ router.beforeEach(async (to, from, next) => {
       } else {
         try {
           // get user info
-          const accessRoutes = await store.dispatch('permission/generateRoutes');
-          router.addRoutes(accessRoutes);
-          const {
-            roles
-          } = await store.dispatch('user/getInfo')
+          // const accessRoutes = await store.dispatch('permission/generateRoutes');
+          // router.addRoutes(accessRoutes);
+          // const {
+          //   roles
+          // } = await store.dispatch('user/getInfo')
 
           next()
         } catch (error) {
@@ -57,7 +56,7 @@ router.beforeEach(async (to, from, next) => {
     }
   } else {
     /* has no token*/
-
+    console.error(to.path)
     if (whiteList.indexOf(to.path) !== -1) {
       // in the free login whitelist, go directly
       next()

+ 38 - 31
src/router/cargoOwnerManagement/index.js

@@ -6,43 +6,50 @@ const cargoOwnerManagementRouter = {
     path: '/cargoOwnerManagement',
     component: Layout,
     redirect: 'noRedirect',
-    t:new Date(),
+    t: new Date(),
     name: 'cargoOwnerManagement',
     meta: {
         title: '货主管理',
-        icon: 'huozhuguanli'
+        icon: 'huozhuguanli',
+        module: 'changyuntong.huozhuguanli.view',
     },
     children: [{
-        path: 'empowerExamine',
-        name: 'empowerExamine',
-        t:new Date(),
-        component: () => import('@/views/cargoOwnerManagement/empowerExamine'),
-        meta: {
-            title: '货主信息',
-            icon: ''
+            path: 'empowerExamine',
+            name: 'empowerExamine',
+            t: new Date(),
+            component: () =>
+                import ('@/views/cargoOwnerManagement/empowerExamine'),
+            meta: {
+                title: '货主信息',
+                icon: '',
+                module: 'changyuntong.huozhuguanli.view',
+            }
+        },
+        {
+            path: 'merchantVerification',
+            name: 'merchantVerification',
+            t: new Date(),
+            component: () =>
+                import ('@/views/cargoOwnerManagement/merchantVerification'),
+            meta: {
+                title: '授权审核',
+                icon: '',
+                module: 'changyuntong.huozhuguanli.shouquan.view',
+            }
+        },
+        {
+            path: 'taskAudit',
+            name: 'taskAudit',
+            t: new Date(),
+            component: () =>
+                import ('@/views/cargoOwnerManagement/taskAudit'),
+            meta: {
+                title: '任务审核',
+                icon: '',
+                module: 'changyuntong.huozhuguanli.renwu.view',
+            }
         }
-    },
-    {
-        path: 'merchantVerification',
-        name: 'merchantVerification',
-        t:new Date(),
-        component: () => import('@/views/cargoOwnerManagement/merchantVerification'),
-        meta: {
-            title: '授权审核',
-            icon: ''
-        }
-    },
-    {
-        path: 'taskAudit',
-        name: 'taskAudit',
-        t:new Date(),
-        component: () => import('@/views/cargoOwnerManagement/taskAudit'),
-        meta: {
-            title: '任务审核',
-            icon: ''
-        }
-    }
     ]
 }
 
-export default cargoOwnerManagementRouter
+export default cargoOwnerManagementRouter

+ 8 - 6
src/router/contractManagement/index.js

@@ -9,19 +9,21 @@ const contractManagementRouter = {
     name: 'contractManagement',
     meta: {
         title: '合同管理',
-        icon: 'hetongguanli'
+        icon: 'hetongguanli',
+        module: 'changyuntong.hetongguanli',
     },
     alwaysShow: true,
     children: [{
         path: 'contractModel',
         name: 'contractModel',
-        component: () => import('@/views/contractManagement/contractModel'),
+        component: () =>
+            import ('@/views/contractManagement/contractModel'),
         meta: {
             title: '合同模板',
-            icon: ''
+            icon: '',
+            module: 'changyuntong.hetongguanli.view',
         }
-    }
-    ]
+    }]
 }
 
-export default contractManagementRouter
+export default contractManagementRouter

+ 36 - 28
src/router/driverManagement/index.js

@@ -9,37 +9,45 @@ const driverManagementRouter = {
     name: 'driverManagement',
     meta: {
         title: '司机管理',
-        icon: 'sijiguanli'
+        icon: 'sijiguanli',
+        module: 'changyuntong.sijiguanli',
     },
     children: [{
-        path: 'identityExamine',
-        name: 'identityExamine',
-        component: () => import('@/views/driverManagement/identityExamine'),
-        meta: {
-            title: '司机信息',
-            icon: ''
-        }
-    },
-    {
-        path: 'fleetInfo',
-        name: 'fleetInfo',
-        component: () => import('@/views/driverManagement/fleetInfo'),
-        meta: {
-            title: '车队信息',
-            icon: ''
-        }
-    },
-    {
-        path: 'vehicleExamine',
-        name: 'vehicleExamine',
-        component: () => import('@/views/driverManagement/vehicleExamine'),
-        meta: {
-            title: '车辆信息',
-            icon: ''
-        }
-    },
+            path: 'identityExamine',
+            name: 'identityExamine',
+            component: () =>
+                import ('@/views/driverManagement/identityExamine'),
+            meta: {
+                title: '司机信息',
+                icon: '',
+                module: 'changyuntong.sijiguanli.view',
+
+            }
+        },
+        {
+            path: 'fleetInfo',
+            name: 'fleetInfo',
+            component: () =>
+                import ('@/views/driverManagement/fleetInfo'),
+            meta: {
+                title: '车队信息',
+                icon: '',
+                module: 'changyuntong.sijiguanli.chedui.view',
+            }
+        },
+        {
+            path: 'vehicleExamine',
+            name: 'vehicleExamine',
+            component: () =>
+                import ('@/views/driverManagement/vehicleExamine'),
+            meta: {
+                title: '车辆信息',
+                icon: '',
+                module: 'changyuntong.sijiguanli.cheliang.view',
+            }
+        },
 
     ]
 }
 
-export default driverManagementRouter
+export default driverManagementRouter

+ 8 - 6
src/router/enterpriseManagement/index.js

@@ -9,19 +9,21 @@ const enterpriseManagementRouter = {
     name: 'enterpriseManagement',
     meta: {
         title: '企业管理',
-        icon: 'qiyeguanli'
+        icon: 'qiyeguanli',
+        module: 'changyuntong.qiyeguanli.view',
     },
     alwaysShow: true,
     children: [{
         path: 'enterpriseAudit',
         name: 'enterpriseAudit',
-        component: () => import('@/views/enterpriseManagement/enterpriseAudit'),
+        component: () =>
+            import ('@/views/enterpriseManagement/enterpriseAudit'),
         meta: {
             title: '企业信息',
-            icon: ''
+            icon: '',
+            module: 'changyuntong.qiyeguanli.view'
         }
-    }
-    ]
+    }]
 }
 
-export default enterpriseManagementRouter
+export default enterpriseManagementRouter

+ 8 - 6
src/router/feedbackManagement/index.js

@@ -9,19 +9,21 @@ const feedbackManagementRouter = {
     name: 'feedbackManagement',
     meta: {
         title: '投诉举报管理',
-        icon: 'fankuiguanli'
+        icon: 'fankuiguanli',
+        module: 'changyuntong.jubaoguanli',
     },
     // alwaysShow: true,
     children: [{
         path: 'userFeedback',
         name: 'userFeedback',
-        component: () => import('@/views/feedbackManagement/userFeedback'),
+        component: () =>
+            import ('@/views/feedbackManagement/userFeedback'),
         meta: {
             title: '投诉举报管理',
-            icon: ''
+            icon: '',
+            module: 'changyuntong.jubaoguanli.view',
         }
-    }
-    ]
+    }]
 }
 
-export default feedbackManagementRouter
+export default feedbackManagementRouter

+ 85 - 92
src/router/index.js

@@ -18,105 +18,98 @@ import operationLog from './operationLog/index'
 
 
 export const constantRoutes = [{
-    path: '/login',
-    component: () =>
-      import('@/views/login/index'),
-    hidden: true
-  },
-
-  {
-    path: '/404',
-    component: () =>
-      import('@/views/404'),
-    hidden: true
-  },
-  {
-    path: '/',
-    component: Layout,
-    redirect: '/dashboard',
-    children: [{
-      path: 'dashboard',
-      name: 'Dashboard',
-      component: () =>
-        import('@/views/dashboard/index'),
-      meta: {
-        title: '首页',
-        icon: 'shouye'
-      }
-    }]
-  },
-  driverManagement,
-  cargoOwnerManagement,
-  enterpriseManagement,
-  orderManagement,
-  contractManagement,
-  platformManagement,
-  feedbackManagement,
-  officialWebsiteManagement,
-  parkReportManagement,
-  settlementManagement,
-  {
-    path: '/permissionSetting',
-    component: Layout,
-    redirect: '/permissionSettingManagement',
-    name: 'permissionSettingManagement',
-    meta: {
-      title: '权限设置',
-      icon: 'shouye'
-    },
-    children: [{
-        path: 'permissionSetting',
-        name: 'permissionSetting',
+        path: '/login',
         component: () =>
-          import('@/views/permissionSetting/permissionSetting'),
-        meta: {
-          title: '角色设置',
-          icon: 'shouye'
-        }
-      },
-      {
-        path: 'permissionSettingPerson',
-        name: 'permissionSettingPerson',
+            import ('@/views/login/index'),
+        hidden: true
+    },
+
+    {
+        path: '/404',
         component: () =>
-          import('@/views/permissionSetting/permissionSettingPerson'),
+            import ('@/views/404'),
+        hidden: true
+    },
+    {
+        path: '/',
+        component: Layout,
+        redirect: '/dashboard',
+        children: [{
+            path: 'dashboard',
+            name: 'Dashboard',
+            component: () =>
+                import ('@/views/dashboard/index'),
+            meta: {
+                title: '首页',
+                icon: 'shouye'
+            }
+        }]
+    },
+    {
+        path: '/permissionSetting',
+        component: Layout,
+        redirect: '/permissionSettingManagement',
+        name: 'permissionSettingManagement',
         meta: {
-          title: '人员设置',
-          icon: 'shouye'
-        }
-      }
-    ]
-  },
-  {
-    path: '*',
-    redirect: '/404',
-    hidden: true
-  }
+            title: '权限设置',
+            icon: 'shouye'
+        },
+        children: [{
+                path: 'permissionSetting',
+                name: 'permissionSetting',
+                component: () =>
+                    import ('@/views/permissionSetting/permissionSetting'),
+                meta: {
+                    title: '角色设置',
+                    icon: 'shouye'
+                }
+            },
+            {
+                path: 'permissionSettingPerson',
+                name: 'permissionSettingPerson',
+                component: () =>
+                    import ('@/views/permissionSetting/permissionSettingPerson'),
+                meta: {
+                    title: '人员设置',
+                    icon: 'shouye'
+                }
+            }
+        ]
+    },
+    {
+        path: '*',
+        redirect: '/404',
+        hidden: true
+    }
 ]
-let cofigRouter = []
-// const modulesFiles = require.context('../views', true, /.js$/)
-// modulesFiles.keys().forEach((model_item, key) => {
-//         if (model_item === 'index.js' || modulesFiles(model_item).default === undefined || modulesFiles(model_item)
-//             .default.path === undefined) return
-//         cofigRouter = cofigRouter.concat(modulesFiles(model_item).default)
-//     })
-// 需要根据用户角色动态加载的路由
-export const dynamicRoutes = cofigRouter
+let cofigRouter = [
+    driverManagement,
+    cargoOwnerManagement,
+    enterpriseManagement,
+    orderManagement,
+    contractManagement,
+    platformManagement,
+    feedbackManagement,
+    officialWebsiteManagement,
+    parkReportManagement,
+    settlementManagement,
+    operationLog,
+]
+export const asyncRoutes = cofigRouter
 const createRouter = () =>
-  new Router({
-    // mode: 'history',
-    scrollBehavior: () => ({
-      y: 0
-    }),
-    linkActiveClass: 'active', // router-link  .active样式
-    routes: constantRoutes
-  })
+    new Router({
+        // mode: 'history',
+        scrollBehavior: () => ({
+            y: 0
+        }),
+        linkActiveClass: 'active', // router-link  .active样式
+        routes: constantRoutes
+    })
 
 const router = createRouter()
-
-// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
 export function resetRouter() {
-  const newRouter = createRouter()
-  router.matcher = newRouter.matcher // reset router
+    const newRouter = createRouter()
+    router.matcher = newRouter.matcher // reset router
 }
 
-export default router
+export default router

+ 132 - 120
src/router/officialWebsiteManagement/index.js

@@ -2,136 +2,148 @@
 
 import Layout from '@/layout'
 
-const officialWebsiteManagement  = {
+const officialWebsiteManagement = {
     path: '/officialWebsiteManagement',
     component: Layout,
     redirect: 'noRedirect',
     name: 'officialWebsiteManagement',
     meta: {
         title: '官网管理',
-        icon: 'fankuiguanli'
+        icon: 'fankuiguanli',
+        module: 'changyuntong.guanwangguanli',
     },
     alwaysShow: true,
-    children: [
-      {
-        path: '/news',
-        name: 'news',
-        component: () => import('@/views/officialWebsiteManagement/news'),
-        meta: {
-            title: '公告信息',
-            icon: ''
-        }
-    },
-    {
-    	path: '/newsAdd',
-    	name: 'newsAdd',
-    	component: () => import('@/views/officialWebsiteManagement/newsAdd'),
-    	meta: {
-    	    title: '公告信息新增',
-    	    icon: ''
-    	},
-    	hidden: true
-    },
-    {
-    	path: '/newsLook',
-    	name: 'newsLook',
-    	component: () => import('@/views/officialWebsiteManagement/newsLook'),
-    	meta: {
-    	    title: '公告信息查看',
-    	    icon: ''
-    	},
-    	hidden: true
-    },
-    {
-    	path: '/newsEdit',
-    	name: 'newsEdit',
-    	component: () => import('@/views/officialWebsiteManagement/newsEdit'),
-    	meta: {
-    	    title: '公告信息编辑',
-    	    icon: ''
-    	},
-    	hidden: true
-    },
-    {
-        path: '/notice',
-        name: 'notice',
-        component: () => import('@/views/officialWebsiteManagement/notice'),
-        meta: {
-            title: '处理公示',
-            icon: ''
+    children: [{
+            path: '/news',
+            name: 'news',
+            component: () =>
+                import ('@/views/officialWebsiteManagement/news'),
+            meta: {
+                title: '公告信息',
+                icon: '',
+            }
+        },
+        {
+            path: '/newsAdd',
+            name: 'newsAdd',
+            component: () =>
+                import ('@/views/officialWebsiteManagement/newsAdd'),
+            meta: {
+                title: '公告信息新增',
+                icon: ''
+            },
+            hidden: true
+        },
+        {
+            path: '/newsLook',
+            name: 'newsLook',
+            component: () =>
+                import ('@/views/officialWebsiteManagement/newsLook'),
+            meta: {
+                title: '公告信息查看',
+                icon: ''
+            },
+            hidden: true
+        },
+        {
+            path: '/newsEdit',
+            name: 'newsEdit',
+            component: () =>
+                import ('@/views/officialWebsiteManagement/newsEdit'),
+            meta: {
+                title: '公告信息编辑',
+                icon: ''
+            },
+            hidden: true
+        },
+        {
+            path: '/notice',
+            name: 'notice',
+            component: () =>
+                import ('@/views/officialWebsiteManagement/notice'),
+            meta: {
+                title: '处理公示',
+                icon: ''
+            },
+        },
+        {
+            path: '/noticeAdd',
+            name: 'noticeAdd',
+            component: () =>
+                import ('@/views/officialWebsiteManagement/noticeAdd'),
+            meta: {
+                title: '处理公示新增',
+                icon: ''
+            },
+            hidden: true
+        },
+        {
+            path: '/noticeLook',
+            name: 'noticeLook',
+            component: () =>
+                import ('@/views/officialWebsiteManagement/noticeLook'),
+            meta: {
+                title: '处理公示查看',
+                icon: ''
+            },
+            hidden: true
+        },
+        {
+            path: '/noticeEdit',
+            name: 'noticeEdit',
+            component: () =>
+                import ('@/views/officialWebsiteManagement/noticeEdit'),
+            meta: {
+                title: '处理公示编辑',
+                icon: ''
+            },
+            hidden: true
         },
-    },
-    {
-    	path: '/noticeAdd',
-    	name: 'noticeAdd',
-    	component: () => import('@/views/officialWebsiteManagement/noticeAdd'),
-    	meta: {
-    	    title: '处理公示新增',
-    	    icon: ''
-    	},
-    	hidden: true
-    },
-    {
-    	path: '/noticeLook',
-    	name: 'noticeLook',
-    	component: () => import('@/views/officialWebsiteManagement/noticeLook'),
-    	meta: {
-    	    title: '处理公示查看',
-    	    icon: ''
-    	},
-    	hidden: true
-    },
-    {
-    	path: '/noticeEdit',
-    	name: 'noticeEdit',
-    	component: () => import('@/views/officialWebsiteManagement/noticeEdit'),
-    	meta: {
-    	    title: '处理公示编辑',
-    	    icon: ''
-    	},
-    	hidden: true
-    },
 
-    {
-        path: '/publicity',
-        name: 'publicity',
-        component: () => import('@/views/officialWebsiteManagement/publicity'),
-        meta: {
-            title: '行业资讯',
-            icon: ''
-        }
-    },
-    {
-    	path: '/publicityAdd',
-    	name: 'publicityAdd',
-    	component: () => import('@/views/officialWebsiteManagement/publicityAdd'),
-    	meta: {
-    	    title: '行业资讯新增',
-    	    icon: ''
-    	},
-    	hidden: true
-    },
-    {
-    	path: '/publicityLook',
-    	name: 'publicityLook',
-    	component: () => import('@/views/officialWebsiteManagement/publicityLook'),
-    	meta: {
-    	    title: '行业资讯查看',
-    	    icon: ''
-    	},
-    	hidden: true
-    },
-    {
-    	path: '/publicityEdit',
-    	name: 'publicityEdit',
-    	component: () => import('@/views/officialWebsiteManagement/publicityEdit'),
-    	meta: {
-    	    title: '行业资讯编辑',
-    	    icon: ''
-    	},
-    	hidden: true
-    },
+        {
+            path: '/publicity',
+            name: 'publicity',
+            component: () =>
+                import ('@/views/officialWebsiteManagement/publicity'),
+            meta: {
+                title: '行业资讯',
+                icon: ''
+            }
+        },
+        {
+            path: '/publicityAdd',
+            name: 'publicityAdd',
+            component: () =>
+                import ('@/views/officialWebsiteManagement/publicityAdd'),
+            meta: {
+                title: '行业资讯新增',
+                icon: ''
+            },
+            hidden: true
+        },
+        {
+            path: '/publicityLook',
+            name: 'publicityLook',
+            component: () =>
+                import ('@/views/officialWebsiteManagement/publicityLook'),
+            meta: {
+                title: '行业资讯查看',
+                icon: ''
+            },
+            hidden: true
+        },
+        {
+            path: '/publicityEdit',
+            name: 'publicityEdit',
+            component: () =>
+                import ('@/views/officialWebsiteManagement/publicityEdit'),
+            meta: {
+                title: '行业资讯编辑',
+                icon: ''
+            },
+            hidden: true
+        },
     ]
 }
 
-export default officialWebsiteManagement
+export default officialWebsiteManagement

+ 9 - 8
src/router/operationLog/index.js

@@ -9,20 +9,21 @@ const operationLogRouter = {
     name: 'operationLog',
     meta: {
         title: '操作日志',
-        icon: 'dingdanguanli'
+        icon: 'dingdanguanli',
+        module: 'changyuntong.caozuorizhi',
     },
     alwaysShow: true,
-    children: [
-      {
+    children: [{
         path: 'logManagement',
         name: 'logManagement',
-        component: () => import('@/views/operationLog/logManagement'),
+        component: () =>
+            import ('@/views/operationLog/logManagement'),
         meta: {
             title: '日志管理',
-            icon: ''
+            icon: '',
+            module: 'changyuntong.caozuorizhi.view',
         }
-    }
-    ]
+    }]
 }
 
-export default operationLogRouter
+export default operationLogRouter

+ 25 - 21
src/router/orderManagement/index.js

@@ -9,30 +9,34 @@ const orderManagementRouter = {
     name: 'orderManagement',
     meta: {
         title: '订单管理',
-        icon: 'dingdanguanli'
+        icon: 'dingdanguanli',
+        module: 'changyuntong.dingdanguanli',
     },
     alwaysShow: true,
-    children: [
-      {
-        path: 'orderAudit',
-        name: 'orderAudit',
-        component: () => import('@/views/orderManagement/orderAudit'),
-        meta: {
-            title: '订单信息',
-            icon: ''
-        }
-    },
-    {
-        path: 'trajectory',
-        name: 'trajectory',
-        component: () => import('@/views/orderManagement/trajectory'),
-        meta: {
-            title: '轨迹',
-            icon: ''
+    children: [{
+            path: 'orderAudit',
+            name: 'orderAudit',
+            component: () =>
+                import ('@/views/orderManagement/orderAudit'),
+            meta: {
+                title: '订单信息',
+                icon: '',
+                module: 'changyuntong.dingdanguanli.view',
+            }
         },
-        	hidden: true
-    }
+        {
+            path: 'trajectory',
+            name: 'trajectory',
+            component: () =>
+                import ('@/views/orderManagement/trajectory'),
+            meta: {
+                title: '轨迹',
+                icon: '',
+                module: 'changyuntong.dingdanguanli.view',
+            },
+            hidden: true
+        }
     ]
 }
 
-export default orderManagementRouter
+export default orderManagementRouter

+ 12 - 5
src/router/parkReportManagement/index.js

@@ -9,7 +9,9 @@ const parkReportManagement = {
     name: 'parkReportManagement',
     meta: {
         title: '园区上报',
-        icon: 'pingtaiguanli'
+        icon: 'pingtaiguanli',
+        module: 'changyuntong.yuanqushangbao',
+
     },
     alwaysShow: true,
     children: [{
@@ -19,7 +21,8 @@ const parkReportManagement = {
                 import ('@/views/parkReportManagement/waybillReporting'),
             meta: {
                 title: '运单上报',
-                icon: ''
+                icon: '',
+                module: 'changyuntong.yuanqushangbao.yundan.view',
             }
         },
         {
@@ -29,7 +32,8 @@ const parkReportManagement = {
                 import ('@/views/parkReportManagement/dailyReport'),
             meta: {
                 title: '流水单上报',
-                icon: ''
+                icon: '',
+                module: 'changyuntong.yuanqushangbao.liushui.view',
             }
         },
         {
@@ -39,7 +43,9 @@ const parkReportManagement = {
                 import ('@/views/parkReportManagement/driverInformationReporting'),
             meta: {
                 title: '司机信息上报',
-                icon: ''
+                icon: '',
+                module: 'changyuntong.yuanqushangbao.sishang.view',
+
             }
         },
         {
@@ -49,7 +55,8 @@ const parkReportManagement = {
                 import ('@/views/parkReportManagement/vehicleInformationReporting'),
             meta: {
                 title: '车辆信息上报',
-                icon: ''
+                icon: '',
+                module: 'changyuntong.yuanqushangbao.cheshang.view',
             }
         },
     ]

+ 36 - 29
src/router/platformManagement/index.js

@@ -9,39 +9,46 @@ const platformManagementRouter = {
     name: 'platformManagement',
     meta: {
         title: '平台规定管理',
-        icon: 'pingtaiguanli'
+        icon: 'pingtaiguanli',
+        module: 'changyuntong.guidingguanli',
     },
     alwaysShow: true,
     children: [{
-        path: 'specifiedRecords',
-        name: 'specifiedRecords',
-        component: () => import('@/views/platformManagement/specifiedRecords'),
-        meta: {
-            title: '规定记录',
-            icon: ''
+            path: 'specifiedRecords',
+            name: 'specifiedRecords',
+            component: () =>
+                import ('@/views/platformManagement/specifiedRecords'),
+            meta: {
+                title: '规定记录',
+                icon: '',
+                module: 'changyuntong.guidingguanli.view',
+            }
+        },
+        {
+            path: 'specifiedRecordsAdd',
+            name: 'specifiedRecordsAdd',
+            component: () =>
+                import ('@/views/platformManagement/specifiedRecordsAdd'),
+            meta: {
+                title: '新增规定记录',
+                icon: '',
+                module: 'changyuntong.guidingguanli.add',
+            },
+            hidden: true
+        },
+        {
+            path: 'specifiedRecordsLook',
+            name: 'specifiedRecordsLook',
+            component: () =>
+                import ('@/views/platformManagement/specifiedRecordsLook'),
+            meta: {
+                title: '规定记录查看',
+                icon: '',
+                module: 'changyuntong.guidingguanli.view',
+            },
+            hidden: true
         }
-    },
-	{
-		path: 'specifiedRecordsAdd',
-		name: 'specifiedRecordsAdd',
-		component: () => import('@/views/platformManagement/specifiedRecordsAdd'),
-		meta: {
-		    title: '新增规定记录',
-		    icon: ''
-		},
-		hidden: true
-	},
-	{
-		path: 'specifiedRecordsLook',
-		name: 'specifiedRecordsLook',
-		component: () => import('@/views/platformManagement/specifiedRecordsLook'),
-		meta: {
-		    title: '规定记录查看',
-		    icon: ''
-		},
-		hidden: true
-	}
     ]
 }
 
-export default platformManagementRouter
+export default platformManagementRouter

+ 12 - 6
src/router/settlementManagement/index.js

@@ -9,7 +9,8 @@ const settlementManagement = {
     name: 'settlementManagement',
     meta: {
         title: '结算管理',
-        icon: 'fankuiguanli'
+        icon: 'fankuiguanli',
+        module: 'changyuntong.jiesuanguanli',
     },
     alwaysShow: true,
     children: [{
@@ -19,7 +20,8 @@ const settlementManagement = {
                 import ('@/views/settlementManagement/driverFeeSettlement'),
             meta: {
                 title: '司机费用结算',
-                icon: ''
+                icon: '',
+                module: 'changyuntong.sifei.view',
             }
         },
         {
@@ -29,7 +31,8 @@ const settlementManagement = {
                 import ('@/views/settlementManagement/advancePaymentAndRepaymentSettlement'),
             meta: {
                 title: '垫付还款结算',
-                icon: ''
+                icon: '',
+                module: 'changyuntong.dianfu.view',
             },
         },
         {
@@ -39,7 +42,8 @@ const settlementManagement = {
                 import ('@/views/settlementManagement/CashOwner'),
             meta: {
                 title: '货主提现',
-                icon: ''
+                icon: '',
+                module: 'changyuntong.tixian.view',
             },
         },
         {
@@ -49,7 +53,8 @@ const settlementManagement = {
                 import ('@/views/settlementManagement/ownerFlow'),
             meta: {
                 title: '货主银行流水',
-                icon: ''
+                icon: '',
+                module: 'changyuntong.hangliu.view',
             },
         },
         {
@@ -59,7 +64,8 @@ const settlementManagement = {
                 import ('@/views/settlementManagement/statisticalReport'),
             meta: {
                 title: '统计报表',
-                icon: ''
+                icon: '',
+                module: 'changyuntong.baobiao.view',
             },
         },
     ]

+ 8 - 8
src/store/getters.js

@@ -1,10 +1,10 @@
 const getters = {
-  sidebar: state => state.app.sidebar,
-  device: state => state.app.device,
-  token: state => state.user.token,
-  avatar: state => state.user.avatar,
-  name: state => state.user.name,
-  menuList: state => state.menu.menuList,
-  roles: state => state.user.roles,
+    sidebar: state => state.app.sidebar,
+    device: state => state.app.device,
+    token: state => state.user.token,
+    avatar: state => state.user.avatar,
+    name: state => state.user.name,
+    menu: state => state.permission.menu,
+    roles: state => state.user.roles,
 }
-export default getters
+export default getters

+ 70 - 116
src/store/modules/permission.js

@@ -1,13 +1,13 @@
 import {
-  asyncRoutes,
-  constantRoutes,
-  resetRouter
+    asyncRoutes,
+    constantRoutes,
+    resetRouter
 } from '@/router'
 import {
-  getRoule
+    getRoule
 } from '@/api/user'
 import {
-  clearStorage
+    clearStorage
 } from '../../utils/auth'
 /**
  * 递归过滤异步路由表,返回符合用户角色权限的路由表
@@ -15,26 +15,26 @@ import {
  * @param roles 传递参数-用户权限内容
  */
 function filterAsyncRoutes(routes, roles) {
-  const res = []
-  routes.forEach(route => {
-    const currentRoute = {
-      ...route
-    }
-    if (currentRoute.meta && currentRoute.meta.module) {
-      const routeModule = currentRoute.meta.module
-      // console.log(roles)
-      if (roles.some(role => role.indexOf(routeModule) === 0)) {
-        if (Array.isArray(currentRoute.children) && currentRoute.children.length > 0) {
-          currentRoute.children = filterAsyncRoutes(currentRoute.children, roles)
-        }
-        res.push(currentRoute)
-      }
-    } else {
-      res.push(currentRoute)
-    }
-  })
-  // console.log(routes)
-  return res
+    const res = []
+    routes.forEach(route => {
+            const currentRoute = {
+                ...route
+            }
+            if (currentRoute.meta && currentRoute.meta.module) {
+                const routeModule = currentRoute.meta.module
+                    // console.log(roles)
+                if (roles.some(role => role.indexOf(routeModule) === 0)) {
+                    if (Array.isArray(currentRoute.children) && currentRoute.children.length > 0) {
+                        currentRoute.children = filterAsyncRoutes(currentRoute.children, roles)
+                    }
+                    res.push(currentRoute)
+                }
+            } else {
+                // res.push(currentRoute)
+            }
+        })
+        // console.log(routes)
+    return res
 }
 
 /**
@@ -44,107 +44,61 @@ function filterAsyncRoutes(routes, roles) {
  * @param {*} parentModule
  */
 function handleRoles(roles, res, parentModule) {
-  // console.log(roles, res, parentModule)
-  roles.forEach((role) => {
-    if (Array.isArray(role.children) && role.children.length > 0) {
-      handleRoles(role.children, res, parentModule + role.name + '.')
-    } else {
-      const lastIndex = role.name.lastIndexOf('.')
-      if (parentModule.indexOf(role.name.split('.')[0]) != -1) {
-        res.push(`${parentModule}${role.name.substring(lastIndex + 1)}`)
-      } else {
-        res.push(`${parentModule}${role.name}`)
-      }
-    }
-  })
+    // console.log(roles, res, parentModule)
+    roles.forEach((role) => {
+        if (Array.isArray(role.children) && role.children.length > 0) {
+            handleRoles(role.children, res, parentModule + role.name + '.')
+        } else {
+            const lastIndex = role.name.lastIndexOf('.')
+            if (parentModule.indexOf(role.name.split('.')[0]) != -1) {
+                res.push(`${parentModule}${role.name.substring(lastIndex + 1)}`)
+            } else {
+                res.push(`${parentModule}${role.name}`)
+            }
+        }
+    })
 }
 const state = {
-  routes: [],
-  menu: []
+    routes: [],
+    menu: []
 }
 
 const mutations = {
-  SET_ROUTES: (state, routes) => {
-    const routerList = constantRoutes.concat(routes)
-    // console.log(routerList)
-    state.menu = leftMenu(routerList, {})
-    state.routes = routerList
-    // console.log(routerList)
-  },
-  SET_MENU: (state, menu) => {
-    state.menu = menu
-  }
-}
-
-const group = (routerChild = []) => {
-  const groupChild = []
-  routerChild.forEach(item => {
-    const routerGroup = [
-      item.path,
-      ...group(item.children || [])
-    ]
-    groupChild.push(...routerGroup)
-  })
-  return groupChild.filter(item => item)
-}
-const formatUrl = (url = '') => {
-  return url.replace(/\/\//g, '/')
-}
-/**
- * 获取左侧菜单列表 数据模型  供日后后台提供接口使用
- * @param {*} menuList 按权限区分出来的集合
- * @param {*} param1 {path=''} 父节点路径
- */
-const leftMenu = (menuList, {
-  path = ''
-}) => {
-  const res = []
-  menuList.filter(item => !item.hidden).forEach(route => {
-    // console.info(route, 'route.children')
-    const currentRoute = {
-      'alias': 'menu',
-      'code': route.name,
-      'name': route.meta ? route.meta.title : route.name,
-      'path': formatUrl(path + (route.path.indexOf('/') > -1 ? '' : '/') + route.path),
-      'source': route.meta ? `iconfont icon${route.meta.icon}` : '',
-      'sort': 1,
-      'category': 1,
-      'isOpen': 1,
-      'children': leftMenu(route.children || [], route),
-      'hasChildren': false,
-      'actionName': '',
-      'isOpenName': '',
-      'group': group(route.children || [])
+    SET_ROUTES: (state, routes) => {
+        const routerList = constantRoutes.concat(routes)
+        state.menu = routerList
+        state.routes = routerList
+    },
+    SET_MENU: (state, menu) => {
+        state.menu = menu
     }
-    res.push(currentRoute)
-  })
-  // console.info(JSON.stringify(res), 'luyou')
-  return res
 }
 
 const actions = {
-  generateRoutes({
-    commit
-  }) {
-    return new Promise(async resolve => {
-      getRoule().then(response => {
-        const roles = []
-        handleRoles(response.data, roles, '')
-        // console.log(roles)
-        const accessedRoutes = filterAsyncRoutes(constantRoutes, roles)
-        commit('user/SET_ROLES', roles, {
-          root: true
+    generateRoutes({
+        commit
+    }) {
+        return new Promise(async resolve => {
+            const data = await getRoule().then().catch(error => {
+                clearStorage()
+                resetRouter()
+            })
+            const roles = []
+            handleRoles(data.data, roles, '')
+            console.log('roles', roles)
+            const accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
+            commit('user/SET_ROLES', roles, {
+                root: true
+            })
+            commit('SET_ROUTES', accessedRoutes)
+            resolve(accessedRoutes)
         })
-        commit('SET_ROUTES', accessedRoutes)
-        resolve(accessedRoutes)
-      })
-    })
-  }
+    }
 }
 
 export default {
-  namespaced: true,
-  state,
-  mutations,
-  actions
-}
+    namespaced: true,
+    state,
+    mutations,
+    actions
+}

+ 259 - 0
src/store/modules/user - 副本.js

@@ -0,0 +1,259 @@
+import {
+  login,
+  logout,
+  getInfo,
+  getRoule,
+  isLandBased,
+  companyInfo
+} from '@/api/user'
+import {
+  getToken,
+  setToken,
+  removeToken
+} from '@/utils/auth'
+import {
+  resetRouter
+} from '@/router'
+
+const getDefaultState = () => {
+  return {
+    token: getToken(),
+    name: '',
+    avatar: '',
+    roles: [],
+  }
+}
+
+const state = getDefaultState()
+
+const mutations = {
+  RESET_STATE: (state) => {
+    Object.assign(state, getDefaultState())
+  },
+  SET_TOKEN: (state, token) => {
+    state.token = token
+  },
+  SET_NAME: (state, name) => {
+    state.name = name
+  },
+  SET_AVATAR: (state, avatar) => {
+    state.avatar = avatar
+  },
+  SET_ROLES: (state, roles) => {
+    state.roles = roles
+  },
+}
+
+const actions = {
+  // user login
+  async login({
+    commit,
+    dispatch
+  }, userInfo) {
+    const {
+      companyName,
+      username,
+      password
+    } = userInfo
+    // return new Promise((resolve, reject) => {
+    const data = await login({
+      companyName: companyName,
+      username: username.trim(),
+      password: password
+    })
+    // .then(response => {
+    // const { data } = response
+    // commit('SET_TOKEN', data.token)
+    // setToken(data.token)
+    // commit('SET_TOKEN', 'Admin-Token')
+    // setToken('Admin-Token')
+    // resolve(response)
+    // }).catch(error => {
+    // reject(error)
+    // })
+    const {
+      compId,
+      tenantId,
+      vesselId,
+      vesselBankFlag,
+      clientFag,
+      userId
+    } = data.data
+    localStorage.setItem('ws-pf_compId', compId)
+    localStorage.setItem('ws-pf_userId', userId)
+    localStorage.setItem('ws-pf_tenantId', tenantId)
+    localStorage.setItem('ws-pf_vesselId', vesselId) // 仅适用于一条船
+    localStorage.setItem('ws-pf_vesselBankFlag', vesselBankFlag) // 当前登录人是船端还是岸端的人员
+    localStorage.setItem('ws-pf_clientFag', clientFag)
+    // notification.setSessionId(userId) // 设置通知唯一标识
+    // notification.start() // 开始监听通知
+    // })
+    await isLandBased().then(response => {
+      localStorage.setItem('ws-pf_serviceTypeFlag', response)
+    })
+    const {
+      organizationMonetaryKey,
+      compName,
+      compDomainName,
+      organizationMonetaryValue
+    } = await companyInfo({
+      compId: compId
+    })
+    localStorage.setItem('ws-pf_organMonetaryKey', organizationMonetaryKey)
+    localStorage.setItem('ws-pf_compName', compName)
+    localStorage.setItem('ws-pf_compDomainName', compDomainName)
+    localStorage.setItem('ws-pf_organMonetaryValue', organizationMonetaryValue)
+    dispatch('getInfo', {
+      vesselBankFlag,
+      compName
+    })
+  },
+  async getInfo({
+    commit,
+    dispatch
+  }, {
+    vesselBankFlag = 'B',
+    compName = ''
+  }) {
+    debugger
+    const response = await getInfo()
+    const {
+      staffName,
+      deptId,
+      deptName,
+      deptNameEn,
+      vessels = [],
+      majorRole: {
+        roleName = '',
+        roleId = '',
+        dutyId = ''
+      },
+      roles
+    } = response.data
+    const content = {
+      ...response.data,
+      showRoleName: roleName || roles[0].roleName,
+      showRoleId: roleId || roles[0].roleId,
+      showCompName: vesselBankFlag === 'V' ? vessels[0].vesselName : compName,
+      avatar: 'img/user.png'
+    }
+    // setStore({
+    //     name: 'userInfo',
+    //     content: content,
+    //     type: 'session'
+    // })
+    // dispatch('common/setLocalVessels', vessels, { root: true })
+    // commit('SET_USER_INFO', content)
+
+    localStorage.setItem('ws-pf_dutyId', dutyId || response.data.roles[0].dutyId)
+    localStorage.setItem('ws-pf_roleName', roleName || roles[0].roleName)
+
+    localStorage.setItem('ws-pf_staffName', staffName)
+    localStorage.setItem('ws-pf_deptId', deptId)
+    localStorage.setItem('ws-pf_deptName', deptName)
+    localStorage.setItem('ws-pf_deptNameEn', deptNameEn)
+    localStorage.setItem('ws-pf_vessels', JSON.stringify(vessels))
+    localStorage.setItem('ws-pf_roleId', roleId || roles[0].roleId)
+
+  },
+  // // get user info
+  // async getInfo({
+  //   commit,
+  //   state,
+  //   dispatch
+  // }) {
+  //   return new Promise((resolve, reject) => {
+
+  //     getInfo().then(response => {
+  //       const {
+  //         data
+  //       } = response
+  //       if (!data) {
+  //         reject('Verification failed, please Login again.')
+  //       }
+  //       const {
+  //         staffName,
+  //         deptId,
+  //         deptName,
+  //         deptNameEn,
+  //         vessels = [],
+  //         majorRole: {
+  //           roleName = '',
+  //           roleId = '',
+  //           dutyId = ''
+  //         },
+  //         roles
+  //       } = data
+
+  //       // roles must be a non-empty array
+  //       // if (!roles || roles.length <= 0) {
+  //       //   reject('getInfo: roles must be a non-null array!')
+  //       // }
+
+  //       localStorage.setItem('ws-pf_dutyId', dutyId || data.roles[0].dutyId)
+  //       localStorage.setItem('ws-pf_roleName', roleName || roles[0].roleName)
+
+  //       localStorage.setItem('ws-pf_staffName', staffName)
+  //       localStorage.setItem('ws-pf_deptId', deptId)
+  //       localStorage.setItem('ws-pf_deptName', deptName)
+  //       localStorage.setItem('ws-pf_deptNameEn', deptNameEn)
+  //       localStorage.setItem('ws-pf_vessels', JSON.stringify(vessels))
+  //       localStorage.setItem('ws-pf_roleId', roleId || roles[0].roleId)
+  //       resolve(data)
+  //     }).catch(error => {
+  //       reject(error)
+  //     })
+  //   })
+  // },
+  getRoule({
+    commit,
+    state
+  }) {
+    return new Promise(async (resolve, reject) => {
+      try {
+        const data = await getRoule(state.roles)
+        data.forEach(route => {
+          asyncRoutes.push(route)
+        })
+        commit('SET_ROUTES', asyncRoutes)
+        resolve(asyncRoutes)
+      } catch (error) {
+        reject(error)
+      }
+    })
+  },
+  // user logout
+  logout({
+    commit,
+    state
+  }) {
+    return new Promise((resolve, reject) => {
+      logout(state.token).then(() => {
+        removeToken() // must remove  token  first
+        resetRouter()
+        commit('RESET_STATE')
+        resolve()
+      }).catch(error => {
+        reject(error)
+      })
+    })
+  },
+
+  // remove token
+  resetToken({
+    commit
+  }) {
+    return new Promise(resolve => {
+      removeToken() // must remove  token  first
+      commit('RESET_STATE')
+      resolve()
+    })
+  }
+}
+
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions
+}

+ 139 - 147
src/store/modules/user.js

@@ -1,172 +1,164 @@
 import {
-  login,
-  logout,
-  getInfo,
-  getRoule
+    login,
+    logout,
+    getInfo,
+    getRoule
 } from '@/api/user'
 import {
-  getToken,
-  setToken,
-  removeToken
+    getToken,
+    setToken,
+    removeToken,
+    asyncRoutes
 } from '@/utils/auth'
 import {
-  resetRouter
+    resetRouter
 } from '@/router'
 
 const getDefaultState = () => {
-  return {
-    token: getToken(),
-    name: '',
-    avatar: '',
-    roles: [],
-  }
+    return {
+        token: getToken(),
+        name: '',
+        avatar: '',
+        roles: [],
+    }
 }
 
 const state = getDefaultState()
 
 const mutations = {
-  RESET_STATE: (state) => {
-    Object.assign(state, getDefaultState())
-  },
-  SET_TOKEN: (state, token) => {
-    state.token = token
-  },
-  SET_NAME: (state, name) => {
-    state.name = name
-  },
-  SET_AVATAR: (state, avatar) => {
-    state.avatar = avatar
-  },
-  SET_ROLES: (state, roles) => {
-    state.roles = roles
-  },
+    RESET_STATE: (state) => {
+        Object.assign(state, getDefaultState())
+    },
+    SET_TOKEN: (state, token) => {
+        state.token = token
+    },
+    SET_NAME: (state, name) => {
+        state.name = name
+    },
+    SET_AVATAR: (state, avatar) => {
+        state.avatar = avatar
+    },
+    SET_ROLES: (state, roles) => {
+        state.roles = roles
+    },
 }
 
 const actions = {
-  // user login
-  login({
-    commit
-  }, userInfo) {
-    const {
-      companyName,
-      username,
-      password
-    } = userInfo
-    return new Promise((resolve, reject) => {
-      login({
-        companyName: companyName,
-        username: username.trim(),
-        password: password
-      }).then(response => {
-        // const { data } = response
-        // commit('SET_TOKEN', data.token)
-        // setToken(data.token)
-        commit('SET_TOKEN', 'Admin-Token')
-        setToken('Admin-Token')
-        resolve(response)
-      }).catch(error => {
-        reject(error)
-      })
-    })
-  },
-
-  // get user info
-  getInfo({
-    commit,
-    state
-  }) {
-    return new Promise((resolve, reject) => {
-
-      getInfo().then(response => {
+    // user login
+    login({
+        commit
+    }, userInfo) {
         const {
-          data
-        } = response
-        if (!data) {
-          reject('Verification failed, please Login again.')
-        }
-        const {
-          staffName,
-          deptId,
-          deptName,
-          deptNameEn,
-          vessels = [],
-          majorRole: {
-            roleName = '',
-            roleId = '',
-            dutyId = ''
-          },
-          roles
-        } = data
+            companyName,
+            username,
+            password
+        } = userInfo
+        return new Promise((resolve, reject) => {
+            login({
+                companyName: companyName,
+                username: username.trim(),
+                password: password
+            }).then(response => {
+                commit('SET_TOKEN', 'Admin-Token')
+                setToken('Admin-Token')
+                resolve(response)
+            }).catch(error => {
+                reject(error)
+            })
+        })
+    },
 
-        // roles must be a non-empty array
-        // if (!roles || roles.length <= 0) {
-        //   reject('getInfo: roles must be a non-null array!')
-        // }
+    // get user info
+    getInfo({
+        commit,
+        state
+    }) {
+        return new Promise((resolve, reject) => {
 
-        localStorage.setItem('ws-pf_dutyId', dutyId || data.roles[0].dutyId)
-        localStorage.setItem('ws-pf_roleName', roleName || roles[0].roleName)
+            getInfo().then(response => {
+                const {
+                    data
+                } = response
+                if (!data) {
+                    reject('Verification failed, please Login again.')
+                }
+                const {
+                    staffName,
+                    deptId,
+                    deptName,
+                    deptNameEn,
+                    vessels = [],
+                    majorRole: {
+                        roleName = '',
+                        roleId = '',
+                        dutyId = ''
+                    },
+                    roles
+                } = data
+                localStorage.setItem('ws-pf_dutyId', dutyId || data.roles[0].dutyId)
+                localStorage.setItem('ws-pf_roleName', roleName || roles[0].roleName)
 
-        localStorage.setItem('ws-pf_staffName', staffName)
-        localStorage.setItem('ws-pf_deptId', deptId)
-        localStorage.setItem('ws-pf_deptName', deptName)
-        localStorage.setItem('ws-pf_deptNameEn', deptNameEn)
-        localStorage.setItem('ws-pf_vessels', JSON.stringify(vessels))
-        localStorage.setItem('ws-pf_roleId', roleId || roles[0].roleId)
-        resolve(data)
-      }).catch(error => {
-        reject(error)
-      })
-    })
-  },
-  getRoule({
-    commit,
-    state
-  }) {
-    return new Promise(async (resolve, reject) => {
-      try {
-        const data = await getRoule(state.roles)
-        data.forEach(route => {
-          asyncRoutes.push(route)
+                localStorage.setItem('ws-pf_staffName', staffName)
+                localStorage.setItem('ws-pf_deptId', deptId)
+                localStorage.setItem('ws-pf_deptName', deptName)
+                localStorage.setItem('ws-pf_deptNameEn', deptNameEn)
+                localStorage.setItem('ws-pf_vessels', JSON.stringify(vessels))
+                localStorage.setItem('ws-pf_roleId', roleId || roles[0].roleId)
+                resolve(data)
+            }).catch(error => {
+                reject(error)
+            })
         })
-        commit('SET_ROUTES', asyncRoutes)
-        resolve(asyncRoutes)
-      } catch (error) {
-        reject(error)
-      }
-    })
-  },
-  // user logout
-  logout({
-    commit,
-    state
-  }) {
-    return new Promise((resolve, reject) => {
-      logout(state.token).then(() => {
-        removeToken() // must remove  token  first
-        resetRouter()
-        commit('RESET_STATE')
-        resolve()
-      }).catch(error => {
-        reject(error)
-      })
-    })
-  },
+    },
+    getRoule({
+        commit,
+        state
+    }) {
+        return new Promise(async(resolve, reject) => {
+            try {
+                const data = await getRoule(state.roles)
+                data.forEach(route => {
+                    asyncRoutes.push(route)
+                })
+                commit('SET_ROUTES', asyncRoutes)
+                resolve(asyncRoutes)
+            } catch (error) {
+                reject(error)
+            }
+        })
+    },
+    // user logout
+    logout({
+        commit,
+        state
+    }) {
+        return new Promise((resolve, reject) => {
+            logout(state.token).then(() => {
+                removeToken() // must remove  token  first
+                resetRouter()
+                commit('RESET_STATE')
+                resolve()
+            }).catch(error => {
+                reject(error)
+            })
+        })
+    },
 
-  // remove token
-  resetToken({
-    commit
-  }) {
-    return new Promise(resolve => {
-      removeToken() // must remove  token  first
-      commit('RESET_STATE')
-      resolve()
-    })
-  }
+    // remove token
+    resetToken({
+        commit
+    }) {
+        return new Promise(resolve => {
+            removeToken() // must remove  token  first
+            commit('RESET_STATE')
+            resolve()
+        })
+    }
 }
 
 export default {
-  namespaced: true,
-  state,
-  mutations,
-  actions
-}
+    namespaced: true,
+    state,
+    mutations,
+    actions
+}

+ 4 - 0
src/utils/auth.js

@@ -13,3 +13,7 @@ export function setToken(token) {
 export function removeToken() {
   return Cookies.remove(TokenKey)
 }
+
+export function clearStorage() {
+  return localStorage.clear();
+}

+ 4 - 2
src/utils/request.js

@@ -6,7 +6,7 @@ import { getToken } from '@/utils/auth'
 // create an axios instance
 const service = axios.create({
   baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
-  // withCredentials: true, // send cookies when cross-domain requests
+  withCredentials: true, // send cookies when cross-domain requests
   timeout: 5000 // request timeout
 })
 
@@ -44,6 +44,9 @@ service.interceptors.response.use(
   response => {
     const res = response.data
     // if the custom code is not 20000, it is judged as an error.
+     if(res.data instanceof Blob){
+      return res.data
+    }
     if (res.code && res.code !== 200 && res.code !== '200') {
       Message({
         message: res.message || 'Error',
@@ -71,7 +74,6 @@ service.interceptors.response.use(
       }else{
         return res
       }
-      
     }
   },
   error => {

+ 339 - 26
src/utils/validate.js

@@ -1,47 +1,360 @@
 /**
- * Created by PanJiaChen on 16/11/18.
+ * @param {string} str
+ * @returns {Boolean}
  */
+export function validUsername(str) {
+    // const valid_map = ['admin', 'editor']
+    // return valid_map.indexOf(str.trim()) >= 0
+    return str.length == 11
+}
+
+export function isEnglish(str) {
+    const reg = /^[a-zA-Z, ]+$/;
+    return reg.test(str);
+}
 
 /**
- * @param {string} path
- * @returns {Boolean}
+ * Created by jiachenpan on 16/11/18.
  */
+
 export function isExternal(path) {
-  return /^(https?:|mailto:|tel:)/.test(path)
+    return /^(https?:|mailto:|tel:)/.test(path)
 }
 
-/**
- * @param {string} str
- * @returns {Boolean}
- */
-export function validUsername(str) {
-  // const valid_map = ['admin', 'editor']
-  // return valid_map.indexOf(str.trim()) >= 0
-  return str.length == 11
+export function validPassword(str) {
+    const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/
+    return reg.test(str)
 }
 
-export function isNumber(str) {
-  const reg = /^[0-9]+$/;
-  return reg.test(str);
+export function validUserVeriCode(str) {
+    const reg = /^\d{6}$/
+    return reg.test(str)
 }
 
-export function isEnglish(str) {
-  const reg = /^[a-zA-Z, ]+$/;
-  return reg.test(str);
+export function validUserCellPhone(str) {
+    const reg = /^1[34578]\d{9}$/
+    return reg.test(str)
 }
 
-export function validPassword(str) {
-  const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/
-  return reg.test(str)
+export function validURL(url) {
+    const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
+    return reg.test(url)
+}
+
+export function validLowerCase(str) {
+    const reg = /^[a-z]+$/
+    return reg.test(str)
+}
+
+export function validUpperCase(str) {
+    const reg = /^[A-Z]+$/
+    return reg.test(str)
+}
+
+export function validAlphabets(str) {
+    const reg = /^[A-Za-z]+$/
+    return reg.test(str)
 }
 
 export function validEmail(email) {
-  const reg =
-    /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
-  return reg.test(email)
+    const reg = /^(([^<>()\\[\]\\.,;:\s@"]+(\.[^<>()\\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
+    return reg.test(email)
+}
+
+export function isString(str) {
+    if (typeof str === 'string' || str instanceof String) {
+        return true
+    }
+    return false
+}
+
+export function isArray(arg) {
+    if (typeof Array.isArray === 'undefined') {
+        return Object.prototype.toString.call(arg) === '[object Array]'
+    }
+    return Array.isArray(arg)
+}
+export function isNumber(str) {
+    const reg = /^[0-9]+$/
+    return reg.test(str)
+}
+export function cardId(str) {
+    const reg = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
+    return reg.test(str)
+}
+// 正整数
+export function isNumberInteger(str) {
+    const reg = /^[1-9]\d*$/
+    return reg.test(str)
+}
+// 其他电话
+export function otherPhone(str) {
+    const reg = /^[0-9-\-;]*$/
+    return reg.test(str)
 }
 // 纯11位手机号码
 export function mobilePhone(str) {
-  const reg = /^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/
-  return reg.test(str)
+    const reg = /^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/
+    return reg.test(str)
+}
+export function convertTwoDigitNumber(value) {
+    return value.replace(/[^\d.]/g, '')
+        .replace(/\.{2,}/g, '.')
+        .replace('.', '$#$')
+        .replace(/\./g, '')
+        .replace('$#$', '.')
+        .replace(/^(\\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
+        .replace(/^\./g, '')
+}
+
+
+
+export function isvalidUsername(str) {
+    const valid_map = ['admin', 'editor']
+    return valid_map.indexOf(str.trim()) >= 0
+}
+
+/* 合法uri*/
+export function validateURL(textval) {
+    const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
+    return urlregex.test(textval)
+}
+/**
+ * 邮箱
+ * @param {*} s
+ */
+export function isEmail(s) {
+    return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s)
+}
+
+/**
+ * 手机号码
+ * @param {*} s
+ */
+export function isMobile(s) {
+    return /^1[0-9]{10}$/.test(s)
+}
+
+/**
+ * 电话号码
+ * @param {*} s
+ */
+export function isPhone(s) {
+    return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s)
+}
+
+/**
+ * URL地址
+ * @param {*} s
+ */
+export function isURL(s) {
+    return /^http[s]?:\/\/.*/.test(s)
+}
+
+/* 小写字母*/
+export function validateLowerCase(str) {
+    const reg = /^[a-z]+$/
+    return reg.test(str)
+}
+
+/* 大写字母*/
+export function validateUpperCase(str) {
+    const reg = /^[A-Z]+$/
+    return reg.test(str)
+}
+
+/* 大小写字母*/
+export function validatAlphabets(str) {
+    const reg = /^[A-Za-z]+$/
+    return reg.test(str)
+}
+/*验证pad还是pc*/
+export const vaildatePc = function() {
+        const userAgentInfo = navigator.userAgent;
+        const Agents = ['Android', 'iPhone',
+            'SymbianOS', 'Windows Phone',
+            'iPad', 'iPod'
+        ];
+        let flag = true;
+        for (var v = 0; v < Agents.length; v++) {
+            if (userAgentInfo.indexOf(Agents[v]) > 0) {
+                flag = false;
+                break;
+            }
+        }
+        return flag;
+    }
+    /**
+     * validate email
+     * @param email
+     * @returns {boolean}
+     */
+export function validateEmail(email) {
+    const re = /^(([^<>()\\[\]\\.,;:\s@"]+(\.[^<>()\\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
+    return re.test(email)
 }
+
+/**
+ * 判断身份证号码
+ */
+export function cardid(code) {
+    let list = [];
+    let result = true;
+    let msg = '';
+    var city = {
+        11: '北京',
+        12: '天津',
+        13: '河北',
+        14: '山西',
+        15: '内蒙古',
+        21: '辽宁',
+        22: '吉林',
+        23: '黑龙江 ',
+        31: '上海',
+        32: '江苏',
+        33: '浙江',
+        34: '安徽',
+        35: '福建',
+        36: '江西',
+        37: '山东',
+        41: '河南',
+        42: '湖北 ',
+        43: '湖南',
+        44: '广东',
+        45: '广西',
+        46: '海南',
+        50: '重庆',
+        51: '四川',
+        52: '贵州',
+        53: '云南',
+        54: '西藏 ',
+        61: '陕西',
+        62: '甘肃',
+        63: '青海',
+        64: '宁夏',
+        65: '新疆',
+        71: '台湾',
+        81: '香港',
+        82: '澳门',
+        91: '国外 '
+    };
+    if (!validatenull(code)) {
+        if (code.length == 18) {
+            if (!code || !/(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(code)) {
+                msg = '证件号码格式错误';
+            } else if (!city[code.substr(0, 2)]) {
+                msg = '地址编码错误';
+            } else {
+                //18位身份证需要验证最后一位校验位
+                code = code.split('');
+                //∑(ai×Wi)(mod 11)
+                //加权因子
+                var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
+                //校验位
+                var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2, 'x'];
+                var sum = 0;
+                var ai = 0;
+                var wi = 0;
+                for (var i = 0; i < 17; i++) {
+                    ai = code[i];
+                    wi = factor[i];
+                    sum += ai * wi;
+                }
+                if (parity[sum % 11] != code[17]) {
+                    msg = '证件号码校验位错误';
+                } else {
+                    result = false;
+                }
+
+            }
+        } else {
+            msg = '证件号码长度不为18位';
+        }
+
+    } else {
+        msg = '证件号码不能为空';
+    }
+    list.push(result);
+    list.push(msg);
+    return list;
+}
+/**
+ * 判断手机号码是否正确
+ */
+export function isvalidatemobile(phone) {
+    let list = [];
+    let result = true;
+    let msg = '';
+    var isPhone = /^0\d{2,3}-?\d{7,8}$/;
+    //增加134 减少|1349[0-9]{7},增加181,增加145,增加17[678]
+    if (!validatenull(phone)) {
+        if (phone.length == 11) {
+            if (isPhone.test(phone)) {
+                msg = '手机号码格式不正确';
+            } else {
+                result = false;
+            }
+        } else {
+            msg = '手机号码长度不为11位';
+        }
+    } else {
+        msg = '手机号码不能为空';
+    }
+    list.push(result);
+    list.push(msg);
+    return list;
+}
+/**
+ * 判断姓名是否正确
+ */
+export function validatename(name) {
+    var regName = /^[\u4e00-\u9fa5]{2,4}$/;
+    if (!regName.test(name)) return false;
+    return true;
+}
+/**
+ * 判断是否为整数
+ */
+export function validatenum(num, type) {
+    let regName = /[^\d.]/g;
+    if (type == 1) {
+        if (!regName.test(num)) return false;
+    } else if (type == 2) {
+        regName = /[^\d]/g;
+        if (!regName.test(num)) return false;
+    }
+    return true;
+}
+/**
+ * 判断是否为小数
+ */
+export function validatenumord(num, type) {
+    let regName = /[^\d.]/g;
+    if (type == 1) {
+        if (!regName.test(num)) return false;
+    } else if (type == 2) {
+        regName = /[^\d.]/g;
+        if (!regName.test(num)) return false;
+    }
+    return true;
+}
+/**
+ * 判断是否为空
+ */
+export function validatenull(val) {
+    if (typeof val == 'boolean') {
+        return false;
+    }
+    if (typeof val == 'number') {
+        return false;
+    }
+    if (val instanceof Array) {
+        if (val.length == 0) return true;
+    } else if (val instanceof Object) {
+        if (JSON.stringify(val) === '{}') return true;
+    } else {
+        if (val == 'null' || val == null || val == 'undefined' || val == undefined || val == '') return true;
+        return false;
+    }
+    return false;
+}

+ 2 - 2
src/views/driverManagement/identityExamine.vue

@@ -238,9 +238,9 @@
         </div>
         <div class="file_tips">
           <span v-if="count == 1">有效期:{{file.cardValidityDate}} </span>
-          <span v-if="count == 2"> 准驾车型:{{file.quasiDrivingVehicle}} </span> 
+          <span v-if="count == 2"> 准驾车型:{{file.quasiDrivingVehicle}} </span>
           <span v-if="count == 2"> 发证机关:{{file.lssuingAuthority}} </span>
-          <span v-if="count == 2"> 有效期:{{file.driverLicenseValidityStartDate}} ~ {{file.driverLicenseValidityDate}} </span> 
+          <span v-if="count == 2"> 有效期:{{file.driverLicenseValidityStartDate}} ~ {{file.driverLicenseValidityDate}} </span>
           <span v-if="count == 4"> 从业资格证号:{{file.qualificationCertificateNumber}}</span>
           <span v-if="count == 4"> 有效期:{{file.qualificationCertificateValidityDate}}</span>
         </div>

+ 375 - 0
src/views/login/index - 副本.vue

@@ -0,0 +1,375 @@
+<template>
+  <div class="login-container">
+    <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on"
+      label-position="left">
+      <div class="title-container">
+        <h3 class="title">畅运通管理平台</h3>
+      </div>
+
+      <el-form-item prop="username">
+        <span class="svg-container">
+          <svg-icon icon-class="user" />
+        </span>
+        <el-input ref="username" v-model="loginForm.username" placeholder="请输入您的账号" name="username" type="text"
+          maxlength="11" tabindex="1" auto-complete="on" />
+      </el-form-item>
+
+      <el-form-item prop="password">
+        <span class="svg-container">
+          <svg-icon icon-class="password" />
+        </span>
+        <el-input :key="passwordType" ref="password" v-model="loginForm.password" :type="passwordType"
+          placeholder="请输入登录密码" name="password" tabindex="2" auto-complete="on" @keyup.enter.native="handleLogin" />
+        <span class="show-pwd" @click="showPwd">
+          <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
+        </span>
+      </el-form-item>
+      <el-form-item prop="code">
+        <el-row :span="24" style="display: flex;align-items: center;">
+          <el-col :span="12">
+            <el-input v-model="loginForm.code" auto-complete="off" placeholder="请输入验证码" size=""
+              @keyup.enter.native="submitForm('loginForm')"></el-input>
+          </el-col>
+          <el-col :span="12" style="display: flex;justify-content: flex-end;">
+            <div class="login-code" @click="refreshCode">
+              <!--验证码组件-->
+              <s-identify :identifyCode="identifyCode"></s-identify>
+            </div>
+          </el-col>
+        </el-row>
+      </el-form-item>
+      <el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;"
+        @click.native.prevent="handleLogin">进入</el-button>
+
+      <!-- <div class="tips">
+        <span style="margin-right:20px;">username: admin</span>
+        <span>password: any</span>
+      </div> -->
+    </el-form>
+  </div>
+</template>
+
+<script>
+  import Cookies from 'js-cookie'
+  import {
+    mapActions
+  } from 'vuex'
+  import {
+    validUsername,
+    isLoginName
+  } from '@/utils/validate'
+  import SIdentify from './sidentify'
+  export default {
+    name: 'Login',
+    components: {
+      SIdentify
+    },
+    data() {
+      const validateUsername = (rule, value, callback) => {
+        if (!validUsername(value)) {
+          callback(new Error('请输入正确的账号'))
+        } else {
+          callback()
+        }
+      }
+      const validatePassword = (rule, value, callback) => {
+        if (value.length < 6) {
+          callback(new Error('请输入正确的密码'))
+        } else {
+          callback()
+        }
+      }
+      const validateCode = (rule, value, callback) => {
+        if (this.identifyCode !== value) {
+          this.loginForm.code = ''
+          this.refreshCode()
+          callback(new Error('请输入正确的验证码'))
+        } else {
+          callback()
+        }
+      }
+      return {
+        isDebugLogin: false,
+        loginForm: {
+          username: '',
+          password: '',
+          code: ''
+        },
+        identifyCodes: '1234567890',
+        identifyCode: '',
+        loginRules: {
+          username: [{
+              required: true,
+              trigger: 'blur',
+              message: '请输入用户名'
+            },
+            {
+              min: 1,
+              max: 200,
+              message: '长度在1-200字符之间',
+              trigger: 'blur'
+            },
+            {
+              validator: isLoginName,
+              trigger: 'blur'
+            }
+          ],
+          password: [{
+              required: true,
+              message: '请输入密码',
+              trigger: 'blur'
+            },
+            {
+              min: 1,
+              max: 100,
+              message: '长度在1-100字符之间',
+              trigger: 'blur'
+            }
+          ],
+          code: [{
+              required: true,
+              message: '请输入验证码',
+              trigger: 'blur'
+            },
+            {
+              validator: validateCode,
+              trigger: 'blur'
+            }
+          ]
+        },
+        loading: false,
+        rememberMe: true,
+        passwordType: 'password',
+        redirect: undefined
+      }
+    },
+    watch: {
+      $route: {
+        handler: function(route) {
+          this.redirect = route.query && route.query.redirect
+        },
+        immediate: true
+      },
+      isDebugLogin(v) {
+        if (v) {
+          this.loginForm.password = '123'
+          this.refreshCode()
+        }
+      },
+      identifyCode(v) {
+        this.isDebugLogin && (this.loginForm.code = v)
+      }
+    },
+    methods: {
+      ...mapActions('user', ['login']),
+      randomNum(min, max) {
+        return Math.floor(Math.random() * (max - min) + min)
+      },
+      refreshCode() {
+        this.identifyCode = ''
+        this.makeCode(this.identifyCodes, 4)
+      },
+      makeCode(o, l) {
+        for (let i = 0; i < l; i++) {
+          this.identifyCode += this.identifyCodes[
+            this.randomNum(0, this.identifyCodes.length)
+          ]
+        }
+      },
+      showPwd() {
+        if (this.passwordType === 'password') {
+          this.passwordType = ''
+        } else {
+          this.passwordType = 'password'
+        }
+        this.$nextTick(() => {
+          this.$refs.password.focus()
+        })
+      },
+      handleLogin() {
+        this.$refs.loginForm.validate(async (valid) => {
+          if (valid) {
+            this.loginForm.companyName = '黑龙江中天昊元贸易有限公司'
+            this.loading = true
+            // this.$store.dispatch('user/login', this.loginForm)
+            // const res = await this.$store.dispatch('user/login', this.loginForm)
+            const res = await this.login(this.loginForm)
+            debugger
+            localStorage.setItem('ws_login_type', 2)
+            Cookies.set('ws_login_companyShortName', this.loginForm.companyName, {
+              expires: 365,
+            })
+            Cookies.set('ws_login_account', this.loginForm.username, {
+              expires: 365,
+            })
+            if (this.rememberMe) {
+              Cookies.set('ws_login_pwd', this.loginForm.password, {
+                expires: 365,
+              })
+              Cookies.set('ws_login_rememberMe', 1, {
+                expires: 365
+              })
+            } else {
+              Cookies.remove('ws_login_companyShortName')
+              Cookies.remove('ws_login_account')
+              Cookies.remove('ws_login_pwd')
+              Cookies.set('ws_login_rememberMe', 0, {
+                expires: 365
+              })
+            }
+            const redirect = this.$route.query.redirect
+            if (redirect) {
+              this.$router.push(redirect)
+            } else {
+              this.$router.push('/')
+            }
+            // .then(response => {
+            //   localStorage.setItem('UserInfo', JSON.stringify(response.data))
+            //   this.$router.push({
+            //     path: this.redirect || '/'
+            //   })
+            //   this.loading = false
+            // })
+            // .catch(() => {
+            //   this.loading = false
+            // })
+          } else {
+            console.log('error submit!!')
+            return false
+          }
+        })
+      }
+    },
+    created() {
+      this.refreshCode()
+    }
+  }
+</script>
+
+<style lang="scss">
+  /* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
+
+  $bg: #283443;
+  $light_gray: #fff;
+  $cursor: #fff;
+
+  @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
+    .login-container .el-input input {
+      color: $cursor;
+    }
+  }
+
+  /* reset element-ui css */
+  .login-container {
+    .el-input {
+      display: inline-block;
+      height: 47px;
+      width: 85%;
+
+      input {
+        background: transparent;
+        border: 0px;
+        -webkit-appearance: none;
+        border-radius: 0px;
+        padding: 12px 5px 12px 15px;
+        color: $light_gray;
+        height: 47px;
+        caret-color: $cursor;
+
+        &:-webkit-autofill {
+          box-shadow: 0 0 0px 1000px $bg inset !important;
+          -webkit-text-fill-color: $cursor !important;
+        }
+      }
+    }
+
+    .el-form-item {
+      border: 1px solid rgba(255, 255, 255, 0.1);
+      background: rgba(0, 0, 0, 0.1);
+      border-radius: 5px;
+      color: #454545;
+    }
+  }
+</style>
+
+<style lang="scss" scoped>
+  $bg: #2d3a4b;
+  $dark_gray: #889aa4;
+  $light_gray: #eee;
+
+  .login-container {
+    min-height: 100%;
+    width: 100%;
+    background-color: $bg;
+    overflow: hidden;
+
+    .login-form {
+      position: relative;
+      width: 520px;
+      max-width: 100%;
+      padding: 160px 35px 0;
+      margin: 0 auto;
+      overflow: hidden;
+    }
+
+    .tips {
+      font-size: 14px;
+      color: #fff;
+      margin-bottom: 10px;
+
+      span {
+        &:first-of-type {
+          margin-right: 16px;
+        }
+      }
+    }
+
+    .svg-container {
+      padding: 6px 5px 6px 15px;
+      color: $dark_gray;
+      vertical-align: middle;
+      width: 30px;
+      display: inline-block;
+    }
+
+    .title-container {
+      position: relative;
+
+      .title {
+        font-size: 26px;
+        color: $light_gray;
+        margin: 0px auto 40px auto;
+        text-align: center;
+        font-weight: bold;
+      }
+    }
+
+    .show-pwd {
+      position: absolute;
+      right: 10px;
+      top: 7px;
+      font-size: 16px;
+      color: $dark_gray;
+      cursor: pointer;
+      user-select: none;
+    }
+  }
+
+  .login-code {
+    cursor: pointer;
+    margin-right: 5px;
+
+    .login-code-img {
+      width: 100px;
+      height: 38px;
+      background-color: #eee;
+      border: 1px solid #f0f0f0;
+      color: #333;
+      font-size: 18px;
+      font-weight: bold;
+      letter-spacing: 2px;
+      text-indent: 2px;
+      text-align: center;
+    }
+  }
+</style>

+ 117 - 12
src/views/login/index.vue

@@ -24,7 +24,20 @@
           <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
         </span>
       </el-form-item>
-
+      <el-form-item prop="code">
+        <el-row :span="24" style="display: flex;align-items: center;">
+          <el-col :span="12">
+            <el-input v-model="loginForm.code" auto-complete="off" placeholder="请输入验证码" size=""
+              @keyup.enter.native="submitForm('loginForm')"></el-input>
+          </el-col>
+          <el-col :span="12" style="display: flex;justify-content: flex-end;">
+            <div class="login-code" @click="refreshCode">
+              <!--验证码组件-->
+              <s-identify :identifyCode="identifyCode"></s-identify>
+            </div>
+          </el-col>
+        </el-row>
+      </el-form-item>
       <el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;"
         @click.native.prevent="handleLogin">进入</el-button>
 
@@ -38,11 +51,15 @@
 
 <script>
   import {
-    validUsername
+    validUsername,
+    isLoginName
   } from '@/utils/validate'
-
+  import SIdentify from './sidentify'
   export default {
     name: 'Login',
+    components: {
+      SIdentify
+    },
     data() {
       const validateUsername = (rule, value, callback) => {
         if (!validUsername(value)) {
@@ -58,19 +75,63 @@
           callback()
         }
       }
+      const validateCode = (rule, value, callback) => {
+        if (this.identifyCode !== value) {
+          this.loginForm.code = ''
+          this.refreshCode()
+          callback(new Error('请输入正确的验证码'))
+        } else {
+          callback()
+        }
+      }
       return {
-        loginForm: {},
+        isDebugLogin: false,
+        loginForm: {
+          username: '',
+          password: '',
+          code: ''
+        },
+        identifyCodes: '1234567890',
+        identifyCode: '',
         loginRules: {
           username: [{
-            required: true,
-            trigger: 'blur',
-            validator: validateUsername
-          }],
+              required: true,
+              trigger: 'blur',
+              message: '请输入用户名'
+            },
+            {
+              min: 1,
+              max: 200,
+              message: '长度在1-200字符之间',
+              trigger: 'blur'
+            },
+            {
+              validator: isLoginName,
+              trigger: 'blur'
+            }
+          ],
           password: [{
-            required: true,
-            trigger: 'blur',
-            validator: validatePassword
-          }]
+              required: true,
+              message: '请输入密码',
+              trigger: 'blur'
+            },
+            {
+              min: 1,
+              max: 100,
+              message: '长度在1-100字符之间',
+              trigger: 'blur'
+            }
+          ],
+          code: [{
+              required: true,
+              message: '请输入验证码',
+              trigger: 'blur'
+            },
+            {
+              validator: validateCode,
+              trigger: 'blur'
+            }
+          ]
         },
         loading: false,
         passwordType: 'password',
@@ -83,9 +144,32 @@
           this.redirect = route.query && route.query.redirect
         },
         immediate: true
+      },
+      isDebugLogin(v) {
+        if (v) {
+          this.loginForm.password = '123'
+          this.refreshCode()
+        }
+      },
+      identifyCode(v) {
+        this.isDebugLogin && (this.loginForm.code = v)
       }
     },
     methods: {
+      randomNum(min, max) {
+        return Math.floor(Math.random() * (max - min) + min)
+      },
+      refreshCode() {
+        this.identifyCode = ''
+        this.makeCode(this.identifyCodes, 4)
+      },
+      makeCode(o, l) {
+        for (let i = 0; i < l; i++) {
+          this.identifyCode += this.identifyCodes[
+            this.randomNum(0, this.identifyCodes.length)
+          ]
+        }
+      },
       showPwd() {
         if (this.passwordType === 'password') {
           this.passwordType = ''
@@ -118,6 +202,9 @@
           }
         })
       }
+    },
+    created() {
+      this.refreshCode()
     }
   }
 </script>
@@ -231,4 +318,22 @@
       user-select: none;
     }
   }
+
+  .login-code {
+    cursor: pointer;
+    margin-right: 5px;
+
+    .login-code-img {
+      width: 100px;
+      height: 38px;
+      background-color: #eee;
+      border: 1px solid #f0f0f0;
+      color: #333;
+      font-size: 18px;
+      font-weight: bold;
+      letter-spacing: 2px;
+      text-indent: 2px;
+      text-align: center;
+    }
+  }
 </style>

+ 142 - 0
src/views/login/sidentify.vue

@@ -0,0 +1,142 @@
+<template>
+  <div class="s-canvas">
+    <canvas id="s-canvas" :width="contentWidth" :height="contentHeight"></canvas>
+  </div>
+</template>
+<script>
+  export default {
+    name: 'SIdentify',
+    props: {
+      identifyCode: {
+        type: String,
+        default: '1234'
+      },
+      fontSizeMin: {
+        type: Number,
+        default: 24
+      },
+      fontSizeMax: {
+        type: Number,
+        default: 36
+      },
+      backgroundColorMin: {
+        type: Number,
+        default: 180
+      },
+      backgroundColorMax: {
+        type: Number,
+        default: 240
+      },
+      colorMin: {
+        type: Number,
+        default: 50
+      },
+      colorMax: {
+        type: Number,
+        default: 160
+      },
+      lineColorMin: {
+        type: Number,
+        default: 40
+      },
+      lineColorMax: {
+        type: Number,
+        default: 180
+      },
+      dotColorMin: {
+        type: Number,
+        default: 0
+      },
+      dotColorMax: {
+        type: Number,
+        default: 255
+      },
+      contentWidth: {
+        type: Number,
+        default: 112
+      },
+      contentHeight: {
+        type: Number,
+        default: 38
+      }
+    },
+    methods: {
+      // 生成一个随机数
+      randomNum(min, max) {
+        return Math.floor(Math.random() * (max - min) + min)
+      },
+      // 生成一个随机的颜色
+      randomColor(min, max) {
+        let r = this.randomNum(min, max)
+        let g = this.randomNum(min, max)
+        let b = this.randomNum(min, max)
+        return 'rgb(' + r + ',' + g + ',' + b + ')'
+      },
+      drawPic() {
+        let canvas = document.getElementById('s-canvas')
+        let ctx = canvas.getContext('2d')
+        ctx.textBaseline = 'bottom'
+        // 绘制背景
+        ctx.fillStyle = this.randomColor(this.backgroundColorMin, this.backgroundColorMax)
+        ctx.fillRect(0, 0, this.contentWidth, this.contentHeight)
+        // 绘制文字
+        for (let i = 0; i < this.identifyCode.length; i++) {
+          this.drawText(ctx, this.identifyCode[i], i)
+        }
+        // this.drawLine(ctx)
+        this.drawDot(ctx)
+      },
+      drawText(ctx, txt, i) {
+        ctx.fillStyle = this.randomColor(this.colorMin, this.colorMax)
+        ctx.font = this.randomNum(this.fontSizeMin, this.fontSizeMax) + 'px SimHei'
+        let x = (i + 1) * (this.contentWidth / (this.identifyCode.length + 1))
+        let y = this.randomNum(this.fontSizeMax, this.contentHeight - 5)
+        var deg = this.randomNum(-45, 45)
+        // 修改坐标原点和旋转角度
+        ctx.translate(x, y)
+        ctx.rotate(deg * Math.PI / 180)
+        ctx.fillText(txt, 0, 0)
+        // 恢复坐标原点和旋转角度
+        ctx.rotate(-deg * Math.PI / 180)
+        ctx.translate(-x, -y)
+      },
+      drawLine(ctx) {
+        // 绘制干扰线
+        for (let i = 0; i < 8; i++) {
+          ctx.strokeStyle = this.randomColor(this.lineColorMin, this.lineColorMax)
+          ctx.beginPath()
+          ctx.moveTo(this.randomNum(0, this.contentWidth), this.randomNum(0, this.contentHeight))
+          ctx.lineTo(this.randomNum(0, this.contentWidth), this.randomNum(0, this.contentHeight))
+          ctx.stroke()
+        }
+      },
+      drawDot(ctx) {
+        // 绘制干扰点
+        for (let i = 0; i < 100; i++) {
+          ctx.fillStyle = this.randomColor(0, 255)
+          ctx.beginPath()
+          ctx.arc(this.randomNum(0, this.contentWidth), this.randomNum(0, this.contentHeight), 1, 0, 2 * Math.PI)
+          ctx.fill()
+        }
+      }
+    },
+    watch: {
+      identifyCode() {
+        this.drawPic()
+      }
+    },
+    mounted() {
+      this.drawPic()
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .s-canvas {
+    height: 38px;
+
+    canvas {
+      margin-top: 1px;
+      margin-left: 8px;
+    }
+  }
+</style>

+ 39 - 44
src/views/operationLog/logManagement.vue

@@ -4,9 +4,9 @@
     <div class="center_css">
       <div class="top_css">
         <el-row>
-          <el-col :span="16" style="height: 45px">
+          <el-col :span="14" style="height: 45px">
             <span type="primary" class="batch_text">
-              <i class="el-icon-tickets"></i>数据列表</span>
+              </span>
             <el-button type="danger" plain icon="el-icon-delete" size="small" @click="delBtn()">删除</el-button>
             <el-button type="warning" plain icon="el-icon-download" size="small" class="top_btn" @click="exportBtn()">导出
             </el-button>
@@ -14,7 +14,7 @@
               range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
             </el-date-picker>
           </el-col>
-          <el-col :span="8" style="height: 45px">
+          <el-col :span="10" style="height: 45px">
             <div class="screen">
               <el-input class="find" placeholder="可按系统模块,操作人员进行筛选" @keyup.enter.native="find" v-model="searchkeyWord"
                 clearable @change="find"></el-input>
@@ -100,29 +100,29 @@
     logList,
     delInfo,
     exportInfo
-  } from "@/api/operationLog";
+  } from '@/api/operationLog';
   export default {
     components: {
-      "el-image-viewer": () =>
-        import("element-ui/packages/image/src/image-viewer"),
+      'el-image-viewer': () =>
+        import('element-ui/packages/image/src/image-viewer'),
     },
     data() {
       return {
         tableData: [],
         //筛选
-        searchkeyWord: "",
+        searchkeyWord: '',
         //分页
         currentPage: 1,
         pageSize: 10,
         deptBudgetTotal: 0,
         deptCircularPage: {},
-        search: "",
+        search: '',
         //图片预览
         srcList: [],
         imgsVisible: false,
         //筛选时间
-        startDate: "",
-        endDate: "",
+        startDate: '',
+        endDate: '',
         value1: [],
         //批量
         musterList: [],
@@ -139,28 +139,28 @@
       let date1 = new Date().setTime(date.getTime() - 24 * 60 * 60 * 1000); //一天前的时间蹉
       date1 = new Date(parseInt(date1))
         .toLocaleString()
-        .split(" ")[0]
-        .replaceAll("/", "-");
+        .split(' ')[0]
+        .replaceAll('/', '-');
       console.log(date1);
 
       this.startDate =
-        date1.split("-")[0] +
-        "-" +
-        (date1.split("-")[1] < 10 ?
-          "0" + date1.split("-")[1] :
-          date1.split("-")[1]) +
-        "-" +
-        (date1.split("-")[2] < 10 ?
-          "0" + date1.split("-")[2] :
-          date1.split("-")[2]);
+        date1.split('-')[0] +
+        '-' +
+        (date1.split('-')[1] < 10 ?
+          '0' + date1.split('-')[1] :
+          date1.split('-')[1]) +
+        '-' +
+        (date1.split('-')[2] < 10 ?
+          '0' + date1.split('-')[2] :
+          date1.split('-')[2]);
       this.endDate =
         date.getFullYear() +
-        "-" +
+        '-' +
         (date.getMonth() + 1 < 10 ?
-          "0" + (date.getMonth() + 1) :
+          '0' + (date.getMonth() + 1) :
           date.getMonth()) +
-        "-" +
-        (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()); //當前時間
+        '-' +
+        (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()); //當前時間
       this.value1 = [this.startDate, this.endDate];
       this.getList();
     },
@@ -182,14 +182,14 @@
           endDate: this.formInfo.endDate,
         }).then((response) => {
           let blob = response.data;
-          let a = document.createElement("a");
+          let a = document.createElement('a');
           //由于后台返回文件名称是通过response返回的
           //因此需要从response headers中content-disposition响应头中获取文件名称fileName,如上图所示
-          let headers = response.headers;
-          let fileName = headers["content-disposition"];
-          fileName = fileName.split('=')[1]
+          // let headers = response.headers;
+          // let fileName = headers["content-disposition"];
+          // fileName = fileName.split('=')[1]
           //download是a标签的一个属性,可以自定义文件名称
-          a.download = "日志记录.xlsx";
+          a.download = '日志记录.xlsx';
           let binaryData = [];
           binaryData.push(blob);
           // a.href = URL.createObjectURL(blob);
@@ -197,12 +197,6 @@
           document.body.appendChild(a);
           a.click();
           document.body.removeChild(a);
-          //  downloadFile({
-          // res: response,
-          // fileName: `导出日志记录`,
-          // type: "xls",
-          // });
-
         });
         // const {
         //   data
@@ -222,22 +216,22 @@
       },
       delBtn() {
         if (this.musterList.length == 0) {
-          this.$message.error("请勾选操作的条目!");
+          this.$message.error('请勾选操作的条目!');
           return;
         }
-        this.$confirm("确定删除信息?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
+        this.$confirm('确定删除信息?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
         }).then(() => {
           delInfo({
             hyOperLogList: this.musterList
           }).then((response) => {
             if (response.code == 200) {
               this.$notify({
-                title: "成功",
-                message: "删除成功!",
-                type: "success",
+                title: '成功',
+                message: '删除成功!',
+                type: 'success',
               });
               this.getList();
             }
@@ -362,6 +356,7 @@
         text-align: center;
         line-height: 40px;
         color: #666666;
+        min-width: 80px;
       }
     }
 

+ 8 - 1
src/views/parkReportManagement/driverInformationReporting.vue

@@ -98,7 +98,14 @@
             </el-tooltip>
           </template>
         </el-table-column>
-        <el-table-column prop="escalationStatus" label="状态" min-width="100"></el-table-column>
+        <el-table-column prop="escalationStatus" label="状态" min-width="100">
+          <template slot-scope="scope">
+            <span>{{scope.row.escalationStatus}}</span>
+              <el-tooltip class="item" effect="dark" content="提示文字" placement="top" v-if="scope.row.escalationStatus == '未通过'">
+                 <img src="../../../public/img/wenhao.png" alt="" class="ask_css" />
+              </el-tooltip>
+          </template>
+        </el-table-column>
         <el-table-column label="操作" min-width="200">
           <template slot-scope="scope">
             <el-link target="_blank" @click="see(scope.row)" type="primary" :underline="false"

+ 35 - 34
src/views/permissionSetting/permissionSetting.vue

@@ -83,11 +83,11 @@
     getRoleInfo,
     getTenantlist,
     bindResources
-  } from "@/api/permissionSettingManagement";
+  } from '@/api/permissionSettingManagement';
   export default {
     components: {
-      "el-image-viewer": () =>
-        import("element-ui/packages/image/src/image-viewer"),
+      'el-image-viewer': () =>
+        import('element-ui/packages/image/src/image-viewer'),
     },
     data() {
       return {
@@ -121,8 +121,8 @@
       async initDict() {
         // 获取部门
         const resp2 = await getDeptPageByCompId({
-          compId: localStorage.getItem("enterprise-front-companyId"),
-          vesselBankFlag: "V"
+          compId: localStorage.getItem('enterprise-front-companyId'),
+          vesselBankFlag: 'V'
         });
         this.deptList = resp2.records;
         await this.getList();
@@ -173,13 +173,13 @@
                 _defaultOpeneds.push(value2.serviceId);
                 _defaultOpeneds.push(value.pluginId);
               }
-              this.$set(value2, "featureCheckeds", _featureCheckeds);
+              this.$set(value2, 'featureCheckeds', _featureCheckeds);
             });
           });
-          this.$set(this, "defaultOpeneds", _defaultOpeneds);
+          this.$set(this, 'defaultOpeneds', _defaultOpeneds);
           this.loadingRoleRan = false;
         } catch (error) {
-          if (error.code && error.code !== "200") this.$message(error.message);
+          if (error.code && error.code !== '200') this.$message(error.message);
         }
       },
       // 初始化插件树
@@ -196,11 +196,11 @@
                 value2.featureCheckeds = [];
               });
             });
-            this.$set(this, "queryList", resp4.data);
+            this.$set(this, 'queryList', resp4.data);
             console.log('lsit', this.queryList)
           }
         } catch (error) {
-          if (error.code && error.code !== "200") this.$message(error.message);
+          if (error.code && error.code !== '200') this.$message(error.message);
         }
       },
       submit() {
@@ -211,18 +211,18 @@
 
         if (this.deptTitle == '添加') {
           let _obj = {
-            compId: "2710b21efc1e4393930c5dc800010dc4",
-            deptId: "3d7dbdc962ca4a96a48522c9ee528bc3",
+            compId: '2710b21efc1e4393930c5dc800010dc4',
+            deptId: '3d7dbdc962ca4a96a48522c9ee528bc3',
             roleName: this.Info.newsTitle,
-            underCompId: "2710b21efc1e4393930c5dc800010dc4",
-            underCompName: "黑龙江中天昊元贸易有限公司",
-            vesselBankFlag: "B"
+            underCompId: '2710b21efc1e4393930c5dc800010dc4',
+            underCompName: '黑龙江中天昊元贸易有限公司',
+            vesselBankFlag: 'B'
           }
           create(_obj).then((response) => {
               this.$notify({
-                title: "成功",
-                message: "添加成功!",
-                type: "success",
+                title: '成功',
+                message: '添加成功!',
+                type: 'success',
               });
               this.sendInfoClose();
               this.listLoading = false;
@@ -230,9 +230,9 @@
             })
             .catch((error) => {
               this.$notify({
-                title: "失败",
+                title: '失败',
                 message: error,
-                type: "error",
+                type: 'error',
               });
               this.sendInfoClose();
             });
@@ -240,9 +240,9 @@
           this.selectRow.roleName = this.Info.newsTitle
           changeInfo(this.selectRow).then((response) => {
               this.$notify({
-                title: "成功",
-                message: "编辑成功!",
-                type: "success",
+                title: '成功',
+                message: '编辑成功!',
+                type: 'success',
               });
               this.sendInfoClose();
               this.listLoading = false;
@@ -250,9 +250,9 @@
             })
             .catch((error) => {
               this.$notify({
-                title: "失败",
+                title: '失败',
                 message: error,
-                type: "error",
+                type: 'error',
               });
               this.sendInfoClose();
             });
@@ -275,10 +275,10 @@
       },
       getList() {
         let _data = {
-          compId: "2710b21efc1e4393930c5dc800010dc4",
+          compId: '2710b21efc1e4393930c5dc800010dc4',
           pageSize: 10,
           currentPage: 1,
-          vesselBankFlag: "B"
+          vesselBankFlag: 'B'
         }
         getList(_data)
           .then((res) => {
@@ -289,17 +289,18 @@
           });
       },
       addJump() {
-        this.deptTitle = "添加";
+        this.deptTitle = '添加';
         this.sendInfo = true
       },
       editInfo(val) {
-        this.deptTitle = "编辑";
+        this.deptTitle = '编辑';
         this.Info.newsTitle = val.roleName
         this.sendInfo = true
         this.selectRow = val
 
       },
       setInfo(val) {
+        // debugger
         this.showRoleRan(val)
       },
       // 保存权限范围
@@ -325,13 +326,13 @@
           };
           await bindResources(data);
           this.$message({
-            message: "保存成功!",
-            type: "success"
+            message: '保存成功!',
+            type: 'success'
           });
           this.addRoleRanFlag = false;
           this.getList();
         } catch (error) {
-          if (error.code && error.code !== "200") this.$message(error.message);
+          if (error.code && error.code !== '200') this.$message(error.message);
         }
       },
       allSelect(data) {
@@ -342,9 +343,9 @@
           sour.forEach((value, index) => {
             _selected.push(value.featureId);
           });
-          this.$set(data, "featureCheckeds", _selected);
+          this.$set(data, 'featureCheckeds', _selected);
         } else {
-          this.$set(data, "featureCheckeds", []);
+          this.$set(data, 'featureCheckeds', []);
         }
       }
     },

+ 2 - 2
vue.config.js

@@ -55,8 +55,8 @@ module.exports = {
         },
         proxy: {
             '/pb': {
-                // target: 'http://192.168.110.67:8099/', 
-                target: 'http://192.168.110.9:8099/',       
+                target: 'http://192.168.110.9:8099/', 
+                // target: 'http://192.168.110.9:8099/',       
                 // target: 'https://apitest.eliangeyun.com',
                 changeOrigin: true, // 开启代理:在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题
                 pathRewrite: {