Browse Source

配置修改

15102826049 1 week ago
parent
commit
8a801149a7
100 changed files with 9588 additions and 9195 deletions
  1. 23 0
      jshERP-web/.eslintrc.js
  2. 8 4
      jshERP-web/package.json
  3. 9 0
      jshERP-web/postcss.config.js
  4. 299 294
      jshERP-web/public/index.html
  5. 31 32
      jshERP-web/src/App.vue
  6. 7 9
      jshERP-web/src/api/GroupRequest.js
  7. 91 94
      jshERP-web/src/api/api.js
  8. 8 8
      jshERP-web/src/api/index.js
  9. 3 3
      jshERP-web/src/api/login.js
  10. 33 33
      jshERP-web/src/api/manage.js
  11. 3 0
      jshERP-web/src/assets/input.css
  12. 4 5
      jshERP-web/src/assets/less/JAreaLinkage.less
  13. 2 1
      jshERP-web/src/assets/less/TableExpand.less
  14. 20 11
      jshERP-web/src/assets/less/common.less
  15. 6 6
      jshERP-web/src/assets/less/index.less
  16. 32 32
      jshERP-web/src/components/AvatarList/Item.vue
  17. 60 62
      jshERP-web/src/components/AvatarList/List.vue
  18. 2 2
      jshERP-web/src/components/AvatarList/index.js
  19. 3 4
      jshERP-web/src/components/AvatarList/index.less
  20. 70 70
      jshERP-web/src/components/ChartCard.vue
  21. 78 82
      jshERP-web/src/components/CountDown/CountDown.vue
  22. 1 1
      jshERP-web/src/components/CountDown/index.js
  23. 33 33
      jshERP-web/src/components/Ellipsis/Ellipsis.vue
  24. 1 1
      jshERP-web/src/components/Ellipsis/index.js
  25. 32 32
      jshERP-web/src/components/NumberInfo/NumberInfo.vue
  26. 1 1
      jshERP-web/src/components/NumberInfo/index.js
  27. 3 4
      jshERP-web/src/components/NumberInfo/index.less
  28. 27 27
      jshERP-web/src/components/Trend/Trend.vue
  29. 1 1
      jshERP-web/src/components/Trend/index.js
  30. 4 4
      jshERP-web/src/components/Trend/index.less
  31. 71 72
      jshERP-web/src/components/chart/AreaChartTy.vue
  32. 43 41
      jshERP-web/src/components/chart/Bar.vue
  33. 50 47
      jshERP-web/src/components/chart/BarAndLine.vue
  34. 92 72
      jshERP-web/src/components/chart/BarMultid.vue
  35. 123 137
      jshERP-web/src/components/chart/DashChartDemo.vue
  36. 42 44
      jshERP-web/src/components/chart/IndexBar.vue
  37. 78 78
      jshERP-web/src/components/chart/LineChartMultid.vue
  38. 28 37
      jshERP-web/src/components/chart/Liquid.vue
  39. 49 49
      jshERP-web/src/components/chart/MiniArea.vue
  40. 58 55
      jshERP-web/src/components/chart/MiniBar.vue
  41. 54 54
      jshERP-web/src/components/chart/MiniProgress.vue
  42. 61 56
      jshERP-web/src/components/chart/Pie.vue
  43. 74 75
      jshERP-web/src/components/chart/Radar.vue
  44. 54 56
      jshERP-web/src/components/chart/RankList.vue
  45. 37 38
      jshERP-web/src/components/chart/StackBar.vue
  46. 48 54
      jshERP-web/src/components/chart/TransferBar.vue
  47. 66 63
      jshERP-web/src/components/chart/Trend.vue
  48. 2 2
      jshERP-web/src/components/chart/chart.less
  49. 2 2
      jshERP-web/src/components/chart/chart.scss
  50. 2 2
      jshERP-web/src/components/chart/mixins/ChartMixins.js
  51. 2 2
      jshERP-web/src/components/index.less
  52. 111 113
      jshERP-web/src/components/jeecg/JAreaLinkage.vue
  53. 196 197
      jshERP-web/src/components/jeecg/JCategorySelect.vue
  54. 32 32
      jshERP-web/src/components/jeecg/JCheckbox.vue
  55. 362 366
      jshERP-web/src/components/jeecg/JCodeEditor.vue
  56. 49 49
      jshERP-web/src/components/jeecg/JCron.vue
  57. 68 68
      jshERP-web/src/components/jeecg/JDate.vue
  58. 400 272
      jshERP-web/src/components/jeecg/JEditableTable.vue
  59. 16 18
      jshERP-web/src/components/jeecg/JEllipsis.vue
  60. 48 44
      jshERP-web/src/components/jeecg/JFormContainer.vue
  61. 177 178
      jshERP-web/src/components/jeecg/JGraphicCode.vue
  62. 186 189
      jshERP-web/src/components/jeecg/JImageUpload.vue
  63. 79 92
      jshERP-web/src/components/jeecg/JImportModal.vue
  64. 79 81
      jshERP-web/src/components/jeecg/JInput.vue
  65. 181 177
      jshERP-web/src/components/jeecg/JModal/index.vue
  66. 48 52
      jshERP-web/src/components/jeecg/JSelectMultiple.vue
  67. 113 102
      jshERP-web/src/components/jeecg/JSlider.vue
  68. 612 564
      jshERP-web/src/components/jeecg/JSuperQuery.vue
  69. 45 46
      jshERP-web/src/components/jeecg/JSwitch.vue
  70. 161 161
      jshERP-web/src/components/jeecg/JTreeDict.vue
  71. 217 219
      jshERP-web/src/components/jeecg/JTreeSelect.vue
  72. 119 122
      jshERP-web/src/components/jeecg/JTreeTable.vue
  73. 398 380
      jshERP-web/src/components/jeecg/JUpload.vue
  74. 2 2
      jshERP-web/src/components/jeecg/index.js
  75. 84 94
      jshERP-web/src/components/jeecg/minipop/JFilePop.vue
  76. 75 74
      jshERP-web/src/components/jeecg/minipop/JInputPop.vue
  77. 807 698
      jshERP-web/src/components/jeecg/modal/JCronModal.vue
  78. 258 261
      jshERP-web/src/components/jeecgbiz/JSelectBizComponent/JSelectBizComponentModal.vue
  79. 120 117
      jshERP-web/src/components/jeecgbiz/JSelectBizComponent/index.vue
  80. 95 94
      jshERP-web/src/components/jeecgbiz/JSelectDepart.vue
  81. 160 107
      jshERP-web/src/components/jeecgbiz/JSelectList.vue
  82. 30 30
      jshERP-web/src/components/jeecgbiz/JSelectMultiUser.vue
  83. 29 29
      jshERP-web/src/components/jeecgbiz/JSelectPosition.vue
  84. 16 19
      jshERP-web/src/components/jeecgbiz/JSelectRole.vue
  85. 71 71
      jshERP-web/src/components/jeecgbiz/JSelectUserByDep.vue
  86. 212 208
      jshERP-web/src/components/jeecgbiz/modal/JSelectBatchModal.vue
  87. 167 171
      jshERP-web/src/components/jeecgbiz/modal/JSelectDepartModal.vue
  88. 346 323
      jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue
  89. 182 174
      jshERP-web/src/components/jeecgbiz/modal/JSelectSnAddModal.vue
  90. 258 253
      jshERP-web/src/components/jeecgbiz/modal/JSelectSnModal.vue
  91. 215 215
      jshERP-web/src/components/jeecgbiz/modal/JSelectUserByDepModal.vue
  92. 91 93
      jshERP-web/src/components/jeecgbiz/modal/SelectUserListModal.vue
  93. 29 34
      jshERP-web/src/components/layouts/BasicLayout.vue
  94. 4 7
      jshERP-web/src/components/layouts/BlankLayout.vue
  95. 41 36
      jshERP-web/src/components/layouts/IframeFReportView.vue
  96. 38 39
      jshERP-web/src/components/layouts/IframePageView.vue
  97. 58 60
      jshERP-web/src/components/layouts/PageView.vue
  98. 9 9
      jshERP-web/src/components/layouts/RouteView.vue
  99. 388 390
      jshERP-web/src/components/layouts/TabLayout.vue
  100. 175 173
      jshERP-web/src/components/layouts/UserLayout.vue

+ 23 - 0
jshERP-web/.eslintrc.js

@@ -0,0 +1,23 @@
+module.exports = {
+  env: {
+    browser: true,
+    es2021: true,
+    node: true,
+  },
+  extends: [
+    'eslint:recommended',
+    'plugin:prettier/recommended', // 添加这一行
+  ],
+  parserOptions: {
+    ecmaVersion: 12,
+    sourceType: 'module',
+  },
+  rules: {
+    'prettier/prettier': [
+      'warn',
+      {
+        semi: false, // 你可以根据需要调整其他 Prettier 选项
+      },
+    ],
+  },
+}

+ 8 - 4
jshERP-web/package.json

@@ -23,6 +23,7 @@
     "lodash.pick": "^4.4.0",
     "md5": "^2.2.1",
     "nprogress": "^0.2.0",
+    "tailwindcss": "^4.0.17",
     "viser-vue": "^2.4.4",
     "vue": "^2.7.16",
     "vue-area-linkage": "^5.1.0",
@@ -36,7 +37,9 @@
     "vue-router": "^3.0.1",
     "vue-splitpane": "^1.0.4",
     "vuedraggable": "^2.20.0",
-    "vuex": "^3.1.0"
+    "vuex": "^3.1.0",
+    "vxe-pc-ui": "^3.4.27",
+    "vxe-table": "^3.14.0"
   },
   "devDependencies": {
     "@babel/polyfill": "^7.2.5",
@@ -47,10 +50,13 @@
     "babel-eslint": "^10.0.1",
     "compression-webpack-plugin": "^3.1.0",
     "eslint": "^5.16.0",
+    "eslint-config-prettier": "^10.1.1",
+    "eslint-plugin-prettier": "^5.2.5",
     "eslint-plugin-vue": "^5.1.0",
     "html-webpack-plugin": "^4.2.0",
     "less": "^3.9.0",
     "less-loader": "^4.1.0",
+    "tailwindcss": "^3.4.1",
     "vue-template-compiler": "^2.6.10"
   },
   "eslintConfig": {
@@ -97,9 +103,7 @@
     }
   },
   "postcss": {
-    "plugins": {
-      "autoprefixer": {}
-    }
+    "plugins": {}
   },
   "browserslist": [
     "> 1%",

+ 9 - 0
jshERP-web/postcss.config.js

@@ -0,0 +1,9 @@
+// https://github.com/michael-ciniawsky/postcss-load-config
+
+module.exports = {
+  plugins: {
+    tailwindcss: {},
+    // to edit target browsers: use "browserslist" field in package.json
+    autoprefixer: {},
+  },
+}

+ 299 - 294
jshERP-web/public/index.html

@@ -1,319 +1,324 @@
 <!DOCTYPE html>
 <html lang="zh-cmn-Hans">
-<head>
-  <title></title>
-  <meta charset="utf-8">
-  <meta http-equiv="X-UA-Compatible" content="IE=edge">
-  <meta name="viewport" content="width=device-width,initial-scale=1.0">
-  <meta name="description" content="基于SpringBoot框架,立志为中小企业提供开源好用的ERP软件,目前专注进销存+财务功能。主要模块有零售管理、采购管理、销售管理、仓库管理、财务管理、报表查询、基础数据、系统管理等。" />
-  <meta name="keywords" content="erp,erp系统,进销存,进销存系统" />
-  <link rel="icon" href="<%= BASE_URL %>static/favicon.ico">
-  <style>
-    html,
-    body,
-    #app {
-      height: 100%;
-      margin: 0px;
-      padding: 0px;
-    }
-    .chromeframe {
-      margin: 0.2em 0;
-      background: #ccc;
-      color: #999;
-      padding: 0.2em 0;
-    }
-    #loader-wrapper {
-      position: fixed;
-      top: 0;
-      left: 0;
-      width: 100%;
-      height: 100%;
-      z-index: 999999;
-    }
-    #loader {
-      display: block;
-      position: relative;
-      left: 50%;
-      top: 50%;
-      width: 120px;
-      height: 120px;
-      margin: -75px 0 0 -75px;
-      border-radius: 50%;
-      border: 3px solid transparent;
-      /* COLOR 1 */
-      border-top-color: #999;
-      -webkit-animation: spin 2s linear infinite;
-      /* Chrome, Opera 15+, Safari 5+ */
-      -ms-animation: spin 2s linear infinite;
-      /* Chrome, Opera 15+, Safari 5+ */
-      -moz-animation: spin 2s linear infinite;
-      /* Chrome, Opera 15+, Safari 5+ */
-      -o-animation: spin 2s linear infinite;
-      /* Chrome, Opera 15+, Safari 5+ */
-      animation: spin 2s linear infinite;
-      /* Chrome, Firefox 16+, IE 10+, Opera */
-      z-index: 1001;
-    }
-    #loader:before {
-      content: "";
-      position: absolute;
-      top: 5px;
-      left: 5px;
-      right: 5px;
-      bottom: 5px;
-      border-radius: 50%;
-      border: 3px solid transparent;
-      /* COLOR 2 */
-      border-top-color: #999;
-      -webkit-animation: spin 3s linear infinite;
-      /* Chrome, Opera 15+, Safari 5+ */
-      -moz-animation: spin 3s linear infinite;
-      /* Chrome, Opera 15+, Safari 5+ */
-      -o-animation: spin 3s linear infinite;
-      /* Chrome, Opera 15+, Safari 5+ */
-      -ms-animation: spin 3s linear infinite;
-      /* Chrome, Opera 15+, Safari 5+ */
-      animation: spin 3s linear infinite;
-      /* Chrome, Firefox 16+, IE 10+, Opera */
-    }
-    #loader:after {
-      content: "";
-      position: absolute;
-      top: 15px;
-      left: 15px;
-      right: 15px;
-      bottom: 15px;
-      border-radius: 50%;
-      border: 3px solid transparent;
-      border-top-color: #999;
-      /* COLOR 3 */
-      -moz-animation: spin 1.5s linear infinite;
-      /* Chrome, Opera 15+, Safari 5+ */
-      -o-animation: spin 1.5s linear infinite;
-      /* Chrome, Opera 15+, Safari 5+ */
-      -ms-animation: spin 1.5s linear infinite;
-      /* Chrome, Opera 15+, Safari 5+ */
-      -webkit-animation: spin 1.5s linear infinite;
-      /* Chrome, Opera 15+, Safari 5+ */
-      animation: spin 1.5s linear infinite;
-      /* Chrome, Firefox 16+, IE 10+, Opera */
-    }
-    @-webkit-keyframes spin {
-      0% {
-        -webkit-transform: rotate(0deg);
+  <head>
+    <title></title>
+    <meta charset="utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
+    <meta
+      name="description"
+      content="基于SpringBoot框架,立志为中小企业提供开源好用的ERP软件,目前专注进销存+财务功能。主要模块有零售管理、采购管理、销售管理、仓库管理、财务管理、报表查询、基础数据、系统管理等。"
+    />
+    <meta name="keywords" content="erp,erp系统,进销存,进销存系统" />
+    <link rel="icon" href="<%= BASE_URL %>static/favicon.ico" />
+    <link href="./tailwind.css" rel="stylesheet" />
+    <style>
+      html,
+      body,
+      #app {
+        height: 100%;
+        margin: 0px;
+        padding: 0px;
+      }
+      .chromeframe {
+        margin: 0.2em 0;
+        background: #ccc;
+        color: #999;
+        padding: 0.2em 0;
+      }
+      #loader-wrapper {
+        position: fixed;
+        top: 0;
+        left: 0;
+        width: 100%;
+        height: 100%;
+        z-index: 999999;
+      }
+      #loader {
+        display: block;
+        position: relative;
+        left: 50%;
+        top: 50%;
+        width: 120px;
+        height: 120px;
+        margin: -75px 0 0 -75px;
+        border-radius: 50%;
+        border: 3px solid transparent;
+        /* COLOR 1 */
+        border-top-color: #999;
+        -webkit-animation: spin 2s linear infinite;
+        /* Chrome, Opera 15+, Safari 5+ */
+        -ms-animation: spin 2s linear infinite;
+        /* Chrome, Opera 15+, Safari 5+ */
+        -moz-animation: spin 2s linear infinite;
+        /* Chrome, Opera 15+, Safari 5+ */
+        -o-animation: spin 2s linear infinite;
+        /* Chrome, Opera 15+, Safari 5+ */
+        animation: spin 2s linear infinite;
+        /* Chrome, Firefox 16+, IE 10+, Opera */
+        z-index: 1001;
+      }
+      #loader:before {
+        content: '';
+        position: absolute;
+        top: 5px;
+        left: 5px;
+        right: 5px;
+        bottom: 5px;
+        border-radius: 50%;
+        border: 3px solid transparent;
+        /* COLOR 2 */
+        border-top-color: #999;
+        -webkit-animation: spin 3s linear infinite;
+        /* Chrome, Opera 15+, Safari 5+ */
+        -moz-animation: spin 3s linear infinite;
+        /* Chrome, Opera 15+, Safari 5+ */
+        -o-animation: spin 3s linear infinite;
+        /* Chrome, Opera 15+, Safari 5+ */
+        -ms-animation: spin 3s linear infinite;
+        /* Chrome, Opera 15+, Safari 5+ */
+        animation: spin 3s linear infinite;
+        /* Chrome, Firefox 16+, IE 10+, Opera */
+      }
+      #loader:after {
+        content: '';
+        position: absolute;
+        top: 15px;
+        left: 15px;
+        right: 15px;
+        bottom: 15px;
+        border-radius: 50%;
+        border: 3px solid transparent;
+        border-top-color: #999;
+        /* COLOR 3 */
+        -moz-animation: spin 1.5s linear infinite;
+        /* Chrome, Opera 15+, Safari 5+ */
+        -o-animation: spin 1.5s linear infinite;
+        /* Chrome, Opera 15+, Safari 5+ */
+        -ms-animation: spin 1.5s linear infinite;
+        /* Chrome, Opera 15+, Safari 5+ */
+        -webkit-animation: spin 1.5s linear infinite;
+        /* Chrome, Opera 15+, Safari 5+ */
+        animation: spin 1.5s linear infinite;
+        /* Chrome, Firefox 16+, IE 10+, Opera */
+      }
+      @-webkit-keyframes spin {
+        0% {
+          -webkit-transform: rotate(0deg);
+          /* Chrome, Opera 15+, Safari 3.1+ */
+          -ms-transform: rotate(0deg);
+          /* IE 9 */
+          transform: rotate(0deg);
+          /* Firefox 16+, IE 10+, Opera */
+        }
+        100% {
+          -webkit-transform: rotate(360deg);
+          /* Chrome, Opera 15+, Safari 3.1+ */
+          -ms-transform: rotate(360deg);
+          /* IE 9 */
+          transform: rotate(360deg);
+          /* Firefox 16+, IE 10+, Opera */
+        }
+      }
+      @keyframes spin {
+        0% {
+          -webkit-transform: rotate(0deg);
+          /* Chrome, Opera 15+, Safari 3.1+ */
+          -ms-transform: rotate(0deg);
+          /* IE 9 */
+          transform: rotate(0deg);
+          /* Firefox 16+, IE 10+, Opera */
+        }
+        100% {
+          -webkit-transform: rotate(360deg);
+          /* Chrome, Opera 15+, Safari 3.1+ */
+          -ms-transform: rotate(360deg);
+          /* IE 9 */
+          transform: rotate(360deg);
+          /* Firefox 16+, IE 10+, Opera */
+        }
+      }
+      #loader-wrapper .loader-section {
+        position: fixed;
+        top: 0;
+        width: 51%;
+        height: 100%;
+        background: #fff;
+        /* Old browsers */
+        z-index: 1000;
+        -webkit-transform: translateX(0);
         /* Chrome, Opera 15+, Safari 3.1+ */
-        -ms-transform: rotate(0deg);
+        -ms-transform: translateX(0);
         /* IE 9 */
-        transform: rotate(0deg);
+        transform: translateX(0);
         /* Firefox 16+, IE 10+, Opera */
       }
-      100% {
-        -webkit-transform: rotate(360deg);
+      #loader-wrapper .loader-section.section-left {
+        left: 0;
+      }
+      #loader-wrapper .loader-section.section-right {
+        right: 0;
+      }
+      /* Loaded */
+      .loaded #loader-wrapper .loader-section.section-left {
+        -webkit-transform: translateX(-100%);
         /* Chrome, Opera 15+, Safari 3.1+ */
-        -ms-transform: rotate(360deg);
+        -ms-transform: translateX(-100%);
         /* IE 9 */
-        transform: rotate(360deg);
+        transform: translateX(-100%);
         /* Firefox 16+, IE 10+, Opera */
+        -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
+        transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
       }
-    }
-    @keyframes spin {
-      0% {
-        -webkit-transform: rotate(0deg);
+      .loaded #loader-wrapper .loader-section.section-right {
+        -webkit-transform: translateX(100%);
         /* Chrome, Opera 15+, Safari 3.1+ */
-        -ms-transform: rotate(0deg);
+        -ms-transform: translateX(100%);
         /* IE 9 */
-        transform: rotate(0deg);
+        transform: translateX(100%);
         /* Firefox 16+, IE 10+, Opera */
+        -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
+        transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
+      }
+      .loaded #loader {
+        opacity: 0;
+        -webkit-transition: all 0.3s ease-out;
+        transition: all 0.3s ease-out;
       }
-      100% {
-        -webkit-transform: rotate(360deg);
+      .loaded #loader-wrapper {
+        visibility: hidden;
+        -webkit-transform: translateY(-100%);
         /* Chrome, Opera 15+, Safari 3.1+ */
-        -ms-transform: rotate(360deg);
+        -ms-transform: translateY(-100%);
         /* IE 9 */
-        transform: rotate(360deg);
+        transform: translateY(-100%);
         /* Firefox 16+, IE 10+, Opera */
+        -webkit-transition: all 0.3s 1s ease-out;
+        transition: all 0.3s 1s ease-out;
       }
-    }
-    #loader-wrapper .loader-section {
-      position: fixed;
-      top: 0;
-      width: 51%;
-      height: 100%;
-      background: #fff;
-      /* Old browsers */
-      z-index: 1000;
-      -webkit-transform: translateX(0);
-      /* Chrome, Opera 15+, Safari 3.1+ */
-      -ms-transform: translateX(0);
-      /* IE 9 */
-      transform: translateX(0);
-      /* Firefox 16+, IE 10+, Opera */
-    }
-    #loader-wrapper .loader-section.section-left {
-      left: 0;
-    }
-    #loader-wrapper .loader-section.section-right {
-      right: 0;
-    }
-    /* Loaded */
-    .loaded #loader-wrapper .loader-section.section-left {
-      -webkit-transform: translateX(-100%);
-      /* Chrome, Opera 15+, Safari 3.1+ */
-      -ms-transform: translateX(-100%);
-      /* IE 9 */
-      transform: translateX(-100%);
-      /* Firefox 16+, IE 10+, Opera */
-      -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
-      transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
-    }
-    .loaded #loader-wrapper .loader-section.section-right {
-      -webkit-transform: translateX(100%);
-      /* Chrome, Opera 15+, Safari 3.1+ */
-      -ms-transform: translateX(100%);
-      /* IE 9 */
-      transform: translateX(100%);
-      /* Firefox 16+, IE 10+, Opera */
-      -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
-      transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
-    }
-    .loaded #loader {
-      opacity: 0;
-      -webkit-transition: all 0.3s ease-out;
-      transition: all 0.3s ease-out;
-    }
-    .loaded #loader-wrapper {
-      visibility: hidden;
-      -webkit-transform: translateY(-100%);
-      /* Chrome, Opera 15+, Safari 3.1+ */
-      -ms-transform: translateY(-100%);
-      /* IE 9 */
-      transform: translateY(-100%);
-      /* Firefox 16+, IE 10+, Opera */
-      -webkit-transition: all 0.3s 1s ease-out;
-      transition: all 0.3s 1s ease-out;
-    }
-    /* JavaScript Turned Off */
-    .no-js #loader-wrapper {
-      display: none;
-    }
-    .no-js h1 {
-      color: #222222;
-    }
-    #loader-wrapper .load_title {
-      font-family: 'Open Sans';
-      color: #999;
-      font-size: 14px;
-      width: 100%;
-      text-align: center;
-      z-index: 9999999999999;
-      position: absolute;
-      top: 60%;
-      opacity: 1;
-      line-height: 30px;
-    }
-    #loader-wrapper .load_title span {
-      font-weight: normal;
-      font-style: italic;
-      font-size: 14px;
-      color: #999;
-      opacity: 0.5;
-    }
-    /* 滚动条优化 start */
-    ::-webkit-scrollbar{
-      width:8px;
-      height:8px;
-    }
-    ::-webkit-scrollbar-track{
-      background: #f6f6f6;
-      border-radius:2px;
-    }
-    ::-webkit-scrollbar-thumb{
-      background: #cdcdcd;
-      border-radius:2px;
-    }
-    ::-webkit-scrollbar-thumb:hover{
-      background: #747474;
-    }
-    ::-webkit-scrollbar-corner {
-      background: #f6f6f6;
-    }
-    /* 滚动条优化 end */
-  </style>
-  <script>
-    function getPlatform(type) {
-      let res = '';
-      let ajax = new XMLHttpRequest();
-      let url = window._CONFIG['domianURL'] + '/platformConfig/getPlatform/' + type
-      ajax.onreadystatechange = function () {
-        if (ajax.readyState===4 &&ajax.status===200) {
-          res = ajax.responseText;
-        } else {
-          res = 'ERP系统';
+      /* JavaScript Turned Off */
+      .no-js #loader-wrapper {
+        display: none;
+      }
+      .no-js h1 {
+        color: #222222;
+      }
+      #loader-wrapper .load_title {
+        font-family: 'Open Sans';
+        color: #999;
+        font-size: 14px;
+        width: 100%;
+        text-align: center;
+        z-index: 9999999999999;
+        position: absolute;
+        top: 60%;
+        opacity: 1;
+        line-height: 30px;
+      }
+      #loader-wrapper .load_title span {
+        font-weight: normal;
+        font-style: italic;
+        font-size: 14px;
+        color: #999;
+        opacity: 0.5;
+      }
+      /* 滚动条优化 start */
+      ::-webkit-scrollbar {
+        width: 8px;
+        height: 8px;
+      }
+      ::-webkit-scrollbar-track {
+        background: #f6f6f6;
+        border-radius: 2px;
+      }
+      ::-webkit-scrollbar-thumb {
+        background: #cdcdcd;
+        border-radius: 2px;
+      }
+      ::-webkit-scrollbar-thumb:hover {
+        background: #747474;
+      }
+      ::-webkit-scrollbar-corner {
+        background: #f6f6f6;
+      }
+      /* 滚动条优化 end */
+    </style>
+    <script>
+      function getPlatform(type) {
+        let res = ''
+        let ajax = new XMLHttpRequest()
+        let url = window._CONFIG['domianURL'] + '/platformConfig/getPlatform/' + type
+        ajax.onreadystatechange = function () {
+          if (ajax.readyState === 4 && ajax.status === 200) {
+            res = ajax.responseText
+          } else {
+            res = 'ERP系统'
+          }
         }
+        ajax.open('get', url, false)
+        ajax.send(null)
+        return res
       }
-      ajax.open('get', url, false);
-      ajax.send(null);
-      return res;
-    }
-    window._CONFIG = {};
-    window._CONFIG['domianURL'] = '/jshERP-boot';
-    let statisticsCode = '1cd9bcbaae133f03a6eb19da6579aaba'
-    window.SYS_TITLE = getPlatform("name");
-    window.SYS_URL = getPlatform("url");
-    window._statistics = 'https://hm.baidu.com/hm.js?' + statisticsCode
-    document.title = window.SYS_TITLE;
-    //statistics
-    var _hmt = _hmt || [];
-    (function() {
-      var hm = document.createElement("script");
-      hm.src = window._statistics;
-      var s = document.getElementsByTagName("script")[0];
-      s.parentNode.insertBefore(hm, s);
-    })();
-  </script>
-</head>
+      window._CONFIG = {}
+      window._CONFIG['domianURL'] = '/jshERP-boot'
+      let statisticsCode = '1cd9bcbaae133f03a6eb19da6579aaba'
+      window.SYS_TITLE = getPlatform('name')
+      window.SYS_URL = getPlatform('url')
+      window._statistics = 'https://hm.baidu.com/hm.js?' + statisticsCode
+      document.title = window.SYS_TITLE
+      //statistics
+      var _hmt = _hmt || []
+      ;(function () {
+        var hm = document.createElement('script')
+        hm.src = window._statistics
+        var s = document.getElementsByTagName('script')[0]
+        s.parentNode.insertBefore(hm, s)
+      })()
+    </script>
+  </head>
 
-<body>
-<!-- built files will be auto injected -->
-<div id="app">
-  <div id="loader-wrapper">
-    <div id="loader"></div>
-    <div class="loader-section section-left"></div>
-    <div class="loader-section section-right"></div>
-    <div class="load_title">
-      正在加载系统,请耐心等待
+  <body>
+    <!-- built files will be auto injected -->
+    <div id="app">
+      <div id="loader-wrapper">
+        <div id="loader"></div>
+        <div class="loader-section section-left"></div>
+        <div class="loader-section section-right"></div>
+        <div class="load_title">正在加载系统,请耐心等待</div>
+      </div>
     </div>
-  </div>
-</div>
-</body>
+  </body>
 
-<!-- 全局配置-多语言切换-开始 -->
-<script src="<%= BASE_URL %>static/translate.js"></script>
-<script>
-//设置本地语种(当前网页的语种)。如果不设置,默认就是 'chinese_simplified' 简体中文
-translate.language.setLocal('chinese_simplified');
-translate.service.use('client.edge');
-//翻译自定义
-translate.nomenclature.append('chinese_simplified','english',`
+  <!-- 全局配置-多语言切换-开始 -->
+  <script src="<%= BASE_URL %>static/translate.js"></script>
+  <script>
+    //设置本地语种(当前网页的语种)。如果不设置,默认就是 'chinese_simplified' 简体中文
+    translate.language.setLocal('chinese_simplified')
+    translate.service.use('client.edge')
+    //翻译自定义
+    translate.nomenclature.append(
+      'chinese_simplified',
+      'english',
+      `
 富贵ERP=fuguierp
-`)
-//开启html页面变化的监控,对变化部分会进行自动翻译
-translate.listener.start();
-//不显示语言选择标签
-translate.selectLanguageTag.show = false;
-//执行翻译初始化操作,显示出select语言选择
-//translate.execute();
-
-//VUE的渲染需要时间,所以留出一点点时间来进行翻译切换
-document.addEventListener('DOMContentLoaded', function () {
-    //页面 DOM 已渲染完毕,当然最好是能监控到整个vue渲染完毕后触发最好
-    translate.execute();
-    //2秒后再一次,避免有遗漏
-    setTimeout(function(){
-    	translate.execute();
-    },2000);
-});
-</script>
-<!-- 全局配置-多语言切换-结束 -->
+`
+    )
+    //开启html页面变化的监控,对变化部分会进行自动翻译
+    translate.listener.start()
+    //不显示语言选择标签
+    translate.selectLanguageTag.show = false
+    //执行翻译初始化操作,显示出select语言选择
+    //translate.execute();
 
-</html>
+    //VUE的渲染需要时间,所以留出一点点时间来进行翻译切换
+    document.addEventListener('DOMContentLoaded', function () {
+      //页面 DOM 已渲染完毕,当然最好是能监控到整个vue渲染完毕后触发最好
+      translate.execute()
+      //2秒后再一次,避免有遗漏
+      setTimeout(function () {
+        translate.execute()
+      }, 2000)
+    })
+  </script>
+  <!-- 全局配置-多语言切换-结束 -->
+</html>

+ 31 - 32
jshERP-web/src/App.vue

@@ -1,43 +1,42 @@
 <template>
   <a-config-provider :locale="locale">
     <div id="app">
-      <router-view/>
+      <router-view />
     </div>
   </a-config-provider>
 </template>
 <script>
-  import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
-  import enquireScreen from '@/utils/device'
+import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
+import enquireScreen from '@/utils/device'
 
-  export default {
-    data () {
-      return {
-        locale: zhCN,
-      }
-    },
-    created () {
-      let that = this
-      enquireScreen(deviceType => {
-        // tablet
-        if (deviceType === 0) {
-          that.$store.commit('TOGGLE_DEVICE', 'mobile')
-          that.$store.dispatch('setSidebar', false)
-        }
-        // mobile
-        else if (deviceType === 1) {
-          that.$store.commit('TOGGLE_DEVICE', 'mobile')
-          that.$store.dispatch('setSidebar', false)
-        }
-        else {
-          that.$store.commit('TOGGLE_DEVICE', 'desktop')
-          that.$store.dispatch('setSidebar', true)
-        }
-      })
+export default {
+  data() {
+    return {
+      locale: zhCN,
     }
-  }
+  },
+  created() {
+    let that = this
+    enquireScreen((deviceType) => {
+      // tablet
+      if (deviceType === 0) {
+        that.$store.commit('TOGGLE_DEVICE', 'mobile')
+        that.$store.dispatch('setSidebar', false)
+      }
+      // mobile
+      else if (deviceType === 1) {
+        that.$store.commit('TOGGLE_DEVICE', 'mobile')
+        that.$store.dispatch('setSidebar', false)
+      } else {
+        that.$store.commit('TOGGLE_DEVICE', 'desktop')
+        that.$store.dispatch('setSidebar', true)
+      }
+    })
+  },
+}
 </script>
 <style>
-  #app {
-    height: 100%;
-  }
-</style>
+#app {
+  height: 100%;
+}
+</style>

+ 7 - 9
jshERP-web/src/api/GroupRequest.js

@@ -9,22 +9,20 @@ import Vue from 'vue'
  */
 export function httpGroupRequest(getPromise, groupId, expire = 1000 * 30) {
   if (groupId == null || groupId === '') {
-    console.log("--------popup----------getFrom  DB-------with---no--groupId ")
+    console.log('--------popup----------getFrom  DB-------with---no--groupId ')
     return getPromise()
   }
 
   if (Vue.ls.get(groupId)) {
-    console.log("---------popup--------getFrom  Cache--------groupId = " + groupId)
-    return Promise.resolve(Vue.ls.get(groupId));
+    console.log('---------popup--------getFrom  Cache--------groupId = ' + groupId)
+    return Promise.resolve(Vue.ls.get(groupId))
   } else {
-    console.log("--------popup----------getFrom  DB---------groupId = " + groupId)
+    console.log('--------popup----------getFrom  DB---------groupId = ' + groupId)
   }
 
   // 还没有发出请求,就发出第一次的请求
-  return getPromise().then(res => {
-    Vue.ls.set(groupId, res, expire);
-    return Promise.resolve(res);
+  return getPromise().then((res) => {
+    Vue.ls.set(groupId, res, expire)
+    return Promise.resolve(res)
   })
 }
-
-

+ 91 - 94
jshERP-web/src/api/api.js

@@ -1,116 +1,116 @@
 import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'
 
 //首页统计
-const getBuyAndSaleStatistics = (params)=>getAction("/depotHead/getBuyAndSaleStatistics",params);
-const buyOrSalePrice = (params)=>getAction("/depotItem/buyOrSalePrice",params);
+const getBuyAndSaleStatistics = (params) => getAction('/depotHead/getBuyAndSaleStatistics', params)
+const buyOrSalePrice = (params) => getAction('/depotItem/buyOrSalePrice', params)
 //租户管理
-const checkTenant = (params)=>getAction("/tenant/checkIsNameExist",params);
-const addTenant = (params)=>postAction("/tenant/add",params);
-const editTenant = (params)=>putAction("/tenant/update",params);
+const checkTenant = (params) => getAction('/tenant/checkIsNameExist', params)
+const addTenant = (params) => postAction('/tenant/add', params)
+const editTenant = (params) => putAction('/tenant/update', params)
 //角色管理
-const addRole = (params)=>postAction("/role/add",params);
-const editRole = (params)=>putAction("/role/update",params);
-const checkRole = (params)=>getAction("/role/checkIsNameExist",params);
-const roleAllList = (params)=>getAction("/role/allList",params);
-const getTenantRoleList = (params)=>getAction("/role/tenantRoleList",params);
+const addRole = (params) => postAction('/role/add', params)
+const editRole = (params) => putAction('/role/update', params)
+const checkRole = (params) => getAction('/role/checkIsNameExist', params)
+const roleAllList = (params) => getAction('/role/allList', params)
+const getTenantRoleList = (params) => getAction('/role/tenantRoleList', params)
 //用户管理
-const registerUser = (params)=>postAction("/user/registerUser",params);
-const addUser = (params)=>postAction("/user/addUser",params);
-const editUser = (params)=>putAction("/user/updateUser",params);
-const getUserList = (params)=>getAction("/user/getUserList",params);
-const getUserBtnByCurrentUser = (params)=>getAction("/user/getUserBtnByCurrentUser",params);
-const queryPermissionsByUser = (params)=>postAction("/function/findMenuByPNumber",params);
+const registerUser = (params) => postAction('/user/registerUser', params)
+const addUser = (params) => postAction('/user/addUser', params)
+const editUser = (params) => putAction('/user/updateUser', params)
+const getUserList = (params) => getAction('/user/getUserList', params)
+const getUserBtnByCurrentUser = (params) => getAction('/user/getUserBtnByCurrentUser', params)
+const queryPermissionsByUser = (params) => postAction('/function/findMenuByPNumber', params)
 //机构管理
-const queryOrganizationTreeList = (params)=>getAction("/organization/getOrganizationTree",params);
-const getAllOrganizationTreeByUser = (params)=>getAction("/organization/getAllOrganizationTreeByUser",params);
-const queryOrganizationById = (params)=>getAction("/organization/findById",params);
-const checkOrganization = (params)=>getAction("/organization/checkIsNameExist",params);
+const queryOrganizationTreeList = (params) => getAction('/organization/getOrganizationTree', params)
+const getAllOrganizationTreeByUser = (params) => getAction('/organization/getAllOrganizationTreeByUser', params)
+const queryOrganizationById = (params) => getAction('/organization/findById', params)
+const checkOrganization = (params) => getAction('/organization/checkIsNameExist', params)
 //经手人管理
-const addPerson = (params)=>postAction("/person/add",params);
-const editPerson = (params)=>putAction("/person/update",params);
-const checkPerson = (params)=>getAction("/person/checkIsNameExist",params);
-const getPersonByType = (params)=>getAction("/person/getPersonByType",params);
-const getPersonByNumType = (params)=>getAction("/person/getPersonByNumType",params);
+const addPerson = (params) => postAction('/person/add', params)
+const editPerson = (params) => putAction('/person/update', params)
+const checkPerson = (params) => getAction('/person/checkIsNameExist', params)
+const getPersonByType = (params) => getAction('/person/getPersonByType', params)
+const getPersonByNumType = (params) => getAction('/person/getPersonByNumType', params)
 //账户管理
-const addAccount = (params)=>postAction("/account/add",params);
-const editAccount = (params)=>putAction("/account/update",params);
-const checkAccount = (params)=>getAction("/account/checkIsNameExist",params);
-const getAccount = (params)=>getAction("/account/getAccount",params);
+const addAccount = (params) => postAction('/account/add', params)
+const editAccount = (params) => putAction('/account/update', params)
+const checkAccount = (params) => getAction('/account/checkIsNameExist', params)
+const getAccount = (params) => getAction('/account/getAccount', params)
 //收支项目
-const addInOutItem = (params)=>postAction("/inOutItem/add",params);
-const editInOutItem = (params)=>putAction("/inOutItem/update",params);
-const checkInOutItem = (params)=>getAction("/inOutItem/checkIsNameExist",params);
-const findInOutItemByParam = (params)=>getAction("/inOutItem/findBySelect",params);
+const addInOutItem = (params) => postAction('/inOutItem/add', params)
+const editInOutItem = (params) => putAction('/inOutItem/update', params)
+const checkInOutItem = (params) => getAction('/inOutItem/checkIsNameExist', params)
+const findInOutItemByParam = (params) => getAction('/inOutItem/findBySelect', params)
 //仓库信息
-const addDepot = (params)=>postAction("/depot/add",params);
-const editDepot = (params)=>putAction("/depot/update",params);
-const checkDepot = (params)=>getAction("/depot/checkIsNameExist",params);
+const addDepot = (params) => postAction('/depot/add', params)
+const editDepot = (params) => putAction('/depot/update', params)
+const checkDepot = (params) => getAction('/depot/checkIsNameExist', params)
 //商品属性
-const editMaterialProperty = (params)=>putAction("/materialProperty/update",params);
+const editMaterialProperty = (params) => putAction('/materialProperty/update', params)
 //商品类型
-const queryMaterialCategoryTreeList = (params)=>getAction("/materialCategory/getMaterialCategoryTree",params);
-const queryMaterialCategoryById = (params)=>getAction("/materialCategory/findById",params);
-const checkMaterialCategory = (params)=>getAction("/materialCategory/checkIsNameExist",params);
+const queryMaterialCategoryTreeList = (params) => getAction('/materialCategory/getMaterialCategoryTree', params)
+const queryMaterialCategoryById = (params) => getAction('/materialCategory/findById', params)
+const checkMaterialCategory = (params) => getAction('/materialCategory/checkIsNameExist', params)
 //商品管理
-const addMaterial = (params)=>postAction("/material/add",params);
-const editMaterial = (params)=>putAction("/material/update",params);
-const checkMaterial = (params)=>getAction("/material/checkIsExist",params);
-const getMaterialBySelect = (params)=>getAction("/material/findBySelect",params);
-const getSerialMaterialBySelect = (params)=>getAction("/material/getMaterialEnableSerialNumberList",params);
-const getMaterialByParam = (params)=>getAction("/material/getMaterialByParam",params);
-const getMaterialByBarCode = (params)=>getAction("/material/getMaterialByBarCode",params);
-const getMaxBarCode = (params)=>getAction("/material/getMaxBarCode",params);
-const checkMaterialBarCode = (params)=>getAction("/materialsExtend/checkIsBarCodeExist",params);
-const batchUpdateMaterial = (params)=>postAction("/material/batchUpdate",params);
-const changeNameToPinYin = (params)=>postAction("/material/changeNameToPinYin",params);
+const addMaterial = (params) => postAction('/material/add', params)
+const editMaterial = (params) => putAction('/material/update', params)
+const checkMaterial = (params) => getAction('/material/checkIsExist', params)
+const getMaterialBySelect = (params) => getAction('/material/findBySelect', params)
+const getSerialMaterialBySelect = (params) => getAction('/material/getMaterialEnableSerialNumberList', params)
+const getMaterialByParam = (params) => getAction('/material/getMaterialByParam', params)
+const getMaterialByBarCode = (params) => getAction('/material/getMaterialByBarCode', params)
+const getMaxBarCode = (params) => getAction('/material/getMaxBarCode', params)
+const checkMaterialBarCode = (params) => getAction('/materialsExtend/checkIsBarCodeExist', params)
+const batchUpdateMaterial = (params) => postAction('/material/batchUpdate', params)
+const changeNameToPinYin = (params) => postAction('/material/changeNameToPinYin', params)
 //序列号
-const batAddSerialNumber = (params)=>postAction("/serialNumber/batAddSerialNumber",params);
-const getEnableSerialNumberList = (params)=>getAction("/serialNumber/getEnableSerialNumberList",params);
+const batAddSerialNumber = (params) => postAction('/serialNumber/batAddSerialNumber', params)
+const getEnableSerialNumberList = (params) => getAction('/serialNumber/getEnableSerialNumberList', params)
 //多属性
-const addMaterialAttribute = (params)=>postAction("/materialAttribute/add",params);
-const editMaterialAttribute = (params)=>putAction("/materialAttribute/update",params);
-const checkMaterialAttribute = (params)=>getAction("/materialAttribute/checkIsNameExist",params);
-const getMaterialAttributeNameList = (params)=>getAction("/materialAttribute/getNameList",params);
-const getMaterialAttributeValueListById = (params)=>getAction("/materialAttribute/getValueListById",params);
+const addMaterialAttribute = (params) => postAction('/materialAttribute/add', params)
+const editMaterialAttribute = (params) => putAction('/materialAttribute/update', params)
+const checkMaterialAttribute = (params) => getAction('/materialAttribute/checkIsNameExist', params)
+const getMaterialAttributeNameList = (params) => getAction('/materialAttribute/getNameList', params)
+const getMaterialAttributeValueListById = (params) => getAction('/materialAttribute/getValueListById', params)
 //功能管理
-const addFunction = (params)=>postAction("/function/add",params);
-const editFunction = (params)=>putAction("/function/update",params);
-const checkFunction = (params)=>getAction("/function/checkIsNameExist",params);
-const checkNumber = (params)=>getAction("/function/checkIsNumberExist",params);
+const addFunction = (params) => postAction('/function/add', params)
+const editFunction = (params) => putAction('/function/update', params)
+const checkFunction = (params) => getAction('/function/checkIsNameExist', params)
+const checkNumber = (params) => getAction('/function/checkIsNumberExist', params)
 //系统配置
-const addSystemConfig = (params)=>postAction("/systemConfig/add",params);
-const editSystemConfig = (params)=>putAction("/systemConfig/update",params);
-const checkSystemConfig = (params)=>getAction("/systemConfig/checkIsNameExist",params);
-const getCurrentSystemConfig = (params)=>getAction("/systemConfig/getCurrentInfo",params);
-const fileSizeLimit = (params)=>getAction("/systemConfig/fileSizeLimit",params);
+const addSystemConfig = (params) => postAction('/systemConfig/add', params)
+const editSystemConfig = (params) => putAction('/systemConfig/update', params)
+const checkSystemConfig = (params) => getAction('/systemConfig/checkIsNameExist', params)
+const getCurrentSystemConfig = (params) => getAction('/systemConfig/getCurrentInfo', params)
+const fileSizeLimit = (params) => getAction('/systemConfig/fileSizeLimit', params)
 //平台参数
-const addPlatformConfig = (params)=>postAction("/platformConfig/add",params);
-const editPlatformConfig = (params)=>putAction("/platformConfig/update",params);
-const getPlatformConfigByKey = (params)=>getAction("/platformConfig/getInfoByKey",params);
+const addPlatformConfig = (params) => postAction('/platformConfig/add', params)
+const editPlatformConfig = (params) => putAction('/platformConfig/update', params)
+const getPlatformConfigByKey = (params) => getAction('/platformConfig/getInfoByKey', params)
 //用户|角色|模块关系
-const addUserBusiness = (params)=>postAction("/userBusiness/add",params);
-const editUserBusiness = (params)=>putAction("/userBusiness/update",params);
-const checkUserBusiness = (params)=>getAction("/userBusiness/checkIsValueExist",params);
-const updateBtnStrByRoleId = (params)=>postAction("/userBusiness/updateBtnStr",params);
+const addUserBusiness = (params) => postAction('/userBusiness/add', params)
+const editUserBusiness = (params) => putAction('/userBusiness/update', params)
+const checkUserBusiness = (params) => getAction('/userBusiness/checkIsValueExist', params)
+const updateBtnStrByRoleId = (params) => postAction('/userBusiness/updateBtnStr', params)
 //多单位
-const addUnit = (params)=>postAction("/unit/add",params);
-const editUnit = (params)=>putAction("/unit/update",params);
-const checkUnit = (params)=>getAction("/unit/checkIsNameExist",params);
+const addUnit = (params) => postAction('/unit/add', params)
+const editUnit = (params) => putAction('/unit/update', params)
+const checkUnit = (params) => getAction('/unit/checkIsNameExist', params)
 //供应商|客户|会员
-const addSupplier = (params)=>postAction("/supplier/add",params);
-const editSupplier = (params)=>putAction("/supplier/update",params);
-const checkSupplier = (params)=>getAction("/supplier/checkIsNameAndTypeExist",params);
-const findBySelectSup = (params)=>postAction("/supplier/findBySelect_sup",params);
-const findBySelectCus = (params)=>postAction("/supplier/findBySelect_cus",params);
-const findBySelectRetail = (params)=>postAction("/supplier/findBySelect_retail",params);
-const findBySelectOrgan = (params)=>postAction("/supplier/findBySelect_organ",params);
+const addSupplier = (params) => postAction('/supplier/add', params)
+const editSupplier = (params) => putAction('/supplier/update', params)
+const checkSupplier = (params) => getAction('/supplier/checkIsNameAndTypeExist', params)
+const findBySelectSup = (params) => postAction('/supplier/findBySelect_sup', params)
+const findBySelectCus = (params) => postAction('/supplier/findBySelect_cus', params)
+const findBySelectRetail = (params) => postAction('/supplier/findBySelect_retail', params)
+const findBySelectOrgan = (params) => postAction('/supplier/findBySelect_organ', params)
 //单据相关
-const findBillDetailByNumber = (params)=>getAction("/depotHead/getDetailByNumber",params);
-const waitBillCount = (params)=>getAction("/depotHead/waitBillCount",params);
-const batchAddDepotHeadAndDetail = (params)=>postAction("/depotHead/batchAddDepotHeadAndDetail",params);
-const findStockByDepotAndBarCode = (params)=>getAction("/depotItem/findStockByDepotAndBarCode",params);
-const getBatchNumberList = (params)=>getAction("/depotItem/getBatchNumberList",params);
-const findFinancialDetailByNumber = (params)=>getAction("/accountHead/getDetailByNumber",params);
+const findBillDetailByNumber = (params) => getAction('/depotHead/getDetailByNumber', params)
+const waitBillCount = (params) => getAction('/depotHead/waitBillCount', params)
+const batchAddDepotHeadAndDetail = (params) => postAction('/depotHead/batchAddDepotHeadAndDetail', params)
+const findStockByDepotAndBarCode = (params) => getAction('/depotItem/findStockByDepotAndBarCode', params)
+const getBatchNumberList = (params) => getAction('/depotItem/getBatchNumberList', params)
+const findFinancialDetailByNumber = (params) => getAction('/accountHead/getDetailByNumber', params)
 
 export {
   getBuyAndSaleStatistics,
@@ -202,8 +202,5 @@ export {
   batchAddDepotHeadAndDetail,
   findStockByDepotAndBarCode,
   getBatchNumberList,
-  findFinancialDetailByNumber
+  findFinancialDetailByNumber,
 }
-
-
-

+ 8 - 8
jshERP-web/src/api/index.js

@@ -1,10 +1,10 @@
 const api = {
-    Login: '/user/login',
-    Logout: '/sys/logout',
-    ForgePassword: '/auth/forge-password',
-    Register: '/auth/register',
-    SendSms: '/account/sms',
-    // get my info
-    UserInfo: '/user/info'
+  Login: '/user/login',
+  Logout: '/sys/logout',
+  ForgePassword: '/auth/forge-password',
+  Register: '/auth/register',
+  SendSms: '/account/sms',
+  // get my info
+  UserInfo: '/user/info',
 }
-export default api
+export default api

+ 3 - 3
jshERP-web/src/api/login.js

@@ -16,13 +16,13 @@ export function login(parameter) {
   return axios({
     url: '/user/login',
     method: 'post',
-    data: parameter
+    data: parameter,
   })
 }
 
 export function logout() {
   return axios({
     url: '/user/logout',
-    method: 'get'
+    method: 'get',
   })
-}
+}

+ 33 - 33
jshERP-web/src/api/manage.js

@@ -7,53 +7,53 @@ const api = {
   service: '/api/service',
   permission: '/api/permission',
   permissionNoPager: '/api/permission/no-pager',
-  exportExcelByParam: '/systemConfig/exportExcelByParam'
+  exportExcelByParam: '/systemConfig/exportExcelByParam',
 }
 
 export default api
 
 //post
-export function postAction(url,parameter) {
+export function postAction(url, parameter) {
   return axios({
     url: url,
-    method:'post' ,
-    data: parameter
+    method: 'post',
+    data: parameter,
   })
 }
 
 //post method= {post | put}
-export function httpAction(url,parameter,method) {
+export function httpAction(url, parameter, method) {
   return axios({
     url: url,
-    method:method ,
-    data: parameter
+    method: method,
+    data: parameter,
   })
 }
 
 //put
-export function putAction(url,parameter) {
+export function putAction(url, parameter) {
   return axios({
     url: url,
-    method:'put',
-    data: parameter
+    method: 'put',
+    data: parameter,
   })
 }
 
 //get
-export function getAction(url,parameter) {
+export function getAction(url, parameter) {
   return axios({
     url: url,
     method: 'get',
-    params: parameter
+    params: parameter,
   })
 }
 
 //deleteAction
-export function deleteAction(url,parameter) {
+export function deleteAction(url, parameter) {
   return axios({
     url: url,
     method: 'delete',
-    params: parameter
+    params: parameter,
   })
 }
 
@@ -61,7 +61,7 @@ export function getUserList(parameter) {
   return axios({
     url: api.user,
     method: 'get',
-    params: parameter
+    params: parameter,
   })
 }
 
@@ -69,7 +69,7 @@ export function getRoleList(parameter) {
   return axios({
     url: api.role,
     method: 'get',
-    params: parameter
+    params: parameter,
   })
 }
 
@@ -77,7 +77,7 @@ export function getServiceList(parameter) {
   return axios({
     url: api.service,
     method: 'get',
-    params: parameter
+    params: parameter,
   })
 }
 
@@ -85,7 +85,7 @@ export function getPermissions(parameter) {
   return axios({
     url: api.permissionNoPager,
     method: 'get',
-    params: parameter
+    params: parameter,
   })
 }
 
@@ -95,7 +95,7 @@ export function saveService(parameter) {
   return axios({
     url: api.service,
     method: parameter.id == 0 ? 'post' : 'put',
-    data: parameter
+    data: parameter,
   })
 }
 
@@ -105,12 +105,12 @@ export function saveService(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function downFile(url,parameter){
+export function downFile(url, parameter) {
   return axios({
     url: url,
     params: parameter,
     method: 'get',
-    responseType: 'blob'
+    responseType: 'blob',
   })
 }
 
@@ -120,12 +120,12 @@ export function downFile(url,parameter){
  * @param parameter
  * @returns {*}
  */
-export function downFilePost(parameter){
+export function downFilePost(parameter) {
   return axios({
     url: api.exportExcelByParam,
     data: parameter,
     method: 'post',
-    responseType: 'blob'
+    responseType: 'blob',
   })
 }
 
@@ -135,13 +135,13 @@ export function downFilePost(parameter){
  * @param parameter
  * @returns {*}
  */
-export function uploadAction(url,parameter){
+export function uploadAction(url, parameter) {
   return axios({
     url: url,
     data: parameter,
-    method:'post' ,
+    method: 'post',
     headers: {
-      'Content-Type': 'multipart/form-data',  // 文件上传
+      'Content-Type': 'multipart/form-data', // 文件上传
     },
   })
 }
@@ -152,13 +152,13 @@ export function uploadAction(url,parameter){
  * @param subStr
  * @returns {*}
  */
-export function getFileAccessHttpUrl(avatar,subStr) {
-  if(!subStr) subStr = 'http'
-  if(avatar && avatar.startsWith(subStr)){
-    return avatar;
-  }else{
-    if(avatar && avatar.length>0 && avatar.indexOf('[')==-1){
-      return window._CONFIG['domianURL'] + "/" + avatar;
+export function getFileAccessHttpUrl(avatar, subStr) {
+  if (!subStr) subStr = 'http'
+  if (avatar && avatar.startsWith(subStr)) {
+    return avatar
+  } else {
+    if (avatar && avatar.length > 0 && avatar.indexOf('[') == -1) {
+      return window._CONFIG['domianURL'] + '/' + avatar
     }
   }
 }

+ 3 - 0
jshERP-web/src/assets/input.css

@@ -0,0 +1,3 @@
+@tailwind base;
+@tailwind components;
+@tailwind utilities;

+ 4 - 5
jshERP-web/src/assets/less/JAreaLinkage.less

@@ -48,7 +48,6 @@
   outline: 0;
 }
 
-
 .area-select:active {
   box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
 }
@@ -96,12 +95,12 @@
   top: 50%;
   margin-top: -2px;
   right: 6px;
-  content: "";
+  content: '';
   width: 0;
   height: 0;
   border: 6px solid transparent;
   border-top-color: rgba(0, 0, 0, 0.25);
-  transition: all .3s linear;
+  transition: all 0.3s linear;
   transform-origin: center;
 }
 
@@ -223,7 +222,7 @@
   top: 50%;
   margin-top: -4px;
   right: 5px;
-  content: "";
+  content: '';
   width: 0;
   height: 0;
   border: 4px solid transparent;
@@ -256,4 +255,4 @@
 .cascader-menu-list::-webkit-scrollbar-thumb:vertical:hover,
 .area-selectable-list-wrap::-webkit-scrollbar-thumb:vertical:hover {
   background-color: #777;
-}
+}

+ 2 - 1
jshERP-web/src/assets/less/TableExpand.less

@@ -1,6 +1,7 @@
 /** [表格主题样式一] 表格强制列不换行 */
 .j-table-force-nowrap {
-  td, th {
+  td,
+  th {
     white-space: nowrap;
   }
 

+ 20 - 11
jshERP-web/src/assets/less/common.less

@@ -23,33 +23,33 @@
 }
 /*列表页面弹出modal*/
 .ant-modal-cust-warp {
-  height: 100%
+  height: 100%;
 }
 /*弹出modal Y轴滚动条*/
 .ant-modal-cust-warp .ant-modal-body {
   padding: 24px 24px 12px 24px;
   height: calc(100% - 110px) !important;
-  overflow-y: auto
+  overflow-y: auto;
 }
 /*弹出modal 先有content后有body 故滚动条控制在body上*/
 .ant-modal-cust-warp .ant-modal-content {
   height: 90%;
-  overflow-y: hidden
+  overflow-y: hidden;
 }
 /*文本框样式*/
 .ant-modal-cust-warp .ant-form-item {
   margin-bottom: 12px;
 }
 /*全屏模式*/
-.ant-modal-cust-warp .fullscreen >.ant-modal-content {
+.ant-modal-cust-warp .fullscreen > .ant-modal-content {
   height: 100vh;
   border-radius: 0;
 }
 /*全屏模式*/
-.ant-modal-cust-warp .fullscreen >.ant-modal-content >.ant-modal-body {
+.ant-modal-cust-warp .fullscreen > .ant-modal-content > .ant-modal-body {
   padding: 24px 24px 12px 24px;
   height: calc(100% - 200px) !important;
-  overflow-y: auto
+  overflow-y: auto;
 }
 /*列表中有图片的加这个样式 参考用户管理*/
 .anty-img-wrap {
@@ -60,13 +60,22 @@
   max-height: 100%;
 }
 /*列表中范围查询样式*/
-.query-group-cust{width: calc(50% - 10px)}
-.query-group-split-cust:before{content:"~";width: 20px;display: inline-block;text-align: center}
+.query-group-cust {
+  width: calc(50% - 10px);
+}
+.query-group-split-cust:before {
+  content: '~';
+  width: 20px;
+  display: inline-block;
+  text-align: center;
+}
 /*erp风格子表外框padding设置*/
-.ant-card-wider-padding.cust-erp-sub-tab>.ant-card-body{padding:5px 12px}
+.ant-card-wider-padding.cust-erp-sub-tab > .ant-card-body {
+  padding: 5px 12px;
+}
 /* 内嵌子表背景颜色 */
 .j-inner-table-wrapper /deep/ .ant-table-expanded-row .ant-table-wrapper .ant-table-tbody .ant-table-row {
-  background-color: #FFFFFF;
+  background-color: #ffffff;
 }
 
 .ant-modal-mask {
@@ -87,4 +96,4 @@
 }
 .resize-table-th {
   position: relative;
-}
+}

+ 6 - 6
jshERP-web/src/assets/less/index.less

@@ -1,14 +1,14 @@
 /**
  * 列表查询通用样式,移动端自适应
  */
-.search{
+.search {
   margin-bottom: 54px;
 }
-.fold{
+.fold {
   width: calc(100% - 216px);
-  display: inline-block
+  display: inline-block;
 }
-.operator{
+.operator {
   margin-bottom: 18px;
 }
 @media screen and (max-width: 900px) {
@@ -22,7 +22,7 @@
 i {
   cursor: pointer;
 }
-.trcolor{
+.trcolor {
   background-color: rgba(255, 192, 203, 0.31);
-  color:red;
+  color: red;
 }

+ 32 - 32
jshERP-web/src/components/AvatarList/Item.vue

@@ -7,40 +7,40 @@
 </template>
 
 <script>
-  import Avatar from 'ant-design-vue/es/avatar'
-  import Tooltip from 'ant-design-vue/es/tooltip'
+import Avatar from 'ant-design-vue/es/avatar'
+import Tooltip from 'ant-design-vue/es/tooltip'
 
-  export default {
-    name: "AvatarItem",
-    components: {
-      Avatar,
-      Tooltip
+export default {
+  name: 'AvatarItem',
+  components: {
+    Avatar,
+    Tooltip,
+  },
+  props: {
+    tips: {
+      type: String,
+      default: '',
+      required: false,
     },
-    props: {
-      tips: {
-        type: String,
-        default: '',
-        required: false
-      },
-      src: {
-        type: String,
-        default: ''
-      }
+    src: {
+      type: String,
+      default: '',
     },
-    data () {
-      return {
-        size: this.$parent.size
-      }
+  },
+  data() {
+    return {
+      size: this.$parent.size,
+    }
+  },
+  computed: {
+    avatarSize() {
+      return (this.size !== 'mini' && this.size) || 20
     },
-    computed: {
-      avatarSize () {
-        return this.size !== 'mini' && this.size || 20
-      }
+  },
+  watch: {
+    '$parent.size'(val) {
+      this.size = val
     },
-    watch: {
-      '$parent.size' (val) {
-        this.size = val
-      }
-    }
-  }
-</script>
+  },
+}
+</script>

+ 60 - 62
jshERP-web/src/components/AvatarList/List.vue

@@ -17,75 +17,73 @@
 -->
 
 <script>
-  import Avatar from 'ant-design-vue/es/avatar'
-  import AvatarItem from './Item'
+import Avatar from 'ant-design-vue/es/avatar'
+import AvatarItem from './Item'
 
-  export default {
+export default {
+  AvatarItem,
+  name: 'AvatarList',
+  components: {
+    Avatar,
     AvatarItem,
-    name: "AvatarList",
-    components: {
-      Avatar,
-      AvatarItem
+  },
+  props: {
+    prefixCls: {
+      type: String,
+      default: 'ant-pro-avatar-list',
     },
-    props: {
-      prefixCls: {
-        type: String,
-        default: 'ant-pro-avatar-list'
-      },
-      /**
-       * 头像大小 类型: large、small 、mini, default
-       * 默认值: default
-       */
-      size: {
-        type: [String, Number],
-        default: 'default'
-      },
-      /**
-       * 要显示的最大项目
-       */
-      maxLength: {
-        type: Number,
-        default: 0
-      },
-      /**
-       * 多余的项目风格
-       */
-      excessItemsStyle: {
-        type: Object,
-        default: () => {
-          return {
-            color: '#f56a00',
-            backgroundColor: '#fde3cf'
-          }
-        }
-      }
+    /**
+     * 头像大小 类型: large、small 、mini, default
+     * 默认值: default
+     */
+    size: {
+      type: [String, Number],
+      default: 'default',
     },
-    data () {
-      return {}
+    /**
+     * 要显示的最大项目
+     */
+    maxLength: {
+      type: Number,
+      default: 0,
     },
-    methods: {
-      getItems(items) {
-        const classString = {
-          [`${this.prefixCls}-item`]: true,
-          [`${this.size}`]: true
-        }
-
-        if (this.maxLength > 0) {
-          items = items.slice(0, this.maxLength)
-          items.push((<Avatar size={ this.size } style={ this.excessItemsStyle }>{`+${this.maxLength}`}</Avatar>))
+    /**
+     * 多余的项目风格
+     */
+    excessItemsStyle: {
+      type: Object,
+      default: () => {
+        return {
+          color: '#f56a00',
+          backgroundColor: '#fde3cf',
         }
-        const itemList = items.map((item) => (
-          <li class={ classString }>{ item }</li>
-        ))
-        return itemList
-      }
+      },
     },
-    render () {
-      const { prefixCls, size } = this.$props
+  },
+  data() {
+    return {}
+  },
+  methods: {
+    getItems(items) {
       const classString = {
-        [`${prefixCls}`]: true,
-        [`${size}`]: true,
+        [`${this.prefixCls}-item`]: true,
+        [`${this.size}`]: true,
       }
+
+      if (this.maxLength > 0) {
+        items = items.slice(0, this.maxLength)
+        items.push(<Avatar size={this.size} style={this.excessItemsStyle}>{`+${this.maxLength}`}</Avatar>)
+      }
+      const itemList = items.map((item) => <li class={classString}>{item}</li>)
+      return itemList
+    },
+  },
+  render() {
+    const { prefixCls, size } = this.$props
+    const classString = {
+      [`${prefixCls}`]: true,
+      [`${size}`]: true,
     }
-  }
-</script>
+  },
+}
+</script>

+ 2 - 2
jshERP-web/src/components/AvatarList/index.js

@@ -1,4 +1,4 @@
 import AvatarList from './List'
-import "./index.less"
+import './index.less'
 
-export default AvatarList
+export default AvatarList

+ 3 - 4
jshERP-web/src/components/AvatarList/index.less

@@ -1,7 +1,7 @@
-@import "../index";
+@import '../index';
 
-@avatar-list-prefix-cls: ~"@{ant-pro-prefix}-avatar-list";
-@avatar-list-item-prefix-cls: ~"@{ant-pro-prefix}-avatar-list-item";
+@avatar-list-prefix-cls: ~'@{ant-pro-prefix}-avatar-list';
+@avatar-list-item-prefix-cls: ~'@{ant-pro-prefix}-avatar-list-item';
 
 .@{avatar-list-prefix-cls} {
   display: inline-block;
@@ -57,4 +57,3 @@
     }
   }
 }
-

+ 70 - 70
jshERP-web/src/components/ChartCard.vue

@@ -17,89 +17,89 @@
 </template>
 
 <script>
-  export default {
-    name: "ChartCard",
-    props: {
-      title: {
-        type: String,
-        default: ''
-      },
-      total: {
-        type: String,
-        default: ''
-      },
-      loading: {
-        type: Boolean,
-        default: false
-      }
-    }
-  }
+export default {
+  name: 'ChartCard',
+  props: {
+    title: {
+      type: String,
+      default: '',
+    },
+    total: {
+      type: String,
+      default: '',
+    },
+    loading: {
+      type: Boolean,
+      default: false,
+    },
+  },
+}
 </script>
 
 <style lang="less" scoped>
-  .chart-card-header {
+.chart-card-header {
+  position: relative;
+  overflow: hidden;
+  width: 100%;
+
+  .meta {
     position: relative;
     overflow: hidden;
     width: 100%;
-
-    .meta {
-      position: relative;
-      overflow: hidden;
-      width: 100%;
-      color: rgba(0, 0, 0, .45);
-      font-size: 14px;
-      line-height: 22px;
-    }
+    color: rgba(0, 0, 0, 0.45);
+    font-size: 14px;
+    line-height: 22px;
   }
+}
 
-  .chart-card-action {
-    cursor: pointer;
-    position: absolute;
-    top: 0;
-    right: 0;
-  }
+.chart-card-action {
+  cursor: pointer;
+  position: absolute;
+  top: 0;
+  right: 0;
+}
 
-  .chart-card-footer {
-    border-top: 1px solid #e8e8e8;
-    padding-top: 9px;
-    margin-top: 8px;
+.chart-card-footer {
+  border-top: 1px solid #e8e8e8;
+  padding-top: 9px;
+  margin-top: 8px;
 
-    > * {
-      position: relative;
-    }
-
-    .field {
-      white-space: nowrap;
-      overflow: hidden;
-      text-overflow: ellipsis;
-      margin: 0;
-    }
-  }
-
-  .chart-card-content {
-    margin-bottom: 12px;
+  > * {
     position: relative;
-    height: 46px;
-    width: 100%;
-
-    .content-fix {
-      position: absolute;
-      left: 0;
-      bottom: 0;
-      width: 100%;
-    }
   }
 
-  .total {
+  .field {
+    white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
-    word-break: break-all;
-    white-space: nowrap;
-    color: #000;
-    margin-top: 4px;
-    margin-bottom: 0;
-    font-size: 30px;
-    line-height: 38px;
-    height: 38px;
+    margin: 0;
   }
-</style>
+}
+
+.chart-card-content {
+  margin-bottom: 12px;
+  position: relative;
+  height: 46px;
+  width: 100%;
+
+  .content-fix {
+    position: absolute;
+    left: 0;
+    bottom: 0;
+    width: 100%;
+  }
+}
+
+.total {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  word-break: break-all;
+  white-space: nowrap;
+  color: #000;
+  margin-top: 4px;
+  margin-bottom: 0;
+  font-size: 30px;
+  line-height: 38px;
+  height: 38px;
+}
+</style>

+ 78 - 82
jshERP-web/src/components/CountDown/CountDown.vue

@@ -5,99 +5,95 @@
 </template>
 
 <script>
+function fixedZero(val) {
+  return val * 1 < 10 ? `0${val}` : val
+}
 
-  function fixedZero(val) {
-    return val * 1 < 10 ? `0${val}` : val;
-  }
-
-  export default {
-    name: "CountDown",
-    props: {
-      format: {
-        type: Function,
-        default: undefined
-      },
-      target: {
-        type: [Date, Number],
-        required: true,
-      },
-      onEnd: {
-        type: Function,
-        default: () => {
-        }
-      }
+export default {
+  name: 'CountDown',
+  props: {
+    format: {
+      type: Function,
+      default: undefined,
     },
-    data() {
-      return {
-        dateTime: '0',
-        originTargetTime: 0,
-        lastTime: 0,
-        timer: 0,
-        interval: 1000
-      }
+    target: {
+      type: [Date, Number],
+      required: true,
     },
-    filters: {
-      format(time) {
-        const hours = 60 * 60 * 1000;
-        const minutes = 60 * 1000;
-
-        const h = Math.floor(time / hours);
-        const m = Math.floor((time - h * hours) / minutes);
-        const s = Math.floor((time - h * hours - m * minutes) / 1000);
-        return `${fixedZero(h)}:${fixedZero(m)}:${fixedZero(s)}`
-      }
+    onEnd: {
+      type: Function,
+      default: () => {},
     },
-    created() {
-      this.initTime()
-      this.tick()
+  },
+  data() {
+    return {
+      dateTime: '0',
+      originTargetTime: 0,
+      lastTime: 0,
+      timer: 0,
+      interval: 1000,
+    }
+  },
+  filters: {
+    format(time) {
+      const hours = 60 * 60 * 1000
+      const minutes = 60 * 1000
+
+      const h = Math.floor(time / hours)
+      const m = Math.floor((time - h * hours) / minutes)
+      const s = Math.floor((time - h * hours - m * minutes) / 1000)
+      return `${fixedZero(h)}:${fixedZero(m)}:${fixedZero(s)}`
     },
-    methods: {
-      initTime() {
-        let lastTime = 0;
-        let targetTime = 0;
-        this.originTargetTime = this.target
-        try {
-          if (Object.prototype.toString.call(this.target) === '[object Date]') {
-            targetTime = this.target
-          } else {
-            targetTime = new Date(this.target).getTime()
-          }
-        } catch (e) {
-          throw new Error('invalid target prop')
+  },
+  created() {
+    this.initTime()
+    this.tick()
+  },
+  methods: {
+    initTime() {
+      let lastTime = 0
+      let targetTime = 0
+      this.originTargetTime = this.target
+      try {
+        if (Object.prototype.toString.call(this.target) === '[object Date]') {
+          targetTime = this.target
+        } else {
+          targetTime = new Date(this.target).getTime()
         }
+      } catch (e) {
+        throw new Error('invalid target prop')
+      }
 
-        lastTime = targetTime - new Date().getTime();
+      lastTime = targetTime - new Date().getTime()
 
-        this.lastTime = lastTime < 0 ? 0 : lastTime
-      },
-      tick() {
-        const {onEnd} = this
+      this.lastTime = lastTime < 0 ? 0 : lastTime
+    },
+    tick() {
+      const { onEnd } = this
 
-        this.timer = setTimeout(() => {
-          if (this.lastTime < this.interval) {
-            clearTimeout(this.timer)
-            this.lastTime = 0
-            if (typeof onEnd === 'function') {
-              onEnd();
-            }
-          } else {
-            this.lastTime -= this.interval
-            this.tick()
+      this.timer = setTimeout(() => {
+        if (this.lastTime < this.interval) {
+          clearTimeout(this.timer)
+          this.lastTime = 0
+          if (typeof onEnd === 'function') {
+            onEnd()
           }
-        }, this.interval)
-      }
-    },
-    beforeUpdate () {
-      if (this.originTargetTime !== this.target) {
-        this.initTime()
-      }
+        } else {
+          this.lastTime -= this.interval
+          this.tick()
+        }
+      }, this.interval)
     },
-    beforeDestroy() {
-      clearTimeout(this.timer)
+  },
+  beforeUpdate() {
+    if (this.originTargetTime !== this.target) {
+      this.initTime()
     }
-  }
+  },
+  beforeDestroy() {
+    clearTimeout(this.timer)
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 1 - 1
jshERP-web/src/components/CountDown/index.js

@@ -1,3 +1,3 @@
 import CountDown from './CountDown'
 
-export default CountDown
+export default CountDown

+ 33 - 33
jshERP-web/src/components/Ellipsis/Ellipsis.vue

@@ -1,36 +1,36 @@
 <script>
-  export default {
-    name: 'Ellipsis',
-    props: {
-      prefixCls: {
-        type: String,
-        default: 'ant-pro-ellipsis'
-      },
-      tooltip: {
-        type: Boolean,
-        default: true,
-      },
-      length: {
-        type: Number,
-        default: 25,
-      },
-      lines: {
-        type: Number,
-        default: 1
-      },
-      fullWidthRecognition: {
-        type: Boolean,
-        default: false
-      }
+export default {
+  name: 'Ellipsis',
+  props: {
+    prefixCls: {
+      type: String,
+      default: 'ant-pro-ellipsis',
     },
-    methods: {},
-    render() {
-      const { tooltip, length } = this.$props
-      let text = ''
-      // 处理没有default插槽时的特殊情况
-      if (this.$slots.default) {
-        text = this.$slots.default.map(vNode => vNode.text).join('')
-      }
+    tooltip: {
+      type: Boolean,
+      default: true,
+    },
+    length: {
+      type: Number,
+      default: 25,
+    },
+    lines: {
+      type: Number,
+      default: 1,
+    },
+    fullWidthRecognition: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  methods: {},
+  render() {
+    const { tooltip, length } = this.$props
+    let text = ''
+    // 处理没有default插槽时的特殊情况
+    if (this.$slots.default) {
+      text = this.$slots.default.map((vNode) => vNode.text).join('')
     }
-  }
-</script>
+  },
+}
+</script>

+ 1 - 1
jshERP-web/src/components/Ellipsis/index.js

@@ -1,3 +1,3 @@
 import Ellipsis from './Ellipsis'
 
-export default Ellipsis
+export default Ellipsis

+ 32 - 32
jshERP-web/src/components/NumberInfo/NumberInfo.vue

@@ -14,41 +14,41 @@
 </template>
 
 <script>
-  import Icon from 'ant-design-vue/es/icon'
+import Icon from 'ant-design-vue/es/icon'
 
-  export default {
-    name: 'NumberInfo',
-    props: {
-      prefixCls: {
-        type: String,
-        default: 'ant-pro-number-info'
-      },
-      total: {
-        type: Number,
-        required: true
-      },
-      subTotal: {
-        type: Number,
-        required: true
-      },
-      subTitle: {
-        type: [String, Function],
-        default: ''
-      },
-      status: {
-        type: String,
-        default: 'up'
-      }
+export default {
+  name: 'NumberInfo',
+  props: {
+    prefixCls: {
+      type: String,
+      default: 'ant-pro-number-info',
     },
-    components: {
-      Icon
+    total: {
+      type: Number,
+      required: true,
     },
-    data () {
-      return {}
-    }
-  }
+    subTotal: {
+      type: Number,
+      required: true,
+    },
+    subTitle: {
+      type: [String, Function],
+      default: '',
+    },
+    status: {
+      type: String,
+      default: 'up',
+    },
+  },
+  components: {
+    Icon,
+  },
+  data() {
+    return {}
+  },
+}
 </script>
 
 <style lang="less" scoped>
-  /*@import "index";*/
-</style>
+/*@import "index";*/
+</style>

+ 1 - 1
jshERP-web/src/components/NumberInfo/index.js

@@ -1,3 +1,3 @@
 import NumberInfo from './NumberInfo'
 
-export default NumberInfo
+export default NumberInfo

+ 3 - 4
jshERP-web/src/components/NumberInfo/index.less

@@ -1,9 +1,8 @@
-@import "../index";
+@import '../index';
 
-@numberInfo-prefix-cls: ~"@{ant-pro-prefix}-number-info";
+@numberInfo-prefix-cls: ~'@{ant-pro-prefix}-number-info';
 
 .@{numberInfo-prefix-cls} {
-
   .ant-pro-number-info-subtitle {
     color: @text-color-secondary;
     font-size: @font-size-base;
@@ -52,4 +51,4 @@
       }
     }
   }
-}
+}

+ 27 - 27
jshERP-web/src/components/Trend/Trend.vue

@@ -1,41 +1,41 @@
 <template>
-  <div :class="[prefixCls, reverseColor && 'reverse-color' ]">
+  <div :class="[prefixCls, reverseColor && 'reverse-color']">
     <span>
       <slot name="term"></slot>
       <span class="item-text">
         <slot></slot>
       </span>
     </span>
-    <span :class="[flag]"><a-icon :type="`caret-${flag}`"/></span>
+    <span :class="[flag]"><a-icon :type="`caret-${flag}`" /></span>
   </div>
 </template>
 
 <script>
-  export default {
-    name: "Trend",
-    props: {
-      prefixCls: {
-        type: String,
-        default: 'ant-pro-trend'
-      },
-      /**
-       * 上升下降标识:up|down
-       */
-      flag: {
-        type: String,
-        required: true
-      },
-      /**
-       * 颜色反转
-       */
-      reverseColor: {
-        type: Boolean,
-        default: false
-      }
-    }
-  }
+export default {
+  name: 'Trend',
+  props: {
+    prefixCls: {
+      type: String,
+      default: 'ant-pro-trend',
+    },
+    /**
+     * 上升下降标识:up|down
+     */
+    flag: {
+      type: String,
+      required: true,
+    },
+    /**
+     * 颜色反转
+     */
+    reverseColor: {
+      type: Boolean,
+      default: false,
+    },
+  },
+}
 </script>
 
 <style lang="less" scoped>
-  @import "index";
-</style>
+@import 'index';
+</style>

+ 1 - 1
jshERP-web/src/components/Trend/index.js

@@ -1,3 +1,3 @@
 import Trend from './Trend.vue'
 
-export default Trend
+export default Trend

+ 4 - 4
jshERP-web/src/components/Trend/index.less

@@ -1,6 +1,6 @@
-@import "../index";
+@import '../index';
 
-@trend-prefix-cls: ~"@{ant-pro-prefix}-trend";
+@trend-prefix-cls: ~'@{ant-pro-prefix}-trend';
 
 .@{trend-prefix-cls} {
   display: inline-block;
@@ -22,7 +22,7 @@
   .item-text {
     display: inline-block;
     margin-left: 8px;
-    color: rgba(0,0,0,.85);
+    color: rgba(0, 0, 0, 0.85);
   }
 
   .up {
@@ -39,4 +39,4 @@
   &.reverse-color .down {
     color: @red-6;
   }
-}
+}

+ 71 - 72
jshERP-web/src/components/chart/AreaChartTy.vue

@@ -3,86 +3,85 @@
     <h4 :style="{ marginBottom: '20px' }">{{ title }}</h4>
 
     <v-chart ref="chart" :forceFit="true" :height="height" :data="dataSource" :scale="scale">
-      <v-tooltip :shared="false"/>
-      <v-axis/>
-      <v-line position="x*y" :size="lineSize" :color="lineColor"/>
-      <v-area position="x*y" :color="color"/>
+      <v-tooltip :shared="false" />
+      <v-axis />
+      <v-line position="x*y" :size="lineSize" :color="lineColor" />
+      <v-area position="x*y" :color="color" />
     </v-chart>
-
   </div>
 </template>
 
 <script>
-  import { triggerWindowResizeEvent } from '@/utils/util'
+import { triggerWindowResizeEvent } from '@/utils/util'
 
-  export default {
-    name: 'AreaChartTy',
-    props: {
-      // 图表数据
-      dataSource: {
-        type: Array,
-        required: true
-      },
-      // 图表标题
-      title: {
-        type: String,
-        default: ''
-      },
-      // x 轴别名
-      x: {
-        type: String,
-        default: 'x'
-      },
-      // y 轴别名
-      y: {
-        type: String,
-        default: 'y'
-      },
-      // Y轴最小值
-      min: {
-        type: Number,
-        default: 0
-      },
-      // Y轴最大值
-      max: {
-        type: Number,
-        default: null
-      },
-      // 图表高度
-      height: {
-        type: Number,
-        default: 254
-      },
-      // 线的粗细
-      lineSize: {
-        type: Number,
-        default: 2
-      },
-      // 面积的颜色
-      color: {
-        type: String,
-        default: ''
-      },
-      // 线的颜色
-      lineColor: {
-        type: String,
-        default: ''
-      }
+export default {
+  name: 'AreaChartTy',
+  props: {
+    // 图表数据
+    dataSource: {
+      type: Array,
+      required: true,
+    },
+    // 图表标题
+    title: {
+      type: String,
+      default: '',
+    },
+    // x 轴别名
+    x: {
+      type: String,
+      default: 'x',
+    },
+    // y 轴别名
+    y: {
+      type: String,
+      default: 'y',
+    },
+    // Y轴最小值
+    min: {
+      type: Number,
+      default: 0,
+    },
+    // Y轴最大值
+    max: {
+      type: Number,
+      default: null,
+    },
+    // 图表高度
+    height: {
+      type: Number,
+      default: 254,
+    },
+    // 线的粗细
+    lineSize: {
+      type: Number,
+      default: 2,
+    },
+    // 面积的颜色
+    color: {
+      type: String,
+      default: '',
+    },
+    // 线的颜色
+    lineColor: {
+      type: String,
+      default: '',
     },
-    computed: {
-      scale() {
-        return [
-          { dataKey: 'x', title: this.x, alias: this.x },
-          { dataKey: 'y', title: this.y, alias: this.y, min: this.min, max: this.max }
-        ]
-      }
+  },
+  computed: {
+    scale() {
+      return [
+        { dataKey: 'x', title: this.x, alias: this.x },
+        { dataKey: 'y', title: this.y, alias: this.y, min: this.min, max: this.max },
+      ]
     },
-    mounted() {
-      triggerWindowResizeEvent()
-    }
-  }
+  },
+  mounted() {
+    triggerWindowResizeEvent()
+  },
+}
 </script>
 
 <style lang="less" scoped>
-  @import "chart";
-</style>
+@import 'chart';
+</style>

+ 43 - 41
jshERP-web/src/components/chart/Bar.vue

@@ -2,54 +2,56 @@
   <div :style="{ padding: '0 0 32px 32px' }">
     <h3 :style="{ marginBottom: '20px' }">{{ title }}</h3>
     <v-chart :forceFit="true" :height="height" :data="dataSource" :scale="scale" :padding="padding">
-      <v-tooltip/>
-      <v-axis/>
-      <v-bar position="x*y" :color="color"/>
+      <v-tooltip />
+      <v-axis />
+      <v-bar position="x*y" :color="color" />
     </v-chart>
   </div>
 </template>
 
 <script>
-  import { triggerWindowResizeEvent } from '@/utils/util'
-  import { DEFAULT_COLOR } from "@/store/mutation-types"
-  import Vue from 'vue'
+import { triggerWindowResizeEvent } from '@/utils/util'
+import { DEFAULT_COLOR } from '@/store/mutation-types'
+import Vue from 'vue'
 
-  export default {
-    name: 'Bar',
-    props: {
-      dataSource: {
-        type: Array,
-        required: true
-      },
-      yaxisText: {
-        type: String,
-        default: 'y'
-      },
-      title: {
-        type: String,
-        default: ''
-      },
-      height: {
-        type: Number,
-        default: 254
-      }
+export default {
+  name: 'Bar',
+  props: {
+    dataSource: {
+      type: Array,
+      required: true,
     },
-    data() {
-      return {
-        padding: ['auto', 'auto', '40', '50'],
-        color: Vue.ls.get(DEFAULT_COLOR)
-      }
+    yaxisText: {
+      type: String,
+      default: 'y',
     },
-    computed: {
-      scale() {
-        return [{
-          dataKey: 'y',
-          alias: this.yaxisText
-        }]
-      }
+    title: {
+      type: String,
+      default: '',
+    },
+    height: {
+      type: Number,
+      default: 254,
     },
-    mounted() {
-      triggerWindowResizeEvent()
+  },
+  data() {
+    return {
+      padding: ['auto', 'auto', '40', '50'],
+      color: Vue.ls.get(DEFAULT_COLOR),
     }
-  }
-</script>
+  },
+  computed: {
+    scale() {
+      return [
+        {
+          dataKey: 'y',
+          alias: this.yaxisText,
+        },
+      ]
+    },
+  },
+  mounted() {
+    triggerWindowResizeEvent()
+  },
+}
+</script>

+ 50 - 47
jshERP-web/src/components/chart/BarAndLine.vue

@@ -1,60 +1,63 @@
 <template>
   <div :style="{ padding: '0 50px 32px 0' }">
     <h4 :style="{ marginBottom: '20px' }">{{ title }}</h4>
-    <v-chart :forceFit="true" :height="height" :data="data" :scale="scale" :padding=" padding" :onClick="handleClick">
-      <v-tooltip/>
-      <v-legend/>
-      <v-axis/>
-      <v-bar position="type*bar"/>
-      <v-line position="type*line" color="#2fc25b" :size="3"/>
+    <v-chart :forceFit="true" :height="height" :data="data" :scale="scale" :padding="padding" :onClick="handleClick">
+      <v-tooltip />
+      <v-legend />
+      <v-axis />
+      <v-bar position="type*bar" />
+      <v-line position="type*line" color="#2fc25b" :size="3" />
     </v-chart>
   </div>
 </template>
 
 <script>
-  import { ChartEventMixins } from './mixins/ChartMixins'
+import { ChartEventMixins } from './mixins/ChartMixins'
 
-  export default {
-    name: 'BarAndLine',
-    mixins: [ChartEventMixins],
-    props: {
-      title: {
-        type: String,
-        default: ''
-      },
-      dataSource: {
-        type: Array,
-        default: () => [
-          { type: '10:10', bar: 200, line: 1000 },
-          { type: '10:15', bar: 600, line: 1000},
-          { type: '10:20', bar: 200, line: 1000},
-          { type: '10:25', bar: 900, line: 1000},
-          { type: '10:30', bar: 200, line: 1000},
-          { type: '10:35', bar: 200, line: 1000},
-          { type: '10:40', bar: 100, line: 1000}
-        ]
-      },
-      height: {
-        type: Number,
-        default: 400
-      }
+export default {
+  name: 'BarAndLine',
+  mixins: [ChartEventMixins],
+  props: {
+    title: {
+      type: String,
+      default: '',
     },
-    data() {
-      return {
-        padding: { top:50, right:50, bottom:100, left:50 },
-        scale: [{
+    dataSource: {
+      type: Array,
+      default: () => [
+        { type: '10:10', bar: 200, line: 1000 },
+        { type: '10:15', bar: 600, line: 1000 },
+        { type: '10:20', bar: 200, line: 1000 },
+        { type: '10:25', bar: 900, line: 1000 },
+        { type: '10:30', bar: 200, line: 1000 },
+        { type: '10:35', bar: 200, line: 1000 },
+        { type: '10:40', bar: 100, line: 1000 },
+      ],
+    },
+    height: {
+      type: Number,
+      default: 400,
+    },
+  },
+  data() {
+    return {
+      padding: { top: 50, right: 50, bottom: 100, left: 50 },
+      scale: [
+        {
           dataKey: 'bar',
-          min: 0
-        }, {
+          min: 0,
+        },
+        {
           dataKey: 'line',
-          min: 0
-        }]
-      }
-    },
-    computed: {
-      data() {
-        return this.dataSource
-      }
+          min: 0,
+        },
+      ],
     }
-  }
-</script>
+  },
+  computed: {
+    data() {
+      return this.dataSource
+    },
+  },
+}
+</script>

+ 92 - 72
jshERP-web/src/components/chart/BarMultid.vue

@@ -2,87 +2,107 @@
   <div :style="{ padding: '0 0 32px 32px' }">
     <h4 :style="{ marginBottom: '20px' }">{{ title }}</h4>
     <v-chart :data="data" :height="height" :force-fit="true" :onClick="handleClick">
-      <v-tooltip/>
-      <v-axis/>
-      <v-legend/>
-      <v-bar position="x*y" color="type" :adjust="adjust"/>
+      <v-tooltip />
+      <v-axis />
+      <v-legend />
+      <v-bar position="x*y" color="type" :adjust="adjust" />
     </v-chart>
   </div>
 </template>
 
 <script>
-  import { DataSet } from '@antv/data-set'
-  import { ChartEventMixins } from './mixins/ChartMixins'
+import { DataSet } from '@antv/data-set'
+import { ChartEventMixins } from './mixins/ChartMixins'
 
-  export default {
-    name: 'BarMultid',
-    mixins: [ChartEventMixins],
-    props: {
-      title: {
-        type: String,
-        default: ''
-      },
-      dataSource: {
-        type: Array,
-        default: () => [
-          { type: 'Jeecg', 'Jan.': 18.9, 'Feb.': 28.8, 'Mar.': 39.3, 'Apr.': 81.4, 'May': 47, 'Jun.': 20.3, 'Jul.': 24, 'Aug.': 35.6 },
-          { type: 'Jeebt', 'Jan.': 12.4, 'Feb.': 23.2, 'Mar.': 34.5, 'Apr.': 99.7, 'May': 52.6, 'Jun.': 35.5, 'Jul.': 37.4, 'Aug.': 42.4 }
-        ]
-      },
-      fields: {
-        type: Array,
-        default: () => ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May', 'Jun.', 'Jul.', 'Aug.']
-      },
-      // 别名,需要的格式:[{field:'name',alias:'姓名'}, {field:'sex',alias:'性别'}]
-      aliases: {
-        type: Array,
-        default: () => []
-      },
-      height: {
-        type: Number,
-        default: 254
-      }
+export default {
+  name: 'BarMultid',
+  mixins: [ChartEventMixins],
+  props: {
+    title: {
+      type: String,
+      default: '',
     },
-    data() {
-      return {
-        adjust: [{
-          type: 'dodge',
-          marginRatio: 1 / 32
-        }]
-      }
+    dataSource: {
+      type: Array,
+      default: () => [
+        {
+          type: 'Jeecg',
+          'Jan.': 18.9,
+          'Feb.': 28.8,
+          'Mar.': 39.3,
+          'Apr.': 81.4,
+          May: 47,
+          'Jun.': 20.3,
+          'Jul.': 24,
+          'Aug.': 35.6,
+        },
+        {
+          type: 'Jeebt',
+          'Jan.': 12.4,
+          'Feb.': 23.2,
+          'Mar.': 34.5,
+          'Apr.': 99.7,
+          May: 52.6,
+          'Jun.': 35.5,
+          'Jul.': 37.4,
+          'Aug.': 42.4,
+        },
+      ],
+    },
+    fields: {
+      type: Array,
+      default: () => ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May', 'Jun.', 'Jul.', 'Aug.'],
     },
-    computed: {
-      data() {
-        const dv = new DataSet.View().source(this.dataSource)
-        dv.transform({
-          type: 'fold',
-          fields: this.fields,
-          key: 'x',
-          value: 'y'
-        })
+    // 别名,需要的格式:[{field:'name',alias:'姓名'}, {field:'sex',alias:'性别'}]
+    aliases: {
+      type: Array,
+      default: () => [],
+    },
+    height: {
+      type: Number,
+      default: 254,
+    },
+  },
+  data() {
+    return {
+      adjust: [
+        {
+          type: 'dodge',
+          marginRatio: 1 / 32,
+        },
+      ],
+    }
+  },
+  computed: {
+    data() {
+      const dv = new DataSet.View().source(this.dataSource)
+      dv.transform({
+        type: 'fold',
+        fields: this.fields,
+        key: 'x',
+        value: 'y',
+      })
 
-        // bar 使用不了 - 和 / 所以替换下
-        let rows = dv.rows.map(row => {
-          if (typeof row.x === 'string') {
-            row.x = row.x.replace(/[-/]/g, '_')
-          }
-          return row
-        })
-        // 替换别名
-        rows.forEach(row => {
-          for (let item of this.aliases) {
-            if (item.field === row.type) {
-              row.type = item.alias
-              break
-            }
+      // bar 使用不了 - 和 / 所以替换下
+      let rows = dv.rows.map((row) => {
+        if (typeof row.x === 'string') {
+          row.x = row.x.replace(/[-/]/g, '_')
+        }
+        return row
+      })
+      // 替换别名
+      rows.forEach((row) => {
+        for (let item of this.aliases) {
+          if (item.field === row.type) {
+            row.type = item.alias
+            break
           }
-        })
-        return rows
-      }
-    }
-  }
+        }
+      })
+      return rows
+    },
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 123 - 137
jshERP-web/src/components/chart/DashChartDemo.vue

@@ -13,13 +13,7 @@
         :grid="null"
       ></v-axis>
       <v-axis dataKey="1" :show="false"></v-axis>
-      <v-series
-        gemo="point"
-        position="value*1"
-        shape="pointer"
-        color="#1890FF"
-        :active="false"
-      ></v-series>
+      <v-series gemo="point" position="value*1" shape="pointer" color="#1890FF" :active="false"></v-series>
       <v-guide
         type="arc"
         :zIndex="0"
@@ -28,160 +22,152 @@
         :end="arcGuide1End"
         :vStyle="arcGuide1Style"
       ></v-guide>
-      <v-guide
-        type="arc"
-        :zIndex="1"
-        :start="arcGuide2Start"
-        :end="getArcGuide2End"
-        :vStyle="arcGuide2Style"
-      ></v-guide>
-      <v-guide
-        type="html"
-        :position="htmlGuidePosition"
-        :html="getHtmlGuideHtml()"
-      ></v-guide>
+      <v-guide type="arc" :zIndex="1" :start="arcGuide2Start" :end="getArcGuide2End" :vStyle="arcGuide2Style"></v-guide>
+      <v-guide type="html" :position="htmlGuidePosition" :html="getHtmlGuideHtml()"></v-guide>
     </v-chart>
   </div>
 </template>
 
 <script>
-  import { registerShape } from 'viser-vue';
+import { registerShape } from 'viser-vue'
 
-  registerShape('point', 'pointer', {
-    draw(cfg, container) {
-      let point = cfg.points[0];
-      point = this.parsePoint(point);
-      const center = this.parsePoint({
-        x: 0,
-        y: 0,
-      });
-      container.addShape('line', {
-        attrs: {
-          x1: center.x,
-          y1: center.y,
-          x2: point.x,
-          y2: point.y + 15,
-          stroke: cfg.color,
-          lineWidth: 5,
-          lineCap: 'round',
-        }
-      });
-      return container.addShape('circle', {
-        attrs: {
-          x: center.x,
-          y: center.y,
-          r: 9.75,
-          stroke: cfg.color,
-          lineWidth: 4.5,
-          fill: '#fff',
-        }
-      });
-    }
-  });
+registerShape('point', 'pointer', {
+  draw(cfg, container) {
+    let point = cfg.points[0]
+    point = this.parsePoint(point)
+    const center = this.parsePoint({
+      x: 0,
+      y: 0,
+    })
+    container.addShape('line', {
+      attrs: {
+        x1: center.x,
+        y1: center.y,
+        x2: point.x,
+        y2: point.y + 15,
+        stroke: cfg.color,
+        lineWidth: 5,
+        lineCap: 'round',
+      },
+    })
+    return container.addShape('circle', {
+      attrs: {
+        x: center.x,
+        y: center.y,
+        r: 9.75,
+        stroke: cfg.color,
+        lineWidth: 4.5,
+        fill: '#fff',
+      },
+    })
+  },
+})
 
-  const scale = [{
+const scale = [
+  {
     dataKey: 'value',
     min: 0,
     max: 9,
     tickInterval: 1,
     nice: false,
-  }];
+  },
+]
 
-  const data = [
-    { value: 7.0 },
-  ];
+const data = [{ value: 7.0 }]
 
-  export default {
-    name:"DashChartDemo",
-    props:{
-      datasource:{
-        type: Number,
-        default:7
-      },
-      title: {
-        type: String,
-        default: ''
-      }
+export default {
+  name: 'DashChartDemo',
+  props: {
+    datasource: {
+      type: Number,
+      default: 7,
     },
-    created(){
-      if(!this.datasource){
-        this.chartData = data;
-      }else{
-        this.chartData = [
-          { value: this.datasource },
-        ];
-      }
+    title: {
+      type: String,
+      default: '',
+    },
+  },
+  created() {
+    if (!this.datasource) {
+      this.chartData = data
+    } else {
+      this.chartData = [{ value: this.datasource }]
+    }
+    this.getChartData()
+  },
+  watch: {
+    datasource: function (val) {
+      this.chartData = [{ value: val }]
       this.getChartData()
     },
-    watch: {
-      'datasource': function (val) {
-        this.chartData = [
-          { value: val},
-        ];
-        this.getChartData();
+  },
+  methods: {
+    getChartData() {
+      if (this.chartData && this.chartData.length > 0) {
+        this.abcd = this.chartData[0].value * 10
+      } else {
+        this.abcd = 70
       }
     },
-    methods:{
-      getChartData(){
-        if(this.chartData && this.chartData.length>0){
-          this.abcd = this.chartData[0].value * 10
-        }else{
-          this.abcd = 70
-        }
-      },
-      getHtmlGuideHtml(){
-        return '<div style="width: 300px;text-align: center;">\n' +
-          '<p style="font-size: 14px;color: #545454;margin: 0;">'+this.title+'</p>\n' +
-          '<p style="font-size: 36px;color: #545454;margin: 0;">'+this.abcd+'%</p>\n' +
-          '</div>'
-      },
-      getArcGuide2End(){
-        return [this.chartData[0].value, 0.945]
-      }
+    getHtmlGuideHtml() {
+      return (
+        '<div style="width: 300px;text-align: center;">\n' +
+        '<p style="font-size: 14px;color: #545454;margin: 0;">' +
+        this.title +
+        '</p>\n' +
+        '<p style="font-size: 36px;color: #545454;margin: 0;">' +
+        this.abcd +
+        '%</p>\n' +
+        '</div>'
+      )
     },
-    data() {
-      return {
-        chartData:[],
-        height: 400,
-        scale: scale,
-        abcd:70,
-        axisLabel: {
-          offset: -16,
-          textStyle: {
-            fontSize: 18,
-            textAlign: 'center',
-            textBaseline: 'middle'
-          }
-        },
-        axisSubTickLine: {
-          length: -8,
-          stroke: '#fff',
-          strokeOpacity: 1,
-        },
-        axisTickLine: {
-          length: -17,
-          stroke: '#fff',
-          strokeOpacity: 1,
-        },
-        arcGuide1Start: [0, 0.945],
-        arcGuide1End: [9, 0.945],
-        arcGuide1Style: {
-          stroke: '#CBCBCB',
-          lineWidth: 18,
-        },
-        arcGuide2Start: [0, 0.945],
-        arcGuide2Style: {
-          stroke: '#1890FF',
-          lineWidth: 18,
+    getArcGuide2End() {
+      return [this.chartData[0].value, 0.945]
+    },
+  },
+  data() {
+    return {
+      chartData: [],
+      height: 400,
+      scale: scale,
+      abcd: 70,
+      axisLabel: {
+        offset: -16,
+        textStyle: {
+          fontSize: 18,
+          textAlign: 'center',
+          textBaseline: 'middle',
         },
-        htmlGuidePosition: ['50%', '100%'],
-        htmlGuideHtml: `
+      },
+      axisSubTickLine: {
+        length: -8,
+        stroke: '#fff',
+        strokeOpacity: 1,
+      },
+      axisTickLine: {
+        length: -17,
+        stroke: '#fff',
+        strokeOpacity: 1,
+      },
+      arcGuide1Start: [0, 0.945],
+      arcGuide1End: [9, 0.945],
+      arcGuide1Style: {
+        stroke: '#CBCBCB',
+        lineWidth: 18,
+      },
+      arcGuide2Start: [0, 0.945],
+      arcGuide2Style: {
+        stroke: '#1890FF',
+        lineWidth: 18,
+      },
+      htmlGuidePosition: ['50%', '100%'],
+      htmlGuideHtml: `
         <div style="width: 300px;text-align: center;">
           <p style="font-size: 14px;color: #545454;margin: 0;">${this.title}</p>
           <p style="font-size: 36px;color: #545454;margin: 0;">${this.abcd}%</p>
         </div>
       `,
-      };
-    },
-  };
+    }
+  },
+}
 </script>

+ 42 - 44
jshERP-web/src/components/chart/IndexBar.vue

@@ -1,61 +1,59 @@
 <template>
   <div :style="{ padding: '0 0 32px 32px' }">
     <h4 :style="{ marginBottom: '20px' }">{{ title }}</h4>
-    <v-chart
-      height="254"
-      :data="datasource"
-      :forceFit="true"
-      :padding="['auto', 'auto', '40', '50']">
+    <v-chart height="254" :data="datasource" :forceFit="true" :padding="['auto', 'auto', '40', '50']">
       <v-tooltip />
       <v-axis />
-      <v-bar position="x*y"/>
+      <v-bar position="x*y" />
     </v-chart>
   </div>
 </template>
 
 <script>
-
-  const data = []
-  for (let i = 0; i < 12; i += 1) {
-    data.push({
-      x: `${i + 1}月`,
-      y: Math.floor(Math.random() * 1000) + 200
-    })
-  }
-  const tooltip = [
-    'x*y',
-    (x, y) => ({
-      name: x,
-      value: y
-    })
-  ]
-  const scale = [{
+const data = []
+for (let i = 0; i < 12; i += 1) {
+  data.push({
+    x: `${i + 1}月`,
+    y: Math.floor(Math.random() * 1000) + 200,
+  })
+}
+const tooltip = [
+  'x*y',
+  (x, y) => ({
+    name: x,
+    value: y,
+  }),
+]
+const scale = [
+  {
     dataKey: 'x',
-    min: 2
-  }, {
+    min: 2,
+  },
+  {
     dataKey: 'y',
     title: '时间',
     min: 1,
-    max: 22
-  }]
+    max: 22,
+  },
+]
 
-  export default {
-    name: "Bar",
-    props: {
-      title: {
-        type: String,
-        default: ''
-      }
-    },
-    mounted(){
-      this.datasource = data
+export default {
+  name: 'Bar',
+  props: {
+    title: {
+      type: String,
+      default: '',
     },
-    data () {
-      return {
-        datasource:[],
-        scale,
-        tooltip
-      }
+  },
+  mounted() {
+    this.datasource = data
+  },
+  data() {
+    return {
+      datasource: [],
+      scale,
+      tooltip,
     }
-  }
-</script>
+  },
+}
+</script>

+ 78 - 78
jshERP-web/src/components/chart/LineChartMultid.vue

@@ -2,93 +2,93 @@
   <div :style="{ padding: '0 0 32px 32px' }">
     <h4 :style="{ marginBottom: '20px' }">{{ title }}</h4>
     <v-chart :force-fit="true" :height="height" :data="data" :scale="scale" :onClick="handleClick">
-      <v-tooltip/>
-      <v-axis/>
-      <v-legend/>
-      <v-line position="type*y" color="x"/>
-      <v-point position="type*y" color="x" :size="4" :v-style="style" :shape="'circle'"/>
+      <v-tooltip />
+      <v-axis />
+      <v-legend />
+      <v-line position="type*y" color="x" />
+      <v-point position="type*y" color="x" :size="4" :v-style="style" :shape="'circle'" />
     </v-chart>
   </div>
 </template>
 
 <script>
-  import { DataSet } from '@antv/data-set'
-  import { ChartEventMixins } from './mixins/ChartMixins'
+import { DataSet } from '@antv/data-set'
+import { ChartEventMixins } from './mixins/ChartMixins'
 
-  export default {
-    name: 'LineChartMultid',
-    mixins: [ChartEventMixins],
-    props: {
-      title: {
-        type: String,
-        default: ''
-      },
-      dataSource: {
-        type: Array,
-        default: () => [
-          { type: 'Jan', jeecg: 7.0, jeebt: 3.9 },
-          { type: 'Feb', jeecg: 6.9, jeebt: 4.2 },
-          { type: 'Mar', jeecg: 9.5, jeebt: 5.7 },
-          { type: 'Apr', jeecg: 14.5, jeebt: 8.5 },
-          { type: 'May', jeecg: 18.4, jeebt: 11.9 },
-          { type: 'Jun', jeecg: 21.5, jeebt: 15.2 },
-          { type: 'Jul', jeecg: 25.2, jeebt: 17.0 },
-          { type: 'Aug', jeecg: 26.5, jeebt: 16.6 },
-          { type: 'Sep', jeecg: 23.3, jeebt: 14.2 },
-          { type: 'Oct', jeecg: 18.3, jeebt: 10.3 },
-          { type: 'Nov', jeecg: 13.9, jeebt: 6.6 },
-          { type: 'Dec', jeecg: 9.6, jeebt: 4.8 }
-        ]
-      },
-      fields: {
-        type: Array,
-        default: () => ['jeecg', 'jeebt']
-      },
-      // 别名,需要的格式:[{field:'name',alias:'姓名'}, {field:'sex',alias:'性别'}]
-      aliases:{
-        type: Array,
-        default: () => []
-      },
-      height: {
-        type: Number,
-        default: 254
-      }
+export default {
+  name: 'LineChartMultid',
+  mixins: [ChartEventMixins],
+  props: {
+    title: {
+      type: String,
+      default: '',
     },
-    data() {
-      return {
-        scale: [{
+    dataSource: {
+      type: Array,
+      default: () => [
+        { type: 'Jan', jeecg: 7.0, jeebt: 3.9 },
+        { type: 'Feb', jeecg: 6.9, jeebt: 4.2 },
+        { type: 'Mar', jeecg: 9.5, jeebt: 5.7 },
+        { type: 'Apr', jeecg: 14.5, jeebt: 8.5 },
+        { type: 'May', jeecg: 18.4, jeebt: 11.9 },
+        { type: 'Jun', jeecg: 21.5, jeebt: 15.2 },
+        { type: 'Jul', jeecg: 25.2, jeebt: 17.0 },
+        { type: 'Aug', jeecg: 26.5, jeebt: 16.6 },
+        { type: 'Sep', jeecg: 23.3, jeebt: 14.2 },
+        { type: 'Oct', jeecg: 18.3, jeebt: 10.3 },
+        { type: 'Nov', jeecg: 13.9, jeebt: 6.6 },
+        { type: 'Dec', jeecg: 9.6, jeebt: 4.8 },
+      ],
+    },
+    fields: {
+      type: Array,
+      default: () => ['jeecg', 'jeebt'],
+    },
+    // 别名,需要的格式:[{field:'name',alias:'姓名'}, {field:'sex',alias:'性别'}]
+    aliases: {
+      type: Array,
+      default: () => [],
+    },
+    height: {
+      type: Number,
+      default: 254,
+    },
+  },
+  data() {
+    return {
+      scale: [
+        {
           dataKey: 'x',
           min: 0,
-          max: 1
-        }],
-        style: { stroke: '#fff', lineWidth: 1 }
-      }
-    },
-    computed: {
-      data() {
-        const dv = new DataSet.View().source(this.dataSource)
-        dv.transform({
-          type: 'fold',
-          fields: this.fields,
-          key: 'x',
-          value: 'y'
-        })
-        let rows =  dv.rows
-        // 替换别名
-        rows.forEach(row => {
-          for (let item of this.aliases) {
-            if (item.field === row.x) {
-              row.x = item.alias
-              break
-            }
-          }
-        })
-        return rows
-      }
+          max: 1,
+        },
+      ],
+      style: { stroke: '#fff', lineWidth: 1 },
     }
-  }
+  },
+  computed: {
+    data() {
+      const dv = new DataSet.View().source(this.dataSource)
+      dv.transform({
+        type: 'fold',
+        fields: this.fields,
+        key: 'x',
+        value: 'y',
+      })
+      let rows = dv.rows
+      // 替换别名
+      rows.forEach((row) => {
+        for (let item of this.aliases) {
+          if (item.field === row.x) {
+            row.x = item.alias
+            break
+          }
+        }
+      })
+      return rows
+    },
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 28 - 37
jshERP-web/src/components/chart/Liquid.vue

@@ -1,20 +1,14 @@
 <template>
   <div>
-    <v-chart
-      :forceFit="true"
-      :height="height"
-      :width="width"
-      :data="data"
-      :scale="scale"
-      :padding="0">
-      <v-tooltip/>
+    <v-chart :forceFit="true" :height="height" :width="width" :data="data" :scale="scale" :padding="0">
+      <v-tooltip />
       <v-interval
         :shape="['liquid-fill-gauge']"
         position="transfer*value"
         color=""
         :v-style="{
           lineWidth: 8,
-          opacity: 0.75
+          opacity: 0.75,
         }"
         :tooltip="[
           'transfer*value',
@@ -22,7 +16,7 @@
             return {
               name: transfer,
               value,
-            };
+            }
           },
         ]"
       ></v-interval>
@@ -33,7 +27,7 @@
         :top="true"
         :position="{
           gender: row.transfer,
-          value: 45
+          value: 45,
         }"
         :content="row.value + '%'"
         :v-style="{
@@ -47,34 +41,31 @@
 </template>
 
 <script>
+const sourceDataConst = [
+  { transfer: '一月', value: 813 },
+  { transfer: '二月', value: 233 },
+  { transfer: '三月', value: 561 },
+]
 
-  const sourceDataConst = [
-    { transfer: '一月', value: 813 },
-    { transfer: '二月', value: 233 },
-    { transfer: '三月', value: 561 }
-  ]
-
-  export default {
-    name: 'Liquid',
-    props: {
-      height: {
-        type: Number,
-        default: 0
-      },
-      width: {
-        type: Number,
-        default: 0
-      }
+export default {
+  name: 'Liquid',
+  props: {
+    height: {
+      type: Number,
+      default: 0,
     },
-    data() {
-      return {
-        data: sourceDataConst,
-        scale: []
-      }
+    width: {
+      type: Number,
+      default: 0,
+    },
+  },
+  data() {
+    return {
+      data: sourceDataConst,
+      scale: [],
     }
-  }
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 49 - 49
jshERP-web/src/components/chart/MiniArea.vue

@@ -2,68 +2,68 @@
   <div class="antv-chart-mini">
     <div class="chart-wrapper" :style="{ height: 46 }">
       <v-chart :force-fit="true" :height="height" :data="data" :scale="scale" :padding="[36, 0, 18, 0]">
-        <v-tooltip/>
-        <v-smooth-area position="x*y"/>
+        <v-tooltip />
+        <v-smooth-area position="x*y" />
       </v-chart>
     </div>
   </div>
 </template>
 
 <script>
-  import moment from 'dayjs'
+import moment from 'dayjs'
 
-  const sourceData = []
-  const beginDay = new Date().getTime()
+const sourceData = []
+const beginDay = new Date().getTime()
 
-  for (let i = 0; i < 10; i++) {
-    sourceData.push({
-      x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
-      y: Math.round(Math.random() * 10)
-    })
-  }
+for (let i = 0; i < 10; i++) {
+  sourceData.push({
+    x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
+    y: Math.round(Math.random() * 10),
+  })
+}
 
-  export default {
-    name: 'MiniArea',
-    props: {
-      dataSource: {
-        type: Array,
-        default: () => []
-      },
-      // x 轴别名
-      x: {
-        type: String,
-        default: 'x'
-      },
-      // y 轴别名
-      y: {
-        type: String,
-        default: 'y'
-      }
+export default {
+  name: 'MiniArea',
+  props: {
+    dataSource: {
+      type: Array,
+      default: () => [],
     },
-    data() {
-      return {
-        data: [],
-        height: 100
-      }
+    // x 轴别名
+    x: {
+      type: String,
+      default: 'x',
     },
-    computed: {
-      scale() {
-        return [
-          { dataKey: 'x', title: this.x, alias: this.x },
-          { dataKey: 'y', title: this.y, alias: this.y }
-        ]
-      }
+    // y 轴别名
+    y: {
+      type: String,
+      default: 'y',
     },
-    created() {
-      if (this.dataSource.length === 0) {
-        this.data = sourceData
-      } else {
-        this.data = this.dataSource
-      }
+  },
+  data() {
+    return {
+      data: [],
+      height: 100,
     }
-  }
+  },
+  computed: {
+    scale() {
+      return [
+        { dataKey: 'x', title: this.x, alias: this.x },
+        { dataKey: 'y', title: this.y, alias: this.y },
+      ]
+    },
+  },
+  created() {
+    if (this.dataSource.length === 0) {
+      this.data = sourceData
+    } else {
+      this.data = this.dataSource
+    }
+  },
+}
 </script>
 
 <style lang="less" scoped>
-  @import "chart";
-</style>
+@import 'chart';
+</style>

+ 58 - 55
jshERP-web/src/components/chart/MiniBar.vue

@@ -1,76 +1,79 @@
 <template>
-  <div :style="{'width':width==null?'auto':width+'px'}">
-    <v-chart :forceFit="width==null" :height="height" :data="data" padding="0">
-      <v-tooltip/>
-      <v-bar position="x*y"/>
+  <div :style="{ width: width == null ? 'auto' : width + 'px' }">
+    <v-chart :forceFit="width == null" :height="height" :data="data" padding="0">
+      <v-tooltip />
+      <v-bar position="x*y" />
     </v-chart>
   </div>
 </template>
 
 <script>
-  import moment from 'dayjs'
+import moment from 'dayjs'
 
-  const sourceData = []
-  const beginDay = new Date().getTime()
+const sourceData = []
+const beginDay = new Date().getTime()
 
-  for (let i = 0; i < 10; i++) {
-    sourceData.push({
-      x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
-      y: Math.round(Math.random() * 10)
-    })
-  }
+for (let i = 0; i < 10; i++) {
+  sourceData.push({
+    x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
+    y: Math.round(Math.random() * 10),
+  })
+}
 
-  const tooltip = [
-    'x*y',
-    (x, y) => ({
-      name: x,
-      value: y
-    })
-  ]
+const tooltip = [
+  'x*y',
+  (x, y) => ({
+    name: x,
+    value: y,
+  }),
+]
 
-  const scale = [{
+const scale = [
+  {
     dataKey: 'x',
-    min: 2
-  }, {
+    min: 2,
+  },
+  {
     dataKey: 'y',
     title: '时间',
     min: 1,
-    max: 30
-  }]
+    max: 30,
+  },
+]
 
-  export default {
-    name: 'MiniBar',
-    props: {
-      dataSource: {
-        type: Array,
-        default: () => []
-      },
-      width: {
-        type: Number,
-        default: null
-      },
-      height: {
-        type: Number,
-        default: 200
-      }
+export default {
+  name: 'MiniBar',
+  props: {
+    dataSource: {
+      type: Array,
+      default: () => [],
     },
-    created() {
-      if (this.dataSource.length === 0) {
-        this.data = sourceData
-      } else {
-        this.data = this.dataSource
-      }
+    width: {
+      type: Number,
+      default: null,
     },
-    data() {
-      return {
-        tooltip,
-        data: [],
-        scale
-      }
+    height: {
+      type: Number,
+      default: 200,
+    },
+  },
+  created() {
+    if (this.dataSource.length === 0) {
+      this.data = sourceData
+    } else {
+      this.data = this.dataSource
+    }
+  },
+  data() {
+    return {
+      tooltip,
+      data: [],
+      scale,
     }
-  }
+  },
+}
 </script>
 
 <style lang="less" scoped>
-  @import "chart";
-</style>
+@import 'chart';
+</style>

+ 54 - 54
jshERP-web/src/components/chart/MiniProgress.vue

@@ -1,75 +1,75 @@
 <template>
   <div class="chart-mini-progress">
-    <div class="target" :style="{ left: target + '%'}">
-      <span :style="{ backgroundColor: color }"/>
-      <span :style="{ backgroundColor: color }"/>
+    <div class="target" :style="{ left: target + '%' }">
+      <span :style="{ backgroundColor: color }" />
+      <span :style="{ backgroundColor: color }" />
     </div>
     <div class="progress-wrapper">
-      <div class="progress" :style="{ backgroundColor: color, width: percentage + '%', height: height+'px' }"></div>
+      <div class="progress" :style="{ backgroundColor: color, width: percentage + '%', height: height + 'px' }"></div>
     </div>
   </div>
 </template>
 
 <script>
-  export default {
-    name: 'MiniProgress',
-    props: {
-      target: {
-        type: Number,
-        default: 0
-      },
-      height: {
-        type: Number,
-        default: 10
-      },
-      color: {
-        type: String,
-        default: '#13C2C2'
-      },
-      percentage: {
-        type: Number,
-        default: 0
-      }
-    }
-  }
+export default {
+  name: 'MiniProgress',
+  props: {
+    target: {
+      type: Number,
+      default: 0,
+    },
+    height: {
+      type: Number,
+      default: 10,
+    },
+    color: {
+      type: String,
+      default: '#13C2C2',
+    },
+    percentage: {
+      type: Number,
+      default: 0,
+    },
+  },
+}
 </script>
 
 <style lang="less" scoped>
-  .chart-mini-progress {
-    padding: 5px 0;
-    position: relative;
-    width: 100%;
+.chart-mini-progress {
+  padding: 5px 0;
+  position: relative;
+  width: 100%;
+
+  .target {
+    position: absolute;
+    top: 0;
+    bottom: 0;
 
-    .target {
+    span {
+      border-radius: 100px;
       position: absolute;
       top: 0;
-      bottom: 0;
+      left: 0;
+      height: 4px;
+      width: 2px;
 
-      span {
-        border-radius: 100px;
-        position: absolute;
-        top: 0;
-        left: 0;
-        height: 4px;
-        width: 2px;
-
-        &:last-child {
-          top: auto;
-          bottom: 0;
-        }
+      &:last-child {
+        top: auto;
+        bottom: 0;
       }
     }
-    .progress-wrapper {
-      background-color: #f5f5f5;
-      position: relative;
+  }
+  .progress-wrapper {
+    background-color: #f5f5f5;
+    position: relative;
 
-      .progress {
-        transition: all .4s cubic-bezier(.08, .82, .17, 1) 0s;
-        border-radius: 1px 0 0 1px;
-        background-color: #1890ff;
-        width: 0;
-        height: 100%;
-      }
+    .progress {
+      transition: all 0.4s cubic-bezier(0.08, 0.82, 0.17, 1) 0s;
+      border-radius: 1px 0 0 1px;
+      background-color: #1890ff;
+      width: 0;
+      height: 100%;
     }
   }
-</style>
+}
+</style>

+ 61 - 56
jshERP-web/src/components/chart/Pie.vue

@@ -1,70 +1,75 @@
 <template>
   <v-chart :forceFit="true" :height="height" :data="data" :scale="scale" :onClick="handleClick">
-    <v-tooltip :showTitle="false" dataKey="item*percent"/>
-    <v-axis/>
-    <v-legend dataKey="item"/>
-    <v-pie position="percent" color="item" :v-style="pieStyle" :label="labelConfig"/>
-    <v-coord type="theta"/>
+    <v-tooltip :showTitle="false" dataKey="item*percent" />
+    <v-axis />
+    <v-legend dataKey="item" />
+    <v-pie position="percent" color="item" :v-style="pieStyle" :label="labelConfig" />
+    <v-coord type="theta" />
   </v-chart>
 </template>
 
 <script>
-  const DataSet = require('@antv/data-set')
-  import { ChartEventMixins } from './mixins/ChartMixins'
+const DataSet = require('@antv/data-set')
+import { ChartEventMixins } from './mixins/ChartMixins'
 
-  export default {
-    name: 'Pie',
-    mixins: [ChartEventMixins],
-    props: {
-      title: {
-        type: String,
-        default: ''
-      },
-      height: {
-        type: Number,
-        default: 254
-      },
-      dataSource: {
-        type: Array,
-        default: () => [
-          { item: '示例一', count: 40 },
-          { item: '示例二', count: 21 },
-          { item: '示例三', count: 17 },
-          { item: '示例四', count: 13 },
-          { item: '示例五', count: 9 }
-        ]
-      }
+export default {
+  name: 'Pie',
+  mixins: [ChartEventMixins],
+  props: {
+    title: {
+      type: String,
+      default: '',
     },
-    data() {
-      return {
-        scale: [{
+    height: {
+      type: Number,
+      default: 254,
+    },
+    dataSource: {
+      type: Array,
+      default: () => [
+        { item: '示例一', count: 40 },
+        { item: '示例二', count: 21 },
+        { item: '示例三', count: 17 },
+        { item: '示例四', count: 13 },
+        { item: '示例五', count: 9 },
+      ],
+    },
+  },
+  data() {
+    return {
+      scale: [
+        {
           dataKey: 'percent',
           min: 0,
-          formatter: '.0%'
-        }],
-        pieStyle: {
-          stroke: '#fff',
-          lineWidth: 1
+          formatter: '.0%',
         },
-        labelConfig: ['percent', {
+      ],
+      pieStyle: {
+        stroke: '#fff',
+        lineWidth: 1,
+      },
+      labelConfig: [
+        'percent',
+        {
           formatter: (val, item) => {
             return item.point.item + ': ' + val
-          }
-        }]
-      }
-    },
-    computed: {
-      data() {
-        let dv = new DataSet.View().source(this.dataSource)
-        // 计算数据百分比
-        dv.transform({
-          type: 'percent',
-          field: 'count',
-          dimension: 'item',
-          as: 'percent'
-        })
-        return dv.rows
-      }
+          },
+        },
+      ],
     }
-  }
-</script>
+  },
+  computed: {
+    data() {
+      let dv = new DataSet.View().source(this.dataSource)
+      // 计算数据百分比
+      dv.transform({
+        type: 'percent',
+        field: 'count',
+        dimension: 'item',
+        as: 'percent',
+      })
+      return dv.rows
+    },
+  },
+}
+</script>

+ 74 - 75
jshERP-web/src/components/chart/Radar.vue

@@ -1,90 +1,89 @@
 <template>
   <v-chart :forceFit="true" :height="height" :data="data" :padding="[20, 20, 95, 20]" :scale="scale">
     <v-tooltip></v-tooltip>
-    <v-axis :dataKey="axis1Opts.dataKey" :line="axis1Opts.line" :tickLine="axis1Opts.tickLine" :grid="axis1Opts.grid"/>
-    <v-axis :dataKey="axis2Opts.dataKey" :line="axis2Opts.line" :tickLine="axis2Opts.tickLine" :grid="axis2Opts.grid"/>
-    <v-legend dataKey="user" marker="circle" :offset="30"/>
-    <v-coord type="polar" radius="0.8"/>
-    <v-line position="item*score" color="user" :size="2"/>
-    <v-point position="item*score" color="user" :size="4" shape="circle"/>
+    <v-axis :dataKey="axis1Opts.dataKey" :line="axis1Opts.line" :tickLine="axis1Opts.tickLine" :grid="axis1Opts.grid" />
+    <v-axis :dataKey="axis2Opts.dataKey" :line="axis2Opts.line" :tickLine="axis2Opts.tickLine" :grid="axis2Opts.grid" />
+    <v-legend dataKey="user" marker="circle" :offset="30" />
+    <v-coord type="polar" radius="0.8" />
+    <v-line position="item*score" color="user" :size="2" />
+    <v-point position="item*score" color="user" :size="4" shape="circle" />
   </v-chart>
 </template>
 
 <script>
-  const axis1Opts = {
-    dataKey: 'item',
-    line: null,
-    tickLine: null,
-    grid: {
-      lineStyle: {
-        lineDash: null
-      },
-      hideFirstLine: false
-    }
-  }
-  const axis2Opts = {
-    dataKey: 'score',
-    line: null,
-    tickLine: null,
-    grid: {
-      type: 'polygon',
-      lineStyle: {
-        lineDash: null
-      }
-    }
-  }
+const axis1Opts = {
+  dataKey: 'item',
+  line: null,
+  tickLine: null,
+  grid: {
+    lineStyle: {
+      lineDash: null,
+    },
+    hideFirstLine: false,
+  },
+}
+const axis2Opts = {
+  dataKey: 'score',
+  line: null,
+  tickLine: null,
+  grid: {
+    type: 'polygon',
+    lineStyle: {
+      lineDash: null,
+    },
+  },
+}
 
-  const scale = [
-    {
-      dataKey: 'score',
-      min: 0,
-      max: 100
-    }, {
-      dataKey: 'user',
-      alias: '类型'
-    }
-  ]
+const scale = [
+  {
+    dataKey: 'score',
+    min: 0,
+    max: 100,
+  },
+  {
+    dataKey: 'user',
+    alias: '类型',
+  },
+]
 
-  const sourceData = [
-    { item: '示例一', score: 40 },
-    { item: '示例二', score: 20 },
-    { item: '示例三', score: 67 },
-    { item: '示例四', score: 43 },
-    { item: '示例五', score: 90 }
-  ]
+const sourceData = [
+  { item: '示例一', score: 40 },
+  { item: '示例二', score: 20 },
+  { item: '示例三', score: 67 },
+  { item: '示例四', score: 43 },
+  { item: '示例五', score: 90 },
+]
 
-  export default {
-    name: 'Radar',
-    props: {
-      height: {
-        type: Number,
-        default: 254
-      },
-      dataSource: {
-        type: Array,
-        default: () => []
-      }
+export default {
+  name: 'Radar',
+  props: {
+    height: {
+      type: Number,
+      default: 254,
     },
-    data() {
-      return {
-        axis1Opts,
-        axis2Opts,
-        scale,
-        data: sourceData
-      }
+    dataSource: {
+      type: Array,
+      default: () => [],
     },
-    watch: {
-      dataSource(newVal) {
-        if (newVal.length === 0) {
-          this.data = sourceData
-        } else {
-          this.data = newVal
-        }
-      }
+  },
+  data() {
+    return {
+      axis1Opts,
+      axis2Opts,
+      scale,
+      data: sourceData,
     }
-  }
+  },
+  watch: {
+    dataSource(newVal) {
+      if (newVal.length === 0) {
+        this.data = sourceData
+      } else {
+        this.data = newVal
+      }
+    },
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 54 - 56
jshERP-web/src/components/chart/RankList.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="rank">
     <h4 class="title">{{ title }}</h4>
-    <ul class="list" :style="{height:height?`${height}px`:'auto',overflow:'auto'}">
+    <ul class="list" :style="{ height: height ? `${height}px` : 'auto', overflow: 'auto' }">
       <li :key="index" v-for="(item, index) in list">
         <span :class="index < 3 ? 'active' : null">{{ index + 1 }}</span>
         <span>{{ item.name }}</span>
@@ -12,70 +12,68 @@
 </template>
 
 <script>
-  export default {
-    name: "RankList",
-    // ['title', 'list']
-    props: {
-      title: {
-        type: String,
-        default: ''
-      },
-      list: {
-        type: Array,
-        default: null
-      },
-      height: {
-        type: Number,
-        default: null
-      }
-    }
-  }
+export default {
+  name: 'RankList',
+  // ['title', 'list']
+  props: {
+    title: {
+      type: String,
+      default: '',
+    },
+    list: {
+      type: Array,
+      default: null,
+    },
+    height: {
+      type: Number,
+      default: null,
+    },
+  },
+}
 </script>
 
 <style lang="less" scoped>
+.rank {
+  padding: 0 32px 32px 72px;
 
-  .rank {
-    padding: 0 32px 32px 72px;
-
-    .list {
-      margin: 25px 0 0;
-      padding: 0;
-      list-style: none;
+  .list {
+    margin: 25px 0 0;
+    padding: 0;
+    list-style: none;
 
-      li {
-        margin-top: 16px;
+    li {
+      margin-top: 16px;
 
-        span {
-          color: rgba(0, 0, 0, .65);
-          font-size: 14px;
-          line-height: 22px;
+      span {
+        color: rgba(0, 0, 0, 0.65);
+        font-size: 14px;
+        line-height: 22px;
 
-          &:first-child {
-            background-color: #f5f5f5;
-            border-radius: 20px;
-            display: inline-block;
-            font-size: 12px;
-            font-weight: 600;
-            margin-right: 24px;
-            height: 20px;
-            line-height: 20px;
-            width: 20px;
-            text-align: center;
-          }
-          &.active {
-            background-color: #314659;
-            color: #fff;
-          }
-          &:last-child {
-            float: right;
-          }
+        &:first-child {
+          background-color: #f5f5f5;
+          border-radius: 20px;
+          display: inline-block;
+          font-size: 12px;
+          font-weight: 600;
+          margin-right: 24px;
+          height: 20px;
+          line-height: 20px;
+          width: 20px;
+          text-align: center;
+        }
+        &.active {
+          background-color: #314659;
+          color: #fff;
+        }
+        &:last-child {
+          float: right;
         }
       }
     }
   }
+}
 
-  .mobile .rank {
-    padding: 0 32px 32px 32px;
-  }
-
-</style>
+.mobile .rank {
+  padding: 0 32px 32px 32px;
+}
+</style>

+ 37 - 38
jshERP-web/src/components/chart/StackBar.vue

@@ -5,50 +5,49 @@
       <v-tooltip />
       <v-legend />
       <v-axis dataKey="State" :label="label" />
-      <v-stack-bar position="State*流程数量"  color="流程状态" />
+      <v-stack-bar position="State*流程数量" color="流程状态" />
     </v-chart>
   </div>
-
 </template>
 
 <script>
-  const DataSet = require('@antv/data-set');
+const DataSet = require('@antv/data-set')
 
-  export default {
-    name: 'StackBar',
-    props: {
-      dataSource: {
-        type: Array,
-        required: true,
-        default: () => [
-          { 'State': '请假', '流转中': 25, '已归档': 18 },
-          { 'State': '出差', '流转中': 30, '已归档': 20 },
-          { 'State': '加班', '流转中': 38, '已归档': 42},
-          { 'State': '用车', '流转中': 51, '已归档': 67}
-        ]
-      },
-      height: {
-        type: Number,
-        default: 254
-      }
+export default {
+  name: 'StackBar',
+  props: {
+    dataSource: {
+      type: Array,
+      required: true,
+      default: () => [
+        { State: '请假', 流转中: 25, 已归档: 18 },
+        { State: '出差', 流转中: 30, 已归档: 20 },
+        { State: '加班', 流转中: 38, 已归档: 42 },
+        { State: '用车', 流转中: 51, 已归档: 67 },
+      ],
     },
-    data() {
-      return {
-        label: { offset: 12 }
-      }
+    height: {
+      type: Number,
+      default: 254,
     },
-    computed: {
-      data() {
-        const dv = new DataSet.View().source(this.dataSource);
-        dv.transform({
-          type: 'fold',
-          fields: ['流转中', '已归档'],
-          key: '流程状态',
-          value: '流程数量',
-          retains: ['State'],
-        });
-       return dv.rows;
-      }
+  },
+  data() {
+    return {
+      label: { offset: 12 },
     }
-  }
-</script>
+  },
+  computed: {
+    data() {
+      const dv = new DataSet.View().source(this.dataSource)
+      dv.transform({
+        type: 'fold',
+        fields: ['流转中', '已归档'],
+        key: '流程状态',
+        value: '流程数量',
+        retains: ['State'],
+      })
+      return dv.rows
+    },
+  },
+}
+</script>

+ 48 - 54
jshERP-web/src/components/chart/TransferBar.vue

@@ -1,66 +1,60 @@
 <template>
   <div :style="{ padding: '0 0 32px 32px' }">
     <h4 :style="{ marginBottom: '20px' }">{{ title }}</h4>
-    <v-chart
-      :height="height"
-      :data="data"
-      :scale="scale"
-      :forceFit="true"
-      :padding="['auto', 'auto', '40', '50']">
-      <v-tooltip/>
-      <v-axis/>
-      <v-bar position="x*y"/>
+    <v-chart :height="height" :data="data" :scale="scale" :forceFit="true" :padding="['auto', 'auto', '40', '50']">
+      <v-tooltip />
+      <v-axis />
+      <v-bar position="x*y" />
     </v-chart>
   </div>
 </template>
 
 <script>
-
-  export default {
-    name: 'Bar',
-    props: {
-      title: {
-        type: String,
-        default: ''
-      },
-      x: {
-        type: String,
-        default: 'x'
-      },
-      y: {
-        type: String,
-        default: 'y'
-      },
-      data: {
-        type: Array,
-        default: () => []
-      },
-      height: {
-        type: Number,
-        default: 254
-      }
+export default {
+  name: 'Bar',
+  props: {
+    title: {
+      type: String,
+      default: '',
+    },
+    x: {
+      type: String,
+      default: 'x',
+    },
+    y: {
+      type: String,
+      default: 'y',
     },
-    data() {
-      return {}
+    data: {
+      type: Array,
+      default: () => [],
     },
-    computed: {
-      scale() {
-        return [
-          { dataKey: 'x', title: this.x, alias: this.x },
-          { dataKey: 'y', title: this.y, alias: this.y }
-        ]
-      }
+    height: {
+      type: Number,
+      default: 254,
     },
-    created() {
-      // this.getMonthBar()
+  },
+  data() {
+    return {}
+  },
+  computed: {
+    scale() {
+      return [
+        { dataKey: 'x', title: this.x, alias: this.x },
+        { dataKey: 'y', title: this.y, alias: this.y },
+      ]
     },
-    methods: {
-      // getMonthBar() {
-      //   this.$http.get('/analysis/month-bar')
-      //     .then(res => {
-      //       this.data = res.result
-      //     })
-      // }
-    }
-  }
-</script>
+  },
+  created() {
+    // this.getMonthBar()
+  },
+  methods: {
+    // getMonthBar() {
+    //   this.$http.get('/analysis/month-bar')
+    //     .then(res => {
+    //       this.data = res.result
+    //     })
+    // }
+  },
+}
+</script>

+ 66 - 63
jshERP-web/src/components/chart/Trend.vue

@@ -2,83 +2,86 @@
   <div class="chart-trend">
     {{ term }}
     <span>{{ rate }}%</span>
-    <span :class="['trend-icon', trend]"><a-icon :type="'caret-' + trend"/></span>
+    <span :class="['trend-icon', trend]"><a-icon :type="'caret-' + trend" /></span>
   </div>
 </template>
 
 <script>
-  export default {
-    name: "Trend",
-    props: {
-      // 同title
-      term: {
-        type: String,
-        default: '',
-        required: true
-      },
-      // 百分比
-      percentage: {
-        type: Number,
-        default: null
-      },
-      type: {
-        type: Boolean,
-        default: null
-      },
-      target: {
-        type: Number,
-        default: 0
-      },
-      value: {
-        type: Number,
-        default: 0
-      },
-      fixed: {
-        type: Number,
-        default: 2
-      }
+export default {
+  name: 'Trend',
+  props: {
+    // 同title
+    term: {
+      type: String,
+      default: '',
+      required: true,
     },
-    data () {
-      return {
-        trend: this.type && 'up' || 'down',
-        rate: this.percentage
-      }
+    // 百分比
+    percentage: {
+      type: Number,
+      default: null,
+    },
+    type: {
+      type: Boolean,
+      default: null,
+    },
+    target: {
+      type: Number,
+      default: 0,
+    },
+    value: {
+      type: Number,
+      default: 0,
+    },
+    fixed: {
+      type: Number,
+      default: 2,
     },
-    created () {
-      let type = this.type === null ? this.value >= this.target : this.type
-      this.trend = type ? 'up' : 'down';
-      this.rate = (this.percentage === null ? Math.abs(this.value - this.target) * 100 / this.target : this.percentage).toFixed(this.fixed)
+  },
+  data() {
+    return {
+      trend: (this.type && 'up') || 'down',
+      rate: this.percentage,
     }
-  }
+  },
+  created() {
+    let type = this.type === null ? this.value >= this.target : this.type
+    this.trend = type ? 'up' : 'down'
+    this.rate = (
+      this.percentage === null ? (Math.abs(this.value - this.target) * 100) / this.target : this.percentage
+    ).toFixed(this.fixed)
+  },
+}
 </script>
 
 <style lang="less" scoped>
-  .chart-trend {
-    display: inline-block;
-    font-size: 14px;
-    line-height: 22px;
+.chart-trend {
+  display: inline-block;
+  font-size: 14px;
+  line-height: 22px;
 
-    .trend-icon {
-      font-size: 12px;
+  .trend-icon {
+    font-size: 12px;
 
-      &.up, &.down {
-        margin-left: 4px;
-        position: relative;
-        top: 1px;
+    &.up,
+    &.down {
+      margin-left: 4px;
+      position: relative;
+      top: 1px;
 
-        i {
-          font-size: 12px;
-          transform: scale(.83);
-        }
+      i {
+        font-size: 12px;
+        transform: scale(0.83);
       }
+    }
 
-      &.up {
-        color: #f5222d;
-      }
-      &.down {
-        color: #52c41a;
-        top: -1px;
-      }
+    &.up {
+      color: #f5222d;
+    }
+    &.down {
+      color: #52c41a;
+      top: -1px;
     }
   }
-</style>
+}
+</style>

+ 2 - 2
jshERP-web/src/components/chart/chart.less

@@ -7,7 +7,7 @@
     bottom: -28px;
     width: 100%;
 
-/*    margin: 0 -5px;
+    /*    margin: 0 -5px;
     overflow: hidden;*/
   }
-}
+}

+ 2 - 2
jshERP-web/src/components/chart/chart.scss

@@ -7,7 +7,7 @@
     bottom: -28px;
     width: 100%;
 
-/*    margin: 0 -5px;
+    /*    margin: 0 -5px;
     overflow: hidden;*/
   }
-}
+}

+ 2 - 2
jshERP-web/src/components/chart/mixins/ChartMixins.js

@@ -6,5 +6,5 @@ export const ChartEventMixins = {
     handleEvent(eventName, event, chart) {
       this.$emit(eventName, event, chart)
     },
-  }
-}
+  },
+}

+ 2 - 2
jshERP-web/src/components/index.less

@@ -1,4 +1,4 @@
-@import "~ant-design-vue/lib/style/index";
+@import '~ant-design-vue/lib/style/index';
 
 // The prefix to use on all css classes from ant-pro.
-@ant-pro-prefix             : ant-pro;
+@ant-pro-prefix: ant-pro;

+ 111 - 113
jshERP-web/src/components/jeecg/JAreaLinkage.vue

@@ -5,7 +5,7 @@
       :value="innerValue"
       :data="pcaa"
       :level="1"
-      :style="{width}"
+      :style="{ width }"
       v-bind="$attrs"
       v-on="_listeners"
       @change="handleChange"
@@ -20,136 +20,134 @@
       @change="handleChange"
     />
     <div v-else>
-      <span style="color:red;"> Bad type value: {{_type}}</span>
+      <span style="color: red"> Bad type value: {{ _type }}</span>
     </div>
   </div>
 </template>
 
 <script>
-  import { pcaa } from 'area-data'
+import { pcaa } from 'area-data'
 
-  export default {
-    name: 'JAreaLinkage',
-    props: {
-      value: {
-        type: String,
-        required:false
-      },
-      // 组件的类型,可选值:
-      // select 下拉样式
-      // cascader 级联样式(默认)
-      type: {
-        type: String,
-        default: 'cascader'
-      },
-      width: {
-        type: String,
-        default: '100%'
-      }
+export default {
+  name: 'JAreaLinkage',
+  props: {
+    value: {
+      type: String,
+      required: false,
     },
-    data() {
-      return {
-        pcaa,
-        innerValue: [],
-        usedListeners: ['change'],
-        enums: {
-          type: ['cascader', 'select']
-        },
-        reloading: false,
-        areaData:''
-      }
+    // 组件的类型,可选值:
+    // select 下拉样式
+    // cascader 级联样式(默认)
+    type: {
+      type: String,
+      default: 'cascader',
     },
-    computed: {
-      _listeners() {
-        let listeners = { ...this.$listeners }
-        // 去掉已使用的事件,防止冲突
-        this.usedListeners.forEach(key => {
-          delete listeners[key]
-        })
-        return listeners
-      },
-      _type() {
-        if (this.enums.type.includes(this.type)) {
-          return this.type
-        } else {
-          console.error(`JAreaLinkage的type属性只能接收指定的值(${this.enums.type.join('|')})`)
-          return this.enums.type[0]
-        }
-      },
+    width: {
+      type: String,
+      default: '100%',
     },
-    watch: {
-      value: {
-        immediate: true,
-        handler() {
-          this.loadDataByValue(this.value)
-        }
+  },
+  data() {
+    return {
+      pcaa,
+      innerValue: [],
+      usedListeners: ['change'],
+      enums: {
+        type: ['cascader', 'select'],
       },
+      reloading: false,
+      areaData: '',
+    }
+  },
+  computed: {
+    _listeners() {
+      let listeners = { ...this.$listeners }
+      // 去掉已使用的事件,防止冲突
+      this.usedListeners.forEach((key) => {
+        delete listeners[key]
+      })
+      return listeners
     },
-    created() {
-      this.initAreaData();
+    _type() {
+      if (this.enums.type.includes(this.type)) {
+        return this.type
+      } else {
+        console.error(`JAreaLinkage的type属性只能接收指定的值(${this.enums.type.join('|')})`)
+        return this.enums.type[0]
+      }
     },
-    methods: {
-      /** 通过 value 反推 options */
-      loadDataByValue(value) {
-        if(!value || value.length==0){
-          this.innerValue = []
-          this.reloading = true;
-          setTimeout(()=>{
-            this.reloading = false
-          },100)
-        }else{
-          this.initAreaData();
-          let arr = this.areaData.getRealCode(value);
-          this.innerValue = arr
-        }
+  },
+  watch: {
+    value: {
+      immediate: true,
+      handler() {
+        this.loadDataByValue(this.value)
       },
-      /** 通过地区code获取子级 */
-      loadDataByCode(value) {
-        let options = []
-        let data = pcaa[value]
-        if (data) {
-          for (let key in data) {
-            if (data.hasOwnProperty(key)) {
-              options.push({ value: key, label: data[key], })
-            }
+    },
+  },
+  created() {
+    this.initAreaData()
+  },
+  methods: {
+    /** 通过 value 反推 options */
+    loadDataByValue(value) {
+      if (!value || value.length == 0) {
+        this.innerValue = []
+        this.reloading = true
+        setTimeout(() => {
+          this.reloading = false
+        }, 100)
+      } else {
+        this.initAreaData()
+        let arr = this.areaData.getRealCode(value)
+        this.innerValue = arr
+      }
+    },
+    /** 通过地区code获取子级 */
+    loadDataByCode(value) {
+      let options = []
+      let data = pcaa[value]
+      if (data) {
+        for (let key in data) {
+          if (data.hasOwnProperty(key)) {
+            options.push({ value: key, label: data[key] })
           }
-          return options
-        } else {
-          return []
-        }
-      },
-      /** 判断是否有子节点 */
-      hasChildren(options) {
-        options.forEach(option => {
-          let data = this.loadDataByCode(option.value)
-          option.isLeaf = data.length === 0
-        })
-      },
-      handleChange(values) {
-        let value = values[values.length - 1]
-        this.$emit('change', value)
-      },
-      initAreaData(){
-        if(!this.areaData){
-          this.areaData = new Area();
         }
-      },
-
+        return options
+      } else {
+        return []
+      }
     },
-    model: { prop: 'value', event: 'change' },
-  }
+    /** 判断是否有子节点 */
+    hasChildren(options) {
+      options.forEach((option) => {
+        let data = this.loadDataByCode(option.value)
+        option.isLeaf = data.length === 0
+      })
+    },
+    handleChange(values) {
+      let value = values[values.length - 1]
+      this.$emit('change', value)
+    },
+    initAreaData() {
+      if (!this.areaData) {
+        this.areaData = new Area()
+      }
+    },
+  },
+  model: { prop: 'value', event: 'change' },
+}
 </script>
 
 <style lang="less" scoped>
-  .j-area-linkage {
-    height:40px;
-    /deep/ .area-cascader-wrap .area-select {
-      width: 100%;
-    }
-
-    /deep/ .area-select .area-selected-trigger {
-      line-height: 1.15;
-    }
+.j-area-linkage {
+  height: 40px;
+  /deep/ .area-cascader-wrap .area-select {
+    width: 100%;
   }
 
-</style>
+  /deep/ .area-select .area-selected-trigger {
+    line-height: 1.15;
+  }
+}
+</style>

+ 196 - 197
jshERP-web/src/components/jeecg/JCategorySelect.vue

@@ -10,229 +10,228 @@
     :value="treeValue"
     :treeData="treeData"
     :multiple="multiple"
-    @change="onChange">
+    @change="onChange"
+  >
   </a-tree-select>
 </template>
 <script>
+import { getAction } from '@/api/manage'
 
-  import { getAction } from '@/api/manage'
-
-  export default {
-    name: 'JCategorySelect',
-    props: {
-      value:{
-        type: String,
-        required: false
-      },
-      placeholder:{
-        type: String,
-        default: '请选择',
-        required: false
-      },
-      disabled:{
-        type:Boolean,
-        default:false,
-        required:false
-      },
-      condition:{
-        type:String,
-        default:'',
-        required:false
-      },
-      // 是否支持多选
-      multiple: {
-        type: Boolean,
-        default: false,
-      },
-      loadTriggleChange:{
-        type: Boolean,
-        default: false,
-        required:false
-      },
-      pid:{
-        type:String,
-        default:'',
-        required:false
-      },
-      pcode:{
-        type:String,
-        default:'',
-        required:false
-      },
-      back:{
-        type:String,
-        default:'',
-        required:false
+export default {
+  name: 'JCategorySelect',
+  props: {
+    value: {
+      type: String,
+      required: false,
+    },
+    placeholder: {
+      type: String,
+      default: '请选择',
+      required: false,
+    },
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+    condition: {
+      type: String,
+      default: '',
+      required: false,
+    },
+    // 是否支持多选
+    multiple: {
+      type: Boolean,
+      default: false,
+    },
+    loadTriggleChange: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+    pid: {
+      type: String,
+      default: '',
+      required: false,
+    },
+    pcode: {
+      type: String,
+      default: '',
+      required: false,
+    },
+    back: {
+      type: String,
+      default: '',
+      required: false,
+    },
+  },
+  data() {
+    return {
+      treeValue: '',
+      treeData: [],
+      url: '/sys/category/loadTreeData',
+      view: '/sys/category/loadDictItem/',
+      tableName: '',
+      text: '',
+      code: '',
+    }
+  },
+  watch: {
+    value() {
+      this.loadItemByCode()
+    },
+    pcode() {
+      this.loadRoot()
+    },
+  },
+  created() {
+    this.validateProp().then(() => {
+      this.loadRoot()
+      this.loadItemByCode()
+    })
+  },
+  methods: {
+    /**加载一级节点 */
+    loadRoot() {
+      let param = {
+        pid: this.pid,
+        pcode: !this.pcode ? '0' : this.pcode,
+        condition: this.condition,
       }
+      getAction(this.url, param).then((res) => {
+        if (res.success && res.result) {
+          for (let i of res.result) {
+            i.value = i.key
+            if (i.leaf == false) {
+              i.isLeaf = false
+            } else if (i.leaf == true) {
+              i.isLeaf = true
+            }
+          }
+          this.treeData = [...res.result]
+        } else {
+          console.log('树一级节点查询结果-else', res)
+        }
+      })
     },
-    data () {
-      return {
-        treeValue:"",
-        treeData:[],
-        url:"/sys/category/loadTreeData",
-        view:'/sys/category/loadDictItem/',
-        tableName:"",
-        text:"",
-        code:"",
 
+    /** 数据回显*/
+    loadItemByCode() {
+      if (!this.value || this.value == '0') {
+        this.treeValue = []
+      } else {
+        getAction(this.view, { ids: this.value }).then((res) => {
+          if (res.success) {
+            let values = this.value.split(',')
+            this.treeValue = res.result.map((item, index) => ({
+              key: values[index],
+              value: values[index],
+              label: item,
+            }))
+            this.onLoadTriggleChange(res.result[0])
+          }
+        })
       }
     },
-    watch: {
-      value () {
-        this.loadItemByCode()
-      },
-      pcode(){
-        this.loadRoot();
+    onLoadTriggleChange(text) {
+      //只有单选才会触发
+      if (!this.multiple && this.loadTriggleChange) {
+        this.backValue(this.value, text)
       }
     },
-    created(){
-      this.validateProp().then(()=>{
-        this.loadRoot()
-        this.loadItemByCode()
-      })
+    backValue(value, label) {
+      let obj = {}
+      if (this.back) {
+        obj[this.back] = label
+      }
+      this.$emit('change', value, obj)
     },
-    methods: {
-      /**加载一级节点 */
-      loadRoot(){
+    asyncLoadTreeData(treeNode) {
+      return new Promise((resolve) => {
+        if (treeNode.$vnode.children) {
+          resolve()
+          return
+        }
+        let pid = treeNode.$vnode.key
         let param = {
-          pid:this.pid,
-          pcode:!this.pcode?'0':this.pcode,
-          condition:this.condition
+          pid: pid,
+          condition: this.condition,
         }
-        getAction(this.url,param).then(res=>{
-          if(res.success && res.result){
-            for(let i of res.result){
+        getAction(this.url, param).then((res) => {
+          if (res.success) {
+            for (let i of res.result) {
               i.value = i.key
-              if(i.leaf==false){
-                i.isLeaf=false
-              }else if(i.leaf==true){
-                i.isLeaf=true
+              if (i.leaf == false) {
+                i.isLeaf = false
+              } else if (i.leaf == true) {
+                i.isLeaf = true
               }
             }
-            this.treeData = [...res.result]
-          }else{
-            console.log("树一级节点查询结果-else",res)
-          }
-        })
-      },
-
-      /** 数据回显*/
-      loadItemByCode(){
-        if(!this.value || this.value=="0"){
-          this.treeValue = []
-        }else{
-          getAction(this.view,{ids:this.value}).then(res=>{
-            if(res.success){
-              let values = this.value.split(',')
-              this.treeValue = res.result.map((item, index) => ({
-                key: values[index],
-                value: values[index],
-                label: item
-              }))
-              this.onLoadTriggleChange(res.result[0]);
-            }
-          })
-        }
-      },
-      onLoadTriggleChange(text){
-        //只有单选才会触发
-        if(!this.multiple && this.loadTriggleChange){
-          this.backValue(this.value,text)
-        }
-      },
-      backValue(value,label){
-        let obj = {}
-        if(this.back){
-          obj[this.back] = label
-        }
-        this.$emit('change', value, obj)
-      },
-      asyncLoadTreeData (treeNode) {
-        return new Promise((resolve) => {
-          if (treeNode.$vnode.children) {
-            resolve()
-            return
+            this.addChildren(pid, res.result, this.treeData)
+            this.treeData = [...this.treeData]
           }
-          let pid = treeNode.$vnode.key
-          let param = {
-            pid:pid,
-            condition:this.condition
-          }
-          getAction(this.url,param).then(res=>{
-            if(res.success){
-              for(let i of res.result){
-                i.value = i.key
-                if(i.leaf==false){
-                  i.isLeaf=false
-                }else if(i.leaf==true){
-                  i.isLeaf=true
-                }
-              }
-              this.addChildren(pid,res.result,this.treeData)
-              this.treeData = [...this.treeData]
-            }
-            resolve()
-          })
+          resolve()
         })
-      },
-      addChildren(pid,children,treeArray){
-        if(treeArray && treeArray.length>0){
-          for(let item of treeArray){
-            if(item.key == pid){
-              if(!children || children.length==0){
-                item.isLeaf=true
-              }else{
-                item.children = children
-              }
-              break
-            }else{
-              this.addChildren(pid,children,item.children)
+      })
+    },
+    addChildren(pid, children, treeArray) {
+      if (treeArray && treeArray.length > 0) {
+        for (let item of treeArray) {
+          if (item.key == pid) {
+            if (!children || children.length == 0) {
+              item.isLeaf = true
+            } else {
+              item.children = children
             }
+            break
+          } else {
+            this.addChildren(pid, children, item.children)
           }
         }
-      },
+      }
+    },
 
-      onChange(value){
-        if(!value){
-          this.$emit('change', '');
-          this.treeValue = ''
-        } else if (value instanceof Array) {
-          //this.$emit('change', value.map(item => item.value).join(','))
-          //this.treeValue = value
+    onChange(value) {
+      if (!value) {
+        this.$emit('change', '')
+        this.treeValue = ''
+      } else if (value instanceof Array) {
+        //this.$emit('change', value.map(item => item.value).join(','))
+        //this.treeValue = value
+      } else {
+        this.backValue(value.value, value.label)
+        this.treeValue = value
+      }
+    },
+    getCurrTreeData() {
+      return this.treeData
+    },
+    validateProp() {
+      let mycondition = this.condition
+      return new Promise((resolve, reject) => {
+        if (!mycondition) {
+          resolve()
         } else {
-          this.backValue(value.value,value.label)
-          this.treeValue = value
-        }
-      },
-      getCurrTreeData(){
-        return this.treeData
-      },
-      validateProp(){
-        let mycondition = this.condition
-        return new Promise((resolve,reject)=>{
-          if(!mycondition){
-            resolve();
-          }else{
-            try {
-              let test=JSON.parse(mycondition);
-              if(typeof test == 'object' && test){
-                resolve()
-              }else{
-                this.$message.error("组件JTreeSelect-condition传值有误,需要一个json字符串!")
-                reject()
-              }
-            } catch(e) {
-              this.$message.error("组件JTreeSelect-condition传值有误,需要一个json字符串!")
+          try {
+            let test = JSON.parse(mycondition)
+            if (typeof test == 'object' && test) {
+              resolve()
+            } else {
+              this.$message.error('组件JTreeSelect-condition传值有误,需要一个json字符串!')
               reject()
             }
+          } catch (e) {
+            this.$message.error('组件JTreeSelect-condition传值有误,需要一个json字符串!')
+            reject()
           }
-        })
-      }
+        }
+      })
     },
-    //2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼
-    model: {
-      prop: 'value',
-      event: 'change'
-    }
-  }
+  },
+  //2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼
+  model: {
+    prop: 'value',
+    event: 'change',
+  },
+}
 </script>

+ 32 - 32
jshERP-web/src/components/jeecg/JCheckbox.vue

@@ -3,41 +3,41 @@
 </template>
 
 <script>
-  export default {
-    name: 'JCheckbox',
-    props: {
-      value:{
-        type: String,
-        required: false
-      },
-      /*label value*/
-      options:{
-        type: Array,
-        required: true
-      }
+export default {
+  name: 'JCheckbox',
+  props: {
+    value: {
+      type: String,
+      required: false,
     },
-    data(){
-      return {
-        checkboxArray:!this.value?[]:this.value.split(",")
-      }
+    /*label value*/
+    options: {
+      type: Array,
+      required: true,
     },
-    watch:{
-      value (val) {
-        if(!val){
-          this.checkboxArray = []
-        }else{
-          this.checkboxArray = this.value.split(",")
-        }
+  },
+  data() {
+    return {
+      checkboxArray: !this.value ? [] : this.value.split(','),
+    }
+  },
+  watch: {
+    value(val) {
+      if (!val) {
+        this.checkboxArray = []
+      } else {
+        this.checkboxArray = this.value.split(',')
       }
     },
-    methods:{
-      onChange (checkedValues) {
-        this.$emit('change', checkedValues.join(","));
-      },
+  },
+  methods: {
+    onChange(checkedValues) {
+      this.$emit('change', checkedValues.join(','))
     },
-    model: {
-      prop: 'value',
-      event: 'change'
-    }
-  }
+  },
+  model: {
+    prop: 'value',
+    event: 'change',
+  },
+}
 </script>

+ 362 - 366
jshERP-web/src/components/jeecg/JCodeEditor.vue

@@ -1,429 +1,425 @@
 <template>
   <div v-bind="fullScreenParentProps">
-    <a-icon v-if="fullScreen" class="full-screen-icon" :type="iconType" @click="()=>fullCoder=!fullCoder"/>
+    <a-icon v-if="fullScreen" class="full-screen-icon" :type="iconType" @click="() => (fullCoder = !fullCoder)" />
 
     <div class="code-editor-cust full-screen-child">
       <textarea ref="textarea"></textarea>
-      <span @click="nullTipClick" class="null-tip" :class="{'null-tip-hidden':hasCode}" :style="nullTipStyle">{{ placeholderShow }}</span>
+      <span @click="nullTipClick" class="null-tip" :class="{ 'null-tip-hidden': hasCode }" :style="nullTipStyle">{{
+        placeholderShow
+      }}</span>
       <template v-if="languageChange">
         <a-select v-model="mode" size="small" class="code-mode-select" @change="changeMode" placeholder="请选择主题">
-          <a-select-option
-            v-for="mode in modes"
-            :key="mode.value"
-            :value="mode.value">
+          <a-select-option v-for="mode in modes" :key="mode.value" :value="mode.value">
             {{ mode.label }}
           </a-select-option>
         </a-select>
       </template>
-
     </div>
   </div>
 </template>
 
 <script type="text/ecmascript-6">
-  // 引入全局实例
-  import _CodeMirror from 'codemirror'
+// 引入全局实例
+import _CodeMirror from 'codemirror'
 
-  // 核心样式
-  import 'codemirror/lib/codemirror.css'
-  // 引入主题后还需要在 options 中指定主题才会生效 darcula  gruvbox-dark hopscotch  monokai
-  import 'codemirror/theme/panda-syntax.css'
-  //提示css
-  import "codemirror/addon/hint/show-hint.css";
+// 核心样式
+import 'codemirror/lib/codemirror.css'
+// 引入主题后还需要在 options 中指定主题才会生效 darcula  gruvbox-dark hopscotch  monokai
+import 'codemirror/theme/panda-syntax.css'
+//提示css
+import "codemirror/addon/hint/show-hint.css";
 
-  // 需要引入具体的语法高亮库才会有对应的语法高亮效果
-  // codemirror 官方其实支持通过 /addon/mode/loadmode.js 和 /mode/meta.js 来实现动态加载对应语法高亮库
-  // 但 vue 貌似没有无法在实例初始化后再动态加载对应 JS ,所以此处才把对应的 JS 提前引入
-  import 'codemirror/mode/javascript/javascript.js'
-  import 'codemirror/mode/css/css.js'
-  import 'codemirror/mode/xml/xml.js'
-  import 'codemirror/mode/clike/clike.js'
-  import 'codemirror/mode/markdown/markdown.js'
-  import 'codemirror/mode/python/python.js'
-  import 'codemirror/mode/r/r.js'
-  import 'codemirror/mode/shell/shell.js'
-  import 'codemirror/mode/sql/sql.js'
-  import 'codemirror/mode/swift/swift.js'
-  import 'codemirror/mode/vue/vue.js'
+// 需要引入具体的语法高亮库才会有对应的语法高亮效果
+// codemirror 官方其实支持通过 /addon/mode/loadmode.js 和 /mode/meta.js 来实现动态加载对应语法高亮库
+// 但 vue 貌似没有无法在实例初始化后再动态加载对应 JS ,所以此处才把对应的 JS 提前引入
+import 'codemirror/mode/javascript/javascript.js'
+import 'codemirror/mode/css/css.js'
+import 'codemirror/mode/xml/xml.js'
+import 'codemirror/mode/clike/clike.js'
+import 'codemirror/mode/markdown/markdown.js'
+import 'codemirror/mode/python/python.js'
+import 'codemirror/mode/r/r.js'
+import 'codemirror/mode/shell/shell.js'
+import 'codemirror/mode/sql/sql.js'
+import 'codemirror/mode/swift/swift.js'
+import 'codemirror/mode/vue/vue.js'
 
-  // 尝试获取全局实例
-  const CodeMirror = window.CodeMirror || _CodeMirror
+// 尝试获取全局实例
+const CodeMirror = window.CodeMirror || _CodeMirror
 
-  export default {
-    name: 'JCodeEditor',
-    props: {
-      // 外部传入的内容,用于实现双向绑定
-      value: {
-        type: String,
-        default: ''
-      },
-      // 外部传入的语法类型
-      language: {
-        type: String,
-        default: null
-      },
-     languageChange:{
-       type: Boolean,
-       default:false,
-       required:false
-     },
-      placeholder: {
-        type: String,
-        default: null
-      },
-      // 显示行号
-      lineNumbers: {
-        type: Boolean,
-        default: true
-      },
-      // 是否显示全屏按钮
-      fullScreen: {
-        type: Boolean,
-        default: false
-      },
-      // 全屏以后的z-index
-      zIndex: {
-        type: [Number, String],
-        default: 999
-      }
+export default {
+  name: 'JCodeEditor',
+  props: {
+    // 外部传入的内容,用于实现双向绑定
+    value: {
+      type: String,
+      default: ''
     },
-    data () {
-      return {
-        // 内部真实的内容
-        code: '',
-        iconType: 'fullscreen',
-        hasCode:false,
-        // 默认的语法类型
-        mode: 'javascript',
-        // 编辑器实例
-        coder: null,
-        // 默认配置
-        options: {
-          // 缩进格式
-          tabSize: 2,
-          // 主题,对应主题库 JS 需要提前引入
-          theme: 'panda-syntax',
-          line: true,
-         // extraKeys: {'Ctrl': 'autocomplete'},//自定义快捷键
-          hintOptions: {
-            tables: {
-              users: ['name', 'score', 'birthDate'],
-              countries: ['name', 'population', 'size']
-            }
-          },
-        },
-        // 支持切换的语法高亮类型,对应 JS 已经提前引入
-        // 使用的是 MIME-TYPE ,不过作为前缀的 text/ 在后面指定时写死了
-        modes: [{
-          value: 'css',
-          label: 'CSS'
-        }, {
-          value: 'javascript',
-          label: 'Javascript'
-        }, {
-          value: 'html',
-          label: 'XML/HTML'
-        }, {
-          value: 'x-java',
-          label: 'Java'
-        }, {
-          value: 'x-objectivec',
-          label: 'Objective-C'
-        }, {
-          value: 'x-python',
-          label: 'Python'
-        }, {
-          value: 'x-rsrc',
-          label: 'R'
-        }, {
-          value: 'x-sh',
-          label: 'Shell'
-        }, {
-          value: 'x-sql',
-          label: 'SQL'
-        }, {
-          value: 'x-swift',
-          label: 'Swift'
-        }, {
-          value: 'x-vue',
-          label: 'Vue'
-        }, {
-          value: 'markdown',
-          label: 'Markdown'
-        }],
-        // code 编辑器 是否全屏
-        fullCoder: false
-      }
+    // 外部传入的语法类型
+    language: {
+      type: String,
+      default: null
+    },
+   languageChange:{
+     type: Boolean,
+     default:false,
+     required:false
+   },
+    placeholder: {
+      type: String,
+      default: null
+    },
+    // 显示行号
+    lineNumbers: {
+      type: Boolean,
+      default: true
     },
-    watch: {
-      fullCoder:{
-        handler(value) {
-          if(value){
-            this.iconType="fullscreen-exit"
-          }else{
-            this.iconType="fullscreen"
+    // 是否显示全屏按钮
+    fullScreen: {
+      type: Boolean,
+      default: false
+    },
+    // 全屏以后的z-index
+    zIndex: {
+      type: [Number, String],
+      default: 999
+    }
+  },
+  data () {
+    return {
+      // 内部真实的内容
+      code: '',
+      iconType: 'fullscreen',
+      hasCode:false,
+      // 默认的语法类型
+      mode: 'javascript',
+      // 编辑器实例
+      coder: null,
+      // 默认配置
+      options: {
+        // 缩进格式
+        tabSize: 2,
+        // 主题,对应主题库 JS 需要提前引入
+        theme: 'panda-syntax',
+        line: true,
+       // extraKeys: {'Ctrl': 'autocomplete'},//自定义快捷键
+        hintOptions: {
+          tables: {
+            users: ['name', 'score', 'birthDate'],
+            countries: ['name', 'population', 'size']
           }
-        }
+        },
       },
-      // value: {
-      //   immediate: false,
-      //   handler(value) {
-      //     this._getCoder().then(() => {
-      //       this.coder.setValue(value)
-      //     })
-      //   }
-      // },
-      language: {
-        immediate: true,
-        handler(language) {
-          this._getCoder().then(() => {
-            // 尝试从父容器获取语法类型
-            if (language) {
-              // 获取具体的语法类型对象
-              let modeObj = this._getLanguage(language)
+      // 支持切换的语法高亮类型,对应 JS 已经提前引入
+      // 使用的是 MIME-TYPE ,不过作为前缀的 text/ 在后面指定时写死了
+      modes: [{
+        value: 'css',
+        label: 'CSS'
+      }, {
+        value: 'javascript',
+        label: 'Javascript'
+      }, {
+        value: 'html',
+        label: 'XML/HTML'
+      }, {
+        value: 'x-java',
+        label: 'Java'
+      }, {
+        value: 'x-objectivec',
+        label: 'Objective-C'
+      }, {
+        value: 'x-python',
+        label: 'Python'
+      }, {
+        value: 'x-rsrc',
+        label: 'R'
+      }, {
+        value: 'x-sh',
+        label: 'Shell'
+      }, {
+        value: 'x-sql',
+        label: 'SQL'
+      }, {
+        value: 'x-swift',
+        label: 'Swift'
+      }, {
+        value: 'x-vue',
+        label: 'Vue'
+      }, {
+        value: 'markdown',
+        label: 'Markdown'
+      }],
+      // code 编辑器 是否全屏
+      fullCoder: false
+    }
+  },
+  watch: {
+    fullCoder:{
+      handler(value) {
+        if(value){
+          this.iconType="fullscreen-exit"
+        }else{
+          this.iconType="fullscreen"
+        }
+      }
+    },
+    // value: {
+    //   immediate: false,
+    //   handler(value) {
+    //     this._getCoder().then(() => {
+    //       this.coder.setValue(value)
+    //     })
+    //   }
+    // },
+    language: {
+      immediate: true,
+      handler(language) {
+        this._getCoder().then(() => {
+          // 尝试从父容器获取语法类型
+          if (language) {
+            // 获取具体的语法类型对象
+            let modeObj = this._getLanguage(language)
 
-              // 判断父容器传入的语法是否被支持
-              if (modeObj) {
-                this.mode = modeObj.label
-                this.coder.setOption('mode', `text/${modeObj.value}`)
-              }
+            // 判断父容器传入的语法是否被支持
+            if (modeObj) {
+              this.mode = modeObj.label
+              this.coder.setOption('mode', `text/${modeObj.value}`)
             }
-          })
-        }
+          }
+        })
+      }
+    }
+  },
+  computed: {
+    placeholderShow() {
+      if (this.placeholder == null) {
+        return `请在此输入${this.language}代码`
+      } else {
+        return this.placeholder
       }
     },
-    computed: {
-      placeholderShow() {
-        if (this.placeholder == null) {
-          return `请在此输入${this.language}代码`
-        } else {
-          return this.placeholder
-        }
-      },
-      nullTipStyle(){
-        if (this.lineNumbers) {
-          return { left: '36px' }
-        } else {
-          return { left: '12px' }
-        }
-      },
-      // coder 配置
-      coderOptions() {
-        return {
-          tabSize: this.options.tabSize,
-          theme: this.options.theme,
-          lineNumbers: this.lineNumbers,
-          line: true,
-          hintOptions: this.options.hintOptions
-        }
-      },
-      fullScreenParentProps(){
-        let props = {
-          class: ['full-screen-parent', this.fullCoder ? 'full-screen' : ''],
-          style: {}
-        }
-        if (this.fullCoder) {
-          props.style['z-index'] = this.zIndex
-        }
-        return props
+    nullTipStyle(){
+      if (this.lineNumbers) {
+        return { left: '36px' }
+      } else {
+        return { left: '12px' }
       }
     },
-    mounted () {
-      // 初始化
-      this._initialize()
+    // coder 配置
+    coderOptions() {
+      return {
+        tabSize: this.options.tabSize,
+        theme: this.options.theme,
+        lineNumbers: this.lineNumbers,
+        line: true,
+        hintOptions: this.options.hintOptions
+      }
     },
-    methods: {
-      // 初始化
-      _initialize () {
-        // 初始化编辑器实例,传入需要被实例化的文本域对象和默认配置
-        this.coder = CodeMirror.fromTextArea(this.$refs.textarea, this.coderOptions)
-        // 编辑器赋值
-        if(this.value||this.code){
+    fullScreenParentProps(){
+      let props = {
+        class: ['full-screen-parent', this.fullCoder ? 'full-screen' : ''],
+        style: {}
+      }
+      if (this.fullCoder) {
+        props.style['z-index'] = this.zIndex
+      }
+      return props
+    }
+  },
+  mounted () {
+    // 初始化
+    this._initialize()
+  },
+  methods: {
+    // 初始化
+    _initialize () {
+      // 初始化编辑器实例,传入需要被实例化的文本域对象和默认配置
+      this.coder = CodeMirror.fromTextArea(this.$refs.textarea, this.coderOptions)
+      // 编辑器赋值
+      if(this.value||this.code){
+        this.hasCode=true
+        this.coder.setValue(this.value || this.code)
+      }else{
+        this.coder.setValue('')
+        this.hasCode=false
+      }
+      // 支持双向绑定
+      this.coder.on('change', (coder) => {
+        this.code = coder.getValue()
+        if(this.code){
           this.hasCode=true
-          this.coder.setValue(this.value || this.code)
         }else{
-          this.coder.setValue('')
           this.hasCode=false
         }
-        // 支持双向绑定
-        this.coder.on('change', (coder) => {
-          this.code = coder.getValue()
-          if(this.code){
-            this.hasCode=true
-          }else{
-            this.hasCode=false
-          }
-          if (this.$emit) {
-            this.$emit('input', this.code)
-          }
-        })
-        this.coder.on('focus', () => {
+        if (this.$emit) {
+          this.$emit('input', this.code)
+        }
+      })
+      this.coder.on('focus', () => {
+        this.hasCode=true
+      })
+      this.coder.on('blur', () => {
+        if(this.code){
           this.hasCode=true
-        })
-        this.coder.on('blur', () => {
-          if(this.code){
-            this.hasCode=true
-          }else{
-            this.hasCode=false
-          }
-        })
+        }else{
+          this.hasCode=false
+        }
+      })
 
-       /* this.coder.on('cursorActivity',()=>{
-          this.coder.showHint()
-        })*/
+     /* this.coder.on('cursorActivity',()=>{
+        this.coder.showHint()
+      })*/
 
-      },
-      getCodeContent(){
-        return this.code
-      },
-      setCodeContent(val){
-        setTimeout(()=>{
-          if(!val){
-            this.coder.setValue('')
-          }else{
-            this.coder.setValue(val)
-          }
-        },300)
-      },
-      // 获取当前语法类型
-      _getLanguage (language) {
-        // 在支持的语法类型列表中寻找传入的语法类型
-        return this.modes.find((mode) => {
-          // 所有的值都忽略大小写,方便比较
-          let currentLanguage = language.toLowerCase()
-          let currentLabel = mode.label.toLowerCase()
-          let currentValue = mode.value.toLowerCase()
+    },
+    getCodeContent(){
+      return this.code
+    },
+    setCodeContent(val){
+      setTimeout(()=>{
+        if(!val){
+          this.coder.setValue('')
+        }else{
+          this.coder.setValue(val)
+        }
+      },300)
+    },
+    // 获取当前语法类型
+    _getLanguage (language) {
+      // 在支持的语法类型列表中寻找传入的语法类型
+      return this.modes.find((mode) => {
+        // 所有的值都忽略大小写,方便比较
+        let currentLanguage = language.toLowerCase()
+        let currentLabel = mode.label.toLowerCase()
+        let currentValue = mode.value.toLowerCase()
 
-          // 由于真实值可能不规范,例如 java 的真实值是 x-java ,所以讲 value 和 label 同时和传入语法进行比较
-          return currentLabel === currentLanguage || currentValue === currentLanguage
-        })
-      },
-      _getCoder() {
-        let _this = this
-        return new Promise((resolve) => {
-          (function get() {
-            if (_this.coder) {
-              resolve(_this.coder)
-            } else {
-              setTimeout(get, 10)
-            }
-          })()
-        })
-      },
-      // 更改模式
-      changeMode (val) {
-        // 修改编辑器的语法配置
-        this.coder.setOption('mode', `text/${val}`)
+        // 由于真实值可能不规范,例如 java 的真实值是 x-java ,所以讲 value 和 label 同时和传入语法进行比较
+        return currentLabel === currentLanguage || currentValue === currentLanguage
+      })
+    },
+    _getCoder() {
+      let _this = this
+      return new Promise((resolve) => {
+        (function get() {
+          if (_this.coder) {
+            resolve(_this.coder)
+          } else {
+            setTimeout(get, 10)
+          }
+        })()
+      })
+    },
+    // 更改模式
+    changeMode (val) {
+      // 修改编辑器的语法配置
+      this.coder.setOption('mode', `text/${val}`)
 
-        // 获取修改后的语法
-        let label = this._getLanguage(val).label.toLowerCase()
+      // 获取修改后的语法
+      let label = this._getLanguage(val).label.toLowerCase()
 
-        // 允许父容器通过以下函数监听当前的语法值
-        this.$emit('language-change', label)
-      },
-      nullTipClick(){
-        this.coder.focus()
-      }
+      // 允许父容器通过以下函数监听当前的语法值
+      this.$emit('language-change', label)
+    },
+    nullTipClick(){
+      this.coder.focus()
     }
   }
+}
 </script>
 
 <style lang="less">
-  .code-editor-cust{
-    flex-grow:1;
-    display:flex;
-    position:relative;
-    height:100%;
-    .CodeMirror{
-      flex-grow:1;
-      z-index:1;
-      .CodeMirror-code{
-        line-height:19px;
-      }
-
-    }
-    .code-mode-select{
-      position:absolute;
-      z-index:2;
-      right:10px;
-      top:10px;
-      max-width:130px;
-    }
-    .CodeMirror{
-      height: auto;
-      min-height:100%;
-    }
-    .null-tip{
-      position: absolute;
-      top: 4px;
-      left: 36px;
-      z-index: 10;
-      color: #ffffffc9;
-      line-height: initial;
-    }
-    .null-tip-hidden{
-      display: none;
+.code-editor-cust {
+  flex-grow: 1;
+  display: flex;
+  position: relative;
+  height: 100%;
+  .CodeMirror {
+    flex-grow: 1;
+    z-index: 1;
+    .CodeMirror-code {
+      line-height: 19px;
     }
   }
+  .code-mode-select {
+    position: absolute;
+    z-index: 2;
+    right: 10px;
+    top: 10px;
+    max-width: 130px;
+  }
+  .CodeMirror {
+    height: auto;
+    min-height: 100%;
+  }
+  .null-tip {
+    position: absolute;
+    top: 4px;
+    left: 36px;
+    z-index: 10;
+    color: #ffffffc9;
+    line-height: initial;
+  }
+  .null-tip-hidden {
+    display: none;
+  }
+}
 
-  /* 全屏样式 */
-  .full-screen-parent {
-    position: relative;
+/* 全屏样式 */
+.full-screen-parent {
+  position: relative;
 
-    .full-screen-icon {
-      opacity: 0;
-      color: black;
-      width: 20px;
-      height: 20px;
-      line-height: 24px;
-      background-color: white;
-      position: absolute;
-      top: 2px;
-      right: 2px;
-      z-index: 9;
-      cursor: pointer;
-      transition: opacity 0.3s;
-    }
+  .full-screen-icon {
+    opacity: 0;
+    color: black;
+    width: 20px;
+    height: 20px;
+    line-height: 24px;
+    background-color: white;
+    position: absolute;
+    top: 2px;
+    right: 2px;
+    z-index: 9;
+    cursor: pointer;
+    transition: opacity 0.3s;
+  }
 
-    &:hover {
-      .full-screen-icon {
-        opacity: 1;
+  &:hover {
+    .full-screen-icon {
+      opacity: 1;
 
-        &:hover {
-          background-color: rgba(255, 255, 255, 0.88);
-        }
+      &:hover {
+        background-color: rgba(255, 255, 255, 0.88);
       }
     }
+  }
 
-    &.full-screen {
-      position: fixed;
-      top: 10px;
-      left: 10px;
-      width: calc(100% - 20px);
-      height: calc(100% - 20px);
-      padding: 10px;
-      background-color: #f5f5f5;
+  &.full-screen {
+    position: fixed;
+    top: 10px;
+    left: 10px;
+    width: calc(100% - 20px);
+    height: calc(100% - 20px);
+    padding: 10px;
+    background-color: #f5f5f5;
 
-      .full-screen-icon {
-        top: 12px;
-        right: 12px;
-      }
-      .full-screen-child {
-        height: 100%;
-        max-height: 100%;
-        min-height: 100%;
-      }
+    .full-screen-icon {
+      top: 12px;
+      right: 12px;
     }
-
     .full-screen-child {
-      min-height: 120px;
-      max-height: 320px;
-      overflow:hidden;
+      height: 100%;
+      max-height: 100%;
+      min-height: 100%;
     }
+  }
 
+  .full-screen-child {
+    min-height: 120px;
+    max-height: 320px;
+    overflow: hidden;
   }
+}
 
-.CodeMirror-cursor{
-  height:18.4px !important;
+.CodeMirror-cursor {
+  height: 18.4px !important;
 }
-</style>
+</style>

+ 49 - 49
jshERP-web/src/components/jeecg/JCron.vue

@@ -1,65 +1,65 @@
 <template>
   <div class="components-input-demo-presuffix">
     <a-input @click="openModal" placeholder="corn表达式" v-model="cron" @change="handleOK">
-      <a-icon slot="prefix" type="schedule" title="corn控件"/>
-      <a-icon v-if="cron" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/>
+      <a-icon slot="prefix" type="schedule" title="corn控件" />
+      <a-icon v-if="cron" slot="suffix" type="close-circle" @click="handleEmpty" title="清空" />
     </a-input>
     <JCronModal ref="innerVueCron" :data="cron" @ok="handleOK"></JCronModal>
   </div>
 </template>
 <script>
-  import JCronModal from "./modal/JCronModal";
-  export default {
-    name: 'JCron',
-    components: {
-      JCronModal
+import JCronModal from './modal/JCronModal'
+export default {
+  name: 'JCron',
+  components: {
+    JCronModal,
+  },
+  props: {
+    value: {
+      required: false,
+      type: String,
     },
-    props: {
-      value: {
-        required: false,
-        type: String,
-      }
+  },
+  data() {
+    return {
+      cron: this.value,
+    }
+  },
+  watch: {
+    value(val) {
+      this.cron = val
     },
-    data(){
-      return {
-        cron: this.value,
-      }
+  },
+  methods: {
+    openModal() {
+      this.$refs.innerVueCron.show()
     },
-    watch:{
-      value(val){
-        this.cron = val
-      }
+    handleOK(val) {
+      this.cron = val
+      this.$emit('change', this.cron)
+      //this.$emit("change", Object.assign({},  this.cron));
     },
-    methods:{
-      openModal(){
-        this.$refs.innerVueCron.show();
-      },
-      handleOK(val){
-        this.cron = val;
-        this.$emit("change", this.cron);
-        //this.$emit("change", Object.assign({},  this.cron));
-      },
-      handleEmpty(){
-        this.handleOK('')
-      }
+    handleEmpty() {
+      this.handleOK('')
     },
-    model: {
-      prop: 'value',
-      event: 'change'
-    }
-  }
+  },
+  model: {
+    prop: 'value',
+    event: 'change',
+  },
+}
 </script>
 <style scoped>
-  .components-input-demo-presuffix .anticon-close-circle {
-    cursor: pointer;
-    color: #ccc;
-    transition: color 0.3s;
-    font-size: 12px;
-  }
-  .components-input-demo-presuffix .anticon-close-circle:hover {
-    color: #f5222d;
-  }
-  .components-input-demo-presuffix .anticon-close-circle:active {
-    color: #666;
-  }
+.components-input-demo-presuffix .anticon-close-circle {
+  cursor: pointer;
+  color: #ccc;
+  transition: color 0.3s;
+  font-size: 12px;
+}
+.components-input-demo-presuffix .anticon-close-circle:hover {
+  color: #f5222d;
+}
+.components-input-demo-presuffix .anticon-close-circle:active {
+  color: #666;
+}
 </style>

+ 68 - 68
jshERP-web/src/components/jeecg/JDate.vue

@@ -7,80 +7,80 @@
     :showTime="showTime"
     :format="dateFormat"
     :getCalendarContainer="getCalendarContainer"
-    style="width:100%"
+    style="width: 100%"
   />
 </template>
 <script>
-  import moment from 'moment'
-  export default {
-    name: 'JDate',
-    props: {
-      placeholder:{
-        type: String,
-        default: '',
-        required: false
-      },
-      value:{
-        type: String,
-        required: false
-      },
-      dateFormat:{
-        type: String,
-        default: 'YYYY-MM-DD HH:mm:ss',
-        required: false
-      },
-      //此属性可以被废弃了
-      triggerChange:{
-        type: Boolean,
-        required: false,
-        default: false
-      },
-      readOnly:{
-        type: Boolean,
-        required: false,
-        default: false
-      },
-      disabled:{
-        type: Boolean,
-        required: false,
-        default: false
-      },
-      showTime:{
-        type: Boolean,
-        required: false,
-        default: false
-      },
-      getCalendarContainer: {
-        type: Function,
-        default: (node) => node.parentNode
-      }
+import moment from 'moment'
+export default {
+  name: 'JDate',
+  props: {
+    placeholder: {
+      type: String,
+      default: '',
+      required: false,
     },
-    data () {
-      let dateStr = this.value;
-      return {
-        decorator:"",
-        momVal:!dateStr?null:moment(dateStr,this.dateFormat)
-      }
+    value: {
+      type: String,
+      required: false,
     },
-    watch: {
-      value (val) {
-        if(!val){
-          this.momVal = null
-        }else{
-          this.momVal = moment(val,this.dateFormat)
-        }
-      }
+    dateFormat: {
+      type: String,
+      default: 'YYYY-MM-DD HH:mm:ss',
+      required: false,
     },
-    methods: {
-      moment,
-      handleDateChange(mom,dateStr){
-        this.$emit('change', dateStr);
-      }
+    //此属性可以被废弃了
+    triggerChange: {
+      type: Boolean,
+      required: false,
+      default: false,
+    },
+    readOnly: {
+      type: Boolean,
+      required: false,
+      default: false,
+    },
+    disabled: {
+      type: Boolean,
+      required: false,
+      default: false,
     },
-    //2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼
-    model: {
-      prop: 'value',
-      event: 'change'
+    showTime: {
+      type: Boolean,
+      required: false,
+      default: false,
+    },
+    getCalendarContainer: {
+      type: Function,
+      default: (node) => node.parentNode,
+    },
+  },
+  data() {
+    let dateStr = this.value
+    return {
+      decorator: '',
+      momVal: !dateStr ? null : moment(dateStr, this.dateFormat),
     }
-  }
+  },
+  watch: {
+    value(val) {
+      if (!val) {
+        this.momVal = null
+      } else {
+        this.momVal = moment(val, this.dateFormat)
+      }
+    },
+  },
+  methods: {
+    moment,
+    handleDateChange(mom, dateStr) {
+      this.$emit('change', dateStr)
+    },
+  },
+  //2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼
+  model: {
+    prop: 'value',
+    event: 'change',
+  },
+}
 </script>

File diff suppressed because it is too large
+ 400 - 272
jshERP-web/src/components/jeecg/JEditableTable.vue


+ 16 - 18
jshERP-web/src/components/jeecg/JEllipsis.vue

@@ -1,29 +1,27 @@
 <template>
   <a-tooltip placement="topLeft">
     <template slot="title">
-      <span>{{value}}</span>
+      <span>{{ value }}</span>
     </template>
     {{ value | ellipsis(length) }}
   </a-tooltip>
 </template>
 
 <script>
-  export default {
-    name: 'JEllipsis',
-    props: {
-      value: {
-        type: String,
-        required: false,
-      },
-      length: {
-        type: Number,
-        required: false,
-        default: 25,
-      }
-    }
-  }
+export default {
+  name: 'JEllipsis',
+  props: {
+    value: {
+      type: String,
+      required: false,
+    },
+    length: {
+      type: Number,
+      required: false,
+      default: 25,
+    },
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 48 - 44
jshERP-web/src/components/jeecg/JFormContainer.vue

@@ -1,5 +1,5 @@
 <template>
-  <div :class="disabled?'jeecg-form-container-disabled':''">
+  <div :class="disabled ? 'jeecg-form-container-disabled' : ''">
     <fieldset :disabled="disabled">
       <slot name="detail"></slot>
     </fieldset>
@@ -11,51 +11,55 @@
 </template>
 
 <script>
-  /**
-   * 使用方法
-   * 在form下直接写这个组件就行了,
-   *<a-form layout="inline" :form="form" >
-   *     <j-form-container :disabled="true">
-   *         <!-- 表单内容省略..... -->
-   *     </j-form-container>
-   *</a-form>
-   */
-  export default {
-    name: 'JFormContainer',
-    props:{
-      disabled:{
-        type:Boolean,
-        default:false,
-        required:false
-      }
+/**
+ * 使用方法
+ * 在form下直接写这个组件就行了,
+ *<a-form layout="inline" :form="form" >
+ *     <j-form-container :disabled="true">
+ *         <!-- 表单内容省略..... -->
+ *     </j-form-container>
+ *</a-form>
+ */
+export default {
+  name: 'JFormContainer',
+  props: {
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
     },
-    mounted(){
-      console.log("我是表单禁用专用组件,但是我并不支持表单中iframe的内容禁用")
-    }
-  }
+  },
+  mounted() {
+    console.log('我是表单禁用专用组件,但是我并不支持表单中iframe的内容禁用')
+  },
+}
 </script>
 <style>
-  .jeecg-form-container-disabled{
-    cursor: not-allowed;
-  }
-  .jeecg-form-container-disabled fieldset[disabled] {
-    -ms-pointer-events: none;
-    pointer-events: none;
-  }
-  .jeecg-form-container-disabled .ant-select{
-    -ms-pointer-events: none;
-    pointer-events: none;
-  }
+.jeecg-form-container-disabled {
+  cursor: not-allowed;
+}
+.jeecg-form-container-disabled fieldset[disabled] {
+  -ms-pointer-events: none;
+  pointer-events: none;
+}
+.jeecg-form-container-disabled .ant-select {
+  -ms-pointer-events: none;
+  pointer-events: none;
+}
 
-  .jeecg-form-container-disabled .ant-upload-select{display:none}
-  .jeecg-form-container-disabled .ant-upload-list{cursor:grabbing}
-  .jeecg-form-container-disabled fieldset[disabled] .ant-upload-list{
-    -ms-pointer-events: auto !important;
-    pointer-events: auto !important;
-  }
+.jeecg-form-container-disabled .ant-upload-select {
+  display: none;
+}
+.jeecg-form-container-disabled .ant-upload-list {
+  cursor: grabbing;
+}
+.jeecg-form-container-disabled fieldset[disabled] .ant-upload-list {
+  -ms-pointer-events: auto !important;
+  pointer-events: auto !important;
+}
 
-  .jeecg-form-container-disabled .ant-upload-list-item-actions .anticon-delete,
-  .jeecg-form-container-disabled .ant-upload-list-item .anticon-close{
-    display: none;
-  }
-</style>
+.jeecg-form-container-disabled .ant-upload-list-item-actions .anticon-delete,
+.jeecg-form-container-disabled .ant-upload-list-item .anticon-close {
+  display: none;
+}
+</style>

+ 177 - 178
jshERP-web/src/components/jeecg/JGraphicCode.vue

@@ -5,198 +5,197 @@
 </template>
 
 <script>
-  import { getAction } from '@/api/manage'
+import { getAction } from '@/api/manage'
 
-  export default {
-    name: 'JGraphicCode',
-    props: {
-      length:{
-        type: Number,
-        default: 4
-      },
-      fontSizeMin: {
-        type: Number,
-        default: 20
-      },
-      fontSizeMax: {
-        type: Number,
-        default: 45
-      },
-      backgroundColorMin: {
-        type: Number,
-        default: 180
-      },
-      backgroundColorMax: {
-        type: Number,
-        default: 240
-      },
-      colorMin: {
-        type: Number,
-        default: 50
-      },
-      colorMax: {
-        type: Number,
-        default: 160
-      },
-      lineColorMin: {
-        type: Number,
-        default: 40
-      },
-      lineColorMax: {
-        type: Number,
-        default: 180
-      },
-      dotColorMin: {
-        type: Number,
-        default: 0
-      },
-      dotColorMax: {
-        type: Number,
-        default: 255
-      },
-      contentWidth: {
-        type: Number,
-        default:136
-      },
-      contentHeight: {
-        type: Number,
-        default: 38
-      },
-      remote:{
-        type:Boolean,
-        default:false,
-        required:false
-      }
+export default {
+  name: 'JGraphicCode',
+  props: {
+    length: {
+      type: Number,
+      default: 4,
     },
-    methods: {
-      // 生成一个随机数
-      randomNum (min, max) {
-        return Math.floor(Math.random() * (max - min) + min)
-      },
-      // 生成一个随机的颜色
-      randomColor (min, max) {
-        let r = this.randomNum(min, max)
-        let g = this.randomNum(min, max)
-        let b = this.randomNum(min, max)
-        return 'rgb(' + r + ',' + g + ',' + b + ')'
-      },
-      drawPic () {
-        this.randomCode().then(()=>{
-          let canvas = document.getElementById('gc-canvas')
-          let ctx = canvas.getContext('2d')
-          ctx.textBaseline = 'bottom'
-          // 绘制背景
-          ctx.fillStyle = this.randomColor(this.backgroundColorMin, this.backgroundColorMax)
-          ctx.fillRect(0, 0, this.contentWidth, this.contentHeight)
-          // 绘制文字
-          for (let i = 0; i < this.code.length; i++) {
-            this.drawText(ctx, this.code[i], i)
-          }
-          this.drawLine(ctx)
-          this.drawDot(ctx)
-          this.$emit("success",this.code)
-        })
-      },
-      drawText (ctx, txt, i) {
-        ctx.fillStyle = this.randomColor(this.colorMin, this.colorMax)
-        let fontSize = this.randomNum(this.fontSizeMin, this.fontSizeMax)
-        ctx.font = fontSize + 'px SimHei'
-        let padding = 10;
-        let offset = (this.contentWidth-40)/(this.code.length-1)
-        let x=padding;
-        if(i>0){
-          x = padding+(i*offset)
-        }
-        //let x = (i + 1) * (this.contentWidth / (this.code.length + 1))
-        let y = this.randomNum(this.fontSizeMax, this.contentHeight - 5)
-        if(fontSize>40){
-          y=40
-        }
-        var deg = this.randomNum(-10,10)
-        // 修改坐标原点和旋转角度
-        ctx.translate(x, y)
-        ctx.rotate(deg * Math.PI / 180)
-        ctx.fillText(txt, 0, 0)
-        // 恢复坐标原点和旋转角度
-        ctx.rotate(-deg * Math.PI / 180)
-        ctx.translate(-x, -y)
-      },
-      drawLine (ctx) {
-        // 绘制干扰线
-        for (let i = 0; i <1; i++) {
-          ctx.strokeStyle = this.randomColor(this.lineColorMin, this.lineColorMax)
-          ctx.beginPath()
-          ctx.moveTo(this.randomNum(0, this.contentWidth), this.randomNum(0, this.contentHeight))
-          ctx.lineTo(this.randomNum(0, this.contentWidth), this.randomNum(0, this.contentHeight))
-          ctx.stroke()
-        }
-      },
-      drawDot (ctx) {
-        // 绘制干扰点
-        for (let i = 0; i < 100; i++) {
-          ctx.fillStyle = this.randomColor(0, 255)
-          ctx.beginPath()
-          ctx.arc(this.randomNum(0, this.contentWidth), this.randomNum(0, this.contentHeight), 1, 0, 2 * Math.PI)
-          ctx.fill()
+    fontSizeMin: {
+      type: Number,
+      default: 20,
+    },
+    fontSizeMax: {
+      type: Number,
+      default: 45,
+    },
+    backgroundColorMin: {
+      type: Number,
+      default: 180,
+    },
+    backgroundColorMax: {
+      type: Number,
+      default: 240,
+    },
+    colorMin: {
+      type: Number,
+      default: 50,
+    },
+    colorMax: {
+      type: Number,
+      default: 160,
+    },
+    lineColorMin: {
+      type: Number,
+      default: 40,
+    },
+    lineColorMax: {
+      type: Number,
+      default: 180,
+    },
+    dotColorMin: {
+      type: Number,
+      default: 0,
+    },
+    dotColorMax: {
+      type: Number,
+      default: 255,
+    },
+    contentWidth: {
+      type: Number,
+      default: 136,
+    },
+    contentHeight: {
+      type: Number,
+      default: 38,
+    },
+    remote: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  methods: {
+    // 生成一个随机数
+    randomNum(min, max) {
+      return Math.floor(Math.random() * (max - min) + min)
+    },
+    // 生成一个随机的颜色
+    randomColor(min, max) {
+      let r = this.randomNum(min, max)
+      let g = this.randomNum(min, max)
+      let b = this.randomNum(min, max)
+      return 'rgb(' + r + ',' + g + ',' + b + ')'
+    },
+    drawPic() {
+      this.randomCode().then(() => {
+        let canvas = document.getElementById('gc-canvas')
+        let ctx = canvas.getContext('2d')
+        ctx.textBaseline = 'bottom'
+        // 绘制背景
+        ctx.fillStyle = this.randomColor(this.backgroundColorMin, this.backgroundColorMax)
+        ctx.fillRect(0, 0, this.contentWidth, this.contentHeight)
+        // 绘制文字
+        for (let i = 0; i < this.code.length; i++) {
+          this.drawText(ctx, this.code[i], i)
         }
-      },
-      reloadPic(){
-        this.drawPic()
-      },
-      randomCode(){
-        return new Promise((resolve)=>{
-          if(this.remote==true){
-            getAction("/sys/getCheckCode").then(res=>{
-              if(res.success){
+        this.drawLine(ctx)
+        this.drawDot(ctx)
+        this.$emit('success', this.code)
+      })
+    },
+    drawText(ctx, txt, i) {
+      ctx.fillStyle = this.randomColor(this.colorMin, this.colorMax)
+      let fontSize = this.randomNum(this.fontSizeMin, this.fontSizeMax)
+      ctx.font = fontSize + 'px SimHei'
+      let padding = 10
+      let offset = (this.contentWidth - 40) / (this.code.length - 1)
+      let x = padding
+      if (i > 0) {
+        x = padding + i * offset
+      }
+      //let x = (i + 1) * (this.contentWidth / (this.code.length + 1))
+      let y = this.randomNum(this.fontSizeMax, this.contentHeight - 5)
+      if (fontSize > 40) {
+        y = 40
+      }
+      var deg = this.randomNum(-10, 10)
+      // 修改坐标原点和旋转角度
+      ctx.translate(x, y)
+      ctx.rotate((deg * Math.PI) / 180)
+      ctx.fillText(txt, 0, 0)
+      // 恢复坐标原点和旋转角度
+      ctx.rotate((-deg * Math.PI) / 180)
+      ctx.translate(-x, -y)
+    },
+    drawLine(ctx) {
+      // 绘制干扰线
+      for (let i = 0; i < 1; i++) {
+        ctx.strokeStyle = this.randomColor(this.lineColorMin, this.lineColorMax)
+        ctx.beginPath()
+        ctx.moveTo(this.randomNum(0, this.contentWidth), this.randomNum(0, this.contentHeight))
+        ctx.lineTo(this.randomNum(0, this.contentWidth), this.randomNum(0, this.contentHeight))
+        ctx.stroke()
+      }
+    },
+    drawDot(ctx) {
+      // 绘制干扰点
+      for (let i = 0; i < 100; i++) {
+        ctx.fillStyle = this.randomColor(0, 255)
+        ctx.beginPath()
+        ctx.arc(this.randomNum(0, this.contentWidth), this.randomNum(0, this.contentHeight), 1, 0, 2 * Math.PI)
+        ctx.fill()
+      }
+    },
+    reloadPic() {
+      this.drawPic()
+    },
+    randomCode() {
+      return new Promise((resolve) => {
+        if (this.remote == true) {
+          getAction('/sys/getCheckCode')
+            .then((res) => {
+              if (res.success) {
                 this.checkKey = res.result.key
                 this.code = window.atob(res.result.code)
-                resolve();
-              }else{
-                this.$message.error("生成验证码错误,请联系系统管理员")
+                resolve()
+              } else {
+                this.$message.error('生成验证码错误,请联系系统管理员')
                 this.code = 'BUG'
-                resolve();
+                resolve()
               }
-            }).catch(()=>{
-              console.log("生成验证码连接服务器异常")
+            })
+            .catch(() => {
+              console.log('生成验证码连接服务器异常')
               this.code = 'BUG'
-              resolve();
+              resolve()
             })
-          }else{
-            this.randomLocalCode();
-            resolve();
-          }
-        })
-      },
-      randomLocalCode(){
-        let random = ''
-        //去掉了I l i o O
-        let str = "QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890"
-        for(let i = 0; i < this.length; i++) {
-          let index = Math.floor(Math.random()*57);
-          random += str[index];
-        }
-        this.code = random
-      },
-      getLoginParam(){
-        return {
-          checkCode:this.code,
-          checkKey:this.checkKey
+        } else {
+          this.randomLocalCode()
+          resolve()
         }
-      }
+      })
     },
-    mounted () {
-      this.drawPic()
+    randomLocalCode() {
+      let random = ''
+      //去掉了I l i o O
+      let str = 'QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890'
+      for (let i = 0; i < this.length; i++) {
+        let index = Math.floor(Math.random() * 57)
+        random += str[index]
+      }
+      this.code = random
     },
-    data(){
+    getLoginParam() {
       return {
-        code:"",
-        checkKey:""
+        checkCode: this.code,
+        checkKey: this.checkKey,
       }
+    },
+  },
+  mounted() {
+    this.drawPic()
+  },
+  data() {
+    return {
+      code: '',
+      checkKey: '',
     }
-
-  }
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 186 - 189
jshERP-web/src/components/jeecg/JImageUpload.vue

@@ -5,224 +5,221 @@
     :multiple="isMultiple"
     :action="uploadAction"
     :headers="headers"
-    :data="{biz:bizPath}"
+    :data="{ biz: bizPath }"
     :fileList="fileList"
     :beforeUpload="beforeUpload"
     :disabled="disabled"
     :isMultiple="isMultiple"
     :showUploadList="isMultiple"
     @change="handleChange"
-    @preview="handlePreview">
-    <img v-if="!isMultiple && picUrl" :src="getAvatarView()" style="height:104px;max-width:300px"/>
-    <div v-else >
+    @preview="handlePreview"
+  >
+    <img v-if="!isMultiple && picUrl" :src="getAvatarView()" style="height: 104px; max-width: 300px" />
+    <div v-else>
       <a-icon :type="uploadLoading ? 'loading' : 'plus'" />
       <div class="ant-upload-text">{{ text }}</div>
     </div>
     <a-modal :visible="previewVisible" :width="1000" :footer="null" @cancel="handleCancel()">
-      <img alt="example" style="width: 100%" :src="previewImage"/>
+      <img alt="example" style="width: 100%" :src="previewImage" />
     </a-modal>
   </a-upload>
 </template>
 
 <script>
-  import Vue from 'vue'
-  import { ACCESS_TOKEN } from "@/store/mutation-types"
-  import { getFileAccessHttpUrl } from '@/api/manage'
-  import { fileSizeLimit } from '@/api/api'
+import Vue from 'vue'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import { getFileAccessHttpUrl } from '@/api/manage'
+import { fileSizeLimit } from '@/api/api'
 
-  const uidGenerator=()=>{
-    return '-'+parseInt(Math.random()*10000+1,10);
+const uidGenerator = () => {
+  return '-' + parseInt(Math.random() * 10000 + 1, 10)
+}
+const getFileName = (path) => {
+  if (path.lastIndexOf('\\') >= 0) {
+    let reg = new RegExp('\\\\', 'g')
+    path = path.replace(reg, '/')
   }
-  const getFileName=(path)=>{
-    if(path.lastIndexOf("\\")>=0){
-      let reg=new RegExp("\\\\","g");
-      path = path.replace(reg,"/");
+  return path.substring(path.lastIndexOf('/') + 1)
+}
+export default {
+  name: 'JImageUpload',
+  data() {
+    return {
+      uploadAction: window._CONFIG['domianURL'] + '/systemConfig/upload',
+      uploadLoading: false,
+      picUrl: false,
+      headers: {},
+      fileList: [],
+      previewImage: '',
+      previewVisible: false,
+      sizeLimit: 0,
+      uploadGoOn: true,
     }
-    return path.substring(path.lastIndexOf("/")+1);
-  }
-  export default {
-    name: 'JImageUpload',
-    data(){
-      return {
-        uploadAction:window._CONFIG['domianURL']+"/systemConfig/upload",
-        uploadLoading:false,
-        picUrl:false,
-        headers:{},
-        fileList: [],
-        previewImage:"",
-        previewVisible: false,
-        sizeLimit: 0,
-        uploadGoOn:true,
-      }
+  },
+  props: {
+    text: {
+      type: String,
+      required: false,
+      default: '上传',
+    },
+    /*这个属性用于控制文件上传的业务路径*/
+    bizPath: {
+      type: String,
+      required: false,
+      default: 'temp',
+    },
+    value: {
+      type: [String, Array],
+      required: false,
+    },
+    disabled: {
+      type: Boolean,
+      required: false,
+      default: false,
     },
-    props:{
-      text:{
-        type:String,
-        required:false,
-        default:"上传"
-      },
-      /*这个属性用于控制文件上传的业务路径*/
-      bizPath:{
-        type:String,
-        required:false,
-        default:"temp"
-      },
-      value:{
-        type:[String,Array],
-        required:false
-      },
-      disabled:{
-        type:Boolean,
-        required:false,
-        default: false
-      },
-      isMultiple:{
-        type:Boolean,
-        required:false,
-        default: false
+    isMultiple: {
+      type: Boolean,
+      required: false,
+      default: false,
+    },
+  },
+  watch: {
+    value(val) {
+      if (val instanceof Array) {
+        this.initFileList(val.join(','))
+      } else {
+        this.initFileList(val)
       }
     },
-    watch:{
-      value(val){
-        if (val instanceof Array) {
-          this.initFileList(val.join(','))
-        } else {
-          this.initFileList(val)
+  },
+  created() {
+    this.initFileSizeLimit()
+    const token = Vue.ls.get(ACCESS_TOKEN)
+    this.headers = { 'X-Access-Token': token }
+  },
+  methods: {
+    initFileSizeLimit() {
+      fileSizeLimit().then((res) => {
+        if (res.code === 200) {
+          this.sizeLimit = res.data
         }
+      })
+    },
+    initFileList(paths) {
+      if (!paths || paths.length == 0) {
+        this.fileList = []
+        this.picUrl = false
+        return
       }
+      this.picUrl = true
+      let fileList = []
+      let arr = paths.split(',')
+      for (var a = 0; a < arr.length; a++) {
+        let url = getFileAccessHttpUrl('systemConfig/static/' + arr[a])
+        fileList.push({
+          uid: uidGenerator(),
+          name: getFileName(arr[a]),
+          status: 'done',
+          url: url,
+          response: {
+            code: 'history',
+            data: arr[a],
+          },
+        })
+      }
+      this.fileList = fileList
     },
-    created(){
-      this.initFileSizeLimit()
-      const token = Vue.ls.get(ACCESS_TOKEN);
-      this.headers = {"X-Access-Token":token}
+    beforeUpload: function (file) {
+      this.uploadGoOn = true
+      let fileType = file.type
+      let fileSize = file.size
+      if (fileType.indexOf('image') < 0) {
+        this.$message.warning('请上传图片')
+        this.uploadGoOn = false
+        return false
+      }
+      //验证文件大小
+      if (fileSize > this.sizeLimit / 10) {
+        let parseSizeLimit = (this.sizeLimit / 1024 / 1024 / 10).toFixed(2)
+        this.$message.warning('抱歉,图片大小不能超过' + parseSizeLimit + 'M')
+        this.uploadGoOn = false
+        return false
+      }
+      return true
     },
-    methods:{
-      initFileSizeLimit() {
-        fileSizeLimit().then((res)=>{
-          if(res.code === 200) {
-            this.sizeLimit = res.data
-          }
-        })
-      },
-      initFileList(paths){
-        if(!paths || paths.length==0){
-          this.fileList = [];
-          this.picUrl = false;
-          return;
-        }
-        this.picUrl = true;
-        let fileList = [];
-        let arr = paths.split(",")
-        for(var a=0;a<arr.length;a++){
-          let url = getFileAccessHttpUrl('systemConfig/static/' + arr[a]);
-          fileList.push({
-            uid: uidGenerator(),
-            name: getFileName(arr[a]),
-            status: 'done',
-            url: url,
-            response:{
-              code:"history",
-              data:arr[a]
+    handleChange(info) {
+      console.log('--文件列表改变--')
+      if (!info.file.status && this.uploadGoOn === false) {
+        info.fileList.pop()
+      }
+      this.picUrl = false
+      let fileList = info.fileList
+      if (info.file.status === 'done') {
+        if (info.file.response.code === 200) {
+          this.picUrl = true
+          fileList = fileList.map((file) => {
+            if (file.response) {
+              file.url = file.response.data
             }
+            return file
           })
         }
-        this.fileList = fileList
-      },
-      beforeUpload: function(file){
-        this.uploadGoOn=true
-        let fileType = file.type;
-        let fileSize = file.size;
-        if(fileType.indexOf('image')<0){
-          this.$message.warning('请上传图片');
-          this.uploadGoOn=false
-          return false;
-        }
-        //验证文件大小
-        if(fileSize>this.sizeLimit/10) {
-          let parseSizeLimit = (this.sizeLimit/1024/1024/10).toFixed(2)
-          this.$message.warning('抱歉,图片大小不能超过' + parseSizeLimit + 'M');
-          this.uploadGoOn=false
-          return false;
-        }
-        return true
-      },
-      handleChange(info) {
-        console.log("--文件列表改变--")
-        if(!info.file.status && this.uploadGoOn === false){
-          info.fileList.pop();
-        }
-        this.picUrl = false;
-        let fileList = info.fileList
-        if(info.file.status==='done'){
-          if(info.file.response.code === 200){
-            this.picUrl = true;
-            fileList = fileList.map((file) => {
-              if (file.response) {
-                file.url = file.response.data;
-              }
-              return file;
-            });
-          }
-          //this.$message.success(`${info.file.name} 上传成功!`);
-        }else if (info.file.status === 'error') {
-          this.$message.error(`${info.file.name} 上传失败.`);
-        }else if(info.file.status === 'removed'){
-          this.handleDelete(info.file)
-        }
-        this.fileList = fileList
-        if(info.file.status==='done' || info.file.status === 'removed'){
-          this.handlePathChange()
-        }
-      },
-      // 预览
-      handlePreview (file) {
-        this.previewImage = file.url || file.thumbUrl
-        this.previewVisible = true
-      },
-      getAvatarView(){
-        if(this.fileList.length>0){
-          let url = this.fileList[0].url
-          return url
-        }
-      },
-      handlePathChange(){
-        let uploadFiles = this.fileList
-        let path = ''
-        if(!uploadFiles || uploadFiles.length==0){
-          path = ''
-        }
-        let arr = [];
-        if(!this.isMultiple){
-          arr.push(uploadFiles[uploadFiles.length-1].response.data)
-        }else{
-          for(var a=0;a<uploadFiles.length;a++){
-            arr.push(uploadFiles[a].response.data)
-          }
-        }
-        if(arr.length>0){
-          path = arr.join(",")
+        //this.$message.success(`${info.file.name} 上传成功!`);
+      } else if (info.file.status === 'error') {
+        this.$message.error(`${info.file.name} 上传失败.`)
+      } else if (info.file.status === 'removed') {
+        this.handleDelete(info.file)
+      }
+      this.fileList = fileList
+      if (info.file.status === 'done' || info.file.status === 'removed') {
+        this.handlePathChange()
+      }
+    },
+    // 预览
+    handlePreview(file) {
+      this.previewImage = file.url || file.thumbUrl
+      this.previewVisible = true
+    },
+    getAvatarView() {
+      if (this.fileList.length > 0) {
+        let url = this.fileList[0].url
+        return url
+      }
+    },
+    handlePathChange() {
+      let uploadFiles = this.fileList
+      let path = ''
+      if (!uploadFiles || uploadFiles.length == 0) {
+        path = ''
+      }
+      let arr = []
+      if (!this.isMultiple) {
+        arr.push(uploadFiles[uploadFiles.length - 1].response.data)
+      } else {
+        for (var a = 0; a < uploadFiles.length; a++) {
+          arr.push(uploadFiles[a].response.data)
         }
-        this.$emit('change', path);
-      },
-      handleDelete(file){
-        //如有需要新增 删除逻辑
-        console.log(file)
-      },
-      handleCancel() {
-        this.close();
-        this.previewVisible = false;
-      },
-      close () {
-
-      },
+      }
+      if (arr.length > 0) {
+        path = arr.join(',')
+      }
+      this.$emit('change', path)
     },
-    model: {
-      prop: 'value',
-      event: 'change'
-    }
-  }
+    handleDelete(file) {
+      //如有需要新增 删除逻辑
+      console.log(file)
+    },
+    handleCancel() {
+      this.close()
+      this.previewVisible = false
+    },
+    close() {},
+  },
+  model: {
+    prop: 'value',
+    event: 'change',
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 79 - 92
jshERP-web/src/components/jeecg/JImportModal.vue

@@ -1,18 +1,13 @@
 <template>
-  <a-modal
-    title="导入EXCEL"
-    :width="600"
-    :visible="visible"
-    :confirmLoading="uploading"
-    @cancel="handleClose">
-
+  <a-modal title="导入EXCEL" :width="600" :visible="visible" :confirmLoading="uploading" @cancel="handleClose">
     <a-upload
       name="file"
       :multiple="true"
       accept=".xls,.xlsx"
       :fileList="fileList"
       :remove="handleRemove"
-      :beforeUpload="beforeUpload">
+      :beforeUpload="beforeUpload"
+    >
       <a-button>
         <a-icon type="upload" />
         选择导入文件
@@ -21,103 +16,95 @@
 
     <template slot="footer">
       <a-button @click="handleClose">关闭</a-button>
-      <a-button
-        type="primary"
-        @click="handleImport"
-        :disabled="fileList.length === 0"
-        :loading="uploading">
+      <a-button type="primary" @click="handleImport" :disabled="fileList.length === 0" :loading="uploading">
         {{ uploading ? '上传中...' : '开始上传' }}
       </a-button>
     </template>
-
   </a-modal>
 </template>
 
 <script>
-  import { postAction } from '@/api/manage'
-  export default {
-    name: 'JImportModal',
-    props:{
-      url:{
-        type: String,
-        default: '',
-        required: false
-      },
-      biz:{
-        type: String,
-        default: '',
-        required: false
-      }
+import { postAction } from '@/api/manage'
+export default {
+  name: 'JImportModal',
+  props: {
+    url: {
+      type: String,
+      default: '',
+      required: false,
     },
-    data(){
-      return {
-        visible:false,
-        uploading:false,
-        fileList:[],
-        uploadAction:'',
-        foreignKeys:''
-      }
+    biz: {
+      type: String,
+      default: '',
+      required: false,
     },
-    watch: {
-      url (val) {
-        if(val){
-         this.uploadAction = window._CONFIG['domianURL']+val
-        }
+  },
+  data() {
+    return {
+      visible: false,
+      uploading: false,
+      fileList: [],
+      uploadAction: '',
+      foreignKeys: '',
+    }
+  },
+  watch: {
+    url(val) {
+      if (val) {
+        this.uploadAction = window._CONFIG['domianURL'] + val
       }
     },
-    created () {
-      this.uploadAction = window._CONFIG['domianURL']+this.url
-    },
+  },
+  created() {
+    this.uploadAction = window._CONFIG['domianURL'] + this.url
+  },
 
-    methods:{
-      handleClose(){
-        this.visible=false
-      },
-      show(arg){
-        this.fileList = []
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    show(arg) {
+      this.fileList = []
+      this.uploading = false
+      this.visible = true
+      this.foreignKeys = arg
+    },
+    handleRemove(file) {
+      const index = this.fileList.indexOf(file)
+      const newFileList = this.fileList.slice()
+      newFileList.splice(index, 1)
+      this.fileList = newFileList
+    },
+    beforeUpload(file) {
+      this.fileList = [...this.fileList, file]
+      return false
+    },
+    handleImport() {
+      const { fileList } = this
+      const formData = new FormData()
+      if (this.biz) {
+        formData.append('isSingleTableImport', this.biz)
+      }
+      if (this.foreignKeys && this.foreignKeys.length > 0) {
+        formData.append('foreignKeys', this.foreignKeys)
+      }
+      fileList.forEach((file) => {
+        formData.append('files[]', file)
+      })
+      this.uploading = true
+      postAction(this.uploadAction, formData).then((res) => {
         this.uploading = false
-        this.visible = true
-        this.foreignKeys = arg;
-      },
-      handleRemove(file) {
-        const index = this.fileList.indexOf(file);
-        const newFileList = this.fileList.slice();
-        newFileList.splice(index, 1);
-        this.fileList = newFileList
-      },
-      beforeUpload(file) {
-        this.fileList = [...this.fileList, file]
-        return false;
-      },
-      handleImport() {
-        const { fileList } = this;
-        const formData = new FormData();
-        if(this.biz){
-          formData.append('isSingleTableImport',this.biz);
+        if (res.success) {
+          this.$message.success(res.message)
+          this.visible = false
+          this.$emit('ok')
+        } else {
+          this.$message.warning(res.message)
         }
-        if(this.foreignKeys && this.foreignKeys.length>0){
-          formData.append('foreignKeys',this.foreignKeys);
-        }
-        fileList.forEach((file) => {
-          formData.append('files[]', file);
-        });
-        this.uploading = true
-        postAction(this.uploadAction, formData).then((res) => {
-          this.uploading = false
-          if(res.success){
-            this.$message.success(res.message)
-            this.visible=false
-            this.$emit('ok')
-          }else{
-            this.$message.warning(res.message)
-          }
-        })
-      }
-
-    }
-  }
+      })
+    },
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 79 - 81
jshERP-web/src/components/jeecg/JInput.vue

@@ -3,98 +3,96 @@
 </template>
 
 <script>
-  const JINPUT_QUERY_LIKE = 'like';
-  const JINPUT_QUERY_NE = 'ne';
-  const JINPUT_QUERY_GE = 'ge'; //大于等于
-  const JINPUT_QUERY_LE = 'le'; //小于等于
-  
-  export default {
-    name: 'JInput',
-    props:{
-      value:{
-        type:String,
-        required:false
-      },
-      type:{
-        type:String,
-        required:false,
-        default:JINPUT_QUERY_LIKE
-      },
-      placeholder:{
-        type:String,
-        required:false,
-        default:''
-      }
-    },
-    watch:{
-      value:{
-        immediate:true,
-        handler:function(){
-          this.initVal();
-        }
-      },
-      // update-begin author:sunjianlei date:20200225 for:当 type 变化的时候重新计算值 ------
-      type() {
-        this.backValue({ target: { value: this.inputVal } })
-      },
-      // update-end author:sunjianlei date:20200225 for:当 type 变化的时候重新计算值 ------
+const JINPUT_QUERY_LIKE = 'like'
+const JINPUT_QUERY_NE = 'ne'
+const JINPUT_QUERY_GE = 'ge' //大于等于
+const JINPUT_QUERY_LE = 'le' //小于等于
+
+export default {
+  name: 'JInput',
+  props: {
+    value: {
+      type: String,
+      required: false,
     },
-    model: {
-      prop: 'value',
-      event: 'change'
+    type: {
+      type: String,
+      required: false,
+      default: JINPUT_QUERY_LIKE,
     },
-    data(){
-      return {
-        inputVal:''
-      }
+    placeholder: {
+      type: String,
+      required: false,
+      default: '',
     },
-    methods:{
-      initVal(){
-        if(!this.value){
-          this.inputVal = ''
-        }else{
-          let text = this.value
-          switch (this.type) {
-            case JINPUT_QUERY_LIKE:
-              text = text.substring(1,text.length-1);
-              break;
-            case JINPUT_QUERY_NE:
-              text = text.substring(1);
-              break;
-            case JINPUT_QUERY_GE:
-              text = text.substring(2);
-              break;
-            case JINPUT_QUERY_LE:
-              text = text.substring(2);
-              break;
-            default:
-          }
-          this.inputVal = text
-        }
+  },
+  watch: {
+    value: {
+      immediate: true,
+      handler: function () {
+        this.initVal()
       },
-      backValue(e){
-        let text = e.target.value
+    },
+    // update-begin author:sunjianlei date:20200225 for:当 type 变化的时候重新计算值 ------
+    type() {
+      this.backValue({ target: { value: this.inputVal } })
+    },
+    // update-end author:sunjianlei date:20200225 for:当 type 变化的时候重新计算值 ------
+  },
+  model: {
+    prop: 'value',
+    event: 'change',
+  },
+  data() {
+    return {
+      inputVal: '',
+    }
+  },
+  methods: {
+    initVal() {
+      if (!this.value) {
+        this.inputVal = ''
+      } else {
+        let text = this.value
         switch (this.type) {
           case JINPUT_QUERY_LIKE:
-            text = "*"+text+"*";
-            break;
+            text = text.substring(1, text.length - 1)
+            break
           case JINPUT_QUERY_NE:
-            text = "!"+text;
-            break;
+            text = text.substring(1)
+            break
           case JINPUT_QUERY_GE:
-            text = ">="+text;
-            break;
+            text = text.substring(2)
+            break
           case JINPUT_QUERY_LE:
-            text = "<="+text;
-            break;
+            text = text.substring(2)
+            break
           default:
         }
-        this.$emit("change",text)
+        this.inputVal = text
       }
-    }
-  }
+    },
+    backValue(e) {
+      let text = e.target.value
+      switch (this.type) {
+        case JINPUT_QUERY_LIKE:
+          text = '*' + text + '*'
+          break
+        case JINPUT_QUERY_NE:
+          text = '!' + text
+          break
+        case JINPUT_QUERY_GE:
+          text = '>=' + text
+          break
+        case JINPUT_QUERY_LE:
+          text = '<=' + text
+          break
+        default:
+      }
+      this.$emit('change', text)
+    },
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 181 - 177
jshERP-web/src/components/jeecg/JModal/index.vue

@@ -6,7 +6,7 @@
       :style="getStyle(modalStyle)"
       :visible="visible"
       :getContainer="() => $refs.container"
-      :maskStyle="{'top':'93px','left':'154px'}"
+      :maskStyle="{ top: '93px', left: '154px' }"
       :wrapClassName="wrapClassNameInfo()"
       :mask="isDesktop()"
       :maskClosable="false"
@@ -15,7 +15,6 @@
       @ok="handleOk"
       @cancel="handleCancel"
     >
-
       <slot></slot>
 
       <template v-if="!isNoTitle" slot="title">
@@ -25,11 +24,24 @@
           </a-col>
           <a-col class="right">
             <a-tooltip title="新手引导">
-              <a-button v-if="switchHelp" @click="handleHelp" style="right:112px;" class="ant-modal-close ant-modal-close-x"
-                        ghost type="link" icon="question-circle"/>
+              <a-button
+                v-if="switchHelp"
+                @click="handleHelp"
+                style="right: 112px"
+                class="ant-modal-close ant-modal-close-x"
+                ghost
+                type="link"
+                icon="question-circle"
+              />
             </a-tooltip>
-            <a-button v-if="switchFullscreen" @click="toggleFullscreen" class="ant-modal-close ant-modal-close-x"
-                      ghost type="link" :icon="fullscreenButtonIcon"/>
+            <a-button
+              v-if="switchFullscreen"
+              @click="toggleFullscreen"
+              class="ant-modal-close ant-modal-close-x"
+              ghost
+              type="link"
+              :icon="fullscreenButtonIcon"
+            />
           </a-col>
         </a-row>
       </template>
@@ -43,214 +55,206 @@
       <template v-for="slotName of slotsKeys" v-slot:[slotName]>
         <slot :name="slotName"></slot>
       </template>
-
     </a-modal>
   </div>
 </template>
 
 <script>
+import { getClass, getStyle } from '@/utils/props-util'
+import { triggerWindowResizeEvent, handleIntroJs } from '@/utils/util'
+import { mixinDevice } from '@/utils/mixin'
+import Vue from 'vue'
 
-  import { getClass, getStyle } from '@/utils/props-util'
-  import { triggerWindowResizeEvent, handleIntroJs } from "@/utils/util"
-  import {mixinDevice} from '@/utils/mixin'
-  import Vue from 'vue'
-
-  export default {
-    name: 'JModal',
-    mixins: [mixinDevice],
-    props: {
-      title: String,
-      // 可使用 .sync 修饰符
-      visible: Boolean,
-      // 前缀代号
-      prefixNo: String,
-      // 是否全屏弹窗,当全屏时无论如何都会禁止 body 滚动。可使用 .sync 修饰符
-      fullscreen: {
-        type: Boolean,
-        default: false
-      },
-      // 是否允许展示新手引导(允许后右上角会出现一个按钮)
-      switchHelp: {
-        type: Boolean,
-        default: false
-      },
-      // 是否允许切换全屏(允许后右上角会出现一个按钮)
-      switchFullscreen: {
-        type: Boolean,
-        default: false
-      },
-      // 点击确定按钮的时候是否关闭弹窗
-      okClose: {
-        type: Boolean,
-        default: true
-      },
+export default {
+  name: 'JModal',
+  mixins: [mixinDevice],
+  props: {
+    title: String,
+    // 可使用 .sync 修饰符
+    visible: Boolean,
+    // 前缀代号
+    prefixNo: String,
+    // 是否全屏弹窗,当全屏时无论如何都会禁止 body 滚动。可使用 .sync 修饰符
+    fullscreen: {
+      type: Boolean,
+      default: false,
+    },
+    // 是否允许展示新手引导(允许后右上角会出现一个按钮)
+    switchHelp: {
+      type: Boolean,
+      default: false,
     },
-    data() {
+    // 是否允许切换全屏(允许后右上角会出现一个按钮)
+    switchFullscreen: {
+      type: Boolean,
+      default: false,
+    },
+    // 点击确定按钮的时候是否关闭弹窗
+    okClose: {
+      type: Boolean,
+      default: true,
+    },
+  },
+  data() {
+    return {
+      // 内部使用的 slots ,不再处理
+      usedSlots: ['title'],
+      // 实际控制是否全屏的参数
+      innerFullscreen: this.fullscreen,
+    }
+  },
+  computed: {
+    // 一些未处理的参数或特殊处理的参数绑定到 a-modal 上
+    _attrs() {
+      let attrs = { ...this.$attrs }
+      // 如果全屏就将宽度设为 100%
+      if (this.innerFullscreen) {
+        attrs['width'] = '100%'
+      }
+      return attrs
+    },
+    modalClass() {
       return {
-        // 内部使用的 slots ,不再处理
-        usedSlots: ['title'],
-        // 实际控制是否全屏的参数
-        innerFullscreen: this.fullscreen,
+        'j-modal-box': true,
+        fullscreen: this.innerFullscreen,
+        'no-title': this.isNoTitle,
+        'no-footer': this.isNoFooter,
       }
     },
-    computed: {
-      // 一些未处理的参数或特殊处理的参数绑定到 a-modal 上
-      _attrs() {
-        let attrs = { ...this.$attrs }
-        // 如果全屏就将宽度设为 100%
-        if (this.innerFullscreen) {
-          attrs['width'] = '100%'
-        }
-        return attrs
-      },
-      modalClass() {
-        return {
-          'j-modal-box': true,
-          'fullscreen': this.innerFullscreen,
-          'no-title': this.isNoTitle,
-          'no-footer': this.isNoFooter,
-        }
-      },
-      modalStyle() {
-        let style = {}
-        // 如果全屏就将top设为 0
-        if (this.innerFullscreen) {
-          style['top'] = '0'
-        }
-        return style
-      },
-      isNoTitle() {
-        return !this.title && !this.allSlotsKeys.includes('title')
-      },
-      isNoFooter() {
-        return this._attrs['footer'] === null
-      },
-      slotsKeys() {
-        return Object.keys(this.$slots).filter(key => !this.usedSlots.includes(key))
-      },
-      scopedSlotsKeys() {
-        return Object.keys(this.$scopedSlots).filter(key => !this.usedSlots.includes(key))
-      },
-      allSlotsKeys() {
-        return this.slotsKeys.concat(this.scopedSlotsKeys)
-      },
-      // 切换全屏的按钮图标
-      fullscreenButtonIcon() {
-        return this.innerFullscreen ? 'fullscreen-exit' : 'fullscreen'
-      },
+    modalStyle() {
+      let style = {}
+      // 如果全屏就将top设为 0
+      if (this.innerFullscreen) {
+        style['top'] = '0'
+      }
+      return style
     },
-    watch: {
-      visible() {
-        if (this.visible) {
-          this.innerFullscreen = this.fullscreen
-        }
-      },
-      innerFullscreen(val) {
-        this.$emit('update:fullscreen', val)
-      },
+    isNoTitle() {
+      return !this.title && !this.allSlotsKeys.includes('title')
+    },
+    isNoFooter() {
+      return this._attrs['footer'] === null
+    },
+    slotsKeys() {
+      return Object.keys(this.$slots).filter((key) => !this.usedSlots.includes(key))
+    },
+    scopedSlotsKeys() {
+      return Object.keys(this.$scopedSlots).filter((key) => !this.usedSlots.includes(key))
+    },
+    allSlotsKeys() {
+      return this.slotsKeys.concat(this.scopedSlotsKeys)
+    },
+    // 切换全屏的按钮图标
+    fullscreenButtonIcon() {
+      return this.innerFullscreen ? 'fullscreen-exit' : 'fullscreen'
+    },
+  },
+  watch: {
+    visible() {
+      if (this.visible) {
+        this.innerFullscreen = this.fullscreen
+      }
+    },
+    innerFullscreen(val) {
+      this.$emit('update:fullscreen', val)
+    },
+  },
+  methods: {
+    getClass(clazz) {
+      return { ...getClass(this), ...clazz }
+    },
+    getStyle(style) {
+      return { ...getStyle(this), ...style }
     },
-    methods: {
-
-      getClass(clazz) {
-        return { ...getClass(this), ...clazz }
-      },
-      getStyle(style) {
-        return { ...getStyle(this), ...style }
-      },
 
-      close() {
-        this.$emit('update:visible', false)
-      },
+    close() {
+      this.$emit('update:visible', false)
+    },
 
-      handleOk() {
-        if (this.okClose) {
-          this.close()
-        }
-      },
-      handleCancel() {
+    handleOk() {
+      if (this.okClose) {
         this.close()
-      },
-
-      /** 新手引导 */
-      handleHelp() {
-        let element = 'intro_cache_' + this.prefixNo
-        Vue.ls.remove(element)
-        handleIntroJs(this.prefixNo, 1)
-      },
+      }
+    },
+    handleCancel() {
+      this.close()
+    },
 
-      /** 切换全屏 */
-      toggleFullscreen() {
-        this.innerFullscreen = !this.innerFullscreen
-        triggerWindowResizeEvent()
-      },
+    /** 新手引导 */
+    handleHelp() {
+      let element = 'intro_cache_' + this.prefixNo
+      Vue.ls.remove(element)
+      handleIntroJs(this.prefixNo, 1)
+    },
 
-    }
-  }
+    /** 切换全屏 */
+    toggleFullscreen() {
+      this.innerFullscreen = !this.innerFullscreen
+      triggerWindowResizeEvent()
+    },
+  },
+}
 </script>
 
 <style lang="less">
-  .j-modal-box {
+.j-modal-box {
+  &.fullscreen {
+    top: 0;
+    left: 0;
+    padding: 0;
 
-    &.fullscreen {
-      top: 0;
-      left: 0;
-      padding: 0;
+    height: 100vh;
 
+    > .ant-modal-content {
       height: 100vh;
+      border-radius: 0;
 
-       >.ant-modal-content {
-        height: 100vh;
-        border-radius: 0;
-
-         >.ant-modal-body {
-          /* title 和 footer 各占 55px */
-          height: calc(100% - 55px - 55px);
-          overflow: auto;
-        }
-      }
-
-      >.no-title, &.no-footer {
-        .ant-modal-body {
-          height: calc(100% - 55px);
-        }
+      > .ant-modal-body {
+        /* title 和 footer 各占 55px */
+        height: calc(100% - 55px - 55px);
+        overflow: auto;
       }
+    }
 
-      >.no-title.no-footer {
-        .ant-modal-body {
-          height: 100%;
-        }
+    > .no-title,
+    &.no-footer {
+      .ant-modal-body {
+        height: calc(100% - 55px);
       }
-
     }
 
-    .j-modal-title-row {
-      .left {
-        width: calc(100% - 56px - 56px);
+    > .no-title.no-footer {
+      .ant-modal-body {
+        height: 100%;
       }
+    }
+  }
 
-      .right {
-        width: 56px;
-        position: inherit;
+  .j-modal-title-row {
+    .left {
+      width: calc(100% - 56px - 56px);
+    }
 
-        .ant-modal-close {
-          right: 56px;
-          color: rgba(0, 0, 0, 0.45);
+    .right {
+      width: 56px;
+      position: inherit;
 
-          &:hover {
-            color: rgba(0, 0, 0, 0.75);
-          }
+      .ant-modal-close {
+        right: 56px;
+        color: rgba(0, 0, 0, 0.45);
 
+        &:hover {
+          color: rgba(0, 0, 0, 0.75);
         }
       }
     }
-
-
   }
+}
 
-  @media (max-width: 767px) {
-    .j-modal-box.fullscreen {
-      margin: 0;
-      max-width: 100vw;
-    }
+@media (max-width: 767px) {
+  .j-modal-box.fullscreen {
+    margin: 0;
+    max-width: 100vw;
   }
-</style>
+}
+</style>

+ 48 - 52
jshERP-web/src/components/jeecg/JSelectMultiple.vue

@@ -1,66 +1,62 @@
 <template>
   <a-select :value="arrayValue" @change="onChange" mode="multiple" :placeholder="placeholder">
-    <a-select-option
-      v-for="(item,index) in options"
-      :key="index"
-      :value="item.value">
+    <a-select-option v-for="(item, index) in options" :key="index" :value="item.value">
       {{ item.text || item.label }}
     </a-select-option>
   </a-select>
 </template>
 
 <script>
-  //option {label:,value:}
-  export default {
-    name: 'JSelectMultiple',
-    props: {
-      placeholder:{
-        type: String,
-        default:'',
-        required: false
-      },
-      value:{
-        type: String,
-        required: false
-      },
-      readOnly:{
-        type: Boolean,
-        required: false,
-        default: false
-      },
-      options:{
-        type: Array,
-        required: true
-      },
-      triggerChange:{
-        type: Boolean,
-        required: false,
-        default: false
-      }
+//option {label:,value:}
+export default {
+  name: 'JSelectMultiple',
+  props: {
+    placeholder: {
+      type: String,
+      default: '',
+      required: false,
     },
-    data(){
-      return {
-        arrayValue:!this.value?[]:this.value.split(",")
-      }
+    value: {
+      type: String,
+      required: false,
+    },
+    readOnly: {
+      type: Boolean,
+      required: false,
+      default: false,
+    },
+    options: {
+      type: Array,
+      required: true,
     },
-    watch:{
-      value (val) {
-        if(!val){
-          this.arrayValue = []
-        }else{
-          this.arrayValue = this.value.split(",")
-        }
+    triggerChange: {
+      type: Boolean,
+      required: false,
+      default: false,
+    },
+  },
+  data() {
+    return {
+      arrayValue: !this.value ? [] : this.value.split(','),
+    }
+  },
+  watch: {
+    value(val) {
+      if (!val) {
+        this.arrayValue = []
+      } else {
+        this.arrayValue = this.value.split(',')
       }
     },
-    methods:{
-      onChange (selectedValue) {
-        if(this.triggerChange){
-          this.$emit('change', selectedValue.join(","));
-        }else{
-          this.$emit('input', selectedValue.join(","));
-        }
-      },
+  },
+  methods: {
+    onChange(selectedValue) {
+      if (this.triggerChange) {
+        this.$emit('change', selectedValue.join(','))
+      } else {
+        this.$emit('input', selectedValue.join(','))
+      }
     },
-
-  }
+  },
+}
 </script>

+ 113 - 102
jshERP-web/src/components/jeecg/JSlider.vue

@@ -1,116 +1,127 @@
 <template>
   <div class="drag" ref="dragDiv">
     <div class="drag_bg"></div>
-    <div class="drag_text">{{confirmWords}}</div>
-    <div ref="moveDiv" @mousedown="mousedownFn($event)" :class="{'handler_ok_bg':confirmSuccess}" class="handler handler_bg" style="border: 0.5px solid #fff;height: 34px;position: absolute;top: 0px;left: 0px;"></div>
+    <div class="drag_text">{{ confirmWords }}</div>
+    <div
+      ref="moveDiv"
+      @mousedown="mousedownFn($event)"
+      :class="{ handler_ok_bg: confirmSuccess }"
+      class="handler handler_bg"
+      style="border: 0.5px solid #fff; height: 34px; position: absolute; top: 0px; left: 0px"
+    ></div>
   </div>
 </template>
 
 <script>
-  export default {
-    name:"JSlider",
-    data(){
-      return {
-        beginClientX:0,           /*距离屏幕左端距离*/
-        mouseMoveStata:false,     /*触发拖动状态  判断*/
-        maxwidth:'',               /*拖动最大宽度,依据滑块宽度算出来的*/
-        confirmWords:'拖动滑块验证',   /*滑块文字*/
-        confirmSuccess:false           /*验证成功判断*/
-      }
+export default {
+  name: 'JSlider',
+  data() {
+    return {
+      beginClientX: 0 /*距离屏幕左端距离*/,
+      mouseMoveStata: false /*触发拖动状态  判断*/,
+      maxwidth: '' /*拖动最大宽度,依据滑块宽度算出来的*/,
+      confirmWords: '拖动滑块验证' /*滑块文字*/,
+      confirmSuccess: false /*验证成功判断*/,
+    }
+  },
+  methods: {
+    isSuccess() {
+      return this.confirmSuccess
     },
-    methods: {
-      isSuccess(){
-        return this.confirmSuccess
-      },
-      mousedownFn:function (e) {
-        if(!this.confirmSuccess){
-          e.preventDefault && e.preventDefault();   //阻止文字选中等 浏览器默认事件
-          this.mouseMoveStata = true;
-          this.beginClientX = e.clientX;
-        }
-      },        //mousedoen 事件
-      successFunction(){
-        this.confirmSuccess = true
-        this.confirmWords = '验证通过';
-        if(window.addEventListener){
-          document.getElementsByTagName('html')[0].removeEventListener('mousemove',this.mouseMoveFn);
-          document.getElementsByTagName('html')[0].removeEventListener('mouseup',this.moseUpFn);
-        }else {
-          document.getElementsByTagName('html')[0].removeEventListener('mouseup',()=>{});
-        }
-        document.getElementsByClassName('drag_text')[0].style.color = '#fff'
-        document.getElementsByClassName('handler')[0].style.left = this.maxwidth + 'px';
-        document.getElementsByClassName('drag_bg')[0].style.width = this.maxwidth + 'px';
+    mousedownFn: function (e) {
+      if (!this.confirmSuccess) {
+        e.preventDefault && e.preventDefault() //阻止文字选中等 浏览器默认事件
+        this.mouseMoveStata = true
+        this.beginClientX = e.clientX
+      }
+    }, //mousedoen 事件
+    successFunction() {
+      this.confirmSuccess = true
+      this.confirmWords = '验证通过'
+      if (window.addEventListener) {
+        document.getElementsByTagName('html')[0].removeEventListener('mousemove', this.mouseMoveFn)
+        document.getElementsByTagName('html')[0].removeEventListener('mouseup', this.moseUpFn)
+      } else {
+        document.getElementsByTagName('html')[0].removeEventListener('mouseup', () => {})
+      }
+      document.getElementsByClassName('drag_text')[0].style.color = '#fff'
+      document.getElementsByClassName('handler')[0].style.left = this.maxwidth + 'px'
+      document.getElementsByClassName('drag_bg')[0].style.width = this.maxwidth + 'px'
 
-        this.$emit("onSuccess",true)
-      },                //验证成功函数
-      mouseMoveFn(e){
-        if(this.mouseMoveStata){
-          let width = e.clientX - this.beginClientX;
-          if(width>0 && width<=this.maxwidth){
-            document.getElementsByClassName('handler')[0].style.left = width + 'px';
-            document.getElementsByClassName('drag_bg')[0].style.width = width + 'px';
-          }else if(width>this.maxwidth){
-            this.successFunction();
-          }
+      this.$emit('onSuccess', true)
+    }, //验证成功函数
+    mouseMoveFn(e) {
+      if (this.mouseMoveStata) {
+        let width = e.clientX - this.beginClientX
+        if (width > 0 && width <= this.maxwidth) {
+          document.getElementsByClassName('handler')[0].style.left = width + 'px'
+          document.getElementsByClassName('drag_bg')[0].style.width = width + 'px'
+        } else if (width > this.maxwidth) {
+          this.successFunction()
         }
-      },                   //mousemove事件
-      moseUpFn(e){
-        this.mouseMoveStata = false;
-        var width = e.clientX - this.beginClientX;
-        if(width<this.maxwidth){
-          // ---- update-begin- author:sunjianlei --- date:20191009 --- for: 修复获取不到 handler 的时候报错 ----
-          let handler = document.getElementsByClassName('handler')[0]
-          if (handler) {
-            handler.style.left = 0 + 'px'
-            document.getElementsByClassName('drag_bg')[0].style.width = 0 + 'px'
-          }
-          // ---- update-end- author:sunjianlei --- date:20191009 --- for: 修复获取不到 handler 的时候报错 ----
+      }
+    }, //mousemove事件
+    moseUpFn(e) {
+      this.mouseMoveStata = false
+      var width = e.clientX - this.beginClientX
+      if (width < this.maxwidth) {
+        // ---- update-begin- author:sunjianlei --- date:20191009 --- for: 修复获取不到 handler 的时候报错 ----
+        let handler = document.getElementsByClassName('handler')[0]
+        if (handler) {
+          handler.style.left = 0 + 'px'
+          document.getElementsByClassName('drag_bg')[0].style.width = 0 + 'px'
         }
-      }                       //mouseup事件
-    },
-    mounted(){
-      this.maxwidth = this.$refs.dragDiv.clientWidth - this.$refs.moveDiv.clientWidth;
-      document.getElementsByTagName('html')[0].addEventListener('mousemove',this.mouseMoveFn);
-      document.getElementsByTagName('html')[0].addEventListener('mouseup',this.moseUpFn)
-    }
-  }
+        // ---- update-end- author:sunjianlei --- date:20191009 --- for: 修复获取不到 handler 的时候报错 ----
+      }
+    }, //mouseup事件
+  },
+  mounted() {
+    this.maxwidth = this.$refs.dragDiv.clientWidth - this.$refs.moveDiv.clientWidth
+    document.getElementsByTagName('html')[0].addEventListener('mousemove', this.mouseMoveFn)
+    document.getElementsByTagName('html')[0].addEventListener('mouseup', this.moseUpFn)
+  },
+}
 </script>
 
 <style scoped>
-  .drag{
-    position: relative;
-    background-color: #e8e8e8;
-    width: 100%;
-    height: 34px;
-    line-height: 34px;
-    text-align: center;
-  }
-  .handler{
-    width: 40px;
-    height: 32px;
-    border: 1px solid #ccc;
-    cursor: move;
-  }
-  .handler_bg{
-    background: #fff url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0ZDhlNWY5My05NmI0LTRlNWQtOGFjYi03ZTY4OGYyMTU2ZTYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NTEyNTVEMURGMkVFMTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NTEyNTVEMUNGMkVFMTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2MTc5NzNmZS02OTQxLTQyOTYtYTIwNi02NDI2YTNkOWU5YmUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NGQ4ZTVmOTMtOTZiNC00ZTVkLThhY2ItN2U2ODhmMjE1NmU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+YiRG4AAAALFJREFUeNpi/P//PwMlgImBQkA9A+bOnfsIiBOxKcInh+yCaCDuByoswaIOpxwjciACFegBqZ1AvBSIS5OTk/8TkmNEjwWgQiUgtQuIjwAxUF3yX3xyGIEIFLwHpKyAWB+I1xGSwxULIGf9A7mQkBwTlhBXAFLHgPgqEAcTkmNCU6AL9d8WII4HOvk3ITkWJAXWUMlOoGQHmsE45ViQ2KuBuASoYC4Wf+OUYxz6mQkgwAAN9mIrUReCXgAAAABJRU5ErkJggg==") no-repeat center;
-  }
-  .handler_ok_bg{
-    background: #fff url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0ZDhlNWY5My05NmI0LTRlNWQtOGFjYi03ZTY4OGYyMTU2ZTYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDlBRDI3NjVGMkQ2MTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDlBRDI3NjRGMkQ2MTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDphNWEzMWNhMC1hYmViLTQxNWEtYTEwZS04Y2U5NzRlN2Q4YTEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NGQ4ZTVmOTMtOTZiNC00ZTVkLThhY2ItN2U2ODhmMjE1NmU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+k+sHwwAAASZJREFUeNpi/P//PwMyKD8uZw+kUoDYEYgloMIvgHg/EM/ptHx0EFk9I8wAoEZ+IDUPiIMY8IN1QJwENOgj3ACo5gNAbMBAHLgAxA4gQ5igAnNJ0MwAVTsX7IKyY7L2UNuJAf+AmAmJ78AEDTBiwGYg5gbifCSxFCZoaBMCy4A4GOjnH0D6DpK4IxNSVIHAfSDOAeLraJrjgJp/AwPbHMhejiQnwYRmUzNQ4VQgDQqXK0ia/0I17wJiPmQNTNBEAgMlQIWiQA2vgWw7QppBekGxsAjIiEUSBNnsBDWEAY9mEFgMMgBk00E0iZtA7AHEctDQ58MRuA6wlLgGFMoMpIG1QFeGwAIxGZo8GUhIysmwQGSAZgwHaEZhICIzOaBkJkqyM0CAAQDGx279Jf50AAAAAABJRU5ErkJggg==") no-repeat center;
-  }
-  .drag_bg{
-    background-color: #7ac23c;
-    height: 34px;
-    width: 0px;
-  }
-  .drag_text{
-    position: absolute;
-    top: 0px;
-    width: 100%;text-align: center;
-    -moz-user-select: none;
-    -webkit-user-select: none;
-    user-select: none;
-    -o-user-select:none;
-    -ms-user-select:none;
-  }
-</style>
+.drag {
+  position: relative;
+  background-color: #e8e8e8;
+  width: 100%;
+  height: 34px;
+  line-height: 34px;
+  text-align: center;
+}
+.handler {
+  width: 40px;
+  height: 32px;
+  border: 1px solid #ccc;
+  cursor: move;
+}
+.handler_bg {
+  background: #fff
+    url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0ZDhlNWY5My05NmI0LTRlNWQtOGFjYi03ZTY4OGYyMTU2ZTYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NTEyNTVEMURGMkVFMTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NTEyNTVEMUNGMkVFMTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2MTc5NzNmZS02OTQxLTQyOTYtYTIwNi02NDI2YTNkOWU5YmUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NGQ4ZTVmOTMtOTZiNC00ZTVkLThhY2ItN2U2ODhmMjE1NmU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+YiRG4AAAALFJREFUeNpi/P//PwMlgImBQkA9A+bOnfsIiBOxKcInh+yCaCDuByoswaIOpxwjciACFegBqZ1AvBSIS5OTk/8TkmNEjwWgQiUgtQuIjwAxUF3yX3xyGIEIFLwHpKyAWB+I1xGSwxULIGf9A7mQkBwTlhBXAFLHgPgqEAcTkmNCU6AL9d8WII4HOvk3ITkWJAXWUMlOoGQHmsE45ViQ2KuBuASoYC4Wf+OUYxz6mQkgwAAN9mIrUReCXgAAAABJRU5ErkJggg==')
+    no-repeat center;
+}
+.handler_ok_bg {
+  background: #fff
+    url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0ZDhlNWY5My05NmI0LTRlNWQtOGFjYi03ZTY4OGYyMTU2ZTYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDlBRDI3NjVGMkQ2MTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDlBRDI3NjRGMkQ2MTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDphNWEzMWNhMC1hYmViLTQxNWEtYTEwZS04Y2U5NzRlN2Q4YTEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NGQ4ZTVmOTMtOTZiNC00ZTVkLThhY2ItN2U2ODhmMjE1NmU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+k+sHwwAAASZJREFUeNpi/P//PwMyKD8uZw+kUoDYEYgloMIvgHg/EM/ptHx0EFk9I8wAoEZ+IDUPiIMY8IN1QJwENOgj3ACo5gNAbMBAHLgAxA4gQ5igAnNJ0MwAVTsX7IKyY7L2UNuJAf+AmAmJ78AEDTBiwGYg5gbifCSxFCZoaBMCy4A4GOjnH0D6DpK4IxNSVIHAfSDOAeLraJrjgJp/AwPbHMhejiQnwYRmUzNQ4VQgDQqXK0ia/0I17wJiPmQNTNBEAgMlQIWiQA2vgWw7QppBekGxsAjIiEUSBNnsBDWEAY9mEFgMMgBk00E0iZtA7AHEctDQ58MRuA6wlLgGFMoMpIG1QFeGwAIxGZo8GUhIysmwQGSAZgwHaEZhICIzOaBkJkqyM0CAAQDGx279Jf50AAAAAABJRU5ErkJggg==')
+    no-repeat center;
+}
+.drag_bg {
+  background-color: #7ac23c;
+  height: 34px;
+  width: 0px;
+}
+.drag_text {
+  position: absolute;
+  top: 0px;
+  width: 100%;
+  text-align: center;
+  -moz-user-select: none;
+  -webkit-user-select: none;
+  user-select: none;
+  -o-user-select: none;
+  -ms-user-select: none;
+}
+</style>

+ 612 - 564
jshERP-web/src/components/jeecg/JSuperQuery.vue

@@ -1,217 +1,266 @@
 <template>
-<div class="j-super-query-box">
-
-  <slot name="button" :isActive="superQueryFlag" :isMobile="izMobile" :open="handleOpen" :reset="handleReset">
-    <a-tooltip v-if="superQueryFlag" v-bind="tooltipProps" :mouseLeaveDelay="0.2">
-      <!-- begin 不知道为什么不加上这段代码就无法生效 -->
-      <span v-show="false">{{tooltipProps}}</span>
-      <!-- end 不知道为什么不加上这段代码就无法生效 -->
-      <template slot="title">
-        <span>已有高级查询条件生效</span>
-        <a-divider type="vertical"/>
-        <a @click="handleReset">清空</a>
+  <div class="j-super-query-box">
+    <slot name="button" :isActive="superQueryFlag" :isMobile="izMobile" :open="handleOpen" :reset="handleReset">
+      <a-tooltip v-if="superQueryFlag" v-bind="tooltipProps" :mouseLeaveDelay="0.2">
+        <!-- begin 不知道为什么不加上这段代码就无法生效 -->
+        <span v-show="false">{{ tooltipProps }}</span>
+        <!-- end 不知道为什么不加上这段代码就无法生效 -->
+        <template slot="title">
+          <span>已有高级查询条件生效</span>
+          <a-divider type="vertical" />
+          <a @click="handleReset">清空</a>
+        </template>
+        <a-button-group>
+          <a-button type="primary" @click="handleOpen">
+            <a-icon type="appstore" theme="twoTone" spin />
+            <span>高级查询</span>
+          </a-button>
+          <a-button v-if="izMobile" type="primary" icon="delete" @click="handleReset" />
+        </a-button-group>
+      </a-tooltip>
+      <a-button v-else type="primary" icon="filter" @click="handleOpen">高级查询</a-button>
+    </slot>
+
+    <j-modal
+      title="高级查询构造器"
+      :width="1000"
+      :visible="visible"
+      @cancel="handleCancel"
+      :mask="false"
+      :fullscreen="izMobile"
+      class="j-super-query-modal"
+      style="top: 5%; max-height: 95%"
+    >
+      <template slot="footer">
+        <div style="float: left">
+          <a-button :loading="loading" @click="handleReset">重置</a-button>
+          <a-button :loading="loading" @click="handleSave">保存查询条件</a-button>
+        </div>
+        <a-button :loading="loading" @click="handleCancel">关闭</a-button>
+        <a-button :loading="loading" type="primary" @click="handleOk">查询</a-button>
       </template>
-      <a-button-group>
-        <a-button type="primary" @click="handleOpen">
-          <a-icon type="appstore" theme="twoTone" spin/>
-          <span>高级查询</span>
-        </a-button>
-        <a-button v-if="izMobile" type="primary" icon="delete" @click="handleReset"/>
-      </a-button-group>
-    </a-tooltip>
-    <a-button v-else type="primary" icon="filter" @click="handleOpen">高级查询</a-button>
-  </slot>
-
-  <j-modal
-    title="高级查询构造器"
-    :width="1000"
-    :visible="visible"
-    @cancel="handleCancel"
-    :mask="false"
-    :fullscreen="izMobile"
-    class="j-super-query-modal"
-    style="top:5%;max-height: 95%;"
-  >
-
-    <template slot="footer">
-      <div style="float: left">
-        <a-button :loading="loading" @click="handleReset">重置</a-button>
-        <a-button :loading="loading" @click="handleSave">保存查询条件</a-button>
-      </div>
-      <a-button :loading="loading" @click="handleCancel">关闭</a-button>
-      <a-button :loading="loading" type="primary" @click="handleOk">查询</a-button>
-    </template>
-
-    <a-spin :spinning="loading">
-      <a-row>
-        <a-col :sm="24" :md="24-5">
-
-          <a-empty v-if="queryParamsModel.length === 0" style="margin-bottom: 12px;">
-            <div slot="description">
-              <span>没有任何查询条件</span>
-              <a-divider type="vertical"/>
-              <a @click="handleAdd">点击新增</a>
-            </div>
-          </a-empty>
-
-          <a-form v-else layout="inline">
 
-            <a-row style="margin-bottom: 12px;">
-              <a-col :md="12" :xs="24">
-                <a-form-item label="过滤条件匹配" :labelCol="{md: 6,xs:24}" :wrapperCol="{md: 18,xs:24}" style="width: 100%;">
-                  <a-select v-model="matchType" :getPopupContainer="node=>node.parentNode" style="width: 100%;">
-                    <a-select-option value="and">AND(所有条件都要求匹配)</a-select-option>
-                    <a-select-option value="or">OR(条件中的任意一个匹配)</a-select-option>
+      <a-spin :spinning="loading">
+        <a-row>
+          <a-col :sm="24" :md="24 - 5">
+            <a-empty v-if="queryParamsModel.length === 0" style="margin-bottom: 12px">
+              <div slot="description">
+                <span>没有任何查询条件</span>
+                <a-divider type="vertical" />
+                <a @click="handleAdd">点击新增</a>
+              </div>
+            </a-empty>
+
+            <a-form v-else layout="inline">
+              <a-row style="margin-bottom: 12px">
+                <a-col :md="12" :xs="24">
+                  <a-form-item
+                    label="过滤条件匹配"
+                    :labelCol="{ md: 6, xs: 24 }"
+                    :wrapperCol="{ md: 18, xs: 24 }"
+                    style="width: 100%"
+                  >
+                    <a-select v-model="matchType" :getPopupContainer="(node) => node.parentNode" style="width: 100%">
+                      <a-select-option value="and">AND(所有条件都要求匹配)</a-select-option>
+                      <a-select-option value="or">OR(条件中的任意一个匹配)</a-select-option>
+                    </a-select>
+                  </a-form-item>
+                </a-col>
+              </a-row>
+
+              <a-row
+                type="flex"
+                style="margin-bottom: 10px"
+                :gutter="16"
+                v-for="(item, index) in queryParamsModel"
+                :key="index"
+              >
+                <a-col :md="8" :xs="24" style="margin-bottom: 12px">
+                  <a-tree-select
+                    showSearch
+                    v-model="item.field"
+                    :treeData="fieldTreeData"
+                    :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+                    placeholder="选择查询字段"
+                    allowClear
+                    treeDefaultExpandAll
+                    :getPopupContainer="(node) => node.parentNode"
+                    style="width: 100%"
+                    @select="(val, option) => handleSelected(option, item)"
+                  >
+                  </a-tree-select>
+                </a-col>
+
+                <a-col :md="4" :xs="24" style="margin-bottom: 12px">
+                  <a-select
+                    placeholder="匹配规则"
+                    :value="item.rule"
+                    :getPopupContainer="(node) => node.parentNode"
+                    @change="handleRuleChange(item, $event)"
+                  >
+                    <a-select-option value="eq">等于</a-select-option>
+                    <a-select-option value="like">包含</a-select-option>
+                    <a-select-option value="right_like">以..开始</a-select-option>
+                    <a-select-option value="left_like">以..结尾</a-select-option>
+                    <a-select-option value="in">在...中</a-select-option>
+                    <a-select-option value="ne">不等于</a-select-option>
+                    <a-select-option value="gt">大于</a-select-option>
+                    <a-select-option value="ge">大于等于</a-select-option>
+                    <a-select-option value="lt">小于</a-select-option>
+                    <a-select-option value="le">小于等于</a-select-option>
                   </a-select>
-                </a-form-item>
-              </a-col>
-            </a-row>
-
-            <a-row type="flex" style="margin-bottom:10px" :gutter="16" v-for="(item, index) in queryParamsModel" :key="index">
-
-              <a-col :md="8" :xs="24" style="margin-bottom: 12px;">
-                <a-tree-select
-                  showSearch
-                  v-model="item.field"
-                  :treeData="fieldTreeData"
-                  :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
-                  placeholder="选择查询字段"
-                  allowClear
-                  treeDefaultExpandAll
-                  :getPopupContainer="node=>node.parentNode"
-                  style="width: 100%"
-                  @select="(val,option)=>handleSelected(option,item)"
-                >
-                </a-tree-select>
-              </a-col>
-
-              <a-col :md="4" :xs="24" style="margin-bottom: 12px;">
-                <a-select placeholder="匹配规则" :value="item.rule" :getPopupContainer="node=>node.parentNode" @change="handleRuleChange(item,$event)">
-                  <a-select-option value="eq">等于</a-select-option>
-                  <a-select-option value="like">包含</a-select-option>
-                  <a-select-option value="right_like">以..开始</a-select-option>
-                  <a-select-option value="left_like">以..结尾</a-select-option>
-                  <a-select-option value="in">在...中</a-select-option>
-                  <a-select-option value="ne">不等于</a-select-option>
-                  <a-select-option value="gt">大于</a-select-option>
-                  <a-select-option value="ge">大于等于</a-select-option>
-                  <a-select-option value="lt">小于</a-select-option>
-                  <a-select-option value="le">小于等于</a-select-option>
-                </a-select>
-              </a-col>
-
-              <a-col :md="8" :xs="24" style="margin-bottom: 12px;">
-                <template v-if="item.dictCode">
-                  <template v-if="item.type === 'table-dict'">
-                    <j-popup
-                      v-model="item.val"
-                      :code="item.dictTable"
-                      :field="item.dictCode"
-                      :orgFields="item.dictCode"
-                      :destFields="item.dictCode"
-                    ></j-popup>
+                </a-col>
+
+                <a-col :md="8" :xs="24" style="margin-bottom: 12px">
+                  <template v-if="item.dictCode">
+                    <template v-if="item.type === 'table-dict'">
+                      <j-popup
+                        v-model="item.val"
+                        :code="item.dictTable"
+                        :field="item.dictCode"
+                        :orgFields="item.dictCode"
+                        :destFields="item.dictCode"
+                      ></j-popup>
+                    </template>
+                    <template v-else>
+                      <j-multi-select-tag
+                        v-show="allowMultiple(item)"
+                        v-model="item.val"
+                        :dictCode="item.dictCode"
+                        placeholder="请选择"
+                      />
+                      <j-dict-select-tag
+                        v-show="!allowMultiple(item)"
+                        v-model="item.val"
+                        :dictCode="item.dictCode"
+                        placeholder="请选择"
+                      />
+                    </template>
                   </template>
-                  <template v-else>
-                    <j-multi-select-tag v-show="allowMultiple(item)" v-model="item.val" :dictCode="item.dictCode" placeholder="请选择"/>
-                    <j-dict-select-tag v-show="!allowMultiple(item)" v-model="item.val" :dictCode="item.dictCode" placeholder="请选择"/>
-                  </template>
-                </template>
-                <j-popup v-else-if="item.type === 'popup'" :value="item.val" v-bind="item.popup" group-id="superQuery" @input="(e,v)=>handleChangeJPopup(item,e,v)"/>
-                <j-select-multi-user
-                  v-else-if="item.type === 'select-user' || item.type === 'sel_user'"
-                  v-model="item.val"
-                  :buttons="false"
-                  :multiple="false"
-                  placeholder="请选择用户"
-                  :returnKeys="['id', item.customReturnField || 'username']"
-                />
-                <j-select-depart
-                  v-else-if="item.type === 'select-depart' || item.type === 'sel_depart'"
-                  v-model="item.val"
-                  :multi="false"
-                  placeholder="请选择部门"
-                  :customReturnField="item.customReturnField || 'id'"
-                />
-                <a-select
-                  v-else-if="item.options instanceof Array"
-                  v-model="item.val"
-                  :options="item.options"
-                  allowClear
-                  placeholder="请选择"
-                  :mode="allowMultiple(item)?'multiple':''"
-                />
-                <j-area-linkage v-model="item.val" v-else-if="item.type==='area-linkage' || item.type==='pca'" style="width: 100%"/>
-                <j-date v-else-if=" item.type=='date' " v-model="item.val" placeholder="请选择日期" style="width: 100%"></j-date>
-                <j-date v-else-if=" item.type=='datetime' " v-model="item.val" placeholder="请选择时间" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"></j-date>
-                <a-time-picker v-else-if="item.type==='time'" :value="item.val ? moment(item.val,'HH:mm:ss') : null" format="HH:mm:ss" style="width: 100%" @change="(time,value)=>item.val=value"/>
-                <a-input-number v-else-if=" item.type=='int'||item.type=='number' " style="width: 100%" placeholder="请输入数值" v-model="item.val"/>
-                <a-input v-else v-model="item.val" placeholder="请输入值"/>
-              </a-col>
-
-              <a-col :md="4" :xs="0" style="margin-bottom: 12px;">
-                <a-button @click="handleAdd" icon="plus"></a-button>&nbsp;
-                <a-button @click="handleDel( index )" icon="minus"></a-button>
-              </a-col>
-
-              <a-col :md="0" :xs="24" style="margin-bottom: 12px;text-align: right;">
-                <a-button @click="handleAdd" icon="plus"></a-button>&nbsp;
-                <a-button @click="handleDel( index )" icon="minus"></a-button>
-              </a-col>
-
-            </a-row>
-
-          </a-form>
-        </a-col>
-        <a-col :sm="24" :md="5">
-          <!-- 查询记录 -->
-
-          <a-card class="j-super-query-history-card" :bordered="true">
-            <div slot="title">
-              保存的查询
-            </div>
-
-            <a-empty v-if="saveTreeData.length === 0" class="j-super-query-history-empty" description="没有保存任何查询"/>
-            <a-tree
-              v-else
-              class="j-super-query-history-tree"
-              showIcon
-              :treeData="saveTreeData"
-              :selectedKeys="[]"
-              @select="handleTreeSelect"
-            >
-            </a-tree>
-          </a-card>
-
-
-        </a-col>
-      </a-row>
-
-
-    </a-spin>
-
-    <a-modal title="请输入保存的名称" :visible="prompt.visible" @cancel="prompt.visible=false" @ok="handlePromptOk">
-      <a-input v-model="prompt.value"></a-input>
-    </a-modal>
-
-  </j-modal>
-</div>
+                  <j-popup
+                    v-else-if="item.type === 'popup'"
+                    :value="item.val"
+                    v-bind="item.popup"
+                    group-id="superQuery"
+                    @input="(e, v) => handleChangeJPopup(item, e, v)"
+                  />
+                  <j-select-multi-user
+                    v-else-if="item.type === 'select-user' || item.type === 'sel_user'"
+                    v-model="item.val"
+                    :buttons="false"
+                    :multiple="false"
+                    placeholder="请选择用户"
+                    :returnKeys="['id', item.customReturnField || 'username']"
+                  />
+                  <j-select-depart
+                    v-else-if="item.type === 'select-depart' || item.type === 'sel_depart'"
+                    v-model="item.val"
+                    :multi="false"
+                    placeholder="请选择部门"
+                    :customReturnField="item.customReturnField || 'id'"
+                  />
+                  <a-select
+                    v-else-if="item.options instanceof Array"
+                    v-model="item.val"
+                    :options="item.options"
+                    allowClear
+                    placeholder="请选择"
+                    :mode="allowMultiple(item) ? 'multiple' : ''"
+                  />
+                  <j-area-linkage
+                    v-model="item.val"
+                    v-else-if="item.type === 'area-linkage' || item.type === 'pca'"
+                    style="width: 100%"
+                  />
+                  <j-date
+                    v-else-if="item.type == 'date'"
+                    v-model="item.val"
+                    placeholder="请选择日期"
+                    style="width: 100%"
+                  ></j-date>
+                  <j-date
+                    v-else-if="item.type == 'datetime'"
+                    v-model="item.val"
+                    placeholder="请选择时间"
+                    :show-time="true"
+                    date-format="YYYY-MM-DD HH:mm:ss"
+                    style="width: 100%"
+                  ></j-date>
+                  <a-time-picker
+                    v-else-if="item.type === 'time'"
+                    :value="item.val ? moment(item.val, 'HH:mm:ss') : null"
+                    format="HH:mm:ss"
+                    style="width: 100%"
+                    @change="(time, value) => (item.val = value)"
+                  />
+                  <a-input-number
+                    v-else-if="item.type == 'int' || item.type == 'number'"
+                    style="width: 100%"
+                    placeholder="请输入数值"
+                    v-model="item.val"
+                  />
+                  <a-input v-else v-model="item.val" placeholder="请输入值" />
+                </a-col>
+
+                <a-col :md="4" :xs="0" style="margin-bottom: 12px">
+                  <a-button @click="handleAdd" icon="plus"></a-button>&nbsp;
+                  <a-button @click="handleDel(index)" icon="minus"></a-button>
+                </a-col>
+
+                <a-col :md="0" :xs="24" style="margin-bottom: 12px; text-align: right">
+                  <a-button @click="handleAdd" icon="plus"></a-button>&nbsp;
+                  <a-button @click="handleDel(index)" icon="minus"></a-button>
+                </a-col>
+              </a-row>
+            </a-form>
+          </a-col>
+          <a-col :sm="24" :md="5">
+            <!-- 查询记录 -->
+
+            <a-card class="j-super-query-history-card" :bordered="true">
+              <div slot="title">保存的查询</div>
+
+              <a-empty
+                v-if="saveTreeData.length === 0"
+                class="j-super-query-history-empty"
+                description="没有保存任何查询"
+              />
+              <a-tree
+                v-else
+                class="j-super-query-history-tree"
+                showIcon
+                :treeData="saveTreeData"
+                :selectedKeys="[]"
+                @select="handleTreeSelect"
+              >
+              </a-tree>
+            </a-card>
+          </a-col>
+        </a-row>
+      </a-spin>
+
+      <a-modal title="请输入保存的名称" :visible="prompt.visible" @cancel="prompt.visible = false" @ok="handlePromptOk">
+        <a-input v-model="prompt.value"></a-input>
+      </a-modal>
+    </j-modal>
+  </div>
 </template>
 
 <script>
-  import moment from 'moment'
-  import * as utils from '@/utils/util'
-  import { mixinDevice } from '@/utils/mixin'
-  import JDate from '@/components/jeecg/JDate.vue'
-  import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
-  import JSelectMultiUser from '@/components/jeecgbiz/JSelectMultiUser'
-  import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
-
-  export default {
-    name: 'JSuperQuery',
-    mixins: [mixinDevice],
-    components: { JAreaLinkage, JDate, JSelectDepart, JSelectMultiUser },
-    props: {
-      /*
+import moment from 'moment'
+import * as utils from '@/utils/util'
+import { mixinDevice } from '@/utils/mixin'
+import JDate from '@/components/jeecg/JDate.vue'
+import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
+import JSelectMultiUser from '@/components/jeecgbiz/JSelectMultiUser'
+import JAreaLinkage from '@comp/jeecg/JAreaLinkage'
+
+export default {
+  name: 'JSuperQuery',
+  mixins: [mixinDevice],
+  components: { JAreaLinkage, JDate, JSelectDepart, JSelectMultiUser },
+  props: {
+    /*
        fieldList: [{
           value:'',
           text:'',
@@ -220,420 +269,419 @@
        }]
        type:date datetime int number string
       * */
-      fieldList: {
-        type: Array,
-        required: true
-      },
-      /*
-      * 这个回调函数接收一个数组参数 即查询条件
-      * */
-      callback: {
-        type: String,
-        required: false,
-        default: 'handleSuperQuery'
-      },
-
-      // 当前是否在加载中
-      loading: {
-        type: Boolean,
-        default: false
-      },
-
-      // 保存查询条件的唯一 code,通过该 code 区分
-      // 默认为 null,代表以当前路由全路径为区分Code
-      saveCode: {
-        type: String,
-        default: null
-      }
+    fieldList: {
+      type: Array,
+      required: true,
+    },
+    /*
+     * 这个回调函数接收一个数组参数 即查询条件
+     * */
+    callback: {
+      type: String,
+      required: false,
+      default: 'handleSuperQuery',
+    },
 
+    // 当前是否在加载中
+    loading: {
+      type: Boolean,
+      default: false,
     },
-    data() {
-      return {
-        moment,
-        fieldTreeData: [],
 
-        prompt: {
-          visible: false,
-          value: ''
-        },
+    // 保存查询条件的唯一 code,通过该 code 区分
+    // 默认为 null,代表以当前路由全路径为区分Code
+    saveCode: {
+      type: String,
+      default: null,
+    },
+  },
+  data() {
+    return {
+      moment,
+      fieldTreeData: [],
 
+      prompt: {
         visible: false,
-        queryParamsModel: [],
-        treeIcon: <a-icon type="file-text"/>,
-        // 保存查询条件的treeData
-        saveTreeData: [],
-        // 保存查询条件的前缀名
-        saveCodeBefore: 'JSuperQuerySaved_',
-        // 查询类型,过滤条件匹配(and、or)
-        matchType: 'and',
-        superQueryFlag: false,
+        value: '',
+      },
+
+      visible: false,
+      queryParamsModel: [],
+      treeIcon: <a-icon type="file-text" />,
+      // 保存查询条件的treeData
+      saveTreeData: [],
+      // 保存查询条件的前缀名
+      saveCodeBefore: 'JSuperQuerySaved_',
+      // 查询类型,过滤条件匹配(and、or)
+      matchType: 'and',
+      superQueryFlag: false,
+    }
+  },
+  computed: {
+    izMobile() {
+      return this.device === 'mobile'
+    },
+    tooltipProps() {
+      return this.izMobile ? { visible: false } : {}
+    },
+    fullSaveCode() {
+      let saveCode = this.saveCode
+      if (saveCode == null || saveCode === '') {
+        saveCode = this.$route.fullPath
       }
+      return this.saveCodeBefore + saveCode
     },
-    computed: {
-      izMobile() {
-        return this.device === 'mobile'
-      },
-      tooltipProps() {
-        return this.izMobile ? { visible: false } : {}
-      },
-      fullSaveCode() {
-        let saveCode = this.saveCode
-        if (saveCode == null || saveCode === '') {
-          saveCode = this.$route.fullPath
+  },
+  watch: {
+    // 当 saveCode 变化时,重新查询已保存的条件
+    fullSaveCode: {
+      immediate: true,
+      handler() {
+        let list = this.$ls.get(this.fullSaveCode)
+        if (list instanceof Array) {
+          this.saveTreeData = list.map((i) => this.renderSaveTreeData(i))
         }
-        return this.saveCodeBefore + saveCode
       },
     },
-    watch: {
-      // 当 saveCode 变化时,重新查询已保存的条件
-      fullSaveCode: {
-        immediate: true,
-        handler() {
-          let list = this.$ls.get(this.fullSaveCode)
-          if (list instanceof Array) {
-            this.saveTreeData = list.map(i => this.renderSaveTreeData(i))
+    fieldList: {
+      deep: true,
+      immediate: true,
+      handler(val) {
+        let mainData = [],
+          subData = []
+        val.forEach((item) => {
+          let data = { ...item }
+          data.label = data.label || data.text
+          let hasChildren = data.children instanceof Array
+          data.disabled = hasChildren
+          data.selectable = !hasChildren
+          if (hasChildren) {
+            data.children = data.children.map((item2) => {
+              let child = { ...item2 }
+              child.label = child.label || child.text
+              child.label = data.label + '-' + child.label
+              child.value = data.value + ',' + child.value
+              child.val = ''
+              return child
+            })
+            data.val = ''
+            subData.push(data)
+          } else {
+            mainData.push(data)
           }
-        }
+        })
+        this.fieldTreeData = mainData.concat(subData)
       },
-      fieldList: {
-        deep: true,
-        immediate: true,
-        handler(val) {
-          let mainData = [], subData = []
-          val.forEach(item => {
-            let data = { ...item }
-            data.label = data.label || data.text
-            let hasChildren = (data.children instanceof Array)
-            data.disabled = hasChildren
-            data.selectable = !hasChildren
-            if (hasChildren) {
-              data.children = data.children.map(item2 => {
-                let child = { ...item2 }
-                child.label = child.label || child.text
-                child.label = data.label + '-' + child.label
-                child.value = data.value + ',' + child.value
-                child.val = ''
-                return child
-              })
-              data.val = ''
-              subData.push(data)
-            } else {
-              mainData.push(data)
-            }
-          })
-          this.fieldTreeData = mainData.concat(subData)
-        }
-      }
     },
+  },
 
-    methods: {
-      show() {
-        if (!this.queryParamsModel || this.queryParamsModel.length === 0) {
-          this.resetLine()
-        }
-        this.visible = true
-      },
-      handleOk() {
-        if (!this.isNullArray(this.queryParamsModel)) {
-          let event = {
-            matchType: this.matchType,
-            params: this.removeEmptyObject(this.queryParamsModel)
-          }
-          // 移动端模式下关闭弹窗
-          if (this.izMobile) {
-            this.visible = false
-          }
-          this.emitCallback(event)
-        } else {
-          this.$message.warn("不能查询空条件")
-        }
-      },
-      emitCallback(event = {}) {
-        let { params = [], matchType = this.matchType } = event
-        this.superQueryFlag = (params && params.length > 0)
-        for (let param of params) {
-          if (Array.isArray(param.val)) {
-            param.val = param.val.join(',')
-          }
-        }
-        console.debug('---高级查询参数--->', { params, matchType })
-        this.$emit(this.callback, params, matchType)
-      },
-      handleCancel() {
-        this.close()
-      },
-      close() {
-        this.$emit('close')
-        this.visible = false
-      },
-      handleAdd() {
-        this.addNewLine()
-      },
-      addNewLine() {
-        this.queryParamsModel.push({ rule: 'eq' })
-      },
-      resetLine() {
-        this.superQueryFlag = false
-        this.queryParamsModel = []
-        this.addNewLine()
-      },
-      handleDel(index) {
-        this.queryParamsModel.splice(index, 1)
-      },
-      handleSelected(node, item) {
-        let { type, options, dictCode, dictTable, customReturnField, popup } = node.dataRef
-        item['type'] = type
-        item['options'] = options
-        item['dictCode'] = dictCode
-        item['dictTable'] = dictTable
-        item['customReturnField'] = customReturnField
-        if (popup) {
-          item['popup'] = popup
-        }
-        this.$set(item, 'val', undefined)
-      },
-      handleOpen() {
-        this.show()
-      },
-      handleReset() {
+  methods: {
+    show() {
+      if (!this.queryParamsModel || this.queryParamsModel.length === 0) {
         this.resetLine()
-        this.emitCallback()
-      },
-      handleSave() {
-        let queryParams = this.removeEmptyObject(this.queryParamsModel)
-        if (this.isNullArray(queryParams)) {
-          this.$message.warning('空条件不能保存')
-        } else {
-          this.prompt.value = ''
-          this.prompt.visible = true
+      }
+      this.visible = true
+    },
+    handleOk() {
+      if (!this.isNullArray(this.queryParamsModel)) {
+        let event = {
+          matchType: this.matchType,
+          params: this.removeEmptyObject(this.queryParamsModel),
         }
-      },
-      handlePromptOk() {
-        let { value } = this.prompt
-        if(!value){
-          this.$message.warning('保存名称不能为空')
-          return
+        // 移动端模式下关闭弹窗
+        if (this.izMobile) {
+          this.visible = false
         }
-        // 取出查询条件
-        let records = this.removeEmptyObject(this.queryParamsModel)
-        // 判断有没有重名的
-        let filterList = this.saveTreeData.filter(i => i.originTitle === value)
-        if (filterList.length > 0) {
-          this.$confirm({
-            content: `${value} 已存在,是否覆盖?`,
-            onOk: () => {
-              this.prompt.visible = false
-              filterList[0].records = records
-              this.saveToLocalStore()
-              this.$message.success('保存成功')
-            }
-          })
-        } else {
-          // 没有重名的,直接添加
-          this.prompt.visible = false
-          // 添加到树列表中
-          this.saveTreeData.push(this.renderSaveTreeData({
-            title: value,
-            matchType: this.matchType,
-            records: records
-          }))
-          // 保存到 LocalStore
-          this.saveToLocalStore()
-          this.$message.success('保存成功')
-        }
-      },
-      handleTreeSelect(idx, event) {
-        if (event.selectedNodes[0]) {
-          let { matchType, records } = event.selectedNodes[0].data.props
-          // 将保存的matchType取出,兼容旧数据,如果没有保存就还是使用原来的
-          this.matchType = matchType || this.matchType
-          this.queryParamsModel = utils.cloneObject(records)
+        this.emitCallback(event)
+      } else {
+        this.$message.warn('不能查询空条件')
+      }
+    },
+    emitCallback(event = {}) {
+      let { params = [], matchType = this.matchType } = event
+      this.superQueryFlag = params && params.length > 0
+      for (let param of params) {
+        if (Array.isArray(param.val)) {
+          param.val = param.val.join(',')
         }
-      },
-      handleRemoveSaveTreeItem(event, vNode) {
-        // 阻止事件冒泡
-        event.stopPropagation()
-
+      }
+      console.debug('---高级查询参数--->', { params, matchType })
+      this.$emit(this.callback, params, matchType)
+    },
+    handleCancel() {
+      this.close()
+    },
+    close() {
+      this.$emit('close')
+      this.visible = false
+    },
+    handleAdd() {
+      this.addNewLine()
+    },
+    addNewLine() {
+      this.queryParamsModel.push({ rule: 'eq' })
+    },
+    resetLine() {
+      this.superQueryFlag = false
+      this.queryParamsModel = []
+      this.addNewLine()
+    },
+    handleDel(index) {
+      this.queryParamsModel.splice(index, 1)
+    },
+    handleSelected(node, item) {
+      let { type, options, dictCode, dictTable, customReturnField, popup } = node.dataRef
+      item['type'] = type
+      item['options'] = options
+      item['dictCode'] = dictCode
+      item['dictTable'] = dictTable
+      item['customReturnField'] = customReturnField
+      if (popup) {
+        item['popup'] = popup
+      }
+      this.$set(item, 'val', undefined)
+    },
+    handleOpen() {
+      this.show()
+    },
+    handleReset() {
+      this.resetLine()
+      this.emitCallback()
+    },
+    handleSave() {
+      let queryParams = this.removeEmptyObject(this.queryParamsModel)
+      if (this.isNullArray(queryParams)) {
+        this.$message.warning('空条件不能保存')
+      } else {
+        this.prompt.value = ''
+        this.prompt.visible = true
+      }
+    },
+    handlePromptOk() {
+      let { value } = this.prompt
+      if (!value) {
+        this.$message.warning('保存名称不能为空')
+        return
+      }
+      // 取出查询条件
+      let records = this.removeEmptyObject(this.queryParamsModel)
+      // 判断有没有重名的
+      let filterList = this.saveTreeData.filter((i) => i.originTitle === value)
+      if (filterList.length > 0) {
         this.$confirm({
-          content: '是否删除当前查询?',
+          content: `${value} 已存在,是否覆盖?`,
           onOk: () => {
-            let { eventKey } = vNode
-            this.saveTreeData.splice(Number.parseInt(eventKey.substring(2)), 1)
+            this.prompt.visible = false
+            filterList[0].records = records
             this.saveToLocalStore()
+            this.$message.success('保存成功')
           },
         })
-      },
+      } else {
+        // 没有重名的,直接添加
+        this.prompt.visible = false
+        // 添加到树列表中
+        this.saveTreeData.push(
+          this.renderSaveTreeData({
+            title: value,
+            matchType: this.matchType,
+            records: records,
+          })
+        )
+        // 保存到 LocalStore
+        this.saveToLocalStore()
+        this.$message.success('保存成功')
+      }
+    },
+    handleTreeSelect(idx, event) {
+      if (event.selectedNodes[0]) {
+        let { matchType, records } = event.selectedNodes[0].data.props
+        // 将保存的matchType取出,兼容旧数据,如果没有保存就还是使用原来的
+        this.matchType = matchType || this.matchType
+        this.queryParamsModel = utils.cloneObject(records)
+      }
+    },
+    handleRemoveSaveTreeItem(event, vNode) {
+      // 阻止事件冒泡
+      event.stopPropagation()
+
+      this.$confirm({
+        content: '是否删除当前查询?',
+        onOk: () => {
+          let { eventKey } = vNode
+          this.saveTreeData.splice(Number.parseInt(eventKey.substring(2)), 1)
+          this.saveToLocalStore()
+        },
+      })
+    },
 
-      // 将查询保存到 LocalStore 里
-      saveToLocalStore() {
-        let saveValue = this.saveTreeData.map(({ originTitle, matchType, records }) => ({ title: originTitle, matchType, records }))
-        this.$ls.set(this.fullSaveCode, saveValue)
-      },
+    // 将查询保存到 LocalStore 里
+    saveToLocalStore() {
+      let saveValue = this.saveTreeData.map(({ originTitle, matchType, records }) => ({
+        title: originTitle,
+        matchType,
+        records,
+      }))
+      this.$ls.set(this.fullSaveCode, saveValue)
+    },
 
-      isNullArray(array) {
-        //判断是不是空数组对象
-        if (!array || array.length === 0) {
+    isNullArray(array) {
+      //判断是不是空数组对象
+      if (!array || array.length === 0) {
+        return true
+      }
+      if (array.length === 1) {
+        let obj = array[0]
+        if (!obj.field || obj.val == null || obj.val === '' || !obj.rule) {
           return true
         }
-        if (array.length === 1) {
-          let obj = array[0]
-          if (!obj.field || (obj.val == null || obj.val === '') || !obj.rule) {
-            return true
-          }
-        }
-        return false
-      },
-      // 去掉数组中的空对象
-      removeEmptyObject(arr) {
-        let array = utils.cloneObject(arr)
-        for (let i = 0; i < array.length; i++) {
-          let item = array[i]
-          if (item == null || Object.keys(item).length <= 0) {
-            array.splice(i--, 1)
-          } else {
-            if (Array.isArray(item.options)) {
-              // 如果有字典属性,就不需要保存 options 了
-              if (item.dictCode) {
-                // 去掉特殊属性
-                delete item.options
-              }
+      }
+      return false
+    },
+    // 去掉数组中的空对象
+    removeEmptyObject(arr) {
+      let array = utils.cloneObject(arr)
+      for (let i = 0; i < array.length; i++) {
+        let item = array[i]
+        if (item == null || Object.keys(item).length <= 0) {
+          array.splice(i--, 1)
+        } else {
+          if (Array.isArray(item.options)) {
+            // 如果有字典属性,就不需要保存 options 了
+            if (item.dictCode) {
+              // 去掉特殊属性
+              delete item.options
             }
           }
         }
-        return array
-      },
+      }
+      return array
+    },
 
-      /** 渲染保存查询条件的 title(加个删除按钮) */
-      renderSaveTreeData(item) {
-        item.icon = this.treeIcon
-        item.originTitle = item['title']
-        item.title = (fn, vNode) => {
-          let { originTitle } = vNode.dataRef
-          return (
-            <div class="j-history-tree-title">
-              <span>{originTitle}</span>
-
-              <div class="j-history-tree-title-closer" onClick={e => this.handleRemoveSaveTreeItem(e, vNode)}>
-                <a-icon type="close-circle"/>
-              </div>
+    /** 渲染保存查询条件的 title(加个删除按钮) */
+    renderSaveTreeData(item) {
+      item.icon = this.treeIcon
+      item.originTitle = item['title']
+      item.title = (fn, vNode) => {
+        let { originTitle } = vNode.dataRef
+        return (
+          <div class="j-history-tree-title">
+            <span>{originTitle}</span>
+
+            <div class="j-history-tree-title-closer" onClick={(e) => this.handleRemoveSaveTreeItem(e, vNode)}>
+              <a-icon type="close-circle" />
             </div>
-          )
-        }
-        return item
-      },
+          </div>
+        )
+      }
+      return item
+    },
 
-      /** 判断是否允许多选 */
-      allowMultiple(item) {
-        return item.rule === 'in'
-      },
+    /** 判断是否允许多选 */
+    allowMultiple(item) {
+      return item.rule === 'in'
+    },
 
-      handleRuleChange(item, newValue) {
-        let oldValue = item.rule
-        this.$set(item, 'rule', newValue)
-        // 上一个规则是否是 in,且type是字典或下拉
-        if (oldValue === 'in') {
-          if (item.dictCode || item.options instanceof Array) {
-            let value = item.val
-            if (typeof item.val === 'string') {
-              value = item.val.split(',')[0]
-            } else if (Array.isArray(item.val)) {
-              value = item.val[0]
-            }
-            this.$set(item, 'val', value)
+    handleRuleChange(item, newValue) {
+      let oldValue = item.rule
+      this.$set(item, 'rule', newValue)
+      // 上一个规则是否是 in,且type是字典或下拉
+      if (oldValue === 'in') {
+        if (item.dictCode || item.options instanceof Array) {
+          let value = item.val
+          if (typeof item.val === 'string') {
+            value = item.val.split(',')[0]
+          } else if (Array.isArray(item.val)) {
+            value = item.val[0]
           }
+          this.$set(item, 'val', value)
         }
-      },
-
-      handleChangeJPopup(item, e, values) {
-        item.val = values[item.popup['destFields']]
-      },
+      }
+    },
 
-    }
-  }
+    handleChangeJPopup(item, e, values) {
+      item.val = values[item.popup['destFields']]
+    },
+  },
+}
 </script>
 
 <style lang="less" scoped>
+.j-super-query-box {
+  display: inline-block;
+}
+
+.j-super-query-modal {
+  .j-super-query-history-card {
+    /deep/ .ant-card-body,
+    /deep/ .ant-card-head-title {
+      padding: 0;
+    }
 
-  .j-super-query-box {
-    display: inline-block;
+    /deep/ .ant-card-head {
+      padding: 4px 8px;
+      min-height: initial;
+    }
   }
 
-  .j-super-query-modal {
-
-    .j-super-query-history-card {
-      /deep/ .ant-card-body,
-      /deep/ .ant-card-head-title {
-        padding: 0;
-      }
-
-      /deep/ .ant-card-head {
-        padding: 4px 8px;
-        min-height: initial;
-      }
+  .j-super-query-history-empty {
+    /deep/ .ant-empty-image {
+      height: 80px;
+      line-height: 80px;
+      margin-bottom: 0;
     }
 
-    .j-super-query-history-empty {
-      /deep/ .ant-empty-image {
-        height: 80px;
-        line-height: 80px;
-        margin-bottom: 0;
-      }
-
-      /deep/ img {
-        width: 80px;
-        height: 65px;
-      }
+    /deep/ img {
+      width: 80px;
+      height: 65px;
+    }
 
-      /deep/ .ant-empty-description {
-        color: #afafaf;
-        margin: 8px 0;
-      }
+    /deep/ .ant-empty-description {
+      color: #afafaf;
+      margin: 8px 0;
     }
+  }
 
-    .j-super-query-history-tree {
-
-      .j-history-tree-title {
-        width: calc(100% - 24px);
-        position: relative;
-        display: inline-block;
-
-        &-closer {
-          color: #999999;
-          position: absolute;
-          top: 0;
-          right: 0;
-          width: 24px;
-          height: 24px;
-          text-align: center;
-          opacity: 0;
-          transition: opacity 0.3s, color 0.3s;
-
-          &:hover {
-            color: #666666;
-          }
-
-          &:active {
-            color: #333333;
-          }
-        }
+  .j-super-query-history-tree {
+    .j-history-tree-title {
+      width: calc(100% - 24px);
+      position: relative;
+      display: inline-block;
+
+      &-closer {
+        color: #999999;
+        position: absolute;
+        top: 0;
+        right: 0;
+        width: 24px;
+        height: 24px;
+        text-align: center;
+        opacity: 0;
+        transition: opacity 0.3s, color 0.3s;
 
         &:hover {
-          .j-history-tree-title-closer {
-            opacity: 1;
-          }
+          color: #666666;
         }
 
+        &:active {
+          color: #333333;
+        }
       }
 
-      /deep/ .ant-tree-switcher {
-        display: none;
+      &:hover {
+        .j-history-tree-title-closer {
+          opacity: 1;
+        }
       }
+    }
 
-      /deep/ .ant-tree-node-content-wrapper {
-        width: 100%;
-      }
+    /deep/ .ant-tree-switcher {
+      display: none;
     }
 
+    /deep/ .ant-tree-node-content-wrapper {
+      width: 100%;
+    }
   }
-
-</style>
+}
+</style>

+ 45 - 46
jshERP-web/src/components/jeecg/JSwitch.vue

@@ -1,57 +1,56 @@
 <template>
-  <a-switch v-model="checkStatus" :disabled="disabled" @change="handleChange"/>
+  <a-switch v-model="checkStatus" :disabled="disabled" @change="handleChange" />
 </template>
 <script>
-
-  export default {
-    name: 'JSwitch',
-    props: {
-      value:{
-        type: String,
-        required: false
-      },
-      disabled:{
-        type: Boolean,
-        required: false,
-        default: false
-      },
-      options:{
-        type:Array,
-        required:false,
-        default:()=>['Y','N']
-      }
+export default {
+  name: 'JSwitch',
+  props: {
+    value: {
+      type: String,
+      required: false,
+    },
+    disabled: {
+      type: Boolean,
+      required: false,
+      default: false,
     },
-    data () {
-      return {
-        checkStatus: false
-      }
+    options: {
+      type: Array,
+      required: false,
+      default: () => ['Y', 'N'],
     },
-    watch: {
-      value:{
-        immediate: true,
-        handler(val){
-          if(!val){
+  },
+  data() {
+    return {
+      checkStatus: false,
+    }
+  },
+  watch: {
+    value: {
+      immediate: true,
+      handler(val) {
+        if (!val) {
+          this.checkStatus = false
+          this.$emit('change', this.options[1])
+        } else {
+          if (this.options[0] == val) {
+            this.checkStatus = true
+          } else {
             this.checkStatus = false
-            this.$emit('change', this.options[1]);
-          }else{
-            if(this.options[0]==val){
-              this.checkStatus = true
-            }else{
-              this.checkStatus = false
-            }
           }
         }
-      }
+      },
     },
-    methods: {
-      handleChange(checked){
-        let flag = checked===false?this.options[1]:this.options[0];
-        this.$emit('change', flag);
-      }
+  },
+  methods: {
+    handleChange(checked) {
+      let flag = checked === false ? this.options[1] : this.options[0]
+      this.$emit('change', flag)
     },
-    model: {
-      prop: 'value',
-      event: 'change'
-    }
-  }
+  },
+  model: {
+    prop: 'value',
+    event: 'change',
+  },
+}
 </script>

+ 161 - 161
jshERP-web/src/components/jeecg/JTreeDict.vue

@@ -10,190 +10,190 @@
     :value="treeValue"
     :treeData="treeData"
     @change="onChange"
-    @search="onSearch">
+    @search="onSearch"
+  >
   </a-tree-select>
 </template>
 
 <script>
-  import { getAction } from '@/api/manage'
+import { getAction } from '@/api/manage'
 
-  export default {
-    name: 'JTreeDict',
-    data(){
-      return {
-        treeData:[],
-        treeValue: null,
-        url_root:"/sys/category/loadTreeRoot",
-        url_children:"/sys/category/loadTreeChildren",
-        url_view:'/sys/category/loadOne',
-      }
+export default {
+  name: 'JTreeDict',
+  data() {
+    return {
+      treeData: [],
+      treeValue: null,
+      url_root: '/sys/category/loadTreeRoot',
+      url_children: '/sys/category/loadTreeChildren',
+      url_view: '/sys/category/loadOne',
+    }
+  },
+  props: {
+    value: {
+      type: String,
+      required: false,
     },
-    props:{
-      value:{
-        type: String,
-        required: false
-      },
-      placeholder:{
-        type: String,
-        default: '请选择',
-        required: false
-      },
-      parentCode:{
-        type: String,
-        default: '',
-        required: false
-      },
-      field:{
-        type: String,
-        default: 'id',
-        required: false
-      },
-      root:{
-        type:Object,
-        required:false,
-        default:()=>{
-          return {
-            pid:'0'
-          }
+    placeholder: {
+      type: String,
+      default: '请选择',
+      required: false,
+    },
+    parentCode: {
+      type: String,
+      default: '',
+      required: false,
+    },
+    field: {
+      type: String,
+      default: 'id',
+      required: false,
+    },
+    root: {
+      type: Object,
+      required: false,
+      default: () => {
+        return {
+          pid: '0',
         }
       },
-      async:{
-        type:Boolean,
-        default:false,
-        required:false
+    },
+    async: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  watch: {
+    root: {
+      handler(val) {
+        console.log('root-change', val)
       },
-      disabled:{
-        type:Boolean,
-        default:false,
-        required:false
-      }
+      deep: true,
     },
-    watch:{
-      root:{
-        handler(val){
-          console.log("root-change",val)
-        },
-        deep:true
+    parentCode: {
+      handler() {
+        this.loadRoot()
       },
-      parentCode:{
-        handler(){
-          this.loadRoot()
-        }
+    },
+    value: {
+      handler() {
+        this.loadViewInfo()
       },
-      value:{
-        handler(){
-          this.loadViewInfo()
+    },
+  },
+  created() {
+    this.loadRoot()
+    this.loadViewInfo()
+  },
+  model: {
+    prop: 'value',
+    event: 'change',
+  },
+  methods: {
+    loadViewInfo() {
+      if (!this.value || this.value == '0') {
+        this.treeValue = null
+      } else {
+        let param = {
+          field: this.field,
+          val: this.value,
         }
+        getAction(this.url_view, param).then((res) => {
+          if (res.success) {
+            this.treeValue = {
+              value: this.value,
+              label: res.result.name,
+            }
+          }
+        })
       }
     },
-    created(){
-      this.loadRoot()
-      this.loadViewInfo()
-    },
-    model: {
-      prop: 'value',
-      event: 'change'
-    },
-    methods:{
-      loadViewInfo(){
-        if(!this.value || this.value=="0"){
-          this.treeValue = null
-        }else{
-          let param = {
-            field:this.field,
-            val:this.value
-          }
-          getAction(this.url_view,param).then(res=>{
-            if(res.success){
-              this.treeValue = {
-                value:this.value,
-                label:res.result.name
-              }
-            }
-          })
+    loadRoot() {
+      let param = {
+        async: this.async,
+        pcode: this.parentCode,
+      }
+      getAction(this.url_root, param).then((res) => {
+        if (res.success) {
+          this.handleTreeNodeValue(res.result)
+          console.log('aaaa', res.result)
+          this.treeData = [...res.result]
+        } else {
+          this.$message.error(res.message)
         }
-      },
-      loadRoot(){
+      })
+    },
+    asyncLoadTreeData(treeNode) {
+      return new Promise((resolve) => {
+        if (!this.async) {
+          resolve()
+          return
+        }
+        if (treeNode.$vnode.children) {
+          resolve()
+          return
+        }
+        let pid = treeNode.$vnode.key
         let param = {
-          async:this.async,
-          pcode:this.parentCode
+          pid: pid,
         }
-        getAction(this.url_root,param).then(res=>{
-          if(res.success){
+        getAction(this.url_children, param).then((res) => {
+          if (res.success) {
             this.handleTreeNodeValue(res.result)
-            console.log("aaaa",res.result)
-            this.treeData = [...res.result]
-          }else{
-            this.$message.error(res.message)
+            this.addChildren(pid, res.result, this.treeData)
+            this.treeData = [...this.treeData]
           }
+          resolve()
         })
-      },
-      asyncLoadTreeData (treeNode) {
-        return new Promise((resolve) => {
-          if(!this.async){
-            resolve()
-            return
-          }
-          if (treeNode.$vnode.children) {
-            resolve()
-            return
-          }
-          let pid = treeNode.$vnode.key
-          let param = {
-            pid:pid
-          }
-          getAction(this.url_children,param).then(res=>{
-            if(res.success){
-              this.handleTreeNodeValue(res.result)
-              this.addChildren(pid,res.result,this.treeData)
-              this.treeData = [...this.treeData]
-            }
-            resolve()
-          })
-        })
-      },
-      addChildren(pid,children,treeArray){
-        if(treeArray && treeArray.length>0){
-          for(let item of treeArray){
-            if(item.key == pid){
-              if(!children || children.length==0){
-                item.leaf = true
-              }else{
-                item.children = children
-              }
-              break
-            }else{
-              this.addChildren(pid,children,item.children)
+      })
+    },
+    addChildren(pid, children, treeArray) {
+      if (treeArray && treeArray.length > 0) {
+        for (let item of treeArray) {
+          if (item.key == pid) {
+            if (!children || children.length == 0) {
+              item.leaf = true
+            } else {
+              item.children = children
             }
+            break
+          } else {
+            this.addChildren(pid, children, item.children)
           }
         }
-      },
-      handleTreeNodeValue(result){
-        let storeField = this.field=='code'?'code':'key'
-        for(let i of result){
-          i.value = i[storeField]
-          i.isLeaf = (!i.leaf)?false:true
-          if(i.children && i.children.length>0){
-            this.handleTreeNodeValue(i.children)
-          }
-        }
-      },
-      onChange(value){
-        console.log(value)
-        if(!value){
-          this.$emit('change', '');
-        }else{
-          this.$emit('change', value.value);
+      }
+    },
+    handleTreeNodeValue(result) {
+      let storeField = this.field == 'code' ? 'code' : 'key'
+      for (let i of result) {
+        i.value = i[storeField]
+        i.isLeaf = !i.leaf ? false : true
+        if (i.children && i.children.length > 0) {
+          this.handleTreeNodeValue(i.children)
         }
-        this.treeValue = value
-      },
-      onSearch(value){
-        console.log(value)
-      },
-      getCurrTreeData(){
-        return this.treeData
       }
-    }
-
-  }
-</script>
+    },
+    onChange(value) {
+      console.log(value)
+      if (!value) {
+        this.$emit('change', '')
+      } else {
+        this.$emit('change', value.value)
+      }
+      this.treeValue = value
+    },
+    onSearch(value) {
+      console.log(value)
+    },
+    getCurrTreeData() {
+      return this.treeData
+    },
+  },
+}
+</script>

+ 217 - 219
jshERP-web/src/components/jeecg/JTreeSelect.vue

@@ -12,249 +12,247 @@
     :treeData="treeData"
     :multiple="multiple"
     @change="onChange"
-    @search="onSearch">
+    @search="onSearch"
+  >
   </a-tree-select>
 </template>
 <script>
+/*
+ * 异步树加载组件 通过传入表名 显示字段 存储字段 加载一个树控件
+ * <j-tree-select dict="aa_tree_test,aad,id" pid-field="pid" ></j-tree-select>
+ * */
+import { getAction } from '@/api/manage'
 
-  /*
-  * 异步树加载组件 通过传入表名 显示字段 存储字段 加载一个树控件
-  * <j-tree-select dict="aa_tree_test,aad,id" pid-field="pid" ></j-tree-select>
-  * */
-  import { getAction } from '@/api/manage'
-
-  export default {
-    name: 'JTreeSelect',
-    props: {
-      value:{
-        type: String,
-        required: false
-      },
-      placeholder:{
-        type: String,
-        default: '请选择',
-        required: false
-      },
-      dict:{
-        type: String,
-        default: '',
-        required: false
-      },
-      pidField:{
-        type: String,
-        default: 'pid',
-        required: false
-      },
-      pidValue:{
-        type: String,
-        default: '',
-        required: false
-      },
-      disabled:{
-        type:Boolean,
-        default:false,
-        required:false
-      },
-      hasChildField:{
-        type: String,
-        default: '',
-        required: false
-      },
-      condition:{
-        type:String,
-        default:'',
-        required:false
-      },
-      // 是否支持多选
-      multiple: {
-        type: Boolean,
-        default: false,
-      },
-      loadTriggleChange:{
-        type: Boolean,
-        default: false,
-        required:false
-      }
+export default {
+  name: 'JTreeSelect',
+  props: {
+    value: {
+      type: String,
+      required: false,
     },
-    data () {
-      return {
-        treeValue: null,
-        treeData:[],
-        url:"/sys/dict/loadTreeData",
-        view:'/sys/dict/loadDictItem/',
-        tableName:"",
-        text:"",
-        code:"",
-
+    placeholder: {
+      type: String,
+      default: '请选择',
+      required: false,
+    },
+    dict: {
+      type: String,
+      default: '',
+      required: false,
+    },
+    pidField: {
+      type: String,
+      default: 'pid',
+      required: false,
+    },
+    pidValue: {
+      type: String,
+      default: '',
+      required: false,
+    },
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+    hasChildField: {
+      type: String,
+      default: '',
+      required: false,
+    },
+    condition: {
+      type: String,
+      default: '',
+      required: false,
+    },
+    // 是否支持多选
+    multiple: {
+      type: Boolean,
+      default: false,
+    },
+    loadTriggleChange: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      treeValue: null,
+      treeData: [],
+      url: '/sys/dict/loadTreeData',
+      view: '/sys/dict/loadDictItem/',
+      tableName: '',
+      text: '',
+      code: '',
+    }
+  },
+  watch: {
+    value() {
+      this.loadItemByCode()
+    },
+    dict() {
+      this.initDictInfo()
+      this.loadRoot()
+    },
+  },
+  created() {
+    this.validateProp().then(() => {
+      this.initDictInfo()
+      this.loadRoot()
+      this.loadItemByCode()
+    })
+  },
+  methods: {
+    loadItemByCode() {
+      if (!this.value || this.value == '0') {
+        this.treeValue = null
+      } else {
+        getAction(`${this.view}${this.dict}`, { key: this.value }).then((res) => {
+          if (res.success) {
+            let values = this.value.split(',')
+            this.treeValue = res.result.map((item, index) => ({
+              key: values[index],
+              value: values[index],
+              label: item,
+            }))
+            this.onLoadTriggleChange(res.result[0])
+          }
+        })
       }
     },
-    watch: {
-      value () {
-        this.loadItemByCode()
-      },
-      dict(){
-        this.initDictInfo()
-        this.loadRoot();
+    onLoadTriggleChange(text) {
+      //只有单选才会触发
+      if (!this.multiple && this.loadTriggleChange) {
+        this.$emit('change', this.value, text)
       }
     },
-    created(){
-      this.validateProp().then(()=>{
-        this.initDictInfo()
-        this.loadRoot()
-        this.loadItemByCode()
-      })
+    initDictInfo() {
+      let arr = this.dict.split(',')
+      this.tableName = arr[0]
+      this.text = arr[1]
+      this.code = arr[2]
     },
-    methods: {
-      loadItemByCode(){
-        if(!this.value || this.value=="0"){
-          this.treeValue = null
-        }else{
-          getAction(`${this.view}${this.dict}`,{key:this.value}).then(res=>{
-            if(res.success){
-              let values = this.value.split(',')
-              this.treeValue = res.result.map((item, index) => ({
-                key: values[index],
-                value: values[index],
-                label: item
-              }))
-              this.onLoadTriggleChange(res.result[0]);
-            }
-          })
+    asyncLoadTreeData(treeNode) {
+      return new Promise((resolve) => {
+        if (treeNode.$vnode.children) {
+          resolve()
+          return
         }
-      },
-      onLoadTriggleChange(text){
-        //只有单选才会触发
-        if(!this.multiple && this.loadTriggleChange){
-          this.$emit('change', this.value,text)
+        let pid = treeNode.$vnode.key
+        let param = {
+          pid: pid,
+          tableName: this.tableName,
+          text: this.text,
+          code: this.code,
+          pidField: this.pidField,
+          hasChildField: this.hasChildField,
+          condition: this.condition,
         }
-      },
-      initDictInfo(){
-        let arr = this.dict.split(",")
-        this.tableName = arr[0]
-        this.text = arr[1]
-        this.code = arr[2]
-      },
-      asyncLoadTreeData (treeNode) {
-        return new Promise((resolve) => {
-          if (treeNode.$vnode.children) {
-            resolve()
-            return
-          }
-          let pid = treeNode.$vnode.key
-          let param = {
-            pid:pid,
-            tableName:this.tableName,
-            text:this.text,
-            code:this.code,
-            pidField:this.pidField,
-            hasChildField:this.hasChildField,
-            condition:this.condition
-          }
-          getAction(this.url,param).then(res=>{
-            if(res.success){
-              for(let i of res.result){
-                i.value = i.key
-                if(i.leaf==false){
-                  i.isLeaf=false
-                }else if(i.leaf==true){
-                  i.isLeaf=true
-                }
+        getAction(this.url, param).then((res) => {
+          if (res.success) {
+            for (let i of res.result) {
+              i.value = i.key
+              if (i.leaf == false) {
+                i.isLeaf = false
+              } else if (i.leaf == true) {
+                i.isLeaf = true
               }
-              this.addChildren(pid,res.result,this.treeData)
-              this.treeData = [...this.treeData]
             }
-            resolve()
-          })
+            this.addChildren(pid, res.result, this.treeData)
+            this.treeData = [...this.treeData]
+          }
+          resolve()
         })
-      },
-      addChildren(pid,children,treeArray){
-        if(treeArray && treeArray.length>0){
-          for(let item of treeArray){
-            if(item.key == pid){
-              if(!children || children.length==0){
-                item.isLeaf=true
-              }else{
-                item.children = children
-              }
-              break
-            }else{
-              this.addChildren(pid,children,item.children)
+      })
+    },
+    addChildren(pid, children, treeArray) {
+      if (treeArray && treeArray.length > 0) {
+        for (let item of treeArray) {
+          if (item.key == pid) {
+            if (!children || children.length == 0) {
+              item.isLeaf = true
+            } else {
+              item.children = children
             }
+            break
+          } else {
+            this.addChildren(pid, children, item.children)
           }
         }
-      },
-      loadRoot(){
-        let param = {
-          pid:this.pidValue,
-          tableName:this.tableName,
-          text:this.text,
-          code:this.code,
-          pidField:this.pidField,
-          hasChildField:this.hasChildField,
-          condition:this.condition
-        }
-        getAction(this.url,param).then(res=>{
-          if(res.success && res.result){
-            for(let i of res.result){
-              i.value = i.key
-              if(i.leaf==false){
-                i.isLeaf=false
-              }else if(i.leaf==true){
-                i.isLeaf=true
-              }
+      }
+    },
+    loadRoot() {
+      let param = {
+        pid: this.pidValue,
+        tableName: this.tableName,
+        text: this.text,
+        code: this.code,
+        pidField: this.pidField,
+        hasChildField: this.hasChildField,
+        condition: this.condition,
+      }
+      getAction(this.url, param).then((res) => {
+        if (res.success && res.result) {
+          for (let i of res.result) {
+            i.value = i.key
+            if (i.leaf == false) {
+              i.isLeaf = false
+            } else if (i.leaf == true) {
+              i.isLeaf = true
             }
-            this.treeData = [...res.result]
-          }else{
-            console.log("数根节点查询结果-else",res)
           }
-        })
-      },
-      onChange(value){
-        if(!value){
-          this.$emit('change', '');
-          this.treeValue = null
-        } else if (value instanceof Array) {
-          this.$emit('change', value.map(item => item.value).join(','))
-          this.treeValue = value
+          this.treeData = [...res.result]
         } else {
-          this.$emit('change', value.value,value.label)
-          this.treeValue = value
+          console.log('数根节点查询结果-else', res)
         }
-
-      },
-      onSearch(value){
-        console.log(value)
-      },
-      getCurrTreeData(){
-        return this.treeData
-      },
-      validateProp(){
-        let mycondition = this.condition
-        return new Promise((resolve,reject)=>{
-          if(!mycondition){
-            resolve();
-          }else{
-            try {
-              let test=JSON.parse(mycondition);
-              console.log("aaaaasdsdd",typeof test)
-              if(typeof test == 'object' && test){
-                resolve()
-              }else{
-                this.$message.error("组件JTreeSelect-condition传值有误,需要一个json字符串!")
-                reject()
-              }
-            } catch(e) {
-              this.$message.error("组件JTreeSelect-condition传值有误,需要一个json字符串!")
+      })
+    },
+    onChange(value) {
+      if (!value) {
+        this.$emit('change', '')
+        this.treeValue = null
+      } else if (value instanceof Array) {
+        this.$emit('change', value.map((item) => item.value).join(','))
+        this.treeValue = value
+      } else {
+        this.$emit('change', value.value, value.label)
+        this.treeValue = value
+      }
+    },
+    onSearch(value) {
+      console.log(value)
+    },
+    getCurrTreeData() {
+      return this.treeData
+    },
+    validateProp() {
+      let mycondition = this.condition
+      return new Promise((resolve, reject) => {
+        if (!mycondition) {
+          resolve()
+        } else {
+          try {
+            let test = JSON.parse(mycondition)
+            console.log('aaaaasdsdd', typeof test)
+            if (typeof test == 'object' && test) {
+              resolve()
+            } else {
+              this.$message.error('组件JTreeSelect-condition传值有误,需要一个json字符串!')
               reject()
             }
+          } catch (e) {
+            this.$message.error('组件JTreeSelect-condition传值有误,需要一个json字符串!')
+            reject()
           }
-        })
-      }
+        }
+      })
     },
-    //2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼
-    model: {
-      prop: 'value',
-      event: 'change'
-    }
-  }
+  },
+  //2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼
+  model: {
+    prop: 'value',
+    event: 'change',
+  },
+}
 </script>

+ 119 - 122
jshERP-web/src/components/jeecg/JTreeTable.vue

@@ -7,121 +7,120 @@
     v-bind="tableAttrs"
     v-on="$listeners"
     @expand="handleExpand"
-    @expandedRowsChange="expandedRowKeys=$event">
-
-    <template v-for="(slotItem) of slots" :slot="slotItem" slot-scope="text, record, index">
-      <slot :name="slotItem" v-bind="{text,record,index}"></slot>
+    @expandedRowsChange="expandedRowKeys = $event"
+  >
+    <template v-for="slotItem of slots" :slot="slotItem" slot-scope="text, record, index">
+      <slot :name="slotItem" v-bind="{ text, record, index }"></slot>
     </template>
-
   </a-table>
 </template>
 
 <script>
-  import { getAction } from '@/api/manage'
+import { getAction } from '@/api/manage'
 
-  export default {
-    name: 'JTreeTable',
-    props: {
-      rowKey: {
-        type: String,
-        default: 'id'
-      },
-      // 根据什么查询,如果传递 id 就根据 id 查询
-      queryKey: {
-        type: String,
-        default: 'parentId'
-      },
-      queryParams: {
-        type: Object,
-        default: () => ({})
-      },
-      // 查询顶级时的值,如果顶级为0,则传0
-      topValue: {
-        type: String,
-        default: null
-      },
-      columns: {
-        type: Array,
-        required: true
-      },
-      url: {
-        type: String,
-        required: true
-      },
-      childrenUrl: {
-        type: String,
-        default: null
-      },
-      tableProps: {
-        type: Object,
-        default: () => ({})
-      },
-      /** 是否在创建组件的时候就查询数据 */
-      immediateRequest: {
-        type: Boolean,
-        default: true
-      },
-      condition:{
-        type:String,
-        default:'',
-        required:false
-      }
+export default {
+  name: 'JTreeTable',
+  props: {
+    rowKey: {
+      type: String,
+      default: 'id',
     },
-    data() {
-      return {
-        dataSource: [],
-        expandedRowKeys: []
-      }
+    // 根据什么查询,如果传递 id 就根据 id 查询
+    queryKey: {
+      type: String,
+      default: 'parentId',
     },
-    computed: {
-      getChildrenUrl() {
-        if (this.childrenUrl) {
-          return this.childrenUrl
-        } else {
-          return this.url
-        }
-      },
-      slots() {
-        let slots = []
-        for (let column of this.columns) {
-          if (column.scopedSlots && column.scopedSlots.customRender) {
-            slots.push(column.scopedSlots.customRender)
-          }
-        }
-        return slots
-      },
-      tableAttrs() {
-        return Object.assign(this.$attrs, this.tableProps)
+    queryParams: {
+      type: Object,
+      default: () => ({}),
+    },
+    // 查询顶级时的值,如果顶级为0,则传0
+    topValue: {
+      type: String,
+      default: null,
+    },
+    columns: {
+      type: Array,
+      required: true,
+    },
+    url: {
+      type: String,
+      required: true,
+    },
+    childrenUrl: {
+      type: String,
+      default: null,
+    },
+    tableProps: {
+      type: Object,
+      default: () => ({}),
+    },
+    /** 是否在创建组件的时候就查询数据 */
+    immediateRequest: {
+      type: Boolean,
+      default: true,
+    },
+    condition: {
+      type: String,
+      default: '',
+      required: false,
+    },
+  },
+  data() {
+    return {
+      dataSource: [],
+      expandedRowKeys: [],
+    }
+  },
+  computed: {
+    getChildrenUrl() {
+      if (this.childrenUrl) {
+        return this.childrenUrl
+      } else {
+        return this.url
       }
     },
-    watch: {
-      queryParams: {
-        deep: true,
-        handler() {
-          this.loadData()
+    slots() {
+      let slots = []
+      for (let column of this.columns) {
+        if (column.scopedSlots && column.scopedSlots.customRender) {
+          slots.push(column.scopedSlots.customRender)
         }
       }
+      return slots
     },
-    created() {
-      if (this.immediateRequest) this.loadData()
+    tableAttrs() {
+      return Object.assign(this.$attrs, this.tableProps)
     },
-    methods: {
-
-      /** 加载数据*/
-      loadData(id = this.topValue, first = true, url = this.url) {
-        this.$emit('requestBefore', { first })
+  },
+  watch: {
+    queryParams: {
+      deep: true,
+      handler() {
+        this.loadData()
+      },
+    },
+  },
+  created() {
+    if (this.immediateRequest) this.loadData()
+  },
+  methods: {
+    /** 加载数据*/
+    loadData(id = this.topValue, first = true, url = this.url) {
+      this.$emit('requestBefore', { first })
 
-        if (first) {
-          this.expandedRowKeys = []
-        }
+      if (first) {
+        this.expandedRowKeys = []
+      }
 
-        let params = Object.assign({}, this.queryParams || {})
-        params[this.queryKey] = id
-        if(this.condition && this.condition.length>0){
-          params['condition'] = this.condition
-        }
+      let params = Object.assign({}, this.queryParams || {})
+      params[this.queryKey] = id
+      if (this.condition && this.condition.length > 0) {
+        params['condition'] = this.condition
+      }
 
-        return getAction(url, params).then(res => {
+      return getAction(url, params)
+        .then((res) => {
           let list = []
           if (res.result instanceof Array) {
             list = res.result
@@ -130,7 +129,7 @@
           } else {
             throw '返回数据类型不识别'
           }
-          let dataSource = list.map(item => {
+          let dataSource = list.map((item) => {
             // 判断是否标记了带有子级
             if (item.hasChildren === true) {
               // 查找第一个带有dataIndex的值的列
@@ -150,31 +149,29 @@
           }
           this.$emit('requestSuccess', { first, dataSource, res })
           return Promise.resolve(dataSource)
-        }).finally(() => this.$emit('requestFinally', { first }))
-      },
+        })
+        .finally(() => this.$emit('requestFinally', { first }))
+    },
 
-      /** 点击展开图标时触发 */
-      handleExpand(expanded, record) {
-        // 判断是否是展开状态
-        if (expanded) {
-          // 判断子级的首个项的标记是否是“正在加载中”,如果是就加载数据
-          if (record.children[0].isLoading === true) {
-            this.loadData(record.id, false, this.getChildrenUrl).then(dataSource => {
-              // 处理好的数据可直接赋值给children
-              if (dataSource.length === 0) {
-                record.children = null
-              } else {
-                record.children = dataSource
-              }
-            })
-          }
+    /** 点击展开图标时触发 */
+    handleExpand(expanded, record) {
+      // 判断是否是展开状态
+      if (expanded) {
+        // 判断子级的首个项的标记是否是“正在加载中”,如果是就加载数据
+        if (record.children[0].isLoading === true) {
+          this.loadData(record.id, false, this.getChildrenUrl).then((dataSource) => {
+            // 处理好的数据可直接赋值给children
+            if (dataSource.length === 0) {
+              record.children = null
+            } else {
+              record.children = dataSource
+            }
+          })
         }
       }
-
-    }
-  }
+    },
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 398 - 380
jshERP-web/src/components/jeecg/JUpload.vue

@@ -1,11 +1,20 @@
 <template>
   <div :id="containerId" style="position: relative">
-
     <!--  ---------------------------- begin 图片左右换位置 ------------------------------------- -->
-    <div class="movety-container" :style="{top:top+'px',left:left+'px',display:moveDisplay}" style="padding:0 8px;position: absolute;z-index: 91;height: 32px;width: 104px;text-align: center;">
-      <div :id="containerId+'-mover'" :class="showMoverTask?'uploadty-mover-mask':'movety-opt'" style="margin-top: 12px">
-        <a @click="moveLast" style="margin: 0 5px;"><a-icon type="arrow-left" style="color: #fff;font-size: 16px"/></a>
-        <a @click="moveNext" style="margin: 0 5px;"><a-icon type="arrow-right" style="color: #fff;font-size: 16px"/></a>
+    <div
+      class="movety-container"
+      :style="{ top: top + 'px', left: left + 'px', display: moveDisplay }"
+      style="padding: 0 8px; position: absolute; z-index: 91; height: 32px; width: 104px; text-align: center"
+    >
+      <div
+        :id="containerId + '-mover'"
+        :class="showMoverTask ? 'uploadty-mover-mask' : 'movety-opt'"
+        style="margin-top: 12px"
+      >
+        <a @click="moveLast" style="margin: 0 5px"><a-icon type="arrow-left" style="color: #fff; font-size: 16px" /></a>
+        <a @click="moveNext" style="margin: 0 5px"
+          ><a-icon type="arrow-right" style="color: #fff; font-size: 16px"
+        /></a>
       </div>
     </div>
     <!--  ---------------------------- end 图片左右换位置 ------------------------------------- -->
@@ -15,7 +24,7 @@
       :multiple="true"
       :action="uploadAction"
       :headers="headers"
-      :data="{'biz':bizPath}"
+      :data="{ biz: bizPath }"
       :fileList="fileList"
       :beforeUpload="beforeUpload"
       @change="handleChange"
@@ -23,15 +32,14 @@
       :returnUrl="returnUrl"
       :listType="complistType"
       @preview="handlePreview"
-      :class="{'uploadty-disabled':disabled}">
+      :class="{ 'uploadty-disabled': disabled }"
+    >
       <template>
         <div v-if="isImageComp">
           <a-icon type="plus" />
           <div class="ant-upload-text">{{ text }}</div>
         </div>
-        <a-button v-else-if="buttonVisible">
-         <a-icon type="upload" />{{ text }}
-        </a-button>
+        <a-button v-else-if="buttonVisible"> <a-icon type="upload" />{{ text }} </a-button>
       </template>
     </a-upload>
     <a-modal :visible="previewVisible" :width="1000" :footer="null" @cancel="handleCancel">
@@ -41,413 +49,423 @@
 </template>
 
 <script>
+import Vue from 'vue'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import { getFileAccessHttpUrl } from '@/api/manage'
+import { fileSizeLimit } from '@/api/api'
 
-  import Vue from 'vue'
-  import { ACCESS_TOKEN } from "@/store/mutation-types"
-  import { getFileAccessHttpUrl } from '@/api/manage';
-  import { fileSizeLimit } from '@/api/api'
-
-  const FILE_TYPE_ALL = "all"
-  const FILE_TYPE_IMG = "image"
-  const FILE_TYPE_TXT = "file"
-  const uidGenerator=()=>{
-    return '-'+parseInt(Math.random()*10000+1,10);
+const FILE_TYPE_ALL = 'all'
+const FILE_TYPE_IMG = 'image'
+const FILE_TYPE_TXT = 'file'
+const uidGenerator = () => {
+  return '-' + parseInt(Math.random() * 10000 + 1, 10)
+}
+const getFileName = (path) => {
+  if (path.lastIndexOf('\\') >= 0) {
+    let reg = new RegExp('\\\\', 'g')
+    path = path.replace(reg, '/')
   }
-  const getFileName=(path)=>{
-    if(path.lastIndexOf("\\")>=0){
-      let reg=new RegExp("\\\\","g");
-      path = path.replace(reg,"/");
+  return path.substring(path.lastIndexOf('/') + 1)
+}
+export default {
+  name: 'JUpload',
+  data() {
+    return {
+      uploadAction: window._CONFIG['domianURL'] + '/systemConfig/upload',
+      headers: {},
+      fileList: [],
+      newFileList: [],
+      uploadGoOn: true,
+      previewVisible: false,
+      //---------------------------- begin 图片左右换位置 -------------------------------------
+      previewImage: '',
+      containerId: '',
+      top: '',
+      left: '',
+      moveDisplay: 'none',
+      showMoverTask: false,
+      moverHold: false,
+      currentImg: '',
+      //---------------------------- end 图片左右换位置 -------------------------------------
+      sizeLimit: 0,
     }
-    return path.substring(path.lastIndexOf("/")+1);
-  }
-  export default {
-    name: 'JUpload',
-    data(){
-      return {
-        uploadAction:window._CONFIG['domianURL']+"/systemConfig/upload",
-        headers:{},
-        fileList: [],
-        newFileList: [],
-        uploadGoOn:true,
-        previewVisible: false,
-        //---------------------------- begin 图片左右换位置 -------------------------------------
-        previewImage: '',
-        containerId:'',
-        top:'',
-        left:'',
-        moveDisplay:'none',
-        showMoverTask:false,
-        moverHold:false,
-        currentImg:'',
-        //---------------------------- end 图片左右换位置 -------------------------------------
-        sizeLimit: 0
-      }
+  },
+  props: {
+    text: {
+      type: String,
+      required: false,
+      default: '点击上传',
     },
-    props:{
-      text:{
-        type:String,
-        required:false,
-        default:"点击上传"
-      },
-      fileType:{
-        type:String,
-        required:false,
-        default:FILE_TYPE_ALL
-      },
-      /*这个属性用于控制文件上传的业务路径*/
-      bizPath:{
-        type:String,
-        required:false,
-        default:"temp"
-      },
-      value:{
-        type:[String,Array],
-        required:false
-      },
-      // update-begin- --- author:wangshuai ------ date:20190929 ---- for:Jupload组件增加是否能够点击
-      disabled:{
-        type:Boolean,
-        required:false,
-        default: false
-      },
-      // update-end- --- author:wangshuai ------ date:20190929 ---- for:Jupload组件增加是否能够点击
-      //此属性被废弃了
-      triggerChange:{
-        type: Boolean,
-        required: false,
-        default: false
-      },
-      /**
-       * update -- author:lvdandan -- date:20190219 -- for:Jupload组件增加是否返回url,
-       * true:仅返回url
-       * false:返回fileName filePath fileSize
-       */
-      returnUrl:{
-        type:Boolean,
-        required:false,
-        default: true
-      },
-      number:{
-        type:Number,
-        required:false,
-        default: 0
-      },
-      buttonVisible:{
-        type:Boolean,
-        required:false,
-        default: true
-      },
+    fileType: {
+      type: String,
+      required: false,
+      default: FILE_TYPE_ALL,
     },
-    watch:{
-      value:{
-        immediate: true,
-        handler() {
-          let val = this.value
-          if (val instanceof Array) {
-            if(this.returnUrl){
-              this.initFileList(val.join(','))
-            }else{
-              this.initFileListArr(val);
-            }
+    /*这个属性用于控制文件上传的业务路径*/
+    bizPath: {
+      type: String,
+      required: false,
+      default: 'temp',
+    },
+    value: {
+      type: [String, Array],
+      required: false,
+    },
+    // update-begin- --- author:wangshuai ------ date:20190929 ---- for:Jupload组件增加是否能够点击
+    disabled: {
+      type: Boolean,
+      required: false,
+      default: false,
+    },
+    // update-end- --- author:wangshuai ------ date:20190929 ---- for:Jupload组件增加是否能够点击
+    //此属性被废弃了
+    triggerChange: {
+      type: Boolean,
+      required: false,
+      default: false,
+    },
+    /**
+     * update -- author:lvdandan -- date:20190219 -- for:Jupload组件增加是否返回url,
+     * true:仅返回url
+     * false:返回fileName filePath fileSize
+     */
+    returnUrl: {
+      type: Boolean,
+      required: false,
+      default: true,
+    },
+    number: {
+      type: Number,
+      required: false,
+      default: 0,
+    },
+    buttonVisible: {
+      type: Boolean,
+      required: false,
+      default: true,
+    },
+  },
+  watch: {
+    value: {
+      immediate: true,
+      handler() {
+        let val = this.value
+        if (val instanceof Array) {
+          if (this.returnUrl) {
+            this.initFileList(val.join(','))
           } else {
-            this.initFileList(val)
+            this.initFileListArr(val)
           }
+        } else {
+          this.initFileList(val)
         }
-      }
-    },
-    computed:{
-      isImageComp(){
-        return this.fileType === FILE_TYPE_IMG
       },
-      complistType(){
-        return this.fileType === FILE_TYPE_IMG?'picture-card':'text'
-      }
     },
-    created(){
-      this.initFileSizeLimit()
-      const token = Vue.ls.get(ACCESS_TOKEN);
-      //---------------------------- begin 图片左右换位置 -------------------------------------
-      this.headers = {"X-Access-Token":token};
-      this.containerId = 'container-ty-'+new Date().getTime();
-      //---------------------------- end 图片左右换位置 -------------------------------------
+  },
+  computed: {
+    isImageComp() {
+      return this.fileType === FILE_TYPE_IMG
+    },
+    complistType() {
+      return this.fileType === FILE_TYPE_IMG ? 'picture-card' : 'text'
     },
+  },
+  created() {
+    this.initFileSizeLimit()
+    const token = Vue.ls.get(ACCESS_TOKEN)
+    //---------------------------- begin 图片左右换位置 -------------------------------------
+    this.headers = { 'X-Access-Token': token }
+    this.containerId = 'container-ty-' + new Date().getTime()
+    //---------------------------- end 图片左右换位置 -------------------------------------
+  },
 
-    methods:{
-      initFileSizeLimit() {
-        fileSizeLimit().then((res)=>{
-          if(res.code === 200) {
-            this.sizeLimit = res.data
-          }
-        })
-      },
-      initFileListArr(val){
-        if(!val || val.length==0){
-          this.fileList = [];
-          return;
+  methods: {
+    initFileSizeLimit() {
+      fileSizeLimit().then((res) => {
+        if (res.code === 200) {
+          this.sizeLimit = res.data
         }
-        let fileList = [];
-        for(var a=0;a<val.length;a++){
-          let url = getFileAccessHttpUrl(val[a].filePath);
-          fileList.push({
-            uid:uidGenerator(),
-            name:val[a].fileName,
-            status: 'done',
-            url: url,
-            response:{
-              code:"history",
-              data:val[a].filePath
-            }
-          })
-        }
-        this.fileList = fileList
-      },
-      initFileList(paths){
-        if(!paths || paths.length==0){
-          //return [];
-          // update-begin- --- author:os_chengtgen ------ date:20190729 ---- for:issues:326,Jupload组件初始化bug
-          this.fileList = [];
-          return;
-          // update-end- --- author:os_chengtgen ------ date:20190729 ---- for:issues:326,Jupload组件初始化bug
-        }
-        let fileList = [];
-        let arr = paths.split(",")
-        for(var a=0;a<arr.length;a++){
-          let url = getFileAccessHttpUrl('systemConfig/static/' + arr[a]);
-          fileList.push({
-            uid:uidGenerator(),
-            name:getFileName(arr[a]),
-            status: 'done',
-            url: url,
-            response:{
-              code:"history",
-              data:arr[a]
-            }
-          })
-        }
-        this.fileList = fileList
-      },
-      handlePathChange(){
-        let uploadFiles = this.fileList
-        let path = ''
-        if(!uploadFiles || uploadFiles.length==0){
-          path = ''
-        }
-        let arr = [];
+      })
+    },
+    initFileListArr(val) {
+      if (!val || val.length == 0) {
+        this.fileList = []
+        return
+      }
+      let fileList = []
+      for (var a = 0; a < val.length; a++) {
+        let url = getFileAccessHttpUrl(val[a].filePath)
+        fileList.push({
+          uid: uidGenerator(),
+          name: val[a].fileName,
+          status: 'done',
+          url: url,
+          response: {
+            code: 'history',
+            data: val[a].filePath,
+          },
+        })
+      }
+      this.fileList = fileList
+    },
+    initFileList(paths) {
+      if (!paths || paths.length == 0) {
+        //return [];
+        // update-begin- --- author:os_chengtgen ------ date:20190729 ---- for:issues:326,Jupload组件初始化bug
+        this.fileList = []
+        return
+        // update-end- --- author:os_chengtgen ------ date:20190729 ---- for:issues:326,Jupload组件初始化bug
+      }
+      let fileList = []
+      let arr = paths.split(',')
+      for (var a = 0; a < arr.length; a++) {
+        let url = getFileAccessHttpUrl('systemConfig/static/' + arr[a])
+        fileList.push({
+          uid: uidGenerator(),
+          name: getFileName(arr[a]),
+          status: 'done',
+          url: url,
+          response: {
+            code: 'history',
+            data: arr[a],
+          },
+        })
+      }
+      this.fileList = fileList
+    },
+    handlePathChange() {
+      let uploadFiles = this.fileList
+      let path = ''
+      if (!uploadFiles || uploadFiles.length == 0) {
+        path = ''
+      }
+      let arr = []
 
-        for(var a=0;a<uploadFiles.length;a++){
-          arr.push(uploadFiles[a].response.data)
-        }
-        if(arr.length>0){
-          path = arr.join(",")
-        }
-        this.$emit('change', path);
-      },
-      beforeUpload(file){
-        this.uploadGoOn=true
-        let fileType = file.type;
-        let fileSize = file.size;
-        if(this.fileType===FILE_TYPE_IMG){
-          if(fileType.indexOf('image')<0){
-            this.$message.warning('请上传图片');
-            this.uploadGoOn=false
-            return false;
-          }
-        }
-        //验证文件大小
-        if(fileSize>this.sizeLimit) {
-          let parseSizeLimit = (this.sizeLimit/1024/1024).toFixed(2)
-          this.$message.warning('抱歉,文件大小不能超过' + parseSizeLimit + 'M');
-          this.uploadGoOn=false
-          return false;
-        }
-        return true
-      },
-      handleChange(info) {
-        console.log("--文件列表改变--")
-        if(!info.file.status && this.uploadGoOn === false){
-          info.fileList.pop();
+      for (var a = 0; a < uploadFiles.length; a++) {
+        arr.push(uploadFiles[a].response.data)
+      }
+      if (arr.length > 0) {
+        path = arr.join(',')
+      }
+      this.$emit('change', path)
+    },
+    beforeUpload(file) {
+      this.uploadGoOn = true
+      let fileType = file.type
+      let fileSize = file.size
+      if (this.fileType === FILE_TYPE_IMG) {
+        if (fileType.indexOf('image') < 0) {
+          this.$message.warning('请上传图片')
+          this.uploadGoOn = false
+          return false
         }
-        let fileList = info.fileList
-        if(info.file.status==='done'){
-          if(this.number>0){
-            fileList = fileList.slice(-this.number);
-          }
-          if(info.file.response.code === 200){
-            fileList = fileList.map((file) => {
-              if (file.response) {
-                let reUrl = file.response.data;
-                file.url = getFileAccessHttpUrl(reUrl);
-              }
-              return file;
-            });
-          }
-          //this.$message.success(`${info.file.name} 上传成功!`);
-        }else if (info.file.status === 'error') {
-          this.$message.error(`${info.file.name} 上传失败.`);
-        }else if(info.file.status === 'removed'){
-          this.handleDelete(info.file)
+      }
+      //验证文件大小
+      if (fileSize > this.sizeLimit) {
+        let parseSizeLimit = (this.sizeLimit / 1024 / 1024).toFixed(2)
+        this.$message.warning('抱歉,文件大小不能超过' + parseSizeLimit + 'M')
+        this.uploadGoOn = false
+        return false
+      }
+      return true
+    },
+    handleChange(info) {
+      console.log('--文件列表改变--')
+      if (!info.file.status && this.uploadGoOn === false) {
+        info.fileList.pop()
+      }
+      let fileList = info.fileList
+      if (info.file.status === 'done') {
+        if (this.number > 0) {
+          fileList = fileList.slice(-this.number)
         }
-        this.fileList = fileList
-        if(info.file.status==='done' || info.file.status === 'removed'){
-          //returnUrl为true时仅返回文件路径
-          if(this.returnUrl){
-            this.handlePathChange()
-          }else{
-            //returnUrl为false时返回文件名称、文件路径及文件大小
-            this.newFileList = [];
-            for(var a=0;a<fileList.length;a++){
-              var fileJson = {
-                fileName:fileList[a].name,
-                filePath:fileList[a].response.data,
-                fileSize:fileList[a].size
-              };
-              this.newFileList.push(fileJson);
+        if (info.file.response.code === 200) {
+          fileList = fileList.map((file) => {
+            if (file.response) {
+              let reUrl = file.response.data
+              file.url = getFileAccessHttpUrl(reUrl)
             }
-            this.$emit('change', this.newFileList);
-          }
-        }
-      },
-      handleDelete(file){
-        //如有需要新增 删除逻辑
-        console.log(file)
-      },
-      handlePreview(file){
-        let postfix = file.name.substring(file.name.lastIndexOf('.'))
-        if(postfix === '.gif' || postfix === '.jpg' || postfix === '.jpeg' || postfix === '.png' ||
-          postfix === '.GIF' || postfix === '.JPG' || postfix === '.JPEG' || postfix === '.PNG') {
-          this.previewImage = file.url || file.thumbUrl;
-          this.previewVisible = true;
-        }else{
-          location.href=file.url
+            return file
+          })
         }
-      },
-      handleCancel(){
-        this.previewVisible = false;
-      },
-      //---------------------------- begin 图片左右换位置 -------------------------------------
-      moveLast(){
-        //console.log(ev)
-        //console.log(this.fileList)
-        //console.log(this.currentImg)
-        let index = this.getIndexByUrl();
-        if(index==0){
-          this.$message.warn('未知的操作')
-        }else{
-          let curr = this.fileList[index].url;
-          let last = this.fileList[index-1].url;
-          let arr =[]
-          for(let i=0;i<this.fileList.length;i++){
-            if(i==index-1){
-              arr.push(curr)
-            }else if(i==index){
-              arr.push(last)
-            }else{
-              arr.push(this.fileList[i].url)
+        //this.$message.success(`${info.file.name} 上传成功!`);
+      } else if (info.file.status === 'error') {
+        this.$message.error(`${info.file.name} 上传失败.`)
+      } else if (info.file.status === 'removed') {
+        this.handleDelete(info.file)
+      }
+      this.fileList = fileList
+      if (info.file.status === 'done' || info.file.status === 'removed') {
+        //returnUrl为true时仅返回文件路径
+        if (this.returnUrl) {
+          this.handlePathChange()
+        } else {
+          //returnUrl为false时返回文件名称、文件路径及文件大小
+          this.newFileList = []
+          for (var a = 0; a < fileList.length; a++) {
+            var fileJson = {
+              fileName: fileList[a].name,
+              filePath: fileList[a].response.data,
+              fileSize: fileList[a].size,
             }
+            this.newFileList.push(fileJson)
           }
-          this.currentImg = last
-          this.$emit('change',arr.join(','))
+          this.$emit('change', this.newFileList)
         }
-      },
-      moveNext(){
-        let index = this.getIndexByUrl();
-        if(index==this.fileList.length-1){
-          this.$message.warn('已到最后~')
-        }else{
-          let curr = this.fileList[index].url;
-          let next = this.fileList[index+1].url;
-          let arr =[]
-          for(let i=0;i<this.fileList.length;i++){
-            if(i==index+1){
-              arr.push(curr)
-            }else if(i==index){
-              arr.push(next)
-            }else{
-              arr.push(this.fileList[i].url)
-            }
+      }
+    },
+    handleDelete(file) {
+      //如有需要新增 删除逻辑
+      console.log(file)
+    },
+    handlePreview(file) {
+      let postfix = file.name.substring(file.name.lastIndexOf('.'))
+      if (
+        postfix === '.gif' ||
+        postfix === '.jpg' ||
+        postfix === '.jpeg' ||
+        postfix === '.png' ||
+        postfix === '.GIF' ||
+        postfix === '.JPG' ||
+        postfix === '.JPEG' ||
+        postfix === '.PNG'
+      ) {
+        this.previewImage = file.url || file.thumbUrl
+        this.previewVisible = true
+      } else {
+        location.href = file.url
+      }
+    },
+    handleCancel() {
+      this.previewVisible = false
+    },
+    //---------------------------- begin 图片左右换位置 -------------------------------------
+    moveLast() {
+      //console.log(ev)
+      //console.log(this.fileList)
+      //console.log(this.currentImg)
+      let index = this.getIndexByUrl()
+      if (index == 0) {
+        this.$message.warn('未知的操作')
+      } else {
+        let curr = this.fileList[index].url
+        let last = this.fileList[index - 1].url
+        let arr = []
+        for (let i = 0; i < this.fileList.length; i++) {
+          if (i == index - 1) {
+            arr.push(curr)
+          } else if (i == index) {
+            arr.push(last)
+          } else {
+            arr.push(this.fileList[i].url)
           }
-          this.currentImg = next
-          this.$emit('change',arr.join(','))
         }
-      },
-      getIndexByUrl(){
-        for(let i=0;i<this.fileList.length;i++){
-          if(this.fileList[i].url === this.currentImg || encodeURI(this.fileList[i].url) === this.currentImg){
-            return i;
+        this.currentImg = last
+        this.$emit('change', arr.join(','))
+      }
+    },
+    moveNext() {
+      let index = this.getIndexByUrl()
+      if (index == this.fileList.length - 1) {
+        this.$message.warn('已到最后~')
+      } else {
+        let curr = this.fileList[index].url
+        let next = this.fileList[index + 1].url
+        let arr = []
+        for (let i = 0; i < this.fileList.length; i++) {
+          if (i == index + 1) {
+            arr.push(curr)
+          } else if (i == index) {
+            arr.push(next)
+          } else {
+            arr.push(this.fileList[i].url)
           }
         }
-        return -1;
+        this.currentImg = next
+        this.$emit('change', arr.join(','))
       }
     },
-    mounted(){
-      const moverObj = document.getElementById(this.containerId+'-mover');
-      moverObj.addEventListener('mouseover',()=>{
-        this.moverHold = true
-        this.moveDisplay = 'block';
-      });
-      moverObj.addEventListener('mouseout',()=>{
-        this.moverHold = false
-        this.moveDisplay = 'none';
-      });
-      let picList = document.getElementById(this.containerId)?document.getElementById(this.containerId).getElementsByClassName('ant-upload-list-picture-card'):[];
-      if(picList && picList.length>0){
-        picList[0].addEventListener('mouseover',(ev)=>{
-          ev = ev || window.event;
-          let target = ev.target || ev.srcElement;
-          if('ant-upload-list-item-info' == target.className){
-            this.showMoverTask=false
-            let item = target.parentElement
-            this.left = item.offsetLeft
-            this.top=item.offsetTop+item.offsetHeight-50;
-            this.moveDisplay = 'block';
-            this.currentImg = target.getElementsByTagName('img')[0].src
-          }
-
-        });
-
-        picList[0].addEventListener('mouseout',(ev)=>{
-          ev = ev || window.event;
-          let target = ev.target || ev.srcElement;
-          //console.log('移除',target)
-          if('ant-upload-list-item-info' == target.className){
-            this.showMoverTask=true
-            setTimeout(()=>{
-              if(this.moverHold === false)
-                this.moveDisplay = 'none';
-            },100)
-          }
-          if('ant-upload-list-item ant-upload-list-item-done' == target.className || 'ant-upload-list ant-upload-list-picture-card'== target.className){
-            this.moveDisplay = 'none';
-          }
-        })
-        //---------------------------- end 图片左右换位置 -------------------------------------
+    getIndexByUrl() {
+      for (let i = 0; i < this.fileList.length; i++) {
+        if (this.fileList[i].url === this.currentImg || encodeURI(this.fileList[i].url) === this.currentImg) {
+          return i
+        }
       }
+      return -1
     },
-    model: {
-      prop: 'value',
-      event: 'change'
+  },
+  mounted() {
+    const moverObj = document.getElementById(this.containerId + '-mover')
+    moverObj.addEventListener('mouseover', () => {
+      this.moverHold = true
+      this.moveDisplay = 'block'
+    })
+    moverObj.addEventListener('mouseout', () => {
+      this.moverHold = false
+      this.moveDisplay = 'none'
+    })
+    let picList = document.getElementById(this.containerId)
+      ? document.getElementById(this.containerId).getElementsByClassName('ant-upload-list-picture-card')
+      : []
+    if (picList && picList.length > 0) {
+      picList[0].addEventListener('mouseover', (ev) => {
+        ev = ev || window.event
+        let target = ev.target || ev.srcElement
+        if ('ant-upload-list-item-info' == target.className) {
+          this.showMoverTask = false
+          let item = target.parentElement
+          this.left = item.offsetLeft
+          this.top = item.offsetTop + item.offsetHeight - 50
+          this.moveDisplay = 'block'
+          this.currentImg = target.getElementsByTagName('img')[0].src
+        }
+      })
+
+      picList[0].addEventListener('mouseout', (ev) => {
+        ev = ev || window.event
+        let target = ev.target || ev.srcElement
+        //console.log('移除',target)
+        if ('ant-upload-list-item-info' == target.className) {
+          this.showMoverTask = true
+          setTimeout(() => {
+            if (this.moverHold === false) this.moveDisplay = 'none'
+          }, 100)
+        }
+        if (
+          'ant-upload-list-item ant-upload-list-item-done' == target.className ||
+          'ant-upload-list ant-upload-list-picture-card' == target.className
+        ) {
+          this.moveDisplay = 'none'
+        }
+      })
+      //---------------------------- end 图片左右换位置 -------------------------------------
     }
-  }
+  },
+  model: {
+    prop: 'value',
+    event: 'change',
+  },
+}
 </script>
 
 <style lang="less">
-.uploadty-disabled{
+.uploadty-disabled {
   .ant-upload-list-item {
-    .anticon-close{
+    .anticon-close {
       display: none;
     }
-    .anticon-delete{
+    .anticon-delete {
       display: none;
     }
   }
 }
-  //---------------------------- begin 图片左右换位置 -------------------------------------
-  .uploadty-mover-mask{
-    background-color: rgba(0, 0, 0, 0.5);
-    opacity: .8;
-    color: #fff;
-    height: 28px;
-    line-height: 28px;
-  }
-  //---------------------------- end 图片左右换位置 -------------------------------------
-</style>
+//---------------------------- begin 图片左右换位置 -------------------------------------
+.uploadty-mover-mask {
+  background-color: rgba(0, 0, 0, 0.5);
+  opacity: 0.8;
+  color: #fff;
+  height: 28px;
+  line-height: 28px;
+}
+//---------------------------- end 图片左右换位置 -------------------------------------
+</style>

+ 2 - 2
jshERP-web/src/components/jeecg/index.js

@@ -5,5 +5,5 @@ export default {
   install(Vue) {
     Vue.component('JFormContainer', JFormContainer)
     Vue.component(JModal.name, JModal)
-  }
-}
+  },
+}

+ 84 - 94
jshERP-web/src/components/jeecg/minipop/JFilePop.vue

@@ -1,12 +1,6 @@
 <template>
   <div>
-    <a-modal
-      title="文件上传"
-      :width="width"
-      :visible="visible"
-      @ok="ok"
-      cancelText="取消"
-      @cancel="close">
+    <a-modal title="文件上传" :width="width" :visible="visible" @ok="ok" cancelText="取消" @cancel="close">
       <!--style="top: 20px;"-->
       <j-upload :file-type="fileType" :value="filePath" @change="handleChange" :disabled="disabled"></j-upload>
     </a-modal>
@@ -14,100 +8,96 @@
 </template>
 
 <script>
-  import JUpload from '@/components/jeecg/JUpload'
-  import { getFileAccessHttpUrl } from '@/api/manage';
+import JUpload from '@/components/jeecg/JUpload'
+import { getFileAccessHttpUrl } from '@/api/manage'
 
-  const getFileName=(path)=>{
-    if(path.lastIndexOf("\\")>=0){
-      let reg=new RegExp("\\\\","g");
-      path = path.replace(reg,"/");
-    }
-    return path.substring(path.lastIndexOf("/")+1);
+const getFileName = (path) => {
+  if (path.lastIndexOf('\\') >= 0) {
+    let reg = new RegExp('\\\\', 'g')
+    path = path.replace(reg, '/')
   }
+  return path.substring(path.lastIndexOf('/') + 1)
+}
 
-  export default {
-    name: 'JFilePop',
-    components: { JUpload },
-    props:{
-      title:{
-        type:String,
-        default:'',
-        required:false
-      },
-      position:{
-        type:String,
-        default:'right',
-        required:false
-      },
-      height:{
-        type:Number,
-        default:200,
-        required:false
-      },
-      width:{
-        type:Number,
-        default:520,
-        required:false
-      },
-
-      popContainer:{
-        type:String,
-        default:'',
-        required:false
-      },
-      disabled:{
-        type:Boolean,
-        default:false,
-        required:false
-      }
+export default {
+  name: 'JFilePop',
+  components: { JUpload },
+  props: {
+    title: {
+      type: String,
+      default: '',
+      required: false,
+    },
+    position: {
+      type: String,
+      default: 'right',
+      required: false,
+    },
+    height: {
+      type: Number,
+      default: 200,
+      required: false,
+    },
+    width: {
+      type: Number,
+      default: 520,
+      required: false,
     },
-    data(){
-      return {
-        visible:false,
-        filePath:'',
-        id:'',
-        fileType:'file'
 
+    popContainer: {
+      type: String,
+      default: '',
+      required: false,
+    },
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      visible: false,
+      filePath: '',
+      id: '',
+      fileType: 'file',
+    }
+  },
+  methods: {
+    handleChange(value) {
+      this.filePath = value
+    },
+    show(id, value, flag) {
+      this.id = id
+      this.filePath = value
+      this.visible = true
+      if (flag === 'img') {
+        this.fileType = 'image'
+      } else {
+        this.fileType = 'file'
       }
     },
-    methods:{
-      handleChange(value){
-        this.filePath = value;
-      },
-      show(id,value,flag){
-        this.id = id;
-        this.filePath = value;
-        this.visible=true
-        if(flag === 'img'){
-          this.fileType = 'image'
-        }else{
-          this.fileType = 'file'
-        }
-
-      },
-      ok(){
-        if(!this.filePath){
-          this.$message.error("未上传任何文件")
-          return false;
-        }
-        let arr = this.filePath.split(",")
-        let obj = {
-          name:getFileName(arr[0]),
-          url:getFileAccessHttpUrl(arr[0]),
-          path:this.filePath,
-          status: 'done',
-          id:this.id
-        }
-        this.$emit('ok',obj)
-        this.visible=false
-      },
-      close(){
-        this.visible=false
+    ok() {
+      if (!this.filePath) {
+        this.$message.error('未上传任何文件')
+        return false
       }
-    }
-  }
+      let arr = this.filePath.split(',')
+      let obj = {
+        name: getFileName(arr[0]),
+        url: getFileAccessHttpUrl(arr[0]),
+        path: this.filePath,
+        status: 'done',
+        id: this.id,
+      }
+      this.$emit('ok', obj)
+      this.visible = false
+    },
+    close() {
+      this.visible = false
+    },
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 75 - 74
jshERP-web/src/components/jeecg/minipop/JInputPop.vue

@@ -4,98 +4,99 @@
     <div slot="title">
       <span>{{ title }}</span>
       <span style="float: right" title="关闭">
-        <a-icon type="close" @click="visible=false"/>
+        <a-icon type="close" @click="visible = false" />
       </span>
     </div>
     <a-input :value="inputContent" @change="handleInputChange" :placeholder="placeholder">
       <a-icon slot="suffix" type="fullscreen" @click.stop="pop" />
     </a-input>
     <div slot="content">
-      <textarea :value="inputContent" @input="handleInputChange" :placeholder="placeholder" :style="{ height: height + 'px', width: width + 'px' }"></textarea>
+      <textarea
+        :value="inputContent"
+        @input="handleInputChange"
+        :placeholder="placeholder"
+        :style="{ height: height + 'px', width: width + 'px' }"
+      ></textarea>
     </div>
   </a-popover>
 </template>
 
 <script>
-  export default {
-    name: 'JInputPop',
-    props:{
-      title:{
-        type:String,
-        default:'',
-        required:false
-      },
-      position:{
-        type:String,
-        default:'right',
-        required:false
-      },
-      height:{
-        type:Number,
-        default:200,
-        required:false
-      },
-      width:{
-        type:Number,
-        default:150,
-        required:false
-      },
-      value:{
-        type:String,
-        required:false
-      },
-      popContainer:{
-        type:String,
-        default:'',
-        required:false
-      },
-      placeholder:{
-        type:String,
-        required:false
-      },
+export default {
+  name: 'JInputPop',
+  props: {
+    title: {
+      type: String,
+      default: '',
+      required: false,
     },
-    data(){
-      return {
-        visible:false,
-        inputContent:''
-
-      }
+    position: {
+      type: String,
+      default: 'right',
+      required: false,
+    },
+    height: {
+      type: Number,
+      default: 200,
+      required: false,
+    },
+    width: {
+      type: Number,
+      default: 150,
+      required: false,
+    },
+    value: {
+      type: String,
+      required: false,
     },
+    popContainer: {
+      type: String,
+      default: '',
+      required: false,
+    },
+    placeholder: {
+      type: String,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      visible: false,
+      inputContent: '',
+    }
+  },
 
-    watch:{
-      value:{
-        immediate:true,
-        handler:function(){
-          if(this.value && this.value.length>0){
-            this.inputContent = this.value;
-          }
+  watch: {
+    value: {
+      immediate: true,
+      handler: function () {
+        if (this.value && this.value.length > 0) {
+          this.inputContent = this.value
         }
       },
     },
-    model: {
-      prop: 'value',
-      event: 'change'
+  },
+  model: {
+    prop: 'value',
+    event: 'change',
+  },
+  methods: {
+    handleInputChange(event) {
+      this.inputContent = event.target.value
+      this.$emit('change', this.inputContent)
     },
-    methods:{
-      handleInputChange(event){
-        this.inputContent = event.target.value
-        this.$emit('change',this.inputContent)
-      },
-      pop(){
-        this.visible=true
-      },
-      getPopupContainer(node){
-        if(!this.popContainer){
-          return node.parentNode
-        }else{
-          return document.getElementById(this.popContainer)
-        }
-
+    pop() {
+      this.visible = true
+    },
+    getPopupContainer(node) {
+      if (!this.popContainer) {
+        return node.parentNode
+      } else {
+        return document.getElementById(this.popContainer)
       }
-    }
-  }
+    },
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 807 - 698
jshERP-web/src/components/jeecg/modal/JCronModal.vue

@@ -1,12 +1,13 @@
 <template>
   <a-modal
-          title="corn表达式"
-          :width="modalWidth"
-          :visible="visible"
-          :confirmLoading="confirmLoading"
-          @ok="handleSubmit"
-          @cancel="close"
-          cancelText="关闭">
+    title="corn表达式"
+    :width="modalWidth"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @ok="handleSubmit"
+    @cancel="close"
+    cancelText="关闭"
+  >
     <div class="card-container">
       <a-tabs type="card">
         <a-tab-pane key="1" type="card">
@@ -16,8 +17,14 @@
               <a-radio value="1">每一秒钟</a-radio>
             </a-row>
             <a-row>
-              <a-radio value="2">每隔
-                <a-input-number size="small" v-model="result.second.incrementIncrement" :min="1" :max="59"></a-input-number>
+              <a-radio value="2"
+                >每隔
+                <a-input-number
+                  size="small"
+                  v-model="result.second.incrementIncrement"
+                  :min="1"
+                  :max="59"
+                ></a-input-number>
                 秒执行 从
                 <a-input-number size="small" v-model="result.second.incrementStart" :min="0" :max="59"></a-input-number>
                 秒开始
@@ -25,12 +32,13 @@
             </a-row>
             <a-row>
               <a-radio value="3">具体秒数(可多选)</a-radio>
-              <a-select style="width:354px;" size="small" mode="multiple" v-model="result.second.specificSpecific">
-                <a-select-option v-for="(val,index) in 60" :key="index" :value="index">{{ index }}</a-select-option>
+              <a-select style="width: 354px" size="small" mode="multiple" v-model="result.second.specificSpecific">
+                <a-select-option v-for="(val, index) in 60" :key="index" :value="index">{{ index }}</a-select-option>
               </a-select>
             </a-row>
             <a-row>
-              <a-radio value="4">周期从
+              <a-radio value="4"
+                >周期从
                 <a-input-number size="small" v-model="result.second.rangeStart" :min="1" :max="59"></a-input-number>
                 <a-input-number size="small" v-model="result.second.rangeEnd" :min="0" :max="59"></a-input-number>
@@ -47,21 +55,35 @@
                 <a-radio value="1">每一分钟</a-radio>
               </a-row>
               <a-row>
-                <a-radio value="2">每隔
-                  <a-input-number size="small" v-model="result.minute.incrementIncrement" :min="1" :max="60"></a-input-number>
+                <a-radio value="2"
+                  >每隔
+                  <a-input-number
+                    size="small"
+                    v-model="result.minute.incrementIncrement"
+                    :min="1"
+                    :max="60"
+                  ></a-input-number>
                   分执行 从
-                  <a-input-number size="small" v-model="result.minute.incrementStart" :min="0" :max="59"></a-input-number>
+                  <a-input-number
+                    size="small"
+                    v-model="result.minute.incrementStart"
+                    :min="0"
+                    :max="59"
+                  ></a-input-number>
                   分开始
                 </a-radio>
               </a-row>
               <a-row>
                 <a-radio value="3">具体分钟数(可多选)</a-radio>
-                <a-select style="width:340px;" size="small" mode="multiple" v-model="result.minute.specificSpecific">
-                  <a-select-option v-for="(val,index) in Array(60)" :key="index" :value="index"> {{ index }}</a-select-option>
+                <a-select style="width: 340px" size="small" mode="multiple" v-model="result.minute.specificSpecific">
+                  <a-select-option v-for="(val, index) in Array(60)" :key="index" :value="index">
+                    {{ index }}</a-select-option
+                  >
                 </a-select>
               </a-row>
               <a-row>
-                <a-radio value="4">周期从
+                <a-radio value="4"
+                  >周期从
                   <a-input-number size="small" v-model="result.minute.rangeStart" :min="1" :max="60"></a-input-number>
                   <a-input-number size="small" v-model="result.minute.rangeEnd" :min="0" :max="59"></a-input-number>
@@ -79,8 +101,14 @@
                 <a-radio value="1">每一小时</a-radio>
               </a-row>
               <a-row>
-                <a-radio value="2">每隔
-                  <a-input-number size="small" v-model="result.hour.incrementIncrement" :min="0" :max="23"></a-input-number>
+                <a-radio value="2"
+                  >每隔
+                  <a-input-number
+                    size="small"
+                    v-model="result.hour.incrementIncrement"
+                    :min="0"
+                    :max="23"
+                  ></a-input-number>
                   小时执行 从
                   <a-input-number size="small" v-model="result.hour.incrementStart" :min="0" :max="23"></a-input-number>
                   小时开始
@@ -88,12 +116,13 @@
               </a-row>
               <a-row>
                 <a-radio class="long" value="3">具体小时数(可多选)</a-radio>
-                <a-select style="width:340px;" size="small" mode="multiple" v-model="result.hour.specificSpecific">
-                  <a-select-option v-for="(val,index) in Array(24)" :key="index" >{{ index }}</a-select-option>
+                <a-select style="width: 340px" size="small" mode="multiple" v-model="result.hour.specificSpecific">
+                  <a-select-option v-for="(val, index) in Array(24)" :key="index">{{ index }}</a-select-option>
                 </a-select>
               </a-row>
               <a-row>
-                <a-radio value="4">周期从
+                <a-radio value="4"
+                  >周期从
                   <a-input-number size="small" v-model="result.hour.rangeStart" :min="0" :max="23"></a-input-number>
                   <a-input-number size="small" v-model="result.hour.rangeEnd" :min="0" :max="23"></a-input-number>
@@ -104,25 +133,39 @@
           </div>
         </a-tab-pane>
         <a-tab-pane key="4">
-          <span slot="tab"><a-icon type="schedule" />  天</span>
+          <span slot="tab"><a-icon type="schedule" /> 天</span>
           <div class="tabBody">
             <a-radio-group v-model="result.day.cronEvery">
               <a-row>
                 <a-radio value="1">每一天</a-radio>
               </a-row>
               <a-row>
-                <a-radio value="2">每隔
-                  <a-input-number size="small" v-model="result.week.incrementIncrement" :min="1" :max="7"></a-input-number>
+                <a-radio value="2"
+                  >每隔
+                  <a-input-number
+                    size="small"
+                    v-model="result.week.incrementIncrement"
+                    :min="1"
+                    :max="7"
+                  ></a-input-number>
                   周执行 从
                   <a-select size="small" v-model="result.week.incrementStart">
-                    <a-select-option v-for="(val,index) in Array(7)" :key="index" :value="index+1">{{ weekDays[index] }}</a-select-option>
+                    <a-select-option v-for="(val, index) in Array(7)" :key="index" :value="index + 1">{{
+                      weekDays[index]
+                    }}</a-select-option>
                   </a-select>
                   开始
                 </a-radio>
               </a-row>
               <a-row>
-                <a-radio value="3">每隔
-                  <a-input-number size="small" v-model="result.day.incrementIncrement" :min="1" :max="31"></a-input-number>
+                <a-radio value="3"
+                  >每隔
+                  <a-input-number
+                    size="small"
+                    v-model="result.day.incrementIncrement"
+                    :min="1"
+                    :max="31"
+                  ></a-input-number>
                   天执行 从
                   <a-input-number size="small" v-model="result.day.incrementStart" :min="1" :max="31"></a-input-number>
                   天开始
@@ -130,14 +173,18 @@
               </a-row>
               <a-row>
                 <a-radio class="long" value="4">具体星期几(可多选)</a-radio>
-                <a-select style="width:340px;" size="small" mode="multiple" v-model="result.week.specificSpecific">
-                  <a-select-option v-for="(val,index) in Array(7)" :key="index" :value="index+1">{{ weekDays[index] }}</a-select-option>
+                <a-select style="width: 340px" size="small" mode="multiple" v-model="result.week.specificSpecific">
+                  <a-select-option v-for="(val, index) in Array(7)" :key="index" :value="index + 1">{{
+                    weekDays[index]
+                  }}</a-select-option>
                 </a-select>
               </a-row>
               <a-row>
                 <a-radio class="long" value="5">具体天数(可多选)</a-radio>
-                <a-select style="width:354px;" size="small" mode="multiple" v-model="result.day.specificSpecific">
-                  <a-select-option v-for="(val,index) in Array(31)" :key="index" :value="index+1">{{ index+1 }}</a-select-option>
+                <a-select style="width: 354px" size="small" mode="multiple" v-model="result.day.specificSpecific">
+                  <a-select-option v-for="(val, index) in Array(31)" :key="index" :value="index + 1">{{
+                    index + 1
+                  }}</a-select-option>
                 </a-select>
               </a-row>
               <a-row>
@@ -147,33 +194,49 @@
                 <a-radio value="7">在这个月的最后一个工作日</a-radio>
               </a-row>
               <a-row>
-                <a-radio value="8">在这个月的最后一个
+                <a-radio value="8"
+                  >在这个月的最后一个
                   <a-select size="small" v-model="result.day.cronLastSpecificDomDay">
-                    <a-select-option v-for="(val,index) in Array(7)" :key="index" :value="index+1">{{ weekDays[index] }}</a-select-option>
+                    <a-select-option v-for="(val, index) in Array(7)" :key="index" :value="index + 1">{{
+                      weekDays[index]
+                    }}</a-select-option>
                   </a-select>
                 </a-radio>
               </a-row>
               <a-row>
                 <a-radio value="9">
                   在本月底前
-                  <a-input-number size="small" v-model="result.day.cronDaysBeforeEomMinus" :min="1" :max="31"></a-input-number>
+                  <a-input-number
+                    size="small"
+                    v-model="result.day.cronDaysBeforeEomMinus"
+                    :min="1"
+                    :max="31"
+                  ></a-input-number>
                 </a-radio>
               </a-row>
               <a-row>
-                <a-radio value="10">最近的工作日(周一至周五)至本月
-                  <a-input-number size="small" v-model="result.day.cronDaysNearestWeekday" :min="1" :max="31"></a-input-number>
+                <a-radio value="10"
+                  >最近的工作日(周一至周五)至本月
+                  <a-input-number
+                    size="small"
+                    v-model="result.day.cronDaysNearestWeekday"
+                    :min="1"
+                    :max="31"
+                  ></a-input-number>
                 </a-radio>
               </a-row>
               <a-row>
-                <a-radio value="11">在这个月的第
+                <a-radio value="11"
+                  >在这个月的第
                   <a-input-number size="small" v-model="result.week.cronNthDayNth" :min="1" :max="5"></a-input-number>
                   <a-select size="small" v-model="result.week.cronNthDayDay">
-                    <a-select-option v-for="(val,index) in Array(7)" :key="index" :value="index+1">{{ weekDays[index] }}</a-select-option>
+                    <a-select-option v-for="(val, index) in Array(7)" :key="index" :value="index + 1">{{
+                      weekDays[index]
+                    }}</a-select-option>
                   </a-select>
-
                 </a-radio>
               </a-row>
             </a-radio-group>
@@ -187,21 +250,41 @@
                 <a-radio value="1">每一月</a-radio>
               </a-row>
               <a-row>
-                <a-radio value="2">每隔
-                  <a-input-number size="small" v-model="result.month.incrementIncrement" :min="0" :max="12"></a-input-number>
+                <a-radio value="2"
+                  >每隔
+                  <a-input-number
+                    size="small"
+                    v-model="result.month.incrementIncrement"
+                    :min="0"
+                    :max="12"
+                  ></a-input-number>
                   月执行 从
-                  <a-input-number size="small" v-model="result.month.incrementStart" :min="0" :max="12"></a-input-number>
+                  <a-input-number
+                    size="small"
+                    v-model="result.month.incrementStart"
+                    :min="0"
+                    :max="12"
+                  ></a-input-number>
                   月开始
                 </a-radio>
               </a-row>
               <a-row>
                 <a-radio class="long" value="3">具体月数(可多选)</a-radio>
-                <a-select style="width:354px;" size="small" filterable mode="multiple" v-model="result.month.specificSpecific">
-                  <a-select-option v-for="(val,index) in Array(12)" :key="index" :value="index+1">{{ index+1 }}</a-select-option>
+                <a-select
+                  style="width: 354px"
+                  size="small"
+                  filterable
+                  mode="multiple"
+                  v-model="result.month.specificSpecific"
+                >
+                  <a-select-option v-for="(val, index) in Array(12)" :key="index" :value="index + 1">{{
+                    index + 1
+                  }}</a-select-option>
                 </a-select>
               </a-row>
               <a-row>
-                <a-radio value="4">从
+                <a-radio value="4"
+                  >从
                   <a-input-number size="small" v-model="result.month.rangeStart" :min="1" :max="12"></a-input-number>
                   <a-input-number size="small" v-model="result.month.rangeEnd" :min="1" :max="12"></a-input-number>
@@ -219,22 +302,47 @@
                 <a-radio value="1">每一年</a-radio>
               </a-row>
               <a-row>
-                <a-radio value="2">每隔
-                  <a-input-number size="small" v-model="result.year.incrementIncrement" :min="1" :max="99"></a-input-number>
+                <a-radio value="2"
+                  >每隔
+                  <a-input-number
+                    size="small"
+                    v-model="result.year.incrementIncrement"
+                    :min="1"
+                    :max="99"
+                  ></a-input-number>
                   年执行 从
-                  <a-input-number size="small" v-model="result.year.incrementStart" :min="2019" :max="2119"></a-input-number>
+                  <a-input-number
+                    size="small"
+                    v-model="result.year.incrementStart"
+                    :min="2019"
+                    :max="2119"
+                  ></a-input-number>
                   年开始
                 </a-radio>
               </a-row>
               <a-row>
                 <a-radio class="long" value="3">具体年份(可多选)</a-radio>
-                <a-select style="width:354px;" size="small" filterable mode="multiple" v-model="result.year.specificSpecific">
-                  <a-select-option v-for="(val,index) in Array(100)" :key="index" :value="2019+index">{{ 2019+index }}</a-select-option>
+                <a-select
+                  style="width: 354px"
+                  size="small"
+                  filterable
+                  mode="multiple"
+                  v-model="result.year.specificSpecific"
+                >
+                  <a-select-option v-for="(val, index) in Array(100)" :key="index" :value="2019 + index">{{
+                    2019 + index
+                  }}</a-select-option>
                 </a-select>
               </a-row>
               <a-row>
-                <a-radio value="4">从
-                  <a-input-number size="small" v-model="result.year.rangeStart" :min="2019" :max="2119"></a-input-number>
+                <a-radio value="4"
+                  >从
+                  <a-input-number
+                    size="small"
+                    v-model="result.year.rangeStart"
+                    :min="2019"
+                    :max="2119"
+                  ></a-input-number>
                   <a-input-number size="small" v-model="result.year.rangeEnd" :min="2019" :max="2119"></a-input-number>
                   年之间的每一年
@@ -245,684 +353,685 @@
         </a-tab-pane>
       </a-tabs>
       <div class="bottom">
-        <span class="value">{{this.cron }}</span>
+        <span class="value">{{ this.cron }}</span>
       </div>
     </div>
   </a-modal>
 </template>
 <script>
-  export default {
-    name:'VueCron',
-    props:['data'],
-    data(){
-      return {
-        visible: false,
-        confirmLoading:false,
-        size:'large',
-        weekDays:['天','一','二','三','四','五','六'].map(val=>'星期'+val),
-        result: {
-          second:{},
-          minute:{},
-          hour:{},
-          day:{},
-          week:{},
-          month:{},
-          year:{}
+export default {
+  name: 'VueCron',
+  props: ['data'],
+  data() {
+    return {
+      visible: false,
+      confirmLoading: false,
+      size: 'large',
+      weekDays: ['天', '一', '二', '三', '四', '五', '六'].map((val) => '星期' + val),
+      result: {
+        second: {},
+        minute: {},
+        hour: {},
+        day: {},
+        week: {},
+        month: {},
+        year: {},
+      },
+      defaultValue: {
+        second: {
+          cronEvery: '',
+          incrementStart: 3,
+          incrementIncrement: 5,
+          rangeStart: 1,
+          rangeEnd: 0,
+          specificSpecific: [],
         },
-        defaultValue: {
-          second:{
-            cronEvery:'',
-            incrementStart:3,
-            incrementIncrement:5,
-            rangeStart:1,
-            rangeEnd:0,
-            specificSpecific:[],
-          },
-          minute:{
-            cronEvery:'',
-            incrementStart:3,
-            incrementIncrement:5,
-            rangeStart:1,
-            rangeEnd:'0',
-            specificSpecific:[],
-          },
-          hour:{
-            cronEvery:'',
-            incrementStart:3,
-            incrementIncrement:5,
-            rangeStart:'0',
-            rangeEnd:'0',
-            specificSpecific:[],
-          },
-          day:{
-            cronEvery:'',
-            incrementStart:1,
-            incrementIncrement:'1',
-            rangeStart:'',
-            rangeEnd:'',
-            specificSpecific:[],
-            cronLastSpecificDomDay:1,
-            cronDaysBeforeEomMinus:1,
-            cronDaysNearestWeekday:1,
-          },
-          week:{
-            cronEvery:'',
-            incrementStart:1,
-            incrementIncrement:1,
-            specificSpecific:[],
-            cronNthDayDay:1,
-            cronNthDayNth:1,
-          },
-          month:{
-            cronEvery:'',
-            incrementStart:3,
-            incrementIncrement:5,
-            rangeStart:1,
-            rangeEnd:1,
-            specificSpecific:[],
-          },
-          year:{
-            cronEvery:'',
-            incrementStart:2017,
-            incrementIncrement:1,
-            rangeStart:2019,
-            rangeEnd: 2019,
-            specificSpecific:[],
-          },
-          label:''
-        }
+        minute: {
+          cronEvery: '',
+          incrementStart: 3,
+          incrementIncrement: 5,
+          rangeStart: 1,
+          rangeEnd: '0',
+          specificSpecific: [],
+        },
+        hour: {
+          cronEvery: '',
+          incrementStart: 3,
+          incrementIncrement: 5,
+          rangeStart: '0',
+          rangeEnd: '0',
+          specificSpecific: [],
+        },
+        day: {
+          cronEvery: '',
+          incrementStart: 1,
+          incrementIncrement: '1',
+          rangeStart: '',
+          rangeEnd: '',
+          specificSpecific: [],
+          cronLastSpecificDomDay: 1,
+          cronDaysBeforeEomMinus: 1,
+          cronDaysNearestWeekday: 1,
+        },
+        week: {
+          cronEvery: '',
+          incrementStart: 1,
+          incrementIncrement: 1,
+          specificSpecific: [],
+          cronNthDayDay: 1,
+          cronNthDayNth: 1,
+        },
+        month: {
+          cronEvery: '',
+          incrementStart: 3,
+          incrementIncrement: 5,
+          rangeStart: 1,
+          rangeEnd: 1,
+          specificSpecific: [],
+        },
+        year: {
+          cronEvery: '',
+          incrementStart: 2017,
+          incrementIncrement: 1,
+          rangeStart: 2019,
+          rangeEnd: 2019,
+          specificSpecific: [],
+        },
+        label: '',
+      },
+    }
+  },
+  computed: {
+    modalWidth() {
+      return 608
+    },
+    secondsText() {
+      let seconds = ''
+      let cronEvery = this.result.second.cronEvery || ''
+      switch (cronEvery.toString()) {
+        case '1':
+          seconds = '*'
+          break
+        case '2':
+          seconds = this.result.second.incrementStart + '/' + this.result.second.incrementIncrement
+          break
+        case '3':
+          this.result.second.specificSpecific.map((val) => {
+            seconds += val + ','
+          })
+          seconds = seconds.slice(0, -1)
+          break
+        case '4':
+          seconds = this.result.second.rangeStart + '-' + this.result.second.rangeEnd
+          break
       }
+      return seconds
     },
-    computed: {
-      modalWidth(){
-        return 608;
-      },
-      secondsText() {
-        let seconds = '';
-        let cronEvery=this.result.second.cronEvery||'';
-        switch (cronEvery.toString()){
-          case '1':
-            seconds = '*';
-            break;
-          case '2':
-            seconds = this.result.second.incrementStart+'/'+this.result.second.incrementIncrement;
-            break;
-          case '3':
-            this.result.second.specificSpecific.map(val=> {seconds += val+','});
-            seconds = seconds.slice(0, -1);
-            break;
-          case '4':
-            seconds = this.result.second.rangeStart+'-'+this.result.second.rangeEnd;
-            break;
-        }
-        return seconds;
-      },
-      minutesText() {
-        let minutes = '';
-        let cronEvery=this.result.minute.cronEvery||'';
-        switch (cronEvery.toString()){
-          case '1':
-            minutes = '*';
-            break;
-          case '2':
-            minutes = this.result.minute.incrementStart+'/'+this.result.minute.incrementIncrement;
-            break;
-          case '3':
-            this.result.minute.specificSpecific.map(val=> {
-              minutes += val+','
-            });
-            minutes = minutes.slice(0, -1);
-            break;
-          case '4':
-            minutes = this.result.minute.rangeStart+'-'+this.result.minute.rangeEnd;
-            break;
-        }
-        return minutes;
-      },
-      hoursText() {
-        let hours = '';
-        let cronEvery=this.result.hour.cronEvery||'';
-        switch (cronEvery.toString()){
-          case '1':
-            hours = '*';
-            break;
-          case '2':
-            hours = this.result.hour.incrementStart+'/'+this.result.hour.incrementIncrement;
-            break;
-          case '3':
-            this.result.hour.specificSpecific.map(val=> {
-              hours += val+','
-            });
-            hours = hours.slice(0, -1);
-            break;
-          case '4':
-            hours = this.result.hour.rangeStart+'-'+this.result.hour.rangeEnd;
-            break;
-        }
-        return hours;
-      },
-      daysText() {
-        let days='';
-        let cronEvery=this.result.day.cronEvery||'';
-        switch (cronEvery.toString()){
-          case '1':
-            break;
-          case '2':
-          case '4':
-          case '11':
-            days = '?';
-            break;
-          case '3':
-            days = this.result.day.incrementStart+'/'+this.result.day.incrementIncrement;
-            break;
-          case '5':
-            this.result.day.specificSpecific.map(val=> {
-              days += val+','
-            });
-            days = days.slice(0, -1);
-            break;
-          case '6':
-            days = "L";
-            break;
-          case '7':
-            days = "LW";
-            break;
-          case '8':
-            days = this.result.day.cronLastSpecificDomDay + 'L';
-            break;
-          case '9':
-            days = 'L-' + this.result.day.cronDaysBeforeEomMinus;
-            break;
-          case '10':
-            days = this.result.day.cronDaysNearestWeekday+"W";
-            break
-        }
-        return days;
-      },
-      weeksText() {
-        let weeks = '';
-        let cronEvery=this.result.day.cronEvery||'';
-        switch (cronEvery.toString()){
-          case '1':
-          case '3':
-          case '5':
-            weeks = '?';
-            break;
-          case '2':
-            weeks = this.result.week.incrementStart+'/'+this.result.week.incrementIncrement;
-            break;
-          case '4':
-            this.result.week.specificSpecific.map(val=> {
-              weeks += val+','
-            });
-            weeks = weeks.slice(0, -1);
-            break;
-          case '6':
-          case '7':
-          case '8':
-          case '9':
-          case '10':
-            weeks = "?";
-            break;
-          case '11':
-            weeks = this.result.week.cronNthDayDay+"#"+this.result.week.cronNthDayNth;
-            break;
-        }
-        return weeks;
-      },
-      monthsText() {
-        let months = '';
-        let cronEvery=this.result.month.cronEvery||'';
-        switch (cronEvery.toString()){
-          case '1':
-            months = '*';
-            break;
-          case '2':
-            months = this.result.month.incrementStart+'/'+this.result.month.incrementIncrement;
-            break;
-          case '3':
-            this.result.month.specificSpecific.map(val=> {
-              months += val+','
-            });
-            months = months.slice(0, -1);
-            break;
-          case '4':
-            months = this.result.month.rangeStart+'-'+this.result.month.rangeEnd;
-            break;
-        }
-        return months;
-      },
-      yearsText() {
-        let years = '';
-        let cronEvery=this.result.year.cronEvery||'';
-        switch (cronEvery.toString()){
-          case '1':
-            years = '*';
-            break;
-          case '2':
-            years = this.result.year.incrementStart+'/'+this.result.year.incrementIncrement;
-            break;
-          case '3':
-            this.result.year.specificSpecific.map(val=> {
-              years += val+','
-            });
-            years = years.slice(0, -1);
-            break;
-          case '4':
-            years = this.result.year.rangeStart+'-'+this.result.year.rangeEnd;
-            break;
-        }
-        return years;
-      },
-      cron(){
-        return `${this.secondsText||'*'} ${this.minutesText||'*'} ${this.hoursText||'*'} ${this.daysText||'*'} ${this.monthsText||'*'} ${this.weeksText||'?'} ${this.yearsText||'*'}`
-      },
+    minutesText() {
+      let minutes = ''
+      let cronEvery = this.result.minute.cronEvery || ''
+      switch (cronEvery.toString()) {
+        case '1':
+          minutes = '*'
+          break
+        case '2':
+          minutes = this.result.minute.incrementStart + '/' + this.result.minute.incrementIncrement
+          break
+        case '3':
+          this.result.minute.specificSpecific.map((val) => {
+            minutes += val + ','
+          })
+          minutes = minutes.slice(0, -1)
+          break
+        case '4':
+          minutes = this.result.minute.rangeStart + '-' + this.result.minute.rangeEnd
+          break
+      }
+      return minutes
     },
-    watch:{
-      visible:{
-        handler() {
-          // if(this.data){
-          //   //this. result = Object.keys(this.data.value).length>0?this.deepCopy(this.data.value):this.deepCopy(this.defaultValue);
-          //   //this.result = Object.keys(this.data.value).length>0?clone(this.data.value):clone(this.defaultValue);
-          //   //this.result = Object.keys(this.data.value).length>0?clone(JSON.parse(this.data.value)):clone(this.defaultValue);
-          //   this.result = Object.keys(this.data.value).length>0?JSON.parse(this.data.value):JSON.parse(JSON.stringify(this.defaultValue));
-          // }else{
-          //   //this.result = this.deepCopy(this.defaultValue);
-          //   //this.result = clone(this.defaultValue);
-          //   this.result = JSON.parse(JSON.stringify(this.defaultValue));
-          // }
-          let label = this.data;
-          if(label){
-            this.secondsReverseExp(label)
-            this.minutesReverseExp(label);
-            this.hoursReverseExp(label);
-            this.daysReverseExp(label);
-            this.daysReverseExp(label);
-            this.monthsReverseExp(label);
-            this.yearReverseExp(label);
-            JSON.parse(JSON.stringify(label));
-          }else {
-            this.result = JSON.parse(JSON.stringify(this.defaultValue));
-          }
-        }
+    hoursText() {
+      let hours = ''
+      let cronEvery = this.result.hour.cronEvery || ''
+      switch (cronEvery.toString()) {
+        case '1':
+          hours = '*'
+          break
+        case '2':
+          hours = this.result.hour.incrementStart + '/' + this.result.hour.incrementIncrement
+          break
+        case '3':
+          this.result.hour.specificSpecific.map((val) => {
+            hours += val + ','
+          })
+          hours = hours.slice(0, -1)
+          break
+        case '4':
+          hours = this.result.hour.rangeStart + '-' + this.result.hour.rangeEnd
+          break
       }
+      return hours
     },
-    methods: {
-      show(){
-        this.visible = true;
-        // console.log('secondsReverseExp',this.secondsReverseExp(this.data));
-        // console.log('minutesReverseExp',this.minutesReverseExp(this.data));
-        // console.log('hoursReverseExp',this.hoursReverseExp(this.data));
-        // console.log('daysReverseExp',this.daysReverseExp(this.data));
-        // console.log('monthsReverseExp',this.monthsReverseExp(this.data));
-        // console.log('yearReverseExp',this.yearReverseExp(this.data));
-
-      },
-      handleSubmit(){
-        this.$emit('ok',this.cron);
-        this.close();
-        this.visible = false;
-      },
-      close(){
-        this.visible = false;
-      },
-      secondsReverseExp(seconds) {
-        let val =  seconds.split(" ")[0];
-        //alert(val);
-        let second = {
-          cronEvery:'',
-          incrementStart:3,
-          incrementIncrement:5,
-          rangeStart:1,
-          rangeEnd:0,
-          specificSpecific:[]
-        };
-        switch (true) {
-          case val.includes('*'):
-            second.cronEvery = '1';
-            break;
-          case val.includes('/'):
-            second.cronEvery = '2';
-            second.incrementStart = val.split('/')[0];
-            second.incrementIncrement = val.split('/')[1];
-            break;
-          case val.includes(','):
-            second.cronEvery = '3';
-            second.specificSpecific = val.split(',').map(Number).sort();
-            break;
-          case val.includes('-'):
-            second.cronEvery = '4';
-            second.rangeStart = val.split('-')[0];
-            second.rangeEnd = val.split('-')[1];
-            break;
-          default:
-            second.cronEvery = '1';
+    daysText() {
+      let days = ''
+      let cronEvery = this.result.day.cronEvery || ''
+      switch (cronEvery.toString()) {
+        case '1':
+          break
+        case '2':
+        case '4':
+        case '11':
+          days = '?'
+          break
+        case '3':
+          days = this.result.day.incrementStart + '/' + this.result.day.incrementIncrement
+          break
+        case '5':
+          this.result.day.specificSpecific.map((val) => {
+            days += val + ','
+          })
+          days = days.slice(0, -1)
+          break
+        case '6':
+          days = 'L'
+          break
+        case '7':
+          days = 'LW'
+          break
+        case '8':
+          days = this.result.day.cronLastSpecificDomDay + 'L'
+          break
+        case '9':
+          days = 'L-' + this.result.day.cronDaysBeforeEomMinus
+          break
+        case '10':
+          days = this.result.day.cronDaysNearestWeekday + 'W'
+          break
+      }
+      return days
+    },
+    weeksText() {
+      let weeks = ''
+      let cronEvery = this.result.day.cronEvery || ''
+      switch (cronEvery.toString()) {
+        case '1':
+        case '3':
+        case '5':
+          weeks = '?'
+          break
+        case '2':
+          weeks = this.result.week.incrementStart + '/' + this.result.week.incrementIncrement
+          break
+        case '4':
+          this.result.week.specificSpecific.map((val) => {
+            weeks += val + ','
+          })
+          weeks = weeks.slice(0, -1)
+          break
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+        case '10':
+          weeks = '?'
+          break
+        case '11':
+          weeks = this.result.week.cronNthDayDay + '#' + this.result.week.cronNthDayNth
+          break
+      }
+      return weeks
+    },
+    monthsText() {
+      let months = ''
+      let cronEvery = this.result.month.cronEvery || ''
+      switch (cronEvery.toString()) {
+        case '1':
+          months = '*'
+          break
+        case '2':
+          months = this.result.month.incrementStart + '/' + this.result.month.incrementIncrement
+          break
+        case '3':
+          this.result.month.specificSpecific.map((val) => {
+            months += val + ','
+          })
+          months = months.slice(0, -1)
+          break
+        case '4':
+          months = this.result.month.rangeStart + '-' + this.result.month.rangeEnd
+          break
+      }
+      return months
+    },
+    yearsText() {
+      let years = ''
+      let cronEvery = this.result.year.cronEvery || ''
+      switch (cronEvery.toString()) {
+        case '1':
+          years = '*'
+          break
+        case '2':
+          years = this.result.year.incrementStart + '/' + this.result.year.incrementIncrement
+          break
+        case '3':
+          this.result.year.specificSpecific.map((val) => {
+            years += val + ','
+          })
+          years = years.slice(0, -1)
+          break
+        case '4':
+          years = this.result.year.rangeStart + '-' + this.result.year.rangeEnd
+          break
+      }
+      return years
+    },
+    cron() {
+      return `${this.secondsText || '*'} ${this.minutesText || '*'} ${this.hoursText || '*'} ${this.daysText || '*'} ${
+        this.monthsText || '*'
+      } ${this.weeksText || '?'} ${this.yearsText || '*'}`
+    },
+  },
+  watch: {
+    visible: {
+      handler() {
+        // if(this.data){
+        //   //this. result = Object.keys(this.data.value).length>0?this.deepCopy(this.data.value):this.deepCopy(this.defaultValue);
+        //   //this.result = Object.keys(this.data.value).length>0?clone(this.data.value):clone(this.defaultValue);
+        //   //this.result = Object.keys(this.data.value).length>0?clone(JSON.parse(this.data.value)):clone(this.defaultValue);
+        //   this.result = Object.keys(this.data.value).length>0?JSON.parse(this.data.value):JSON.parse(JSON.stringify(this.defaultValue));
+        // }else{
+        //   //this.result = this.deepCopy(this.defaultValue);
+        //   //this.result = clone(this.defaultValue);
+        //   this.result = JSON.parse(JSON.stringify(this.defaultValue));
+        // }
+        let label = this.data
+        if (label) {
+          this.secondsReverseExp(label)
+          this.minutesReverseExp(label)
+          this.hoursReverseExp(label)
+          this.daysReverseExp(label)
+          this.daysReverseExp(label)
+          this.monthsReverseExp(label)
+          this.yearReverseExp(label)
+          JSON.parse(JSON.stringify(label))
+        } else {
+          this.result = JSON.parse(JSON.stringify(this.defaultValue))
         }
-        this.result.second = second;
       },
-      minutesReverseExp(minutes) {
-        let val =  minutes.split(" ")[1];
-        let minute = {
-          cronEvery:'',
-          incrementStart:3,
-          incrementIncrement:5,
-          rangeStart:1,
-          rangeEnd:0,
-          specificSpecific:[],
-        }
+    },
+  },
+  methods: {
+    show() {
+      this.visible = true
+      // console.log('secondsReverseExp',this.secondsReverseExp(this.data));
+      // console.log('minutesReverseExp',this.minutesReverseExp(this.data));
+      // console.log('hoursReverseExp',this.hoursReverseExp(this.data));
+      // console.log('daysReverseExp',this.daysReverseExp(this.data));
+      // console.log('monthsReverseExp',this.monthsReverseExp(this.data));
+      // console.log('yearReverseExp',this.yearReverseExp(this.data));
+    },
+    handleSubmit() {
+      this.$emit('ok', this.cron)
+      this.close()
+      this.visible = false
+    },
+    close() {
+      this.visible = false
+    },
+    secondsReverseExp(seconds) {
+      let val = seconds.split(' ')[0]
+      //alert(val);
+      let second = {
+        cronEvery: '',
+        incrementStart: 3,
+        incrementIncrement: 5,
+        rangeStart: 1,
+        rangeEnd: 0,
+        specificSpecific: [],
+      }
+      switch (true) {
+        case val.includes('*'):
+          second.cronEvery = '1'
+          break
+        case val.includes('/'):
+          second.cronEvery = '2'
+          second.incrementStart = val.split('/')[0]
+          second.incrementIncrement = val.split('/')[1]
+          break
+        case val.includes(','):
+          second.cronEvery = '3'
+          second.specificSpecific = val.split(',').map(Number).sort()
+          break
+        case val.includes('-'):
+          second.cronEvery = '4'
+          second.rangeStart = val.split('-')[0]
+          second.rangeEnd = val.split('-')[1]
+          break
+        default:
+          second.cronEvery = '1'
+      }
+      this.result.second = second
+    },
+    minutesReverseExp(minutes) {
+      let val = minutes.split(' ')[1]
+      let minute = {
+        cronEvery: '',
+        incrementStart: 3,
+        incrementIncrement: 5,
+        rangeStart: 1,
+        rangeEnd: 0,
+        specificSpecific: [],
+      }
+      switch (true) {
+        case val.includes('*'):
+          minute.cronEvery = '1'
+          break
+        case val.includes('/'):
+          minute.cronEvery = '2'
+          minute.incrementStart = val.split('/')[0]
+          minute.incrementIncrement = val.split('/')[1]
+          break
+        case val.includes(','):
+          minute.cronEvery = '3'
+          minute.specificSpecific = val.split(',').map(Number).sort()
+          break
+        case val.includes('-'):
+          minute.cronEvery = '4'
+          minute.rangeStart = val.split('-')[0]
+          minute.rangeEnd = val.split('-')[1]
+          break
+        default:
+          minute.cronEvery = '1'
+      }
+      this.result.minute = minute
+    },
+    hoursReverseExp(hours) {
+      let val = hours.split(' ')[2]
+      let hour = {
+        cronEvery: '',
+        incrementStart: 3,
+        incrementIncrement: 5,
+        rangeStart: 1,
+        rangeEnd: '0',
+        specificSpecific: [],
+      }
+      switch (true) {
+        case val.includes('*'):
+          hour.cronEvery = '1'
+          break
+        case val.includes('/'):
+          hour.cronEvery = '2'
+          hour.incrementStart = val.split('/')[0]
+          hour.incrementIncrement = val.split('/')[1]
+          break
+        case val.includes(','):
+          hour.cronEvery = '3'
+          hour.specificSpecific = val.split(',').map(Number).sort()
+          break
+        case val.includes('-'):
+          hour.cronEvery = '4'
+          hour.rangeStart = val.split('-')[0]
+          hour.rangeEnd = val.split('-')[1]
+          break
+        default:
+          hour.cronEvery = '1'
+      }
+      this.result.hour = hour
+    },
+    daysReverseExp(cron) {
+      let days = cron.split(' ')[3]
+      let weeks = cron.split(' ')[5]
+      let day = {
+        cronEvery: '',
+        incrementStart: 1,
+        incrementIncrement: 1,
+        rangeStart: 1,
+        rangeEnd: 1,
+        specificSpecific: [],
+        cronLastSpecificDomDay: 1,
+        cronDaysBeforeEomMinus: 1,
+        cronDaysNearestWeekday: 1,
+      }
+      let week = {
+        cronEvery: '',
+        incrementStart: 1,
+        incrementIncrement: 1,
+        specificSpecific: [],
+        cronNthDayDay: 1,
+        cronNthDayNth: '1',
+      }
+      if (!days.includes('?')) {
         switch (true) {
-          case val.includes('*'):
-            minute.cronEvery = '1';
-            break;
-          case val.includes('/'):
-            minute.cronEvery = '2';
-            minute.incrementStart = val.split('/')[0];
-            minute.incrementIncrement = val.split('/')[1];
-            break;
-          case val.includes(','):
-            minute.cronEvery = '3';
-            minute.specificSpecific = val.split(',').map(Number).sort();
-            break;
-          case val.includes('-'):
-            minute.cronEvery = '4';
-            minute.rangeStart = val.split('-')[0];
-            minute.rangeEnd = val.split('-')[1];
-            break;
+          case days.includes('*'):
+            day.cronEvery = '1'
+            break
+          case days.includes('?'):
+            // 2、4、11
+            break
+          case days.includes('/'):
+            day.cronEvery = '3'
+            day.incrementStart = days.split('/')[0]
+            day.incrementIncrement = days.split('/')[1]
+            break
+          case days.includes(','):
+            day.cronEvery = '5'
+            day.specificSpecific = days.split(',').map(Number).sort()
+            // day.specificSpecific.forEach(function (value, index) {
+            //   day.specificSpecific[index] = value -1;
+            // });
+            break
+          case days.includes('LW'):
+            day.cronEvery = '7'
+            break
+          case days.includes('L-'):
+            day.cronEvery = '9'
+            day.cronDaysBeforeEomMinus = days.split('L-')[1]
+            break
+          case days.includes('L'):
+            //alert(days);
+            if (days.len == 1) {
+              day.cronEvery = '6'
+              day.cronLastSpecificDomDay = '1'
+            } else {
+              day.cronEvery = '8'
+              day.cronLastSpecificDomDay = Number(days.split('L')[0])
+            }
+            break
+          case days.includes('W'):
+            day.cronEvery = '10'
+            day.cronDaysNearestWeekday = days.split('W')[0]
+            break
           default:
-            minute.cronEvery = '1';
+            day.cronEvery = '1'
         }
-        this.result.minute = minute;
-      },
-      hoursReverseExp(hours) {
-        let val =  hours.split(" ")[2];
-        let hour ={
-            cronEvery:'',
-            incrementStart:3,
-            incrementIncrement:5,
-            rangeStart:1,
-            rangeEnd:'0',
-            specificSpecific:[],
-          };
+      } else {
         switch (true) {
-          case val.includes('*'):
-            hour.cronEvery = '1';
-            break;
-          case val.includes('/'):
-            hour.cronEvery = '2';
-            hour.incrementStart = val.split('/')[0];
-            hour.incrementIncrement = val.split('/')[1];
-            break;
-          case val.includes(','):
-            hour.cronEvery = '3';
-            hour.specificSpecific = val.split(',').map(Number).sort();
-            break;
-          case val.includes('-'):
-            hour.cronEvery = '4';
-            hour.rangeStart = val.split('-')[0];
-            hour.rangeEnd = val.split('-')[1];
-            break;
-          default:
-            hour.cronEvery = '1';
-          }
-        this.result.hour = hour;
-      },
-      daysReverseExp(cron) {
-        let days =  cron.split(" ")[3];
-        let weeks =  cron.split(" ")[5];
-        let day ={
-          cronEvery:'',
-          incrementStart:1,
-          incrementIncrement:1,
-          rangeStart:1,
-          rangeEnd:1,
-          specificSpecific:[],
-          cronLastSpecificDomDay:1,
-          cronDaysBeforeEomMinus:1,
-          cronDaysNearestWeekday:1,
-        };
-        let week = {
-            cronEvery:'',
-            incrementStart:1,
-            incrementIncrement:1,
-            specificSpecific:[],
-            cronNthDayDay:1,
-            cronNthDayNth:'1',
-        };
-        if (!days.includes('?')) {
-          switch (true) {
-            case days.includes('*'):
-              day.cronEvery = '1';
-              break;
-            case days.includes('?'):
-              // 2、4、11
-              break;
-            case days.includes('/'):
-              day.cronEvery = '3';
-              day.incrementStart = days.split('/')[0];
-              day.incrementIncrement = days.split('/')[1];
-              break;
-            case days.includes(','):
-              day.cronEvery = '5';
-              day.specificSpecific = days.split(',').map(Number).sort();
-              // day.specificSpecific.forEach(function (value, index) {
-              //   day.specificSpecific[index] = value -1;
-              // });
-              break;
-            case days.includes('LW'):
-              day.cronEvery = '7';
-              break;
-            case days.includes('L-'):
-              day.cronEvery = '9';
-              day.cronDaysBeforeEomMinus = days.split('L-')[1];
-              break;
-            case days.includes('L'):
-
-              //alert(days);
-              if(days.len == 1){
-                day.cronEvery = '6';
-                day.cronLastSpecificDomDay = '1';
-              }
-              else
-              {
-                day.cronEvery = '8';
-                day.cronLastSpecificDomDay = Number(days.split('L')[0]);
-              }
-              break;
-            case days.includes('W'):
-              day.cronEvery = '10';
-              day.cronDaysNearestWeekday = days.split('W')[0];
-              break;
-            default:
-              day.cronEvery = '1';
-          }
-        }else {
-          switch (true){
-            case weeks.includes('/'):
-              day.cronEvery = '2';
-              week.incrementStart = weeks.split("/")[0];
-              week.incrementIncrement = weeks.split("/")[1];
-              break;
-            case weeks.includes(','):
-              day.cronEvery = '4';
-              week.specificSpecific = weeks.split(',').map(Number).sort();
-              break;
-            case '#':
-              day.cronEvery = '11';
-              week.cronNthDayDay = weeks.split("#")[0];
-              week.cronNthDayNth = weeks.split("#")[1];
-              break;
-            default:
-              day.cronEvery = '1';
-              week.cronEvery = '1';
-          }
-        }
-        this.result.day = day;
-        this.result.week = week;
-      },
-      monthsReverseExp(cron) {
-        let months = cron.split(" ")[4];
-        let month = {
-          cronEvery:'',
-            incrementStart:3,
-            incrementIncrement:5,
-            rangeStart:1,
-            rangeEnd:1,
-            specificSpecific:[],
-        };
-        switch (true){
-          case months.includes('*'):
-            month.cronEvery = '1';
-            break;
-          case months.includes('/'):
-            month.cronEvery = '2';
-            month.incrementStart = months.split('/')[0];
-            month.incrementIncrement = months.split('/')[1];
-            break;
-          case months.includes(','):
-            month.cronEvery = '3';
-            month.specificSpecific = months.split(',').map(Number).sort();
-            break;
-          case months.includes('-'):
-            month.cronEvery = '4';
-            month.rangeStart = months.split('-')[0];
-            month.rangeEnd = months.split('-')[1];
-            break;
-          default:
-            month.cronEvery = '1';
-        }
-        this.result.month = month;
-      },
-      yearReverseExp(cron) {
-        let years = cron.split(" ")[6];
-        let year = {
-          cronEvery:'',
-          incrementStart:3,
-          incrementIncrement:5,
-          rangeStart:2019,
-          rangeEnd:2019,
-          specificSpecific:[],
-        };
-        switch (true){
-          case years.includes('*'):
-            year.cronEvery = '1';
-            break;
-          case years.includes('/'):
-            year.cronEvery = '2';
-            year.incrementStart = years.split('/')[0];
-            year.incrementIncrement = years.split('/')[1];
-            break;
-          case years.includes(','):
-            year.cronEvery = '3';
-            year.specificSpecific = years.split(',').map(Number).sort();
-            break;
-          case years.includes('-'):
-            year.cronEvery = '4';
-            year.rangeStart = years.split('-')[0];
-            year.rangeEnd = years.split('-')[1];
-            break;
+          case weeks.includes('/'):
+            day.cronEvery = '2'
+            week.incrementStart = weeks.split('/')[0]
+            week.incrementIncrement = weeks.split('/')[1]
+            break
+          case weeks.includes(','):
+            day.cronEvery = '4'
+            week.specificSpecific = weeks.split(',').map(Number).sort()
+            break
+          case '#':
+            day.cronEvery = '11'
+            week.cronNthDayDay = weeks.split('#')[0]
+            week.cronNthDayNth = weeks.split('#')[1]
+            break
           default:
-            year.cronEvery = '1';
+            day.cronEvery = '1'
+            week.cronEvery = '1'
         }
-        this.result.year = year;
       }
-    }
-  }
+      this.result.day = day
+      this.result.week = week
+    },
+    monthsReverseExp(cron) {
+      let months = cron.split(' ')[4]
+      let month = {
+        cronEvery: '',
+        incrementStart: 3,
+        incrementIncrement: 5,
+        rangeStart: 1,
+        rangeEnd: 1,
+        specificSpecific: [],
+      }
+      switch (true) {
+        case months.includes('*'):
+          month.cronEvery = '1'
+          break
+        case months.includes('/'):
+          month.cronEvery = '2'
+          month.incrementStart = months.split('/')[0]
+          month.incrementIncrement = months.split('/')[1]
+          break
+        case months.includes(','):
+          month.cronEvery = '3'
+          month.specificSpecific = months.split(',').map(Number).sort()
+          break
+        case months.includes('-'):
+          month.cronEvery = '4'
+          month.rangeStart = months.split('-')[0]
+          month.rangeEnd = months.split('-')[1]
+          break
+        default:
+          month.cronEvery = '1'
+      }
+      this.result.month = month
+    },
+    yearReverseExp(cron) {
+      let years = cron.split(' ')[6]
+      let year = {
+        cronEvery: '',
+        incrementStart: 3,
+        incrementIncrement: 5,
+        rangeStart: 2019,
+        rangeEnd: 2019,
+        specificSpecific: [],
+      }
+      switch (true) {
+        case years.includes('*'):
+          year.cronEvery = '1'
+          break
+        case years.includes('/'):
+          year.cronEvery = '2'
+          year.incrementStart = years.split('/')[0]
+          year.incrementIncrement = years.split('/')[1]
+          break
+        case years.includes(','):
+          year.cronEvery = '3'
+          year.specificSpecific = years.split(',').map(Number).sort()
+          break
+        case years.includes('-'):
+          year.cronEvery = '4'
+          year.rangeStart = years.split('-')[0]
+          year.rangeEnd = years.split('-')[1]
+          break
+        default:
+          year.cronEvery = '1'
+      }
+      this.result.year = year
+    },
+  },
+}
 </script>
 
 <style lang="less">
-  .card-container {
-    background: #fff;
-    overflow: hidden;
-    padding: 12px;
-    position: relative;
-    width: 100%;
-    .ant-tabs{
-      border:1px solid #e6ebf5;
-      padding: 0;
-      .ant-tabs-bar {
+.card-container {
+  background: #fff;
+  overflow: hidden;
+  padding: 12px;
+  position: relative;
+  width: 100%;
+  .ant-tabs {
+    border: 1px solid #e6ebf5;
+    padding: 0;
+    .ant-tabs-bar {
+      margin: 0;
+      outline: none;
+      border-bottom: none;
+      .ant-tabs-nav-container {
         margin: 0;
-        outline: none;
-        border-bottom: none;
-        .ant-tabs-nav-container{
-          margin: 0;
-          .ant-tabs-tab {
-            padding: 0 24px!important;
-            background-color: #f5f7fa!important;
-            margin-right: 0px!important;
-            border-radius: 0;
-            line-height: 38px;
-            border: 1px solid transparent!important;
-            border-bottom: 1px solid #e6ebf5!important;
-          }
-          .ant-tabs-tab-active.ant-tabs-tab{
-            color: #409eff;
-            background-color: #fff!important;
-            border-right:1px solid #e6ebf5!important;
-            border-left:1px solid #e6ebf5!important;
-            border-bottom:1px solid #fff!important;
-            font-weight: normal;
-            transition:none!important;
-          }
+        .ant-tabs-tab {
+          padding: 0 24px !important;
+          background-color: #f5f7fa !important;
+          margin-right: 0px !important;
+          border-radius: 0;
+          line-height: 38px;
+          border: 1px solid transparent !important;
+          border-bottom: 1px solid #e6ebf5 !important;
         }
-      }
-      .ant-tabs-tabpane{
-        padding: 15px;
-        .ant-row{
-          margin: 10px 0;
-        }
-        .ant-select,.ant-input-number{
-          width: 100px;
+        .ant-tabs-tab-active.ant-tabs-tab {
+          color: #409eff;
+          background-color: #fff !important;
+          border-right: 1px solid #e6ebf5 !important;
+          border-left: 1px solid #e6ebf5 !important;
+          border-bottom: 1px solid #fff !important;
+          font-weight: normal;
+          transition: none !important;
         }
       }
     }
+    .ant-tabs-tabpane {
+      padding: 15px;
+      .ant-row {
+        margin: 10px 0;
+      }
+      .ant-select,
+      .ant-input-number {
+        width: 100px;
+      }
+    }
   }
+}
 </style>
 <style lang="less" scoped>
-  .container-widthEn{
-    width: 755px;
-  }
-  .container-widthCn{
-    width: 608px;
-  }
-  .language{
-    text-align: center;
-    position: absolute;
-    right: 13px;
-    top: 13px;
-    border: 1px solid transparent;
-    height: 40px;
-    line-height: 38px;
-    font-size: 16px;
-    color: #409eff;
-    z-index: 1;
-    background: #f5f7fa;
-    outline: none;
-    width: 47px;
-    border-bottom: 1px solid #e6ebf5;
-    border-radius: 0;
-  }
-  .card-container{
-    .bottom{
-      display: flex;
-      justify-content: center;
-      padding: 10px 0 0 0;
-      .cronButton{
-        margin: 0 10px;
-        line-height: 40px;
-      }
+.container-widthEn {
+  width: 755px;
+}
+.container-widthCn {
+  width: 608px;
+}
+.language {
+  text-align: center;
+  position: absolute;
+  right: 13px;
+  top: 13px;
+  border: 1px solid transparent;
+  height: 40px;
+  line-height: 38px;
+  font-size: 16px;
+  color: #409eff;
+  z-index: 1;
+  background: #f5f7fa;
+  outline: none;
+  width: 47px;
+  border-bottom: 1px solid #e6ebf5;
+  border-radius: 0;
+}
+.card-container {
+  .bottom {
+    display: flex;
+    justify-content: center;
+    padding: 10px 0 0 0;
+    .cronButton {
+      margin: 0 10px;
+      line-height: 40px;
     }
   }
-  .tabBody{
-    .a-row{
-      margin: 10px 0;
-      .long{
-        .a-select{
-          width:354px;
-        }
-      }
-      .a-input-number{
-        width: 110px;
+}
+.tabBody {
+  .a-row {
+    margin: 10px 0;
+    .long {
+      .a-select {
+        width: 354px;
       }
     }
+    .a-input-number {
+      width: 110px;
+    }
   }
+}
 </style>

+ 258 - 261
jshERP-web/src/components/jeecgbiz/JSelectBizComponent/JSelectBizComponentModal.vue

@@ -6,27 +6,29 @@
     :visible="visible"
     @ok="handleOk"
     @cancel="close"
-    cancelText="关闭">
-
+    cancelText="关闭"
+  >
     <a-row :gutter="18">
       <a-col :span="16">
         <!-- 查询区域 -->
         <div class="table-page-search-wrapper">
           <a-form layout="inline">
             <a-row :gutter="24">
-
               <a-col :span="14">
-                <a-form-item :label="(queryParamText||name)">
-                  <a-input v-model="queryParam[queryParamCode||valueKey]" :placeholder="'请输入' + (queryParamText||name)" @pressEnter="searchQuery"/>
+                <a-form-item :label="queryParamText || name">
+                  <a-input
+                    v-model="queryParam[queryParamCode || valueKey]"
+                    :placeholder="'请输入' + (queryParamText || name)"
+                    @pressEnter="searchQuery"
+                  />
                 </a-form-item>
               </a-col>
               <a-col :span="8">
-                  <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-                    <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
-                    <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
-                  </span>
+                <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
+                  <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+                  <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+                </span>
               </a-col>
-
             </a-row>
           </a-form>
         </div>
@@ -40,21 +42,19 @@
           :pagination="ipagination"
           :loading="loading"
           :scroll="{ y: 240 }"
-          :rowSelection="{selectedRowKeys, onChange: onSelectChange, type: multiple ? 'checkbox':'radio'}"
+          :rowSelection="{ selectedRowKeys, onChange: onSelectChange, type: multiple ? 'checkbox' : 'radio' }"
           :customRow="customRowFn"
-          @change="handleTableChange">
+          @change="handleTableChange"
+        >
         </a-table>
-
       </a-col>
       <a-col :span="8">
-        <a-card :title="'已选' + name" :bordered="false" :head-style="{padding:0}" :body-style="{padding:0}">
-
+        <a-card :title="'已选' + name" :bordered="false" :head-style="{ padding: 0 }" :body-style="{ padding: 0 }">
           <a-table size="small" :rowKey="rowKey" bordered v-bind="selectedTable">
-              <span slot="action" slot-scope="text, record, index">
-                <a @click="handleDeleteSelected(record, index)">删除</a>
-              </span>
+            <span slot="action" slot-scope="text, record, index">
+              <a @click="handleDeleteSelected(record, index)">删除</a>
+            </span>
           </a-table>
-
         </a-card>
       </a-col>
     </a-row>
@@ -62,273 +62,270 @@
 </template>
 
 <script>
-  import { getAction } from '@/api/manage'
-  import Ellipsis from '@/components/Ellipsis'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-  import { cloneObject, pushIfNotExist } from '@/utils/util'
+import { getAction } from '@/api/manage'
+import Ellipsis from '@/components/Ellipsis'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { cloneObject, pushIfNotExist } from '@/utils/util'
 
-  export default {
-    name: 'JSelectBizComponentModal',
-    mixins: [JeecgListMixin],
-    components: { Ellipsis },
-    props: {
-      value: {
-        type: Array,
-        default: () => []
-      },
-      visible: {
-        type: Boolean,
-        default: false
-      },
-      valueKey: {
-        type: String,
-        required: true
-      },
-      multiple: {
-        type: Boolean,
-        default: true
-      },
-      width: {
-        type: Number,
-        default: 900
-      },
+export default {
+  name: 'JSelectBizComponentModal',
+  mixins: [JeecgListMixin],
+  components: { Ellipsis },
+  props: {
+    value: {
+      type: Array,
+      default: () => [],
+    },
+    visible: {
+      type: Boolean,
+      default: false,
+    },
+    valueKey: {
+      type: String,
+      required: true,
+    },
+    multiple: {
+      type: Boolean,
+      default: true,
+    },
+    width: {
+      type: Number,
+      default: 900,
+    },
 
-      name: {
-        type: String,
-        default: ''
-      },
-      listUrl: {
-        type: String,
-        required: true,
-        default: ''
-      },
-      // 根据 value 获取显示文本的地址,例如存的是 username,可以通过该地址获取到 realname
-      valueUrl: {
-        type: String,
-        default: ''
-      },
-      displayKey: {
-        type: String,
-        default: null
-      },
-      columns: {
-        type: Array,
-        required: true,
-        default: () => []
-      },
-      // 查询条件Code
-      queryParamCode: {
-        type: String,
-        default: null
-      },
-      // 查询条件文字
-      queryParamText: {
-        type: String,
-        default: null
-      },
-      rowKey: {
-        type: String,
-        default: 'id'
-      },
-      // 过长裁剪长度,设置为 -1 代表不裁剪
-      ellipsisLength: {
-        type: Number,
-        default: 12
-      },
+    name: {
+      type: String,
+      default: '',
     },
-    data() {
-      return {
-        innerValue: [],
-        // 已选择列表
-        selectedTable: {
-          pagination: false,
-          scroll: { y: 240 },
-          columns: [
-            {
-              ...this.columns[0],
-              width: this.columns[0].widthRight || this.columns[0].width,
-            },
-            { title: '操作', dataIndex: 'action', align: 'center', width: 60, scopedSlots: { customRender: 'action' }, }
-          ],
-          dataSource: [],
-        },
-        renderEllipsis: (value) => (<ellipsis length={this.ellipsisLength}>{value}</ellipsis>),
-        url: { list: this.listUrl },
-        /* 分页参数 */
-        ipagination: {
-          current: 1,
-          pageSize: 5,
-          pageSizeOptions: ['5', '10', '20', '30'],
-          showTotal: (total, range) => {
-            return range[0] + '-' + range[1] + ' 共' + total + '条'
+    listUrl: {
+      type: String,
+      required: true,
+      default: '',
+    },
+    // 根据 value 获取显示文本的地址,例如存的是 username,可以通过该地址获取到 realname
+    valueUrl: {
+      type: String,
+      default: '',
+    },
+    displayKey: {
+      type: String,
+      default: null,
+    },
+    columns: {
+      type: Array,
+      required: true,
+      default: () => [],
+    },
+    // 查询条件Code
+    queryParamCode: {
+      type: String,
+      default: null,
+    },
+    // 查询条件文字
+    queryParamText: {
+      type: String,
+      default: null,
+    },
+    rowKey: {
+      type: String,
+      default: 'id',
+    },
+    // 过长裁剪长度,设置为 -1 代表不裁剪
+    ellipsisLength: {
+      type: Number,
+      default: 12,
+    },
+  },
+  data() {
+    return {
+      innerValue: [],
+      // 已选择列表
+      selectedTable: {
+        pagination: false,
+        scroll: { y: 240 },
+        columns: [
+          {
+            ...this.columns[0],
+            width: this.columns[0].widthRight || this.columns[0].width,
           },
-          showQuickJumper: true,
-          showSizeChanger: true,
-          total: 0
+          { title: '操作', dataIndex: 'action', align: 'center', width: 60, scopedSlots: { customRender: 'action' } },
+        ],
+        dataSource: [],
+      },
+      renderEllipsis: (value) => <ellipsis length={this.ellipsisLength}>{value}</ellipsis>,
+      url: { list: this.listUrl },
+      /* 分页参数 */
+      ipagination: {
+        current: 1,
+        pageSize: 5,
+        pageSizeOptions: ['5', '10', '20', '30'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 共' + total + '条'
         },
-        options: [],
-        dataSourceMap: {},
-      }
-    },
-    computed: {
-      // 表头
-      innerColumns() {
-        let columns = cloneObject(this.columns)
-        columns.forEach(column => {
-          // 给所有的列加上过长裁剪
-          if (this.ellipsisLength !== -1) {
-            column.customRender = (text) => this.renderEllipsis(text)
-          }
-        })
-        return columns
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0,
       },
-    },
-    watch: {
-      value: {
-        deep: true,
-        immediate: true,
-        handler(val) {
-          this.innerValue = cloneObject(val)
-          this.selectedRowKeys = []
-          this.valueWatchHandler(val)
-          this.queryOptionsByValue(val)
+      options: [],
+      dataSourceMap: {},
+    }
+  },
+  computed: {
+    // 表头
+    innerColumns() {
+      let columns = cloneObject(this.columns)
+      columns.forEach((column) => {
+        // 给所有的列加上过长裁剪
+        if (this.ellipsisLength !== -1) {
+          column.customRender = (text) => this.renderEllipsis(text)
         }
+      })
+      return columns
+    },
+  },
+  watch: {
+    value: {
+      deep: true,
+      immediate: true,
+      handler(val) {
+        this.innerValue = cloneObject(val)
+        this.selectedRowKeys = []
+        this.valueWatchHandler(val)
+        this.queryOptionsByValue(val)
       },
-      dataSource: {
-        deep: true,
-        handler(val) {
-          this.emitOptions(val)
-          this.valueWatchHandler(this.innerValue)
-        }
+    },
+    dataSource: {
+      deep: true,
+      handler(val) {
+        this.emitOptions(val)
+        this.valueWatchHandler(this.innerValue)
       },
-      selectedRowKeys: {
-        immediate: true,
-        deep: true,
-        handler(val) {
-          this.selectedTable.dataSource = val.map(key => {
-            for (let data of this.dataSource) {
-              if (data[this.rowKey] === key) {
-                pushIfNotExist(this.innerValue, data[this.valueKey])
-                return data
-              }
+    },
+    selectedRowKeys: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        this.selectedTable.dataSource = val.map((key) => {
+          for (let data of this.dataSource) {
+            if (data[this.rowKey] === key) {
+              pushIfNotExist(this.innerValue, data[this.valueKey])
+              return data
             }
-            for (let data of this.selectedTable.dataSource) {
-              if (data[this.rowKey] === key) {
-                pushIfNotExist(this.innerValue, data[this.valueKey])
-                return data
-              }
+          }
+          for (let data of this.selectedTable.dataSource) {
+            if (data[this.rowKey] === key) {
+              pushIfNotExist(this.innerValue, data[this.valueKey])
+              return data
             }
-            console.warn('未找到选择的行信息,key:' + key)
-            return {}
-          })
-        },
-      }
+          }
+          console.warn('未找到选择的行信息,key:' + key)
+          return {}
+        })
+      },
     },
+  },
 
-    methods: {
-
-      /** 关闭弹窗 */
-      close() {
-        this.$emit('update:visible', false)
-      },
+  methods: {
+    /** 关闭弹窗 */
+    close() {
+      this.$emit('update:visible', false)
+    },
 
-      valueWatchHandler(val) {
-        val.forEach(item => {
-          this.dataSource.concat(this.selectedTable.dataSource).forEach(data => {
-            if (data[this.valueKey] === item) {
-              pushIfNotExist(this.selectedRowKeys, data[this.rowKey])
-            }
-          })
+    valueWatchHandler(val) {
+      val.forEach((item) => {
+        this.dataSource.concat(this.selectedTable.dataSource).forEach((data) => {
+          if (data[this.valueKey] === item) {
+            pushIfNotExist(this.selectedRowKeys, data[this.rowKey])
+          }
         })
-      },
+      })
+    },
 
-      queryOptionsByValue(value) {
-        if (!value || value.length === 0) {
-          return
-        }
-        // 判断options是否存在value,如果已存在数据就不再请求后台了
-        let notExist = false
-        for (let val of value) {
-          let find = false
-          for (let option of this.options) {
-            if (val === option.value) {
-              find = true
-              break
-            }
-          }
-          if (!find) {
-            notExist = true
+    queryOptionsByValue(value) {
+      if (!value || value.length === 0) {
+        return
+      }
+      // 判断options是否存在value,如果已存在数据就不再请求后台了
+      let notExist = false
+      for (let val of value) {
+        let find = false
+        for (let option of this.options) {
+          if (val === option.value) {
+            find = true
             break
           }
         }
-        if (!notExist) return
-        getAction(this.valueUrl || this.listUrl, {
-          // 这里最后加一个 , 的原因是因为无论如何都要使用 in 查询,防止后台进行了模糊匹配,导致查询结果不准确
-          [this.valueKey]: value.join(',') + ',',
-          pageNo: 1,
-          pageSize: value.length
-        }).then((res) => {
-          if (res.success) {
-            let dataSource = res.result
-            if (!(dataSource instanceof Array)) {
-              dataSource = res.result.records
-            }
-            this.emitOptions(dataSource, (data) => {
-              pushIfNotExist(this.innerValue, data[this.valueKey])
-              pushIfNotExist(this.selectedRowKeys, data[this.rowKey])
-              pushIfNotExist(this.selectedTable.dataSource, data, this.rowKey)
-            })
+        if (!find) {
+          notExist = true
+          break
+        }
+      }
+      if (!notExist) return
+      getAction(this.valueUrl || this.listUrl, {
+        // 这里最后加一个 , 的原因是因为无论如何都要使用 in 查询,防止后台进行了模糊匹配,导致查询结果不准确
+        [this.valueKey]: value.join(',') + ',',
+        pageNo: 1,
+        pageSize: value.length,
+      }).then((res) => {
+        if (res.success) {
+          let dataSource = res.result
+          if (!(dataSource instanceof Array)) {
+            dataSource = res.result.records
           }
-        })
-      },
+          this.emitOptions(dataSource, (data) => {
+            pushIfNotExist(this.innerValue, data[this.valueKey])
+            pushIfNotExist(this.selectedRowKeys, data[this.rowKey])
+            pushIfNotExist(this.selectedTable.dataSource, data, this.rowKey)
+          })
+        }
+      })
+    },
 
-      emitOptions(dataSource, callback) {
-        dataSource.forEach(data => {
-          let key = data[this.valueKey]
-          this.dataSourceMap[key] = data
-          pushIfNotExist(this.options, { label: data[this.displayKey || this.valueKey], value: key }, 'value')
-          typeof callback === 'function' ? callback(data) : ''
-        })
-        this.$emit('options', this.options, this.dataSourceMap)
-      },
+    emitOptions(dataSource, callback) {
+      dataSource.forEach((data) => {
+        let key = data[this.valueKey]
+        this.dataSourceMap[key] = data
+        pushIfNotExist(this.options, { label: data[this.displayKey || this.valueKey], value: key }, 'value')
+        typeof callback === 'function' ? callback(data) : ''
+      })
+      this.$emit('options', this.options, this.dataSourceMap)
+    },
 
-      /** 完成选择 */
-      handleOk() {
-        let value = this.selectedTable.dataSource.map(data => data[this.valueKey])
-        this.$emit('input', value)
-        this.close()
-      },
+    /** 完成选择 */
+    handleOk() {
+      let value = this.selectedTable.dataSource.map((data) => data[this.valueKey])
+      this.$emit('input', value)
+      this.close()
+    },
 
-      /** 删除已选择的 */
-      handleDeleteSelected(record, index) {
-        this.selectedRowKeys.splice(this.selectedRowKeys.indexOf(record[this.rowKey]), 1)
-        this.selectedTable.dataSource.splice(index, 1)
-      },
+    /** 删除已选择的 */
+    handleDeleteSelected(record, index) {
+      this.selectedRowKeys.splice(this.selectedRowKeys.indexOf(record[this.rowKey]), 1)
+      this.selectedTable.dataSource.splice(index, 1)
+    },
 
-      customRowFn(record) {
-        return {
-          on: {
-            click: () => {
-              let key = record[this.rowKey]
-              if (!this.multiple) {
-                this.selectedRowKeys = [key]
-                this.selectedTable.dataSource = [record]
+    customRowFn(record) {
+      return {
+        on: {
+          click: () => {
+            let key = record[this.rowKey]
+            if (!this.multiple) {
+              this.selectedRowKeys = [key]
+              this.selectedTable.dataSource = [record]
+            } else {
+              let index = this.selectedRowKeys.indexOf(key)
+              if (index === -1) {
+                this.selectedRowKeys.push(key)
+                this.selectedTable.dataSource.push(record)
               } else {
-                let index = this.selectedRowKeys.indexOf(key)
-                if (index === -1) {
-                  this.selectedRowKeys.push(key)
-                  this.selectedTable.dataSource.push(record)
-                } else {
-                  this.handleDeleteSelected(record, index)
-                }
+                this.handleDeleteSelected(record, index)
               }
             }
-          }
-        }
-      },
-
-    }
-  }
+          },
+        },
+      }
+    },
+  },
+}
 </script>
-<style lang="less" scoped>
-</style>
+<style lang="less" scoped></style>

+ 120 - 117
jshERP-web/src/components/jeecgbiz/JSelectBizComponent/index.vue

@@ -1,6 +1,6 @@
 <template>
   <a-row class="j-select-biz-component-box" type="flex" :gutter="8">
-    <a-col class="left" :class="{'full': !buttons}">
+    <a-col class="left" :class="{ full: !buttons }">
       <slot name="left">
         <a-select
           mode="multiple"
@@ -10,15 +10,17 @@
           allowClear
           :disabled="disabled"
           :open="selectOpen"
-          style="width: 100%;"
+          style="width: 100%"
           @dropdownVisibleChange="handleDropdownVisibleChange"
-          @click.native="visible=(buttons?visible:true)"
+          @click.native="visible = buttons ? visible : true"
         />
       </slot>
     </a-col>
 
     <a-col v-if="buttons" class="right">
-      <a-button type="primary" icon="search" :disabled="disabled" @click="visible=true">{{selectButtonText}}</a-button>
+      <a-button type="primary" icon="search" :disabled="disabled" @click="visible = true">{{
+        selectButtonText
+      }}</a-button>
     </a-col>
 
     <j-select-biz-component-modal
@@ -31,135 +33,136 @@
 </template>
 
 <script>
-  import JSelectBizComponentModal from './JSelectBizComponentModal'
-
-  export default {
-    name: 'JSelectBizComponent',
-    components: { JSelectBizComponentModal },
-    props: {
-      value: {
-        type: String,
-        default: ''
-      },
-      /** 是否返回 id,默认 false,返回 code */
-      returnId: {
-        type: Boolean,
-        default: false
-      },
-      placeholder: {
-        type: String,
-        default: '请选择'
-      },
-      disabled: {
-        type: Boolean,
-        default: false
-      },
-      // 是否支持多选,默认 true
-      multiple: {
-        type: Boolean,
-        default: true
-      },
-      // 是否显示按钮,默认 true
-      buttons: {
-        type: Boolean,
-        default: true
-      },
-      // 显示的 Key
-      displayKey: {
-        type: String,
-        default: null
-      },
-      // 返回的 key
-      returnKeys: {
-        type: Array,
-        default: () => ['id', 'id']
-      },
-      // 选择按钮文字
-      selectButtonText: {
-        type: String,
-        default: '选择'
-      },
+import JSelectBizComponentModal from './JSelectBizComponentModal'
 
+export default {
+  name: 'JSelectBizComponent',
+  components: { JSelectBizComponentModal },
+  props: {
+    value: {
+      type: String,
+      default: '',
     },
-    data() {
-      return {
-        selectValue: [],
-        selectOptions: [],
-        dataSourceMap: {},
-        visible: false,
-        selectOpen: false,
-      }
+    /** 是否返回 id,默认 false,返回 code */
+    returnId: {
+      type: Boolean,
+      default: false,
     },
-    computed: {
-      valueKey() {
-        return this.returnId ? this.returnKeys[0] : this.returnKeys[1]
-      },
-      modalProps() {
-        return Object.assign({
+    placeholder: {
+      type: String,
+      default: '请选择',
+    },
+    disabled: {
+      type: Boolean,
+      default: false,
+    },
+    // 是否支持多选,默认 true
+    multiple: {
+      type: Boolean,
+      default: true,
+    },
+    // 是否显示按钮,默认 true
+    buttons: {
+      type: Boolean,
+      default: true,
+    },
+    // 显示的 Key
+    displayKey: {
+      type: String,
+      default: null,
+    },
+    // 返回的 key
+    returnKeys: {
+      type: Array,
+      default: () => ['id', 'id'],
+    },
+    // 选择按钮文字
+    selectButtonText: {
+      type: String,
+      default: '选择',
+    },
+  },
+  data() {
+    return {
+      selectValue: [],
+      selectOptions: [],
+      dataSourceMap: {},
+      visible: false,
+      selectOpen: false,
+    }
+  },
+  computed: {
+    valueKey() {
+      return this.returnId ? this.returnKeys[0] : this.returnKeys[1]
+    },
+    modalProps() {
+      return Object.assign(
+        {
           valueKey: this.valueKey,
           multiple: this.multiple,
           returnKeys: this.returnKeys,
-          displayKey: this.displayKey || this.valueKey
-        }, this.$attrs)
-      },
+          displayKey: this.displayKey || this.valueKey,
+        },
+        this.$attrs
+      )
     },
-    watch: {
-      value: {
-        immediate: true,
-        handler(val) {
-          if (val) {
-            this.selectValue = val.split(',')
-          } else {
-            this.selectValue = []
-          }
+  },
+  watch: {
+    value: {
+      immediate: true,
+      handler(val) {
+        if (val) {
+          this.selectValue = val.split(',')
+        } else {
+          this.selectValue = []
         }
       },
-      selectValue: {
-        deep: true,
-        handler(val) {
-          let rows = val.map(key => this.dataSourceMap[key])
-          this.$emit('select', rows)
-          let data = val.join(',')
-          this.$emit('input', data)
-          this.$emit('change', data)
-        }
-      }
     },
-    methods: {
-      handleOptions(options, dataSourceMap) {
-        this.selectOptions = options
-        this.dataSourceMap = dataSourceMap
-      },
-      handleDropdownVisibleChange() {
-        // 解决antdv自己的bug —— open 设置为 false 了,点击后还是添加了 open 样式,导致点击事件失效
-        this.selectOpen = true
-        this.$nextTick(() => {
-          this.selectOpen = false
-        })
+    selectValue: {
+      deep: true,
+      handler(val) {
+        let rows = val.map((key) => this.dataSourceMap[key])
+        this.$emit('select', rows)
+        let data = val.join(',')
+        this.$emit('input', data)
+        this.$emit('change', data)
       },
-    }
-  }
+    },
+  },
+  methods: {
+    handleOptions(options, dataSourceMap) {
+      this.selectOptions = options
+      this.dataSourceMap = dataSourceMap
+    },
+    handleDropdownVisibleChange() {
+      // 解决antdv自己的bug —— open 设置为 false 了,点击后还是添加了 open 样式,导致点击事件失效
+      this.selectOpen = true
+      this.$nextTick(() => {
+        this.selectOpen = false
+      })
+    },
+  },
+}
 </script>
 
 <style lang="less" scoped>
-  .j-select-biz-component-box {
-
-    @width: 82px;
+.j-select-biz-component-box {
+  @width: 82px;
 
-    .left {
-      width: calc(100% - @width - 8px);
-    }
+  .left {
+    width: calc(100% - @width - 8px);
+  }
 
-    .right {
-      width: @width;
-    }
+  .right {
+    width: @width;
+  }
 
-    .full {
-      width: 100%;
-    }
+  .full {
+    width: 100%;
+  }
 
-    /deep/ .ant-select-search__field {
-      display: none !important;
-    }
+  /deep/ .ant-select-search__field {
+    display: none !important;
   }
-</style>
+}
+</style>

+ 95 - 94
jshERP-web/src/components/jeecgbiz/JSelectDepart.vue

@@ -2,8 +2,8 @@
   <div class="components-input-demo-presuffix">
     <!---->
     <a-input @click="openModal" placeholder="请点击选择部门" v-model="departNames" readOnly :disabled="disabled">
-      <a-icon slot="prefix" type="cluster" title="部门选择控件"/>
-      <a-icon v-if="departIds" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/>
+      <a-icon slot="prefix" type="cluster" title="部门选择控件" />
+      <a-icon v-if="departIds" slot="suffix" type="close-circle" @click="handleEmpty" title="清空" />
     </a-input>
 
     <j-select-depart-modal
@@ -13,110 +13,111 @@
       :rootOpened="rootOpened"
       :depart-id="departIds"
       @ok="handleOK"
-      @initComp="initComp"/>
+      @initComp="initComp"
+    />
   </div>
 </template>
 
 <script>
-  import JSelectDepartModal from './modal/JSelectDepartModal'
-  export default {
-    name: 'JSelectDepart',
-    components:{
-      JSelectDepartModal
+import JSelectDepartModal from './modal/JSelectDepartModal'
+export default {
+  name: 'JSelectDepart',
+  components: {
+    JSelectDepartModal,
+  },
+  props: {
+    modalWidth: {
+      type: Number,
+      default: 500,
+      required: false,
     },
-    props:{
-      modalWidth:{
-        type:Number,
-        default:500,
-        required:false
-      },
-      multi:{
-        type:Boolean,
-        default:false,
-        required:false
-      },
-      rootOpened:{
-        type:Boolean,
-        default:true,
-        required:false
-      },
-      value:{
-        type:String,
-        required:false
-      },
-      disabled:{
-        type: Boolean,
-        required: false,
-        default: false
-      },
-      // 自定义返回字段,默认返回 id
-      customReturnField: {
-        type: String,
-        default: 'id'
-      }
+    multi: {
+      type: Boolean,
+      default: false,
+      required: false,
     },
-    data(){
-      return {
-        visible:false,
-        confirmLoading:false,
-        departNames:"",
-        departIds:''
-      }
+    rootOpened: {
+      type: Boolean,
+      default: true,
+      required: false,
+    },
+    value: {
+      type: String,
+      required: false,
     },
-    mounted(){
-      this.departIds = this.value
+    disabled: {
+      type: Boolean,
+      required: false,
+      default: false,
     },
-    watch:{
-      value(val){
-        if (this.customReturnField === 'id') {
-          this.departIds = val
-        }
+    // 自定义返回字段,默认返回 id
+    customReturnField: {
+      type: String,
+      default: 'id',
+    },
+  },
+  data() {
+    return {
+      visible: false,
+      confirmLoading: false,
+      departNames: '',
+      departIds: '',
+    }
+  },
+  mounted() {
+    this.departIds = this.value
+  },
+  watch: {
+    value(val) {
+      if (this.customReturnField === 'id') {
+        this.departIds = val
       }
     },
-    methods:{
-      initComp(departNames){
-        this.departNames = departNames
-      },
-      openModal(){
-        this.$refs.innerDepartSelectModal.show()
-      },
-      handleOK(rows, idstr) {
-        let value = ''
-        if (!rows && rows.length <= 0) {
-          this.departNames = ''
-          this.departIds = ''
-        } else {
-          value = rows.map(row => row[this.customReturnField]).join(',')
-          this.departNames = rows.map(row => row['departName']).join(',')
-          this.departIds = idstr
-        }
-        this.$emit("change", value)
-      },
-      getDepartNames(){
-        return this.departNames
-      },
-      handleEmpty(){
-        this.handleOK('')
+  },
+  methods: {
+    initComp(departNames) {
+      this.departNames = departNames
+    },
+    openModal() {
+      this.$refs.innerDepartSelectModal.show()
+    },
+    handleOK(rows, idstr) {
+      let value = ''
+      if (!rows && rows.length <= 0) {
+        this.departNames = ''
+        this.departIds = ''
+      } else {
+        value = rows.map((row) => row[this.customReturnField]).join(',')
+        this.departNames = rows.map((row) => row['departName']).join(',')
+        this.departIds = idstr
       }
+      this.$emit('change', value)
     },
-    model: {
-      prop: 'value',
-      event: 'change'
-    }
-  }
+    getDepartNames() {
+      return this.departNames
+    },
+    handleEmpty() {
+      this.handleOK('')
+    },
+  },
+  model: {
+    prop: 'value',
+    event: 'change',
+  },
+}
 </script>
 
 <style scoped>
-  .components-input-demo-presuffix .anticon-close-circle {
-    cursor: pointer;
-    color: #ccc;
-    transition: color 0.3s;
-    font-size: 12px;
-  }
-  .components-input-demo-presuffix .anticon-close-circle:hover {
-    color: #f5222d;
-  }
-  .components-input-demo-presuffix .anticon-close-circle:active {
-    color: #666;
-  }
-</style>
+.components-input-demo-presuffix .anticon-close-circle {
+  cursor: pointer;
+  color: #ccc;
+  transition: color 0.3s;
+  font-size: 12px;
+}
+.components-input-demo-presuffix .anticon-close-circle:hover {
+  color: #f5222d;
+}
+.components-input-demo-presuffix .anticon-close-circle:active {
+  color: #666;
+}
+</style>

+ 160 - 107
jshERP-web/src/components/jeecgbiz/JSelectList.vue

@@ -1,14 +1,28 @@
 <template>
   <div>
-    <a-input-group v-if="kind === 'material'" compact style="width:100%;top:0px">
-      <a-select placeholder="输入条码或名称" :dropdownMatchSelectWidth="false" showSearch :showArrow="false"
-                v-model="names" optionFilterProp="children" :style="searchWidth" notFoundContent="需在商品管理先新增才能使用"
-                @search="handleSearch" @change="handleChange">
+    <a-input-group v-if="kind === 'material'" compact style="width: 100%; top: 0px">
+      <a-select
+        placeholder="输入条码或名称"
+        :dropdownMatchSelectWidth="false"
+        showSearch
+        :showArrow="false"
+        v-model="names"
+        optionFilterProp="children"
+        :style="searchWidth"
+        notFoundContent="需在商品管理先新增才能使用"
+        @search="handleSearch"
+        @change="handleChange"
+      >
         <div slot="dropdownRender" slot-scope="menu">
           <v-nodes :vnodes="menu" />
-          <a-divider v-if="materialData.length===20" style="margin: 4px 0;" />
-          <div v-if="materialData.length===20" style="padding: 4px 8px; cursor: pointer;"
-               @mousedown="e => e.preventDefault()">此处最多显示20条,如需更多请点击放大镜查询</div>
+          <a-divider v-if="materialData.length === 20" style="margin: 4px 0" />
+          <div
+            v-if="materialData.length === 20"
+            style="padding: 4px 8px; cursor: pointer"
+            @mousedown="(e) => e.preventDefault()"
+          >
+            此处最多显示20条,如需更多请点击放大镜查询
+          </div>
         </div>
         <a-select-option v-for="item in materialData" :key="item.barCode">
           {{ item.materialStr }}
@@ -16,119 +30,158 @@
       </a-select>
       <a-button icon="search" @click="onSearch" />
     </a-input-group>
-    <a-input-search v-if="kind === 'batch'||kind === 'sn'||kind === 'snAdd'" v-model="names" placeholder="请点开弹窗" readOnly @search="onSearch"></a-input-search>
-    <j-select-material-modal v-if="kind === 'material'" ref="selectModal" :rows="rows" :multi="multi" :bar-code="value" @ok="selectOK" @initComp="initComp"/>
-    <j-select-batch-modal v-if="kind === 'batch'" ref="selectModal" :rows="rows" :multi="multi" :bar-code="value" @ok="selectOK" @initComp="initComp"/>
-    <j-select-sn-modal v-if="kind === 'sn'" ref="selectModal" :rows="rows" :multi="multi" :bar-code="value" @ok="selectOK" @initComp="initComp"/>
-    <j-select-sn-add-modal v-if="kind === 'snAdd'" ref="selectModal" :rows="rows" :multi="multi" :bar-code="value" @ok="selectOK" @initComp="initComp"/>
+    <a-input-search
+      v-if="kind === 'batch' || kind === 'sn' || kind === 'snAdd'"
+      v-model="names"
+      placeholder="请点开弹窗"
+      readOnly
+      @search="onSearch"
+    ></a-input-search>
+    <j-select-material-modal
+      v-if="kind === 'material'"
+      ref="selectModal"
+      :rows="rows"
+      :multi="multi"
+      :bar-code="value"
+      @ok="selectOK"
+      @initComp="initComp"
+    />
+    <j-select-batch-modal
+      v-if="kind === 'batch'"
+      ref="selectModal"
+      :rows="rows"
+      :multi="multi"
+      :bar-code="value"
+      @ok="selectOK"
+      @initComp="initComp"
+    />
+    <j-select-sn-modal
+      v-if="kind === 'sn'"
+      ref="selectModal"
+      :rows="rows"
+      :multi="multi"
+      :bar-code="value"
+      @ok="selectOK"
+      @initComp="initComp"
+    />
+    <j-select-sn-add-modal
+      v-if="kind === 'snAdd'"
+      ref="selectModal"
+      :rows="rows"
+      :multi="multi"
+      :bar-code="value"
+      @ok="selectOK"
+      @initComp="initComp"
+    />
   </div>
 </template>
 
 <script>
-  import JSelectMaterialModal from './modal/JSelectMaterialModal'
-  import JSelectBatchModal from './modal/JSelectBatchModal'
-  import JSelectSnModal from './modal/JSelectSnModal'
-  import JSelectSnAddModal from './modal/JSelectSnAddModal'
-  import { getMaterialByParam } from '@/api/api'
+import JSelectMaterialModal from './modal/JSelectMaterialModal'
+import JSelectBatchModal from './modal/JSelectBatchModal'
+import JSelectSnModal from './modal/JSelectSnModal'
+import JSelectSnAddModal from './modal/JSelectSnAddModal'
+import { getMaterialByParam } from '@/api/api'
 
-  export default {
-    name: 'JSelectList',
-    components: {
-      JSelectMaterialModal, JSelectBatchModal, JSelectSnModal, JSelectSnAddModal,
-      VNodes: {
-        functional: true,
-        render: (h, ctx) => ctx.props.vnodes,
-      }
+export default {
+  name: 'JSelectList',
+  components: {
+    JSelectMaterialModal,
+    JSelectBatchModal,
+    JSelectSnModal,
+    JSelectSnAddModal,
+    VNodes: {
+      functional: true,
+      render: (h, ctx) => ctx.props.vnodes,
     },
-    props: {
-      value: {
-        type: String,
-        required: false
-      },
-      disabled: {
-        type: Boolean,
-        required: false,
-        default: false
-      },
-      rows: {
-        type: String,
-        required: false
-      },
-      kind: {
-        type: String,
-        required: false
-      },
-      multi: {
-        type: Boolean,
-        default: true,
-        required: false
-      }
+  },
+  props: {
+    value: {
+      type: String,
+      required: false,
     },
-    data() {
-      return {
-        ids: "",
-        names: "",
-        materialData: [],
-        setTimeFlag: null,
-        searchWidth: ""
-      }
+    disabled: {
+      type: Boolean,
+      required: false,
+      default: false,
     },
-    mounted() {
-      this.ids = this.value
+    rows: {
+      type: String,
+      required: false,
     },
-    watch: {
-      value(val) {
-        this.ids = val
-      }
+    kind: {
+      type: String,
+      required: false,
     },
-    created () {
-      const currentWidth = window.screen.width
-      if(currentWidth<1500) {
-        this.searchWidth = 'width:75%'
-      } else {
-        this.searchWidth = 'width:81%'
+    multi: {
+      type: Boolean,
+      default: true,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      ids: '',
+      names: '',
+      materialData: [],
+      setTimeFlag: null,
+      searchWidth: '',
+    }
+  },
+  mounted() {
+    this.ids = this.value
+  },
+  watch: {
+    value(val) {
+      this.ids = val
+    },
+  },
+  created() {
+    const currentWidth = window.screen.width
+    if (currentWidth < 1500) {
+      this.searchWidth = 'width:75%'
+    } else {
+      this.searchWidth = 'width:81%'
+    }
+  },
+  model: {
+    prop: 'value',
+    event: 'change',
+  },
+  methods: {
+    initComp(name) {
+      this.names = name ? name : undefined
+    },
+    onSearch() {
+      this.$refs.selectModal.showModal()
+    },
+    handleSearch(value) {
+      let that = this
+      if (this.setTimeFlag != null) {
+        clearTimeout(this.setTimeFlag)
       }
+      this.setTimeFlag = setTimeout(() => {
+        getMaterialByParam({ q: value }).then((res) => {
+          if (res && res.code === 200) {
+            that.materialData = res.data
+          }
+        })
+      }, 500)
     },
-    model: {
-      prop: 'value',
-      event: 'change'
+    handleChange(value) {
+      this.$emit('change', value)
     },
-    methods: {
-      initComp(name) {
-        this.names = name ? name : undefined
-      },
-      onSearch() {
-        this.$refs.selectModal.showModal()
-      },
-      handleSearch(value) {
-        let that = this
-        if(this.setTimeFlag != null){
-          clearTimeout(this.setTimeFlag);
-        }
-        this.setTimeFlag = setTimeout(()=>{
-          getMaterialByParam({q: value}).then((res) => {
-            if (res && res.code === 200) {
-              that.materialData = res.data
-            }
-          })
-        },500)
-      },
-      handleChange(value) {
-        this.$emit("change", value)
-      },
-      selectOK(rows, idstr) {
-        console.log("选中id", idstr)
-        if (!rows) {
-          this.ids = ''
-        } else {
-          this.ids = idstr
-        }
-        this.$emit("change", this.ids)
+    selectOK(rows, idstr) {
+      console.log('选中id', idstr)
+      if (!rows) {
+        this.ids = ''
+      } else {
+        this.ids = idstr
       }
-    }
-  }
+      this.$emit('change', this.ids)
+    },
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 30 - 30
jshERP-web/src/components/jeecgbiz/JSelectMultiUser.vue

@@ -11,37 +11,37 @@
 </template>
 
 <script>
-  import JSelectBizComponent from './JSelectBizComponent'
+import JSelectBizComponent from './JSelectBizComponent'
 
-  export default {
-    name: 'JSelectMultiUser',
-    components: { JSelectBizComponent },
-    props: ['value'],
-    data() {
-      return {
-        url: { list: '/sys/user/list' },
-        columns: [
-          { title: '姓名', align: 'center', width: '25%', widthRight: '70%', dataIndex: 'realname' },
-          { title: '账号', align: 'center', width: '25%', dataIndex: 'username' },
-          { title: '电话', align: 'center', width: '20%', dataIndex: 'phone' },
-          { title: '出生日期', align: 'center', width: '20%', dataIndex: 'birthday' }
-        ],
-        // 定义在这里的参数都是可以在外部传递覆盖的,可以更灵活的定制化使用的组件
-        default: {
-          name: '用户',
-          width: 1200,
-          displayKey: 'realname',
-          returnKeys: ['id', 'username'],
-          queryParamText: '账号',
-        }
-      }
-    },
-    computed: {
-      attrs() {
-        return Object.assign(this.default, this.$attrs)
-      }
+export default {
+  name: 'JSelectMultiUser',
+  components: { JSelectBizComponent },
+  props: ['value'],
+  data() {
+    return {
+      url: { list: '/sys/user/list' },
+      columns: [
+        { title: '姓名', align: 'center', width: '25%', widthRight: '70%', dataIndex: 'realname' },
+        { title: '账号', align: 'center', width: '25%', dataIndex: 'username' },
+        { title: '电话', align: 'center', width: '20%', dataIndex: 'phone' },
+        { title: '出生日期', align: 'center', width: '20%', dataIndex: 'birthday' },
+      ],
+      // 定义在这里的参数都是可以在外部传递覆盖的,可以更灵活的定制化使用的组件
+      default: {
+        name: '用户',
+        width: 1200,
+        displayKey: 'realname',
+        returnKeys: ['id', 'username'],
+        queryParamText: '账号',
+      },
     }
-  }
+  },
+  computed: {
+    attrs() {
+      return Object.assign(this.default, this.$attrs)
+    },
+  },
+}
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped></style>

+ 29 - 29
jshERP-web/src/components/jeecgbiz/JSelectPosition.vue

@@ -1,37 +1,37 @@
 <template>
-  <j-select-biz-component :width="1000" v-bind="configs" v-on="$listeners"/>
+  <j-select-biz-component :width="1000" v-bind="configs" v-on="$listeners" />
 </template>
 
 <script>
-  import JSelectBizComponent from './JSelectBizComponent'
+import JSelectBizComponent from './JSelectBizComponent'
 
-  export default {
-    name: 'JSelectPosition',
-    components: { JSelectBizComponent },
-    props: ['value'],
-    data() {
-      return {
-        settings: {
-          name: '职务',
-          displayKey: 'name',
-          returnKeys: ['id', 'code'],
-          listUrl: '/sys/position/list',
-          queryParamCode: 'name',
-          queryParamText: '职务名称',
-          columns: [
-            { title: '职务名称', dataIndex: 'name', align: 'center', width: '30%', widthRight: '70%' },
-            { title: '职务编码', dataIndex: 'code', align: 'center', width: '35%' },
-            { title: '职级', dataIndex: 'rank_dictText', align: 'center', width: '25%' }
-          ]
-        }
-      }
-    },
-    computed: {
-      configs() {
-        return Object.assign({ value: this.value }, this.settings, this.$attrs)
-      }
+export default {
+  name: 'JSelectPosition',
+  components: { JSelectBizComponent },
+  props: ['value'],
+  data() {
+    return {
+      settings: {
+        name: '职务',
+        displayKey: 'name',
+        returnKeys: ['id', 'code'],
+        listUrl: '/sys/position/list',
+        queryParamCode: 'name',
+        queryParamText: '职务名称',
+        columns: [
+          { title: '职务名称', dataIndex: 'name', align: 'center', width: '30%', widthRight: '70%' },
+          { title: '职务编码', dataIndex: 'code', align: 'center', width: '35%' },
+          { title: '职级', dataIndex: 'rank_dictText', align: 'center', width: '25%' },
+        ],
+      },
     }
-  }
+  },
+  computed: {
+    configs() {
+      return Object.assign({ value: this.value }, this.settings, this.$attrs)
+    },
+  },
+}
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped></style>

+ 16 - 19
jshERP-web/src/components/jeecgbiz/JSelectRole.vue

@@ -1,38 +1,35 @@
 <template>
   <j-select-biz-component
     :value="value"
-
     name="角色"
     displayKey="roleName"
-
     :returnKeys="returnKeys"
     :listUrl="url.list"
     :columns="columns"
     queryParamText="角色编码"
-
     v-on="$listeners"
     v-bind="$attrs"
   />
 </template>
 
 <script>
-  import JSelectBizComponent from './JSelectBizComponent'
+import JSelectBizComponent from './JSelectBizComponent'
 
-  export default {
-    name: 'JSelectMultiUser',
-    components: { JSelectBizComponent },
-    props: ['value'],
-    data() {
-      return {
-        returnKeys: ['id', 'roleCode'],
-        url: { list: '/sys/role/list' },
-        columns: [
-          { title: '角色名称', dataIndex: 'roleName', align: 'center', width: 120 },
-          { title: '角色编码', dataIndex: 'roleCode', align: 'center', width: 120 }
-        ]
-      }
+export default {
+  name: 'JSelectMultiUser',
+  components: { JSelectBizComponent },
+  props: ['value'],
+  data() {
+    return {
+      returnKeys: ['id', 'roleCode'],
+      url: { list: '/sys/role/list' },
+      columns: [
+        { title: '角色名称', dataIndex: 'roleName', align: 'center', width: 120 },
+        { title: '角色编码', dataIndex: 'roleCode', align: 'center', width: 120 },
+      ],
     }
-  }
+  },
+}
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped></style>

+ 71 - 71
jshERP-web/src/components/jeecgbiz/JSelectUserByDep.vue

@@ -1,89 +1,89 @@
 <template>
   <div>
-    <a-input-search
-      v-model="userNames"
-      placeholder="请先选择用户"
-      readOnly
-      unselectable="on"
-      @search="onSearchDepUser">
+    <a-input-search v-model="userNames" placeholder="请先选择用户" readOnly unselectable="on" @search="onSearchDepUser">
       <a-button slot="enterButton" :disabled="disabled">选择用户</a-button>
     </a-input-search>
-    <j-select-user-by-dep-modal ref="selectModal" :modal-width="modalWidth" :multi="multi" @ok="selectOK" :user-ids="value" @initComp="initComp"/>
+    <j-select-user-by-dep-modal
+      ref="selectModal"
+      :modal-width="modalWidth"
+      :multi="multi"
+      @ok="selectOK"
+      :user-ids="value"
+      @initComp="initComp"
+    />
   </div>
 </template>
 
 <script>
-  import JSelectUserByDepModal from './modal/JSelectUserByDepModal'
+import JSelectUserByDepModal from './modal/JSelectUserByDepModal'
 
-  export default {
-    name: 'JSelectUserByDep',
-    components: {JSelectUserByDepModal},
-    props: {
-      modalWidth: {
-        type: Number,
-        default: 1250,
-        required: false
-      },
-      value: {
-        type: String,
-        required: false
-      },
-      disabled: {
-        type: Boolean,
-        required: false,
-        default: false
-      },
-      multi: {
-        type: Boolean,
-        default: true,
-        required: false
-      },
+export default {
+  name: 'JSelectUserByDep',
+  components: { JSelectUserByDepModal },
+  props: {
+    modalWidth: {
+      type: Number,
+      default: 1250,
+      required: false,
     },
-    data() {
-      return {
-        userIds: "",
-        userNames: ""
-      }
+    value: {
+      type: String,
+      required: false,
     },
-    mounted() {
-      this.userIds = this.value
+    disabled: {
+      type: Boolean,
+      required: false,
+      default: false,
     },
-    watch: {
-      value(val) {
-        this.userIds = val
-      }
+    multi: {
+      type: Boolean,
+      default: true,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      userIds: '',
+      userNames: '',
+    }
+  },
+  mounted() {
+    this.userIds = this.value
+  },
+  watch: {
+    value(val) {
+      this.userIds = val
     },
-    model: {
-      prop: 'value',
-      event: 'change'
+  },
+  model: {
+    prop: 'value',
+    event: 'change',
+  },
+  methods: {
+    initComp(userNames) {
+      this.userNames = userNames
     },
-    methods: {
-      initComp(userNames) {
-        this.userNames = userNames
-      },
-      onSearchDepUser() {
-        this.$refs.selectModal.showModal()
-      },
-      selectOK(rows, idstr) {
-        console.log("当前选中用户", rows)
-        console.log("当前选中用户ID", idstr)
-        if (!rows) {
-          this.userNames = ''
-          this.userIds = ''
-        } else {
-          let temp = ''
-          for (let item of rows) {
-            temp += ',' + item.realname
-          }
-          this.userNames = temp.substring(1)
-          this.userIds = idstr
+    onSearchDepUser() {
+      this.$refs.selectModal.showModal()
+    },
+    selectOK(rows, idstr) {
+      console.log('当前选中用户', rows)
+      console.log('当前选中用户ID', idstr)
+      if (!rows) {
+        this.userNames = ''
+        this.userIds = ''
+      } else {
+        let temp = ''
+        for (let item of rows) {
+          temp += ',' + item.realname
         }
-        this.$emit("change", this.userIds)
+        this.userNames = temp.substring(1)
+        this.userIds = idstr
       }
-    }
-  }
+      this.$emit('change', this.userIds)
+    },
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 212 - 208
jshERP-web/src/components/jeecgbiz/modal/JSelectBatchModal.vue

@@ -6,8 +6,9 @@
     @ok="handleSubmit"
     @cancel="close"
     cancelText="关闭"
-    style="top:12%;height: 90%;overflow-y: hidden"
-    wrapClassName="ant-modal-cust-warp">
+    style="top: 12%; height: 90%; overflow-y: hidden"
+    wrapClassName="ant-modal-cust-warp"
+  >
     <a-row :gutter="10" style="padding: 10px; margin: -10px">
       <a-col :md="24" :sm="24">
         <!-- 查询区域 -->
@@ -20,7 +21,7 @@
                   <a-input ref="name" placeholder="请输入批号" v-model="queryParam.name"></a-input>
                 </a-form-item>
               </a-col>
-              <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
                 <a-col :md="12" :sm="24">
                   <a-button type="primary" @click="loadData(1)">查询</a-button>
                   <a-button style="margin-left: 8px" @click="searchReset(1)">重置</a-button>
@@ -36,9 +37,10 @@
             rowKey="id"
             :columns="columns"
             :dataSource="dataSource"
-            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type: getType}"
+            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: getType }"
             :loading="loading"
-            :customRow="rowAction">
+            :customRow="rowAction"
+          >
           </a-table>
         </div>
       </a-col>
@@ -47,233 +49,235 @@
 </template>
 
 <script>
-  import { getAction } from '@/api/manage'
-  import {getBatchNumberList} from '@/api/api'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { getAction } from '@/api/manage'
+import { getBatchNumberList } from '@/api/api'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 
-  export default {
-    name: 'JSelectBatchModal',
-    mixins:[JeecgListMixin],
-    components: {},
-    props: ['rows', 'multi', 'barCode'],
-    data() {
-      return {
-        modalWidth: 1100,
-        queryParam: {
-          name: "",
-          depotItemId: '',
-          depotId: '',
-          barCode: ''
-        },
-        labelCol: {
-          xs: { span: 24 },
-          sm: { span: 5 },
-        },
-        wrapperCol: {
-          xs: { span: 24 },
-          sm: { span: 16 },
-        },
-        categoryTree:[],
-        columns: [
-          {dataIndex: 'batchNumber', title: '批号', width: 100, align: 'left', ellipsis:true},
-          {dataIndex: 'barCode', title: '条码', width: 100, ellipsis:true},
-          {dataIndex: 'name', title: '名称', width: 100, ellipsis:true},
-          {dataIndex: 'standard', title: '规格', width: 80, ellipsis:true},
-          {dataIndex: 'model', title: '型号', width: 80, ellipsis:true},
-          {dataIndex: 'commodityUnit', title: '单位', width: 60, ellipsis:true},
-          {dataIndex: 'expirationDateStr', title: '有效期至', width: 80},
-          {dataIndex: 'totalNum', title: '库存', width: 80}
-        ],
-        scrollTrigger: {},
-        dataSource: [],
-        selectedRowKeys: [],
-        selectRows: [],
-        selectIds: [],
-        title: '选择批号',
-        isorter: {
-          column: 'createTime',
-          order: 'desc'
-        },
-        departTree: [],
-        depotList: [],
-        visible: false,
-        form: this.$form.createForm(this),
-        loading: false,
-        expandedKeys: [],
-      }
-    },
-    computed: {
-      // 计算属性的 getter
-      getType: function () {
-        return this.multi == true ? 'checkbox' : 'radio';
-      }
+export default {
+  name: 'JSelectBatchModal',
+  mixins: [JeecgListMixin],
+  components: {},
+  props: ['rows', 'multi', 'barCode'],
+  data() {
+    return {
+      modalWidth: 1100,
+      queryParam: {
+        name: '',
+        depotItemId: '',
+        depotId: '',
+        barCode: '',
+      },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      categoryTree: [],
+      columns: [
+        { dataIndex: 'batchNumber', title: '批号', width: 100, align: 'left', ellipsis: true },
+        { dataIndex: 'barCode', title: '条码', width: 100, ellipsis: true },
+        { dataIndex: 'name', title: '名称', width: 100, ellipsis: true },
+        { dataIndex: 'standard', title: '规格', width: 80, ellipsis: true },
+        { dataIndex: 'model', title: '型号', width: 80, ellipsis: true },
+        { dataIndex: 'commodityUnit', title: '单位', width: 60, ellipsis: true },
+        { dataIndex: 'expirationDateStr', title: '有效期至', width: 80 },
+        { dataIndex: 'totalNum', title: '库存', width: 80 },
+      ],
+      scrollTrigger: {},
+      dataSource: [],
+      selectedRowKeys: [],
+      selectRows: [],
+      selectIds: [],
+      title: '选择批号',
+      isorter: {
+        column: 'createTime',
+        order: 'desc',
+      },
+      departTree: [],
+      depotList: [],
+      visible: false,
+      form: this.$form.createForm(this),
+      loading: false,
+      expandedKeys: [],
+    }
+  },
+  computed: {
+    // 计算属性的 getter
+    getType: function () {
+      return this.multi == true ? 'checkbox' : 'radio'
     },
-    watch: {
-      barCode: {
-        immediate: true,
-        handler() {
-          this.initBarCode()
-        }
+  },
+  watch: {
+    barCode: {
+      immediate: true,
+      handler() {
+        this.initBarCode()
       },
     },
-    created() {
-      this.loadData()
+  },
+  created() {
+    this.loadData()
+  },
+  methods: {
+    initBarCode() {
+      if (this.barCode) {
+        this.$emit('initComp', this.barCode)
+      } else {
+        // JSelectUserByDep组件bug issues/I16634
+        this.$emit('initComp', '')
+      }
     },
-    methods: {
-      initBarCode() {
-        if (this.barCode) {
-          this.$emit('initComp', this.barCode)
-        } else {
-          // JSelectUserByDep组件bug issues/I16634
-          this.$emit('initComp', '')
-        }
-      },
-      loadData(arg) {
-        if(this.rows) {
-          if(JSON.parse(this.rows).depotId && JSON.parse(this.rows).barCode ){
-            let isEdit = JSON.parse(this.rows).isEdit
-            if(isEdit) {
-              //只有在保存之后的编辑页面下才获取明细id
-              let depotItemId = JSON.parse(this.rows).id
-              if (depotItemId.length <= 19) {
-                this.queryParam.depotItemId = depotItemId-0
-              }
+    loadData(arg) {
+      if (this.rows) {
+        if (JSON.parse(this.rows).depotId && JSON.parse(this.rows).barCode) {
+          let isEdit = JSON.parse(this.rows).isEdit
+          if (isEdit) {
+            //只有在保存之后的编辑页面下才获取明细id
+            let depotItemId = JSON.parse(this.rows).id
+            if (depotItemId.length <= 19) {
+              this.queryParam.depotItemId = depotItemId - 0
             }
-            this.queryParam.depotId = JSON.parse(this.rows).depotId-0
-            this.queryParam.barCode = JSON.parse(this.rows).barCode
           }
+          this.queryParam.depotId = JSON.parse(this.rows).depotId - 0
+          this.queryParam.barCode = JSON.parse(this.rows).barCode
         }
-        if (arg === 1) {
-          this.ipagination.current = 1;
-        }
-        this.loading = true
-        let params = this.getQueryParams()//查询条件
-        getBatchNumberList(params).then((res) => {
+      }
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      this.loading = true
+      let params = this.getQueryParams() //查询条件
+      getBatchNumberList(params)
+        .then((res) => {
           if (res && res.code === 200) {
             this.dataSource = res.data.rows
             this.ipagination.total = res.data.total
           }
-        }).finally(() => {
+        })
+        .finally(() => {
           this.loading = false
         })
-      },
-      showModal() {
-        this.visible = true
-        this.$nextTick(() => this.$refs.name.focus())
-        this.loadData()
-        this.form.resetFields()
-      },
-      getQueryParams() {
-        let param = Object.assign({}, this.queryParam, this.isorter);
-        return param;
-      },
-      getQueryField() {
-        let str = 'id,';
-        for (let a = 0; a < this.columns.length; a++) {
-          str += ',' + this.columns[a].dataIndex;
-        }
-        return str;
-      },
-      searchReset(num) {
-        let that = this;
-        if (num !== 0) {
-          if(this.rows) {
-            this.queryParam.name=''
-            if(JSON.parse(this.rows).depotId && JSON.parse(this.rows).barCode ){
-              let isEdit = JSON.parse(this.rows).isEdit
-              if(isEdit) {
-                //只有在保存之后的编辑页面下才获取明细id
-                let depotItemId = JSON.parse(this.rows).id
-                if(depotItemId.length<=19) {
-                  this.queryParam.depotItemId = depotItemId-0
-                }
+    },
+    showModal() {
+      this.visible = true
+      this.$nextTick(() => this.$refs.name.focus())
+      this.loadData()
+      this.form.resetFields()
+    },
+    getQueryParams() {
+      let param = Object.assign({}, this.queryParam, this.isorter)
+      return param
+    },
+    getQueryField() {
+      let str = 'id,'
+      for (let a = 0; a < this.columns.length; a++) {
+        str += ',' + this.columns[a].dataIndex
+      }
+      return str
+    },
+    searchReset(num) {
+      let that = this
+      if (num !== 0) {
+        if (this.rows) {
+          this.queryParam.name = ''
+          if (JSON.parse(this.rows).depotId && JSON.parse(this.rows).barCode) {
+            let isEdit = JSON.parse(this.rows).isEdit
+            if (isEdit) {
+              //只有在保存之后的编辑页面下才获取明细id
+              let depotItemId = JSON.parse(this.rows).id
+              if (depotItemId.length <= 19) {
+                this.queryParam.depotItemId = depotItemId - 0
               }
-              this.queryParam.depotId = JSON.parse(this.rows).depotId-0
-              this.queryParam.barCode = JSON.parse(this.rows).barCode
             }
+            this.queryParam.depotId = JSON.parse(this.rows).depotId - 0
+            this.queryParam.barCode = JSON.parse(this.rows).barCode
           }
-          that.loadData(1);
         }
-        that.selectedRowKeys = [];
-        that.selectIds = [];
-      },
-      close() {
-        this.searchReset(0);
-        this.visible = false;
-      },
-      handleSubmit() {
-        let that = this;
-        this.getSelectRows();
-        that.$emit('ok', that.selectRows, that.selectIds);
-        that.searchReset(0)
-        that.close();
-      },
-      //获取选择信息
-      getSelectRows(rowId) {
-        let dataSource = this.dataSource;
-        let ids = "";
-        this.selectRows = [];
-        for (let i = 0, len = dataSource.length; i < len; i++) {
-          if (this.selectedRowKeys.includes(dataSource[i].id)) {
-            this.selectRows.push(dataSource[i]);
-            ids = ids + "," + dataSource[i].batchNumber
-          }
+        that.loadData(1)
+      }
+      that.selectedRowKeys = []
+      that.selectIds = []
+    },
+    close() {
+      this.searchReset(0)
+      this.visible = false
+    },
+    handleSubmit() {
+      let that = this
+      this.getSelectRows()
+      that.$emit('ok', that.selectRows, that.selectIds)
+      that.searchReset(0)
+      that.close()
+    },
+    //获取选择信息
+    getSelectRows(rowId) {
+      let dataSource = this.dataSource
+      let ids = ''
+      this.selectRows = []
+      for (let i = 0, len = dataSource.length; i < len; i++) {
+        if (this.selectedRowKeys.includes(dataSource[i].id)) {
+          this.selectRows.push(dataSource[i])
+          ids = ids + ',' + dataSource[i].batchNumber
         }
-        this.selectIds = ids.substring(1);
-      },
-      onSelectChange(selectedRowKeys, selectionRows) {
-        this.selectedRowKeys = selectedRowKeys;
-        this.selectionRows = selectionRows;
-      },
-      onSearch() {
-        if(this.dataSource && this.dataSource.length===1) {
-          if(this.queryParam.name === this.dataSource[0].batchNumber) {
-            let arr = []
-            arr.push(this.dataSource[0].id)
-            this.selectedRowKeys = arr
-            this.handleSubmit()
-          } else {
-            this.loadData(1)
-          }
+      }
+      this.selectIds = ids.substring(1)
+    },
+    onSelectChange(selectedRowKeys, selectionRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectionRows = selectionRows
+    },
+    onSearch() {
+      if (this.dataSource && this.dataSource.length === 1) {
+        if (this.queryParam.name === this.dataSource[0].batchNumber) {
+          let arr = []
+          arr.push(this.dataSource[0].id)
+          this.selectedRowKeys = arr
+          this.handleSubmit()
         } else {
           this.loadData(1)
         }
-      },
-      modalFormOk() {
-        this.loadData();
-      },
-      rowAction(record, index) {
-        return {
-          on: {
-            click: () => {
-              let arr = []
-              arr.push(record.id)
-              this.selectedRowKeys = arr
-            },
-            dblclick: () => {
-              let arr = []
-              arr.push(record.id)
-              this.selectedRowKeys = arr
-              this.handleSubmit()
-            }
-          }
-        }
+      } else {
+        this.loadData(1)
       }
-    }
-  }
+    },
+    modalFormOk() {
+      this.loadData()
+    },
+    rowAction(record, index) {
+      return {
+        on: {
+          click: () => {
+            let arr = []
+            arr.push(record.id)
+            this.selectedRowKeys = arr
+          },
+          dblclick: () => {
+            let arr = []
+            arr.push(record.id)
+            this.selectedRowKeys = arr
+            this.handleSubmit()
+          },
+        },
+      }
+    },
+  },
+}
 </script>
 
 <style scoped>
-  .ant-table-tbody .ant-table-row td {
-    padding-top: 10px;
-    padding-bottom: 10px;
-  }
+.ant-table-tbody .ant-table-row td {
+  padding-top: 10px;
+  padding-bottom: 10px;
+}
 
-  #components-layout-demo-custom-trigger .trigger {
-    font-size: 18px;
-    line-height: 64px;
-    padding: 0 24px;
-    cursor: pointer;
-    transition: color .3s;
-  }
-</style>
+#components-layout-demo-custom-trigger .trigger {
+  font-size: 18px;
+  line-height: 64px;
+  padding: 0 24px;
+  cursor: pointer;
+  transition: color 0.3s;
+}
+</style>

+ 167 - 171
jshERP-web/src/components/jeecgbiz/modal/JSelectDepartModal.vue

@@ -6,7 +6,8 @@
     :confirmLoading="confirmLoading"
     @ok="handleSubmit"
     @cancel="handleCancel"
-    cancelText="关闭">
+    cancelText="关闭"
+  >
     <a-spin tip="Loading..." :spinning="false">
       <a-input-search style="margin-bottom: 1px" placeholder="请输入部门名称按回车进行搜索" @search="onSearch" />
       <a-tree
@@ -18,209 +19,204 @@
         @expand="onExpand"
         :autoExpandParent="autoExpandParent"
         :expandedKeys="expandedKeys"
-        :checkedKeys="checkedKeys">
-
-        <template slot="title" slot-scope="{title}">
+        :checkedKeys="checkedKeys"
+      >
+        <template slot="title" slot-scope="{ title }">
           <span v-if="title.indexOf(searchValue) > -1">
-            {{title.substr(0, title.indexOf(searchValue))}}
-            <span style="color: #f50">{{searchValue}}</span>
-            {{title.substr(title.indexOf(searchValue) + searchValue.length)}}
+            {{ title.substr(0, title.indexOf(searchValue)) }}
+            <span style="color: #f50">{{ searchValue }}</span>
+            {{ title.substr(title.indexOf(searchValue) + searchValue.length) }}
           </span>
-          <span v-else>{{title}}</span>
+          <span v-else>{{ title }}</span>
         </template>
       </a-tree>
-
     </a-spin>
   </a-modal>
 </template>
 
 <script>
-  export default {
-    name: 'JSelectDepartModal',
-    props:['modalWidth','multi','rootOpened','departId'],
-    data(){
-      return {
-        visible:false,
-        confirmLoading:false,
-        treeData:[],
-        autoExpandParent:true,
-        expandedKeys:[],
-        dataList:[],
-        checkedKeys:[],
-        checkedRows:[],
-        searchValue:""
-      }
-    },
-    created(){
-    },
-    watch:{
-      departId(){
-        this.initDepartComponent()
-      },
-      visible: {
-        handler() {
-          if (this.departId) {
-            this.checkedKeys = this.departId.split(",");
-            // console.log('this.departId', this.departId)
-          } else {
-            this.checkedKeys = [];
-          }
-        }
-      }
+export default {
+  name: 'JSelectDepartModal',
+  props: ['modalWidth', 'multi', 'rootOpened', 'departId'],
+  data() {
+    return {
+      visible: false,
+      confirmLoading: false,
+      treeData: [],
+      autoExpandParent: true,
+      expandedKeys: [],
+      dataList: [],
+      checkedKeys: [],
+      checkedRows: [],
+      searchValue: '',
+    }
+  },
+  created() {},
+  watch: {
+    departId() {
+      this.initDepartComponent()
     },
-    methods:{
-      show(){
-        this.visible=true
-        this.checkedRows=[]
-        this.checkedKeys=[]
-      },
-      initDepartComponent(){
-        let names = ''
-        if(this.departId){
-          let currDepartId = this.departId
-          for(let item of this.dataList){
-            if(currDepartId.indexOf(item.key)>=0){
-              names+=","+item.title
-            }
-          }
-          if(names){
-            names = names.substring(1)
-          }
+    visible: {
+      handler() {
+        if (this.departId) {
+          this.checkedKeys = this.departId.split(',')
+          // console.log('this.departId', this.departId)
+        } else {
+          this.checkedKeys = []
         }
-        this.$emit("initComp",names)
       },
-      reWriterWithSlot(arr){
-        for(let item of arr){
-          if(item.children && item.children.length>0){
-            this.reWriterWithSlot(item.children)
-            let temp = Object.assign({},item)
-            temp.children = {}
-            this.dataList.push(temp)
-          }else{
-            this.dataList.push(item)
-            item.scopedSlots={ title: 'title' }
+    },
+  },
+  methods: {
+    show() {
+      this.visible = true
+      this.checkedRows = []
+      this.checkedKeys = []
+    },
+    initDepartComponent() {
+      let names = ''
+      if (this.departId) {
+        let currDepartId = this.departId
+        for (let item of this.dataList) {
+          if (currDepartId.indexOf(item.key) >= 0) {
+            names += ',' + item.title
           }
         }
-      },
-      initExpandedKeys(arr){
-        if(arr && arr.length>0){
-          let keys = []
-          for(let item of arr){
-            if(item.children && item.children.length>0){
-              keys.push(item.id)
-            }
-          }
-          this.expandedKeys=[...keys]
-        }else{
-          this.expandedKeys=[]
+        if (names) {
+          names = names.substring(1)
         }
-      },
-      onCheck (checkedKeys,info) {
-        if(!this.multi){
-          let arr = checkedKeys.checked.filter(item => this.checkedKeys.indexOf(item) < 0)
-          this.checkedKeys = [...arr]
-          this.checkedRows = (this.checkedKeys.length === 0) ? [] : [info.node.dataRef]
-        }else{
-          this.checkedKeys = checkedKeys.checked
-          this.checkedRows = this.getCheckedRows(this.checkedKeys)
+      }
+      this.$emit('initComp', names)
+    },
+    reWriterWithSlot(arr) {
+      for (let item of arr) {
+        if (item.children && item.children.length > 0) {
+          this.reWriterWithSlot(item.children)
+          let temp = Object.assign({}, item)
+          temp.children = {}
+          this.dataList.push(temp)
+        } else {
+          this.dataList.push(item)
+          item.scopedSlots = { title: 'title' }
         }
-      },
-      onSelect(selectedKeys,info) {
+      }
+    },
+    initExpandedKeys(arr) {
+      if (arr && arr.length > 0) {
         let keys = []
-        keys.push(selectedKeys[0])
-        if(!this.checkedKeys || this.checkedKeys.length===0 || !this.multi){
-          this.checkedKeys = [...keys]
-          this.checkedRows=[info.node.dataRef]
-        }else{
-          let currKey = info.node.dataRef.key
-          if(this.checkedKeys.indexOf(currKey)>=0){
-            this.checkedKeys = this.checkedKeys.filter(item=> item !==currKey)
-          }else{
-            this.checkedKeys.push(...keys)
+        for (let item of arr) {
+          if (item.children && item.children.length > 0) {
+            keys.push(item.id)
           }
         }
+        this.expandedKeys = [...keys]
+      } else {
+        this.expandedKeys = []
+      }
+    },
+    onCheck(checkedKeys, info) {
+      if (!this.multi) {
+        let arr = checkedKeys.checked.filter((item) => this.checkedKeys.indexOf(item) < 0)
+        this.checkedKeys = [...arr]
+        this.checkedRows = this.checkedKeys.length === 0 ? [] : [info.node.dataRef]
+      } else {
+        this.checkedKeys = checkedKeys.checked
         this.checkedRows = this.getCheckedRows(this.checkedKeys)
-      },
-      onExpand (expandedKeys) {
-        this.expandedKeys = expandedKeys
-        this.autoExpandParent = false
-      },
-      handleSubmit(){
-        if(!this.checkedKeys || this.checkedKeys.length==0){
-          this.$emit("ok",'')
-        }else{
-          this.$emit("ok",this.checkedRows,this.checkedKeys.join(","))
+      }
+    },
+    onSelect(selectedKeys, info) {
+      let keys = []
+      keys.push(selectedKeys[0])
+      if (!this.checkedKeys || this.checkedKeys.length === 0 || !this.multi) {
+        this.checkedKeys = [...keys]
+        this.checkedRows = [info.node.dataRef]
+      } else {
+        let currKey = info.node.dataRef.key
+        if (this.checkedKeys.indexOf(currKey) >= 0) {
+          this.checkedKeys = this.checkedKeys.filter((item) => item !== currKey)
+        } else {
+          this.checkedKeys.push(...keys)
         }
-        this.handleClear()
-      },
-      handleCancel(){
-        this.handleClear()
-      },
-      handleClear(){
-        this.visible=false
-        this.checkedKeys=[]
-      },
-      getParentKey(currKey,treeData){
-        let parentKey
-        for (let i = 0; i < treeData.length; i++) {
-          const node = treeData[i]
-          if (node.children) {
-            if (node.children.some(item => item.key === currKey)) {
-              parentKey = node.key
-            } else if (this.getParentKey(currKey, node.children)) {
-              parentKey = this.getParentKey(currKey, node.children)
-            }
+      }
+      this.checkedRows = this.getCheckedRows(this.checkedKeys)
+    },
+    onExpand(expandedKeys) {
+      this.expandedKeys = expandedKeys
+      this.autoExpandParent = false
+    },
+    handleSubmit() {
+      if (!this.checkedKeys || this.checkedKeys.length == 0) {
+        this.$emit('ok', '')
+      } else {
+        this.$emit('ok', this.checkedRows, this.checkedKeys.join(','))
+      }
+      this.handleClear()
+    },
+    handleCancel() {
+      this.handleClear()
+    },
+    handleClear() {
+      this.visible = false
+      this.checkedKeys = []
+    },
+    getParentKey(currKey, treeData) {
+      let parentKey
+      for (let i = 0; i < treeData.length; i++) {
+        const node = treeData[i]
+        if (node.children) {
+          if (node.children.some((item) => item.key === currKey)) {
+            parentKey = node.key
+          } else if (this.getParentKey(currKey, node.children)) {
+            parentKey = this.getParentKey(currKey, node.children)
           }
         }
-        return parentKey
-      },
-      onSearch(value){
-        const expandedKeys = this.dataList.map((item) => {
+      }
+      return parentKey
+    },
+    onSearch(value) {
+      const expandedKeys = this.dataList
+        .map((item) => {
           if (item.title.indexOf(value) > -1) {
-            return this.getParentKey(item.key,this.treeData)
+            return this.getParentKey(item.key, this.treeData)
           }
           return null
-        }).filter((item, i, self) => item && self.indexOf(item) === i)
-
-        Object.assign(this, {
-          expandedKeys,
-          searchValue: value,
-          autoExpandParent: true,
         })
+        .filter((item, i, self) => item && self.indexOf(item) === i)
 
-
-      },
-      // 根据 checkedKeys 获取 rows
-      getCheckedRows(checkedKeys) {
-        const forChildren = (list, key) => {
-          for (let item of list) {
-            if (item.id === key) {
-              return item
-            }
-            if (item.children instanceof Array) {
-              let value = forChildren(item.children, key)
-              if (value != null) {
-                return value
-              }
+      Object.assign(this, {
+        expandedKeys,
+        searchValue: value,
+        autoExpandParent: true,
+      })
+    },
+    // 根据 checkedKeys 获取 rows
+    getCheckedRows(checkedKeys) {
+      const forChildren = (list, key) => {
+        for (let item of list) {
+          if (item.id === key) {
+            return item
+          }
+          if (item.children instanceof Array) {
+            let value = forChildren(item.children, key)
+            if (value != null) {
+              return value
             }
           }
-          return null
         }
+        return null
+      }
 
-        let rows = []
-        for (let key of checkedKeys) {
-          let row = forChildren(this.treeData, key)
-          if (row != null) {
-            rows.push(row)
-          }
+      let rows = []
+      for (let key of checkedKeys) {
+        let row = forChildren(this.treeData, key)
+        if (row != null) {
+          rows.push(row)
         }
-        return rows
       }
-    }
-  }
-
+      return rows
+    },
+  },
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 346 - 323
jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue

@@ -7,7 +7,7 @@
     @ok="handleSubmit"
     @cancel="close"
     cancelText="关闭(ESC)"
-    style="top:20px;height: 95%;"
+    style="top: 20px; height: 95%"
   >
     <a-row :gutter="10" style="padding: 10px; margin: -10px">
       <a-col :md="24" :sm="24">
@@ -28,15 +28,22 @@
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="仓库">
-                  <a-select placeholder="选择仓库" v-model="queryParam.depotId" @change="onDepotChange"
-                    :dropdownMatchSelectWidth="false" showSearch optionFilterProp="children" allow-clear>
-                    <a-select-option v-for="(item,index) in depotList" :key="index" :value="item.id">
+                  <a-select
+                    placeholder="选择仓库"
+                    v-model="queryParam.depotId"
+                    @change="onDepotChange"
+                    :dropdownMatchSelectWidth="false"
+                    showSearch
+                    optionFilterProp="children"
+                    allow-clear
+                  >
+                    <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.id">
                       {{ item.depotName }}
                     </a-select-option>
                   </a-select>
                 </a-form-item>
               </a-col>
-              <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
                 <a-col :md="6" :sm="8">
                   <a-button type="primary" @click="loadMaterialData(1)">查询</a-button>
                   <a-button style="margin-left: 8px" @click="searchReset(1)">重置</a-button>
@@ -45,30 +52,36 @@
                   </a-tooltip>
                   <a @click="handleToggleSearch" style="margin-left: 8px">
                     {{ toggleSearchStatus ? '收起' : '展开' }}
-                    <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+                    <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
                   </a>
                 </a-col>
               </span>
               <template v-if="toggleSearchStatus">
                 <a-col :md="6" :sm="8">
-                  <a-form-item label="颜色" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
+                  <a-form-item label="颜色" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
                     <a-input placeholder="请输入颜色" v-model="queryParam.color"></a-input>
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="8">
-                  <a-form-item label="品牌" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
+                  <a-form-item label="品牌" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
                     <a-input placeholder="请输入品牌" v-model="queryParam.brand"></a-input>
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="8">
                   <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="类别">
-                    <a-tree-select style="width:100%" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}" allow-clear
-                                   :treeData="categoryTree" v-model="queryParam.categoryId" placeholder="请选择类别">
+                    <a-tree-select
+                      style="width: 100%"
+                      :dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
+                      allow-clear
+                      :treeData="categoryTree"
+                      v-model="queryParam.categoryId"
+                      placeholder="请选择类别"
+                    >
                     </a-tree-select>
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="8">
-                  <a-form-item label="制造商" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
+                  <a-form-item label="制造商" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
                     <a-input placeholder="请输入制造商" v-model="queryParam.mfrs"></a-input>
                   </a-form-item>
                 </a-col>
@@ -81,7 +94,7 @@
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
-                  <a-form-item label="批号" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
+                  <a-form-item label="批号" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
                     <a-select placeholder="有无批号" v-model="queryParam.enableBatchNumber">
                       <a-select-option value="1">有</a-select-option>
                       <a-select-option value="0">无</a-select-option>
@@ -99,25 +112,31 @@
             :columns="columns"
             :dataSource="dataSource"
             :pagination="ipagination"
-            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type: getType}"
+            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: getType }"
             :loading="loading"
             :customRow="rowAction"
-            @change="handleTableChange">
+            @change="handleTableChange"
+          >
             <template slot="customBarCode" slot-scope="text, record">
-              <div :style="record.imgName?'float:left;line-height:30px':'float:left;'">{{record.mBarCode}}</div>
+              <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">{{ record.mBarCode }}</div>
               <a-popover placement="right" trigger="click">
                 <template slot="content">
                   <img :src="getImgUrl(record.imgName, record.imgLarge)" width="500px" />
                 </template>
                 <div class="item-info" v-if="record.imgName">
-                  <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)" class="item-img" title="查看大图" />
+                  <img
+                    v-if="record.imgName"
+                    :src="getImgUrl(record.imgName, record.imgSmall)"
+                    class="item-img"
+                    title="查看大图"
+                  />
                 </div>
               </a-popover>
             </template>
             <template slot="customName" slot-scope="text, record">
-              {{record.name}}
-              <a-tag v-if="record.enableSerialNumber==1" color="orange">序</a-tag>
-              <a-tag v-if="record.enableBatchNumber==1" color="orange">批</a-tag>
+              {{ record.name }}
+              <a-tag v-if="record.enableSerialNumber == 1" color="orange">序</a-tag>
+              <a-tag v-if="record.enableBatchNumber == 1" color="orange">批</a-tag>
             </template>
           </a-table>
         </div>
@@ -128,332 +147,336 @@
 </template>
 
 <script>
-  import { getAction, getFileAccessHttpUrl } from '@/api/manage'
-  import {filterObj, getMpListShort} from '@/utils/util'
-  import {getMaterialBySelect, queryMaterialCategoryTreeList} from '@/api/api'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-  import {mixinDevice} from '@/utils/mixin'
-  import Vue from 'vue'
+import { getAction, getFileAccessHttpUrl } from '@/api/manage'
+import { filterObj, getMpListShort } from '@/utils/util'
+import { getMaterialBySelect, queryMaterialCategoryTreeList } from '@/api/api'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { mixinDevice } from '@/utils/mixin'
+import Vue from 'vue'
 
-  export default {
-    name: 'JSelectMaterialModal',
-    mixins:[JeecgListMixin, mixinDevice],
-    components: {
-      MaterialModal: () => import('@/views/material/modules/MaterialModal')
-    },
-    props: ['rows', 'multi', 'barCode'],
-    data() {
-      return {
-        modalWidth: 1450,
-        queryParam: {
-          q: '',
-          standardOrModel: '',
-          depotId: undefined,
-          color: '',
-          brand: '',
-          categoryId: undefined,
-          mfrs: '',
-          enableSerialNumber: undefined,
-          enableBatchNumber: undefined
-        },
-        labelCol: {
-          xs: { span: 24 },
-          sm: { span: 5 },
-        },
-        wrapperCol: {
-          xs: { span: 24 },
-          sm: { span: 16 },
-        },
-        categoryTree:[],
-        columns: [
-          {dataIndex: 'mBarCode', title: '条码', scopedSlots: { customRender: 'customBarCode' }},
-          {dataIndex: 'name', title: '名称', scopedSlots: { customRender: 'customName' }},
-          {dataIndex: 'categoryName', title: '类别'},
-          {dataIndex: 'standard', title: '规格'},
-          {dataIndex: 'model', title: '型号'},
-          {dataIndex: 'color', title: '颜色'},
-          {dataIndex: 'brand', title: '品牌'},
-          {dataIndex: 'mfrs', title: '制造商'},
-          {dataIndex: 'unit', title: '单位'},
-          {dataIndex: 'sku', title: '多属性'},
-          {dataIndex: 'stock', title: '库存'},
-          {dataIndex: 'expand', title: '扩展信息'}
-        ],
-        scrollTrigger: {},
-        dataSource: [],
-        selectedRowKeys: [],
-        selectMaterialRows: [],
-        selectMaterialIds: [],
-        title: '选择商品',
-        ipagination: {
-          current: 1,
-          pageSize: 10,
-          pageSizeOptions: ['10', '20', '30'],
-          showTotal: (total, range) => {
-            return range[0] + '-' + range[1] + ' 共' + total + '条'
-          },
-          showQuickJumper: true,
-          showSizeChanger: true,
-          total: 0
-        },
-        isorter: {
-          column: 'createTime',
-          order: 'desc'
+export default {
+  name: 'JSelectMaterialModal',
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    MaterialModal: () => import('@/views/material/modules/MaterialModal'),
+  },
+  props: ['rows', 'multi', 'barCode'],
+  data() {
+    return {
+      modalWidth: 1450,
+      queryParam: {
+        q: '',
+        standardOrModel: '',
+        depotId: undefined,
+        color: '',
+        brand: '',
+        categoryId: undefined,
+        mfrs: '',
+        enableSerialNumber: undefined,
+        enableBatchNumber: undefined,
+      },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      categoryTree: [],
+      columns: [
+        { dataIndex: 'mBarCode', title: '条码', scopedSlots: { customRender: 'customBarCode' } },
+        { dataIndex: 'name', title: '名称', scopedSlots: { customRender: 'customName' } },
+        { dataIndex: 'categoryName', title: '类别' },
+        { dataIndex: 'standard', title: '规格' },
+        { dataIndex: 'model', title: '型号' },
+        { dataIndex: 'color', title: '颜色' },
+        { dataIndex: 'brand', title: '品牌' },
+        { dataIndex: 'mfrs', title: '制造商' },
+        { dataIndex: 'unit', title: '单位' },
+        { dataIndex: 'sku', title: '多属性' },
+        { dataIndex: 'stock', title: '库存' },
+        { dataIndex: 'expand', title: '扩展信息' },
+      ],
+      scrollTrigger: {},
+      dataSource: [],
+      selectedRowKeys: [],
+      selectMaterialRows: [],
+      selectMaterialIds: [],
+      title: '选择商品',
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ['10', '20', '30'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 共' + total + '条'
         },
-        departTree: [],
-        depotList: [],
-        visible: false,
-        form: this.$form.createForm(this),
-        loading: false,
-        expandedKeys: [],
-        disableMixinCreated: true,
-      }
-    },
-    computed: {
-      // 计算属性的 getter
-      getType: function () {
-        return this.multi == true ? 'checkbox' : 'radio';
-      }
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0,
+      },
+      isorter: {
+        column: 'createTime',
+        order: 'desc',
+      },
+      departTree: [],
+      depotList: [],
+      visible: false,
+      form: this.$form.createForm(this),
+      loading: false,
+      expandedKeys: [],
+      disableMixinCreated: true,
+    }
+  },
+  computed: {
+    // 计算属性的 getter
+    getType: function () {
+      return this.multi == true ? 'checkbox' : 'radio'
     },
-    watch: {
-      barCode: {
-        immediate: true,
-        handler() {
-          this.initBarCode()
-        }
+  },
+  watch: {
+    barCode: {
+      immediate: true,
+      handler() {
+        this.initBarCode()
       },
     },
-    created() {
-      // 该方法触发屏幕自适应
-      this.resetScreenSize()
+  },
+  created() {
+    // 该方法触发屏幕自适应
+    this.resetScreenSize()
+  },
+  methods: {
+    initBarCode() {
+      if (this.barCode) {
+        this.$emit('initComp', this.barCode)
+      } else {
+        // JSelectUserByDep组件bug issues/I16634
+        this.$emit('initComp', '')
+      }
     },
-    methods: {
-      initBarCode() {
-        if (this.barCode) {
-          this.$emit('initComp', this.barCode)
-        } else {
-          // JSelectUserByDep组件bug issues/I16634
-          this.$emit('initComp', '')
-        }
-      },
-      loadMaterialData(arg) {
-        if (arg === 1) {
-          this.ipagination.current = 1;
-        }
-        this.loading = true
-        let params = this.getQueryParams()//查询条件
-        getMaterialBySelect(params).then((res) => {
-          if (res) {
-            this.dataSource = res.rows
-            this.ipagination.total = res.total
-            if(res.total ===1) {
-              if(this.queryParam.q === this.dataSource[0].mBarCode||
-                this.queryParam.q === this.dataSource[0].name||
-                this.queryParam.q === this.dataSource[0].mnemonic) {
-                this.title = '选择商品【再次回车可以直接选中】'
-                this.$nextTick(() => this.$refs.material.focus());
-              } else {
-                this.title = '选择商品'
-              }
+    loadMaterialData(arg) {
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      this.loading = true
+      let params = this.getQueryParams() //查询条件
+      getMaterialBySelect(params).then((res) => {
+        if (res) {
+          this.dataSource = res.rows
+          this.ipagination.total = res.total
+          if (res.total === 1) {
+            if (
+              this.queryParam.q === this.dataSource[0].mBarCode ||
+              this.queryParam.q === this.dataSource[0].name ||
+              this.queryParam.q === this.dataSource[0].mnemonic
+            ) {
+              this.title = '选择商品【再次回车可以直接选中】'
+              this.$nextTick(() => this.$refs.material.focus())
             } else {
               this.title = '选择商品'
             }
+          } else {
+            this.title = '选择商品'
           }
-          this.loading = false
-          this.onClearSelected()
-        })
-      },
-      loadTreeData(){
-        let that = this;
-        let params = {};
-        params.id='';
-        queryMaterialCategoryTreeList(params).then((res)=>{
-          if(res){
-            that.categoryTree = [];
-            for (let i = 0; i < res.length; i++) {
-              let temp = res[i];
-              that.categoryTree.push(temp);
-            }
-          }
-        })
-      },
-      // 触发屏幕自适应
-      resetScreenSize() {
-        let realScreenWidth = window.screen.width
-        this.modalWidth = realScreenWidth<1600?'1300px':'1550px'
-        let screenWidth = document.body.clientWidth;
-        if (screenWidth < 500) {
-          this.scrollTrigger = {x: 800};
-        } else {
-          this.scrollTrigger = {};
-        }
-      },
-      showModal(barCode) {
-        this.visible = true;
-        this.title = '选择商品'
-        this.queryParam.q = barCode
-        this.$nextTick(() => this.$refs.material.focus());
-        this.loadTreeData()
-        this.getDepotList()
-        this.initDepotSelect()
-        this.loadMaterialData();
-        this.form.resetFields();
-      },
-      getQueryParams() {
-        let param = Object.assign({}, this.queryParam, this.isorter);
-        param.mpList = getMpListShort(Vue.ls.get('materialPropertyList'))  //扩展属性
-        param.page = this.ipagination.current;
-        param.rows = this.ipagination.pageSize;
-        return filterObj(param);
-      },
-      getQueryField() {
-        let str = 'id,';
-        for (let a = 0; a < this.columns.length; a++) {
-          str += ',' + this.columns[a].dataIndex;
         }
-        return str;
-      },
-      searchReset(num) {
-        let that = this;
-        if (num !== 0) {
-          that.queryParam = {};
-          that.loadMaterialData(1);
+        this.loading = false
+        this.onClearSelected()
+      })
+    },
+    loadTreeData() {
+      let that = this
+      let params = {}
+      params.id = ''
+      queryMaterialCategoryTreeList(params).then((res) => {
+        if (res) {
+          that.categoryTree = []
+          for (let i = 0; i < res.length; i++) {
+            let temp = res[i]
+            that.categoryTree.push(temp)
+          }
         }
-        that.selectedRowKeys = [];
-        that.selectMaterialIds = [];
-      },
-      addMaterial() {
-        this.$refs.modalForm.add()
-        this.$refs.modalForm.title = '新增商品'
-      },
-      getImgUrl(imgName, type) {
-        if(imgName && imgName.split(',')) {
-          type = type? type + '/':''
-          return getFileAccessHttpUrl('systemConfig/static/' + type + imgName.split(',')[0])
-        } else {
-          return ''
+      })
+    },
+    // 触发屏幕自适应
+    resetScreenSize() {
+      let realScreenWidth = window.screen.width
+      this.modalWidth = realScreenWidth < 1600 ? '1300px' : '1550px'
+      let screenWidth = document.body.clientWidth
+      if (screenWidth < 500) {
+        this.scrollTrigger = { x: 800 }
+      } else {
+        this.scrollTrigger = {}
+      }
+    },
+    showModal(barCode) {
+      this.visible = true
+      this.title = '选择商品'
+      this.queryParam.q = barCode
+      this.$nextTick(() => this.$refs.material.focus())
+      this.loadTreeData()
+      this.getDepotList()
+      this.initDepotSelect()
+      this.loadMaterialData()
+      this.form.resetFields()
+    },
+    getQueryParams() {
+      let param = Object.assign({}, this.queryParam, this.isorter)
+      param.mpList = getMpListShort(Vue.ls.get('materialPropertyList')) //扩展属性
+      param.page = this.ipagination.current
+      param.rows = this.ipagination.pageSize
+      return filterObj(param)
+    },
+    getQueryField() {
+      let str = 'id,'
+      for (let a = 0; a < this.columns.length; a++) {
+        str += ',' + this.columns[a].dataIndex
+      }
+      return str
+    },
+    searchReset(num) {
+      let that = this
+      if (num !== 0) {
+        that.queryParam = {}
+        that.loadMaterialData(1)
+      }
+      that.selectedRowKeys = []
+      that.selectMaterialIds = []
+    },
+    addMaterial() {
+      this.$refs.modalForm.add()
+      this.$refs.modalForm.title = '新增商品'
+    },
+    getImgUrl(imgName, type) {
+      if (imgName && imgName.split(',')) {
+        type = type ? type + '/' : ''
+        return getFileAccessHttpUrl('systemConfig/static/' + type + imgName.split(',')[0])
+      } else {
+        return ''
+      }
+    },
+    close() {
+      this.searchReset(0)
+      this.visible = false
+    },
+    handleTableChange(pagination, filters, sorter) {
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field
+        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
+      }
+      this.ipagination = pagination
+      this.loadMaterialData()
+    },
+    handleSubmit() {
+      let that = this
+      this.getSelectMaterialRows()
+      that.$emit('ok', that.selectMaterialRows, that.selectMaterialIds)
+      that.searchReset(0)
+      that.close()
+    },
+    //获取选择信息
+    getSelectMaterialRows(rowId) {
+      let dataSource = this.dataSource
+      let materialIds = ''
+      this.selectMaterialRows = []
+      for (let i = 0, len = dataSource.length; i < len; i++) {
+        if (this.selectedRowKeys.includes(dataSource[i].id)) {
+          this.selectMaterialRows.push(dataSource[i])
+          materialIds = materialIds + ',' + dataSource[i].mBarCode
         }
-      },
-      close() {
-        this.searchReset(0);
-        this.visible = false;
-      },
-      handleTableChange(pagination, filters, sorter) {
-        if (Object.keys(sorter).length > 0) {
-          this.isorter.column = sorter.field;
-          this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc';
+      }
+      this.selectMaterialIds = materialIds.substring(1)
+    },
+    getDepotList() {
+      let that = this
+      getAction('/depot/findDepotByCurrentUser').then((res) => {
+        if (res.code === 200) {
+          that.depotList = res.data
         }
-        this.ipagination = pagination;
-        this.loadMaterialData();
-      },
-      handleSubmit() {
-        let that = this;
-        this.getSelectMaterialRows();
-        that.$emit('ok', that.selectMaterialRows, that.selectMaterialIds);
-        that.searchReset(0)
-        that.close();
-      },
-      //获取选择信息
-      getSelectMaterialRows(rowId) {
-        let dataSource = this.dataSource;
-        let materialIds = "";
-        this.selectMaterialRows = [];
-        for (let i = 0, len = dataSource.length; i < len; i++) {
-          if (this.selectedRowKeys.includes(dataSource[i].id)) {
-            this.selectMaterialRows.push(dataSource[i]);
-            materialIds = materialIds + "," + dataSource[i].mBarCode
-          }
+      })
+    },
+    initDepotSelect() {
+      if (this.rows) {
+        if (JSON.parse(this.rows).depotId) {
+          this.queryParam.depotId = JSON.parse(this.rows).depotId - 0
         }
-        this.selectMaterialIds = materialIds.substring(1);
-      },
-      getDepotList() {
-        let that = this;
-        getAction('/depot/findDepotByCurrentUser').then((res) => {
-          if(res.code === 200){
-            that.depotList = res.data
-          }
-        })
-      },
-      initDepotSelect() {
-        if(this.rows) {
-          if(JSON.parse(this.rows).depotId){
-            this.queryParam.depotId = JSON.parse(this.rows).depotId-0
-          }
+      }
+    },
+    onDepotChange(value) {
+      this.queryParam.depotId = value
+    },
+    onSelectChange(selectedRowKeys, selectionRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectionRows = selectionRows
+    },
+    onSearch() {
+      if (this.dataSource && this.dataSource.length === 1) {
+        if (
+          this.queryParam.q === this.dataSource[0].mBarCode ||
+          this.queryParam.q === this.dataSource[0].name ||
+          this.queryParam.q === this.dataSource[0].mnemonic
+        ) {
+          let arr = []
+          arr.push(this.dataSource[0].id)
+          this.selectedRowKeys = arr
+          this.handleSubmit()
+        } else {
+          this.loadMaterialData(1)
         }
-      },
-      onDepotChange(value) {
-        this.queryParam.depotId = value
-      },
-      onSelectChange(selectedRowKeys, selectionRows) {
-        this.selectedRowKeys = selectedRowKeys;
-        this.selectionRows = selectionRows;
-      },
-      onSearch() {
-        if(this.dataSource && this.dataSource.length===1) {
-          if(this.queryParam.q === this.dataSource[0].mBarCode||
-            this.queryParam.q === this.dataSource[0].name||
-            this.queryParam.q === this.dataSource[0].mnemonic) {
+      } else {
+        this.loadMaterialData(1)
+      }
+    },
+    modalFormOk() {
+      this.loadMaterialData()
+    },
+    rowAction(record, index) {
+      return {
+        on: {
+          click: () => {
+            let arr = []
+            arr.push(record.id)
+            this.selectedRowKeys = arr
+          },
+          dblclick: () => {
             let arr = []
-            arr.push(this.dataSource[0].id)
+            arr.push(record.id)
             this.selectedRowKeys = arr
             this.handleSubmit()
-          } else {
-            this.loadMaterialData(1)
-          }
-        } else {
-          this.loadMaterialData(1)
-        }
-      },
-      modalFormOk() {
-        this.loadMaterialData()
-      },
-      rowAction(record, index) {
-        return {
-          on: {
-            click: () => {
-              let arr = []
-              arr.push(record.id)
-              this.selectedRowKeys = arr
-            },
-            dblclick: () => {
-              let arr = []
-              arr.push(record.id)
-              this.selectedRowKeys = arr
-              this.handleSubmit()
-            }
-          }
-        }
+          },
+        },
       }
-    }
-  }
+    },
+  },
+}
 </script>
 
 <style scoped>
-  .ant-table-tbody .ant-table-row td {
-    padding-top: 10px;
-    padding-bottom: 10px;
-  }
+.ant-table-tbody .ant-table-row td {
+  padding-top: 10px;
+  padding-bottom: 10px;
+}
 
-  #components-layout-demo-custom-trigger .trigger {
-    font-size: 18px;
-    line-height: 64px;
-    padding: 0 24px;
-    cursor: pointer;
-    transition: color .3s;
-  }
+#components-layout-demo-custom-trigger .trigger {
+  font-size: 18px;
+  line-height: 64px;
+  padding: 0 24px;
+  cursor: pointer;
+  transition: color 0.3s;
+}
 
-  .item-info {
-    float:left;
-    width:30px;
-    height:30px;
-    margin-left:8px
-  }
-  .item-img {
-    cursor:pointer;
-    position: static;
-    display: block;
-    width: 100%;
-    height: 100%;
-    object-fit: cover;
-  }
-</style>
+.item-info {
+  float: left;
+  width: 30px;
+  height: 30px;
+  margin-left: 8px;
+}
+.item-img {
+  cursor: pointer;
+  position: static;
+  display: block;
+  width: 100%;
+  height: 100%;
+  object-fit: cover;
+}
+</style>

+ 182 - 174
jshERP-web/src/components/jeecgbiz/modal/JSelectSnAddModal.vue

@@ -6,8 +6,9 @@
     @ok="handleSubmit"
     @cancel="close"
     cancelText="关闭"
-    style="top:12%;height: 90%;overflow-y: hidden"
-    wrapClassName="ant-modal-cust-warp">
+    style="top: 12%; height: 90%; overflow-y: hidden"
+    wrapClassName="ant-modal-cust-warp"
+  >
     <a-row :gutter="24">
       <a-col :md="24" :sm="24">
         <div>
@@ -17,9 +18,14 @@
                 <a-row :gutter="24">
                   <a-col :md="24" :sm="24">
                     <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="序列号">
-                      <a-input ref="name" style="width:400px;" placeholder="请输入序列号并回车(只能输入数字或字母)"
-                               oninput="value=value.replace(/[\W]/g,'')" v-model="queryParam.name"></a-input>
-                      <div style="float:left;">
+                      <a-input
+                        ref="name"
+                        style="width: 400px"
+                        placeholder="请输入序列号并回车(只能输入数字或字母)"
+                        oninput="value=value.replace(/[\W]/g,'')"
+                        v-model="queryParam.name"
+                      ></a-input>
+                      <div style="float: left">
                         <a-button type="primary" @click="onAdd">添加</a-button>
                         <a-button style="margin-left: 8px" @click="clearAllSn">清空</a-button>
                       </div>
@@ -31,11 +37,13 @@
                 <a-row :gutter="24">
                   <a-col :md="24" :sm="24">
                     <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="序列号">
-                      <a-textarea style="width:400px;"
+                      <a-textarea
+                        style="width: 400px"
                         placeholder="多个序列号用逗号隔开,请少于100个字符"
                         :auto-size="{ minRows: 2, maxRows: 4 }"
-                        v-model="queryParam.multiName" />
-                      <div style="float:left;">
+                        v-model="queryParam.multiName"
+                      />
+                      <div style="float: left">
                         <a-button type="primary" @click="onBatchAdd">批量添加</a-button>
                         <a-button style="margin-left: 8px" @click="clearAllSn">清空</a-button>
                       </div>
@@ -48,7 +56,7 @@
         </div>
       </a-col>
     </a-row>
-    <a-row :gutter="10" style="padding: 10px;">
+    <a-row :gutter="10" style="padding: 10px">
       <a-col :md="24" :sm="24">
         <a-table
           ref="table"
@@ -58,10 +66,11 @@
           :columns="columns"
           :dataSource="checkDataSource"
           :pagination="false"
-          :loading="loading">
-           <span slot="action" slot-scope="text, record">
-              <a @click="removeSn(record)">移除</a>
-           </span>
+          :loading="loading"
+        >
+          <span slot="action" slot-scope="text, record">
+            <a @click="removeSn(record)">移除</a>
+          </span>
         </a-table>
       </a-col>
     </a-row>
@@ -69,191 +78,190 @@
 </template>
 
 <script>
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 
-  export default {
-    name: 'JSelectSnAddModal',
-    mixins:[JeecgListMixin],
-    components: {},
-    props: ['rows', 'multi', 'barCode'],
-    data() {
-      return {
-        modalWidth: 800,
-        queryParam: {
-          name: "",
-          multiName: ""
-        },
-        labelCol: {
-          xs: { span: 24 },
-          sm: { span: 3 },
-        },
-        wrapperCol: {
-          xs: { span: 24 },
-          sm: { span: 18 },
-        },
-        categoryTree:[],
-        columns: [
-          {dataIndex: 'serialNumber', title: '已录入的序列号', width: 100, align: 'left'},
-          {tdataIndex: 'action', title: '操作', align:"center", width: 50, scopedSlots: { customRender: 'action' }}
-        ],
-        scrollTrigger: {y: 460},
-        checkDataSource: [],
-        selectedRowKeys: [],
-        selectRows: [],
-        selectIds: [],
-        title: '录入序列号',
-        visible: false,
-        form: this.$form.createForm(this),
-        disableMixinCreated: true,
-        loading: false,
-      }
-    },
-    computed: {
-      // 计算属性的 getter
-      getType: function () {
-        return this.multi == true ? 'checkbox' : 'radio';
-      }
-    },
-    watch: {
-      barCode: {
-        immediate: true,
-        handler() {
-          this.initBarCode()
-        }
-      },
-    },
-    methods: {
-      initBarCode() {
-        if (this.barCode) {
-          this.$emit('initComp', this.barCode)
-        } else {
-          this.$emit('initComp', '')
-        }
+export default {
+  name: 'JSelectSnAddModal',
+  mixins: [JeecgListMixin],
+  components: {},
+  props: ['rows', 'multi', 'barCode'],
+  data() {
+    return {
+      modalWidth: 800,
+      queryParam: {
+        name: '',
+        multiName: '',
       },
-      showModal() {
-        this.visible = true
-        this.$nextTick(() => this.$refs.name.focus())
-        this.form.resetFields()
-        //加载存在的序列号
-        if(this.rows) {
-          this.checkDataSource = []
-          let rowObj = JSON.parse(this.rows)
-          let snArr = rowObj.snList.split(',')
-          for (let i = 0; i < snArr.length; i++) {
-            let snObj = {
-              'id': snArr[i],
-              'serialNumber': snArr[i]
-            }
-            this.checkDataSource.push(snObj)
-          }
-        }
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 3 },
       },
-      clearAllSn() {
-        this.checkDataSource = []
-      },
-      close() {
-        this.visible = false;
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 18 },
       },
-      handleSubmit() {
-        let that = this;
-        this.getSelectRows();
-        that.$emit('ok', that.selectRows, that.selectIds);
-        that.close();
+      categoryTree: [],
+      columns: [
+        { dataIndex: 'serialNumber', title: '已录入的序列号', width: 100, align: 'left' },
+        { tdataIndex: 'action', title: '操作', align: 'center', width: 50, scopedSlots: { customRender: 'action' } },
+      ],
+      scrollTrigger: { y: 460 },
+      checkDataSource: [],
+      selectedRowKeys: [],
+      selectRows: [],
+      selectIds: [],
+      title: '录入序列号',
+      visible: false,
+      form: this.$form.createForm(this),
+      disableMixinCreated: true,
+      loading: false,
+    }
+  },
+  computed: {
+    // 计算属性的 getter
+    getType: function () {
+      return this.multi == true ? 'checkbox' : 'radio'
+    },
+  },
+  watch: {
+    barCode: {
+      immediate: true,
+      handler() {
+        this.initBarCode()
       },
-      removeSn(record) {
-        let oldArr = this.checkDataSource
-        let newArr = []
-        for (let i = 0; i < oldArr.length; i++) {
-          if(oldArr[i].id !== record.id) {
-            newArr.push(oldArr[i])
+    },
+  },
+  methods: {
+    initBarCode() {
+      if (this.barCode) {
+        this.$emit('initComp', this.barCode)
+      } else {
+        this.$emit('initComp', '')
+      }
+    },
+    showModal() {
+      this.visible = true
+      this.$nextTick(() => this.$refs.name.focus())
+      this.form.resetFields()
+      //加载存在的序列号
+      if (this.rows) {
+        this.checkDataSource = []
+        let rowObj = JSON.parse(this.rows)
+        let snArr = rowObj.snList.split(',')
+        for (let i = 0; i < snArr.length; i++) {
+          let snObj = {
+            id: snArr[i],
+            serialNumber: snArr[i],
           }
+          this.checkDataSource.push(snObj)
         }
-        this.checkDataSource = newArr
-      },
-      //获取选择信息
-      getSelectRows() {
-        let ids = ""
-        this.selectRows = this.checkDataSource
-        let data = this.checkDataSource
-        for (let i = 0; i < data.length; i++) {
-          ids = ids + "," + data[i].serialNumber
+      }
+    },
+    clearAllSn() {
+      this.checkDataSource = []
+    },
+    close() {
+      this.visible = false
+    },
+    handleSubmit() {
+      let that = this
+      this.getSelectRows()
+      that.$emit('ok', that.selectRows, that.selectIds)
+      that.close()
+    },
+    removeSn(record) {
+      let oldArr = this.checkDataSource
+      let newArr = []
+      for (let i = 0; i < oldArr.length; i++) {
+        if (oldArr[i].id !== record.id) {
+          newArr.push(oldArr[i])
         }
-        this.selectIds = ids.substring(1)
-      },
-      onAdd() {
-        if(!this.queryParam.name) {
-          return
+      }
+      this.checkDataSource = newArr
+    },
+    //获取选择信息
+    getSelectRows() {
+      let ids = ''
+      this.selectRows = this.checkDataSource
+      let data = this.checkDataSource
+      for (let i = 0; i < data.length; i++) {
+        ids = ids + ',' + data[i].serialNumber
+      }
+      this.selectIds = ids.substring(1)
+    },
+    onAdd() {
+      if (!this.queryParam.name) {
+        return
+      }
+      let checkObj = {
+        id: this.queryParam.name,
+        serialNumber: this.queryParam.name,
+      }
+      let data = this.checkDataSource
+      let isExist = false
+      for (let i = 0; i < data.length; i++) {
+        if (data[i].serialNumber === this.queryParam.name) {
+          isExist = true
         }
+      }
+      if (isExist) {
+        this.$message.warning('抱歉,此序列号已经添加过!')
+      } else {
+        this.checkDataSource.push(checkObj)
+        this.queryParam.name = ''
+      }
+    },
+    onBatchAdd() {
+      if (!this.queryParam.multiName) {
+        return
+      }
+      this.queryParam.multiName = this.queryParam.multiName.replaceAll(',', ',')
+      let nameArr = this.queryParam.multiName.split(',')
+      for (let i = 0; i < nameArr.length; i++) {
         let checkObj = {
-          id: this.queryParam.name,
-          serialNumber: this.queryParam.name
+          id: nameArr[i],
+          serialNumber: nameArr[i],
         }
         let data = this.checkDataSource
         let isExist = false
-        for (let i = 0; i < data.length; i++) {
-          if(data[i].serialNumber === this.queryParam.name) {
+        for (let j = 0; j < data.length; j++) {
+          if (data[j].serialNumber === nameArr[i]) {
             isExist = true
           }
         }
-        if(isExist) {
-          this.$message.warning('抱歉,此序列号已经添加过!');
+        if (isExist) {
+          this.$message.warning('抱歉,序列号' + nameArr[i] + '已经添加过!')
+          return
         } else {
           this.checkDataSource.push(checkObj)
-          this.queryParam.name = ''
-        }
-      },
-      onBatchAdd() {
-        if(!this.queryParam.multiName) {
-          return
         }
-        this.queryParam.multiName = this.queryParam.multiName.replaceAll(',',',')
-        let nameArr = this.queryParam.multiName.split(',')
-        for (let i = 0; i < nameArr.length; i++) {
-          let checkObj = {
-            id: nameArr[i],
-            serialNumber: nameArr[i]
-          }
-          let data = this.checkDataSource
-          let isExist = false
-          for (let j = 0; j < data.length; j++) {
-            if(data[j].serialNumber === nameArr[i]) {
-              isExist = true
-            }
-          }
-          if(isExist) {
-            this.$message.warning('抱歉,序列号' + nameArr[i] + '已经添加过!');
-            return
-          } else {
-            this.checkDataSource.push(checkObj)
-          }
-        }
-        this.queryParam.multiName = ''
       }
-    }
-  }
+      this.queryParam.multiName = ''
+    },
+  },
+}
 </script>
 
 <style lang="less">
-  .ant-table-tbody .ant-table-row td {
-    padding-top: 10px;
-    padding-bottom: 10px;
-  }
+.ant-table-tbody .ant-table-row td {
+  padding-top: 10px;
+  padding-bottom: 10px;
+}
 
-  #components-layout-demo-custom-trigger .trigger {
-    font-size: 18px;
-    line-height: 64px;
-    padding: 0 24px;
-    cursor: pointer;
-    transition: color .3s;
-  }
+#components-layout-demo-custom-trigger .trigger {
+  font-size: 18px;
+  line-height: 64px;
+  padding: 0 24px;
+  cursor: pointer;
+  transition: color 0.3s;
+}
 
-  .table-page-search-wrapper {
-    .ant-form-inline {
-      .ant-form-item {
-        margin-bottom: 12px;
-        margin-right: 0;
-      }
+.table-page-search-wrapper {
+  .ant-form-inline {
+    .ant-form-item {
+      margin-bottom: 12px;
+      margin-right: 0;
     }
-
   }
-</style>
+}
+</style>

+ 258 - 253
jshERP-web/src/components/jeecgbiz/modal/JSelectSnModal.vue

@@ -6,8 +6,9 @@
     @ok="handleSubmit"
     @cancel="close"
     cancelText="关闭"
-    style="top:12%;height: 90%;overflow-y: hidden"
-    wrapClassName="ant-modal-cust-warp">
+    style="top: 12%; height: 90%; overflow-y: hidden"
+    wrapClassName="ant-modal-cust-warp"
+  >
     <a-row :gutter="10" style="padding: 10px; margin: -10px">
       <a-col :md="16" :sm="24">
         <!-- 查询区域 -->
@@ -20,7 +21,7 @@
                   <a-input ref="name" placeholder="请输入序列号并回车" v-model="queryParam.name"></a-input>
                 </a-form-item>
               </a-col>
-              <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
                 <a-col :md="12" :sm="24">
                   <a-button type="primary" @click="onSearch">查询</a-button>
                   <a-button style="margin-left: 8px" type="primary" @click="checkAll">全选</a-button>
@@ -32,7 +33,7 @@
         </div>
       </a-col>
       <a-col :md="8" :sm="24">
-        <span style="font-size: 16px;font-weight: bold;">此处为已选中的序列号列表</span>
+        <span style="font-size: 16px; font-weight: bold">此处为已选中的序列号列表</span>
         <a-button style="margin-left: 8px" @click="clearAllSn">清空</a-button>
       </a-col>
     </a-row>
@@ -40,7 +41,7 @@
       <a-col :md="16" :sm="24">
         <a-table
           ref="table"
-          style="width:95%"
+          style="width: 95%"
           :scroll="scrollTrigger"
           size="middle"
           rowKey="id"
@@ -48,9 +49,10 @@
           :dataSource="dataSource"
           :pagination="ipagination"
           :loading="loading"
-          @change="handleTableChange">
+          @change="handleTableChange"
+        >
           <span slot="action" slot-scope="text, record">
-              <a @click="checkSn(record)">选中</a>
+            <a @click="checkSn(record)">选中</a>
           </span>
         </a-table>
       </a-col>
@@ -64,10 +66,11 @@
           :dataSource="checkDataSource"
           :pagination="false"
           :loading="loading"
-          @change="handleTableChange">
-           <span slot="action" slot-scope="text, record">
-              <a @click="removeSn(record)">移除</a>
-           </span>
+          @change="handleTableChange"
+        >
+          <span slot="action" slot-scope="text, record">
+            <a @click="removeSn(record)">移除</a>
+          </span>
         </a-table>
       </a-col>
     </a-row>
@@ -75,280 +78,282 @@
 </template>
 
 <script>
-  import { getAction } from '@/api/manage'
-  import {getEnableSerialNumberList} from '@/api/api'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { getAction } from '@/api/manage'
+import { getEnableSerialNumberList } from '@/api/api'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 
-  export default {
-    name: 'JSelectSnModal',
-    mixins:[JeecgListMixin],
-    components: {},
-    props: ['rows', 'multi', 'barCode'],
-    data() {
-      return {
-        modalWidth: 1000,
-        queryParam: {
-          name: "",
-          depotItemId: '',
-          depotId: '',
-          barCode: ''
-        },
-        labelCol: {
-          xs: { span: 24 },
-          sm: { span: 5 },
-        },
-        wrapperCol: {
-          xs: { span: 24 },
-          sm: { span: 16 },
-        },
-        categoryTree:[],
-        leftColumns: [
-          {dataIndex: 'serialNumber', title: '序列号', width: 100, align: 'left'},
-          {dataIndex: 'inBillNo', title: '入库单号', width: 100, align: 'left'},
-          {dataIndex: 'createTimeStr', title: '创建时间', width: 100, align: 'left'},
-          {dataIndex: 'action', title: '操作', align:"center", width: 50, scopedSlots: { customRender: 'action' }}
-        ],
-        rightColumns: [
-          {dataIndex: 'serialNumber', title: '序列号', width: 100, align: 'left'},
-          {tdataIndex: 'action', title: '操作', align:"center", width: 50, scopedSlots: { customRender: 'action' }}
-        ],
-        scrollTrigger: {y: 460},
-        dataSource: [],
-        checkDataSource: [],
-        selectedRowKeys: [],
-        selectRows: [],
-        selectIds: [],
-        title: '选择序列号',
-        ipagination: {
-          current: 1,
-          pageSize: 10,
-          pageSizeOptions: ['10', '20', '30', '100', '200'],
-          showTotal: (total, range) => {
-            return range[0] + '-' + range[1] + ' 共' + total + '条'
-          },
-          showQuickJumper: true,
-          showSizeChanger: true,
-          total: 0
-        },
-        isorter: {
-          column: 'createTime',
-          order: 'desc'
+export default {
+  name: 'JSelectSnModal',
+  mixins: [JeecgListMixin],
+  components: {},
+  props: ['rows', 'multi', 'barCode'],
+  data() {
+    return {
+      modalWidth: 1000,
+      queryParam: {
+        name: '',
+        depotItemId: '',
+        depotId: '',
+        barCode: '',
+      },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      categoryTree: [],
+      leftColumns: [
+        { dataIndex: 'serialNumber', title: '序列号', width: 100, align: 'left' },
+        { dataIndex: 'inBillNo', title: '入库单号', width: 100, align: 'left' },
+        { dataIndex: 'createTimeStr', title: '创建时间', width: 100, align: 'left' },
+        { dataIndex: 'action', title: '操作', align: 'center', width: 50, scopedSlots: { customRender: 'action' } },
+      ],
+      rightColumns: [
+        { dataIndex: 'serialNumber', title: '序列号', width: 100, align: 'left' },
+        { tdataIndex: 'action', title: '操作', align: 'center', width: 50, scopedSlots: { customRender: 'action' } },
+      ],
+      scrollTrigger: { y: 460 },
+      dataSource: [],
+      checkDataSource: [],
+      selectedRowKeys: [],
+      selectRows: [],
+      selectIds: [],
+      title: '选择序列号',
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ['10', '20', '30', '100', '200'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 共' + total + '条'
         },
-        departTree: [],
-        depotList: [],
-        visible: false,
-        form: this.$form.createForm(this),
-        loading: false,
-        expandedKeys: [],
-      }
-    },
-    computed: {
-      // 计算属性的 getter
-      getType: function () {
-        return this.multi == true ? 'checkbox' : 'radio';
-      }
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0,
+      },
+      isorter: {
+        column: 'createTime',
+        order: 'desc',
+      },
+      departTree: [],
+      depotList: [],
+      visible: false,
+      form: this.$form.createForm(this),
+      loading: false,
+      expandedKeys: [],
+    }
+  },
+  computed: {
+    // 计算属性的 getter
+    getType: function () {
+      return this.multi == true ? 'checkbox' : 'radio'
     },
-    watch: {
-      barCode: {
-        immediate: true,
-        handler() {
-          this.initBarCode()
-        }
+  },
+  watch: {
+    barCode: {
+      immediate: true,
+      handler() {
+        this.initBarCode()
       },
     },
-    created() {
-      this.loadData()
+  },
+  created() {
+    this.loadData()
+  },
+  methods: {
+    initBarCode() {
+      if (this.barCode) {
+        this.$emit('initComp', this.barCode)
+      } else {
+        this.$emit('initComp', '')
+      }
     },
-    methods: {
-      initBarCode() {
-        if (this.barCode) {
-          this.$emit('initComp', this.barCode)
-        } else {
-          this.$emit('initComp', '')
-        }
-      },
-      loadData(arg) {
-        if(this.rows) {
-          if(JSON.parse(this.rows).depotId && JSON.parse(this.rows).barCode ){
-            let depotItemId = JSON.parse(this.rows).id
-            if(depotItemId.length<=19) {
-              this.queryParam.depotItemId = depotItemId-0
-            }
-            this.queryParam.depotId = JSON.parse(this.rows).depotId-0
-            this.queryParam.barCode = JSON.parse(this.rows).barCode
+    loadData(arg) {
+      if (this.rows) {
+        if (JSON.parse(this.rows).depotId && JSON.parse(this.rows).barCode) {
+          let depotItemId = JSON.parse(this.rows).id
+          if (depotItemId.length <= 19) {
+            this.queryParam.depotItemId = depotItemId - 0
           }
+          this.queryParam.depotId = JSON.parse(this.rows).depotId - 0
+          this.queryParam.barCode = JSON.parse(this.rows).barCode
         }
-        if (arg === 1) {
-          this.ipagination.current = 1;
-        }
-        this.loading = true
-        let params = this.getQueryParams()//查询条件
-        getEnableSerialNumberList(params).then((res) => {
+      }
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      this.loading = true
+      let params = this.getQueryParams() //查询条件
+      getEnableSerialNumberList(params)
+        .then((res) => {
           if (res && res.code === 200) {
             this.dataSource = res.data.rows
             this.ipagination.total = res.data.total
-            if(res.data.total ===1) {
-              if(this.queryParam.name === this.dataSource[0].serialNumber) {
+            if (res.data.total === 1) {
+              if (this.queryParam.name === this.dataSource[0].serialNumber) {
                 let obj = {
                   id: this.dataSource[0].id,
-                  serialNumber: this.dataSource[0].serialNumber
+                  serialNumber: this.dataSource[0].serialNumber,
                 }
                 this.checkSn(obj)
                 this.queryParam.name = ''
               }
             }
           }
-        }).finally(() => {
+        })
+        .finally(() => {
           this.loading = false
         })
-      },
-      showModal() {
-        this.visible = true
-        this.$nextTick(() => this.$refs.name.focus())
-        this.loadData()
-        this.form.resetFields()
-        //加载存在的序列号
-        if(this.rows) {
-          this.checkDataSource = []
-          let rowObj = JSON.parse(this.rows)
-          let snArr = rowObj.snList.split(',')
-          for (let i = 0; i < snArr.length; i++) {
-            let snObj = {
-              'id': snArr[i],
-              'serialNumber': snArr[i]
-            }
-            this.checkDataSource.push(snObj)
-          }
-        }
-      },
-      getQueryParams() {
-        let param = Object.assign({}, this.queryParam, this.isorter);
-        param.page = this.ipagination.current;
-        param.rows = this.ipagination.pageSize;
-        return param;
-      },
-      getQueryField() {
-        let str = 'id,';
-        for (let a = 0; a < this.columns.length; a++) {
-          str += ',' + this.columns[a].dataIndex;
-        }
-        return str;
-      },
-      checkAll() {
-        this.checkDataSource = []
-        let data = this.dataSource
-        for (let i = 0; i < data.length; i++) {
-          let checkObj = {
-            id: data[i].id,
-            serialNumber: data[i].serialNumber
-          }
-          this.checkDataSource.push(checkObj)
-        }
-      },
-      clearAllSn() {
+    },
+    showModal() {
+      this.visible = true
+      this.$nextTick(() => this.$refs.name.focus())
+      this.loadData()
+      this.form.resetFields()
+      //加载存在的序列号
+      if (this.rows) {
         this.checkDataSource = []
-      },
-      searchReset(num) {
-        let that = this;
-        if (num !== 0) {
-          if(this.rows) {
-            this.queryParam.name=''
-            if(JSON.parse(this.rows).depotId && JSON.parse(this.rows).barCode ){
-              let depotItemId = JSON.parse(this.rows).id
-              if(depotItemId.length<=19) {
-                this.queryParam.depotItemId = depotItemId-0
-              }
-              this.queryParam.depotId = JSON.parse(this.rows).depotId-0
-              this.queryParam.barCode = JSON.parse(this.rows).barCode
-            }
+        let rowObj = JSON.parse(this.rows)
+        let snArr = rowObj.snList.split(',')
+        for (let i = 0; i < snArr.length; i++) {
+          let snObj = {
+            id: snArr[i],
+            serialNumber: snArr[i],
           }
-          that.loadData(1);
-        }
-        that.selectedRowKeys = [];
-        that.selectIds = [];
-      },
-      close() {
-        this.searchReset(0);
-        this.visible = false;
-      },
-      handleTableChange(pagination, filters, sorter) {
-        if (Object.keys(sorter).length > 0) {
-          this.isorter.column = sorter.field;
-          this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc';
+          this.checkDataSource.push(snObj)
         }
-        this.ipagination = pagination;
-        this.loadData();
-      },
-      handleSubmit() {
-        let that = this;
-        this.getSelectRows();
-        that.$emit('ok', that.selectRows, that.selectIds);
-        that.searchReset(0)
-        that.close();
-      },
-      checkSn(record) {
+      }
+    },
+    getQueryParams() {
+      let param = Object.assign({}, this.queryParam, this.isorter)
+      param.page = this.ipagination.current
+      param.rows = this.ipagination.pageSize
+      return param
+    },
+    getQueryField() {
+      let str = 'id,'
+      for (let a = 0; a < this.columns.length; a++) {
+        str += ',' + this.columns[a].dataIndex
+      }
+      return str
+    },
+    checkAll() {
+      this.checkDataSource = []
+      let data = this.dataSource
+      for (let i = 0; i < data.length; i++) {
         let checkObj = {
-          id: record.id,
-          serialNumber: record.serialNumber
+          id: data[i].id,
+          serialNumber: data[i].serialNumber,
         }
-        let data = this.checkDataSource
-        let isExist = false
-        for (let i = 0; i < data.length; i++) {
-          if(data[i].serialNumber === record.serialNumber) {
-            isExist = true
+        this.checkDataSource.push(checkObj)
+      }
+    },
+    clearAllSn() {
+      this.checkDataSource = []
+    },
+    searchReset(num) {
+      let that = this
+      if (num !== 0) {
+        if (this.rows) {
+          this.queryParam.name = ''
+          if (JSON.parse(this.rows).depotId && JSON.parse(this.rows).barCode) {
+            let depotItemId = JSON.parse(this.rows).id
+            if (depotItemId.length <= 19) {
+              this.queryParam.depotItemId = depotItemId - 0
+            }
+            this.queryParam.depotId = JSON.parse(this.rows).depotId - 0
+            this.queryParam.barCode = JSON.parse(this.rows).barCode
           }
         }
-        if(isExist) {
-          this.$message.warning('抱歉,此序列号已经选择过!');
-        } else {
-          this.checkDataSource.push(checkObj)
-        }
-      },
-      removeSn(record) {
-        let oldArr = this.checkDataSource
-        let newArr = []
-        for (let i = 0; i < oldArr.length; i++) {
-          if(oldArr[i].id !== record.id) {
-            newArr.push(oldArr[i])
-          }
+        that.loadData(1)
+      }
+      that.selectedRowKeys = []
+      that.selectIds = []
+    },
+    close() {
+      this.searchReset(0)
+      this.visible = false
+    },
+    handleTableChange(pagination, filters, sorter) {
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field
+        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
+      }
+      this.ipagination = pagination
+      this.loadData()
+    },
+    handleSubmit() {
+      let that = this
+      this.getSelectRows()
+      that.$emit('ok', that.selectRows, that.selectIds)
+      that.searchReset(0)
+      that.close()
+    },
+    checkSn(record) {
+      let checkObj = {
+        id: record.id,
+        serialNumber: record.serialNumber,
+      }
+      let data = this.checkDataSource
+      let isExist = false
+      for (let i = 0; i < data.length; i++) {
+        if (data[i].serialNumber === record.serialNumber) {
+          isExist = true
         }
-        this.checkDataSource = newArr
-      },
-      //获取选择信息
-      getSelectRows() {
-        let ids = ""
-        this.selectRows = this.checkDataSource
-        let data = this.checkDataSource
-        for (let i = 0; i < data.length; i++) {
-          ids = ids + "," + data[i].serialNumber
+      }
+      if (isExist) {
+        this.$message.warning('抱歉,此序列号已经选择过!')
+      } else {
+        this.checkDataSource.push(checkObj)
+      }
+    },
+    removeSn(record) {
+      let oldArr = this.checkDataSource
+      let newArr = []
+      for (let i = 0; i < oldArr.length; i++) {
+        if (oldArr[i].id !== record.id) {
+          newArr.push(oldArr[i])
         }
-        this.selectIds = ids.substring(1)
-      },
-      onSelectChange(selectedRowKeys, selectionRows) {
-        this.selectedRowKeys = selectedRowKeys;
-        this.selectionRows = selectionRows;
-      },
-      onSearch() {
-        this.loadData(1);
-      },
-      modalFormOk() {
-        this.loadData();
       }
-    }
-  }
+      this.checkDataSource = newArr
+    },
+    //获取选择信息
+    getSelectRows() {
+      let ids = ''
+      this.selectRows = this.checkDataSource
+      let data = this.checkDataSource
+      for (let i = 0; i < data.length; i++) {
+        ids = ids + ',' + data[i].serialNumber
+      }
+      this.selectIds = ids.substring(1)
+    },
+    onSelectChange(selectedRowKeys, selectionRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectionRows = selectionRows
+    },
+    onSearch() {
+      this.loadData(1)
+    },
+    modalFormOk() {
+      this.loadData()
+    },
+  },
+}
 </script>
 
 <style scoped>
-  .ant-table-tbody .ant-table-row td {
-    padding-top: 10px;
-    padding-bottom: 10px;
-  }
+.ant-table-tbody .ant-table-row td {
+  padding-top: 10px;
+  padding-bottom: 10px;
+}
 
-  #components-layout-demo-custom-trigger .trigger {
-    font-size: 18px;
-    line-height: 64px;
-    padding: 0 24px;
-    cursor: pointer;
-    transition: color .3s;
-  }
-</style>
+#components-layout-demo-custom-trigger .trigger {
+  font-size: 18px;
+  line-height: 64px;
+  padding: 0 24px;
+  cursor: pointer;
+  transition: color 0.3s;
+}
+</style>

+ 215 - 215
jshERP-web/src/components/jeecgbiz/modal/JSelectUserByDepModal.vue

@@ -17,7 +17,7 @@
             selectable
             :selectedKeys="selectedDepIds"
             :checkStrictly="true"
-            :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
+            :dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
             :treeData="departTree"
             :expandAction="false"
             :expandedKeys.sync="expandedKeys"
@@ -28,7 +28,7 @@
         <a-card :bordered="false">
           用户账号:
           <a-input-search
-            :style="{width:'150px',marginBottom:'15px'}"
+            :style="{ width: '150px', marginBottom: '15px' }"
             placeholder="请输入账号"
             v-model="queryParam.username"
             @search="onSearch"
@@ -43,9 +43,10 @@
             :columns="columns"
             :dataSource="dataSource"
             :pagination="ipagination"
-            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type: getType}"
+            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: getType }"
             :loading="loading"
-            @change="handleTableChange">
+            @change="handleTableChange"
+          >
           </a-table>
         </a-card>
       </a-col>
@@ -54,233 +55,232 @@
 </template>
 
 <script>
-  import {filterObj} from '@/utils/util'
-  import {getUserList, queryUserByDepId} from '@/api/api'
+import { filterObj } from '@/utils/util'
+import { getUserList, queryUserByDepId } from '@/api/api'
 
-  export default {
-    name: 'JSelectUserByDepModal',
-    components: {},
-    props: ['modalWidth', 'multi', 'userIds'],
-    data() {
-      return {
-        queryParam: {
-          username: "",
+export default {
+  name: 'JSelectUserByDepModal',
+  components: {},
+  props: ['modalWidth', 'multi', 'userIds'],
+  data() {
+    return {
+      queryParam: {
+        username: '',
+      },
+      columns: [
+        {
+          title: '用户账号',
+          align: 'center',
+          dataIndex: 'username',
         },
-        columns: [
-          {
-            title: '用户账号',
-            align: 'center',
-            dataIndex: 'username'
-          },
-          {
-            title: '用户姓名',
-            align: 'center',
-            dataIndex: 'realname'
-          },
-          {
-            title: '性别',
-            align: 'center',
-            dataIndex: 'sex',
-            customRender: function (text) {
-              if (text === 1) {
-                return '男'
-              } else if (text === 2) {
-                return '女'
-              } else {
-                return text
-              }
+        {
+          title: '用户姓名',
+          align: 'center',
+          dataIndex: 'realname',
+        },
+        {
+          title: '性别',
+          align: 'center',
+          dataIndex: 'sex',
+          customRender: function (text) {
+            if (text === 1) {
+              return '男'
+            } else if (text === 2) {
+              return '女'
+            } else {
+              return text
             }
           },
-          {
-            title: '手机',
-            align: 'center',
-            dataIndex: 'phone'
-          },
-          {
-            title: '部门',
-            align: 'center',
-            dataIndex: 'orgCode'
-          }
-        ],
-        scrollTrigger: {},
-        dataSource: [],
-        selectedRowKeys: [],
-        selectUserRows: [],
-        selectUserIds: [],
-        title: '根据部门选择用户',
-        ipagination: {
-          current: 1,
-          pageSize: 10,
-          pageSizeOptions: ['10', '20', '30'],
-          showTotal: (total, range) => {
-            return range[0] + '-' + range[1] + ' 共' + total + '条'
-          },
-          showQuickJumper: true,
-          showSizeChanger: true,
-          total: 0
         },
-        isorter: {
-          column: 'createTime',
-          order: 'desc'
+        {
+          title: '手机',
+          align: 'center',
+          dataIndex: 'phone',
+        },
+        {
+          title: '部门',
+          align: 'center',
+          dataIndex: 'orgCode',
         },
-        selectedDepIds: [],
-        departTree: [],
-        visible: false,
-        form: this.$form.createForm(this),
-        loading: false,
-        expandedKeys: [],
+      ],
+      scrollTrigger: {},
+      dataSource: [],
+      selectedRowKeys: [],
+      selectUserRows: [],
+      selectUserIds: [],
+      title: '根据部门选择用户',
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ['10', '20', '30'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 共' + total + '条'
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0,
+      },
+      isorter: {
+        column: 'createTime',
+        order: 'desc',
+      },
+      selectedDepIds: [],
+      departTree: [],
+      visible: false,
+      form: this.$form.createForm(this),
+      loading: false,
+      expandedKeys: [],
+    }
+  },
+  computed: {
+    // 计算属性的 getter
+    getType: function () {
+      return this.multi == true ? 'checkbox' : 'radio'
+    },
+  },
+  watch: {
+    userIds: {
+      immediate: true,
+      handler() {
+        this.initUserNames()
+      },
+    },
+  },
+  created() {
+    // 该方法触发屏幕自适应
+    this.resetScreenSize()
+    this.loadData()
+  },
+  methods: {
+    initUserNames() {
+      if (this.userIds) {
+        // 这里最后加一个 , 的原因是因为无论如何都要使用 in 查询,防止后台进行了模糊匹配,导致查询结果不准确
+        let values = this.userIds.split(',') + ','
+        getUserList({
+          username: values,
+          pageNo: 1,
+          pageSize: values.length,
+        }).then((res) => {
+          if (res.success) {
+            let selectedRowKeys = []
+            let realNames = []
+            res.result.records.forEach((user) => {
+              realNames.push(user['realname'])
+              selectedRowKeys.push(user['id'])
+            })
+            this.selectedRowKeys = selectedRowKeys
+            this.$emit('initComp', realNames.join(','))
+          }
+        })
+      } else {
+        // JSelectUserByDep组件bug issues/I16634
+        this.$emit('initComp', '')
       }
     },
-    computed: {
-      // 计算属性的 getter
-      getType: function () {
-        return this.multi == true ? 'checkbox' : 'radio';
+    async loadData(arg) {
+      if (arg === 1) {
+        this.ipagination.current = 1
       }
     },
-    watch: {
-      userIds: {
-        immediate: true,
-        handler() {
-          this.initUserNames()
-        }
-      },
+    // 触发屏幕自适应
+    resetScreenSize() {
+      let screenWidth = document.body.clientWidth
+      if (screenWidth < 500) {
+        this.scrollTrigger = { x: 800 }
+      } else {
+        this.scrollTrigger = {}
+      }
     },
-    created() {
-      // 该方法触发屏幕自适应
-      this.resetScreenSize();
+    showModal() {
+      this.visible = true
+      this.queryDepartTree()
+      this.initUserNames()
       this.loadData()
+      this.form.resetFields()
     },
-    methods: {
-      initUserNames() {
-        if (this.userIds) {
-          // 这里最后加一个 , 的原因是因为无论如何都要使用 in 查询,防止后台进行了模糊匹配,导致查询结果不准确
-          let values = this.userIds.split(',') + ','
-          getUserList({
-            username: values,
-            pageNo: 1,
-            pageSize: values.length
-          }).then((res) => {
-            if (res.success) {
-              let selectedRowKeys = []
-              let realNames = []
-              res.result.records.forEach(user => {
-                realNames.push(user['realname'])
-                selectedRowKeys.push(user['id'])
-              })
-              this.selectedRowKeys = selectedRowKeys
-              this.$emit('initComp', realNames.join(','))
-            }
-          })
-        } else {
-          // JSelectUserByDep组件bug issues/I16634
-          this.$emit('initComp', '')
-        }
-      },
-      async loadData(arg) {
-        if (arg === 1) {
-          this.ipagination.current = 1;
-        }
-      },
-      // 触发屏幕自适应
-      resetScreenSize() {
-        let screenWidth = document.body.clientWidth;
-        if (screenWidth < 500) {
-          this.scrollTrigger = {x: 800};
-        } else {
-          this.scrollTrigger = {};
-        }
-      },
-      showModal() {
-        this.visible = true;
-        this.queryDepartTree();
-        this.initUserNames()
-        this.loadData();
-        this.form.resetFields();
-      },
-      getQueryParams() {
-        let param = Object.assign({}, this.queryParam, this.isorter);
-        param.field = this.getQueryField();
-        param.pageNo = this.ipagination.current;
-        param.pageSize = this.ipagination.pageSize;
-        return filterObj(param);
-      },
-      getQueryField() {
-        let str = 'id,';
-        for (let a = 0; a < this.columns.length; a++) {
-          str += ',' + this.columns[a].dataIndex;
-        }
-        return str;
-      },
-      searchReset(num) {
-        let that = this;
-        if (num !== 0) {
-          that.queryParam = {};
-          that.loadData(1);
-        }
-        that.selectedRowKeys = [];
-        that.selectUserIds = [];
-        that.selectedDepIds = [];
-      },
-      close() {
-        this.searchReset(0);
-        this.visible = false;
-      },
-      handleTableChange(pagination, filters, sorter) {
-        //TODO 筛选
-        if (Object.keys(sorter).length > 0) {
-          this.isorter.column = sorter.field;
-          this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc';
-        }
-        this.ipagination = pagination;
-        this.loadData();
-      },
-      handleSubmit() {
-        let that = this;
-        this.getSelectUserRows();
-        that.$emit('ok', that.selectUserRows, that.selectUserIds);
-        that.searchReset(0)
-        that.close();
-      },
-      //获取选择用户信息
-      getSelectUserRows(rowId) {
-        let dataSource = this.dataSource;
-        let userIds = "";
-        this.selectUserRows = [];
-        for (let i = 0, len = dataSource.length; i < len; i++) {
-          if (this.selectedRowKeys.includes(dataSource[i].id)) {
-            this.selectUserRows.push(dataSource[i]);
-            userIds = userIds + "," + dataSource[i].username
-          }
+    getQueryParams() {
+      let param = Object.assign({}, this.queryParam, this.isorter)
+      param.field = this.getQueryField()
+      param.pageNo = this.ipagination.current
+      param.pageSize = this.ipagination.pageSize
+      return filterObj(param)
+    },
+    getQueryField() {
+      let str = 'id,'
+      for (let a = 0; a < this.columns.length; a++) {
+        str += ',' + this.columns[a].dataIndex
+      }
+      return str
+    },
+    searchReset(num) {
+      let that = this
+      if (num !== 0) {
+        that.queryParam = {}
+        that.loadData(1)
+      }
+      that.selectedRowKeys = []
+      that.selectUserIds = []
+      that.selectedDepIds = []
+    },
+    close() {
+      this.searchReset(0)
+      this.visible = false
+    },
+    handleTableChange(pagination, filters, sorter) {
+      //TODO 筛选
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field
+        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
+      }
+      this.ipagination = pagination
+      this.loadData()
+    },
+    handleSubmit() {
+      let that = this
+      this.getSelectUserRows()
+      that.$emit('ok', that.selectUserRows, that.selectUserIds)
+      that.searchReset(0)
+      that.close()
+    },
+    //获取选择用户信息
+    getSelectUserRows(rowId) {
+      let dataSource = this.dataSource
+      let userIds = ''
+      this.selectUserRows = []
+      for (let i = 0, len = dataSource.length; i < len; i++) {
+        if (this.selectedRowKeys.includes(dataSource[i].id)) {
+          this.selectUserRows.push(dataSource[i])
+          userIds = userIds + ',' + dataSource[i].username
         }
-        this.selectUserIds = userIds.substring(1);
-      },
-      onSelectChange(selectedRowKeys, selectionRows) {
-        this.selectedRowKeys = selectedRowKeys;
-        this.selectionRows = selectionRows;
-      },
-      onSearch() {
-        this.loadData(1);
-      },
-      queryDepartTree() {
-      },
-      modalFormOk() {
-        this.loadData();
       }
-    }
-  }
+      this.selectUserIds = userIds.substring(1)
+    },
+    onSelectChange(selectedRowKeys, selectionRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectionRows = selectionRows
+    },
+    onSearch() {
+      this.loadData(1)
+    },
+    queryDepartTree() {},
+    modalFormOk() {
+      this.loadData()
+    },
+  },
+}
 </script>
 
 <style scoped>
-  .ant-table-tbody .ant-table-row td {
-    padding-top: 10px;
-    padding-bottom: 10px;
-  }
+.ant-table-tbody .ant-table-row td {
+  padding-top: 10px;
+  padding-bottom: 10px;
+}
 
-  #components-layout-demo-custom-trigger .trigger {
-    font-size: 18px;
-    line-height: 64px;
-    padding: 0 24px;
-    cursor: pointer;
-    transition: color .3s;
-  }
-</style>
+#components-layout-demo-custom-trigger .trigger {
+  font-size: 18px;
+  line-height: 64px;
+  padding: 0 24px;
+  cursor: pointer;
+  transition: color 0.3s;
+}
+</style>

+ 91 - 93
jshERP-web/src/components/jeecgbiz/modal/SelectUserListModal.vue

@@ -5,8 +5,8 @@
     :visible="visible"
     :confirmLoading="confirmLoading"
     @ok="handleSubmit"
-    @cancel="handleCancel">
-
+    @cancel="handleCancel"
+  >
     <a-table
       ref="table"
       bordered
@@ -16,107 +16,105 @@
       :dataSource="dataSource"
       :pagination="ipagination"
       :loading="loading"
-      :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"></a-table>
+      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+    ></a-table>
   </a-modal>
 </template>
 
 <script>
-  import {getUserList} from '@/api/api'
-  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
+import { getUserList } from '@/api/api'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 
-  export default {
-    name: "SelectUserListModal",
-    mixins: [JeecgListMixin],
-    data() {
-      return {
-        title: "操作",
-        visible: false,
-        model: {},
-        confirmLoading: false,
-        url: {
-          add: "/act/model/create",
-          list: "/sys/user/list"
+export default {
+  name: 'SelectUserListModal',
+  mixins: [JeecgListMixin],
+  data() {
+    return {
+      title: '操作',
+      visible: false,
+      model: {},
+      confirmLoading: false,
+      url: {
+        add: '/act/model/create',
+        list: '/sys/user/list',
+      },
+      columns: [
+        {
+          title: '用户账号',
+          align: 'center',
+          dataIndex: 'username',
+          fixed: 'left',
+          width: 200,
+        },
+        {
+          title: '用户姓名',
+          align: 'center',
+          dataIndex: 'realname',
+        },
+        {
+          title: '性别',
+          align: 'center',
+          dataIndex: 'sex_dictText',
+        },
+        {
+          title: '手机号码',
+          align: 'center',
+          dataIndex: 'phone',
+        },
+        {
+          title: '邮箱',
+          align: 'center',
+          dataIndex: 'email',
         },
-        columns: [
-          {
-            title: '用户账号',
-            align: "center",
-            dataIndex: 'username',
-            fixed: 'left',
-            width: 200
-          },
-          {
-            title: '用户姓名',
-            align: "center",
-            dataIndex: 'realname',
-          },
-          {
-            title: '性别',
-            align: "center",
-            dataIndex: 'sex_dictText'
-          },
-          {
-            title: '手机号码',
-            align: "center",
-            dataIndex: 'phone'
-          },
-          {
-            title: '邮箱',
-            align: "center",
-            dataIndex: 'email'
-          },
-          {
-            title: '状态',
-            align: "center",
-            dataIndex: 'status_dictText'
-          }
-        ]
+        {
+          title: '状态',
+          align: 'center',
+          dataIndex: 'status_dictText',
+        },
+      ],
+    }
+  },
+  created() {
+    //Step.2 加载用户数据
+    getUserList().then((res) => {
+      if (res.success) {
+        this.dataSource = res.result.records
+        this.ipagination.total = res.result.total
       }
+    })
+  },
+  methods: {
+    open() {
+      this.visible = true
+
+      //Step.1 清空选中用户
+      this.selectedRowKeys = []
+      this.selectedRows = []
     },
-    created() {
-      //Step.2 加载用户数据
-      getUserList().then((res) => {
-        if (res.success) {
-          this.dataSource = res.result.records;
-          this.ipagination.total = res.result.total;
-        }
-      })
+    close() {
+      this.$emit('close')
+      this.visible = false
     },
-    methods: {
-      open() {
-        this.visible = true;
-
-        //Step.1 清空选中用户
-        this.selectedRowKeys = []
-        this.selectedRows = []
-      },
-      close() {
-        this.$emit('close');
-        this.visible = false;
-      },
-      handleChange(info) {
-        let file = info.file;
-        if (file.response.success) {
-          this.$message.success(file.response.message);
-          this.$emit('ok');
-          this.close()
-        } else {
-          this.$message.warn(file.response.message);
-          this.close()
-        }
-
-      },
-      handleCancel() {
+    handleChange(info) {
+      let file = info.file
+      if (file.response.success) {
+        this.$message.success(file.response.message)
+        this.$emit('ok')
         this.close()
-      },
-      handleSubmit() {
-        this.$emit('ok', this.selectionRows);
+      } else {
+        this.$message.warn(file.response.message)
         this.close()
-      },
-    }
-  }
+      }
+    },
+    handleCancel() {
+      this.close()
+    },
+    handleSubmit() {
+      this.$emit('ok', this.selectionRows)
+      this.close()
+    },
+  },
+}
 </script>
 
-<style>
-
-</style>
+<style></style>

+ 29 - 34
jshERP-web/src/components/layouts/BasicLayout.vue

@@ -10,32 +10,27 @@
 </template>
 
 <script>
-  import GlobalLayout from '@/components/page/GlobalLayout'
-
-  export default {
-    name: "BasicLayout",
-    components: {
-      GlobalLayout
-    },
-    data () {
-      return {
-
-      }
-    },
-    computed: {
-      keepAlive () {
-        return this.$route.meta.keepAlive
-      }
+import GlobalLayout from '@/components/page/GlobalLayout'
+
+export default {
+  name: 'BasicLayout',
+  components: {
+    GlobalLayout,
+  },
+  data() {
+    return {}
+  },
+  computed: {
+    keepAlive() {
+      return this.$route.meta.keepAlive
     },
-    methods: {
-
-    },
-  }
+  },
+  methods: {},
+}
 </script>
 
 <style lang="less">
-
-  /*
+/*
  * The following styles are auto-applied to elements with
  * transition="page-transition" when their visibility is toggled
  * by Vue.js.
@@ -44,17 +39,17 @@
  * these styles.
  */
 
-  .page-transition-enter {
-    opacity: 0;
-  }
+.page-transition-enter {
+  opacity: 0;
+}
 
-  .page-transition-leave-active {
-    opacity: 0;
-  }
+.page-transition-leave-active {
+  opacity: 0;
+}
 
-  .page-transition-enter .page-transition-container,
-  .page-transition-leave-active .page-transition-container {
-    -webkit-transform: scale(1.1);
-    transform: scale(1.1);
-  }
-</style>
+.page-transition-enter .page-transition-container,
+.page-transition-leave-active .page-transition-container {
+  -webkit-transform: scale(1.1);
+  transform: scale(1.1);
+}
+</style>

+ 4 - 7
jshERP-web/src/components/layouts/BlankLayout.vue

@@ -5,12 +5,9 @@
 </template>
 
 <script>
-
-  export default {
-    name: "BlankLayout",
-  }
+export default {
+  name: 'BlankLayout',
+}
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 41 - 36
jshERP-web/src/components/layouts/IframeFReportView.vue

@@ -1,47 +1,52 @@
 <template>
-
-    <iframe  :id="id" :src="url" frameborder="0" width="100%" height="800px" scrolling="auto" style="background-color: #fff;"></iframe>
-
+  <iframe
+    :id="id"
+    :src="url"
+    frameborder="0"
+    width="100%"
+    height="800px"
+    scrolling="auto"
+    style="background-color: #fff"
+  ></iframe>
 </template>
 
 <script>
-  import PageLayout from '../page/PageLayout'
-  import RouteView from './RouteView'
+import PageLayout from '../page/PageLayout'
+import RouteView from './RouteView'
 
-  export default {
-    name: "IframePageContent",
-    data () {
-      return {
-        url: "",
-        id:""
-      }
-    },
-    created () {
-      this.goUrl()
-    },
-    updated () {
+export default {
+  name: 'IframePageContent',
+  data() {
+    return {
+      url: '',
+      id: '',
+    }
+  },
+  created() {
+    this.goUrl()
+  },
+  updated() {
+    this.goUrl()
+  },
+  watch: {
+    $route(to, from) {
       this.goUrl()
     },
-    watch: {
-      $route(to, from) {
-        this.goUrl();
+  },
+  methods: {
+    goUrl() {
+      let url = this.$route.meta.url
+      let id = this.$route.path
+      this.id = id
+      //url = "http://www.baidu.com"
+      console.log('------url------' + url)
+      if (url !== null && url !== undefined) {
+        this.url = url
+        //window.open(this.url);
       }
     },
-    methods: {
-      goUrl () {
-        let url = this.$route.meta.url
-        let id = this.$route.path
-        this.id = id
-        //url = "http://www.baidu.com"
-        console.log("------url------"+url)
-        if (url !== null && url !== undefined) {
-          this.url = url;
-          //window.open(this.url);
-        }
-      }
-    }
-  }
+  },
+}
 </script>
 
-<style>
-</style>
+<style></style>

+ 38 - 39
jshERP-web/src/components/layouts/IframePageView.vue

@@ -1,50 +1,49 @@
 <template>
-    <iframe :id="id" :src="url" frameborder="0" width="100%" :height="height" scrolling="auto"></iframe>
+  <iframe :id="id" :src="url" frameborder="0" width="100%" :height="height" scrolling="auto"></iframe>
 </template>
 
 <script>
-  import {mixinDevice} from '@/utils/mixin.js'
+import { mixinDevice } from '@/utils/mixin.js'
 
-  export default {
-    name: "IframePageContent",
-    inject:['closeCurrent'],
-    mixins: [mixinDevice],
-    data () {
-      return {
-        url: "",
-        id:"",
-        height: ""
+export default {
+  name: 'IframePageContent',
+  inject: ['closeCurrent'],
+  mixins: [mixinDevice],
+  data() {
+    return {
+      url: '',
+      id: '',
+      height: '',
+    }
+  },
+  created() {
+    this.goUrl()
+  },
+  methods: {
+    goUrl() {
+      let url = this.$route.meta.url
+      this.id = this.$route.path
+      if (this.isMobile()) {
+        this.height = 800
+      } else {
+        this.height = document.documentElement.clientHeight - 100
       }
-    },
-    created () {
-      this.goUrl()
-    },
-    methods: {
-      goUrl () {
-        let url = this.$route.meta.url
-        this.id = this.$route.path
-        if (this.isMobile()) {
-          this.height = 800
-        } else {
-          this.height = document.documentElement.clientHeight-100
-        }
-        console.log("------url------"+url)
-        if (url !== null && url !== undefined) {
-          if(url) {
-            url = url.replace('/system','')
-            if(url.indexOf('.html') === -1) {
-              //地址不以.html结尾的,需要重新构造url
-              let urlArr = url.split('/')
-              url = '/' + urlArr[1] + '/' + urlArr[2] + '/' + urlArr[2] + '.html?t=' + urlArr[3]
-            }
-            url = document.location.protocol + '//' + window.location.host + url
+      console.log('------url------' + url)
+      if (url !== null && url !== undefined) {
+        if (url) {
+          url = url.replace('/system', '')
+          if (url.indexOf('.html') === -1) {
+            //地址不以.html结尾的,需要重新构造url
+            let urlArr = url.split('/')
+            url = '/' + urlArr[1] + '/' + urlArr[2] + '/' + urlArr[2] + '.html?t=' + urlArr[3]
           }
-          this.url = url
+          url = document.location.protocol + '//' + window.location.host + url
         }
+        this.url = url
       }
-    }
-  }
+    },
+  },
+}
 </script>
 
-<style>
-</style>
+<style></style>

+ 58 - 60
jshERP-web/src/components/layouts/PageView.vue

@@ -1,7 +1,7 @@
 <template>
   <page-layout :desc="description" :title="getTitle" :link-list="linkList" :search="search" :tabs="tabs">
     <div slot="extra" class="extra-img">
-      <img :src="extraImage"/>
+      <img :src="extraImage" />
     </div>
     <!-- keep-alive  -->
     <route-view ref="content"></route-view>
@@ -9,77 +9,75 @@
 </template>
 
 <script>
-  import PageLayout from '../page/PageLayout'
-  import RouteView from './RouteView'
+import PageLayout from '../page/PageLayout'
+import RouteView from './RouteView'
 
-  export default {
-    name: "PageContent",
-    components: {
-      RouteView,
-      PageLayout
-    },
-    data () {
-      return {
-        title: '',
-        description: '',
-        linkList: [],
-        extraImage: '',
-        search: false,
-        tabs: {}
-      }
-    },
-    mounted () {
-      this.getPageHeaderInfo()
-    },
-    updated () {
-      this.getPageHeaderInfo()
+export default {
+  name: 'PageContent',
+  components: {
+    RouteView,
+    PageLayout,
+  },
+  data() {
+    return {
+      title: '',
+      description: '',
+      linkList: [],
+      extraImage: '',
+      search: false,
+      tabs: {},
+    }
+  },
+  mounted() {
+    this.getPageHeaderInfo()
+  },
+  updated() {
+    this.getPageHeaderInfo()
+  },
+  computed: {
+    getTitle() {
+      return this.$route.meta.title
     },
-    computed: {
+  },
+  methods: {
+    getPageHeaderInfo() {
+      // eslint-disable-next-line
+      this.title = this.$route.meta.title
+      // 因为套用了一层 route-view 所以要取 ref 对象下的子节点的第一个对象
+      const content = this.$refs.content && this.$refs.content.$children[0]
 
-      getTitle () {
-        return this.$route.meta.title
+      if (content) {
+        this.description = content.description
+        this.linkList = content.linkList
+        this.extraImage = content.extraImage
+        this.search = content.search == true ? true : false
+        this.tabs = content.tabs
       }
-
     },
-    methods: {
-      getPageHeaderInfo () {
-        // eslint-disable-next-line
-        this.title = this.$route.meta.title
-        // 因为套用了一层 route-view 所以要取 ref 对象下的子节点的第一个对象
-        const content = this.$refs.content && this.$refs.content.$children[0]
-
-        if (content) {
-          this.description = content.description
-          this.linkList = content.linkList
-          this.extraImage = content.extraImage
-          this.search = content.search == true ? true : false
-          this.tabs = content.tabs
-        }
-      }
-    }
-  }
+  },
+}
 </script>
 
 <style lang="less" scoped>
+.extra-img {
+  margin-top: -60px;
+  text-align: center;
+  width: 195px;
+
+  img {
+    width: 100%;
+  }
+}
+
+.mobile {
   .extra-img {
-    margin-top: -60px;
+    margin-top: 0;
     text-align: center;
-    width: 195px;
+    width: 96px;
 
     img {
       width: 100%;
     }
   }
-
-  .mobile {
-    .extra-img{
-      margin-top: 0;
-      text-align: center;
-      width: 96px;
-
-      img{
-        width: 100%;
-      }
-    }
-  }
-</style>
+}
+</style>

+ 9 - 9
jshERP-web/src/components/layouts/RouteView.vue

@@ -8,12 +8,12 @@
 </template>
 
 <script>
-  export default {
-    name: "RouteView",
-    computed: {
-      keepAlive () {
-        return this.$route.meta.keepAlive
-      }
-    }
-  }
-</script>
+export default {
+  name: 'RouteView',
+  computed: {
+    keepAlive() {
+      return this.$route.meta.keepAlive
+    },
+  },
+}
+</script>

+ 388 - 390
jshERP-web/src/components/layouts/TabLayout.vue

@@ -1,8 +1,8 @@
 <template>
   <global-layout @dynamicRouterShow="dynamicRouterShow">
-    <contextmenu :itemList="menuItemList" :visible.sync="menuVisible" style="z-index: 9999;" @select="onMenuSelect"/>
+    <contextmenu :itemList="menuItemList" :visible.sync="menuVisible" style="z-index: 9999" @select="onMenuSelect" />
     <a-tabs
-      @contextmenu.native="e => onContextmenu(e)"
+      @contextmenu.native="(e) => onContextmenu(e)"
       v-if="multipage"
       :active-key="activePage"
       class="tab-layout-tabs"
@@ -10,12 +10,13 @@
       type="editable-card"
       @change="changePage"
       @tabClick="tabCallBack"
-      @edit="editPage">
+      @edit="editPage"
+    >
       <a-tab-pane :id="page.fullPath" :key="page.fullPath" v-for="page in pageList">
         <span slot="tab" :pagekey="page.fullPath">{{ page.meta.title }}</span>
       </a-tab-pane>
     </a-tabs>
-    <div style="margin: 4px 4px 0;">
+    <div style="margin: 4px 4px 0">
       <transition name="page-toggle">
         <keep-alive v-if="multipage" :include="includedComponents">
           <router-view />
@@ -29,442 +30,439 @@
         v-for="item in hasOpenComponentsArr"
         :key="item.name"
         :is="item.name"
-        v-show="$route.path === item.path">
+        v-show="$route.path === item.path"
+      >
       </component>
     </div>
   </global-layout>
 </template>
 
 <script>
-  import GlobalLayout from '@/components/page/GlobalLayout'
-  import Contextmenu from '@/components/menu/Contextmenu'
-  import { mixin, mixinDevice } from '@/utils/mixin.js'
-  import { triggerWindowResizeEvent } from '@/utils/util'
-  const indexKey = '/dashboard/analysis'
-  import Vue from 'vue'
-  import { CACHE_INCLUDED_ROUTES } from "@/store/mutation-types"
-  import store from '../../store'
+import GlobalLayout from '@/components/page/GlobalLayout'
+import Contextmenu from '@/components/menu/Contextmenu'
+import { mixin, mixinDevice } from '@/utils/mixin.js'
+import { triggerWindowResizeEvent } from '@/utils/util'
+const indexKey = '/dashboard/analysis'
+import Vue from 'vue'
+import { CACHE_INCLUDED_ROUTES } from '@/store/mutation-types'
+import store from '../../store'
 
-  export default {
-    name: 'TabLayout',
-    components: {
-      GlobalLayout,
-      Contextmenu
-    },
-    mixins: [mixin, mixinDevice],
-    data() {
-      return {
-        pageList: [],
-        linkList: [],
-        activePage: '',
-        menuVisible: false,
-        menuItemList: [
-          { key: '1', icon: 'arrow-left', text: '关闭左侧' },
-          { key: '2', icon: 'arrow-right', text: '关闭右侧' },
-          { key: '3', icon: 'close', text: '关闭其它' }
-        ],
-        componentsArr: []
-      }
+export default {
+  name: 'TabLayout',
+  components: {
+    GlobalLayout,
+    Contextmenu,
+  },
+  mixins: [mixin, mixinDevice],
+  data() {
+    return {
+      pageList: [],
+      linkList: [],
+      activePage: '',
+      menuVisible: false,
+      menuItemList: [
+        { key: '1', icon: 'arrow-left', text: '关闭左侧' },
+        { key: '2', icon: 'arrow-right', text: '关闭右侧' },
+        { key: '3', icon: 'close', text: '关闭其它' },
+      ],
+      componentsArr: [],
+    }
+  },
+  provide() {
+    return {
+      closeCurrent: this.closeCurrent,
+    }
+  },
+  computed: {
+    // 实现懒加载,只渲染已经打开过(hasOpen:true)的iframe页
+    hasOpenComponentsArr() {
+      return this.componentsArr.filter((item) => item.hasOpen)
     },
-    provide(){
-      return{
-        closeCurrent:this.closeCurrent
+    multipage() {
+      //判断如果是手机模式,自动切换为单页面模式
+      if (this.isMobile()) {
+        return false
+      } else {
+        return this.$store.state.app.multipage
       }
     },
-    computed: {
-      // 实现懒加载,只渲染已经打开过(hasOpen:true)的iframe页
-      hasOpenComponentsArr() {
-        return this.componentsArr.filter(item => item.hasOpen)
-      },
-      multipage() {
-        //判断如果是手机模式,自动切换为单页面模式
-        if (this.isMobile()) {
-          return false
-        } else {
-          return this.$store.state.app.multipage
-        }
-      },
-      includedComponents() {
-        const includedRouters = Vue.ls.get(CACHE_INCLUDED_ROUTES)
-        //加入到 cache_included_routes
-        if (this.$route.meta.componentName) {
-          let cacheRouterArray = Vue.ls.get(CACHE_INCLUDED_ROUTES) || []
-          if(!cacheRouterArray.includes(this.$route.meta.componentName)){
-            cacheRouterArray.push(this.$route.meta.componentName)
-            Vue.ls.set(CACHE_INCLUDED_ROUTES, cacheRouterArray)
-            return cacheRouterArray;
-          }
+    includedComponents() {
+      const includedRouters = Vue.ls.get(CACHE_INCLUDED_ROUTES)
+      //加入到 cache_included_routes
+      if (this.$route.meta.componentName) {
+        let cacheRouterArray = Vue.ls.get(CACHE_INCLUDED_ROUTES) || []
+        if (!cacheRouterArray.includes(this.$route.meta.componentName)) {
+          cacheRouterArray.push(this.$route.meta.componentName)
+          Vue.ls.set(CACHE_INCLUDED_ROUTES, cacheRouterArray)
+          return cacheRouterArray
         }
-        return includedRouters;
       }
+      return includedRouters
     },
-    created() {
-      // 设置iframe页的数组对象
-      const componentsArr = this.getComponentsArr()
-      componentsArr.forEach((item) => {
-        Vue.component(item.name, item.component)
-      })
-      this.componentsArr = componentsArr
-      // 判断当前路由是否iframe页
-      this.isOpenIframePage()
+  },
+  created() {
+    // 设置iframe页的数组对象
+    const componentsArr = this.getComponentsArr()
+    componentsArr.forEach((item) => {
+      Vue.component(item.name, item.component)
+    })
+    this.componentsArr = componentsArr
+    // 判断当前路由是否iframe页
+    this.isOpenIframePage()
 
-      if (this.$route.path != indexKey) {
-        this.addIndexToFirst()
+    if (this.$route.path != indexKey) {
+      this.addIndexToFirst()
+    }
+    let storeKey = 'route:title:' + this.$route.fullPath
+    let routeTitle = this.$ls.get(storeKey)
+    if (routeTitle) {
+      this.$route.meta.title = routeTitle
+    }
+    this.pageList.push(this.$route)
+    this.linkList.push(this.$route.fullPath)
+    this.activePage = this.$route.fullPath
+  },
+  mounted() {},
+  watch: {
+    $route: function (newRoute) {
+      // console.log("新的路由",newRoute)
+      this.activePage = newRoute.fullPath
+      if (!this.multipage) {
+        this.linkList = [newRoute.fullPath]
+        this.pageList = [Object.assign({}, newRoute)]
+      } else if (indexKey == newRoute.fullPath) {
+        //首页时 直接刷新
+      } else if (this.linkList.indexOf(newRoute.fullPath) < 0) {
+        this.linkList.push(newRoute.fullPath)
+        this.pageList.push(Object.assign({}, newRoute))
+      } else if (this.linkList.indexOf(newRoute.fullPath) >= 0) {
+        let oldIndex = this.linkList.indexOf(newRoute.fullPath)
+        let oldPositionRoute = this.pageList[oldIndex]
+        this.pageList.splice(oldIndex, 1, Object.assign({}, newRoute, { meta: oldPositionRoute.meta }))
       }
-      let storeKey = 'route:title:' + this.$route.fullPath
-      let routeTitle = this.$ls.get(storeKey)
-      if (routeTitle) {
-        this.$route.meta.title = routeTitle
+    },
+    activePage: function (key) {
+      let index = this.linkList.lastIndexOf(key)
+      let waitRouter = this.pageList[index]
+      this.$router.push(Object.assign({}, waitRouter))
+      this.changeTitle(waitRouter.meta.title)
+    },
+    multipage: function (newVal) {
+      if (!newVal) {
+        this.linkList = [this.$route.fullPath]
+        this.pageList = [this.$route]
       }
-      this.pageList.push(this.$route)
-      this.linkList.push(this.$route.fullPath)
-      this.activePage = this.$route.fullPath
     },
-    mounted() {
+    //从单页模式切换回多页模式后首页要居第一位
+    device() {
+      if (this.multipage && this.linkList.indexOf(indexKey) === -1) {
+        this.addIndexToFirst()
+      }
     },
-    watch: {
-      '$route': function(newRoute) {
-        // console.log("新的路由",newRoute)
-        this.activePage = newRoute.fullPath
-        if (!this.multipage) {
-          this.linkList = [newRoute.fullPath]
-          this.pageList = [Object.assign({},newRoute)]
-        } else if(indexKey==newRoute.fullPath) {
-          //首页时 直接刷新
-        }else if (this.linkList.indexOf(newRoute.fullPath) < 0) {
-          this.linkList.push(newRoute.fullPath)
-          this.pageList.push(Object.assign({},newRoute))
-        } else if (this.linkList.indexOf(newRoute.fullPath) >= 0) {
-          let oldIndex = this.linkList.indexOf(newRoute.fullPath)
-          let oldPositionRoute = this.pageList[oldIndex]
-          this.pageList.splice(oldIndex, 1, Object.assign({},newRoute,{meta:oldPositionRoute.meta}))
-        }
-      },
-      'activePage': function(key) {
-        let index = this.linkList.lastIndexOf(key)
-        let waitRouter = this.pageList[index]
-        this.$router.push(Object.assign({},waitRouter));
-        this.changeTitle(waitRouter.meta.title)
-      },
-      'multipage': function(newVal) {
-        if (!newVal) {
-          this.linkList = [this.$route.fullPath]
-          this.pageList = [this.$route]
-        }
-      },
-      //从单页模式切换回多页模式后首页要居第一位
-      device() {
-        if (this.multipage && this.linkList.indexOf(indexKey) === -1) {
-          this.addIndexToFirst()
-        }
-      },
-      $route() {
-        // 判断当前路由是否iframe页
-        this.isOpenIframePage()
+    $route() {
+      // 判断当前路由是否iframe页
+      this.isOpenIframePage()
+    },
+  },
+  methods: {
+    // 根据当前路由设置hasOpen
+    isOpenIframePage() {
+      const target = this.componentsArr.find((item) => {
+        return item.path === this.$route.path
+      })
+      if (target && !target.hasOpen) {
+        target.hasOpen = true
       }
     },
-    methods: {
-      // 根据当前路由设置hasOpen
-      isOpenIframePage() {
-        const target = this.componentsArr.find(item => {
-          return item.path === this.$route.path
-        })
-        if (target && !target.hasOpen) {
-          target.hasOpen = true;
-        }
-      },
-      // 遍历路由的所有页面,把含有iframeComponent标识的收集起来
-      getComponentsArr() {
-        let iframeArr = []
-        const routers = this.$store.state.permission.routers;
-        for (let i = 0; i < routers.length; i++) {
-          if(routers[i].children) {
-            //二级目录
-            for (let j = 0; j < routers[i].children.length; j++) {
-              if(routers[i].children[j].iframeComponent) {
-                iframeArr.push(routers[i].children[j])
-                if(routers[i].children[j].children) {
-                  //三级目录
-                  for (let k = 0; k < routers[i].children[j].children.length; k++) {
-                    iframeArr.push(routers[i].children[j].children[k])
-                  }
+    // 遍历路由的所有页面,把含有iframeComponent标识的收集起来
+    getComponentsArr() {
+      let iframeArr = []
+      const routers = this.$store.state.permission.routers
+      for (let i = 0; i < routers.length; i++) {
+        if (routers[i].children) {
+          //二级目录
+          for (let j = 0; j < routers[i].children.length; j++) {
+            if (routers[i].children[j].iframeComponent) {
+              iframeArr.push(routers[i].children[j])
+              if (routers[i].children[j].children) {
+                //三级目录
+                for (let k = 0; k < routers[i].children[j].children.length; k++) {
+                  iframeArr.push(routers[i].children[j].children[k])
                 }
               }
             }
           }
         }
-        return iframeArr.map((item) => {
-          const name = item.path.replaceAll('/', '').replaceAll('.','')
-          return {
-            name: name,
-            path: item.path,
-            hasOpen: false, // 是否打开过,默认false
-            component: item.iframeComponent // 组件文件的引用
-          }
-        })
-      },
-      // 将首页添加到第一位
-      addIndexToFirst() {
-        this.pageList.splice(0, 0, {
-          name: '首页',
-          path: indexKey,
-          fullPath: indexKey,
-          meta: {
-            icon: 'dashboard',
-            title: '首页'
-          }
-        })
-        this.linkList.splice(0, 0, indexKey)
-      },
-      //动态更改页面标题
-      changeTitle(title) {
-        let projectTitle = window.SYS_TITLE
-        // 首页特殊处理
-        if (this.$route.path === indexKey) {
-          document.title = projectTitle
-        } else {
-          document.title = title + ' · ' + projectTitle
-        }
-      },
-      changePage(key) {
-        this.activePage = key
-      },
-      tabCallBack() {
-        this.$nextTick(() => {
-          triggerWindowResizeEvent()
-        })
-      },
-      editPage(key, action) {
-        this[action](key)
-      },
-      remove(key) {
-        if (key == indexKey) {
-          this.$message.warning('首页不能关闭!')
-          return
-        }
-        if (this.pageList.length === 1) {
-          this.$message.warning('这是最后一页,不能再关闭了啦')
-          return
-        }
-        //console.log("this.pageList ",this.pageList );
-        let removeRoute = this.pageList.filter(item => item.fullPath == key)
-        this.pageList = this.pageList.filter(item => item.fullPath !== key)
-        let index = this.linkList.indexOf(key)
-        this.linkList = this.linkList.filter(item => item !== key)
-        index = index >= this.linkList.length ? this.linkList.length - 1 : index
-        this.activePage = this.linkList[index]
-        //update-begin--Author:scott  Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842
-        //关闭页面则从缓存cache_included_routes中删除路由,下次点击菜单会重新加载页面
-        let cacheRouterArray = Vue.ls.get(CACHE_INCLUDED_ROUTES) || []
-        if (removeRoute && removeRoute[0]) {
-          let componentName = removeRoute[0].meta.componentName
-          //console.log("key: ", key);
-          //console.log("componentName: ", componentName);
-          if(cacheRouterArray.includes(componentName)){
-            cacheRouterArray.splice(cacheRouterArray.findIndex(item => item === componentName), 1)
-            Vue.ls.set(CACHE_INCLUDED_ROUTES, cacheRouterArray)
-          }
-        }
-        //从iframe缓存中关闭对应的页面
-        this.componentsArr.find(item => {
-          if(item.path === key) {
-            item.hasOpen = false
-          }
-        })
-        //update-end--Author:scott  Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842
-      },
-      onContextmenu(e) {
-        const pagekey = this.getPageKey(e.target)
-        if (pagekey !== null) {
-          e.preventDefault()
-          this.menuVisible = true
-        }
-      },
-      getPageKey(target, depth) {
-        depth = depth || 0
-        if (depth > 2) {
-          return null
-        }
-        let pageKey = target.getAttribute('pagekey')
-        pageKey = pageKey || (target.previousElementSibling ? target.previousElementSibling.getAttribute('pagekey') : null)
-        return pageKey || (target.firstElementChild ? this.getPageKey(target.firstElementChild, ++depth) : null)
-      },
-      onMenuSelect(key, target) {
-        let pageKey = this.getPageKey(target)
-        switch (key) {
-          case '1':
-            this.closeLeft(pageKey)
-            break
-          case '2':
-            this.closeRight(pageKey)
-            break
-          case '3':
-            this.closeOthers(pageKey)
-            break
-          default:
-            break
+      }
+      return iframeArr.map((item) => {
+        const name = item.path.replaceAll('/', '').replaceAll('.', '')
+        return {
+          name: name,
+          path: item.path,
+          hasOpen: false, // 是否打开过,默认false
+          component: item.iframeComponent, // 组件文件的引用
         }
-      },
-      //关闭当前tab页,供子页面调用->望菜单能配置外链,直接弹出新页面而不是嵌入iframe
-      closeCurrent(){
-        this.remove(this.activePage);
-      },
-      closeOthers(pageKey) {
-        let index = this.linkList.indexOf(pageKey)
-        if (pageKey == indexKey || pageKey.indexOf('?ticke=')>=0) {
-          this.linkList = this.linkList.slice(index, index + 1)
-          this.pageList = this.pageList.slice(index, index + 1)
-          this.activePage = this.linkList[0]
-        } else {
-          let indexContent = this.pageList.slice(0, 1)[0]
-          this.linkList = this.linkList.slice(index, index + 1)
-          this.pageList = this.pageList.slice(index, index + 1)
-          this.linkList.unshift(indexContent.fullPath)
-          this.pageList.unshift(indexContent)
-          this.activePage = this.linkList[1]
+      })
+    },
+    // 将首页添加到第一位
+    addIndexToFirst() {
+      this.pageList.splice(0, 0, {
+        name: '首页',
+        path: indexKey,
+        fullPath: indexKey,
+        meta: {
+          icon: 'dashboard',
+          title: '首页',
+        },
+      })
+      this.linkList.splice(0, 0, indexKey)
+    },
+    //动态更改页面标题
+    changeTitle(title) {
+      let projectTitle = window.SYS_TITLE
+      // 首页特殊处理
+      if (this.$route.path === indexKey) {
+        document.title = projectTitle
+      } else {
+        document.title = title + ' · ' + projectTitle
+      }
+    },
+    changePage(key) {
+      this.activePage = key
+    },
+    tabCallBack() {
+      this.$nextTick(() => {
+        triggerWindowResizeEvent()
+      })
+    },
+    editPage(key, action) {
+      this[action](key)
+    },
+    remove(key) {
+      if (key == indexKey) {
+        this.$message.warning('首页不能关闭!')
+        return
+      }
+      if (this.pageList.length === 1) {
+        this.$message.warning('这是最后一页,不能再关闭了啦')
+        return
+      }
+      //console.log("this.pageList ",this.pageList );
+      let removeRoute = this.pageList.filter((item) => item.fullPath == key)
+      this.pageList = this.pageList.filter((item) => item.fullPath !== key)
+      let index = this.linkList.indexOf(key)
+      this.linkList = this.linkList.filter((item) => item !== key)
+      index = index >= this.linkList.length ? this.linkList.length - 1 : index
+      this.activePage = this.linkList[index]
+      //update-begin--Author:scott  Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842
+      //关闭页面则从缓存cache_included_routes中删除路由,下次点击菜单会重新加载页面
+      let cacheRouterArray = Vue.ls.get(CACHE_INCLUDED_ROUTES) || []
+      if (removeRoute && removeRoute[0]) {
+        let componentName = removeRoute[0].meta.componentName
+        //console.log("key: ", key);
+        //console.log("componentName: ", componentName);
+        if (cacheRouterArray.includes(componentName)) {
+          cacheRouterArray.splice(
+            cacheRouterArray.findIndex((item) => item === componentName),
+            1
+          )
+          Vue.ls.set(CACHE_INCLUDED_ROUTES, cacheRouterArray)
         }
-      },
-      closeLeft(pageKey) {
-        if (pageKey == indexKey) {
-          return
+      }
+      //从iframe缓存中关闭对应的页面
+      this.componentsArr.find((item) => {
+        if (item.path === key) {
+          item.hasOpen = false
         }
-        let tempList = [...this.pageList]
-        let indexContent = tempList.slice(0, 1)[0]
-        let index = this.linkList.indexOf(pageKey)
-        this.linkList = this.linkList.slice(index)
-        this.pageList = this.pageList.slice(index)
+      })
+      //update-end--Author:scott  Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842
+    },
+    onContextmenu(e) {
+      const pagekey = this.getPageKey(e.target)
+      if (pagekey !== null) {
+        e.preventDefault()
+        this.menuVisible = true
+      }
+    },
+    getPageKey(target, depth) {
+      depth = depth || 0
+      if (depth > 2) {
+        return null
+      }
+      let pageKey = target.getAttribute('pagekey')
+      pageKey =
+        pageKey || (target.previousElementSibling ? target.previousElementSibling.getAttribute('pagekey') : null)
+      return pageKey || (target.firstElementChild ? this.getPageKey(target.firstElementChild, ++depth) : null)
+    },
+    onMenuSelect(key, target) {
+      let pageKey = this.getPageKey(target)
+      switch (key) {
+        case '1':
+          this.closeLeft(pageKey)
+          break
+        case '2':
+          this.closeRight(pageKey)
+          break
+        case '3':
+          this.closeOthers(pageKey)
+          break
+        default:
+          break
+      }
+    },
+    //关闭当前tab页,供子页面调用->望菜单能配置外链,直接弹出新页面而不是嵌入iframe
+    closeCurrent() {
+      this.remove(this.activePage)
+    },
+    closeOthers(pageKey) {
+      let index = this.linkList.indexOf(pageKey)
+      if (pageKey == indexKey || pageKey.indexOf('?ticke=') >= 0) {
+        this.linkList = this.linkList.slice(index, index + 1)
+        this.pageList = this.pageList.slice(index, index + 1)
+        this.activePage = this.linkList[0]
+      } else {
+        let indexContent = this.pageList.slice(0, 1)[0]
+        this.linkList = this.linkList.slice(index, index + 1)
+        this.pageList = this.pageList.slice(index, index + 1)
         this.linkList.unshift(indexContent.fullPath)
         this.pageList.unshift(indexContent)
-        if (this.linkList.indexOf(this.activePage) < 0) {
-          this.activePage = this.linkList[0]
+        this.activePage = this.linkList[1]
+      }
+    },
+    closeLeft(pageKey) {
+      if (pageKey == indexKey) {
+        return
+      }
+      let tempList = [...this.pageList]
+      let indexContent = tempList.slice(0, 1)[0]
+      let index = this.linkList.indexOf(pageKey)
+      this.linkList = this.linkList.slice(index)
+      this.pageList = this.pageList.slice(index)
+      this.linkList.unshift(indexContent.fullPath)
+      this.pageList.unshift(indexContent)
+      if (this.linkList.indexOf(this.activePage) < 0) {
+        this.activePage = this.linkList[0]
+      }
+    },
+    closeRight(pageKey) {
+      let index = this.linkList.indexOf(pageKey)
+      this.linkList = this.linkList.slice(0, index + 1)
+      this.pageList = this.pageList.slice(0, index + 1)
+      if (this.linkList.indexOf(this.activePage < 0)) {
+        this.activePage = this.linkList[this.linkList.length - 1]
+      }
+    },
+    //动态路由title显示配置的菜单title而不是其对应路由的title
+    dynamicRouterShow(key, id, title, component) {
+      let keyIndex = this.linkList.indexOf(key)
+      if (keyIndex >= 0) {
+        //切换历史页签
+        let currRouter = this.pageList[keyIndex]
+        let meta = Object.assign({}, currRouter.meta, { title: title })
+        this.pageList.splice(keyIndex, 1, Object.assign({}, currRouter, { meta: meta }))
+        this.activePage = key
+        if (key === this.activePage) {
+          this.changeTitle(title)
         }
-      },
-      closeRight(pageKey) {
-        let index = this.linkList.indexOf(pageKey)
-        this.linkList = this.linkList.slice(0, index + 1)
-        this.pageList = this.pageList.slice(0, index + 1)
-        if (this.linkList.indexOf(this.activePage < 0)) {
-          this.activePage = this.linkList[this.linkList.length - 1]
+      } else {
+        //打开新的页签
+        if (component) {
+          let index = component.lastIndexOf('\/')
+          component = component.substring(index + 1, component.length)
         }
-      },
-      //动态路由title显示配置的菜单title而不是其对应路由的title
-      dynamicRouterShow(key, id, title, component){
-        let keyIndex = this.linkList.indexOf(key)
-        if(keyIndex>=0){
-          //切换历史页签
-          let currRouter = this.pageList[keyIndex]
-          let meta = Object.assign({},currRouter.meta,{title:title})
-          this.pageList.splice(keyIndex, 1, Object.assign({},currRouter,{meta:meta}))
-          this.activePage = key
-          if (key === this.activePage) {
-            this.changeTitle(title)
-          }
-        } else {
-          //打开新的页签
-          if(component) {
-            let index = component.lastIndexOf("\/");
-            component = component.substring(index + 1, component.length);
-          }
-          this.pageList.push({
-            name: title,
-            path: key,
-            fullPath: key,
-            meta: {
-              id: id,
-              icon: key,
-              title: title,
-              componentName: component,
-              keepAlive: true
-            }
-          })
-          this.linkList.push(key)
-          this.activePage = key
-        }
-      },
-    }
-  }
+        this.pageList.push({
+          name: title,
+          path: key,
+          fullPath: key,
+          meta: {
+            id: id,
+            icon: key,
+            title: title,
+            componentName: component,
+            keepAlive: true,
+          },
+        })
+        this.linkList.push(key)
+        this.activePage = key
+      }
+    },
+  },
+}
 </script>
 
 <style lang="less">
-
-  /*
+/*
  * by ji-shenghua qq 75-27-18-920
  */
 
-  .page-transition-enter {
-    opacity: 0;
-  }
+.page-transition-enter {
+  opacity: 0;
+}
 
-  .page-transition-leave-active {
-    opacity: 0;
-  }
+.page-transition-leave-active {
+  opacity: 0;
+}
 
-  .page-transition-enter .page-transition-container,
-  .page-transition-leave-active .page-transition-container {
-    -webkit-transform: scale(1.1);
-    transform: scale(1.1);
-  }
+.page-transition-enter .page-transition-container,
+.page-transition-leave-active .page-transition-container {
+  -webkit-transform: scale(1.1);
+  transform: scale(1.1);
+}
 
-  /*美化弹出Tab样式*/
-  .ant-tabs-nav-container {
-    margin-top: 0px;
-  }
+/*美化弹出Tab样式*/
+.ant-tabs-nav-container {
+  margin-top: 0px;
+}
 
-  /* 修改 ant-tabs 样式 */
-  .tab-layout-tabs.ant-tabs {
-    border-bottom: 1px solid #ccc;
-    border-left: 1px solid #ccc;
-    background-color: white;
-    padding: 0 20px;
-
-    .ant-tabs-bar {
-      margin: 0px;
-      border: none;
-    }
+/* 修改 ant-tabs 样式 */
+.tab-layout-tabs.ant-tabs {
+  border-bottom: 1px solid #ccc;
+  border-left: 1px solid #ccc;
+  background-color: white;
+  padding: 0 20px;
 
+  .ant-tabs-bar {
+    margin: 0px;
+    border: none;
   }
+}
 
-  .ant-tabs {
-
-    &.ant-tabs-card .ant-tabs-tab {
-
-      padding: 0 24px !important;
-      background-color: white !important;
-      margin-right: 10px !important;
-
-      .ant-tabs-close-x {
-        width: 12px !important;
-        height: 12px !important;
-        opacity: 0 !important;
-        cursor: pointer !important;
-        font-size: 12px !important;
-        margin: 0 !important;
-        position: absolute;
-        top: 36%;
-        right: 6px;
-      }
-
-      &:hover .ant-tabs-close-x {
-        opacity: 1 !important;
-      }
+.ant-tabs {
+  &.ant-tabs-card .ant-tabs-tab {
+    padding: 0 24px !important;
+    background-color: white !important;
+    margin-right: 10px !important;
 
+    .ant-tabs-close-x {
+      width: 12px !important;
+      height: 12px !important;
+      opacity: 0 !important;
+      cursor: pointer !important;
+      font-size: 12px !important;
+      margin: 0 !important;
+      position: absolute;
+      top: 36%;
+      right: 6px;
     }
 
-  }
-
-  .ant-tabs.ant-tabs-card > .ant-tabs-bar {
-    .ant-tabs-tab {
-      border: none !important;
-      border-bottom: 1px solid transparent !important;
-    }
-    .ant-tabs-tab-active {
-      height: 35px !important;
-      border-color: @primary-color!important;
+    &:hover .ant-tabs-close-x {
+      opacity: 1 !important;
     }
   }
+}
 
-  .main>.ant-card>.ant-card-body {
-    padding: 8px 24px;
+.ant-tabs.ant-tabs-card > .ant-tabs-bar {
+  .ant-tabs-tab {
+    border: none !important;
+    border-bottom: 1px solid transparent !important;
+  }
+  .ant-tabs-tab-active {
+    height: 35px !important;
+    border-color: @primary-color!important;
   }
+}
 
-</style>
+.main > .ant-card > .ant-card-body {
+  padding: 8px 24px;
+}
+</style>

+ 175 - 173
jshERP-web/src/components/layouts/UserLayout.vue

@@ -3,7 +3,7 @@
     <div id="userLayout" :class="['user-layout-wrapper', device]">
       <div class="container">
         <div class="poster-img">
-          <img src="/static/rightImg.png?v=320">
+          <img src="/static/rightImg.png?v=320" />
         </div>
         <div class="right-form">
           <div class="top">
@@ -11,7 +11,7 @@
               <a-row>
                 <a-col>
                   <a href="/">
-                    <span class="title">{{systemTitle}}</span>
+                    <span class="title">{{ systemTitle }}</span>
                     <small class="desc">V1.0</small>
                   </a>
                 </a-col>
@@ -26,203 +26,205 @@
 </template>
 
 <script>
-  import RouteView from "@/components/layouts/RouteView"
-  import { mixinDevice } from '@/utils/mixin.js'
+import RouteView from '@/components/layouts/RouteView'
+import { mixinDevice } from '@/utils/mixin.js'
 
-  export default {
-    name: "UserLayout",
-    components: { RouteView },
-    mixins: [mixinDevice],
-    data () {
-      return {
-        systemTitle: window.SYS_TITLE,
-        systemUrl: window.SYS_URL,
-        isShowRight: false,
-        isAndroidShow: false,
-        isIphoneShow: false,
-        isMiniProgramShow: false,
-      }
+export default {
+  name: 'UserLayout',
+  components: { RouteView },
+  mixins: [mixinDevice],
+  data() {
+    return {
+      systemTitle: window.SYS_TITLE,
+      systemUrl: window.SYS_URL,
+      isShowRight: false,
+      isAndroidShow: false,
+      isIphoneShow: false,
+      isMiniProgramShow: false,
+    }
+  },
+  mounted() {
+    document.body.classList.add('userLayout')
+  },
+  beforeDestroy() {
+    document.body.classList.remove('userLayout')
+  },
+  created() {
+    let host = window.location.host
+    if (host === 'cloud.gyjerp.com') {
+      this.isShowRight = true
+    } else {
+      this.isShowRight = false
+    }
+  },
+  methods: {
+    handleAndroidCancel() {
+      this.isAndroidShow = false
     },
-    mounted () {
-      document.body.classList.add('userLayout')
+    handleIphoneCancel() {
+      this.isIphoneShow = false
     },
-    beforeDestroy () {
-      document.body.classList.remove('userLayout')
+    handleMiniProgramCancel() {
+      this.isMiniProgramShow = false
     },
-    created () {
-      let host = window.location.host
-      if(host === 'cloud.gyjerp.com') {
-        this.isShowRight = true
-      } else {
-        this.isShowRight = false
-      }
+    openAndroid() {
+      this.isAndroidShow = true
     },
-    methods: {
-      handleAndroidCancel() {
-        this.isAndroidShow = false
-      },
-      handleIphoneCancel() {
-        this.isIphoneShow = false
-      },
-      handleMiniProgramCancel() {
-        this.isMiniProgramShow = false
-      },
-      openAndroid() {
-        this.isAndroidShow = true
-      },
-      openIPhone() {
-        this.isIphoneShow = true
-      },
-      openMiniProgram() {
-        this.isMiniProgramShow = true
-      }
-    }
-  }
+    openIPhone() {
+      this.isIphoneShow = true
+    },
+    openMiniProgram() {
+      this.isMiniProgramShow = true
+    },
+  },
+}
 </script>
 
 <style scoped>
-  .back-layout {
-    width: 100%;
-    height: 100%;
-    background-image: url(/static/bgimg.png?v=1);
-    background-size: cover;
-    background-repeat: no-repeat;
-    position: relative;
-    overflow: hidden;
-  }
-  #userLayout.user-layout-wrapper.mobile {
-    position: fixed;
-    left: 6%;
-    top: 10%;
-    margin-left: 0px;
-  }
-  .third-party-platform {
-    display: flex;
-    flex-direction: row;
-    justify-content: center;
-    margin-bottom:15px;
-    opacity:0.7
-  }
-  .third-party-platform .platform-info {
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-    cursor: pointer;
-    color:#1890ff
-  }
-  .platform-modal {
-    padding:20px;
-    margin:20px 50px;
-    border:1px solid #eee;
-  }
+.back-layout {
+  width: 100%;
+  height: 100%;
+  background-image: url(/static/bgimg.png?v=1);
+  background-size: cover;
+  background-repeat: no-repeat;
+  position: relative;
+  overflow: hidden;
+}
+#userLayout.user-layout-wrapper.mobile {
+  position: fixed;
+  left: 6%;
+  top: 10%;
+  margin-left: 0px;
+}
+.third-party-platform {
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+  margin-bottom: 15px;
+  opacity: 0.7;
+}
+.third-party-platform .platform-info {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  cursor: pointer;
+  color: #1890ff;
+}
+.platform-modal {
+  padding: 20px;
+  margin: 20px 50px;
+  border: 1px solid #eee;
+}
 </style>
 <style lang="less" scoped>
-  #userLayout.user-layout-wrapper {
-    position: fixed;
-    left: 50%;
-    top: 12%;
-    margin-left: -543px;
-    height: 100%;
+#userLayout.user-layout-wrapper {
+  position: fixed;
+  left: 50%;
+  top: 12%;
+  margin-left: -543px;
+  height: 100%;
 
-    &.mobile {
-      .container {
-        .main {
-          max-width: 368px;
-          width: 98%;
-        }
-      }
-      .poster-img {
-        display: none;
+  &.mobile {
+    .container {
+      .main {
+        max-width: 368px;
+        width: 98%;
       }
     }
+    .poster-img {
+      display: none;
+    }
+  }
 
-    .container {
-      float: left;
-      width: 100%;
-      z-index: 99;
-      height: 70%;
+  .container {
+    float: left;
+    width: 100%;
+    z-index: 99;
+    height: 70%;
 
-      .poster-img {
-        float: left;
-        height: 100%;
-      }
+    .poster-img {
+      float: left;
+      height: 100%;
+    }
 
-      .right-form {
-        background-size: 100%;
-        position: relative;
-        width: 340px;
-        height: 460px;
-        background: rgba(255, 255, 255, 1);
-        border-radius: 8px;
-        right: 0;
-        top: 0;
-        padding: 10px 30px 0 30px;
-        margin-top: 50px;
-        -webkit-box-shadow: 0 2px 6px 0 rgb(200 200 200);
-        box-shadow: 0 2px 6px 0 rgb(200 200 200);
-        overflow: hidden;
+    .right-form {
+      background-size: 100%;
+      position: relative;
+      width: 340px;
+      height: 460px;
+      background: rgba(255, 255, 255, 1);
+      border-radius: 8px;
+      right: 0;
+      top: 0;
+      padding: 10px 30px 0 30px;
+      margin-top: 50px;
+      -webkit-box-shadow: 0 2px 6px 0 rgb(200 200 200);
+      box-shadow: 0 2px 6px 0 rgb(200 200 200);
+      overflow: hidden;
 
-        a {
-          text-decoration: none;
-        }
+      a {
+        text-decoration: none;
+      }
 
-        .top {
-          text-align: center;
+      .top {
+        text-align: center;
 
-          .header {
-            height: 44px;
-            line-height: 44px;
-            margin-top: 35px;
-            margin-bottom: 35px;
-            .title {
-              font-size: 35px;
-              color: #666;
-              font-family: "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
-              font-weight: 700;
-              position: relative;
-              top: 2px;
-            }
-            .desc {
-              font-size: 16px;
-              color: #666;
-              margin-top: 12px;
-              margin-left: 10px;
-              margin-bottom: 40px;
-            }
+        .header {
+          height: 44px;
+          line-height: 44px;
+          margin-top: 35px;
+          margin-bottom: 35px;
+          .title {
+            font-size: 35px;
+            color: #666;
+            font-family: 'Chinese Quote', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
+              'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
+              'Segoe UI Emoji', 'Segoe UI Symbol';
+            font-weight: 700;
+            position: relative;
+            top: 2px;
+          }
+          .desc {
+            font-size: 16px;
+            color: #666;
+            margin-top: 12px;
+            margin-left: 10px;
+            margin-bottom: 40px;
           }
         }
+      }
 
-        .main {
-          min-width: 260px;
-          width: 280px;
-          margin: 0 auto;
-        }
+      .main {
+        min-width: 260px;
+        width: 280px;
+        margin: 0 auto;
       }
     }
   }
-  .footer {
-    position: absolute;
-    bottom: 0;
-    padding: 0 16px;
-    margin: 48px 0 12px;
-    text-align: center;
-    left: 33%;
-    right: 33%;
+}
+.footer {
+  position: absolute;
+  bottom: 0;
+  padding: 0 16px;
+  margin: 48px 0 12px;
+  text-align: center;
+  left: 33%;
+  right: 33%;
 
-    .links {
-      margin-bottom: 8px;
-      font-size: 14px;
-      a {
-        color: rgba(0, 0, 0, 0.45);
-        transition: all 0.3s;
-        &:not(:last-child) {
-          margin-right: 40px;
-        }
-      }
-    }
-    .copyright {
+  .links {
+    margin-bottom: 8px;
+    font-size: 14px;
+    a {
       color: rgba(0, 0, 0, 0.45);
-      font-size: 14px;
+      transition: all 0.3s;
+      &:not(:last-child) {
+        margin-right: 40px;
+      }
     }
   }
-</style>
+  .copyright {
+    color: rgba(0, 0, 0, 0.45);
+    font-size: 14px;
+  }
+}
+</style>

Some files were not shown because too many files changed in this diff