瀏覽代碼

Merge branch 'dev' of http://1.116.113.26:8088/zhuliu/qiaobi into dev

lrj 10 月之前
父節點
當前提交
c98f016187
共有 71 個文件被更改,包括 4174 次插入1549 次删除
  1. 4 0
      src/App.vue
  2. 7 0
      src/api/application.js
  3. 5 2
      src/api/index.js
  4. 26 10
      src/api/version.js
  5. 0 36
      src/api/vip.js
  6. 36 0
      src/api/vipType.js
  7. 9 2
      src/assets/css/layout.less
  8. 二進制
      src/assets/user-avatar.jpeg
  9. 1 0
      src/icons/svg/人员.svg
  10. 1 0
      src/icons/svg/人员组织.svg
  11. 1 0
      src/icons/svg/企业.svg
  12. 1 0
      src/icons/svg/会员类型.svg
  13. 1 0
      src/icons/svg/审核.svg
  14. 1 0
      src/icons/svg/版本.svg
  15. 1 0
      src/icons/svg/职位.svg
  16. 1 0
      src/icons/svg/账号.svg
  17. 1 0
      src/icons/svg/部门.svg
  18. 98 37
      src/router/index.js
  19. 11 3
      src/store/modules/history.js
  20. 8 0
      src/styles/element-ui.scss
  21. 12 4
      src/styles/sidebar.scss
  22. 14 4
      src/utils/axios.js
  23. 63 22
      src/utils/common.js
  24. 1 0
      src/utils/constants.js
  25. 87 0
      src/utils/encryption.js
  26. 5 4
      src/utils/index.js
  27. 7 1
      src/utils/model/index.js
  28. 44 0
      src/utils/model/tooltip/index.vue
  29. 491 0
      src/utils/model/upload/index.vue
  30. 34 0
      src/utils/model/valueInput/index.vue
  31. 90 0
      src/utils/query.js
  32. 120 0
      src/views/backStageManage/application/apply/components/apply.vue
  33. 286 0
      src/views/backStageManage/application/apply/index copy.vue
  34. 12 272
      src/views/backStageManage/application/apply/index.vue
  35. 286 0
      src/views/backStageManage/application/function/index copy.vue
  36. 10 275
      src/views/backStageManage/application/function/index.vue
  37. 0 89
      src/views/backStageManage/application/vip/components/addVipForm.vue
  38. 0 102
      src/views/backStageManage/application/vip/components/editVipForm.vue
  39. 0 226
      src/views/backStageManage/application/vip/index.vue
  40. 25 0
      src/views/backStageManage/application/vipType/addVipType.vue
  41. 229 0
      src/views/backStageManage/application/vipType/components/form/vipType.vue
  42. 29 0
      src/views/backStageManage/application/vipType/editVipType.vue
  43. 26 0
      src/views/backStageManage/application/vipType/index.vue
  44. 223 0
      src/views/backStageManage/application/vipType/vipType.vue
  45. 29 0
      src/views/backStageManage/application/vipType/vipTypeDetail.vue
  46. 13 60
      src/views/backStageManage/application/vision/addVersion.vue
  47. 61 0
      src/views/backStageManage/application/vision/components/dialog/addFunctionDialog.vue
  48. 75 0
      src/views/backStageManage/application/vision/components/form/function.vue
  49. 381 0
      src/views/backStageManage/application/vision/components/form/versionForm.vue
  50. 135 0
      src/views/backStageManage/application/vision/components/functionTable.vue
  51. 11 0
      src/views/backStageManage/application/vision/components/mixins/commonData.js
  52. 142 0
      src/views/backStageManage/application/vision/components/mixins/functionData.js
  53. 135 0
      src/views/backStageManage/application/vision/components/mixins/treeChecked.js
  54. 0 132
      src/views/backStageManage/application/vision/components/versionForm.vue
  55. 9 31
      src/views/backStageManage/application/vision/editVersion.vue
  56. 8 204
      src/views/backStageManage/application/vision/index.vue
  57. 30 0
      src/views/backStageManage/application/vision/versionDetail.vue
  58. 307 0
      src/views/backStageManage/application/vision/vision.vue
  59. 202 0
      src/views/backStageManage/examine/examine/components/examine.vue
  60. 44 0
      src/views/backStageManage/examine/examine/components/view/table.vue
  61. 27 0
      src/views/backStageManage/examine/examine/index.vue
  62. 1 1
      src/views/backStageManage/home/index.vue
  63. 7 8
      src/views/backStageManage/layout/components/AppMain.vue
  64. 12 6
      src/views/backStageManage/layout/components/Navbar.vue
  65. 2 1
      src/views/backStageManage/layout/components/history.vue
  66. 12 2
      src/views/backStageManage/login/index.vue
  67. 21 0
      src/views/backStageManage/organization/personnel/index.vue
  68. 60 0
      src/views/backStageManage/organization/tenant/components/dialog/vipNumDialog.vue
  69. 100 0
      src/views/backStageManage/organization/tenant/components/tenant.vue
  70. 26 0
      src/views/backStageManage/organization/tenant/index.vue
  71. 17 15
      src/views/home/components/downLoad/downLoad.vue

+ 4 - 0
src/App.vue

@@ -27,6 +27,7 @@ textarea {
 }
 html, body, #app {
   width: 100%;
+  min-width: 1350px;
   height: 100%;
   padding: 0;
   margin: 0;
@@ -34,6 +35,9 @@ html, body, #app {
   font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
   overflow: hidden;
 }
+.height_100{
+  height:100% !important;
+}
 .margin-left_0 {
   margin-left: 0 !important;
 }

+ 7 - 0
src/api/application.js

@@ -12,4 +12,11 @@ export default {
     queryApplication(data){
         return axios.post('/permission/api/qiaoBiApplication/queryApplication',data)
     },
+
+    /**
+     * 查询功能
+     */
+    queryFunctionList(params) {
+        return axios.get('/permission/api/function/queryPageList', {params})
+    },
 }

+ 5 - 2
src/api/index.js

@@ -4,7 +4,9 @@ import permission from "./permission";
 import registerAndLogin from './registerAndLogin'
 import application from "./application";
 import version from "./version";
-import vip from "./vip";
+import vip from "./vipType";
+import file from "./file";
+
 
 export default {
 
@@ -12,5 +14,6 @@ export default {
   ...registerAndLogin,
   ...application,
   ...version,
-  ...vip
+  ...vip,
+  ...file
 }

+ 26 - 10
src/api/version.js

@@ -7,16 +7,7 @@ export default {
      * @returns 
      */
     getVersionList(data){
-        return axios.post('/permission/api/version/query',data)
-    },
-
-    /**
-     * 根据id获取应用版本信息
-     * @param {*} data 
-     * @returns 
-     */
-    getVersionById(params){
-        return axios.get('/permission/api/version/queryById',{params})
+        return axios.post('/permission/api/version/queryVersionList',data)
     },
 
     //添加应用版本
@@ -29,4 +20,29 @@ export default {
         return axios.post('/permission/api/version/update', data)
     },
 
+    //删除应用版本
+    removeVersions(data){
+        return axios.post('/permission/api/version/delete', data)
+    },
+
+    //编辑版本状态
+    updateVisionStatus(data){
+        return axios.post('/permission/api/version/updateStatus', data)
+    },
+
+    //编辑版本状态
+    queryPublicVersionLast(data){
+        return axios.post('/permission/api/version/queryPublicVersionLast', data)
+    },
+
+    //查询版本功能及代码
+    queryFunctionCode(data){
+        return axios.post('/permission/api/version/queryFunctionCode', data)
+    },
+
+    //查询版本功能及代码
+    addFunction(data){
+        return axios.post('/permission/api/version/addFunction', data)
+    },
+
 }

+ 0 - 36
src/api/vip.js

@@ -1,36 +0,0 @@
-import axios from '@/utils/axios'
-
-export default {
-    /**
-     * 获取应用会员列表
-     * @param {*} data 
-     * @returns 
-     */
-    getVipList(data){
-        return axios.post('/permission/api/appVipType/query',data)
-    },
-
-    /**
-     * 根据id获取应用会员信息
-     * @param {*} data 
-     * @returns 
-     */
-    getVipById(params){
-        return axios.get('/permission/api/appVipType/queryById',{params})
-    },
-
-    //添加应用会员
-    addVip(data){
-        return axios.post('/permission/api/appVipType/add', data)
-    },
-
-    //编辑应用会员
-    updateVip(data){
-        return axios.post('/permission/api/appVipType/update', data)
-    },
-
-    deleteVip(data){
-        return axios.post('/permission/api/appVipType/delete', data)
-    }
-
-}

+ 36 - 0
src/api/vipType.js

@@ -0,0 +1,36 @@
+import axios from '@/utils/axios'
+
+export default {
+    /**
+     * 获取应用会员类型
+     * @param {*} data 
+     * @returns 
+     */
+    getVipList(data){
+        return axios.post('/permission/api/vipType/query',data)
+    },
+
+
+    //添加应用会员类型
+    addVipType(data){
+        return axios.post('/permission/api/vipType/add', data)
+    },
+
+    //编辑应用会员类型
+    updateVipType(data){
+        return axios.post('/permission/api/vipType/update', data)
+    },
+    //删除会员类型
+    deleteVipType(data){
+        return axios.post('/permission/api/vipType/delete', data)
+    },
+    //查询会员类型功能
+    getVipTypeFunction(data){
+        return axios.post('/permission/api/vipType/queryFunction', data)
+    },
+    //查询窍笔所有功能
+    queryQiaoBiFunction(data){
+        return axios.post('/permission/api/qiaoBiApplication/queryFunction', data)
+    },
+
+}

+ 9 - 2
src/assets/css/layout.less

@@ -8,9 +8,12 @@
     }
   }
 }
+.padding_10{
+  padding:10px 0 !important;
+}
 .pagination {
-  text-align: center;
-  margin: 20px 0;
+  text-align: right;
+  margin: 0;
 }
 .vue-treeselect__control {
   padding-left: 10px !important;
@@ -118,3 +121,7 @@
     transform: rotate(45deg);
   }
 }
+
+.pointer_events_none{
+  pointer-events:none !important;
+}

二進制
src/assets/user-avatar.jpeg


文件差異過大導致無法顯示
+ 1 - 0
src/icons/svg/人员.svg


文件差異過大導致無法顯示
+ 1 - 0
src/icons/svg/人员组织.svg


文件差異過大導致無法顯示
+ 1 - 0
src/icons/svg/企业.svg


文件差異過大導致無法顯示
+ 1 - 0
src/icons/svg/会员类型.svg


文件差異過大導致無法顯示
+ 1 - 0
src/icons/svg/审核.svg


文件差異過大導致無法顯示
+ 1 - 0
src/icons/svg/版本.svg


文件差異過大導致無法顯示
+ 1 - 0
src/icons/svg/职位.svg


文件差異過大導致無法顯示
+ 1 - 0
src/icons/svg/账号.svg


文件差異過大導致無法顯示
+ 1 - 0
src/icons/svg/部门.svg


+ 98 - 37
src/router/index.js

@@ -2,6 +2,9 @@ import Vue from 'vue'
 import VueRouter from 'vue-router'
 import Store from '../store'
 import Cookies from 'js-cookie'
+
+import {stringifyQuery,parseQuery} from '@/utils/query'
+
 Vue.use(VueRouter)
 
 const originalPush = VueRouter.prototype.push
@@ -57,73 +60,129 @@ export const backStageManageRouterItem = [
       },
     ]
   },
-
   {
     path: '/administrator',
-    name: 'Administrator_application',
+    name: 'Administrator_organization',
     component: administrator_layout,
-    redirect: '/administrator/apply',
-    meta: { title: '应用管理', icon: 'application' },
+    redirect: '/administrator/personnel',
+    meta: { title: '人员组织管理', icon: '人员组织' },
     children: [
       {
-        path: 'addApply',
-        name: 'Administrator_addApply',
-        component: () => import('@/views/backStageManage/application/apply/components/addApply.vue'),
-        meta: {title: '添加应用功能', icon: 'apply', keepAlive:true},
-        hidden:true
+        path: 'tenant',
+        name: 'Administrator_tenant',
+        component: () => import('@/views/backStageManage/organization/tenant/index.vue'),
+        meta: {title: '企业管理',icon: '企业'},
       },
       {
-        path: 'apply',
-        name: 'Administrator_apply',
-        component: () => import('@/views/backStageManage/application/apply/index.vue'),
-        meta: { title: '应用功能清单', icon: 'apply' }
+        path: 'personnel',
+        name: 'Administrator_personnel',
+        component: () => import('@/views/backStageManage/organization/personnel/index.vue'),
+        meta: {title: '人员清单',icon: '人员'},
       },
+      // {
+      //   path: 'personnel',
+      //   name: 'Administrator_personnel',
+      //   component: () => import('@/views/backStageManage/organization/personnel/index.vue'),
+      //   meta: {title: '部门管理',icon: '部门'},
+      // },
+      // {
+      //   path: 'personnel',
+      //   name: 'Administrator_personnel',
+      //   component: () => import('@/views/backStageManage/organization/personnel/index.vue'),
+      //   meta: {title: '职位管理',icon: '职位'},
+      // },
+    ]
+  },
+
+  {
+    path: '/administrator',
+    name: 'Administrator_application',
+    component: administrator_layout,
+    redirect: '/administrator/vision',
+    meta: { title: '应用管理', icon: 'application' },
+    children: [
+      // {
+      //   path: 'addApply',
+      //   name: 'Administrator_addApply',
+      //   component: () => import('@/views/backStageManage/application/apply/components/addApply.vue'),
+      //   meta: {title: '添加应用功能', icon: 'apply', keepAlive:true},
+      //   hidden:true
+      // },
+      // {
+      //   path: 'apply',
+      //   name: 'Administrator_apply',
+      //   component: () => import('@/views/backStageManage/application/apply/index.vue'),
+      //   meta: { title: '应用功能清单', icon: 'apply' }
+      // },
       {
         path: 'vision',
         name: 'Administrator_vision',
         component: () => import('@/views/backStageManage/application/vision/index.vue'),
-        meta: { title: '应用版本清单', icon: 'vision' }
-      },
-      {
-        path: 'function',
-        name: 'Administrator_function',
-        component: () => import('@/views/backStageManage/application/apply/index.vue'),
-        meta: { title: '功能清单', icon: 'function' }
+        meta: { title: '应用版本管理', icon: '版本' }
       },
       {
         path: 'addVersion',
         name: 'Administrator_addVersion',
         component: () => import('@/views/backStageManage/application/vision/addVersion.vue'),
-        meta: {title: '添加应用版本', icon: 'addVision'},
+        meta: {title: '添加应用版本', icon: 'addVision',keepAlive:true},
         hidden:true
       },
       {
         path: 'editVersion',
         name: 'Administrator_editVersion',
         component: () => import('@/views/backStageManage/application/vision/editVersion.vue'),
-        meta: {title: '编辑应用版本', icon: 'editVision'},
+        meta: {title: '编辑应用版本', icon: 'editVision',keepAlive:true},
+        hidden:true
+      },
+      {
+        path: 'versionDetail',
+        name: 'Administrator_versionDetail',
+        component: () => import('@/views/backStageManage/application/vision/versionDetail.vue'),
+        meta: {title: '应用版本详情', icon: 'editVision'},
         hidden:true
       },
       {
-        path: 'vip',
-        name: 'Administrator_vip',
-        component: () => import('@/views/backStageManage/application/vip/index.vue'),
-        meta: {title: '应用会员清单', icon: 'vip'}
+        path: 'vipType',
+        name: 'Administrator_vipType',
+        component: () => import('@/views/backStageManage/application/vipType/index.vue'),
+        meta: {title: '应用会员类型', icon: '会员类型'}
       },
       {
-        path: 'addVip',
-        name: 'Administrator_addVip',
-        component: () => import('@/views/backStageManage/application/vip/components/addVipForm.vue'),
-        meta: {title: '添加应用会员', icon: 'addVip'},
+        path: 'addVipType',
+        name: 'Administrator_addVipType',
+        component: () => import('@/views/backStageManage/application/vipType/addVipType.vue'),
+        meta: {title: '添加应用会员类型',keepAlive:true},
         hidden:true
       },
       {
-        path: 'editVip',
-        name: 'Administrator_editVip',
-        component: () => import('@/views/backStageManage/application/vip/components/editVipForm.vue'),
-        meta: {title: '编辑应用会员', icon: 'editVip'},
+        path: 'editVipType',
+        name: 'Administrator_editVipType',
+        component: () => import('@/views/backStageManage/application/vipType/editVipType.vue'),
+        meta: {title: '编辑应用会员类型', keepAlive:true},
         hidden:true
       },
+      {
+        path: 'vipTypeDetail',
+        name: 'Administrator_vipTypeDetail',
+        component: () => import('@/views/backStageManage/application/vipType/vipTypeDetail.vue'),
+        meta: {title: '应用会员类型详情'},
+        hidden:true
+      },
+    ]
+  },
+  {
+    path: '/administrator',
+    name: 'Administrator_examine',
+    component: administrator_layout,
+    redirect: '/administrator/examine',
+    meta: { title: '审核管理', icon: '审核'},
+    children: [
+      {
+        path: 'examine',
+        name: 'Administrator_examine',
+        component: () => import('@/views/backStageManage/examine/examine/index.vue'),
+        meta: {title: '账号审核', icon: '审核'},
+      },
     ]
   },
 ]
