yuwenjun1997 3 سال پیش
والد
کامیت
93c1d7ffd6
40فایلهای تغییر یافته به همراه1265 افزوده شده و 872 حذف شده
  1. 3 2
      .prettierrc
  2. 1 1
      package.json
  3. 4 4
      src/layout/components/Navbar.vue
  4. 0 2
      src/main.js
  5. 24 71
      src/permission.js
  6. 2 2
      src/router/index.js
  7. 16 16
      src/router/module/audit.js
  8. 3 3
      src/router/module/club.js
  9. 2 2
      src/router/module/doctor.js
  10. 4 4
      src/router/module/supplier.js
  11. 2 11
      src/store/index.js
  12. 9 1
      src/store/modules/app.js
  13. 1 6
      src/store/modules/errorLog.js
  14. 5 24
      src/store/modules/permission.js
  15. 3 6
      src/store/modules/settings.js
  16. 14 27
      src/store/modules/tagsView.js
  17. 57 105
      src/store/modules/user.js
  18. 14 15
      src/utils/auth.js
  19. 1 1
      src/views/admin/audit/club/device/index.vue
  20. 1 1
      src/views/admin/audit/club/index.vue
  21. 2 2
      src/views/admin/audit/club/list.vue
  22. 1 1
      src/views/admin/audit/material/article/index.vue
  23. 1 1
      src/views/admin/audit/material/image/index.vue
  24. 4 4
      src/views/admin/audit/material/index.vue
  25. 1 1
      src/views/admin/supplier/club/device/detail.vue
  26. 1 1
      src/views/admin/supplier/club/device/index.vue
  27. 2 2
      src/views/admin/supplier/club/index.vue
  28. 2 2
      src/views/admin/supplier/edit.vue
  29. 3 3
      src/views/admin/supplier/index.vue
  30. 400 0
      src/views/common/helper/document/index.vue
  31. 400 0
      src/views/common/helper/video/index.vue
  32. 5 17
      src/views/login/index.vue
  33. 1 1
      src/views/normal/club/device/edit.vue
  34. 2 2
      src/views/normal/club/device/index.vue
  35. 264 516
      src/views/normal/club/edit.vue
  36. 4 9
      src/views/normal/club/index.vue
  37. 1 1
      src/views/normal/doctor/edit.vue
  38. 1 1
      src/views/normal/material/article/edit.vue
  39. 2 2
      src/views/normal/material/article/index.vue
  40. 2 2
      src/views/normal/material/image/index.vue

+ 3 - 2
.prettierrc

@@ -1,5 +1,6 @@
 {
   "semi": false,
   "singleQuote": true,
-  "printWidth": 120
-}
+  "printWidth": 120,
+  "trailingComma": "none"
+}

+ 1 - 1
package.json

@@ -110,4 +110,4 @@
     "type": "git",
     "url": "git+https://github.com/PanJiaChen/vue-element-admin.git"
   }
-}
+}

+ 4 - 4
src/layout/components/Navbar.vue

