Ver código fonte

Merge branch 'deploy' of chelingzhu-web/storeCheck-it-html into master

lilei 4 anos atrás
pai
commit
f5b9fb85be
52 arquivos alterados com 4517 adições e 1851 exclusões
  1. 1 1
      .env
  2. 1 1
      .env.preview
  3. 25 3
      package-lock.json
  4. 1 1
      package.json
  5. 6 6
      src/api/bannerSetting.js
  6. 5 7
      src/api/editionSetting.js
  7. 89 0
      src/api/evaluationItem.js
  8. 92 0
      src/api/evaluationPlan.js
  9. 3 3
      src/api/menu.js
  10. 51 10
      src/api/tenants.js
  11. 3 3
      src/components/Table/index.js
  12. 3 4
      src/components/UploadFile/index.vue
  13. 18 0
      src/components/global.less
  14. 1 1
      src/config/defaultSettings.js
  15. 67 25
      src/config/router.config.js
  16. 1 1
      src/core/directives/hasPermission.js
  17. 22 18
      src/main.js
  18. 1 0
      src/permission.js
  19. 26 22
      src/utils/request.js
  20. 184 165
      src/views/appSetting/addEditionSetting.vue
  21. 376 313
      src/views/appSetting/bannerSetting.vue
  22. 108 104
      src/views/appSetting/editionSetting.vue
  23. 24 13
      src/views/bnSetting/menu/adminMenus.vue
  24. 35 32
      src/views/bnSetting/menu/childModal.vue
  25. 36 25
      src/views/bnSetting/menu/storeMenus.vue
  26. 6 12
      src/views/bnSetting/menusAuth.vue
  27. 20 20
      src/views/bnSetting/menusAuthTab.vue
  28. 173 0
      src/views/evaluation/evaluationItem/AddEvaIndexModal.vue
  29. 213 0
      src/views/evaluation/evaluationItem/AddEvaItemModal.vue
  30. 265 0
      src/views/evaluation/evaluationItem/EvaluationItem.vue
  31. 172 0
      src/views/evaluation/evaluationItem/SetEvaItemModal.vue
  32. 253 0
      src/views/evaluation/evaluationPlan/AddEvaModal.vue
  33. 317 0
      src/views/evaluation/evaluationPlan/EvaluationPlan.vue
  34. 244 0
      src/views/evaluation/evaluationPlan/SetEvaDefaultModal.vue
  35. 393 0
      src/views/evaluation/evaluationPlan/SetEvaModal.vue
  36. 16 18
      src/views/power/OperateJournal/OperateJournal.vue
  37. 54 34
      src/views/power/dataDictionary/codeItemModal.vue
  38. 28 22
      src/views/power/dataDictionary/codeModal.vue
  39. 279 277
      src/views/power/dataDictionary/dataDictionary.vue
  40. 16 16
      src/views/power/job/jobs.vue
  41. 25 25
      src/views/power/menu/childModal.vue
  42. 24 13
      src/views/power/menu/menu.vue
  43. 27 14
      src/views/power/register/register.vue
  44. 9 33
      src/views/power/role/menuModal.vue
  45. 119 79
      src/views/power/role/roleList.vue
  46. 24 22
      src/views/power/role/roleModal.vue
  47. 135 95
      src/views/power/user/userList.vue
  48. 34 28
      src/views/power/user/userModal.vue
  49. 159 187
      src/views/tenants/tenantsList.vue
  50. 323 196
      src/views/tenants/tenantsModal.vue
  51. 8 0
      src/views/user/Login.vue
  52. 2 2
      vue.config.js

+ 1 - 1
.env

@@ -1,5 +1,5 @@
 NODE_ENV=production
 VUE_APP_PREVIEW=false
-VUE_APP_API_BASE_URL=https://it.zyucgj.com/zyit/
+VUE_APP_API_BASE_URL=https://aitour-it.zyucgj.com/at-it
 VUE_APP_VERSION=V1.0.1
 VUE_APP_PRO_NAME=智能巡店IT后台

+ 1 - 1
.env.preview

@@ -1,5 +1,5 @@
 NODE_ENV=production
 VUE_APP_PREVIEW=true
-VUE_APP_API_BASE_URL=http://it.test.zyucgj.com/zyit
+VUE_APP_API_BASE_URL=https://aitour-it.test.zyucgj.com/at-it
 VUE_APP_VERSION=V1.0.1
 VUE_APP_PRO_NAME=智能巡店IT后台-pro

+ 25 - 3
package-lock.json

@@ -1148,6 +1148,22 @@
       "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==",
       "dev": true
     },
+    "@simonwep/pickr": {
+      "version": "1.7.4",
+      "resolved": "https://registry.npmjs.org/@simonwep/pickr/-/pickr-1.7.4.tgz",
+      "integrity": "sha512-fq7jgKJT21uWGC1mARBHvvd1JYlEf93o7SuVOB4Lr0x/2UPuNC9Oe9n/GzVeg4oVtqMDfh1wIEJpsdOJEZb+3g==",
+      "requires": {
+        "core-js": "^3.6.5",
+        "nanopop": "^2.1.0"
+      },
+      "dependencies": {
+        "core-js": {
+          "version": "3.6.5",
+          "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz",
+          "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA=="
+        }
+      }
+    },
     "@soda/friendly-errors-webpack-plugin": {
       "version": "1.7.1",
       "resolved": "https://registry.npmjs.org/@soda/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.7.1.tgz",
@@ -2313,12 +2329,13 @@
       "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4="
     },
     "ant-design-vue": {
-      "version": "1.5.2",
-      "resolved": "https://registry.npmjs.org/ant-design-vue/-/ant-design-vue-1.5.2.tgz",
-      "integrity": "sha512-DmlOl+ld4hSQdEG1c2wAV+v9/Bl2aG+wBEnd1GJYV0LeOXaSrBGiIkZrmUrTrUL92yBdFO+OF25aFNb0UFMZOA==",
+      "version": "1.6.5",
+      "resolved": "https://registry.npmjs.org/ant-design-vue/-/ant-design-vue-1.6.5.tgz",
+      "integrity": "sha512-FzLrK+JuJUq+g4vd+UjFFi13ZdSsb11EZFapisFXilJxpc1LxqyunZu5AP4nr9vFLs3J4UX2A6q+Rp/Fi6JrLg==",
       "requires": {
         "@ant-design/icons": "^2.1.1",
         "@ant-design/icons-vue": "^2.0.0",
+        "@simonwep/pickr": "~1.7.0",
         "add-dom-event-listener": "^1.0.2",
         "array-tree-filter": "^2.1.0",
         "async-validator": "^3.0.3",
@@ -11878,6 +11895,11 @@
         }
       }
     },