@@ -158,20 +217,22 @@ export const backStageManage = [
 const router = new VueRouter({
   mode: 'history',
   base: '/',
-  routes: process.env.NODE_ENV !== 'production' ? [...routes, ...backStageManage] : routes
+  stringifyQuery: stringifyQuery, // 序列化query参数
+  parseQuery: parseQuery, // 反序列化query参数
+  routes: [...routes, ...backStageManage]
 })
 
 router.beforeEach((to, from, next) => {
-  const tokenStr = Cookies.get('token')
   if (to.meta.title) {
     document.title = to.meta.title;
   }
-  if (to.path == '/administrator/login'||to.path=='/home') {
+  if (to.path == '/administrator/login'|| routeExists(routes,to.path) || to.meta.notLogin) {
     Cookies.remove("token")
     localStorage.removeItem('vuex')
     next()
   }
   else {
+    const tokenStr = Cookies.get('token')
     switch (tokenStr) {
       case undefined:
         if (to.meta.title) {

+ 11 - 3
src/store/modules/history.js

@@ -1,3 +1,4 @@
+import router from "@/router";
 export default {
   state: {
     history:[],
@@ -32,17 +33,24 @@ export default {
     },
     removeHistory(state,path){
         state.history=state.history.filter(item=>{
-            return item.path!==path;
+            return item.path!=path;
         })
+        if(state.history.length == 0){
+          router.push(
+            {
+              path:'/administrator/home',
+            }
+          )
+        }
     },
     removeHistoryPath(state,path){
         state.historyPath=state.historyPath.filter(item=>{
-            return item!==path;
+            return item!=path;
         })
         if(state.historyPath.length>0)
             state.currentPath=state.historyPath[state.historyPath.length-1];
         else
-            state.currentPath=null;
+            state.currentPath=null; 
     }
 
   },

+ 8 - 0
src/styles/element-ui.scss

@@ -27,3 +27,11 @@
     }
   }
 }
+
+
+.el-header{
+  background: none;
+}
+
+
+

+ 12 - 4
src/styles/sidebar.scss

@@ -1,3 +1,15 @@
+.el-menu--vertical .el-menu-item {
+  background-color: rgb(41, 40, 40) !important; /* 设置折叠状态下子菜单的背景色 */
+  color: white !important;
+  &:hover{
+    // background-color:rgb(199, 220, 243) !important;
+    color: rgb(41, 40, 40) !important;
+    background-color: rgb(154, 156, 163) !important;
+  }
+  &.is-active{
+    color: #409EFF !important;
+  }
+}
 #app {
 
   // 主体区域
@@ -79,10 +91,6 @@
   }
 
 
-  .el-menu--collapse .el-menu .el-submenu {
-    min-width: 180px !important;
-  }
-
   //适配移动端
   .mobile {
     .main-container {

+ 14 - 4
src/utils/axios.js

@@ -35,8 +35,7 @@ _axios.interceptors.request.use(
     if (token) {
       // config.headers[constants.tokenHeader] = token
     }
-    config.headers['x-project-id'] = Store.getters.projectId || ''
-    // config.headers['x-project-id'] = Store.getters.projectId || ''
+    config.headers['applicationCode'] = '4e95e3d926a2a4befa5d913acc0aa9f5'
     if (config.loading) {
       loadingInstance = Loading.service({})
     }
@@ -63,7 +62,7 @@ _axios.interceptors.response.use(
     }
     else if (code === 401) {
       Router.push({
-        path: `${Store.getters.prefix}/login`
+        path: `/administrator/login`
       }).then(r => {})
       return Promise.reject(response.data)
     }
@@ -83,6 +82,10 @@ _axios.interceptors.response.use(
     }
     else if (code === 500) {
       // TODO
+      Notification.error({
+        title: '请求错误',
+        message: message
+      })
       return Promise.reject(response.data)
     } else if (code === 0) {
       isRefreshing = false
@@ -92,8 +95,15 @@ _axios.interceptors.response.use(
       })
       return Promise.reject(response.data)
     } else{
+      // isRefreshing = false
+      // return response.data 
       isRefreshing = false
-      return response.data 
+      Notification.error({
+        title: '请求错误',
+        message: message
+      })
+      
+      return Promise.reject(response.data)
     }
     // Do something with response data
     // return response;

+ 63 - 22
src/utils/common.js

@@ -2,12 +2,73 @@
 import { Message } from 'element-ui'
 import Config from '@/config'
 export default {
+   /**
+   * 防抖
+   * @param {Function} func 
+   * @param {Number} duration 
+   * @returns 
+   */
+   debounce(func, duration = 500) {
+    let timer;
+    return () => {
+      clearTimeout(timer)
+      timer = setTimeout(func, duration)
+    }
+  },
+  /**
+   * 节流
+   * @param {Function} func 
+   * @param {Number} delay 
+   * @returns 
+   */
+  throttle(func, delay = 2000) {
+    let flag = true
+    return () => {
+      if (!flag) return;
+      flag = false;
+      setTimeout(() => {
+        func()
+        flag = true
+      }, delay)
+    }
+  },
+  //显示表头数据
+  renderHeaderMethods(h, { column }, message) {
+    if(!column.sortable){
+      return column.label
+    }
+    var message = '点击升序'
+    switch (column.order) {
+      case "":
+        message = '点击升序'
+        break;
+      case "ascending":
+        message = '点击降序'
+        break;
+      case 'descending':
+        message = '点击取消排序'
+        break
+    }
+    return [
+      ,
+      h(
+        'el-tooltip',
+        {
+          props: {
+            content: message, // 鼠标悬停时要展示的文字提示
+            placement: 'top' // 悬停内容展示的位置
+          }
+        },
+        [h('span', column.label)] // 图标
+      )
+    ]
+  },
   //查看文件
-  getFile(guid) {
+  checkViewer(guid) {
     if(!guid){
       return ''
     }
-    return `/fileManager/downloadFile?fileId=${guid}`
+    return `/api/fileManager/downloadFile?fileId=${guid}`
   },
    //校验文件是否全部上传
    validFile(data,arr) {
@@ -38,24 +99,4 @@ export default {
 
     return arr
   },
-
-  //导出
-  downLoad(guid){
-    const href = this.getFile(guid)
-    const anchor = document.createElement('a');
-    const fileName = 'download';
-    if ('download' in anchor) {
-      anchor.href = href;
-      anchor.setAttribute("download", fileName);
-      anchor.className = "download-js-link";
-      anchor.innerHTML = "downloading...";
-      anchor.style.display = "none";
-      document.body.appendChild(anchor);
-      setTimeout(function () {
-        anchor.click();
-        document.body.removeChild(anchor);
-      }, 66);
-      return true;
-    }
-  },
 }

+ 1 - 0
src/utils/constants.js

@@ -73,4 +73,5 @@ export default {
     { label: 'Courier New', value: 'Courier New' },
     { label: 'Microsoft YaHei', value: 'Microsoft YaHei' },
   ],
+  sourceId:6,
 }

+ 87 - 0
src/utils/encryption.js

@@ -0,0 +1,87 @@
+ 
+import CryptoJS from 'crypto-js'
+import CryptoJSCore from 'crypto-js/core'
+import AES from 'crypto-js/aes'
+import ZeroPadding from 'crypto-js/pad-zeropadding'
+import Utf8, { parse } from 'crypto-js/enc-utf8'
+import Base64 from 'crypto-js/enc-base64'
+ 
+/*
+ * 加密 解密
+ */
+const keyHex = parse('1111111111111111') // 十六位数作为密钥,自行修改
+const ivHex = CryptoJS.lib.WordArray.random(128 / 8) // 十六位数作为密钥偏移量 随机生成
+ 
+/**
+ * 加密
+ * @param {String} key
+ * @returns {string}
+ */
+// 加密后的结果通常是一个CipherParams对象,其中包含了加密后的密文数据,而密文数据本身是一个WordArray对象。同样,在解密过程中,解密后的结果也是一个WordArray对象。
+export const getEncrypt = (key) => {
+  try {
+    key = JSON.stringify(key)
+  } catch (e) {
+    console.warn(e)
+  }
+  //   key需要是WordArray类型
+  return JSON.stringify({
+    encrypt: AES.encrypt(key, keyHex, {
+      mode: CryptoJSCore.mode.CBC,
+      padding: ZeroPadding,
+      iv: ivHex,
+    }).toString(),
+    iv: ivHex,
+  })
+}
+ 
+/**
+ * 加密后转base64
+ * @param {String}} key
+ */
+export const getEncryptToBase64 = (key) => {
+  const encryptStr = getEncrypt(key)
+  const wordArray = Utf8.parse(encryptStr) //转为WordArray对象
+  return Base64.stringify(wordArray)
+}
+ 
+/**
+ * 解密
+ * @param data
+ * @returns {string}
+ */
+export const getDecrypt = (data) => {
+  let { encrypt, iv } = JSON.parse(data)
+  let decrypted = AES.decrypt(
+    {
+      ciphertext: Base64.parse(encrypt),
+    },
+    keyHex,
+    {
+      mode: CryptoJSCore.mode.CBC,
+      padding: ZeroPadding,
+      iv: iv,
+    }
+  ).toString(Utf8) //转换为指定编码的字符串
+ 
+  try {
+    decrypted = JSON.parse(decrypted)
+  } catch (e) {
+    console.warn(e)
+  }
+  return decrypted
+}
+ 
+/**
+ * 对base64数据解密  先解析base64,在做解密
+ * @param {String} data
+ * @returns {string}
+ */
+export const getDecryptByBase64 = (data) => {
+  // 将Base64字符串转换为WordArray
+  const parsedWordArray = Base64.parse(data)
+  //   WordArray对象转换成一个UTF-8编码的字符串
+  const decryptStr = Utf8.stringify(parsedWordArray)
+ 
+  return getDecrypt(decryptStr)
+}

+ 5 - 4
src/utils/index.js

@@ -1,6 +1,7 @@
 import moment from 'moment'
 import _ from 'lodash'
 import constants from '@/utils/constants'
+import commonJS from './common'
 
 export const formatDate = (date, format = 'YYYY-MM-DD') => {
   return moment(date).format(format)
@@ -51,10 +52,10 @@ export const downLoadBase64 = (content, fileName) => {
   aLink.click();
 }
 
-export const downLoad2 = (url) => {
-  const href = `/api/v2/common/download?url=${encodeURIComponent(url)}`
+export const downLoad2 = (guid,fileName="download") => {
+  const href = commonJS.checkViewer(guid)
   const anchor = document.createElement('a');
-  const fileName = 'download';
+  // const fileName = 'download';
   if ('download' in anchor) {
     anchor.href = href;
     anchor.setAttribute("download", fileName);
@@ -199,4 +200,4 @@ export const renderSize = (value) => {
 
 export const getPatentCountry = (patentNo) => {
   return patentNo.substr(0, 2)
-}
+}

+ 7 - 1
src/utils/model/index.js

@@ -1,9 +1,15 @@
 // 全局注册自定义
 
 import myInput from './input/index.vue'
+import myUpload from './upload/index.vue'
+import myTooltip from './tooltip/index.vue'
+import valueInput from './valueInput'
 
 var models = {
-  myInput
+  myInput,
+  myUpload,
+  myTooltip,
+  valueInput
 }
 export default {
   install(Vue) {

+ 44 - 0
src/utils/model/tooltip/index.vue

@@ -0,0 +1,44 @@
+<template>
+  <el-tooltip class="item" :content="content+''" :disabled="!disable" v-bind="$attrs" ref="myToolTip">
+    <template #content="scopeData">
+        <slot name="content"  v-bind="scopeData || {}"></slot>
+    </template>
+    <template>
+        <slot></slot>
+    </template>
+      
+    </el-tooltip>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {
+    disabled:Boolean,
+    content:{
+      type:[String,Number]
+    }
+  },
+  data() {
+    return {
+        disable:true
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {
+    this.$refs.myToolTip.$el.addEventListener('mouseenter',this.mouseenter)
+  },
+  methods: {
+    mouseenter(e){
+        var target = e.target
+        const target_Width = target.scrollWidth;
+        const target_content_Width= target.clientWidth;
+        this.disable = target_Width > target_content_Width;
+    }
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 491 - 0
src/utils/model/upload/index.vue

@@ -0,0 +1,491 @@
+<template>
+  <div class="myUpload">
+    <div class="myUpload1" v-if="show">
+      <div class="myDemo">
+        <el-upload
+          ref="uploadRef"
+          class="upload-demo"
+          action="#"
+          :auto-upload="false"
+          :drag="drag"
+          :multiple="multiple"
+          :data="data"
+          :name="name"
+          :show-file-list="false" 
+          :accept="accept"
+          :list-type="listType"
+          :disabled="disabled"
+          :limit="limit"
+          :on-preview="onPreview"
+          :on-remove="onRemove"
+          :on-success="onSuccess"
+          :on-error="onError"
+          :on-progress="onProgress"
+          :on-change="onChange"
+          :on-exceed="onExceed"
+          style="width: 100%"
+        >
+          <i class="el-icon-upload"></i>
+          <div class="el-upload__text">
+            <div>将文件拖到此处,或<em>点击上传</em></div>
+            <div v-if="accept"><span>只能上传{{ accept }}文件</span></div>
+          </div>
+        </el-upload>
+      </div>
+      <div class="line" v-if="fileList.length > 0"></div>
+      <div class="fileList" v-if="fileList.length > 0">
+        <ul>
+          <li v-for="item in fileList" :key="item.guid" @dblclick="ondblclick(item)">
+            <myTooltip :content="item.name ? item.name : item.originalName">
+              <div class="noWrap">
+                <i class="el-icon-document" style="margin-right: 10px"></i
+                ><span class="name" @click="checkFiles(item)">{{
+                  item.name ? item.name : item.originalName
+                }}</span>
+              </div>
+            </myTooltip>
+            <div class="type" v-if="autoUpload">{{ item.guid ? "已上传" : "待上传" }}</div>
+            <div class="icon" @click="onRemove(item, fileList)">
+              <i class="el-icon-close"></i>
+            </div>
+          </li>
+        </ul>
+      </div>
+    </div>
+    <el-dialog
+      custom-class="myUpload_dialog"
+      :visible.sync="dialogVisible"
+      width="500px"
+      :before-close="handleClose"
+      :append-to-body="true" 
+      :close-on-click-modal="false">
+      <div slot="title">提示信息<span class="title" ><i class="el-icon-warning"></i></span></div>
+      <div>
+        <div v-if="discontent.length>0">
+          <div  class="content">
+            <div>
+              <i class="el-icon-error red"></i>
+            </div>
+            <div @click="showDiscontent = !showDiscontent">
+              <i class="el-icon-caret-right" v-if="!showDiscontent"></i>
+              <i class="el-icon-caret-bottom" v-else></i>
+            </div>
+            <div>
+              上传文件格式不正确
+            </div>
+          </div>
+          <div v-if="showDiscontent" class="list showList">
+            <div v-for="(item,index) in discontent" :key="item.name">{{ item.name }}<span v-if="index != discontent.length-1">,</span></div>
+          </div>
+        </div>
+        <div v-if="exist.length>0">
+          <div class="content">
+            <div>
+              <i class="el-icon-error red"></i>
+            </div>
+            <div @click="showExist = !showExist">
+              <i class="el-icon-caret-right" v-if="!showExist"></i>
+              <i class="el-icon-caret-bottom" v-else></i>
+            </div>
+            <div>
+              上传文件名称重复
+            </div>
+          </div>
+          <div v-if="showExist" class="showList">
+            <div class="list">{{ exist.map((item) => { return item.name;}).join(',') }}</div>
+            <div class="menu">
+              <div @click="choose(1)">
+                <i class="el-icon-check"></i>
+                <span>替换目标中的文件</span>
+              </div>
+              <div @click="choose(2)">
+                <i class="iconfont icon--skip"></i>
+                <span>跳过这些文件</span>
+              </div>
+              <!-- <div @click="choose(3)">
+                <i class="iconfont icon-wenbentihuan"></i>
+                <span>让我决定每个文件</span>
+              </div> -->
+            </div>
+          </div>
+        </div>
+        
+      </div>
+      <div slot="footer">
+        <el-button type="primary" size="small" @click="handleClose" >我知道了</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import myTooltip from '../tooltip/index'
+export default {
+  components: {
+    myTooltip
+  },
+  props: {
+    //上传的接口或地址
+    action: {
+      type: String,
+      default: "",
+    },
+    multiple: {
+      type: Boolean,
+    },
+    data: {
+      type: Object,
+    },
+    name: {
+      type: String,
+      default: "",
+    },
+    showFileList: {
+      type: Boolean,
+    },
+    drag: {
+      type: Boolean,
+      default: true,
+    },
+    accept: {
+      type: String,
+      default: "",
+    },
+    listType: {
+      type: String,
+      default: "text",
+    },
+    //是否立即上传
+    autoUpload: {
+      type: Boolean,
+      default: false,
+    },
+    //文件列表
+    fileList: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    disabled: {
+      type: Boolean,
+      default: false,
+    },
+    limit: {
+      type: Number,
+    },
+  },
+  data() {
+    return {
+      discontent: [],
+      showDiscontent:false,
+      exist:[],
+      exist2:[],
+      showExist:false,
+      dialogVisible:false,
+      show : false
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {
+    this.show = true
+  },
+  mounted() {
+  },
+  methods: {
+    // 双击已上传的文件
+    ondblclick(file) {
+      if(file.guid){
+        var fileName = file.name || file.referencesName || file.fileName
+        var type = fileName.split('.').pop()
+        this.$commonJS.previewFile({fileName:fileName},file.guid,type.toLowerCase())
+      }
+      this.$emit('on-dblclick',file)
+    },
+    onPreview(file) {
+      this.$emit("on-preview", file);
+    },
+    onRemove(file, fileList) {
+      this.$emit("on-remove", file, fileList);
+    },
+    onSuccess(response, file, fileList) {
+      this.$emit("on-success", response, file, fileList);
+    },
+    onError(err, file, fileList) {
+      this.$emit("on-error", err, file, fileList);
+    },
+    onProgress(event, file, fileList) {
+      this.$emit("on-progress", event, file, fileList);
+    },
+    onChange(file, fileList) {
+      if(this.limit){
+        if(this.fileList.length>=this.limit){
+          this.$message.warning(`只能上传${this.limit}个文件`)
+          return false
+        }
+      }
+      this.$nextTick(() => {
+        if(this.discontent.length>0 || this.exist.length>0){
+          this.open()
+        }
+      });
+      //审核上传文件类型
+      if (this.accept) {
+        var arr = this.accept.split(/,|,/g);
+        var fileType = file.name.substring(file.name.lastIndexOf("."));
+        var index = arr.findIndex((item) => {
+          return item == fileType;
+        });
+        if (index == -1) {
+          this.discontent.push(file);
+          return false;
+        }
+      }
+      //验证是否有重复文件
+      if(this.fileList.length>0){
+        var index = this.fileList.findIndex(item =>{
+          return item.name == file.name || item.originalName == file.name
+        })
+        if(index != -1){
+          this.exist.push(file)
+          this.exist2.push(this.fileList[index])
+          return false
+        }
+      }
+      this.$emit("on-change", file);
+      this.$refs.uploadRef.clearFiles()
+      //是否立即上传
+      if (this.autoUpload) {
+        this.uploadFile(file)
+        return false
+      }
+      
+    
+    },
+    onExceed(file, fileList) {
+      this.$emit("on-exceed", file, fileList);
+    },
+    //查看文件
+    checkFiles(file) {
+      if(file.guid){
+
+      }else{
+
+      }
+    },
+    //上传附件
+    uploadFile(file){
+      let formData = new FormData()
+      formData.append('sourceId',this.$constants.sourceId)
+      formData.append('files',file.raw)
+      this.$api.uploadFile(formData).then(response=>{
+        if(response.code == 200){
+          file.guid = response.data[0]
+          file.raw.guid = response.data[0]
+          this.$emit("on-change", file)
+        }
+      })
+    },
+    //打开提示弹窗
+    open(){
+      this.dialogVisible = true
+    },
+    //关闭弹窗
+    handleClose(){
+      this.dialogVisible = false
+      this.discontent = []
+      this.exist = []
+      this.exist2=[]
+      this.showDiscontent=false
+      this.showExist = false
+    },
+    //操作
+    choose(type){
+      switch(type){
+        case 1:
+          this.exist2.forEach((item,index)=>{
+            this.onRemove(item,this.fileList)
+            this.$emit("on-change", this.exist[index]);
+            this.uploadFile(this.exist[index])
+          })
+          this.handleClose()
+          break;
+        case 2:
+          this.handleClose()
+          break;
+        case 3:
+          break;
+      }
+    },
+ 
+  },
+  destroyed(){
+    this.show = false
+  },
+};
+</script>
+<style lang="scss">
+.myUpload1 {
+  .el-upload {
+    width: 100%;
+    height: 100%;
+    .el-upload-dragger {
+      width: 100% !important;
+      height: 100%;
+      border: none;
+      border-radius: 0px;
+    }
+    .el-upload-dragger:hover {
+      border: none;
+    }
+  }
+  .el-upload-list {
+    display: none;
+  }
+}
+.myUpload_dialog{
+  border: 2px solid var(--bg);
+  box-shadow: none;
+  --fs:15px;
+  i{
+    cursor: pointer;
+  }
+  .el-dialog__close{
+    color: black;
+    font-weight: bold;
+  }
+  .el-dialog__headerbtn{
+    top: 14px;
+  }
+  .el-dialog__header{
+    border-bottom: 2px solid var(--bg) !important;
+    color: red;
+    padding: 10px;
+  }
+  .el-dialog__body{
+    padding: 20px 10px;
+  }
+  .el-dialog__footer{
+    border-top:none !important;
+  }
+  .title{
+    margin-left: 10px;
+  }
+  .content{
+    display: flex;
+    align-items: center;
+    padding: 5px 0px;
+    color: var(--bg);
+    font-size: var(--fs);
+    font-family: var(--fm);
+    font-weight: bold;
+  }
+  .red{
+    color: red;
+  }
+  .showList{
+    padding-left:var(--fs) ;
+  }
+  .list{
+    padding-top: 5px;
+    padding-bottom: 5px;
+    font-size: 14px;
+    display: flex;
+    flex-wrap: wrap;
+    // overflow: hidden;
+    // white-space: nowrap;
+    // text-overflow:ellipsis;
+  }
+  .menu{
+    font-size: 14px;
+    i{
+      font-size: 14px;
+    }
+    div{
+      font-family: var(--fm);
+      padding: 5px 0;
+      cursor: pointer;
+      color: var(--bg);
+      i{
+        color: blue;
+      }
+        span{
+          margin-left:10px
+        }
+    }
+    div:hover{
+      background: #85afd9;
+    }
+  }
+  
+}
+</style>
+<style lang="scss" scoped>
+.myUpload {
+  width: calc(100% - 0px);
+  height: 185px;
+  padding: 5px;
+}
+.myUpload1 {
+  width: calc(100% - 20px);
+  height: 100%;
+  padding: 5px;
+  display: flex;
+  align-items: center;
+  background: white;
+  border: 1px dashed var(--bg);
+  border-radius: 10px;
+  .myDemo {
+    width: 100%;
+    height: 100%;
+    flex: 1;
+  }
+  .line {
+    width: 1px;
+    height: 100%;
+    background: var(--bg);
+  }
+  .fileList {
+    width: 100%;
+    height: 100%;
+    overflow-y: auto;
+    flex: 2;
+    ul {
+      list-style-type: none;
+      padding: 0 10px;
+      li {
+        line-height: initial;
+        padding: 5px 10px;
+        border-radius: 5px;
+        display: flex;
+        justify-content: space-between;
+
+        .type {
+          min-width:75px;
+          display: block;
+          color: #57a5f7;
+        }
+        .icon {
+          display: none;
+        }
+      }
+      li:hover {
+        background: #f4f4f4;
+        .name {
+          color: #57a5f7;
+          cursor: pointer;
+        }
+        .type {
+          min-width:75px;
+          display: none;
+        }
+        .icon {
+          display: block;
+          cursor: pointer;
+        }
+      }
+    }
+  }
+}
+</style>

+ 34 - 0
src/utils/model/valueInput/index.vue

@@ -0,0 +1,34 @@
+<template>
+  <components :is="component" v-model="newValue" v-bind="$attrs" v-on="$listeners"></components>
+</template> 
+
+<script>
+export default {
+  components: {},
+  props: {
+    value:{
+
+    },
+    component:{
+        type:String,
+        default:"el-input"
+    }
+  },
+  data() {
+    return {
+        newValue:this.value,
+    };
+  },
+  watch: {
+    value(){
+        this.newValue = this.value
+    }
+  },
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {},
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 90 - 0
src/utils/query.js

@@ -0,0 +1,90 @@
+import {
+    getEncryptToBase64 as encrypt,
+    getDecryptByBase64 as decrypt,
+  } from './encryption'
+const encodeReserveRE = /[!'()*]/g
+const encodeReserveReplacer = (c) => '%' + c.charCodeAt(0).toString(16)
+const commaRE = /&2c/g
+
+const encode = (str)=>{
+    return encodeURIComponent(str)
+        .replace(encodeReserveRE,encodeReserveReplacer)
+        .replace(commaRE,',')
+}
+
+const decode = decodeURIComponent
+
+function isBase64(str){
+    if(!str || str.trim() === ''){
+        return false
+    }
+
+    const base64Pattern = /^[A-Za-z0-9+/]*={0,2}$/
+
+    if(!base64Pattern.test(str)){
+        return false
+    }
+
+    try{
+        return btoa(atob(str)) === str
+    }catch(err){
+        return false
+    }
+}
+
+export const stringifyQuery = (obj)=>{
+    const res = obj
+        ? Object.keys(obj).map((key)=>{
+            const val = obj[key]
+            if(val === null || val === undefined){
+                return encode(key)
+            }
+
+            if(Array.isArray(val)){
+                const result = []
+                val.forEach((val2)=>{
+                    if(val === null || val === undefined){
+                        result.push(encode(key))
+                    }else{
+                        result.push(encode(key) + '=' + encode(val2))
+                    }
+                })
+                return result.join('&')
+            }
+            return encode(key) + '=' + encode(val)
+        }).join('&')
+        : null
+    return res ? `?${encrypt(res)}` : ''
+}
+
+
+export const parseQuery = (query) =>{
+    const res = {}
+
+    query = query.trim().replace(/^(\?|#|&)/,'')
+
+    if(!query){
+        return res
+    }
+
+    query = isBase64(query) ? decrypt(query) : query
+    // try{
+    //     query = decrypt(query)
+    // }catch(err){
+    //     query = query
+    // }
+
+    query.split('&').forEach((param)=>{
+        const parts = param.split('=')
+        const key = decode(parts.shift())
+        const val = parts.length>0 ? decode(parts.join('')) : null
+        if(res[key] === undefined){
+            res[key] = val
+        }else if(Array.isArray(res[key])){
+            res[key].push(val)
+        }else{
+            res[key] = [res[key],val]
+        }
+    })
+    return res
+}

+ 120 - 0
src/views/backStageManage/application/apply/components/apply.vue

@@ -0,0 +1,120 @@
+<template>
+  <div class="height_100">
+    <el-container>
+        <el-header>
+            <el-form :inline="true">
+                <el-form-item>
+                    <el-input v-model="queryParams.name" size="small" placeholder="请输入"></el-input>
+                </el-form-item>
+                <el-form-item>
+                    <el-button type="" size="small" @click="getList">查询</el-button>
+                    <el-button type="primary" size="small" @click="handleAdd(0)">新增</el-button>
+                </el-form-item>
+            </el-form>
+        </el-header>
+        <el-main class="padding_10">
+            <el-table
+                :row-key="getRowKeys" 
+                v-loading="loading"
+                :data="tableData"
+                header-row-class-name="custom-table-header"
+                max-height="calc(100% - 0)"
+            >
+            <el-table-column label="应用名称" align="" show-overflow-tooltip>
+                <template slot-scope="scope">
+                <span class="details">{{scope.row.name}}</span>
+                </template>
+            </el-table-column>
+            <el-table-column prop="describe" label="应用描述" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="createUserName" label="创建人" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column label="操作" align="center" width="150">
+                <template slot-scope="scope">
+                <el-dropdown split-button type="primary" size="small" @click="handleEdit(scope.row)">
+                    编辑
+                    <el-dropdown-menu slot="dropdown" class="text-align_center">
+                    
+                    <el-dropdown-item @click.native="handleDetails(scope.row)">详情</el-dropdown-item>
+                    <el-dropdown-item class="color-red" @click.native="handleDelete(scope.row)" divided>删除</el-dropdown-item>
+                    </el-dropdown-menu>
+                </el-dropdown>
+                </template>
+            </el-table-column>
+            </el-table>
+        </el-main>
+        <el-footer class="pagination">
+                <el-pagination :current-page.sync="queryParams.current" :page-size="queryParams.size" :total="total" @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
+        </el-footer>
+    </el-container>
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {},
+  data() {
+    return {
+        getRowKeys(row){
+            return row.id
+        },
+        loading: false,
+        btnLoading: false,
+        total: 0,
+        tableData: [],
+        queryParams: {
+            size: 10,
+            current: 1,
+            name: ''
+        },
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    getList() {
+      this.loading = true
+      this.$api.queryApplication(this.queryParams).then(response => {
+        this.tableData = response.data
+        this.total = response.pageColumn.total
+        this.loading = false
+      }).catch(error => {
+        this.tableData = []
+        this.loading = false
+      })
+    },
+    handleDelete(row) {
+      this.$confirm('确认删除本条数据吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loading = true
+        this.$api.deleteApply({ id: row.id }).then(response => {
+          this.$message.success('删除成功')
+          this.loading = false
+          this.getList()
+        }).catch(error => {
+          this.loading = false
+        })
+      })
+    },
+    //新增
+    handleAdd(parentId) {
+    },
+    //编辑
+    handleEdit(row) {
+      this.title = '编辑应用'
+    },
+    //详情
+    handleDetails(row){
+    
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 286 - 0
src/views/backStageManage/application/apply/index copy.vue

@@ -0,0 +1,286 @@
+<template>
+  <div class="admin-apply">
+    <el-form :inline="true">
+      <el-form-item>
+        <el-input v-model="queryParams.name" size="small" placeholder="请输入"></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="" size="small" @click="getList">查询</el-button>
+        <el-button type="primary" size="small" @click="handleAdd(0)">新增</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table
+        :row-key="getRowKeys" 
+        v-loading="loading"
+        :data="tableData"
+        header-row-class-name="custom-table-header"
+
+        :expand-row-keys="expands"
+        @expand-change="expandChange"
+        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+    >
+     <el-table-column type="expand">
+      <template slot-scope="scope" style="width:80%">
+        <function-list :applyId="scope.row.id"></function-list>
+      </template>
+    </el-table-column>
+      <el-table-column label="应用名称" align="" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <span class="details">{{scope.row.name}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="describe" label="应用描述" align="center" show-overflow-tooltip></el-table-column>
+      <el-table-column prop="createUserName" label="创建人" align="center" show-overflow-tooltip></el-table-column>
+      <el-table-column label="操作" align="center" width="150">
+        <template slot-scope="scope">
+          <el-dropdown split-button type="primary" size="small" @click="handleEdit(scope.row)">
+            编辑
+            <el-dropdown-menu slot="dropdown" class="text-align_center">
+             
+              <el-dropdown-item @click.native="handleDetails(scope.row)">详情</el-dropdown-item>
+              <el-dropdown-item class="color-red" @click.native="handleDelete(scope.row)" divided>删除</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="pagination">
+      <el-pagination :current-page.sync="queryParams.current" :page-size="queryParams.size" :total="total" @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
+    </div>
+    <el-dialog :title="title" :visible.sync="visible" width="500px" :before-close="close">
+      <el-form v-if="visible" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" label-position="left">
+      
+        <el-form-item label="应用名称" prop="name">
+          <el-input v-model="ruleForm.name" placeholder="请输入应用名称"></el-input>
+        </el-form-item>
+        
+        <el-form-item label="应用描述" prop="describe">
+          <el-input v-model="ruleForm.describe" placeholder="请输入" type="textarea" maxlength="100" show-word-limit></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="close">取 消</el-button>
+        <el-button type="primary" @click="submit" :loading="btnLoading">确 定</el-button>
+      </div>
+    </el-dialog>
+       <el-dialog :title="title" :visible.sync="showvisible" width="700px" class="my-dialog-name" contentStyle="width:400px;" :before-close="close" v-if="ruleForm.apply!=null">
+        <el-form label-position="left"  class="demo-table-expand" label-width="80px">
+          <el-form-item label="应用名称 :">
+            <span>{{ruleForm.apply.name}}</span>
+          </el-form-item>
+          <el-form-item label="应用描述 :">
+            <span>{{ruleForm.apply.describe}}</span>
+          </el-form-item>
+           <el-form-item label="创建人 :">
+            <span>{{ruleForm.apply.createUserName}}</span>
+          </el-form-item>
+          <el-form-item label="租户列表" class="list">
+         
+          </el-form-item>
+         
+        </el-form>
+          <el-table :data="ruleForm.tenantVOList" header-row-class-name="custom-table-header"  max-height="250" border>
+            <!-- <el-table-column type="index" label="#" width="55" align="center"></el-table-column> -->
+            <el-table-column prop="name" label="租户名称" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="contacts" label="联系人" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="address" label="联系人地址" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="type" label="类型" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column label="是否启用" align="center" show-overflow-tooltip>
+              <template slot-scope="scope">
+              <span v-if="scope.row.state==0">否</span>
+              <span v-if="scope.row.state==1">是</span>
+            </template>
+            </el-table-column>
+          </el-table>
+
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import FunctionList from '../function/index.vue'
+export default {
+  components: {
+    Treeselect,
+    FunctionList
+  },
+  data() {
+    return {
+     getRowKeys(row){
+				return row.id
+			},
+      visible: false,
+      showvisible:false,
+      loading: false,
+      btnLoading: false,
+      total: 0,
+      tableData: [],
+      title: '',
+      expands:[],
+      queryParams: {
+        size: 10,
+        current: 1,
+        name: ''
+      },
+      ruleForm: {},
+      rules: {
+        name: [{ required: true, message: '请输入应用名称', trigger: 'blur' },],
+        describe: [{ required: true, message: '请输入描述', trigger: 'blur' },],
+      },
+    }
+  },
+    computed: {
+    userinfo() {
+      return this.$store.state.admin.userinfo
+    }
+  },
+  mounted() {
+    this.getList()
+
+  },
+  methods: {
+    expandChange(row,expandedRows) {
+			let that=this
+			console.log(expandedRows);
+			if (expandedRows.length) {
+              that.expands = []
+              if (row) {
+                that.expands.push(row.id)
+              }
+            } else {
+              that.expands = []
+            }
+    },
+   
+    normalizer(node) {
+      return {
+        id: node.id,
+        label: node.name,
+      }
+    },
+    handleAdd(parentId) {
+      this.title = '新增应用'
+      this.visible = true
+      this.ruleForm = {
+        // sort: 0,
+        // parentId: parentId
+      }
+    },
+    handleEdit(row) {
+      this.title = '编辑应用'
+      this.visible = true
+      this.ruleForm = { ...row }
+    },
+    handleDetails(row){
+      this.title = '应用详情'
+      this.showvisible = true
+      this.$api.getAllTenantByApplicationId({id:row.id}).then(response=>{
+         console.log(response)
+         
+         this.ruleForm = response.data
+         this.ruleForm.apply={...row}
+      })
+     
+    },
+     handleCurrentChange(val) {
+      this.queryParams.current = val;
+      this.getList();
+    },
+    close() {
+      this.visible = false
+      this.showvisible = false
+    },
+    getList() {
+      this.loading = true
+      this.$api.queryApplication(this.queryParams).then(response => {
+       
+        this.tableData = response.data
+        this.total = response.pageColumn.total
+        this.loading = false
+      }).catch(error => {
+        this.loading = false
+      })
+    },
+    submit() {
+      this.$refs.ruleForm.validate((valid) => {
+        if (valid) {
+          this.btnLoading = true
+          if (this.ruleForm.id) {
+            this.$api.editApply(this.ruleForm).then(response => {
+              this.$message.success('编辑成功')
+              this.btnLoading = false
+              this.getList()
+              this.close()
+            }).catch(error => {
+              this.btnLoading = false
+            })
+          } else {
+            this.ruleForm.tenant=this.userinfo.tenantId
+            this.$api.addApply(this.ruleForm).then(response => {
+              console.log(2,response)
+              this.$message.success('新增成功')
+              this.btnLoading = false
+              this.getList()
+              this.close()
+            }).catch(error => {
+              this.btnLoading = false
+            })
+          }
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    handleDelete(row) {
+      this.$confirm('确认删除本条数据吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loading = true
+        this.$api.deleteApply({ id: row.id }).then(response => {
+          this.$message.success('删除成功')
+          this.loading = false
+          this.getList()
+        }).catch(error => {
+          this.loading = false
+        })
+      })
+    }
+  }
+}
+</script>
+<style lang="scss">
+.my-dialog-name{
+  .el-dialog__body{
+  padding-top:0
+}
+}
+.list .el-form-item__label{
+    font-weight: 900;
+}
+</style>
+<style lang="scss" scoped>
+.admin-apply {
+
+}
+.details:hover{
+  border-bottom: 1px solid black;
+  cursor: pointer;
+}
+ .demo-table-expand {
+    font-size: 0;
+  }
+  .demo-table-expand label {
+    width: 90px;
+    color: #99a9bf;
+  }
+  .demo-table-expand .el-form-item {
+    margin-right: 0;
+    margin-bottom: 0;
+    width: 50%;
+  }
+</style>

+ 12 - 272
src/views/backStageManage/application/apply/index.vue

@@ -1,286 +1,26 @@
 <template>
-  <div class="admin-apply">
-    <el-form :inline="true">
-      <el-form-item>
-        <el-input v-model="queryParams.name" size="small" placeholder="请输入"></el-input>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="" size="small" @click="getList">查询</el-button>
-        <el-button type="primary" size="small" @click="handleAdd(0)">新增</el-button>
-      </el-form-item>
-    </el-form>
-    <el-table
-        :row-key="getRowKeys" 
-        v-loading="loading"
-        :data="tableData"
-        header-row-class-name="custom-table-header"
-
-        :expand-row-keys="expands"
-        @expand-change="expandChange"
-        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
-    >
-     <el-table-column type="expand">
-      <template slot-scope="scope" style="width:80%">
-        <function-list :applyId="scope.row.id"></function-list>
-      </template>
-    </el-table-column>
-      <el-table-column label="应用名称" align="" show-overflow-tooltip>
-        <template slot-scope="scope">
-          <span class="details">{{scope.row.name}}</span>
-        </template>
-      </el-table-column>
-      <el-table-column prop="describe" label="应用描述" align="center" show-overflow-tooltip></el-table-column>
-      <el-table-column prop="createUserName" label="创建人" align="center" show-overflow-tooltip></el-table-column>
-      <el-table-column label="操作" align="center" width="150">
-        <template slot-scope="scope">
-          <el-dropdown split-button type="primary" size="small" @click="handleEdit(scope.row)">
-            编辑
-            <el-dropdown-menu slot="dropdown" class="text-align_center">
-             
-              <el-dropdown-item @click.native="handleDetails(scope.row)">详情</el-dropdown-item>
-              <el-dropdown-item class="color-red" @click.native="handleDelete(scope.row)" divided>删除</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-        </template>
-      </el-table-column>
-    </el-table>
-    <div class="pagination">
-      <el-pagination :current-page.sync="queryParams.current" :page-size="queryParams.size" :total="total" @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
-    </div>
-    <el-dialog :title="title" :visible.sync="visible" width="500px" :before-close="close">
-      <el-form v-if="visible" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" label-position="left">
-        
-        <el-form-item label="应用名称" prop="name">
-          <el-input v-model="ruleForm.name" placeholder="请输入应用名称"></el-input>
-        </el-form-item>
-        
-        <el-form-item label="应用描述" prop="describe">
-          <el-input v-model="ruleForm.describe" placeholder="请输入" type="textarea" maxlength="100" show-word-limit></el-input>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="close">取 消</el-button>
-        <el-button type="primary" @click="submit" :loading="btnLoading">确 定</el-button>
-      </div>
-    </el-dialog>
-       <el-dialog :title="title" :visible.sync="showvisible" width="700px" class="my-dialog-name" contentStyle="width:400px;" :before-close="close" v-if="ruleForm.apply!=null">
-        <el-form label-position="left"  class="demo-table-expand" label-width="80px">
-          <el-form-item label="应用名称 :">
-            <span>{{ruleForm.apply.name}}</span>
-          </el-form-item>
-          <el-form-item label="应用描述 :">
-            <span>{{ruleForm.apply.describe}}</span>
-          </el-form-item>
-           <el-form-item label="创建人 :">
-            <span>{{ruleForm.apply.createUserName}}</span>
-          </el-form-item>
-          <el-form-item label="租户列表" class="list">
-         
-          </el-form-item>
-         
-        </el-form>
-          <el-table :data="ruleForm.tenantVOList" header-row-class-name="custom-table-header"  max-height="250" border>
-            <!-- <el-table-column type="index" label="#" width="55" align="center"></el-table-column> -->
-            <el-table-column prop="name" label="租户名称" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="contacts" label="联系人" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="address" label="联系人地址" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="type" label="类型" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column label="是否启用" align="center" show-overflow-tooltip>
-              <template slot-scope="scope">
-              <span v-if="scope.row.state==0">否</span>
-              <span v-if="scope.row.state==1">是</span>
-            </template>
-            </el-table-column>
-          </el-table>
-
-    </el-dialog>
+  <div class="height_100">
+    <apply></apply>
   </div>
 </template>
 
 <script>
-import Treeselect from '@riophae/vue-treeselect'
-import '@riophae/vue-treeselect/dist/vue-treeselect.css'
-import FunctionList from '../function/index.vue'
+import apply from './components/apply.vue';
 export default {
   components: {
-    Treeselect,
-    FunctionList
+    apply
   },
+  props: {},
   data() {
     return {
-     getRowKeys(row){
-				return row.id
-			},
-      visible: false,
-      showvisible:false,
-      loading: false,
-      btnLoading: false,
-      total: 0,
-      tableData: [],
-      title: '',
-      expands:[],
-      queryParams: {
-        size: 10,
-        current: 1,
-        name: ''
-      },
-      ruleForm: {},
-      rules: {
-        name: [{ required: true, message: '请输入应用名称', trigger: 'blur' },],
-        describe: [{ required: true, message: '请输入描述', trigger: 'blur' },],
-      },
-    }
-  },
-    computed: {
-    userinfo() {
-      return this.$store.state.admin.userinfo
-    }
+    };
   },
-  mounted() {
-    this.getList()
-
-  },
-  methods: {
-    expandChange(row,expandedRows) {
-			let that=this
-			console.log(expandedRows);
-			if (expandedRows.length) {
-              that.expands = []
-              if (row) {
-                that.expands.push(row.id)
-              }
-            } else {
-              that.expands = []
-            }
-    },
-   
-    normalizer(node) {
-      return {
-        id: node.id,
-        label: node.name,
-      }
-    },
-    handleAdd(parentId) {
-      this.title = '新增应用'
-      this.visible = true
-      this.ruleForm = {
-        // sort: 0,
-        // parentId: parentId
-      }
-    },
-    handleEdit(row) {
-      this.title = '编辑应用'
-      this.visible = true
-      this.ruleForm = { ...row }
-    },
-    handleDetails(row){
-      this.title = '应用详情'
-      this.showvisible = true
-      this.$api.getAllTenantByApplicationId({id:row.id}).then(response=>{
-         console.log(response)
-         
-         this.ruleForm = response.data
-         this.ruleForm.apply={...row}
-      })
-     
-    },
-     handleCurrentChange(val) {
-      this.queryParams.current = val;
-      this.getList();
-    },
-    close() {
-      this.visible = false
-      this.showvisible = false
-    },
-    getList() {
-      this.loading = true
-      this.$api.queryApplication(this.queryParams).then(response => {
-       
-        this.tableData = response.data
-        this.total = response.pageColumn.total
-        this.loading = false
-      }).catch(error => {
-        this.loading = false
-      })
-    },
-    submit() {
-      this.$refs.ruleForm.validate((valid) => {
-        if (valid) {
-          this.btnLoading = true
-          if (this.ruleForm.id) {
-            this.$api.editApply(this.ruleForm).then(response => {
-              this.$message.success('编辑成功')
-              this.btnLoading = false
-              this.getList()
-              this.close()
-            }).catch(error => {
-              this.btnLoading = false
-            })
-          } else {
-            this.ruleForm.tenant=this.userinfo.tenantId
-            this.$api.addApply(this.ruleForm).then(response => {
-              console.log(2,response)
-              this.$message.success('新增成功')
-              this.btnLoading = false
-              this.getList()
-              this.close()
-            }).catch(error => {
-              this.btnLoading = false
-            })
-          }
-        } else {
-          console.log('error submit!!');
-          return false;
-        }
-      });
-    },
-    handleDelete(row) {
-      this.$confirm('确认删除本条数据吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        this.loading = true
-        this.$api.deleteApply({ id: row.id }).then(response => {
-          this.$message.success('删除成功')
-          this.loading = false
-          this.getList()
-        }).catch(error => {
-          this.loading = false
-        })
-      })
-    }
-  }
-}
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {},
+};
 </script>
-<style lang="scss">
-.my-dialog-name{
-  .el-dialog__body{
-  padding-top:0
-}
-}
-.list .el-form-item__label{
-    font-weight: 900;
-}
-</style>
 <style lang="scss" scoped>
-.admin-apply {
-
-}
-.details:hover{
-  border-bottom: 1px solid black;
-  cursor: pointer;
-}
- .demo-table-expand {
-    font-size: 0;
-  }
-  .demo-table-expand label {
-    width: 90px;
-    color: #99a9bf;
-  }
-  .demo-table-expand .el-form-item {
-    margin-right: 0;
-    margin-bottom: 0;
-    width: 50%;
-  }
 </style>

+ 286 - 0
src/views/backStageManage/application/function/index copy.vue

@@ -0,0 +1,286 @@
+<template>
+  <div class="admin-apply">
+    <el-form :inline="true">
+      <el-form-item>
+        <el-input v-model="queryParams.name" size="small" placeholder="请输入"></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="" size="small" @click="getList">查询</el-button>
+        <el-button type="primary" size="small" @click="handleAdd(0)">新增</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table
+        :row-key="getRowKeys" 
+        v-loading="loading"
+        :data="tableData"
+        header-row-class-name="custom-table-header"
+
+        :expand-row-keys="expands"
+        @expand-change="expandChange"
+        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+    >
+     <el-table-column type="expand">
+      <template slot-scope="scope" style="width:80%">
+        <function-list :applyId="scope.row.id"></function-list>
+      </template>
+    </el-table-column>
+      <el-table-column label="应用名称" align="" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <span class="details">{{scope.row.name}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="describe" label="应用描述" align="center" show-overflow-tooltip></el-table-column>
+      <el-table-column prop="createUserName" label="创建人" align="center" show-overflow-tooltip></el-table-column>
+      <el-table-column label="操作" align="center" width="150">
+        <template slot-scope="scope">
+          <el-dropdown split-button type="primary" size="small" @click="handleEdit(scope.row)">
+            编辑
+            <el-dropdown-menu slot="dropdown" class="text-align_center">
+             
+              <el-dropdown-item @click.native="handleDetails(scope.row)">详情</el-dropdown-item>
+              <el-dropdown-item class="color-red" @click.native="handleDelete(scope.row)" divided>删除</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="pagination">
+      <el-pagination :current-page.sync="queryParams.current" :page-size="queryParams.size" :total="total" @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
+    </div>
+    <el-dialog :title="title" :visible.sync="visible" width="500px" :before-close="close">
+      <el-form v-if="visible" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" label-position="left">
+      
+        <el-form-item label="应用名称" prop="name">
+          <el-input v-model="ruleForm.name" placeholder="请输入应用名称"></el-input>
+        </el-form-item>
+        
+        <el-form-item label="应用描述" prop="describe">
+          <el-input v-model="ruleForm.describe" placeholder="请输入" type="textarea" maxlength="100" show-word-limit></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="close">取 消</el-button>
+        <el-button type="primary" @click="submit" :loading="btnLoading">确 定</el-button>
+      </div>
+    </el-dialog>
+       <el-dialog :title="title" :visible.sync="showvisible" width="700px" class="my-dialog-name" contentStyle="width:400px;" :before-close="close" v-if="ruleForm.apply!=null">
+        <el-form label-position="left"  class="demo-table-expand" label-width="80px">
+          <el-form-item label="应用名称 :">
+            <span>{{ruleForm.apply.name}}</span>
+          </el-form-item>
+          <el-form-item label="应用描述 :">
+            <span>{{ruleForm.apply.describe}}</span>
+          </el-form-item>
+           <el-form-item label="创建人 :">
+            <span>{{ruleForm.apply.createUserName}}</span>
+          </el-form-item>
+          <el-form-item label="租户列表" class="list">
+         
+          </el-form-item>
+         
+        </el-form>
+          <el-table :data="ruleForm.tenantVOList" header-row-class-name="custom-table-header"  max-height="250" border>
+            <!-- <el-table-column type="index" label="#" width="55" align="center"></el-table-column> -->
+            <el-table-column prop="name" label="租户名称" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="contacts" label="联系人" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="address" label="联系人地址" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="type" label="类型" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column label="是否启用" align="center" show-overflow-tooltip>
+              <template slot-scope="scope">
+              <span v-if="scope.row.state==0">否</span>
+              <span v-if="scope.row.state==1">是</span>
+            </template>
+            </el-table-column>
+          </el-table>
+
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import FunctionList from '../function/index.vue'
+export default {
+  components: {
+    Treeselect,
+    FunctionList
+  },
+  data() {
+    return {
+     getRowKeys(row){
+				return row.id
+			},
+      visible: false,
+      showvisible:false,
+      loading: false,
+      btnLoading: false,
+      total: 0,
+      tableData: [],
+      title: '',
+      expands:[],
+      queryParams: {
+        size: 10,
+        current: 1,
+        name: ''
+      },
+      ruleForm: {},
+      rules: {
+        name: [{ required: true, message: '请输入应用名称', trigger: 'blur' },],
+        describe: [{ required: true, message: '请输入描述', trigger: 'blur' },],
+      },
+    }
+  },
+    computed: {
+    userinfo() {
+      return this.$store.state.admin.userinfo
+    }
+  },
+  mounted() {
+    this.getList()
+
+  },
+  methods: {
+    expandChange(row,expandedRows) {
+			let that=this
+			console.log(expandedRows);
+			if (expandedRows.length) {
+              that.expands = []
+              if (row) {
+                that.expands.push(row.id)
+              }
+            } else {
+              that.expands = []
+            }
+    },
+   
+    normalizer(node) {
+      return {
+        id: node.id,
+        label: node.name,
+      }
+    },
+    handleAdd(parentId) {
+      this.title = '新增应用'
+      this.visible = true
+      this.ruleForm = {
+        // sort: 0,
+        // parentId: parentId
+      }
+    },
+    handleEdit(row) {
+      this.title = '编辑应用'
+      this.visible = true
+      this.ruleForm = { ...row }
+    },
+    handleDetails(row){
+      this.title = '应用详情'
+      this.showvisible = true
+      this.$api.getAllTenantByApplicationId({id:row.id}).then(response=>{
+         console.log(response)
+         
+         this.ruleForm = response.data
+         this.ruleForm.apply={...row}
+      })
+     
+    },
+     handleCurrentChange(val) {
+      this.queryParams.current = val;
+      this.getList();
+    },
+    close() {
+      this.visible = false
+      this.showvisible = false
+    },
+    getList() {
+      this.loading = true
+      this.$api.getApplyList(this.queryParams).then(response => {
+       
+        this.tableData = response.data
+        this.total = response.pageColumn.total
+        this.loading = false
+      }).catch(error => {
+        this.loading = false
+      })
+    },
+    submit() {
+      this.$refs.ruleForm.validate((valid) => {
+        if (valid) {
+          this.btnLoading = true
+          if (this.ruleForm.id) {
+            this.$api.editApply(this.ruleForm).then(response => {
+              this.$message.success('编辑成功')
+              this.btnLoading = false
+              this.getList()
+              this.close()
+            }).catch(error => {
+              this.btnLoading = false
+            })
+          } else {
+            this.ruleForm.tenant=this.userinfo.tenantId
+            this.$api.addApply(this.ruleForm).then(response => {
+              console.log(2,response)
+              this.$message.success('新增成功')
+              this.btnLoading = false
+              this.getList()
+              this.close()
+            }).catch(error => {
+              this.btnLoading = false
+            })
+          }
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    handleDelete(row) {
+      this.$confirm('确认删除本条数据吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loading = true
+        this.$api.deleteApply({ id: row.id }).then(response => {
+          this.$message.success('删除成功')
+          this.loading = false
+          this.getList()
+        }).catch(error => {
+          this.loading = false
+        })
+      })
+    }
+  }
+}
+</script>
+<style lang="scss">
+.my-dialog-name{
+  .el-dialog__body{
+  padding-top:0
+}
+}
+.list .el-form-item__label{
+    font-weight: 900;
+}
+</style>
+<style lang="scss" scoped>
+.admin-apply {
+
+}
+.details:hover{
+  border-bottom: 1px solid black;
+  cursor: pointer;
+}
+ .demo-table-expand {
+    font-size: 0;
+  }
+  .demo-table-expand label {
+    width: 90px;
+    color: #99a9bf;
+  }
+  .demo-table-expand .el-form-item {
+    margin-right: 0;
+    margin-bottom: 0;
+    width: 50%;
+  }
+</style>

+ 10 - 275
src/views/backStageManage/application/function/index.vue

@@ -1,286 +1,21 @@
 <template>
-  <div class="admin-apply">
-    <el-form :inline="true">
-      <el-form-item>
-        <el-input v-model="queryParams.name" size="small" placeholder="请输入"></el-input>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="" size="small" @click="getList">查询</el-button>
-        <el-button type="primary" size="small" @click="handleAdd(0)">新增</el-button>
-      </el-form-item>
-    </el-form>
-    <el-table
-        :row-key="getRowKeys" 
-        v-loading="loading"
-        :data="tableData"
-        header-row-class-name="custom-table-header"
-
-        :expand-row-keys="expands"
-        @expand-change="expandChange"
-        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
-    >
-     <el-table-column type="expand">
-      <template slot-scope="scope" style="width:80%">
-        <function-list :applyId="scope.row.id"></function-list>
-      </template>
-    </el-table-column>
-      <el-table-column label="应用名称" align="" show-overflow-tooltip>
-        <template slot-scope="scope">
-          <span class="details">{{scope.row.name}}</span>
-        </template>
-      </el-table-column>
-      <el-table-column prop="describe" label="应用描述" align="center" show-overflow-tooltip></el-table-column>
-      <el-table-column prop="createUserName" label="创建人" align="center" show-overflow-tooltip></el-table-column>
-      <el-table-column label="操作" align="center" width="150">
-        <template slot-scope="scope">
-          <el-dropdown split-button type="primary" size="small" @click="handleEdit(scope.row)">
-            编辑
-            <el-dropdown-menu slot="dropdown" class="text-align_center">
-             
-              <el-dropdown-item @click.native="handleDetails(scope.row)">详情</el-dropdown-item>
-              <el-dropdown-item class="color-red" @click.native="handleDelete(scope.row)" divided>删除</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-        </template>
-      </el-table-column>
-    </el-table>
-    <div class="pagination">
-      <el-pagination :current-page.sync="queryParams.current" :page-size="queryParams.size" :total="total" @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
-    </div>
-    <el-dialog :title="title" :visible.sync="visible" width="500px" :before-close="close">
-      <el-form v-if="visible" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" label-position="left">
-      
-        <el-form-item label="应用名称" prop="name">
-          <el-input v-model="ruleForm.name" placeholder="请输入应用名称"></el-input>
-        </el-form-item>
-        
-        <el-form-item label="应用描述" prop="describe">
-          <el-input v-model="ruleForm.describe" placeholder="请输入" type="textarea" maxlength="100" show-word-limit></el-input>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="close">取 消</el-button>
-        <el-button type="primary" @click="submit" :loading="btnLoading">确 定</el-button>
-      </div>
-    </el-dialog>
-       <el-dialog :title="title" :visible.sync="showvisible" width="700px" class="my-dialog-name" contentStyle="width:400px;" :before-close="close" v-if="ruleForm.apply!=null">
-        <el-form label-position="left"  class="demo-table-expand" label-width="80px">
-          <el-form-item label="应用名称 :">
-            <span>{{ruleForm.apply.name}}</span>
-          </el-form-item>
-          <el-form-item label="应用描述 :">
-            <span>{{ruleForm.apply.describe}}</span>
-          </el-form-item>
-           <el-form-item label="创建人 :">
-            <span>{{ruleForm.apply.createUserName}}</span>
-          </el-form-item>
-          <el-form-item label="租户列表" class="list">
-         
-          </el-form-item>
-         
-        </el-form>
-          <el-table :data="ruleForm.tenantVOList" header-row-class-name="custom-table-header"  max-height="250" border>
-            <!-- <el-table-column type="index" label="#" width="55" align="center"></el-table-column> -->
-            <el-table-column prop="name" label="租户名称" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="contacts" label="联系人" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="address" label="联系人地址" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="type" label="类型" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column label="是否启用" align="center" show-overflow-tooltip>
-              <template slot-scope="scope">
-              <span v-if="scope.row.state==0">否</span>
-              <span v-if="scope.row.state==1">是</span>
-            </template>
-            </el-table-column>
-          </el-table>
-
-    </el-dialog>
-  </div>
+  <div></div>
 </template>
 
 <script>
-import Treeselect from '@riophae/vue-treeselect'
-import '@riophae/vue-treeselect/dist/vue-treeselect.css'
-import FunctionList from '../function/index.vue'
 export default {
-  components: {
-    Treeselect,
-    FunctionList
-  },
+  components: {},
+  props: {},
   data() {
     return {
-     getRowKeys(row){
-				return row.id
-			},
-      visible: false,
-      showvisible:false,
-      loading: false,
-      btnLoading: false,
-      total: 0,
-      tableData: [],
-      title: '',
-      expands:[],
-      queryParams: {
-        size: 10,
-        current: 1,
-        name: ''
-      },
-      ruleForm: {},
-      rules: {
-        name: [{ required: true, message: '请输入应用名称', trigger: 'blur' },],
-        describe: [{ required: true, message: '请输入描述', trigger: 'blur' },],
-      },
-    }
-  },
-    computed: {
-    userinfo() {
-      return this.$store.state.admin.userinfo
-    }
+    };
   },
-  mounted() {
-    this.getList()
-
-  },
-  methods: {
-    expandChange(row,expandedRows) {
-			let that=this
-			console.log(expandedRows);
-			if (expandedRows.length) {
-              that.expands = []
-              if (row) {
-                that.expands.push(row.id)
-              }
-            } else {
-              that.expands = []
-            }
-    },
-   
-    normalizer(node) {
-      return {
-        id: node.id,
-        label: node.name,
-      }
-    },
-    handleAdd(parentId) {
-      this.title = '新增应用'
-      this.visible = true
-      this.ruleForm = {
-        // sort: 0,
-        // parentId: parentId
-      }
-    },
-    handleEdit(row) {
-      this.title = '编辑应用'
-      this.visible = true
-      this.ruleForm = { ...row }
-    },
-    handleDetails(row){
-      this.title = '应用详情'
-      this.showvisible = true
-      this.$api.getAllTenantByApplicationId({id:row.id}).then(response=>{
-         console.log(response)
-         
-         this.ruleForm = response.data
-         this.ruleForm.apply={...row}
-      })
-     
-    },
-     handleCurrentChange(val) {
-      this.queryParams.current = val;
-      this.getList();
-    },
-    close() {
-      this.visible = false
-      this.showvisible = false
-    },
-    getList() {
-      this.loading = true
-      this.$api.getApplyList(this.queryParams).then(response => {
-       
-        this.tableData = response.data
-        this.total = response.pageColumn.total
-        this.loading = false
-      }).catch(error => {
-        this.loading = false
-      })
-    },
-    submit() {
-      this.$refs.ruleForm.validate((valid) => {
-        if (valid) {
-          this.btnLoading = true
-          if (this.ruleForm.id) {
-            this.$api.editApply(this.ruleForm).then(response => {
-              this.$message.success('编辑成功')
-              this.btnLoading = false
-              this.getList()
-              this.close()
-            }).catch(error => {
-              this.btnLoading = false
-            })
-          } else {
-            this.ruleForm.tenant=this.userinfo.tenantId
-            this.$api.addApply(this.ruleForm).then(response => {
-              console.log(2,response)
-              this.$message.success('新增成功')
-              this.btnLoading = false
-              this.getList()
-              this.close()
-            }).catch(error => {
-              this.btnLoading = false
-            })
-          }
-        } else {
-          console.log('error submit!!');
-          return false;
-        }
-      });
-    },
-    handleDelete(row) {
-      this.$confirm('确认删除本条数据吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        this.loading = true
-        this.$api.deleteApply({ id: row.id }).then(response => {
-          this.$message.success('删除成功')
-          this.loading = false
-          this.getList()
-        }).catch(error => {
-          this.loading = false
-        })
-      })
-    }
-  }
-}
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {},
+};
 </script>
-<style lang="scss">
-.my-dialog-name{
-  .el-dialog__body{
-  padding-top:0
-}
-}
-.list .el-form-item__label{
-    font-weight: 900;
-}
-</style>
 <style lang="scss" scoped>
-.admin-apply {
-
-}
-.details:hover{
-  border-bottom: 1px solid black;
-  cursor: pointer;
-}
- .demo-table-expand {
-    font-size: 0;
-  }
-  .demo-table-expand label {
-    width: 90px;
-    color: #99a9bf;
-  }
-  .demo-table-expand .el-form-item {
-    margin-right: 0;
-    margin-bottom: 0;
-    width: 50%;
-  }
 </style>

+ 0 - 89
src/views/backStageManage/application/vip/components/addVipForm.vue

@@ -1,89 +0,0 @@
-<template>
-    <div>
-        <el-form ref="form" :model="form" :rules="rules" label-width="auto">
-            
-            <el-form-item label="会员类型名称" prop="vipName">
-                <el-input v-model="form.tenantVipName" placeholder="请输入会员类型名称" maxlength="20" />
-            </el-form-item>
-                
-            <el-form-item label="备注" prop="remark">
-                <el-input v-model="form.remark" placeholder="请输入备注" maxlength="50" />
-            </el-form-item>
-    
-            <el-form-item label="持续时长/月" prop="lastTime">
-                <el-input v-model="form.lastTime" placeholder="请输入持续时长" maxlength="50" />
-            </el-form-item>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-            <div class="button-container">
-                <el-button type="primary" @click="submitForm">提 交</el-button>
-                <el-button @click="cancel">重 置</el-button>
-            </div>
-        </div>
-    </div>
-</template>
-
-<script>
-export default {
-components: {},
-props: {},
-data() {
-    return {
-        // 表单参数
-        form: {},
-        // 表单校验
-        rules: {
-            tenantVipName: [
-                { required: true, message: "会员类型名称不能为空", trigger: "blur" }
-            ],
-            lastTime: [
-                { required: true, message: "持续时长不能为空", trigger: "blur" }
-            ]
-        }
-    };
-},
-watch: {},
-computed: {},
-created() {},
-mounted() {},
-methods: {
-     /** 提交按钮 */
-     submitForm: function() {
-        this.$refs.form.validate((valid) => {
-            if (valid) {
-                this.$api.addVip(this.form)
-                    .then(response => {
-                        if (response.code === 200) {
-                            this.$message.success('提交成功');
-                            this.resetForm();
-                        } else {
-                            this.$message.error('提交失败');
-                        }
-                    })
-                    .catch(error => {
-                        this.$message.error('提交失败');
-                        console.error(error);
-                    });
-            }
-        });
-    },
-    
-},
-};
-</script>
-<style lang="scss" scoped>
-.el-form {
-  display: flex;
-  align-items: center;
-  flex-direction: column;
-}
-.dialog-footer {
-    display: flex;
-    justify-content: center;
-}
-
-.button-container {
-    display: flex;
-    justify-content: center;
-}
-</style>

+ 0 - 102
src/views/backStageManage/application/vip/components/editVipForm.vue

@@ -1,102 +0,0 @@
-<template>
-    <div>
-        <el-form ref="form" :model="form" :rules="rules" label-width="auto">
-            <el-form-item label="会员类型名称" prop="tenantVipName">
-                <el-input v-model="form.tenantVipName" placeholder="请输入会员类型名称" maxlength="20" />
-            </el-form-item>       
-            <el-form-item label="持续时长" prop="lastTime">
-                <el-input v-model="form.lastTime" placeholder="请输入持续时长" maxlength="11" />
-            </el-form-item>
-            <el-form-item label="备注" prop="remark">
-                <el-input v-model="form.remark" placeholder="请输入备注" maxlength="50" />
-            </el-form-item>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-            <div class="button-container">
-                <el-button type="primary" @click="submitForm">提 交</el-button>
-                <el-button @click="cancel">重 置</el-button>
-            </div>
-        </div>
-    </div>
-</template>
-
-<script>
-export default {
-    components: {},
-    props: {},
-    data() {
-        return {
-            // 表单参数
-            form: {},
-            // 表单校验
-            rules: {
-                tenantVipName: [
-                    { required: true, message: "会员类型名称不能为空", trigger: "blur" }
-                ],
-                lastTime: [
-                    { required: true, message: "持续时长不能为空", trigger: "blur" }
-                ]
-            }
-        };
-    },
-    watch: {},
-    computed: {
-        vipId() {
-            return this.$route.query.id;
-        },
-    },
-    created() {},
-    mounted() {
-        this.getById()
-    },
-    methods: {
-        getById() {
-            var params = {
-                id: this.vipId,
-            };
-            this.$api.getVipById(params).then(response=>{
-                if(response.code == 200){
-                    this.form = response.data.records
-                }
-            }).catch(error=>{
-                this.form = []
-            })
-        },
-        /** 提交按钮 */
-        submitForm: function() {
-            this.$refs.form.validate((valid) => {
-                if (valid) {
-                    this.$api.updateVip(this.form)
-                        .then(response => {
-                            if (response.code === 200) {
-                                this.$message.success('提交成功');
-                                this.resetForm();
-                            } else {
-                                this.$message.error('提交失败');
-                            }
-                        })
-                        .catch(error => {
-                            this.$message.error('提交失败');
-                            console.error(error);
-                        });
-                }
-            });
-        },
-    },
-};
-</script>
-<style lang="scss" scoped>
-.el-form {
-  display: flex;
-  align-items: center;
-  flex-direction: column;
-}
-.dialog-footer {
-    display: flex;
-    justify-content: center;
-}
-.button-container {
-    display: flex;
-    justify-content: center;
-}
-</style>

+ 0 - 226
src/views/backStageManage/application/vip/index.vue

@@ -1,226 +0,0 @@
-<template>
-  <div class="container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
-      <el-form-item label="会员类型名称" prop="tenantVipName">
-        <el-input
-          v-model="queryParams.tenantVipName"
-          placeholder="请输入会员类型名称"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-    
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button type="primary" icon="el-icon-plus" size="small" @click="handleAdd">新增</el-button>
-      </el-col>
-    </el-row>
-
-    <el-table 
-        :data="tableData"
-        row-key="id"
-        style="width: 100%"
-        :maxHeight="tableHeight - 40"
-        v-loading="loading"
-        @selection-change="handleSelectionChange"
-        @sort-change="sortChange"
-    >
-        <el-table-column type="selection" width="55" :reserve-selection="true" v-if="!choose"></el-table-column>
-
-        <el-table-column  v-if="choose" align="center">
-          <template slot-scope="scope">
-              <div>
-                  <el-checkbox-group v-model="checkList1">
-                      <el-checkbox :label="scope.row.id">{{(scope.$index + 1) + ((queryParams.current - 1) * queryParams.size)}}</el-checkbox>
-                  </el-checkbox-group>
-              </div>
-          </template>
-        </el-table-column>
-
-        <el-table-column prop="tenantVipName" label="会员类型名称"></el-table-column>
-        <el-table-column prop="lastTime" label="持续时长"></el-table-column>
-        <el-table-column prop="createPersonName" label="创建人"></el-table-column>
-        <el-table-column prop="createTime" label="创建时间"></el-table-column>
-        <el-table-column prop="remark" label="备注"></el-table-column>
-
-        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-          <template slot-scope="scope">
-            <el-button
-              size="mini"
-              type="text"
-              icon="el-icon-edit"
-              @click="handleEdit(scope.row)"
-            >修改</el-button>
-            <el-button
-              v-if="scope.row.id != 0"
-              size="mini"
-              type="text"
-              icon="el-icon-delete"
-              @click="handleDelete(scope.row)"
-            >删除</el-button>
-          </template>
-        </el-table-column>
-    </el-table>
-    <div>
-      <el-pagination background layout="total, sizes, prev, pager, next, jumper"
-        :current-page.sync="queryParams.current" :page-size.sync="queryParams.size"
-        @current-change="handleCurrentChange" @size-change="changeSize" :total="total">
-      </el-pagination>
-    </div>
-  </div>
-</template>
-
-<script>
-
-export default {
-
-  components: {},
-  props: {},
-  data() {
-    return {
-      // 遮罩层
-      loading: false,
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 显示搜索条件
-      showSearch: true,
-      // 表单参数
-      form: {},
-      tableData: [],
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        tenantVipName: undefined
-      },
-      rules: {
-        tenantVipName: [
-          { required: true, message: "会员类型名称不能为空", trigger: "blur" }
-        ]
-      }
-    };
-  },
-  watch: {},
-  computed: {},
-  created() {},
-  mounted() {
-    this.getList()
-  },
-  methods: {
-    /** 查询vip列表 */
-    getList() {
-      this.loading = true;
-      this.$api.getVipList(this.queryParams).then(response=>{
-        if(response.code == 200){
-            this.tableData = response.data.records
-            this.total = response.data.total
-            this.loading = false
-        }
-      }).catch(error=>{
-          this.tableData = []
-          this.total = 0
-          this.loading = false
-      })
-    },
-    /** 新增按钮操作 */
-    handleAdd(row) {
-      this.$router.push('/administrator/addVip');
-    },
-    /** 提交按钮 */
-    submitForm: function() {
-      this.open = false;
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-    },
-    handleEdit(row) {
-      this.$router.push({ 
-        path: '/administrator/editVip', 
-        query: {
-            id: row.id
-        }
-      });
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.handleQuery();
-    },
-    handleDelete(row) {
-      this.removeVip([row.id]);
-    },
-    removeVip(ids,type){
-          this.$confirm('确认删除本条数据吗?', '提示', {
-              confirmButtonText: '确定',
-              cancelButtonText: '取消',
-              type: 'warning'
-          }).then(() => {
-            var params = {
-                ids:ids,
-            }
-              this.$api.deleteVip(params).then(response=>{
-                  if(response.code == 200){
-                      this.$message.success('删除成功')
-                      this.getList()
-                      if(type){
-                          this.multipleSelection = []
-                          this.$refs.table.clearSelection();
-                      }else{
-                          var id = response.data.data[0]
-                          var index = this.multipleSelection.findIndex(item=>{
-                              return item.id == id
-                          })
-                          if(index!=-1){
-                              this.multipleSelection.splice(index,1)
-                          }
-                      }
-                      
-                  }
-              }).catch(error=>{
-                  this.$message.error('删除失败')
-              })
-          })
-      },
-  },
-};
-</script>
-<style lang="scss" scoped>
-.container{
-  width: 100%;
-}
-.padding_20{
-  padding: 20px
-}
-::v-deep .el-table,
-.el-table__expanded-cell {
-  background-color: transparent;
-}
-
-::v-deep .el-table tr {
-  background-color: transparent !important;
-}
-::v-deep .el-table__body td,::v-deep .el-table__header th,
-.el-table .cell {
-  background-color: transparent;
-}
-::v-deep .el-table::before {
-  //去除底部白线
-  left: 0;
-  bottom: 0;
-  width: 100%;
-  height: 0px;
-}
-
-</style>

+ 25 - 0
src/views/backStageManage/application/vipType/addVipType.vue

@@ -0,0 +1,25 @@
+<template>
+    <div>
+        <vipTypeForm model="add"></vipTypeForm>
+    </div>
+</template>
+
+<script>
+import vipTypeForm from './components/form/vipType.vue';
+export default {
+    components: {
+        vipTypeForm
+    },
+    props: {},
+    data() {
+        return {};
+    },
+    watch: {},
+    computed: {},
+    created() {},
+    mounted() {},
+    methods: {},
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 229 - 0
src/views/backStageManage/application/vipType/components/form/vipType.vue

@@ -0,0 +1,229 @@
+<template>
+    <div>
+        <div class="button-container" v-if="model != 'detail'">
+                <el-button type="primary" size="small" :loading="btnLoading" @click="submitForm">提 交</el-button>
+                <el-button size="small"  @click="init">重 置</el-button>
+        </div>
+        <div class="form_center" >
+            <el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="120px" :class="model == 'detail'?'pointer_events_none':''">
+                <el-form-item label="会员类型名称:" prop="vipTypeName" >
+                    <el-input v-model="form.vipTypeName" placeholder="请输入会员类型名称" maxlength="20" />
+                </el-form-item>
+                <el-form-item label="持续时长:" prop="lastTime">
+                    <el-input v-model="form.lastTime" placeholder="请输入持续时长" >
+                        <template slot="append">月</template>
+                    </el-input>
+                </el-form-item>
+                <el-form-item label="是否启用:" prop="enable">
+                    <el-radio-group v-model="form.enable">
+                        <el-radio :label="true">是</el-radio>
+                        <el-radio :label="false">否</el-radio>
+                    </el-radio-group>
+                </el-form-item>
+                <el-form-item label="备注:" prop="remark">
+                    <el-input v-model="form.remark" placeholder="请输入备注" maxlength="50" />
+                </el-form-item>
+            </el-form>
+            <div style="border:1px solid white;padding:10px;margin:10px 0;border-radius:8px;">
+                <div style="height: 500px;" >
+                    <p>
+                        {{model=='detail'?'功能清单':'选择功能'}}
+                    </p>
+                    <funTable ref="functionTable" :tableData="tableData" :loading="loading" :reload="reload" :canChoose="model=='detail'?false:true" :defaultChecked="true"></funTable>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+import funTable from '@/views/backStageManage/application/vision/components/functionTable.vue';
+const currentForm = {
+    id:null,
+    vipName:null,
+    lastTime:1,
+    applicationCode:'4e95e3d926a2a4befa5d913acc0aa9f5',
+    applyId:14,
+    remark:null,
+    enable:true,
+    functionIds:[]
+}
+export default {
+    components: {
+        funTable
+    },
+    mixins:[],
+    props: {
+        id:"",
+        model:{
+            type:String,
+            default:"add"
+        },
+    },
+    data() {
+        return {
+            btnLoading: false,
+            // 表单参数
+            form: {},
+            // 表单校验
+            rules: {
+                vipTypeName: [
+                    { required: true, message: "会员类型不能为空", trigger: "blur" }
+                ],
+                lastTime: [
+                    { required: true, message: "持续时长不能为空", trigger: "blur" }
+                ]
+            },
+            tableData:{},
+            loading:false,
+            reload:true,
+            
+        };
+    },
+    watch: {
+        id(){
+            if(this.$route.path != '/administrator/editVipType'){
+                return
+            }
+            this.init()
+        },
+    },
+    computed: {},
+    created() {},
+    mounted() {
+       this.init()
+    },
+    methods: {
+        //初始化当前页面
+        async init(){
+            if(this.model == 'add'){
+                this.resetForm()
+            }else if(this.model == 'edit' || this.model == 'detail'){
+                if( this.model == 'detail'){
+                    this.reload = false
+                }
+                this.getById()
+            }
+            this.reload = false
+            this.$nextTick(()=>{
+                this.reload = true
+            })
+            await this.getList()
+        },
+        //查询数据并校验
+        getById(){
+            if(!this.id){
+                this.$message.error('编辑缺少参数')
+                return
+            }
+            var params = {
+                ids: [this.id],
+            };
+            this.$api.getVipList(params).then(response=>{
+                if(response.code == 200){
+                    var data = response.data.records
+                    if(data && data.length>0){
+                        this.form = data[0]
+                    }
+                }
+            }).catch(error=>{
+                this.resetForm()
+            })
+        },
+        //重置表单
+        resetForm(){
+            this.form = Object.assign({}, currentForm)
+            this.$refs['form'].resetFields();
+        },
+        //获取所有的功能及代码
+        getAllFunId(data,funId){
+            for(var i = 0;i<data.length;i++){
+                if(data[i].isSelect != 2){
+                    funId.push(data[i].id)
+                }
+                if(data[i].children && data[i].children.length){
+                    this.getAllFunId(data[i].children,funId)
+                }
+            }
+        },
+        /** 提交按钮 */
+        submitForm: function() {
+            this.$refs['form'].validate((valid) => {
+                if (valid) {
+                    var functionIds = []
+                    this.getAllFunId(this.tableData.children,functionIds)
+                    this.form.functionIds = functionIds
+                    this.btnLoading = true
+                    var a = '添加'
+                    var api = 'addVipType'
+                    if(this.model == "edit"){
+                        a = '编辑'
+                        api = 'updateVipType'
+                    }
+                    this.$api[api](this.form).then(response => {
+                        if (response.code === 200) {
+                            this.btnLoading = false
+                            this.$message.success( a + '成功');
+                            this.finish()
+                        }
+                    })
+                    .catch(error => {
+                        this.$message.error(a + '失败')
+                        this.btnLoading = false
+                    });
+                }
+            });
+        },
+        finish(){
+            if(this.model == 'add'){
+                this.resetForm();
+                this.init()
+            }else{
+                this.$store.commit('removeHistoryPath',this.$route.path);
+                this.$store.commit('removeHistory',this.$route.path);
+                this.$router.push(
+                    {
+                        path:'/administrator/vipType'
+                    }
+                )
+            }
+        },
+        //查询功能列表
+        async getList() {
+            var params = {}
+            var api = 'queryQiaoBiFunction'
+            if(this.model == 'detail'){
+                api = 'getVipTypeFunction'
+            }
+            if(this.model != 'add'){
+                params.vipTypeId = this.id
+            }
+            this.loading = true
+            await this.$api[api](params).then(response => {
+                this.tableData = {
+                    applyId:this.form.applyId,
+                    children:response.data
+                }
+                this.loading = false
+            }).catch(error => {
+                this.loading = true
+            })
+        },
+    },
+};
+</script>
+<style lang="scss">
+.form_center {
+    width: 800px;
+    margin: 30px auto;
+}
+
+.button-container {
+    max-width: 1200px;
+    display: flex;
+    justify-content:flex-end;
+    margin: 10px auto;
+    position:sticky;
+    top:10px,
+}
+</style>

+ 29 - 0
src/views/backStageManage/application/vipType/editVipType.vue

@@ -0,0 +1,29 @@
+<template>
+    <div>
+        <vipTypeForm model="edit" :id="id"></vipTypeForm>
+    </div>
+</template>
+
+<script>
+import vipTypeForm from './components/form/vipType.vue';
+export default {
+    components: {
+        vipTypeForm
+    },
+    props: {},
+    data() {
+        return {};
+    },
+    watch: {},
+    computed: {
+        id(){
+            return this.$route.query.id
+        }
+    },
+    created() {},
+    mounted() {},
+    methods: {},
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 26 - 0
src/views/backStageManage/application/vipType/index.vue

@@ -0,0 +1,26 @@
+<template>
+  <div class="height_100">
+    <vipType></vipType>
+  </div>
+</template>
+
+<script>
+import vipType from './vipType.vue';
+export default {
+  components: {
+    vipType
+  },
+  props: {},
+  data() {
+    return {
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {},
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 223 - 0
src/views/backStageManage/application/vipType/vipType.vue

@@ -0,0 +1,223 @@
+<template>
+  <div class="height_100">
+    <el-container>
+      <el-header>
+        <div class="header">
+          <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
+            <el-form-item label="会员类型名称" prop="tenantVipName">
+              <el-input
+                v-model="queryParams.vipTypeName"
+                placeholder="请输入会员类型名称"
+                clearable
+              />
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" icon="el-icon-search" size="mini" @click="search">搜索</el-button>
+              <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            </el-form-item>
+          </el-form>
+          
+          <el-row :gutter="10">
+            <el-col :span="1.5">
+              <el-button icon="el-icon-plus" size="small" @click="handleAdd">新增</el-button>
+            </el-col>
+          </el-row>
+        </div>
+      </el-header>
+      <el-main class="padding_10">
+        <el-table 
+          :data="tableData"
+          border
+          row-key="id"
+          style="width: 100%"
+          max-height="calc(100% - 40px)"
+          v-loading="loading"
+      >
+          <el-table-column type="index" label="序号" align="center" width="120px">
+            <template slot-scope="scope">
+                <div>
+                    <!-- <el-checkbox-group v-model="checkList">
+                        <el-checkbox :label="scope.row.id">{{(scope.$index + 1) + ((queryParams.current - 1) * queryParams.size)}}</el-checkbox>
+                    </el-checkbox-group> -->
+                    {{(scope.$index + 1) + ((queryParams.current - 1) * queryParams.size)}}
+                </div>
+            </template>
+          </el-table-column>
+          <el-table-column prop="vipTypeName" label="会员类型名称">
+            <template slot-scope="scope">
+                <div>
+                  <el-link type="primary" @click="handleDetail(scope.row)">{{ scope.row.vipTypeName }}</el-link>
+                </div>
+              </template>
+          </el-table-column>
+          <el-table-column prop="lastTime" label="持续时长">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.lastTime }}月
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column prop="enable" label="是否启用">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.enable?'是':"否" }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column prop="createName" label="创建人"></el-table-column>
+          <el-table-column prop="createTime" label="创建时间"></el-table-column>
+          <el-table-column prop="remark" label="备注"></el-table-column>
+          <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-edit"
+                @click="handleEdit(scope.row)"
+              >修改</el-button>
+              <el-button
+                v-if="scope.row.id != 0"
+                size="mini"
+                type="text"
+                icon="el-icon-delete"
+                @click="handleDelete(scope.row)"
+              >删除</el-button>
+            </template>
+          </el-table-column>
+      </el-table>
+      </el-main>
+      <el-footer class="pagination">
+        <el-pagination background layout="total, sizes, prev, pager, next, jumper"
+          :current-page.sync="queryParams.current" :page-size.sync="queryParams.size"
+          @current-change="handleCurrentChange" @size-change="changeSize" :total="total">
+        </el-pagination>
+      </el-footer>
+    </el-container>
+  </div>
+</template>
+
+<script>
+const searchForm = {
+  vipTypeName:null
+}
+export default {
+  components: {},
+  props: {},
+  data() {
+    return {
+      // 遮罩层
+      loading: false,
+      tableData: [],
+      // 查询参数
+      queryParams: {
+        current: 1,
+        size: 10,
+        ...searchForm
+      },
+      total:0,
+      checkList:[],
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    /** 查询vip类型列表 */
+    getList() {
+      this.loading = true;
+      this.$api.getVipList(this.queryParams).then(response=>{
+        if(response.code == 200){
+            this.tableData = response.data.records
+            this.total = response.data.total || 0
+            this.loading = false
+        }
+      }).catch(error=>{
+          this.tableData = []
+          this.total = 0
+          this.loading = false
+      })
+    },
+    //切换分页
+    handleCurrentChange(value){
+      this.queryParams.current = value
+      this.getList()
+    },
+    //切换页大小
+    changeSize(value){
+      this.queryParams.size = value
+      this.queryParams.current = 1
+      this.getList()
+    },
+    /** 新增按钮操作 */
+    handleAdd(row) {
+      this.$router.push('/administrator/addVipType');
+    },
+    handleEdit(row) {
+      this.$router.push({ 
+        path: '/administrator/editVipType', 
+        query: {
+            id: row.id
+        }
+      });
+    },
+    handleDetail(row) {
+      this.$router.push({ 
+        path: '/administrator/editVipType', 
+        query: {
+            id: row.id
+        }
+      });
+    },
+    /** 搜索按钮操作 */
+    search() {
+      this.queryParams.current = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      for(let key in searchForm){
+        this.$set(this.queryParams,key,'')
+      }
+      this.search();
+    },
+    handleDelete(row) {
+      this.removeVip([row.id]);
+    },
+    removeVip(ids,type){
+      this.$confirm('确认删除选择数据吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+      }).then(() => {
+        var params = {
+            ids:ids,
+        }
+        this.$api.deleteVip(params).then(response=>{
+            if(response.code == 200){
+                this.$message.success('删除成功')
+                this.getList()
+            }
+        }).catch(error=>{
+            this.$message.error('删除失败')
+        })
+      })
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.header{
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.foot{
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+}
+</style>

+ 29 - 0
src/views/backStageManage/application/vipType/vipTypeDetail.vue

@@ -0,0 +1,29 @@
+<template>
+    <div>
+        <vipTypeForm model="detail" :id="id"></vipTypeForm>
+    </div>
+</template>
+
+<script>
+import vipTypeForm from './components/form/vipType.vue';
+export default {
+    components: {
+        vipTypeForm
+    },
+    props: {},
+    data() {
+        return {};
+    },
+    watch: {},
+    computed: {
+        id(){
+            return this.$route.query.id
+        }
+    },
+    created() {},
+    mounted() {},
+    methods: {},
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 13 - 60
src/views/backStageManage/application/vision/addVersion.vue

@@ -1,72 +1,25 @@
 <template>
     <div>
-        <version-form></version-form>
+        <version-form model="add"></version-form>
     </div>
 </template>
 
 <script>
-import VersionForm from './components/versionForm.vue';
+import VersionForm from './components/form/versionForm.vue';
 export default {
-components: {
-    'version-form': VersionForm
-},
-props: {},
-data() {
-    return {
-        fileList: [],
-        // 表单参数
-        form: {},
-        // 表单校验
-        rules: {
-            versionName: [
-                { required: true, message: "版本名称不能为空", trigger: "blur" }
-            ],
-            versionNum: [
-                { required: true, message: "版本号不能为空", trigger: "blur" }
-            ]
-        }
-    };
-},
-watch: {},
-computed: {},
-created() {},
-mounted() {},
-methods: {
-    /** 提交按钮 */
-    submitForm: function() {
-        this.$refs.form.validate((valid) => {
-            if (valid) {
-                this.$api.addVersion(this.form)
-                    .then(response => {
-                        if (response.code === 200) {
-                            this.$message.success('提交成功');
-                            this.resetForm();
-                        } else {
-                            this.$message.error('提交失败');
-                        }
-                    })
-                    .catch(error => {
-                        this.$message.error('提交失败');
-                        console.error(error);
-                    });
-            }
-        });
+    components: {
+        'version-form': VersionForm
     },
-},
+    props: {},
+    data() {
+        return {};
+    },
+    watch: {},
+    computed: {},
+    created() {},
+    mounted() {},
+    methods: {},
 };
 </script>
 <style lang="scss" scoped>
-.el-form {
-  display: flex;
-  align-items: center;
-  flex-direction: column;
-}
-.dialog-footer {
-    display: flex;
-    justify-content: center;
-}
-.button-container {
-    display: flex;
-    justify-content: center;
-}
 </style>

+ 61 - 0
src/views/backStageManage/application/vision/components/dialog/addFunctionDialog.vue

@@ -0,0 +1,61 @@
+<template>
+  <div>
+    <el-dialog title="添加功能" :visible.sync="visible" width="500px" :before-close="close">
+        <addFunctionForm ref="addFunctionForm" v-if="visible" :form="form"></addFunctionForm>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="close">取 消</el-button>
+        <el-button type="primary" @click="submit" :loading="btnLoading">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import addFunctionForm from '../form/function.vue'
+export default {
+  components: {
+    addFunctionForm
+  },
+  props: {},
+  data() {
+    return {
+        visible:false,
+        form:{},
+        btnLoading:false,
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {
+    open(form){
+        this.form = form
+        this.visible = true
+    },
+    close(){
+        this.form = {}
+        this.visible = false
+    },
+    async submit(){
+        this.btnLoading = true
+        var sign = await this.$refs.addFunctionForm.validate()
+        if(!sign){
+            this.btnLoading = false
+            return
+        }
+        this.$api.addFunction(this.form).then(response=>{
+            if(response.code == 200){
+                this.$emit('getNewFunction',response.data)
+                this.btnLoading = false
+                this.close()
+            }
+        }).catch(error=>{
+            this.btnLoading = false
+        })
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 75 - 0
src/views/backStageManage/application/vision/components/form/function.vue

@@ -0,0 +1,75 @@
+<template>
+  <div>
+    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" label-position="left">
+      <el-form-item label="所属功能" prop="function" v-if="ruleForm.function">
+        <el-input v-model="ruleForm.last" placeholder="所属功能" :disabled="true"></el-input>
+      </el-form-item>
+      <!-- <el-form-item label="所属应用" prop="apply">
+        <el-input v-model="ruleForm.applyName" placeholder="所属应用" :disabled="true"></el-input>
+      </el-form-item> -->
+      <el-form-item label="功能名称" prop="name">
+        <el-input v-model="ruleForm.name" placeholder="请输入功能名称"></el-input>
+      </el-form-item>
+      <el-form-item label="功能标识" prop="sign">
+        <el-input type="textarea" v-model="ruleForm.sign" placeholder="请输入功能标识"></el-input>
+      </el-form-item>
+      <!-- <el-form-item label="是否可选" prop="ismore">
+         <el-radio-group v-model="ruleForm.functionType">
+            <el-radio :label="1">是</el-radio>
+            <el-radio :label="0">否</el-radio>
+        </el-radio-group>
+      </el-form-item> -->
+      <el-form-item label="功能描述" prop="describe">
+        <el-input v-model="ruleForm.describe" placeholder="请输入" type="textarea" maxlength="100" show-word-limit></el-input>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {
+    form:{
+        type:Object,
+        default:()=>{
+            return {}
+        }
+    }
+  },
+  data() {
+    return {
+        ruleForm:this.form,
+        rules: {
+            name: [{ required: true, message: '请输入功能名称', trigger: 'blur' },],
+            apply: [{ required: true, message: '请选择所属应用', trigger: 'blur' },],
+            sign: [{ required: true, message: '请输入功能标识', trigger: 'blur' },],
+        },
+    };
+  },
+  watch: {
+    form(){
+        this.ruleForm = this.form
+    }
+  },
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {
+    async validate(){
+        var sign = false
+        await this.$refs.ruleForm.validate((valid) => {
+            if (valid) {
+                sign = true
+            }
+            else {
+                sign = false;
+            }
+        })
+        return sign
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 381 - 0
src/views/backStageManage/application/vision/components/form/versionForm.vue

@@ -0,0 +1,381 @@
+<template>
+    <div>
+        <div class="button-container" v-if="model != 'detail'">
+                <el-button type="primary" size="small" :loading="btnLoading" @click="submitForm">提 交</el-button>
+                <el-button size="small"  @click="init">重 置</el-button>
+        </div>
+        <div class="form_center" >
+            <el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="120px" :class="model == 'detail'?'pointer_events_none':''">
+                <el-form-item label="版本名称:" prop="versionName" >
+                    <el-input v-model="form.versionName" placeholder="请输入版本名称" maxlength="20" />
+                </el-form-item>
+
+                <el-form-item label="版本号:" prop="versionNum">
+                    <el-input v-model="form.versionNum" placeholder="请输入版本号" maxlength="11" />
+                </el-form-item>
+
+                <el-form-item label="版本状态:" prop="status">
+                    <el-radio-group v-model="form.status">
+                        <el-radio v-for="(item, key) in status" :key="key" :label="parseInt(key)">{{item}}</el-radio>
+                    </el-radio-group>
+                </el-form-item>
+            
+                <el-form-item label="备注:" prop="remark">
+                    <el-input v-model="form.remark" placeholder="请输入备注" maxlength="50" />
+                </el-form-item>
+
+                <el-form-item label="上传文件:" class="margin-bottom_0" >
+                    <myUpload v-if="model != 'detail'" :file-list="(form.systemFile && form.systemFile.guid)?[form.systemFile]:[]" @on-change="onchangeFile" @on-remove="onRemove" :multiple="false" :limit="1"
+                        style="height: 185px;" :autoUpload="true">
+                    </myUpload>
+                    <div v-else-if="form.systemFile && form.systemFile.guid" style="display:flex;align-items:center;justify-content:space-between;">
+                        <div>
+                            {{form.systemFile.originalName }}
+                        </div>
+                        <el-button size="small" type="text" icon="el-icon-download" @click="downLoad(form)" style="font-size:16px;pointer-events:all !important;">下载</el-button>
+                    </div>
+                </el-form-item>
+                
+            </el-form>
+            <div style="border:1px solid white;padding:10px;margin:10px 0;border-radius:8px;">
+                <div style="height: 500px;" >
+                    <p style="display:flex;align-items:center;justify-content:space-between">
+                        {{model=='detail'?'功能清单':'选择功能'}}
+                        <el-button v-if="model != 'detail'" type="primary" size="small" @click="addFunction(1,form)">添加功能</el-button>
+                    </p>
+                    <funTable ref="functionTable" :tableData="tableData" :loading="loading" :reload="reload" :canChoose="model=='detail'?false:true" :defaultChecked="true">
+                        <template slot="column">
+                            <el-table-column label="授权代码" align="center">
+                                <template slot-scope="scope" v-if="!scope.row.children || scope.row.children == 0">
+                                    <span v-if="model == 'detail'">
+                                        {{ getCode(scope.row,2) }}
+                                    </span>
+                                    <value-input v-else type="textarea" :value="getCode(scope.row,2)" @change="(val)=>setCodeList_code(scope.row,val,2)"></value-input>
+                                </template>
+                            </el-table-column>
+                            <el-table-column label="未授权代码" align="center">
+                                <template slot-scope="scope" v-if="!scope.row.children || scope.row.children == 0">
+                                    <span v-if="model == 'detail'">
+                                        {{ getCode(scope.row,1) }}
+                                    </span>
+                                    <value-input v-else type="textarea" :value="getCode(scope.row,1)" @change="(val)=>setCodeList_code(scope.row,val,1)"></value-input>
+                                </template>
+                            </el-table-column>
+                            <el-table-column label="操作" align="center" width="120px" v-if="model != 'detail'">
+                                <template slot-scope="scope">
+                                    <div>
+                                        <el-button type="text" size="small" @click="addFunction(2,scope.row)">新增子功能</el-button>
+                                        <el-button type="text" size="small" @click="remove(scope.row)">移除</el-button>
+                                    </div>
+                                </template>
+                            </el-table-column>
+                        </template>
+                    </funTable>
+                </div>
+            </div>
+        </div>
+        <addFunctionDialog ref="addFunctionDialog" @getNewFunction="getNewFunction"></addFunctionDialog>
+    </div>
+</template>
+
+<script>
+import funTable from '../functionTable.vue';
+import functionData from '../mixins/functionData';
+import commonData from '../mixins/commonData';
+import { downLoad2 } from '@/utils';
+const currentForm = {
+    id:null,
+    versionName:null,
+    versionNum:null,
+    fileGuid:null,
+    status: 1,
+    applicationCode:'4e95e3d926a2a4befa5d913acc0aa9f5',
+    applyId:14,
+    remark:null,
+    systemFile:null,
+    assoFunctionCodeDTOS:[]
+}
+export default {
+    components: {
+        funTable
+    },
+    mixins:[functionData,commonData],
+    props: {
+        versionId:"",
+        model:{
+            type:String,
+            default:"add"
+        },
+    },
+    data() {
+        return {
+            btnLoading: false,
+            // 表单参数
+            form: {},
+            // 表单校验
+            rules: {
+                versionName: [
+                    { required: true, message: "版本名称不能为空", trigger: "blur" }
+                ],
+                versionNum: [
+                    { required: true, message: "版本号不能为空", trigger: "blur" }
+                ]
+            },
+            // checkFunctions:[],
+            // checkFunctions_back_up:[],
+            // codeList:[],
+            tableData:{},
+            loading:false,
+            reload:true,
+            
+        };
+    },
+    watch: {
+        versionId(){
+            if(this.$route.path != '/administrator/editVersion'){
+                return
+            }
+            this.init()
+        },
+    },
+    computed: {},
+    created() {},
+    mounted() {
+       this.init()
+    },
+    methods: {
+        //下载
+        downLoad(row){
+            if(!row.systemFile || !row.systemFile.guid){
+                this.$message.warning('该版本没有文件')
+                return
+            }
+            downLoad2(row.systemFile.guid,row.systemFile.originalName)
+        },
+        //初始化当前页面
+        async init(){
+            if(this.model == 'add'){
+                this.resetForm()
+            }else if(this.model == 'edit' || this.model == 'detail'){
+                if( this.model == 'detail'){
+                    this.reload = false
+                }
+                this.getById()
+            }
+            this.reload = false
+            this.$nextTick(()=>{
+                this.reload = true
+            })
+            await this.getList()
+        },
+        //查询数据并校验
+        getById(){
+            if(!this.versionId){
+                this.$message.error('编辑缺少参数')
+                return
+            }
+            var params = {
+                ids: [this.versionId],
+            };
+            this.$api.getVersionList(params).then(response=>{
+                if(response.code == 200){
+                    var data = response.data.records
+                    if(data && data.length>0){
+                        this.form = data[0]
+                    }
+                }
+            }).catch(error=>{
+                this.resetForm()
+            })
+        },
+        //重置表单
+        resetForm(){
+            this.form = Object.assign({}, currentForm)
+            this.$refs['form'].resetFields();
+        },
+        //获取所有的功能及代码
+        getAllFunCode(data,funCode){
+            for(var i = 0;i<data.length;i++){
+                if(data[i].isSelect != 2){
+                    funCode.push(
+                        {
+                            functionId:data[i].id,
+                            operateType:data[i].operateType,
+                            functionCodes:data[i].functionCodes
+                        }
+                    )
+                }
+                if(data[i].children && data[i].children.length){
+                    this.getAllFunCode(data[i].children,funCode)
+                }
+            }
+        },
+        /** 提交按钮 */
+        submitForm: function() {
+            this.$refs['form'].validate((valid) => {
+                if (valid) {
+                    var fileGuids = this.$commonJS.checkUploadFile([this.form.systemFile])
+                    if(!fileGuids){
+                        return
+                    }
+                    this.form.fileGuid = fileGuids.length>0?fileGuids[0]:''
+                    var assoFunctionCodeDTO = []
+                    this.getAllFunCode(this.tableData.children,assoFunctionCodeDTO)
+                    this.form.assoFunctionCodeDTOS = assoFunctionCodeDTO
+                    this.btnLoading = true
+                    var a = '添加'
+                    var api = 'addVersion'
+                    if(this.model == "edit"){
+                        a = '编辑'
+                        api = 'updateVersion'
+                    }
+                    this.$api[api](this.form).then(response => {
+                        if (response.code === 200) {
+                            this.btnLoading = false
+                            this.$message.success( a + '成功');
+                            this.finish()
+                        }
+                    })
+                    .catch(error => {
+                        this.$message.error(a + '失败')
+                        this.btnLoading = false
+                    });
+                }
+            });
+        },
+        finish(){
+            if(this.model == 'add'){
+                this.resetForm();
+                this.init()
+            }else{
+                this.$store.commit('removeHistoryPath',this.$route.path);
+                this.$store.commit('removeHistory',this.$route.path);
+                this.$router.push(
+                    {
+                        path:'/administrator/vision'
+                    }
+                )
+            }
+        },
+        //文件切换
+        onchangeFile(file){
+            if(file.guid){
+               this.$set(this.form,'systemFile',file) 
+            }
+        },
+        //删除文件
+        onRemove(file){
+            this.$set(this.form,'systemFile',null)
+        },
+        //查询功能列表
+        async getList() {
+            var params = {}
+            if(this.model != 'add'){
+                params.versionId = this.versionId
+            }
+            this.loading = true
+            await this.$api.queryFunctionCode(params).then(response => {
+                this.tableData = {
+                    applyId:this.form.applyId,
+                    children:response.data
+                }
+                var a = response.data
+                for(var j = 0;j<a.length;j++){
+                    function l(data){
+                        if(data.hasOwnProperty('children')){
+                            for(var i = 0;i<data.children.length;i++){
+                            
+                                if(data.hasOwnProperty('last')){
+                                    data.children[i].last=data.last+'/'+data.name
+                                }else{
+                                    data.children[i].last=data.name
+                                }
+                                l(data.children[i])
+                            }
+                        }
+                    }
+                    l(a[j])
+                }
+                this.loading = false
+            }).catch(error => {
+                this.loading = true
+            })
+        },
+       
+
+
+        /**
+         * 无用代码
+         * @param {*} val 
+         */
+        //切换分页
+        // handleCurrentChange(val){
+        //     this.queryParams.current = val
+        //     this.getList()
+        // },
+        // getFunctionId(data,checkData=[]){
+        //     for(var i = 0;i<data.length;i++){
+        //         checkData.push(data[i].id)
+        //         if(data[i].children && data[i].children.length>0){
+        //             this.getFunctionId(data[i].children,checkData)
+        //         }
+        //     }
+        //     this.checkFunctions = checkData
+        //     this.$nextTick(()=>{
+        //         this.checkFunctions_back_up = [...checkData]
+        //     })
+        // },
+        // //获取代码集合
+        // getCodeList(){
+        //     if(!this.form.id){
+        //         return 
+        //     }
+        //     this.codeList = []
+        // },
+        // //获取代码
+        // getCode(funId,field){
+        //     var index = this.codeList.findIndex(item=>{
+        //         return item.id == funId
+        //     })
+        //     if(index!=-1){
+        //         return this.codeList[index][field]
+        //     }
+        //     return ''
+        // },
+        // //改变代码
+        // setCodeList_code(funId,value,field){
+        //     var index1 = this.checkFunctions.indexOf(funId)
+        //     if(index1 ==-1){
+        //         this.checkFunctions.push(funId)
+        //     }
+        //     var index = this.codeList.findIndex(item=>{
+        //         return item.id == funId
+        //     })
+        //     if(index!=-1){
+        //         this.codeList[index][field] = value
+        //     }else{
+        //         var obj = {
+        //             id:funId,
+        //         }
+        //         obj[field] = value
+        //         this.codeList.push(obj)
+        //     }
+        // },
+    },
+};
+</script>
+<style lang="scss">
+.form_center {
+    width: 800px;
+    margin: 30px auto;
+}
+
+.button-container {
+    max-width: 1200px;
+    display: flex;
+    justify-content:flex-end;
+    margin: 10px auto;
+    position:sticky;
+    top:10px,
+}
+</style>

+ 135 - 0
src/views/backStageManage/application/vision/components/functionTable.vue

@@ -0,0 +1,135 @@
+<template>
+    <div class="height_100">
+        <el-table
+            row-key="id"
+            v-loading="loading"
+            :data="tableData.children"
+            border
+            height="calc(100% - 30px)"
+            :default-expand-all="expandAll"
+            header-row-class-name="custom-table-header"
+            :row-class-name="rowClassNameFun"
+            :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+        >
+            <el-table-column v-if="canChoose" type="index" align="center" width="50px">
+                <template slot-scope="scope">
+                    <div v-if="reload">
+                        <!-- <el-checkbox-group v-model="checkList">
+                            <el-checkbox :label="scope.row.id" @change="(value)=>changeCheck(value,scope.row)">{{ "" }}</el-checkbox>
+                        </el-checkbox-group> -->
+                        <value-input component="el-checkbox" :value="(scope.row.isSelect == 1 || (defaultChecked && scope.row.isSelect === undefined))?true:false"  @change="(value)=>changeCheck(value,scope.row)"></value-input>
+                    </div>
+                </template>
+            </el-table-column>
+            <el-table-column prop="name" label="功能名称" align="" show-overflow-tooltip></el-table-column>
+            <!-- <el-table-column label="所属应用" align="center" show-overflow-tooltip>
+                <template slot-scope="scope">
+                    <span >{{tableData.applyName}}</span>
+                    </template>
+            </el-table-column> -->
+            <el-table-column prop="describe" label="功能描述" align="center" show-overflow-tooltip></el-table-column>
+            <!-- <el-table-column prop="sign" label="路径" align="center" show-overflow-tooltip></el-table-column> -->
+            <!-- <el-table-column label="是否可选" align="center" show-overflow-tooltip>
+                <template slot-scope="scope">
+                    <span >{{scope.row.functionType==1?'是':'否'}}</span>
+                    </template>
+            </el-table-column> -->
+            <slot name="column"></slot>
+        </el-table>
+    </div>
+</template>
+
+<script>
+import treeChecked from './mixins/treeChecked';
+export default {
+    components: {},
+    mixins:[treeChecked],
+    props: {
+        applyId:"",
+        checkFunctions:{
+            type:Array,
+            default:()=>{
+                return []
+            }
+        },
+        expandAll:{
+            type:Boolean,
+            default:false
+        },
+        tableData:{
+            type:Object,
+            default:()=>{
+                return {}
+            }
+        },
+        loading:{
+            type:Boolean,
+            default:false
+        },
+        reload:{
+            type:Boolean,
+            default:true,
+        },
+        canChoose:{
+            type:Boolean,
+            default:false,
+        },
+        defaultChecked:{
+            type:Boolean,
+            default:false,
+        }
+    },
+    data() {
+        return {
+            checkList:this.checkFunctions,
+        };
+    },
+    watch: {
+        checkFunctions(){
+            this.checkList = this.checkFunctions
+        }
+    },
+    computed: {},
+    created() {},
+    mounted() {
+    },
+    methods: {
+        getCheckList(){
+            return this.checkList
+        },
+    },
+};
+</script>
+<style lang="scss">
+.indeterminate .el-checkbox__input .el-checkbox__inner {
+  background-color: #409eff !important;
+  border-color: #409eff !important;
+  color: #fff !important;
+}
+
+.indeterminate .el-checkbox__input.is-checked .el-checkbox__inner::after {
+  transform: scale(0.5);
+}
+
+.indeterminate .el-checkbox__input .el-checkbox__inner {
+  background-color: #f2f6fc;
+  border-color: #dcdfe6;
+}
+.indeterminate .el-checkbox__input .el-checkbox__inner::after {
+  border-color: #c0c4cc !important;
+  background-color: #c0c4cc;
+}
+.indeterminate .el-checkbox__input .el-checkbox__inner::after {
+  content: "";
+  position: absolute;
+  display: block;
+  background-color: #fff;
+  height: 2px;
+  transform: scale(0.5);
+  left: 0;
+  right: 0;
+  top: 5px;
+  width: auto !important;
+}
+
+</style>

+ 11 - 0
src/views/backStageManage/application/vision/components/mixins/commonData.js

@@ -0,0 +1,11 @@
+export default{
+    data() {
+        return {
+            status:{
+                1:"已保存",
+                2:"调试",
+                3:"已发布"
+            },
+        }
+    },
+}

+ 142 - 0
src/views/backStageManage/application/vision/components/mixins/functionData.js

@@ -0,0 +1,142 @@
+
+import addFunctionDialog from "../dialog/addFunctionDialog.vue"
+
+export default{
+    components:{
+        addFunctionDialog
+    },
+    data() {
+        return {
+            addType:null,
+            originFunction:null,
+        }
+    },
+    created() {
+    },
+    mounted() {
+    },
+    methods: {
+        remove(row){
+            var data = this.tableData.children
+            if(row.function == 0){
+                var index = data.findIndex(item=>{
+                    return item.id == row.id
+                })
+                if(index !=-1){
+                    data.splice(index,1)
+                }
+                return
+            }
+            var path = row.path
+            path = path.split(',')
+            path = path.filter(item=>{
+                return item != 0
+            })
+            
+            for(var i = 0;i<path.length;i++){
+                var obj = data.find(item=>{
+                    return item.id == path[i]
+                })
+                if(!obj){
+                    return
+                }
+                data = obj.children
+            }
+            var index = data.findIndex(item=>{
+                return item.id == row.id
+            })
+            if(index !=-1){
+                data.splice(index,1)
+            }
+        },
+        async addFunction(type,form={}){
+            if(type == 2){
+                var data = form.functionCodes
+                if(data && data.length > 0){
+                    var arr = data.filter(item=>{
+                        return item.code
+                    })
+                    if(arr && arr.length){
+                        var sign = false
+                        await this.$confirm('该功能已存在功能代码,如果添加子功能则会将该功能代码删掉, 是否继续?', '提示', {
+                            confirmButtonText: '确定',
+                            cancelButtonText: '取消',
+                            type: 'warning'
+                        }).then(() => {
+                            sign = true
+                        }).catch(() => {
+                            sign = false         
+                        });
+                        if(!sign){
+                            return
+                        }
+                        this.$set(form,'functionCodes',[])
+                    }
+                }
+            }
+            this.addType = type
+            this.originFunction = form
+            var ruleForm = {
+                // apply:form.apply,
+                // applyName:this.tableData.applyName,
+                sign:form.sign,
+                function: type == 2?form.id : 0,
+                functionType:1,
+                last:form.path?(form.last+'/'+form.name):form.name
+            }
+            this.$refs.addFunctionDialog.open(ruleForm)
+        },
+        getNewFunction(value){
+            let functionObj = value
+            functionObj.operateType = 1
+            if(this.addType == 1){//新增根功能
+                this.tableData.children.push(functionObj)
+            }else if(this.addType == 2){//新增子功能
+                this.originFunction.children.push(functionObj)
+            }
+            this.addType = null
+            this.originFunction = null
+        },
+         //获取代码
+         getCode(row,type){
+            var data = row.functionCodes
+            if(!data || data.length == 0){
+                data = [
+                    {
+                        authType:type,
+                        code:'' 
+                    }
+                ]
+                this.$set(row,'functionCodes',data)
+                return ''
+            }
+            var obj = data.find(item=>{
+                return item.authType == type
+            })
+            if(obj){
+                return obj.code
+            }
+            return ''
+        },
+        //改变代码
+        setCodeList_code(row,value,type){
+            if(!row.operateType){
+                row.operateType = this.model == 'edit'?3:1
+            }
+            var data = row.functionCodes
+            var obj = data.find(item=>{
+                return item.authType == type
+            })
+            if(!obj){
+                obj = {
+                    authType:type,
+                    code :value
+                }
+                data.push(obj)
+                return 
+            }
+            obj.code = value
+
+        },
+    },
+}

+ 135 - 0
src/views/backStageManage/application/vision/components/mixins/treeChecked.js

@@ -0,0 +1,135 @@
+export default{
+    methods: {
+        changeCheck(checked,row){
+            let that = this;
+            if(checked){
+                that.$set(row,'isSelect',1)
+            }else{
+                that.$set(row,'isSelect',2)
+            }
+            
+            function selectAllChildrens(data) {
+                data.forEach((item) => {
+                    // let index = that.checkList.findIndex(i =>{
+                    //     return i == item.id
+                    // })
+                    if(checked){
+                        that.$set(item,'isSelect',1)
+                        // if(index == -1){
+                        //     that.checkList.push(item.id) 
+                        // }
+                    }else{
+                        that.$set(item,'isSelect',2)
+                        // if(index !=-1 ){
+                        //     that.checkList.splice(index,1)
+                        // }
+                    }
+                    
+                  if (item.children && item.children.length) {
+                    selectAllChildrens(item.children);
+                  }
+                });
+            }
+    
+            function getSelectStatus(selectStatuaArr, data) {
+                data.forEach((childrenItem) => {
+                    selectStatuaArr.push(childrenItem.isSelect)
+                    if (childrenItem.children && childrenItem.children.length) {
+                        getSelectStatus(selectStatuaArr, childrenItem.children);
+                    }
+                });
+                return selectStatuaArr;
+            }
+            function getLevelStatus(row) {
+                //如果当前节点的parantId =0 并且有子节点,则为1
+                //如果当前节点的parantId !=0 并且子节点没有子节点 则为3
+                if (row.function == 0) {
+                    if (row.children && row.children.length) {
+                        return 1;
+                    }else{
+                        return 4;
+                    }
+                } else {
+                    if (!row.children || !row.children.length) {
+                        return 3;
+                    } else {
+                        return 2;
+                    }
+                }
+            }
+            let result = {};
+            //获取明确的节点
+            function getExplicitNode(data,parentId) {
+                for(var i = 0;i<data.length;i++){
+                    var item = data[i]
+                    if(item.id == parentId) {
+                        result = item;
+                        return result;
+                    }
+                    if(item.children && item.children.length) {
+                        getExplicitNode(item.children,parentId);
+                    }
+                }
+                return result
+            }
+            function operateLastLeve(row) {
+                //操作的是子节点  1、获取父节点  2、判断子节点选中个数,如果全部选中则父节点设为选中状态,如果都不选中,则为不选中状态,如果部分选择,则设为不明确状态
+                let selectStatuaArr = [];
+                let item = getExplicitNode(that.tableData.children,row.function);
+                selectStatuaArr = getSelectStatus(selectStatuaArr, item.children);
+                if (
+                    selectStatuaArr.every((selectItem) => {
+                        return 1 == selectItem || selectItem === undefined;
+                    })
+                ) {
+                    that.$set(item,'isSelect',1)
+                    // let index = that.checkList.findIndex(i=>i == item.id)
+                    // if(index == -1){
+                    //     that.checkList.push(item.id)
+                    // }
+                } else if (
+                    selectStatuaArr.every((selectItem) => {
+                    return 2 == selectItem;
+                    })
+                ) {
+                    that.$set(item,'isSelect',2)
+                    // let index = that.checkList.findIndex(i =>{
+                    //     return i == item.id
+                    // })
+                    // if(index != -1){
+                    //     that.checkList.splice(index,1)
+                    // }
+                } else {
+                    that.$set(item,'isSelect','')
+                    // let index = that.checkList.findIndex(i=>i == item.id)
+                    // if(index == -1){
+                    //     that.checkList.push(item.id)
+                    // }
+                }
+                //则还有父级
+                if(item.function!=0) {
+                    operateLastLeve(item)
+                }
+            }
+            //判断操作的是子级点复选框还是父级点复选框,如果是父级点,则控制子级点的全选和不全选
+      
+            // 1、只是父级 2、既是子集,又是父级 3、只是子级
+            let levelSataus = getLevelStatus(row);
+            if (levelSataus == 1) {
+              selectAllChildrens(row.children);
+            } else if (levelSataus == 2) {
+              selectAllChildrens(row.children);
+              operateLastLeve(row);
+            } else if(levelSataus == 3) {
+              operateLastLeve(row);
+            }
+            // this.$forceUpdate()
+        },
+        rowClassNameFun({ row }) {
+            if (row.isSelect ==='') {
+              return "indeterminate";
+            }
+          },
+      
+    },
+}

+ 0 - 132
src/views/backStageManage/application/vision/components/versionForm.vue

@@ -1,132 +0,0 @@
-<template>
-    <div>
-        <el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="80px">
-            <el-form-item label="版本名称" prop="versionName">
-                <el-input v-model="form.versionName" placeholder="请输入版本名称" maxlength="20" />
-            </el-form-item>
-
-            <el-form-item label="版本号" prop="versionNum">
-                <el-input v-model="form.versionNum" placeholder="请输入版本号" maxlength="11" />
-            </el-form-item>
-        
-            <el-form-item label="备注" prop="remark">
-                <el-input v-model="form.remark" placeholder="请输入备注" maxlength="50" />
-            </el-form-item>
-
-            <el-form-item label="是否授权" prop="authType">
-                <el-tooltip :content="'Switch value: ' + value" placement="top">
-                    <el-switch
-                        v-model="form.authType"
-                        active-color="#13ce66"
-                        inactive-color="#ff4949"
-                        active-value="1"
-                        inactive-value="2">
-                    </el-switch>
-                </el-tooltip>
-            </el-form-item>
-
-            <el-form-item label="版本文件" prop="versionFile">
-                <el-upload class="upload-demo" drag action="https://jsonplaceholder.typicode.com/posts/" multiple>
-                    <i class="el-icon-upload"></i>
-                    <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
-                </el-upload>
-            </el-form-item>
-
-
-        </el-form>
-        <div class="button-container">
-            <el-button type="primary" :loading="btnLoading" @click="submitForm">提 交</el-button>
-            <el-button @click="resetForm">重 置</el-button>
-        </div>
-    </div>
-</template>
-
-<script>
-const currentForm = {
-    id:null,
-    versionName:null,
-    versionNum:null,
-    remark:null,
-    versionFile:null,
-}
-export default {
-    components: {
-        switchValue() {
-            return this.form.authType === 1 ? '授权' : '未授权';
-        }
-    },
-    props: {
-        versionData: {
-            type:Object,
-            default:()=>{
-                return {}
-            }
-        },
-    },
-    data() {
-        return {
-            btnLoading: false,
-            fileList: [],
-            // 表单参数
-            form: this.versionData,
-            // 表单校验
-            rules: {
-                versionName: [
-                    { required: true, message: "版本名称不能为空", trigger: "blur" }
-                ]
-            }
-        };
-    },
-    watch: {
-        versionData(val){
-            this.form = val
-        }
-    },
-    computed: {},
-    created() {},
-    mounted() {},
-    methods: {
-        //重置表单
-        resetForm(){
-            this.form = Object.assign({},currentForm)
-            this.$refs['form'].resetFields();
-        },
-        /** 提交按钮 */
-        submitForm: function() {
-            this.$refs['form'].validate((valid) => {
-                if (valid) {
-                    this.btnLoading = true
-                    var a = '添加'
-                    var api = 'addVersion'
-                    if(this.form.id){
-                        a = '编辑'
-                        api = 'updateVersion'
-                    }
-                    this.$api[api](this.form).then(response => {
-                        if (response.code === 200) {
-                            this.btnLoading = false
-                            this.$message.success( a + '成功');
-                            this.resetForm();
-                        }
-                    })
-                    .catch(error => {
-                        this.$message.error(a + '失败')
-                        this.btnLoading = false
-                    });
-                }
-            });
-        },
-    },
-};
-</script>
-<style lang="scss">
-.el-form {
-  display: flex;
-  align-items: center;
-  flex-direction: column;
-}
-.button-container {
-    display: flex;
-    justify-content: center;
-}
-</style>

+ 9 - 31
src/views/backStageManage/application/vision/editVersion.vue

@@ -1,53 +1,31 @@
 <template>
     <div>
-        <version-form :versionData="versionForm"></version-form>
+        <version-form :versionId="versionId" model="edit"></version-form>
     </div>
 </template>
 
 <script>
-import VersionForm from './components/versionForm.vue';
+import VersionForm from './components/form/versionForm.vue';
 export default {
     components: {
         'version-form': VersionForm
     },
     props: {},
     data() {
-        return {
-            fileList: [],
-            // 表单参数
-            versionForm: {},
-            // 表单校验
-            rules: {
-                versionName: [
-                    { required: true, message: "版本名称不能为空", trigger: "blur" }
-                ]
-            },
-        };
+        return {};
     },
     watch: {},
     computed: {
         versionId() {
-            return this.$route.query.id;
+            if(this.$route.path == '/administrator/editVersion'){
+                return this.$route.query.id;
+            }
+            
         },
     },
     created() {},
-    mounted() {
-        this.getById()
-    },
-    methods: {
-        getById() {
-            var params = {
-                id: this.versionId,
-            };
-            this.$api.getVersionById(params).then(response=>{
-                if(response.code == 200){
-                    this.versionForm = response.data.records
-                }
-            }).catch(error=>{
-                this.versionForm = []
-            })
-        },
-    },
+    mounted() {},
+    methods: {},
 };
 </script>
 <style lang="scss" scoped>

+ 8 - 204
src/views/backStageManage/application/vision/index.vue

@@ -1,222 +1,26 @@
 <template>
-  <div class="container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="版本名" prop="versionName">
-        <el-input v-model="queryParams.versionName" placeholder="请输入版本名称"/>
-      </el-form-item>
-      <el-form-item label="版本号" prop="versionNum">
-        <el-input v-model="queryParams.versionNum" placeholder="请输入版本号"/>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="search">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-    
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button type="primary" plain icon="el-icon-plus" size="small" @click="handleAdd">新增</el-button>
-      </el-col>
-    </el-row>
-
-    <el-table
-            ref="table"
-            :data="tableData"
-            row-key="id"
-            style="width: 100%"
-            :maxHeight="tableHeight - 40"
-            v-loading="loading"
-            @selection-change="handleSelectionChange"
-            @sort-change="sortChange"
-        >
-        <el-table-column type="selection" width="55" :reserve-selection="true" v-if="!choose">
-
-        </el-table-column>
-        <el-table-column  v-if="choose" align="center">
-            <template slot-scope="scope">
-                <div>
-                    <el-checkbox-group v-model="checkList1">
-                        <el-checkbox :label="scope.row.id">{{(scope.$index + 1) + ((queryParams.current - 1) * queryParams.size)}}</el-checkbox>
-                    </el-checkbox-group>
-                </div>
-            </template>
-            
-        </el-table-column>
-
-        <el-table-column prop="versionName" label="版本名称"></el-table-column>
-        <el-table-column prop="versionNum" label="版本号"></el-table-column>
-        <el-table-column prop="versionFile" label="版本文件"></el-table-column>
-        <el-table-column prop="remark" label="备注"></el-table-column>
-
-        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-          <template slot-scope="scope">
-            <el-button size="mini" type="text" icon="el-icon-edit" @click="handleEdit(scope.row)">修改</el-button>
-            <el-button v-if="scope.row.id != 0" size="mini" type="text" icon="el-icon-delete"@click="handleDelete(scope.row)">删除</el-button>
-          </template>
-        </el-table-column>
-    </el-table>
-    <div>
-      <el-pagination background layout="total, sizes, prev, pager, next, jumper"
-        :current-page.sync="queryParams.current" :page-size.sync="queryParams.size"
-        @current-change="handleCurrentChange" @size-change="changeSize" :total="total">
-      </el-pagination>
-    </div>
+  <div class="height_100">
+    <version></version>
   </div>
 </template>
 
 <script>
-
+import version from './vision.vue';
 export default {
-
-  components: {},
-  props: {
-    choose:{
-      type:Boolean,
-      default:false
-    },
-    checkList:{
-      type:Array,
-      default:()=>{
-          return []
-      }
-    }
+  components: {
+    version
   },
+  props: {},
   data() {
     return {
-      checkList1:this.checkList,
-      multipleSelection:[],
-      // 遮罩层
-      loading: false,
-      // 显示搜索条件
-      showSearch: true,
-      // 表单参数
-      form: {},
-      // 版本表格数据
-      versionList: [],
-      // 总条数
-      total: 0,
-      tableData: [],
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        versionNum: '',
-        versionName: ''
-      },
-      rules: {
-        versionNum: [
-          { required: true, message: "版本号不能为空", trigger: "blur" }
-        ],
-        versionName: [
-          { required: true, message: "版本名称不能为空", trigger: "blur" }
-        ]
-      }
     };
   },
   watch: {},
   computed: {},
   created() {},
-  mounted() {
-    this.getList()
-  },
-  methods: {
-    //检索
-    search(){
-      this.queryParams.current = 1
-      this.getList()
-    },
-    /** 查询版本列表 */
-    getList() {
-      this.loading = true;
-      this.$api.getVersionList(this.queryParams).then(response=>{
-        if(response.code == 200){
-            this.tableData = response.data.records
-            this.total = response.data.total
-            this.loading = false
-        }
-      }).catch(error=>{
-          this.tableData = []
-          this.total = 0
-          this.loading = false
-      })
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!=1
-      this.multiple = !selection.length
-    },
-    //切换分页
-    handleCurrentChange(val){
-        this.queryParams.current = val
-        this.getList()
-    },
-
-    //切换也大小
-    handleSizeChange(val){
-        this.queryParams.current = 1
-        this.queryParams.size = 10
-        this.getList()
-    },
-    //排序
-    sortChange({ column, prop, order }){},
-    /** 新增按钮操作 */
-    handleAdd(row) {
-      this.$router.push('/administrator/addVersion');
-    },
-    /** 提交按钮 */
-    submitForm: function() {
-      this.open = false;
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-    },
-    handleEdit(row) {
-      this.$router.push({ 
-        path: '/administrator/editVersion', 
-        query: {
-            id: row.id
-        }
-      });
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.handleQuery();
-    },
-  },
+  mounted() {},
+  methods: {},
 };
 </script>
 <style lang="scss" scoped>
-.container{
-  width: 100%;
-}
-.padding_20{
-  padding: 20px
-}
-::v-deep .el-table,
-.el-table__expanded-cell {
-  background-color: transparent;
-}
-
-::v-deep .el-table tr {
-  background-color: transparent !important;
-}
-::v-deep .el-table__body td,::v-deep .el-table__header th,
-.el-table .cell {
-  background-color: transparent;
-}
-::v-deep .el-table::before {
-  //去除底部白线
-  left: 0;
-  bottom: 0;
-  width: 100%;
-  height: 0px;
-}
-
 </style>

+ 30 - 0
src/views/backStageManage/application/vision/versionDetail.vue

@@ -0,0 +1,30 @@
+<template>
+    <div>
+        <version-form :versionId="versionId" model="detail"></version-form>
+    </div>
+</template>
+
+<script>
+import VersionForm from './components/form/versionForm.vue';
+export default {
+    components: {
+        'version-form': VersionForm
+    },
+    props: {},
+    data() {
+        return {};
+    },
+    watch: {},
+    computed: {
+        versionId() {
+            return this.$route.query.id;
+        },
+    },
+    created() {},
+    mounted() {},
+    methods: {},
+};
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 307 - 0
src/views/backStageManage/application/vision/vision.vue

@@ -0,0 +1,307 @@
+<template>
+  <div class="height_100">
+    <el-container>
+      <el-header>
+        <div class="header">
+          <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"  label-width="68px">
+            <el-form-item label="版本名" prop="versionName">
+              <el-input v-model="queryParams.versionName" placeholder="请输入版本名称"/>
+            </el-form-item>
+            <el-form-item label="版本号" prop="versionNum">
+              <el-input v-model="queryParams.versionNum" placeholder="请输入版本号"/>
+            </el-form-item>
+            <el-form-item label="版本状态" prop="status">
+              <el-select v-model="queryParams.status" placeholder="请选择版本状态">
+                <el-option v-for="(item, key) in status" :key="key" :label="item" :value="key"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" icon="el-icon-search" size="mini" @click="search">搜索</el-button>
+              <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            </el-form-item>
+          </el-form>
+          
+          <el-row :gutter="10" class="mb8">
+            <el-col :span="1.5">
+              <el-button type="primary" plain icon="el-icon-plus" size="small" @click="handleAdd">新增</el-button>
+            </el-col>
+          </el-row>
+        </div>
+      </el-header>
+      <el-main class="padding_10">
+        <el-table
+            ref="table"
+            border
+            :data="tableData"
+            row-key="id"
+            style="width: 100%"
+            max-height="calc(100% - 0)"
+            v-loading="loading"
+            @sort-change="sortChange"
+        >
+            <el-table-column type="index" label="序号" align="center" width="100px">
+                <template slot-scope="scope">
+                    <div>
+                        <el-checkbox-group v-model="checkList">
+                            <el-checkbox :label="scope.row.id">{{(scope.$index + 1) + ((queryParams.current - 1) * queryParams.size)}}</el-checkbox>
+                        </el-checkbox-group>
+                    </div>
+                </template>
+            </el-table-column>
+
+            <el-table-column prop="versionName" label="版本名称">
+              <template slot-scope="scope">
+                <div>
+                  <el-link type="primary" @click="handleDetail(scope.row)">{{ scope.row.versionName }}</el-link>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="versionNum" label="版本号" width="100px"></el-table-column>
+            <el-table-column prop="versionFile" label="版本文件">
+              <template slot-scope="scope">
+                <div v-if="scope.row.systemFile && scope.row.systemFile.originalName">
+                  {{ scope.row.systemFile.originalName }}
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="status" label="版本状态" width="100px">
+              <template slot-scope="scope">
+                <div>
+                  {{ status[scope.row.status] }}
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="remark" label="备注"></el-table-column>
+            <el-table-column prop="createTime" label="创建时间"></el-table-column>
+
+            <el-table-column label="操作" align="center" width="170px">
+              <template slot-scope="scope">
+                <template v-if="scope.row.status != 3">
+                  <el-button size="mini" type="text" icon="el-icon-edit" @click="handleEdit(scope.row)">修改</el-button>
+                  <el-button size="mini" type="text" icon="el-icon-position" @click="release(scope.row)">发布</el-button>
+                </template>
+                <el-button size="mini" type="text" icon="el-icon-download" @click="downLoad(scope.row)">下载</el-button>
+                <el-button v-if="scope.row.id != 0" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
+              </template>
+            </el-table-column>
+        </el-table>
+      </el-main>
+      <el-footer class="pagination">
+        <div class="foot">
+            <div v-if="checkList.length>0">
+              <el-button size="small" type="danger" @click="dels">删除{{ checkList.length }}条</el-button>
+            </div>
+            <div v-else></div>
+            <el-pagination background layout="total, sizes, prev, pager, next, jumper"
+            :current-page.sync="queryParams.current" :page-size.sync="queryParams.size"
+            @current-change="handleCurrentChange" @size-change="changeSize" :total="total">
+          </el-pagination>
+        </div>
+        
+      </el-footer>
+    </el-container>
+  </div>
+</template>
+
+<script>
+import { downLoad2 } from '@/utils';
+import commonData from './components/mixins/commonData';
+const searchForm = {
+  versionName:'',
+  versionNum:'',
+  status:'',
+}
+export default {
+  mixins:[commonData],
+  components: {},
+  props: {
+  },
+  data() {
+    return {
+      checkList:[],
+      // 遮罩层
+      loading: false,
+      // 总条数
+      total: 0,
+      tableData: [],
+      // 查询参数
+      queryParams: {
+        current: 1,
+        size: 10,
+        ...searchForm,
+      },
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    //检索
+    search(){
+      this.queryParams.current = 1
+      this.getList()
+    },
+
+    /** 查询版本列表 */
+    getList() {
+      this.loading = true;
+      this.$api.getVersionList(this.queryParams).then(response=>{
+        if(response.code == 200){
+            this.tableData = response.data.records
+            this.total = response.data.total
+            this.loading = false
+        }
+      }).catch(error=>{
+          this.tableData = []
+          this.total = 0
+          this.loading = false
+      })
+    },
+
+    //切换分页
+    handleCurrentChange(val){
+        this.queryParams.current = val
+        this.getList()
+    },
+
+    //切换也大小
+    changeSize(val){
+        this.queryParams.current = 1
+        this.queryParams.size = val
+        this.getList()
+    },
+
+    //排序
+    sortChange({ column, prop, order }){
+
+    },
+
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.$router.push({
+        path:'/administrator/addVersion'
+      });
+    },
+
+    handleEdit(row) {
+      this.$router.push({ 
+        path: '/administrator/editVersion', 
+        query: {
+            id: row.id
+        }
+      });
+    },
+    handleDetail(row){
+      this.$router.push({ 
+        path: '/administrator/versionDetail', 
+        query: {
+            id: row.id
+        }
+      });
+    },
+    //下载
+    downLoad(row){
+      if(!row.systemFile || !row.systemFile.guid){
+        this.$message.warning('该版本没有文件')
+        return
+      }
+      downLoad2(row.systemFile.guid,row.systemFile.originalName)
+    },
+    //发布
+    release(row){
+      var params = {
+        id:row.id,
+        status:3
+      }
+      var message = this.$message({
+        type:'warning',
+        message: '正在发布...',
+        duration: 0 // 设置为0表示不自动关闭
+      })
+      this.$api.updateVisionStatus(params).then(response=>{
+        if(response.code == 200){
+          message.close()
+          this.$message(
+            {
+              type:'success',
+              message:'发布成功'
+            }
+          )
+          this.$set(row,'status',3)
+        }
+      }).catch(error=>{
+        message.close()
+        this.$message(
+          {
+            type:'error',
+            message:'发布失败'
+          }
+        )
+      })
+    },
+    //删除
+    handleDelete(row){
+      this.removeVersions([row.id],1)
+    },
+    dels(){
+      this.removeVersions(this.checkList)
+    },
+    //删除
+    removeVersions(ids,type){
+      this.$confirm('确认删除选择的数据吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loading = true
+        this.$api.removeVersions(ids).then(response => {
+          this.$message.success('删除成功')
+          this.loading = false
+          this.getList()
+          if(type){
+              var id = ids[0]
+              var index = this.checkList.indexOf(id)
+              if(index!=-1){
+                this.checkList.splice(index,1)
+              }
+          }else{
+              this.$set(this,'checkList',[])
+          }
+        }).catch(error => {
+          this.loading = false
+        })
+      })
+    },
+
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.current = 1;
+      this.getList();
+    },
+
+    /** 重置按钮操作 */
+    resetQuery() {
+      for(let key in searchForm){
+        this.$set(this.queryParams,key,'')
+      }
+      this.handleQuery();
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.header{
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.foot{
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+}
+</style>

+ 202 - 0
src/views/backStageManage/examine/examine/components/examine.vue

@@ -0,0 +1,202 @@
+<template>
+  <div class="height_100">
+    <el-container>
+        <el-header>
+            <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"  label-width="68px">
+                <el-form-item label="审核类型" prop="examineType">
+                    <el-input v-model="queryParams.examineType" placeholder="请输入审核类型"/>
+                </el-form-item>
+                <el-form-item label="状态" prop="status">
+                    <el-input v-model="queryParams.status" placeholder="请输入状态"/>
+                </el-form-item>
+                <el-form-item>
+                    <el-button type="primary" icon="el-icon-search" size="mini" @click="search">搜索</el-button>
+                    <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+                </el-form-item>
+            </el-form>
+        </el-header>
+        <el-main class="padding_10">
+            <el-table
+                ref="table"
+                border
+                :data="tableData"
+                row-key="id"
+                style="width: 100%"
+                max-height="calc(100% - 0)"
+                v-loading="loading"
+                @sort-change="sortChange"
+                @selection-change="handleSelectionChange"
+            >
+                <el-table-column  type="selection" width="55"></el-table-column>
+
+                <el-table-column v-for="item in columnList" :render-header="$commonJS.renderHeaderMethods" :key="item.field" :prop="item.field" :label="item.name" :sortable="item.ifSort?'custom':false" :width="item.width || 'auto'"></el-table-column>
+
+                <el-table-column label="操作" align="center" width="180px">
+                    <template slot-scope="scope">
+                        <el-button size="mini" type="primary" @click="examine(scope.row,1)"><i class="el-icon-check"></i>通过</el-button>
+                        <el-button size="mini" type="danger" @click="examine(scope.row,2)"><i class="el-icon-close"></i>不通过</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </el-main>
+        <el-footer class="pagination">
+            <div class="foot">
+                <div v-if="multipleSelection.length">
+                    已选择{{ multipleSelection.length }}条数据
+                    <el-button size="mini" type="primary" @click="examineAll(1)"><i class="el-icon-check"></i>审核通过</el-button>
+                    <el-button size="mini" type="danger" @click="examineAll(2)"><i class="el-icon-close"></i>审核通过</el-button>
+                </div>
+                <div v-else></div>
+                <el-pagination background layout="total, sizes, prev, pager, next, jumper"
+                    :current-page.sync="queryParams.current" :page-size.sync="queryParams.size"
+                    @current-change="handleCurrentChange" @size-change="changeSize" :total="total">
+                </el-pagination>
+            </div>
+            
+        </el-footer>
+    </el-container>
+  </div>
+</template>
+
+<script>
+const defaultColumn = [
+    {
+        field:'name',
+        name:'姓名',
+        ifSort:true,
+        width:'120px'
+    },
+    {
+        field:'phone',
+        name:'电话',
+        ifSort:true
+    },
+    {
+        field:'email',
+        name:'邮箱',
+        ifSort:true
+    },
+    {
+        field:'userName',
+        name:'账号',
+        ifSort:true
+    },
+    // {
+    //     field:'password',
+    //     name:'密码',
+    //     ifSort:true
+    // },
+    {
+        field:'departmentalPosition',
+        name:'部门职位',
+        ifSort:false,
+        type:"function",
+        useFunction:(data)=>{
+            return `部门:${data.department}<br>职位:${data.position}`
+        }
+    },
+    {
+        field:'enterprise',
+        name:'所属企业',
+        ifSort:false,
+        type:"function",
+        useFunction:(data)=>{
+            return `名称:${data.enterpriseName}<br>地址:${data.enterpriseAddress}<br>类型:${data.enterpriseType}`
+        }
+    },
+    {
+        field:'type',
+        name:'审核类型',
+        ifSort:true,
+        width:'120px'
+    },
+    {
+        field:'status',
+        name:'状态',
+        ifSort:true,
+        width:'120px'
+    },
+    {
+        field:'createTime',
+        name:'创建时间',
+        ifSort:true
+    },
+]
+export default {
+  components: {},
+  props: {},
+  data() {
+    return {
+        queryParams:{
+            current:1,
+            size:10,
+        },
+        total:0,
+        tableData:[],
+        columnList:defaultColumn,
+        loading:false,
+        multipleSelection:[],
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    //查询审核任务列表
+    getList(){},
+    //检索
+    search(){},
+    //重置检索条件
+    resetQuery(){},
+    //切换分页
+    handleCurrentChange(val){
+        this.queryParams.current = val
+        this.getList()
+    },
+    //切换页大小
+    changeSize(value){
+        this.queryParams.size = value
+        this.queryParams.current = 1
+        this.getList()
+    },
+    //排序
+    sortChange({ column, prop, order }){
+        var orderType = {
+            ascending: 0,
+            descending: 1
+        }
+        this.queryParams.orderBy = prop
+        this.queryParams.orderType = orderType[order]
+        this.getList()
+    },
+    //选择
+    handleSelectionChange(val) {
+        this.multipleSelection = val;
+    },
+    //审核
+    examine(row,type){
+        this.submitExamine([row.id],type)
+    },
+    examineAll(type){
+        var ids = this.multipleSelection.map(item=>item.id)
+        this.submitExamine(ids,type)
+    },
+    submitExamine(data,type){
+        var params = {
+            ids:data,
+            type:type
+        }
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.foot{
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+}
+</style>

+ 44 - 0
src/views/backStageManage/examine/examine/components/view/table.vue

@@ -0,0 +1,44 @@
+<template>
+  <div class="height_100">
+    <el-table
+        ref="table"
+        border
+        :data="tableData"
+        row-key="id"
+        style="width: 100%"
+        max-height="calc(100% - 0)"
+        v-loading="loading"
+        @sort-change="sortChange"
+        @selection-change="handleSelectionChange"
+    >
+        <el-table-column  type="selection" width="55"></el-table-column>
+
+        <el-table-column v-for="item in columnList" :render-header="$commonJS.renderHeaderMethods" :key="item.field" :prop="item.field" :label="item.name" :sortable="item.ifSort?'custom':false" :width="item.width || 'auto'"></el-table-column>
+
+        <el-table-column label="操作" align="center" width="180px">
+            <template slot-scope="scope">
+                <el-button size="mini" type="primary" @click="examine(scope.row,1)"><i class="el-icon-check"></i>通过</el-button>
+                <el-button size="mini" type="danger" @click="examine(scope.row,2)"><i class="el-icon-close"></i>不通过</el-button>
+            </template>
+        </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {},
+  data() {
+    return {
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {},
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 27 - 0
src/views/backStageManage/examine/examine/index.vue

@@ -0,0 +1,27 @@
+<template>
+  <div class="height_100">
+    <examine></examine>
+  </div>
+</template>
+
+<script>
+import examine from './components/examine.vue';
+export default {
+  components: {
+    examine
+  },
+  props: {},
+  data() {
+    return {
+
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {},
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 1 - 1
src/views/backStageManage/home/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>12</div>
+  <div></div>
 </template>
 
 <script>

+ 7 - 8
src/views/backStageManage/layout/components/AppMain.vue

@@ -1,15 +1,13 @@
 <template>
   <section class="app-main">
     <transition name="fade" mode="out-in">
-      <!-- <router-view :key="key"></router-view> -->
-      
-      <template v-if="$route.meta.keepAlive">
-        <keep-alive>
-          <router-view></router-view>
-        </keep-alive>
-      </template>
-      <router-view v-else></router-view>
+      <keep-alive>
+          <router-view :key="$route.fullPath" v-if="$route.meta.keepAlive"></router-view>
+      </keep-alive>
     </transition>
+      <transition name="fade" mode="out-in">
+          <router-view v-if="!$route.meta.keepAlive"></router-view>
+      </transition>
   </section>
 </template>
 
@@ -30,6 +28,7 @@ export default {
     },
   },
   watch:{
+
   },
   data() {
     return {

+ 12 - 6
src/views/backStageManage/layout/components/Navbar.vue

@@ -7,11 +7,12 @@
     </div> -->
       <el-dropdown class="avatar-container" trigger="click">
         <div class="avatar-wrapper">
-          <img class="user-avatar" :src="$commonJS.getFile(avatar)">
+          <img class="user-avatar" v-if="avatar" :src="$commonJS.checkViewer(avatar)">
+          <img class="user-avatar" v-else :src="require('@/assets/user-avatar.jpeg')">
           <i class="el-icon-caret-bottom"></i>
         </div>
         <el-dropdown-menu class="user-dropdown" slot="dropdown">
-          <router-link class="inlineBlock" to="/">
+          <router-link class="inlineBlock" to="/administrator/home">
             <el-dropdown-item>
               首页
             </el-dropdown-item>
@@ -70,9 +71,14 @@ export default {
       this.$store.dispatch('ToggleSideBar')
     },
     logout() {
-      this.$store.dispatch('LogOut').then(() => {
-        location.reload() // 为了重新实例化vue-router对象 避免bug
-      })
+      // this.$store.dispatch('LogOut').then(() => {
+      //   location.reload() // 为了重新实例化vue-router对象 避免bug
+      // })
+      this.$router.push(
+        {
+          path:'/administrator/login'
+        }
+      )
     },
     toggleFullScreen() {
       const elem = document.documentElement;
@@ -126,7 +132,7 @@ export default {
       .user-avatar {
         width: 40px;
         height: 40px;
-        border-radius: 10px;
+        border-radius: 40px;
       }
       .el-icon-caret-bottom {
         position: absolute;

+ 2 - 1
src/views/backStageManage/layout/components/history.vue

@@ -38,9 +38,10 @@ export default {
       }
     },
     tabRemove(path){
+      var sign = this.currentPath == path
       this.$store.commit('removeHistoryPath',path);
       this.$store.commit('removeHistory',path);
-      if(this.currentPath == path){
+      if(sign){
         this.tabClick(this.history[this.history.length-1])
       }
       

+ 12 - 2
src/views/backStageManage/login/index.vue

@@ -28,13 +28,23 @@
             <template v-if="loginType == 2">
               <div>
                 <el-form-item prop="username" >
-                  <el-input v-model="form.username" placeholder="请输入账号">
+                  <el-input v-model="form.username" placeholder="请输入账号" @keyup.enter.native="submit">
                     <i slot="prefix" class="iconfont icon-tianjiazhanghao icon"></i>
                   </el-input>
                 </el-form-item>
                 <el-form-item prop="password" >
-                  <el-input v-model="form.password" placeholder="请输入密码">
+                  <!-- <el-input v-model="form.password" placeholder="请输入密码">
                     <i slot="prefix" class="iconfont icon-mima icon"></i>
+                  </el-input> -->
+                  <el-input
+                    type="password"
+                    placeholder="请输入密码"
+                    prefix-icon="el-icon-lock"
+                    v-model="form.password"
+                    autocomplete="off"
+                    :show-password="true"
+                    @keyup.enter.native="submit"
+                  >
                   </el-input>
                 </el-form-item>
               </div>

+ 21 - 0
src/views/backStageManage/organization/personnel/index.vue

@@ -0,0 +1,21 @@
+<template>
+  <div></div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {},
+  data() {
+    return {
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {},
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 60 - 0
src/views/backStageManage/organization/tenant/components/dialog/vipNumDialog.vue

@@ -0,0 +1,60 @@
+<template>
+  <div>
+    <el-dialog title="查看版本数量" :visible.sync="visible" width="500px" :before-close="close">
+        <el-table border v-loading="loading" :data="tableData">
+            <el-table-column type="index" label="#" width="55" align="center">
+                <template slot-scope="scope">
+                    <span>{{ (scope.$index + 1) }}</span>
+                </template>
+            </el-table-column>
+            <el-table-column label="会员类型名称" align="center">
+                <template slot-scope="scope">
+                    <span>{{ scope.row.vipName }}</span>
+                </template>
+            </el-table-column>
+            <el-table-column label="数量" align="center">
+                <template slot-scope="scope">
+                    <span>{{ scope.row.num }}</span>
+                </template>
+            </el-table-column>
+            <el-table-column label="操作" align="center">
+                <template slot-scope="scope">
+                    <el-button type="text">修改数量</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {},
+  data() {
+    return {
+        visible:false,
+        loading:false,
+        tableData:[],
+        tenantId:null
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {
+    open(tenantId){
+        this.tenantId = tenantId
+        this.getList()
+        this.visible = true
+    },
+    getList(){},
+    close(){
+        this.visible = false
+    }
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 100 - 0
src/views/backStageManage/organization/tenant/components/tenant.vue

@@ -0,0 +1,100 @@
+<template>
+  <div class="height_100">
+    <el-container>
+        <el-header>
+            <el-form :inline="true">
+                <el-form-item label="租户名称" prop="name">
+                    <el-input v-model="queryParams.name" size="small" placeholder="请输入"></el-input>
+                </el-form-item>
+                <el-form-item>
+                    <el-button type="" size="small" @click="search">查询</el-button>
+                </el-form-item>
+            </el-form>
+        </el-header>
+        <el-main class="padding_10">
+            <el-table v-loading="loading" :data="tableData" border header-row-class-name="custom-table-header">
+                <el-table-column type="index" label="#" width="55" align="center">
+                    <template slot-scope="scope">
+                        <span>{{ (scope.$index + 1) + ((queryParams.current - 1) * queryParams.size) }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="name" label="租户名称" align="center" show-overflow-tooltip></el-table-column>
+                <el-table-column prop="contacts" label="联系人" align="center" show-overflow-tooltip></el-table-column>
+                <el-table-column prop="address" label="联系人地址" align="center" show-overflow-tooltip></el-table-column>
+                <el-table-column prop="type" label="类型" align="center" show-overflow-tooltip>
+                    <template slot-scope="scope">
+                        
+                    </template>
+                </el-table-column>
+                <el-table-column label="是否启用" align="center" show-overflow-tooltip>
+                    <template slot-scope="scope">
+                        <span v-if="scope.row.state==0">否</span>
+                        <span v-if="scope.row.state==1">是</span>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="describe" label="备注" align="center" show-overflow-tooltip></el-table-column>
+                <el-table-column label="操作"  width="150">
+                    <template slot-scope="scope">
+                        <el-button type="primary" size="mini" @click="checkVipNum(scope.row)">查看会员版本数量</el-button>
+                        <el-button type="danger" size="mini" @click="disableTenant(scope.row)">禁用</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </el-main>
+        <el-footer class="pagination">
+            <el-pagination :current-page.sync="queryParams.current" :page-size="queryParams.size" :total="total" @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
+        </el-footer>
+    </el-container>
+
+    <vipNumDialog ref="vipNumDialog"></vipNumDialog>
+  </div>
+</template>
+
+<script>
+import vipNumDialog from './dialog/vipNumDialog.vue';
+export default {
+  components: {
+    vipNumDialog
+  },
+  props: {},
+  data() {
+    return {
+        queryParams:{
+            current:1,
+            size:10,
+        },
+        total:0,
+        loading:false,
+        tableData:[],
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    getList(){},
+    search(){
+        this.queryParams.current = 1
+        this.getList()
+    },
+    //切换分页
+    handleCurrentChange(val){
+        this.queryParams.current = val
+        this.getList()
+    },
+    //查看租户会员版本数量
+    checkVipNum(row){
+        this.$refs.vipNumDialog.open(row.id)
+    },
+    //禁用租户
+    disableTenant(row){
+
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 26 - 0
src/views/backStageManage/organization/tenant/index.vue

@@ -0,0 +1,26 @@
+<template>
+  <div class="height_100">
+    <tenant></tenant>
+  </div>
+</template>
+
+<script>
+import tenant from './components/tenant.vue';
+export default {
+  components: {
+    tenant
+  },
+  props: {},
+  data() {
+    return {
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {},
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 17 - 15
src/views/home/components/downLoad/downLoad.vue

@@ -4,7 +4,7 @@
         <div>欢迎使用</div>
         <div>窍笔撰写辅助工具</div>
         <div class="downLoad">
-            <el-button round style="width:100%;color:black;font-size:16px;height:50px;font-weight:bold;" @click="submit">点击下载</el-button>
+            <el-button round style="width:100%;color:black;font-size:16px;height:50px;font-weight:bold;" @click="downLoad">点击下载</el-button>
         </div>
     </div>
     
@@ -12,11 +12,13 @@
 </template>
 
 <script>
+import { downLoad2 } from '@/utils';
 export default {
   components: {},
   props: {},
   data() {
     return {
+      btnLoading:false,
     };
   },
   watch: {},
@@ -24,21 +26,21 @@ export default {
   created() {},
   mounted() {},
   methods: {
-    submit(){
-        const anchor = document.createElement('a');
-        if ('download' in anchor) {
-            anchor.href = this.$c.downLoadURL;
-            anchor.setAttribute("download", '窍笔');
-            anchor.className = "download-js-link";
-            anchor.innerHTML = "downloading...";
-            anchor.style.display = "none";
-            document.body.appendChild(anchor);
-            setTimeout(function () {
-                anchor.click();
-                document.body.removeChild(anchor);
-            }, 66);
-            return true;
+    downLoad(){
+      var params = {
+      }
+      this.btnLoading = true
+      this.$api.queryPublicVersionLast(params).then(response=>{
+        if(response.code == 200){
+            var data = response.data
+            if(data.systemFile && data.systemFile.guid){
+              downLoad2(data.systemFile.guid,'窍笔')
+            }
+            this.btnLoading = false
         }
+      }).catch(error=>{
+          this.btnLoading = false
+      })
     },
   },
 };