chenrui  2 жил өмнө
parent
commit
cf1447daba
62 өөрчлөгдсөн 4196 нэмэгдсэн , 340 устгасан
  1. 72 0
      src/api/login.js
  2. 70 0
      src/api/manage.js
  3. 9 0
      src/api/menu.js
  4. 49 0
      src/api/monitor/cache.js
  5. 79 0
      src/api/monitor/job.js
  6. 35 0
      src/api/monitor/jobLog.js
  7. 35 0
      src/api/monitor/loginLog.js
  8. 18 0
      src/api/monitor/online.js
  9. 35 0
      src/api/monitor/operlog.js
  10. 9 0
      src/api/monitor/server.js
  11. 69 0
      src/api/monitor/sysDataPermissionsDefRule.js
  12. 78 0
      src/api/monitor/sysDataPermissionsMethod.js
  13. 61 0
      src/api/monitor/sysDataPermissionsRule.js
  14. 53 0
      src/api/system/apiLog.js
  15. 68 0
      src/api/system/cargoDetail.js
  16. 69 0
      src/api/system/config.js
  17. 145 0
      src/api/system/dept.js
  18. 77 0
      src/api/system/dict/data.js
  19. 69 0
      src/api/system/dict/type.js
  20. 112 0
      src/api/system/menu.js
  21. 57 0
      src/api/system/notice.js
  22. 53 0
      src/api/system/optimizationSuggestionRule.js
  23. 70 0
      src/api/system/post.js
  24. 61 0
      src/api/system/riskGoodsNameKeySuggest.js
  25. 124 0
      src/api/system/role.js
  26. 53 0
      src/api/system/runLog.js
  27. 61 0
      src/api/system/specialCode.js
  28. 53 0
      src/api/system/syncEmergencyFlight.js
  29. 53 0
      src/api/system/sysNoticeUserRead.js
  30. 93 0
      src/api/system/sysPortalConfig.js
  31. 79 0
      src/api/system/sysPortlet.js
  32. 27 0
      src/api/system/sysTableConfig.js
  33. 60 0
      src/api/system/sysThemeConfig.js
  34. 53 0
      src/api/system/tCasebaseAwb.js
  35. 17 0
      src/api/system/upload.js
  36. 174 0
      src/api/system/user.js
  37. 53 0
      src/api/system/vCsisBusinessAsd.js
  38. 53 0
      src/api/system/vCsisBusinessRecord.js
  39. 53 0
      src/api/system/vCsisBusinessRelease.js
  40. 53 0
      src/api/system/vInternationalAsd.js
  41. 53 0
      src/api/system/vInternationalRecord.js
  42. 53 0
      src/api/system/vInternationalRelease.js
  43. 53 0
      src/api/system/vInternationalUnpacking.js
  44. 53 0
      src/api/system/waybill.js
  45. 101 0
      src/api/tool/gen.js
  46. 98 0
      src/api/tool/genConfigTemplate.js
  47. 235 0
      src/utils/aidex.js
  48. 35 0
      src/utils/axios.js
  49. 21 0
      src/utils/domUtil.js
  50. 95 0
      src/utils/drag.js
  51. 6 0
      src/utils/errorCode.js
  52. 20 0
      src/utils/filter.js
  53. 29 0
      src/utils/highlight.js
  54. 385 0
      src/utils/pt/layout/baseMouldStyles.js
  55. 119 79
      src/utils/request.js
  56. 9 0
      src/utils/requireIcons.js
  57. 30 0
      src/utils/routeConvert.js
  58. 18 0
      src/utils/screenLog.js
  59. 128 0
      src/utils/util.js
  60. 50 0
      src/utils/utils.less
  61. 51 261
      src/utils/validate.js
  62. 42 0
      src/utils/zipdownload.js

+ 72 - 0
src/api/login.js