+    "nanopop": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/nanopop/-/nanopop-2.1.0.tgz",
+      "integrity": "sha512-jGTwpFRexSH+fxappnGQtN9dspgE2ipa1aOjtR24igG0pv6JCxImIAmrLRHX+zUF5+1wtsFVbKyfP51kIGAVNw=="
+    },
     "natural-compare": {
       "version": "1.4.0",
       "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",

+ 1 - 1
package.json

@@ -15,7 +15,7 @@
   },
   "dependencies": {
     "@antv/data-set": "^0.10.2",
-    "ant-design-vue": "^1.5.2",
+    "ant-design-vue": "^1.6.5",
     "axios": "^0.19.0",
     "core-js": "2.6.9",
     "enquire.js": "^2.1.6",

+ 6 - 6
src/api/bannerSetting.js

@@ -2,17 +2,17 @@ import { axios } from '@/utils/request'
 
 // 列表查询
 export const getBannerSettingList = (params) => {
-  const url = `/zycar-mgr/banner/query`
+  const url = `banner/query`
   return axios({
     url: url,
-    data: {bannerType:params.bannerType},
+    data: params,
     method: 'post'
   })
 }
 
 // 更改状态
 export const changeStatus = (params) => {
-  const url = `/zycar-mgr/banner/enable/${params.id}/${params.flag}`
+  const url = `banner/enable/${params.id}/${params.flag}`
   return axios({
     url: url,
     data: {},
@@ -22,7 +22,7 @@ export const changeStatus = (params) => {
 
 // 确认保存
 export const saveItem = (params) => {
-  const url = `/zycar-mgr/banner/save`
+  const url = `banner/save`
   return axios({
     url: url,
     data: params,
@@ -32,10 +32,10 @@ export const saveItem = (params) => {
 
 // 删除
 export const deleteItem = (params) => {
-  const url = `/zycar-mgr/banner/del/${params.id}`
+  const url = `banner/del/${params.id}`
   return axios({
     url: url,
     data: {},
     method: 'get'
   })
-}
+}

+ 5 - 7
src/api/editionSetting.js

@@ -2,21 +2,19 @@ import { axios } from '@/utils/request'
 
 // 列表查询
 export const getEditionSettingList = (params) => {
-  const url = `/zycar-mgr/sysVersion/query/${params.pageNo}/${params.pageSize}`
+  const url = `version/query/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
     url: url,
-    data: {applyCode:params.applyCode},
+    data: params,
     method: 'post'
   })
 }
 
-
-
 // 新建保存
 export const saveItem = (params) => {
-  const url = `/zycar-mgr/sysVersion/save`
+  const url = `version/save`
   return axios({
     url: url,
     data: params,
@@ -26,10 +24,10 @@ export const saveItem = (params) => {
 
 // 根据id查询
 export const editItem = (params) => {
-  const url = `/zycar-mgr/sysVersion/${params.id}`
+  const url = `version/${params.id}`
   return axios({
     url: url,
     data: params,
     method: 'get'
   })
-}
+}

+ 89 - 0
src/api/evaluationItem.js

@@ -0,0 +1,89 @@
+import { axios } from '@/utils/request'
+
+// 列表分页查询
+export const getItemListByPage = (params) => {
+  const url = `/assess/item/query/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 列表查询 (不带分页)
+export const getItemList = (params) => {
+  const url = `/assess/item/queryList`
+  return axios({
+    url: url,
+    data: {},
+    method: 'post'
+  })
+}
+// 保存考评项目
+export const itemSave = (params) => {
+  return axios({
+    url: '/assess/item/save',
+    data: params,
+    method: 'post'
+  })
+}
+// 考评项目启删除
+export const itemDelete = (params) => {
+  return axios({
+    url: `/assess/item/delete/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 考评项目启禁用
+export const itemEnable = (params) => {
+  return axios({
+    url: `/assess/item/enable/${params.id}/${params.status}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 考评项目详情
+export const itemDetail = (params) => {
+  return axios({
+    url: `/assess/item/find/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}
+/**
+ * 考评指标管理
+ */
+// 考评指标列表查询
+export const itemIndexQuery = (params) => {
+  return axios({
+    url: `/assess/target/query`,
+    data: params,
+    method: 'post'
+  })
+}
+// 考评指标删除
+export const itemIndexDelete = (params) => {
+  return axios({
+    url: `/assess/target/delete/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 考评指标详情
+export const itemIndexDetail = (params) => {
+  return axios({
+    url: `/assess/target/find/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 考评指标保存
+export const itemIndexSave = (params) => {
+  return axios({
+    url: `/assess/target/save`,
+    data: params,
+    method: 'post'
+  })
+}

+ 92 - 0
src/api/evaluationPlan.js

@@ -0,0 +1,92 @@
+import { axios } from '@/utils/request'
+
+// 列表分页查询
+export const planQueryByPage = (params) => {
+  const url = `/assess/scheme/query/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 列表查询 (不带分页)
+export const planQuery = (params) => {
+  const url = `/assess/scheme/queryList`
+  return axios({
+    url: url,
+    data: {},
+    method: 'post'
+  })
+}
+// 保存考评项目
+export const planSave = (params) => {
+  return axios({
+    url: '/assess/scheme/save',
+    data: params,
+    method: 'post'
+  })
+}
+// 删除
+export const planDelete = (params) => {
+  return axios({
+    url: `/assess/scheme/delete/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 启禁用
+export const planEnable = (params) => {
+  return axios({
+    url: `/assess/scheme/enable/${params.id}/${params.status}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 考评方案详情
+export const planDetail = (params) => {
+  return axios({
+    url: `/assess/scheme/find/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}
+/**
+ * 为考评方案选择项目
+ */
+// 考评方案包含项目查询
+export const planItemQuery = (params) => {
+  return axios({
+    url: `/assess/scheme/item/query`,
+    data: params,
+    method: 'post'
+  })
+}
+// 保存考评方案项目
+export const planItemSave = (params) => {
+  return axios({
+    url: `/assess/scheme/item/save`,
+    data: params,
+    method: 'post'
+  })
+}
+/**
+ * 设置默认方案
+ */
+// 默认考评配置查询
+export const planDefaultQuery = (params) => {
+  return axios({
+    url: `/assess/default/query`,
+    data: {},
+    method: 'post'
+  })
+}
+// 保存默认考评配置
+export const planDefaultSave = (params) => {
+  return axios({
+    url: `/assess/default/save`,
+    data: params,
+    method: 'post'
+  })
+}

+ 3 - 3
src/api/menu.js

@@ -31,7 +31,7 @@ export const deleteMenu = params => {
 
 // 获取门店菜单树数据
 export const getMdMenuList = params => {
-  const url = `/mdmenu/findAll`
+  const url = `/ddmenu/findAll`
   return axios({
     url: url,
     data: params,
@@ -41,7 +41,7 @@ export const getMdMenuList = params => {
 
 // 门店菜单保存
 export const saveMdMenu = params => {
-  const url = `/mdmenu/save`
+  const url = `/ddmenu/save`
   return axios({
     url: url,
     data: params,
@@ -50,7 +50,7 @@ export const saveMdMenu = params => {
 }
 // 门店菜单删除
 export const deleteMdMenu = params => {
-  const url = `/mdmenu/delete/${params.id}`
+  const url = `/ddmenu/delete/${params.id}`
   return axios({
     url: url,
     method: 'get'

+ 51 - 10
src/api/tenants.js

@@ -1,8 +1,8 @@
 import { axios } from '@/utils/request'
 
-// 获取列表数据
+// 获取列表数据  atcompany/query/{pageNo}/{pageSize}
 export const getTenantsList = params => {
-  const url = `/org/apply/queryLike/${params.pageNo}/${params.pageSize}`
+  const url = `/atcompany/query/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -12,20 +12,61 @@ export const getTenantsList = params => {
   })
 }
 
-// 启用禁用
-export const enable = params => {
+// 删除
+export const tenantsDelete = params => {
   return axios({
-    url: '/org/apply/enable',
-    data: params,
-    method: 'POST'
+    url: `/atcompany/delete/${params.id}`,
+    data: {},
+    method: 'get'
+  })
+}
+// 查详情
+export const tenantsDetail = params => {
+  return axios({
+    url: `/atcompany/findById/${params.id}`,
+    data: {},
+    method: 'get'
   })
 }
 
-// 授权
-export const saveAuth = params => {
+// 保存
+export const tenantsSave = params => {
   return axios({
-    url: '/org/apply/auth',
+    url: '/atcompany/save',
     data: params,
     method: 'POST'
   })
 }
+// 查询省
+export const getProvince = () => {
+  return axios({
+    url: `/area/PROVINCE`,
+    headers: {
+      'USER-TERM-TYPE': 'pc',
+      'App-Type': 2
+    },
+    method: 'get'
+  })
+}
+// 查询市
+export const getCityByPro = params => {
+  return axios({
+    url: `/area/CITY/${params.id}`,
+    headers: {
+      'USER-TERM-TYPE': 'pc',
+      'App-Type': 2
+    },
+    method: 'get'
+  })
+}
+// 查询区
+export const getDistrictByCity = params => {
+  return axios({
+    url: `/area/DISTRICT/${params.id}`,
+    headers: {
+      'USER-TERM-TYPE': 'pc',
+      'App-Type': 2
+    },
+    method: 'get'
+  })
+}

+ 3 - 3
src/components/Table/index.js

@@ -155,11 +155,11 @@ export default {
       // eslint-disable-next-line
       if ((typeof result === 'object' || typeof result === 'function') && typeof result.then === 'function') {
         result.then(r => {
-          let list = r.list || r.data || r
-          console.log(r,'rrrrrrrrrr')
+          const list = r.list || r.data || r
+          console.log(r, 'rrrrrrrrrr')
           this.localPagination = this.showPagination && Object.assign({}, this.localPagination, {
             current: r.pageNo, // 返回结果中的当前分页数
-            total: r.count, // 返回结果中的总记录数
+            total: Number(r.count), // 返回结果中的总记录数
             showSizeChanger: this.showSizeChanger,
             pageSize: (pagination && pagination.pageSize) ||
               this.localPagination.pageSize

+ 3 - 4
src/components/UploadFile/index.vue

@@ -7,7 +7,6 @@
       @preview="handlePreview"
       @change="handleChange"
       :beforeUpload="beforeUpload"
-      :preview-file="previewFile"
       :data="params"
       :value="comVal"
     >
@@ -116,7 +115,7 @@ export default {
       if (this.listType == 'text') {
         return
       }
-      console.log(file,'8888888888')
+      console.log(file, '8888888888')
       this.previewImage = file.url || file.thumbUrl
       // this.previewImage = file.response.data
       this.previewVisible = true
@@ -172,9 +171,9 @@ export default {
 
       // 文件大小
       const isLt2M = file.size / 1024 / 1024 < this.fileSize
-      if (!isLt2M ) {
+      if (!isLt2M) {
         if (tip != 0) {
-          if (this.fileType !='video/mp4') {
+          if (this.fileType != 'video/mp4') {
             this.$message.error('图片不能超过 ' + this.fileSize + 'MB!')
           } else {
             this.$message.error('视频不能超过 ' + this.fileSize + 'MB!')

+ 18 - 0
src/components/global.less

@@ -501,3 +501,21 @@ body {
     }
   }
 }
+
+/* 表格操作按钮样式 */
+  td .actionBtn {
+    font-size: 20px;
+    padding: 0 10px;
+  }
+  td .icon-blues {
+  	color: #1890FF;
+  }
+  td .icon-green {
+  	color: #16b50e;
+  }
+  td .icon-red {
+  	color: red;
+  }
+  td .icon-orange {
+  	color: #ffaa00;
+  }

+ 1 - 1
src/config/defaultSettings.js

@@ -14,7 +14,7 @@
  */
 
 export default {
-  primaryColor: '#52C41A', // primary color of ant design
+  primaryColor: '#1890FF', // primary color of ant design
   navTheme: 'dark', // theme for nav menu
   layout: 'sidemenu', // nav menu position: sidemenu or topmenu
   contentWidth: 'Fixed', // layout of content: Fluid or Fixed, only works when layout is topmenu

+ 67 - 25
src/config/router.config.js

@@ -3,7 +3,6 @@ import {
   UserLayout,
   BasicLayout,
   RouteView,
-  BlankLayout,
   PageView
 } from '@/layouts'
 
@@ -12,7 +11,7 @@ export const asyncRouterMap = [{
   name: 'index',
   component: BasicLayout,
   meta: {
-    title: '首页'
+    title: 'IT后台'
   },
   redirect: '/home',
   children: [{
@@ -32,21 +31,21 @@ export const asyncRouterMap = [{
       meta: {
         title: '首页',
         icon: 'home',
-        hidden: true
-      }
-    },
-    {
-      path: '/changePwd',
-      name: 'changePwd',
-      component: () => import(/* webpackChunkName: "home" */ '@/views/user/ChangePwd'),
-      meta: {
-        title: '修改密码',
-        icon: 'home',
-        hidden: true
+        hiddenHeaderContent: true
       }
     }
     ]
   },
+  {
+    path: '/changePwd',
+    name: 'changePwd',
+    hidden: true,
+    component: () => import(/* webpackChunkName: "changePwd" */ '@/views/user/ChangePwd'),
+    meta: {
+      title: '修改密码',
+      icon: 'home'
+    }
+  },
   {
     path: '/tenants',
     redirect: '/tenants/list',
@@ -67,6 +66,38 @@ export const asyncRouterMap = [{
       }
     }]
   },
+  // 考评管理
+  {
+    path: '/evaluation',
+    redirect: '/evaluation/evaluationItem',
+    component: PageView,
+    meta: {
+      title: '考评管理',
+      icon: 'block',
+      permission: 'M_evaluation_0'
+    },
+    children: [{
+      path: '/evaluation/evaluationItem',
+      name: 'EvaluationItem',
+      component: () => import(/* webpackChunkName: "evaluation" */
+        '@/views/evaluation/evaluationItem/EvaluationItem.vue'),
+      meta: {
+        title: '考评项目',
+        icon: 'save',
+        permission: 'M_evaluationItem_list'
+      }
+    }, {
+      path: '/evaluation/evaluationPlan',
+      name: 'EvaluationPlan',
+      component: () => import(/* webpackChunkName: "evaluation" */
+        '@/views/evaluation/evaluationPlan/EvaluationPlan.vue'),
+      meta: {
+        title: '考评方案',
+        icon: 'switcher',
+        permission: 'M_evaluationPlan_list'
+      }
+    }]
+  },
   // 业务 设置setting
   {
     path: '/bnSetting',
@@ -124,7 +155,7 @@ export const asyncRouterMap = [{
         component: () => import(/* webpackChunkName: "appSetting" */
           '@/views/appSetting/editionSetting.vue'),
         meta: {
-          title: '版本设置列表',
+          title: '列表',
           icon: 'interaction',
           permission: 'M_banben'
         }
@@ -139,6 +170,17 @@ export const asyncRouterMap = [{
           icon: 'crown',
           hidden: true
         }
+      },
+      {
+        path: '/editionSetting/add',
+        name: 'editionSetting_edit',
+        component: () => import(/* webpackChunkName: "appSetting" */
+          '@/views/appSetting/addEditionSetting.vue'),
+        meta: {
+          title: '编辑',
+          icon: 'crown',
+          hidden: true
+        }
       }
       ]
     }
@@ -159,7 +201,7 @@ export const asyncRouterMap = [{
       name: 'storeMenus',
       component: () => import(/* webpackChunkName: "bnSetting" */ '@/views/bnSetting/menu/storeMenus.vue'),
       meta: {
-        title: '店菜单管理',
+        title: '店菜单管理',
         icon: 'shop',
         permission: 'M_menusAuth_storeMenus'
       }
@@ -238,16 +280,16 @@ export const asyncRouterMap = [{
         permission: 'M_sys_dataDictionary'
       }
     },
-    {
-      path: '/setting/register',
-      name: 'powerRegister',
-      component: () => import(/* webpackChunkName: "setting" */ '@/views/power/register/register.vue'),
-      meta: {
-        title: '参数管理',
-        icon: 'key',
-        permission: 'M_sys_register'
-      }
-    },
+    // {
+    //   path: '/setting/register',
+    //   name: 'powerRegister',
+    //   component: () => import(/* webpackChunkName: "setting" */ '@/views/power/register/register.vue'),
+    //   meta: {
+    //     title: '参数管理',
+    //     icon: 'key'
+    //     // permission: 'M_sys_register'
+    //   }
+    // },
     // {
     //   path: '/setting/jobs',
     //   name: 'powerJobs',

+ 1 - 1
src/core/directives/hasPermission.js

@@ -5,7 +5,7 @@ import store from '@/store'
  * hasPermission 权限指令
  * 指令用法:
  *  - 在需要控制 hasPermission 级别权限的组件上使用 v-hasPermission:[method] , 如下:
- *    <i-button v-hasPermission:add >添加用户</a-button>
+ *    <i-button v-hasPermission:add >新增用户</a-button>
  *    <a-button v-hasPermission:delete>删除用户</a-button>
  *    <a v-hasPermission:edit @click="edit(record)">修改</a>
  *

+ 22 - 18
src/main.js

@@ -8,39 +8,43 @@ import store from './store/'
 import { VueAxios } from './utils/request'
 
 // mock
-//import './mock'
+// import './mock'
 
 import bootstrap from './core/bootstrap'
 import './core/use'
 import './permission' // permission control
-import './utils/filter' // global filter
+import './utils/filter'
+
+import VueCookies from 'vue-cookies' // global filter
 
 Vue.config.productionTip = false
 
 // mount axios Vue.$http and this.$http
 Vue.use(VueAxios)
-
-import VueCookies from 'vue-cookies'
 Vue.use(VueCookies)
 Vue.$cookies.config('7d')
 /**
  * 权限检查
  */
 Vue.prototype.$hasPermissions = function (value) {
- let isExist = false;
- const roles = store.getters.roles
- const permissionList = roles.permissionList
- //console.log(permissionsStr,'permissionsStr')
- if (permissionList == undefined || permissionList == null) {
-  return false;
- }
- let has = permissionList.find(item => {
-   return item == value
- })
- if (has) {
-  isExist = true;
- }
- return isExist;
+  let isExist = false
+  const roles = store.getters.roles
+  const permissionList = roles.permissionList
+  // console.log(permissionsStr,'permissionsStr')
+  if (permissionList == undefined || permissionList == null) {
+    return false
+  }
+  const has = permissionList.find(item => {
+    return item == value
+  })
+  if (has) {
+    isExist = true
+  }
+  return isExist
+}
+// 禁止输入框输入空格,换行符,<,>
+Vue.prototype.$filterEmpty = function (e) {
+  return e.target.value.replace(/\s|\r\n|\n|<|>/g, '')
 }
 new Vue({
   router,

+ 1 - 0
src/permission.js

@@ -10,6 +10,7 @@ import { ACCESS_TOKEN } from '@/store/mutation-types'
 
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
+// const whiteList = ['login', 'register', 'registerResult', 'EvaluationPlan', 'EvaluationItem', 'tenantsList'] // no redirect whitelist
 const whiteList = ['login', 'register', 'registerResult'] // no redirect whitelist
 const defaultRoutePath = '/home'
 

+ 26 - 22
src/utils/request.js

@@ -40,7 +40,7 @@ service.interceptors.request.use(config => {
   const token = store.getters.token
   config.headers['App-Type'] = 9 // 平台类型
   if (token) {
-    config.headers['authorization'] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
+    config.headers['access-token'] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
   }
   return config
 }, err)
@@ -48,27 +48,31 @@ service.interceptors.request.use(config => {
 // response interceptor
 service.interceptors.response.use((response) => {
   console.log(response, 'response.data.status')
-  const et = sessionStorage.getItem('errorTips')
-  if (response.data.status == '1001' && !et) {
-    sessionStorage.setItem('errorTips', 1)
-    modal.destroyAll()
-    modal.error({
-      title: '提示',
-      content: response.data.message,
-      onOk () {
-        sessionStorage.setItem('errorTips', 0)
-        store.dispatch('Logout').then(() => {
-          window.location.reload()
-        })
-      }
-    })
-  }
-  if ((response.data.status == '401' || response.data.status == '900' || response.data.status == '500') && window.location.pathname != '/user/login') {
-    notification.destroy()
-    notification.error({
-      message: '提示',
-      description: response.data.message
-    })
+  if (window.location.pathname != '/user/login') {
+    if (response.data.status == '500' || response.data.status == '900') {
+      notification.destroy()
+      notification.error({
+        message: '提示',
+        description: response.data.message
+      })
+    }
+    const et = sessionStorage.getItem('errorTips')
+    if (response.data.status.length == 4 && !et) {
+      sessionStorage.setItem('errorTips', 1)
+      modal.destroyAll()
+      modal.error({
+        title: '提示',
+        content: response.data.message,
+        onOk () {
+          sessionStorage.setItem('errorTips', 0)
+          if (['1001', '1002', '1006', '1099', '1100', '9000'].indexOf(response.data.status) >= 0) {
+            store.dispatch('Logout').then(() => {
+              window.location.reload()
+            })
+          }
+        }
+      })
+    }
   }
   return response.data
 }, err)

+ 184 - 165
src/views/appSetting/addEditionSetting.vue

@@ -1,154 +1,147 @@
 <template>
   <div class="addPage">
-     <div class="formBox">
-       <a-form :form="form" @submit="handleSubmit">
-          <a-row>
-              <a-col :span="24">
-                 <a-form-item
-                   :label-col="formItemLayout.labelCol"
-                   :wrapper-col="formItemLayout.wrapperCol"
-                   label="版本号"
-                 >
-                  <a-input
-                    v-decorator="[
-                      'formData.version',
-                      { initialValue: formData.version,
-                        rules: [{ required: true, message: '请输入版本号' }]
-                      },
-                    ]"
-                    placeholder="请输入版本号"
-                  /> 
-                 </a-form-item>
-             </a-col>
-             <a-col :span="24">
-                 <a-form-item
-                   :label-col="formItemLayout.labelCol"
-                   :wrapper-col="formItemLayout.wrapperCol"
-                   label="请选择更新时间"
-                 >
-                   <a-date-picker
-                      show-time
-                      placeholder="年/月/日 时/分/秒"
-                      v-decorator="[
-                        'formData.updateDate',
-                        { initialValue: formData.updateDate,
-                          rules: [{required: true, message: '请选择更新时间!' }] },
-                      ]" />
-                 </a-form-item>
-             </a-col>
-             <a-col :span="24">
-                 <a-form-item
-                   :label-col="formItemLayout.labelCol"
-                   :wrapper-col="formItemLayout.wrapperCol"
-                   label="强制升级"
-                 >
-                    <a-radio-group
-                      name="radioGroup"
-                      @change="onChange"
-                      v-decorator="[
-                        'formData.forceUpgrade',
-                        {
-                          initialValue: formData.forceUpgrade,
-                          rules: [{ required: true, type: 'number', message: '请选择是否强制升级!' }] },
-                      ]"
-                    >
-                      <a-radio :value="1">是</a-radio>
-                      <a-radio :value="0">否</a-radio>
-                    </a-radio-group>
-                 </a-form-item>
-             </a-col>
-             <a-col :span="24">
-              <a-form-item
-                :label-col="formItemLayout.labelCol"
-                :wrapper-col="formItemLayout.wrapperCol"
-                label="下载链接"
-              >
-                <a-input
+    <div class="formBox">
+      <a-form :form="form" @submit="handleSubmit">
+        <a-row>
+          <a-col :span="24">
+            <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="版本号">
+              <a-input
+                v-decorator="[
+                  'formData.version',
+                  { initialValue: formData.version,getValueFromEvent: $filterEmpty,
+                    rules: [{ required: true, message: '请输入(0~999999)之间的版本号' }]
+                  },
+                ]"
+                oninput="if(value.length>6)value=value.slice(0,6);if(value<0)value=0"
+                id="addEditionSetting-version"
+                placeholder="请输入(0~999999)之间的版本号"
+                allowClear
+                type="number" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="请选择更新时间">
+              <a-date-picker
+                show-time
+                id="addEditionSetting-publicDate"
+                placeholder="年/月/日 时/分/秒"
+                :disabled-date="disabledDate"
+                v-decorator="['formData.publicDate', { initialValue: formData.publicDate, rules: [{ required: true, message: '请选择更新时间!' }] }]" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="强制升级">
+              <a-radio-group
+                name="radioGroup"
+                id="addEditionSetting-forceUpgrade"
+                @change="onChange"
+                v-decorator="[
+                  'formData.forceUpgrade',
+                  {
+                    initialValue: formData.forceUpgrade,
+                    rules: [{ required: true, type: 'number', message: '请选择是否强制升级!' }] },
+                ]">
+                <a-radio :value="1">是</a-radio>
+                <a-radio :value="0">否</a-radio>
+              </a-radio-group>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="下载链接">
+              <a-textarea
+                :maxLength="300"
+                v-decorator="[
+                  'formData.downloadUrl',
+                  { initialValue: formData.downloadUrl,getValueFromEvent: $filterEmpty,
+                    rules: [{ message: '请输入下载链接(最长为300字符)' }]
+                  },
+                ]"
+                id="addEditionSetting-downloadUrl"
+                placeholder="请输入下载链接(最长为300字符)"
+                allowClear />
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="升级内容">
+              <a-textarea
+                placeholder="请输入升级内容(最多500个字符)"
+                :maxLength="500"
+                id="addEditionSetting-upgradeContent"
+                auto-size
+                v-decorator="[
+                  'formData.upgradeContent',
+                  { initialValue: formData.upgradeContent,getValueFromEvent: $filterEmpty,
+                    rules: [{ required: true, message: '请输入升级内容(最多500个字符)' }]
+                  },
+                ]" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="24">
+            <a-form-item label="附件" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+              <div style="display: block;">
+                <Upload
+                  ref="upfile"
+                  id="addEditionSetting-attachment"
+                  :maxNums="1"
+                  :fileSize="100"
                   v-decorator="[
-                    'formData.downloadUrl',
-                    { initialValue: formData.downloadUrl,
-                      rules: [{ message: '请输入下载链接' }]
+                    'formData.attachment',
+                    { initialValue: formData.attachment,
+                      rules: [{ required: true, message: '请上传app安装文件' }]
                     },
                   ]"
-                  placeholder="请输入下载链接"
-                />
-              </a-form-item> 
-             </a-col>
-              <a-col :span="24">
-               <a-form-item
-                 :label-col="formItemLayout.labelCol"
-                 :wrapper-col="formItemLayout.wrapperCol"
-                 label="升级内容"
-               >
-                
-                 <a-textarea placeholder="请输入升级内容" auto-size  
-                 v-decorator="[
-                     'formData.upgradeContent',
-                     { initialValue: formData.upgradeContent,
-                       rules: [{ required: true, message: '请输入升级内容' }]
-                     },
-                   ]"
-                   />
-               </a-form-item> 
-              </a-col>
-           </a-row>
-           <a-row>
-             <a-col :span="24">
-               <a-form-item
-                 label="附件"
-                 :label-col="formItemLayout.labelCol"
-                 :wrapper-col="formItemLayout.wrapperCol"
-                 >
-                 <div style="display: block;">
-                   <Upload
-                     ref="upfile"
-                     :maxNums="1"
-                     :fileSize="100"
-                     v-decorator="[
-                         'formData.attachment',
-                         { initialValue: formData.attachment,
-                           rules: [{ required: true, message: '请上传app安装文件' }]
-                         },
-                       ]"
-                     fileType="application/vnd.android.package-archive"
-                     upText="附件上传">
-                   </Upload>
-                 </div>
-                 <div style="line-height: 16px;clear: both;padding-top: 10px;color: #999;">(上传apk格式文件)</div>
-               </a-form-item>
-             </a-col>
-           </a-row>
-           <a-form-item :label-col="formTailLayout.labelCol" :wrapper-col="formTailLayout.wrapperCol">
-             <a-button htmlType="submit" type="primary">
-               保存
-             </a-button>
-             <a-button style="margin-left: 20px;" @click="cansel">
-               返回列表
-             </a-button>
-           </a-form-item>
-         </a-form>
-     </div>
+                  fileType="application/vnd.android.package-archive"
+                  upText="附件上传">
+                </Upload>
+              </div>
+              <div style="line-height: 16px;clear: both;padding-top: 10px;color: #999;">(上传apk格式文件)</div>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-form-item :label-col="formTailLayout.labelCol" :wrapper-col="formTailLayout.wrapperCol">
+          <a-button htmlType="submit" type="primary" id="addEditionSetting-submit">
+            保存
+          </a-button>
+          <a-button style="margin-left: 20px;" @click="cansel" id="addEditionSetting-cansel">
+            取消
+          </a-button>
+        </a-form-item>
+      </a-form>
+    </div>
   </div>
 </template>
 
 <script>
-import { Upload } from '@/components'
-import { saveItem,editItem} from '@/api/editionSetting.js'
+import {
+  Upload
+} from '@/components'
+import {
+  saveItem,
+  editItem
+} from '@/api/editionSetting.js'
 import moment from 'moment'
 
 const formItemLayout = {
-            labelCol: { span: 3 },
-            wrapperCol: { span: 6 },
-          };
+  labelCol: {
+    span: 3
+  },
+  wrapperCol: {
+    span: 6
+  }
+}
 const formTailLayout = {
-  wrapperCol: {offset: 5 },
-};
+  wrapperCol: {
+    offset: 5
+  }
+}
 export default {
   name: 'AddeditionSetting',
   components: {
     Upload
   },
- 
+
   data () {
     return {
       formItemLayout,
@@ -156,59 +149,85 @@ export default {
       form: this.$form.createForm(this),
       formData: {
         version: '',
-        updateDate: null,
+        publicDate: null,
         downloadUrl: '',
         forceUpgrade: '0',
-        upgradeContent:'',
-        attachment:''
+        upgradeContent: '',
+        attachment: ''
       },
-      applyName:'IT后台',
-      applyCode:'zyit',
-      mode1:'time',
+      applyName: 'IT后台',
+      applyCode: 'atit',
+      mode1: 'time'
     }
   },
   methods: {
+    moment,
+    // 禁止当前之前的日期选择
+    range (start, end) {
+      const result = []
+      for (let i = start; i < end; i++) {
+        result.push(i)
+      }
+      return result
+    },
+
+    disabledDate (current) {
+      // Can not select days before today and today
+      return current && current < moment().subtract(1, 'days')
+    },
+    // disabledDateTime () {
+    //   return {
+    //     disabledHours: () => this.range(0, moment().hour()),
+    //     disabledMinutes: () => this.range(0, moment().minute()),
+    //     disabledSeconds: () => this.range(0, moment().second())
+    //   }
+    // },
     // 保存
     handleSubmit (e) {
       e.preventDefault()
       const _this = this
       this.form.validateFields((err, values) => {
         if (!err) {
-          let query = this.$route.query
-          console.log(this.formData, values.formData,{applyName:'IT后台', applyCode:'zyit'})
-          const formData = Object.assign({}, this.formData, values.formData,{applyName:'IT后台'},{applyCode:'zyit'})
-          formData.updateDate = formData.updateDate.format('YYYY-MM-DD HH:mm:ss')
-          console.log(formData)
+          const query = this.$route.query
+          const formData = Object.assign({}, this.formData, values.formData, {
+            applyName: 'IT后台'
+          }, {
+            applyCode: 'atit'
+          })
+          formData.publicDate = formData.publicDate.format('YYYY-MM-DD HH:mm:ss')
           saveItem(formData).then(res => {
-            console.log(res, 'rrrrrrrrr')
+            // console.log(res, 'rrrrrrrrr')
             if (res.status == 200) {
               _this.$message.success(res.message ? res.message : '保存成功')
-              _this.$router.push({ name: 'editionSetting_list' })
+              _this.$router.push({
+                name: 'editionSetting_list'
+              })
             } else {
               _this.$message.error(res.message)
             }
-            
           })
         }
       })
     },
     // 返回列表
-    cansel() {
-      this.$router.push({ name: 'editionSetting_list' })
+    cansel () {
+      this.$router.push({
+        name: 'editionSetting_list'
+      })
     },
     // 选择时间
-    handleOpenChange1(open) {
+    handleOpenChange1 (open) {
       console.log(open)
       if (open) {
-        this.mode1 = 'time';
+        this.mode1 = 'time'
       }
     },
     // 改变默认选项
-    onChange(e){
-      console.log('radio checked', e.target.value);
+    onChange (e) {
+      console.log('radio checked', e.target.value)
     }
   },
-  
+
   beforeRouteEnter (to, from, next) {
     next(vm => {
       console.log(111)
@@ -224,7 +243,7 @@ export default {
             const page = res.data
             vm.formData = Object.assign(vm.formData, page)
             vm.formData.forceUpgrade = Number(vm.formData.forceUpgrade)
-            vm.formData.updateDate = moment(vm.formData.updateDate)
+            vm.formData.publicDate = moment(vm.formData.publicDate)
             vm.$refs.upfile.setFileList(vm.formData.attachment)
           }
         })
@@ -234,14 +253,14 @@ export default {
 }
 </script>
 
-<style lang="less"> 
-  .addPage{
-    .formBox{
-      padding:34px 0 10px;
-      flex-grow: 1;
-      background: #fff;
-      border-radius: 5px;
-     
-    }
-  }
+<style lang="less">
+	.addPage {
+		.formBox {
+			padding: 34px 0 10px;
+			flex-grow: 1;
+			background: #fff;
+			border-radius: 5px;
+
+		}
+	}
 </style>

+ 376 - 313
src/views/appSetting/bannerSetting.vue

@@ -1,323 +1,386 @@
 <template>
-	<a-card :bordered="false">
-		<div class="add">
-			<a-button type="primary" icon="plus" class="addBtn" @click="showModal">新建</a-button>
-		</div>
-		<v-select ref="position" style="display: none;" code="ADVERT_POSITION"></v-select>
-		<!-- table列表 -->
-		<s-table ref="table" size="default" :rowKey="(row)=> row.id" :showPagination="false" :columns="columns" :data="loadData"
-		 bordered>
-			<!-- 广告图位置 -->
-			<span slot="position" slot-scope="text,record">
-				{{ $refs.position.getNameByCode(text) }}
-			</span>
-			<span slot="action" slot-scope="text, record">
-				<template>
-					<a-icon type="eye" :style="{ fontSize: '20px', color: '#e29e14', padding: '0 10px' }" @click="handleEdit(record, 1)" />
-					<a-icon type="edit" v-if="record.status == '0'" style="font-size: 20px;color: #1890FF;padding: 0 10px;" @click="handleEdit(record, 0)" />
-					<a-icon type="delete" v-if="record.status == '0'" style="font-size: 20px;color: red;padding: 0 10px;" @click="delect(record)" />
-				</template>
-			</span>
-			<span slot="status" slot-scope="text,record">
-				<a-switch checkedChildren="启用" unCheckedChildren="禁用" v-model=" record.status==1 ? true : false " @change="changeFlagHandle(text, record)" />
-			</span>
-		</s-table>
-		<!-- 弹窗 -->
-		<a-modal :title="title" :visible="visible" :footer="null" :closable="closable" @cancel="close" width="45%">
-			<a-form id="components-form-demo-validate-other" :form="form" ref="form" v-bind="formItemLayout" @submit="handleSubmit">
-				<a-form-item label="名称" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-					<a-input :maxLength="32" v-decorator="['formData.title', { initialValue:formData.title,rules: [{ required: true, message: '请输入轮播图名称32个字以内!' }] }]"
-					 :disabled="disabled" placeholder="请输入轮播图名称32个字以内" />
-				</a-form-item>
-				<a-form-item required label="广告图位置" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-					<v-select ref="position" code="ADVERT_POSITION" v-model="formData.position" allowClear placeholder="请选择广告图位置"
-					 :disabled="disabled"></v-select>
-				</a-form-item>
-				<a-form-item label="跳转链接" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-					<a-input v-decorator="['formData.url', { initialValue:formData.url,rules: [{ required: false, message: '请填写跳转链接!' }] }]"
-					 :disabled="disabled" placeholder="请输入跳转链接" />
-				</a-form-item>
-				<a-form-item label="排序" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-					<a-input type="number" v-decorator="['formData.sort', { initialValue:formData.sort, rules: [{ required: true, message: '请排序!' }] }]"
-					 :disabled="disabled" placeholder="请输入序号值" />
-				</a-form-item>
-				<a-form-item label="状态" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-					<a-radio-group :disabled="disabled" v-decorator="['formData.status', { initialValue:formData.status,rules: [{ required: true, message: '请选择状态!' }] }]">
-						<a-radio value="1">
-							启用
-						</a-radio>
-						<a-radio value="0">
-							禁用
-						</a-radio>
-					</a-radio-group>
-				</a-form-item>
-				<a-form-item label="上传图片" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
-					<div style="border: 1px solid #eee;overflow: hidden;padding: 8px 8px  0;">
-						<Upload v-if="title != '查看详情'" v-decorator="[
-                'formData.photo',
-                {
-                  initialValue: formData.photo,
-                  rules: [{required: true,message: '请上传轮播图!'}]
-                }]"
-						 ref="bannerImage" :fileSize="0.25" :disabled="disabled" @change="getbannerImage" listType="picture-card" upText="上传图片">
-						</Upload>
-						<img v-else :src="formData.photo" style="width:100px ;height: auto; margin-bottom: 8px;" />
-					</div>
-				</a-form-item>
-				<a-form-item :wrapper-col="{ span: 12, offset: 5 }" style="text-align: center;">
-					<a-button type="primary" html-type="submit" v-if="!disabled">
-						保存
-					</a-button>
-					<a-button @click="close()" style="margin-left: 8px">
-						返回列表
-					</a-button>
-				</a-form-item>
-			</a-form>
-		</a-modal>
-		</div>
-	</a-card>
+  <a-card :bordered="false">
+    <div class="add"><a-button type="primary" icon="plus" class="addBtn" @click="showModal" id="bannerSetting-showModal">新增</a-button></div>
+    <v-select ref="position" style="display: none;" code="ADVERT_POSITION"></v-select>
+    <!-- table列表 -->
+    <s-table
+      ref="table"
+      size="default"
+      :rowKey="row => row.id"
+      :showPagination="false"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 广告图位置 -->
+      <span slot="position" slot-scope="text">{{ $refs.position.getNameByCode(text) }}</span>
+      <span slot="action" slot-scope="text, record">
+        <a-icon
+          type="eye"
+          id="bannerSetting-handleView"
+          title="查看"
+          class="actionBtn icon-green"
+          @click="handleEdit(record, 1)" />
+        <a-icon
+          type="edit"
+          id="bannerSetting-handleEdit"
+          v-if="record.status == '0'"
+          title="编辑"
+          class="actionBtn icon-blues"
+          @click="handleEdit(record, 0)" />
+        <a-icon
+          type="delete"
+          id="bannerSetting-delect"
+          v-if="record.status == '0'"
+          title="删除"
+          class="actionBtn icon-red"
+          @click="delect(record)" />
+      </span>
+      <span slot="status" slot-scope="text, record">
+        <a-switch
+          checkedChildren="启用"
+          unCheckedChildren="禁用"
+          id="bannerSetting-changeFlagHandle"
+          v-model="record.status == 1 ? true : false"
+          @change="changeFlagHandle(text, record)"
+        />
+      </span>
+    </s-table>
+    <!-- 弹窗 -->
+    <a-modal
+      :title="title"
+      :visible="visible"
+      :footer="null"
+      :closable="closable"
+      :centered="true"
+      @cancel="close"
+      width="45%">
+      <a-form
+        id="components-form-demo-validate-other"
+        :form="form"
+        ref="form"
+        v-bind="formItemLayout"
+        @submit="handleSubmit"
+        :hideRequiredMark="hideRequiredMark">
+        <a-form-item label="名称" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <a-input
+            id="bannerSetting-title"
+            :maxLength="30"
+            v-decorator="['formData.title', { initialValue: formData.title,getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入轮播图名称(最多30个字符)!' }] }]"
+            :disabled="disabled"
+            placeholder="请输入轮播图名称(最多30个字符)"
+            allowClear
+          />
+        </a-form-item>
+        <a-form-item label="广告图位置" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <v-select
+            ref="position"
+            code="ADVERT_POSITION"
+            allowClear
+            id="bannerSetting-position"
+            placeholder="请选择广告图位置"
+            :disabled="disabled"
+            v-decorator="['formData.position', { initialValue: formData.position, rules: [{ required: true, message: '请选择广告图位置!' }] }]"
+          ></v-select>
+        </a-form-item>
+        <a-form-item label="跳转链接" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <a-textarea
+            :maxLength="300"
+            v-decorator="['formData.url', { initialValue: formData.url, rules: [{ required: false, message: '请输入跳转链接(最多300字符)!' }] }]"
+            :disabled="disabled"
+            id="bannerSetting-url"
+            placeholder="请输入跳转链接(最多300字符)"
+            allowClear
+          />
+        </a-form-item>
+        <a-form-item label="排序" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <a-input
+            type="number"
+            oninput="if(value.length>6)value=value.slice(0,6);if(value<0)value=0"
+            v-decorator="['formData.sort', { initialValue: formData.sort,getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入(0~999999)之间的序号值!' }] }]"
+            :disabled="disabled"
+            id="bannerSetting-sort"
+            placeholder="请输入(0~999999)之间的序号值"
+            allowClear
+          />
+        </a-form-item>
+        <a-form-item label="状态" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <a-radio-group
+            :disabled="disabled"
+            id="bannerSetting-status"
+            v-decorator="['formData.status', { initialValue: formData.status, rules: [{ required: true, message: '请选择状态!' }] }]"
+          >
+            <a-radio value="1">启用</a-radio>
+            <a-radio value="0">禁用</a-radio>
+          </a-radio-group>
+        </a-form-item>
+        <a-form-item label="上传图片" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+          <Upload
+            v-if="title != '查看详情'"
+            id="bannerSetting-photoPath"
+            v-decorator="[
+              'formData.photoPath',
+              {
+                initialValue: formData.photoPath,
+                rules: [{ required: true, message: '请上传轮播图!' }]
+              }
+            ]"
+            ref="bannerImage"
+            :fileSize="0.25"
+            :disabled="disabled"
+            @change="getbannerImage"
+            listType="picture-card"
+            upText="上传"
+          ></Upload>
+          <img v-else :src="formData.photoPath" style="width:100px ;height: auto;" />
+        </a-form-item>
+        <a-form-item :wrapper-col="{ span: 12, offset: 6}" style="text-align: center;">
+          <a-button type="primary" html-type="submit" v-if="!disabled" id="bannerSetting-submit" style="margin-right: 15px">保存</a-button>
+          <a-button @click="close()" v-if="!disabled" style="margin-left: 15px" id="bannerSetting-close">取消</a-button>
+        </a-form-item>
+      </a-form>
+    </a-modal>
+  </a-card>
 </template>
 
 <script>
-	import {
-		Upload,
-		STable,
-		VSelect
-	} from '@/components'
-	import {
-		getBannerSettingList,
-		changeStatus,
-		deleteItem,
-		saveItem
-	} from '@/api/bannerSetting.js'
+import { Upload, STable, VSelect } from '@/components'
+import { getBannerSettingList, changeStatus, deleteItem, saveItem } from '@/api/bannerSetting.js'
 
-	export default {
-		components: {
-			STable,
-			Upload,
-			VSelect
-		},
-		data() {
-			return {
-				// 表头
-				columns: [{
-						title: '序号',
-						dataIndex: 'no',
-						minWidth: '40',
-						align: 'center'
-					},
-					{
-						title: '操作',
-						// dataIndex: 'action',
-						minWidth: '100',
-						align: 'center',
-						scopedSlots: {
-							customRender: 'action'
-						}
-					},
-					{
-						title: '状态',
-						minWidth: '100',
-						dataIndex: 'status',
-						align: 'center',
-						scopedSlots: {
-							customRender: 'status'
-						}
-					},
-					{
-						title: '广告图位置',
-						minWidth: '100',
-						dataIndex: 'position',
-						align: 'center',
-						scopedSlots: {
-							customRender: 'position'
-						}
-					},
-					{
-						title: '名称',
-						minWidth: '100',
-						dataIndex: 'title',
-						align: 'center'
-					},
-					{
-						title: '排序',
-						minWidth: '100',
-						dataIndex: 'sort',
-						align: 'center'
-					},
-					{
-						title: '跳转链接',
-						minWidth: '200',
-						dataIndex: 'url',
-						align: 'center'
-					}
-				],
-				// 加载数据方法 必须为 Promise 对象
-				loadData: parameter => {
-					return getBannerSettingList({
-							bannerType: 'app'
-						})
-						.then(res => {
-							console.log(res, '1111')
-							const no = 0
-							for (let i = 0; i < res.data.length; i++) {
-								const _item = res.data[i]
-								_item.no = no + i + 1
-								_item.releaseStatus = _item.releaseStatus + '' === 'FB'
-							}
-							return res.data
-						})
-				},
+export default {
+  components: {
+    STable,
+    Upload,
+    VSelect
+  },
+  data () {
+    return {
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'no',
+          width: 60,
+          align: 'center'
+        },
+        {
+          title: '广告图位置',
+          width: 200,
+          dataIndex: 'position',
+          align: 'center',
+          scopedSlots: {
+            customRender: 'position'
+          }
+        },
+        {
+          title: '名称',
+          width: 100,
+          dataIndex: 'title',
+          align: 'center'
+        },
+        {
+          title: '排序',
+          width: 100,
+          dataIndex: 'sort',
+          align: 'center'
+        },
+        {
+          title: '跳转链接',
+          width: 100,
+          dataIndex: 'url',
+          align: 'center',
+          customRender: (text) => {
+            return text || '--'
+          }
+        },
+        {
+          title: '状态',
+          width: 100,
+          dataIndex: 'status',
+          align: 'center',
+          scopedSlots: {
+            customRender: 'status'
+          }
+        },
+        {
+          title: '操作',
+          align: 'center',
+          width: 200,
+          scopedSlots: {
+            customRender: 'action'
+          }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return getBannerSettingList({
+          bannerType: 'app'
+        }).then(res => {
+          // console.log(res, '1111')
+          const no = 0
+          for (let i = 0; i < res.data.length; i++) {
+            const _item = res.data[i]
+            _item.no = no + i + 1
+          }
+          return res.data
+        })
+      },
 
-				title: '编辑',
-				closable: true,
-				visible: false,
-				confirmLoading: false,
-				formLayout: 'horizontal',
-				form: this.$form.createForm(this),
-				formItemLayout: {
-					labelCol: {
-						span: 6
-					},
-					wrapperCol: {
-						span: 14
-					}
-				},
-				formData: {
-					title: '', // 标题
-					photo: '', // banner图片
-					url: '', // 图片路径
-					status: '', // 状态
-					sort: '', // 排序
-					position: '' // 广告图位置
-				},
-				bannerType: 'app',
-				disabled: false,
-				value: '',
-				id: '',
-				isShow: true,
-			}
-		},
-
-		beforeCreate() {
-			this.form = this.$form.createForm(this, {
-				name: 'validate_other'
-			})
-		},
-		methods: {
-			showModal() {
-				this.disabled = false
-				delete this.formData.id
-				this.visible = true
-				this.title = '新增'
-			},
-			getbannerImage(data) {
-				this.formData.photo = data
-			},
-			// 点击保存;
-			handleSubmit(e) {
-				e.preventDefault()
-				const _this = this
-				this.form.validateFields((err, values) => {
-					if (!err) {
-						console.log('Received values of form: ', values, this.formData)
-						const formData = Object.assign({}, this.formData, values.formData, {
-							bannerType: 'app'
-						})
-						console.log(formData, _this.radioGroup)
-						saveItem(formData, _this.radioGroup).then(res => {
-							console.log(res, 'rrrrrrrrr')
-							if (res.status == 200) {
-								_this.$message.success(res.message ? res.message : '保存成功')
-								_this.$refs.table.refresh()
-								_this.close()
-							} else {
-								_this.$message.error(res.message)
-							}
-						})
-					}
-				})
-			},
-			close() {
-				this.visible = false
-				this.formData.title = ''
-				this.formData.photo = ''
-				this.formData.url = ''
-				this.formData.status = ''
-				this.formData.sort = ''
-				this.formData.position = ''
-				this.title = '新增'
-				this.$refs.bannerImage.setFileList('')
-				this.form.resetFields()
-			},
-			// 赋值
-			assignment(row) {
-				this.formData.id = row.id
-				this.formData.title = row.title
-				this.formData.photo = row.photo
-				this.formData.url = row.url
-				this.formData.status = row.status
-				this.formData.sort = row.sort
-				this.formData.position = row.position
-			},
-			// 0 修改,1 查看详情
-			handleEdit(row, type) {
-				console.log(row)
-				const _this = this
-				if (type == 1) {
-					this.title = '查看详情'
-				} else if (type == 0) {
-					this.title = '编辑'
-				}
-				this.assignment(row)
-				this.disabled = type == 1
-				this.visible = true
-				console.log(this.formData.photo)
-				setTimeout(() => {
-					_this.$refs.bannerImage.setFileList(this.formData.photo)
-				}, 500)
-			},
-			// 删除
-			delect(row) {
-				const _this = this
-				this.$confirm({
-					title: '警告',
-					content: '删除后无法恢复,确认删除?',
-					okText: '确定',
-					cancelText: '取消',
-					onOk() {
-						deleteItem({
-							id: row.id
-						}).then(res => {
-							if (res.status == 200) {
-								_this.$message.success('删除成功')
-								_this.$refs.table.refresh()
-							}
-						})
-					}
-				})
-			},
-			// 更改启用禁用状态
-			changeFlagHandle(text, record) {
-				const _data = {
-					id: record.id,
-					flag: record.status == 1 ? '0' : '1'
-				}
-				changeStatus(_data).then(res => {
-					if (res.status == '200') {
-						this.$message.success('修改成功')
-						this.$refs.table.refresh()
-					} else {
-						record.status = !record.status
-					}
-				})
-			}
-		}
-	}
+      title: '编辑',
+      closable: true,
+      visible: false,
+      confirmLoading: false,
+      formLayout: 'horizontal',
+      hideRequiredMark: false, // 是否显示必填的* 默认显示
+      form: this.$form.createForm(this),
+      formItemLayout: {
+        labelCol: {
+          span: 6
+        },
+        wrapperCol: {
+          span: 14
+        }
+      },
+      formData: {
+        title: '', // 标题
+        url: '', // 图片路径
+        status: '', // 状态
+        sort: '', // 排序
+        position: '', // 广告图位置
+        photoPath: '', // banner地址
+        createDate: ''
+      },
+      bannerType: 'app',
+      disabled: false,
+      value: '',
+      id: '',
+      isShow: true
+    }
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, {
+      name: 'validate_other'
+    })
+  },
+  methods: {
+    showModal () {
+      this.disabled = false
+      delete this.formData.id
+      delete this.formData.createDate
+      this.visible = true
+      this.title = '新增'
+      this.hideRequiredMark = false
+    },
+    // 轮播图change
+    getbannerImage (data) {
+      this.formData.photoPath = data
+    },
+    // 点击保存;
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          console.log('Received values of form: ', values, this.formData)
+          const formData = Object.assign({}, this.formData, values.formData, {
+            bannerType: 'app'
+          })
+          console.log(formData, _this.radioGroup)
+          saveItem(formData, _this.radioGroup).then(res => {
+            console.log(res, 'rrrrrrrrr')
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.close()
+            }
+          })
+        }
+      })
+    },
+    close () {
+      this.visible = false
+      this.formData.title = ''
+      this.photo = ''
+      this.formData.url = ''
+      this.formData.status = ''
+      this.formData.sort = ''
+      this.formData.position = ''
+      this.formData.photoBasePath = ''
+      this.formData.photoPath = ''
+      this.title = '新增'
+      this.$refs.bannerImage.setFileList('')
+      this.form.resetFields()
+    },
+    // 赋值
+    assignment (row) {
+      this.formData.id = row.id
+      this.formData.title = row.title
+      this.formData.photoPath = row.photoPath
+      this.formData.url = row.url
+      this.formData.status = row.status
+      this.formData.sort = row.sort
+      this.formData.position = row.position
+      this.formData.createDate = row.createDate
+    },
+    // 0 修改,1 查看详情
+    handleEdit (row, type) {
+      const _this = this
+      console.log(row)
+      if (type == 1) {
+        this.title = '查看详情'
+        this.hideRequiredMark = true
+      } else if (type == 0) {
+        this.title = '编辑'
+        this.hideRequiredMark = false
+      }
+      this.assignment(row)
+      this.disabled = type == 1
+      this.visible = true
+      setTimeout(() => {
+        _this.$refs.bannerImage.setFileList(this.formData.photoPath)
+      }, 500)
+    },
+    // 删除
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        centered: true,
+        content: '删除后无法恢复,确认删除?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          deleteItem({
+            id: row.id
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
+    },
+    // 更改启用禁用状态
+    changeFlagHandle (text, record) {
+      const _data = {
+        id: record.id,
+        flag: record.status == 1 ? '0' : '1'
+      }
+      changeStatus(_data).then(res => {
+        if (res.status == '200') {
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+        } else {
+          record.status = !record.status
+        }
+      })
+    }
+  }
+}
 </script>
 
 <style scoped>
-	.addBtn {
-		margin-bottom: 20px;
-	}
+.addBtn {
+  margin-bottom: 20px;
+}
 </style>

+ 108 - 104
src/views/appSetting/editionSetting.vue

@@ -2,7 +2,7 @@
   <a-card :bordered="false">
     <!-- 新建 -->
     <div class="add">
-      <a-button type="primary" icon="plus" class="addBtn" @click="openModal()">新建</a-button>
+      <a-button type="primary" icon="plus" class="addBtn" @click="openModal()" id="editionSetting-openModal">新增</a-button>
     </div>
     <!-- table列表 -->
     <s-table
@@ -13,119 +13,123 @@
       :data="loadData"
       bordered
     >
-    <span slot="action" slot-scope="text, record">
-      <template>
-        <a-icon type="edit" style="font-size: 20px;color: #1890FF;padding: 0 10px;" @click="handleEdit(record)" />
+      <!-- 操作 -->
+      <span slot="action" slot-scope="text, record">
+        <template>
+          <a-icon v-if="currentDate < new Date(record.publicDate).getTime()" type="edit" id="editionSetting-handleEdit" style="font-size: 20px;color: #1890FF;padding: 0 10px;" @click="handleEdit(record)" />
+          <span v-if="currentDate > new Date(record.publicDate).getTime()">--</span>
+        </template>
+      </span>
+      <template slot="upgradeContent" slot-scope="text, record">
+        <span :title="record.upgradeContent" style="display: inline-block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">{{ record.upgradeContent }}</span>
+
       </template>
-    </span>
-    <template slot="upgradeContent" slot-scope="text, record">
-      <span :title="record.upgradeContent" style="display: inline-block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 200px;">{{record.upgradeContent}}</span>
-      
-    </template>
-    <span slot="forceUpgrade" slot-scope="text, record">
-      <template>
-        <span v-if= " text == '1'">是</span>
-        <span v-if= " text == '0'">否</span>
-      </template> 
-    </span>
+      <span slot="forceUpgrade" slot-scope="text">
+        <template>
+          <span v-if=" text == '1'">是</span>
+          <span v-if=" text == '0'">否</span>
+        </template>
+      </span>
     </s-table>
   </a-card>
 </template>
 
 <script>
-  import {STable} from '@/components'
-  import {getEditionSettingList} from '@/api/editionSetting.js'
-  export default{
-    name:'EditionSetting',
-    components:{STable},
-    data(){
-      return{
-        columns:[
-          {
-            title: '序号',
-            dataIndex: 'no',
-            width:"40",
-            align:'center'
-          },
-          {
-            title: '创建时间',
-            width:"100",
-            dataIndex: 'createDate',
-            align:'center'
-          },
-          {
-            title: '版本号',
-            width:"40",
-            dataIndex:'version',
-            align:'center'
-          },
-          {
-            title: '强制升级',
-            width:"40",
-            dataIndex:'forceUpgrade',
-            align:'center',
-            scopedSlots: { customRender: 'forceUpgrade' }
-          },
-          {
-            title: '升级内容',
-            width:'200',
-            dataIndex:'upgradeContent',
-            align:'center',
-            ellipsis: true  ,//内容超过宽度 自动出现省略号
-            scopedSlots: { customRender: 'upgradeContent' }
-            
-          },
-          {
-            title: '下载地址',
-            width:'200',
-            dataIndex:'downloadUrl',
-            align:'center'
-          },
-          {
-            title: '更新时间',
-            width:'100',
-            dataIndex:'updateDate',
-            align:'center'
-          },
-          {
-            title: '操作',
-            // dataIndex: 'action',
-            width:"40",
-            align:'center',
-            scopedSlots: { customRender: 'action' }
-          },
-        ],
-        applyCode:'zyit',
-        applyName:'IT后台',
-        // 获取列表数据
-        loadData: parameter => {
-          return getEditionSettingList(Object.assign(parameter, {applyCode:'zyit'}))
-            .then(res => {
-              console.log(res,'1111')
-              const no = (res.data.pageNo - 1) * res.data.pageSize
-              for (let i = 0; i < res.data.list.length; i++) {
-                const _item = res.data.list[i]
-                _item.no = no + i + 1
-                _item.releaseStatus = _item.releaseStatus + '' === 'FB'
-              }
-              return res.data
-            })
+import { STable } from '@/components'
+import { getEditionSettingList } from '@/api/editionSetting.js'
+export default {
+  name: 'EditionSetting',
+  components: { STable },
+  data () {
+    return {
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'no',
+          width: 60,
+          align: 'center'
         },
-        id:''
-      }
-    },
-    methods:{
-      openModal(){
-        this.$router.push({ name: 'editionSetting_add' })
+        {
+          title: '创建时间',
+          width: 100,
+          dataIndex: 'createDate',
+          align: 'center'
+        },
+        {
+          title: '版本号',
+          width: 100,
+          dataIndex: 'version',
+          align: 'center'
+        },
+        {
+          title: '强制升级',
+          width: 100,
+          dataIndex: 'forceUpgrade',
+          align: 'center',
+          scopedSlots: { customRender: 'forceUpgrade' }
+        },
+        {
+          title: '升级内容',
+          width: 100,
+          dataIndex: 'upgradeContent',
+          align: 'center',
+          ellipsis: true, // 内容超过宽度 自动出现省略号
+          scopedSlots: { customRender: 'upgradeContent' }
+
+        },
+        {
+          title: '下载地址',
+          width: 100,
+          dataIndex: 'downloadUrl',
+          align: 'center',
+          customRender: (text) => {
+            return text || '--'
+          }
+        },
+        {
+          title: '更新时间',
+          width: 100,
+          dataIndex: 'publicDate',
+          align: 'center'
+        },
+        {
+          title: '操作',
+          // dataIndex: 'action',
+          width: 100,
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      applyCode: 'atit',
+      applyName: 'IT后台',
+      currentDate: new Date().getTime(),	// 当前时间
+      // 获取列表数据
+      loadData: parameter => {
+        return getEditionSettingList(Object.assign(parameter))
+          .then(res => {
+            const no = (res.data.pageNo - 1) * res.data.pageSize
+            for (let i = 0; i < res.data.list.length; i++) {
+              const _item = res.data.list[i]
+              _item.no = no + i + 1
+            }
+            return res.data
+          })
       },
-      //操作修改
-      handleEdit(row){
-        console.log(row)
-        this.$router.push({ name: 'editionSetting_add', query: { id: row.id } })
-        // this.formData=Object.assign({},this.formData,row)
-      }
+      id: ''
+    }
+  },
+  methods: {
+	 // 新增
+    openModal () {
+      this.$router.push({ name: 'editionSetting_add' })
+    },
+    // 编辑
+    handleEdit (row) {
+      console.log(row)
+      this.$router.push({ name: 'editionSetting_edit', query: { id: row.id } })
     }
   }
+}
 </script>
 
 <style scoped>

+ 24 - 13
src/views/bnSetting/menu/adminMenus.vue

@@ -1,9 +1,9 @@
 <template>
   <a-card :bordered="false">
     <a-row :gutter="24">
-      <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addChild">添加子菜单</a-button>
-      <a-button style="margin-right: 10px;background-color: #19be6b;color: #fff;" type="" icon="plus" @click="addTitle">添加顶部菜单</a-button>
-      <a-button style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="delect()">删除</a-button>
+      <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addChild" id="adminMenus-addChild">新增子菜单</a-button>
+      <a-button style="margin-right: 10px;background-color: #19be6b;color: #fff;" type="" icon="plus" @click="addTitle" id="adminMenus-addTitle">新增顶部菜单</a-button>
+      <a-button style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="delect()" id="adminMenus-delect">删除</a-button>
 
     </a-row>
     <a-row :gutter="24">
@@ -15,7 +15,7 @@
         </a-row>
 
         <a-row :gutter="24" >
-          <a-input-search placeholder="输入搜索菜单名搜索" style="width: 100%" @change="onChange" />
+          <a-input-search placeholder="输入搜索菜单名搜索" style="width: 100%" @change="onChange" id="adminMenus-onChange"/>
           <a-tree
             @expand="onExpand"
             :treeData="getMenus"
@@ -54,10 +54,13 @@
           <!-- 名称 -->
           <a-form-item label="名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
-              placeholder="请输入名称"
+              id="adminMenus-name"
+              allowClear
+              :maxLength="30"
+              placeholder="请输入名称30个字以内"
               v-decorator="['formData.name', {
-                initialValue: formData.name,
-                rules: [{ required: true, message: '请输入名称!' },{pattern:'^[^<|>]{1,20}$',message:'请输入不含<或>的字符,最多20个字符'}] }]"
+                initialValue: formData.name,getValueFromEvent: $filterEmpty,
+                rules: [{ required: true, message: '请输入名称30个字以内!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]"
             />
           </a-form-item>
           <!-- 路由英文名 -->
@@ -90,11 +93,13 @@
           <!-- 前端权限编码 -->
           <a-form-item label="前端权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
+              id="adminMenus-code"
+              allowClear
               placeholder="请输入前端权限编码"
               v-decorator="[
                 'formData.code',
                 {
-                  initialValue: formData.code,
+                  initialValue: formData.code,getValueFromEvent: $filterEmpty,
                   rules: [{ required: true, message: '请输入前端权限编码!' }] },
               ]"
             />
@@ -102,11 +107,13 @@
           <!-- 后台权限编码 -->
           <a-form-item label="后台权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
+              id="adminMenus-permission"
+              allowClear
               placeholder="请输入后台权限编码"
               v-decorator="[
                 'formData.permission',
                 {
-                  initialValue: formData.permission,
+                  initialValue: formData.permission,getValueFromEvent: $filterEmpty,
                   rules: [{ required: formData.isLeaf, message: '请输入后台权限编码!' }] },
               ]"
             />
@@ -143,16 +150,20 @@
           <!-- 排序值 -->
           <a-form-item label="排序值" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
+              id="adminMenus-sort"
+              allowClear
               type="number"
-              placeholder="请输入排序值"
+              oninput="if(value.length>6)value=value.slice(0,6);if(value<0)value=0"
+              placeholder="请输入(0~999999)之间的排序值"
               v-decorator="['formData.sort', {
-                initialValue: formData.sort,
+                initialValue: formData.sort,getValueFromEvent: $filterEmpty,
                 rules: [] }]"
             />
           </a-form-item>
           <!-- 状态 -->
           <a-form-item label="启用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-radio-group
+              id="adminMenus-status"
               name="radioGroup"
               v-decorator="[
                 'formData.status',
@@ -167,10 +178,10 @@
           </a-form-item>
 
           <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-            <a-button type="primary" @click="handleSubmit()">
+            <a-button type="primary" @click="handleSubmit()" id="adminMenus-handleSubmit">
               保存
             </a-button>
-            <a-button :style="{ marginLeft: '8px' }" @click="clear">
+            <a-button :style="{ marginLeft: '8px' }" @click="clear" id="adminMenus-clear">
               重置
             </a-button>
           </a-form-item>

+ 35 - 32
src/views/bnSetting/menu/childModal.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel">
+    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel" :centered="true">
       <a-form :form="form" @submit="handleSubmit">
         <!-- 上级菜单 -->
         <a-form-item label="上级菜单" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
@@ -12,6 +12,8 @@
         <!-- 类型 -->
         <a-form-item label="类型" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-select
+            id="childModal-type"
+            allowClear
             @change="selectChange"
             :disabled="disabled"
             v-decorator="[
@@ -31,10 +33,13 @@
         <!-- 名称 -->
         <a-form-item label="名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
-            placeholder="请输入名称"
+            placeholder="请输入名称(最多30个字符)"
+            :maxLength="30"
+            id="childModal-name"
+            allowClear
             v-decorator="['formData.name', {
-              initialValue: formData.name,
-              rules: [{ required: true, message: '请输入名称!' },{pattern:'^[^<|>]{1,20}$',message:'请输入不含<或>的字符,最多20个字符'}] }]"
+              initialValue: formData.name,getValueFromEvent: $filterEmpty,
+              rules: [{ required: true, message: '请输入名称(最多30个字符)!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]"
           />
         </a-form-item>
         <!-- 路由英文名 -->
@@ -66,10 +71,12 @@
         <a-form-item label="前端权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
             placeholder="请输入前端权限编码"
+            allowClear
+            id="childModal-code"
             v-decorator="[
               'formData.code',
               {
-                initialValue: formData.code,
+                initialValue: formData.code,getValueFromEvent: $filterEmpty,
                 rules: [{ required: true, message: '请输入前端权限编码!' }] },
             ]"
           />
@@ -79,9 +86,11 @@
         <a-form-item label="后台权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
             placeholder="请输入后台权限编码"
+            allowClear
+            id="childModal-permission"
             v-decorator="[
               'formData.permission',
-              {initialValue: formData.permission},
+              {initialValue: formData.permission,getValueFromEvent: $filterEmpty,},
             ]"
           />
 
@@ -120,14 +129,17 @@
         <a-form-item label="排序值" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
             type="number"
-            placeholder="请输入排序值"
+			oninput="if(value.length>6)value=value.slice(0,6);if(value<0)value=0"
+            placeholder="请输入(0~999999)之间的排序值"
+            allowClear
+            id="childModal-sort"
             v-decorator="['formData.sort', {
-              initialValue: formData.sort,
+              initialValue: formData.sort,getValueFromEvent: $filterEmpty,
               rules: [] }]"
           />
         </a-form-item>
         <!-- 连锁可用 -->
-        <a-form-item v-if="parentType=='store'" label="连锁可用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+        <!-- <a-form-item v-if="parentType=='store'" label="连锁可用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-radio-group
             name="radioGroup"
             v-decorator="[
@@ -140,9 +152,9 @@
             <a-radio :value="1">是</a-radio>
             <a-radio :value="0">否</a-radio>
           </a-radio-group>
-        </a-form-item>
+        </a-form-item> -->
         <!-- 单店可用 -->
-        <a-form-item v-if="parentType=='store'" label="单店可用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+        <!-- <a-form-item v-if="parentType=='store'" label="单店可用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-radio-group
             name="radioGroup"
             v-decorator="[
@@ -155,11 +167,12 @@
             <a-radio :value="1">是</a-radio>
             <a-radio :value="0">否</a-radio>
           </a-radio-group>
-        </a-form-item>
+        </a-form-item> -->
         <!-- 状态 -->
         <a-form-item label="启用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-radio-group
             name="radioGroup"
+            id="childModal-status"
             v-decorator="[
               'formData.status',
               {
@@ -172,11 +185,11 @@
           </a-radio-group>
         </a-form-item>
 
-        <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button type="primary" @click="handleSubmit()">
+        <a-form-item :wrapper-col="{ span: 12, offset: 6 }">
+          <a-button type="primary" @click="handleSubmit()" id="childModal-handleSubmit">
             保存
           </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()" id="childModal-handleCancel">
             取消
           </a-button>
         </a-form-item>
@@ -230,8 +243,8 @@ export default {
         urlPath: '',
         sort: '',
         type: undefined,
-        chainOrgUse: 1,
-        singleOrgUse: 1,
+        // chainOrgUse: 1,
+        // singleOrgUse: 1,
         status: 1 // 活动状态
       }
     }
@@ -270,17 +283,7 @@ export default {
     },
     // 取消
     handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定取消吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
+      this.cancel()
     },
     clear () {
       this.form.resetFields()
@@ -295,8 +298,8 @@ export default {
       this.formData.sort = ''
       this.formData.type = ''
       this.formData.status = 1
-      this.formData.chainOrgUse = 1
-      this.formData.singleOrgUse = 1
+      // this.formData.chainOrgUse = 1
+      // this.formData.singleOrgUse = 1
       this.formData.code = ''
       this.formData.permission = ''
     }
@@ -314,13 +317,13 @@ export default {
     isshow (newValue, oldValue) {
       if (newValue) {
         if (this.data.id) { // 添加子菜单
-          this.titleText = '添加子菜单'
+          this.titleText = '新增子菜单'
           this.disabled = false
           console.log(this.data, 'this.data')
           this.formData.parentId = this.data.id
           this.parentTitle = this.data.name
         } else { // 添加顶菜单
-          this.titleText = '添加顶菜单'
+          this.titleText = '新增顶菜单'
           this.formData.type = 0
           this.disabled = true
         }

+ 36 - 25
src/views/bnSetting/menu/storeMenus.vue

@@ -1,9 +1,9 @@
 <template>
   <a-card :bordered="false">
     <a-row :gutter="24">
-      <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addChild">添加子菜单</a-button>
-      <a-button style="margin-right: 10px;background-color: #19be6b;color: #fff;" type="" icon="plus" @click="addTitle">添加顶部菜单</a-button>
-      <a-button style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="delect()">删除</a-button>
+      <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addChild" id="storeMenus-addChild">新增子菜单</a-button>
+      <a-button style="margin-right: 10px;background-color: #19be6b;color: #fff;" type="" icon="plus" @click="addTitle" id="storeMenus-addTitle">新增顶部菜单</a-button>
+      <a-button style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="delect()" id="storeMenus-delect">删除</a-button>
 
     </a-row>
     <a-row :gutter="24">
@@ -15,7 +15,7 @@
         </a-row>
 
         <a-row :gutter="24" >
-          <a-input-search placeholder="输入搜索菜单名搜索" style="width: 100%" @change="onChange" />
+          <a-input-search placeholder="输入搜索菜单名搜索" style="width: 100%" @change="onChange" id="storeMenus-onChange"/>
           <a-tree
             @expand="onExpand"
             :treeData="getMenus"
@@ -54,10 +54,13 @@
           <!-- 名称 -->
           <a-form-item label="名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
-              placeholder="请输入名称"
+              id="storeMenus-name"
+              allowClear
+              :maxLength="30"
+              placeholder="请输入名称30个字以内"
               v-decorator="['formData.name', {
-                initialValue: formData.name,
-                rules: [{ required: true, message: '请输入名称!' },{pattern:'^[^<|>]{1,20}$',message:'请输入不含<或>的字符,最多20个字符'}] }]"
+                initialValue: formData.name,getValueFromEvent: $filterEmpty,
+                rules: [{ required: true, message: '请输入名称30个字以内!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]"
             />
           </a-form-item>
           <!-- 路由英文名 -->
@@ -90,11 +93,13 @@
           <!-- 前端权限编码 -->
           <a-form-item label="前端权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
+              id="storeMenus-code"
+              allowClear
               placeholder="请输入前端权限编码"
               v-decorator="[
                 'formData.code',
                 {
-                  initialValue: formData.code,
+                  initialValue: formData.code,getValueFromEvent: $filterEmpty,
                   rules: [{ required: true, message: '请输入前端权限编码!' }] },
               ]"
             />
@@ -102,11 +107,13 @@
           <!-- 后台权限编码 -->
           <a-form-item label="后台权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
+              id="storeMenus-permission"
+              allowClear
               placeholder="请输入后台权限编码"
               v-decorator="[
                 'formData.permission',
                 {
-                  initialValue: formData.permission,
+                  initialValue: formData.permission,getValueFromEvent: $filterEmpty,
                   rules: [{ required: formData.isLeaf, message: '请输入后台权限编码!' }] },
               ]"
             />
@@ -144,14 +151,17 @@
           <a-form-item label="排序值" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
               type="number"
-              placeholder="请输入排序值"
+              oninput="if(value.length>6)value=value.slice(0,6);if(value<0)value=0"
+              allowClear
+              id="storeMenus-sort"
+              placeholder="请输入(0~999999)之间的排序值"
               v-decorator="['formData.sort', {
-                initialValue: formData.sort,
+                initialValue: formData.sort,getValueFromEvent: $filterEmpty,
                 rules: [] }]"
             />
           </a-form-item>
           <!-- 连锁可用 -->
-          <a-form-item label="连锁可用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <!-- <a-form-item label="连锁可用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-radio-group
               name="radioGroup"
               v-decorator="[
@@ -164,9 +174,9 @@
               <a-radio :value="1">是</a-radio>
               <a-radio :value="0">否</a-radio>
             </a-radio-group>
-          </a-form-item>
+          </a-form-item> -->
           <!-- 单店可用 -->
-          <a-form-item label="单店可用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+          <!-- <a-form-item label="单店可用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-radio-group
               name="radioGroup"
               v-decorator="[
@@ -179,10 +189,11 @@
               <a-radio :value="1">是</a-radio>
               <a-radio :value="0">否</a-radio>
             </a-radio-group>
-          </a-form-item>
+          </a-form-item> -->
           <!-- 状态 -->
           <a-form-item label="启用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-radio-group
+              id="storeMenus-status"
               name="radioGroup"
               v-decorator="[
                 'formData.status',
@@ -197,10 +208,10 @@
           </a-form-item>
 
           <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-            <a-button type="primary" @click="handleSubmit()">
+            <a-button type="primary" @click="handleSubmit()" id="storeMenus-handleSubmit">
               保存
             </a-button>
-            <a-button :style="{ marginLeft: '8px' }" @click="clear">
+            <a-button :style="{ marginLeft: '8px' }" @click="clear" id="storeMenus-clear">
               重置
             </a-button>
           </a-form-item>
@@ -249,8 +260,8 @@ export default {
         sort: '',
         type: '0',
         isLeaf: true,
-        chainOrgUse: '',
-        singleOrgUse: '',
+        // chainOrgUse: '',
+        // singleOrgUse: '',
         status: '' // 活动状态
       }
     }
@@ -287,16 +298,16 @@ export default {
           permission: data.permission,
           sort: data.sort,
           type: data.type,
-          chainOrgUse: data.chainOrgUse,
-          singleOrgUse: data.singleOrgUse,
+          // chainOrgUse: data.chainOrgUse,
+          // singleOrgUse: data.singleOrgUse,
           status: data.status,
           isLeaf: !(isLeaf && isLeaf.length)
         }
 
         this.selectedMenu = this.formData.name
         this.formData.status = Number(this.formData.status)
-        this.formData.chainOrgUse = Number(this.formData.chainOrgUse)
-        this.formData.singleOrgUse = Number(this.formData.singleOrgUse)
+        // this.formData.chainOrgUse = Number(this.formData.chainOrgUse)
+        // this.formData.singleOrgUse = Number(this.formData.singleOrgUse)
       } else {
         this.selectedMenu = ''
         this.clear()
@@ -388,8 +399,8 @@ export default {
       this.formData.urlPath = ''
       this.formData.sort = ''
       this.formData.type = ''
-	    this.formData.chainOrgUse = ''
-	    this.formData.singleOrgUse = ''
+	    // this.formData.chainOrgUse = ''
+	    // this.formData.singleOrgUse = ''
       this.formData.status = ''
       this.formData.code = ''
       this.formData.permission = ''

+ 6 - 12
src/views/bnSetting/menusAuth.vue

@@ -5,13 +5,14 @@
         checkable
         @check="onCheck"
         @expand="onExpand"
+        :expandedKeys="expandedKeys"
         :autoExpandParent="autoExpandParent"
         v-model="checkedKeys"
         :treeData="treeData"
       />
     </a-form>
     <a-form-item :wrapper-col="{ offset: 3 }">
-      <a-button type="primary" @click="handleSubmit()">
+      <a-button id="menusAuth-handleSubmit" type="primary" @click="handleSubmit()">
         保存
       </a-button>
     </a-form-item>
@@ -50,14 +51,9 @@ export default {
       this.menuIds = dr.mould.menuIds
       if (this.menuIds) {
         const arr = this.menuIds.split(',')
-        const temp = []
-        arr.map(item => {
-          temp.push(Number(item))
-        })
-        this.checkedData = temp
-        this.expandedKeys = temp
+        this.checkedData = arr
         // 找出叶子节点
-        this.findLeaf(this.treeData, temp)
+        this.findLeaf(this.treeData, arr)
       }
     },
     // 获取连锁树数据
@@ -79,7 +75,6 @@ export default {
       })
     },
     onExpand (expandedKeys) {
-      console.log('onExpand', expandedKeys)
       this.expandedKeys = expandedKeys
       this.autoExpandParent = false
     },
@@ -87,7 +82,7 @@ export default {
       this.checkedData = [...checkedKeys, ...info.halfCheckedKeys]
       this.checkedKeys = checkedKeys
     },
-    // 勾选已选的菜单
+    // 查找叶子节点
     findLeaf (data, arr) {
       for (let i = 0; i < data.length; i++) {
         const node = data[i]
@@ -98,6 +93,7 @@ export default {
             return item == node.id
           })
           if (hasNode) {
+            this.expandedKeys.push(node.id)
             this.checkedKeys.push(node.id)
           }
         }
@@ -105,10 +101,8 @@ export default {
     },
     // 保存提交
     handleSubmit () {
-      const _this = this
       this.form.validateFields((err, values) => {
         if (!err) {
-          // console.log(this.checkedData)
           if (this.checkedData.length == 0) {
             return this.$message.warning('请先选择菜单')
           }

+ 20 - 20
src/views/bnSetting/menusAuthTab.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="menusAuth-cons">
     <a-tabs @change="tabChange" type="card">
-      <a-tab-pane tab="单店菜单设置" key="1">
+      <!-- <a-tab-pane tab="单店菜单设置" key="1">
         <menusAuth types="dd"></menusAuth>
-      </a-tab-pane>
+      </a-tab-pane> -->
       <a-tab-pane tab="连锁店菜单设置" key="2">
         <menusAuth types="ls"></menusAuth>
       </a-tab-pane>
@@ -12,25 +12,25 @@
 </template>
 
 <script>
-  import menusAuth from './menusAuth.vue'
-  export default {
-    name: 'menusAuthTab',
-    components: {
-      menusAuth
-    },
-    data() {
-      return {}
-    },
-    methods: {
-      tabChange(v) {
-        console.log(v)
-      },
-    },
-    beforeRouteEnter (to, from, next) {
-      next(vm => {
-      })
-    },
+import menusAuth from './menusAuth.vue'
+export default {
+  name: 'MenusAuthTab',
+  components: {
+    menusAuth
+  },
+  data () {
+    return {}
+  },
+  methods: {
+    tabChange (v) {
+      console.log(v)
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+    })
   }
+}
 </script>
 
 <style>

+ 173 - 0
src/views/evaluation/evaluationItem/AddEvaIndexModal.vue

@@ -0,0 +1,173 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      :footer="null"
+      centered
+      :title="titleText"
+      v-model="isshow"
+      @cancle="cancel"
+      :width="600">
+      <a-form :form="form" ref="form" @submit="handleSubmit">
+        <a-row :gutter="24">
+          <a-col :span="20">
+            <!-- 考评指标名称 -->
+            <a-form-item label="考评指标名称:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+              <a-input
+                allowClear
+                id="addEvaIndexModal-name"
+                :maxLength="128"
+                v-decorator="[
+                  'formData.name',
+                  { initialValue: formData.name,
+                    getValueFromEvent: $filterEmpty,
+                    rules: [{ required: true, message: '请输入考评指标名称!' }] },
+                ]"
+                placeholder="请输入考评指标名称(最多128个字符)" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-form-item :wrapper-col="{ span: 15, offset: 9 }">
+          <a-button :loading="loading" id="addEvaIndexModal-submit" type="primary" @click="handleSubmit()">
+            保存
+          </a-button>
+          <a-button id="addEvaIndexModal-cancel" :style="{ marginLeft: '8px' }" @click="cancel()">
+            取消
+          </a-button>
+        </a-form-item>
+      </a-form>
+
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  itemIndexSave,
+  itemIndexDetail
+} from '@/api/evaluationItem.js'
+export default {
+  name: 'AddEvaIndexModal',
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    // 关联的考评项id
+    itemId: {
+      type: [String, Number],
+      default: ''
+    },
+    // 要编辑的考评指标id
+    itemIndexId: {
+	  type: [String, Number],
+	  default: ''
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (newValue) {
+		  // 编辑 查数据
+        if (this.itemIndexId) {
+          this.getData(this.itemIndexId)
+        }
+      } else {
+        this.cancel()
+      }
+    }
+  },
+  data () {
+    return {
+      isshow: this.visible, // 弹框显示隐藏
+      form: this.$form.createForm(this, {
+        name: 'AddEvaIndexModal'
+      }),
+      formData: {
+        name: '' // 指标名称
+      },
+	  loading: false // 确定按钮loading
+
+    }
+  },
+  computed: {
+    // 弹框标题
+    titleText () {
+      return this.itemIndexId ? '编辑' : '新增'
+    }
+  },
+  methods: {
+    // 点击弹框x号触发事件
+    cancel (e) {
+      this.clear()
+      this.$emit('close')
+    },
+    // 编辑时,获取数据详情
+    getData (id) {
+      itemIndexDetail({ id: id }).then(res => {
+        if (res.status == 200) {
+          // console.log(res, 'rrrrrrrrrr')
+          this.form.setFieldsValue({ 'formData.name': res.data.name })
+        }
+      })
+    },
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          this.loading = true
+          const params = this.itemIndexId ? Object.assign({ assessItemId: this.itemId, id: this.itemIndexId }, values.formData) : Object.assign({ assessItemId: this.itemId }, values.formData)
+          // console.log(params, 'ppppppppppppp')
+          itemIndexSave(params).then(res => {
+            console.log(res, 'res--save')
+            if (res.status + '' === '200') {
+              this.$message.success(res.message ? res.message : '保存成功')
+              this.$emit('refresh')
+              setTimeout(function () {
+                _this.cancel()
+              }, 300)
+            } else {
+              // this.$message.warning(res.message)
+            }
+            this.loading = false
+          })
+        }
+      })
+    },
+    clear () {
+      this.form.resetFields()
+    }
+
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, {
+      name: 'AddEvaIndexModal'
+    })
+  }
+
+}
+</script>
+
+<style scoped>
+	.modalBox {}
+
+	.ant-modal-footer {
+		display: none;
+	}
+
+	.time-text {
+		color: #1890FF;
+		padding: 0px 20px;
+		cursor: pointer;
+	}
+
+	.labelT {
+		position: absolute;
+		left: -135px;
+		top: 20px;
+		color: rgba(0, 0, 0, 0.85);
+	}
+</style>

+ 213 - 0
src/views/evaluation/evaluationItem/AddEvaItemModal.vue

@@ -0,0 +1,213 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      :footer="null"
+      centered
+      :title="titleText"
+      v-model="isshow"
+      @cancle="cancel"
+      :width="600">
+      <a-form :form="form" ref="form" @submit="handleSubmit">
+        <a-row :gutter="24">
+          <a-col :span="20">
+            <!-- 考评项目名称 -->
+            <a-form-item label="考评项目名称:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+              <a-input
+                allowClear
+                id="addEvaItemModal-name"
+                :maxLength="128"
+                v-decorator="[
+                  'formData.name',
+                  { initialValue: formData.name,
+                    getValueFromEvent: $filterEmpty,
+                    rules: [{ required: true, message: '请输入考评项目名称!' }] },
+                ]"
+                placeholder="请输入考评项目名称(最多128个字符)" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="20">
+            <!-- 考评项目说明 -->
+            <a-form-item label="考评项目说明:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+              <a-textarea
+                allowClear
+                id="addEvaItemModal-desc"
+                :maxLength="500"
+                Input.TextArea
+                :autoSize="{minRows:5}"
+                v-decorator="[
+                  'formData.desc',
+                  { initialValue: formData.desc,getValueFromEvent: $filterEmpty },
+                ]"
+                placeholder="请输入考评项目说明(最多500个字符)" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-form-item :wrapper-col="{ span: 15, offset: 9 }">
+          <a-button :loading="loading" id="addEvaItemModal-submit" type="primary" @click="handleSubmit()">
+            保存
+          </a-button>
+          <a-button id="addEvaItemModal-cancel" :style="{ marginLeft: '8px' }" @click="cancel()">
+            取消
+          </a-button>
+        </a-form-item>
+      </a-form>
+
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  itemDetail,
+  itemSave
+} from '@/api/evaluationItem.js'
+export default {
+  name: 'AddEvaItemModal',
+  components: {
+    STable,
+    VSelect
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    // 要编辑的项目id
+    itemId: {
+      type: [String, Number],
+      default: ''
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (newValue) {
+        this.form.resetFields()
+        // 编辑查详情
+        if (this.itemId) {
+          this.getFormData(this.itemId)
+        }
+      } else {
+        this.cancel()
+      }
+    }
+  },
+  data () {
+    return {
+      isshow: this.visible, // 弹框显示隐藏
+      form: this.$form.createForm(this, {
+        name: 'AddEvaItemModal'
+      }),
+      formData: {
+        name: '', // 方案名称
+        desc: '' // 方案说明
+      },
+	  loading: false // 确定按钮loading
+    }
+  },
+  computed: {
+    // 弹框标题
+    titleText () {
+      return this.itemId ? '编辑' : '新增'
+    }
+  },
+  methods: {
+    // 点击弹框x号触发事件
+    cancel (e) {
+      this.formData.name = ''
+      this.formData.desc = ''
+      this.$emit('close')
+    },
+    // 查详情
+    getFormData (id) {
+      itemDetail({
+        id: id
+      }).then(res => {
+        if (res.status == 200) {
+          // console.log(res, 'rrrrrrrrrr')
+          this.formData = Object.assign(this.formData, res.data)
+          console.log(this.formData, 'this.formData')
+        }
+      })
+    },
+    // 保存提交
+    handleSubmit () {
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          this.loading = true
+          const params = this.itemId ? Object.assign({
+            id: this.itemId
+          }, values.formData) : values.formData
+          // console.log(params, 'ppppppppppppp')
+          itemSave(params).then(res => {
+            console.log(res, 'res--save')
+            if (res.status + '' === '200') {
+              this.$message.success(res.message ? res.message : '保存成功')
+              this.$emit('refresh')
+              setTimeout(() => {
+                this.cancel()
+              }, 300)
+            } else {
+              // this.$message.warning(res.message)
+            }
+            this.loading = false
+          })
+        }
+      })
+    },
+    // 取消
+    handleCancel () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定取消吗?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          _this.cancel()
+        }
+      })
+    },
+    clear () {
+      this.form.resetFields()
+    }
+
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, {
+      name: 'AddEvaItemModal'
+    })
+  }
+
+}
+</script>
+
+<style scoped>
+	.modalBox {}
+
+	.ant-modal-footer {
+		display: none;
+	}
+
+	.time-text {
+		color: #1890FF;
+		padding: 0px 20px;
+		cursor: pointer;
+	}
+
+	.labelT {
+		position: absolute;
+		left: -135px;
+		top: 20px;
+		color: rgba(0, 0, 0, 0.85);
+	}
+</style>

+ 265 - 0
src/views/evaluation/evaluationItem/EvaluationItem.vue

@@ -0,0 +1,265 @@
+<template>
+  <a-card :bordered="false">
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="48">
+          <a-col :span="6">
+            <a-form-item label="考评项目名称">
+              <a-input id="evaluationItem-name" allowClear v-model.trim="queryParam.name" placeholder="请输入考评项目名称" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="启用状态">
+              <v-select
+                id="evaluationItem-status"
+                ref="status"
+                allowClear
+                placeholder="状态"
+                v-model="queryParam.status"
+                code="ENABLE_FLAG"></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-button id="evaluationItem-search" type="primary" style="margin-right: 10px;" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button id="evaluationItem-reset" type="" @click="reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <a-divider />
+    <div class="table-operator">
+      <a-button id="evaluationItem-add" type="primary" icon="plus" @click="openModal">新增</a-button>
+    </div>
+    <s-table
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-icon id="evaluationItem-setting" title="设置考评指标" type="setting" class="actionBtn icon-orange" @click="handleSet(record)" />
+        <a-icon
+          id="evaluationItem-edit"
+          type="edit"
+          title="编辑"
+          class="actionBtn icon-blues"
+          v-if="record.status == '0'"
+          @click="openModal(record)" />
+        <a-icon
+          id="evaluationItem-delete"
+          title="删除"
+          type="delete"
+          class="actionBtn icon-red"
+          v-if="record.status == '0'"
+          @click="delect(record)" />
+      </template>
+      <!-- 启用禁用 -->
+      <template slot="enable" slot-scope="text, row">
+        <a-switch id="evaluationItem-enableStatus" checkedChildren="启用" unCheckedChildren="禁用" v-model="row.status" @change="changeFlagHandle(row)" />
+      </template>
+    </s-table>
+    <!-- 新增/编辑 弹窗 -->
+    <add-evaItemModal :itemId="itemId" :visible="openAddModal" @refresh="reset" @close="openAddModal=false"></add-evaItemModal>
+    <!-- 设置弹窗 -->
+    <set-evaItemModal :itemId="itemId" :itemName="itemName" :visible="openSetting" @close="openSetting=false"></set-evaItemModal>
+  </a-card>
+
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  getItemListByPage,
+  itemDelete,
+  itemEnable
+} from '@/api/evaluationItem.js'
+import addEvaItemModal from './AddEvaItemModal.vue'
+import setEvaItemModal from './SetEvaItemModal.vue'
+import moment from 'moment'
+export default {
+  name: 'EvaluationPlanList',
+  components: {
+    STable,
+    VSelect,
+    addEvaItemModal,
+    setEvaItemModal
+  },
+  data () {
+    return {
+      moment,
+      pageNo: 1,
+      pageSize: 10,
+      openAddModal: false, // 打开新增弹窗
+      openSetting: false, // 打开设置弹窗
+      itemId: '', // 要编辑的考评项id
+      itemName: '', // 要编辑的考评项名称
+      // 查询参数
+      queryParam: {
+        name: '', // 项目名称
+        status: '' // 状态
+      },
+      // 表头
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '考评项目名称',
+        dataIndex: 'name',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '考评项目说明',
+        dataIndex: 'desc',
+        width: 300,
+        align: 'center',
+        customRender: (text) => {
+		  return text || '--'
+        }
+      },
+      {
+        title: '状态',
+        width: 150,
+        align: 'center',
+        dataIndex: 'status',
+        scopedSlots: {
+          customRender: 'enable'
+        }
+      },
+      {
+        title: '操作',
+        width: 200,
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return getItemListByPage(Object.assign(parameter, this.queryParam)).then(res => {
+          if (res.status == 200) {
+            const no = (res.data.pageNo - 1) * res.data.pageSize
+            for (let i = 0; i < res.data.list.length; i++) {
+              const _item = res.data.list[i]
+              _item.no = no + i + 1
+              _item.status = _item.status + '' === '1'
+            }
+            res.data.count = Number(res.data.count)
+            return res.data
+          }
+        })
+      }
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.reset()
+    })
+  },
+  methods: {
+    // 修改状态
+    changeFlagHandle (record) {
+      // console.log(record, '222222222')
+      const _data = {
+        id: record.id,
+        status: record.status ? '1' : '0'
+      }
+      itemEnable(_data).then(res => {
+        console.log(res.status)
+        if (res.status == '200') {
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+        } else {
+          record.status = !record.status
+        }
+      })
+    },
+    // 打开新增弹窗
+    openModal (row) {
+      this.itemId = row ? row.id : ''
+      this.openAddModal = true
+    },
+    // 删除
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        centered: true,
+        content: '删除考评项目时,其关联的考评指标将被同步删除,确认删除吗?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          itemDelete({
+            id: row.id
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+          })
+        }
+      })
+    },
+    // 打开设置弹框
+    handleSet (row) {
+      this.openSetting = true
+      this.itemId = row.id
+      this.itemName = row.name
+    },
+    // 重置
+    reset () {
+      this.queryParam = {
+        name: '',
+        status: '' // 状态
+      }
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>
+<style>
+	.table-page-search-wrapper,
+	.addButton {
+		margin-bottom: 0;
+	}
+
+	.table-page-search-wrapper .ant-form-inline .ant-form-item {
+		margin-bottom: 10px;
+	}
+
+	.table-operator {
+		margin-bottom: 10px;
+	}
+
+	.textCount {
+		border: 1px solid #91d5ff;
+		background-color: #e6f7ff;
+		padding: 10px 0;
+		border-radius: 5px;
+		padding-left: 20px;
+		margin: 10px 0;
+	}
+
+	.action-button {
+		line-height: 40px;
+		white-space: nowrap;
+		padding: 5px 10px;
+		background-color: #1890ff;
+		border-radius: 4px;
+		color: #fff;
+		margin-right: 5px;
+	}
+
+	.menu-text {
+		background-color: #f90;
+	}
+</style>

+ 172 - 0
src/views/evaluation/evaluationItem/SetEvaItemModal.vue

@@ -0,0 +1,172 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      :footer="null"
+      centered
+      title="设置考评指标"
+      v-model="isshow"
+      @cancle="cancel"
+      :width="'60%'">
+      <a-row :gutter="24" class="header">
+        <div>请给考评项目为【{{ itemName }}】设置考评指标</div>
+        <a-button id="setEvaItemModal-add" type="primary" @click="openModal">新增考评指标</a-button>
+      </a-row>
+      <a-table
+        ref="table"
+        size="default"
+        :pagination="false"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :dataSource="list"
+        bordered>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-icon id="setEvaItemModal-edit" title="编辑" type="edit" class="actionBtn icon-blues" @click="openModal(record)" />
+          <a-icon id="setEvaItemModal-delete" title="删除" type="delete" class="actionBtn icon-red" @click="delect(record)" />
+        </template>
+      </a-table>
+      <!-- 新增/编辑 弹窗 -->
+      <add-evaIndexModal :itemId="itemId" :itemIndexId="itemIndexId" :visible="openAddModal" @refresh="getList" @close="openAddModal=false"></add-evaIndexModal>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  itemIndexQuery,
+  itemIndexDelete
+} from '@/api/evaluationItem.js'
+import addEvaIndexModal from './AddEvaIndexModal.vue'
+export default {
+  name: 'SetEvaItemModal',
+  components: {
+    addEvaIndexModal
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    // 要编辑的考评项id
+    itemId: {
+      type: [String, Number],
+      default: ''
+    },
+    // 要编辑的考评项名称
+    itemName: {
+      type: String,
+      default: ''
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (newValue) {
+        this.getList()
+      } else {
+        this.cancel()
+      }
+    }
+  },
+  data () {
+    return {
+      isshow: this.visible, // 弹框显示隐藏
+      openAddModal: false, // 是否打开编辑/新增弹框
+      itemIndexId: '', // 考评指标id
+      // 表头
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '考评指标名称',
+        dataIndex: 'name',
+        width: 300,
+        align: 'center'
+      },
+      {
+        title: '操作',
+        width: 150,
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      list: []
+    }
+  },
+  computed: {},
+  methods: {
+    // 获取列表数据
+    getList () {
+      itemIndexQuery({
+        assessItemId: this.itemId
+      }).then(res => {
+        if (res.status == 200) {
+          res.data.map((item, index) => {
+            item.no = index + 1
+          })
+          this.list = res.data
+        } else {
+          this.list = []
+        }
+      })
+    },
+    // 点击弹框x号触发事件
+    cancel (e) {
+      this.$emit('close')
+    },
+    // 打开新增/编辑 弹窗
+    openModal (row) {
+      this.itemIndexId = row ? row.id : ''
+      this.openAddModal = true
+    },
+    // 删除考评指标
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        centered: true,
+        content: '删除后原数据不可恢复,是否删除?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          itemIndexDelete({
+            id: row.id
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.getList()
+            }
+          })
+        }
+      })
+    }
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, {
+      name: 'SetEvaItemModal'
+    })
+  }
+
+}
+</script>
+
+<style lang="less">
+	.modalBox{
+	  .header {
+	  	font-size: 16px;
+	  	font-weight: 600;
+	    padding: 0 15px 20px 15px;
+	  }
+	  .header div {
+	  	margin-bottom: 20px;
+	  }
+	}
+</style>