@@ -76,10 +76,10 @@ export default {
       this.$message.success('已退出当前账号')
       setTimeout(() => {
         // 退出登录重置用户信息
-        this.$store.dispatch('user/logout')
-        // 重置相关state
-        this.$store.dispatch('resetState')
-        this.$router.replace('/login')
+        this.$store.dispatch('user/logout').then(() => {
+          // 重置相关state
+          this.$router.replace('/login')
+        })
       }, 500)
     },
     proxyLogout() {

+ 0 - 2
src/main.js

@@ -6,8 +6,6 @@ import 'normalize.css/normalize.css' // a modern alternative to CSS resets
 
 import Element from 'element-ui'
 import './styles/element-variables.scss'
-// import enLang from 'element-ui/lib/locale/lang/en'// 如果使用中文语言包请默认支持,无需额外引入,请删除该依赖
-
 import '@/styles/index.scss' // global css
 
 import App from './App'

+ 24 - 71
src/permission.js

@@ -1,95 +1,48 @@
-import router, { resetRouter } from './router'
-import store from './store'
-import { Message } from 'element-ui'
-import { hasLogin, initGoPage } from '@/utils/auth'
-import { createHash } from '@/utils/tools'
-import getPageTitle from '@/utils/get-page-title'
+import router from '@/router'
 
-// 不用拦截的路由
-const whiteList = ['/login', '/auth-redirect']
-// 需要添加跳转限制的路由,防止数据冲突
-const toSupplier = ['/supplier/list', '/supplier']
+import store from '@/store'
 
-// 重置登录信息和路由信息及标签页信息
-const resetState = () => {
-  store.dispatch('user/logout')
-  store.dispatch('resetState')
+import { getToken, getUserInfo, initGoPage } from '@/utils/auth'
+// 获取用户信息
+const userInfo = getUserInfo()
+if (userInfo) {
+  store.commit('user/SAVE_USER_INOF', userInfo)
 }
 
-// 是否开启会话 条件:当前用户为管理员 && socket对象已创建成功
-const isOpenSocket = () => {
-  return store.getters.openSoket && !store.getters.socketState && store.getters.userIdentity === 1
-}
+// 路由白名单
+const whiteList = ['/login']
 
+// 路由拦截器
 router.beforeEach(async(to, from, next) => {
-  // 设置页面名称
-  document.title = getPageTitle(to.meta.title)
-  const proxyInfo = store.getters.proxyInfo
-  const isChangeProxy = store.getters.isChangeProxy
-  // 如果登录过
-  if (hasLogin()) {
-    /**
-     * 满足要求则关闭所有标签,防止代理数据冲突
-     * 条件:1、sotre中存有代理数据 即 proxyInfo !== null
-     *      2、即将跳转的页面为 /supplier/list 或者 /supplier
-     */
-    if (toSupplier.includes(to.path) && store.getters.proxyInfo !== null) {
-      store.dispatch('tagsView/delAllProxyView')
-      store.commit('user/SET_PROXY_INFO', null)
-    }
-    // 是否需要初始化路由
-    const hasInitRouter = store.getters.initRouter
-    // 在登录状态下访问login页面,直接跳转到首页
-    if (to.path === '/login' && hasInitRouter) {
-      next(initGoPage())
+  // 获取token
+  const hasToken = getToken()
+  if (hasToken) {
+    // 如果是访问登录页面,强制跳转到首页
+    if (to.path === '/login') {
+      next({ path: initGoPage() })
     } else {
       // 加载国家列表
       store.dispatch('app/setCountry')
-      // 如果路由已经初始化则不需要再次初始化路由
-      if (hasInitRouter && !isChangeProxy) {
+      // 角色判断
+      const hasRoles = store.getters.roles && store.getters.roles.length > 0
+      if (hasRoles) {
         next()
       } else {
         try {
-          // 是否需要登录代理数据
-          if (proxyInfo !== null) {
-            store.dispatch('user/proxyLogin', proxyInfo) // 代理登录 模拟
-          }
-          resetRouter()
-          console.log(router)
-          store.commit('proxy/CHANGE_PROXY_STATE', false)
-          store.dispatch('resetState')
-          // 设置路由的初始化状态
-          store.commit('permission/RESET_STATE')
-          store.commit('permission/SET_INITROUTER', true)
-          const accessRoutes = await store.dispatch('permission/generateRoutes', store.getters.roles)
-          // 设置路由
+          const roles = await store.dispatch('user/getRoles')
+          const accessRoutes = await store.dispatch('permission/generateRoutes', roles)
           router.addRoutes(accessRoutes)
-          // 初始化会话信息
-          if (isOpenSocket()) {
-            store.dispatch('webSocket/initMessage')
-          }
-          // 放行
           next({ ...to, replace: true })
-        } catch (error) {
-          Message.error(error || '未知错误,请重新登录')
-          // 重置登录信息和路由信息及标签页信息
-          resetState()
-          next(`/login?redirect=${to.path}`)
+        } catch (err) {
+          store.dispatch('user/logout')
         }
       }
     }
   } else {
-    // 重置登录信息和路由信息及标签页信息
-    resetState()
-    // token不存在并且访问的路由非拦截路由
     if (whiteList.indexOf(to.path) !== -1) {
-      // 允许访问
       next()
     } else {
-      // 跳转到登录页面
-      Message({ message: '登录失效,请重新登录!', duration: 1500 })
-      next(`/login?cm=${createHash(6)}`)
-      return
+      next(`/login?redirect=${to.path}`)
     }
   }
 })

+ 2 - 2
src/router/index.js

@@ -18,8 +18,8 @@ export const asyncRoutes = [
   ...AuditRoutes,
   ...clubRoutes,
   ...doctorRoutes,
-  ...feedbackRoutes,
   ...materialRoutes,
+  ...feedbackRoutes,
   ...helperRoutes,
   // 404页面 放在最后面
   { path: '*', redirect: '/404', hidden: true }
@@ -48,7 +48,7 @@ export const constantRoutes = [
   },
   {
     path: '/proxy',
-    component: () => import(/* webpackChunkName: "proxy" */ '@/views/authentic/proxy/proxy'),
+    component: () => import(/* webpackChunkName: "proxy" */ '@/views/proxy'),
     hidden: true
   }
 ]

+ 16 - 16
src/router/module/audit.js

@@ -7,35 +7,35 @@ const clubAuditRoutes = [
     path: 'club',
     component: () => import('@/views/admin/audit/club'),
     name: 'AuditClub',
-    meta: { title: '机构认证', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+    meta: { title: '机构认证', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club1' }
   },
   {
     path: 'club-list',
     hidden: true,
     component: () => import('@/views/admin/audit/club/list'),
     name: 'AuditClubList',
-    meta: { title: '机构认证审核', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+    meta: { title: '机构认证审核', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club2' }
   },
   {
     path: 'club-detail',
     hidden: true,
     component: () => import('@/views/admin/audit/club/review'),
     name: 'AuditClubDetail',
-    meta: { title: '机构认证审核详情', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+    meta: { title: '机构认证审核详情', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club3' }
   },
   {
     path: 'club-device-list',
     hidden: true,
     component: () => import('@/views/admin/audit/club/device'),
     name: 'AuditClubDeviceList',
-    meta: { title: '设备审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+    meta: { title: '设备审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club4' }
   },
   {
     path: 'club-device-detail',
     hidden: true,
     component: () => import('@/views/admin/audit/club/device/review'),
     name: 'AuditClubDeviceDetail',
-    meta: { title: '设备审核详情', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+    meta: { title: '设备审核详情', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club4' }
   }
 ]
 
@@ -45,21 +45,21 @@ const doctorAuditRoutes = [
     path: 'doctor',
     component: () => import('@/views/admin/audit/doctor'),
     name: 'AuditDoctor',
-    meta: { title: '医师认证', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+    meta: { title: '医师认证', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club6' }
   },
   {
     path: 'doctor-list',
     hidden: true,
     component: () => import('@/views/admin/audit/doctor/list'),
     name: 'AuditDoctorList',
-    meta: { title: '医师审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+    meta: { title: '医师审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club7' }
   },
   {
     path: 'doctor-detail',
     hidden: true,
     component: () => import('@/views/admin/audit/doctor/review'),
     name: 'AuditDoctorDetail',
-    meta: { title: '医师审核详情', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+    meta: { title: '医师审核详情', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club8' }
   }
 ]
 
@@ -69,49 +69,49 @@ const materialAuditRoutes = [
     path: 'material',
     component: () => import('@/views/admin/audit/material'),
     name: 'AuditMaterial',
-    meta: { title: '资料库', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+    meta: { title: '资料库', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club9' }
   },
   {
     path: 'material/article-list',
     component: () => import('@/views/admin/audit/material/article'),
     name: 'AuditMaterialArticleList',
     hidden: true,
-    meta: { title: '文章审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+    meta: { title: '文章审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club10' }
   },
   {
     path: 'material/article-detail',
     component: () => import('@/views/admin/audit/material/article/review'),
     name: 'AuditMaterialArticleDetail',
     hidden: true,
-    meta: { title: '审核文章', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+    meta: { title: '审核文章', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club11' }
   },
   {
     path: 'material/image-list',
     component: () => import('@/views/admin/audit/material/image'),
     name: 'AuditMaterialImageList',
     hidden: true,
-    meta: { title: '图片审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+    meta: { title: '图片审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club12' }
   },
   {
     path: 'material/image-detail',
     component: () => import('@/views/admin/audit/material/image/review'),
     name: 'AuditMaterialImageDetail',
     hidden: true,
-    meta: { title: '审核图片', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+    meta: { title: '审核图片', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club3' }
   },
   {
     path: 'material/video-list',
     component: () => import('@/views/admin/audit/material/video'),
     name: 'AuditMaterialVideoList',
     hidden: true,
-    meta: { title: '视频审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+    meta: { title: '视频审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club4' }
   },
   {
     path: 'material/file-list',
     component: () => import('@/views/admin/audit/material/file'),
     name: 'AuditMaterialFileList',
     hidden: true,
-    meta: { title: '文件审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
+    meta: { title: '文件审核列表', icon: 'el-icon-menu', roles: ['admin'], noCache: true, id: 'club5' }
   }
 ]
 
@@ -122,7 +122,7 @@ const AuditRoutes = [
     component: Layout,
     alwaysShow: true,
     name: 'Audit',
-    meta: { title: '审核管理', icon: 'el-icon-s-check', roles: ['admin'], noCache: true, id: 38 },
+    meta: { title: '审核管理', icon: 'el-icon-s-check', roles: ['admin'], noCache: true },
     children: [...clubAuditRoutes, ...doctorAuditRoutes, ...materialAuditRoutes]
   }
 ]

+ 3 - 3
src/router/module/club.js

@@ -8,7 +8,7 @@ const clubRoutes = [
     alwaysShow: true,
     redirect: '/club/list',
     name: 'Club',
-    meta: { title: '机构认证', icon: 'el-icon-s-custom', roles: ['admin', 'normal'], noCache: true, proxy: true },
+    meta: { title: '机构认证', icon: 'el-icon-s-custom', roles: ['normal'], noCache: true, proxy: true },
     children: [
       // 机构
       {
@@ -49,10 +49,10 @@ const clubRoutes = [
       // 设备
       {
         hidden: true,
-        path: 'device',
+        path: 'device-list',
         component: () => import('@/views/normal/club/device'),
         name: 'ClubDeviceList',
-        meta: { title: '设备列表', icon: 'el-icon-menu', roles: ['admin', 'normal'], noCache: true, id: 24 }
+        meta: { title: '设备列表', icon: 'el-icon-menu', roles: ['normal'], noCache: true, id: 24 }
       },
       {
         hidden: true,

+ 2 - 2
src/router/module/doctor.js

@@ -27,14 +27,14 @@ const doctorRoutes = [
         hidden: true,
         path: 'add',
         component: () => import('@/views/normal/doctor/edit'),
-        name: 'DoctorList',
+        name: 'DoctorAdd',
         meta: { title: '添加医师', icon: 'el-icon-menu', roles: ['normal'], noCache: true, proxy: true }
       },
       {
         hidden: true,
         path: 'edit',
         component: () => import('@/views/normal/doctor/edit'),
-        name: 'DoctorList',
+        name: 'DoctorEdit',
         meta: { title: '修改医师资料', icon: 'el-icon-menu', roles: ['normal'], noCache: true, proxy: true }
       }
     ]

+ 4 - 4
src/router/module/supplier.js

@@ -35,28 +35,28 @@ const supplierRoutes = [
         hidden: true,
         path: 'club-list',
         component: () => import('@/views/admin/supplier/club'),
-        name: 'ClubList',
+        name: 'SupplierClubList',
         meta: { title: '查看认证机构', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
       },
       {
         hidden: true,
         path: 'club-detail',
         component: () => import('@/views/admin/supplier/club/detail'),
-        name: 'ClubDetail',
+        name: 'SupplierClubDetail',
         meta: { title: '认证机构详情', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
       },
       {
         hidden: true,
         path: 'club-device-list',
         component: () => import('@/views/admin/supplier/club/device'),
-        name: 'ClubDeviceList',
+        name: 'SupplierClubDeviceList',
         meta: { title: '查看设备认证', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
       },
       {
         hidden: true,
         path: 'club-device-detail',
         component: () => import('@/views/admin/supplier/club/device/detail'),
-        name: 'ClubDeviceDetail',
+        name: 'SupplierClubDeviceDetail',
         meta: { title: '设备认证详情', icon: 'el-icon-menu', roles: ['admin'], noCache: true }
       }
     ]

+ 2 - 11
src/store/index.js

@@ -1,7 +1,7 @@
 import Vue from 'vue'
 import Vuex from 'vuex'
 import getters from './getters'
-import { closeWebSocket } from '@/utils/WebSocketUtil'
+// import { closeWebSocket } from '@/utils/WebSocketUtil'
 
 Vue.use(Vuex)
 
@@ -20,16 +20,7 @@ const { modules } = loadModules()
 // 创建store
 const store = new Vuex.Store({
   modules,
-  getters,
-  actions: {
-    // 重置部分state
-    resetState({ commit }) {
-      commit('permission/RESET_STATE') // 重置路由
-      commit('tagsView/RESET_STATE') // 重置标签
-      commit('webSocket/CLEAR_MESSAGE') // 重置消息列表
-      closeWebSocket()
-    }
-  }
+  getters
 })
 
 export default store

+ 9 - 1
src/store/modules/app.js

@@ -1,5 +1,5 @@
-import Cookies from 'js-cookie'
 import { getCountry } from '@/api/common'
+import Cookies from 'js-cookie'
 
 const state = {
   sidebar: {
@@ -7,6 +7,7 @@ const state = {
     withoutAnimation: false
   },
   device: 'desktop',
+  language: Cookies.get('language') || 'en',
   size: Cookies.get('size') || 'medium',
   countryList: []
 }
@@ -29,6 +30,10 @@ const mutations = {
   TOGGLE_DEVICE: (state, device) => {
     state.device = device
   },
+  SET_LANGUAGE: (state, language) => {
+    state.language = language
+    Cookies.set('language', language)
+  },
   SET_SIZE: (state, size) => {
     state.size = size
     Cookies.set('size', size)
@@ -49,6 +54,9 @@ const actions = {
   toggleDevice({ commit }, device) {
     commit('TOGGLE_DEVICE', device)
   },
+  setLanguage({ commit }, language) {
+    commit('SET_LANGUAGE', language)
+  },
   setSize({ commit }, size) {
     commit('SET_SIZE', size)
   },

+ 1 - 6
src/store/modules/errorLog.js

@@ -1,3 +1,4 @@
+
 const state = {
   logs: []
 }
@@ -5,18 +6,12 @@ const state = {
 const mutations = {
   ADD_ERROR_LOG: (state, log) => {
     state.logs.push(log)
-  },
-  CLEAR_ERROR_LOG: (state) => {
-    state.logs.splice(0)
   }
 }
 
 const actions = {
   addErrorLog({ commit }, log) {
     commit('ADD_ERROR_LOG', log)
-  },
-  clearErrorLog({ commit }) {
-    commit('CLEAR_ERROR_LOG')
   }
 }
 

+ 5 - 24
src/store/modules/permission.js

@@ -1,7 +1,7 @@
 import { asyncRoutes, constantRoutes } from '@/router'
 
 /**
- * Use meta.role to determine if the current user has permission
+ * 通过meta.role判断是否与当前用户权限匹配
  * @param roles
  * @param route
  */
@@ -14,7 +14,7 @@ function hasPermission(roles, route) {
 }
 
 /**
- * Filter asynchronous routing tables by recursion
+ * 递归过滤异步路由表,返回符合用户角色权限的路由表
  * @param routes asyncRoutes
  * @param roles
  */
@@ -36,44 +36,25 @@ export function filterAsyncRoutes(routes, roles) {
 
 const state = {
   routes: [],
-  addRoutes: [],
-  initRouter: false
+  addRoutes: []
 }
 
 const mutations = {
   SET_ROUTES: (state, routes) => {
     state.addRoutes = routes
     state.routes = constantRoutes.concat(routes)
-  },
-  SET_INITROUTER: (state, flag) => {
-    state.initRouter = flag
-  },
-  RESET_STATE: (state) => {
-    state.routes = []
-    state.addRoutes = []
-    state.initRouter = false
   }
 }
 
 const actions = {
   generateRoutes({ commit }, roles) {
     return new Promise(resolve => {
-      let accessedRoutes = []
-      // 开启后admin可以访问所有的路由
+      const accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
       // if (roles.includes('admin')) {
-      //   accessedRoutes = asyncRoutes || []
+      //   accessedRoutes = asyncRoutes
       // } else {
       //   accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
       // }
-      accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
-      if (roles.includes('admin')) {
-        accessedRoutes.forEach((item, index) => {
-          if (item.name === 'Auth') {
-            item.hidden = 'true'
-            item.children[0].meta.affix = false
-          }
-        })
-      }
       commit('SET_ROUTES', accessedRoutes)
       resolve(accessedRoutes)
     })

+ 3 - 6
src/store/modules/settings.js

@@ -1,15 +1,12 @@
-import variables from '@/styles/element-variables.scss'
 import defaultSettings from '@/settings'
-
-const { showSettings, tagsView, fixedHeader, sidebarLogo, openSoket } = defaultSettings
+const { showSettings, tagsView, fixedHeader, sidebarLogo, theme } = defaultSettings
 
 const state = {
-  theme: variables.theme,
+  theme: theme,
   showSettings: showSettings,
   tagsView: tagsView,
   fixedHeader: fixedHeader,
-  sidebarLogo: sidebarLogo,
-  openSoket: openSoket
+  sidebarLogo: sidebarLogo
 }
 
 const mutations = {

+ 14 - 27
src/store/modules/tagsView.js

@@ -1,3 +1,4 @@
+
 const state = {
   visitedViews: [],
   cachedViews: []
@@ -28,8 +29,13 @@ const mutations = {
     }
   },
   DEL_CACHED_VIEW: (state, view) => {
-    const index = state.cachedViews.indexOf(view.name)
-    index > -1 && state.cachedViews.splice(index, 1)
+    for (const i of state.cachedViews) {
+      if (i === view.name) {
+        const index = state.cachedViews.indexOf(i)
+        state.cachedViews.splice(index, 1)
+        break
+      }
+    }
   },
 
   DEL_OTHERS_VISITED_VIEWS: (state, view) => {
@@ -38,12 +44,12 @@ const mutations = {
     })
   },
   DEL_OTHERS_CACHED_VIEWS: (state, view) => {
-    const index = state.cachedViews.indexOf(view.name)
-    if (index > -1) {
-      state.cachedViews = state.cachedViews.slice(index, index + 1)
-    } else {
-      // if index = -1, there is no cached tags
-      state.cachedViews = []
+    for (const i of state.cachedViews) {
+      if (i === view.name) {
+        const index = state.cachedViews.indexOf(i)
+        state.cachedViews = state.cachedViews.slice(index, index + 1)
+        break
+      }
     }
   },
 
@@ -63,21 +69,6 @@ const mutations = {
         break
       }
     }
-  },
-
-  // 关闭所有可被代理的页面
-  DEL_ALL_PROXY_VIEW: state => {
-    let i = state.visitedViews.length
-    while (i--) {
-      if (state.visitedViews[i].meta?.proxy) {
-        state.visitedViews.splice(i, 1)
-      }
-    }
-  },
-
-  RESET_STATE: (state) => {
-    state.visitedViews = []
-    state.cachedViews = []
   }
 }
 
@@ -164,10 +155,6 @@ const actions = {
 
   updateVisitedView({ commit }, view) {
     commit('UPDATE_VISITED_VIEW', view)
-  },
-
-  delAllProxyView({ commit }) {
-    commit('DEL_ALL_PROXY_VIEW')
   }
 }
 

+ 57 - 105
src/store/modules/user.js

@@ -1,77 +1,50 @@
 import { login } from '@/api/user'
-import { getToken, setToken, removeToken, setUser, getUser, removeUser } from '@/utils/auth'
 import { resetRouter } from '@/router'
-const userInfo = getUser() && JSON.parse(getUser())
+import { getToken, removeToken, removeUserInfo, setToken, setUserInfo } from '@/utils/auth'
 
+// 处理角色权限
 const formatRoles = userIdentity => {
-  let roles = []
-  switch (userIdentity) {
-    case 1:
-      roles = ['admin']
-      break
-    case 2:
-      roles = ['normal']
-      break
-    default:
-      roles = []
-      break
+  if (userIdentity === 1) {
+    return ['admin']
   }
-  return roles
+  if (userIdentity === 2) {
+    return ['normal']
+  }
+  return []
 }
 
+// 角色状态
 const state = {
   token: getToken(),
-  name: userInfo?.name || '',
-  roles: formatRoles(userInfo?.userIdentity),
-  shopStatus: userInfo?.shopStatus || '',
-  authUserId: userInfo?.authUserId || '',
-  userIdentity: userInfo?.userIdentity || '',
-  proxyInfo: null,
-  shopType: userInfo?.shopType || '',
-  brandId: userInfo?.brandId || '',
-  copyUserInfo: userInfo // 原始登录用户信息
+  name: '',
+  roles: [],
+  shopStatus: '',
+  authUserId: '',
+  userIdentity: '',
+  shopType: '',
+  brandId: '',
+  userInfo: null,
+  proxyInfo: null
 }
 
 const mutations = {
-  // 设置token
-  SET_TOKEN: (state, token) => {
-    state.token = token
-  },
-  // 设置用户名
-  SET_NAME: (state, name) => {
-    state.name = name
-  },
-  // 设置角色
-  SET_ROLES: (state, roles) => {
-    state.roles = roles
-  },
-  // 设置用户信息
-  SET_USERINFO: (state, userInfo) => {
-    state.shopStatus = userInfo.shopStatus
-    state.authUserId = userInfo.authUserId
-    state.userIdentity = userInfo.userIdentity
-    state.shopType = userInfo.shopType
-    state.brandId = userInfo.brandId
+  // 重置用户信息
+  SAVE_USER_INOF: (state, playload) => {
+    const userInfo = playload
+    state.name = userInfo.name || ''
+    state.shopStatus = userInfo.shopStatus || ''
+    state.authUserId = userInfo.authUserId || ''
+    state.userIdentity = userInfo.userIdentity || ''
+    state.shopType = userInfo.shopType || ''
+    state.brandId = userInfo.brandId || ''
   },
-  // 设置代理供应商信息
-  SET_PROXY_INFO: (state, proxyInfo) => {
-    state.proxyInfo = proxyInfo
-  },
-  // 设置供应商类型
-  SET_SHOP_TYPE: (state, shopType) => {
-    state.shopType = shopType
+  // 设置token
+  SET_TOKEN: (state, playload) => {
+    state.token = playload
   },
-  // 重置用户状态
-  RESET_STATE: state => {
-    state.token = getToken()
-    state.name = userInfo?.name || ''
-    state.roles = formatRoles(userInfo?.userIdentity)
-    state.shopStatus = userInfo?.shopStatus || ''
-    state.authUserId = userInfo?.authUserId || ''
-    state.userIdentity = userInfo?.userIdentity || ''
-    state.proxyInfo = null
-    state.shopType = userInfo?.shopType || ''
-    state.brandId = userInfo?.brandId || ''
+  // 设置用户角色
+  SET_ROLES: (state, playload) => {
+    state.roles = playload
   }
 }
 
@@ -79,55 +52,34 @@ const actions = {
   // 登录操作
   login({ commit }, userInfo) {
     const { username, password } = userInfo
-    return new Promise((resolve, reject) => {
-      login({ mobileOrName: username.trim(), password: password })
-        .then(response => {
-          console.log(response)
-          const { token, userIdentity, name } = response.data
-          commit('SET_TOKEN', token) // 保存token
-          commit('SET_USERINFO', response.data) // 保存用户信息
-          commit('SET_ROLES', formatRoles(userIdentity)) // 根据用户类型生成角色列表
-          commit('SET_NAME', name) // 保存用户名称
-          setToken(token) // cokies保存token
-          setUser(response.data) // cokies保存当前用户信息
-          resolve()
-        })
-        .catch(error => {
-          reject(error)
-        })
-    })
-  },
-  // 代理用户登录
-  proxyLogin({ commit }, proxy) {
-    const { name, userIdentity } = proxy
-    commit('SET_USERINFO', proxy)
-    commit('SET_ROLES', formatRoles(userIdentity)) // 根据用户类型生成角色列表
-    commit('SET_NAME', name) // 保存用户名称
+    return login({ mobileOrName: username.trim(), password: password })
+      .then(res => {
+        console.log(res)
+        setToken(res.data.token)
+        setUserInfo(res.data)
+        commit('SAVE_USER_INOF', res.data)
+        commit('SET_TOKEN', res.data.token)
+        // 处理路由
+      }).catch(() => {
+        commit('SAVE_USER_INOF', {})
+        commit('SET_TOKEN', '')
+        commit('SET_ROLES', [])
+      })
   },
-  // 代理用户登出
-  proxyLogout({ commit }) {
-    // 从cookie中重新获取用户信息
-    const userInfo = getUser() && JSON.parse(getUser())
-    commit('SET_USERINFO', userInfo)
-    commit('SET_ROLES', formatRoles(userInfo.userIdentity)) // 根据用户类型生成角色列表
-    commit('SET_NAME', userInfo.name) // 保存用户名称
+  // 获取用户角色
+  getRoles({ commit, state }) {
+    const roles = formatRoles(state.userIdentity)
+    commit('SET_ROLES', roles)
+    return roles
   },
   // 退出登录
   logout({ commit }) {
-    commit('RESET_STATE')
-    removeToken() // 从cokies中移除token
-    resetRouter() // 重置路由
-    removeUser() // 从cokies中移除用户信息
-  },
-
-  // 移除token
-  resetToken({ commit }) {
-    return new Promise(resolve => {
-      commit('SET_TOKEN', '')
-      commit('SET_ROLES', [])
-      removeToken()
-      resolve()
-    })
+    removeToken()
+    removeUserInfo()
+    resetRouter()
+    commit('SAVE_USER_INOF', {})
+    commit('SET_TOKEN', '')
+    commit('SET_ROLES', [])
   }
 }
 

+ 14 - 15
src/utils/auth.js

@@ -17,28 +17,27 @@ export function removeToken() {
   return Cookies.remove(TokenKey)
 }
 
-// 设置用户信息
-export function setUser(userInfo) {
-  return Cookies.set('userInfo', userInfo)
-}
-
 // 获取用户信息
-export function getUser() {
-  return Cookies.get('userInfo')
+export function getUserInfo() {
+  return JSON.parse(localStorage.getItem('USER_INFO'))
 }
 
-// 移除用户信息
-export function removeUser() {
-  return Cookies.remove('userInfo')
+// 保存用户信息
+export function setUserInfo(userInfo) {
+  // if (userInfo.token) delete userInfo.token
+  localStorage.setItem('USER_INFO', JSON.stringify(userInfo))
 }
 
-// 用户是否登录
-export function hasLogin() {
-  return getToken() && getUser()
+// 移除用户信息
+export function removeUserInfo() {
+  localStorage.removeItem('USER_INFO')
 }
 
 // 跳转页面判定
 export function initGoPage() {
-  const isAdmin = JSON.parse(getUser()).userIdentity === 1
-  return isAdmin ? '/supplier/list' : '/auth/list'
+  const userInfo = getUserInfo()
+  if (!userInfo) {
+    return '/404'
+  }
+  return userInfo.userIdentity === 1 ? '/supplier/list' : '/club'
 }

+ 1 - 1
src/views/admin/audit/club/device/index.vue

@@ -85,7 +85,7 @@
       </el-table-column>
       <el-table-column label="操作" width="240px" align="center">
         <template slot-scope="{row}">
-          <el-button v-if="row.auditStatus !== 1" type="primary" icon="el-icon-s-check" size="mini" @click="$_navigationTo(`auth-shop-detail?id=${row.productId}&authId=${listQuery.authId}`)">审核</el-button>
+          <el-button v-if="row.auditStatus !== 1" type="primary" icon="el-icon-s-check" size="mini" @click="$_navigationTo(`club-device-detail?id=${row.productId}&authId=${listQuery.authId}`)">审核</el-button>
           <span v-else class="status success el-icon-check">&nbsp;已审核</span>
         </template>
       </el-table-column>

+ 1 - 1
src/views/admin/audit/club/index.vue

@@ -88,7 +88,7 @@
               type="primary"
               icon="el-icon-s-check"
               size="mini"
-              @click="$_navigationTo(`auth-list?authUserId=${row.authUserId}`)"
+              @click="$_navigationTo(`club-list?authUserId=${row.authUserId}`)"
             >机构认证审核</el-button>
           </el-badge>
         </template>

+ 2 - 2
src/views/admin/audit/club/list.vue

@@ -104,10 +104,10 @@
             size="mini"
             style="margin-right:5px"
             icon="el-icon-s-check"
-            @click="$_navigationTo(`auth-detail?authId=${row.authId}`)"
+            @click="$_navigationTo(`club-detail?authId=${row.authId}`)"
           >审核</el-button>
           <el-badge :hidden="row.lowerAuditStatus === 1" :value="row.waitAuditNum" :max="99">
-            <el-button icon="el-icon-s-shop" type="primary" size="mini" @click="$_navigationTo(`auth-shop-list?authId=${row.authId}`)">设备认证审核</el-button>
+            <el-button icon="el-icon-s-shop" type="primary" size="mini" @click="$_navigationTo(`club-device-list?authId=${row.authId}`)">设备认证审核</el-button>
           </el-badge>
         </template>
       </el-table-column>

+ 1 - 1
src/views/admin/audit/material/article/index.vue

@@ -90,7 +90,7 @@
             size="mini"
             style="margin-right:5px"
             icon="el-icon-s-check"
-            @click="$_navigationTo(`doc-article-detail?articleId=${row.articleId}`)"
+            @click="$_navigationTo(`/audit/material/article-detail?articleId=${row.articleId}`)"
           >审核</el-button>
           <span v-else class="status success el-icon-check">&nbsp;已审核</span>
         </template>

+ 1 - 1
src/views/admin/audit/material/image/index.vue

@@ -83,7 +83,7 @@
             size="mini"
             style="margin-right:5px"
             icon="el-icon-s-check"
-            @click="$_navigationTo(`doc-image-detail?imageId=${row.imageId}`)"
+            @click="$_navigationTo(`/audit/material/image-detail?imageId=${row.imageId}`)"
           >审核</el-button>
           <span v-else class="status success el-icon-check">&nbsp;已审核</span>
         </template>

+ 4 - 4
src/views/admin/audit/material/index.vue

@@ -88,7 +88,7 @@
               type="primary"
               icon="el-icon-tickets"
               size="mini"
-              @click="$_navigationTo(`doc-article-list?authUserId=${row.authUserId}`)"
+              @click="$_navigationTo(`material/article-list?authUserId=${row.authUserId}`)"
             >文章</el-button>
           </el-badge>
           <el-badge :hidden="row.imageWaitNum === 0" :value="row.imageWaitNum" :max="99">
@@ -96,7 +96,7 @@
               type="primary"
               icon="el-icon-picture-outline"
               size="mini"
-              @click="$_navigationTo(`doc-image-list?authUserId=${row.authUserId}`)"
+              @click="$_navigationTo(`material/image-list?authUserId=${row.authUserId}`)"
             >图片</el-button>
           </el-badge>
           <el-badge :hidden="row.videoWaitNum === 0" :value="row.videoWaitNum" :max="99">
@@ -104,7 +104,7 @@
               type="primary"
               icon="el-icon-video-camera"
               size="mini"
-              @click="$_navigationTo(`doc-video-list?authUserId=${row.authUserId}`)"
+              @click="$_navigationTo(`material/video-list?authUserId=${row.authUserId}`)"
             >视频</el-button>
           </el-badge>
           <el-badge :hidden="row.fileWaitNum === 0" :value="row.fileWaitNum" :max="99">
@@ -112,7 +112,7 @@
               type="primary"
               icon="el-icon-document-copy"
               size="mini"
-              @click="$_navigationTo(`doc-file-list?authUserId=${row.authUserId}`)"
+              @click="$_navigationTo(`material/file-list?authUserId=${row.authUserId}`)"
             >文件</el-button>
           </el-badge>
         </template>

+ 1 - 1
src/views/admin/supplier/club/device/detail.vue

@@ -50,7 +50,7 @@
 </template>
 
 <script>
-import UploadImage from '../../components/uploadImage'
+import UploadImage from '@/views/components/uploadImage.vue'
 import { saveProduct, getProductById } from '@/api/product'
 import { fetchBrandList } from '@/api/brand'
 import { mapGetters } from 'vuex'

+ 1 - 1
src/views/admin/supplier/club/device/index.vue

@@ -100,7 +100,7 @@
       </el-table-column>
       <el-table-column label="操作" align="center" width="240px" class-name="small-padding fixed-width">
         <template slot-scope="{row}">
-          <el-button type="primary" size="mini" @click="$_navigationTo(`auth-product-detail?id=${row.productId}`)">查看</el-button>
+          <el-button type="primary" size="mini" @click="$_navigationTo(`club-device-detail?id=${row.productId}`)">查看</el-button>
           <el-button type="primary" size="mini" :disabled="row.auditStatus !== 1" @click="handleShowQRcode(row)">
             二维码
           </el-button>

+ 2 - 2
src/views/admin/supplier/club/index.vue

@@ -102,10 +102,10 @@
       <!-- <el-table-column label="创建人" class-name="status-col" width="160px" prop="createBy" /> -->
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="{row}">
-          <el-button type="primary" size="mini" @click="$_navigationTo(`/supplier/auth-detail?id=${row.authId}&authParty=${row.authParty}`)">
+          <el-button type="primary" size="mini" @click="$_navigationTo(`club-detail?id=${row.authId}&authParty=${row.authParty}`)">
             查看
           </el-button>
-          <el-button type="primary" size="mini" @click="$_navigationTo(`/supplier/auth-product-list?id=${row.authId}&authParty=${row.authParty}`)">
+          <el-button type="primary" size="mini" @click="$_navigationTo(`club-device-list?id=${row.authId}&authParty=${row.authParty}`)">
             查看设备认证
           </el-button>
         </template>

+ 2 - 2
src/views/admin/supplier/edit.vue

@@ -236,8 +236,8 @@
 </template>
 
 <script>
-import UploadImage from '../components/uploadImage'
-import UploadFile from '../components/uploadFile'
+import UploadImage from '@/views/components/uploadImage'
+import UploadFile from '@/views/components/uploadFile'
 import UploadImageT from '@/components/UploadImage'
 import { mapGetters } from 'vuex'
 import { isMobile } from '@/utils/validate'

+ 3 - 3
src/views/admin/supplier/index.vue

@@ -24,7 +24,7 @@
       <span>联系人:</span>
       <el-input v-model="listQuery.linkMan" placeholder="联系人" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
       <el-button type="primary" icon="el-icon-search" @click="getList(listQuery)">查询</el-button>
-      <el-button type="primary" icon="el-icon-edit" @click="$_navigationTo('add')">添加供应商</el-button>
+      <el-button type="primary" icon="el-icon-edit" @click="$_navigationTo('supplier-add')">添加供应商</el-button>
     </div>
     <!-- 表格区域 -->
     <el-table
@@ -60,13 +60,13 @@
       <el-table-column label="创建人" class-name="status-col" width="100px" prop="createBy" />
       <el-table-column label="操作" align="center" width="360" class-name="small-padding fixed-width">
         <template slot-scope="{row}">
-          <el-button size="mini" type="primary" @click="$_navigationTo(`edit?id=${row.authUserId}`)">
+          <el-button size="mini" type="primary" @click="$_navigationTo(`supplier-edit?id=${row.authUserId}`)">
             编辑
           </el-button>
           <el-button size="mini" type="primary" @click="handleProxy(row)">
             代他操作
           </el-button>
-          <el-button size="mini" type="primary" @click="$_navigationTo(`/supplier/auth-list?id=${row.authUserId}`)">
+          <el-button size="mini" type="primary" @click="$_navigationTo(`club-list?id=${row.authUserId}`)">
             查看机构认证
           </el-button>
           <el-button size="mini" type="primary" @click="handleResetPwd(row)">

+ 400 - 0
src/views/common/helper/document/index.vue

@@ -0,0 +1,400 @@
+<template>
+  <div class="app-container">
+    <!-- 搜索区域 -->
+    <div class="filter-container">
+      <span>标题:</span>
+      <el-input
+        v-model="listQuery.fileTitle"
+        placeholder="标题"
+        style="width: 200px"
+        class="filter-item"
+        @keyup.enter.native="getList"
+      />
+      <span>所属模块:</span>
+
+      <el-cascader
+        v-model="listQuery.fileModule"
+        :options="modules"
+        class="filter-item"
+        placeholder="所属模块"
+        style="margin-rigth: 15px"
+        clearable
+        @change="getList"
+      />
+      <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
+      <el-button
+        v-if="userIdentity === 1"
+        icon="el-icon-edit"
+        type="primary"
+        @click="dialogVisible = true"
+      >添加</el-button>
+    </div>
+    <!-- 搜索区域END -->
+    <!-- 表格区域 -->
+    <el-table
+      v-loading="listLoading"
+      :data="list"
+      style="width: 100%"
+      border
+      fit
+      highlight-current-row
+      cell-class-name="table-cell"
+    >
+      <el-table-column
+        v-loading="listLoading"
+        :data="list"
+        style="width: 100%"
+        border
+        fit
+        highlight-current-row
+        cell-class-name="table-cell"
+      >
+        <el-table-column label="序号" :index="indexMethod" type="index" width="80" align="center" />
+        <el-table-column label="标题" prop="fileTitle" align="center" />
+        <el-table-column label="所属模块" align="center" prop="fileModuleType" />
+        <el-table-column label="创建时间" width="240px" align="center">
+          <template slot-scope="{ row }">
+            {{ row.createTime | formatTime }}
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center">
+          <template slot-scope="{ row }">
+            <el-button
+              v-if="userIdentity === 1"
+              type="primary"
+              size="mini"
+              style="margin-right:5px"
+              icon="el-icon-edit"
+              @click="handleEditFile(row)"
+            >编辑</el-button>
+
+            <el-button
+              type="success"
+              size="mini"
+              style="margin-right:5px"
+              icon="el-icon-document"
+              @click="handlePreview(row)"
+            >查看</el-button>
+
+            <el-button
+              v-if="userIdentity === 1"
+              type="danger"
+              size="mini"
+              style="margin-right:5px"
+              icon="el-icon-s-check"
+              @click="handleRemove(row)"
+            >删除</el-button>
+
+          </template>
+        </el-table-column>
+      </el-table-column></el-table>
+    <!-- 表格区域END -->
+    <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList(listQuery)" />
+
+    <!-- 文档编辑dialog -->
+    <el-dialog
+      title="添加文档"
+      :visible="dialogVisible"
+      width="30%"
+      @close="dialogClose"
+    >
+
+      <el-form ref="dialogForm" :model="dialogFormData" label-width="86px" :rules="rules">
+        <el-form-item label="标题:" prop="fileTitle">
+          <el-input v-model="dialogFormData.fileTitle" placeholder="请输入标题" />
+        </el-form-item>
+        <el-form-item label="文档路径:" prop="fileUrl">
+          <file-upload ref="fileUpload" :file-list="uploadFileList" accept-type=".doc,.docx" @change="fileUploadChange" />
+          <el-input v-show="false" v-model="dialogFormData.fileUrl" />
+        </el-form-item>
+        <el-form-item label="所属模块:" prop="fileModule">
+          <el-cascader
+            v-if="dialogVisible"
+            v-model="dialogFormData.fileModule"
+            :options="modules"
+            placeholder="所属模块"
+            clearable
+          />
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" :disabled="!saveBtnClickable" :loading="requestLoading" @click="submitUpload">确 定</el-button>
+      </span>
+    </el-dialog>
+    <!-- 文档编辑dialog END -->
+  </div>
+</template>
+
+<script>
+import FileUpload from '@/components/FileUpload'
+import Pagination from '@/components/Pagination' // secondary package based on el-pagination
+import openWindow from '@/utils/open-window'
+import { formatDate } from '@/utils'
+import { mapGetters } from 'vuex'
+import { fetchCourseList, saveCourse, removeCourse } from '@/api/helper'
+import { getToutesTree, getModuleType } from '@/utils/formatRoutesToModule'
+import { debounce } from '@/utils/tools'
+export default {
+  components: { Pagination, FileUpload },
+  filters: {
+    formatTime(time) {
+      if (!time) {
+        return ''
+      }
+      return formatDate(time, 'yyyy-MM-DD HH:mm:ss')
+    }
+  },
+
+  data() {
+    return {
+      listLoading: false,
+      dialogVisible: false,
+      requestLoading: false,
+      total: 0,
+      listQuery: {
+        fileType: 2, // 文件类型:1视频,2文档
+        fileTitle: '', // 文件标题
+        fileModule: [], // 文件模块:1品牌授权-授权列表,2机构管理-机构列表
+        pageNum: 1,
+        pageSize: 10
+      },
+      modules: [],
+      list: [],
+      uploadFileList: [],
+      dialogFormData: {},
+      rules: {
+        fileTitle: [{
+          required: true,
+          message: '请输入标题', trigger: ['change', 'blur']
+        }],
+        fileUrl: [
+          {
+            required: true,
+            message: '请选择文件', trigger: 'change'
+          }
+        ],
+        fileModule: [{
+          required: true,
+          message: '请选择所属模块', trigger: 'change'
+        }]
+      }
+    }
+  },
+  computed: {
+    ...mapGetters(['authUserId', 'userIdentity', 'proxyInfo', 'routes']),
+    saveBtnClickable() {
+      return this.uploadFileList.length > 0
+    }
+  },
+  created() {
+    this.dialogFormData = this.resetDialogFormData()
+    this.modules = getToutesTree(this.routes)
+    this.getList()
+  },
+  methods: {
+    // 初始化dialog formdata
+    resetDialogFormData() {
+      return {
+        fileTitle: '',
+        fileUrl: '',
+        fileId: '',
+        fileName: '',
+        fileType: 2,
+        fileModule: []
+      }
+    },
+
+    // 上传文件
+    submitUpload() {
+      if (this.userIdentity !== 1) return
+      this.$refs.dialogForm.validate(valid => {
+        console.log(valid)
+        if (!valid) return
+        this.requestLoading = true // 上传文件 保存 loading
+
+        const uploadFile = this.uploadFileList[0]
+        // 文件如果已上传 直接保存
+        if (uploadFile && uploadFile.status === 'success') {
+          this.handleSave()
+        } else {
+          // 上传文件
+          this.$refs.fileUpload.submit()
+        }
+        console.log(this.uploadFileList)
+      })
+    },
+    // 监听上传文件的状态变化
+    async fileUploadChange(fileList) {
+      this.uploadFileList = fileList
+      try {
+        await this.handleFileUploadStatus(fileList)
+        this.handleSave.apply(this)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 保存 TODO
+    handleSave: debounce(function() {
+      if (this.userIdentity !== 1) return
+      const params = {
+        fileId: this.dialogFormData.fileId || '',
+        fileTitle: this.dialogFormData.fileTitle,
+        fileName: this.dialogFormData.fileName,
+        ossName: this.dialogFormData.fileUrl,
+        fileType: this.dialogFormData.fileType,
+        fileModule: this.dialogFormData.fileModule.join('-')
+      }
+      saveCourse(params).then(res => {
+        this.$message.success(res.data)
+        this.dialogVisible = false
+        this.getList()
+      }).catch(err => {
+        console.log(err)
+      }).finally(() => {
+        this.requestLoading = false
+      })
+    }, 200),
+
+    // 处理文件上传状态
+    handleFileUploadStatus(fileList) {
+      // 文件列表为空
+      if (fileList.length <= 0) {
+        this.dialogFormData.fileUrl = ''
+        return Promise.reject('faild')
+      }
+      // 取第一个文件
+      const { response, status } = fileList[0]
+      // 文件已选择但未上传
+      if (status === 'ready') {
+        this.dialogFormData.fileUrl = status
+        return Promise.reject('faild')
+      }
+      // 文件已上传
+      if (status === 'success') {
+        this.dialogFormData.fileUrl = response.downloadUrl
+        this.dialogFormData.fileName = response.fileName
+        return Promise.resolve('success')
+      }
+      console.log(response)
+    },
+
+    // 数据回显 修改
+    handleEditFile(row) {
+      if (this.userIdentity !== 1) return
+      const fileModule = row.fileModule.split('-')
+      const i = parseInt(fileModule[0])
+      const j = parseInt(fileModule[1])
+      // dialog 表单数据
+      this.dialogFormData.fileTitle = row.fileTitle
+      this.dialogFormData.fileUrl = row.ossName
+      this.dialogFormData.fileId = row.fileId
+      this.dialogFormData.fileName = row.fileName
+      this.dialogFormData.fileType = 2
+      this.dialogFormData.fileModule = [i, j]
+      // 文件回显列表
+      this.uploadFileList = [{ url: row.fileUrl, name: row.fileName }]
+      this.dialogVisible = true
+    },
+
+    // 获取列表数据
+    getList() {
+      this.listLoading = true
+      const params = {
+        ...this.listQuery,
+        authUserId: this.authUserId,
+        fileModule: this.listQuery.fileModule.join('-')
+      }
+      fetchCourseList(params)
+        .then(res => {
+          if (res.code !== 0) return
+          this.list = this.formatFileModuleType(res.data.list)
+          this.total = res.data.total
+        })
+        .finally(() => {
+          this.listLoading = false
+        })
+    },
+    // 删除
+    async handleRemove(row) {
+      if (this.userIdentity !== 1) return
+      const text = await this.$confirm('确认删除该帮助文档吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).catch(() => {
+        this.$message.info('已取消操作')
+      })
+      if (text !== 'confirm') return
+      removeCourse({ fileId: row.fileId })
+        .then(res => {
+          if (res.code !== 0) return
+          this.$message.success(res.data)
+          this.getList(this.listQuery)
+        })
+    },
+
+    // 预览
+    handlePreview(row) {
+      const url = `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(row.fileUrl)}`
+      openWindow(url, '', `${row.fileModuleType}-教程`, 800, 460)
+    },
+
+    // 关闭添加对话框
+    dialogClose() {
+      this.uploadFileList = []
+      this.$refs.fileUpload.clearAllFiles()
+      this.$refs.dialogForm.resetFields()
+
+      this.dialogFormData = this.resetDialogFormData()
+      this.dialogVisible = false
+    },
+    // 获取模块文本
+    formatFileModuleType(list) {
+      return list.filter(item => {
+        item.fileModuleType = getModuleType(item.fileModule)
+        return item.fileModuleType !== ''
+      })
+    },
+    // 表格索引
+    indexMethod(index) {
+      return index + this.listQuery.pageSize * (this.listQuery.pageNum - 1) + 1
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.filter-container {
+  span {
+    display: inline-block;
+    margin-bottom: 10px;
+    vertical-align: middle;
+    font-size: 14px;
+  }
+  .el-button {
+    display: inline-block;
+    margin-bottom: 10px;
+    vertical-align: middle;
+  }
+  .el-input,
+  .el-select {
+    margin-right: 10px;
+    margin-left: 10px;
+  }
+}
+.el-table .cell {
+  overflow: visible;
+}
+.el-badge {
+  margin: 0 6px;
+}
+
+.el-cascader{
+&.filter-item{
+margin: 0 15px 10px;
+}
+
+}
+
+</style>

+ 400 - 0
src/views/common/helper/video/index.vue

@@ -0,0 +1,400 @@
+<template>
+  <div class="app-container">
+    <!-- 搜索区域 -->
+    <div class="filter-container">
+      <span>标题:</span>
+      <el-input
+        v-model="listQuery.fileTitle"
+        placeholder="标题"
+        style="width: 200px"
+        class="filter-item"
+        @keyup.enter.native="getList"
+      />
+      <span>所属模块:</span>
+
+      <el-cascader
+        v-model="listQuery.fileModule"
+        :options="modules"
+        class="filter-item"
+        placeholder="所属模块"
+        style="margin-rigth: 15px"
+        clearable
+        @change="getList"
+      />
+      <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
+      <el-button
+        v-if="userIdentity === 1"
+        icon="el-icon-edit"
+        type="primary"
+        @click="dialogVisible = true"
+      >添加</el-button>
+    </div>
+    <!-- 搜索区域END -->
+    <!-- 表格区域 -->
+    <el-table
+      v-loading="listLoading"
+      :data="list"
+      style="width: 100%"
+      border
+      fit
+      highlight-current-row
+      cell-class-name="table-cell"
+    >
+      <el-table-column
+        v-loading="listLoading"
+        :data="list"
+        style="width: 100%"
+        border
+        fit
+        highlight-current-row
+        cell-class-name="table-cell"
+      >
+        <el-table-column label="序号" :index="indexMethod" type="index" width="80" align="center" />
+        <el-table-column label="标题" prop="fileTitle" align="center" />
+        <el-table-column label="所属模块" align="center" prop="fileModuleType" />
+        <el-table-column label="创建时间" width="240px" align="center">
+          <template slot-scope="{ row }">
+            {{ row.createTime | formatTime }}
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center">
+          <template slot-scope="{ row }">
+            <el-button
+              v-if="userIdentity === 1"
+              type="primary"
+              size="mini"
+              style="margin-right:5px"
+              icon="el-icon-edit"
+              @click="handleEditFile(row)"
+            >编辑</el-button>
+
+            <el-button
+              type="success"
+              size="mini"
+              style="margin-right:5px"
+              icon="el-icon-film"
+              @click="handlePreview(row)"
+            >播放</el-button>
+
+            <el-button
+              v-if="userIdentity === 1"
+              type="danger"
+              size="mini"
+              style="margin-right:5px"
+              icon="el-icon-s-check"
+              @click="handleRemove(row)"
+            >删除</el-button>
+
+          </template>
+        </el-table-column>
+      </el-table-column></el-table>
+    <!-- 表格区域END -->
+    <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList(listQuery)" />
+
+    <!-- 视频编辑dialog -->
+    <el-dialog
+      title="添加视频"
+      :visible="dialogVisible"
+      width="30%"
+      @close="dialogClose"
+    >
+
+      <el-form ref="dialogForm" :model="dialogFormData" label-width="86px" :rules="rules">
+        <el-form-item label="标题:" prop="fileTitle">
+          <el-input v-model="dialogFormData.fileTitle" placeholder="请输入标题" />
+        </el-form-item>
+        <el-form-item label="视频路径:" prop="fileUrl">
+          <file-upload ref="fileUpload" :file-list="uploadFileList" accept-type="video/*" @change="fileUploadChange" />
+          <el-input v-show="false" v-model="dialogFormData.fileUrl" />
+        </el-form-item>
+        <el-form-item label="所属模块:" prop="fileModule">
+          <el-cascader
+            v-if="dialogVisible"
+            v-model="dialogFormData.fileModule"
+            :options="modules"
+            placeholder="所属模块"
+            clearable
+          />
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" :disabled="!saveBtnClickable" :loading="requestLoading" @click="submitUpload">确 定</el-button>
+      </span>
+    </el-dialog>
+    <!-- 视频编辑dialog END -->
+  </div>
+</template>
+
+<script>
+import FileUpload from '@/components/FileUpload'
+import Pagination from '@/components/Pagination' // secondary package based on el-pagination
+import openWindow from '@/utils/open-window'
+import { formatDate } from '@/utils'
+import { mapGetters } from 'vuex'
+import { fetchCourseList, saveCourse, removeCourse } from '@/api/helper'
+import { getToutesTree, getModuleType } from '@/utils/formatRoutesToModule'
+import { debounce } from '@/utils/tools'
+export default {
+  components: { Pagination, FileUpload },
+  filters: {
+    formatTime(time) {
+      if (!time) {
+        return ''
+      }
+      return formatDate(time, 'yyyy-MM-DD HH:mm:ss')
+    }
+  },
+
+  data() {
+    return {
+      listLoading: false,
+      dialogVisible: false,
+      requestLoading: false,
+      total: 0,
+      listQuery: {
+        fileType: 1, // 文件类型:1视频,2文档
+        fileTitle: '', // 文件标题
+        fileModule: [], // 文件模块:1品牌授权-授权列表,2机构管理-机构列表
+        pageNum: 1,
+        pageSize: 10
+      },
+      modules: [],
+      list: [],
+      uploadFileList: [],
+      dialogFormData: {},
+      rules: {
+        fileTitle: [{
+          required: true,
+          message: '请输入标题', trigger: ['change', 'blur']
+        }],
+        fileUrl: [
+          {
+            required: true,
+            message: '请选择文件', trigger: 'change'
+          }
+        ],
+        fileModule: [{
+          required: true,
+          message: '请选择所属模块', trigger: 'change'
+        }]
+      }
+    }
+  },
+  computed: {
+    ...mapGetters(['authUserId', 'userIdentity', 'proxyInfo', 'routes']),
+    saveBtnClickable() {
+      return this.uploadFileList.length > 0
+    }
+  },
+  created() {
+    this.dialogFormData = this.resetDialogFormData()
+    this.modules = getToutesTree(this.routes)
+    this.getList()
+    console.log(this.authUserId)
+  },
+  methods: {
+    // 初始化dialog formdata
+    resetDialogFormData() {
+      return {
+        fileTitle: '',
+        fileUrl: '',
+        fileId: '',
+        fileName: '',
+        fileType: 1,
+        fileModule: []
+      }
+    },
+
+    // 上传文件
+    submitUpload() {
+      if (this.userIdentity !== 1) return
+      this.$refs.dialogForm.validate(valid => {
+        console.log(valid)
+        if (!valid) return
+        this.requestLoading = true // 上传文件 保存 loading
+
+        const uploadFile = this.uploadFileList[0]
+        // 文件如果已上传 直接保存
+        if (uploadFile && uploadFile.status === 'success') {
+          this.handleSave()
+        } else {
+          // 上传文件
+          this.$refs.fileUpload.submit()
+        }
+        console.log(this.uploadFileList)
+      })
+    },
+    // 监听上传文件的状态变化
+    async fileUploadChange(fileList) {
+      this.uploadFileList = fileList
+      try {
+        await this.handleFileUploadStatus(fileList)
+        this.handleSave.apply(this)
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 保存 TODO
+    handleSave: debounce(function() {
+      if (this.userIdentity !== 1) return
+      const params = {
+        fileId: this.dialogFormData.fileId || '',
+        fileTitle: this.dialogFormData.fileTitle,
+        fileName: this.dialogFormData.fileName,
+        ossName: this.dialogFormData.fileUrl,
+        fileType: this.dialogFormData.fileType,
+        fileModule: this.dialogFormData.fileModule.join('-')
+      }
+      saveCourse(params).then(res => {
+        this.$message.success(res.data)
+        this.dialogVisible = false
+        this.getList()
+      }).catch(err => {
+        console.log(err)
+      }).finally(() => {
+        this.requestLoading = false
+      })
+    }, 200),
+
+    // 处理文件上传状态
+    handleFileUploadStatus(fileList) {
+      // 文件列表为空
+      if (fileList.length <= 0) {
+        this.dialogFormData.fileUrl = ''
+        return Promise.reject('faild')
+      }
+      // 取第一个文件
+      const { response, status } = fileList[0]
+      // 文件已选择但未上传
+      if (status === 'ready') {
+        this.dialogFormData.fileUrl = status
+        return Promise.reject('faild')
+      }
+      // 文件已上传
+      if (status === 'success') {
+        this.dialogFormData.fileUrl = response.downloadUrl
+        this.dialogFormData.fileName = response.fileName
+        return Promise.resolve('success')
+      }
+      console.log(response)
+    },
+
+    // 数据回显 修改
+    handleEditFile(row) {
+      if (this.userIdentity !== 1) return
+      const fileModule = row.fileModule.split('-')
+      const i = parseInt(fileModule[0])
+      const j = parseInt(fileModule[1])
+      // dialog 表单数据
+      this.dialogFormData.fileTitle = row.fileTitle
+      this.dialogFormData.fileUrl = row.ossName
+      this.dialogFormData.fileId = row.fileId
+      this.dialogFormData.fileName = row.fileName
+      this.dialogFormData.fileType = 1
+      this.dialogFormData.fileModule = [i, j]
+      // 文件回显列表
+      this.uploadFileList = [{ url: row.fileUrl, name: row.fileName }]
+      this.dialogVisible = true
+    },
+
+    // 获取列表数据
+    getList() {
+      this.listLoading = true
+      const params = {
+        ...this.listQuery,
+        authUserId: this.authUserId,
+        fileModule: this.listQuery.fileModule.join('-')
+      }
+      fetchCourseList(params)
+        .then(res => {
+          if (res.code !== 0) return
+          this.list = this.formatFileModuleType(res.data.list)
+          this.total = res.data.total
+        })
+        .finally(() => {
+          this.listLoading = false
+        })
+    },
+    // 删除
+    async handleRemove(row) {
+      if (this.userIdentity !== 1) return
+      const text = await this.$confirm('确认删除该帮助视频吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).catch(() => {
+        this.$message.info('已取消操作')
+      })
+      if (text !== 'confirm') return
+      removeCourse({ fileId: row.fileId })
+        .then(res => {
+          if (res.code !== 0) return
+          this.$message.success(res.data)
+          this.getList(this.listQuery)
+        })
+    },
+
+    // 预览
+    handlePreview(row) {
+      openWindow(row.fileUrl, '', `${row.fileModuleType}-教程`, 800, 460)
+    },
+
+    // 关闭添加对话框
+    dialogClose() {
+      this.uploadFileList = []
+      this.$refs.fileUpload.clearAllFiles()
+      this.$refs.dialogForm.resetFields()
+
+      this.dialogFormData = this.resetDialogFormData()
+      this.dialogVisible = false
+    },
+    // 获取模块文本
+    formatFileModuleType(list) {
+      return list.filter(item => {
+        item.fileModuleType = getModuleType(item.fileModule)
+        return item.fileModuleType !== ''
+      })
+    },
+    // 表格索引
+    indexMethod(index) {
+      return index + this.listQuery.pageSize * (this.listQuery.pageNum - 1) + 1
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.filter-container {
+  span {
+    display: inline-block;
+    margin-bottom: 10px;
+    vertical-align: middle;
+    font-size: 14px;
+  }
+  .el-button {
+    display: inline-block;
+    margin-bottom: 10px;
+    vertical-align: middle;
+  }
+  .el-input,
+  .el-select {
+    margin-right: 10px;
+    margin-left: 10px;
+  }
+}
+.el-table .cell {
+  overflow: visible;
+}
+.el-badge {
+  margin: 0 6px;
+}
+
+.el-cascader{
+&.filter-item{
+margin: 0 15px 10px;
+}
+
+}
+
+</style>

+ 5 - 17
src/views/login/index.vue

@@ -122,23 +122,11 @@ export default {
     },
     handleLogin() {
       this.$refs.loginForm.validate(valid => {
-        if (valid) {
-          this.loading = true
-          this.$store
-            .dispatch('user/login', this.loginForm)
-            .then(() => {
-              // const isAdmin = this.$store.getters.userIdentity === 1
-              // isAdmin ? this.$router.replace('/supplier/list') : this.$router.replace('/auth/list')
-              this.$router.replace(initGoPage())
-              this.loading = false
-              this.$message.success('登录成功')
-            })
-            .catch(() => {
-              this.loading = false
-            })
-        } else {
-          return false
-        }
+        if (!valid) return
+        this.loading = true
+        this.$store.dispatch('user/login', this.loginForm).then(res => {
+          this.$router.replace(initGoPage())
+        })
       })
     },
     getOtherQuery(query) {

+ 1 - 1
src/views/normal/club/device/edit.vue

@@ -85,7 +85,7 @@ import { saveProduct } from '@/api/product'
 import { fetchBrandList } from '@/api/brand'
 import { mapGetters } from 'vuex'
 import { isSnCode } from '@/utils/validate'
-import AuthCardTemplate from '../components/authCardTemplate.vue'
+import AuthCardTemplate from '@/views/components/authCardTemplate.vue'
 export default {
   components: { UploadImage, AuthCardTemplate },
   data() {

+ 2 - 2
src/views/normal/club/device/index.vue

@@ -34,7 +34,7 @@
         <el-option label="未上线" :value="0" />
       </el-select>
       <el-button type="primary" icon="el-icon-search" @click="handleFilter">查询</el-button>
-      <el-button v-if="isProxy" icon="el-icon-edit" type="primary" @click="$_navigationTo(`add?id=${listQuery.authId}`)">添加</el-button>
+      <el-button v-if="isProxy" icon="el-icon-edit" type="primary" @click="$_navigationTo(`device-add?id=${listQuery.authId}`)">添加</el-button>
     </div>
     <!-- 表格区域 -->
     <el-table
@@ -103,7 +103,7 @@
       <el-table-column label="操作" align="center" width="240px" class-name="small-padding fixed-width">
         <template slot-scope="{row}">
           <template v-if="userIdentity === 2|| proxyInfo !== null">
-            <el-button type="default" size="mini" @click="$_navigationTo(`edit?id=${row.productId}`)">
+            <el-button type="default" size="mini" @click="$_navigationTo(`device-edit?id=${row.productId}`)">
               编辑
             </el-button>
             <el-button type="danger" size="mini" @click="handleRemoveProduct(row)">

+ 264 - 516
src/views/normal/club/edit.vue

@@ -1,580 +1,328 @@
 <template>
-  <div class="app-container">
-    <div class="filter-container">
-      <span>机构名称:</span>
-      <el-input v-model="listQuery.authParty" placeholder="机构名称" style="width: 280px;" class="filter-item" @keyup.enter.native="handleFilter" />
-      <span>审核状态:</span>
-      <el-select
-        v-model="listQuery.auditStatus"
-        placeholder="审核状态"
-        clearable
-        style="width: 200px"
-        class="filter-item"
-        @change="getList"
-      >
-        <el-option label="全部" value="" />
-        <el-option label="待审核" :value="2" />
-        <el-option label="审核通过" :value="1" />
-        <el-option label="审核未通过" :value="0" />
-      </el-select>
-      <span>上线状态:</span>
-      <el-select
-        v-model="listQuery.status"
-        placeholder="上线状态"
-        clearable
-        style="width: 200px"
-        class="filter-item"
-        @change="getList"
-      >
-        <el-option label="全部" value="" />
-        <el-option label="已上线" :value="1" />
-        <el-option label="待上线" :value="2" />
-        <el-option label="未上线" :value="0" />
-      </el-select>
-
-      <el-button icon="el-icon-search" type="primary" @click="getList">查询</el-button>
-      <!-- <el-button v-if="isProxy" icon="el-icon-edit" type="primary" @click="handleShowEditDialog('添加品牌授权')">添加品牌授权</el-button> -->
-      <el-button v-if="isProxy" icon="el-icon-edit" type="primary" @click="$_navigationTo('/auth/auth-add')">添加</el-button>
-      <el-button icon="el-icon-upload" type="primary" @click="improtDialogVisible = true">导入</el-button>
-      <el-button icon="el-icon-document" type="primary" @click="handleExportExcel">导出</el-button>
-      <el-button icon="el-icon-document-copy" type="primary" @click="downLoadExportExcel">获取导入模板</el-button>
-      <el-button type="primary" icon="el-icon-download" @click="handleExport(1)">一键下载授权牌</el-button>
-      <el-button type="primary" icon="el-icon-download" @click="handleExport(2)">一键下载二维码</el-button>
+  <div class="club-edit">
+    <el-form ref="submitForm" class="club-edit-form" label-width="120px" :model="formData" :rules="rules">
+      <el-form-item label="机构名称:" prop="name">
+        <el-input v-model="formData.name" placeholder="请输入机构名称" />
+      </el-form-item>
+      <el-form-item label="所在地区:" prop="address">
+        <el-cascader
+          ref="cascader"
+          v-model="formData.address"
+          :class="{ display: cascaderDisplay }"
+          clearable
+          :props="cascaderProps"
+          style="width: 100%"
+          :placeholder="cascaderPlaceholder"
+          @change="handleChange"
+        />
+      </el-form-item>
+      <el-form-item label="详细地址:" prop="fullAddress">
+        <el-input v-model="formData.fullAddress" placeholder="请输入详细地址" />
+      </el-form-item>
+      <el-form-item label="经纬度:" prop="point">
+        <el-input v-model="formData.point" placeholder="请输入经纬度 (格式:纬度,经度,可通过右侧地图小按钮获取)">
+          <el-button slot="append" icon="el-icon-map-location" @click="dialogMapVisible = true" />
+        </el-input>
+      </el-form-item>
+      <el-form-item label="联系方式:" prop="mobile">
+        <el-input v-model="formData.mobile" placeholder="请输入联系方式" />
+      </el-form-item>
+      <el-form-item label="机构logo:" prop="logoImage">
+        <el-input v-show="false" v-model="formData.logoImage" />
+        <upload-image
+          tip="建议尺寸:242px * 242px"
+          :image-list="logoList"
+          :before-upload="beforeLogoUpload"
+          @success="uploadLogoSuccess"
+          @remove="handleLogoRemove"
+        />
+      </el-form-item>
+      <el-form-item label="轮播图:" prop="banner">
+        <el-input v-show="false" v-model="formData.banner" />
+        <upload-image
+          tip="至少上传一张,最多6张;建议尺寸:542px * 542px"
+          :image-list="bannerList"
+          :before-upload="beforeBannerUpload"
+          :limit="6"
+          @success="uploadBannerSuccess"
+          @remove="handleBannerRemove"
+        />
+      </el-form-item>
+    </el-form>
+    <div class="submit-btn">
+      <el-button type="primary" @click="submit">保存</el-button>
+      <el-button type="warning" @click="$_back()">返回</el-button>
     </div>
-    <!-- 表格区域 -->
-    <el-table
-      :key="tableKey"
-      v-loading="listLoading"
-      :data="list"
-      border
-      fit
-      highlight-current-row
-      style="width: 100%;"
-      header-row-class-name="tableHeader"
-    >
-      <el-table-column label="序号" :index="indexMethod" align="center" width="80" type="index" />
-
-      <el-table-column label="机构名称" align="center" prop="authParty" />
-
-      <el-table-column label="审核状态" width="160px" align="center">
-        <template slot-scope="{ row }">
-          <el-tag v-if="row.auditStatus === 2" size="small" type="warning">待审核</el-tag>
-          <el-tag v-if="row.auditStatus === 1" size="small" type="success">审核通过</el-tag>
-          <!-- 未通过原因展示 -->
-          <template v-if="row.auditStatus === 0">
-            <!-- <span class="status danger">审核未通过&nbsp;</span> -->
-            <el-popover
-              placement="top-start"
-              title="审核说明"
-              width="400"
-              trigger="hover"
-              :content="row.invalidReason"
-            >
-              <el-tag slot="reference" size="small" type="danger" class="reason">
-                <span>审核未通过</span>
-                <span class="el-icon-question status danger " />
-              </el-tag>
-            </el-popover>
-            <!-- 未通过原因展示END -->
-          </template>
-        </template>
-      </el-table-column>
-
-      <el-table-column label="上线状态" width="260px" align="center">
-        <template slot-scope="{row}">
-          <!-- 只有审核通过了才能操作上下线 auditStatus :审核状态 -->
-          <template v-if="row.auditStatus === 1">
-            <template v-if="row.status === 0">
-              <span style="margin-right:10px;" class="status danger">已下线</span>
-              <el-button v-if="isProxy" type="primary" size="mini" @click="handleChangeStatus(row)">上线</el-button>
-            </template>
-            <template v-else>
-              <span style="margin-right:10px;" class="status success ">已上线</span>
-              <el-button v-if="isProxy" type="info" size="mini" @click="handleChangeStatus(row)">下线</el-button>
-            </template>
-          </template>
-          <template v-else>
-            <!-- <el-tag type="warning">待上线</el-tag> -->
-            <span style="margin-right:10px;" class="status warning">待上线</span>
-          </template>
-        </template>
-      </el-table-column>
 
-      <el-table-column label="创建时间" class-name="status-col" width="200px">
-        <template slot-scope="{row}">
-          <span>{{ row.createTime | formatTime }}</span>
-        </template>
-      </el-table-column>
-
-      <!-- <el-table-column label="创建人" class-name="status-col" width="160px" prop="createBy" /> -->
-      <el-table-column label="操作" align="center" width="400px" class-name="small-padding fixed-width">
-        <template slot-scope="{row}">
-          <template v-if="isProxy">
-            <el-button type="primary" size="mini" @click="$_navigationTo(`/auth/auth-edit?id=${row.authId}&authParty=${row.authParty}`)">
-              编辑
-            </el-button>
-            <el-button type="primary" size="mini" @click="$_navigationTo(`/auth/user-list?id=${row.authId}&authParty=${row.authParty}`)">
-              登录用户
-            </el-button>
-          </template>
-          <template v-if="!isProxy">
-            <el-button type="primary" size="mini" @click="$_navigationTo(`/product?id=${row.authId}&authParty=${row.authParty}`)">
-              查看
-            </el-button>
-          </template>
-          <el-button type="primary" size="mini" @click="$_navigationTo(`/product?id=${row.authId}&authParty=${row.authParty}`)">
-            查看设备认证
-          </el-button>
-          <el-button v-if="isProxy" type="danger" size="mini" @click="handleRemoveAuth(row)">
-            删除
-          </el-button>
-
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <!-- 页码 -->
-    <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" />
-
-    <!-- 对话框区域 -->
     <el-dialog
-      :title="dialogTitle"
-      :visible.sync="showAddAuthDialog"
-      width="30%"
-      @close="dialogClosed"
+      class="map-dialog"
+      title="坐标拾取(请拖动标记点选取准确位置)"
+      :visible.sync="dialogMapVisible"
+      width="80%"
     >
-      <el-form ref="addAuthForm" :rules="addAuthFormRules" :model="addAuthFormData" label-width="100px">
-        <el-form-item label="授权机构:" prop="authParty">
-          <el-input v-model="addAuthFormData.authParty" placeholder="请输入授权机构名称" />
-        </el-form-item>
-        <!-- <el-form-item label="上线状态:">
-          <el-select v-model="addAuthFormData.status">
-            <el-option label="上线" :value="1" />
-            <el-option label="下线" :value="0" />
-          </el-select>
-        </el-form-item> -->
-      </el-form>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="showAddAuthDialog = false">取 消</el-button>
-        <el-button type="primary" :disabled="disabled" @click="handleUpdateBrandAuth">确 定</el-button>
-      </span>
+      <!-- <location v-if="dialogMapVisible" :init-point="formData.point" @point="handlePointChange" /> -->
+      <map-ui v-if="dialogMapVisible" :init-point="formData.point" :address="locationAddress" @change="markerChange" />
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" size="mini" @click="dialogMapVisible = false">确 定</el-button>
+      </div>
     </el-dialog>
-    <!-- 导入对话框 -->
-    <!-- dialog Start -->
-    <el-dialog
-      title="导入"
-      :visible.sync="improtDialogVisible"
-      width="30%"
-      @close="improtDialogClose"
-    >
-      <el-form ref="dialogForm" :model="improtDialogFormData" label-width="86px" :rules="improtDialogFormRules">
-        <el-form-item label="文件路径:" prop="fileUrl">
-          <file-upload ref="fileUpload" :file-list="uploadFileList" @change="fileUploadChange" />
-          <el-input v-show="false" v-model="improtDialogFormData.fileUrl" />
-        </el-form-item>
-      </el-form>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="improtDialogVisible = false">取 消</el-button>
-        <el-button type="primary" :disabled="!saveBtnClickable" :loading="requestLoading" @click="submitUpload">确 定</el-button>
-      </span>
-    </el-dialog>
-    <!-- dialog END -->
   </div>
 </template>
 
 <script>
-import FileUpload from '@/components/FileUpload'
-import { fecthAuthList, saveBrandAuth, changeAuthStatus, removeAuth, authImportExcel } from '@/api/auth'
-import Pagination from '@/components/Pagination' // secondary package based on el-pagination
+// import Location from '@/components/location'
+import AMapUI from '@/components/AMapUI'
+import UploadImage from '@/components/UploadImage'
 import { mapGetters } from 'vuex'
-import { formatDate } from '@/utils'
-import { debounce, downLoadWithATag } from '@/utils/tools'
+import { saveBrandAuth, getAuthFormData } from '@/api/auth'
+import { getAddress } from '@/api/common'
+import { isPoint, isNumber } from '@/utils/validate'
+
 export default {
-  name: 'ComplexTable',
-  components: { Pagination, FileUpload },
-  filters: {
-    formatTime(time) {
-      if (!time) {
-        return ''
-      }
-      return formatDate(time, 'yyyy-MM-DD HH:mm:ss')
-    }
+  components: {
+    // Location
+    [AMapUI.name]: AMapUI,
+    UploadImage
   },
   data() {
+    var validatePoint = (rule, value, callback) => {
+      if (value === '') {
+        callback(new Error('经纬度坐标不能为空'))
+      } else {
+        if (isPoint(value)) {
+          this.$refs.ruleForm.validateField('point')
+        } else {
+          callback('经纬度坐标格式不正确,(例如:114.095294,22.536004)')
+        }
+        callback()
+      }
+    }
+
+    var validateMobile = (rule, value, callback) => {
+      if (value === '') {
+        callback(new Error('联系方式不能为空'))
+      } else {
+        if (isNumber(value)) {
+          this.$refs.ruleForm.validateField('point')
+        } else {
+          callback('联系方式格式不正确')
+        }
+        callback()
+      }
+    }
+
     return {
-      noticeTitle: '添加',
-      dialogFlag: true, // 对话框状态
-      tableKey: 0,
-      list: null,
-      total: 0,
-      listLoading: true,
-      // 查询参数
-      listQuery: {
-        authParty: '', // 授权机构
-        authUserId: '', // 供应商用户id
-        pageNum: 1, // 页码
-        pageSize: 10, // 分页
-        status: ''
-      },
-      // 添加品牌授权
-      showAddAuthDialog: false, // 显示添加供应商对话框
-      dialogTitle: '',
-      addAuthFormData: {
-        authId: '', // 授权id
-        authUserId: '', // 供应商用户id
-        authParty: '', // 授权机构
-        createBy: '', // 创建人id
-        status: 2 // 授权状态 0下线,1上线  2待审核
-      },
-      addAuthFormRules: {
-        authParty: [
-          { required: true, message: '请输入授权机构名称', trigger: 'blur' }
-        ]
-      },
+      dialogMapVisible: false,
+      point: {},
+      value: [],
+      options: [],
+
+      authId: '',
       disabled: false,
-      // 审核未通过
-      auditFailedList: [],
-      auditNoticeFlag: true,
-      // ------------------
-      improtDialogVisible: false,
-      requestLoading: false,
-      uploadFileList: [],
-      improtDialogFormData: {
-        fileUrl: ''
+
+      area: '',
+      formData: {
+        name: '',
+        address: [],
+        fullAddress: '',
+        point: '',
+        mobile: '',
+        logoImage: '',
+        banner: ''
       },
-      improtDialogFormRules: {
-        fileUrl: [
-          {
-            required: true,
-            message: '请选择文件', trigger: 'change'
-          }
-        ]
+      rules: {
+        name: [{ required: true, message: '机构名称不能为空', trigger: ['blur', 'change'] }],
+        address: [{ required: true, message: '地址不能为空', trigger: 'change', type: 'array' }],
+        fullAddress: [{ required: true, message: '详细不能为空', trigger: ['blur', 'change'] }],
+        point: [{ validator: validatePoint, trigger: ['blur', 'change'] }],
+        mobile: [{ validator: validateMobile, trigger: ['blur', 'change'] }],
+        logoImage: [{ required: true, message: '请上传机构logo', trigger: 'change' }],
+        banner: [{ required: true, message: '请至少上传一张banner图片', trigger: 'change' }]
       },
-      chooseFile: ''
+      // logo图片列表
+      logoList: [],
+      // banner图片列表
+      bannerList: [],
+      // 级联选择的地址
+      address: ''
     }
   },
   computed: {
-    ...mapGetters(['authUserId', 'userIdentity', 'proxyInfo', 'copyUserInfo']),
-    saveBtnClickable() {
-      return this.uploadFileList.length > 0
+    ...mapGetters(['authUserId', 'proxyInfo']),
+    // 级联选择器
+    cascaderProps() {
+      return {
+        lazy: true,
+        lazyLoad: async(node, resolve) => {
+          const { level, value = 0 } = node
+          const result = await getAddress({ parentId: value, type: level })
+          const nodes = result.data.map(item => ({ value: item.id, label: item.name, leaf: level >= 2 }))
+          resolve(nodes)
+        }
+      }
+    },
+    cascaderDisplay() {
+      return this.formData.address.length > 0
     },
-    isProxy() {
-      return this.proxyInfo || this.userIdentity !== 1
+    cascaderPlaceholder() {
+      return this.cascaderDisplay ? this.area : '请选择所在区域'
+    },
+    // 定位使用的地址
+    locationAddress() {
+      return this.address + this.formData.fullAddress
     }
   },
   created() {
-    this.listQuery.authUserId = this.$route.query.id || this.proxyInfo?.authUserId || this.authUserId
-    const type = this.$route.query.type
-    // 如果是通过路由参数传递的type,则需要同步到store
-    if (type) {
-      this.$store.commit('user/SET_SHOP_TYPE', parseInt(type))
-    }
-    this.getList()
+    this.authId = this.$route.query.id
+    this.initFormData()
   },
   methods: {
-    // 上传文件
-    submitUpload() {
-      this.$refs.dialogForm.validate(valid => {
-        console.log(valid)
-        if (!valid) return
-        this.requestLoading = true // 上传文件
-        // this.$refs.fileUpload.submit()
-        this.handleSave()
+    // 获取地址
+    initAddress() {
+      return getAddress({
+        parentId: 19,
+        type: 1
       })
     },
-    // 监听上传文件的状态变化
-    async fileUploadChange(fileList) {
-      this.uploadFileList = fileList
-      try {
-        await this.handleFileUploadStatus(fileList)
-        this.handleSave.apply(this)
-      } catch (error) {
-        console.log(error)
-      }
+
+    // 地图标记变化
+    markerChange(point) {
+      this.formData.point = `${point.lng},${point.lat}`
     },
 
-    // 导出下载授权牌 || 二维码
-    async handleExport(type) {
-      const confirmText = type === 1 ? '授权牌' : '二维码'
+    // 数据回显
+    initFormData() {
+      getAuthFormData({ authId: this.authId }).then(res => {
+        console.log(res)
+        this.formData.name = res.data.authParty
 
-      const text = await this.$confirm(`确认下载所有${confirmText}?`, '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).catch(() => {
-        this.$message.info('已取消操作')
-      })
-      if (text !== 'confirm') return
-      // 使用a链接下载
-      downLoadWithATag(`${process.env.VUE_APP_BASE_API}/download/shop/image?authUserId=${this.authUserId}&type=${type}`)
-    },
+        this.formData.fullAddress = res.data.address
+        this.formData.point = res.data.lngAndLat
+        this.formData.mobile = res.data.mobile
+        this.formData.logoImage = res.data.logo
+        this.formData.banner = res.data.bannerList.length || ''
 
-    // 下载模板
-    downLoadExportExcel() {
-      downLoadWithATag(`${process.env.VUE_APP_BASE_API}/download/file?ossName=%E6%AD%A3%E5%93%81%E8%81%94%E7%9B%9F%E6%9C%BA%E6%9E%84%E3%80%81%E5%95%86%E5%93%81%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx&fileName=%E6%AD%A3%E5%93%81%E8%81%94%E7%9B%9F%E6%9C%BA%E6%9E%84%E3%80%81%E5%95%86%E5%93%81%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`)
-    },
+        this.logoList = [{ name: '', url: res.data.logo }]
+        this.bannerList = res.data.bannerList.map(item => ({ name: '', url: item }))
 
-    // 导出为Excel
-    async handleExportExcel() {
-      const text = await this.$confirm('确认导出所有授权机构的数据吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).catch(() => {
-        this.$message.info('已取消操作')
+        this.formData.address = [res.data.provinceId, res.data.cityId, res.data.townId]
+        // this.formData.address = '广东省/深圳市/福田区'
+        this.area = res.data.area
       })
-      if (text !== 'confirm') return
-      // 使用a链接下载
-      downLoadWithATag(`${process.env.VUE_APP_BASE_API}/auth/export/excel?authUserId=${this.authUserId}`)
     },
 
-    // 导入Excel 并提交
-    handleSave: debounce(function() {
-      console.log('保存')
-      console.log(this.improtDialogFormData)
-      console.log(this.proxyInfo, this.authUserId)
-      // 上传文件使用 multipart/form-data
-      const formData = new FormData()
+    // 表单提交保存
+    submit() {
+      this.$refs.submitForm.validate(valide => {
+        if (!valide) return
 
-      formData.append('authUserId', this.authUserId)
-      formData.append('createBy', this.copyUserInfo.authUserId)
-      formData.append('file', this.chooseFile)
+        console.log(this.formData)
+        const {
+          name: authParty,
+          address: [provinceId, cityId, townId],
+          mobile,
+          logoImage: logo,
+          point: lngAndLat
+        } = this.formData
 
-      authImportExcel(formData)
-        .then(res => {
-          this.$message.success(res.data)
-          this.improtDialogVisible = false
-          this.getList()
-        })
-        .catch(err => { console.log(err) })
-        .finally(() => {
-          this.requestLoading = false
-        })
-    }, 200),
+        const authUserId = this.proxyInfo?.authUserId || this.authUserId
 
-    // 处理文件上传状态
-    handleFileUploadStatus(fileList) {
-      console.log(fileList)
-      this.chooseFile = fileList[0].raw
-      // 文件列表为空
-      if (fileList.length <= 0) {
-        this.improtDialogFormData.fileUrl = ''
-        return Promise.reject('faild')
-      }
-      // 取第一个文件
-      const { response, status } = fileList[0]
-      // 文件已选择但未上传
-      if (status === 'ready') {
-        this.improtDialogFormData.fileUrl = status
-        return Promise.reject('faild')
-      }
-      // 文件已上传
-      if (status === 'success') {
-        this.improtDialogFormData.fileUrl = response.previewUrl
-        return Promise.resolve('success')
-      }
-    },
-    improtDialogClose() {
-      console.log(123)
-      // this.uploadFileList = []
-      this.$refs.fileUpload.clearAllFiles()
-      this.$refs.dialogForm.resetFields()
-    },
-    // 获取授权列表
-    getList() {
-      this.listLoading = true
-      fecthAuthList(this.listQuery).then(response => {
-        if (response.code !== 0) {
-          return this.$message.error('授权列表信息获取失败')
+        const data = {
+          authId: parseInt(this.authId),
+          authParty,
+          authUserId,
+          createBy: authUserId,
+          provinceId,
+          cityId,
+          townId,
+          address: this.formData.fullAddress,
+          mobile,
+          logo,
+          lngAndLat
         }
-        const { list, total } = response.data
-        // this.formatList(list)
-        this.list = list
-        this.total = total
-        // 获取审核未通过的列表
-        // this.checkAuditFailedList(list)
-      }).catch(err => {
-        console.log(err)
-        return this.$message.error('授权列表信息获取失败')
-      }).finally(() => {
-        this.listLoading = false
-      })
-    },
-    // 获取审核未通过条数
-    // Audit failed 审核未通过
-    checkAuditFailedList(data) {
-      this.auditFailedList = data.filter(item => item.auditStatus === 0)
-      if (this.auditFailedList.length > 0 && this.auditNoticeFlag && (this.userIdentity !== 1 || this.proxyInfo !== null)) {
-        this.$notify.info({
-          title: '消息通知',
-          dangerouslyUseHTMLString: true,
-          message: `共有<b style="color:red">${this.auditFailedList.length}</b>个授权机构未能通过审核,请查看原因并及时修改!`,
-          duration: 3000
-        })
-        this.auditNoticeFlag = false
-      }
-    },
-    // 检查机构名是否存在 true:存在  false:不存在
-    handleCheckAuthName(name) {
-      const flag = this.list.some(item => item.authParty === name)
-      console.log(flag)
-      return flag
-    },
-    // 添加授权
-    handleUpdateBrandAuth() {
-      if (this.handleCheckAuthName(this.addAuthFormData.authParty) && this.dialogFlag) {
-        this.$message({
-          message: '该授权机构已存在',
-          duration: 1000,
-          type: 'warning'
-        })
-        return
-      }
-      this.$refs.addAuthForm.validate(valide => {
-        if (valide) {
-          this.disabled = true
-          this.listLoading = true
-          // authUserId先判断是否为代理操作,是就从代理数据中获取,否则直接获取当前登录用户的信息
-          this.addAuthFormData.authUserId = this.$route.query.id || this.proxyInfo?.authUserId || this.authUserId
-          this.addAuthFormData.createBy = this.addAuthFormData.authUserId
-          saveBrandAuth(this.addAuthFormData).then(res => {
-            if (res.code !== 0) {
-              return
-            }
-            this.getList()
+
+        data.bannerList = this.bannerList.map(item => item.response ? item.response.data : item.url)
+
+        console.log(data)
+        saveBrandAuth(data)
+          .then(res => {
             const h = this.$createElement
             this.$notify.success({
-              title: `${this.noticeTitle}授权机构`,
-              message: h('i', { style: 'color: #333' }, `已${this.noticeTitle}授权机构:"${this.addAuthFormData.authParty}"`),
+              title: `修改授权机构`,
+              message: h('i', { style: 'color: #333' }, `已修改授权机构:"${this.formData.name}"`),
               duration: 3000
             })
-            this.$refs.addAuthForm.resetFields()
-          }).catch(err => {
-            console.log(err)
-            this.$message.danger('操作失败')
-          }).finally(() => {
-            this.showAddAuthDialog = false
-            this.listLoading = false
-            this.disabled = false
+            this.$refs.submitForm.resetFields()
+            this.$store.dispatch('tagsView/delView', this.$route)
+            this.$router.push('/auth/list')
+          })
+          .catch(err => {
+            this.$message.danger(err.msg)
           })
-        }
       })
     },
-    // 删除品牌授权
-    async handleRemoveAuth(item) {
-      const text = await this.$confirm('确认删除该数据吗?删除后,对应的商品数据也将全部删除', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).catch(() => {
-        this.$message.info('已取消操作')
-      })
-      if (text !== 'confirm') return
-      // 要执行的操作
-      this.listLoading = true
-      removeAuth({	authId: item.authId }).then(res => {
-        if (res.code !== 0) return
-        const h = this.$createElement
-        this.$notify.success({
-          title: '移除授权机构',
-          message: h('i', { style: 'color: #333' }, `移除授权机构:"${item.authParty}"`),
-          duration: 3000
-        })
-      }).catch(err => {
-        console.log(err)
-      }).finally(() => {
-        this.listLoading = false
-        this.getList()
-      })
+    handleChange(e) {
+      const node = this.$refs.cascader.getCheckedNodes()
+      if (node.length <= 0) return
+      this.address = node[0].pathLabels.join()
     },
-    // 格式化列表数据
-    formatList(list = []) {
-      list.forEach(i => {
-        i.status = i.status === 1
-      })
+    // logo上传
+    uploadLogoSuccess({ response, file, fileList }) {
+      this.logoList = fileList
+      this.formData.logoImage = fileList[0].response.data
     },
-    // 供应商状态改变
-    handleChangeStatus(item) {
-      if (this.userIdentity !== 2 && this.proxyInfo === null) return
-      this.listLoading = true
-      // const params = {
-      //   authId: item.authId,
-      //   status: item.status ? 1 : 0
-      // }
-      const params = {
-        authId: item.authId,
-        status: item.status === 1 ? 0 : 1
-      }
-      changeAuthStatus(params).then(res => {
-        // this.$message.success(res.data)
-        this.$message({
-          message: res.data,
-          duration: 500,
-          type: 'success'
-        })
-        this.getList()
-      }).catch(err => {
-        console.log(err)
-      }).finally(() => {
-        this.listLoading = false
-      })
+    handleLogoRemove({ file, fileList }) {
+      this.logoList = fileList
+      this.formData.logoImage = ''
     },
-    // 过滤列表
-    handleFilter() {
-      this.listQuery.page = 1
-      this.getList()
+    beforeLogoUpload(file) {
+      const flag = file.size / 1024 < 500
+      if (!flag) {
+        this.$message.error('上传logo图片大小不能超过 500kb!')
+      }
+      return flag
     },
-    // 添加供应商
-    handleAddAuth() {
-      console.log('添加供应商')
+
+    // banner上传
+    uploadBannerSuccess({ response, file, fileList }) {
+      this.bannerList = fileList
+      console.log(this.bannerList)
+      this.formData.banner = fileList.length > 0 ? fileList.length : ''
     },
-    // 对话框关闭事件
-    dialogClosed() {
-      console.log('dialog is closed')
-      this.addAuthFormData.authParty = ''
-      this.addAuthFormData.authId = ''
-      this.addAuthFormData.status = 1
-      this.noticeTitle = '添加'
-      this.$refs.addAuthForm.resetFields()
+    handleBannerRemove({ file, fileList }) {
+      this.bannerList = fileList
+      this.formData.banner = fileList.length > 0 ? fileList.length : ''
     },
-    handleShowEditDialog(title, data) {
-      this.dialogTitle = title
-      if (data) {
-        this.addAuthFormData.authId = data.authId
-        this.addAuthFormData.authUserId = data.authUserId
-        this.addAuthFormData.authParty = data.authParty
-        this.addAuthFormData.createBy = data.createBy
-        this.status = data.status
-        this.noticeTitle = '修改'
-        this.dialogFlag = false
-      } else {
-        this.dialogFlag = true
+    beforeBannerUpload(file) {
+      const flag = file.size / 1024 / 1024 < 1
+      if (!flag) {
+        this.$message.error('上传banner图片大小不能超过 1MB!')
       }
-      this.showAddAuthDialog = true
-    },
-    indexMethod(index) {
-      return index + this.listQuery.pageSize * (this.listQuery.pageNum - 1) + 1
+      return flag
     }
   }
 }
 </script>
 
 <style lang="scss" scoped>
-.filter-container{
-  span{
-    display: inline-block;
-    margin-bottom: 10px;
-    vertical-align: middle;
-    font-size: 14px;
-  }
-  .el-button{
-    display: inline-block;
-    margin-bottom: 10px;
-    vertical-align: middle;
-  }
-  .el-input,.el-select{
-    margin-right: 10px;
-    margin-left: 10px;
+#allmap {
+  width: 100%;
+  height: 600px;
+}
+
+.club-edit {
+  margin-bottom: 80px;
+}
+
+.club-edit-form {
+  width: 600px;
+  margin: 0 auto;
+  margin-top: 80px;
+}
+.submit-btn {
+  text-align: center;
+  .el-button {
+    width: 140px;
   }
 }
 </style>

+ 4 - 9
src/views/normal/club/index.vue

@@ -34,7 +34,7 @@
 
       <el-button icon="el-icon-search" type="primary" @click="getList">查询</el-button>
       <!-- <el-button v-if="isProxy" icon="el-icon-edit" type="primary" @click="handleShowEditDialog('添加品牌授权')">添加品牌授权</el-button> -->
-      <el-button v-if="isProxy" icon="el-icon-edit" type="primary" @click="$_navigationTo('/auth/auth-add')">添加</el-button>
+      <el-button v-if="isProxy" icon="el-icon-edit" type="primary" @click="$_navigationTo('club-add')">添加</el-button>
       <el-button icon="el-icon-upload" type="primary" @click="improtDialogVisible = true">导入</el-button>
       <el-button icon="el-icon-document" type="primary" @click="handleExportExcel">导出</el-button>
       <el-button icon="el-icon-document-copy" type="primary" @click="downLoadExportExcel">获取导入模板</el-button>
@@ -110,19 +110,14 @@
       <el-table-column label="操作" align="center" width="400px" class-name="small-padding fixed-width">
         <template slot-scope="{row}">
           <template v-if="isProxy">
-            <el-button type="primary" size="mini" @click="$_navigationTo(`/auth/auth-edit?id=${row.authId}&authParty=${row.authParty}`)">
+            <el-button type="primary" size="mini" @click="$_navigationTo(`club-edit?id=${row.authId}&authParty=${row.authParty}`)">
               编辑
             </el-button>
-            <el-button type="primary" size="mini" @click="$_navigationTo(`/auth/user-list?id=${row.authId}&authParty=${row.authParty}`)">
+            <el-button type="primary" size="mini" @click="$_navigationTo(`user-list?id=${row.authId}&authParty=${row.authParty}`)">
               登录用户
             </el-button>
           </template>
-          <template v-if="!isProxy">
-            <el-button type="primary" size="mini" @click="$_navigationTo(`/product?id=${row.authId}&authParty=${row.authParty}`)">
-              查看
-            </el-button>
-          </template>
-          <el-button type="primary" size="mini" @click="$_navigationTo(`/product?id=${row.authId}&authParty=${row.authParty}`)">
+          <el-button type="primary" size="mini" @click="$_navigationTo(`device-list?id=${row.authId}&authParty=${row.authParty}`)">
             查看设备认证
           </el-button>
           <el-button v-if="isProxy" type="danger" size="mini" @click="handleRemoveAuth(row)">

+ 1 - 1
src/views/normal/doctor/edit.vue

@@ -48,7 +48,7 @@
 <script>
 import { Promise } from 'jszip/lib/external'
 import { mapGetters } from 'vuex'
-import DeviceSection from '../components/deviceSection.vue'
+import DeviceSection from '@/views/components/deviceSection.vue'
 import UploadImage from '@/components/UploadImage'
 import { doctorSave } from '@/api/doctor'
 

+ 1 - 1
src/views/normal/material/article/edit.vue

@@ -24,7 +24,7 @@
 
 <script>
 import { mapGetters } from 'vuex'
-import UploadImage from '../components/uploadImage'
+import UploadImage from '@/views/components/uploadImage'
 import Tinymce from '@/components/Tinymce'
 import { getToken } from '@/utils/auth'
 import { saveArticle, getArticleDeatil } from '@/api/doc'

+ 2 - 2
src/views/normal/material/article/index.vue

@@ -43,7 +43,7 @@
         v-if="userIdentity === 2 || proxyInfo !== null"
         icon="el-icon-edit"
         type="primary"
-        @click="$_navigationTo(`/doc/article-edit`)"
+        @click="$_navigationTo(`article-edit`)"
       >添加文章</el-button>
     </div>
     <!-- 搜索区域END -->
@@ -131,7 +131,7 @@
             size="mini"
             style="margin-right:5px"
             icon="el-icon-edit"
-            @click="$_navigationTo(`/doc/article-edit?articleId=${row.articleId}`)"
+            @click="$_navigationTo(`article-edit?articleId=${row.articleId}`)"
           >编辑</el-button>
           <el-button
             type="danger"

+ 2 - 2
src/views/normal/material/image/index.vue

@@ -43,7 +43,7 @@
         v-if="userIdentity === 2 || proxyInfo!==null"
         icon="el-icon-edit"
         type="primary"
-        @click="$_navigationTo(`/doc/image-edit`)"
+        @click="$_navigationTo(`image-edit`)"
       >添加图片</el-button>
     </div>
     <!-- 搜索区域END -->
@@ -108,7 +108,7 @@
       </el-table-column>
       <el-table-column label="操作" width="240px" align="center">
         <template slot-scope="{row}">
-          <el-button type="primary" size="mini" style="margin-right:5px" icon="el-icon-edit" @click="$_navigationTo(`/doc/image-edit?imageId=${row.imageId}`)">编辑</el-button>
+          <el-button type="primary" size="mini" style="margin-right:5px" icon="el-icon-edit" @click="$_navigationTo(`image-edit?imageId=${row.imageId}`)">编辑</el-button>
           <el-button type="danger" size="mini" style="margin-right:5px" icon="el-icon-s-check" @click="handleRemoveImage(row)">删除</el-button>
         </template>
       </el-table-column>