@@ -0,0 +1,72 @@
+import request from '@/utils/request'
+
+const userApi = {
+  Login: '/login',
+  Logout: '/logout',
+  // get my info
+  UserInfo: '/getInfo',
+  SendSms: '/system/sysSms/sendSms'
+}
+
+/**
+ * login func
+ * @param parameter
+ * @returns {*}
+ */
+export function login (parameter) {
+  return request({
+    url: userApi.Login,
+    method: 'post',
+    data: parameter
+  })
+}
+
+/**
+ * login func
+ * @param parameter
+ * @returns {*}
+ */
+export function loginBySms (parameter) {
+  return request({
+    url: '/system/sysSms/loginBySms',
+    method: 'post',
+    data: parameter
+  })
+}
+
+export function getInfo () {
+  return request({
+    url: userApi.UserInfo,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+export function logout () {
+  return request({
+    url: userApi.Logout,
+    method: 'delete',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+// 获取验证码
+export function getCodeImg () {
+  return request({
+    url: '/captchaImage',
+    method: 'get'
+  })
+}
+
+// 获取手机验证码
+export function getSmsCaptcha (parameter) {
+  return request({
+    url: userApi.SendSms,
+    method: 'post',
+    data: parameter
+  })
+}

+ 70 - 0
src/api/manage.js

@@ -0,0 +1,70 @@
+import request from '@/utils/request'
+
+const api = {
+  user: '/user',
+  role: '/role',
+  service: '/service',
+  permission: '/permission',
+  permissionNoPager: '/permission/no-pager',
+  orgTree: '/org/tree'
+}
+
+export default api
+
+export function getUserList (parameter) {
+  return request({
+    url: api.user,
+    method: 'get',
+    params: parameter
+  })
+}
+
+export function getRoleList (parameter) {
+  return request({
+    url: api.role,
+    method: 'get',
+    params: parameter
+  })
+}
+
+export function getServiceList (parameter) {
+  return request({
+    url: api.service,
+    method: 'get',
+    params: parameter
+  })
+}
+
+export function getPermissions (parameter) {
+  return request({
+    url: api.permissionNoPager,
+    method: 'get',
+    params: parameter
+  })
+}
+
+export function getOrgTree (parameter) {
+  return request({
+    url: api.orgTree,
+    method: 'get',
+    params: parameter
+  })
+}
+
+// id == 0 add     post
+// id != 0 update  put
+export function saveService (parameter) {
+  return request({
+    url: api.service,
+    method: parameter.id === 0 ? 'post' : 'put',
+    data: parameter
+  })
+}
+
+export function saveSub (sub) {
+  return request({
+    url: '/sub',
+    method: sub.id === 0 ? 'post' : 'put',
+    data: sub
+  })
+}

+ 9 - 0
src/api/menu.js

@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+// 获取路由
+export const getRouters = () => {
+  return request({
+    url: '/getRouters',
+    method: 'get'
+  })
+}

+ 49 - 0
src/api/monitor/cache.js

@@ -0,0 +1,49 @@
+import request from '@/utils/request'
+
+// 查询缓存详细
+export function getCache () {
+  return request({
+    url: '/monitor/cache',
+    method: 'get'
+  })
+}
+
+// 查询缓存名称列表
+export function listCacheName () {
+  return request({
+    url: '/monitor/cache/listCacheName',
+    method: 'get'
+  })
+}
+
+// 删除角色
+export function clearCache (cacheId) {
+  return request({
+    url: '/monitor/cache/clearCache/' + cacheId,
+    method: 'delete'
+  })
+}
+
+// 查询缓存详细
+export function listCacheKey (cacheId) {
+  return request({
+    url: '/monitor/cache/listCacheKey/' + cacheId,
+    method: 'get'
+  })
+}
+
+// 删除角色
+export function clearCacheByKey (cacheId, cacheKey) {
+  return request({
+    url: '/monitor/cache/clearCacheByKey/' + cacheId + '/' + cacheKey,
+    method: 'delete'
+  })
+}
+
+// 查询缓存详细
+export function getCacheValue (cacheId, cacheKey) {
+  return request({
+    url: '/monitor/cache/getCacheValue/' + cacheId + '/' + cacheKey,
+    method: 'get'
+  })
+}

+ 79 - 0
src/api/monitor/job.js

@@ -0,0 +1,79 @@
+import request from '@/utils/request'
+
+// 查询定时任务调度列表
+export function listJob (query) {
+  return request({
+    url: '/monitor/job/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询定时任务调度详细
+export function getJob (jobId) {
+  return request({
+    url: '/monitor/job/' + jobId,
+    method: 'get'
+  })
+}
+
+// 新增定时任务调度
+export function addJob (data) {
+  return request({
+    url: '/monitor/job',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改定时任务调度
+export function updateJob (data) {
+  return request({
+    url: '/monitor/job',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除定时任务调度
+export function delJob (jobId) {
+  return request({
+    url: '/monitor/job/' + jobId,
+    method: 'delete'
+  })
+}
+
+// 导出定时任务调度
+export function exportJob (query) {
+  return request({
+    url: '/monitor/job/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 任务状态修改
+export function changeJobStatus (jobId, status) {
+  const data = {
+    jobId,
+    status
+  }
+  return request({
+    url: '/monitor/job/changeStatus',
+    method: 'put',
+    data: data
+  })
+}
+
+// 定时任务立即执行一次
+export function runJob (jobId, jobGroup) {
+  const data = {
+    jobId,
+    jobGroup
+  }
+  return request({
+    url: '/monitor/job/run',
+    method: 'put',
+    data: data
+  })
+}

+ 35 - 0
src/api/monitor/jobLog.js

@@ -0,0 +1,35 @@
+import request from '@/utils/request'
+
+// 查询调度日志列表
+export function listJobLog (query) {
+  return request({
+    url: '/monitor/jobLog/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 删除调度日志
+export function delJobLog (jobLogId) {
+  return request({
+    url: '/monitor/jobLog/' + jobLogId,
+    method: 'delete'
+  })
+}
+
+// 清空调度日志
+export function cleanJobLog () {
+  return request({
+    url: '/monitor/jobLog/clean',
+    method: 'delete'
+  })
+}
+
+// 导出调度日志
+export function exportJobLog (query) {
+  return request({
+    url: '/monitor/jobLog/export',
+    method: 'get',
+    params: query
+  })
+}

+ 35 - 0
src/api/monitor/loginLog.js

@@ -0,0 +1,35 @@
+import request from '@/utils/request'
+
+// 查询登录日志列表
+export function list (query) {
+  return request({
+    url: '/monitor/loginLog/page',
+    method: 'get',
+    params: query
+  })
+}
+
+// 删除登录日志
+export function delLoginLog (infoId) {
+  return request({
+    url: '/monitor/loginLog/' + infoId,
+    method: 'delete'
+  })
+}
+
+// 清空登录日志
+export function cleanLoginLog () {
+  return request({
+    url: '/monitor/loginLog/clean',
+    method: 'delete'
+  })
+}
+
+// 导出登录日志
+export function exportLoginLog (query) {
+  return request({
+    url: '/monitor/loginLog/export',
+    method: 'get',
+    params: query
+  })
+}

+ 18 - 0
src/api/monitor/online.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+// 查询在线用户列表
+export function list (query) {
+  return request({
+    url: '/monitor/online/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 强退用户
+export function forceLogout (tokenId) {
+  return request({
+    url: '/monitor/online/' + tokenId,
+    method: 'delete'
+  })
+}

+ 35 - 0
src/api/monitor/operlog.js

@@ -0,0 +1,35 @@
+import request from '@/utils/request'
+
+// 查询操作日志列表
+export function list (query) {
+  return request({
+    url: '/monitor/operlog/page',
+    method: 'get',
+    params: query
+  })
+}
+
+// 删除操作日志
+export function delOperlog (operId) {
+  return request({
+    url: '/monitor/operlog/' + operId,
+    method: 'delete'
+  })
+}
+
+// 清空操作日志
+export function cleanOperlog () {
+  return request({
+    url: '/monitor/operlog/clean',
+    method: 'delete'
+  })
+}
+
+// 导出操作日志
+export function exportOperlog (query) {
+  return request({
+    url: '/monitor/operlog/export',
+    method: 'get',
+    params: query
+  })
+}

+ 9 - 0
src/api/monitor/server.js

@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+// 查询服务器详细
+export function getServer () {
+  return request({
+    url: '/monitor/server',
+    method: 'get'
+  })
+}

+ 69 - 0
src/api/monitor/sysDataPermissionsDefRule.js

@@ -0,0 +1,69 @@
+import request from '@/utils/request'
+
+// 查询默认规则维护列表
+export function listSysDataPermissionsDefRule (query) {
+  return request({
+    url: '/monitor/sysDataPermissionsDefRule/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询默认规则维护详细
+export function getSysDataPermissionsDefRule (id) {
+  return request({
+    url: '/monitor/sysDataPermissionsDefRule/' + id,
+    method: 'get'
+  })
+}
+
+// 新增默认规则维护
+export function addSysDataPermissionsDefRule (data) {
+  return request({
+    url: '/monitor/sysDataPermissionsDefRule',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改默认规则维护
+export function updateSysDataPermissionsDefRule (data) {
+  return request({
+    url: '/monitor/sysDataPermissionsDefRule',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除默认规则维护
+export function delSysDataPermissionsDefRule (id) {
+  return request({
+    url: '/monitor/sysDataPermissionsDefRule/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出默认规则维护
+export function exportSysDataPermissionsDefRule (query) {
+  return request({
+    url: '/monitor/sysDataPermissionsDefRule/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询菜单同层最大排序
+export function findMaxSort () {
+  return request({
+    url: '/monitor/sysDataPermissionsDefRule/findMaxSort',
+    method: 'get'
+  })
+}
+
+// 获得全部的且已启用的默认规则
+export function getAllDefaultRule () {
+  return request({
+    url: '/monitor/sysDataPermissionsDefRule/getAllDefaultRule',
+    method: 'get'
+  })
+}

+ 78 - 0
src/api/monitor/sysDataPermissionsMethod.js

@@ -0,0 +1,78 @@
+import request from '@/utils/request'
+
+// 查询数据权限方法维护列表
+export function listSysDataPermissionsMethod (query) {
+  return request({
+    url: '/monitor/sysDataPermissionsMethod/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询数据权限方法维护详细
+export function getSysDataPermissionsMethod (id) {
+  return request({
+    url: '/monitor/sysDataPermissionsMethod/' + id,
+    method: 'get'
+  })
+}
+
+// 新增数据权限方法维护
+export function addSysDataPermissionsMethod (data) {
+  return request({
+    url: '/monitor/sysDataPermissionsMethod',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改数据权限方法维护
+export function updateSysDataPermissionsMethod (data) {
+  return request({
+    url: '/monitor/sysDataPermissionsMethod',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除数据权限方法维护
+export function delSysDataPermissionsMethod (id) {
+  return request({
+    url: '/monitor/sysDataPermissionsMethod/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出数据权限方法维护
+export function exportSysDataPermissionsMethod (query) {
+  return request({
+    url: '/monitor/sysDataPermissionsMethod/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 新增数据权限方法维护
+export function getAllMapperData () {
+  return request({
+    url: '/monitor/sysDataPermissionsMethod/getAllMapperData',
+    method: 'get'
+  })
+}
+
+// 新增数据权限方法维护
+export function getMapperName (searchInfo) {
+  return request({
+    url: '/monitor/sysDataPermissionsMethod/getMapperName',
+    method: 'get',
+    params: searchInfo
+  })
+}
+
+export function getMethodHtml (searchInfo) {
+  return request({
+    url: '/monitor/sysDataPermissionsMethod/getMethodHtml',
+    method: 'get',
+    params: searchInfo
+  })
+}

+ 61 - 0
src/api/monitor/sysDataPermissionsRule.js

@@ -0,0 +1,61 @@
+import request from '@/utils/request'
+
+// 查询数据权限规则维护子表列表
+export function listSysDataPermissionsRule (query) {
+  return request({
+    url: '/monitor/sysDataPermissionsRule/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询数据权限规则维护子表详细
+export function getSysDataPermissionsRule (id) {
+  return request({
+    url: '/monitor/sysDataPermissionsRule/' + id,
+    method: 'get'
+  })
+}
+
+// 新增数据权限规则维护子表
+export function addSysDataPermissionsRule (data) {
+  return request({
+    url: '/monitor/sysDataPermissionsRule',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改数据权限规则维护子表
+export function updateSysDataPermissionsRule (data) {
+  return request({
+    url: '/monitor/sysDataPermissionsRule',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除数据权限规则维护子表
+export function delSysDataPermissionsRule (id) {
+  return request({
+    url: '/monitor/sysDataPermissionsRule/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出数据权限规则维护子表
+export function exportSysDataPermissionsRule (query) {
+  return request({
+    url: '/monitor/sysDataPermissionsRule/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 导出数据权限规则维护子表
+export function getDataPermissionsMethodInfo (methodId) {
+  return request({
+    url: '/monitor/sysDataPermissionsRule/getDataPermissionsMethodInfo/' + methodId,
+    method: 'get'
+  })
+}

+ 53 - 0
src/api/system/apiLog.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询接口日志列表
+export function listApiLog (query) {
+  return request({
+    url: '/system/apiLog/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询接口日志详细
+export function getApiLog (id) {
+  return request({
+    url: '/system/apiLog/' + id,
+    method: 'get'
+  })
+}
+
+// 新增接口日志
+export function addApiLog (data) {
+  return request({
+    url: '/system/apiLog',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改接口日志
+export function updateApiLog (data) {
+  return request({
+    url: '/system/apiLog',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除接口日志
+export function delApiLog (id) {
+  return request({
+    url: '/system/apiLog/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出接口日志
+export function exportApiLog (query) {
+  return request({
+    url: '/system/apiLog/export',
+    method: 'get',
+    params: query
+  })
+}

+ 68 - 0
src/api/system/cargoDetail.js

@@ -0,0 +1,68 @@
+import request from '@/utils/request'
+
+// 查询货品清单列表
+export function listCargoDetail (query) {
+  return request({
+    url: '/system/cargoDetail/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询货品清单详细
+export function getCargoDetail (id) {
+  return request({
+    url: '/system/cargoDetail/' + id,
+    method: 'get'
+  })
+}
+
+// 新增货品清单
+export function addCargoDetail (data) {
+  return request({
+    url: '/system/cargoDetail',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改货品清单
+export function updateCargoDetail (data) {
+  return request({
+    url: '/system/cargoDetail',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除货品清单
+export function delCargoDetail (id) {
+  return request({
+    url: '/system/cargoDetail/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出货品清单
+export function exportCargoDetail (query) {
+  return request({
+    url: '/system/cargoDetail/export',
+    method: 'get',
+    params: query
+  })
+}
+
+export function apply (data) {
+  return request({
+    url: '/system/cargoDetail/apply',
+    method: 'post',
+    data
+  })
+}
+
+export function importTemplate () {
+  return request({
+    url: '/system/cargoDetail/importTemplate',
+    method: 'get'
+  })
+}

+ 69 - 0
src/api/system/config.js

@@ -0,0 +1,69 @@
+import request from '@/utils/request'
+
+// 查询参数列表
+export function listConfig (query) {
+  return request({
+    url: '/system/config/page',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询参数详细
+export function getConfig (configId) {
+  return request({
+    url: '/system/config/' + configId,
+    method: 'get'
+  })
+}
+
+// 根据参数键名查询参数值
+export function getConfigKey (configKey) {
+  return request({
+    url: '/system/config/configKey/' + configKey,
+    method: 'get'
+  })
+}
+
+// 新增参数配置
+export function saveConfig (data) {
+  return request({
+    url: '/system/config',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除参数配置
+export function delConfig (configId) {
+  return request({
+    url: '/system/config/' + configId,
+    method: 'delete'
+  })
+}
+
+// 清理参数缓存
+export function clearCache () {
+  return request({
+    url: '/system/config/clearCache',
+    method: 'delete'
+  })
+}
+
+// 导出参数
+export function exportConfig (query) {
+  return request({
+    url: '/system/config/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 参数列表唯一校验
+export function checkConfigKeyUnique (data) {
+  return request({
+    url: 'system/config/checkConfigKeyUnique',
+    method: 'get',
+    params: data
+  })
+}

+ 145 - 0
src/api/system/dept.js

@@ -0,0 +1,145 @@
+import request from '@/utils/request'
+
+// 查询部门列表
+export function listDept (query, deptId, expandLevel) {
+  if (deptId == null || deptId === '') {
+    deptId = '0'
+  }
+  if (expandLevel == null || expandLevel === '') {
+    expandLevel = '1'
+  }
+  return request({
+    url: '/system/dept/list/' + expandLevel + '/' + deptId,
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询部门树列表(排除节点)
+export function listDeptExcludeChild (deptId) {
+  return request({
+    url: '/system/dept/listTreeExcludeChild/10/0/' + deptId,
+    method: 'get'
+  })
+}
+
+// 查询部门树列表(排除当前节点及子节点)
+export function listDeptTree (deptId, expandLevel) {
+	if (deptId == null || deptId === '') {
+		deptId = '0'
+	}
+  if (expandLevel == null || expandLevel === '') {
+    expandLevel = '1'
+  }
+  return request({
+    url: '/system/dept/listTree/' + expandLevel + '/' + deptId,
+    method: 'get'
+  })
+}
+
+// 查询部门详细
+export function getDept (deptId) {
+  return request({
+    url: '/system/dept/' + deptId,
+    method: 'get'
+  })
+}
+
+// 根据角色ID查询部门树结构
+export function roleDeptTreeselect (roleId) {
+  return request({
+    url: '/system/dept/roleDeptTreeselect/' + roleId,
+    method: 'get'
+  })
+}
+
+// 新增部门
+export function addDept (data) {
+  return request({
+    url: '/system/dept',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改部门
+export function updateDept (data) {
+  return request({
+    url: '/system/dept',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除部门
+export function delDept (deptId) {
+  return request({
+    url: '/system/dept/' + deptId,
+    method: 'delete'
+  })
+}
+
+// 查询部门下拉树结构
+export function findMaxSort (parentId) {
+  return request({
+    url: '/system/dept/findMaxSort/' + parentId,
+    method: 'get'
+  })
+}
+
+// 校验部门名称是否存在
+export function validateDeptNameUnique (deptName, parentId, id) {
+  if (id === undefined) {
+    id = ''
+  }
+  return request({
+    url: '/system/dept/validateDeptNameUnique/' + deptName + '/' + parentId + '/' + id,
+    method: 'get'
+  })
+}
+// 部门树检索
+export function searchDept (searchInfo) {
+  return request({
+    url: '/system/dept/search',
+    method: 'get',
+    params: searchInfo
+  })
+}
+// 部门树检索
+export function searchDeptList (searchInfo) {
+  return request({
+    url: '/system/dept/searchDeptList',
+    method: 'get',
+    params: searchInfo
+  })
+}
+// 按部门分组人员树
+export function userSelectTree (deptId, expandLevel) {
+	if (deptId == null || deptId === '') {
+		deptId = '0'
+	}
+  if (expandLevel == null || expandLevel === '') {
+    expandLevel = '1'
+  }
+  return request({
+    url: '/system/dept/userSelectList/' + expandLevel + '/' + deptId,
+    method: 'get'
+  })
+}
+// 按部门树检索用户
+export function searchDeptUserList (searchInfo) {
+  return request({
+    url: '/system/dept/searchDeptUserList',
+    method: 'get',
+    params: searchInfo
+  })
+}
+
+// 查询部门详细
+export function getDeptInfoByIds (userIds) {
+  return request({
+    url: '/system/dept/getDeptInfoByIds',
+    method: 'post',
+    data: userIds
+  })
+}

+ 77 - 0
src/api/system/dict/data.js

@@ -0,0 +1,77 @@
+import request from '@/utils/request'
+
+// 查询字典数据列表
+export function listData (query) {
+  return request({
+    url: '/system/dict/data/page',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询字典数据详细
+export function getData (dictCode) {
+  return request({
+    url: '/system/dict/data/' + dictCode,
+    method: 'get'
+  })
+}
+
+// 根据字典类型查询字典数据信息
+export function getDicts (dictType) {
+  return request({
+    url: '/system/dict/data/type/' + dictType,
+    method: 'get'
+  })
+}
+
+// 根据字典类型查询字典数据信息
+export function getAllDicts (dictType) {
+  return request({
+    url: '/system/dict/data/all/type/' + dictType,
+    method: 'get'
+  })
+}
+
+// 新增字典数据
+export function saveData (data) {
+  return request({
+    url: '/system/dict/data',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除字典数据
+export function delData (dictCode) {
+  return request({
+    url: '/system/dict/data/' + dictCode,
+    method: 'delete'
+  })
+}
+
+// 导出字典数据
+export function exportData (query) {
+  return request({
+    url: '/system/dict/data/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询字典类型列表
+export function checkDictDataValueUnique (data) {
+  return request({
+    url: 'system/dict/data/checkDictDataValueUnique',
+    method: 'get',
+    params: data
+  })
+}
+
+// 查询最大排序
+export function findMaxSort (dictType) {
+  return request({
+    url: '/system/dict/data/findMaxSort/' + dictType,
+    method: 'get'
+  })
+}

+ 69 - 0
src/api/system/dict/type.js

@@ -0,0 +1,69 @@
+import request from '@/utils/request'
+
+// 查询字典类型列表
+export function listType (query) {
+  return request({
+    url: '/system/dict/type/page',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询字典类型详细
+export function getType (dictId) {
+  return request({
+    url: '/system/dict/type/' + dictId,
+    method: 'get'
+  })
+}
+
+// 新增字典类型
+export function saveType (data) {
+  return request({
+    url: '/system/dict/type',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除字典类型
+export function delType (dictId) {
+  return request({
+    url: '/system/dict/type/' + dictId,
+    method: 'delete'
+  })
+}
+
+// 清理参数缓存
+export function clearCache () {
+  return request({
+    url: '/system/dict/type/clearCache',
+    method: 'delete'
+  })
+}
+
+// 导出字典类型
+export function exportType (query) {
+  return request({
+    url: '/system/dict/type/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 获取字典选择框列表
+export function optionselect () {
+  return request({
+    url: '/system/dict/type/optionselect',
+    method: 'get'
+  })
+}
+
+// 查询字典类型列表
+export function checkDictTypeUnique (data) {
+  return request({
+    url: 'system/dict/type/checkDictTypeUnique',
+    method: 'get',
+    params: data
+  })
+}

+ 112 - 0
src/api/system/menu.js

@@ -0,0 +1,112 @@
+import request from '@/utils/request'
+
+// 查询菜单列表
+export function listMenu (query, menuId, expandLevel) {
+  if (menuId == null || menuId === '') {
+    menuId = '0'
+  }
+  if (expandLevel == null || expandLevel === '') {
+    expandLevel = '2'
+  }
+  return request({
+    url: '/system/menu/list/' + expandLevel + '/' + menuId,
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询菜单详细
+export function getMenu (menuId) {
+  return request({
+    url: '/system/menu/' + menuId,
+    method: 'get'
+  })
+}
+
+// 查询菜单下拉树结构
+export function treeselect (menuId, expandLevel) {
+  if (menuId == null || menuId === '') {
+    menuId = '0'
+  }
+  if (expandLevel == null || expandLevel === '') {
+    expandLevel = '2'
+  }
+  return request({
+    url: '/system/menu/treeselect/' + expandLevel + '/' + menuId,
+    method: 'get'
+  })
+}
+
+// 查询菜单下拉树结构
+export function menuTreeExcludeButton (menuId, expandLevel) {
+  if (menuId == null || menuId === '') {
+    menuId = '0'
+  }
+  if (expandLevel == null || expandLevel === '') {
+    expandLevel = '2'
+  }
+  return request({
+    url: '/system/menu/menuTreeExcludeButton/' + expandLevel + '/' + menuId,
+    method: 'get'
+  })
+}
+
+// 根据角色ID查询菜单下拉树结构
+export function roleMenuTreeselect (roleId) {
+  return request({
+    url: '/system/menu/roleMenuTreeselect/' + roleId,
+    method: 'get'
+  })
+}
+
+// 新增菜单
+export function saveMenu (data) {
+  return request({
+    url: '/system/menu',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除菜单
+export function delMenu (menuId) {
+  return request({
+    url: '/system/menu/' + menuId,
+    method: 'delete'
+  })
+}
+
+// 菜单树检索
+export function searchMenuList (searchInfo) {
+  return request({
+    url: '/system/menu/searchMenuList',
+    method: 'get',
+    params: searchInfo
+  })
+}
+
+// 菜单名称唯一校验
+export function checkMenuNameUnique (data) {
+  return request({
+    url: 'system/menu/checkMenuNameUnique',
+    method: 'get',
+    params: data
+  })
+}
+
+// 路由地址唯一校验
+export function checkMenuCodeUnique (data) {
+  return request({
+    url: 'system/menu/checkMenuCodeUnique',
+    method: 'get',
+    params: data
+  })
+}
+
+// 查询菜单同层最大排序
+export function findMaxSort (parentId) {
+  return request({
+    url: '/system/menu/findMaxSort/' + parentId,
+    method: 'get'
+  })
+}

+ 57 - 0
src/api/system/notice.js

@@ -0,0 +1,57 @@
+import request from '@/utils/request'
+
+// 查询公告列表
+export function listNotice (query) {
+  return request({
+    url: '/system/notice/page',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询公告详细
+export function getNotice (noticeId) {
+  return request({
+    url: '/system/notice/' + noticeId,
+    method: 'get'
+  })
+}
+
+// 新增公告
+export function saveNotice (data) {
+  return request({
+    url: '/system/notice',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除公告
+export function delNotice (noticeId) {
+  return request({
+    url: '/system/notice/' + noticeId,
+    method: 'delete'
+  })
+}
+// 查看页面查询公告详细
+export function getNoticeView (noticeId) {
+  return request({
+    url: '/system/notice/getNoticeView/' + noticeId,
+    method: 'get'
+  })
+}
+// 查询个人公告阅读列表
+export function listNoticeByUser (query) {
+  return request({
+    url: '/system/notice/listNoticeByUser/page',
+    method: 'get',
+    params: query
+  })
+}
+// 新增公告
+export function updateNoticeToRead (noticeIds) {
+  return request({
+    url: '/system/notice/updateNoticeToRead/' + noticeIds,
+    method: 'put'
+  })
+}

+ 53 - 0
src/api/system/optimizationSuggestionRule.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询优化建议规则设置列表
+export function listOptimizationSuggestionRule (query) {
+  return request({
+    url: '/system/optimizationSuggestionRule/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询优化建议规则设置详细
+export function getOptimizationSuggestionRule () {
+  return request({
+    url: '/system/optimizationSuggestionRule',
+    method: 'get'
+  })
+}
+
+// 新增优化建议规则设置
+export function addOptimizationSuggestionRule (data) {
+  return request({
+    url: '/system/optimizationSuggestionRule',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改优化建议规则设置
+export function updateOptimizationSuggestionRule (data) {
+  return request({
+    url: '/system/optimizationSuggestionRule',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除优化建议规则设置
+export function delOptimizationSuggestionRule (id) {
+  return request({
+    url: '/system/optimizationSuggestionRule/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出优化建议规则设置
+export function exportOptimizationSuggestionRule (query) {
+  return request({
+    url: '/system/optimizationSuggestionRule/export',
+    method: 'get',
+    params: query
+  })
+}

+ 70 - 0
src/api/system/post.js

@@ -0,0 +1,70 @@
+import request from '@/utils/request'
+
+// 查询岗位列表
+export function listPost (query) {
+  return request({
+    url: '/system/post/page',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询岗位详细
+export function getPost (id) {
+  return request({
+    url: '/system/post/' + id,
+    method: 'get'
+  })
+}
+
+// 新增岗位
+export function savePost (data) {
+  return request({
+    url: '/system/post',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除岗位
+export function delPost (id) {
+  return request({
+    url: '/system/post/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出岗位
+export function exportPost (query) {
+  return request({
+    url: '/system/post/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 岗位编码唯一校验
+export function checkPostCodeUnique (data) {
+  return request({
+    url: 'system/post/checkPostCodeUnique',
+    method: 'get',
+    params: data
+  })
+}
+
+// 岗位名称唯一校验
+export function checkPostNameUnique (data) {
+  return request({
+    url: 'system/post/checkPostNameUnique',
+    method: 'get',
+    params: data
+  })
+}
+
+// 查询岗位最大排序
+export function findMaxSort () {
+  return request({
+    url: '/system/post/findMaxSort',
+    method: 'get'
+  })
+}

+ 61 - 0
src/api/system/riskGoodsNameKeySuggest.js

@@ -0,0 +1,61 @@
+import request from '@/utils/request'
+
+// 查询优化建议信息列表
+export function listRiskGoodsNameKeySuggest (query) {
+  return request({
+    url: '/system/riskGoodsNameKeySuggest/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询优化建议信息详细
+export function getRiskGoodsNameKeySuggest (id) {
+  return request({
+    url: '/system/riskGoodsNameKeySuggest/' + id,
+    method: 'get'
+  })
+}
+
+// 新增优化建议信息
+export function addRiskGoodsNameKeySuggest (data) {
+  return request({
+    url: '/system/riskGoodsNameKeySuggest',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改优化建议信息
+export function updateRiskGoodsNameKeySuggest (data) {
+  return request({
+    url: '/system/riskGoodsNameKeySuggest',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除优化建议信息
+export function delRiskGoodsNameKeySuggest (id) {
+  return request({
+    url: '/system/riskGoodsNameKeySuggest/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出优化建议信息
+export function exportRiskGoodsNameKeySuggest (query) {
+  return request({
+    url: '/system/riskGoodsNameKeySuggest/export',
+    method: 'get',
+    params: query
+  })
+}
+
+export function apply (data) {
+  return request({
+    url: '/system/riskGoodsNameKeySuggest/apply',
+    method: 'post',
+    data
+  })
+}

+ 124 - 0
src/api/system/role.js

@@ -0,0 +1,124 @@
+import request from '@/utils/request'
+
+// 查询角色列表
+export function listRole (query) {
+  return request({
+    url: '/system/role/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询角色详细
+export function getRole (roleId) {
+  return request({
+    url: '/system/role/' + roleId,
+    method: 'get'
+  })
+}
+
+// 新增角色
+export function addRole (data) {
+  return request({
+    url: '/system/role',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改角色
+export function updateRole (data) {
+  return request({
+    url: '/system/role',
+    method: 'put',
+    data: data
+  })
+}
+
+// 角色数据权限
+export function dataScope (data) {
+  return request({
+    url: '/system/role/dataScope',
+    method: 'put',
+    data: data
+  })
+}
+
+// 角色状态修改
+export function changeRoleStatus (id, status) {
+  const data = {
+    id,
+    status
+  }
+  return request({
+    url: '/system/role/changeStatus',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除角色
+export function delRole (roleId) {
+  return request({
+    url: '/system/role/' + roleId,
+    method: 'delete'
+  })
+}
+
+// 导出角色
+export function exportRole (query) {
+  return request({
+    url: '/system/role/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 校验角色名称唯一性
+export function checkRoleNameUnique (data) {
+  return request({
+    url: '/system/role/checkRoleNameUnique',
+    method: 'get',
+    params: data
+  })
+}
+
+// 校验角色名称唯一性
+export function checkRoleKeyUnique (data) {
+  return request({
+    url: '/system/role/checkRoleKeyUnique',
+    method: 'get',
+    params: data
+  })
+}
+
+// 查询最大排序
+export function findMaxSort () {
+  return request({
+    url: '/system/role/findMaxSort',
+    method: 'get'
+  })
+}
+// 新增角色
+export function batchSaveRole (data) {
+  return request({
+    url: '/system/role/batchSave',
+    method: 'post',
+    data: data
+  })
+}
+// 删除角色
+export function delRoleUser (roleId, userIds) {
+  return request({
+    url: '/system/role/deleteRoleUser/' + roleId + '/' + userIds,
+    method: 'delete'
+  })
+}
+// 给小页授权
+export function saveRolePortlet (data) {
+  return request({
+    url: '/system/role/saveRolePortlet',
+    method: 'post',
+    data: data
+  })
+}

+ 53 - 0
src/api/system/runLog.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询运单接收日志列表
+export function listRunLog (query) {
+  return request({
+    url: '/system/runLog/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询运单接收日志详细
+export function getRunLog (id) {
+  return request({
+    url: '/system/runLog/' + id,
+    method: 'get'
+  })
+}
+
+// 新增运单接收日志
+export function addRunLog (data) {
+  return request({
+    url: '/system/runLog',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改运单接收日志
+export function updateRunLog (data) {
+  return request({
+    url: '/system/runLog',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除运单接收日志
+export function delRunLog (id) {
+  return request({
+    url: '/system/runLog/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出运单接收日志
+export function exportRunLog (query) {
+  return request({
+    url: '/system/runLog/export',
+    method: 'get',
+    params: query
+  })
+}

+ 61 - 0
src/api/system/specialCode.js

@@ -0,0 +1,61 @@
+import request from '@/utils/request'
+
+// 查询特货代码列表
+export function listSpecialCode (query) {
+  return request({
+    url: '/system/specialCode/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询特货代码列表
+export function listAll () {
+  return request({
+    url: '/system/specialCode/all',
+    method: 'get'
+  })
+}
+
+// 查询特货代码详细
+export function getSpecialCode (id) {
+  return request({
+    url: '/system/specialCode/' + id,
+    method: 'get'
+  })
+}
+
+// 新增特货代码
+export function addSpecialCode (data) {
+  return request({
+    url: '/system/specialCode',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改特货代码
+export function updateSpecialCode (data) {
+  return request({
+    url: '/system/specialCode',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除特货代码
+export function delSpecialCode (id) {
+  return request({
+    url: '/system/specialCode/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出特货代码
+export function exportSpecialCode (query) {
+  return request({
+    url: '/system/specialCode/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/system/syncEmergencyFlight.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询重点航班信息列表
+export function listSyncEmergencyFlight (query) {
+  return request({
+    url: '/system/syncEmergencyFlight/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询重点航班信息详细
+export function getSyncEmergencyFlight (id) {
+  return request({
+    url: '/system/syncEmergencyFlight/' + id,
+    method: 'get'
+  })
+}
+
+// 新增重点航班信息
+export function addSyncEmergencyFlight (data) {
+  return request({
+    url: '/system/syncEmergencyFlight',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改重点航班信息
+export function updateSyncEmergencyFlight (data) {
+  return request({
+    url: '/system/syncEmergencyFlight',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除重点航班信息
+export function delSyncEmergencyFlight (id) {
+  return request({
+    url: '/system/syncEmergencyFlight/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出重点航班信息
+export function exportSyncEmergencyFlight (query) {
+  return request({
+    url: '/system/syncEmergencyFlight/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/system/sysNoticeUserRead.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询通知公告用户阅读列表
+export function listSysNoticeUserRead (query) {
+  return request({
+    url: '/system/sysNoticeUserRead/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询通知公告用户阅读详细
+export function getSysNoticeUserRead (id) {
+  return request({
+    url: '/system/sysNoticeUserRead/' + id,
+    method: 'get'
+  })
+}
+
+// 新增通知公告用户阅读
+export function addSysNoticeUserRead (data) {
+  return request({
+    url: '/system/sysNoticeUserRead',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改通知公告用户阅读
+export function updateSysNoticeUserRead (data) {
+  return request({
+    url: '/system/sysNoticeUserRead',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除通知公告用户阅读
+export function delSysNoticeUserRead (id) {
+  return request({
+    url: '/system/sysNoticeUserRead/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出通知公告用户阅读
+export function exportSysNoticeUserRead (query) {
+  return request({
+    url: '/system/sysNoticeUserRead/export',
+    method: 'get',
+    params: query
+  })
+}

+ 93 - 0
src/api/system/sysPortalConfig.js

@@ -0,0 +1,93 @@
+import request from '@/utils/request'
+
+// 查询多栏目门户配置列表
+export function listSysPortalConfig (query) {
+  return request({
+    url: '/system/sysPortalConfig/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询多栏目门户配置详细
+export function getSysPortalConfig (id) {
+  return request({
+    url: '/system/sysPortalConfig/' + id,
+    method: 'get'
+  })
+}
+
+// 新增多栏目门户配置
+export function addSysPortalConfig (data) {
+  return request({
+    url: '/system/sysPortalConfig',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改多栏目门户配置
+export function updateSysPortalConfig (data) {
+  return request({
+    url: '/system/sysPortalConfig',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除多栏目门户配置
+export function delSysPortalConfig (id) {
+  return request({
+    url: '/system/sysPortalConfig/' + id,
+    method: 'delete'
+  })
+}
+
+// 查询最大编号
+export function findMaxSort () {
+  return request({
+    url: '/system/sysPortalConfig/findMaxSort',
+    method: 'get'
+  })
+}
+// 校验小页编码是否存在
+export function checkCodeUnique (id, code) {
+  if (id === undefined) {
+    id = ''
+  }
+  return request({
+    url: '/system/sysPortalConfig/checkCodeUnique/' + code + '/' + id,
+    method: 'get'
+  })
+}
+
+// 导出多栏目门户配置
+export function exportSysPortalConfig (query) {
+  return request({
+    url: '/system/sysPortalConfig/export',
+    method: 'get',
+    params: query
+  })
+}
+// 查询多栏目门户配置详细
+export function getConfigAndPortalList (id) {
+  return request({
+    url: '/system/sysPortalConfig/getConfigAndPortalList/' + id,
+    method: 'get'
+  })
+}
+// 修改多栏目门户配置
+export function updateDefaultPortalConfig (data) {
+  return request({
+    url: '/system/sysPortalConfig/updateDefaultPortalConfig',
+    method: 'put',
+    data: data
+  })
+}
+// 查询模板列表
+export function getPortalTemplateList () {
+  return request({
+    url: '/system/sysPortalConfig/getPortalTemplateList',
+    method: 'get'
+  })
+}

+ 79 - 0
src/api/system/sysPortlet.js

@@ -0,0 +1,79 @@
+import request from '@/utils/request'
+
+// 查询工作台小页管理列表
+export function listSysPortlet (query) {
+  return request({
+    url: '/system/sysPortlet/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询工作台小页管理详细
+export function getSysPortlet (id) {
+  return request({
+    url: '/system/sysPortlet/' + id,
+    method: 'get'
+  })
+}
+
+// 新增工作台小页管理
+export function addSysPortlet (data) {
+  return request({
+    url: '/system/sysPortlet',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改工作台小页管理
+export function updateSysPortlet (data) {
+  return request({
+    url: '/system/sysPortlet',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除工作台小页管理
+export function delSysPortlet (id) {
+  return request({
+    url: '/system/sysPortlet/' + id,
+    method: 'delete'
+  })
+}
+
+// 查询最大编号
+export function findMaxSort () {
+  return request({
+    url: '/system/sysPortlet/findMaxSort',
+    method: 'get'
+  })
+}
+// 校验小页编码是否存在
+export function checkCodeUnique (id, code) {
+  if (id === undefined) {
+    id = ''
+  }
+  return request({
+    url: '/system/sysPortlet/checkCodeUnique/' + code + '/' + id,
+    method: 'get'
+  })
+}
+
+// 导出工作台小页管理
+export function exportSysPortlet (query) {
+  return request({
+    url: '/system/sysPortlet/export',
+    method: 'get',
+    params: query
+  })
+}
+// 查询工作台小页管理列表
+export function listSysPortletByRoleId (query) {
+  return request({
+    url: '/system/sysPortlet/getSysPortletByRoleId',
+    method: 'get',
+    params: query
+  })
+}

+ 27 - 0
src/api/system/sysTableConfig.js

@@ -0,0 +1,27 @@
+import request from '@/utils/request'
+
+// 查询个性化配置详细
+export function getSysTableConfig (tableKey) {
+  return request({
+    url: '/system/sysTableConfig/getInfoByTableKey/' + tableKey,
+    method: 'get'
+  })
+}
+
+// 新增个性化配置
+export function addSysTableConfig (data) {
+  return request({
+    url: '/system/sysTableConfig',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改个性化配置
+export function updateSysTableConfig (data) {
+  return request({
+    url: '/system/sysTableConfig',
+    method: 'put',
+    data: data
+  })
+}

+ 60 - 0
src/api/system/sysThemeConfig.js

@@ -0,0 +1,60 @@
+import request from '@/utils/request'
+
+// 查询用户主题信息记录列表
+export function listSysThemeConfig (query) {
+  return request({
+    url: '/sysThemeConfig/sysThemeConfig/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询用户主题信息记录详细
+export function getSysThemeConfig (id) {
+  return request({
+    url: '/sysThemeConfig/sysThemeConfig/' + id,
+    method: 'get'
+  })
+}
+
+// 新增用户主题信息记录
+export function addSysThemeConfig (data) {
+  return request({
+    url: '/sysThemeConfig/sysThemeConfig',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改用户主题信息记录
+export function updateSysThemeConfig (data) {
+  return request({
+    url: '/sysThemeConfig/sysThemeConfig',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除用户主题信息记录
+export function delSysThemeConfig (id) {
+  return request({
+    url: '/sysThemeConfig/sysThemeConfig/' + id,
+    method: 'delete'
+  })
+}
+
+// 查询最大编号
+export function findMaxSort () {
+  return request({
+    url: '/sysThemeConfig/sysThemeConfig/findMaxSort',
+    method: 'get'
+  })
+}
+// 导出用户主题信息记录
+export function exportSysThemeConfig (query) {
+  return request({
+    url: '/sysThemeConfig/sysThemeConfig/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/system/tCasebaseAwb.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询运单安检基础信息列表
+export function listTCasebaseAwb (query) {
+  return request({
+    url: '/system/tCasebaseAwb/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询运单安检基础信息详细
+export function getTCasebaseAwb (id) {
+  return request({
+    url: '/system/tCasebaseAwb/' + id,
+    method: 'get'
+  })
+}
+
+// 新增运单安检基础信息
+export function addTCasebaseAwb (data) {
+  return request({
+    url: '/system/tCasebaseAwb',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改运单安检基础信息
+export function updateTCasebaseAwb (data) {
+  return request({
+    url: '/system/tCasebaseAwb',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除运单安检基础信息
+export function delTCasebaseAwb (id) {
+  return request({
+    url: '/system/tCasebaseAwb/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出运单安检基础信息
+export function exportTCasebaseAwb (query) {
+  return request({
+    url: '/system/tCasebaseAwb/export',
+    method: 'get',
+    params: query
+  })
+}

+ 17 - 0
src/api/system/upload.js

@@ -0,0 +1,17 @@
+import request from '@/utils/request'
+// 上传附件
+export function baseUpload (data) {
+  return request({
+    url: '/common/attach/baseupload/v1',
+    method: 'post',
+    data: data
+  })
+}
+// 仅上传附件到磁盘不保存数据库
+export function uploadDisk (data) {
+  return request({
+    url: '/common/attach/uploadDisk/v1',
+    method: 'post',
+    data: data
+  })
+}

+ 174 - 0
src/api/system/user.js

@@ -0,0 +1,174 @@
+import request from '@/utils/request'
+import { praseStrEmpty } from '@/utils/aidex'
+
+// 查询用户列表
+export function listUser (query) {
+  return request({
+    url: '/system/user/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询用户详细
+export function getUser (userId) {
+  return request({
+    url: '/system/user/' + praseStrEmpty(userId),
+    method: 'get'
+  })
+}
+
+// 新增用户
+export function addUser (data) {
+  return request({
+    url: '/system/user',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改用户
+export function updateUser (data) {
+  return request({
+    url: '/system/user',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除用户
+export function delUser (userId) {
+  return request({
+    url: '/system/user/' + userId,
+    method: 'delete'
+  })
+}
+
+// 导出用户
+export function exportUser (query) {
+  return request({
+    url: '/system/user/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 用户密码重置
+export function resetUserPwd (id, password) {
+  const data = {
+    id,
+    password
+  }
+  return request({
+    url: '/system/user/resetPwd',
+    method: 'put',
+    data: data
+  })
+}
+
+// 用户状态修改
+export function changeUserStatus (id, status) {
+  const data = {
+    id,
+    status
+  }
+  return request({
+    url: '/system/user/changeStatus',
+    method: 'put',
+    data: data
+  })
+}
+
+// 查询用户个人信息
+export function getUserProfile () {
+  return request({
+    url: '/system/user/profile',
+    method: 'get'
+  })
+}
+
+// 修改用户个人信息
+export function updateUserProfile (data) {
+  return request({
+    url: '/system/user/profile',
+    method: 'put',
+    data: data
+  })
+}
+
+// 用户密码重置
+export function updateUserPwd (oldPassword, newPassword) {
+  const data = {
+    oldPassword,
+    newPassword
+  }
+  return request({
+    url: '/system/user/profile/updatePwd',
+    method: 'put',
+    params: data
+  })
+}
+
+// 用户头像上传
+export function uploadAvatar (data) {
+  return request({
+    url: '/system/user/profile/avatar',
+    method: 'post',
+    data: data
+  })
+}
+
+// 下载用户导入模板
+export function importTemplate () {
+  return request({
+    url: '/system/user/importTemplate',
+    method: 'get'
+  })
+}
+
+// 校验用户名称唯一性
+export function checkUserNameUnique (data) {
+  return request({
+    url: '/system/user/checkUserNameUnique',
+    method: 'get',
+    params: data
+  })
+}
+export function checkEmailUnique (data) {
+  return request({
+    url: '/system/user/checkEmailUnique',
+    method: 'get',
+    params: data
+  })
+}
+export function checkPhoneUnique (data) {
+  return request({
+    url: '/system/user/checkPhoneUnique',
+    method: 'get',
+    params: data
+  })
+}
+// 查询用户详细
+export function getUserInfoByIds (userIds) {
+  return request({
+    url: '/system/user/getUserInfoByIds',
+    method: 'post',
+    data: userIds
+  })
+}
+// 查询角色下用户列表
+export function getRoleUserList (query) {
+  return request({
+    url: '/system/user/roleUserList',
+    method: 'get',
+    params: query
+  })
+}
+// 插入角色用户
+export function saveRoleUser (data) {
+  return request({
+    url: '/system/user/addRoleUser',
+    method: 'post',
+    data: data
+  })
+}

+ 53 - 0
src/api/system/vCsisBusinessAsd.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询申报数据列表
+export function listVCsisBusinessAsd (query) {
+  return request({
+    url: '/system/vCsisBusinessAsd/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询申报数据详细
+export function getVCsisBusinessAsd (id) {
+  return request({
+    url: '/system/vCsisBusinessAsd/' + id,
+    method: 'get'
+  })
+}
+
+// 新增申报数据
+export function addVCsisBusinessAsd (data) {
+  return request({
+    url: '/system/vCsisBusinessAsd',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改申报数据
+export function updateVCsisBusinessAsd (data) {
+  return request({
+    url: '/system/vCsisBusinessAsd',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除申报数据
+export function delVCsisBusinessAsd (id) {
+  return request({
+    url: '/system/vCsisBusinessAsd/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出申报数据
+export function exportVCsisBusinessAsd (query) {
+  return request({
+    url: '/system/vCsisBusinessAsd/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/system/vCsisBusinessRecord.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询国内过检数据列表
+export function listVCsisBusinessRecord (query) {
+  return request({
+    url: '/system/vCsisBusinessRecord/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询国内过检数据详细
+export function getVCsisBusinessRecord (id) {
+  return request({
+    url: '/system/vCsisBusinessRecord/' + id,
+    method: 'get'
+  })
+}
+
+// 新增国内过检数据
+export function addVCsisBusinessRecord (data) {
+  return request({
+    url: '/system/vCsisBusinessRecord',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改国内过检数据
+export function updateVCsisBusinessRecord (data) {
+  return request({
+    url: '/system/vCsisBusinessRecord',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除国内过检数据
+export function delVCsisBusinessRecord (id) {
+  return request({
+    url: '/system/vCsisBusinessRecord/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出国内过检数据
+export function exportVCsisBusinessRecord (query) {
+  return request({
+    url: '/system/vCsisBusinessRecord/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/system/vCsisBusinessRelease.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询国内放行数据列表
+export function listVCsisBusinessRelease (query) {
+  return request({
+    url: '/system/vCsisBusinessRelease/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询国内放行数据详细
+export function getVCsisBusinessRelease (id) {
+  return request({
+    url: '/system/vCsisBusinessRelease/' + id,
+    method: 'get'
+  })
+}
+
+// 新增国内放行数据
+export function addVCsisBusinessRelease (data) {
+  return request({
+    url: '/system/vCsisBusinessRelease',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改国内放行数据
+export function updateVCsisBusinessRelease (data) {
+  return request({
+    url: '/system/vCsisBusinessRelease',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除国内放行数据
+export function delVCsisBusinessRelease (id) {
+  return request({
+    url: '/system/vCsisBusinessRelease/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出国内放行数据
+export function exportVCsisBusinessRelease (query) {
+  return request({
+    url: '/system/vCsisBusinessRelease/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/system/vInternationalAsd.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询国际申报数据列表
+export function listVInternationalAsd (query) {
+  return request({
+    url: '/system/vInternationalAsd/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询国际申报数据详细
+export function getVInternationalAsd (id) {
+  return request({
+    url: '/system/vInternationalAsd/' + id,
+    method: 'get'
+  })
+}
+
+// 新增国际申报数据
+export function addVInternationalAsd (data) {
+  return request({
+    url: '/system/vInternationalAsd',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改国际申报数据
+export function updateVInternationalAsd (data) {
+  return request({
+    url: '/system/vInternationalAsd',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除国际申报数据
+export function delVInternationalAsd (id) {
+  return request({
+    url: '/system/vInternationalAsd/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出国际申报数据
+export function exportVInternationalAsd (query) {
+  return request({
+    url: '/system/vInternationalAsd/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/system/vInternationalRecord.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询国际过检数据列表
+export function listVInternationalRecord (query) {
+  return request({
+    url: '/system/vInternationalRecord/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询国际过检数据详细
+export function getVInternationalRecord (id) {
+  return request({
+    url: '/system/vInternationalRecord/' + id,
+    method: 'get'
+  })
+}
+
+// 新增国际过检数据
+export function addVInternationalRecord (data) {
+  return request({
+    url: '/system/vInternationalRecord',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改国际过检数据
+export function updateVInternationalRecord (data) {
+  return request({
+    url: '/system/vInternationalRecord',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除国际过检数据
+export function delVInternationalRecord (id) {
+  return request({
+    url: '/system/vInternationalRecord/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出国际过检数据
+export function exportVInternationalRecord (query) {
+  return request({
+    url: '/system/vInternationalRecord/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/system/vInternationalRelease.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询国际放行数据列表
+export function listVInternationalRelease (query) {
+  return request({
+    url: '/system/vInternationalRelease/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询国际放行数据详细
+export function getVInternationalRelease (id) {
+  return request({
+    url: '/system/vInternationalRelease/' + id,
+    method: 'get'
+  })
+}
+
+// 新增国际放行数据
+export function addVInternationalRelease (data) {
+  return request({
+    url: '/system/vInternationalRelease',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改国际放行数据
+export function updateVInternationalRelease (data) {
+  return request({
+    url: '/system/vInternationalRelease',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除国际放行数据
+export function delVInternationalRelease (id) {
+  return request({
+    url: '/system/vInternationalRelease/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出国际放行数据
+export function exportVInternationalRelease (query) {
+  return request({
+    url: '/system/vInternationalRelease/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/system/vInternationalUnpacking.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询国际开箱数据列表
+export function listVInternationalUnpacking (query) {
+  return request({
+    url: '/system/vInternationalUnpacking/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询国际开箱数据详细
+export function getVInternationalUnpacking (id) {
+  return request({
+    url: '/system/vInternationalUnpacking/' + id,
+    method: 'get'
+  })
+}
+
+// 新增国际开箱数据
+export function addVInternationalUnpacking (data) {
+  return request({
+    url: '/system/vInternationalUnpacking',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改国际开箱数据
+export function updateVInternationalUnpacking (data) {
+  return request({
+    url: '/system/vInternationalUnpacking',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除国际开箱数据
+export function delVInternationalUnpacking (id) {
+  return request({
+    url: '/system/vInternationalUnpacking/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出国际开箱数据
+export function exportVInternationalUnpacking (query) {
+  return request({
+    url: '/system/vInternationalUnpacking/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/system/waybill.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询运单管理列表
+export function listWaybill (query) {
+  return request({
+    url: '/system/waybill/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询运单管理详细
+export function getWaybill (id) {
+  return request({
+    url: '/system/waybill/' + id,
+    method: 'get'
+  })
+}
+
+// 新增运单管理
+export function addWaybill (data) {
+  return request({
+    url: '/system/waybill',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改运单管理
+export function updateWaybill (data) {
+  return request({
+    url: '/system/waybill',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除运单管理
+export function delWaybill (id) {
+  return request({
+    url: '/system/waybill/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出运单管理
+export function exportWaybill (query) {
+  return request({
+    url: '/system/waybill/export',
+    method: 'get',
+    params: query
+  })
+}

+ 101 - 0
src/api/tool/gen.js

@@ -0,0 +1,101 @@
+import request from '@/utils/request'
+
+// 查询生成表数据
+export function listTable (query) {
+  return request({
+    url: '/tool/gen/list',
+    method: 'get',
+    params: query
+  })
+}
+// 查询db数据库列表
+export function listDbTable (query) {
+  return request({
+    url: '/tool/gen/db/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询表详细信息
+export function getGenTable (tableId) {
+  return request({
+    url: '/tool/gen/' + tableId,
+    method: 'get'
+  })
+}
+
+// 修改代码生成信息并同步生成代码
+export function updateGenTableGenCode (data) {
+  return request({
+    url: '/tool/gen/genCode',
+    method: 'put',
+    data: data
+  })
+}
+
+// 修改代码生成信息
+export function updateGenTableNoValidated (data) {
+  return request({
+    url: '/tool/gen/editNoValidated',
+    method: 'post',
+    data: data
+  })
+}
+// 修改代码生成信息
+export function updateGenTable (data) {
+  return request({
+    url: '/tool/gen',
+    method: 'put',
+    data: data
+  })
+}
+
+// 导入表
+export function importTable (data) {
+  return request({
+    url: '/tool/gen/importTable',
+    method: 'post',
+    params: data
+  })
+}
+
+// 预览生成代码
+export function previewTable (tableId) {
+  return request({
+    url: '/tool/gen/preview/' + tableId,
+    method: 'get'
+  })
+}
+
+// 删除表数据
+export function delTable (tableId) {
+  return request({
+    url: '/tool/gen/' + tableId,
+    method: 'delete'
+  })
+}
+
+// 生成代码(自定义路径)
+export function genCode (tableName) {
+  return request({
+    url: '/tool/gen/genCode/' + tableName,
+    method: 'get'
+  })
+}
+
+// 同步数据库
+export function synchDb (tableName) {
+  return request({
+    url: '/tool/gen/synchDb/' + tableName,
+    method: 'get'
+  })
+}
+
+// 生成菜单
+export function addMenu (tableName) {
+  return request({
+    url: '/tool/gen/addMenu/' + tableName,
+    method: 'get'
+  })
+}

+ 98 - 0
src/api/tool/genConfigTemplate.js

@@ -0,0 +1,98 @@
+import request from '@/utils/request'
+
+// 查询模板配置列表
+export function listTemplate (query) {
+  return request({
+    url: '/system/template/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询模板配置详细
+export function getTemplate (id) {
+  return request({
+    url: '/system/template/' + id,
+    method: 'get'
+  })
+}
+
+// 新增模板配置
+export function addTemplate (data) {
+  return request({
+    url: '/system/template',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改模板配置
+export function updateTemplate (data) {
+  return request({
+    url: '/system/template',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除模板配置
+export function delTemplate (id) {
+  return request({
+    url: '/system/template/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出模板配置
+export function exportTemplate (query) {
+  return request({
+    url: '/system/template/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 状态修改
+export function changeStatus (id, status) {
+  const data = {
+    id,
+    status
+  }
+  return request({
+    url: '/system/template/changeStatus',
+    method: 'put',
+    data: data
+  })
+}
+
+// 状态修改
+export function changeTemplateDefault (id, templateDefault) {
+  const data = {
+    id,
+    templateDefault
+  }
+  return request({
+    url: '/system/template/changeTemplateDefault',
+    method: 'put',
+    data: data
+  })
+}
+
+// 查询最大编号
+export function findMaxSort () {
+  return request({
+    url: '/system/template/findMaxSort',
+    method: 'get'
+  })
+}
+
+// 校验模板名称是否存在
+export function checkTemplateUnique (id, templateName) {
+  if (id === undefined) {
+    id = ''
+  }
+  return request({
+    url: '/system/template/checkTemplateNameUnique/' + templateName + '/' + id,
+    method: 'get'
+  })
+}

+ 235 - 0
src/utils/aidex.js

@@ -0,0 +1,235 @@
+/**
+ * 通用js方法封装处理
+ * Copyright (c) 2019 aidex
+ */
+
+const baseURL = process.env.VUE_APP_BASE_API
+
+// 日期格式化
+export function parseTime (time, pattern) {
+	if (arguments.length === 0 || !time) {
+		return null
+	}
+	const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
+	let date
+	if (typeof time === 'object') {
+		date = time
+	} else {
+		if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
+			time = parseInt(time)
+		} else if (typeof time === 'string') {
+			time = time.replace(new RegExp(/-/gm), '/')
+		}
+		if ((typeof time === 'number') && (time.toString().length === 10)) {
+			time = time * 1000
+		}
+		date = new Date(time)
+	}
+	const formatObj = {
+		y: date.getFullYear(),
+		m: date.getMonth() + 1,
+		d: date.getDate(),
+		h: date.getHours(),
+		i: date.getMinutes(),
+		s: date.getSeconds(),
+		a: date.getDay()
+	}
+	const timeStr = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
+		let value = formatObj[key]
+		// Note: getDay() returns 0 on Sunday
+		if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
+		if (result.length > 0 && value < 10) {
+			value = '0' + value
+		}
+		return value || 0
+	})
+	return timeStr
+}
+
+// 表单重置
+export function resetForm (refName) {
+	if (this[refName]) {
+		this[refName].resetFields()
+	}
+}
+
+// 添加日期范围
+export function addDateRange (params, dateRange, propName) {
+	var search = params
+	search.params = {}
+	if (dateRange !== null && dateRange !== '' && dateRange.length === 2) {
+		if (typeof (propName) === 'undefined') {
+			search.params['beginTime'] = dateRange[0]
+			search.params['endTime'] = dateRange[1]
+		} else {
+			search.params[propName + 'BeginTime'] = dateRange[0]
+			search.params[propName + 'EndTime'] = dateRange[1]
+		}
+	}
+	return search
+}
+
+// 回显数据字典
+export function selectDictLabel (datas, value) {
+	var actions = []
+	Object.keys(datas).some((key) => {
+		if (datas[key].dictValue === ('' + value)) {
+			actions.push(datas[key].dictLabel)
+			return true
+		}
+	})
+	return actions.join('')
+}
+
+// 回显数据字典(字符串数组)
+export function selectDictLabels (datas, value, separator) {
+	var actions = []
+	var currentSeparator = undefined === separator ? ',' : separator
+	var temp = value.split(currentSeparator)
+	Object.keys(value.split(currentSeparator)).some((val) => {
+		Object.keys(datas).some((key) => {
+			if (datas[key].dictValue === ('' + temp[val])) {
+				actions.push(datas[key].dictLabel + currentSeparator)
+			}
+		})
+	})
+	return actions.join('').substring(0, actions.join('').length - 1)
+}
+
+// 通用下载方法
+export function download (fileName, delFlag) {
+  if (delFlag === undefined) {
+    delFlag = true
+  }
+	window.location.href = baseURL + '/common/download?fileName=' + encodeURI(fileName) + '&delete=' + delFlag
+}
+// 通用下载方法
+export function downloadByPath (filePath, delFlag) {
+  if (delFlag === undefined) {
+    delFlag = true
+  }
+	window.location.href = baseURL + '/common/downloadByPath?filePath=' + encodeURI(filePath) + '&delete=' + delFlag
+}
+// 通用下载到导出任务中心
+export function downloadTask () {
+  this.$router.push({
+    name: 'SysDownloadFiles',
+    params: {
+      key: new Date().toLocaleString()
+    }
+  })
+}
+
+// 字符串格式化(%s )
+export function sprintf (str) {
+	var args = arguments
+	var flag = true
+	var i = 1
+	str = str.replace(/%s/g, function () {
+		var arg = args[i++]
+		if (typeof arg === 'undefined') {
+			flag = false
+			return ''
+		}
+		return arg
+	})
+	return flag ? str : ''
+}
+
+// 转换字符串,undefined,null等转化为''
+export function praseStrEmpty (str) {
+	if (!str || str === 'undefined' || str === 'null') {
+		return ''
+	}
+	return str
+}
+
+/**
+ * 构造树型结构数据
+ * @param {*} data 数据源
+ * @param {*} id id字段 默认 'id'
+ * @param {*} parentId 父节点字段 默认 'parentId'
+ * @param {*} children 孩子节点字段 默认 'children'
+ * @param {*} rootId 根Id 默认 0
+ */
+export function handleTree (data, id, parentId, children, rootId) {
+	id = id || 'id'
+	parentId = parentId || 'parentId'
+	children = children || 'children'
+	rootId = rootId || '0'
+	// 对源数据深度克隆
+	const cloneData = JSON.parse(JSON.stringify(data))
+	// 循环所有项
+	const treeData = cloneData.filter(father => {
+		var branchArr = cloneData.filter(child => {
+			// 返回每一项的子级数组
+			return father[id] === child[parentId]
+		})
+
+		if (branchArr.length > 0) {
+			father.children = branchArr
+		} else {
+			father.children = ''
+		}
+		// 返回第一层
+		return father[parentId] === rootId
+	})
+	return treeData !== '' && treeData == null ? treeData : data
+}
+/**
+ * 从树中移除指定节点
+ * @param {Object} list
+ * @param {Object} node
+ */
+export function removeTreeNode (list, node) {
+  const parentList = list
+  const parentIds = node.parentIds.split('/')
+  const currentNodeId = node.id
+	deleteTreeNode(parentList, list, parentIds, currentNodeId)
+}
+export function deleteTreeNode (parentList, list, parentIds, currentNodeId) {
+          for (let s = 0; s < list.length; s++) {
+            if (list[s].id === currentNodeId) {
+              list.splice(s, 1)
+              // 当删除节点后,没有子节点时需要修改父节点为叶子节点
+              if (list.length === 0) {
+                parentList.treeLeaf = 'y'
+              }
+              return
+            } else if (list[s].children && list[s].children.length > 0) { // 递归条件
+              parentIds.splice(0, 1)
+              deleteTreeNode(list[s], list[s].children, parentIds, currentNodeId)
+            } else {
+              continue
+            }
+          }
+}
+export function appendTreeNode (node, data) {
+  if (node.treeLeaf === 'y') {
+    // 如果节点是叶子节点则直接改为非叶子节点
+    node.treeLeaf = 'n'
+    node.children.push(data)
+  } else {
+    const children = node.children
+    if (children.length > 0) {
+      // 有子节点则直接push数据,否则不做操作等待异步加载
+       node.children.push(data)
+    }
+  }
+}
+/**
+ * 按展开几层展开树
+ * @param {Object} nodes
+ * @param {Object} expandLevel
+ * @param {Object} expandedRowKeys 记录展开key
+ */
+export function expandTree (nodes, expandLevel, expandedRowKeys) {
+      if (expandLevel > 1) {
+        // 最后一层不展开
+        nodes.forEach(node => {
+          expandedRowKeys.push(node.id)
+          expandLevel = expandLevel - 1
+          return expandTree(node.children, expandLevel, expandedRowKeys)
+        })
+      }
+}

+ 35 - 0
src/utils/axios.js

@@ -0,0 +1,35 @@
+const VueAxios = {
+  vm: {},
+  // eslint-disable-next-line no-unused-vars
+  install (Vue, instance) {
+    if (this.installed) {
+      return
+    }
+    this.installed = true
+
+    if (!instance) {
+      // eslint-disable-next-line no-console
+      console.error('You have to install axios')
+      return
+    }
+
+    Vue.axios = instance
+
+    Object.defineProperties(Vue.prototype, {
+      axios: {
+        get: function get () {
+          return instance
+        }
+      },
+      $http: {
+        get: function get () {
+          return instance
+        }
+      }
+    })
+  }
+}
+
+export {
+  VueAxios
+}

+ 21 - 0
src/utils/domUtil.js

@@ -0,0 +1,21 @@
+import config from '@/config/defaultSettings'
+
+export const setDocumentTitle = function (title) {
+  document.title = title
+  const ua = navigator.userAgent
+  // eslint-disable-next-line
+  const regex = /\bMicroMessenger\/([\d\.]+)/
+  if (regex.test(ua) && /ip(hone|od|ad)/i.test(ua)) {
+    const i = document.createElement('iframe')
+    i.src = '/favicon.ico'
+    i.style.display = 'none'
+    i.onload = function () {
+      setTimeout(function () {
+        i.remove()
+      }, 9)
+    }
+    document.body.appendChild(i)
+  }
+}
+
+export const domTitle = config.title

+ 95 - 0
src/utils/drag.js

@@ -0,0 +1,95 @@
+const draggable = {
+    install (Vue) {
+      Vue.directive('drag', {
+        inserted (el, binding) {
+          if (window.Element && !Element.prototype.closest) {
+            Element.prototype.closest = function (s) {
+              const matches = (this.document || this.ownerDocument).querySelectorAll(s)
+                let i
+                let el = this
+              do {
+                i = matches.length
+              } while (i < 0 && (el = el.parentElement))
+              return el
+            }
+          }
+          let overWin = false // 拖动是否能超出屏幕,默认不能
+          if (binding.value) {
+            overWin = binding.value.over || false
+          }
+
+          const moveTitle = el.parentNode.parentNode.parentNode.querySelector('.ant-modal-header')
+
+          el.style.width = '100%'
+          el.style.height = moveTitle.offsetHeight + 'px'
+          el.style.position = 'absolute'
+          el.style.left = 0
+          el.style.top = 0
+          el.style.cursor = 'move'
+
+          const odiv = el // 获取当前元素操作区
+          const moveDom = el.closest('.ant-modal') // 位移元素,当前只对a-modal生效
+
+          odiv.onmousedown = e => {
+            const moveDomLeft = moveDom.offsetLeft // 位移元素初始横轴位置
+              const moveDomTop = moveDom.offsetTop // 位移元素初始纵轴位置
+              const moveDomW = moveDom.offsetWidth // 位移元素初始宽
+              const moveDomH = moveDom.offsetHeight // 位移元素初始高
+              const winWidth = document.body.clientWidth // 父容器初始宽
+              const winHeight = document.body.clientHeight // 父容器初始高
+
+            // 设置位移元素可移动
+            moveDom.style.position = 'absolute'
+            moveDom.style.top = moveDomTop + 'px'
+            moveDom.style.left = moveDomLeft + 'px'
+
+            // 算出鼠标相对元素的位置
+            const disX = e.clientX
+              const disY = e.clientY
+
+            document.onmousemove = e => {
+              // 用鼠标的位置减去鼠标相对元素的位置,得到元素的位置
+              const left = e.clientX - disX // X轴相对位移量
+                const top = e.clientY - disY // Y轴相对位移量
+                let toMoveTop = 0 // 纵轴最终坐标
+                let toMoveLeft = 0 // 横轴最终坐标
+
+              if (!overWin) {
+                // 不可超出屏幕时计算移动边界
+                if (moveDomTop + top + moveDomH > winHeight) {
+                  toMoveTop = winHeight - moveDomH
+                } else if (moveDomTop + top < 0) {
+                  // 解决漏洞toMoveTop默认为0这里无需重复赋值
+                 // toMoveTop = 0
+                } else {
+                  toMoveTop = moveDomTop + top
+                }
+                if (moveDomLeft + left < 0) {
+                  // 解决漏洞toMoveLeft默认为0这里无需重复赋值
+                  // toMoveLeft = 0
+                } else if (moveDomLeft + left + moveDomW > winWidth) {
+                  toMoveLeft = winWidth - moveDomW
+                } else {
+                  toMoveLeft = moveDomLeft + left
+                }
+              } else {
+                // 让弹窗飞
+                toMoveTop = moveDomTop + top
+                toMoveLeft = moveDomLeft + left
+              }
+
+              // 移动当前元素
+              moveDom.style.top = toMoveTop + 'px'
+              moveDom.style.left = toMoveLeft + 'px'
+            }
+            document.onmouseup = () => {
+              // 注销事件
+              document.onmousemove = null
+              document.onmouseup = null
+            }
+          }
+        }
+      })
+    }
+  }
+export default draggable

+ 6 - 0
src/utils/errorCode.js

@@ -0,0 +1,6 @@
+export default {
+  '401': '认证失败,无法访问系统资源',
+  '403': '当前操作没有权限',
+  '404': '访问资源不存在',
+  'default': '系统未知错误,请反馈给管理员'
+}

+ 20 - 0
src/utils/filter.js

@@ -0,0 +1,20 @@
+import Vue from 'vue'
+import moment from 'moment'
+import 'moment/locale/zh-cn'
+moment.locale('zh-cn')
+
+Vue.filter('NumberFormat', function (value) {
+  if (!value) {
+    return '0'
+  }
+  const intPartFormat = value.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断
+  return intPartFormat
+})
+
+Vue.filter('dayjs', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
+  return moment(dataStr).format(pattern)
+})
+
+Vue.filter('moment', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
+  return moment(dataStr).format(pattern)
+})

+ 29 - 0
src/utils/highlight.js

@@ -0,0 +1,29 @@
+// src/utils/highlight.js 文件路径,纯属自定义
+
+// highlight.js  代码高亮指令
+import Hljs from 'highlight.js'
+import 'highlight.js/styles/vs.css' // 代码高亮风格,选择更多风格需导入 node_modules/hightlight.js/styles/ 目录下其它css文件
+
+const Highlight = {}
+// 自定义插件
+Highlight.install = function (Vue) {
+    // 自定义指令 v-highlight
+    Vue.directive('highlight', {
+        // 被绑定元素插入父节点时调用
+        inserted: function (el) {
+            const blocks = el.querySelectorAll('pre code')
+            for (let i = 0; i < blocks.length; i++) {
+                Hljs.highlightBlock(blocks[i])
+            }
+        },
+        // 指令所在组件的 VNode 及其子 VNode 全部更新后调用
+        componentUpdated: function (el) {
+            const blocks = el.querySelectorAll('pre code')
+            for (let i = 0; i < blocks.length; i++) {
+                Hljs.highlightBlock(blocks[i])
+            }
+        }
+    })
+}
+
+export default Highlight

+ 385 - 0
src/utils/pt/layout/baseMouldStyles.js

@@ -0,0 +1,385 @@
+/**
+   * 控制表单列数布局
+   * @param layout 列布局: 1,2,3,4
+   */
+  const formColLayout = function (layout, colSetting, fixedSetting) {
+    if (layout && layout === '1') {
+      // 1列
+      return {
+        cols: colSetting && colSetting.cols ? colSetting.cols : { xs: 24, sm: 24, lg: 24, xl: 24 },
+        labelCol:
+          colSetting && colSetting.labelCol ? colSetting.labelCol : { xs: 6, sm: 6, lg: 6, xl: 6 },
+        wrapperCol:
+          colSetting && colSetting.wrapperCol
+            ? colSetting.wrapperCol
+            : { xs: 18, sm: 18, lg: 18, xl: 18 },
+        fixed: {
+          cols: { xs: 24, sm: 24, lg: 24, xl: 24 },
+          labelCol:
+            fixedSetting && fixedSetting.labelCol
+              ? fixedSetting.labelCol
+              : { xs: 6, sm: 6, lg: 6, xl: 6 },
+          wrapperCol:
+            fixedSetting && fixedSetting.wrapperCol
+              ? fixedSetting.wrapperCol
+              : { xs: 18, sm: 18, lg: 18, xl: 18 }
+        }
+      }
+    } else if (layout && layout === '2') {
+      // 2列
+      return {
+        cols: colSetting && colSetting.cols ? colSetting.cols : { xs: 12, sm: 12, lg: 12, xl: 12 },
+        labelCol:
+          colSetting && colSetting.labelCol ? colSetting.labelCol : { xs: 8, sm: 8, lg: 8, xl: 8 },
+        wrapperCol:
+          colSetting && colSetting.wrapperCol
+            ? colSetting.wrapperCol
+            : { xs: 16, sm: 16, lg: 16, xl: 16 },
+        fixed: {
+          cols: { xs: 24, sm: 24, lg: 24, xl: 24 },
+          labelCol:
+            fixedSetting && fixedSetting.labelCol
+              ? fixedSetting.labelCol
+              : { xs: 4, sm: 4, lg: 4, xl: 4 },
+          wrapperCol:
+            fixedSetting && fixedSetting.wrapperCol
+              ? fixedSetting.wrapperCol
+              : { xs: 20, sm: 20, lg: 20, xl: 20 }
+        }
+      }
+    } else if (layout && layout === '3') {
+      // 3列
+      return {
+        cols: colSetting && colSetting.cols ? colSetting.cols : { xs: 8, sm: 8, lg: 8, xl: 8 },
+        labelCol:
+          colSetting && colSetting.labelCol ? colSetting.labelCol : { xs: 9, sm: 9, lg: 9, xl: 9 },
+        wrapperCol:
+          colSetting && colSetting.wrapperCol
+            ? colSetting.wrapperCol
+            : { xs: 15, sm: 15, lg: 15, xl: 15 },
+        fixed: {
+          cols: { xs: 24, sm: 24, lg: 24, xl: 24 },
+          labelCol:
+            fixedSetting && fixedSetting.labelCol
+              ? fixedSetting.labelCol
+              : { xs: 3, sm: 3, lg: 3, xl: 3 },
+          wrapperCol:
+            fixedSetting && fixedSetting.wrapperCol
+              ? fixedSetting.wrapperCol
+              : { xs: 21, sm: 21, lg: 21, xl: 21 }
+        }
+      }
+    } else if (layout && layout === '4') {
+      // 4列
+      return {
+        cols: colSetting && colSetting.cols ? colSetting.cols : { xs: 6, sm: 6, lg: 6, xl: 6 },
+        labelCol:
+          colSetting && colSetting.labelCol ? colSetting.labelCol : { xs: 8, sm: 8, lg: 8, xl: 8 },
+        wrapperCol:
+          colSetting && colSetting.wrapperCol
+            ? colSetting.wrapperCol
+            : { xs: 16, sm: 16, lg: 16, xl: 16 },
+        fixed: {
+          cols: { xs: 24, sm: 24, lg: 24, xl: 24 },
+          labelCol:
+            fixedSetting && fixedSetting.labelCol
+              ? fixedSetting.labelCol
+              : { xs: 2, sm: 2, lg: 2, xl: 2 },
+          wrapperCol:
+            fixedSetting && fixedSetting.wrapperCol
+              ? fixedSetting.wrapperCol
+              : { xs: 22, sm: 22, lg: 22, xl: 22 }
+        }
+      }
+    } else {
+      // 默认1列
+      return {
+        cols: { xs: 24, sm: 24, lg: 24, xl: 24 },
+        labelCol: { xs: 4, sm: 4, lg: 4, xl: 4 },
+        wrapperCol: { xs: 20, sm: 20, lg: 20, xl: 20 },
+        fixed: {
+          cols: { xs: 24, sm: 24, lg: 24, xl: 24 },
+          labelCol: { xs: 4, sm: 4, lg: 4, xl: 4 },
+          wrapperCol: { xs: 20, sm: 20, lg: 20, xl: 20 }
+        }
+      }
+    }
+  }
+
+  /**
+   * 控制详情页表单列数布局
+   * @param layout 列布局: 1,2,3,4
+   */
+  const flowformColLayout = function (layout, colSetting, fixedSetting) {
+    if (layout && layout === '1') {
+      // 1列
+      return {
+        cols: colSetting && colSetting.cols ? colSetting.cols : { xs: 24, sm: 24, lg: 24, xl: 24 },
+        labelCol:
+          colSetting && colSetting.labelCol
+            ? colSetting.labelCol
+            : { xs: 22, sm: 22, lg: 22, xl: 22 },
+        wrapperCol:
+          colSetting && colSetting.wrapperCol
+            ? colSetting.wrapperCol
+            : { xs: 22, sm: 22, lg: 22, xl: 22 },
+        fixed: {
+          cols: { xs: 24, sm: 24, lg: 24, xl: 24 },
+          labelCol:
+            fixedSetting && fixedSetting.labelCol
+              ? fixedSetting.labelCol
+              : { xs: 24, sm: 24, lg: 24, xl: 24 },
+          wrapperCol:
+            fixedSetting && fixedSetting.wrapperCol
+              ? fixedSetting.wrapperCol
+              : { xs: 20, sm: 20, lg: 20, xl: 20 }
+        }
+      }
+    } else if (layout && layout === '2') {
+      // 2列
+      return {
+        cols: colSetting && colSetting.cols ? colSetting.cols : { xs: 12, sm: 12, lg: 12, xl: 12 },
+        labelCol:
+          colSetting && colSetting.labelCol ? colSetting.labelCol : { xs: 6, sm: 6, lg: 6, xl: 6 },
+        wrapperCol:
+          colSetting && colSetting.wrapperCol
+            ? colSetting.wrapperCol
+            : { xs: 18, sm: 18, lg: 18, xl: 18 },
+        fixed: {
+          cols: { xs: 24, sm: 24, lg: 24, xl: 24 },
+          labelCol:
+            fixedSetting && fixedSetting.labelCol
+              ? fixedSetting.labelCol
+              : { xs: 3, sm: 3, lg: 3, xl: 3 },
+          wrapperCol:
+            fixedSetting && fixedSetting.wrapperCol
+              ? fixedSetting.wrapperCol
+              : { xs: 21, sm: 21, lg: 21, xl: 21 }
+        }
+      }
+    } else if (layout && layout === '3') {
+      // 3列
+      return {
+        cols: colSetting && colSetting.cols ? colSetting.cols : { xs: 8, sm: 8, lg: 8, xl: 8 },
+        labelCol:
+          colSetting && colSetting.labelCol ? colSetting.labelCol : { xs: 6, sm: 6, lg: 6, xl: 6 },
+        wrapperCol:
+          colSetting && colSetting.wrapperCol
+            ? colSetting.wrapperCol
+            : { xs: 18, sm: 18, lg: 18, xl: 18 },
+        fixed: {
+          cols: { xs: 24, sm: 24, lg: 24, xl: 24 },
+          labelCol:
+            fixedSetting && fixedSetting.labelCol
+              ? fixedSetting.labelCol
+              : { xs: 2, sm: 2, lg: 2, xl: 2 },
+          wrapperCol:
+            fixedSetting && fixedSetting.wrapperCol
+              ? fixedSetting.wrapperCol
+              : { xs: 22, sm: 22, lg: 22, xl: 22 }
+        }
+      }
+    } else if (layout && layout === '4') {
+      // 4列
+      return {
+        cols: colSetting && colSetting.cols ? colSetting.cols : { xs: 6, sm: 6, lg: 6, xl: 6 },
+        labelCol:
+          colSetting && colSetting.labelCol
+            ? colSetting.labelCol
+            : { xs: 24, sm: 24, lg: 24, xl: 24 },
+        wrapperCol:
+          colSetting && colSetting.wrapperCol
+            ? colSetting.wrapperCol
+            : { xs: 24, sm: 24, lg: 24, xl: 24 },
+        fixed: {
+          cols: { xs: 24, sm: 24, lg: 24, xl: 24 },
+          labelCol:
+            fixedSetting && fixedSetting.labelCol
+              ? fixedSetting.labelCol
+              : { xs: 24, sm: 24, lg: 24, xl: 24 },
+          wrapperCol:
+            fixedSetting && fixedSetting.wrapperCol
+              ? fixedSetting.wrapperCol
+              : { xs: 24, sm: 24, lg: 24, xl: 24 }
+        }
+      }
+    } else {
+      // 默认1列
+      return {
+        cols: { xs: 24, sm: 24, lg: 24, xl: 24 },
+        labelCol: { xs: 4, sm: 4, lg: 4, xl: 4 },
+        wrapperCol: { xs: 20, sm: 20, lg: 20, xl: 20 },
+        fixed: {
+          cols: { xs: 24, sm: 24, lg: 24, xl: 24 },
+          labelCol: { xs: 4, sm: 4, lg: 4, xl: 4 },
+          wrapperCol: { xs: 20, sm: 20, lg: 20, xl: 20 }
+        }
+      }
+    }
+  }
+  /**
+   * 控制弹窗modal的宽高
+   * @param widthRatio 弹窗modal宽度占屏幕比例
+   * @param heightRatio 弹窗modal高度占屏幕比例
+   * @param cutHeight 弹窗modal的body的高度比整个弹窗modal少的高度
+   * @param bodyOverflowY 弹窗modal的body的overflow-y属性
+   */
+  const modalWidthAndHeight = function (
+    widthRatio = 0.7,
+    heightRatio = 0.7,
+    cutHeight = 40,
+    bodyOverflowY = 'auto',
+    backgroundColor = '#fff'
+  ) {
+    const modalStyleWidth = document.documentElement.clientWidth * widthRatio + 'px'
+    // let modalStyleHeight = document.documentElement.clientHeight * heightRatio + 'px';
+    const bodyStyleWidth = document.documentElement.clientWidth * widthRatio + 'px'
+    const bodyStyleHeight = document.documentElement.clientHeight * heightRatio - cutHeight + 'px'
+    return {
+      modalStyle: {
+        // 弹窗宽高控制
+        width: modalStyleWidth,
+        height: 'auto'
+      },
+      bodyStyle: {
+        // 弹窗body宽高控制
+        width: bodyStyleWidth,
+        height: bodyStyleHeight,
+        overflowY: bodyOverflowY,
+        backgroundColor
+      }
+    }
+  }
+  /**
+   * 根据布局列数控制弹窗modal的宽高
+   * (单列: 580*420  适用于1~6项内容时、
+   *   两列:960*500   适用于6~12项内容时、
+   *   三列:1280*600) 适用于12项以上
+   * @param layout 列数
+   * @param cutHeight 弹窗modal的body的高度比整个弹窗modal少的高度
+   * @param bodyOverflowY 弹窗modal的body的overflow-y属性
+   */
+  const modalWidthAndHeightBylayout = function (
+    layout = 1,
+    cutHeight = 40,
+    bodyOverflowY = 'auto',
+    backgroundColor = '#fff'
+  ) {
+    let modalStyleWidth = null
+    // let modalStyleHeight = document.documentElement.clientHeight * heightRatio + 'px';
+    let bodyStyleWidth = null
+    let bodyStyleHeight = null
+    let bodyStylePadding = null
+    if (layout === 1) {
+      modalStyleWidth = 580 + 'px'
+      bodyStyleWidth = 580 + 'px'
+      bodyStyleHeight = 420 - cutHeight + 'px'
+      bodyStylePadding = '20px 50px'
+    } else if (layout === 2) {
+      modalStyleWidth = 960 + 'px'
+      bodyStyleWidth = 960 + 'px'
+      bodyStyleHeight = 500 - cutHeight + 'px'
+      bodyStylePadding = '20px'
+    } else if (layout === 3) {
+      modalStyleWidth = 1280 + 'px'
+      bodyStyleWidth = 1280 + 'px'
+      bodyStyleHeight = 600 - cutHeight + 'px'
+      bodyStylePadding = '20px 40px'
+    }
+    return {
+      modalStyle: {
+        // 弹窗宽高控制
+        width: modalStyleWidth,
+        height: 'auto'
+      },
+      bodyStyle: {
+        // 弹窗body宽高控制
+        width: bodyStyleWidth,
+        height: bodyStyleHeight,
+        padding: bodyStylePadding,
+        overflowY: bodyOverflowY,
+        backgroundColor
+      }
+    }
+  }
+  /**
+   * 获取内容高度: 传入元素的父元素高度 - 父元素除去内容之外的元素的高度
+   * @param wrapId 元素的id
+   * @param cutHeight 内容与父元素相差的高度,一般包括:父元素padding,按钮高度及margin,及其他
+   */
+  const getContentHeight = function (params) {
+    // 默认值auto
+    let contentHeight = 'auto'
+    if (params) {
+      // 获取元素父元素
+      const el = document.querySelector('#' + params.wrapId)
+      if (el) {
+        // 获取父元素高度
+        const parentHeight = el.parentNode.offsetHeight
+        // 传入的元素高度设为父元素高度
+        // el.style.height = parentHeight + 'px'; 为加resize改变大小,注释掉这句.
+        // 内容高度为 父元素高度 减去 父元素除去内容之外的元素的高度
+        if (params.cutHeight) {
+          contentHeight = parentHeight - params.cutHeight + 'px'
+        } else {
+          contentHeight = parentHeight + 'px'
+        }
+      }
+    }
+    return contentHeight
+  }
+
+  /**
+   * 校验不通过,滚动到校验不通过元素位置,提示用户
+   */
+  const getFirstCheckErrorElement = function (err) {
+    for (const key in err) {
+      // return document.querySelector("div[for='" + key + "']") || document.querySelector("div[for='" + key + "Alias']") || document.querySelector("div[for='" + key + "Name']");
+      return document.querySelector('#' + key)
+    }
+  }
+ const appointModalWidthAndHeight = function (
+    height,
+    width,
+    cutHeight,
+    bodyOverflowY = 'auto',
+    backgroundColor = '#fff'
+  ) {
+     let modalStyleWidth
+     let bodyStyleWidth
+     let bodyStyleHeight
+    if (width === '100%' && height === '100%') {
+      // 全屏模式
+       modalStyleWidth = document.documentElement.clientWidth + 'px'
+       bodyStyleWidth = document.documentElement.clientWidth + 'px'
+       bodyStyleHeight = document.documentElement.clientHeight - cutHeight + 'px'
+    } else {
+      // 指定宽高
+       modalStyleWidth = width + 'px'
+       bodyStyleWidth = width + 'px'
+       bodyStyleHeight = height - cutHeight + 'px'
+    }
+    return {
+      modalStyle: {
+        // 弹窗宽高控制
+        width: modalStyleWidth,
+        height: 'auto'
+      },
+      bodyStyle: {
+        // 弹窗body宽高控制
+        width: bodyStyleWidth,
+        height: bodyStyleHeight,
+        overflowY: bodyOverflowY,
+        backgroundColor
+      }
+    }
+  }
+  export {
+    formColLayout,
+    flowformColLayout,
+    modalWidthAndHeight,
+    modalWidthAndHeightBylayout,
+    getContentHeight,
+    getFirstCheckErrorElement,
+    appointModalWidthAndHeight
+  }

+ 119 - 79
src/utils/request.js

@@ -1,93 +1,133 @@
 import axios from 'axios'
-import { MessageBox, Message } from 'element-ui'
 import store from '@/store'
-import { getToken } from '@/utils/auth'
-// create an axios instance
-// let baseURL
-// if (process.env.NODE_ENV === "development") {
-//   baseURL = '/dev-api'
-// }
-// else {
-//   baseURL = ''
-// }
-const service = axios.create({
-  //baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
-  baseURL: PLATFROM_CONFIG.baseURLCA,
-  // withCredentials: true, // send cookies when cross-domain requests
-  timeout: 15000 // request timeout
+import storage from 'store'
+import notification from 'ant-design-vue/es/notification'
+import { VueAxios } from './axios'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import errorCode from '@/utils/errorCode'
+
+// 创建 axios 实例
+const request = axios.create({
+  // API 请求的默认前缀
+  baseURL: process.env.VUE_APP_BASE_API,
+  // baseURL: 'https://aidex.setworld.net',
+  timeout: 20000 // 请求超时时间
 })
 
+// 异常拦截处理器
+const errorHandler = (error) => {
+  console.log('err' + error)
+    let { message } = error
+    if (message === 'Network Error') {
+      message = '后端接口连接异常'
+    } else if (message.includes('timeout')) {
+      message = '系统接口请求超时'
+    } else if (message.includes('Request failed with status code')) {
+      message = '系统接口' + message.substr(message.length - 3) + '异常'
+    }
+    notification.error({
+      message: message,
+      duration: 5 * 1000
+    })
+  //  return Promise.reject(error) //注释该行,否则接口请求失败会一直请求刷新错误数据,这里保证请求一次
+}
+
 // request interceptor
-service.interceptors.request.use(
-  config => {
-    // do something before request is sent
-    // config.headers['Content-Type'] = 'text/plain'
-    if (store.getters.token) {
-      // let each request carry token
-      // ['X-Token'] is a custom headers key
-      // please modify it according to the actual situation
-      // config.headers['X-Token'] = getToken()
-      config.headers['token'] = getToken()
+request.interceptors.request.use(config => {
+  const token = storage.get(ACCESS_TOKEN)
+  // 如果 token 存在
+  // 让每个请求携带自定义 token 请根据实际情况自行修改
+  if (token && config.url !== ('login')) {
+    config.headers['Authorization'] = 'Bearer ' + token // 让每个请求携带自定义token 请根据实际情况自行修改
+    // config.headers['accessAccess-Token'] = token
+  }
+  // get请求映射params参数
+  if (config.method === 'get' && config.params) {
+    let url = config.url + '?'
+    for (const propName of Object.keys(config.params)) {
+      const value = config.params[propName]
+      var part = encodeURIComponent(propName) + '='
+        // 修改漏洞
+       if (value != null && typeof (value) !== 'undefined') {
+        if (typeof value === 'object') {
+          for (const key of Object.keys(value)) {
+            const params = propName + '[' + key + ']'
+            var subPart = encodeURIComponent(params) + '='
+            url += subPart + encodeURIComponent(value[key]) + '&'
+          }
+        } else {
+          url += part + encodeURIComponent(value) + '&'
+        }
+      }
     }
-    return config
-  },
-  error => {
-    // do something with request error
-    console.log(error) // for debug
-    return Promise.reject(error)
+    url = url.slice(0, -1)
+    config.params = {}
+    config.url = url
   }
-)
+  return config
+}, errorHandler)
 
 // response interceptor
-service.interceptors.response.use(
-  /**
-   * If you want to get http information such as headers or status
-   * Please return  response => response
-  */
-
-  /**
-   * Determine the request status by custom code
-   * Here is just an example
-   * You can also judge the status by HTTP Status Code
-   */
-  response => {
-    const res = response.data
-
-    // if the custom code is not 20000, it is judged as an error.
-    if (res.code != '0') {
-      Message({
-        message: res.message || 'Error',
-        type: 'error',
-        duration: 5 * 1000
+request.interceptors.response.use((res) => {
+  // 请求rul
+  const requestUrl = res.config.url
+  // 未设置状态码则默认成功状态
+  const code = res.data.code || 200
+  // 获取错误信息
+  const msg = errorCode[code] || res.data.msg || errorCode['default']
+  if (code === 401) {
+    notification.open({
+      message: '系统提示',
+      description: '登录状态已过期,请重新登录',
+      btn: h => {
+        return h(
+          'a-button',
+          {
+            props: {
+              type: 'primary',
+              size: 'small'
+            },
+            on: {
+              click: () => {
+                store.dispatch('Logout').then(() => {
+                  location.href = '/index'
+                })
+              }
+            }
+          },
+          '确认'
+        )
+      },
+      duration: 0,
+      onClose: close
+    })
+  } else if (code === 500) {
+    if (requestUrl !== '/login') {
+      notification.error({
+        message: msg,
+        description: msg
       })
-
-      // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
-      if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
-        // to re-login
-        MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
-          confirmButtonText: 'Re-Login',
-          cancelButtonText: 'Cancel',
-          type: 'warning'
-        }).then(() => {
-          store.dispatch('user/resetToken').then(() => {
-            location.reload()
-          })
-        })
-      }
-      return Promise.reject(new Error(res.message || 'Error'))
-    } else {
-      return res
     }
-  },
-  error => {
-    console.log('err' + error) // for debug
-    Message({
-      message: error.message,
-      type: 'error',
-      duration: 5 * 1000
+  } else if (code !== 200) {
+    notification.error({
+      message: msg
     })
-    return Promise.reject(error)
+  } else {
+    return res.data
+  }
+  return Promise.reject(msg)
+}, errorHandler)
+
+const installer = {
+  vm: {},
+  install (Vue) {
+    Vue.use(VueAxios, request)
   }
-)
+}
+
+export default request
 
-export default service
+export {
+  installer as VueAxios,
+  request as axios
+}

+ 9 - 0
src/utils/requireIcons.js

@@ -0,0 +1,9 @@
+const req = require.context('../assets/icons', false, /\.svg$/)
+const requireAll = requireContext => requireContext.keys()
+const re = /\.\/(.*)\.svg/
+
+const icons = requireAll(req).map(i => {
+  return i.match(re)[1]
+})
+
+export default icons

+ 30 - 0
src/utils/routeConvert.js

@@ -0,0 +1,30 @@
+import cloneDeep from 'lodash.clonedeep'
+
+export function convertRoutes (nodes) {
+  if (!nodes) return null
+
+  nodes = cloneDeep(nodes)
+
+  let queue = Array.isArray(nodes) ? nodes.concat() : [nodes]
+
+  while (queue.length) {
+    const levelSize = queue.length
+
+    for (let i = 0; i < levelSize; i++) {
+      const node = queue.shift()
+
+      if (!node.children || !node.children.length) continue
+
+      node.children.forEach(child => {
+        // 转化相对路径
+        if (child.path[0] !== '/' && !child.path.startsWith('http')) {
+          child.path = node.path.replace(/(\w*)[/]*$/, `$1/${child.path}`)
+        }
+      })
+
+      queue = queue.concat(node.children)
+    }
+  }
+
+  return nodes
+}

+ 18 - 0
src/utils/screenLog.js

@@ -0,0 +1,18 @@
+/* eslint-disable */
+export const printANSI = () => {
+  // console.clear()
+  console.log('[antd pro] created()')
+  // ASCII - ANSI Shadow
+  let text = `
+ █████╗ ███╗   ██╗████████╗██████╗     ██████╗ ██████╗  ██████╗ 
+██╔══██╗████╗  ██║╚══██╔══╝██╔══██╗    ██╔══██╗██╔══██╗██╔═══██╗
+███████║██╔██╗ ██║   ██║   ██║  ██║    ██████╔╝██████╔╝██║   ██║
+██╔══██║██║╚██╗██║   ██║   ██║  ██║    ██╔═══╝ ██╔══██╗██║   ██║
+██║  ██║██║ ╚████║   ██║   ██████╔╝    ██║     ██║  ██║╚██████╔╝
+╚═╝  ╚═╝╚═╝  ╚═══╝   ╚═╝   ╚═════╝     ╚═╝     ╚═╝  ╚═╝ ╚═════╝ 
+\t\t\t\t\tPublished ${APP_VERSION}-${GIT_HASH} @ antdv.com
+\t\t\t\t\tBuild date: ${BUILD_DATE}`
+  console.log(`%c${text}`, 'color: #fc4d50')
+  console.log('%c感谢使用 antd pro!', 'color: #000; font-size: 14px;    font-family: Hiragino Sans GB,Microsoft YaHei,\\\\5FAE\\8F6F\\96C5\\9ED1,Droid Sans Fallback,Source Sans,Wenquanyi Micro Hei,WenQuanYi Micro Hei Mono,WenQuanYi Zen Hei,Apple LiGothic Medium,SimHei,ST Heiti,WenQuanYi Zen Hei Sharp,sans-serif;')
+  console.log('%cThanks for using antd pro!', 'color: #fff; font-size: 14px; font-weight: 300; text-shadow:#000 1px 0 0,#000 0 1px 0,#000 -1px 0 0,#000 0 -1px 0;')
+}

+ 128 - 0
src/utils/util.js

@@ -0,0 +1,128 @@
+export function timeFix () {
+  const time = new Date()
+  const hour = time.getHours()
+  return hour < 9 ? '早上好' : hour <= 11 ? '上午好' : hour <= 13 ? '中午好' : hour < 20 ? '下午好' : '晚上好'
+}
+
+export function welcome () {
+  const arr = ['休息一会儿吧', '准备吃什么呢?', '要不要打一把 DOTA', '我猜你可能累了']
+  const index = Math.floor(Math.random() * arr.length)
+  return arr[index]
+}
+
+/**
+ * 触发 window.resize
+ */
+export function triggerWindowResizeEvent () {
+  const event = document.createEvent('HTMLEvents')
+  event.initEvent('resize', true, true)
+  event.eventType = 'message'
+  window.dispatchEvent(event)
+}
+
+export function handleScrollHeader (callback) {
+  let timer = 0
+
+  let beforeScrollTop = window.pageYOffset
+  callback = callback || function () {}
+  window.addEventListener(
+    'scroll',
+    event => {
+      clearTimeout(timer)
+      timer = setTimeout(() => {
+        let direction = 'up'
+        const afterScrollTop = window.pageYOffset
+        const delta = afterScrollTop - beforeScrollTop
+        if (delta === 0) {
+          return false
+        }
+        direction = delta > 0 ? 'down' : 'up'
+        callback(direction)
+        beforeScrollTop = afterScrollTop
+      }, 50)
+    },
+    false
+  )
+}
+
+export function isIE () {
+  const bw = window.navigator.userAgent
+  const compare = (s) => bw.indexOf(s) >= 0
+  const ie11 = (() => 'ActiveXObject' in window)()
+  return compare('MSIE') || ie11
+}
+
+/**
+ * Remove loading animate
+ * @param id parent element id or class
+ * @param timeout
+ */
+export function removeLoadingAnimate (id = '', timeout = 1500) {
+  if (id === '') {
+    return
+  }
+  setTimeout(() => {
+    document.body.removeChild(document.getElementById(id))
+  }, timeout)
+}
+
+/**
+ * 随机生成数字
+ * @param min 最小值
+ * @param max 最大值
+ * @return int 生成后的数字
+ */
+export function randomNumber (min, max) {
+  return Math.floor(Math.random() * (max - min + 1) + min)
+}
+
+/**
+ * 随机生成字符串
+ * @param length 字符串的长度
+ * @param chats 可选字符串区间(只会生成传入的字符串中的字符)
+ * @return string 生成的字符串
+ */
+export function randomString (length, chats) {
+  if (!length) length = 1
+  if (!chats) chats = '0123456789qwertyuioplkjhgfdsazxcvbnm'
+  let str = ''
+  for (let i = 0; i < length; i++) {
+    const num = randomNumber(0, chats.length - 1)
+    str += chats[num]
+  }
+  return str
+}
+
+/**
+ * 随机生成uuid
+ * @return string 生成的uuid
+ */
+export function randomUUID () {
+  const chats = '0123456789abcdef'
+  return randomString(32, chats)
+}
+/**
+ * json对象单层,转换url参数
+ * @param {*} paramObj
+ */
+export function formateObjToParamStr (paramObj) {
+  const sdata = []
+  for (const attr in paramObj) {
+    sdata.push(`${attr} = ${filter(paramObj[attr])}`)
+  }
+  return sdata.join('&')
+}
+// 过滤特殊符号
+function filter (str) {
+  // 特殊字符转义
+  str += '' // 隐式转换
+  str = str.replace(/%/g, '%25')
+  str = str.replace(/\+/g, '%2B')
+  str = str.replace(/ /g, '%20')
+  str = str.replace(/\//g, '%2F')
+  str = str.replace(/\?/g, '%3F')
+  str = str.replace(/&/g, '%26')
+  str = str.replace(/=/g, '%3D')
+  str = str.replace(/#/g, '%23')
+  return str
+}

+ 50 - 0
src/utils/utils.less

@@ -0,0 +1,50 @@
+.textOverflow() {
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  word-break: break-all;
+}
+
+.textOverflowMulti(@line: 3, @bg: #fff) {
+  position: relative;
+  max-height: @line * 1.5em;
+  margin-right: -1em;
+  padding-right: 1em;
+  overflow: hidden;
+  line-height: 1.5em;
+  text-align: justify;
+  &::before {
+    position: absolute;
+    right: 14px;
+    bottom: 0;
+    padding: 0 1px;
+    background: @bg;
+    content: '...';
+  }
+  &::after {
+    position: absolute;
+    right: 14px;
+    width: 1em;
+    height: 1em;
+    margin-top: 0.2em;
+    background: white;
+    content: '';
+  }
+}
+
+// mixins for clearfix
+// ------------------------
+.clearfix() {
+  zoom: 1;
+  &::before,
+  &::after {
+    display: table;
+    content: ' ';
+  }
+  &::after {
+    clear: both;
+    height: 0;
+    font-size: 0;
+    visibility: hidden;
+  }
+}

+ 51 - 261
src/utils/validate.js

@@ -1,12 +1,8 @@
-/**
- * Created by PanJiaChen on 16/11/18.
- */
-
 /**
  * @param {string} path
  * @returns {Boolean}
  */
-export function isExternal(path) {
+export function isExternal (path) {
   return /^(https?:|mailto:|tel:)/.test(path)
 }
 
@@ -14,280 +10,74 @@ export function isExternal(path) {
  * @param {string} str
  * @returns {Boolean}
  */
-export function validUsername(str) {
-  const valid_map = ['admin', 'editor']
-  return valid_map.indexOf(str.trim()) >= 0
+export function validUsername (str) {
+  const validMap = ['admin', 'editor']
+  return validMap.indexOf(str.trim()) >= 0
 }
-// 账号组树构造
-// export function translateDataToTreeAll(data, parentKey, parentIDKey) {
-//   const parent = data.filter(value => Number(value[parentKey]) <= 0) // 父数据
-//   const children = data.filter(value => Number(value[parentKey]) > 0) // 子数据
-//   // console.log('--parent', parent)
-//   // console.log('--children', children)
-//   const translator = (parent, children) => {
-//     parent.forEach(parent => {
-//       parent.children = []
-//       // children.forEach((current, index) => {
-//       //   if (current[parentKey] === parent[parentIDKey]) {
-//       //     const temp = JSON.parse(JSON.stringify(children))
-//       //     temp.splice(index, 1)
-//       //     translator([current], temp)
-//       //     typeof parent.children !== 'undefined' ? parent.children.push(current) : (parent.children = [current])
-//       //   }
-//       // })
-//       for (let i = 0; i < children.length; ) {
-//         if (children[i][parentKey] === parent[parentIDKey]) {
-//           const temp = children.splice(i, 1)
-//           typeof parent.children !== 'undefined' ? parent.children.push(...temp) : (parent.children = temp)
-//           translator(temp, children)
-//         } else {
-//           i++
-//         }
-//       }
-//     })
-//   }
-//   translator(parent, children)
-//   return parent
-// }
 
-export function translateDataToTreeAll(arr, parentKey, key) {
-  const map = {}
-  const result = []
-  arr.forEach(element => {
-    const id = element[key]
-    const pid = element[parentKey]
-    if (map[id]) {
-      map[id] = {
-        ...aement,
-        children: map[id].children
-      }
-    } else {
-      map[id] = {
-        ...aement,
-        children: []
-      }
-    }
-    const item = map[id]
-    if (pid <= 0) {
-      result.push(item)
-    } else {
-      if (map[pid]) {
-        map[pid].children.push(item)
-      } else {
-        map[pid] = {
-          children: [item]
-        }
-      }
-    }
-  })
-  return result
+/**
+ * @param {string} url
+ * @returns {Boolean}
+ */
+export function validURL (url) {
+  const reg = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~/])+$/
+  return reg.test(url)
 }
 
-// 模糊查询
-export function findarrays(ar, feature, v) {
-  var arr = []
-  ar.forEach(res => {
-    console.log(res.feature)
-  })
-  for (var i = 0; i < ar.length; i++) {
-    var atxt = ar[i][feature]
-    var btxt = v
-    var type = 0
-    if (atxt.match(btxt) == btxt) {
-      type = 1
-    }
-    if (type == 1) {
-      arr.push(ar[i])
-    }
-  }
-  // var arr = [];
-  // for (var i = 0; i < ar.length; i++) {
-  //   var atxt = ar[i][feature];
-  //   var btxt = v;
-  //   //		将字符串按某个字符切割成若干个字符串,并以数组形式返回
-  //   var atxtarr = atxt;
-  //   var btxtarr = btxt;
-  //   var type = 0;
-  //   // for (var k = 0; k < atxtarr.length; k++) {
-  //   //   if (btxtarr[0].length >= atxtarr[k].length) {
-  //   //     if (atxtarr[k] == btxtarr[0]) {
-  //   //       type = 1;
-  //   //     }
-  //   //   }
-  //   // }
-  //   if (atxtarr == btxtarr) {
-  //     type = 1;
-  //   } else if (atxtarr.length > btxtarr.length) {
-  //     for (var k = 0; k < atxtarr.length; k++) {
-  //       if (btxtarr[0].length >= atxtarr[k].length) {
-  //         if (atxtarr[k] == btxtarr) {
-  //           type = 1;
-  //         }
-  //       }
-  //     }
-  //   }
-  //   if (type == 1) {
-  //     arr.push(ar[i]);
-  //   }
-  // }
-  return arr
+/**
+ * @param {string} str
+ * @returns {Boolean}
+ */
+export function validLowerCase (str) {
+  const reg = /^[a-z]+$/
+  return reg.test(str)
 }
 
-// 随机长度
-function randomNum(start, end) {
-  return Math.floor(Math.random() * (Number(end) - Number(start)) + start)
+/**
+ * @param {string} str
+ * @returns {Boolean}
+ */
+export function validUpperCase (str) {
+  const reg = /^[A-Z]+$/
+  return reg.test(str)
 }
 
-// 字母随机
-function randomAlp(arr, count) {
-  let shuffled = arr.slice(0),
-    i = arr.length,
-    min = i - count,
-    temp,
-    index
-  while (i-- > min) {
-    index = Math.floor((i + 1) * Math.random())
-    temp = shuffled[index]
-    shuffled[index] = shuffled[i]
-    shuffled[i] = temp
-  }
-  return shuffled.slice(min)
+/**
+ * @param {string} str
+ * @returns {Boolean}
+ */
+export function validAlphabets (str) {
+  const reg = /^[A-Za-z]+$/
+  return reg.test(str)
 }
 
 /**
- * @param {minLen} 密码最小长度
- * @param {maxLen} 密码最大长度
- * @param {struc} 密码规则
- * @returns {Object}
- * 4位密码规则 1111 = 大写 小写 特殊字符 数字 都开启
+ * @param {string} email
+ * @returns {Boolean}
  */
-export function pwdProduce(minLen, maxLen, struc) {
-  // 密码规则转化
-  const pwdStruc = typeof struc === 'string' ? struc.split('') : `${struc}`.split('')
-  // 字母
-  const alphabet = 'abcdefghijklmnopqrstuvwxyz'
-  // 特殊字符
-  const special = ['~', '!', '@', '#', '$', '%', '^', '&', '*', '_', '+', '.']
-  // 数字
-  const numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
-  // 密码随机长度
-  const pwdLen = randomNum(minLen, maxLen)
-  const datas = []
-
-  if (pwdStruc.length) {
-    let typeLong = Number(pwdStruc[0]) + Number(pwdStruc[1]) + Number(pwdStruc[2]) + Number(pwdStruc[3])
-    let passLong = Math.ceil(pwdLen / typeLong)
-    let dis = ''
-    if (pwdStruc[0] == 1) {
-      let arr = alphabet.toLocaleUpperCase().split('')
-      let v = randomAlp(arr, passLong)
-      for (let i = 0; i < passLong; i++) {
-        dis += v[i]
-      }
-    }
-    if (pwdStruc[1] == 1) {
-      let arr = alphabet.split('')
-      let v = randomAlp(arr, passLong)
-      for (let i = 0; i < passLong; i++) {
-        dis += v[i]
-      }
-    }
-    if (pwdStruc[2] == 1) {
-      let arr = special
-      let v = randomAlp(arr, passLong)
-      for (let i = 0; i < passLong; i++) {
-        dis += v[i]
-      }
-    }
-    if (pwdStruc[3] == 1) {
-      let arr = numbers
-      let v = randomAlp(arr, passLong)
-      for (let i = 0; i < passLong; i++) {
-        dis += v[i]
-      }
-    }
-    return dis
-    // 缓存当前的密码规则
-    // pwdStruc.forEach((item, index) => {
-    //   if (item == 1) {
-    //     datas.push(index)
-    //   }
-    // })
-    // // 只有一种规则时
-    // if (datas.length === 1) {
-    //   const num = datas[0]
-    //   const dis = randomAlp(alphabet.split('')).splice(0, pwdLen).join('')
-    //   switch (num) {
-    //     case 0:
-    //       return dis.toLocaleUpperCase()
-    //       break;
-    //     case 1:
-    //       return dis
-    //       break;
-    //     default:
-    //       break;
-    //   }
-    // }
-  } else {
-    return new Error('密码规则转换失败')
-  }
+export function validEmail (email) {
+  const reg = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
+  return reg.test(email)
 }
 
-// 表单输入长度验证
-function getRealLength(string) {
-  let realLength = 0,
-    len = string.length,
-    charCode = -1
-  for (let i = 0; i < len; i++) {
-    charCode = string.charCodeAt(i)
-    if (charCode >= 0 && charCode <= 128) {
-      realLength += 1
-    } else {
-      realLength += 2
-    }
+/**
+ * @param {string} str
+ * @returns {Boolean}
+ */
+export function isString (str) {
+  if (typeof str === 'string' || str instanceof String) {
+    return true
   }
-  return realLength
+  return false
 }
 
-export function lengthValidator(rule, value, callback) {
-  value = value ?? ''
-  const realLength = getRealLength(value)
-  if (realLength === 0) {
-    callback()
-  } else if (rule.min && realLength < rule.min) {
-    rule.message += `  ${realLength}/${rule.min}`
-    callback(new Error('长度小于最小值'))
-  } else if (rule.max && realLength > rule.max) {
-    rule.message += `  ${realLength}/${rule.max}`
-    callback(new Error('长度超出最大值'))
-  } else {
-    callback()
-  }
-}
 /**
- * 是否合法IP地址
- * @param value
- * @param callback
+ * @param {Array} arg
+ * @returns {Boolean}
  */
-export function validateIP(rule, value, callback) {
-  if (value === '' || typeof value === 'undefined' || value == null) {
-    callback(new Error('请输入正确的IP地址'))
-  } else {
-    const reg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/
-    if ((!reg.test(value)) && value !== '') {
-      callback(new Error('请输入正确的IP地址'))
-    } else {
-      callback()
-    }
+export function isArray (arg) {
+  if (typeof Array.isArray === 'undefined') {
+    return Object.prototype.toString.call(arg) === '[object Array]'
   }
-}
-
-// 表单验证输入内容验证
-export const regular = {
-  integer: /^[0-9]*$/,
-  positiveInteger: /^[1-9][0-9]*$/,
-  name: /^(?!_)(?!.*?_$)[a-zA-Z0-9_\u4e00-\u9fa5]+$/,
-  nameMessage: '只能包含中文、英文、数字和下划线且不能以下划线开头',
-  url: /([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/|[wW]{3}.|[wW][aA][pP].|[fF][tT][pP].|[fF][iI][lL][eE].)[-A-Za-z0-9+&@#\/%?=~_|!:,.;]+[-A-Za-z0-9+&@#\/%=~_|]/,
-  urlMessage: '请输入正确地址'
+  return Array.isArray(arg)
 }

+ 42 - 0
src/utils/zipdownload.js

@@ -0,0 +1,42 @@
+import axios from 'axios'
+import storage from 'store'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+
+const mimeMap = {
+  xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+  zip: 'application/zip'
+}
+
+const baseUrl = process.env.VUE_APP_BASE_API
+export function downLoadZip (str, filename) {
+  var url = baseUrl + str
+  axios({
+    method: 'get',
+    url: url,
+    responseType: 'blob',
+    headers: { 'Authorization': 'Bearer ' + storage.get(ACCESS_TOKEN) }
+  }).then(res => {
+    resolveBlob(res, mimeMap.zip)
+  })
+}
+/**
+ * 解析blob响应内容并下载
+ * @param {*} res blob响应内容
+ * @param {String} mimeType MIME类型
+ */
+export function resolveBlob (res, mimeType) {
+  const aLink = document.createElement('a')
+  var blob = new Blob([res.data], { type: mimeType })
+  // //从response的headers中获取filename, 后端response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 设置的文件名;
+  var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*')
+  var contentDisposition = decodeURI(res.headers['content-disposition'])
+  var result = patt.exec(contentDisposition)
+  console.log(result)
+  var fileName = result[1]
+  fileName = fileName.replace(/"/g, '')
+  aLink.href = URL.createObjectURL(blob)
+  aLink.setAttribute('download', fileName) // 设置下载文件名称
+  document.body.appendChild(aLink)
+  aLink.click()
+  document.body.appendChild(aLink)
+}