+ 253 - 0
src/views/evaluation/evaluationPlan/AddEvaModal.vue

@@ -0,0 +1,253 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      :footer="null"
+      centered
+      :title="titleText"
+      v-model="isshow"
+      @cancle="cancel"
+      :width="600">
+      <a-form :form="form" :model="formData" ref="form" @submit="handleSubmit">
+        <a-row :gutter="24">
+          <a-col :span="20">
+            <!-- 考评方案名称 -->
+            <a-form-item label="考评方案名称:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+              <a-input
+                allowClear
+                id="addEvaModal-name"
+                :maxLength="128"
+                v-decorator="[
+                  'formData.name',
+                  { initialValue: formData.name,
+                    getValueFromEvent: $filterEmpty,
+                    rules: [{ required: true, message: '请输入考评方案名称!' }] },
+                ]"
+                placeholder="请输入考评方案名称(最多128个字符)" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+
+        <a-row :gutter="24">
+          <a-col :span="20">
+            <!-- 适用模式 -->
+            <a-form-item label="适用模式:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+              <v-select
+                ref="orgType"
+                id="addEvaModal-scopeType"
+                allowClear
+                mode="multiple"
+                @change="scopeTypeChange"
+                v-decorator="[
+                  'formData.scopeType',
+                  { initialValue: formData.scopeType,
+                    rules: [{ required: true, message: '请选择适用模式!' }] },
+                ]"
+                code="ASSESS_SCHEME_SCOPE_TYPE"></v-select>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="20">
+            <!-- 考评方案说明 -->
+            <a-form-item label="考评方案说明:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+              <a-textarea
+                allowClear
+                id="addEvaModal-desc"
+                :maxLength="500"
+                Input.TextArea
+                :autoSize="{minRows:5}"
+                v-decorator="[
+                  'formData.desc',
+                  { initialValue: formData.desc,getValueFromEvent: $filterEmpty },
+                ]"
+                placeholder="请输入考评方案说明(最多500个字符)" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-form-item :wrapper-col="{ span: 24, offset: 10 }">
+          <a-button :loading="loading" id="addEvaModal-submit" type="primary" @click="handleSubmit()">
+            保存
+          </a-button>
+          <a-button id="addEvaModal-cancel" :style="{ marginLeft: '8px' }" @click="cancel()">
+            取消
+          </a-button>
+        </a-form-item>
+      </a-form>
+
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  VSelect
+} from '@/components'
+import {
+  planSave,
+  planDetail
+} from '@/api/evaluationPlan.js'
+export default {
+  name: 'AddEvaModal',
+  components: {
+    VSelect
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    // 要编辑的方案id
+    itemId: {
+      type: [String, Number],
+      default: ''
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (newValue) {
+        this.form.resetFields()
+        // 编辑查详情
+        if (this.itemId) {
+          this.getFormData(this.itemId)
+        }
+      } else {
+        this.cancel()
+      }
+    }
+  },
+  data () {
+    return {
+      isshow: this.visible, // 弹框显示隐藏
+      form: this.$form.createForm(this, {
+        name: 'AddEvaModal'
+      }),
+      formData: {
+        name: '', // 方案名称
+        scopeType: [], // 适用类型
+        desc: '' // 方案说明
+      },
+      loading: false, // 确定按钮loading
+      options: [{
+        code: 'VIDEO_INSPECTION',
+        dispName: '视频巡店',
+        id: 1
+      },
+      {
+        code: 'SPOT_INSPECTION',
+        dispName: '现场巡店',
+        id: 12
+      },
+      {
+        code: 'POINT_INSPECTION',
+        dispName: '点检',
+        id: 13
+      }
+      ]
+    }
+  },
+  computed: {
+    // 弹框标题
+    titleText () {
+      return this.itemId ? '编辑' : '新增'
+    }
+  },
+  methods: {
+    // 点击弹框x号触发事件
+    cancel (e) {
+      this.formData = {
+        name: '', // 方案名称
+        scopeType: [], // 适用类型
+        desc: '' // 方案说明
+      }
+      this.$emit('close')
+    },
+    // 查详情
+    getFormData (id) {
+      planDetail({
+        id: id
+      }).then(res => {
+        if (res.status == 200) {
+          // console.log(res, 'rrrrrrrrrr')
+          this.formData = Object.assign(this.formData, res.data)
+          this.formData.scopeType = this.formData.scopeType.split(',')
+        }
+      })
+    },
+    // 使用模式改变
+    scopeTypeChange (v) {
+      this.formData.scopeType = v
+    },
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          this.loading = true
+          const params = this.itemId ? Object.assign({
+            id: this.itemId
+          }, values.formData) : values.formData
+          params.scopeType = params.scopeType.join(',')
+          // console.log(params, 'ppppppppppppp')
+          planSave(params).then(res => {
+            console.log(res, 'res--save')
+            if (res.status + '' === '200') {
+              this.$message.success(res.message ? res.message : '保存成功')
+              this.$emit('refresh')
+              setTimeout(function () {
+                _this.cancel()
+              }, 300)
+            } else {
+              // this.$message.warning(res.message)
+            }
+            this.loading = false
+          })
+        }
+      })
+    },
+    // 取消
+    handleCancel () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定取消吗?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          _this.cancel()
+        }
+      })
+    }
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, {
+      name: 'AddEvaModal'
+    })
+  }
+
+}
+</script>
+
+<style scoped>
+	.modalBox {}
+
+	.ant-modal-footer {
+		display: none;
+	}
+
+	.time-text {
+		color: #1890FF;
+		padding: 0px 20px;
+		cursor: pointer;
+	}
+
+	.labelT {
+		position: absolute;
+		left: -135px;
+		top: 20px;
+		color: rgba(0, 0, 0, 0.85);
+	}
+</style>

+ 317 - 0
src/views/evaluation/evaluationPlan/EvaluationPlan.vue

@@ -0,0 +1,317 @@
+<template>
+  <a-card :bordered="false">
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="48">
+          <a-col :span="6">
+            <a-form-item label="方案名称">
+              <a-input id="evaluationPlan-name" allowClear v-model.trim="queryParam.name" placeholder="请输入方案名称" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="启用状态">
+              <v-select
+                id="evaluationPlan-status"
+                ref="status"
+                allowClear
+                placeholder="状态"
+                v-model="queryParam.status"
+                code="ENABLE_FLAG"></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-button id="evaluationPlan-search" type="primary" style="margin-right: 10px;" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button id="evaluationPlan-reset" type="" @click="reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <a-divider />
+    <a-row class="add-btn" type="flex" justify="space-between">
+      <a-button id="evaluationPlan-add" type="primary" icon="plus" @click="openModal">新增</a-button>
+      <!-- 目前版本不要 -->
+      <!-- <a-col id="evaluationPlan-setDefaultPlan" @click="handleDefaultSet">
+        <a-icon type="setting" class="setting-icon" />
+        <span class="setting">默认方案设置</span>
+      </a-col> -->
+    </a-row>
+    <s-table
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-icon id="evaluationPlan-setting" title="选择考评项目" type="setting" class="actionBtn icon-orange" @click="handleSet(record)" />
+        <a-icon
+          id="evaluationPlan-edit"
+          title="编辑"
+          type="edit"
+          class="actionBtn icon-blues"
+          v-if="record.status == '0'"
+          @click="openModal(record)" />
+        <a-icon
+          id="evaluationPlan-delete"
+          title="删除"
+          type="delete"
+          class="actionBtn icon-red"
+          v-if="record.status == '0'"
+          @click="delect(record)" />
+      </template>
+      <!-- 启用禁用 -->
+      <template slot="enable" slot-scope="text, row">
+        <a-switch id="evaluationPlan-enableStatus" checkedChildren="启用" unCheckedChildren="禁用" v-model="row.status" @change="changeFlagHandle(row)" />
+      </template>
+    </s-table>
+    <!-- 新增/编辑 弹窗 -->
+    <add-evaModal :itemId="itemId" :visible="openAddModal" @refresh="reset" @close="openAddModal=false"></add-evaModal>
+    <!-- 选择考评项弹窗 -->
+    <set-evaModal :itemId="itemId" :itemName="itemName" :visible="openSetting" @close="openSetting=false"></set-evaModal>
+    <!-- 设置默认方案弹窗 -->
+    <set-evaDefaultModal :itemId="itemId" :defaultPlanList="defaultPlanList" :visible="openDefaultSetting" @refresh="getDefaultPlan" @close="openDefaultSetting=false"></set-evaDefaultModal>
+  </a-card>
+
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  planQueryByPage,
+  planEnable,
+  planDefaultQuery,
+  planDelete
+} from '@/api/evaluationPlan.js'
+import addEvaModal from './AddEvaModal.vue'
+import setEvaModal from './SetEvaModal.vue'
+import setEvaDefaultModal from './SetEvaDefaultModal.vue'
+export default {
+  name: 'EvaluationPlanList',
+  components: {
+    STable,
+    VSelect,
+    addEvaModal,
+    setEvaModal,
+    setEvaDefaultModal
+  },
+  data () {
+    return {
+      pageNo: 1,
+      pageSize: 10,
+      openAddModal: false, // 打开新增弹窗
+      openSetting: false, // 打开选择考评项弹窗
+      openDefaultSetting: false, // 打开设置默认方案弹窗
+      itemId: '', // 要编辑的方案id
+      itemName: '', // 方案名称
+      defaultPlanList: [], // 默认方案列表
+      // 查询参数
+      queryParam: {
+        name: '',
+        status: '' // 状态
+      },
+      // 表头
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '考评方案名称',
+        dataIndex: 'name',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '考评方案说明',
+        dataIndex: 'desc',
+        width: 300,
+        align: 'center',
+        customRender: (text) => {
+          return text || '--'
+        }
+      },
+      {
+        title: '适用模式',
+        width: 200,
+        align: 'center',
+        dataIndex: 'scopeTypeDictValue'
+      },
+      {
+        title: '状态',
+        width: 150,
+        align: 'center',
+        dataIndex: 'status',
+        scopedSlots: {
+          customRender: 'enable'
+        }
+      },
+      {
+        title: '操作',
+        width: 200,
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        return planQueryByPage(Object.assign(parameter, this.queryParam)).then(res => {
+          if (res.status == 200) {
+            const no = (res.data.pageNo - 1) * res.data.pageSize
+            for (let i = 0; i < res.data.list.length; i++) {
+              const _item = res.data.list[i]
+              _item.no = no + i + 1
+              _item.status = _item.status + '' === '1'
+            }
+            return res.data
+          }
+        })
+      }
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.reset()
+      vm.getDefaultPlan()
+    })
+  },
+  methods: {
+    // 默认方案查询
+    getDefaultPlan () {
+      planDefaultQuery().then(res => {
+        // console.log(res, 'rrrrrrrr')
+        if (res.status == 200) {
+          this.defaultPlanList = res.data
+        } else {
+          this.defaultPlanList = []
+        }
+      })
+    },
+    // 修改状态
+    changeFlagHandle (record) {
+      const _data = {
+        id: record.id,
+        status: record.status ? '1' : '0'
+      }
+      planEnable(_data).then(res => {
+        console.log(res.status)
+        if (res.status == '200') {
+          this.$message.success('修改成功')
+          this.$refs.table.refresh()
+        } else {
+          record.status = !record.status
+        }
+      })
+    },
+    // 打开新增弹窗
+    openModal (row) {
+      this.itemId = row ? row.id : ''
+      this.openAddModal = true
+    },
+    // 打开默认方案设置弹窗
+    handleDefaultSet () {
+      this.openDefaultSetting = true
+    },
+    // 删除
+    delect (row) {
+      const _this = this
+      // 判断当前方案是否为默认方案
+      const has = this.defaultPlanList.find(item => item.assessId == row.id)
+      if (has) {
+        this.$warning({
+          title: '警告',
+		  centered: true,
+          content: '该考评方案为当前默认考评方案,不能删除,请取消该方案的默认后再进行删除!'
+        })
+      } else {
+        this.$confirm({
+          title: '警告',
+		  centered: true,
+          content: '删除后原数据不可恢复,是否删除?',
+          okText: '确定',
+          cancelText: '取消',
+          onOk () {
+            planDelete({
+              id: row.id
+            }).then(res => {
+              if (res.status == 200) {
+                _this.$message.success(res.message)
+                _this.$refs.table.refresh()
+              }
+            })
+          }
+        })
+      }
+    },
+    // 打开设置弹框
+    handleSet (row) {
+      this.itemId = row.id
+      this.itemName = row.name
+      this.openSetting = true
+      console.log(this.openSetting)
+    },
+    // 重置
+    reset () {
+      this.queryParam = {
+        name: '',
+        status: '' // 状态
+      }
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>
+<style scoped>
+	.table-page-search-wrapper,
+	.addButton {
+		margin-bottom: 0;
+	}
+
+	.table-page-search-wrapper .ant-form-inline .ant-form-item {
+		margin-bottom: 10px;
+	}
+
+	.add-btn {
+		margin-bottom: 10px;
+	}
+
+	.actionBtn {
+		font-size: 20px;
+		padding: 0 10px;
+	}
+
+	.setting-icon {
+		font-size: 20px;
+		margin-right: 5px;
+		color: #1890FF;
+	}
+
+	.setting {
+		font-size: 16px;
+		color: #1890FF;
+		border-bottom: 1px solid #1890FF;
+		cursor: pointer;
+	}
+
+	.blue {
+		color: #1890FF;
+	}
+
+	.green {
+		color: #16b50e;
+	}
+
+	.red {
+		color: red;
+	}
+
+	.orange {
+		color: #ffaa00;
+	}
+</style>

+ 244 - 0
src/views/evaluation/evaluationPlan/SetEvaDefaultModal.vue

@@ -0,0 +1,244 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      :footer="null"
+      title="默认方案设置"
+	  centered
+      v-model="isshow"
+      @cancle="cancel"
+      :width="600">
+      <a-form :form="form" ref="form" @submit="handleSubmit">
+        <a-row :gutter="24">
+          <a-col :span="24">
+            <!-- 视频巡店默认方案 -->
+            <a-form-item label="视频巡店默认方案:" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }">
+              <a-select
+                id="setEvaDefaultModal-videoType"
+                @change="videoTypeChange"
+                v-decorator="[
+                  'formData.videoType',
+                  { initialValue: formData.videoType,
+                    rules: [{ required: true, message: '请选择考评方案(单选)!' }] },
+                ]"
+                placeholder="请选择考评方案(单选)"
+              >
+                <a-select-option v-for="item in planList" :key="item.id" :value="item.id">
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="24">
+            <!-- 现场巡店默认方案 -->
+            <a-form-item label="现场巡店默认方案:" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }">
+              <a-select
+                id="setEvaDefaultModal-spotType"
+                placeholder="请选择考评方案(单选)"
+                @change="spotTypeChange"
+                v-decorator="[
+                  'formData.spotType',
+                  { initialValue: formData.spotType,
+                    rules: [{ required: true, message: '请选择考评方案(单选)!' }] },
+                ]">
+                <a-select-option v-for="item in planList" :key="item.id" :value="item.id">
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="22">
+            说明:如果默认方案被删除,系统将自动获取对应类别下最新一条启用的模板作为默认方案模板
+          </a-col>
+        </a-row>
+        <a-form-item :wrapper-col="{ span: 24, offset: 10 }">
+          <a-button :loading="loading" id="setEvaDefaultModal-submit" type="primary" @click="handleSubmit()">
+            保存
+          </a-button>
+          <a-button id="setEvaDefaultModal-cancle" :style="{ marginLeft: '8px' }" @click="cancel()">
+            取消
+          </a-button>
+        </a-form-item>
+      </a-form>
+
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  planQuery,
+  planDefaultSave
+} from '@/api/evaluationPlan.js'
+export default {
+  name: 'AddEvaModal',
+  components: {
+    STable,
+    VSelect
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    // 要编辑的方案id
+    itemId: {
+      type: [String, Number],
+      default: ''
+    },
+    // 默认方案
+    defaultPlanList: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (newValue) {
+        this.form.resetFields()
+        // 默认方案回显
+        this.pageInit()
+      } else {
+        this.cancel()
+      }
+    }
+  },
+  data () {
+    return {
+      isshow: this.visible, // 弹框显示隐藏
+      form: this.$form.createForm(this, {
+        name: 'AddEvaModal'
+      }),
+	  // 默认值设为undefined, 解决placeholder不生效问题
+      formData: {
+        videoType: undefined, // 视频巡店默认方案
+        spotType: undefined // 现场巡店默认方案
+      },
+      planList: [], // 考评方案列表
+	  loading: false // 确定按钮loading
+    }
+  },
+  computed: {},
+  mounted () {
+    // 获取方案列表数据
+    this.getPlanList()
+  },
+  methods: {
+    pageInit () {
+      if (this.defaultPlanList.length) {
+        this.formData.videoType = this.defaultPlanList.find(item => item.scopeType == 'VIDEO_INSPECTION').assessId
+        this.formData.spotType = this.defaultPlanList.find(item => item.scopeType == 'SPOT_INSPECTION').assessId
+      }
+    },
+    // 点击弹框x号触发事件
+    cancel (e) {
+      this.formData.videoType = undefined
+      this.formData.spotType = undefined
+      this.$emit('close')
+    },
+    // 获取方案列表数据
+    getPlanList () {
+      planQuery().then(res => {
+        if (res.status == 200) {
+          this.planList = res.data
+        } else {
+          this.planList = []
+        }
+      })
+    },
+    // 视频巡店默认方案改变
+    videoTypeChange (v) {
+      this.formData.videoType = v
+    },
+    // 现场巡店默认方案改变
+    spotTypeChange (v) {
+      this.formData.spotType = v
+    },
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          this.loading = true
+          const params = [{
+            assessId: values.formData.videoType,
+            scopeType: 'VIDEO_INSPECTION'
+          },
+          {
+            assessId: values.formData.spotType,
+            scopeType: 'SPOT_INSPECTION'
+          }
+          ]
+          planDefaultSave(params).then(res => {
+            console.log(res, 'res--save')
+            if (res.status + '' === '200') {
+              this.$message.success(res.message ? res.message : '保存成功')
+			  // 保存后更新默认方案
+			  this.$emit('refresh')
+              setTimeout(function () {
+                _this.cancel()
+              }, 300)
+            } else {
+              // this.$message.warning(res.message)
+            }
+            this.loading = false
+          })
+        }
+      })
+    },
+    // 取消
+    handleCancel () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定取消吗?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          _this.cancel()
+        }
+      })
+    }
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, {
+      name: 'AddEvaModal'
+    })
+  }
+
+}
+</script>
+
+<style scoped>
+	.modalBox {}
+
+	.ant-modal-footer {
+		display: none;
+	}
+
+	.time-text {
+		color: #1890FF;
+		padding: 0px 20px;
+		cursor: pointer;
+	}
+
+	.labelT {
+		position: absolute;
+		left: -135px;
+		top: 20px;
+		color: rgba(0, 0, 0, 0.85);
+	}
+</style>

+ 393 - 0
src/views/evaluation/evaluationPlan/SetEvaModal.vue

@@ -0,0 +1,393 @@
+<template>
+  <div>
+    <a-modal
+      class="modalBox"
+      :footer="null"
+      centered
+      title="选择考评项"
+      v-model="isshow"
+      @cancle="cancel"
+      :width="'80%'">
+      <a-row :gutter="24">
+        <a-col class="title" :span="20">
+          <!-- 考评方案名称 -->
+          <span>考评方案名称: {{ itemName }}</span>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-form :form="form" ref="form" @submit="handleSubmit">
+          <a-card class="card-content">
+            <a-col :span="15">
+              <p>已选考评项目:</p>
+              <!-- 已选考评项列表 -->
+              <a-table
+                ref="table"
+                size="default"
+                :scroll="{y:400}"
+                :pagination="false"
+                :rowKey="(record) => record.id"
+                :columns="columns"
+                :dataSource="checkedList"
+                bordered>
+                <!-- 操作 -->
+                <template slot="action" slot-scope="text, record, index">
+                  <a-button
+                    id="setEvaModal-moveUp"
+                    type="primary"
+                    ghost
+                    size="small"
+                    class="actionBtn"
+                    @click="moveUp(index)"
+                    v-if="index>0"
+                    icon="arrow-up">上移</a-button>
+                  <a-button
+                    id="setEvaModal-moveDown"
+                    type="primary"
+                    ghost
+                    size="small"
+                    class="actionBtn"
+                    @click="moveDown(index)"
+                    v-if="index < checkedList.length-1"
+                    icon="arrow-down">下移</a-button>
+                  <a-button
+                    id="setEvaModal-moveTop"
+                    type="danger"
+                    ghost
+                    size="small"
+                    class="actionBtn"
+                    @click="moveTop(index)"
+                    v-if="index>0"
+                    icon="up">置顶</a-button>
+                  <a-button
+                    id="setEvaModal-moveBottom"
+                    type="danger"
+                    ghost
+                    size="small"
+                    class="actionBtn"
+                    @click="moveBottom(index)"
+                    v-if="index < checkedList.length-1"
+                    icon="down">置底</a-button>
+                </template>
+              </a-table>
+
+            </a-col>
+            <a-col span="1" class="divider">
+            </a-col>
+            <a-col span="8">
+              <a-row>
+                <p>请选择需要的考评项目:</p>
+              </a-row>
+              <s-table
+                ref="tableItem"
+                size="default"
+                :scroll="{y:400}"
+                :showPagination="false"
+                :row-selection="rowSelection"
+                :rowKey="(record) => record.id"
+                :columns="itemColumns"
+                :data="loadItemData"
+                bordered>
+                <!-- 启用禁用 -->
+                <template slot="enable" slot-scope="text, row">
+                  <span :class="[text==1 ? 'green' : 'grey']">{{ text==1 ? '启用' : '禁用' }}</span>
+                </template>
+              </s-table>
+            </a-col>
+          </a-card>
+          <a-form-item class="footer" :wrapper-col="{ span: 24, offset: 12 }">
+            <a-button :loading="loading" id="setEvaModal-submit" type="primary" @click="handleSubmit()">
+              保存
+            </a-button>
+            <a-button id="setEvaModal-cancel" :style="{ marginLeft: '8px' }" @click="cancel()">
+              取消
+            </a-button>
+          </a-form-item>
+        </a-form>
+      </a-row>
+
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  planItemQuery,
+  planItemSave
+} from '@/api/evaluationPlan.js'
+import { getItemList } from '@/api/evaluationItem.js'
+export default {
+  name: 'AddEvaModal',
+  components: {
+    STable,
+    VSelect
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    // 要编辑的方案id
+    itemId: {
+      type: [String, Number],
+      default: ''
+    },
+    // 要编辑的方案名字
+    itemName: {
+	  type: String,
+	  default: ''
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (newValue) {
+        // 获取已选列表数据
+        this.getCheckedList()
+      } else {
+        this.cancel()
+      }
+    }
+  },
+  data () {
+    return {
+      isshow: this.visible, // 弹框显示隐藏
+      form: this.$form.createForm(this, {
+        name: 'SetEvaModal'
+      }),
+      loading: false, // 确定按钮loading
+      // 已选考评项数据
+      checkedList: [], // 已选考评项列表
+      // 表头
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '考评项目名称',
+        dataIndex: 'assessItemName',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '操作',
+        width: 200,
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
+        }
+      }
+      ],
+      // 考评项列表数据
+      itemColumns: [{
+        title: '考评项目名称',
+        dataIndex: 'name',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '状态',
+        width: 100,
+        dataIndex: 'status',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'enable'
+        }
+      }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadItemData: parameter => {
+        return getItemList().then(res => {
+          if (res.status == 200) {
+            return res.data
+          }
+        })
+      }
+    }
+  },
+  computed: {
+    // 已选择的复选框
+    selectedRowKeys () {
+      const arr = []
+      this.checkedList.map(item => {
+        arr.push(item.assessItemId)
+      })
+      return arr
+    },
+    // 列表项是否可选择的配置
+    rowSelection () {
+      return {
+        columnTitle: '选择', // 选择框标题
+        columnWidth: 80, // 选择框宽度
+        selectedRowKeys: this.selectedRowKeys, // 指定选中项的 key 数组
+        // 选中项发生变化时的回调 selectedRowKeys:指定选中项的 key 数组 selectedRows:已选中的数组数据
+        onChange: (selectedRowKeys, selectedRows) => {
+          const arr = []
+          let index = 0
+  		  // 根据选择项的顺序展示已选列表
+          selectedRowKeys.map(item => {
+            index++
+            const p = selectedRows.find(row => row.id == item)
+            const row = {}
+            if (p) {
+              row.no = index
+			  row.assessItemId = p.id
+			  row.assessItemName = p.name
+			  row.assessSchemeId = this.itemId
+              arr.push(row)
+            }
+          })
+          this.checkedList = arr
+          // console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
+        },
+        getCheckboxProps: record => ({
+          props: {
+            disabled: record.status == '0' // 禁用状态不可选
+          }
+        })
+      }
+    }
+  },
+  methods: {
+    // 获取已选列表数据
+    getCheckedList () {
+      planItemQuery({ assessSchemeId: this.itemId }).then(res => {
+        if (res.status == 200) {
+          this.checkedList = res.data
+          this.checkedList.map((item, index) => {
+            item.no = index + 1
+          })
+        } else {
+          this.checkedList = []
+          this.$message.warning(res.message)
+        }
+      })
+    },
+    // 点击弹框x号触发事件
+    cancel (e) {
+      this.clear()
+      this.$emit('close')
+    },
+    // 上移
+    moveUp (index) {
+      this.moveArr(index, index - 1)
+    },
+    // 下移
+    moveDown (index) {
+      this.moveArr(index, index + 1)
+    },
+    // 置顶
+    moveTop (index) {
+      this.goToArr(index, 1)
+    },
+    // 置底
+    moveBottom (index) {
+      this.goToArr(index, 0)
+    },
+    // 置顶和置底
+    goToArr (index, type) {
+      const arr = this.checkedList
+      const row = arr[index]
+      arr.splice(index, 1)
+      if (type) {
+        arr.unshift(row)
+      } else {
+        arr.push(row)
+      }
+      arr.map((item, index) => {
+        item.no = index + 1
+      })
+    },
+    // 移动
+    moveArr (index1, index2) {
+      const arr = this.checkedList
+      arr[index1] = arr.splice(index2, 1, arr[index1])[0]
+      arr.map((item, index) => {
+        item.no = index + 1
+      })
+      this.checkedList = arr
+    },
+    // 保存提交
+    handleSubmit () {
+      const _this = this
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          if (!this.checkedList.length) {
+            return this.$message.warning('请先选择考评项目')
+          }
+		  this.loading = true
+          planItemSave(this.checkedList).then(res => {
+            console.log(res, 'res--save')
+            if (res.status + '' === '200') {
+              this.$message.success(res.message ? res.message : '保存成功')
+              this.$emit('refresh')
+              setTimeout(function () {
+                _this.cancel()
+              }, 300)
+            } else {
+              // this.$message.warning(res.message)
+            }
+            this.loading = false
+          })
+        }
+      })
+    },
+    // 取消
+    handleCancel () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定取消吗?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          _this.clear()
+          _this.cancel()
+        }
+      })
+    },
+    clear () {
+      this.form.resetFields()
+    }
+
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, {
+      name: 'SetEvaModal'
+    })
+  }
+
+}
+</script>
+
+<style scoped>
+	.title {
+		font-size: 16px;
+		color: black;
+		padding-bottom: 30px;
+	}
+
+	.actionBtn {
+		font-size: 12px;
+		margin: 0 5px;
+	}
+
+	.green {
+		color: #16b50e;
+	}
+
+	.grey {
+		color: rgb(153, 153, 153);
+	}
+
+	.footer {
+		margin-top: 20px;
+	}
+</style>

+ 16 - 18
src/views/power/OperateJournal/OperateJournal.vue

@@ -2,20 +2,26 @@
   <a-card :bordered="false">
     <div class="operateJournal">
       <!-- 搜索框 -->
-      <div class="table-page-search-wrapper">
+      <div class="table-page-search-wrapper" style="margin-bottom: 15px;">
         <a-form layout="inline">
           <a-row :gutter="48">
             <a-col :md="8" :sm="24">
               <a-form-item label="操作时间">
-                <a-range-picker :format="dateFormat" show-time :placeholder="['开始时间', '结束时间']" v-model="time" @change="onChange" />
+                <a-range-picker
+                  :format="dateFormat"
+                  show-time
+                  :placeholder="['开始时间', '结束时间']"
+                  v-model="time"
+                  @change="onChange"
+                  id="OperateJournal-onChange"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="操作人"><a-input allowClear v-model.trim="searchData.queryWord" placeholder="请输入" /></a-form-item>
+              <a-form-item label="操作人"><a-input allowClear v-model.trim="searchData.queryWord" :maxLength="30" placeholder="请输入" id="OperateJournal-queryWord"/></a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-button style="margin-right: 10px;" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
-              <a-button type="" @click="resetForm">重置</a-button>
+              <a-button style="margin-right: 10px;" type="primary" @click="$refs.table.refresh(true)" id="OperateJournal-refreshTable">查询</a-button>
+              <a-button type="" @click="resetForm" id="OperateJournal-resetForm">重置</a-button>
             </a-col>
           </a-row>
         </a-form>
@@ -60,26 +66,26 @@ export default {
         {
           title: '序号',
           dataIndex: 'no',
-          minWidth: '40',
+          width: 60,
           align: 'center'
         },
         {
           title: '操作人',
           dataIndex: 'actorName',
-          minWidth: '100',
+          width: 100,
           align: 'center',
           scopedSlots: { customRender: 'actorName' }
         },
         {
           title: 'IP',
           dataIndex: 'ip',
-          minWidth: '100',
+          width: 200,
           align: 'center'
         },
         {
           title: '日志明细',
           dataIndex: 'actDesc',
-          minWidth: '100',
+          width: 200,
           align: 'center',
           scopedSlots: { customRender: 'actDesc' }
         }
@@ -115,15 +121,7 @@ export default {
       this.$refs.table.refresh(true)
     }
   }
-  // beforeRouteEnter (to, from, next) {
-  //   next(vm => {
-  //     // const todayDate= [getDate.getToday().starttime, getDate.getToday().endtime]
-  // 	// console.log(todayDate)
-  // 	// vm.searchData.beginDate = getDate.getToday().starttime
-  // 	// vm.searchData.endDate = getDate.getToday().endtime
-  // 	// console.log(vm.searchData.beginDate, '--------------',  vm.searchData.endDate )
-  //   })
-  // }
+
 }
 </script>
 

+ 54 - 34
src/views/power/dataDictionary/codeItemModal.vue

@@ -1,6 +1,12 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel">
+    <a-modal
+      class="modalBox"
+      :title="titleText"
+      v-model="isshow"
+      @cancle="cancel"
+      :centered="true"
+      width="45%">
       <a-form :form="form" @submit="handleSubmit">
         <a-row :gutter="24">
           <a-col :span="24">
@@ -9,8 +15,10 @@
               <a-input
                 disabled
                 placeholder=""
+                allowClear
+                id="codeItemModal-lookupCode"
                 v-decorator="['formData.lookupCode', {
-                  initialValue: formData.lookupCode,
+                  initialValue: formData.lookupCode,getValueFromEvent: $filterEmpty,
                   rules: [] }]"
               />
             </a-form-item>
@@ -22,10 +30,13 @@
             <!-- 名称 -->
             <a-form-item label="名称" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
-                placeholder="请输入名称"
+                placeholder="请输入名称(最多30个字符)"
+                id="codeItemModal-dispName"
+                allowClear
+                :maxLength="30"
                 v-decorator="['formData.dispName', {
-                  initialValue: formData.dispName,
-                  rules: [{ required: true, message: '请输入名称!' }] }]"
+                  initialValue: formData.dispName,getValueFromEvent: $filterEmpty,
+                  rules: [{ required: true, message: '请输入名称(最多30个字符)!' }] }]"
               />
             </a-form-item>
           </a-col>
@@ -34,8 +45,10 @@
             <a-form-item label="项编码" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 placeholder="请输入项编码"
+                id="codeItemModal-code"
+                allowClear
                 v-decorator="['formData.code', {
-                  initialValue: formData.code,
+                  initialValue: formData.code,getValueFromEvent: $filterEmpty,
                   rules: [{ required: true, message: '请输入项编码!' }] }]"
               />
             </a-form-item>
@@ -46,6 +59,7 @@
             <a-form-item label="启用" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-radio-group
                 name="radioGroup"
+                id="codeItemModal-isEnable"
                 v-decorator="[
                   'formData.isEnable',
                   {
@@ -63,10 +77,13 @@
             <a-form-item label="排序值" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 type="number"
-                placeholder="请输入排序值"
+                placeholder="请输入(0~999999)之间的序号值"
+                oninput="if(value.length>6)value=value.slice(0,6);if(value<0)value=0"
+                id="codeItemModal-sort"
+                allowClear
                 v-decorator="['formData.sort', {
-                  initialValue: formData.sort,
-                  rules: [{ required: true, message: '请输入排序值!' }] }]"
+                  initialValue: formData.sort,getValueFromEvent: $filterEmpty,
+                  rules: [{ required: true, message: '请输入(0~999999)之间的序号值!' }] }]"
               />
             </a-form-item>
           </a-col>
@@ -78,8 +95,10 @@
             <a-form-item label="扩展一" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 placeholder=""
+                allowClear
+                id="codeItemModal-attr1"
                 v-decorator="['formData.attr1', {
-                  initialValue: formData.attr1,
+                  initialValue: formData.attr1,getValueFromEvent: $filterEmpty,
                   rules: [] }]"
               />
             </a-form-item>
@@ -89,8 +108,10 @@
             <a-form-item label="扩展二" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 placeholder=""
+                allowClear
+                id="codeItemModal-attr2"
                 v-decorator="['formData.attr2', {
-                  initialValue: formData.attr2,
+                  initialValue: formData.attr2,getValueFromEvent: $filterEmpty,
                   rules: [] }]"
               />
             </a-form-item>
@@ -100,8 +121,10 @@
             <a-form-item label="扩展三" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 placeholder=""
+                allowClear
+                id="codeItemModal-attr3"
                 v-decorator="['formData.attr3', {
-                  initialValue: formData.attr3,
+                  initialValue: formData.attr3,getValueFromEvent: $filterEmpty,
                   rules: [] }]"
               />
             </a-form-item>
@@ -111,8 +134,10 @@
             <a-form-item label="扩展四" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 placeholder=""
+                allowClear
+                id="codeItemModal-attr4"
                 v-decorator="['formData.attr4', {
-                  initialValue: formData.attr4,
+                  initialValue: formData.attr4,getValueFromEvent: $filterEmpty,
                   rules: [] }]"
               />
             </a-form-item>
@@ -122,8 +147,10 @@
             <a-form-item label="扩展五" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 placeholder=""
+                allowClear
+                id="codeItemModal-attr5"
                 v-decorator="['formData.attr5', {
-                  initialValue: formData.attr5,
+                  initialValue: formData.attr5,getValueFromEvent: $filterEmpty,
                   rules: [] }]"
               />
             </a-form-item>
@@ -133,8 +160,10 @@
             <a-form-item label="扩展六" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 placeholder=""
+                allowClear
+                id="codeItemModal-attr6"
                 v-decorator="['formData.attr6', {
-                  initialValue: formData.attr6,
+                  initialValue: formData.attr6,getValueFromEvent: $filterEmpty,
                   rules: [] }]"
               />
             </a-form-item>
@@ -148,21 +177,22 @@
                 v-decorator="[
                   'formData.remarks',
                   {
-                    initialValue: formData.remarks,
+                    initialValue: formData.remarks,getValueFromEvent: $filterEmpty,
                     rules: [] },
                 ]"
                 style="min-height: 50px;"
-                placeholder=""
+                placeholder="请输入备注(最多500个字符)"
+                :maxLength="500"
+                id="codeItemModal-remarks"
                 autosize />
             </a-form-item>
           </a-col>
         </a-row>
-
         <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button type="primary" @click="handleSubmit()">
+          <a-button type="primary" @click="handleSubmit()" id="codeItemModal-handleSubmit">
             保存
           </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()" id="codeItemModal-handleCancel">
             取消
           </a-button>
         </a-form-item>
@@ -194,7 +224,7 @@ export default {
   },
   data () {
     return {
-      titleText: '添加字典项',
+      titleText: '新增字典项',
       isshow: this.visible,
       formLayout: 'horizontal',
       form: this.$form.createForm(this, { name: 'miniForm' }),
@@ -246,17 +276,7 @@ export default {
     },
     // 取消
     handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定取消吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
+      this.cancel()
     },
     clear () {
       this.form.resetFields()
@@ -296,7 +316,7 @@ export default {
           console.log(this.formData, 'this.formData')
         } else {
           this.formData.lookupCode = this.data.lookupCode
-          this.titleText = '添加字典项'
+          this.titleText = '新增字典项'
         }
       } else {
         this.cancel()
@@ -306,7 +326,7 @@ export default {
 }
 </script>
 
-<style >
+<style scoped="scoped">
   .modalBox{
     width: 650px !important;
   }

+ 28 - 22
src/views/power/dataDictionary/codeModal.vue

@@ -1,14 +1,22 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel">
+    <a-modal
+      class="modalBox"
+      :title="titleText"
+      v-model="isshow"
+      @cancle="cancel"
+      :centered="true"
+      width="45%">
       <a-form :form="form" @submit="handleSubmit">
         <!-- 类别编码 -->
         <a-form-item label="类别编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
+            id="codeModal-code"
             placeholder="请输入类别编码"
             :disabled="true"
+            allowClear
             v-decorator="['formData.code', {
-              initialValue: formData.code,
+              initialValue: formData.code,getValueFromEvent: $filterEmpty,
               rules: [{ required: true, message: '请输入类别编码!' }] }]"
           />
         </a-form-item>
@@ -16,10 +24,13 @@
         <!-- 名称 -->
         <a-form-item label="名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
-            placeholder="请输入名称"
+            placeholder="请输入名称30个字以内"
+            id="codeModal-name"
+            allowClear
+            :maxLength="30"
             v-decorator="['formData.name', {
-              initialValue: formData.name,
-              rules: [{ required: true, message: '请输入名称!' }] }]"
+              initialValue: formData.name,getValueFromEvent: $filterEmpty,
+              rules: [{ required: true, message: '请输入名称30个字以内!' }] }]"
           />
         </a-form-item>
 
@@ -28,8 +39,10 @@
           <a-input
             type="number"
             placeholder="请输入排序值"
+            id="codeModal-sort"
+            allowClear
             v-decorator="['formData.sort', {
-              initialValue: formData.sort,
+              initialValue: formData.sort,getValueFromEvent: $filterEmpty,
               rules: [{ required: true, message: '请输入排序值!' }] }]"
           />
         </a-form-item>
@@ -37,6 +50,7 @@
         <a-form-item label="启用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-radio-group
             name="radioGroup"
+            id="codeModal-isEnable"
             v-decorator="[
               'formData.isEnable',
               {
@@ -53,19 +67,21 @@
           <a-textarea
             v-decorator="[
               'formData.remarks',
-              { initialValue: formData.remarks,
+              { initialValue: formData.remarks,getValueFromEvent: $filterEmpty,
                 rules: [] },
             ]"
+            :maxLength="500"
+            id="codeModal-remarks"
             style="min-height: 60px;"
             placeholder=""
             autosize />
         </a-form-item>
 
         <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button type="primary" @click="handleSubmit()">
+          <a-button type="primary" @click="handleSubmit()" id="codeModal-handleSubmit">
             保存
           </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()" id="codeModal-handleCancel">
             取消
           </a-button>
         </a-form-item>
@@ -97,7 +113,7 @@ export default {
   },
   data () {
     return {
-      titleText: '添加字典',
+      titleText: '新增字典',
       isshow: this.visible,
       formLayout: 'horizontal',
       form: this.$form.createForm(this, { name: 'miniForm' }),
@@ -140,17 +156,7 @@ export default {
     },
     // 取消
     handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定取消吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
+      this.cancel()
     },
     clear () {
       this.form.resetFields()
@@ -182,7 +188,7 @@ export default {
           this.formData.isEnable = Number(this.formData.isEnable)
           console.log(this.formData, 'this.formData')
         } else {
-          this.formData.titleText = '添加字典'
+          this.formData.titleText = '新增字典'
         }
       } else {
         this.cancel()

+ 279 - 277
src/views/power/dataDictionary/dataDictionary.vue

@@ -3,26 +3,26 @@
     <a-row :gutter="24">
       <!-- 左侧字典列表 -->
       <a-col :span="6">
-        <a-row :gutter="24">        
-             <!-- <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addCode">添加字典</a-button> -->   
-              <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="editCode">编辑字典</a-button>
-             <!-- <a-select style="width: 110px" placeholder="更多操作" allowClear >
+        <a-row :gutter="24">
+          <!-- <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addCode">新增字典</a-button> -->
+          <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="editCode">编辑字典</a-button>
+          <!-- <a-select style="width: 110px" placeholder="更多操作" allowClear >
                <a-select-option @click="editCode" value="编辑字典">编辑字典</a-select-option>
                <a-select-option @click="delectCode" value="删除字典">删除字典</a-select-option>
-             </a-select> -->              
+             </a-select> -->
         </a-row>
-        <a-row :gutter="24"  class="textCount">
+        <a-row :gutter="24" class="textCount">
           <a-icon type="info-circle" style="color: #1890FF;margin-right: 10px;" />
-          <span>当前选择:<span style="color: #40a9ff;font-weight: 600;">{{selectedMenu}}</span><span v-if="selectedKey.length" class="imgSize" @click="cancelSel">取消选择</span></span>
+          <span>当前选择:<span style="color: #40a9ff;font-weight: 600;">{{ selectedMenu }}</span><span v-if="selectedKey.length" class="imgSize" @click="cancelSel">取消选择</span></span>
         </a-row>
         <a-row :gutter="24" >
-          <a-input-search v-model="code" placeholder="输入编码类别/名称 搜索字典" style="width: 100%" @search="getCodeList" />
+          <a-input-search v-model="code" placeholder="输入编码类别/名称 搜索字典" style="width: 100%" @search="getCodeList" id="dataDictionary-getCodeList"/>
         </a-row>
         <a-row :gutter="24" >
-         <a-menu class="menu-box" style="border-right: 0;max-height: 650px;overflow: auto;" v-model="selectedKey" >
-              <a-menu-item  style="margin-bottom: 0px;height: 30px; line-height: 30px;" v-for="(item,index) in codeList" :key="index" :value="item">{{item.name}}</a-menu-item>            
-            </a-menu>
-            <span v-if="noData" style="line-height: 50px; font-weight: 600;">暂无数据</span>
+          <a-menu class="menu-box" style="border-right: 0;max-height: 650px;overflow: auto;" v-model="selectedKey" >
+            <a-menu-item style="margin-bottom: 0px;height: 30px; line-height: 30px;" v-for="(item,index) in codeList" :key="index" :value="item">{{ item.name }}</a-menu-item>
+          </a-menu>
+          <span v-if="noData" style="line-height: 50px; font-weight: 600;">暂无数据</span>
         </a-row>
       </a-col>
       <!-- 右侧数据列表 -->
@@ -33,19 +33,22 @@
               <a-row :gutter="48">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="数据名称">
-                    <a-input allowClear v-model="queryParam.dispName" placeholder="请输入数据名称"/>
+                    <a-input allowClear v-model="queryParam.dispName" placeholder="请输入数据名称" id="dataDictionary-dispName"/>
                   </a-form-item>
                 </a-col>
-          
+
                 <a-col :md="6" :sm="24">
                   <a-form-item label="状态">
-                    <a-select allowClear v-model="queryParam.isEnable"
-                              placeholder="请选择"
+                    <a-select
+                      allowClear
+                      id="dataDictionary-isEnable"
+                      v-model="queryParam.isEnable"
+                      placeholder="请选择"
                     >
-                      <a-select-option  :value = '1'>
+                      <a-select-option :value="1">
                       </a-select-option>
-                      <a-select-option  :value = '0'>
+                      <a-select-option :value="0">
                       </a-select-option>
                     </a-select>
@@ -53,7 +56,7 @@
                   </a-form-item>
                 </a-col>
                 <a-col :md="2" :sm="24">
-                  <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+                  <a-button type="primary" @click="$refs.table.refresh(true)" id="dataDictionary-handSubmit">查询</a-button>
                 </a-col>
                 <!-- <a-col :md="2" :sm="24">
                   <a-button type="primary" @click="queryParam=''">重置</a-button>
@@ -63,11 +66,11 @@
           </div>
           <!-- <a-divider/> -->
           <div class="table-operator">
-            <a-button type="primary" icon="plus" @click="openCodeItemModal">添加数据</a-button>
+            <a-button type="primary" icon="plus" @click="openCodeItemModal" id="dataDictionary-openCodeItemModal">新增数据</a-button>
             <!-- <a-button type="" icon="delete" @click="delectAll">批量删除</a-button> -->
-            <a-button type="" icon="reload" @click="$refs.table.refresh(true)">刷新数据</a-button>
+            <a-button type="" icon="reload" @click="$refs.table.refresh(true)" id="dataDictionary-refreshTable">刷新数据</a-button>
           </div>
-         <!-- <div  class="textCount">
+          <!-- <div  class="textCount">
             <a-icon type="info-circle" style="color: #1890FF;margin-right: 10px;" />
             <span>已选择<span style="color: #40a9ff;font-weight: 600;margin-left: 10px;">{{selectedNum}}项</span><span class="imgSize">清空</span></span>
           </div> -->
@@ -78,16 +81,16 @@
             :columns="columns"
             :data="loadData"
             bordered
-          >         
+          >
             <span slot="action" slot-scope="text, record">
               <template>
-                <a class="action-button" @click="handleEdit(record)">修改</a>
-                <a v-if="!record.isEnable" class="action-button red-text" @click="delect(record)">删除</a>
+                <a class="action-button" @click="handleEdit(record)" id="dataDictionary-handleEdit">编辑</a>
+                <a v-if="!record.isEnable" class="action-button red-text" @click="delect(record)" id="dataDictionary-delect">删除</a>
               </template>
             </span>
           </s-table>
         </div>
-        
+
       </a-col>
     </a-row>
     <codeModal :visible="showCodeModal" :data="codeData" @refresh="getCodeList" @close="showCodeModal = false"></codeModal>
@@ -96,272 +99,271 @@
 </template>
 
 <script>
-  import { STable, VSelect } from '@/components'
-  import codeModal from './codeModal.vue'
-  import codeItemModal from './codeItemModal.vue'
-  import { listLookUp, delLookUp, getLookUpItem, delLookUpItem } from '@/api/lookup.js'
-  export default {
-    name: 'dataDictionary',
-    components: {
-      STable, VSelect, codeModal, codeItemModal
-    },
-    props: {},
-    data () {
-       // const rowSelection = {
-       //    onChange: (selectedRowKeys, selectedRows) => {
-       //      console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
-       //    },
-       //    onSelect: (record, selected, selectedRows) => {
-       //      this.selectedNum = selectedRows.length
-       //      console.log(record,'record')
-       //      console.log(selectedRows,'selectedRows')
-       //    },
-       //    onSelectAll: (selected, selectedRows, changeRows) => {
-       //      this.selectedNum = selectedRows.length
-       //      console.log(selected, selectedRows, changeRows)
-       //    }
-       //  }
-      return {
-        // 查询参数
-        queryParam: {
-          dispName: '',
-          isEnable: undefined,
-          lookupCode: ''
+import { STable, VSelect } from '@/components'
+import codeModal from './codeModal.vue'
+import codeItemModal from './codeItemModal.vue'
+import { listLookUp, delLookUp, getLookUpItem, delLookUpItem } from '@/api/lookup.js'
+export default {
+  name: 'DataDictionary',
+  components: {
+    STable, VSelect, codeModal, codeItemModal
+  },
+  props: {},
+  data () {
+    // const rowSelection = {
+    //    onChange: (selectedRowKeys, selectedRows) => {
+    //      console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
+    //    },
+    //    onSelect: (record, selected, selectedRows) => {
+    //      this.selectedNum = selectedRows.length
+    //      console.log(record,'record')
+    //      console.log(selectedRows,'selectedRows')
+    //    },
+    //    onSelectAll: (selected, selectedRows, changeRows) => {
+    //      this.selectedNum = selectedRows.length
+    //      console.log(selected, selectedRows, changeRows)
+    //    }
+    //  }
+    return {
+      // 查询参数
+      queryParam: {
+        dispName: '',
+        isEnable: undefined,
+        lookupCode: ''
+      },
+      noData: false,
+      code: '', // 根据输入编码类别/名称搜索字典
+      selectedNum: '',
+      selectedKey: [], // 选中的字典编码项
+      selectedMenu: '',
+      formLayout: 'horizontal',
+      form: this.$form.createForm(this, { name: 'miniForm' }),
+      codeList: [],
+      showCodeModal: false,
+      showItemCodeModal: false,
+      codeData: {}, // 编辑字典行数据
+      itemCodeData: {},
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'no',
+          width: '40',
+          align: 'center'
+        },
+        {
+          title: '名称',
+          dataIndex: 'dispName',
+          width: '100',
+          align: 'center'
+        },
+        {
+          title: '项编码',
+          dataIndex: 'code',
+          width: '100',
+          align: 'center'
+        },
+        {
+          title: '排序值',
+          dataIndex: 'sort',
+          width: '100',
+          align: 'center'
         },
-        noData: false, 
-        code: '', // 根据输入编码类别/名称搜索字典
-        selectedNum: '',
-        selectedKey: [], // 选中的字典编码项
-        selectedMenu: '',
-        formLayout: 'horizontal',
-        form: this.$form.createForm(this, { name: 'miniForm' }),
-        codeList: [],
-        showCodeModal: false,
-        showItemCodeModal: false,
-        codeData: {}, // 编辑字典行数据
-        itemCodeData: {}, 
-          // 表头
-          columns: [
-            {
-              title: '序号',
-              dataIndex: 'no',
-              width: '40',
-              align: 'center'
-            },
-            {
-              title: '名称',
-              dataIndex: 'dispName',
-              width: '100',
-              align: 'center'
-            },
-            {
-              title: '项编码',
-              dataIndex: 'code',
-              width: '100',
-              align: 'center'
-            },
-            {
-              title: '排序值',
-              dataIndex: 'sort',
-              width: '100',
-              align: 'center'
-            },
-            {
-              title: '是否启用',
-              width: '100',
-              align: 'center',
-              dataIndex: 'isEnable',
-              customRender: function(text) {
-                if (text == 1) {
-                  return '启用'
-                } else {
-                  return '禁用'
-                }
-              }
-            },
-            {
-              title: '创建时间',
-              dataIndex: 'createDate',
-              width: '120',
-              align: 'center'
-            },
-            {
-              title: '备注',
-              dataIndex: 'remarks',
-              width: '100',
-              align: 'center'
-            },
-            {
-              title: '操作',
-              width: '100',
-              align: 'center',
-              scopedSlots: { customRender: 'action' }
+        {
+          title: '是否启用',
+          width: '100',
+          align: 'center',
+          dataIndex: 'isEnable',
+          customRender: function (text) {
+            if (text == 1) {
+              return '启用'
+            } else {
+              return '禁用'
             }
-          ],
-          // 加载数据方法 必须为 Promise 对象
-          loadData: parameter => {
-            console.log(parameter, 'parameter')
-              
-            return getLookUpItem(Object.assign(parameter, this.queryParam)).then(res => {
-              const no = (res.data.pageNo - 1) * res.data.pageSize
-              for (let i = 0; i < res.data.list.length; i++) {
-                const _item = res.data.list[i]
-                _item.no = no + i + 1
-                _item.isEnable = _item.isEnable + '' === '1'
-              }
-              return res.data
-            })
-          },
-          optionAlertShow: false
+          }
+        },
+        {
+          title: '创建时间',
+          dataIndex: 'createDate',
+          width: '120',
+          align: 'center'
+        },
+        {
+          title: '备注',
+          dataIndex: 'remarks',
+          width: '100',
+          align: 'center'
+        },
+        {
+          title: '操作',
+          width: '100',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
         }
-    },
-    methods: {
-     
-      // 获取字典列表
-      getCodeList () {
-        console.log({code:this.code})
-        listLookUp({code:this.code}).then(res => {
-          console.log(res, 'res1111111')
-          if (res.status == 200) {
-            this.codeList = res.data
-            this.noData = false
-            if (!res.data.length) {
-              this.noData = true
-            }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        console.log(parameter, 'parameter')
+
+        return getLookUpItem(Object.assign(parameter, this.queryParam)).then(res => {
+          const no = (res.data.pageNo - 1) * res.data.pageSize
+          for (let i = 0; i < res.data.list.length; i++) {
+            const _item = res.data.list[i]
+            _item.no = no + i + 1
+            _item.isEnable = _item.isEnable + '' === '1'
           }
+          return res.data
         })
       },
-     // 添加字典
-     addCode () {
-       this.showCodeModal = true
-       this.codeData = {}
-     },
-     // 编辑字典
-     editCode () {
-       if (!this.selectedKey.length) {
-        return this.$message.warning('您还未选择要编辑的字典');
-       }
-       this.showCodeModal = true
-       this.codeData = this.codeList[this.selectedKey]
-     },
-     // 删除字典
-     delectCode () {
-       if (!this.selectedKey.length) {
-        return this.$message.warning('您还未选择要删除的字典');
-       }
-       let _this = this
-       let id = this.codeList[this.selectedKey].id
-       this.$confirm({
-         title: '警告',
-         content: `确定要删除 ${this.codeList[this.selectedKey].name} 吗?`,
-         okText: '确定',
-         cancelText: '取消',
-         onOk () {
-           delLookUp({
-             id: id
-           }).then(res => {
-             if (res.status == 200) {
-               _this.$message.success('删除成功')
-               _this.getCodeList()
-             }
-           }).catch(() => {
-             _this.$message.success('删除失败, 请稍后重试')
-           })
-         }
-       })
-     },
+      optionAlertShow: false
+    }
+  },
+  methods: {
+
+    // 获取字典列表
+    getCodeList () {
+      console.log({ code: this.code })
+      listLookUp({ code: this.code }).then(res => {
+        console.log(res, 'res1111111')
+        if (res.status == 200) {
+          this.codeList = res.data
+          this.noData = false
+          if (!res.data.length) {
+            this.noData = true
+          }
+        }
+      })
+    },
+    // 添加字典
+    addCode () {
+      this.showCodeModal = true
+      this.codeData = {}
+    },
+    // 编辑字典
+    editCode () {
+      if (!this.selectedKey.length) {
+        return this.$message.warning('您还未选择要编辑的字典')
+      }
+      this.showCodeModal = true
+      this.codeData = this.codeList[this.selectedKey]
+    },
+    // 删除字典
+    delectCode () {
+      if (!this.selectedKey.length) {
+        return this.$message.warning('您还未选择要删除的字典')
+      }
+      const _this = this
+      const id = this.codeList[this.selectedKey].id
+      this.$confirm({
+        title: '警告',
+        content: `确定要删除 ${this.codeList[this.selectedKey].name} 吗?`,
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          delLookUp({
+            id: id
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success('删除成功')
+              _this.getCodeList()
+            }
+          }).catch(() => {
+            _this.$message.success('删除失败, 请稍后重试')
+          })
+        }
+      })
+    },
     // 字典 取消选择
     cancelSel () {
       this.selectedKey = []
       this.selectedMenu = ''
     },
-    
-     // 新增数据
-     openCodeItemModal () {
-       if (!this.selectedKey.length) {
-        return this.$message.warning('请先选择一个字典类别');
-       }
-       this.showItemCodeModal = true
-       this.itemCodeData = {lookupCode:this.codeList[this.selectedKey].code}
-     },   
-     
-     // 批量删除数据
-      delectAll () {
-        if (!this.selectedNum) {
-         return this.$message.warning('您还未选择要删除的数据');
-        }
-        let _this = this
-        this.$confirm({
-          title: '警告',
-          content: `确定要删除您选择的这${this.selectedNum}条数据吗?`,
-          okText: '确定',
-          cancelText: '取消',
-          onOk () {
-            // delectUserPower({
-            //   id: row.id
-            // }).then(res => {
-            //   if (res.status == 200) {
-            //     _this.$message.success('删除成功')
-            //     _this.$refs.table.refresh()
-            //   }
-            // }).catch(() => {
-            //   _this.$message.success('删除失败, 请稍后重试')
-            // })
-          }
-        })
-      },
-      // 删除
-      delect (row) { 
-        let _this = this
-        this.$confirm({
-          title: '警告',
-          content: '确定要删除吗?',
-          okText: '确定',
-          cancelText: '取消',
-          onOk () {
-            delLookUpItem({
-              id: row.id
-            }).then(res => {
-              console.log(res, 'res1111')
-              if (res.status == 200) {
-                _this.$message.success('删除成功')
-                _this.$refs.table.refresh()
-              }
-            }).catch(() => {
-              _this.$message.success('删除失败, 请稍后重试')
-            })
-          }
-        })
-      },
-      handleEdit (row) {
-        console.log(row, 'row')
-        this.showItemCodeModal = true
-        this.itemCodeData = row 
-      },
-      
-    },
-    mounted () {
-    },
-    beforeCreate () {
-      this.form = this.$form.createForm(this, { name: 'miniForm' })
+
+    // 新增数据
+    openCodeItemModal () {
+      if (!this.selectedKey.length) {
+        return this.$message.warning('请先选择一个字典类别')
+      }
+      this.showItemCodeModal = true
+      this.itemCodeData = { lookupCode: this.codeList[this.selectedKey].code }
     },
-    beforeRouteEnter (to, from, next) {
-      next(vm => {
-        vm.getCodeList()
+
+    // 批量删除数据
+    delectAll () {
+      if (!this.selectedNum) {
+        return this.$message.warning('您还未选择要删除的数据')
+      }
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        content: `确定要删除您选择的这${this.selectedNum}条数据吗?`,
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          // delectUserPower({
+          //   id: row.id
+          // }).then(res => {
+          //   if (res.status == 200) {
+          //     _this.$message.success('删除成功')
+          //     _this.$refs.table.refresh()
+          //   }
+          // }).catch(() => {
+          //   _this.$message.success('删除失败, 请稍后重试')
+          // })
+        }
       })
     },
-    watch: {
-      selectedKey(newValue, oldValue) {
-        console.log(newValue, 'newValue')
-        if (newValue.length) {
-          
-          this.selectedMenu = this.codeList[this.selectedKey].name + " " + '(' + this.codeList[this.selectedKey].code + ')'
-          this.queryParam.lookupCode = this.codeList[this.selectedKey].code
-          this.$refs.table.refresh(true)
+    // 删除
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        content: '确定要删除吗?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          delLookUpItem({
+            id: row.id
+          }).then(res => {
+            console.log(res, 'res1111')
+            if (res.status == 200) {
+              _this.$message.success('删除成功')
+              _this.$refs.table.refresh()
+            }
+          }).catch(() => {
+            _this.$message.success('删除失败, 请稍后重试')
+          })
         }
-      }
+      })
     },
+    handleEdit (row) {
+      console.log(row, 'row')
+      this.showItemCodeModal = true
+      this.itemCodeData = row
+    }
+
+  },
+  mounted () {
+  },
+  beforeCreate () {
+    this.form = this.$form.createForm(this, { name: 'miniForm' })
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getCodeList()
+    })
+  },
+  watch: {
+    selectedKey (newValue, oldValue) {
+      console.log(newValue, 'newValue')
+      if (newValue.length) {
+        this.selectedMenu = this.codeList[this.selectedKey].name + ' ' + '(' + this.codeList[this.selectedKey].code + ')'
+        this.queryParam.lookupCode = this.codeList[this.selectedKey].code
+        this.$refs.table.refresh(true)
+      }
+    }
   }
+}
 </script>
 
 <style scoped>
@@ -369,7 +371,7 @@
     width: 6px;
     height: 6px ;
   }
-  
+
   .menu-box::-webkit-scrollbar-thumb{
     width: 6px;
     height: 6px ;
@@ -377,7 +379,7 @@
     -webkit-box-shadow: inset 0 0 2px #d1d1d1;
     background: #e4e4e4;
   }
- 
+
   .textCount{
     border: 1px solid #91d5ff;
     background-color: #e6f7ff;

+ 16 - 16
src/views/power/job/jobs.vue

@@ -5,20 +5,20 @@
         <a-row :gutter="20">
           <a-col :md="6" :sm="24">
             <a-form-item style="margin-bottom: 0;">
-              <a-input v-model.trim="queryParam.name" placeholder="定时器名称" allowClear/>
+              <a-input v-model.trim="queryParam.name" id="jobs-name" placeholder="定时器名称" allowClear @pressEnter="$refs.table.refresh(true)"/>
             </a-form-item>
           </a-col>
           <a-col :md="4" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button type="primary" @click="$refs.table.refresh(true)" id="jobs-handSubmit">查询</a-button>
           </a-col>
         </a-row>
       </a-form>
     </div>
     <a-divider />
     <div class="btns">
-      <a-button @click="addJob()" type="primary" icon="plus-circle">添加JOB</a-button>
-      <a-button @click="startJob()" type="default" icon="play-circle">启动</a-button>
-      <a-button @click="stopJob()" type="default" icon="stop">停止</a-button>
+      <a-button @click="addJob()" type="primary" icon="plus-circle" id="jobs-addJob">新增JOB</a-button>
+      <a-button @click="startJob()" type="default" icon="play-circle" id="jobs-startJob">启动</a-button>
+      <a-button @click="stopJob()" type="default" icon="stop" id="jobs-stopJob">停止</a-button>
     </div>
 
     <s-table
@@ -32,11 +32,11 @@
     >
       <span slot="action" slot-scope="text, record">
         <template>
-          <a @click="editJob(record)">编辑</a>
+          <a @click="editJob(record)" id="jobs-editJob">编辑</a>
           <a-divider type="vertical" />
-          <a @click="deleteRow(record)">删除</a>
+          <a @click="deleteRow(record)" id="jobs-deleteRow">删除</a>
           <a-divider type="vertical" />
-          <a @click="syncJob(record)">立即运行一次</a>
+          <a @click="syncJob(record)" id="jobs-syncJob">立即运行一次</a>
         </template>
       </span>
       <span slot="isEnable" slot-scope="text, record">
@@ -49,7 +49,7 @@
     </s-table>
 
     <a-modal
-      title="添加JOB"
+      title="新增JOB"
       v-model="visible"
       :footer="null"
       :maskClosable="false"
@@ -64,28 +64,28 @@
           :label-col="{ span: 6 }"
           :wrapper-col="{ span: 17 }"
         >
-          <a-input v-decorator="['formData.name',{initialValue: formData.name,rules:[{ required: true, message: '请输入JOB名称' }]}]"/>
+          <a-input id="jobs-name" v-decorator="['formData.name',{initialValue: formData.name,rules:[{ required: true, message: '请输入JOB名称' }]}]"/>
         </a-form-item>
         <a-form-item
           label="JOB分组"
           :label-col="{ span: 6 }"
           :wrapper-col="{ span: 17 }"
         >
-          <a-input v-decorator="['formData.group',{initialValue: formData.group,rules:[{ required: true, message: '请输入JOB分组称' }]}]"/>
+          <a-input id="jobs-group" v-decorator="['formData.group',{initialValue: formData.group,rules:[{ required: true, message: '请输入JOB分组称' }]}]"/>
         </a-form-item>
         <a-form-item
           label="JOB业务类名"
           :label-col="{ span: 6 }"
           :wrapper-col="{ span: 17 }"
         >
-          <a-input v-decorator="['formData.className',{initialValue: formData.className,rules:[{ required: true, message: '请输入JOB业务类名' }]}]"/>
+          <a-input id="jobs-className" v-decorator="['formData.className',{initialValue: formData.className,rules:[{ required: true, message: '请输入JOB业务类名' }]}]"/>
         </a-form-item>
         <a-form-item
           label="CRON表达式"
           :label-col="{ span: 6 }"
           :wrapper-col="{ span: 17 }"
         >
-          <a-input @click="openCronModal" v-model="formData.cron" @change="setCorn">
+          <a-input @click="openCronModal" v-model="formData.cron" @change="setCorn" id="jobs-cron">
             <a-icon slot="prefix" type="schedule" title="corn控件"/>
             <a-icon v-if="formData.cron" slot="suffix" type="close-circle" @click="formData.cron=''" title="清空"/>
           </a-input>
@@ -96,13 +96,13 @@
           :label-col="{ span: 6 }"
           :wrapper-col="{ span: 17 }"
         >
-          <a-switch checkedChildren="启用" unCheckedChildren="禁用" v-decorator="['formData.isEnable', { initialValue: formData.isEnable, valuePropName: 'checked' }]" />
+          <a-switch checkedChildren="启用" unCheckedChildren="禁用" id="jobs-isEnable" v-decorator="['formData.isEnable', { initialValue: formData.isEnable, valuePropName: 'checked' }]" />
           <!-- <a-switch checkedChildren="启用" unCheckedChildren="禁用" :checked="formData.isEnable" @change="changeStatus"/> -->
         </a-form-item>
 
         <div class="jobBtns">
-          <a-button key="back" @click="handleCancel">取消</a-button>
-          <a-button htmlType="submit" :loading="loading" type="primary">
+          <a-button key="back" @click="handleCancel" id="jobs-handleCancel">取消</a-button>
+          <a-button htmlType="submit" :loading="loading" type="primary" id="jobs-submit">
             确定
           </a-button>
         </div>

+ 25 - 25
src/views/power/menu/childModal.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel">
+    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel" :centered="true">
       <a-form :form="form" @submit="handleSubmit">
         <!-- 上级菜单 -->
         <a-form-item label="上级菜单" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
@@ -13,6 +13,7 @@
         <a-form-item label="类型" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-select
             @change="selectChange"
+            id="childModal-type"
             :disabled="disabled"
             v-decorator="[
               'formData.type',
@@ -31,10 +32,13 @@
         <!-- 名称 -->
         <a-form-item label="名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
-            placeholder="请输入名称"
+            placeholder="请输入名称30个字以内"
+            id="childModal-name"
+            :maxLength="30"
+            allowClear
             v-decorator="['formData.name', {
-              initialValue: formData.name,
-              rules: [{ required: true, message: '请输入名称!' },{pattern:'^[^<|>]{1,20}$',message:'请输入不含<或>的字符,最多20个字符'}] }]"
+              initialValue: formData.name,getValueFromEvent: $filterEmpty,
+              rules: [{ required: true, message: '请输入名称!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]"
           />
         </a-form-item>
         <!-- 路由英文名 -->
@@ -66,10 +70,12 @@
         <a-form-item label="前端权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
             placeholder="请输入前端权限编码"
+            id="childModal-code"
+            allowClear
             v-decorator="[
               'formData.code',
               {
-                initialValue: formData.code,
+                initialValue: formData.code,getValueFromEvent: $filterEmpty,
                 rules: [{ required: true, message: '请输入前端权限编码!' }] },
             ]"
           />
@@ -79,9 +85,11 @@
         <a-form-item label="后台权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
             placeholder="请输入后台权限编码"
+            allowClear
+            id="childModal-permission"
             v-decorator="[
               'formData.permission',
-              {initialValue: formData.permission},
+              {initialValue: formData.permission,},
             ]"
           />
 
@@ -120,9 +128,12 @@
         <a-form-item label="排序值" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
             type="number"
-            placeholder="请输入排序值"
+            oninput="if(value.length>6)value=value.slice(0,6);if(value<0)value=0"
+            placeholder="请输入(0~999999)之间的排序值"
+            allowClear
+            id="childModal-sort"
             v-decorator="['formData.sort', {
-              initialValue: formData.sort,
+              initialValue: formData.sort,getValueFromEvent: $filterEmpty,
               rules: [] }]"
           />
         </a-form-item>
@@ -130,6 +141,7 @@
         <a-form-item label="启用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-radio-group
             name="radioGroup"
+            id="childModal-status"
             v-decorator="[
               'formData.status',
               {
@@ -143,10 +155,10 @@
         </a-form-item>
 
         <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button type="primary" @click="handleSubmit()">
+          <a-button type="primary" @click="handleSubmit()" id="childModal-handleSubmit">
             保存
           </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()" id="childModal-handleCancel">
             取消
           </a-button>
         </a-form-item>
@@ -233,17 +245,7 @@ export default {
     },
     // 取消
     handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定取消吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
+      this.cancel()
     },
     clear () {
       this.form.resetFields()
@@ -275,13 +277,13 @@ export default {
     isshow (newValue, oldValue) {
       if (newValue) {
         if (this.data.id) { // 添加子菜单
-          this.titleText = '添加子菜单'
+          this.titleText = '新增子菜单'
           this.disabled = false
           console.log(this.data, 'this.data')
           this.formData.parentId = this.data.id
           this.parentTitle = this.data.name
         } else { // 添加顶菜单
-          this.titleText = '添加顶菜单'
+          this.titleText = '新增顶菜单'
           this.formData.type = 0
           this.disabled = true
         }
@@ -294,8 +296,6 @@ export default {
 </script>
 
 <style >
-  .modalBox{
-  }
   .ant-modal-footer {
     display: none;
   }

+ 24 - 13
src/views/power/menu/menu.vue

@@ -1,9 +1,9 @@
 <template>
   <a-card :bordered="false">
     <a-row :gutter="24">
-      <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addChild">添加子菜单</a-button>
-      <a-button style="margin-right: 10px;background-color: #19be6b;color: #fff;" type="" icon="plus" @click="addTitle">添加顶部菜单</a-button>
-      <a-button style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="delect()">删除</a-button>
+      <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addChild" id="menu-addChild">新增子菜单</a-button>
+      <a-button style="margin-right: 10px;background-color: #19be6b;color: #fff;" type="" icon="plus" @click="addTitle" id="menu-addTitle">新增顶部菜单</a-button>
+      <a-button style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="delect()" id="menu-delect">删除</a-button>
 
     </a-row>
     <a-row :gutter="24">
@@ -15,7 +15,7 @@
         </a-row>
 
         <a-row :gutter="24" >
-          <a-input-search placeholder="输入搜索菜单名搜索" style="width: 100%" @change="onChange" />
+          <a-input-search placeholder="输入搜索菜单名搜索" style="width: 100%" @change="onChange" id="menu-onChange" />
           <a-tree
             @expand="onExpand"
             :treeData="getMenus"
@@ -54,10 +54,13 @@
           <!-- 名称 -->
           <a-form-item label="名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
-              placeholder="请输入名称"
+              placeholder="请输入名称30个字以内"
+              :maxLength="30"
+              allowClear
+              id="menu-name"
               v-decorator="['formData.name', {
-                initialValue: formData.name,
-                rules: [{ required: true, message: '请输入名称!' },{pattern:'^[^<|>]{1,20}$',message:'请输入不含<或>的字符,最多20个字符'}] }]"
+                initialValue: formData.name,getValueFromEvent: $filterEmpty,
+                rules: [{ required: true, message: '请输入名称30个字以内!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]"
             />
           </a-form-item>
           <!-- 路由英文名 -->
@@ -91,10 +94,12 @@
           <a-form-item label="前端权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
               placeholder="请输入前端权限编码"
+              allowClear
+              id="menu-code"
               v-decorator="[
                 'formData.code',
                 {
-                  initialValue: formData.code,
+                  initialValue: formData.code,getValueFromEvent: $filterEmpty,
                   rules: [{ required: true, message: '请输入前端权限编码!' }] },
               ]"
             />
@@ -103,10 +108,12 @@
           <a-form-item label="后台权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
               placeholder="请输入后台权限编码"
+              allowClear
+              id="menu-permission"
               v-decorator="[
                 'formData.permission',
                 {
-                  initialValue: formData.permission,
+                  initialValue: formData.permission,getValueFromEvent: $filterEmpty,
                   rules: [{ required: formData.isLeaf, message: '请输入后台权限编码!' }] },
               ]"
             />
@@ -144,9 +151,12 @@
           <a-form-item label="排序值" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
               type="number"
-              placeholder="请输入排序值"
+			  oninput="if(value.length>6)value=value.slice(0,6);if(value<0)value=0"
+              placeholder="请输入(0~999999)之间的排序值"
+              allowClear
+              id="menu-sort"
               v-decorator="['formData.sort', {
-                initialValue: formData.sort,
+                initialValue: formData.sort,getValueFromEvent: $filterEmpty,
                 rules: [] }]"
             />
           </a-form-item>
@@ -154,6 +164,7 @@
           <a-form-item label="启用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-radio-group
               name="radioGroup"
+              id="menu-status"
               v-decorator="[
                 'formData.status',
                 {
@@ -167,10 +178,10 @@
           </a-form-item>
 
           <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-            <a-button type="primary" @click="handleSubmit()">
+            <a-button type="primary" @click="handleSubmit()" id="menu-handleSubmit">
               保存
             </a-button>
-            <a-button :style="{ marginLeft: '8px' }" @click="clear">
+            <a-button :style="{ marginLeft: '8px' }" @click="clear" id="menu-clear">
               重置
             </a-button>
           </a-form-item>

+ 27 - 14
src/views/power/register/register.vue

@@ -10,7 +10,7 @@
 
         <a-row :gutter="24" >
           <a-row :gutter="24" >
-            <a-input-search placeholder="搜索" style="width: 100%" @change="onChange" />
+            <a-input-search placeholder="搜索" style="width: 100%" @change="onChange" id="register-onChange"/>
           </a-row>
           <a-tree
             @expand="onExpand"
@@ -36,15 +36,16 @@
 
         <a-form :form="form" @submit="handleSubmit">
           <a-form-item label=" " :colon="false" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addChild">添加子分类</a-button>
-            <a-button style="margin-right: 10px;background-color: #19be6b;color: #fff;" type="" icon="plus" @click="addTop">添加根节点</a-button>
-            <a-button style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="remove()">删除</a-button>
+            <a-button style="margin-right: 10px;" type="primary" icon="plus" @click="addChild" id="register-addChild">新增子分类</a-button>
+            <a-button style="margin-right: 10px;background-color: #19be6b;color: #fff;" type="" icon="plus" @click="addTop" id="register-addTop">新增根节点</a-button>
+            <a-button style="margin-right: 10px;background-color: red;color: #fff;" type="" icon="delete" @click="remove()" id="register-remove">删除</a-button>
           </a-form-item>
           <!-- 父路径 -->
           <a-form-item label="父路径" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
               disabled
               placeholder=""
+              id="register-parentPath"
               v-decorator="['formData.parentPath', {
                 initialValue: formData.parentPath,
                 rules: [] }]"
@@ -53,18 +54,23 @@
           <!-- 显示名称-->
           <a-form-item label="显示名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
-              placeholder="请输入节点显示名称"
+              placeholder="请输入节点显示名称30个字以内"
+              id="register-dispname"
+			  :maxLength="30"
+			  allowClear
               v-decorator="['formData.dispname', {
-                initialValue: formData.dispname,
-                rules: [{ required: true, message: '请输入节点显示名称!' }] }]"
+                initialValue: formData.dispname,getValueFromEvent: $filterEmpty,
+                rules: [{ required: true, message: '请输入节点显示名称30个字以内!' }] }]"
             />
           </a-form-item>
           <!-- 名称 -->
           <a-form-item label="编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
               placeholder="请输入节点code"
+              id="register-name"
+			  allowClear
               v-decorator="['formData.name', {
-                initialValue: formData.name,
+                initialValue: formData.name,getValueFromEvent: $filterEmpty,
                 rules: [{ required: true, message: '请输入节点code!' }] }]"
             />
           </a-form-item>
@@ -74,8 +80,10 @@
             <a-input
               :maxlength="20"
               placeholder="请输入节点值"
+			  allowClear
+              id="register-value"
               v-decorator="['formData.value', {
-                initialValue: formData.value,
+                initialValue: formData.value,getValueFromEvent: $filterEmpty,
                 rules: [{ required: true, message: '请输入节点值!' }] }]"
             />
           </a-form-item>
@@ -85,9 +93,11 @@
             <a-input
               type="number"
               :maxlength="20"
+			  allowClear
+              id="register-index"
               placeholder="请输入正确的序号"
               v-decorator="['formData.index', {
-                initialValue: formData.index,
+                initialValue: formData.index,getValueFromEvent: $filterEmpty,
                 rules: [{ required: true, message: '请输入正确的序号!' }] }]"
             />
           </a-form-item>
@@ -96,6 +106,7 @@
           <a-form-item label="是否启用" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-radio-group
               name="radioGroup"
+              id="register-isEnable"
               v-decorator="[
                 'formData.isEnable',
                 {
@@ -111,19 +122,21 @@
             <a-textarea
               v-decorator="[
                 'formData.desc',
-                { initialValue: formData.desc,
+                { initialValue: formData.desc,getValueFromEvent: $filterEmpty,
                   rules: [] },
               ]"
+			  :maxLength="500"
               style="min-height: 60px;"
-              placeholder=""
+              placeholder="输入内容为500个字以内"
+              id="register-desc"
               autosize />
           </a-form-item>
 
           <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-            <a-button type="primary" @click="handleSubmit()">
+            <a-button type="primary" @click="handleSubmit()" id="register-handleSubmit">
               保存
             </a-button>
-            <a-button :style="{ marginLeft: '8px' }" @click="reset">
+            <a-button :style="{ marginLeft: '8px' }" @click="reset" id="register-reset">
               重置
             </a-button>
           </a-form-item>

+ 9 - 33
src/views/power/role/menuModal.vue

@@ -1,8 +1,7 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="roleName" v-model="isshow" @cancle="cancel">
+    <a-modal class="modalBox" :title="roleName" v-model="isshow" @cancle="cancel" :centered="true">
       <a-form class="form-box" style="max-height: 600px;" :form="form" @submit="handleSubmit">
-
         <a-tree
           checkable
           @check="onCheck"
@@ -12,13 +11,12 @@
           v-model="checkedKeys"
           :treeData="treeData"
         />
-
       </a-form>
       <a-form-item :wrapper-col="{ offset: 15 }">
-        <a-button type="primary" @click="handleSubmit()">
+        <a-button type="primary" @click="handleSubmit()" id="menuModal-handleSubmit">
           保存
         </a-button>
-        <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+        <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()" id="menuModal-handleCancel">
           取消
         </a-button>
       </a-form-item>
@@ -62,9 +60,6 @@ export default {
   },
   methods: {
     onExpand (expandedKeys) {
-      console.log('onExpand', expandedKeys)
-      // if not set autoExpandParent to false, if children expanded, parent can not collapse.
-      // or, you can remove all expanded children keys.
       this.expandedKeys = expandedKeys
       this.autoExpandParent = false
     },
@@ -76,7 +71,6 @@ export default {
       this.clear()
       this.$emit('close')
     },
-
     // 保存提交
     handleSubmit () {
       const _this = this
@@ -87,9 +81,7 @@ export default {
             return this.$message.warning('请先选择菜单')
           }
           const arr = this.checkedData.join(',')
-          console.log({ id: this.id, menuIds: arr })
           addMenuPower({ id: this.id, menuIds: arr }).then(res => {
-            console.log(res, 'res--save')
             if (res.status + '' === '200') {
               this.$message.success(res.message ? res.message : '保存成功')
               this.$emit('refresh')
@@ -105,24 +97,16 @@ export default {
     },
     // 取消
     handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定取消吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
+      this.cancel()
     },
     clear () {
       this.form.resetFields()
       this.roleName = ''
       this.id = ''
       this.checkedKeys = []
+      this.expandedKeys = []
     },
+    // 查找叶子节点
     findLeaf (data, arr) {
       for (let i = 0; i < data.length; i++) {
         const node = data[i]
@@ -133,14 +117,13 @@ export default {
             return item == node.id
           })
           if (hasNode) {
+            this.expandedKeys.push(node.id)
             this.checkedKeys.push(node.id)
           }
         }
       }
     }
   },
-  mounted () {
-  },
   beforeCreate () {
     this.form = this.$form.createForm(this, { name: 'menuModal' })
   },
@@ -156,16 +139,9 @@ export default {
           this.roleName = '分配权限' + '(' + this.data.role.name + ')'
           if (this.data.role.menuIds) {
             const arr = this.data.role.menuIds.split(',')
-            const temp = []
-            arr.map(item => {
-              temp.push(Number(item))
-            })
-            this.checkedData = temp
-            this.expandedKeys = temp
+            this.checkedData = arr
             // 找出叶子节点
-            this.findLeaf(this.treeData, temp)
-            // console.log(this.checkedKeys, 'this.checkedKeys----')
-            // console.log(this.checkedData, 'this.checkedData')
+            this.findLeaf(this.treeData, arr)
           }
         }
       } else {

+ 119 - 79
src/views/power/role/roleList.vue

@@ -5,24 +5,31 @@
         <a-row :gutter="48">
           <a-col :md="6" :sm="24">
             <a-form-item label="角色名称">
-              <a-input allowClear v-model="queryParam.name" placeholder="请输入角色名称"/>
+              <a-input
+                allowClear
+                v-model.trim="queryParam.name"
+                placeholder="请输入角色名称"
+                :maxLength="30"
+                id="roleList-name"
+                @pressEnter="$refs.table.refresh(true)" />
             </a-form-item>
           </a-col>
 
           <a-col :md="6" :sm="24">
             <a-form-item label="状态">
-              <v-select code="CHECK_ENABLE_STATE" v-model="queryParam.isEnable" allowClear placeholder="请选择状态" ></v-select>
+              <v-select code="ENABLE_FLAG" v-model="queryParam.isEnable" allowClear placeholder="请选择状态" id="roleList-isEnable"></v-select>
             </a-form-item>
           </a-col>
-          <a-col :md="4" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+          <a-col :md="6" :sm="24">
+            <a-button type="primary" @click="$refs.table.refresh(true)" id="roleList-handSubmit" style="margin-right: 10px;">查询</a-button>
+            <a-button type="" @click="reset" id="roleList-reset">重置</a-button>
           </a-col>
         </a-row>
       </a-form>
     </div>
-    <a-divider/>
+    <a-divider />
     <div class="table-operator">
-      <a-button type="primary" icon="plus" @click="openModal">新建</a-button>
+      <a-button type="primary" icon="plus" @click="openModal" id="roleList-openModal">新增</a-button>
     </div>
 
     <s-table
@@ -31,18 +38,25 @@
       rowKey="id"
       :columns="columns"
       :data="loadData"
-      bordered
-    >
+      bordered>
+      <!-- 启用禁用 -->
       <span slot="status" slot-scope="text, record">
-        <a-switch checkedChildren="" unCheckedChildren="" v-model="record.isEnable" @change="changeFlagHandle(text, record)"/>
+        <a-switch checkedChildren="启用" unCheckedChildren="禁用" id="roleList-isEnable" v-model="record.isEnable" @change="changeFlagHandle(text, record)" />
       </span>
-
+      <!-- 角色描述 -->
+      <template slot="remarks" slot-scope="text, record">
+        <span :title="record.remarks" style="display: inline-block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">{{ record.remarks ?record.remarks : '--' }}</span>
+      </template>
+      <!-- 操作 -->
       <span slot="action" slot-scope="text, record">
-        <template>
-          <a class="action-button menu-text" @click="openMenuModal(record)">菜单权限</a>
-          <a class="action-button" @click="handleEdit(record)">修改</a>
-          <a v-if="!record.isEnable" class="action-button red-text" @click="delect(record)">删除</a>
-        </template>
+        <a-icon type="setting" title="菜单权限" class="actionBtn icon-orange" @click="openMenuModal(record)" />
+        <a-icon type="edit" title="编辑" class="actionBtn icon-blues" @click="handleEdit(record)" />
+        <a-icon
+          type="delete"
+          title="删除"
+          class="actionBtn icon-red"
+          v-if="!record.isEnable"
+          @click="delect(record)" />
       </span>
     </s-table>
     <roleModal :visible="showModal" :data="itemData" @refresh="refreshTable" @close="showModal = false"></roleModal>
@@ -51,14 +65,25 @@
 </template>
 
 <script>
-import { STable, VSelect } from '@/components'
+import {
+  STable,
+  VSelect
+} from '@/components'
 import roleModal from './roleModal.vue'
 import menuModal from './menuModal.vue'
-import { getPowerRoleList, updateEnableStatus, delectRolePower, getMenuList } from '@/api/power-role.js'
+import {
+  getPowerRoleList,
+  updateEnableStatus,
+  delectRolePower,
+  getMenuList
+} from '@/api/power-role.js'
 export default {
   name: 'RoleList',
   components: {
-    STable, VSelect, roleModal, menuModal
+    STable,
+    VSelect,
+    roleModal,
+    menuModal
   },
   data () {
     return {
@@ -72,43 +97,50 @@ export default {
       itemData: {}, // 编辑行数据
       menuData: {},
       // 表头
-      columns: [
-        {
-          title: '序号',
-          dataIndex: 'no',
-          width: '40',
-          align: 'center'
-        },
-        {
-          title: '角色名称',
-          dataIndex: 'name',
-          width: '100',
-          align: 'center'
-        },
-        {
-          title: '角色描述',
-          dataIndex: 'remarks',
-          width: '100',
-          align: 'center'
-        },
-        {
-          title: '状态',
-          width: '100',
-          align: 'center',
-          scopedSlots: { customRender: 'status' }
-        },
-        {
-          title: '创建时间',
-          dataIndex: 'createDate',
-          width: '120',
-          align: 'center'
-        },
-        {
-          title: '操作',
-          width: '100',
-          align: 'center',
-          scopedSlots: { customRender: 'action' }
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '创建时间',
+        dataIndex: 'createDate',
+        width: 150,
+        align: 'center'
+      },
+      {
+        title: '角色名称',
+        dataIndex: 'name',
+        width: 200,
+        align: 'center'
+      },
+      {
+        title: '角色描述',
+        dataIndex: 'remarks',
+        width: 200,
+        ellipsis: true, // 内容超过宽度 自动出现省略号
+        align: 'center',
+        scopedSlots: {
+          customRender: 'remarks'
+        }
+      },
+      {
+        title: '状态',
+        width: 150,
+        align: 'center',
+        scopedSlots: {
+          customRender: 'status'
+        }
+      },
+      {
+        title: '操作',
+        width: 150,
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
         }
+      }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -137,6 +169,12 @@ export default {
     refreshTable () {
       this.$refs.table.refresh(true)
     },
+    // 重置
+    reset () {
+      this.queryParam.name = ''
+      this.queryParam.isEnable = ''
+      this.refreshTable()
+    },
     // 新建
     openModal () {
       this.showModal = true
@@ -149,7 +187,9 @@ export default {
     // 获取菜单树列表
     getMenuList (id) {
       const _this = this
-      getMenuList({ id: id }).then(res => {
+      getMenuList({
+        id: id
+      }).then(res => {
         if (res.status == 200) {
           _this.menuData = res.data
           this.showMenuModal = true
@@ -163,6 +203,7 @@ export default {
       const _this = this
       this.$confirm({
         title: '警告',
+        centered: true,
         content: '删除后无法恢复,确认删除?',
         okText: '确定',
         cancelText: '取消',
@@ -172,13 +213,9 @@ export default {
           }).then(res => {
             console.log(res, 'res1111')
             if (res.status == 200) {
-              _this.$message.success('删除成功')
+              _this.$message.success(res.message)
               _this.$refs.table.refresh()
-            } else {
-              this.$message.error(res.message)
             }
-          }).catch(() => {
-            _this.$message.success('删除失败, 请稍后重试')
           })
         }
       })
@@ -196,7 +233,7 @@ export default {
       }
       updateEnableStatus(_data).then(res => {
         if (res.status + '' === '200') {
-          this.$message.success('修改成功')
+          this.$message.success(res.message)
         } else {
           record.isEnable = !record.isEnable
         }
@@ -206,22 +243,25 @@ export default {
 }
 </script>
 <style scoped>
-  .table-page-search-wrapper .ant-form-inline .ant-form-item{
-    margin-bottom: 0;
-  }
-  .action-button{
-    line-height: 40px;
-    white-space: nowrap;
-    padding: 5px 10px;
-    background-color: #1890ff;
-    border-radius: 4px;
-    color: #fff;
-    margin-right: 5px;
-  }
-  .red-text{
-    background-color: red;
-  }
-  .menu-text {
-    background-color: #f90;
-  }
+	.table-page-search-wrapper .ant-form-inline .ant-form-item {
+		margin-bottom: 0;
+	}
+
+	.action-button {
+		line-height: 40px;
+		white-space: nowrap;
+		padding: 5px 10px;
+		background-color: #1890ff;
+		border-radius: 4px;
+		color: #fff;
+		margin-right: 5px;
+	}
+
+	.red-text {
+		background-color: red;
+	}
+
+	.menu-text {
+		background-color: #f90;
+	}
 </style>

+ 24 - 22
src/views/power/role/roleModal.vue

@@ -1,14 +1,23 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel">
+    <a-modal
+      class="modalBox"
+      :title="titleText"
+      v-model="isshow"
+      @cancle="cancel"
+      width="45%"
+      :centered="true">
       <a-form :form="form" @submit="handleSubmit">
         <!-- 用户名称 -->
         <a-form-item label="角色名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
-            placeholder="请输入角色名称"
+            placeholder="请输入角色名称(最多30个字符)"
+            allowClear
+            :maxLength="30"
+            id="roleModal-name"
             v-decorator="['formData.name', {
-              initialValue: formData.name,
-              rules: [{ required: true, message: '请输入角色名称!' },{pattern:'^[^<|>]{1,20}$',message:'请输入不含<或>的字符,最多20个字符'}] }]"
+              initialValue: formData.name,getValueFromEvent: $filterEmpty,
+              rules: [{ required: true, message: '请输入角色名称(最多30个字符)!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]"
           />
         </a-form-item>
 
@@ -16,6 +25,7 @@
         <a-form-item label="状态" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-radio-group
             name="radioGroup"
+            id="roleModal-isEnable"
             v-decorator="[
               'formData.isEnable',
               {
@@ -30,21 +40,23 @@
 
         <a-form-item label="角色描述" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-textarea
+            id="roleModal-remarks"
+            :maxLength="500"
             v-decorator="[
               'formData.remarks',
-              { initialValue: formData.remarks,
+              { initialValue: formData.remarks,getValueFromEvent: $filterEmpty,
                 rules: [] },
             ]"
             style="min-height: 60px;"
-            placeholder=""
+            placeholder="请输入角色描述(最多500个字符)"
             autosize />
         </a-form-item>
 
-        <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button type="primary" @click="handleSubmit()">
+        <a-form-item :wrapper-col="{ span: 24, offset: 10 }">
+          <a-button type="primary" @click="handleSubmit()" id="roleModal-handleSubmit" :style="{ marginRight: '15px' }">
             保存
           </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button :style="{ marginLeft: '15px' }" @click="handleCancel()" id="roleModal-handleCancel">
             取消
           </a-button>
         </a-form-item>
@@ -76,7 +88,7 @@ export default {
   },
   data () {
     return {
-      titleText: '添加角色',
+      titleText: '新增角色',
       isshow: this.visible,
       formLayout: 'horizontal',
       form: this.$form.createForm(this, { name: 'roleModal' }),
@@ -117,17 +129,7 @@ export default {
     },
     // 取消
     handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定取消吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
+      this.cancel()
     },
     clear () {
       this.form.resetFields()
@@ -156,7 +158,7 @@ export default {
           this.formData.isEnable = Number(this.formData.isEnable)
           console.log(this.formData, 'this.formData')
         } else {
-          this.titleText = '添加角色'
+          this.titleText = '新增角色'
         }
       } else {
         this.cancel()

+ 135 - 95
src/views/power/user/userList.vue

@@ -5,30 +5,43 @@
         <a-row :gutter="48">
           <a-col :md="6" :sm="24">
             <a-form-item label="用户名称">
-              <a-input allowClear v-model="queryParam.name" placeholder="请输入用户名称"/>
+              <a-input
+                allowClear
+                v-model.trim="queryParam.name"
+                placeholder="请输入用户名称"
+                id="userList-name"
+                :maxLength="30"
+                @pressEnter="$refs.table.refresh(true)" />
             </a-form-item>
           </a-col>
 
           <a-col :md="6" :sm="24">
             <a-form-item label="手机号码">
-              <a-input allowClear v-model="queryParam.phone" placeholder="请输入手机号码"/>
+              <a-input
+                allowClear
+                v-model.trim="queryParam.phone"
+                placeholder="请输入手机号码"
+                :maxLength="11"
+                id="userList-phone"
+                @pressEnter="$refs.table.refresh(true)" />
             </a-form-item>
           </a-col>
 
           <a-col :md="6" :sm="24">
             <a-form-item label="状态">
-              <v-select code="CHECK_ENABLE_STATE" v-model="queryParam.loginFlag" allowClear placeholder="请选择状态"></v-select>
+              <v-select code="ENABLE_FLAG" v-model="queryParam.loginFlag" allowClear placeholder="请选择状态" id="userList-check-enable-state"></v-select>
             </a-form-item>
           </a-col>
-          <a-col :md="4" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+          <a-col :md="6" :sm="24">
+            <a-button type="primary" @click="$refs.table.refresh(true)" id="userList-handSubmit" style="margin-right: 10px;">查询</a-button>
+            <a-button type="" @click="reset" id="userList-reset">重置</a-button>
           </a-col>
         </a-row>
       </a-form>
     </div>
-    <a-divider/>
+    <a-divider />
     <div class="table-operator">
-      <a-button type="primary" icon="plus" @click="openModal">新建</a-button>
+      <a-button type="primary" icon="plus" @click="openModal" id="userList-openModal">新增</a-button>
     </div>
 
     <s-table
@@ -37,23 +50,34 @@
       rowKey="id"
       :columns="columns"
       :data="loadData"
-      bordered
-    >
+      bordered>
       <span slot="status" slot-scope="text, record">
-        <a-switch checkedChildren="" unCheckedChildren="" v-model="record.loginFlag" @change="changeFlagHandle(text, record)"/>
+        <a-switch
+          checkedChildren="启用"
+          unCheckedChildren="禁用"
+          v-model="record.loginFlag"
+          @change="changeFlagHandle(text, record)"
+          id="userList-changeFlagHandle" />
       </span>
-      <div slot="roleNames" slot-scope="text, record" :title="record.roleNames">
-        <span v-if="record.roleNames">{{ record.roleNames.substr(0,12) + '...' }}</span>
-        <span v-else>无</span>
-      </div>
       <span slot="action" slot-scope="text, record">
-        <template>
-          <div >
-            <a class="action-button" @click="handleEdit(record)">修改</a>
-            <a v-if="record.loginFlag" class="action-button reset-text" @click="resetPassword(record)">重置密码</a>
-            <a v-if="!record.loginFlag" class="action-button red-text" @click="delect(record)">删除</a>
-          </div>
-        </template>
+        <a-icon
+          type="unlock"
+          title="重置密码"
+          v-if="record.loginFlag==1"
+          class="actionBtn icon-orange"
+          @click="resetPassword(record)" />
+        <a-icon
+          type="edit"
+          title="编辑"
+          class="actionBtn icon-blues"
+          @click="handleEdit(record)"
+        />
+        <a-icon
+          type="delete"
+          title="删除"
+          class="actionBtn icon-red"
+          v-if="record.loginFlag==0"
+          @click="delect(record)"/>
       </span>
     </s-table>
     <userModal :visible="showModal" @refresh="$refs.table.refresh(true)" :data="itemData" @close="showModal = false"></userModal>
@@ -61,13 +85,23 @@
 </template>
 
 <script>
-import { STable, VSelect } from '@/components'
+import {
+  STable,
+  VSelect
+} from '@/components'
 import userModal from './userModal.vue'
-import { resetPSD, updateEnableStatus, getPowerUserList, delectUserPower } from '@/api/power-user.js'
+import {
+  resetPSD,
+  updateEnableStatus,
+  getPowerUserList,
+  delectUserPower
+} from '@/api/power-user.js'
 export default {
   name: 'UserList',
   components: {
-    STable, VSelect, userModal
+    STable,
+    VSelect,
+    userModal
   },
   data () {
     return {
@@ -80,49 +114,52 @@ export default {
       showModal: false,
       itemData: {}, // 编辑行数据
       // 表头
-      columns: [
-        {
-          title: '序号',
-          dataIndex: 'no',
-          width: '40',
-          align: 'center'
-        },
-        {
-          title: '用户名称',
-          dataIndex: 'name',
-          width: '100',
-          align: 'center'
-        },
-        {
-          title: '手机号码',
-          dataIndex: 'phone',
-          width: '100',
-          align: 'center'
-        },
-        {
-          title: '角色',
-          width: '100',
-          align: 'center',
-          scopedSlots: { customRender: 'roleNames' }
-        },
-        {
-          title: '状态',
-          width: '100',
-          align: 'center',
-          scopedSlots: { customRender: 'status' }
-        },
-        {
-          title: '创建时间',
-          dataIndex: 'createDate',
-          width: '120',
-          align: 'center'
-        },
-        {
-          title: '操作',
-          width: '100',
-          align: 'center',
-          scopedSlots: { customRender: 'action' }
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: 60,
+        align: 'center'
+      },
+      {
+        title: '创建时间',
+        dataIndex: 'createDate',
+        width: '120',
+        align: 'center'
+      },
+      {
+        title: '用户名称',
+        dataIndex: 'name',
+        width: '100',
+        align: 'center'
+      },
+      {
+        title: '手机号码',
+        dataIndex: 'phone',
+        width: '100',
+        align: 'center'
+      },
+      {
+        title: '角色',
+        width: '100',
+        align: 'center',
+        dataIndex: 'roleNames'
+      },
+      {
+        title: '状态',
+        width: '100',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'status'
+        }
+      },
+      {
+        title: '操作',
+        width: '100',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
         }
+      }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -154,18 +191,21 @@ export default {
       this.showModal = true
       this.itemData = {}
     },
+    // 重置
+    reset () {
+      this.queryParam.name = ''
+      this.queryParam.phone = '',
+      this.queryParam.loginFlag = ''
+      this.refreshTable()
+    },
     // 重置密码
     resetPassword (row) {
       resetPSD({
         id: row.id
       }).then(res => {
         if (res.status == 200) {
-          this.$message.success('密码重置成功')
-        } else {
-          this.$message.error(res.message)
+          this.$message.success(res.message)
         }
-      }).catch(() => {
-        this.$message.success('密码重置失败, 请稍后重试')
       })
     },
     // 删除
@@ -173,6 +213,7 @@ export default {
       const _this = this
       this.$confirm({
         title: '警告',
+        centered: true,
         content: '删除后无法恢复,确认删除?',
         okText: '确定',
         cancelText: '取消',
@@ -181,13 +222,9 @@ export default {
             id: row.id
           }).then(res => {
             if (res.status == 200) {
-              _this.$message.success('删除成功')
+              _this.$message.success(res.message)
               _this.$refs.table.refresh()
-            } else {
-              _this.$message.error(res.message)
             }
-          }).catch(() => {
-            _this.$message.success('删除失败, 请稍后重试')
           })
         }
       })
@@ -212,7 +249,7 @@ export default {
       }
       updateEnableStatus(_data).then(res => {
         if (res.status + '' === '200') {
-          this.$message.success('修改成功')
+          this.$message.success(res.message)
         } else {
           record.loginFlag = !record.loginFlag
         }
@@ -222,22 +259,25 @@ export default {
 }
 </script>
 <style scoped>
-  .table-page-search-wrapper .ant-form-inline .ant-form-item{
-    margin-bottom: 0;
-  }
-  .action-button{
-   line-height: 40px;
-   white-space: nowrap;
-    padding: 5px 10px;
-    background-color: #1890ff;
-    border-radius: 4px;
-    color: #fff;
-    margin-right: 5px;
-  }
-  .red-text{
-    background-color: red;
-  }
-  .reset-text {
-    background-color: #31b50b;
-  }
+	.table-page-search-wrapper .ant-form-inline .ant-form-item {
+		margin-bottom: 0;
+	}
+
+	.action-button {
+		line-height: 40px;
+		white-space: nowrap;
+		padding: 5px 10px;
+		background-color: #1890ff;
+		border-radius: 4px;
+		color: #fff;
+		margin-right: 5px;
+	}
+
+	.red-text {
+		background-color: red;
+	}
+
+	.reset-text {
+		background-color: #31b50b;
+	}
 </style>

+ 34 - 28
src/views/power/user/userModal.vue

@@ -1,16 +1,25 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel">
+    <a-modal
+      class="modalBox"
+      :title="titleText"
+      v-model="isshow"
+      @cancle="cancel"
+      width="45%"
+      :centered="true">
       <a-form :form="form" @submit="handleSubmit">
         <a-row :gutter="24">
           <a-col :span="12">
             <!-- 用户名称 -->
             <a-form-item label="用户名称" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
-                placeholder="请输入用户名称"
+                placeholder="请输入用户名称(最多30个字符)"
+                allowClear
+                id="userModal-name"
+                :maxLength="30"
                 v-decorator="['formData.name', {
-                  initialValue: formData.name,
-                  rules: [{ required: true, message: '请输入用户名称!' },{pattern:'^[^<|>]{1,20}$',message:'请输入不含<或>的字符,最多20个字符'}] }]"
+                  initialValue: formData.name,getValueFromEvent: $filterEmpty,
+                  rules: [{ required: true, message: '请输入用户名称(最多30个字符)!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]"
               />
             </a-form-item>
           </a-col>
@@ -19,8 +28,11 @@
             <a-form-item label="手机号码" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 placeholder="请输入手机号码"
+                allowClear
+                :maxLength="11"
+                id="userModal-phone"
                 v-decorator="['formData.phone', {
-                  initialValue: formData.phone,
+                  initialValue: formData.phone,getValueFromEvent: $filterEmpty,
                   rules: [{ required: true, message: '请输入手机号码!' },{pattern:/^[1][0-9]{10}$/, message: '请输入正确的手机号码!'}] }]"
               />
             </a-form-item>
@@ -33,6 +45,7 @@
             <a-form-item label="性别" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <v-select
                 code="SEX"
+                id="userModal-sex"
                 v-decorator="[
                   'formData.sex',
                   {
@@ -48,6 +61,7 @@
             <a-form-item label="状态" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-radio-group
                 name="radioGroup"
+                id="userModal-loginFlag"
                 v-decorator="[
                   'formData.loginFlag',
                   {
@@ -55,8 +69,8 @@
                     rules: [{ required: true, message: '请选择状态!' }] },
                 ]"
               >
-                <a-radio :value="1"></a-radio>
-                <a-radio :value="0"></a-radio>
+                <a-radio :value="1">启用</a-radio>
+                <a-radio :value="0">禁用</a-radio>
               </a-radio-group>
 
             </a-form-item>
@@ -66,15 +80,17 @@
           <a-col :span="24">
             <a-form-item label="角色" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
               <a-select
+                id="userModal-roleNames"
                 v-decorator="[
                   'formData.roleNames',
                   {
                     initialValue: formData.roleNames,
-                    rules: [{ required: true, message: '请选择状态!' }] },
+                    rules: [{ required: true, message: '请选择角色!' }] },
                 ]"
                 mode="multiple"
                 style="width: 100%"
                 placeholder="请选择角色"
+                allowClear
               >
                 <a-select-option
                   v-for="item in roleList"
@@ -91,24 +107,25 @@
           <a-col :span="24">
             <a-form-item label="备注" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
               <a-textarea
+                id="userModal-remarks"
+                :maxLength="500"
                 v-decorator="[
                   'formData.remarks',
                   {
-                    initialValue: formData.remarks,
+                    initialValue: formData.remarks,getValueFromEvent: $filterEmpty,
                     rules: [] },
                 ]"
                 style="min-height: 50px;"
-                placeholder=""
+                placeholder="请输入备注(最多500个字符)"
                 autosize />
             </a-form-item>
           </a-col>
         </a-row>
-
-        <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button type="primary" @click="handleSubmit()">
+        <a-form-item :wrapper-col="{ span: 24, offset: 10}">
+          <a-button type="primary" @click="handleSubmit()" id="userModal-handleSubmit" :style="{ marginRight: '15px' }">
             保存
           </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button :style="{ marginLeft: '15px' }" @click="handleCancel()" id="userModal-handleCancel">
             取消
           </a-button>
         </a-form-item>
@@ -140,7 +157,7 @@ export default {
   },
   data () {
     return {
-      titleText: '添加用户',
+      titleText: '新增用户',
       isshow: this.visible,
       formLayout: 'horizontal',
       form: this.$form.createForm(this, { name: 'miniForm' }),
@@ -169,7 +186,6 @@ export default {
         console.log(values, 'values222')
         if (!err) {
           values.formData.roleNames = values.formData.roleNames.join(',')
-
           console.log(values.formData, ' formData.type222222222')
           console.log(Object.assign({ id: this.data.id ? this.data.id : '' }, values.formData))
           saveUserPower(Object.assign({ id: this.data.id ? this.data.id : '' }, values.formData)).then(res => {
@@ -189,17 +205,7 @@ export default {
     },
     // 取消
     handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定取消吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
+      this.cancel()
     },
     clear () {
       this.form.resetFields()
@@ -268,7 +274,7 @@ export default {
           // this.formData.sex = Number(this.formData.sex)
           console.log(this.formData, 'this.formData')
         } else {
-          this.titleText = '添加用户'
+          this.titleText = '新增用户'
         }
       } else {
         this.cancel()

+ 159 - 187
src/views/tenants/tenantsList.vue

@@ -1,21 +1,21 @@
 <template>
   <a-card :bordered="false">
     <div class="table-page-search-wrapper">
-      <a-form layout="inline">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="48">
           <a-col :span="6">
-            <a-form-item label="企业名称" >
-              <a-input allowClear v-model.trim="queryParam.name" placeholder="请输入企业名称"/>
+            <a-form-item label="企业名称">
+              <a-input allowClear v-model.trim="queryParam.name" placeholder="请输入企业名称" />
             </a-form-item>
           </a-col>
           <a-col :span="6">
-            <a-form-item label="申请人手机" >
-              <a-input allowClear v-model.trim="queryParam.contactPhone" placeholder="请输入申请人手机"/>
+            <a-form-item label="负责人手机">
+              <a-input allowClear v-model.trim="queryParam.contactPhone" placeholder="请输入申请人手机" />
             </a-form-item>
           </a-col>
           <a-col :span="6">
-            <a-form-item label="推荐人手机" >
-              <a-input allowClear v-model.trim="queryParam.introPhone" placeholder="请输入推荐人手机"/>
+            <a-form-item label="启用状态">
+              <v-select ref="status" allowClear placeholder="状态" v-model="queryParam.status" code="ENABLE_FLAG"></v-select>
             </a-form-item>
           </a-col>
           <a-col :span="6">
@@ -23,73 +23,52 @@
             <a-button type="" @click="reset">重置</a-button>
           </a-col>
         </a-row>
-        <a-row :gutter="48">
-          <a-col :span="6">
-            <a-form-item label="是否有推荐人" >
-              <a-select
-                allowClear
-                v-model="queryParam.applyType"
-                placeholder="是否有推荐人"
-              >
-                <a-select-option :value="1">
-                  是
-                </a-select-option>
-                <a-select-option :value="0">
-                  否
-                </a-select-option>
-              </a-select>
-              <!-- <v-select ref="applyType" allowClear placeholder="是否有推荐人" v-model="queryParam.applyType" code="FLAG"></v-select> -->
-            </a-form-item>
-          </a-col>
-          <a-col :span="6">
-            <a-form-item label="状态" >
-              <v-select ref="status" allowClear placeholder="状态" v-model="queryParam.status" code="CHECK_ENABLE_STATE"></v-select>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <v-select v-show="false" ref="orgType" allowClear code="ORG_TYPE"></v-select>
       </a-form>
     </div>
+    <a-divider />
+    <div class="table-operator">
+      <a-button type="primary" icon="plus" @click="openModal">新增</a-button>
+    </div>
     <s-table
       ref="table"
       size="default"
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      bordered
-    >
+      bordered>
       <!-- 操作 -->
-      <template slot="action" slot-scope="text, row">
-        <a size="small" class="action-button menu-text" @click="openModal(row)" type="primary" >授权</a>
+      <template slot="action" slot-scope="text, record">
+        <a-icon title="编辑" type="edit" class="actionBtn icon-blues" @click="openModal(record)" />
+        <!-- <a-icon title="删除" type="delete" class="actionBtn icon-red" v-if="record.status == '0'" @click="delect(record)" /> -->
       </template>
       <!-- 启用禁用 -->
       <template slot="enable" slot-scope="text, row">
-        <a-switch checkedChildren="已启用" unCheckedChildren="已禁用" v-model="row.status" @change="changeFlagHandle(text, row)"/>
-      </template>
-      <!-- 门店类型 -->
-      <template slot="orgType" slot-scope="text, row">
-        {{ $refs.orgType.getNameByCode(text) }}
-      </template>
-      <!-- 地址 -->
-      <template slot="address" slot-scope="text, row">
-        {{ getAddr(row) }}
+        <span :class="[text==1 ? 'green' : 'red']">{{ text==1 ? '已启用' : '已禁用' }}</span>
       </template>
     </s-table>
-    <!-- 授权弹窗 -->
-    <tenantsModal :itemData="itemData" :visible="openTenantsModal" @refresh="$refs.table.refresh()" @close="openTenantsModal=false"></tenantsModal>
+    <!-- 新增/编辑 弹窗 -->
+    <tenantsModal :itemId="itemId" :visible="openTenantsModal" @refresh="reset()" @close="openTenantsModal=false"></tenantsModal>
   </a-card>
 
 </template>
 
 <script>
-import { STable, VSelect } from '@/components'
-import { getTenantsList, enable } from '@/api/tenants.js'
+import {
+  STable,
+  VSelect
+} from '@/components'
+import {
+  getTenantsList,
+  tenantsDelete
+} from '@/api/tenants.js'
 import tenantsModal from './tenantsModal.vue'
 import moment from 'moment'
 export default {
   name: 'TenantsList',
   components: {
-    STable, VSelect, tenantsModal
+    STable,
+    VSelect,
+    tenantsModal
   },
   data () {
     return {
@@ -97,90 +76,74 @@ export default {
       pageNo: 1,
       pageSize: 10,
       openTenantsModal: false, // 打开授权弹窗
-      itemData: null, // 授权信息
+      itemId: '', // 要编辑的租户id
       // 查询参数
       queryParam: {
         name: '',
         contactPhone: '',
-        introPhone: '',
-        applyType: undefined, // 申请来源  0:自申请  1:推荐
         status: '' // 状态
       },
       // 表头
-      columns: [
-        {
-          title: '序号',
-          dataIndex: 'no',
-          width: '40',
-          align: 'center'
-        },
-        {
-          title: '申请时间',
-          dataIndex: 'applyTime',
-          width: '200',
-          align: 'center'
-        },
-        {
-          title: '企业名称',
-          dataIndex: 'name',
-          align: 'center'
-        },
-        {
-          title: '门店类型',
-          dataIndex: 'orgType',
-          width: '120',
-          align: 'center',
-          scopedSlots: {
-            customRender: 'orgType'
-          }
-        },
-        {
-          title: '申请人手机',
-          width: '120',
-          align: 'center',
-          dataIndex: 'contactPhone'
-        },
-        {
-          title: '推荐人手机',
-          width: '120',
-          align: 'center',
-          dataIndex: 'introPhone'
-        },
-        {
-          title: '地址',
-          width: '200',
-          align: 'center',
-          scopedSlots: {
-            customRender: 'address'
-          }
-        },
-        {
-          title: '有效期至',
-          width: '200',
-          align: 'center',
-          dataIndex: 'expireDate'
-        },
-        {
-          title: '启用状态',
-          width: '200',
-          align: 'center',
-          dataIndex: 'status',
-          scopedSlots: {
-            customRender: 'enable'
-          }
-        },
-        {
-          title: '操作',
-          width: '200',
-          align: 'center',
-          scopedSlots: {
-            customRender: 'action'
-          }
+      columns: [{
+        title: '序号',
+        dataIndex: 'no',
+        width: '40',
+        align: 'center'
+      },
+      {
+        title: '创建时间',
+        dataIndex: 'createDate',
+        width: '200',
+        align: 'center'
+      },
+      {
+        title: '企业名称',
+        dataIndex: 'name',
+        align: 'center'
+      },
+      {
+        title: '负责人名称',
+        dataIndex: 'contactName',
+        width: '120',
+        align: 'center',
+        customRender: (text) => {
+		  return text || '--'
+        }
+      },
+      {
+        title: '负责人手机',
+        width: '120',
+        align: 'center',
+        dataIndex: 'contactPhone'
+      },
+      {
+        title: '有效期至',
+        width: '200',
+        align: 'center',
+        dataIndex: 'expireDate'
+      },
+      {
+        title: '启用状态',
+        width: '200',
+        align: 'center',
+        dataIndex: 'status',
+        scopedSlots: {
+          customRender: 'enable'
+        }
+      },
+      {
+        title: '操作',
+        width: '200',
+        align: 'center',
+        scopedSlots: {
+          customRender: 'action'
         }
+      }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         return getTenantsList(Object.assign(parameter, this.queryParam)).then(res => {
+          console.log(res, 'rrrrrrr')
           if (res.status == 200) {
             const no = (res.data.pageNo - 1) * res.data.pageSize
             for (let i = 0; i < res.data.list.length; i++) {
@@ -196,86 +159,95 @@ export default {
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.$refs.table.refresh()
+      vm.reset()
     })
   },
   methods: {
-    // 地址拼接
-    getAddr (row) {
-      const provinceName = row.provinceName ? row.provinceName : ''
-      const cityName = row.cityName ? row.cityName : ''
-      const districtName = row.districtName ? row.districtName : ''
-      const addrDetail = row.addrDetail ? row.addrDetail : ''
-      if (provinceName === cityName) {
-        return cityName + districtName + addrDetail
-      }
-      return provinceName + cityName + districtName + addrDetail
-    },
-    // 修改状态
-    changeFlagHandle (text, record) {
-      const _data = {
-        id: record.id,
-        status: record.status ? '1' : '0'
-      }
-      if (!record.expireDate && _data.status == '1') {
-        this.$message.success('请确认授权设置无误并点击【确定】后,再进行启用!')
-        record.status = !record.status
-      } else {
-        enable(_data).then(res => {
-          console.log(res.status)
-          if (res.status == '200') {
-            this.$message.success('修改成功')
-            this.$refs.table.refresh()
-          } else {
-            record.status = !record.status
-          }
-        })
-      }
-    },
-    // 打开授权弹窗
-    openModal (data) {
-      this.itemData = data
+    // 打开新增/编辑 弹窗
+    openModal (row) {
+      this.itemId = row ? row.id : ''
       this.openTenantsModal = true
     },
+    // 删除
+    delect (row) {
+      const _this = this
+      this.$confirm({
+        title: '警告',
+        centered: true,
+        content: '删除后原数据不可恢复,是否删除?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk () {
+          tenantsDelete({
+          	id: row.id
+          }).then(res => {
+          	if (res.status == 200) {
+          		_this.$message.success('res.message')
+          		_this.$refs.table.refresh()
+          	}
+          })
+        }
+      })
+    },
     // 重置
     reset () {
       this.queryParam = {
         name: '',
         contactPhone: '',
-        introPhone: '',
-        applyType: '', // 申请来源  0:自申请  1:推荐
         status: '' // 状态
       }
-      this.$refs.table.refresh()
+      this.$refs.table.refresh(true)
     }
   }
 }
 </script>
 <style>
-  .table-page-search-wrapper ,.addButton{
-    margin-bottom: 0;
-  }
-  .table-page-search-wrapper .ant-form-inline .ant-form-item{
-    margin-bottom: 10px;
-  }
-  .textCount{
-    border: 1px solid #91d5ff;
-    background-color: #e6f7ff;
-    padding: 10px 0;
-    border-radius: 5px;
-    padding-left: 20px;
-    margin: 10px 0;
-  }
-  .action-button{
-    line-height: 40px;
-    white-space: nowrap;
-    padding: 5px 10px;
-    background-color: #1890ff;
-    border-radius: 4px;
-    color: #fff;
-    margin-right: 5px;
-  }
-  .menu-text {
-    background-color: #f90;
-  }
+	.table-page-search-wrapper,
+	.addButton {
+		margin-bottom: 0;
+	}
+
+	.table-page-search-wrapper .ant-form-inline .ant-form-item {
+		margin-bottom: 10px;
+	}
+
+	.textCount {
+		border: 1px solid #91d5ff;
+		background-color: #e6f7ff;
+		padding: 10px 0;
+		border-radius: 5px;
+		padding-left: 20px;
+		margin: 10px 0;
+	}
+
+	.action-button {
+		line-height: 40px;
+		white-space: nowrap;
+		padding: 5px 10px;
+		background-color: #1890ff;
+		border-radius: 4px;
+		color: #fff;
+		margin-right: 5px;
+	}
+
+	.menu-text {
+		background-color: #f90;
+	}
+
+	.actionBtn {
+		font-size: 20px;
+		padding: 0 10px;
+	}
+
+	.blue {
+		color: #1890FF;
+	}
+
+	.green {
+		color: #16b50e;
+	}
+
+	.red {
+		color: red;
+	}
 </style>

+ 323 - 196
src/views/tenants/tenantsModal.vue

@@ -1,194 +1,352 @@
 <template>
   <div>
-    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel" :width="600">
-      <a-form :form="form" @submit="handleSubmit" >
-        <!-- 企业名称 -->
-        <a-form-item label="企业名称:" :label-col="{ span: 9 }" :wrapper-col="{ span: 14 }">
-          <span>{{ itemData?itemData.name:'' }}</span>
-        </a-form-item>
-        <!-- 申请人手机 -->
-        <a-form-item label="申请人手机:" :label-col="{ span: 9 }" :wrapper-col="{ span: 14 }">
-          <span>{{ itemData?itemData.contactPhone:'' }}</span>
-        </a-form-item>
-        <!-- 推荐人手机 -->
-        <a-form-item label="推荐人手机:" :label-col="{ span: 9 }" :wrapper-col="{ span: 14 }">
-          <span>{{ itemData?itemData.introPhone:'' }}</span>
-        </a-form-item>
-
-        <!-- 使用有效期至 -->
-        <a-form-item label="使用有效期至:" :label-col="{ span: 9 }" :wrapper-col="{ span: 14 }">
-          <a-date-picker
-            style="width: 100%;"
-            @change="expireDateChange"
-            placeholder="年/月/日"
-            v-decorator="[
-              'formData.expireDate',
-              { initialValue: formData.expireDate,
-                rules: [{type: 'object', required: true, message: '请选择使用有效期!' }] },
-            ]"/>
-          <p>
-            常选:<span class="time-text" @click="timeFilter(3)">3天</span>  <span class="time-text" @click="timeFilter(30)">1个月</span>  <span class="time-text" @click="timeFilter(365)">1年</span>
-          </p>
-        </a-form-item>
-        <!-- 门店类型 -->
-        <a-form-item label="门店类型:" :label-col="{ span: 9 }" :wrapper-col="{ span: 14 }">
-          <v-select
-            ref="orgType"
-            allowClear
-            :disabled="hasOrgType"
-            @change="orgTypeChange"
-            v-decorator="[
-              'formData.orgType',
-              { initialValue: formData.orgType,
-                rules: [{ required: true, message: '请选择门店类型!' }] },
-            ]"
-            code="ORG_TYPE"></v-select>
-
-        </a-form-item>
-        <!-- 使用权限 -->
-        <a-form-item label="使用权限:" :label-col="{ span: 9 }" :wrapper-col="{ span: 14 }">
-          <v-select
-            ref="orgType"
-            allowClear
-            @change="scopeTypeChange"
-            v-decorator="[
-              'formData.scopeType',
-              { initialValue: formData.scopeType,
-                rules: [{ required: true, message: '请选择使用权限!' }] },
-            ]"
-            code="STORE_AUTH_TYPE"></v-select>
-
-        </a-form-item>
-        <!-- 最大可开通门店数 -->
-        <a-form-item v-if="formData.orgType=='ls'" label="最大可开通门店数:" :label-col="{ span: 9 }" :wrapper-col="{ span: 14 }">
-          <a-input-number
-            id="inputNumber"
-            :min="1"
-            :max="10"
-            style="width: 100%;"
-            v-decorator="[
-              'formData.childMaxNum',
-              { initialValue: formData.childMaxNum,
-                rules: [{ required: true, message: '请输入最大可开通门店数!' }] },
-            ]"
-          />
-        </a-form-item>
-        <!-- 单店最大可开通用户数 -->
-        <a-form-item v-if="formData.orgType=='ls'" label="单店最大可开通用户数:" :label-col="{ span: 9 }" :wrapper-col="{ span: 14 }">
-          <span class="labelT">( 包含管理员账号 )</span>
-          <a-input-number
-            id="inputNumber"
-            :min="1"
-            :max="100"
-            style="width: 100%;"
-            v-decorator="[
-              'formData.childUserMaxNum',
-              { initialValue: formData.childUserMaxNum,
-                rules: [{ required: true, message: '请输入单店最大可开通用户数!' }] },
-            ]"
-          />
-        </a-form-item>
-        <!-- 最大可开通用户数 -->
-        <a-form-item v-if="formData.orgType!='ls'" label="最大可开通用户数:" :label-col="{ span: 9 }" :wrapper-col="{ span: 14 }">
-          <span class="labelT">( 包含管理员账号 )</span>
-          <a-input-number
-            id="inputNumber"
-            :min="1"
-            :max="100"
-            style="width: 100%;"
-            v-decorator="[
-              'formData.childUserMaxNum',
-              { initialValue: formData.childUserMaxNum,
-                rules: [{ required: true, message: '请输入最大可开通用户数!' }] },
-            ]"
-          />
-        </a-form-item>
-
+    <a-modal
+      centered
+      class="modalBox"
+      :footer="null"
+      :title="titleText"
+      v-model="isshow"
+      @cancle="cancel"
+      :width="900">
+      <a-form :form="form" ref="form" @submit="handleSubmit">
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <!-- 企业名称 -->
+            <a-form-item label="企业名称:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+              <a-input
+                allowClear
+                :maxLength="30"
+                v-decorator="['formData.name', { initialValue: formData.name,getValueFromEvent: $filterEmpty, rules: [{ required: true, message: '请输入企业名称!' }] }]"
+                placeholder="请输入企业名称(最多30个字符)"
+              />
+            </a-form-item>
+          </a-col>
+          <!-- 企业编码 -->
+          <!-- 本次迭代先隐藏 -->
+          <!-- <a-col :span="12">
+            <a-form-item label="企业编码:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+              <a-input allowClear :maxLength="30" v-decorator="['formData.bizCode', { initialValue: formData.bizCode,getValueFromEvent: $filterEmpty }]" placeholder="请输入企业编码" />
+            </a-form-item>
+          </a-col> -->
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <!-- 负责人名称 -->
+            <a-form-item label="负责人名称:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+              <a-input allowClear :maxLength="30" v-decorator="['formData.contactName', { initialValue: formData.contactName,getValueFromEvent: $filterEmpty, rules: [] }]" placeholder="请输入负责人名称(最多30个字符)" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <!-- 负责人手机 -->
+            <a-form-item label="负责人手机:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+              <a-input
+                allowClear
+                :disabled="itemId?true:false"
+                :maxLength="11"
+                v-decorator="[
+                  'formData.contactPhone',
+                  { initialValue: formData.contactPhone, rules: [{ required: true, message: '请输入负责人手机号!' }, { pattern: /^\d{11}$/, message: '请输入正确的负责人手机号' }] }
+                ]"
+                placeholder="请输入负责人手机"
+              />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <!-- 使用有效期至 -->
+            <a-form-item label="使用有效期至:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+              <a-date-picker
+                style="width: 100%;"
+                :disabled-date="disabledDate"
+                @change="expireDateChange"
+                placeholder="年/月/日"
+                v-decorator="['formData.expireDate', { initialValue: formData.expireDate, rules: [{ type: 'object', required: true, message: '请选择使用有效期!' }] }]"
+              />
+              <p>
+                常选:
+                <span class="time-text" @click="timeFilter(3)">3天</span>
+                <span class="time-text" @click="timeFilter(30)">1个月</span>
+                <span class="time-text" @click="timeFilter(365)">1年</span>
+              </p>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <!-- 启用状态 -->
+            <a-form-item label="启用状态:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+              <a-radio-group @change="onStatusChange" v-decorator="['formData.status', { initialValue: formData.status, rules: [{ required: true, message: '请选择启用状态!' }] }]">
+                <a-radio :value="1">是</a-radio>
+                <a-radio :value="0">否</a-radio>
+              </a-radio-group>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="12">
+            <!-- 使用权限 -->
+            <a-form-item label="使用权限:" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }">
+              <v-select
+                ref="orgType"
+                allowClear
+                @change="scopeTypeChange"
+                v-decorator="['formData.scopeType', { initialValue: formData.scopeType, rules: [{ required: true, message: '请选择使用权限!' }] }]"
+                code="STORE_AUTH_TYPE"
+              ></v-select>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <!-- 地址 -->
+          <a-col span="9">
+            <a-form-item label="地址:" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
+              <a-select @change="getCityList" v-decorator="['formData.addrProvince', { initialValue: formData.addrProvince, rules: [] }]" placeholder="请选择省">
+                <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col span="7">
+            <a-form-item prop="addrCity">
+              <a-select v-decorator="['formData.addrCity', { initialValue: formData.addrCity, rules: [] }]" @change="getAreaList" placeholder="请选择市">
+                <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col span="7">
+            <a-form-item prop="addrDistrict">
+              <a-select v-decorator="['formData.addrDistrict', { initialValue: formData.addrDistrict, rules: [] }]" @change="areaCharged" placeholder="请选择区/县">
+                <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="17">
+            <!-- 详细地址 -->
+            <a-form-item label="详细地址" :label-col="{ span: 4 }" :wrapper-col="{ span: 18 }">
+              <a-input :maxLength="30" allowClear placeholder="请输入详细地址(最多30个字符)" v-decorator="['formData.addrDetail', { initialValue: formData.addrDetail,getValueFromEvent: $filterEmpty, rules: [] }]" />
+            </a-form-item>
+          </a-col>
+        </a-row>
         <a-form-item :wrapper-col="{ span: 24, offset: 10 }">
-          <a-button type="primary" @click="handleSubmit()">
-            确定
-          </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
-            取消
-          </a-button>
+          <a-button type="primary" @click="handleSubmit()">保存</a-button>
+          <a-button :style="{ marginLeft: '8px' }" @click="cancel()">取消</a-button>
         </a-form-item>
       </a-form>
-
     </a-modal>
   </div>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
-import { saveAuth } from '@/api/tenants.js'
+import { getProvince, getCityByPro, getDistrictByCity, tenantsDetail, tenantsSave } from '@/api/tenants.js'
 import moment from 'moment'
 export default {
   name: 'TenantsModal',
   components: {
-    STable, VSelect
+    STable,
+    VSelect
   },
   props: {
     visible: {
       type: Boolean,
       default: false
     },
-    itemData: {
-      type: Object,
-      default: function () {
-        return {}
+    // 要编辑的租户id
+    itemId: {
+      type: [String, Number],
+      default: ''
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (newValue) {
+        if (this.itemId) {
+          this.getDetail(this.itemId)
+        }
+      } else {
+        this.cancel()
       }
     }
   },
   data () {
     return {
       moment,
-      titleText: '设置权限',
       isshow: this.visible,
-      hasOrgType: false,
-      formLayout: 'horizontal',
-      form: this.$form.createForm(this, { name: 'tenantsModal' }),
+      form: this.$form.createForm(this, {
+        name: 'tenantsModal'
+      }),
+      addrProvinceList: [], // 省列表
+      addrCityList: [], // 市列表
+      addrDistrictList: [], // 区列表
       formData: {
-        expireDate: null,
-        orgType: '',
-        scopeType: '',
-        childMaxNum: 1,
-        childUserMaxNum: 1
+        name: '', // 企业名称
+        bizCode: '', // 企业编码
+        contactName: '', // 负责人名称
+        contactPhone: '', // 负责人电话
+        expireDate: null, // 使用有效期
+        scopeType: '', // 权限类型
+        status: 1, // 启用状态
+        addrProvince: undefined,
+        addrCity: undefined,
+        addrDistrict: undefined,
+        addrDetail: '' // 详细地址
       }
-
     }
   },
+  computed: {
+    titleText () {
+      return this.itemId ? '编辑' : '新增'
+    }
+  },
+  mounted () {
+    this.getProvinceList()
+  },
   methods: {
     cancel (e) {
       this.clear()
       this.$emit('close')
     },
+    // 不可选日期 今天以前日期不可选
+    disabledDate (current) {
+      return current && current.valueOf() < Date.now() - 86400000
+    },
+    pageInit () {
+      this.formData = {
+        name: '', // 企业名称
+        bizCode: '', // 企业编码
+        contactName: '', // 负责人名称
+        contactPhone: '', // 负责人电话
+        expireDate: null, // 使用有效期
+        scopeType: '', // 权限类型
+        status: 1, // 启用状态
+        addrProvince: undefined,
+        addrCity: undefined,
+        addrDistrict: undefined,
+        addrDetail: '' // 详细地址
+      }
+    },
+    // 查详情
+    getDetail (id) {
+      tenantsDetail({ id: id }).then(res => {
+        // console.log(res, 'rrrrrrr')
+        if (res.status == 200) {
+          // 获取市列表数据
+          this.getCityListRequest(res.data.addrProvince)
+          // 获取区列表数据
+          this.getAreaListRequest(res.data.addrCity)
+          this.formData = Object.assign(this.formData, res.data)
+          const now = moment().add(7, 'day').format('YYYY-MM-DD')
+          const expireDate = moment(now, 'YYYY-MM-DD')
+          this.formData.expireDate = this.formData.expireDate ? moment(this.formData.expireDate, 'YYYY-MM-DD') : expireDate
+          this.form.setFields({ 'formData.expireDate': { value: this.formData.expireDate, errors: '' } })
+          this.formData.status = Number(this.formData.status)
+
+          console.log(this.formData, 'this.formData')
+        }
+      })
+    },
+    // 获取省列表'
+    getProvinceList () {
+      getProvince().then(res => {
+        // console.log(res, 'rrrrrrr')
+        if (res.status == 200) {
+          this.addrProvinceList = res.data || []
+        } else {
+          this.addrProvinceList = []
+        }
+      })
+    },
+    // 获取城市列表
+    getCityList (val) {
+      this.addrCityList = []
+      this.addrDistrictList = []
+      this.form.setFields({ 'formData.addrCity': { value: undefined, errors: '' } })
+      this.form.setFields({ 'formData.addrDistrict': { value: undefined, errors: '' } })
+      this.form.setFields({ 'formData.addrDetail': { value: undefined, errors: '' } })
+      this.getCityListRequest(val)
+    },
+    getCityListRequest (val) {
+      getCityByPro({
+        id: val
+      }).then(res => {
+        if (res.status == 200) {
+          this.addrCityList = res.data || []
+        } else {
+          this.addrCityList = []
+        }
+      })
+    },
+    // 获取区县列表
+    getAreaList (val) {
+      this.addrDistrictList = []
+      this.form.setFields({ 'formData.addrDistrict': { value: undefined, errors: '' } })
+      this.form.setFields({ 'formData.addrDetail': { value: undefined, errors: '' } })
+      this.getAreaListRequest(val)
+    },
+    getAreaListRequest (val) {
+      getDistrictByCity({
+        id: val
+      }).then(res => {
+        if (res.status == 200) {
+          this.addrDistrictList = res.data || []
+        } else {
+          this.addrDistrictList = []
+        }
+      })
+    },
+    // 区县变更
+    areaCharged (val) {
+      this.form.setFields({ 'formData.addrDetail': { value: undefined, errors: '' } })
+    },
+    // 有效期改变
     expireDateChange (v) {
       console.log(v)
-      this.form.setFields({ 'formData.expireDate': { value: v, errors: '' } })
-    },
-    orgTypeChange (v) {
-      this.formData.orgType = v
-      
+      this.form.setFields({
+        'formData.expireDate': {
+          value: v,
+          errors: ''
+        }
+      })
     },
+    // 使用权限改变
     scopeTypeChange (v) {
-      this.formData.scopeType = v
+      this.form.setFields({ 'formData.scopeType': { value: v, errors: '' } })
+    },
+    // 启用状态切换
+    onStatusChange (v) {
+      console.log(v, 'vvvvvvvvvv')
+      this.formData.status = v
     },
     // 快捷时间处理
     timeFilter (time) {
-      const now = moment().add(time, 'day').format('YYYY-MM-DD')
-      this.form.setFields({ 'formData.expireDate': { value: moment(now, 'YYYY-MM-DD'), errors: '' } })
+      const now = moment()
+        .add(time, 'day')
+        .format('YYYY-MM-DD')
+      this.form.setFields({
+        'formData.expireDate': {
+          value: moment(now, 'YYYY-MM-DD'),
+          errors: ''
+        }
+      })
     },
-
     // 保存提交
     handleSubmit () {
       const _this = this
       this.form.validateFields((err, values) => {
         if (!err) {
-          console.log(values.formData, ' formData.type222222222')
-          const params = Object.assign({ id: this.itemData.id }, values.formData)
+          const params = this.itemId
+            ? Object.assign(
+              {
+                id: this.itemId
+              },
+              values.formData
+            )
+            : values.formData
           params.expireDate = moment(params.expireDate).format('YYYY-MM-DD')
-            console.log(params, 'ppppppppppppp')
-          saveAuth(params).then(res => {
+          tenantsSave(params).then(res => {
             console.log(res, 'res--save')
             if (res.status + '' === '200') {
               this.$message.success(res.message ? res.message : '保存成功')
@@ -197,74 +355,43 @@ export default {
                 _this.cancel()
               }, 300)
             } else {
-              // this.$message.warning(res.message)
+              // this.$message.error(res.message);
             }
           })
         }
       })
     },
-    // 取消
-    handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定取消吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
-    },
     clear () {
       this.form.resetFields()
+      this.pageInit()
     }
-
-  },
-  mounted () {
   },
   beforeCreate () {
-    this.form = this.$form.createForm(this, { name: 'tenantsModal' })
-  },
-  watch: {
-    visible (newValue, oldValue) {
-      this.isshow = newValue
-    },
-    isshow (newValue, oldValue) {
-      if (newValue) {
-        const now = moment().add(7, 'day').format('YYYY-MM-DD')
-        const expireDate = moment(now, 'YYYY-MM-DD')
-        this.formData.expireDate = this.itemData.expireDate ? moment(this.itemData.expireDate, 'YYYY-MM-DD') : expireDate
-        // this.form.setFields({ 'formData.expireDate': { value: this.formData.expireDate, errors: '' } })
-        this.formData.orgType = this.itemData.orgType ? this.itemData.orgType : ''
-        this.formData.scopeType = this.itemData.scopeType ? this.itemData.scopeType : ''
-        this.formData.childMaxNum = this.itemData.childMaxNum ? this.itemData.childMaxNum : 1
-        this.formData.childUserMaxNum = this.itemData.childUserMaxNum ? this.itemData.childUserMaxNum : 1
-        this.hasOrgType = !!this.itemData.menuMouldId
-      } else {
-        this.cancel()
-      }
-    }
+    this.form = this.$form.createForm(this, {
+      name: 'tenantsModal'
+    })
   }
 }
 </script>
 
-<style >
-  .modalBox{
-  }
-  .ant-modal-footer {
-    display: none;
-  }
-  .time-text{
-    color: #1890FF;
-    padding: 0px 20px;
-    cursor: pointer;
-  }
-  .labelT{
-     position: absolute;
-     left: -135px;
-     top: 20px;
-     color: rgba(0, 0, 0, 0.85);
-  }
+<style>
+.modalBox {
+}
+
+.ant-modal-footer {
+  display: none;
+}
+
+.time-text {
+  color: #1890ff;
+  padding: 0px 20px;
+  cursor: pointer;
+}
+
+.labelT {
+  position: absolute;
+  left: -135px;
+  top: 20px;
+  color: rgba(0, 0, 0, 0.85);
+}
 </style>

+ 8 - 0
src/views/user/Login.vue

@@ -184,6 +184,14 @@ export default {
     },
     handleSubmit (e) {
       e.preventDefault()
+      //  this.$router.push({ name: 'bannerSetting' }, () => {
+			  // console.log('onComplete')
+			  // this.$notification.success({
+			  //   message: '欢迎',
+			  //   description: `${timeFix()},欢迎回来`
+			  // })
+      //  })
+      //  return
       const {
         form: { validateFields },
         state,

+ 2 - 2
vue.config.js

@@ -108,8 +108,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.16.103:9110/zyit',
-        target: 'http://it.test.zyucgj.com/zyit',
+        // target: 'http://192.168.16.100:9102/at-it/',
+        target: 'https://aitour-it.test.zyucgj.com/at-it',
         ws: false,
         changeOrigin: true,
         pathRewrite: {