Browse Source

【升级】升级前端所有代码规范,修复一些已知bug

俞宝山 4 years ago
parent
commit
7b89a99b4c
100 changed files with 3165 additions and 3093 deletions
  1. 70 10
      _web/.eslintrc.js
  2. 12 3
      _web/package.json
  3. 1 1
      _web/public/index.html
  4. 1 1
      _web/public/loading/loading.html
  5. 1 1
      _web/public/loading/option2/html_code_segment.html
  6. 1 3
      _web/src/api/manage.js
  7. 0 1
      _web/src/api/modular/system/appManage.js
  8. 1 2
      _web/src/api/modular/system/configManage.js
  9. 0 3
      _web/src/api/modular/system/dictDataManage.js
  10. 0 2
      _web/src/api/modular/system/dictManage.js
  11. 1 1
      _web/src/api/modular/system/emailManage.js
  12. 2 4
      _web/src/api/modular/system/fileManage.js
  13. 0 2
      _web/src/api/modular/system/logManage.js
  14. 0 2
      _web/src/api/modular/system/loginManage.js
  15. 0 1
      _web/src/api/modular/system/machineManage.js
  16. 0 1
      _web/src/api/modular/system/menuManage.js
  17. 0 1
      _web/src/api/modular/system/noticeManage.js
  18. 0 1
      _web/src/api/modular/system/noticeReceivedManage.js
  19. 0 4
      _web/src/api/modular/system/onlineUserManage.js
  20. 1 2
      _web/src/api/modular/system/orgManage.js
  21. 0 1
      _web/src/api/modular/system/posManage.js
  22. 1 2
      _web/src/api/modular/system/roleManage.js
  23. 1 1
      _web/src/api/modular/system/smsManage.js
  24. 2 3
      _web/src/api/modular/system/timersManage.js
  25. 1 1
      _web/src/api/modular/system/userManage.js
  26. 8 5
      _web/src/components/Editor/WangEditor.vue
  27. 114 109
      _web/src/components/GlobalHeader/GlobalHeader.vue
  28. 2 2
      _web/src/components/IconSelector/icons.js
  29. 4 4
      _web/src/components/SettingDrawer/SettingDrawer.vue
  30. 13 11
      _web/src/components/Table/index.js
  31. 152 136
      _web/src/components/tools/UserMenu.vue
  32. 8 6
      _web/src/config/router.config.js
  33. 1 1
      _web/src/core/bootstrap.js
  34. 7 1
      _web/src/core/lazy_lib/components_use.js
  35. 2 2
      _web/src/layouts/BasicLayout.vue
  36. 14 14
      _web/src/layouts/Iframe.vue
  37. 1 1
      _web/src/layouts/PageView.vue
  38. 1 1
      _web/src/layouts/index.js
  39. 1 7
      _web/src/main.js
  40. 28 26
      _web/src/permission.js
  41. 13 13
      _web/src/router/generator-routers.js
  42. 1 1
      _web/src/store/getters.js
  43. 1 1
      _web/src/store/index.js
  44. 1 1
      _web/src/store/modules/async-router.js
  45. 1 3
      _web/src/store/modules/permission.js
  46. 136 135
      _web/src/store/modules/user.js
  47. 1 1
      _web/src/utils/applocation.js
  48. 20 0
      _web/src/utils/filter.js
  49. 3 3
      _web/src/utils/permissions.js
  50. 10 11
      _web/src/utils/request.js
  51. 153 153
      _web/src/views/system/account/center/Index.vue
  52. 26 26
      _web/src/views/system/account/center/page/Article.vue
  53. 9 10
      _web/src/views/system/app/addForm.vue
  54. 15 16
      _web/src/views/system/app/editForm.vue
  55. 95 95
      _web/src/views/system/app/index.vue
  56. 45 48
      _web/src/views/system/config/addForm.vue
  57. 48 50
      _web/src/views/system/config/editForm.vue
  58. 68 65
      _web/src/views/system/config/index.vue
  59. 1 2
      _web/src/views/system/dashboard/Workplace.vue
  60. 38 41
      _web/src/views/system/dict/addForm.vue
  61. 43 46
      _web/src/views/system/dict/dictdata/addForm.vue
  62. 34 37
      _web/src/views/system/dict/dictdata/editForm.vue
  63. 41 41
      _web/src/views/system/dict/dictdata/index.vue
  64. 33 36
      _web/src/views/system/dict/editForm.vue
  65. 41 41
      _web/src/views/system/dict/index.vue
  66. 55 52
      _web/src/views/system/email/index.vue
  67. 23 23
      _web/src/views/system/file/detailForm.vue
  68. 127 129
      _web/src/views/system/file/index.vue
  69. 12 12
      _web/src/views/system/file/previewForm.vue
  70. 5 5
      _web/src/views/system/index/welcome.vue
  71. 29 29
      _web/src/views/system/log/oplog/details.vue
  72. 38 36
      _web/src/views/system/log/oplog/index.vue
  73. 7 7
      _web/src/views/system/log/vislog/details.vue
  74. 37 35
      _web/src/views/system/log/vislog/index.vue
  75. 43 43
      _web/src/views/system/machine/index.vue
  76. 262 257
      _web/src/views/system/menu/addForm.vue
  77. 245 237
      _web/src/views/system/menu/editForm.vue
  78. 68 68
      _web/src/views/system/menu/index.vue
  79. 63 62
      _web/src/views/system/notice/addForm.vue
  80. 14 14
      _web/src/views/system/notice/detailForm.vue
  81. 61 61
      _web/src/views/system/notice/editForm.vue
  82. 49 47
      _web/src/views/system/notice/index.vue
  83. 14 15
      _web/src/views/system/noticeReceived/detailForm.vue
  84. 64 61
      _web/src/views/system/noticeReceived/index.vue
  85. 38 38
      _web/src/views/system/onlineUser/index.vue
  86. 24 27
      _web/src/views/system/org/addForm.vue
  87. 33 36
      _web/src/views/system/org/editForm.vue
  88. 30 30
      _web/src/views/system/org/index.vue
  89. 38 41
      _web/src/views/system/pos/addForm.vue
  90. 33 36
      _web/src/views/system/pos/editForm.vue
  91. 49 49
      _web/src/views/system/pos/index.vue
  92. 38 41
      _web/src/views/system/role/addForm.vue
  93. 33 36
      _web/src/views/system/role/editForm.vue
  94. 64 64
      _web/src/views/system/role/index.vue
  95. 60 64
      _web/src/views/system/role/roleMenuForm.vue
  96. 63 61
      _web/src/views/system/role/roleOrgForm.vue
  97. 38 36
      _web/src/views/system/sms/index.vue
  98. 50 53
      _web/src/views/system/timers/addForm.vue
  99. 29 32
      _web/src/views/system/timers/editForm.vue
  100. 0 0
      _web/src/views/system/timers/index.vue

+ 70 - 10
_web/.eslintrc.js

@ -1,15 +1,75 @@
module.exports = {
  "root": true,
  "env": {
    "node": true
  root: true,
  env: {
    node: true
  },
  "extends": [
    "plugin:vue/essential",
  'extends': [
    'plugin:vue/strongly-recommended',
    '@vue/standard'
  ],
  "rules": {
    "no-console": 0
  rules: {
    'no-console': 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'generator-star-spacing': 'off',
    'no-mixed-operators': 0,
    'vue/max-attributes-per-line': [
      2,
      {
        'singleline': 5,
        'multiline': {
          'max': 1,
          'allowFirstLine': false
        }
      }
    ],
    'vue/attribute-hyphenation': 0,
    'vue/html-self-closing': 0,
    'vue/component-name-in-template-casing': 0,
    'vue/html-closing-bracket-spacing': 0,
    'vue/singleline-html-element-content-newline': 0,
    'vue/no-unused-components': 0,
    'vue/multiline-html-element-content-newline': 0,
    'vue/no-use-v-if-with-v-for': 0,
    'vue/html-closing-bracket-newline': 0,
    'vue/no-parsing-error': 0,
    'no-tabs': 0,
    'quotes': [
      2,
      'single',
      {
        'avoidEscape': true,
        'allowTemplateLiterals': true
      }
    ],
    'semi': [
      2,
      'never',
      {
        'beforeStatementContinuationChars': 'never'
      }
    ],
    'no-delete-var': 2,
    'prefer-const': [
      2,
      {
        'ignoreReadBeforeAssign': false
      }
    ],
    'template-curly-spacing': 'off',
    'indent': 'off'
  },
  "parserOptions": {
    "parser": "babel-eslint"
  }
  parserOptions: {
    parser: 'babel-eslint'
  },
  overrides: [
    {
      files: [
        '**/__tests__/*.{j,t}s?(x)',
        '**/tests/unit/**/*.spec.{j,t}s?(x)'
      ],
      env: {
        jest: true
      }
    }
  ]
}

+ 12 - 3
_web/package.json

@ -13,7 +13,10 @@
    "@antv/data-set": "^0.10.2",
    "ant-design-vue": "1.5.0-rc.6",
    "axios": "^0.19.0",
    "babel-polyfill": "^6.26.0",
    "clipboard": "^2.0.6",
    "core-js": "^3.1.2",
    "default-passive-events": "^1.0.10",
    "enquire.js": "^2.1.6",
    "font-awesome": "^4.7.0",
    "jquery": "^3.5.1",
@ -24,15 +27,18 @@
    "mockjs2": "1.0.8",
    "moment": "^2.24.0",
    "nprogress": "^0.2.0",
    "print-js": "^1.0.63",
    "raphael": "^2.3.0",
    "viser-vue": "^2.4.6",
    "vue": "^2.6.10",
    "vue-clipboard2": "^0.2.1",
    "vue-codemirror-lite": "^1.0.4",
    "vue-cropper": "0.4.9",
    "vue-ls": "^3.2.1",
    "vue-quill-editor": "^3.0.6",
    "vue-router": "^3.1.2",
    "vue-svg-component-runtime": "^1.0.1",
    "vuedraggable": "^2.23.2",
    "vuex": "^3.1.1",
    "wangeditor": "^3.1.1"
  },
@ -44,18 +50,21 @@
    "@vue/cli-plugin-unit-jest": "^4.0.4",
    "@vue/cli-plugin-vuex": "^4.0.4",
    "@vue/cli-service": "^4.0.4",
    "@vue/eslint-config-prettier": "^5.0.0",
    "@vue/eslint-config-standard": "^4.0.0",
    "@vue/test-utils": "^1.0.0-beta.29",
    "babel-eslint": "^10.0.1",
    "babel-plugin-import": "^1.12.2",
    "babel-plugin-import": "^1.13.0",
    "babel-plugin-transform-remove-console": "^6.9.4",
    "eslint": "^5.16.0",
    "eslint": "^6.8.0",
    "eslint-plugin-html": "^5.0.0",
    "eslint-plugin-prettier": "^3.1.0",
    "eslint-plugin-vue": "^5.2.3",
    "less": "^3.0.4",
    "less-loader": "^5.0.0",
    "opencollective": "^1.0.3",
    "opencollective-postinstall": "^2.0.2",
    "prettier": "^1.18.2",
    "vue-svg-icon-loader": "^2.1.1",
    "vue-template-compiler": "^2.6.10",
    "webpack-theme-color-replacer": "^1.2.17"
@ -72,4 +81,4 @@
  "author": "",
  "license": "ISC",
  "description": ""
}
}

+ 1 - 1
_web/public/index.html

@ -27,7 +27,7 @@
</div>
<!-- require cdn assets js -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<script type="text/javascript" src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
<!-- built files will be auto injected -->
</body>

+ 1 - 1
_web/public/loading/loading.html

@ -1 +1 @@
<div id="preloadingAnimation"><div class=lds-roller><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div><div class=load-tips>Loading</div></div>
<div id="preloadingAnimation"><div class=lds-roller><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div><div class=load-tips>Loading</div></div>

File diff suppressed because it is too large
+ 1 - 1
_web/public/loading/option2/html_code_segment.html


+ 1 - 3
_web/src/api/manage.js

@ -4,11 +4,10 @@
import { axios } from '@/utils/request'
const api = {
  user: '/user',
  role: '/role',
  service:'/service'
  service: '/service'
}
export default api
@ -53,4 +52,3 @@ export function saveService (parameter) {
    data: parameter
  })
}

+ 0 - 1
_web/src/api/modular/system/appManage.js

@ -6,7 +6,6 @@
 */
import { axios } from '@/utils/request'
/**
 * 系统应用列表
 *

+ 1 - 2
_web/src/api/modular/system/configManage.js

@ -1,6 +1,5 @@
import { axios } from '@/utils/request'
/**
 * 分页查询配置列表
 *
@ -75,7 +74,7 @@ export function sysDictTypeDropDown (parameter) {
 * 获取系统的所有任务列表
 *
 * @author yubaoshan
 * @Date 2020/7/8 20:46
 * @date 2020/7/8 20:46
 */
export function sysTimersGetActionClasses (parameter) {
  return axios({

+ 0 - 3
_web/src/api/modular/system/dictDataManage.js

@ -1,6 +1,5 @@
import { axios } from '@/utils/request'
/**
 * 查询系统字典值
 *
@ -56,5 +55,3 @@ export function sysDictDataDelete (parameter) {
    data: parameter
  })
}

+ 0 - 2
_web/src/api/modular/system/dictManage.js

@ -1,6 +1,5 @@
import { axios } from '@/utils/request'
/**
 * 分页查询系统字典类型
 *
@ -70,4 +69,3 @@ export function sysDictTypeDropDown (parameter) {
    params: parameter
  })
}

+ 1 - 1
_web/src/api/modular/system/emailManage.js

@ -26,4 +26,4 @@ export function emailSendEmailHtml (parameter) {
    method: 'post',
    data: parameter
  })
}
}

+ 2 - 4
_web/src/api/modular/system/fileManage.js

@ -1,6 +1,5 @@
import { axios } from '@/utils/request'
/**
 * 分页查询文件信息表
 *
@ -54,7 +53,7 @@ export function sysFileInfoDownload (parameter) {
    url: '/sysFileInfo/download',
    method: 'get',
    params: parameter,
    responseType: "blob",
    responseType: 'blob'
  })
}
@ -69,7 +68,7 @@ export function sysFileInfoPreview (parameter) {
    url: '/sysFileInfo/preview',
    method: 'get',
    params: parameter,
    responseType: "arraybuffer",
    responseType: 'arraybuffer'
  })
}
@ -87,7 +86,6 @@ export function sysFileInfoDetail (parameter) {
  })
}
/**
 * 删除文件信息表
 *

+ 0 - 2
_web/src/api/modular/system/logManage.js

@ -1,6 +1,5 @@
import { axios } from '@/utils/request'
/**
 * 查询访问日志
 *
@ -56,4 +55,3 @@ export function sysOpLogDelete (parameter) {
    data: parameter
  })
}

+ 0 - 2
_web/src/api/modular/system/loginManage.js

@ -6,7 +6,6 @@
 */
import { axios } from '@/utils/request'
/**
 * 登录
 *
@ -104,4 +103,3 @@ export function twoStepCode (parameter) {
    params: parameter
  })
}

+ 0 - 1
_web/src/api/modular/system/machineManage.js

@ -1,6 +1,5 @@
import { axios } from '@/utils/request'
/**
 * 系统属性监控
 *

+ 0 - 1
_web/src/api/modular/system/menuManage.js

@ -1,6 +1,5 @@
import { axios } from '@/utils/request'
/**
 * 获取菜单列表
 *

+ 0 - 1
_web/src/api/modular/system/noticeManage.js

@ -1,6 +1,5 @@
import { axios } from '@/utils/request'
/**
 * 查询系统通知公告
 *

+ 0 - 1
_web/src/api/modular/system/noticeReceivedManage.js

@ -1,6 +1,5 @@
import { axios } from '@/utils/request'
/**
 * 查询我收到的系统通知公告
 *

+ 0 - 4
_web/src/api/modular/system/onlineUserManage.js

@ -1,6 +1,5 @@
import { axios } from '@/utils/request'
/**
 * 在线用户列表
 *
@ -28,6 +27,3 @@ export function sysOnlineUserForceExist (parameter) {
    data: parameter
  })
}

+ 1 - 2
_web/src/api/modular/system/orgManage.js

@ -1,6 +1,5 @@
import { axios } from '@/utils/request'
/**
 * 获取机构树
 *
@ -83,4 +82,4 @@ export function sysOrgDelete (parameter) {
    method: 'post',
    data: parameter
  })
}
}

+ 0 - 1
_web/src/api/modular/system/posManage.js

@ -1,6 +1,5 @@
import { axios } from '@/utils/request'
/**
 * 查询系统职位
 *

+ 1 - 2
_web/src/api/modular/system/roleManage.js

@ -1,6 +1,5 @@
import { axios } from '@/utils/request'
/**
 * 获取角色列表
 *
@ -139,4 +138,4 @@ export function sysRoleGrantData (parameter) {
    method: 'post',
    data: parameter
  })
}
}

+ 1 - 1
_web/src/api/modular/system/smsManage.js

@ -40,4 +40,4 @@ export function sysValidateMessage (parameter) {
    method: 'post',
    data: parameter
  })
}
}

+ 2 - 3
_web/src/api/modular/system/timersManage.js

@ -1,6 +1,5 @@
import { axios } from '@/utils/request'
/**
 * 分页查询定时任务
 *
@ -63,7 +62,7 @@ export function sysTimersAdd (parameter) {
 * @author yubaoshan
 * @date 2020/7/3 03:23
 */
export function sysTimersDelete(parameter) {
export function sysTimersDelete (parameter) {
  return axios({
    url: '/sysTimers/delete',
    method: 'post',
@ -77,7 +76,7 @@ export function sysTimersDelete(parameter) {
 * @author yubaoshan
 * @date 2020/7/3 03:23
 */
export function sysTimersEdit(parameter) {
export function sysTimersEdit (parameter) {
  return axios({
    url: '/sysTimers/edit',
    method: 'post',

+ 1 - 1
_web/src/api/modular/system/userManage.js

@ -180,4 +180,4 @@ export function sysUserSelector (parameter) {
    method: 'get',
    params: parameter
  })
}
}

+ 8 - 5
_web/src/components/Editor/WangEditor.vue

@ -1,13 +1,13 @@
<template>
  <div>
    <div  id="editor" ref='myEditor'></div>
    <div id="editor" ref="myEditor"></div>
    <slot></slot>
  </div>
</template>
<script>
  import WangEditor from 'wangeditor'
  export default {
    name: 'component-wangeditor',
    name: 'ComponentWangeditor',
    data () {
      return {
        edit: ''
@ -15,18 +15,21 @@
    },
    props: {
      value: {
        type: String,
        default: ''
      },
      config: {
        type: Array,
        default: () => {
          return {}
        }
      },
      uploadConfig: {
        type: Array,
        default: () => {
          return {
            method: 'http', // 支持custom(objurl)和http(服务器)和base64
            url: '/',
            url: '/'
          }
        }
      }
@ -57,7 +60,7 @@
        this.editor = new WangEditor(this.$refs.myEditor)
        // 配置 onchange 事件
        this.editor.customConfig = this.customConfig
        this.editor.customConfig.uploadImgMaxLength = 5;
        this.editor.customConfig.uploadImgMaxLength = 5
        this.editor.change = function () { // 编辑区域内容变化时
          self.$emit('input', this.txt.html())
          self.$emit('onchange', this.txt.html(), this.txt)
@ -120,4 +123,4 @@
    flex-wrap:wrap;
  }
</style>
</style>

+ 114 - 109
_web/src/components/GlobalHeader/GlobalHeader.vue

@ -6,20 +6,24 @@
        :class="[fixedHeader && 'ant-header-fixedHeader', sidebarOpened ? 'ant-header-side-opened' : 'ant-header-side-closed', ]"
        :style="{ padding: '0' }">
        <div v-if="mode === 'sidemenu'" class="header">
          <a-menu
            mode="horizontal"
            :default-selected-keys=this.defApp
            :default-selected-keys="this.defApp"
            style="border-bottom:0px;lineHeight:62px;"
          >
            <a-icon v-if="device==='mobile'" class="trigger" :type="collapsed ? 'menu-fold' : 'menu-unfold'" @click="toggle"/>
            <a-icon v-else class="trigger" :type="collapsed ? 'menu-unfold' : 'menu-fold'" @click="toggle"/>
            <a-menu-item v-for='(item) in userInfo.apps' :key="item.code" style="top:0px;" @click="switchApp(item.code)">
              {{item.name}}
            <a-menu-item v-for="(item) in userInfo.apps" :key="item.code" style="top:0px;" @click="switchApp(item.code)">
              {{ item.name }}
            </a-menu-item>
            <user-menu></user-menu>
          </a-menu>
        </div>
        <div v-else :class="['top-nav-header-index', theme]">
          <div class="header-index-wide">
            <div class="header-index-left">
              <logo class="top-nav-header" :show-title="device !== 'mobile'"/>
@ -35,126 +39,127 @@
</template>
<script>
  import UserMenu from '../tools/UserMenu'
  import SMenu from '../Menu/'
  import Logo from '../tools/Logo'
  import { mixin } from '@/utils/mixin'
  import { mapActions,mapGetters } from 'vuex'
  import { ALL_APPS_MENU } from '@/store/mutation-types'
  import Vue from 'vue'
  import { message } from 'ant-design-vue/es'
import UserMenu from '../tools/UserMenu'
import SMenu from '../Menu/'
import Logo from '../tools/Logo'
import { mixin } from '@/utils/mixin'
import { mapActions, mapGetters } from 'vuex'
import { ALL_APPS_MENU } from '@/store/mutation-types'
import Vue from 'vue'
import { message } from 'ant-design-vue/es'
  export default {
    name: 'GlobalHeader',
    components: {
      UserMenu,
      SMenu,
      Logo,
export default {
  name: 'GlobalHeader',
  components: {
    UserMenu,
    SMenu,
    Logo
  },
  computed: {
    ...mapGetters(['userInfo'])
  },
  created () {
    this.defApp.push(Vue.ls.get(ALL_APPS_MENU)[0].code)
  },
  mixins: [mixin],
  props: {
    mode: {
      type: String,
      // sidemenu, topmenu
      default: 'sidemenu'
    },
    computed: {
      ...mapGetters(['userInfo']),
    menus: {
      type: Array,
      required: true
    },
    created(){
      this.defApp.push(Vue.ls.get(ALL_APPS_MENU)[0].code)
    },
    mixins: [mixin],
    props: {
      mode: {
        type: String,
        // sidemenu, topmenu
        default: 'sidemenu'
      },
      menus: {
        type: Array,
        required: true
      },
      theme: {
        type: String,
        required: false,
        default: 'dark'
      },
      collapsed: {
        type: Boolean,
        required: false,
        default: false
      },
      device: {
        type: String,
        required: false,
        default: 'desktop'
      }
    },
    data () {
      return {
        visible: true,
        oldScrollTop: 0,
        defApp:[]
      }
    theme: {
      type: String,
      required: false,
      default: 'dark'
    },
    mounted () {
      document.addEventListener('scroll', this.handleScroll, { passive: true })
    collapsed: {
      type: Boolean,
      required: false,
      default: false
    },
    methods: {
      ...mapActions(['MenuChange']),
    device: {
      type: String,
      required: false,
      default: 'desktop'
    }
  },
  data () {
    return {
      visible: true,
      oldScrollTop: 0,
      defApp: []
    }
  },
  mounted () {
    document.addEventListener('scroll', this.handleScroll, { passive: true })
  },
  methods: {
    ...mapActions(['MenuChange']),
      /**
       * 应用切换
       */
      switchApp(appCode){
        this.defApp=[]
        const applicationData = this.userInfo.apps.filter(item => item.code == appCode)
        const hideMessage = message.loading('正在切换应用!', 0)
        this.MenuChange(applicationData[0]).then((res)=>{
    /**
     * 应用切换
     */
    switchApp (appCode) {
      this.defApp = []
      const applicationData = this.userInfo.apps.filter(item => item.code === appCode)
      const hideMessage = message.loading('正在切换应用!', 0)
      this.MenuChange(applicationData[0]).then((res) => {
          hideMessage()
        }).catch((err)=>{
          message.error("应用切换异常");
        });
      },
      handleScroll () {
        if (!this.autoHideHeader) {
          return
        }
      // eslint-disable-next-line handle-callback-err
      }).catch((err) => {
        message.error('应用切换异常')
      })
    },
    handleScroll () {
      if (!this.autoHideHeader) {
        return
      }
        const scrollTop = document.body.scrollTop + document.documentElement.scrollTop
        if (!this.ticking) {
          this.ticking = true
          requestAnimationFrame(() => {
            if (this.oldScrollTop > scrollTop) {
              this.visible = true
            } else if (scrollTop > 300 && this.visible) {
              this.visible = false
            } else if (scrollTop < 300 && !this.visible) {
              this.visible = true
            }
            this.oldScrollTop = scrollTop
            this.ticking = false
          })
        }
      },
      toggle () {
        this.$emit('toggle')
      const scrollTop = document.body.scrollTop + document.documentElement.scrollTop
      if (!this.ticking) {
        this.ticking = true
        requestAnimationFrame(() => {
          if (this.oldScrollTop > scrollTop) {
            this.visible = true
          } else if (scrollTop > 300 && this.visible) {
            this.visible = false
          } else if (scrollTop < 300 && !this.visible) {
            this.visible = true
          }
          this.oldScrollTop = scrollTop
          this.ticking = false
        })
      }
    },
    beforeDestroy () {
      document.body.removeEventListener('scroll', this.handleScroll, true)
    toggle () {
      this.$emit('toggle')
    }
  },
  beforeDestroy () {
    document.body.removeEventListener('scroll', this.handleScroll, true)
  }
}
</script>
<style lang="less">
  @import '../index.less';
@import '../index.less';
  .header-animat{
    position: relative;
    z-index: @ant-global-header-zindex;
  }
  .showHeader-enter-active {
    transition: all 0.25s ease;
  }
  .showHeader-leave-active {
    transition: all 0.5s ease;
  }
  .showHeader-enter, .showHeader-leave-to {
    opacity: 0;
  }
.header-animat{
  position: relative;
  z-index: @ant-global-header-zindex;
}
.showHeader-enter-active {
  transition: all 0.25s ease;
}
.showHeader-leave-active {
  transition: all 0.5s ease;
}
.showHeader-enter, .showHeader-leave-to {
  opacity: 0;
}
</style>

File diff suppressed because it is too large
+ 2 - 2
_web/src/components/IconSelector/icons.js


+ 4 - 4
_web/src/components/SettingDrawer/SettingDrawer.vue

@ -171,16 +171,16 @@
</template>
<script>
/*import { DetailList } from '@/components'
import SettingItem from './SettingItem'*/
/* import { DetailList } from '@/components'
import SettingItem from './SettingItem' */
import config from '@/config/defaultSettings'
import { updateTheme, updateColorWeak, colorList } from './settingConfig'
import { mixin, mixinDevice } from '@/utils/mixin'
export default {
  components: {
    //DetailList,
    //SettingItem
    // DetailList,
    // SettingItem
  },
  mixins: [mixin, mixinDevice],
  data () {

+ 13 - 11
_web/src/components/Table/index.js

@ -110,7 +110,7 @@ export default {
      pageSize: this.pageSize,
      showSizeChanger: this.showSizeChanger
    }) || false
    //console.log('this.localPagination', this.localPagination)
    // console.log('this.localPagination', this.localPagination)
    this.needTotalList = this.initTotalList(this.columns)
    this.loadData()
  },
@ -154,20 +154,20 @@ export default {
      // eslint-disable-next-line
      if ((typeof result === 'object' || typeof result === 'function') && typeof result.then === 'function') {
        result.then(r => {
          if(r == null){
          if (r == null) {
            this.localLoading = false
            return
          }
          this.localPagination = this.showPagination && Object.assign({}, this.localPagination, {
            current: r.pageNo,//pageNo, // 返回结果中的当前分页数
            total:r.totalRows,//totalCount, // 返回结果中的总记录数
            current: r.pageNo, // pageNo, // 返回结果中的当前分页数
            total: r.totalRows, // totalCount, // 返回结果中的总记录数
            showSizeChanger: this.showSizeChanger,
            pageSize: (pagination && pagination.pageSize) ||
              this.localPagination.pageSize
          }) || false
          //防止后端数据此项出现null报错
          if(r.rows==null){
            r.rows=[]
          // 后端数据rows为null保存修复
          if (r.rows == null) {
            r.rows = []
          }
          // 为防止删除数据后导致页面当前页面数据长度为 0 ,自动翻页到上一页
          if (r.rows.length === 0 && this.showPagination && this.localPagination.current > 1) {
@ -246,6 +246,7 @@ export default {
    },
    renderAlert () {
      // 绘制统计列数据
      // eslint-disable-next-line no-unused-vars
      const needTotalItems = this.needTotalList.map((item) => {
        return (<span style="margin-right: 12px">
          {item.title}总计 <a style="font-weight: 600">{!item.customRender ? item.total : item.customRender(item.total)}</a>
@ -253,6 +254,7 @@ export default {
      })
      // 绘制 清空 按钮
      // eslint-disable-next-line no-unused-vars
      const clearItem = (typeof this.alert.clear === 'boolean' && this.alert.clear) ? (
        this.renderClear(this.clearSelected)
      ) : (this.alert !== null && typeof this.alert.clear === 'function') ? (
@ -260,9 +262,9 @@ export default {
      ) : null
      // 绘制 alert 组件
      //统一先去除alert组件
      // 统一先去除alert组件
      return ''
      /*return (
      /* return (
        <a-alert showIcon={true} style="margin-bottom: 16px">
          <template slot="message">
            <span style="margin-right: 12px">已选择: <a style="font-weight: 600">{this.selectedRows.length}</a></span>
@ -270,7 +272,7 @@ export default {
            {clearItem}
          </template>
        </a-alert>
      )*/
      ) */
    }
  },
@ -288,7 +290,7 @@ export default {
      if (k === 'rowSelection') {
        if (showAlert && this.rowSelection) {
          // 如果需要使用alert,则重新绑定 rowSelection 事件
          //console.log('this.rowSelection', this.rowSelection)
          // console.log('this.rowSelection', this.rowSelection)
          props[k] = {
            ...this.rowSelection,
            selectedRows: this.selectedRows,

+ 152 - 136
_web/src/components/tools/UserMenu.vue

@ -6,7 +6,9 @@
          <a-icon type="question-circle-o"></a-icon>
        </span>
      </a>
      <notice-icon class="action"/>
      <a-dropdown>
        <span class="action ant-dropdown-link user-dropdown-menu">
          <a-avatar class="avatar" size="small" :src="avatar"/>
@ -20,7 +22,7 @@
            </a>
          </a-menu-item>
          <a-menu-item key="5" v-if="hasPerm('sysUser:updatePwd')" >
            <a  @click="updatePwd()" >
            <a @click="updatePwd()" >
              <a-icon type="tool"/>
              <span>修改密码</span>
            </a>
@ -48,6 +50,7 @@
        </a-menu>
      </a-dropdown>
    </div>
    <a-modal
      title="切换应用"
      :visible="visible"
@ -55,7 +58,8 @@
      :confirm-loading="confirmLoading"
      @cancel="handleCancel"
    >
      <a-form  :form="form1" >
      <a-form :form="form1" >
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
@ -63,11 +67,11 @@
        >
          <a-menu
            mode="inline"
            :default-selected-keys=this.defApp
            :default-selected-keys="this.defApp"
            style="border-bottom:0px;lineHeight:62px;"
          >
            <a-menu-item v-for='(item) in userInfo.apps' :key="item.code" style="top:0px;" @click="switchApp(item.code)">
              {{item.name}}
            <a-menu-item v-for="(item) in userInfo.apps" :key="item.code" style="top:0px;" @click="switchApp(item.code)">
              {{ item.name }}
            </a-menu-item>
          </a-menu>
        </a-form-item>
@ -80,6 +84,7 @@
      @ok="handleOkUpdPwd"
      @cancel="handleCancel"
    >
      <a-form :form="form2">
        <a-form-item
          label="原密码"
@ -87,181 +92,192 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入原密码"  type="password" v-decorator="['password', {rules: [{required: true,  message: '请输入原密码!'}]}]" />
          <a-input placeholder="请输入原密码" type="password" v-decorator="['password', {rules: [{required: true, message: '请输入原密码!'}]}]" />
        </a-form-item>
        <a-form-item
          label="新密码"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入新密码" type="password" v-decorator="['newPassword', {rules: [{required: true,  message: '请输入新密码!'},{
                validator: validateToNextPassword,
              },]}]" />
          <a-input
            placeholder="请输入新密码"
            type="password"
            v-decorator="['newPassword', {rules: [{required: true, message: '请输入新密码!'},{
              validator: validateToNextPassword,
            },]}]" />
        </a-form-item>
        <a-form-item
          label="重复新密码"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请再次输入新密码" type="password" v-decorator="['confirm', {rules: [{required: true,  message: '请再次输入新密码!'},
              {
                validator: compareToFirstPassword,
              }]}]" />
          <a-input
            placeholder="请再次输入新密码"
            type="password"
            v-decorator="['confirm', {rules: [{required: true, message: '请再次输入新密码!'},
                                              {
                                                validator: compareToFirstPassword,
                                              }]}]" />
        </a-form-item>
      </a-form>
    </a-modal>
  </div>
</template>
<script>
  import NoticeIcon from '@/components/NoticeIcon'
  import { mapActions, mapGetters } from 'vuex'
  import { ALL_APPS_MENU } from '@/store/mutation-types'
  import Vue from 'vue'
  import { message } from 'ant-design-vue/es'
import NoticeIcon from '@/components/NoticeIcon'
import { mapActions, mapGetters } from 'vuex'
import { ALL_APPS_MENU } from '@/store/mutation-types'
import Vue from 'vue'
import { message } from 'ant-design-vue/es'
  export default {
    name: 'UserMenu',
    components: {
      NoticeIcon,
    },
    props: {
      mode: {
        type: String,
        // sidemenu, topmenu
        default: 'sidemenu'
export default {
  name: 'UserMenu',
  components: {
    NoticeIcon
  },
  props: {
    mode: {
      type: String,
      // sidemenu, topmenu
      default: 'sidemenu'
    }
  },
  data () {
    return {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
    },
    data() {
      return {
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 }
        },
        visible: false,
        visible_updPwd:false,
        confirmLoading: false,
        form1: this.$form.createForm(this),
        form2: this.$form.createForm(this),
        defApp:[]
      };
    },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      visible: false,
      visible_updPwd: false,
      confirmLoading: false,
      form1: this.$form.createForm(this),
      form2: this.$form.createForm(this),
      defApp: []
    }
  },
    computed: {
      ...mapGetters(['nickname', 'avatar','userInfo'])
  computed: {
    ...mapGetters(['nickname', 'avatar', 'userInfo'])
    },
    methods: {
      ...mapActions(['Logout','MenuChange','UpdatePwd']),
  },
  methods: {
    ...mapActions(['Logout', 'MenuChange', 'UpdatePwd']),
      handleLogout () {
        this.$confirm({
          title: '提示',
          content: '真的要注销登录吗 ?',
          onOk: () => {
            return this.Logout({}).then(() => {
              setTimeout(() => {
                window.location.reload()
              }, 16)
            }).catch(err => {
              this.$message.error({
                title: '错误',
                description: err.message
              })
    handleLogout () {
      this.$confirm({
        title: '提示',
        content: '真的要注销登录吗 ?',
        onOk: () => {
          return this.Logout({}).then(() => {
            setTimeout(() => {
              window.location.reload()
            }, 16)
          }).catch(err => {
            this.$message.error({
              title: '错误',
              description: err.message
            })
          },
          onCancel () {
          }
        })
      },
      /**
       * 打开切换应用框
       */
      appToggled () {
        this.visible = true;
        this.defApp.push(Vue.ls.get(ALL_APPS_MENU)[0].code)
      },
          })
        },
        onCancel () {
        }
      })
    },
      /**
       * 打开修改密码框
       */
      updatePwd () {
        this.visible_updPwd = true;
      },
    /**
     * 打开切换应用框
     */
    appToggled () {
      this.visible = true
      this.defApp.push(Vue.ls.get(ALL_APPS_MENU)[0].code)
    },
      compareToFirstPassword(rule, value, callback) {
        const form2 = this.form2;
        if (value && value !== form2.getFieldValue('newPassword')) {
          callback('请确认两次输入密码的一致性!');
        } else {
          callback();
        }
      },
      validateToNextPassword(rule, value, callback) {
        const form2 = this.form2;
        if (value && this.confirmDirty) {
          form2.validateFields(['confirm'], { force: true });
        }
        callback();
      },
    /**
     * 打开修改密码框
     */
    updatePwd () {
      this.visible_updPwd = true
    },
      switchApp(appCode){
        this.visible = false;
        this.defApp=[]
        const applicationData = this.userInfo.apps.filter(item => item.code == appCode)
        const hideMessage = message.loading('正在切换应用!', 0)
        this.MenuChange(applicationData[0]).then((res)=>{
          hideMessage()
        }).catch((err)=>{
          message.error("应用切换异常");
        });
      },
    compareToFirstPassword (rule, value, callback) {
      const form2 = this.form2
      if (value && value !== form2.getFieldValue('newPassword')) {
        // eslint-disable-next-line standard/no-callback-literal
        callback('请确认两次输入密码的一致性!')
      } else {
        callback()
      }
    },
    validateToNextPassword (rule, value, callback) {
      const form2 = this.form2
      if (value && this.confirmDirty) {
        form2.validateFields(['confirm'], { force: true })
      }
      callback()
    },
      handleOkUpdPwd(){
        const { form2: { validateFields } } = this
        validateFields((errors, values) => {
          if(!errors){
            values.id = this.userInfo.id
            this.UpdatePwd(values).then((res) =>{
              if(res.success){
                this.$message.success('修改成功')
                this.handleCancel()
              }else{
                this.$message.error('修改失败:'+res.message)
              }
            })
    switchApp (appCode) {
      this.visible = false
      this.defApp = []
      const applicationData = this.userInfo.apps.filter(item => item.code === appCode)
      const hideMessage = message.loading('正在切换应用!', 0)
      this.MenuChange(applicationData[0]).then((res) => {
        hideMessage()
      // eslint-disable-next-line handle-callback-err
      }).catch((err) => {
        message.error('应用切换异常')
      })
    },
          }
        })
      },
    handleOkUpdPwd () {
      const { form2: { validateFields } } = this
      validateFields((errors, values) => {
        if (!errors) {
          values.id = this.userInfo.id
          this.UpdatePwd(values).then((res) => {
            if (res.success) {
              this.$message.success('修改成功')
              this.handleCancel()
            } else {
              this.$message.error('修改失败:' + res.message)
            }
          })
        }
      })
    },
      handleCancel(){
        this.form1.resetFields();
        this.form2.resetFields();
        this.visible = false;
        this.visible_updPwd = false;
      }
    handleCancel () {
      this.form1.resetFields()
      this.form2.resetFields()
      this.visible = false
      this.visible_updPwd = false
    }
  }
}
</script>
<style lang="less" scoped>
  .appRedio {
    .appRedio {
    border:1px solid #91d5ff;
    padding:10px 20px;
    background: #e6f7ff;
    border-radius:2px;
    margin-bottom:10px;
    color: #91d5ff;
      color: #91d5ff;
    /*display: inline;
    margin-bottom:10px;*/
  }
    }
</style>

+ 8 - 6
_web/src/config/router.config.js

@ -9,8 +9,7 @@ export const asyncRouterMap = [
    name: 'MenuIndex.vue',
    component: BasicLayout,
    meta: { title: '首页' },
    redirect: '/dashboard/workplace'
    ,
    redirect: '/dashboard/workplace',
    children: [
      // dashboard
      {
@ -18,22 +17,25 @@ export const asyncRouterMap = [
        name: 'dashboard',
        redirect: '/dashboard/workplace',
        component: RouteView,
        meta: { title: '仪表盘', keepAlive: true, icon: bxAnaalyse, /*permission: [ 'dashboard' ] */},
        // eslint-disable-next-line standard/object-curly-even-spacing
        meta: { title: '仪表盘', keepAlive: true, icon: bxAnaalyse /* permission: [ 'dashboard' ] */ },
        children: [
          {
            path: 'analysis/:pageNo([1-9]\\d*)?',
            name: 'Analysis',
            component: () => import('@/views/system/dashboard/Analysis'),
            meta: { title: '分析页', keepAlive: true, /*permission: [ 'dashboard' ]*/ }
            // eslint-disable-next-line standard/object-curly-even-spacing
            meta: { title: '分析页', keepAlive: true /* permission: [ 'dashboard' ] */ }
          },
          {
            path: 'workplace',
            name: 'Workplace',
            component: () => import('@/views/system/dashboard/Workplace'),
            meta: { title: '工作台', keepAlive: false/*, permission: [ 'dashboard' ] */}
            // eslint-disable-next-line standard/object-curly-even-spacing
            meta: { title: '工作台', keepAlive: false/*, permission: [ 'dashboard' ] */ }
          }
        ]
      },
      }
    ]
  },
  {

+ 1 - 1
_web/src/core/bootstrap.js

@ -16,7 +16,7 @@ import {
import config from '@/config/defaultSettings'
export default function Initializer () {
  //console.log(`API_URL: ${process.env.VUE_APP_API_BASE_URL}`)
  // console.log(`API_URL: ${process.env.VUE_APP_API_BASE_URL}`)
  store.commit('SET_SIDEBAR_TYPE', Vue.ls.get(SIDEBAR_TYPE, true))
  store.commit('TOGGLE_THEME', Vue.ls.get(DEFAULT_THEME, config.navTheme))

+ 7 - 1
_web/src/core/lazy_lib/components_use.js

@ -50,6 +50,9 @@ import {
  Tree,
  Transfer,
  Empty,
  PageHeader,
  Descriptions,
  Result
} from 'ant-design-vue'
// import VueCropper from 'vue-cropper'
@ -96,6 +99,9 @@ Vue.use(TreeSelect)
Vue.use(Tree)
Vue.use(Transfer)
Vue.use(Empty)
Vue.use(PageHeader)
Vue.use(Descriptions)
Vue.use(Result)
Vue.prototype.$confirm = Modal.confirm
Vue.prototype.$message = message
@ -103,4 +109,4 @@ Vue.prototype.$notification = notification
Vue.prototype.$info = Modal.info
Vue.prototype.$success = Modal.success
Vue.prototype.$error = Modal.error
Vue.prototype.$warning = Modal.warning
Vue.prototype.$warning = Modal.warning

+ 2 - 2
_web/src/layouts/BasicLayout.vue

@ -115,8 +115,8 @@ export default {
  },
  created () {
    this.setMenus()
    /*const routes = convertRoutes(this.mainMenu.find(item => item.path === '/'))
    this.menus = (routes && routes.children) || []*/
    /* const routes = convertRoutes(this.mainMenu.find(item => item.path === '/'))
    this.menus = (routes && routes.children) || [] */
    this.collapsed = !this.sidebarOpened
  },
  mounted () {

+ 14 - 14
_web/src/layouts/Iframe.vue

@ -4,26 +4,26 @@
  import { ACCESS_TOKEN } from '@/store/mutation-types'
    export default {
      name: "Iframe",
      data(){
      name: 'Iframe',
      data () {
          return {
          }
      },
      render(){
        const { $route:{meta:{link}}}=this
        if({link}.link === ''){
      render () {
        const { $route: { meta: { link } } } = this
        if ({ link }.link === '') {
           return '404'
        }
        let url =''
        if({link}.link.indexOf("token=")>-1){
          url={link}.link+Vue.ls.get(ACCESS_TOKEN)
        }else{
          url={link}.link
        let url = ''
        if ({ link }.link.indexOf('token=') > -1) {
          url = { link }.link + Vue.ls.get(ACCESS_TOKEN)
        } else {
          url = { link }.link
        }
        let height =''
        const deviceHeight = document.documentElement.clientHeight;
        height = (Number(deviceHeight)-260) + 'px';
        let height = ''
        const deviceHeight = document.documentElement.clientHeight
        height = (Number(deviceHeight) - 260) + 'px'
        return <iframe id="iframe" height={height} src={url} style="width:100%;overflow:hidden;" frameBorder="0"></iframe>
      },
      }
   }
</script>

+ 1 - 1
_web/src/layouts/PageView.vue

@ -104,7 +104,7 @@ export default {
    getPageMeta () {
      // eslint-disable-next-line
      //文字样式//(typeof(this.title) === 'string' || !this.title) ? this.title : this.$route.meta.title
      //为了简洁改为无
      // 为了简洁改为无
      this.pageTitle = ''
      const content = this.$refs.content

+ 1 - 1
_web/src/layouts/index.js

@ -5,4 +5,4 @@ import RouteView from './RouteView'
import PageView from './PageView'
import Iframe from './Iframe'
export { UserLayout, BasicLayout, BlankLayout, RouteView, PageView ,Iframe}
export { UserLayout, BasicLayout, BlankLayout, RouteView, PageView, Iframe }

+ 1 - 7
_web/src/main.js

@ -1,14 +1,11 @@
// with polyfills
import 'core-js/stable'
import 'regenerator-runtime/runtime'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store/'
import { VueAxios } from './utils/request'
// mock
// WARNING: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.
import './mock'
@ -18,17 +15,14 @@ import './permission' // permission control
import './utils/filter' // global filter
import './components/global.less'
import { Dialog } from '@/components'
import { hasBtnPermission } from './utils/permissions' // button permission
import { sysApplication } from './utils/applocation'
Vue.config.productionTip = false
// mount axios Vue.$http and this.$http
Vue.use(VueAxios)
Vue.use(Dialog)
Vue.prototype.hasPerm = hasBtnPermission
Vue.prototype.applocation = sysApplication
Vue.config.productionTip = false
new Vue({
  router,

+ 28 - 26
_web/src/permission.js

@ -5,13 +5,13 @@ import store from './store'
import NProgress from 'nprogress' // progress bar
import '@/components/NProgress/nprogress.less' // progress bar custom style
import { setDocumentTitle, domTitle } from '@/utils/domUtil'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { ALL_APPS_MENU } from '@/store/mutation-types'
import {Modal,notification} from 'ant-design-vue'///es/notification
NProgress.configure({ showSpinner: false }) // NProgress Configuration
import { timeFix } from '@/utils/util'
import { ACCESS_TOKEN, ALL_APPS_MENU } from '@/store/mutation-types'
import { Modal, notification } from 'ant-design-vue' // NProgress Configuration
import { timeFix } from '@/utils/util'/// es/notification
NProgress.configure({ showSpinner: false })
const whiteList = ['login', 'register', 'registerResult'] // no redirect whitelist
//无默认首页的情况
// 无默认首页的情况
const defaultRoutePath = '/welcome'
router.beforeEach((to, from, next) => {
@ -19,7 +19,7 @@ router.beforeEach((to, from, next) => {
  to.meta && (typeof to.meta.title !== 'undefined' && setDocumentTitle(`${to.meta.title} - ${domTitle}`))
  if (Vue.ls.get(ACCESS_TOKEN)) {
    /* has token */
    if (to.path=== '/user/login') {
    if (to.path === '/user/login') {
      next({ path: defaultRoutePath })
      NProgress.done()
    } else {
@ -27,7 +27,7 @@ router.beforeEach((to, from, next) => {
        store
          .dispatch('GetInfo')
          .then(res => {
            if(res.menus.length<1){
            if (res.menus.length < 1) {
              Modal.error({
                title: '提示:',
                content: '无菜单权限,请联系管理员',
@ -40,23 +40,25 @@ router.beforeEach((to, from, next) => {
              })
              return
            }
            const all_app_menu=Vue.ls.get(ALL_APPS_MENU)
            // eslint-disable-next-line camelcase
            const all_app_menu = Vue.ls.get(ALL_APPS_MENU)
            let antDesignmenus
            if(all_app_menu==null){
            // eslint-disable-next-line camelcase
            if (all_app_menu == null) {
              const applocation = []
              res.apps.forEach(item=>{
                const apps={"code": "","name": "","active":"","menu":""}
                if(item.active){
                  apps.code=item.code
                  apps.name=item.name
                  apps.active =item.active
                  apps.menu=res.menus
                  antDesignmenus=res.menus
                }else{
                  apps.code=item.code
                  apps.name=item.name
                  apps.active =item.active
                  apps.menu=""
              res.apps.forEach(item => {
                const apps = { 'code': '', 'name': '', 'active': '', 'menu': '' }
                if (item.active) {
                  apps.code = item.code
                  apps.name = item.name
                  apps.active = item.active
                  apps.menu = res.menus
                  antDesignmenus = res.menus
                } else {
                  apps.code = item.code
                  apps.name = item.name
                  apps.active = item.active
                  apps.menu = ''
                }
                applocation.push(apps)
              })
@ -68,8 +70,8 @@ router.beforeEach((to, from, next) => {
                  description: `${timeFix()},欢迎回来`
                })
              }, 1000)
            }else{
              antDesignmenus=Vue.ls.get(ALL_APPS_MENU)[0].menu
            } else {
              antDesignmenus = Vue.ls.get(ALL_APPS_MENU)[0].menu
            }
            store.dispatch('GenerateRoutes', { antDesignmenus }).then(() => {
              // 动态添加可访问路由表
@ -86,7 +88,7 @@ router.beforeEach((to, from, next) => {
              }
            })
          })
          .catch((err) => {
          .catch(() => {
            store.dispatch('Logout').then(() => {
              next({ path: '/user/login', query: { redirect: to.fullPath } })
            })

+ 13 - 13
_web/src/router/generator-routers.js

@ -1,5 +1,5 @@
import { BasicLayout, BlankLayout, PageView, RouteView ,Iframe} from '@/layouts'
import { BasicLayout, BlankLayout, PageView, RouteView, Iframe } from '@/layouts'
// 前端路由表
const constantRouterComponents = {
@ -8,8 +8,8 @@ const constantRouterComponents = {
  BlankLayout: BlankLayout,
  RouteView: RouteView,
  PageView: PageView,
  Iframe:Iframe,
  '403': () => import( '@/views/system/exception/403'),
  Iframe: Iframe,
  '403': () => import('@/views/system/exception/403'),
  '404': () => import('@/views/system/exception/404'),
  '500': () => import('@/views/system/exception/500'),
@ -23,15 +23,15 @@ const constantRouterComponents = {
  'BindingSettings': () => import('@/views/system/account/settings/Binding'),
  'NotificationSettings': () => import('@/views/system/account/settings/Notification'),
  //默认首页
  'Console': () => import('@/views/system/index/welcome'),
  // 默认首页
  'Console': () => import('@/views/system/index/welcome')
}
// 前端未找到页面路由(固定不用改)、原来为 /404
const notFoundRouter = {
  path: '*', redirect: '/welcome', hidden: true
}
//个人中心页面
// 个人中心页面
const userAccount = [
  // account
  {
@ -137,7 +137,6 @@ const userAccount = [
    'component': 'Console'
  }
]
// 根级菜单
@ -176,10 +175,9 @@ export const generatorDynamicRouter = (data) => {
    routers.push(notFoundRouter)
    resolve(routers)
  }).catch(err => {
    //reject('加载菜单失败')
    // reject('加载菜单失败')
    return Promise.reject(err)
  })
}
/**
@ -191,21 +189,22 @@ export const generatorDynamicRouter = (data) => {
 */
export const generator = (routerMap, parent) => {
  return routerMap.map(item => {
    const { title, show, hideChildren, hiddenHeaderContent, target, icon,link } = item.meta || {}
    // eslint-disable-next-line no-unused-vars
    const { title, show, hideChildren, hiddenHeaderContent, target, icon, link } = item.meta || {}
    const currentRouter = {
      // 如果路由设置了 path,则作为默认 path,否则 路由地址 动态拼接生成如 /dashboard/workplace
      path: item.path || `${parent && parent.path || ''}/${item.key}`,
      // 路由名称,建议唯一
      name: item.name || item.key || '',
      // 该路由对应页面的 组件 :方案1
      //component: constantRouterComponents[item.component || item.key],
      // component: constantRouterComponents[item.component || item.key],
      // 该路由对应页面的 组件 :方案2 (动态加载)
      component: (constantRouterComponents[item.component || item.key]) || (() => import(`@/views/${item.component}`)),
      // meta: 页面标题, 菜单图标, 页面权限(供指令权限用,可去掉)
      meta: {
        title: title,
        icon: icon || undefined,
        //hiddenHeaderContent: hiddenHeaderContent,
        // hiddenHeaderContent: hiddenHeaderContent,
        target: target,
        link: link
      }
@ -222,7 +221,7 @@ export const generator = (routerMap, parent) => {
    if (!currentRouter.path.startsWith('http')) {
      currentRouter.path = currentRouter.path.replace('//', '/')
    }
    //重定向
    // 重定向
    item.redirect && (currentRouter.redirect = item.redirect)
    // 是否有子菜单,并递归处理
    if (item.children && item.children.length > 0) {
@ -242,6 +241,7 @@ export const generator = (routerMap, parent) => {
const listToTree = (list, tree, parentId) => {
  list.forEach(item => {
    // 判断是否为父级菜单
    // eslint-disable-next-line eqeqeq
    if (item.pid == parentId) {
      const child = {
        ...item,

+ 1 - 1
_web/src/store/getters.js

@ -12,7 +12,7 @@ const getters = {
  userInfo: state => state.user.info,
  addRouters: state => state.permission.addRouters,
  multiTab: state => state.app.multiTab,
  lang: state => state.i18n.lang,
  lang: state => state.i18n.lang
}
export default getters

+ 1 - 1
_web/src/store/index.js

@ -5,7 +5,7 @@ import app from './modules/app'
import user from './modules/user'
// default router permission control
//import permission from './modules/permission'
// import permission from './modules/permission'
// dynamic router permission control (Experimental)
import permission from './modules/async-router'

+ 1 - 1
_web/src/store/modules/async-router.js

@ -3,7 +3,6 @@
 */
import { constantRouterMap } from '@/config/router.config'
import { generatorDynamicRouter } from '@/router/generator-routers'
import store from '../index'
const permission = {
  state: {
@ -24,6 +23,7 @@ const permission = {
          resolve()
        })
      }).catch(err => {
        // eslint-disable-next-line no-undef
        reject(err)
      })
    }

+ 1 - 3
_web/src/store/modules/permission.js

@ -8,7 +8,6 @@ import { asyncRouterMap, constantRouterMap } from '@/config/router.config'
 * @returns {boolean}
 */
function hasPermission (permission, route) {
  // if (route.meta && route.meta.permission) {
  //   let flag = false
  //   for (let i = 0, len = permission.length; i < len; i++) {
@ -67,7 +66,7 @@ const permission = {
      return new Promise(resolve => {
        const { roles } = data
        const accessedRouters = filterAsyncRouter(asyncRouterMap, roles)
        //console.log('动态获取到的菜单列表:'+JSON.stringify(accessedRouters))
        // console.log('动态获取到的菜单列表:'+JSON.stringify(accessedRouters))
        commit('SET_ROUTERS', accessedRouters)
        resolve()
      })
@ -76,4 +75,3 @@ const permission = {
}
export default permission

+ 136 - 135
_web/src/store/modules/user.js

@ -1,159 +1,160 @@
import Vue from 'vue'
import { login, getLoginUser,logout } from '@/api/modular/system/loginManage'
import { login, getLoginUser, logout } from '@/api/modular/system/loginManage'
import { sysMenuChange } from '@/api/modular/system/menuManage'
import { sysUserUpdatePwd } from '@/api/modular/system/userManage'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { ALL_APPS_MENU } from '@/store/mutation-types'
import { ACCESS_TOKEN, ALL_APPS_MENU } from '@/store/mutation-types'
import { welcome } from '@/utils/util'
import store from '../index'
import router from '../../router'
const user = {
    state: {
      token: '',
      name: '',
      welcome: '',
      avatar: '',
      buttons: [],//按钮权限
      admintype:'',//是否是超管
      roles: [],
      info: {},
    },
  state: {
    token: '',
    name: '',
    welcome: '',
    avatar: '',
    buttons: [], // 按钮权限
    admintype: '', // 是否是超管
    roles: [],
    info: {}
  },
    mutations: {
      SET_TOKEN: (state, token) => {
  mutations: {
    SET_TOKEN: (state, token) => {
      state.token = token
    },
    SET_NAME: (state, { name, welcome }) => {
    state.name = name
    state.welcome = welcome
      state.name = name
      state.welcome = welcome
    },
    SET_AVATAR: (state, avatar) => {
      state.avatar = avatar
    },
    SET_ROLES: (state, roles) => {
      state.roles = roles
    },
    SET_INFO: (state, info) => {
      state.info = info
    },
    SET_BUTTONS: (state, buttons) => {
      state.buttons = buttons
    },
    SET_ADMINTYPE: (state, admintype) => {
      state.admintype = admintype
    }
  },
  SET_AVATAR: (state, avatar) => {
  state.avatar = avatar
},
SET_ROLES: (state, roles) => {
  state.roles = roles
},
SET_INFO: (state, info) => {
  state.info = info
},
SET_BUTTONS: (state, buttons) => {
  state.buttons = buttons
},
SET_ADMINTYPE: (state, admintype) => {
  state.admintype = admintype
}
},
actions: {
  // 登录
  Login ({ commit }, userInfo) {
    return new Promise((resolve, reject) => {
  actions: {
    // 登录
    Login ({ commit }, userInfo) {
      return new Promise((resolve, reject) => {
        login(userInfo).then(response => {
          if (!response.success) {
            reject(response.message)
            return
          }
          const result = response.data
          Vue.ls.set(ACCESS_TOKEN, result, 7 * 24 * 60 * 60 * 1000)
          commit('SET_TOKEN', result)
          resolve()
        }).catch(error => {
          reject(error)
        })
      })
    },
      login(userInfo).then(response => {
        if(!response.success){
      reject(response.message)
      return
    }
    const result = response.data
    Vue.ls.set(ACCESS_TOKEN, result, 7 * 24 * 60 * 60 * 1000)
    commit('SET_TOKEN', result)
    resolve()
  }).catch(error => {
      reject(error)
    })
  })
  },
    // 获取用户信息
    GetInfo ({ commit }) {
      return new Promise((resolve, reject) => {
        getLoginUser().then(response => {
          if (response.success) {
              const data = response.data
              commit('SET_ADMINTYPE', data.adminType)
              commit('SET_ROLES', 1)
              commit('SET_BUTTONS', data.permissions)
              commit('SET_INFO', data)
              commit('SET_NAME', { name: data.name, welcome: welcome() })
              commit('SET_AVATAR', data.avatar)
              resolve(data)
          } else {
            // eslint-disable-next-line no-undef
            reject(new Error(data.message))
          }
        }).catch(error => {
          reject(error)
        })
      })
    },
  // 获取用户信息
  GetInfo ({ commit }) {
    return new Promise((resolve, reject) => {
      getLoginUser().then(response => {
        if(response.success){
      const data = response.data
      commit('SET_ADMINTYPE',data.adminType)
      commit('SET_ROLES',1)
      commit('SET_BUTTONS', data.permissions)
      commit('SET_INFO', data)
      commit('SET_NAME', { name: data.name, welcome: welcome() })
      commit('SET_AVATAR', data.avatar)
      resolve(data)
    }else{
      reject(new Error(data.message))
    }
  }).catch(error => {
      reject(error)
    })
  })
  },
    // 登出
    Logout ({ commit, state }) {
      return new Promise((resolve) => {
        logout(state.token).then(() => {
          resolve()
        }).catch(() => {
          resolve()
        }).finally(() => {
          commit('SET_TOKEN', '')
          commit('SET_ROLES', [])
          commit('SET_BUTTONS', [])
          commit('SET_ADMINTYPE', '')
          Vue.ls.remove(ACCESS_TOKEN)
          Vue.ls.remove(ALL_APPS_MENU)
        })
      })
    },
  // 登出
  Logout ({ commit, state }) {
    return new Promise((resolve) => {
      logout(state.token).then(() => {
      resolve()
    }).catch(() => {
      resolve()
    }).finally(() => {
      commit('SET_TOKEN', '')
    commit('SET_ROLES', [])
    commit('SET_BUTTONS', [])
    commit('SET_ADMINTYPE','')
    Vue.ls.remove(ACCESS_TOKEN)
    Vue.ls.remove(ALL_APPS_MENU)
  })
  })
  },
    // 切换应用菜单
    MenuChange ({ commit }, application) {
      return new Promise((resolve) => {
        sysMenuChange({ application: application.code }).then((res) => {
          const apps = { 'code': '', 'name': '', 'active': '', 'menu': '' }
          apps.active = true
          apps.menu = res.data
          // eslint-disable-next-line camelcase
          const all_app_menu = Vue.ls.get(ALL_APPS_MENU)
          // eslint-disable-next-line camelcase
          const new_false_all_app_menu = []
          // 先去除所有默认的,以为此时切换的即将成为前端缓存默认的应用
          all_app_menu.forEach(item => {
            if (item.active) {
              item.active = false
            }
            new_false_all_app_menu.push(item)
          })
          // 此时缓存中全部都是不默认的应用
          Vue.ls.set(ALL_APPS_MENU, new_false_all_app_menu)
          apps.name = application.name
          apps.code = application.code
          const applocationR = []
          applocationR.push(apps)
          Vue.ls.set(ALL_APPS_MENU, applocationR)
          resolve(res)
          const antDesignmenus = res.data
          store.dispatch('GenerateRoutes', { antDesignmenus }).then(() => {
            router.addRoutes(store.getters.addRouters)
          })
          // 切换应用刷新整体界面,暂且取消
          // window.location.reload()
        }).catch(() => {
          resolve()
        })
      })
    },
  // 切换应用菜单
  MenuChange({ commit },application) {
    return new Promise((resolve) => {
      sysMenuChange({application:application.code}).then((res) => {
        const apps={"code": "","name": "","active":"","menu":""}
        apps.active =true
        apps.menu=res.data
        const all_app_menu=Vue.ls.get(ALL_APPS_MENU)
        const new_false_all_app_menu=[]
        //先去除所有默认的,以为此时切换的即将成为前端缓存默认的应用
        all_app_menu.forEach(item=>{
          if(item.active){
      item.active =false
    // 修改密码
    UpdatePwd ({ commit }, passwords) {
      return new Promise((resolve, reject) => {
        sysUserUpdatePwd(passwords).then((res) => {
          resolve(res)
        }).catch(() => {
          resolve()
        })
      })
    }
    new_false_all_app_menu.push(item)
  })
    //此时缓存中全部都是不默认的应用
    Vue.ls.set(ALL_APPS_MENU, new_false_all_app_menu)
    apps.name =application.name
    apps.code =application.code
    const applocationR = []
    applocationR.push(apps)
    Vue.ls.set(ALL_APPS_MENU, applocationR)
    resolve(res)
    const antDesignmenus=res.data
    store.dispatch('GenerateRoutes', { antDesignmenus }).then(() => {
      router.addRoutes(store.getters.addRouters)
    })
    //切换应用刷新整体界面,暂且取消
    //window.location.reload()
  }).catch(() => {
      resolve()
    })
  })
  },
  // 修改密码
  UpdatePwd({ commit },passwords) {
    return new Promise((resolve,reject) => {
      sysUserUpdatePwd(passwords).then((res) => {
        resolve(res)
        return
      }).catch(() => {
      resolve()
    })
  })
  }
}
}
export default user

+ 1 - 1
_web/src/utils/applocation.js

@ -6,6 +6,6 @@ import store from '@/store'
 * @author yubaoshan
 * @date 2020/06/27 02:34
 */
export function sysApplication() {
export function sysApplication () {
  return store.getters.applocation
}

+ 20 - 0
_web/src/utils/filter.js

@ -18,3 +18,23 @@ Vue.filter('dayjs', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
Vue.filter('moment', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
  return moment(dataStr).format(pattern)
})
Vue.filter('Fmoney', function (val) {
  // eslint-disable-next-line no-useless-escape
  val = val.toString().replace(/\$|\,/g, '')
  if (isNaN(val)) {
    val = '0'
  }
  // eslint-disable-next-line eqeqeq
  const sign = (val == (val = Math.abs(val)))
  val = Math.floor(val * 100 + 0.50000000001)
  let cents = val % 100
  val = Math.floor(val / 100).toString()
  if (cents < 10) {
    cents = '0' + cents
  }
  // eslint-disable-next-line no-undef
  for (let i = 0; i < Math.floor((val.length - (1 + i)) / 3); I++) {
    val = val.substring(0, val.length - (4 * i + 3)) + ',' + val.substring(val.length - (4 * i + 3))
  }
  return (((sign) ? '' : '-') + val + '.' + cents)
})

+ 3 - 3
_web/src/utils/permissions.js

@ -9,17 +9,17 @@ export function actionToObject (json) {
  return []
}
/**
 * 控制按钮是否显示
 *
 * @author yubaoshan
 * @date 2020/06/27 02:34
 */
export function hasBtnPermission(permission) {
export function hasBtnPermission (permission) {
  const myBtns = store.getters.buttons
  const admintype = store.getters.admintype
  if(admintype == '1'){
  // eslint-disable-next-line eqeqeq
  if (admintype == '1') {
     return true
  }
  return myBtns.indexOf(permission) > -1

+ 10 - 11
_web/src/utils/request.js

@ -1,7 +1,7 @@
import Vue from 'vue'
import axios from 'axios'
import store from '@/store'
import { message, Modal, notification } from 'ant-design-vue' ///es/notification
import { message, Modal, notification } from 'ant-design-vue' /// es/notification
import { VueAxios } from './axios'
import { ACCESS_TOKEN } from '@/store/mutation-types'
@ -12,7 +12,6 @@ const service = axios.create({
})
const err = (error) => {
  if (error.response) {
    const data = error.response.data
    const token = Vue.ls.get(ACCESS_TOKEN)
@ -37,9 +36,9 @@ const err = (error) => {
      if (token) {
        store.dispatch('Logout').then(() => {
          setTimeout(() => {
          window.location.reload()
        }, 1500)
      })
            window.location.reload()
          }, 1500)
        })
      }
    }
  }
@ -61,7 +60,7 @@ service.interceptors.request.use(config => {
 */
service.interceptors.response.use((response) => {
  if (response.request.responseType === 'blob') {
  return response
    return response
  }
  const code = response.data.code
  if (code === 1011006 || code === 1011007 || code === 1011008 || code === 1011009) {
@ -70,10 +69,10 @@ service.interceptors.response.use((response) => {
      content: response.data.message,
      okText: '重新登录',
      onOk: () => {
      Vue.ls.remove(ACCESS_TOKEN)
      window.location.reload()
    }
  })
        Vue.ls.remove(ACCESS_TOKEN)
        window.location.reload()
      }
    })
  } else if (code === 1013002 || code === 1016002 || code === 1015002) {
    message.error(response.data.message)
    return response.data
@ -84,7 +83,7 @@ service.interceptors.response.use((response) => {
const installer = {
  vm: {},
  install(Vue) {
  install (Vue) {
    Vue.use(VueAxios, service)
  }
}

+ 153 - 153
_web/src/views/system/account/center/Index.vue

@ -94,193 +94,193 @@
</template>
<script>
  import { PageView, RouteView } from '@/layouts'
  import { AppPage, ArticlePage, ProjectPage } from './page'
import { PageView, RouteView } from '@/layouts'
import { AppPage, ArticlePage, ProjectPage } from './page'
  import { mapGetters } from 'vuex'
import { mapGetters } from 'vuex'
  export default {
    components: {
      RouteView,
      PageView,
      AppPage,
      ArticlePage,
      ProjectPage
    },
    data () {
      return {
        tags: ['很有想法的', '专注设计', '辣~', '大长腿', '川妹子', '海纳百川'],
export default {
  components: {
    RouteView,
    PageView,
    AppPage,
    ArticlePage,
    ProjectPage
  },
  data () {
    return {
      tags: ['很有想法的', '专注设计', '辣~', '大长腿', '川妹子', '海纳百川'],
        tagInputVisible: false,
        tagInputValue: '',
      tagInputVisible: false,
      tagInputValue: '',
        teams: [],
        teamSpinning: true,
      teams: [],
      teamSpinning: true,
        tabListNoTitle: [
          {
            key: 'article',
            tab: '文章(8)'
          },
          {
            key: 'app',
            tab: '应用(8)'
          },
          {
            key: 'project',
            tab: '项目(8)'
          }
        ],
        noTitleKey: 'app'
      }
    },
    mounted () {
      this.getTeams()
    },
    methods: {
      ...mapGetters(['nickname', 'avatar']),
      getTeams () {
        this.$http.get('/workplace/teams').then(res => {
          this.teams = res.result
          this.teamSpinning = false
        })
      },
      tabListNoTitle: [
        {
          key: 'article',
          tab: '文章(8)'
        },
        {
          key: 'app',
          tab: '应用(8)'
        },
        {
          key: 'project',
          tab: '项目(8)'
        }
      ],
      noTitleKey: 'app'
    }
  },
  mounted () {
    this.getTeams()
  },
  methods: {
    ...mapGetters(['nickname', 'avatar']),
      handleTabChange (key, type) {
        this[type] = key
      },
    getTeams () {
      this.$http.get('/workplace/teams').then(res => {
        this.teams = res.result
        this.teamSpinning = false
      })
    },
      handleTagClose (removeTag) {
        const tags = this.tags.filter(tag => tag !== removeTag)
        this.tags = tags
      },
    handleTabChange (key, type) {
      this[type] = key
    },
      showTagInput () {
        this.tagInputVisible = true
        this.$nextTick(() => {
          this.$refs.tagInput.focus()
        })
      },
    handleTagClose (removeTag) {
      const tags = this.tags.filter(tag => tag !== removeTag)
      this.tags = tags
    },
      handleInputChange (e) {
        this.tagInputValue = e.target.value
      },
    showTagInput () {
      this.tagInputVisible = true
      this.$nextTick(() => {
        this.$refs.tagInput.focus()
      })
    },
      handleTagInputConfirm () {
        const inputValue = this.tagInputValue
        let tags = this.tags
        if (inputValue && !tags.includes(inputValue)) {
          tags = [...tags, inputValue]
        }
    handleInputChange (e) {
      this.tagInputValue = e.target.value
    },
        Object.assign(this, {
          tags,
          tagInputVisible: false,
          tagInputValue: ''
        })
    handleTagInputConfirm () {
      const inputValue = this.tagInputValue
      let tags = this.tags
      if (inputValue && !tags.includes(inputValue)) {
        tags = [...tags, inputValue]
      }
      Object.assign(this, {
        tags,
        tagInputVisible: false,
        tagInputValue: ''
      })
    }
  }
}
</script>
<style lang="less" scoped>
  .page-header-wrapper-grid-content-main {
    width: 100%;
    height: 100%;
    min-height: 100%;
    transition: 0.3s;
.page-header-wrapper-grid-content-main {
  width: 100%;
  height: 100%;
  min-height: 100%;
  transition: 0.3s;
    .account-center-avatarHolder {
      text-align: center;
      margin-bottom: 24px;
  .account-center-avatarHolder {
    text-align: center;
    margin-bottom: 24px;
      & > .avatar {
        margin: 0 auto;
        width: 104px;
        height: 104px;
        margin-bottom: 20px;
        border-radius: 50%;
        overflow: hidden;
        img {
          height: 100%;
          width: 100%;
        }
    & > .avatar {
      margin: 0 auto;
      width: 104px;
      height: 104px;
      margin-bottom: 20px;
      border-radius: 50%;
      overflow: hidden;
      img {
        height: 100%;
        width: 100%;
      }
    }
      .username {
        color: rgba(0, 0, 0, 0.85);
        font-size: 20px;
        line-height: 28px;
        font-weight: 500;
        margin-bottom: 4px;
      }
    .username {
      color: rgba(0, 0, 0, 0.85);
      font-size: 20px;
      line-height: 28px;
      font-weight: 500;
      margin-bottom: 4px;
    }
  }
    .account-center-detail {
      p {
        margin-bottom: 8px;
        padding-left: 26px;
        position: relative;
      }
  .account-center-detail {
    p {
      margin-bottom: 8px;
      padding-left: 26px;
      position: relative;
    }
      i {
        position: absolute;
        height: 14px;
        width: 14px;
        left: 0;
        top: 4px;
        background: url(https://gw.alipayobjects.com/zos/rmsportal/pBjWzVAHnOOtAUvZmZfy.svg);
      }
    i {
      position: absolute;
      height: 14px;
      width: 14px;
      left: 0;
      top: 4px;
      background: url(https://gw.alipayobjects.com/zos/rmsportal/pBjWzVAHnOOtAUvZmZfy.svg);
    }
      .title {
        background-position: 0 0;
      }
      .group {
        background-position: 0 -22px;
      }
      .address {
        background-position: 0 -44px;
      }
    .title {
      background-position: 0 0;
    }
    .group {
      background-position: 0 -22px;
    }
    .address {
      background-position: 0 -44px;
    }
  }
    .account-center-tags {
      .ant-tag {
        margin-bottom: 8px;
      }
  .account-center-tags {
    .ant-tag {
      margin-bottom: 8px;
    }
  }
    .account-center-team {
      .members {
        a {
          display: block;
          margin: 12px 0;
  .account-center-team {
    .members {
      a {
        display: block;
        margin: 12px 0;
        line-height: 24px;
        height: 24px;
        .member {
          font-size: 14px;
          color: rgba(0, 0, 0, 0.65);
          line-height: 24px;
          height: 24px;
          .member {
            font-size: 14px;
            color: rgba(0, 0, 0, 0.65);
            line-height: 24px;
            max-width: 100px;
            vertical-align: top;
            margin-left: 12px;
            transition: all 0.3s;
            display: inline-block;
          }
          &:hover {
            span {
              color: #1890ff;
            }
          max-width: 100px;
          vertical-align: top;
          margin-left: 12px;
          transition: all 0.3s;
          display: inline-block;
        }
        &:hover {
          span {
            color: #1890ff;
          }
        }
      }
    }
  }
    .tagsTitle,
    .teamTitle {
      font-weight: 500;
      color: rgba(0, 0, 0, 0.85);
      margin-bottom: 12px;
    }
  .tagsTitle,
  .teamTitle {
    font-weight: 500;
    color: rgba(0, 0, 0, 0.85);
    margin-bottom: 12px;
  }
}
</style>

+ 26 - 26
_web/src/views/system/account/center/page/Article.vue

@ -26,36 +26,36 @@
</template>
<script>
  import { ArticleListContent } from '@/components'
import { ArticleListContent } from '@/components'
  export default {
    name: 'Article',
    components: {
      ArticleListContent
    },
    data () {
      return {
        loading: true,
        loadingMore: false,
        data: []
      }
    },
    mounted () {
      this.getList()
export default {
  name: 'Article',
  components: {
    ArticleListContent
  },
  data () {
    return {
      loading: true,
      loadingMore: false,
      data: []
    }
  },
  mounted () {
    this.getList()
  },
  methods: {
    getList () {
      this.$http.get('/list/article').then(res => {
        console.log('res', res)
        this.data = res.result
        this.loading = false
      })
    },
    methods: {
      getList () {
        this.$http.get('/list/article').then(res => {
          console.log('res', res)
          this.data = res.result
          this.loading = false
        })
      },
      loadMore () {
        this.loadingMore = false
      }
    loadMore () {
      this.loadingMore = false
    }
  }
}
</script>
<style scoped>

+ 9 - 10
_web/src/views/system/app/addForm.vue

@ -23,7 +23,7 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入应用名称" v-decorator="['name', {rules: [{required: true,  message: '请输入应用名称!'}]}]" />
          <a-input placeholder="请输入应用名称" v-decorator="['name', {rules: [{required: true, message: '请输入应用名称!'}]}]" />
        </a-form-item>
        <a-form-item
@ -41,7 +41,6 @@
  </a-modal>
</template>
<script>
  import { sysAppAdd } from '@/api/modular/system/appManage'
@ -63,10 +62,10 @@
    },
    methods: {
      //初始化方法
      // 初始化方法
      add () {
        this.visible = true
        this.form.getFieldDecorator('active',{initialValue:'N'})
        this.form.getFieldDecorator('active', { initialValue: 'N' })
      },
      handleSubmit () {
@ -76,14 +75,14 @@
          if (!errors) {
            sysAppAdd(values).then((res) => {
              this.confirmLoading = false
              if(res.success){
              if (res.success) {
                this.$message.success('新增成功')
                this.handleCancel ()
                this.handleCancel()
                this.$emit('ok', values)
              }else{
                this.$message.error('新增失败:'+res.message)
              } else {
                this.$message.error('新增失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -92,7 +91,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 15 - 16
_web/src/views/system/app/editForm.vue

@ -31,7 +31,7 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入应用名称" v-decorator="['name', {rules: [{required: true,  message: '请输入应用名称!'}]}]" />
          <a-input placeholder="请输入应用名称" v-decorator="['name', {rules: [{required: true, message: '请输入应用名称!'}]}]" />
        </a-form-item>
        <a-form-item
@ -48,7 +48,6 @@
  </a-modal>
</template>
<script>
  import { sysAppEdit } from '@/api/modular/system/appManage'
@ -65,25 +64,25 @@
        },
        visible: false,
        confirmLoading: false,
        visibleDef:false,
        visibleDef: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      edit (record) {
        this.visible = true
        setTimeout(()=>{
        setTimeout(() => {
          this.form.setFieldsValue(
            {
              id:record.id,
              name:record.name,
              code:record.code,
              active:record.active,
              id: record.id,
              name: record.name,
              code: record.code,
              active: record.active
            }
          );
        },100)
          )
        }, 100)
      },
      handleSubmit () {
@ -92,15 +91,15 @@
        validateFields((errors, values) => {
          if (!errors) {
            sysAppEdit(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('编辑成功')
                this.visible = false
                this.confirmLoading = false
                this.$emit('ok', values)
              }else{
                this.$message.error('编辑失败:'+res.message)
              } else {
                this.$message.error('编辑失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -109,7 +108,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 95 - 95
_web/src/views/system/app/index.vue

@ -1,75 +1,73 @@
/* eslint-disable eqeqeq */
<template>
  <a-card :bordered="false" >
    <a-spin :spinning="loading">
    <div class="table-page-search-wrapper" v-if="hasPerm('sysApp:page')">
      <a-form layout="inline">
        <a-row :gutter="48">
          <a-col :md="8" :sm="24">
            <a-form-item label="应用名称">
              <a-input v-model="queryParam.name" allow-clear placeholder="请输入应用名称"/>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="24">
            <a-form-item label="唯一编码">
              <a-input v-model="queryParam.code" allow-clear placeholder="请输入唯一编码"/>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="24">
            <span class="table-page-search-submitButtons">
              <a-button type="primary"  @click="$refs.table.refresh(true)">查询</a-button>
              <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <div class="table-operator" v-if="hasPerm('sysApp:add')" >
      <a-button type="primary" v-if="hasPerm('sysApp:add')" icon="plus" @click="$refs.addForm.add()">新增应用</a-button>
    </div>
    <s-table
      ref="table"
      size="default"
      :columns="columns"
      :data="loadData"
      :alert="true"
      :rowKey="(record) => record.id"
      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onChange }"
    >
      <span slot="active" slot-scope="text">
        {{ activeFilter(text) }}
      </span>
      <span slot="status" slot-scope="text">
        {{ statusFilter(text) }}
      </span>
      <span slot="action" slot-scope="text, record">
        <a v-if="hasPerm('sysApp:edit')" @click="$refs.editForm.edit(record)">编辑</a>
        <a-divider  type="vertical" v-if="hasPerm('sysApp:edit') & hasPerm('sysApp:delete')" />
        <a-popconfirm v-if="hasPerm('sysApp:delete')" placement="topRight" title="确认删除?" @confirm="() => sysAppDelete(record)">
      <div class="table-page-search-wrapper" v-if="hasPerm('sysApp:page')">
        <a-form layout="inline">
          <a-row :gutter="48">
            <a-col :md="8" :sm="24">
              <a-form-item label="应用名称">
                <a-input v-model="queryParam.name" allow-clear placeholder="请输入应用名称"/>
              </a-form-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-item label="唯一编码">
                <a-input v-model="queryParam.code" allow-clear placeholder="请输入唯一编码"/>
              </a-form-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <span class="table-page-search-submitButtons">
                <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
                <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
              </span>
            </a-col>
          </a-row>
        </a-form>
      </div>
      <div class="table-operator" v-if="hasPerm('sysApp:add')" >
        <a-button type="primary" v-if="hasPerm('sysApp:add')" icon="plus" @click="$refs.addForm.add()">新增应用</a-button>
      </div>
      <s-table
        ref="table"
        size="default"
        :columns="columns"
        :data="loadData"
        :alert="true"
        :rowKey="(record) => record.id"
        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onChange }"
      >
        <span slot="active" slot-scope="text">
          {{ activeFilter(text) }}
        </span>
        <span slot="status" slot-scope="text">
          {{ statusFilter(text) }}
        </span>
        <span slot="action" slot-scope="text, record">
          <a v-if="hasPerm('sysApp:edit')" @click="$refs.editForm.edit(record)">编辑</a>
          <a-divider type="vertical" v-if="hasPerm('sysApp:edit') & hasPerm('sysApp:delete')" />
          <a-popconfirm v-if="hasPerm('sysApp:delete')" placement="topRight" title="确认删除?" @confirm="() => sysAppDelete(record)">
            <a>删除</a>
        </a-popconfirm>
          </a-popconfirm>
        <a-divider  type="vertical" v-if="hasPerm('sysApp:setAsDefault') & hasPerm('sysApp:delete') & record.active == 'N' || hasPerm('sysApp:edit') & hasPerm('sysApp:setAsDefault')  & record.active == 'N'" />
          <a-divider type="vertical" v-if="hasPerm('sysApp:setAsDefault') & hasPerm('sysApp:delete') & record.active == 'N' || hasPerm('sysApp:edit') & hasPerm('sysApp:setAsDefault') & record.active == 'N'" />
        <a-popconfirm v-if="hasPerm('sysApp:setAsDefault') & record.active == 'N'" placement="topRight" title="设置为默认应用?" @confirm="() => sysDefault(record)">
          <a>设为默认</a>
       </a-popconfirm>
          <a-popconfirm v-if="hasPerm('sysApp:setAsDefault') & record.active == 'N'" placement="topRight" title="设置为默认应用?" @confirm="() => sysDefault(record)">
            <a>设为默认</a>
          </a-popconfirm>
      </span>
    </s-table>
        </span>
      </s-table>
    <add-form ref="addForm" @ok="handleOk" />
    <edit-form ref="editForm" @ok="handleOk" />
      <add-form ref="addForm" @ok="handleOk" />
      <edit-form ref="editForm" @ok="handleOk" />
    </a-spin>
  </a-card>
</template>
<script>
  import { STable } from '@/components'
  import { getAppPage,sysAppDelete ,sysAppSetAsDefault} from '@/api/modular/system/appManage'
  import { getAppPage, sysAppDelete, sysAppSetAsDefault } from '@/api/modular/system/appManage'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  import editForm from './editForm'
  import addForm from './addForm'
@ -82,7 +80,7 @@
    },
    data () {
      return {
        //description: '面包屑说明',
        // description: '面包屑说明',
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 }
@ -116,21 +114,21 @@
        ],
        // 加载数据方法 必须为 Promise 对象
        loadData: parameter => {
          return getAppPage(Object.assign(parameter, this.queryParam)).then((res)=>{
          return getAppPage(Object.assign(parameter, this.queryParam)).then((res) => {
            return res.data
          })
        },
        loading:false,
        loading: false,
        selectedRowKeys: [],
        selectedRows: [],
        statusDict:[],
        activeDict:[],
        statusDict: [],
        activeDict: []
      }
    },
    created(){
    created () {
      this.sysDictTypeDropDown()
      if(this.hasPerm('sysApp:edit') || this.hasPerm('sysApp:delete') || this.hasPerm('sysApp:setAsDefault')){
      if (this.hasPerm('sysApp:edit') || this.hasPerm('sysApp:delete') || this.hasPerm('sysApp:setAsDefault')) {
        this.columns.push({
          title: '操作',
          width: '200px',
@ -142,27 +140,29 @@
    methods: {
      activeFilter (active) {
        const active_value = this.activeDict.filter(item => item.code == active)
        if(active_value.length>0){
          return active_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.activeDict.filter(item => item.code == active)
        if (values.length > 0) {
          return values[0].value
        }
      },
      statusFilter (status) {
        const status_value = this.statusDict.filter(item => item.code == status)
        if(status_value.length>0){
          return status_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.statusDict.filter(item => item.code == status)
        if (values.length > 0) {
          return values[0].value
        }
      },
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown(){
        sysDictTypeDropDown({code:'yes_or_no'}).then((res)=>{
          this.activeDict=res.data
      sysDictTypeDropDown () {
        sysDictTypeDropDown({ code: 'yes_or_no' }).then((res) => {
          this.activeDict = res.data
        })
        sysDictTypeDropDown({code:'common_status'}).then((res)=>{
          this.statusDict=res.data
        sysDictTypeDropDown({ code: 'common_status' }).then((res) => {
          this.statusDict = res.data
        })
      },
@ -170,40 +170,40 @@
        this.$refs.table.refresh()
      },
      sysDefault(record){
        this.loading=true
        sysAppSetAsDefault({id:record.id}).then((res)=>{
          this.loading=false
           if(res.success){
      sysDefault (record) {
        this.loading = true
        sysAppSetAsDefault({ id: record.id }).then((res) => {
          this.loading = false
           if (res.success) {
             this.$message.success('设置成功')
             this.$refs.table.refresh()
           }else{
             this.$message.error('设置失败:'+res.message)
           } else {
             this.$message.error('设置失败:' + res.message)
           }
        })
      },
      /**
       * 删除应用
       */
      sysAppDelete(record){
        this.loading=true
        sysAppDelete(record).then((res)=>{
          this.loading=false
          if(res.success) {
      sysAppDelete (record) {
        this.loading = true
        sysAppDelete(record).then((res) => {
          this.loading = false
          if (res.success) {
            this.$message.success('删除成功')
            this.$refs.table.refresh()
          }else{
            this.$message.error('删除失败:'+res.message)
          } else {
            this.$message.error('删除失败:' + res.message)
          }
        }).catch((err)=>{
          this.$message.error('删除错误:'+err.message)
        }).catch((err) => {
          this.$message.error('删除错误:' + err.message)
        })
      },
      onChange (selectedRowKeys, selectedRows) {
        this.selectedRowKeys = selectedRowKeys
        this.selectedRows = selectedRows
      },
    },
      }
    }
  }
</script>
<style scoped>
@ -215,4 +215,4 @@
    margin-right: 8px;
  }
</style>
</style>

+ 45 - 48
_web/src/views/system/config/addForm.vue

@ -9,23 +9,23 @@
  >
    <a-spin :spinning="formLoading">
      <a-form :form="form">
      <a-form-item
        label="参数名称"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入参数名称" v-decorator="['name', {rules: [{required: true, message: '请输入参数名称!'}]}]" />
      </a-form-item>
        <a-form-item
          label="参数名称"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入参数名称" v-decorator="['name', {rules: [{required: true, message: '请输入参数名称!'}]}]" />
        </a-form-item>
      <a-form-item
        label="唯一编码"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true,  message: '请输入唯一编码!'}]}]" />
      </a-form-item>
        <a-form-item
          label="唯一编码"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true, message: '请输入唯一编码!'}]}]" />
        </a-form-item>
        <a-form-item
          label="系统参数"
@ -33,7 +33,7 @@
          :wrapperCol="wrapperCol"
        >
          <a-radio-group v-decorator="['sysFlag',{rules: [{ required: true, message: '请选择是否为系统参数!' }]}]" >
            <a-radio-button value="Y"  > 是 </a-radio-button>
            <a-radio-button value="Y" > 是 </a-radio-button>
            <a-radio-button value="N" >  否 </a-radio-button>
          </a-radio-group>
        </a-form-item>
@ -45,26 +45,26 @@
          has-feedback
        >
          <a-select style="width: 100%" placeholder="请选择所属分类" v-decorator="['groupCode', {rules: [{ required: true, message: '请选择取所属分类!' }]}]" >
            <a-select-option v-for='(item,index) in groupCodeList' :key="index" :value="item.code" >{{item.value}}</a-select-option>
            <a-select-option v-for="(item,index) in groupCodeList" :key="index" :value="item.code" >{{ item.value }}</a-select-option>
          </a-select>
        </a-form-item>
      <a-form-item
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        label="参数值"
      >
        <a-input placeholder="请输入参数值" v-decorator="['value', {rules: [{required: true, message: '请输入参数值!'}]}]" />
      </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="参数值"
        >
          <a-input placeholder="请输入参数值" v-decorator="['value', {rules: [{required: true, message: '请输入参数值!'}]}]" />
        </a-form-item>
      <a-form-item
        label="备注"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-textarea :rows="4" placeholder="请输入备注"  v-decorator="['remark']"></a-textarea>
      </a-form-item>
        <a-form-item
          label="备注"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']"></a-textarea>
        </a-form-item>
      </a-form>
@ -72,9 +72,8 @@
  </a-modal>
</template>
<script>
  import { sysDictTypeDropDown,sysConfigAdd } from '@/api/modular/system/configManage'
  import { sysDictTypeDropDown, sysConfigAdd } from '@/api/modular/system/configManage'
  export default {
    data () {
      return {
@ -88,15 +87,13 @@
        },
        visible: false,
        confirmLoading: false,
        formLoading :true,
        groupCodeList:[],
        formLoading: true,
        groupCodeList: [],
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      add () {
        this.visible = true
        this.sysDictTypeDropDown()
@ -105,9 +102,9 @@
      /**
       * 获取所属分类
       */
      sysDictTypeDropDown(){
        sysDictTypeDropDown({code:'consts_type'}).then((res)=>{
          this.groupCodeList=res.data
      sysDictTypeDropDown () {
        sysDictTypeDropDown({ code: 'consts_type' }).then((res) => {
          this.groupCodeList = res.data
          this.formLoading = false
        })
      },
@ -119,14 +116,14 @@
          if (!errors) {
            sysConfigAdd(values).then((res) => {
              this.confirmLoading = false
              if(res.success){
              if (res.success) {
                this.$message.success('新增成功')
                this.$emit('ok', values)
                this.handleCancel()
              }else{
                this.$message.error('新增失败:'+res.message)
              } else {
                this.$message.error('新增失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -135,7 +132,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 48 - 50
_web/src/views/system/config/editForm.vue

@ -19,14 +19,14 @@
          <a-input v-decorator="['id']" />
        </a-form-item>
      <a-form-item
        label="参数名称"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入参数名称" v-decorator="['name', {rules: [{required: true, message: '请输入参数名称!'}]}]" />
      </a-form-item>
        <a-form-item
          label="参数名称"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入参数名称" v-decorator="['name', {rules: [{required: true, message: '请输入参数名称!'}]}]" />
        </a-form-item>
        <a-form-item
          label="唯一编码"
@ -34,7 +34,7 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入唯一编码" :disabled="editDisabled" v-decorator="['code', {rules: [{required: true,  message: '请输入唯一编码!'}]}]" />
          <a-input placeholder="请输入唯一编码" :disabled="editDisabled" v-decorator="['code', {rules: [{required: true, message: '请输入唯一编码!'}]}]" />
        </a-form-item>
        <a-form-item
@ -42,8 +42,8 @@
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
        >
          <a-radio-group :disabled="editDisabled"  v-decorator="['sysFlag',{rules: [{ required: true, message: '请选择是否为系统参数!' }]}]" >
            <a-radio-button value="Y"  > 是 </a-radio-button>
          <a-radio-group :disabled="editDisabled" v-decorator="['sysFlag',{rules: [{ required: true, message: '请选择是否为系统参数!' }]}]" >
            <a-radio-button value="Y" > 是 </a-radio-button>
            <a-radio-button value="N" >  否 </a-radio-button>
          </a-radio-group>
        </a-form-item>
@ -54,19 +54,19 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-select :disabled="editDisabled"  style="width: 100%" placeholder="请选择所属分类" v-decorator="['groupCode', {rules: [{ required: true, message: '请选择取所属分类!' }]}]" >
            <a-select-option v-for='(item,index) in groupCodeList' :key="index" :value="item.code" >{{item.value}}</a-select-option>
          <a-select :disabled="editDisabled" style="width: 100%" placeholder="请选择所属分类" v-decorator="['groupCode', {rules: [{ required: true, message: '请选择取所属分类!' }]}]" >
            <a-select-option v-for="(item,index) in groupCodeList" :key="index" :value="item.code" >{{ item.value }}</a-select-option>
          </a-select>
        </a-form-item>
      <a-form-item
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        label="参数值"
        has-feedback
      >
        <a-input placeholder="请输入参数值" v-decorator="['value', {rules: [{required: true, message: '请输入参数值!'}]}]" />
      </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="参数值"
          has-feedback
        >
          <a-input placeholder="请输入参数值" v-decorator="['value', {rules: [{required: true, message: '请输入参数值!'}]}]" />
        </a-form-item>
        <a-form-item
          label="备注"
@ -74,7 +74,7 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" placeholder="请输入备注"  v-decorator="['remark']"></a-textarea>
          <a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']"></a-textarea>
        </a-form-item>
      </a-form>
@ -83,9 +83,8 @@
  </a-modal>
</template>
<script>
  import { sysDictTypeDropDown,sysConfigEdit } from '@/api/modular/system/configManage'
  import { sysDictTypeDropDown, sysConfigEdit } from '@/api/modular/system/configManage'
  export default {
    data () {
@ -100,32 +99,31 @@
        },
        visible: false,
        confirmLoading: false,
        formLoading:true,
        groupCodeList:[],
        editDisabled:false,
        formLoading: true,
        groupCodeList: [],
        editDisabled: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      edit (record) {
        this.visible = true
        setTimeout(()=>{
        setTimeout(() => {
          this.form.setFieldsValue(
            {
              id:record.id,
              name:record.name,
              code:record.code,
              groupCode:record.groupCode,
              sysFlag:record.sysFlag,
              value:record.value,
              remark:record.remark,
              id: record.id,
              name: record.name,
              code: record.code,
              groupCode: record.groupCode,
              sysFlag: record.sysFlag,
              value: record.value,
              remark: record.remark
            }
          );
        },100)
        if(record.sysFlag == 'Y'){
          )
        }, 100)
        // eslint-disable-next-line eqeqeq
        if (record.sysFlag == 'Y') {
           this.editDisabled = true
        }
        this.sysDictTypeDropDown()
@ -134,9 +132,9 @@
      /**
       * 获取所属分类
       */
      sysDictTypeDropDown(){
        sysDictTypeDropDown({code:'consts_type'}).then((res)=>{
          this.groupCodeList=res.data
      sysDictTypeDropDown () {
        sysDictTypeDropDown({ code: 'consts_type' }).then((res) => {
          this.groupCodeList = res.data
          this.formLoading = false
        })
      },
@ -148,14 +146,14 @@
          if (!errors) {
            sysConfigEdit(values).then((res) => {
              this.confirmLoading = false
              if(res.success){
              if (res.success) {
                this.$message.success('编辑成功')
                this.$emit('ok', values)
                this.handleCancel ()
              }else{
                this.$message.error('编辑失败:'+res.message)
                this.handleCancel()
              } else {
                this.$message.error('编辑失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -164,7 +162,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
        this.editDisabled = false
      }

+ 68 - 65
_web/src/views/system/config/index.vue

@ -1,7 +1,6 @@
<template>
  <a-card :bordered="false">
    <div class="table-page-search-wrapper"  v-if="hasPerm('sysConfig:page')">
    <div class="table-page-search-wrapper" v-if="hasPerm('sysConfig:page')">
      <a-form layout="inline">
        <a-row :gutter="48">
          <a-col :md="8" :sm="24">
@ -18,7 +17,7 @@
            <a-col :md="8" :sm="24">
              <a-form-item label="所属分类">
                <a-select v-model="queryParam.groupCode" placeholder="请选择所属分类" allow-clear>
                  <a-select-option v-for='(item,index) in groupCodeDictTypeDropDown' :key="index" :value="item.code" >{{item.value}}</a-select-option>
                  <a-select-option v-for="(item,index) in groupCodeDictTypeDropDown" :key="index" :value="item.code" >{{ item.value }}</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
@ -26,7 +25,7 @@
          <a-col :md="!advanced && 8 || 24" :sm="24" >
            <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
              <a-button type="primary" @click="$refs.table.refresh(true)" >查询</a-button>
               <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
              <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
              <a @click="toggleAdvanced" style="margin-left: 8px">
                {{ advanced ? '收起' : '展开' }}
                <a-icon :type="advanced ? 'up' : 'down'"/>
@ -36,53 +35,58 @@
        </a-row>
      </a-form>
    </div>
    <div class="table-operator" v-if="hasPerm('sysConfig:add')" >
      <a-button type="primary" v-if="hasPerm('sysConfig:add')" icon="plus" @click="$refs.addForm.add()">新增配置</a-button>
    </div>
        <s-table
          ref="table"
          size="default"
          :columns="columns"
          :data="loadData"
          :alert="true"
          :rowKey="(record) => record.code"
          :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
        >
          <span slot="groupCode" slot-scope="text">
              {{ groupCodeFilter(text)  }}
          </span>
          <span slot="action" slot-scope="text, record">
            <a v-if="hasPerm('sysConfig:edit')" @click="$refs.editForm.edit(record)">编辑</a>
            <a-divider type="vertical" v-if="hasPerm('sysConfig:edit') & hasPerm('sysConfig:delete')"/>
            <a-popconfirm v-if="hasPerm('sysConfig:delete')" placement="topRight" title="确认删除?" @confirm="() => sysConfigDelete(record)">
              <a>删除</a>
            </a-popconfirm>
          </span>
        </s-table>
    <add-form ref="addForm" @ok="handleOk" />
    <edit-form ref="editForm" @ok="handleOk" />
    <s-table
      ref="table"
      size="default"
      :columns="columns"
      :data="loadData"
      :alert="true"
      :rowKey="(record) => record.code"
      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
    >
      <span slot="name" slot-scope="text">
        <ellipsis :length="20" tooltip>{{ text }}</ellipsis>
      </span>
      <span slot="code" slot-scope="text">
        <ellipsis :length="10" tooltip>{{ text }}</ellipsis>
      </span>
      <span slot="value" slot-scope="text">
        <ellipsis :length="16" tooltip>{{ text }}</ellipsis>
      </span>
      <span slot="remark" slot-scope="text">
        <ellipsis :length="16" tooltip>{{ text }}</ellipsis>
      </span>
      <span slot="groupCode" slot-scope="text">
        {{ groupCodeFilter(text) }}
      </span>
      <span slot="action" slot-scope="text, record">
        <a v-if="hasPerm('sysConfig:edit')" @click="$refs.editForm.edit(record)">编辑</a>
        <a-divider type="vertical" v-if="hasPerm('sysConfig:edit') & hasPerm('sysConfig:delete')"/>
        <a-popconfirm v-if="hasPerm('sysConfig:delete')" placement="topRight" title="确认删除?" @confirm="() => sysConfigDelete(record)">
          <a>删除</a>
        </a-popconfirm>
      </span>
    </s-table>
    <add-form ref="addForm" @ok="handleOk" v-if="hasPerm('sysConfig:add')"/>
    <edit-form ref="editForm" @ok="handleOk" v-if="hasPerm('sysConfig:edit')"/>
  </a-card>
</template>
<script>
  import { STable } from '@/components'
  import { sysConfigPage ,sysConfigDelete } from '@/api/modular/system/configManage'
  import { STable, Ellipsis } from '@/components'
  import { sysConfigPage, sysConfigDelete } from '@/api/modular/system/configManage'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  import addForm from './addForm'
  import editForm from './editForm'
  export default {
    components: {
      STable,
      Ellipsis,
      addForm,
      editForm,
      editForm
    },
    data () {
      return {
        // 高级搜索 展开/关闭
@ -93,24 +97,28 @@
        columns: [
          {
            title: '参数名称',
            dataIndex: 'name'
            dataIndex: 'name',
            scopedSlots: { customRender: 'name' }
          },
          {
            title: '唯一编码',
            dataIndex: 'code'
            dataIndex: 'code',
            scopedSlots: { customRender: 'code' }
          },
          {
            title: '参数值',
            dataIndex: 'value'
            dataIndex: 'value',
            scopedSlots: { customRender: 'value' }
          },
          {
            title: '所属分类',
            dataIndex: 'groupCode',
            scopedSlots: { customRender: 'groupCode' },
            scopedSlots: { customRender: 'groupCode' }
          },
          {
            title: '备注',
            dataIndex: 'remark'
            dataIndex: 'remark',
            scopedSlots: { customRender: 'remark' }
          }
        ],
        // 加载数据方法 必须为 Promise 对象
@ -121,17 +129,15 @@
        },
        selectedRowKeys: [],
        selectedRows: [],
        groupCodeDictTypeDropDown:[]
    }
        groupCodeDictTypeDropDown: []
      }
    },
    /**
     * 初始化判断按钮权限是否拥有,没有则不现实列
     */
    created(){
    created () {
      this.sysDictTypeDropDown()
      if(this.hasPerm('sysConfig:edit') || this.hasPerm('sysConfig:delete')){
      if (this.hasPerm('sysConfig:edit') || this.hasPerm('sysConfig:delete')) {
        this.columns.push({
          title: '操作',
          width: '150px',
@ -140,37 +146,34 @@
        })
      }
    },
    methods: {
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown(){
        sysDictTypeDropDown({code:'consts_type'}).then((res)=>{
          this.groupCodeDictTypeDropDown=res.data
      sysDictTypeDropDown () {
        sysDictTypeDropDown({ code: 'consts_type' }).then((res) => {
          this.groupCodeDictTypeDropDown = res.data
        })
      },
      groupCodeFilter (groupCode) {
        const groupCode_value = this.groupCodeDictTypeDropDown.filter(item => item.code == groupCode)
        if(groupCode_value.length>0){
          return groupCode_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.groupCodeDictTypeDropDown.filter(item => item.code == groupCode)
        if (values.length > 0) {
          return values[0].value
        }
      },
      sysConfigDelete(record){
        sysConfigDelete(record).then((res)=>{
          if(res.success) {
      sysConfigDelete (record) {
        sysConfigDelete(record).then((res) => {
          if (res.success) {
            this.$message.success('删除成功')
            this.$refs.table.refresh()
          }else{
            this.$message.error('删除失败:'+res.message)
          } else {
            this.$message.error('删除失败:' + res.message)
          }
        }).catch((err)=>{
          this.$message.error('删除错误:'+err.message)
        }).catch((err) => {
          this.$message.error('删除错误:' + err.message)
        })
      },
      toggleAdvanced () {
        this.advanced = !this.advanced
      },

+ 1 - 2
_web/src/views/system/dashboard/Workplace.vue

@ -208,7 +208,7 @@
    },
    methods: {
      getProjects () {
        this.projects =[{
        this.projects = [{
          id: 1,
          cover: 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png',
          title: 'Alipay',
@ -367,7 +367,6 @@
            avatar: 'https://gw.alipayobjects.com/zos/rmsportal/WhxKECPNujWoWEFNdnJE.png'
          }
        ]
      },
      initRadar () {
        this.radarLoading = true

+ 38 - 41
_web/src/views/system/dict/addForm.vue

@ -9,40 +9,40 @@
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
      <a-form-item
        label="类型名称"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入类型名称" v-decorator="['name', {rules: [{required: true, message: '请输入类型名称!'}]}]" />
      </a-form-item>
        <a-form-item
          label="类型名称"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入类型名称" v-decorator="['name', {rules: [{required: true, message: '请输入类型名称!'}]}]" />
        </a-form-item>
      <a-form-item
        label="唯一编码"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true,  message: '请输入唯一编码!'}]}]" />
      </a-form-item>
        <a-form-item
          label="唯一编码"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true, message: '请输入唯一编码!'}]}]" />
        </a-form-item>
      <a-form-item
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        label="排序"
      >
        <a-input-number placeholder="请输入排序" style="width: 100%" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
      </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="排序"
        >
          <a-input-number placeholder="请输入排序" style="width: 100%" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
        </a-form-item>
      <a-form-item
        label="备注"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-textarea :rows="4" placeholder="请输入备注"  v-decorator="['remark']"></a-textarea>
      </a-form-item>
        <a-form-item
          label="备注"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']"></a-textarea>
        </a-form-item>
      </a-form>
@ -50,7 +50,6 @@
  </a-modal>
</template>
<script>
  import { sysDictTypeAdd } from '@/api/modular/system/dictManage'
  export default {
@ -68,11 +67,9 @@
        confirmLoading: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      add (record) {
        this.visible = true
      },
@ -83,16 +80,16 @@
        validateFields((errors, values) => {
          if (!errors) {
            sysDictTypeAdd(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('新增成功')
                this.visible = false
                this.confirmLoading = false
                this.$emit('ok', values)
                this.form.resetFields();
              }else{
                this.$message.error('新增失败:'+res.message)
                this.form.resetFields()
              } else {
                this.$message.error('新增失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -101,7 +98,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 43 - 46
_web/src/views/system/dict/dictdata/addForm.vue

@ -18,40 +18,40 @@
          <a-input v-decorator="['typeId']" />
        </a-form-item>
      <a-form-item
        label="字典值"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入字典值" v-decorator="['value', {rules: [{required: true, message: '请输入字典值!'}]}]" />
      </a-form-item>
        <a-form-item
          label="字典值"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入字典值" v-decorator="['value', {rules: [{required: true, message: '请输入字典值!'}]}]" />
        </a-form-item>
      <a-form-item
        label="唯一编码"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true,  message: '请输入唯一编码!'}]}]" />
      </a-form-item>
        <a-form-item
          label="唯一编码"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true, message: '请输入唯一编码!'}]}]" />
        </a-form-item>
      <a-form-item
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        label="排序"
      >
        <a-input-number placeholder="请输入排序" style="width: 100%" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
      </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="排序"
        >
          <a-input-number placeholder="请输入排序" style="width: 100%" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
        </a-form-item>
      <a-form-item
        label="备注"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-textarea :rows="4" placeholder="请输入备注"  v-decorator="['remark']"></a-textarea>
      </a-form-item>
        <a-form-item
          label="备注"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']"></a-textarea>
        </a-form-item>
      </a-form>
@ -59,7 +59,6 @@
  </a-modal>
</template>
<script>
  import { sysDictDataAdd } from '@/api/modular/system/dictDataManage'
  export default {
@ -77,21 +76,19 @@
        confirmLoading: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      add (record) {
        this.visible = true
        //增加上级类型ID
        setTimeout(()=>{
        // 增加上级类型ID
        setTimeout(() => {
          this.form.setFieldsValue(
            {
              typeId:record,
              typeId: record
            }
          );
        },100)
          )
        }, 100)
      },
      handleSubmit () {
@ -100,16 +97,16 @@
        validateFields((errors, values) => {
          if (!errors) {
            sysDictDataAdd(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('新增成功')
                this.visible = false
                this.confirmLoading = false
                this.$emit('ok', values)
                this.form.resetFields();
              }else{
                this.$message.error('新增失败:'+res.message)
                this.form.resetFields()
              } else {
                this.$message.error('新增失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -118,7 +115,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 34 - 37
_web/src/views/system/dict/dictdata/editForm.vue

@ -27,14 +27,14 @@
          <a-input v-decorator="['typeId']" />
        </a-form-item>
      <a-form-item
        label="字典值"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入字典值" v-decorator="['value', {rules: [{required: true, message: '请输入字典值!'}]}]" />
      </a-form-item>
        <a-form-item
          label="字典值"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入字典值" v-decorator="['value', {rules: [{required: true, message: '请输入字典值!'}]}]" />
        </a-form-item>
        <a-form-item
          label="唯一编码"
@ -42,17 +42,17 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true,  message: '请输入唯一编码!'}]}]" />
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true, message: '请输入唯一编码!'}]}]" />
        </a-form-item>
      <a-form-item
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        label="排序"
        has-feedback
      >
        <a-input-number style="width: 100%" placeholder="请输入排序" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
      </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="排序"
          has-feedback
        >
          <a-input-number style="width: 100%" placeholder="请输入排序" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
        </a-form-item>
        <a-form-item
          label="备注"
@ -60,7 +60,7 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" placeholder="请输入备注"  v-decorator="['remark']"></a-textarea>
          <a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']"></a-textarea>
        </a-form-item>
      </a-form>
@ -69,7 +69,6 @@
  </a-modal>
</template>
<script>
  import { sysDictDataEdit } from '@/api/modular/system/dictDataManage'
  export default {
@ -87,25 +86,23 @@
        confirmLoading: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      edit (record) {
        this.visible = true
        setTimeout(()=>{
        setTimeout(() => {
          this.form.setFieldsValue(
            {
              id:record.id,
              typeId:record.typeId,
              value:record.value,
              code:record.code,
              sort:record.sort,
              remark:record.remark,
              id: record.id,
              typeId: record.typeId,
              value: record.value,
              code: record.code,
              sort: record.sort,
              remark: record.remark
            }
          );
        },100)
          )
        }, 100)
      },
      handleSubmit () {
@ -114,16 +111,16 @@
        validateFields((errors, values) => {
          if (!errors) {
            sysDictDataEdit(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('编辑成功')
                this.visible = false
                this.confirmLoading = false
                this.$emit('ok', values)
                this.form.resetFields();
              }else{
                this.$message.error('编辑失败:'+res.message)
                this.form.resetFields()
              } else {
                this.$message.error('编辑失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -132,7 +129,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 41 - 41
_web/src/views/system/dict/dictdata/index.vue

@ -21,10 +21,10 @@
              </a-form-item>
            </a-col>
            <a-col :md="!advanced && 8 || 24" :sm="24">
            <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
              <a-button  type="primary" @click="$refs.table.refresh(true)">查询</a-button>
               <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
            </span>
              <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
                <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
                <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
              </span>
            </a-col>
          </a-row>
        </a-form>
@ -41,16 +41,16 @@
        :rowKey="(record) => record.code"
        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
      >
      <span slot="status" slot-scope="text">
        {{ statusFilter(text) }}
      </span>
        <span slot="status" slot-scope="text">
          {{ statusFilter(text) }}
        </span>
        <span slot="action" slot-scope="text, record">
        <a v-if="hasPerm('sysDictData:edit')" @click="$refs.editForm.edit(record)">编辑</a>
        <a-divider type="vertical" v-if="hasPerm('sysDictData:edit') & hasPerm('sysDictData:delete')"/>
        <a-popconfirm v-if="hasPerm('sysDictData:delete')" placement="topRight" title="确认删除?" @confirm="() => sysDictDataDelete(record)">
        <a>删除</a>
        </a-popconfirm>
      </span>
          <a v-if="hasPerm('sysDictData:edit')" @click="$refs.editForm.edit(record)">编辑</a>
          <a-divider type="vertical" v-if="hasPerm('sysDictData:edit') & hasPerm('sysDictData:delete')"/>
          <a-popconfirm v-if="hasPerm('sysDictData:delete')" placement="topRight" title="确认删除?" @confirm="() => sysDictDataDelete(record)">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </s-table>
      <add-form ref="addForm" @ok="handleOk" />
      <edit-form ref="editForm" @ok="handleOk" />
@ -60,7 +60,7 @@
<script>
  import { STable } from '@/components'
  import { sysDictDataPage ,sysDictDataDelete } from '@/api/modular/system/dictDataManage'
  import { sysDictDataPage, sysDictDataDelete } from '@/api/modular/system/dictDataManage'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  import addForm from './addForm'
  import editForm from './editForm'
@ -95,7 +95,7 @@
          {
            title: '备注',
            dataIndex: 'remark',
            width:200
            width: 200
          },
          {
            title: '状态',
@ -104,24 +104,23 @@
          }
        ],
        visible: false,
        typeId:[],
        typeId: [],
        // 加载数据方法 必须为 Promise 对象
        loadData:parameter => {
          this.queryParam.typeId=this.typeId
        loadData: parameter => {
          this.queryParam.typeId = this.typeId
          return sysDictDataPage(Object.assign(parameter, this.queryParam)).then((res) => {
            return res.data
          })
        },
        selectedRowKeys: [],
        selectedRows: [],
        statusDict:[]
        statusDict: []
      }
    },
    created () {
      this.sysDictTypeDropDown()
      if(this.hasPerm('sysDictData:edit') || this.hasPerm('sysDictData:delete')){
      if (this.hasPerm('sysDictData:edit') || this.hasPerm('sysDictData:delete')) {
        this.columns.push({
          title: '操作',
          width: '150px',
@ -132,48 +131,49 @@
    },
    methods: {
      //打开此页面首先加载此方法
      // 打开此页面首先加载此方法
      index (record) {
        this.visible = true
        this.typeId=record.id
        this.queryParam.typeId=record.id
        try{
        this.typeId = record.id
        this.queryParam.typeId = record.id
        try {
          this.$refs.table.refresh()
        }catch (e) {
          //首次进入界面,因表格加载顺序,会抛异常,我们不予理会
        } catch (e) {
          // 首次进入界面,因表格加载顺序,会抛异常,我们不予理会
        }
      },
      statusFilter (status) {
        const status_value = this.statusDict.filter(item => item.code == status)
        if(status_value.length>0){
          return status_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.statusDict.filter(item => item.code == status)
        if (values.length > 0) {
          return values[0].value
        }
      },
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown(){
        sysDictTypeDropDown({code:'common_status'}).then((res)=>{
          this.statusDict=res.data
      sysDictTypeDropDown () {
        sysDictTypeDropDown({ code: 'common_status' }).then((res) => {
          this.statusDict = res.data
        })
      },
      handleCancel () {
        this.queryParam={}
        this.queryParam = {}
        this.visible = false
      },
      sysDictDataDelete(record){
        sysDictDataDelete(record).then((res)=>{
          if(res.success) {
      sysDictDataDelete (record) {
        sysDictDataDelete(record).then((res) => {
          if (res.success) {
            this.$message.success('删除成功')
            this.$refs.table.refresh()
          }else{
            this.$message.error('删除失败:'+res.message)
          } else {
            this.$message.error('删除失败:' + res.message)
          }
        }).catch((err)=>{
          this.$message.error('删除错误:'+err.message)
        }).catch((err) => {
          this.$message.error('删除错误:' + err.message)
        })
      },
      toggleAdvanced () {

+ 33 - 36
_web/src/views/system/dict/editForm.vue

@ -19,14 +19,14 @@
          <a-input v-decorator="['id']" />
        </a-form-item>
      <a-form-item
        label="类型名称"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入类型名称" v-decorator="['name', {rules: [{required: true, message: '请输入类型名称!'}]}]" />
      </a-form-item>
        <a-form-item
          label="类型名称"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入类型名称" v-decorator="['name', {rules: [{required: true, message: '请输入类型名称!'}]}]" />
        </a-form-item>
        <a-form-item
          label="唯一编码"
@ -34,17 +34,17 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true,  message: '请输入唯一编码!'}]}]" />
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true, message: '请输入唯一编码!'}]}]" />
        </a-form-item>
      <a-form-item
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        label="排序"
        has-feedback
      >
        <a-input-number style="width: 100%" placeholder="请输入排序" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
      </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="排序"
          has-feedback
        >
          <a-input-number style="width: 100%" placeholder="请输入排序" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
        </a-form-item>
        <a-form-item
          label="备注"
@ -52,7 +52,7 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" placeholder="请输入备注"  v-decorator="['remark']"></a-textarea>
          <a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']"></a-textarea>
        </a-form-item>
      </a-form>
@ -61,7 +61,6 @@
  </a-modal>
</template>
<script>
  import { sysDictTypeEdit } from '@/api/modular/system/dictManage'
  export default {
@ -79,24 +78,22 @@
        confirmLoading: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      edit (record) {
        this.visible = true
        setTimeout(()=>{
        setTimeout(() => {
          this.form.setFieldsValue(
            {
              id:record.id,
              name:record.name,
              code:record.code,
              sort:record.sort,
              remark:record.remark,
              id: record.id,
              name: record.name,
              code: record.code,
              sort: record.sort,
              remark: record.remark
            }
          );
        },100)
          )
        }, 100)
      },
      handleSubmit () {
@ -105,16 +102,16 @@
        validateFields((errors, values) => {
          if (!errors) {
            sysDictTypeEdit(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('编辑成功')
                this.visible = false
                this.confirmLoading = false
                this.$emit('ok', values)
                this.form.resetFields();
              }else{
                this.$message.error('编辑失败:'+res.message)
                this.form.resetFields()
              } else {
                this.$message.error('编辑失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -123,7 +120,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 41 - 41
_web/src/views/system/dict/index.vue

@ -16,8 +16,8 @@
          </a-col>
          <a-col :md="!advanced && 8 || 24" :sm="24">
            <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
              <a-button  type="primary" @click="$refs.table.refresh(true)">查询</a-button>
               <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
              <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
              <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
            </span>
          </a-col>
        </a-row>
@ -41,27 +41,27 @@
        {{ statusFilter(text) }}
      </span>
          <span slot="action" slot-scope="text, record">
            <a @click="$refs.dataIndex.index(record)">字典</a>
            <a-divider type="vertical" v-if="hasPerm('sysDictType:edit') || hasPerm('sysDictType:delete')"/>
            <a-dropdown  v-if="hasPerm('sysDictType:edit') || hasPerm('sysDictType:delete')">
              <a class="ant-dropdown-link">
                更多 <a-icon type="down" />
              </a>
              <a-menu slot="overlay">
                <a-menu-item v-if="hasPerm('sysDictType:edit')">
                  <a @click="$refs.editForm.edit(record)">编辑</a>
                </a-menu-item>
                <a-menu-item v-if="hasPerm('sysDictType:delete')">
                  <a-popconfirm placement="topRight" title="确认删除?" @confirm="() => sysDictTypeDelete(record)">
                  <a>删除</a>
                  </a-popconfirm>
                </a-menu-item>
              </a-menu>
            </a-dropdown>
          </span>
      <span slot="action" slot-scope="text, record">
        <a @click="$refs.dataIndex.index(record)">字典</a>
        <a-divider type="vertical" v-if="hasPerm('sysDictType:edit') || hasPerm('sysDictType:delete')"/>
        <a-dropdown v-if="hasPerm('sysDictType:edit') || hasPerm('sysDictType:delete')">
          <a class="ant-dropdown-link">
            更多 <a-icon type="down" />
          </a>
          <a-menu slot="overlay">
            <a-menu-item v-if="hasPerm('sysDictType:edit')">
              <a @click="$refs.editForm.edit(record)">编辑</a>
            </a-menu-item>
            <a-menu-item v-if="hasPerm('sysDictType:delete')">
              <a-popconfirm placement="topRight" title="确认删除?" @confirm="() => sysDictTypeDelete(record)">
                <a>删除</a>
              </a-popconfirm>
            </a-menu-item>
          </a-menu>
        </a-dropdown>
      </span>
    </s-table>
@ -74,7 +74,7 @@
<script>
  import { STable } from '@/components'
  import { sysDictTypePage ,sysDictTypeDelete ,sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  import { sysDictTypePage, sysDictTypeDelete, sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  import addForm from './addForm'
  import editForm from './editForm'
  import dataIndex from './dictdata/index'
@ -111,13 +111,13 @@
          {
            title: '备注',
            dataIndex: 'remark',
            width:200
            width: 200
          },
          {
            title: '状态',
            dataIndex: 'status',
            scopedSlots: { customRender: 'status' }
          },{
          }, {
            title: '操作',
            width: '150px',
            dataIndex: 'action',
@ -132,9 +132,8 @@
        },
        selectedRowKeys: [],
        selectedRows: [],
        statusDict:[]
        statusDict: []
      }
    },
    created () {
      this.sysDictTypeDropDown()
@ -143,31 +142,32 @@
    methods: {
      statusFilter (status) {
        const status_value = this.statusDict.filter(item => item.code == status)
        if(status_value.length>0){
          return status_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.statusDict.filter(item => item.code == status)
        if (values.length > 0) {
          return values[0].value
        }
      },
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown(){
        sysDictTypeDropDown({code:'common_status'}).then((res)=>{
          this.statusDict=res.data
      sysDictTypeDropDown () {
        sysDictTypeDropDown({ code: 'common_status' }).then((res) => {
          this.statusDict = res.data
        })
      },
      sysDictTypeDelete(record){
        sysDictTypeDelete(record).then((res)=>{
          if(res.success) {
      sysDictTypeDelete (record) {
        sysDictTypeDelete(record).then((res) => {
          if (res.success) {
            this.$message.success('删除成功')
            this.$refs.table.refresh()
          }else{
            this.$message.error('删除失败:'+res.message)
          } else {
            this.$message.error('删除失败:' + res.message)
          }
        }).catch((err)=>{
          this.$message.error('删除错误:'+err.message)
        }).catch((err) => {
          this.$message.error('删除错误:' + err.message)
        })
      },

+ 55 - 52
_web/src/views/system/email/index.vue

@ -2,7 +2,7 @@
  <a-card :bordered="false">
    <a-spin :spinning="confirmLoading">
      <a-tabs default-active-key="1"   >
      <a-tabs default-active-key="1" >
        <a-tab-pane key="1" tab="发送邮件" @change="tabsCallback" v-if="hasPerm('email:sendEmail')">
          <a-form :form="form1">
            <a-form-item
@ -13,12 +13,12 @@
            <a-form-item
              label="邮件标题"
            >
              <a-input placeholder="请输入邮件标题" v-decorator="['title', {rules: [{required: true,  message: '请输入邮件标题!'}]}]" />
              <a-input placeholder="请输入邮件标题" v-decorator="['title', {rules: [{required: true, message: '请输入邮件标题!'}]}]" />
            </a-form-item>
            <a-form-item
              label="邮件内容"
            >
              <a-textarea :rows="4" placeholder="请输入备注"  v-decorator="['content', {rules: [{required: true,  message: '请输入邮件内容!'}]}]"></a-textarea>
              <a-textarea :rows="4" placeholder="请输入备注" v-decorator="['content', {rules: [{required: true, message: '请输入邮件内容!'}]}]"></a-textarea>
            </a-form-item>
            <a-form-item class="subForm-item">
              <a-button type="primary" @click="handleSubmit1" :loading="confirmLoading">发送</a-button>
@ -26,26 +26,26 @@
          </a-form>
        </a-tab-pane>
        <a-tab-pane key="2" tab="发送Html邮件" @change="tabsCallback" v-if="hasPerm('email:sendEmailHtml')">
            <a-form :form="form2">
              <a-form-item
                label="收件邮箱"
              >
                <a-input placeholder="请输入收件邮箱" v-decorator="['to',{rules: [ {type: 'email',message: '请输入正确的邮箱!'},{required: true, message: '请输入收件邮箱!'}]}]" />
              </a-form-item>
              <a-form-item
                label="邮件标题"
              >
                <a-input placeholder="请输入邮件标题" v-decorator="['title', {rules: [{required: true,  message: '请输入邮件标题!'}]}]" />
              </a-form-item>
              <a-form-item
                label="邮件内容"
              >
                <antd-editor :uploadConfig="editorUploadConfig" v-model="editorContent" @onchange="changeEditor" @oninit="getEditor" />
              </a-form-item>
              <a-form-item class="subForm-item">
                <a-button type="primary" @click="handleSubmit2" :loading="confirmLoading">发送</a-button>
              </a-form-item>
            </a-form>
          <a-form :form="form2">
            <a-form-item
              label="收件邮箱"
            >
              <a-input placeholder="请输入收件邮箱" v-decorator="['to',{rules: [ {type: 'email',message: '请输入正确的邮箱!'},{required: true, message: '请输入收件邮箱!'}]}]" />
            </a-form-item>
            <a-form-item
              label="邮件标题"
            >
              <a-input placeholder="请输入邮件标题" v-decorator="['title', {rules: [{required: true, message: '请输入邮件标题!'}]}]" />
            </a-form-item>
            <a-form-item
              label="邮件内容"
            >
              <antd-editor :uploadConfig="editorUploadConfig" v-model="editorContent" @onchange="changeEditor" @oninit="getEditor" />
            </a-form-item>
            <a-form-item class="subForm-item">
              <a-button type="primary" @click="handleSubmit2" :loading="confirmLoading">发送</a-button>
            </a-form-item>
          </a-form>
        </a-tab-pane>
      </a-tabs>
@ -55,40 +55,43 @@
</template>
<script>
  import { emailSendEmail,emailSendEmailHtml } from '@/api/modular/system/emailManage'
  import { emailSendEmail, emailSendEmailHtml } from '@/api/modular/system/emailManage'
  import { AntdEditor } from '@/components'
  import { sysFileInfoUpload ,sysFileInfoDownload } from '@/api/modular/system/fileManage'
  // eslint-disable-next-line no-unused-vars
  import { sysFileInfoUpload, sysFileInfoDownload } from '@/api/modular/system/fileManage'
  export default {
    components: {
      AntdEditor,
      AntdEditor
    },
    data () {
      return {
        editorContentText:'',
        editorContentText: '',
        editorUploadConfig: {
          method: 'http',
          callback: this.editorUploadImage
        },
        confirmLoading:false,
        editorContent:'',
        confirmLoading: false,
        editorContent: '',
        form1: this.$form.createForm(this),
        form2: this.$form.createForm(this),
        form2: this.$form.createForm(this)
      }
    },
    methods: {
      tabsCallback(key){
        if(key === '1'){
      tabsCallback (key) {
        if (key === '1') {
          // eslint-disable-next-line no-labels
          form1: this.$form.createForm(this)
          this.form2.resetFields();
          this.form2.resetFields()
          this.editor.txt.clear()
        }
        if(key === '2'){
        if (key === '2') {
          // eslint-disable-next-line no-labels
          form2: this.$form.createForm(this)
          this.form1.resetFields();
          this.form1.resetFields()
        }
      },
      /**
@ -101,9 +104,9 @@
        })
        sysFileInfoUpload(formData).then((res) => {
          if (res.success) {
            insert(process.env.VUE_APP_API_BASE_URL+'/sysFileInfo/preview?id='+res.data)
          }else {
            this.$message.error('编辑器上传图片失败:' + res.message);
            insert(process.env.VUE_APP_API_BASE_URL + '/sysFileInfo/preview?id=' + res.data)
          } else {
            this.$message.error('编辑器上传图片失败:' + res.message)
          }
        })
      },
@ -124,14 +127,14 @@
        validateFields((errors, values) => {
          if (!errors) {
            emailSendEmail(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('发送成功')
                this.confirmLoading = false
                this.form1.resetFields();
              }else{
                this.$message.error('发送失败:'+res.message)
                this.form1.resetFields()
              } else {
                this.$message.error('发送失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -144,32 +147,32 @@
       */
      handleSubmit2 () {
        const { form2: { validateFields } } = this
        if(this.editorContent == ''){
          this.$message.error("请填写邮件内容")
        // eslint-disable-next-line eqeqeq
        if (this.editorContent == '') {
          this.$message.error('请填写邮件内容')
          return
        }
        this.confirmLoading = true
        validateFields((errors, values) => {
          if (!errors) {
            values.content = this.editorContent
            emailSendEmailHtml(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('发送成功')
                this.confirmLoading = false
                this.editor.txt.clear()
                this.form2.resetFields();
              }else{
                this.$message.error('发送失败:'+res.message)
                this.form2.resetFields()
              } else {
                this.$message.error('发送失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
            this.confirmLoading = false
          }
        })
      },
      }
    }
  }

+ 23 - 23
_web/src/views/system/file/detailForm.vue

@ -12,47 +12,47 @@
        <a-form-item v-show="false">
          <a-input v-decorator="['id']" />
        </a-form-item>
      <a-form-item
        label="文件存储位置"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
      >
        {{fileDetail.fileLocation}}
      </a-form-item>
        <a-form-item
          label="文件存储位置"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
        >
          {{ fileDetail.fileLocation }}
        </a-form-item>
        <a-form-item
          label="文件仓库"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
        >
          {{fileDetail.fileBucket}}
          {{ fileDetail.fileBucket }}
        </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="文件名称"
        >
          {{ fileDetail.fileOriginName }}
        </a-form-item>
      <a-form-item
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        label="文件名称"
      >
        {{fileDetail.fileOriginName}}
      </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="文件后缀"
        >
          {{fileDetail.fileSuffix}}
          {{ fileDetail.fileSuffix }}
        </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="文件大小"
        >
          {{fileDetail.fileSizeKb}}
          {{ fileDetail.fileSizeKb }}
        </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="唯一标识"
        >
          {{fileDetail.fileObjectName}}
          {{ fileDetail.fileObjectName }}
        </a-form-item>
        <a-form-item
@ -60,7 +60,7 @@
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
        >
          {{fileDetail.filePath}}
          {{ fileDetail.filePath }}
        </a-form-item>
      </a-form>
    </a-spin>
@ -72,26 +72,26 @@
      return {
        labelCol: {
          xs: { span: 24 },
          sm: { span: 8}
          sm: { span: 8 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 15 }
        },
        fileDetail:[],
        fileDetail: [],
        visible: false,
        confirmLoading: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      detail (record) {
        this.fileDetail = record
        this.visible = true
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 127 - 129
_web/src/views/system/file/index.vue

@ -1,98 +1,94 @@
<template>
  <a-spin :spinning="cardLoading">
  <a-card :bordered="false">
    <div class="table-page-search-wrapper" v-if="hasPerm('sysFileInfo:page')">
      <a-form layout="inline">
        <a-row :gutter="48">
          <a-col :md="8" :sm="24">
            <a-form-item label="存储位置">
              <a-select v-model="queryParam.fileLocation" placeholder="请选择存储位置" >
                <a-select-option v-for='(item,index) in fileLocationDictTypeDropDown' :key="index" :value="item.code" >{{item.value}}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="24">
            <a-form-item label="文件仓库">
              <a-input v-model="queryParam.fileBucket" placeholder="请输入文件仓库"/>
            </a-form-item>
          </a-col>
          <template v-if="advanced">
    <a-card :bordered="false">
      <div class="table-page-search-wrapper" v-if="hasPerm('sysFileInfo:page')">
        <a-form layout="inline">
          <a-row :gutter="48">
            <a-col :md="8" :sm="24">
              <a-form-item label="文件名称">
                <a-input v-model="queryParam.fileOriginName" placeholder="请输入文件名称(上传时候的文件名)"/>
              <a-form-item label="存储位置">
                <a-select v-model="queryParam.fileLocation" placeholder="请选择存储位置" >
                  <a-select-option v-for="(item,index) in fileLocationDictTypeDropDown" :key="index" :value="item.code" >{{ item.value }}</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
          </template>
          <a-col :md="!advanced && 8 || 24" :sm="24">
            <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
              <a-button type="primary" @click="$refs.table.refresh(true)" >查询</a-button>
              <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
              <a @click="toggleAdvanced" style="margin-left: 8px">
                {{ advanced ? '收起' : '展开' }}
                <a-icon :type="advanced ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <div class="table-operator" v-if="hasPerm('sysFileInfo:upload')">
      <a-upload
        v-if="hasPerm('sysFileInfo:upload')"
         name="file"
        :multiple="true"
         :customRequest="customRequest"
         :showUploadList="false"
            <a-col :md="8" :sm="24">
              <a-form-item label="文件仓库">
                <a-input v-model="queryParam.fileBucket" placeholder="请输入文件仓库"/>
              </a-form-item>
            </a-col>
            <template v-if="advanced">
              <a-col :md="8" :sm="24">
                <a-form-item label="文件名称">
                  <a-input v-model="queryParam.fileOriginName" placeholder="请输入文件名称(上传时候的文件名)"/>
                </a-form-item>
              </a-col>
            </template>
            <a-col :md="!advanced && 8 || 24" :sm="24">
              <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
                <a-button type="primary" @click="$refs.table.refresh(true)" >查询</a-button>
                <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
                <a @click="toggleAdvanced" style="margin-left: 8px">
                  {{ advanced ? '收起' : '展开' }}
                  <a-icon :type="advanced ? 'up' : 'down'"/>
                </a>
              </span>
            </a-col>
          </a-row>
        </a-form>
      </div>
      <div class="table-operator" v-if="hasPerm('sysFileInfo:upload')">
        <a-upload
          v-if="hasPerm('sysFileInfo:upload')"
          name="file"
          :multiple="true"
          :customRequest="customRequest"
          :showUploadList="false"
        >
          <a-button> <a-icon type="upload" />上传文件</a-button>
        </a-upload>
      </div>
      <s-table
        ref="table"
        size="default"
        :columns="columns"
        :data="loadData"
        :alert="true"
        :rowKey="(record) => record.id"
        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
      >
        <a-button> <a-icon type="upload" />上传文件</a-button>
      </a-upload>
    </div>
    <s-table
      ref="table"
      size="default"
      :columns="columns"
      :data="loadData"
      :alert="true"
      :rowKey="(record) => record.id"
      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
    >
      <span slot="fileOriginName" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
      </span>
      <span slot="fileObjectName" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
      </span>
      <span slot="fileLocation" slot-scope="text">
        {{ fileLocationFilter(text)  }}
      </span>
      <span slot="fileSuffix" slot-scope="text">
        <span slot="fileOriginName" slot-scope="text">
          <ellipsis :length="10" tooltip>{{ text }}</ellipsis>
        </span>
        <span slot="fileObjectName" slot-scope="text">
          <ellipsis :length="10" tooltip>{{ text }}</ellipsis>
        </span>
        <span slot="fileLocation" slot-scope="text">
          {{ fileLocationFilter(text) }}
        </span>
        <span slot="fileSuffix" slot-scope="text">
          <a-tag color="blue">{{ text }}</a-tag>
      </span>
      <span slot="action" slot-scope="text, record">
        <a v-if="hasPerm('sysFileInfo:download')" @click="sysFileInfoDownload(record)">下载</a>
        <a-divider type="vertical" v-if="hasPerm('sysFileInfo:download') & hasPerm('sysFileInfo:detail')"/>
        <a v-if="hasPerm('sysFileInfo:detail')" @click="$refs.detailForm.detail(record)">详情</a>
        <a-divider type="vertical" v-if="hasPerm('sysFileInfo:detail') & hasPerm('sysFileInfo:delete')"/>
        <a-popconfirm v-if="hasPerm('sysFileInfo:delete')" placement="topRight" title="确认删除?" @confirm="() => sysFileInfoDelete(record)">
          <a>删除</a>
        </a-popconfirm>
        <a-divider type="vertical" v-if="(hasPerm('sysFileInfo:preview') & record.fileSuffix === 'png' || record.fileSuffix === 'PNG' || record.fileSuffix === 'jpeg' || record.fileSuffix === 'JPEG'
        || record.fileSuffix === 'jpg' || record.fileSuffix === 'JPG' || record.fileSuffix === 'gif' || record.fileSuffix === 'GIF' ||
        record.fileSuffix === 'tif' || record.fileSuffix === 'TIF' || record.fileSuffix === 'bmp' || record.fileSuffix === 'BMP') & hasPerm('sysFileInfo:delete')"/>
        <a v-if="(hasPerm('sysFileInfo:preview') & record.fileSuffix === 'png' || record.fileSuffix === 'PNG' || record.fileSuffix === 'jpeg' || record.fileSuffix === 'JPEG'
        || record.fileSuffix === 'jpg' || record.fileSuffix === 'JPG' || record.fileSuffix === 'gif' || record.fileSuffix === 'GIF' ||
        record.fileSuffix === 'tif' || record.fileSuffix === 'TIF' || record.fileSuffix === 'bmp' || record.fileSuffix === 'BMP')" @click="$refs.previewForm.preview(record)">预览</a>
      </span>
    </s-table>
    <detail-form ref="detailForm" @ok="handleOk" v-if="hasPerm('sysFileInfo:detail')"/>
    <preview-form ref="previewForm" v-if="hasPerm('sysFileInfo:preview')"/>
  </a-card>
        </span>
        <span slot="action" slot-scope="text, record">
          <a v-if="hasPerm('sysFileInfo:download')" @click="sysFileInfoDownload(record)">下载</a>
          <a-divider type="vertical" v-if="hasPerm('sysFileInfo:download') & hasPerm('sysFileInfo:detail')"/>
          <a v-if="hasPerm('sysFileInfo:detail')" @click="$refs.detailForm.detail(record)">详情</a>
          <a-divider type="vertical" v-if="hasPerm('sysFileInfo:detail') & hasPerm('sysFileInfo:delete')"/>
          <a-popconfirm v-if="hasPerm('sysFileInfo:delete')" placement="topRight" title="确认删除?" @confirm="() => sysFileInfoDelete(record)">
            <a>删除</a>
          </a-popconfirm>
          <a-divider type="vertical" v-if="(hasPerm('sysFileInfo:preview') & record.fileSuffix === 'png' || record.fileSuffix === 'jpeg' || record.fileSuffix === 'jpg'|| record.fileSuffix === 'gif'|| record.fileSuffix === 'tif' || record.fileSuffix === 'bmp' ) & hasPerm('sysFileInfo:delete')"/>
          <a v-if="(hasPerm('sysFileInfo:preview') & record.fileSuffix === 'png' || record.fileSuffix === 'jpeg'|| record.fileSuffix === 'jpg'|| record.fileSuffix === 'gif'|| record.fileSuffix === 'tif' || record.fileSuffix === 'bmp' )" @click="$refs.previewForm.preview(record)">预览</a>
        </span>
      </s-table>
      <detail-form ref="detailForm" @ok="handleOk" v-if="hasPerm('sysFileInfo:detail')"/>
      <preview-form ref="previewForm" v-if="hasPerm('sysFileInfo:preview')"/>
    </a-card>
  </a-spin>
</template>
<script>
  import { STable,Ellipsis } from '@/components'
  import { STable, Ellipsis } from '@/components'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  import { sysFileInfoPage ,sysFileInfoDelete ,sysFileInfoUpload ,sysFileInfoDownload} from '@/api/modular/system/fileManage'
  import { sysFileInfoPage, sysFileInfoDelete, sysFileInfoUpload, sysFileInfoDownload } from '@/api/modular/system/fileManage'
  import detailForm from './detailForm'
  import previewForm from './previewForm'
  export default {
@ -113,7 +109,7 @@
          {
            title: '存储位置',
            dataIndex: 'fileLocation',
            scopedSlots: {customRender: 'fileLocation'}
            scopedSlots: { customRender: 'fileLocation' }
          },
          {
            title: '文件仓库',
@ -122,12 +118,12 @@
          {
            title: '文件名称',
            dataIndex: 'fileOriginName',
            scopedSlots: { customRender: 'fileOriginName' },
            scopedSlots: { customRender: 'fileOriginName' }
          },
          {
            title: '文件后缀',
            dataIndex: 'fileSuffix',
            scopedSlots: { customRender: 'fileSuffix' },
            scopedSlots: { customRender: 'fileSuffix' }
          },
          {
            title: '文件大小',
@ -136,8 +132,8 @@
          {
            title: '唯一标识id',
            dataIndex: 'fileObjectName',
            scopedSlots: { customRender: 'fileObjectName' },
          },
            scopedSlots: { customRender: 'fileObjectName' }
          }
        ],
        // 加载数据方法 必须为 Promise 对象
@ -146,15 +142,15 @@
            return res.data
          })
        },
        cardLoading:false,
        fileLocationDictTypeDropDown:[],
        cardLoading: false,
        fileLocationDictTypeDropDown: [],
        selectedRowKeys: [],
        selectedRows: [],
        selectedRows: []
      }
    },
    created(){
    created () {
      this.sysDictTypeDropDown()
      if(this.hasPerm('sysPos:edit') || this.hasPerm('sysPos:delete')){
      if (this.hasPerm('sysPos:edit') || this.hasPerm('sysPos:delete')) {
        this.columns.push({
          title: '操作',
          width: '200px',
@ -165,59 +161,61 @@
    },
    methods: {
      fileLocationFilter (fileLocation) {
        const fileLocation_value = this.fileLocationDictTypeDropDown.filter(item => item.code == fileLocation)
        if(fileLocation_value.length>0){
          return fileLocation_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.fileLocationDictTypeDropDown.filter(item => item.code == fileLocation)
        if (values.length > 0) {
          return values[0].value
        }
      },
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown(){
        sysDictTypeDropDown({code:'file_storage_location'}).then((res)=>{
          this.fileLocationDictTypeDropDown=res.data
      sysDictTypeDropDown () {
        sysDictTypeDropDown({ code: 'file_storage_location' }).then((res) => {
          this.fileLocationDictTypeDropDown = res.data
        })
      },
      /**
       * 下载文件(所有文件)
       */
      sysFileInfoDownload(record){
      sysFileInfoDownload (record) {
        this.cardLoading = true
        sysFileInfoDownload({id:record.id}).then((res)=>{
        sysFileInfoDownload({ id: record.id }).then((res) => {
          this.cardLoading = false
          this.downloadfile(res)
        }).catch((err)=>{
        // eslint-disable-next-line handle-callback-err
        }).catch((err) => {
          this.cardLoading = false
          this.$message.error('下载错误:获取文件流错误')
        })
      },
      downloadfile(res) {
        var blob = new Blob([res.data], {type: 'application/octet-stream;charset=UTF-8'});
        var contentDisposition = res.headers['content-disposition'];
        var patt = new RegExp("filename=([^;]+\\.[^\\.;]+);*");
        var result = patt.exec(contentDisposition);
        var filename = result[1];
        var downloadElement = document.createElement('a');
        var href = window.URL.createObjectURL(blob); //创建下载的链接
        var reg = /^["](.*)["]$/g;
        downloadElement.style.display = 'none';
        downloadElement.href = href;
        downloadElement.download = decodeURI(filename.replace(reg,"$1")); //下载后文件名
        document.body.appendChild(downloadElement);
        downloadElement.click(); //点击下载
        document.body.removeChild(downloadElement); //下载完成移除元素
        window.URL.revokeObjectURL(href);
      downloadfile (res) {
        var blob = new Blob([res.data], { type: 'application/octet-stream;charset=UTF-8' })
        var contentDisposition = res.headers['content-disposition']
        var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*')
        var result = patt.exec(contentDisposition)
        var filename = result[1]
        var downloadElement = document.createElement('a')
        var href = window.URL.createObjectURL(blob) // 创建下载的链接
        var reg = /^["](.*)["]$/g
        downloadElement.style.display = 'none'
        downloadElement.href = href
        downloadElement.download = decodeURI(filename.replace(reg, '$1')) // 下载后文件名
        document.body.appendChild(downloadElement)
        downloadElement.click() // 点击下载
        document.body.removeChild(downloadElement) // 下载完成移除元素
        window.URL.revokeObjectURL(href)
      },
      sysFileInfoDelete(record){
        sysFileInfoDelete(record).then((res)=>{
          if(res.success) {
      sysFileInfoDelete (record) {
        sysFileInfoDelete(record).then((res) => {
          if (res.success) {
            this.$message.success('删除成功')
            this.$refs.table.refresh()
          }else{
            this.$message.error('删除失败:'+res.message)
          } else {
            this.$message.error('删除失败:' + res.message)
          }
        }).catch((err)=>{
          this.$message.error('删除错误:'+err.message)
        }).catch((err) => {
          this.$message.error('删除错误:' + err.message)
        })
      },
      toggleAdvanced () {
@ -226,15 +224,15 @@
      /**
       * 上传文件
       */
      customRequest(data){
      customRequest (data) {
        const formData = new FormData()
        formData.append('file', data.file)
        sysFileInfoUpload(formData).then((res) => {
          if (res.success) {
            this.$message.success('上传成功');
            this.$message.success('上传成功')
            this.$refs.table.refresh()
          } else {
            this.$message.error('上传失败:' + res.message);
            this.$message.error('上传失败:' + res.message)
          }
        })
      },

+ 12 - 12
_web/src/views/system/file/previewForm.vue

@ -8,19 +8,19 @@
  >
    <a-spin :spinning="divLoading">
      <div style="text-align: center">
        <img :src ="src" style="max-width: 99%">
        <img :src="src" style="max-width: 99%">
      </div>
    </a-spin>
  </a-modal>
</template>
<script>
  import { sysFileInfoPreview} from '@/api/modular/system/fileManage'
  import { sysFileInfoPreview } from '@/api/modular/system/fileManage'
  export default {
    data () {
      return {
        visible: false,
        src:'',
        divLoading: false,
        src: '',
        divLoading: false
      }
    },
    methods: {
@ -35,24 +35,24 @@
      /**
       * 获取图片并转为链接
       */
      sysFileInfoPreview(record){
        sysFileInfoPreview({id:record.id}).then((res)=>{
      sysFileInfoPreview (record) {
        sysFileInfoPreview({ id: record.id }).then((res) => {
          this.divLoading = false
          this.downloadfile(res)
        }).catch((err)=>{
        }).catch((err) => {
          this.divLoading = false
          this.$message.error('预览错误:'+err.message)
          this.$message.error('预览错误:' + err.message)
        })
      },
      /**
       * 转图片类型
       */
      downloadfile(res) {
        let blob = new Blob([res]);
        this.src  = window.URL.createObjectURL(blob);
      downloadfile (res) {
        const blob = new Blob([res])
        this.src = window.URL.createObjectURL(blob)
      },
      handleCancel () {
        this.src=''
        this.src = ''
        this.visible = false
      }
    }

+ 5 - 5
_web/src/views/system/index/welcome.vue

@ -1,9 +1,9 @@
<template>
    <a-card :bordered="false" style="display: flex;justify-content:center;height: 100%" >
        <div  style="margin:100px auto;">
          <img src="~@/assets/welcome.png" class="logo" alt="logo">
        </div>
    </a-card>
  <a-card :bordered="false" style="display: flex;justify-content:center;height: 100%" >
    <div style="margin:100px auto;">
      <img src="~@/assets/welcome.png" class="logo" alt="logo">
    </div>
  </a-card>
</template>
<script>

+ 29 - 29
_web/src/views/system/log/oplog/details.vue

@ -9,82 +9,82 @@
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              label="方法名称"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input  v-decorator="['methodName']" />
              <a-input v-decorator="['methodName']" />
            </a-form-item>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              label="地址"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input  v-decorator="['location']" />
              <a-input v-decorator="['location']" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              label="浏览器"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input  v-decorator="['browser']" />
              <a-input v-decorator="['browser']" />
            </a-form-item>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              label="操作系统"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-input  v-decorator="['os']" />
              <a-input v-decorator="['os']" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              label="类名称"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-textarea :rows="4"  v-decorator="['className']"/>
              <a-textarea :rows="4" v-decorator="['className']"/>
            </a-form-item>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              label="具体消息"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-textarea :rows="4"  v-decorator="['message']"/>
              <a-textarea :rows="4" v-decorator="['message']"/>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              label="请求参数"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-textarea :rows="4"  v-decorator="['param']"/>
              <a-textarea :rows="4" v-decorator="['param']"/>
            </a-form-item>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              label="返回结果"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
            >
              <a-textarea :rows="4"  v-decorator="['result']"/>
              <a-textarea :rows="4" v-decorator="['result']"/>
            </a-form-item>
          </a-col>
        </a-row>
@ -110,26 +110,26 @@
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      details (record) {
        this.visible = true
        setTimeout(()=>{
        setTimeout(() => {
          this.form.setFieldsValue(
            {
              location:record.location,
              browser:record.browser,
              os:record.os,
              className:record.className,
              methodName:record.methodName,
              param:record.param,
              result:record.result,
              message:record.message,
              location: record.location,
              browser: record.browser,
              os: record.os,
              className: record.className,
              methodName: record.methodName,
              param: record.param,
              result: record.result,
              message: record.message
            }
          );
        },100)
          )
        }, 100)
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 38 - 36
_web/src/views/system/log/oplog/index.vue

@ -5,26 +5,26 @@
        <a-row :gutter="48">
          <a-col :md="8" :sm="24">
            <a-form-item label="日志名称">
              <a-input v-model="queryParam.name" allow-clear  placeholder="请输入日志名称"/>
              <a-input v-model="queryParam.name" allow-clear placeholder="请输入日志名称"/>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="24">
            <a-select v-model="queryParam.opType" allow-clear placeholder="请选择操作类型" >
              <a-select-option v-for='(item,index) in opTypeDict' :key="index" :value="item.code" >{{item.value}}</a-select-option>
              <a-select-option v-for="(item,index) in opTypeDict" :key="index" :value="item.code" >{{ item.value }}</a-select-option>
            </a-select>
          </a-col>
          <template v-if="advanced">
            <a-col :md="8" :sm="24">
              <a-form-item label="是否成功">
                <a-select v-model="queryParam.success" placeholder="请选择是否成功" >
                  <a-select-option v-for='(item,index) in successDict' :key="index" :value="item.code" >{{item.value}}</a-select-option>
                  <a-select-option v-for="(item,index) in successDict" :key="index" :value="item.code" >{{ item.value }}</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
          </template>
          <a-col :md="!advanced && 8 || 24" :sm="24">
            <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
              <a-button type="primary"  @click="$refs.table.refresh(true)">查询</a-button>
              <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
              <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
              <a @click="toggleAdvanced" style="margin-left: 8px">
                {{ advanced ? '收起' : '展开' }}
@ -36,7 +36,7 @@
      </a-form>
    </div>
    <div class="table-operator" v-if="hasPerm('sysOpLog:delete')">
      <a-popconfirm  placement="top" title="确认清空日志?" @confirm="() => sysOpLogDelete()">
      <a-popconfirm placement="top" title="确认清空日志?" @confirm="() => sysOpLogDelete()">
        <a-button >清空日志</a-button>
      </a-popconfirm>
    </div>
@ -56,26 +56,26 @@
        {{ successFilter(text) }}
      </span>
      <span slot="name" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
        <ellipsis :length="10" tooltip>{{ text }}</ellipsis>
      </span>
      <span slot="url" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
        <ellipsis :length="10" tooltip>{{ text }}</ellipsis>
      </span>
      <span slot="opTime" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
        <ellipsis :length="10" tooltip>{{ text }}</ellipsis>
      </span>
      <span slot="action" slot-scope="text, record">
          <span slot="action" >
            <a @click="$refs.detailsOplog.details(record)">查看详情</a>
          </span>
        <span slot="action" >
          <a @click="$refs.detailsOplog.details(record)">查看详情</a>
        </span>
      </span>
    </s-table>
    <details-oplog ref="detailsOplog"/>
  </a-card>
</template>
<script>
  import { STable ,Ellipsis} from '@/components'
  import { sysOpLogPage,sysOpLogDelete } from '@/api/modular/system/logManage'
  import { STable, Ellipsis } from '@/components'
  import { sysOpLogPage, sysOpLogDelete } from '@/api/modular/system/logManage'
  import detailsOplog from './details'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  export default {
@ -94,7 +94,7 @@
          {
            title: '日志名称',
            dataIndex: 'name',
            scopedSlots: {customRender: 'name'}
            scopedSlots: { customRender: 'name' }
          },
          {
            title: '操作类型',
@ -113,12 +113,12 @@
          {
            title: '请求地址',
            dataIndex: 'url',
            scopedSlots: {customRender: 'url'}
            scopedSlots: { customRender: 'url' }
          },
          {
            title: '操作时间',
            dataIndex: 'opTime',
            scopedSlots: {customRender: 'opTime'}
            scopedSlots: { customRender: 'opTime' }
          },
          {
            title: '操作人',
@ -128,7 +128,7 @@
            title: '详情',
            dataIndex: 'action',
            width: '150px',
            scopedSlots: {customRender: 'action'}
            scopedSlots: { customRender: 'action' }
          }
        ],
        // 加载数据方法 必须为 Promise 对象
@ -139,9 +139,9 @@
        },
        selectedRowKeys: [],
        selectedRows: [],
        defaultExpandedKeys:[],
        opTypeDict:[],
        successDict:[],
        defaultExpandedKeys: [],
        opTypeDict: [],
        successDict: []
      }
    },
    created () {
@ -149,38 +149,40 @@
    },
    methods: {
      opTypeFilter (opType) {
        const opType_value = this.opTypeDict.filter(item => item.code == opType)
        if(opType_value.length>0){
          return opType_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.opTypeDict.filter(item => item.code == opType)
        if (values.length > 0) {
          return values[0].value
        }
      },
      successFilter (success) {
        const success_value = this.successDict.filter(item => item.code == success)
        if(success_value.length>0){
          return success_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.successDict.filter(item => item.code == success)
        if (values.length > 0) {
          return values[0].value
        }
      },
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown(){
        sysDictTypeDropDown({code:'op_type'}).then((res)=>{
          this.opTypeDict=res.data
      sysDictTypeDropDown () {
        sysDictTypeDropDown({ code: 'op_type' }).then((res) => {
          this.opTypeDict = res.data
        })
        sysDictTypeDropDown({code:'yes_or_no'}).then((res)=>{
          this.successDict=res.data
        sysDictTypeDropDown({ code: 'yes_or_no' }).then((res) => {
          this.successDict = res.data
        })
      },
      /**
       * 清空日志
       */
      sysOpLogDelete(){
        sysOpLogDelete().then((res)=>{
          if(res.success){
      sysOpLogDelete () {
        sysOpLogDelete().then((res) => {
          if (res.success) {
            this.$message.success('清空成功')
            this.$refs.table.refresh(true)
          }else{
            this.$message.error('清空失败:'+res.message)
          } else {
            this.$message.error('清空失败:' + res.message)
          }
        })
      },

+ 7 - 7
_web/src/views/system/log/vislog/details.vue

@ -13,7 +13,7 @@
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
        >
          <a-textarea :rows="4"  v-decorator="['message']"/>
          <a-textarea :rows="4" v-decorator="['message']"/>
        </a-form-item>
      </a-form>
    </a-spin>
@ -37,19 +37,19 @@
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      details (record) {
        this.visible = true
        setTimeout(()=>{
        setTimeout(() => {
          this.form.setFieldsValue(
            {
              message:record.message,
              message: record.message
            }
          );
        },100)
          )
        }, 100)
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 37 - 35
_web/src/views/system/log/vislog/index.vue

@ -5,13 +5,13 @@
        <a-row :gutter="48">
          <a-col :md="8" :sm="24">
            <a-form-item label="日志名称">
              <a-input v-model="queryParam.name" allow-clear  placeholder="请输入日志名称"/>
              <a-input v-model="queryParam.name" allow-clear placeholder="请输入日志名称"/>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="24">
            <a-form-item label="访问类型">
              <a-select v-model="queryParam.visType" allow-clear placeholder="请选择访问类型" >
                <a-select-option v-for='(item,index) in visTypeDict' :key="index" :value="item.code" >{{item.value}}</a-select-option>
                <a-select-option v-for="(item,index) in visTypeDict" :key="index" :value="item.code" >{{ item.value }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
@ -19,7 +19,7 @@
            <a-col :md="8" :sm="24">
              <a-form-item label="是否成功">
                <a-select v-model="queryParam.success" placeholder="请选择是否成功" >
                  <a-select-option v-for='(item,index) in successDict' :key="index" :value="item.code" >{{item.value}}</a-select-option>
                  <a-select-option v-for="(item,index) in successDict" :key="index" :value="item.code" >{{ item.value }}</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
@ -38,9 +38,9 @@
      </a-form>
    </div>
    <div class="table-operator" v-if="hasPerm('sysVisLog:delete')">
        <a-popconfirm  v-if="hasPerm('sysVisLog:delete')" placement="top" title="确认清空日志?" @confirm="() => sysVisLogDelete()">
          <a-button >清空日志</a-button>
        </a-popconfirm>
      <a-popconfirm v-if="hasPerm('sysVisLog:delete')" placement="top" title="确认清空日志?" @confirm="() => sysVisLogDelete()">
        <a-button >清空日志</a-button>
      </a-popconfirm>
    </div>
    <s-table
      ref="table"
@ -52,10 +52,10 @@
      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
    >
      <span slot="name" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
        <ellipsis :length="10" tooltip>{{ text }}</ellipsis>
      </span>
      <span slot="visTime" slot-scope="text">
        <ellipsis :length="10" tooltip>{{text}}</ellipsis>
        <ellipsis :length="10" tooltip>{{ text }}</ellipsis>
      </span>
      <span slot="visType" slot-scope="text">
        {{ visTypeFilter(text) }}
@ -64,17 +64,17 @@
        {{ successFilter(text) }}
      </span>
      <span slot="action" slot-scope="text, record">
          <span slot="action" >
            <a @click="$refs.detailsVislog.details(record)">查看详情</a>
          </span>
        <span slot="action" >
          <a @click="$refs.detailsVislog.details(record)">查看详情</a>
        </span>
      </span>
    </s-table>
    <details-vislog ref="detailsVislog"/>
  </a-card>
</template>
<script>
  import { STable,Ellipsis } from '@/components'
  import { sysVisLogPage ,sysVisLogDelete } from '@/api/modular/system/logManage'
  import { STable, Ellipsis } from '@/components'
  import { sysVisLogPage, sysVisLogDelete } from '@/api/modular/system/logManage'
  import detailsVislog from './details'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  export default {
@ -93,7 +93,7 @@
          {
            title: '日志名称',
            dataIndex: 'name',
            scopedSlots: {customRender: 'name'}
            scopedSlots: { customRender: 'name' }
          },
          {
            title: '访问类型',
@ -116,7 +116,7 @@
          {
            title: '访问时间',
            dataIndex: 'visTime',
            scopedSlots: {customRender: 'visTime'}
            scopedSlots: { customRender: 'visTime' }
          },
          {
            title: '访问人',
@ -126,7 +126,7 @@
            title: '详情',
            dataIndex: 'action',
            width: '150px',
            scopedSlots: {customRender: 'action'}
            scopedSlots: { customRender: 'action' }
          }
        ],
        // 加载数据方法 必须为 Promise 对象
@ -137,9 +137,9 @@
        },
        selectedRowKeys: [],
        selectedRows: [],
        defaultExpandedKeys:[],
        visTypeDict:[],
        successDict:[]
        defaultExpandedKeys: [],
        visTypeDict: [],
        successDict: []
      }
    },
    /**
@ -150,38 +150,40 @@
    },
    methods: {
      visTypeFilter (visType) {
        const visType_value = this.visTypeDict.filter(item => item.code == visType)
        if(visType_value.length>0){
          return visType_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.visTypeDict.filter(item => item.code == visType)
        if (values.length > 0) {
          return values[0].value
        }
      },
      successFilter (success) {
        const success_value = this.successDict.filter(item => item.code == success)
        if(success_value.length>0){
          return success_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.successDict.filter(item => item.code == success)
        if (values.length > 0) {
          return values[0].value
        }
      },
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown(){
        sysDictTypeDropDown({code:'vis_type'}).then((res)=>{
          this.visTypeDict=res.data
      sysDictTypeDropDown () {
        sysDictTypeDropDown({ code: 'vis_type' }).then((res) => {
          this.visTypeDict = res.data
        })
        sysDictTypeDropDown({code:'yes_or_no'}).then((res)=>{
          this.successDict=res.data
        sysDictTypeDropDown({ code: 'yes_or_no' }).then((res) => {
          this.successDict = res.data
        })
      },
      /**
       * 清空日志
       */
      sysVisLogDelete(){
        sysVisLogDelete().then((res)=>{
          if(res.success){
      sysVisLogDelete () {
        sysVisLogDelete().then((res) => {
          if (res.success) {
            this.$message.success('清空成功')
            this.$refs.table.refresh(true)
          }else{
            this.$message.error('清空失败:'+res.message)
          } else {
            this.$message.error('清空失败:' + res.message)
          }
        })
      },

+ 43 - 43
_web/src/views/system/machine/index.vue

@ -3,65 +3,65 @@
    <!-- 系统信息  Java信息-->
    <a-row :gutter="24">
      <a-col  :md="12" :sm="24">
      <a-col :md="12" :sm="24">
        <a-card :loading="loading" title="系统信息" style="margin-bottom: 20px" :bordered="false">
          <table class="sysInfo_table" >
            <tr >
              <td class="sysInfo_td">系统名称:</td>
              <td class="sysInfo_td">{{this.sysOsInfo.osName}}</td>
              <td class="sysInfo_td">{{ this.sysOsInfo.osName }}</td>
            </tr>
            <tr >
              <td class="sysInfo_td">系统架构:</td>
              <td class="sysInfo_td">{{this.sysOsInfo.osArch}}</td>
              <td class="sysInfo_td">{{ this.sysOsInfo.osArch }}</td>
            </tr>
            <tr >
              <td class="sysInfo_td">系统版本:</td>
              <td class="sysInfo_td">{{this.sysOsInfo.osVersion}}</td>
              <td class="sysInfo_td">{{ this.sysOsInfo.osVersion }}</td>
            </tr>
            <tr >
              <td class="sysInfo_td">主机名称:</td>
              <td class="sysInfo_td">{{this.sysOsInfo.osHostName}}</td>
              <td class="sysInfo_td">{{ this.sysOsInfo.osHostName }}</td>
            </tr>
            <tr >
              <td >主机IP地址:</td>
              <td >{{this.sysOsInfo.osHostAddress}}</td>
              <td >{{ this.sysOsInfo.osHostAddress }}</td>
            </tr>
          </table>
        </a-card>
      </a-col>
      <a-col  :md="12" :sm="24">
      <a-col :md="12" :sm="24">
        <a-card :loading="loading" title="Java信息" style="margin-bottom: 20px">
          <table class="sysInfo_table" >
            <tr >
              <td class="sysInfo_td">虚拟机名称:</td>
              <td class="sysInfo_td">{{this.sysJavaInfo.jvmName}}</td>
              <td class="sysInfo_td">{{ this.sysJavaInfo.jvmName }}</td>
            </tr>
            <tr >
              <td class="sysInfo_td">虚拟机版本:</td>
              <td class="sysInfo_td">{{this.sysJavaInfo.jvmVersion}}</td>
              <td class="sysInfo_td">{{ this.sysJavaInfo.jvmVersion }}</td>
            </tr>
            <tr >
              <td class="sysInfo_td">虚拟机供应商:</td>
              <td class="sysInfo_td">{{this.sysJavaInfo.jvmVendor}}</td>
              <td class="sysInfo_td">{{ this.sysJavaInfo.jvmVendor }}</td>
            </tr>
            <tr >
              <td class="sysInfo_td">java名称:</td>
              <td class="sysInfo_td">{{this.sysJavaInfo.javaName}}</td>
              <td class="sysInfo_td">{{ this.sysJavaInfo.javaName }}</td>
            </tr>
            <tr >
              <td >java版本:</td>
              <td >{{this.sysJavaInfo.javaVersion}}</td>
              <td >{{ this.sysJavaInfo.javaVersion }}</td>
            </tr>
          </table>
        </a-card>
@ -71,24 +71,24 @@
    <a-card :loading="loading" title="JVM内存信息" >
      <table class="sysInfo_table" >
            <tr >
              <td class="sysInfo_td">最大内存:</td>
              <td class="sysInfo_td">{{this.sysJvmMemInfo.jvmMaxMemory}}</td>
              <td class="sysInfo_td">可用内存:</td>
              <td class="sysInfo_td">{{this.sysJvmMemInfo.jvmUsableMemory}}</td>
            </tr>
            <tr >
              <td class="sysInfo_td">总内存:</td>
              <td class="sysInfo_td">{{this.sysJvmMemInfo.jvmTotalMemory}}</td>
              <td class="sysInfo_td">已使用内存:</td>
              <td class="sysInfo_td">{{this.sysJvmMemInfo.jvmUsedMemory}}</td>
            </tr>
            <tr class="sysInfo_tr">
              <td >空余内存:</td>
              <td >{{this.sysJvmMemInfo.jvmFreeMemory}}</td>
              <td >使用率:</td>
              <td >{{this.sysJvmMemInfo.jvmMemoryUsedRate}}</td>
            </tr>
        <tr >
          <td class="sysInfo_td">最大内存:</td>
          <td class="sysInfo_td">{{ this.sysJvmMemInfo.jvmMaxMemory }}</td>
          <td class="sysInfo_td">可用内存:</td>
          <td class="sysInfo_td">{{ this.sysJvmMemInfo.jvmUsableMemory }}</td>
        </tr>
        <tr >
          <td class="sysInfo_td">总内存:</td>
          <td class="sysInfo_td">{{ this.sysJvmMemInfo.jvmTotalMemory }}</td>
          <td class="sysInfo_td">已使用内存:</td>
          <td class="sysInfo_td">{{ this.sysJvmMemInfo.jvmUsedMemory }}</td>
        </tr>
        <tr class="sysInfo_tr">
          <td >空余内存:</td>
          <td >{{ this.sysJvmMemInfo.jvmFreeMemory }}</td>
          <td >使用率:</td>
          <td >{{ this.sysJvmMemInfo.jvmMemoryUsedRate }}</td>
        </tr>
      </table>
    </a-card>
@ -102,28 +102,28 @@
  export default {
    data () {
      return {
        loading:true,
        sysOsInfo:[],
        sysJavaInfo:[],
        sysJvmMemInfo:[],
        loading: true,
        sysOsInfo: [],
        sysJavaInfo: [],
        sysJvmMemInfo: []
      }
    },
    //进页面加载
    // 进页面加载
    created () {
      this.loadDataList()
    },
    methods: {
      //加载数据方法
      loadDataList(){
        sysMachineQuery().then((res)=>{
          this.loading=false
          this.sysOsInfo=res.data.sysOsInfo
          this.sysJavaInfo=res.data.sysJavaInfo
          this.sysJvmMemInfo=res.data.sysJvmMemInfo
      // 加载数据方法
      loadDataList () {
        sysMachineQuery().then((res) => {
          this.loading = false
          this.sysOsInfo = res.data.sysOsInfo
          this.sysJavaInfo = res.data.sysJavaInfo
          this.sysJvmMemInfo = res.data.sysJvmMemInfo
        })
      },
      }
    }
  }

+ 262 - 257
_web/src/views/system/menu/addForm.vue

@ -1,6 +1,4 @@
/* eslint-disable */
<template>
  <a-modal
    title="新增菜单"
    :width="1000"
@ -8,38 +6,37 @@
    :confirmLoading="confirmLoading"
    @ok="handleSubmit"
    @cancel="handleCancel"
    :destroyOnClose=true
    :destroyOnClose="true"
  >
    <a-spin :spinning="formLoading">
      <a-form  :form="form" >
      <a-form :form="form" >
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
              <a-form-item
                label="菜单名称"
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                hasFeedback
              >
                <a-input placeholder="请输入菜单名称"  v-decorator="['name',{rules: [{required: true, min: 1, message: '请输入菜单名称!'}]}]" />
              </a-form-item>
          <a-col :md="12" :sm="24">
            <a-form-item
              label="菜单名称"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              hasFeedback
            >
              <a-input placeholder="请输入菜单名称" v-decorator="['name',{rules: [{required: true, min: 1, message: '请输入菜单名称!'}]}]" />
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
              <a-form-item
                style="width: 100%"
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                label="菜单编号"
                hasFeedback
              >
                <a-input placeholder="请输入菜单编号" v-decorator="['code', {rules: [{required: true, min: 1, message: '请输入菜单编号!'}]}]" />
              </a-form-item>
            <a-form-item
              style="width: 100%"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="菜单编号"
              hasFeedback
            >
              <a-input placeholder="请输入菜单编号" v-decorator="['code', {rules: [{required: true, min: 1, message: '请输入菜单编号!'}]}]" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
@ -47,61 +44,61 @@
              has-feedback
            >
              <a-select style="width: 100%" placeholder="请选择应用分类" v-decorator="['application', {rules: [{ required: true, message: '请选择应用分类!' }]}]" >
                <a-select-option v-for='(item,index) in appData' :key="index" :value="item.code" @click="changeApplication(item.code)">{{item.name}}</a-select-option>
                <a-select-option v-for="(item,index) in appData" :key="index" :value="item.code" @click="changeApplication(item.code)">{{ item.name }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="菜单层级"
            >
              <a-radio-group v-decorator="['type',{rules: [{ required: true, message: '请选择菜单层级!' }]}]" >
                <a-radio v-for='(item,index) in typeData' :key="index" :value="item.code" @click="meneTypeFunc(item.code)">{{item.value}}</a-radio>
                <a-radio v-for="(item,index) in typeData" :key="index" :value="item.code" @click="meneTypeFunc(item.code)">{{ item.value }}</a-radio>
              </a-radio-group>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <div v-show="pidShow">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="父级菜单"
                  has-feedback
              <a-form-item
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                label="父级菜单"
                has-feedback
              >
                <a-tree-select
                  v-decorator="['pid', {rules: [{ required: true, message: '请选择父级菜单!' }]}]"
                  style="width: 100%"
                  :dropdownStyle="{ maxHeight: '300px', overflow: 'auto' }"
                  :treeData="menuTreeData"
                  placeholder="请选择父级菜单"
                  treeDefaultExpandAll
                >
                  <a-tree-select
                    v-decorator="['pid', {rules: [{ required: true, message: '请选择父级菜单!' }]}]"
                    style="width: 100%"
                    :dropdownStyle="{ maxHeight: '300px', overflow: 'auto' }"
                    :treeData="menuTreeData"
                    placeholder="请选择父级菜单"
                    treeDefaultExpandAll
                  >
                    <span  slot="title" slot-scope="{ id }">{{ id }}
                    </span>
                  </a-tree-select>
                </a-form-item>
                  <span slot="title" slot-scope="{ id }">{{ id }}
                  </span>
                </a-tree-select>
              </a-form-item>
            </div>
            <div v-show="redirectShow">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                >
                  <span slot="label">
                    <a-tooltip title="如需打开首页加载此目录下菜单,请填写加载菜单路由,设为首页后其他设置的主页将被替代">
                      <a-icon type="question-circle-o" />
                    </a-tooltip>&nbsp;
                    重定向
                  </span>
                  <a-input prop="redirect" placeholder="请输入重定向地址" v-decorator="['redirect']"  />
                </a-form-item>
              <a-form-item
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
              >
                <span slot="label">
                  <a-tooltip title="如需打开首页加载此目录下菜单,请填写加载菜单路由,设为首页后其他设置的主页将被替代">
                    <a-icon type="question-circle-o" />
                  </a-tooltip>&nbsp;
                  重定向
                </span>
                <a-input prop="redirect" placeholder="请输入重定向地址" v-decorator="['redirect']" />
              </a-form-item>
            </div>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
@ -112,8 +109,8 @@
                </a-tooltip>&nbsp;
                打开方式
              </span>
              <a-radio-group :disabled="openTypeDisabled"  v-decorator="['openType',{rules: [{ required: true, message: '请选择打开方式!' }]}]">
                <a-radio v-for='(item,index) in openTypeData'  :key="index" :value="item.code" @click="meneOpenTypeFunc(item.code)">{{item.value}}</a-radio>
              <a-radio-group :disabled="openTypeDisabled" v-decorator="['openType',{rules: [{ required: true, message: '请选择打开方式!' }]}]">
                <a-radio v-for="(item,index) in openTypeData" :key="index" :value="item.code" @click="meneOpenTypeFunc(item.code)">{{ item.value }}</a-radio>
              </a-radio-group>
            </a-form-item>
@ -123,7 +120,7 @@
        <a-divider />
        <a-row :gutter="24" >
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <div v-show="componentShow">
              <a-form-item
                :labelCol="labelCol"
@ -140,7 +137,7 @@
              </a-form-item>
            </div>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <div v-show="routerShow">
              <a-form-item
                :labelCol="labelCol"
@ -163,15 +160,14 @@
                label="权限标识"
                hasFeedback
              >
                <a-input placeholder="请输入权限标识" v-decorator="['permission', {rules: [{required: permissionRequired,  message: '请输入权限标识!'}]}]" />
                <a-input placeholder="请输入权限标识" v-decorator="['permission', {rules: [{required: permissionRequired, message: '请输入权限标识!'}]}]" />
              </a-form-item>
            </div>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <div v-show="linkShow" >
              <a-form-item
                :labelCol="labelCol"
@ -184,28 +180,27 @@
                  </a-tooltip>&nbsp;
                  内外链地址
                </span>
                <a-input placeholder="请输入内链打开地址" :disabled="linkDisabled" v-decorator="['link', {rules: [{required: linkRequired,  message: '请输入权限标识!'}]}]" />
                <a-input placeholder="请输入内链打开地址" :disabled="linkDisabled" v-decorator="['link', {rules: [{required: linkRequired, message: '请输入权限标识!'}]}]" />
              </a-form-item>
            </div>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <div v-show="iconShow" >
              <a-form-item
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                label="图标"
              >
                <a-input placeholder="请选择图标"  disabled="disabled" v-decorator="['icon']" >
                  <a-icon slot="addonAfter"   @click="openIconSele()" type="setting" />
                <a-input placeholder="请选择图标" disabled="disabled" v-decorator="['icon']" >
                  <a-icon slot="addonAfter" @click="openIconSele()" type="setting" />
                </a-input>
              </a-form-item>
            </div>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
@ -217,23 +212,23 @@
                权重
              </span>
              <a-radio-group v-decorator="['weight']">
                <a-radio v-for='(item,index) in weightData' :key="index" :value="item.code" >{{item.value}}</a-radio>
                <a-radio v-for="(item,index) in weightData" :key="index" :value="item.code" >{{ item.value }}</a-radio>
              </a-radio-group>
            </a-form-item>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="是否可见"
            >
              <a-switch id="visible" checkedChildren="是" unCheckedChildren="否"  v-decorator="['visible', { valuePropName: 'checked' }]"/><!-- defaultChecked -->
              <a-switch id="visible" checkedChildren="是" unCheckedChildren="否" v-decorator="['visible', { valuePropName: 'checked' }]"/><!-- defaultChecked -->
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
@ -242,7 +237,7 @@
              <a-input-number style="width: 100%" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
            </a-form-item>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
@ -256,27 +251,27 @@
      </a-form>
    </a-spin>
        <a-modal
          :width="850"
          :visible="visibleIcon"
          @cancel="handleCancelIcon"
          footer=""
          :mask=false
          :closable=false
          :destroyOnClose=true
        >
          <icon-selector v-model="currentSelectedIcon" @change="handleIconChange"/>
        </a-modal>
    <a-modal
      :width="850"
      :visible="visibleIcon"
      @cancel="handleCancelIcon"
      footer=""
      :mask="false"
      :closable="false"
      :destroyOnClose="true"
    >
      <icon-selector v-model="currentSelectedIcon" @change="handleIconChange"/>
    </a-modal>
  </a-modal>
</template>
<script>
  import { getAppList } from '@/api/modular/system/appManage'
  import { getMenuTree ,sysMenuAdd} from '@/api/modular/system/menuManage'
  import { getMenuTree, sysMenuAdd } from '@/api/modular/system/menuManage'
  import IconSelector from '@/components/IconSelector'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  export default {
    components: {IconSelector},
    components: { IconSelector },
    data () {
      return {
@ -288,100 +283,100 @@
          xs: { span: 24 },
          sm: { span: 16 }
        },
        visibleIcon:false,
        visibleIcon: false,
        visible: false,
        confirmLoading: false,
        appData:[],
        menuTreeData:[],
        redirectShow:true,
        componentShow:true,
        componentDisabled:false,
        componentRequired:true,
        routerRequired:true,
        routerShow:true,
        iconShow:true,
        openTypeShow:true,
        pidShow:true,
        permissionShow:true,
        permissionRequired:true,
        //图标组件
        appData: [],
        menuTreeData: [],
        redirectShow: true,
        componentShow: true,
        componentDisabled: false,
        componentRequired: true,
        routerRequired: true,
        routerShow: true,
        iconShow: true,
        openTypeShow: true,
        pidShow: true,
        permissionShow: true,
        permissionRequired: true,
        // 图标组件
        currentSelectedIcon: 'pause-circle',
        typeData:[],
        openTypeData:[],
        weightData:[],
        formLoading:true,
        linkShow:true,
        openTypeDisabled:false,
        openTypeDefault:[],
        openType:'',
        linkRequired:true,
        linkDisabled:false,
        type:'',
        form: this.$form.createForm(this),
        typeData: [],
        openTypeData: [],
        weightData: [],
        formLoading: true,
        linkShow: true,
        openTypeDisabled: false,
        openTypeDefault: [],
        openType: '',
        linkRequired: true,
        linkDisabled: false,
        type: '',
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //打开页面初始化
      // 打开页面初始化
      add (type) {
        this.visible = true
        //图标
        // 图标
        this.currentSelectedIcon = type
        //默认选中菜单项,并初始化
        this.form.getFieldDecorator('type',{valuePropName:'checked',initialValue:'1'})
        // 默认选中菜单项,并初始化
        this.form.getFieldDecorator('type', { valuePropName: 'checked', initialValue: '1' })
        this.meneTypeFunc('1')
        //默认选中的单选框
        //this.form.getFieldDecorator('type',{valuePropName:'checked',initialValue:'1'})
        this.form.getFieldDecorator('weight',{valuePropName:'checked',initialValue:'2'})
        this.form.getFieldDecorator('visible',{initialValue:true})
        // 默认选中的单选框
        // this.form.getFieldDecorator('type',{valuePropName:'checked',initialValue:'1'})
        this.form.getFieldDecorator('weight', { valuePropName: 'checked', initialValue: '2' })
        this.form.getFieldDecorator('visible', { initialValue: true })
        //获取系统应用列表
        this.getSysApplist();
        // 获取系统应用列表
        this.getSysApplist()
        this.sysDictTypeDropDown()
      },
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown(){
        this.formLoading=true
        //菜单类型
        sysDictTypeDropDown({code:'menu_type'}).then((res)=>{
          this.typeData=res.data
      sysDictTypeDropDown () {
        this.formLoading = true
        // 菜单类型
        sysDictTypeDropDown({ code: 'menu_type' }).then((res) => {
          this.typeData = res.data
        })
        //权重
        sysDictTypeDropDown({code:'menu_weight'}).then((res)=>{
          this.weightData=res.data
        // 权重
        sysDictTypeDropDown({ code: 'menu_weight' }).then((res) => {
          this.weightData = res.data
        })
        //内外链
        sysDictTypeDropDown({code:'open_type'}).then((res)=>{
          this.openTypeData=res.data
          this.formLoading=false
        // 内外链
        sysDictTypeDropDown({ code: 'open_type' }).then((res) => {
          this.openTypeData = res.data
          this.formLoading = false
        })
      },
      getSysApplist() {
      getSysApplist () {
        return getAppList().then((res) => {
          if (res.success) {
            this.appData=res.data
            this.appData = res.data
          } else {
            this.$message.warning(res.message)
          }
        })
      },
      changeApplication(value){
        getMenuTree({'application':value}).then((res) => {
      changeApplication (value) {
        getMenuTree({ 'application': value }).then((res) => {
          if (res.success) {
            this.form.resetFields(`pid`,[]);
            this.menuTreeData=[{
              "id": "-1",
              "parentId": "0",
              "title": "顶级",
              "value": "0",
              "pid": "0",
              "children":res.data
            this.form.resetFields(`pid`, [])
            this.menuTreeData = [{
              'id': '-1',
              'parentId': '0',
              'title': '顶级',
              'value': '0',
              'pid': '0',
              'children': res.data
            }]
          } else {
            this.$message.warning(res.message)
@ -392,77 +387,81 @@
      /**
       * 选择菜单类型执行初始化表单变量
       */
      meneTypeFunc(type){
      meneTypeFunc (type) {
        this.type = type
        if(type=='0' || type=='1'){
          //内外链地址显示,给空值
          this.linkShow=true
          this.form.resetFields(`link`,[]);
          //图标选择显示
          this.iconShow=true
          //路由必填,设置空值,并显示
          this.routerRequired=true
          this.form.getFieldDecorator('router',{initialValue:''})
          this.routerShow=true
          //权限标识框隐藏,选填,给空值
          this.permissionShow=false
          this.permissionRequired =false
          this.form.getFieldDecorator('permission',{initialValue:''})
          //打开方式设置为组件 ,禁用选择方式
        // eslint-disable-next-line eqeqeq
        if (type == '0' || type == '1') {
          // 内外链地址显示,给空值
          this.linkShow = true
          this.form.resetFields(`link`, [])
          // 图标选择显示
          this.iconShow = true
          // 路由必填,设置空值,并显示
          this.routerRequired = true
          this.form.getFieldDecorator('router', { initialValue: '' })
          this.routerShow = true
          // 权限标识框隐藏,选填,给空值
          this.permissionShow = false
          this.permissionRequired = false
          this.form.getFieldDecorator('permission', { initialValue: '' })
          // 打开方式设置为组件 ,禁用选择方式
          this.openType = '1'
          this.form.getFieldDecorator('openType',{initialValue:this.openType = '1'})
          this.form.getFieldDecorator('openType', { initialValue: this.openType = '1' })
          this.openTypeDisabled = false
        }
        if(type=='0'){
          //重定向展示,并给空
          this.redirectShow=true
          this.form.resetFields(`redirect`,[]);
          //组件默认为显示,设置可输入,给默认组件 PageView,验证必填
          this.componentShow=true
          this.componentDisabled=false
          this.form.getFieldDecorator('component',{initialValue:'PageView'})
          this.componentRequired=true
          //父级初始化顶级,并将其隐藏
          this.form.getFieldDecorator('pid',{initialValue:'0'})
          this.pidShow=false
        }else{
          if(type=='1'){
            //组件可以手输,取消值
            this.componentDisabled=false
            this.form.getFieldDecorator('component',{initialValue:''})
        // eslint-disable-next-line eqeqeq
        if (type == '0') {
          // 重定向展示,并给空
          this.redirectShow = true
          this.form.resetFields(`redirect`, [])
          // 组件默认为显示,设置可输入,给默认组件 PageView,验证必填
          this.componentShow = true
          this.componentDisabled = false
          this.form.getFieldDecorator('component', { initialValue: 'PageView' })
          this.componentRequired = true
          // 父级初始化顶级,并将其隐藏
          this.form.getFieldDecorator('pid', { initialValue: '0' })
          this.pidShow = false
        } else {
          // eslint-disable-next-line eqeqeq
          if (type == '1') {
            // 组件可以手输,取消值
            this.componentDisabled = false
            this.form.getFieldDecorator('component', { initialValue: '' })
          }
          //重定向输入隐藏,并给空值
          this.redirectShow=false
          this.form.getFieldDecorator('redirect',{initialValue:''})
          //父级选择放开
          this.pidShow=true
          // 重定向输入隐藏,并给空值
          this.redirectShow = false
          this.form.getFieldDecorator('redirect', { initialValue: '' })
          // 父级选择放开
          this.pidShow = true
        }
        if(type=='2'){
          //组件设置不填,不可输入,并给空(手输的跟设置的)
        // eslint-disable-next-line eqeqeq
        if (type == '2') {
          // 组件设置不填,不可输入,并给空(手输的跟设置的)
          this.componentRequired = false
          this.componentDisabled=true
          this.form.resetFields(`component`,[]);
          this.form.getFieldDecorator('component',{initialValue:''})
          //路由选填,设置空值,并隐藏
          this.routerRequired=true
          this.form.getFieldDecorator('router',{initialValue:''})
          this.routerShow=false
          //内外链地址隐藏,给空值
          this.linkShow=false
          this.form.getFieldDecorator('link',{initialValue:''})
          //权限标识框显示,必填,给空值
          this.permissionShow=true
          this.permissionRequired =true
          this.form.getFieldDecorator('permission',{initialValue:''})
          //图标选择隐藏,并给空
          this.iconShow=false
          this.form.getFieldDecorator('icon',{initialValue:''})
          //打开方式设置为无 ,禁用选择方式
          this.componentDisabled = true
          this.form.resetFields(`component`, [])
          this.form.getFieldDecorator('component', { initialValue: '' })
          // 路由选填,设置空值,并隐藏
          this.routerRequired = true
          this.form.getFieldDecorator('router', { initialValue: '' })
          this.routerShow = false
          // 内外链地址隐藏,给空值
          this.linkShow = false
          this.form.getFieldDecorator('link', { initialValue: '' })
          // 权限标识框显示,必填,给空值
          this.permissionShow = true
          this.permissionRequired = true
          this.form.getFieldDecorator('permission', { initialValue: '' })
          // 图标选择隐藏,并给空
          this.iconShow = false
          this.form.getFieldDecorator('icon', { initialValue: '' })
          // 打开方式设置为无 ,禁用选择方式
          this.openType = '0'
          this.form.getFieldDecorator('openType',{initialValue:this.openType})
          this.form.getFieldDecorator('openType', { initialValue: this.openType })
          this.openTypeDisabled = true
          //取消icon
          this.form.getFieldDecorator('icon',{initialValue:''})
          // 取消icon
          this.form.getFieldDecorator('icon', { initialValue: '' })
        }
        this.meneOpenTypeFunc(this.openType)
      },
@ -470,80 +469,86 @@
      /**
       * 选择打开方式执行方法
       */
      meneOpenTypeFunc(openType){
         this.form.resetFields(`openType`,openType);
         if(openType == '2' || openType == '3'){
           //点击内外链的时候保留原值,其他清空
           if(this.linkDisabled = false){
             this.form.resetFields(`link`,[]);
      meneOpenTypeFunc (openType) {
         this.form.resetFields(`openType`, openType)
         // eslint-disable-next-line eqeqeq
         if (openType == '2' || openType == '3') {
           // 点击内外链的时候保留原值,其他清空
           if (this.linkDisabled === false) {
             this.form.resetFields(`link`, [])
           }
            //设置内外链可手输,加验证
            // 设置内外链可手输,加验证
           this.linkDisabled = false
           this.linkRequired = true
         }else{
            //设置内外链不可手输,取消值,取消验证
         } else {
            // 设置内外链不可手输,取消值,取消验证
            this.linkDisabled = true
            this.form.resetFields(`link`,[]);
            this.form.resetFields(`link`, [])
            this.linkRequired = false
         }
         //另起一个分支
        if(openType == '3'){
         // 另起一个分支
        // eslint-disable-next-line eqeqeq
        if (openType == '3') {
          this.componentRequired = false
          this.componentDisabled=true
          this.form.resetFields(`component`,[]);
          this.form.getFieldDecorator('component',{initialValue:''})
        }else{
          this.componentDisabled = true
          this.form.resetFields(`component`, [])
          this.form.getFieldDecorator('component', { initialValue: '' })
        } else {
          this.componentRequired = true
          if(this.type == '1' || this.type == '2'){
            this.form.getFieldDecorator('component',{initialValue:''})
          }else{
            this.form.resetFields(`component`,[]);
            this.form.getFieldDecorator('component',{initialValue:'PageView'})
          // eslint-disable-next-line eqeqeq
          if (this.type == '1' || this.type == '2') {
            this.form.getFieldDecorator('component', { initialValue: '' })
          } else {
            this.form.resetFields(`component`, [])
            this.form.getFieldDecorator('component', { initialValue: 'PageView' })
          }
          if(openType == '2'){
            //组件设置为 iframe
            this.form.resetFields(`component`,[]);
            this.form.getFieldDecorator('component',{initialValue:'Iframe'})
          // eslint-disable-next-line eqeqeq
          if (openType == '2') {
            // 组件设置为 iframe
            this.form.resetFields(`component`, [])
            this.form.getFieldDecorator('component', { initialValue: 'Iframe' })
          }
        }
        if(this.type == '2'){
          if(openType == '0'){
        // eslint-disable-next-line eqeqeq
        if (this.type == '2') {
          // eslint-disable-next-line eqeqeq
          if (openType == '0') {
            this.componentRequired = false
            this.routerRequired = false
          }
        }
      },
      openIconSele(){
        this.visibleIcon=true
      openIconSele () {
        this.visibleIcon = true
      },
      handleIconChange(icon){
        this.form.getFieldDecorator('icon',{initialValue:icon})
        this.visibleIcon=false
      handleIconChange (icon) {
        this.form.getFieldDecorator('icon', { initialValue: icon })
        this.visibleIcon = false
      },
      handleCancelIcon(){
        this.visibleIcon=false
      handleCancelIcon () {
        this.visibleIcon = false
      },
      handleSubmit () {
        const { form: { validateFields } } = this
        this.confirmLoading = true
        validateFields((errors, values) => {
          if (!errors) {
            if(values.visible){
              values.visible='Y'
            }else{
              values.visible='N'
            if (values.visible) {
              values.visible = 'Y'
            } else {
              values.visible = 'N'
            }
            sysMenuAdd(values).then((res) => {
              this.confirmLoading = false
              if(res.success){
              if (res.success) {
                this.$message.success('新增成功')
                this.$emit('ok', values)
                this.handleCancel ()
              }else{
                this.$message.error('新增失败:'+res.message)
                this.handleCancel()
              } else {
                this.$message.error('新增失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -552,11 +557,11 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.confirmLoading = false
        this.visible = false
      }
    },
    }
  }
</script>

+ 245 - 237
_web/src/views/system/menu/editForm.vue

@ -1,4 +1,3 @@
/* eslint-disable */
<template>
  <a-modal
@ -8,24 +7,24 @@
    :confirmLoading="confirmLoading"
    @ok="handleSubmit"
    @cancel="handleCancel"
    :destroyOnClose=true
    :destroyOnClose="true"
  >
    <a-spin :spinning="formLoading">
      <a-form  :form="form" >
      <a-form :form="form" >
        <a-form-item v-show=false >
          <a-input  v-decorator="['id']" />
        <a-form-item v-show="false" >
          <a-input v-decorator="['id']" />
        </a-form-item>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              label="菜单名称"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              hasFeedback
            >
              <a-input placeholder="请输入菜单名称"  v-decorator="['name',{rules: [{required: true, min: 1, message: '请输入菜单名称!'}]}]" />
              <a-input placeholder="请输入菜单名称" v-decorator="['name',{rules: [{required: true, min: 1, message: '请输入菜单名称!'}]}]" />
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="24">
@ -42,7 +41,7 @@
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
@ -50,25 +49,25 @@
              has-feedback
            >
              <a-select style="width: 100%" :disabled="appDisabled" placeholder="请选择应用分类" v-decorator="['application', {rules: [{ required: true, message: '请选择应用分类!' }]}]" >
                <a-select-option v-for='(item,index) in appData' :key="index" :value="item.code" @click="changeApplication(item.code)">{{item.name}}</a-select-option>
                <a-select-option v-for="(item,index) in appData" :key="index" :value="item.code" @click="changeApplication(item.code)">{{ item.name }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="菜单层级"
            >
              <a-radio-group v-decorator="['type',{rules: [{ required: true, message: '请选择菜单层级!' }]}]" >
                <a-radio v-for='(item,index) in typeData' :key="index" :value="item.code" @click="meneTypeFunc(item.code)">{{item.value}}</a-radio>
                <a-radio v-for="(item,index) in typeData" :key="index" :value="item.code" @click="meneTypeFunc(item.code)">{{ item.value }}</a-radio>
              </a-radio-group>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <div v-show="pidShow">
              <a-form-item
                :labelCol="labelCol"
@ -85,7 +84,7 @@
                  treeDefaultExpandAll
                  @change="setPid"
                >
                  <span  slot="title" slot-scope="{ id }">{{ id }}
                  <span slot="title" slot-scope="{ id }">{{ id }}
                  </span>
                </a-tree-select>
              </a-form-item>
@ -101,11 +100,11 @@
                  </a-tooltip>&nbsp;
                  重定向
                </span>
                <a-input prop="redirect" placeholder="请输入重定向地址" v-decorator="['redirect']"  />
                <a-input prop="redirect" placeholder="请输入重定向地址" v-decorator="['redirect']" />
              </a-form-item>
            </div>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
@ -116,8 +115,8 @@
                </a-tooltip>&nbsp;
                打开方式
              </span>
              <a-radio-group :disabled="openTypeDisabled"  v-decorator="['openType',{rules: [{ required: true, message: '请选择打开方式!' }]}]">
                <a-radio v-for='(item,index) in openTypeData'  :key="index" :value="item.code" @click="meneOpenTypeFunc(item.code)">{{item.value}}</a-radio>
              <a-radio-group :disabled="openTypeDisabled" v-decorator="['openType',{rules: [{ required: true, message: '请选择打开方式!' }]}]">
                <a-radio v-for="(item,index) in openTypeData" :key="index" :value="item.code" @click="meneOpenTypeFunc(item.code)">{{ item.value }}</a-radio>
              </a-radio-group>
            </a-form-item>
@ -127,7 +126,7 @@
        <a-divider />
        <a-row :gutter="24" >
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <div v-show="componentShow">
              <a-form-item
                :labelCol="labelCol"
@ -144,7 +143,7 @@
              </a-form-item>
            </div>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <div v-show="routerShow">
              <a-form-item
                :labelCol="labelCol"
@ -167,15 +166,14 @@
                label="权限标识"
                hasFeedback
              >
                <a-input placeholder="请输入权限标识" v-decorator="['permission', {rules: [{required: permissionRequired,  message: '请输入权限标识!'}]}]" />
                <a-input placeholder="请输入权限标识" v-decorator="['permission', {rules: [{required: permissionRequired, message: '请输入权限标识!'}]}]" />
              </a-form-item>
            </div>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <div v-show="linkShow" >
              <a-form-item
                :labelCol="labelCol"
@ -188,28 +186,27 @@
                  </a-tooltip>&nbsp;
                  内外链地址
                </span>
                <a-input placeholder="请输入内链打开地址" :disabled="linkDisabled" v-decorator="['link', {rules: [{required: linkRequired,  message: '请输入权限标识!'}]}]" />
                <a-input placeholder="请输入内链打开地址" :disabled="linkDisabled" v-decorator="['link', {rules: [{required: linkRequired, message: '请输入权限标识!'}]}]" />
              </a-form-item>
            </div>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <div v-show="iconShow" >
              <a-form-item
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                label="图标"
              >
                <a-input placeholder="请选择图标"  disabled="disabled" v-decorator="['icon']" >
                  <a-icon slot="addonAfter"   @click="openIconSele()" type="setting" />
                <a-input placeholder="请选择图标" disabled="disabled" v-decorator="['icon']" >
                  <a-icon slot="addonAfter" @click="openIconSele()" type="setting" />
                </a-input>
              </a-form-item>
            </div>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
@ -221,23 +218,23 @@
                权重
              </span>
              <a-radio-group v-decorator="['weight']">
                <a-radio v-for='(item,index) in weightData' :key="index" :value="item.code" >{{item.value}}</a-radio>
                <a-radio v-for="(item,index) in weightData" :key="index" :value="item.code" >{{ item.value }}</a-radio>
              </a-radio-group>
            </a-form-item>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              label="是否可见"
            >
              <a-switch id="visible" checkedChildren="是" unCheckedChildren="否"  v-decorator="['visible', { valuePropName: 'checked' }]"/>
              <a-switch id="visible" checkedChildren="是" unCheckedChildren="否" v-decorator="['visible', { valuePropName: 'checked' }]"/>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
@ -246,7 +243,7 @@
              <a-input-number style="width: 100%" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
            </a-form-item>
          </a-col>
          <a-col  :md="12" :sm="24">
          <a-col :md="12" :sm="24">
            <a-form-item
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
@ -265,9 +262,9 @@
      :visible="visibleIcon"
      @cancel="handleCancelIcon"
      footer=""
      :mask=false
      :closable=false
      :destroyOnClose=true
      :mask="false"
      :closable="false"
      :destroyOnClose="true"
    >
      <icon-selector v-model="currentSelectedIcon" @change="handleIconChange"/>
    </a-modal>
@ -276,12 +273,12 @@
<script>
  import { getAppList } from '@/api/modular/system/appManage'
  import { getMenuTree ,sysMenuEdit} from '@/api/modular/system/menuManage'
  import { getMenuTree, sysMenuEdit } from '@/api/modular/system/menuManage'
  import IconSelector from '@/components/IconSelector'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  export default {
    name:'menu_edit',
    components: {IconSelector},
    name: 'MenuEdit',
    components: { IconSelector },
    data () {
      return {
@ -293,148 +290,149 @@
          xs: { span: 24 },
          sm: { span: 16 }
        },
        visibleIcon:false,
        visibleIcon: false,
        visible: false,
        confirmLoading: false,
        appData:[],
        menuTreeData:[],
        redirectShow:true,
        componentShow:true,
        componentDisabled:false,
        componentRequired:true,
        routerRequired:true,
        routerShow:true,
        iconShow:true,
        openTypeShow:true,
        pidShow:true,
        permissionShow:true,
        permissionRequired:true,
        //图标组件
        appData: [],
        menuTreeData: [],
        redirectShow: true,
        componentShow: true,
        componentDisabled: false,
        componentRequired: true,
        routerRequired: true,
        routerShow: true,
        iconShow: true,
        openTypeShow: true,
        pidShow: true,
        permissionShow: true,
        permissionRequired: true,
        // 图标组件
        currentSelectedIcon: 'pause-circle',
        typeData:[],
        openTypeData:[],
        weightData:[],
        formLoading:true,
        linkShow:true,
        openTypeDisabled:false,
        openTypeDefault:[],
        openType:'',
        linkRequired:true,
        linkDisabled:false,
        type:'',
        pid:'',
        appDisabled:false,
        form: this.$form.createForm(this),
        typeData: [],
        openTypeData: [],
        weightData: [],
        formLoading: true,
        linkShow: true,
        openTypeDisabled: false,
        openTypeDefault: [],
        openType: '',
        linkRequired: true,
        linkDisabled: false,
        type: '',
        pid: '',
        appDisabled: false,
        form: this.$form.createForm(this)
      }
    },
    watch: {
      pid(val) {
        if(val === '0'){
           //再不能切换应用
      pid (val) {
        if (val === '0') {
           // 再不能切换应用
          this.appDisabled = false
        }else{
        } else {
          this.appDisabled = true
        }
      }
    },
    methods: {
      //打开页面初始化
      // 打开页面初始化
      edit (record) {
        this.visible = true
        //获取系统应用列表
        this.getSysApplist();
        // 获取系统应用列表
        this.getSysApplist()
        this.sysDictTypeDropDown()
        //图标
        // 图标
        this.currentSelectedIcon = record.icon
        //默认选中菜单项,并初始化
        this.form.getFieldDecorator('type',{valuePropName:'checked',initialValue:record.type.toString()})
        this.meneTypeFunc(record.type.toString(),record.openType.toString())
        // 默认选中菜单项,并初始化
        this.form.getFieldDecorator('type', { valuePropName: 'checked', initialValue: record.type.toString() })
        this.meneTypeFunc(record.type.toString(), record.openType.toString())
        //默认选中的单选框
        const visibleDef=false
        if(record.visible=='Y'){
          this.visibleDef=true
        // 默认选中的单选框
        // eslint-disable-next-line no-unused-vars
        const visibleDef = false
        // eslint-disable-next-line eqeqeq
        if (record.visible == 'Y') {
          this.visibleDef = true
        }
        this.form.getFieldDecorator('weight',{valuePropName:'checked',initialValue:record.weight.toString()})
        this.form.getFieldDecorator('visible',{valuePropName:'checked',initialValue:this.visibleDef})
        this.form.getFieldDecorator('icon',{initialValue:record.icon})
        setTimeout(()=>{
        this.form.getFieldDecorator('weight', { valuePropName: 'checked', initialValue: record.weight.toString() })
        this.form.getFieldDecorator('visible', { valuePropName: 'checked', initialValue: this.visibleDef })
        this.form.getFieldDecorator('icon', { initialValue: record.icon })
        setTimeout(() => {
           this.setMenuItem(record)
          this.changeApplication(record.application)
        },100)
        }, 100)
      },
      setMenuItem(record){
      setMenuItem (record) {
        this.form.setFieldsValue(
          {
            id:record.id,
            name:record.name,
            code:record.code,
            application:record.application,
            redirect:record.redirect,
            component:record.component,
            permission:record.permission,
            link:record.link,
            router:record.router,
            sort:record.sort,
            remark:record.remark,
            id: record.id,
            name: record.name,
            code: record.code,
            application: record.application,
            redirect: record.redirect,
            component: record.component,
            permission: record.permission,
            link: record.link,
            router: record.router,
            sort: record.sort,
            remark: record.remark
          }
        );
        this.form.getFieldDecorator('pid',{initialValue:record.pid})
        )
        this.form.getFieldDecorator('pid', { initialValue: record.pid })
        this.pid = record.pid
      },
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown(){
        this.formLoading=true
        //菜单类型
        sysDictTypeDropDown({code:'menu_type'}).then((res)=>{
          this.typeData=res.data
      sysDictTypeDropDown () {
        this.formLoading = true
        // 菜单类型
        sysDictTypeDropDown({ code: 'menu_type' }).then((res) => {
          this.typeData = res.data
        })
        //权重
        sysDictTypeDropDown({code:'menu_weight'}).then((res)=>{
          this.weightData=res.data
        // 权重
        sysDictTypeDropDown({ code: 'menu_weight' }).then((res) => {
          this.weightData = res.data
        })
        //内外链
        sysDictTypeDropDown({code:'open_type'}).then((res)=>{
          this.openTypeData=res.data
          this.formLoading=false
        // 内外链
        sysDictTypeDropDown({ code: 'open_type' }).then((res) => {
          this.openTypeData = res.data
          this.formLoading = false
        })
      },
      /**
       * 选择父级
       */
      setPid(value){
      setPid (value) {
        this.pid = value
      },
      getSysApplist() {
      getSysApplist () {
        return getAppList().then((res) => {
          if (res.success) {
            this.appData=res.data
            this.appData = res.data
          } else {
            this.$message.warning(res.message)
          }
        })
      },
      changeApplication(value){
        getMenuTree({'application':value}).then((res) => {
      changeApplication (value) {
        getMenuTree({ 'application': value }).then((res) => {
          if (res.success) {
            this.form.resetFields(`pid`,[]);
            this.menuTreeData=[{
              "id": "-1",
              "parentId": "0",
              "title": "顶级",
              "value": "0",
              "pid": "0",
              "children":res.data
            this.form.resetFields(`pid`, [])
            this.menuTreeData = [{
              'id': '-1',
              'parentId': '0',
              'title': '顶级',
              'value': '0',
              'pid': '0',
              'children': res.data
            }]
          } else {
            this.$message.warning(res.message)
@ -445,78 +443,82 @@
      /**
       * 选择菜单类型执行初始化表单变量
       */
      meneTypeFunc(type,openType){
      meneTypeFunc (type, openType) {
        this.type = type
        if(type=='0' || type=='1'){
          //内外链地址显示,给空值
          this.linkShow=true
          this.form.resetFields(`link`,[]);
          //图标选择显示
          this.iconShow=true
          //路由必填,设置空值,并显示
          this.routerRequired=true
          this.form.getFieldDecorator('router',{initialValue:''})
          this.routerShow=true
          //权限标识框隐藏,选填,给空值
          this.permissionShow=false
          this.permissionRequired =false
          this.form.getFieldDecorator('permission',{initialValue:''})
          //打开方式设置为组件 ,禁用选择方式
        // eslint-disable-next-line eqeqeq
        if (type == '0' || type == '1') {
          // 内外链地址显示,给空值
          this.linkShow = true
          this.form.resetFields(`link`, [])
          // 图标选择显示
          this.iconShow = true
          // 路由必填,设置空值,并显示
          this.routerRequired = true
          this.form.getFieldDecorator('router', { initialValue: '' })
          this.routerShow = true
          // 权限标识框隐藏,选填,给空值
          this.permissionShow = false
          this.permissionRequired = false
          this.form.getFieldDecorator('permission', { initialValue: '' })
          // 打开方式设置为组件 ,禁用选择方式
          this.openType = openType
          this.form.getFieldDecorator('openType',{initialValue:this.openType})
          this.form.getFieldDecorator('openType', { initialValue: this.openType })
          this.openTypeDisabled = false
        }
        if(type=='0'){
          //重定向展示,并给空
          this.redirectShow=true
          this.form.resetFields(`redirect`,[]);
          //组件默认为显示,设置可输入,给默认组件 PageView,验证必填
          this.componentShow=true
          this.componentDisabled=false
          this.form.getFieldDecorator('component',{initialValue:'PageView'})
          this.componentRequired=true
          //父级初始化顶级,并将其隐藏
          this.form.getFieldDecorator('pid',{initialValue:'0'})
        // eslint-disable-next-line eqeqeq
        if (type == '0') {
          // 重定向展示,并给空
          this.redirectShow = true
          this.form.resetFields(`redirect`, [])
          // 组件默认为显示,设置可输入,给默认组件 PageView,验证必填
          this.componentShow = true
          this.componentDisabled = false
          this.form.getFieldDecorator('component', { initialValue: 'PageView' })
          this.componentRequired = true
          // 父级初始化顶级,并将其隐藏
          this.form.getFieldDecorator('pid', { initialValue: '0' })
          this.pid = '0'
          this.pidShow=false
        }else{
          if(type=='1'){
            //组件可以手输,取消值
            this.componentDisabled=false
            this.form.getFieldDecorator('component',{initialValue:''})
          this.pidShow = false
        } else {
          // eslint-disable-next-line eqeqeq
          if (type == '1') {
            // 组件可以手输,取消值
            this.componentDisabled = false
            this.form.getFieldDecorator('component', { initialValue: '' })
          }
          //重定向输入隐藏,并给空值
          this.redirectShow=false
          this.form.getFieldDecorator('redirect',{initialValue:''})
          //父级选择放开
          this.pidShow=true
          // 重定向输入隐藏,并给空值
          this.redirectShow = false
          this.form.getFieldDecorator('redirect', { initialValue: '' })
          // 父级选择放开
          this.pidShow = true
        }
        if(type=='2'){
          //组件设置不填,不可输入,并给空(手输的跟设置的)
        // eslint-disable-next-line eqeqeq
        if (type == '2') {
          // 组件设置不填,不可输入,并给空(手输的跟设置的)
          this.componentRequired = false
          this.componentDisabled=true
          this.form.resetFields(`component`,[]);
          this.form.getFieldDecorator('component',{initialValue:''})
          //路由选填,设置空值,并隐藏
          this.routerRequired=true
          this.form.getFieldDecorator('router',{initialValue:''})
          this.routerShow=false
          //内外链地址隐藏,给空值
          this.linkShow=false
          this.form.getFieldDecorator('link',{initialValue:''})
          //权限标识框显示,必填,给空值
          this.permissionShow=true
          this.permissionRequired =true
          this.form.getFieldDecorator('permission',{initialValue:''})
          //图标选择隐藏,并给空
          this.iconShow=false
          this.form.getFieldDecorator('icon',{initialValue:''})
          //打开方式设置为无 ,禁用选择方式
          this.componentDisabled = true
          this.form.resetFields(`component`, [])
          this.form.getFieldDecorator('component', { initialValue: '' })
          // 路由选填,设置空值,并隐藏
          this.routerRequired = true
          this.form.getFieldDecorator('router', { initialValue: '' })
          this.routerShow = false
          // 内外链地址隐藏,给空值
          this.linkShow = false
          this.form.getFieldDecorator('link', { initialValue: '' })
          // 权限标识框显示,必填,给空值
          this.permissionShow = true
          this.permissionRequired = true
          this.form.getFieldDecorator('permission', { initialValue: '' })
          // 图标选择隐藏,并给空
          this.iconShow = false
          this.form.getFieldDecorator('icon', { initialValue: '' })
          // 打开方式设置为无 ,禁用选择方式
          this.openType = '0'
          this.form.getFieldDecorator('openType',{initialValue:this.openType})
          this.form.getFieldDecorator('openType', { initialValue: this.openType })
          this.openTypeDisabled = true
          //取消icon
          this.form.getFieldDecorator('icon',{initialValue:''})
          // 取消icon
          this.form.getFieldDecorator('icon', { initialValue: '' })
        }
        this.meneOpenTypeFunc(this.openType)
      },
@ -524,83 +526,89 @@
      /**
       * 选择打开方式执行方法
       */
      meneOpenTypeFunc(openType){
        this.form.resetFields(`openType`,openType);
        if(openType == '2' || openType == '3'){
          //点击内外链的时候保留原值,其他清空
          if(this.linkDisabled = false){
            this.form.resetFields(`link`,[]);
      meneOpenTypeFunc (openType) {
        this.form.resetFields(`openType`, openType)
        // eslint-disable-next-line eqeqeq
        if (openType == '2' || openType == '3') {
          // 点击内外链的时候保留原值,其他清空
          if (this.linkDisabled === false) {
            this.form.resetFields(`link`, [])
          }
          //设置内外链可手输,加验证
          // 设置内外链可手输,加验证
          this.linkDisabled = false
          this.linkRequired = true
        }else{
          //设置内外链不可手输,取消值,取消验证
        } else {
          // 设置内外链不可手输,取消值,取消验证
          this.linkDisabled = true
          this.form.resetFields(`link`,[]);
          this.form.resetFields(`link`, [])
          this.linkRequired = false
        }
        //另起一个分支
        if(openType == '3'){
        // 另起一个分支
        // eslint-disable-next-line eqeqeq
        if (openType == '3') {
          this.componentRequired = false
          this.componentDisabled=true
          this.form.resetFields(`component`,[]);
          this.form.getFieldDecorator('component',{initialValue:''})
        }else{
          this.componentDisabled = true
          this.form.resetFields(`component`, [])
          this.form.getFieldDecorator('component', { initialValue: '' })
        } else {
          this.componentRequired = true
          if(this.type == '1' || this.type == '2'){
            this.form.getFieldDecorator('component',{initialValue:''})
          }else{
            this.form.resetFields(`component`,[]);
            this.form.getFieldDecorator('component',{initialValue:'PageView'})
          // eslint-disable-next-line eqeqeq
          if (this.type == '1' || this.type == '2') {
            this.form.getFieldDecorator('component', { initialValue: '' })
          } else {
            this.form.resetFields(`component`, [])
            this.form.getFieldDecorator('component', { initialValue: 'PageView' })
          }
          if(openType == '2'){
            //组件设置为 iframe
            this.form.resetFields(`component`,[]);
            this.form.getFieldDecorator('component',{initialValue:'Iframe'})
          // eslint-disable-next-line eqeqeq
          if (openType == '2') {
            // 组件设置为 iframe
            this.form.resetFields(`component`, [])
            this.form.getFieldDecorator('component', { initialValue: 'Iframe' })
          }
        }
        if(this.type == '2'){
          if(openType == '0'){
        // eslint-disable-next-line eqeqeq
        if (this.type == '2') {
          // eslint-disable-next-line eqeqeq
          if (openType == '0') {
            this.componentRequired = false
            this.routerRequired = false
          }
        }
      },
      openIconSele(){
        this.visibleIcon=true
      openIconSele () {
        this.visibleIcon = true
      },
      handleIconChange(icon){
        //console.log('新图标:'+icon)
        this.form.getFieldDecorator('icon',{initialValue:icon})
        //this.form.resetFields(`icon`,icon);
      handleIconChange (icon) {
        // console.log('新图标:'+icon)
        this.form.getFieldDecorator('icon', { initialValue: icon })
        // this.form.resetFields(`icon`,icon);
        this.visibleIcon=false
        this.visibleIcon = false
      },
      handleCancelIcon(){
        this.visibleIcon=false
      handleCancelIcon () {
        this.visibleIcon = false
      },
      handleSubmit () {
        const { form: { validateFields } } = this
        this.confirmLoading = true
        validateFields((errors, values) => {
          if (!errors) {
            if(values.visible){
              values.visible='Y'
            }else{
              values.visible='N'
            if (values.visible) {
              values.visible = 'Y'
            } else {
              values.visible = 'N'
            }
            sysMenuEdit(values).then((res) => {
              this.confirmLoading = false
              if(res.success){
              if (res.success) {
                this.$message.success('编辑成功')
                this.$emit('ok', values)
                this.handleCancel ()
              }else{
                this.$message.error('编辑失败:'+res.message)
                this.handleCancel()
              } else {
                this.$message.error('编辑失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -609,11 +617,11 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.confirmLoading = false
        this.visible = false
      }
    },
    }
  }
</script>

+ 68 - 68
_web/src/views/system/menu/index.vue

@ -12,39 +12,39 @@
      <a style="margin-left: 24px" @click="clearSele()">清空</a>
    </div>-->
  <a-table
    ref="table"
    :rowKey="(record) => record.id"
    :pagination="false"
    :defaultExpandAllRows="true"
    :columns="columns"
    :dataSource="data"
    :loading="loading"
     showPagination="auto"
    :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
   >
    <!--:rowSelection="rowSelectionon"-->
    <span slot="type" slot-scope="text">
      {{ typeFilter(text) }}
    </span>
    <span slot="icon" slot-scope="text">
      <div v-if="text != ''">
        <a-icon :type="text"/>
      </div>
    </span>
    <span slot="action" slot-scope="text, record">
      <template>
        <a v-if="hasPerm('sysMenu:edit')" @click="$refs.editForm.edit(record)">编辑</a>
        <a-divider type="vertical" v-if="hasPerm('sysMenu:edit') & hasPerm('sysMenu:delete')"/>
        <a-popconfirm v-if="hasPerm('sysMenu:delete')" placement="topRight" title="删除本菜单与下级?" @confirm="() => handleDel(record)">
          <a>删除</a>
        </a-popconfirm>
      </template>
    </span>
  </a-table>
    <a-table
      ref="table"
      :rowKey="(record) => record.id"
      :pagination="false"
      :defaultExpandAllRows="true"
      :columns="columns"
      :dataSource="data"
      :loading="loading"
      showPagination="auto"
      :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
    >
      <!--:rowSelection="rowSelectionon"-->
      <span slot="type" slot-scope="text">
        {{ typeFilter(text) }}
      </span>
      <span slot="icon" slot-scope="text">
        <div v-if="text != ''">
          <a-icon :type="text"/>
        </div>
      </span>
      <span slot="action" slot-scope="text, record">
        <template>
          <a v-if="hasPerm('sysMenu:edit')" @click="$refs.editForm.edit(record)">编辑</a>
          <a-divider type="vertical" v-if="hasPerm('sysMenu:edit') & hasPerm('sysMenu:delete')"/>
          <a-popconfirm v-if="hasPerm('sysMenu:delete')" placement="topRight" title="删除本菜单与下级?" @confirm="() => handleDel(record)">
            <a>删除</a>
          </a-popconfirm>
        </template>
      </span>
    </a-table>
    <add-form ref="addForm" @ok="handleOk"/>
    <edit-form ref="editForm" @ok="handleOk"/>
@ -53,7 +53,7 @@
</template>
<script>
  import { getMenuList ,sysMenuDelete} from '@/api/modular/system/menuManage'
  import { getMenuList, sysMenuDelete } from '@/api/modular/system/menuManage'
  import addForm from './addForm'
  import editForm from './editForm'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
@ -64,15 +64,15 @@
      editForm
    },
    data() {
    data () {
      return {
        data:[],
        loading : true,
        data: [],
        loading: true,
        columns: [
          {
            title: '菜单名称',
            dataIndex: 'name',
            width:'20%',
            width: '20%'
          },
          {
            title: '菜单类型',
@ -87,27 +87,27 @@
          {
            title: '组件',
            dataIndex: 'component',
            ellipsis: true,
            ellipsis: true
          },
          {
            title: '路由地址',
            dataIndex: 'router',
            key:'router',
            ellipsis: true,
            key: 'router',
            ellipsis: true
          },
          {
            title: '排序',
            dataIndex: 'sort',
            dataIndex: 'sort'
          }
        ],
        selectedRowKeys:[],
        typeDict:[]
        selectedRowKeys: [],
        typeDict: []
      }
    },
    created () {
      this.loadData()
      if(this.hasPerm('sysMenu:edit') || this.hasPerm('sysMenu:delete')){
      if (this.hasPerm('sysMenu:edit') || this.hasPerm('sysMenu:delete')) {
        this.columns.push({
          title: '操作',
          dataIndex: 'action',
@ -118,11 +118,11 @@
    },
    methods: {
      loadData() {
      loadData () {
        this.loading = true
        getMenuList(this.queryParam).then((res) => {
          if (res.success) {
            this.data=res.data
            this.data = res.data
          }
        }).finally(() => {
          this.loading = false
@ -131,50 +131,50 @@
      },
      typeFilter (type) {
        const type_value = this.typeDict.filter(item => item.code == type)
        if(type_value.length>0){
          return type_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.typeDict.filter(item => item.code == type)
        if (values.length > 0) {
          return values[0].value
        }
      },
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown(){
        sysDictTypeDropDown({code:'menu_type'}).then((res)=>{
          this.typeDict=res.data
      sysDictTypeDropDown () {
        sysDictTypeDropDown({ code: 'menu_type' }).then((res) => {
          this.typeDict = res.data
        })
      },
      refreshSele(){
        this.loadData();
      refreshSele () {
        this.loadData()
      },
      handleOk () {
        this.loadData()
      },
      handleDel (record) {
        sysMenuDelete(record).then((res)=>{
           if(res.success){
        sysMenuDelete(record).then((res) => {
           if (res.success) {
             this.$message.success('删除成功')
             this.loadData()
           }else{
             this.$message.error('删除失败:'+res.message)
           } else {
             this.$message.error('删除失败:' + res.message)
           }
        }).catch((err)=>{
            this.$message.error('错误:'+err.message)
        }).catch((err) => {
            this.$message.error('错误:' + err.message)
        })
      },
      onSelectChange(selectedRowKeys) {
        this.selectedRowKeys = selectedRowKeys;
      onSelectChange (selectedRowKeys) {
        this.selectedRowKeys = selectedRowKeys
      },
      clearSele(){
        this.selectedRowKeys =[]
      clearSele () {
        this.selectedRowKeys = []
      }
    },
    }
  }
</script>
<style scoped>
@ -185,4 +185,4 @@
    margin-right: 8px;
  }
</style>
</style>

+ 63 - 62
_web/src/views/system/notice/addForm.vue

@ -8,29 +8,29 @@
  >
    <a-spin :spinning="formLoading">
      <a-form :form="form">
      <a-form-item
        label="标题"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
      >
        <a-input placeholder="请输入标题" v-decorator="['title', {rules: [{required: true, message: '请输入标题!'}]}]" />
      </a-form-item>
        <a-form-item
          label="标题"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
        >
          <a-input placeholder="请输入标题" v-decorator="['title', {rules: [{required: true, message: '请输入标题!'}]}]" />
        </a-form-item>
        <a-form-item
          label="类型"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
        >
          <a-radio-group v-decorator="['type',{rules: [{ required: true, message: '请选择类型!' }]}]" >
            <a-radio-button v-for='(item,index) in typeDictTypeDropDown' :key="index" :value="item.code">{{item.value}}</a-radio-button>
            <a-radio-button v-for="(item,index) in typeDictTypeDropDown" :key="index" :value="item.code">{{ item.value }}</a-radio-button>
          </a-radio-group>
        </a-form-item>
      <a-form-item
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        label="内容"
      >
        <antd-editor :uploadConfig="editorUploadConfig" v-model="editorContent" @onchange="changeEditor" @oninit="getEditor" />
      </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="内容"
        >
          <antd-editor :uploadConfig="editorUploadConfig" v-model="editorContent" @onchange="changeEditor" @oninit="getEditor" />
        </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
@ -51,9 +51,9 @@
        </a-form-item>
        <a-divider />
        <a-form-item class="subForm-item">
          <a-button type="primary"  class="subButton"  @click="handleSubmit('1')">发布</a-button>
          <a-button type="primary" class="subButton" @click="handleSubmit('1')">发布</a-button>
          <a-button type="danger" class="subButton" @click="handleSubmit('0')">存为草稿</a-button>
          <a-button class="subButton"  @click="handleCancel">取消</a-button>
          <a-button class="subButton" @click="handleCancel">取消</a-button>
        </a-form-item>
      </a-form>
    </a-spin>
@ -66,8 +66,8 @@
  import { AntdEditor } from '@/components'
  import { sysUserSelector } from '@/api/modular/system/userManage'
  export default {
    name: 'addForm',
    components:{
    name: 'AddForm',
    components: {
      AntdEditor
    },
    data () {
@ -80,34 +80,34 @@
          xs: { span: 24 },
          sm: { span: 18 }
        },
        visible:false,
        visible: false,
        confirmLoading: false,
        form: this.$form.createForm(this),
        editorContent: '',
        editorContentText:'',
        editorContentText: '',
        editorUploadConfig: {
          method: 'http',
          callback: this.editorUploadImage
        },
        mockData: [],
        targetKeys: [],
        typeDictTypeDropDown:[],//0通知 1公告
        formLoading:true
        typeDictTypeDropDown: [], // 0通知 1公告
        formLoading: true
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      add () {
        this.visible = true
        this.sysDictTypeDropDown()//先注释
        this.getMock();
        this.sysDictTypeDropDown()// 先注释
        this.getMock()
      },
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown(){
        sysDictTypeDropDown({code:'notice_type'}).then((res)=>{
          this.typeDictTypeDropDown=res.data
      sysDictTypeDropDown () {
        sysDictTypeDropDown({ code: 'notice_type' }).then((res) => {
          this.typeDictTypeDropDown = res.data
        })
      },
      /**
@ -120,12 +120,12 @@
        })
        sysFileInfoUpload(formData).then((res) => {
          if (res.success) {
            insert(process.env.VUE_APP_API_BASE_URL+'/sysFileInfo/preview?id='+res.data)
          }else {
            this.$message.error('编辑器上传图片失败:' + res.message);
            insert(process.env.VUE_APP_API_BASE_URL + '/sysFileInfo/preview?id=' + res.data)
          } else {
            this.$message.error('编辑器上传图片失败:' + res.message)
          }
        }).catch((err)=>{
          this.$message.error('预览错误:'+err.message)
        }).catch((err) => {
          this.$message.error('预览错误:' + err.message)
        })
      },
      getEditor (editor) {
@ -138,37 +138,38 @@
      /**
       * 穿梭框
       */
      getMock() {
        const targetKeys = [];
        const mockData = [];
        sysUserSelector().then((res)=>{
          this.formLoading=false
      getMock () {
        const targetKeys = []
        const mockData = []
        sysUserSelector().then((res) => {
          this.formLoading = false
          for (let i = 0; i < res.data.length; i++) {
            const data = {
              key: res.data[i].id.toString(),
              title:res.data[i].name ,
              description: `description of ${res.data[i].name}`,
            };
            mockData.push(data);
              title: res.data[i].name,
              description: `description of ${res.data[i].name}`
            }
            mockData.push(data)
          }
        })
        this.mockData = mockData;
        this.targetKeys = targetKeys;
        this.mockData = mockData
        this.targetKeys = targetKeys
      },
      filterOption(inputValue, option) {
        return option.description.indexOf(inputValue) > -1;
      filterOption (inputValue, option) {
        return option.description.indexOf(inputValue) > -1
      },
      handleChange(targetKeys, direction, moveKeys) {
        this.targetKeys = targetKeys;
      handleChange (targetKeys, direction, moveKeys) {
        this.targetKeys = targetKeys
      },
      handleSubmit (types) {
        const { form: { validateFields } } = this
        if(this.editorContent == ''){
          this.$message.error("请填写内容")
        // eslint-disable-next-line eqeqeq
        if (this.editorContent == '') {
          this.$message.error('请填写内容')
          return
        }
        if(this.targetKeys.length <1){
          this.$message.error("请选择通知到的人")
        if (this.targetKeys.length < 1) {
          this.$message.error('请选择通知到的人')
          return
        }
         validateFields((errors, values) => {
@ -178,14 +179,14 @@
              values.status = types
              values.noticeUserIdList = this.targetKeys
              sysNoticeAdd(values).then((res) => {
                if(res.success){
                if (res.success) {
                  this.$message.success('新增成功')
                  this.$emit('ok', values)
                  this.handleCancel()
                }else{
                  this.$message.error('新增失败:'+res.message)
                } else {
                  this.$message.error('新增失败:' + res.message)
                }
              }).finally((res) =>{
              }).finally((res) => {
                this.formLoading = false
              })
            }
@ -193,11 +194,11 @@
      },
      handleCancel () {
        this.editor.txt.clear()
        this.targetKeys =[]
        this.editorContent =''
        this.form.resetFields();
        this.targetKeys = []
        this.editorContent = ''
        this.form.resetFields()
        this.visible = false
        this.formLoading=true
        this.formLoading = true
      }
    }
  }
@ -209,4 +210,4 @@
  .subForm-item{
    margin-bottom: 0px;
  }
</style>
</style>

+ 14 - 14
_web/src/views/system/notice/detailForm.vue

@ -8,11 +8,11 @@
    @cancel="handleCancel"
  >
    <a-spin :spinning="confirmLoading">
      <div style="text-align: center;font-size: 30px">{{this.contentRecord.title}}</div>
      <div style="text-align: center;font-size: 30px">{{ this.contentRecord.title }}</div>
      <br>
      <div style="text-align: right;font-size: 10px">
         <span>(发布人:{{this.contentRecord.publicUserName}})</span>
        <span>发布时间:{{this.contentRecord.publicTime}} </span>
        <span>(发布人:{{ this.contentRecord.publicUserName }})</span>
        <span>发布时间:{{ this.contentRecord.publicTime }} </span>
      </div>
      <a-divider style="margin-top: 5px"/>
      <div >
@ -25,30 +25,30 @@
  import { sysNoticeDetail } from '@/api/modular/system/noticeManage'
  export default {
    name: 'detailForm',
    components:{
    name: 'DetailForm',
    components: {
    },
    data () {
      return {
        visible:false,
        visible: false,
        confirmLoading: false,
        contentRecord: {},
        contentRecord: {}
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      detail (record) {
        this.confirmLoading=true
        this.confirmLoading = true
        this.visible = true
        this.sysNoticeDetail(record.id)
      },
      /**
       * 查看详情
       */
      sysNoticeDetail(id){
        sysNoticeDetail({id:id}).then((res)=>{
          this.confirmLoading=false
          this.contentRecord =res.data
      sysNoticeDetail (id) {
        sysNoticeDetail({ id: id }).then((res) => {
          this.confirmLoading = false
          this.contentRecord = res.data
        })
      },
      handleCancel () {
@ -57,4 +57,4 @@
      }
    }
  }
</script>
</script>

+ 61 - 61
_web/src/views/system/notice/editForm.vue

@ -24,7 +24,7 @@
          :wrapperCol="wrapperCol"
        >
          <a-radio-group v-decorator="['type',{rules: [{ required: true, message: '请选择类型!' }]}]" >
            <a-radio-button v-for='(item,index) in typeDictTypeDropDown' :key="index" :value="item.code">{{item.value}}</a-radio-button>
            <a-radio-button v-for="(item,index) in typeDictTypeDropDown" :key="index" :value="item.code">{{ item.value }}</a-radio-button>
          </a-radio-group>
        </a-form-item>
        <a-form-item
@ -54,23 +54,23 @@
        </a-form-item>
        <a-divider />
        <a-form-item class="subForm-item">
          <a-button type="primary"  class="subButton"  @click="handleSubmit('1')">发布</a-button>
          <a-button type="primary" class="subButton" @click="handleSubmit('1')">发布</a-button>
          <a-button type="danger" class="subButton" @click="handleSubmit('0')">存为草稿</a-button>
          <a-button class="subButton"   @click="handleCancel">取消</a-button>
          <a-button class="subButton" @click="handleCancel">取消</a-button>
        </a-form-item>
      </a-form>
    </a-spin>
  </a-modal>
</template>
<script>
  import { sysNoticeEdit ,sysNoticeDetail} from '@/api/modular/system/noticeManage'
  import { sysNoticeEdit, sysNoticeDetail } from '@/api/modular/system/noticeManage'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  import { sysFileInfoUpload } from '@/api/modular/system/fileManage'
  import { AntdEditor } from '@/components'
  import { sysUserSelector } from '@/api/modular/system/userManage'
  export default {
    name: 'addForm',
    components:{
    name: 'AddForm',
    components: {
      AntdEditor
    },
    data () {
@ -83,46 +83,45 @@
          xs: { span: 24 },
          sm: { span: 18 }
        },
        visible:false,
        visible: false,
        form: this.$form.createForm(this),
        typeDictTypeDropDown:[],//0通知 1公告
        typeDictTypeDropDown: [], // 0通知 1公告
        editorContent: '',
        editorContentText:'',
        editorContentText: '',
        editorUploadConfig: {
          method: 'http',
          callback: this.editorUploadImage
        },
        mockData: [],
        targetKeys: [],
        noticeDetail:[],
        formLoading:true
        noticeDetail: [],
        formLoading: true
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      edit (record) {
        this.visible = true
        this.sysNoticeDetail(record.id)
        this.sysDictTypeDropDown()
        setTimeout(()=>{
        setTimeout(() => {
          this.form.setFieldsValue(
            {
              id:record.id,
              title:record.title,
              type:record.type.toString(),
              id: record.id,
              title: record.title,
              type: record.type.toString()
            }
          );
          )
          this.editor.txt.html(record.content)
          this.editorContent =record.content
        },100)
          this.editorContent = record.content
        }, 100)
      },
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown(){
        sysDictTypeDropDown({code:'notice_type'}).then((res)=>{
          this.typeDictTypeDropDown=res.data
      sysDictTypeDropDown () {
        sysDictTypeDropDown({ code: 'notice_type' }).then((res) => {
          this.typeDictTypeDropDown = res.data
        })
      },
      /**
@ -135,9 +134,9 @@
        })
        sysFileInfoUpload(formData).then((res) => {
          if (res.success) {
            insert(process.env.VUE_APP_API_BASE_URL+'/sysFileInfo/preview?id='+res.data)
          }else {
            this.$message.error('编辑器上传图片失败:' + res.message);
            insert(process.env.VUE_APP_API_BASE_URL + '/sysFileInfo/preview?id=' + res.data)
          } else {
            this.$message.error('编辑器上传图片失败:' + res.message)
          }
        })
      },
@ -151,51 +150,52 @@
      /**
       * 编辑时获取全部信息
       */
      sysNoticeDetail(id){
        sysNoticeDetail({id:id}).then((res)=>{
          this.noticeDetail=res.data
          this.getMock(this.noticeDetail);
      sysNoticeDetail (id) {
        sysNoticeDetail({ id: id }).then((res) => {
          this.noticeDetail = res.data
          this.getMock(this.noticeDetail)
        })
      },
      /**
       * 穿梭框
       */
      getMock(noticeDetail) {
        const targetKeys = [];
        const mockData = [];
          sysUserSelector().then((res)=>{
            this.formLoading=false
      getMock (noticeDetail) {
        const targetKeys = []
        const mockData = []
          sysUserSelector().then((res) => {
            this.formLoading = false
            for (let i = 0; i < res.data.length; i++) {
              const data = {
                key: res.data[i].id.toString(),
                title: res.data[i].name,
                description: `description of ${res.data[i].name}`,
              };
              for(let j = 0; j < noticeDetail.noticeUserIdList.length; j++){
                if(data.key === noticeDetail.noticeUserIdList[j]){
                  targetKeys.push(noticeDetail.noticeUserIdList[j]);
                description: `description of ${res.data[i].name}`
              }
              for (let j = 0; j < noticeDetail.noticeUserIdList.length; j++) {
                if (data.key === noticeDetail.noticeUserIdList[j]) {
                  targetKeys.push(noticeDetail.noticeUserIdList[j])
                }
              }
              mockData.push(data);
              mockData.push(data)
            }
          })
        this.mockData = mockData;
        this.targetKeys = targetKeys;
        this.mockData = mockData
        this.targetKeys = targetKeys
      },
      filterOption(inputValue, option) {
        return option.description.indexOf(inputValue) > -1;
      filterOption (inputValue, option) {
        return option.description.indexOf(inputValue) > -1
      },
      handleChange(targetKeys, direction, moveKeys) {
        this.targetKeys = targetKeys;
      handleChange (targetKeys, direction, moveKeys) {
        this.targetKeys = targetKeys
      },
      handleSubmit (types) {
        const { form: { validateFields } } = this
        if(this.editorContent == ''){
          this.$message.error("请填写内容")
        // eslint-disable-next-line eqeqeq
        if (this.editorContent == '') {
          this.$message.error('请填写内容')
          return
        }
        if(this.targetKeys.length <1){
          this.$message.error("请选择通知到的人")
        if (this.targetKeys.length < 1) {
          this.$message.error('请选择通知到的人')
          return
        }
        validateFields((errors, values) => {
@ -205,27 +205,27 @@
            values.status = types
            values.noticeUserIdList = this.targetKeys
            sysNoticeEdit(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('编辑成功')
                this.visible = false
                this.$emit('ok', values)
                this.handleCancel()
              }else{
                this.$message.error('编辑失败:'+res.message)
              } else {
                this.$message.error('编辑失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.formLoading = false
            })
          }
        })
      },
      handleCancel() {
      handleCancel () {
        this.editor.txt.clear()
        this.targetKeys =[]
        this.editorContent =''
        this.form.resetFields();
        this.targetKeys = []
        this.editorContent = ''
        this.form.resetFields()
        this.visible = false
        this.formLoading=true
        this.formLoading = true
      }
    }
  }
@ -237,4 +237,4 @@
  .subForm-item{
    margin-bottom: 0px;
  }
</style>
</style>

+ 49 - 47
_web/src/views/system/notice/index.vue

@ -10,8 +10,8 @@
          </a-col>
          <a-col :md="8" :sm="24">
            <a-form-item label="类型" >
              <a-select v-model="queryParam.type" placeholder="请选择类型" allow-clear  >
                <a-select-option v-for='(item,index) in typeDictTypeDropDown' :key="index" :value="item.code" >{{item.value}}</a-select-option>
              <a-select v-model="queryParam.type" placeholder="请选择类型" allow-clear >
                <a-select-option v-for="(item,index) in typeDictTypeDropDown" :key="index" :value="item.code" >{{ item.value }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
@ -35,38 +35,38 @@
      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
    >
      <span slot="status" slot-scope="text">
         {{ statusFilter(text)  }}
        {{ statusFilter(text) }}
      </span>
      <span slot="type" slot-scope="text">
         {{ typeFilter(text)  }}
        {{ typeFilter(text) }}
      </span>
      <span slot="action" slot-scope="text, record">
        <div v-if="record.status == 0">
          <a v-if="hasPerm('sysNotice:detail')" @click="$refs.detailForm.detail(record)">查看</a>
          <a-divider type="vertical"  v-if="hasPerm('sysNotice:detail') & hasPerm('sysNotice:edit')"/>
          <a-divider type="vertical" v-if="hasPerm('sysNotice:detail') & hasPerm('sysNotice:edit')"/>
          <a v-if="hasPerm('sysNotice:edit')" @click="$refs.editForm.edit(record)">编辑</a>
          <a-divider type="vertical"  v-if="hasPerm('sysNotice:edit') & hasPerm('sysNotice:changeStatus')"/>
          <a-divider type="vertical" v-if="hasPerm('sysNotice:edit') & hasPerm('sysNotice:changeStatus')"/>
          <a-popconfirm v-if="hasPerm('sysNotice:changeStatus')" placement="topRight" title="确认发布该信息?" @confirm="() => editNoticeStatus(1,record)">
              <a>发布</a>
         </a-popconfirm>
            <a>发布</a>
          </a-popconfirm>
        </div>
        <div v-if="record.status == 1">
            <a v-if="hasPerm('sysNotice:detail')" @click="$refs.detailForm.detail(record)">查看</a>
            <a-divider type="vertical" v-if="hasPerm('sysNotice:detail') & hasPerm('sysNotice:changeStatus')"/>
            <a-popconfirm v-if="hasPerm('sysNotice:changeStatus')" placement="topRight" title="确认撤回该信息?" @confirm="() => editNoticeStatus(2,record)">
                <a>撤回</a>
            </a-popconfirm>
          <a v-if="hasPerm('sysNotice:detail')" @click="$refs.detailForm.detail(record)">查看</a>
          <a-divider type="vertical" v-if="hasPerm('sysNotice:detail') & hasPerm('sysNotice:changeStatus')"/>
          <a-popconfirm v-if="hasPerm('sysNotice:changeStatus')" placement="topRight" title="确认撤回该信息?" @confirm="() => editNoticeStatus(2,record)">
            <a>撤回</a>
          </a-popconfirm>
        </div>
        <div v-if="record.status == 2">
          <a v-if="hasPerm('sysNotice:detail')" @click="$refs.detailForm.detail(record)">查看</a>
          <a-divider type="vertical" v-if="hasPerm('sysNotice:detail') & hasPerm('sysNotice:delete')"/>
          <a-popconfirm v-if="hasPerm('sysNotice:delete')" placement="topRight" title="确认删除?" @confirm="() => sysNoticeDelete(record)">
                <a>删除</a>
            <a>删除</a>
          </a-popconfirm>
        </div>
      </span>
    </s-table>
    <add-form  ref="addForm" @ok="handleOk" v-if="hasPerm('sysNotice:add')"/>
    <add-form ref="addForm" @ok="handleOk" v-if="hasPerm('sysNotice:add')"/>
    <edit-form ref="editForm" @ok="handleOk" v-if="hasPerm('sysNotice:edit')"/>
    <detail-form ref="detailForm" @ok="handleOk" v-if="hasPerm('sysNotice:detail')"/>
    <div ref="editor"></div>
@ -74,7 +74,7 @@
</template>
<script>
  import { STable } from '@/components'
  import { sysNoticePage ,sysNoticeDelete ,sysNoticeChangeStatus} from '@/api/modular/system/noticeManage'
  import { sysNoticePage, sysNoticeDelete, sysNoticeChangeStatus } from '@/api/modular/system/noticeManage'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  import addForm from './addForm'
  import editForm from './editForm'
@ -101,12 +101,12 @@
          {
            title: '类型',
            dataIndex: 'type',
            scopedSlots: {customRender: 'type'}
            scopedSlots: { customRender: 'type' }
          },
          {
            title: '状态',
            dataIndex: 'status',
            scopedSlots: {customRender: 'status'}
            scopedSlots: { customRender: 'status' }
          }
        ],
        // 加载数据方法 必须为 Promise 对象
@ -117,13 +117,13 @@
        },
        selectedRowKeys: [],
        selectedRows: [],
        statusDictTypeDropDown:[],//0草稿 1发布 2撤回 3删除
        typeDictTypeDropDown:[]//0通知 1公告
        statusDictTypeDropDown: [], // 0草稿 1发布 2撤回 3删除
        typeDictTypeDropDown: []// 0通知 1公告
      }
    },
    created(){
      this.sysDictTypeDropDown()//先注释
      if(this.hasPerm('sysNotice:changeStatus') || this.hasPerm('sysNotice:edit') || this.hasPerm('sysNotice:delete')){
    created () {
      this.sysDictTypeDropDown()// 先注释
      if (this.hasPerm('sysNotice:changeStatus') || this.hasPerm('sysNotice:edit') || this.hasPerm('sysNotice:delete')) {
        this.columns.push({
          title: '操作',
          width: '300px',
@ -136,52 +136,54 @@
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown(){
        sysDictTypeDropDown({code:'notice_status'}).then((res)=>{
          this.statusDictTypeDropDown=res.data
      sysDictTypeDropDown () {
        sysDictTypeDropDown({ code: 'notice_status' }).then((res) => {
          this.statusDictTypeDropDown = res.data
        })
        sysDictTypeDropDown({code:'notice_type'}).then((res)=>{
          this.typeDictTypeDropDown=res.data
        sysDictTypeDropDown({ code: 'notice_type' }).then((res) => {
          this.typeDictTypeDropDown = res.data
        })
      },
      statusFilter (status) {
        const status_value = this.statusDictTypeDropDown.filter(item => item.code == status)
        if(status_value.length>0){
          return status_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.statusDictTypeDropDown.filter(item => item.code == status)
        if (values.length > 0) {
          return values[0].value
        }
      },
      typeFilter (type) {
        const type_value = this.typeDictTypeDropDown.filter(item => item.code == type)
        if(type_value.length>0){
          return type_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.typeDictTypeDropDown.filter(item => item.code == type)
        if (values.length > 0) {
          return values[0].value
        }
      },
      /**
       * 修改状态
       */
      editNoticeStatus(code,record){
        sysNoticeChangeStatus({id:record.id,status:code.toString()}).then((res=>{
          if(res.success) {
      editNoticeStatus (code, record) {
        sysNoticeChangeStatus({ id: record.id, status: code.toString() }).then(res => {
          if (res.success) {
            this.$message.success('操作成功')
            this.$refs.table.refresh()
          }else{
            this.$message.error('操作失败:'+res.message)
          } else {
            this.$message.error('操作失败:' + res.message)
          }
        }))
        })
      },
      /**
       * 提交
       */
      sysNoticeDelete(record){
        sysNoticeDelete(record).then((res)=>{
          if(res.success) {
      sysNoticeDelete (record) {
        sysNoticeDelete(record).then((res) => {
          if (res.success) {
            this.$message.success('删除成功')
            this.$refs.table.refresh()
          }else{
            this.$message.error('删除失败:'+res.message)
          } else {
            this.$message.error('删除失败:' + res.message)
          }
        }).catch((err)=>{
          this.$message.error('删除错误:'+err.message)
        }).catch((err) => {
          this.$message.error('删除错误:' + err.message)
        })
      },
      handleOk () {

+ 14 - 15
_web/src/views/system/noticeReceived/detailForm.vue

@ -9,11 +9,11 @@
  >
    <a-spin :spinning="confirmLoading">
      <div style="text-align: center;font-size: 30px">{{this.contentRecord.title}}</div>
      <div style="text-align: center;font-size: 30px">{{ this.contentRecord.title }}</div>
      <br>
      <div style="text-align: right;font-size: 10px">
        <span>(发布人:{{this.contentRecord.publicUserName}})</span>
        <span>发布时间:{{this.contentRecord.publicTime}} </span>
        <span>(发布人:{{ this.contentRecord.publicUserName }})</span>
        <span>发布时间:{{ this.contentRecord.publicTime }} </span>
      </div>
      <a-divider style="margin-top: 5px"/>
      <div >
@ -24,28 +24,27 @@
  </a-modal>
</template>
<script>
  import { sysNoticeDetail } from '@/api/modular/system/noticeManage'
  export default {
    name: 'detailForm',
    components:{
    name: 'DetailForm',
    components: {
    },
    data () {
      return {
        visible:false,
        visible: false,
        confirmLoading: false,
        contentRecord: '',
        contentRecord: ''
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      detail (record) {
        this.confirmLoading=true
        this.confirmLoading = true
        this.visible = true
        this.sysNoticeDetail(record.id)
      },
@ -53,10 +52,10 @@
      /**
       * 查看详情
       */
      sysNoticeDetail(id){
        sysNoticeDetail({id:id}).then((res)=>{
          this.confirmLoading=false
          this.contentRecord =res.data
      sysNoticeDetail (id) {
        sysNoticeDetail({ id: id }).then((res) => {
          this.confirmLoading = false
          this.contentRecord = res.data
        })
      },
@ -73,4 +72,4 @@
  .subForm-item{
    margin-bottom: 0px;
  }
</style>
</style>

+ 64 - 61
_web/src/views/system/noticeReceived/index.vue

@ -1,55 +1,55 @@
<template>
  <a-card :bordered="false">
        <div class="table-page-search-wrapper" v-if="hasPerm('sysNotice:received')">
          <a-form layout="inline">
            <a-row :gutter="48">
              <a-col :md="8" :sm="24">
                <a-form-item label="关键词" v-if="hasPerm('sysNotice:received')">
                  <a-input v-model="queryParam.searchValue" allow-clear placeholder="请输入标题、内容"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="类型" v-if="hasPerm('sysNotice:received')">
                  <a-select v-model="queryParam.type" placeholder="请选择类型" allow-clear >
                    <a-select-option v-for='(item,index) in typeDictTypeDropDown' :key="index" :value="item.code" >{{item.value}}</a-select-option>
                  </a-select>
                </a-form-item>
              </a-col>
              <a-col :md="!advanced && 8 || 24" :sm="24">
    <div class="table-page-search-wrapper" v-if="hasPerm('sysNotice:received')">
      <a-form layout="inline">
        <a-row :gutter="48">
          <a-col :md="8" :sm="24">
            <a-form-item label="关键词" v-if="hasPerm('sysNotice:received')">
              <a-input v-model="queryParam.searchValue" allow-clear placeholder="请输入标题、内容"/>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="24">
            <a-form-item label="类型" v-if="hasPerm('sysNotice:received')">
              <a-select v-model="queryParam.type" placeholder="请选择类型" allow-clear >
                <a-select-option v-for="(item,index) in typeDictTypeDropDown" :key="index" :value="item.code" >{{ item.value }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="!advanced && 8 || 24" :sm="24">
            <span class="table-page-search-submitButtons" >
              <a-button  type="primary" @click="$refs.table.refresh(true)">查询</a-button>
              <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
              <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
            </span>
              </a-col>
            </a-row>
          </a-col>
        </a-row>
          </a-form>
        </div>
      </a-form>
    </div>
        <s-table
          ref="table"
          size="default"
          :columns="columns"
          :data="loadData"
          :alert="true"
          :rowKey="(record) => record.id"
          :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
        >
    <s-table
      ref="table"
      size="default"
      :columns="columns"
      :data="loadData"
      :alert="true"
      :rowKey="(record) => record.id"
      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
    >
          <span slot="status" slot-scope="text">
             {{ statusFilter(text)  }}
          </span>
      <span slot="status" slot-scope="text">
        {{ statusFilter(text) }}
      </span>
          <span slot="type" slot-scope="text">
             {{ typeFilter(text)  }}
          </span>
      <span slot="type" slot-scope="text">
        {{ typeFilter(text) }}
      </span>
          <span slot="action" slot-scope="text, record">
            <a v-if="hasPerm('sysNotice:received')" @click="$refs.detailForm.detail(record)">查看</a>
          </span>
      <span slot="action" slot-scope="text, record">
        <a v-if="hasPerm('sysNotice:received')" @click="$refs.detailForm.detail(record)">查看</a>
      </span>
        </s-table>
    </s-table>
    <detail-form ref="detailForm" @ok="handleOk" />
    <div ref="editor"></div>
@ -58,15 +58,16 @@
<script>
  import { STable } from '@/components'
  import { sysNoticePage  } from '@/api/modular/system/noticeManage'
  import { sysNoticeReceived  } from '@/api/modular/system/noticeReceivedManage'
  // eslint-disable-next-line no-unused-vars
  import { sysNoticePage } from '@/api/modular/system/noticeManage'
  import { sysNoticeReceived } from '@/api/modular/system/noticeReceivedManage'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  import detailForm from './detailForm'
  export default {
    components: {
      STable,
      detailForm,
      detailForm
    },
    data () {
@ -84,12 +85,12 @@
          {
            title: '类型',
            dataIndex: 'type',
            scopedSlots: {customRender: 'type'}
            scopedSlots: { customRender: 'type' }
          },
          {
            title: '状态',
            dataIndex: 'status',
            scopedSlots: {customRender: 'status'}
            scopedSlots: { customRender: 'status' }
          }
        ],
        // 加载数据方法 必须为 Promise 对象
@ -100,14 +101,14 @@
        },
        selectedRowKeys: [],
        selectedRows: [],
        statusDictTypeDropDown:[],//0草稿 1发布 2撤回 3删除
        typeDictTypeDropDown:[]//0通知 1公告
        statusDictTypeDropDown: [], // 0草稿 1发布 2撤回 3删除
        typeDictTypeDropDown: []// 0通知 1公告
    }
    },
    created(){
      this.sysDictTypeDropDown()//先注释
      if(this.hasPerm('sysNotice:received')){
    created () {
      this.sysDictTypeDropDown()// 先注释
      if (this.hasPerm('sysNotice:received')) {
        this.columns.push({
          title: '操作',
          width: '200px',
@ -121,25 +122,27 @@
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown(){
        sysDictTypeDropDown({code:'notice_status'}).then((res)=>{
          this.statusDictTypeDropDown=res.data
      sysDictTypeDropDown () {
        sysDictTypeDropDown({ code: 'notice_status' }).then((res) => {
          this.statusDictTypeDropDown = res.data
        })
        sysDictTypeDropDown({code:'notice_type'}).then((res)=>{
          this.typeDictTypeDropDown=res.data
        sysDictTypeDropDown({ code: 'notice_type' }).then((res) => {
          this.typeDictTypeDropDown = res.data
        })
      },
      statusFilter (status) {
        const status_value = this.statusDictTypeDropDown.filter(item => item.code == status)
        if(status_value.length>0){
          return status_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.statusDictTypeDropDown.filter(item => item.code == status)
        if (values.length > 0) {
          return values[0].value
        }
      },
      typeFilter (type) {
        const type_value = this.typeDictTypeDropDown.filter(item => item.code == type)
        if(type_value.length>0){
          return type_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.typeDictTypeDropDown.filter(item => item.code == type)
        if (values.length > 0) {
          return values[0].value
        }
      },

+ 38 - 38
_web/src/views/system/onlineUser/index.vue

@ -1,28 +1,28 @@
<template>
  <a-card :bordered="false">
        <a-table
          ref="table"
          size="default"
          :pagination="false"
          :loading="loading"
          :columns="columns"
          :dataSource="loadData"
          :rowKey="(record) => record.sessionId"
          :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
        >
          <span slot="action" slot-scope="text, record">
            <a-popconfirm v-if="hasPerm('sysOnlineUser:forceExist')" placement="topRight"   title="是否强制下线该用户?" @confirm="() => forceExist(record)">
              <a>强制下线</a>
            </a-popconfirm>
          </span>
        </a-table>
    <a-table
      ref="table"
      size="default"
      :pagination="false"
      :loading="loading"
      :columns="columns"
      :dataSource="loadData"
      :rowKey="(record) => record.sessionId"
      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
    >
      <span slot="action" slot-scope="text, record">
        <a-popconfirm v-if="hasPerm('sysOnlineUser:forceExist')" placement="topRight" title="是否强制下线该用户?" @confirm="() => forceExist(record)">
          <a>强制下线</a>
        </a-popconfirm>
      </span>
    </a-table>
  </a-card>
</template>
<script>
  import { sysOnlineUserForceExist ,sysOnlineUserList } from '@/api/modular/system/onlineUserManage'
  import { sysOnlineUserForceExist, sysOnlineUserList } from '@/api/modular/system/onlineUserManage'
  export default {
    components: {
@ -66,17 +66,17 @@
            dataIndex: 'lastLoginOs'
          }
        ],
        loading:true,
        loadData:[],
        loading: true,
        loadData: [],
        selectedRowKeys: [],
        selectedRows: [],
        selectedRows: []
    }
    },
    //进页面加载
    // 进页面加载
    created () {
      this.loadDataList()
      if(this.hasPerm('sysOnlineUser:forceExist')){
      if (this.hasPerm('sysOnlineUser:forceExist')) {
        this.columns.push({
          title: '操作',
          width: '150px',
@ -88,31 +88,31 @@
    methods: {
      //加载数据方法
      loadDataList(){
        if(!this.hasPerm('sysOnlineUser:list')){
          this.loading=false
          this.loadData=null
      // 加载数据方法
      loadDataList () {
        if (!this.hasPerm('sysOnlineUser:list')) {
          this.loading = false
          this.loadData = null
          this.$message.error('无权限查询数据,请联系管理员')
          return
        }
        sysOnlineUserList().then((res)=>{
          this.loading=false
          this.loadData=res.data
        sysOnlineUserList().then((res) => {
          this.loading = false
          this.loadData = res.data
        })
      },
      forceExist(record){
        sysOnlineUserForceExist(record).then((res)=>{
          if(res.success) {
      forceExist (record) {
        sysOnlineUserForceExist(record).then((res) => {
          if (res.success) {
            this.$message.success('强制下线成功')
            //重新加载表格
            // 重新加载表格
            this.loadDataList()
          }else{
            this.$message.error('强制下线失败:'+res.message)
          } else {
            this.$message.error('强制下线失败:' + res.message)
          }
        }).catch((err)=>{
          this.$message.error('强制下线错误:'+err.message)
        }).catch((err) => {
          this.$message.error('强制下线错误:' + err.message)
        })
      },

+ 24 - 27
_web/src/views/system/org/addForm.vue

@ -24,7 +24,7 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true,  message: '请输入唯一编码!'}]}]" />
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true, message: '请输入唯一编码!'}]}]" />
        </a-form-item>
        <a-form-item
@ -41,8 +41,8 @@
            placeholder="请选择上级机构"
            treeDefaultExpandAll
          >
                    <span  slot="title" slot-scope="{ id }">{{ id }}
                    </span>
            <span slot="title" slot-scope="{ id }">{{ id }}
            </span>
          </a-tree-select>
        </a-form-item>
@ -60,7 +60,7 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" placeholder="请输入备注"  v-decorator="['remark']"></a-textarea>
          <a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']"></a-textarea>
        </a-form-item>
      </a-form>
@ -69,9 +69,8 @@
  </a-modal>
</template>
<script>
  import { sysOrgAdd ,getOrgTree} from '@/api/modular/system/orgManage'
  import { sysOrgAdd, getOrgTree } from '@/api/modular/system/orgManage'
  export default {
    data () {
      return {
@ -83,17 +82,15 @@
          xs: { span: 24 },
          sm: { span: 15 }
        },
        orgTree:[],
        orgTree: [],
        visible: false,
        confirmLoading: false,
        formLoading:true,
        formLoading: true,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      add () {
        this.visible = true
        this.getOrgTree()
@ -102,20 +99,20 @@
      /**
       * 获取机构树,并加载于表单中
       */
      getOrgTree(){
      getOrgTree () {
        getOrgTree().then((res) => {
          this.formLoading = false
          if(!res.success){
            this.orgTree=[]
          if (!res.success) {
            this.orgTree = []
            return
          }
          this.orgTree=[{
            "id": "-1",
            "parentId": "0",
            "title": "顶级",
            "value": "0",
            "pid": "0",
            "children":res.data
          this.orgTree = [{
            'id': '-1',
            'parentId': '0',
            'title': '顶级',
            'value': '0',
            'pid': '0',
            'children': res.data
          }]
        })
      },
@ -126,16 +123,16 @@
        validateFields((errors, values) => {
          if (!errors) {
            sysOrgAdd(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('新增成功')
                this.visible = false
                this.confirmLoading = false
                this.$emit('ok', values)
                this.form.resetFields();
              }else{
                this.$message.error('新增失败:'+res.message)
                this.form.resetFields()
              } else {
                this.$message.error('新增失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -144,7 +141,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 33 - 36
_web/src/views/system/org/editForm.vue

@ -34,7 +34,7 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true,  message: '请输入唯一编码!'}]}]" />
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true, message: '请输入唯一编码!'}]}]" />
        </a-form-item>
        <a-form-item
@ -51,8 +51,8 @@
            placeholder="请选择上级机构"
            treeDefaultExpandAll
          >
                    <span  slot="title" slot-scope="{ id }">{{ id }}
                    </span>
            <span slot="title" slot-scope="{ id }">{{ id }}
            </span>
          </a-tree-select>
        </a-form-item>
@ -70,7 +70,7 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" placeholder="请输入备注"  v-decorator="['remark']"></a-textarea>
          <a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']"></a-textarea>
        </a-form-item>
      </a-form>
@ -79,9 +79,8 @@
  </a-modal>
</template>
<script>
  import { sysOrgEdit ,getOrgTree} from '@/api/modular/system/orgManage'
  import { sysOrgEdit, getOrgTree } from '@/api/modular/system/orgManage'
  export default {
    data () {
      return {
@ -93,51 +92,49 @@
          xs: { span: 24 },
          sm: { span: 15 }
        },
        orgTree:[],
        orgTree: [],
        visible: false,
        confirmLoading: false,
        formLoading:true,
        formLoading: true,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      edit (record) {
        this.visible = true
        this.getOrgTree()
        setTimeout(()=>{
        setTimeout(() => {
          this.form.setFieldsValue(
            {
              id:record.id,
              name:record.name,
              code:record.code,
              sort:record.sort,
              pid:record.pid,
              remark:record.remark,
              id: record.id,
              name: record.name,
              code: record.code,
              sort: record.sort,
              pid: record.pid,
              remark: record.remark
            }
          );
        },100)
          )
        }, 100)
      },
      /**
       * 获取机构树,并加载于表单中
       */
      getOrgTree(){
      getOrgTree () {
        getOrgTree().then((res) => {
          this.formLoading = false
          if(!res.success){
            this.orgTree=[]
          if (!res.success) {
            this.orgTree = []
            return
          }
          this.orgTree=[{
            "id": "-1",
            "parentId": "0",
            "title": "顶级",
            "value": "0",
            "pid": "0",
            "children":res.data
          this.orgTree = [{
            'id': '-1',
            'parentId': '0',
            'title': '顶级',
            'value': '0',
            'pid': '0',
            'children': res.data
          }]
        })
      },
@ -148,16 +145,16 @@
        validateFields((errors, values) => {
          if (!errors) {
            sysOrgEdit(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('编辑成功')
                this.visible = false
                this.confirmLoading = false
                this.$emit('ok', values)
                this.form.resetFields();
              }else{
                this.$message.error('编辑失败:'+res.message)
                this.form.resetFields()
              } else {
                this.$message.error('编辑失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -166,7 +163,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 30 - 30
_web/src/views/system/org/index.vue

@ -1,8 +1,8 @@
<template>
  <a-row :gutter="24" >
    <a-col :md="5" :sm="24"  >
      <a-card  :bordered="false" :loading="treeLoading">
    <a-col :md="5" :sm="24" >
      <a-card :bordered="false" :loading="treeLoading">
        <div v-if="this.orgTree!='' ">
          <a-tree
            style="scroll:true"
@ -20,7 +20,7 @@
    </a-col>
    <a-col :md="19" :sm="24">
      <a-card  :bordered="false">
      <a-card :bordered="false">
        <div class="table-page-search-wrapper" v-if="hasPerm('sysOrg:page')">
          <a-form layout="inline">
            <a-row :gutter="48">
@ -30,7 +30,7 @@
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-button  type="primary" @click="$refs.table.refresh(true)">查询</a-button>
                <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
                <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
              </a-col>
              <a-col :md="8" :sm="24">
@ -57,9 +57,9 @@
          <span slot="action" slot-scope="text, record">
            <a v-if="hasPerm('sysOrg:edit')" @click="$refs.editForm.edit(record)">编辑</a>
            <a-divider type="vertical" v-if="hasPerm('sysOrg:edit') & hasPerm('sysOrg:delete')"/>
              <a-popconfirm v-if="hasPerm('sysOrg:delete')" placement="topRight" title="确认删除?" @confirm="() => sysOrgDelete(record)">
                  <a>删除</a>
              </a-popconfirm>
            <a-popconfirm v-if="hasPerm('sysOrg:delete')" placement="topRight" title="确认删除?" @confirm="() => sysOrgDelete(record)">
              <a>删除</a>
            </a-popconfirm>
          </span>
@ -76,8 +76,8 @@
<script>
  import { STable } from '@/components'
  import { Empty } from 'ant-design-vue';
  import { getOrgPage ,sysOrgDelete,getOrgTree} from '@/api/modular/system/orgManage'
  import { Empty } from 'ant-design-vue'
  import { getOrgPage, sysOrgDelete, getOrgTree } from '@/api/modular/system/orgManage'
  import addForm from './addForm'
  import editForm from './editForm'
@ -122,22 +122,21 @@
        orgTree: [],
        selectedRowKeys: [],
        selectedRows: [],
        defaultExpandedKeys:[],
        //搜索的三个参数
        defaultExpandedKeys: [],
        // 搜索的三个参数
        expandedKeys: [],
        searchValue: '',
        autoExpandParent: true,
        treeLoading:true,
        simpleImage:Empty.PRESENTED_IMAGE_SIMPLE,
        treeLoading: true,
        simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
        replaceFields: {
          key: 'id',
        },
          key: 'id'
        }
    }
    },
    created () {
      this.getOrgTree()
      if(this.hasPerm('sysOrg:edit') || this.hasPerm('sysOrg:delete')){
      if (this.hasPerm('sysOrg:edit') || this.hasPerm('sysOrg:delete')) {
        this.columns.push({
          title: '操作',
          width: '150px',
@ -151,17 +150,18 @@
      /**
       * 获取到机构树,展开顶级下树节点,考虑到后期数据量变大,不建议全部展开
       */
      getOrgTree(){
      getOrgTree () {
        getOrgTree(Object.assign(this.queryParam)).then(res => {
          this.treeLoading = false
          if(!res.success){
          if (!res.success) {
            return
          }
          this.orgTree = res.data
          this.queryParam.parentId=this.orgTree[0].id
          //全部展开,上面api方法提供的不生效,先用此方法
          for(var item of  res.data){
            if(item.parentId==0){
          this.queryParam.parentId = this.orgTree[0].id
          // 全部展开,上面api方法提供的不生效,先用此方法
          for (var item of res.data) {
            // eslint-disable-next-line eqeqeq
            if (item.parentId == 0) {
              this.defaultExpandedKeys.push(item.id)
            }
          }
@ -172,17 +172,17 @@
       * 删除
       * @param record
       */
      sysOrgDelete(record){
        sysOrgDelete(record).then((res)=>{
          if(res.success) {
      sysOrgDelete (record) {
        sysOrgDelete(record).then((res) => {
          if (res.success) {
            this.$message.success('删除成功')
            this.getOrgTree()
            this.$refs.table.refresh()
          }else{
            this.$message.error('删除失败:'+res.message)
          } else {
            this.$message.error('删除失败:' + res.message)
          }
        }).catch((err)=>{
          this.$message.error('删除错误:'+err.message)
        }).catch((err) => {
          this.$message.error('删除错误:' + err.message)
        })
      },

+ 38 - 41
_web/src/views/system/pos/addForm.vue

@ -9,40 +9,40 @@
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
      <a-form-item
        label="职位名称"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入职位名称" v-decorator="['name', {rules: [{required: true, message: '请输入职位名称!'}]}]" />
      </a-form-item>
        <a-form-item
          label="职位名称"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入职位名称" v-decorator="['name', {rules: [{required: true, message: '请输入职位名称!'}]}]" />
        </a-form-item>
      <a-form-item
        label="唯一编码"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true,  message: '请输入唯一编码!'}]}]" />
      </a-form-item>
        <a-form-item
          label="唯一编码"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true, message: '请输入唯一编码!'}]}]" />
        </a-form-item>
      <a-form-item
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        label="排序"
      >
        <a-input-number placeholder="请输入排序" style="width: 100%" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
      </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="排序"
        >
          <a-input-number placeholder="请输入排序" style="width: 100%" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
        </a-form-item>
      <a-form-item
        label="备注"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-textarea :rows="4" placeholder="请输入备注"  v-decorator="['remark']"></a-textarea>
      </a-form-item>
        <a-form-item
          label="备注"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']"></a-textarea>
        </a-form-item>
      </a-form>
@ -50,7 +50,6 @@
  </a-modal>
</template>
<script>
  import { sysPosAdd } from '@/api/modular/system/posManage'
  export default {
@ -68,11 +67,9 @@
        confirmLoading: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      add (record) {
        this.visible = true
      },
@ -83,16 +80,16 @@
        validateFields((errors, values) => {
          if (!errors) {
            sysPosAdd(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('新增成功')
                this.visible = false
                this.confirmLoading = false
                this.$emit('ok', values)
                this.form.resetFields();
              }else{
                this.$message.error('新增失败:'+res.message)
                this.form.resetFields()
              } else {
                this.$message.error('新增失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -101,7 +98,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 33 - 36
_web/src/views/system/pos/editForm.vue

@ -19,14 +19,14 @@
          <a-input v-decorator="['id']" />
        </a-form-item>
      <a-form-item
        label="职位名称"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入职位名称" v-decorator="['name', {rules: [{required: true, message: '请输入职位名称!'}]}]" />
      </a-form-item>
        <a-form-item
          label="职位名称"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入职位名称" v-decorator="['name', {rules: [{required: true, message: '请输入职位名称!'}]}]" />
        </a-form-item>
        <a-form-item
          label="唯一编码"
@ -34,17 +34,17 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true,  message: '请输入唯一编码!'}]}]" />
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true, message: '请输入唯一编码!'}]}]" />
        </a-form-item>
      <a-form-item
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        label="排序"
        has-feedback
      >
        <a-input-number style="width: 100%" placeholder="请输入排序" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
      </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="排序"
          has-feedback
        >
          <a-input-number style="width: 100%" placeholder="请输入排序" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
        </a-form-item>
        <a-form-item
          label="备注"
@ -52,7 +52,7 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" placeholder="请输入备注"  v-decorator="['remark']"></a-textarea>
          <a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']"></a-textarea>
        </a-form-item>
      </a-form>
@ -61,7 +61,6 @@
  </a-modal>
</template>
<script>
  import { sysPosEdit } from '@/api/modular/system/posManage'
@ -80,24 +79,22 @@
        confirmLoading: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      edit (record) {
        this.visible = true
        setTimeout(()=>{
        setTimeout(() => {
          this.form.setFieldsValue(
            {
              id:record.id,
              name:record.name,
              code:record.code,
              sort:record.sort,
              remark:record.remark,
              id: record.id,
              name: record.name,
              code: record.code,
              sort: record.sort,
              remark: record.remark
            }
          );
        },100)
          )
        }, 100)
      },
      handleSubmit () {
@ -106,16 +103,16 @@
        validateFields((errors, values) => {
          if (!errors) {
            sysPosEdit(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('编辑成功')
                this.visible = false
                this.confirmLoading = false
                this.$emit('ok', values)
                this.form.resetFields();
              }else{
                this.$message.error('编辑失败:'+res.message)
                this.form.resetFields()
              } else {
                this.$message.error('编辑失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -124,7 +121,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 49 - 49
_web/src/views/system/pos/index.vue

@ -1,52 +1,52 @@
<template>
  <a-card :bordered="false">
        <div class="table-page-search-wrapper" v-if="hasPerm('sysPos:page')">
          <a-form layout="inline">
            <a-row :gutter="48">
              <a-col :md="8" :sm="24">
                <a-form-item label="职位名称" >
                  <a-input v-model="queryParam.name" allow-clear placeholder="请输入职位名称"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="唯一编码" >
                  <a-input v-model="queryParam.code" allow-clear placeholder="请输入唯一编码" />
                </a-form-item>
              </a-col>
              <a-col :md="!advanced && 8 || 24" :sm="24">
    <div class="table-page-search-wrapper" v-if="hasPerm('sysPos:page')">
      <a-form layout="inline">
        <a-row :gutter="48">
          <a-col :md="8" :sm="24">
            <a-form-item label="职位名称" >
              <a-input v-model="queryParam.name" allow-clear placeholder="请输入职位名称"/>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="24">
            <a-form-item label="唯一编码" >
              <a-input v-model="queryParam.code" allow-clear placeholder="请输入唯一编码" />
            </a-form-item>
          </a-col>
          <a-col :md="!advanced && 8 || 24" :sm="24">
            <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
              <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
               <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
              <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
            </span>
              </a-col>
            </a-row>
          </a-col>
        </a-row>
          </a-form>
        </div>
      </a-form>
    </div>
    <div class="table-operator" v-if="hasPerm('sysPos:add')" >
      <a-button type="primary" v-if="hasPerm('sysPos:add')" icon="plus" @click="$refs.addForm.add()">新增职位</a-button>
    </div>
        <s-table
          ref="table"
          size="default"
          :columns="columns"
          :data="loadData"
          :alert="true"
          :rowKey="(record) => record.code"
          :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
        >
          <span slot="action" slot-scope="text, record">
            <a v-if="hasPerm('sysPos:edit')" @click="$refs.editForm.edit(record)">编辑</a>
            <a-divider type="vertical" v-if="hasPerm('sysPos:edit') & hasPerm('sysPos:delete')"/>
            <a-popconfirm v-if="hasPerm('sysPos:delete')" placement="topRight" title="确认删除?" @confirm="() => sysPosDelete(record)">
                  <a>删除</a>
            </a-popconfirm>
          </span>
        </s-table>
    <s-table
      ref="table"
      size="default"
      :columns="columns"
      :data="loadData"
      :alert="true"
      :rowKey="(record) => record.code"
      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
    >
      <span slot="action" slot-scope="text, record">
        <a v-if="hasPerm('sysPos:edit')" @click="$refs.editForm.edit(record)">编辑</a>
        <a-divider type="vertical" v-if="hasPerm('sysPos:edit') & hasPerm('sysPos:delete')"/>
        <a-popconfirm v-if="hasPerm('sysPos:delete')" placement="topRight" title="确认删除?" @confirm="() => sysPosDelete(record)">
          <a>删除</a>
        </a-popconfirm>
      </span>
    </s-table>
    <add-form ref="addForm" @ok="handleOk" />
    <edit-form ref="editForm" @ok="handleOk" />
@ -56,7 +56,7 @@
<script>
  import { STable } from '@/components'
  import { sysPosPage ,sysPosDelete } from '@/api/modular/system/posManage'
  import { sysPosPage, sysPosDelete } from '@/api/modular/system/posManage'
  import addForm from './addForm'
  import editForm from './editForm'
@ -64,7 +64,7 @@
    components: {
      STable,
      addForm,
      editForm,
      editForm
    },
    data () {
@ -100,12 +100,12 @@
          })
        },
        selectedRowKeys: [],
        selectedRows: [],
        selectedRows: []
    }
    },
    created(){
      if(this.hasPerm('sysPos:edit') || this.hasPerm('sysPos:delete')){
    created () {
      if (this.hasPerm('sysPos:edit') || this.hasPerm('sysPos:delete')) {
        this.columns.push({
          title: '操作',
          width: '150px',
@ -116,16 +116,16 @@
    },
    methods: {
      sysPosDelete(record){
        sysPosDelete(record).then((res)=>{
          if(res.success) {
      sysPosDelete (record) {
        sysPosDelete(record).then((res) => {
          if (res.success) {
            this.$message.success('删除成功')
            this.$refs.table.refresh()
          }else{
            this.$message.error('删除失败:'+res.message)
          } else {
            this.$message.error('删除失败:' + res.message)
          }
        }).catch((err)=>{
          this.$message.error('删除错误:'+err.message)
        }).catch((err) => {
          this.$message.error('删除错误:' + err.message)
        })
      },

+ 38 - 41
_web/src/views/system/role/addForm.vue

@ -9,40 +9,40 @@
  >
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">
      <a-form-item
        label="角色名"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入角色名" v-decorator="['name', {rules: [{required: true, message: '请输入角色名!'}]}]" />
      </a-form-item>
        <a-form-item
          label="角色名"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入角色名" v-decorator="['name', {rules: [{required: true, message: '请输入角色名!'}]}]" />
        </a-form-item>
      <a-form-item
        label="唯一编码"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true,  message: '请输入唯一编码!'}]}]" />
      </a-form-item>
        <a-form-item
          label="唯一编码"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true, message: '请输入唯一编码!'}]}]" />
        </a-form-item>
      <a-form-item
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        label="排序"
      >
        <a-input-number placeholder="请输入排序" style="width: 100%" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
      </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="排序"
        >
          <a-input-number placeholder="请输入排序" style="width: 100%" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
        </a-form-item>
      <a-form-item
        label="备注"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-textarea :rows="4" placeholder="请输入备注"  v-decorator="['remark']"></a-textarea>
      </a-form-item>
        <a-form-item
          label="备注"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']"></a-textarea>
        </a-form-item>
      </a-form>
@ -50,7 +50,6 @@
  </a-modal>
</template>
<script>
  import { sysRoleAdd } from '@/api/modular/system/roleManage'
  export default {
@ -68,11 +67,9 @@
        confirmLoading: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      add (record) {
        this.visible = true
      },
@ -83,16 +80,16 @@
        validateFields((errors, values) => {
          if (!errors) {
            sysRoleAdd(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('新增成功')
                this.visible = false
                this.confirmLoading = false
                this.$emit('ok', values)
                this.form.resetFields();
              }else{
                this.$message.error('新增失败:'+res.message)
                this.form.resetFields()
              } else {
                this.$message.error('新增失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -101,7 +98,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 33 - 36
_web/src/views/system/role/editForm.vue

@ -19,14 +19,14 @@
          <a-input v-decorator="['id']" />
        </a-form-item>
      <a-form-item
        label="角色名"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入角色名" v-decorator="['name', {rules: [{required: true, message: '请输入角色名!'}]}]" />
      </a-form-item>
        <a-form-item
          label="角色名"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入角色名" v-decorator="['name', {rules: [{required: true, message: '请输入角色名!'}]}]" />
        </a-form-item>
        <a-form-item
          label="唯一编码"
@ -34,17 +34,17 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true,  message: '请输入唯一编码!'}]}]" />
          <a-input placeholder="请输入唯一编码" v-decorator="['code', {rules: [{required: true, message: '请输入唯一编码!'}]}]" />
        </a-form-item>
      <a-form-item
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        label="排序"
        has-feedback
      >
        <a-input-number style="width: 100%" placeholder="请输入排序" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
      </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="排序"
          has-feedback
        >
          <a-input-number style="width: 100%" placeholder="请输入排序" v-decorator="['sort', { initialValue: 100 }]" :min="1" :max="1000" />
        </a-form-item>
        <a-form-item
          label="备注"
@ -52,7 +52,7 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" placeholder="请输入备注"  v-decorator="['remark']"></a-textarea>
          <a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']"></a-textarea>
        </a-form-item>
      </a-form>
@ -61,7 +61,6 @@
  </a-modal>
</template>
<script>
  import { sysRoleEdit } from '@/api/modular/system/roleManage'
  export default {
@ -79,24 +78,22 @@
        confirmLoading: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      edit (record) {
        this.visible = true
        setTimeout(()=>{
        setTimeout(() => {
          this.form.setFieldsValue(
            {
              id:record.id,
              name:record.name,
              code:record.code,
              sort:record.sort,
              remark:record.remark,
              id: record.id,
              name: record.name,
              code: record.code,
              sort: record.sort,
              remark: record.remark
            }
          );
        },100)
          )
        }, 100)
      },
      handleSubmit () {
@ -105,16 +102,16 @@
        validateFields((errors, values) => {
          if (!errors) {
            sysRoleEdit(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('编辑成功')
                this.visible = false
                this.confirmLoading = false
                this.$emit('ok', values)
                this.form.resetFields();
              }else{
                this.$message.error('编辑失败:'+res.message)
                this.form.resetFields()
              } else {
                this.$message.error('编辑失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -123,7 +120,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 64 - 64
_web/src/views/system/role/index.vue

@ -1,65 +1,65 @@
<template>
  <a-card :bordered="false">
        <div class="table-page-search-wrapper" v-if="hasPerm('sysRole:page')">
          <a-form layout="inline">
            <a-row :gutter="48">
              <a-col :md="8" :sm="24">
                <a-form-item label="角色名">
                  <a-input v-model="queryParam.name" allow-clear  placeholder="请输入角色名"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="唯一编码">
                  <a-input v-model="queryParam.code" allow-clear  placeholder="请输入唯一编码"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-button  type="primary" @click="$refs.table.refresh(true)">查询</a-button>
                <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
              </a-col>
            </a-row>
          </a-form>
        </div>
    <div class="table-page-search-wrapper" v-if="hasPerm('sysRole:page')">
      <a-form layout="inline">
        <a-row :gutter="48">
          <a-col :md="8" :sm="24">
            <a-form-item label="角色名">
              <a-input v-model="queryParam.name" allow-clear placeholder="请输入角色名"/>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="24">
            <a-form-item label="唯一编码">
              <a-input v-model="queryParam.code" allow-clear placeholder="请输入唯一编码"/>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="24">
            <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
            <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <div class="table-operator" v-if="hasPerm('sysRole:add')" >
      <a-button type="primary" v-if="hasPerm('sysRole:add')" icon="plus" @click="$refs.addForm.add()">新增角色</a-button>
    </div>
        <s-table
          ref="table"
          size="default"
          :columns="columns"
          :data="loadData"
          :alert="true"
          :rowKey="(record) => record.code"
          :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
        >
          <span slot="action" slot-scope="text, record">
            <a v-if="hasPerm('sysRole:edit')" @click="$refs.editForm.edit(record)">编辑</a>
            <a-divider type="vertical" v-if="hasPerm('sysRole:edit')"/>
            <a-dropdown v-if="hasPerm('sysRole:grantMenu') || hasPerm('sysRole:grantData') || hasPerm('sysRole:delete')">
              <a class="ant-dropdown-link">
                更多 <a-icon type="down" />
              </a>
              <a-menu slot="overlay">
                <a-menu-item v-if="hasPerm('sysRole:grantMenu')">
                  <a @click="$refs.roleMenuForm.roleMenu(record)">授权菜单</a>
                </a-menu-item>
                <a-menu-item v-if="hasPerm('sysRole:grantData')">
                  <a @click="$refs.roleOrgForm.roleOrg(record)">授权数据</a>
                </a-menu-item>
                <a-menu-item v-if="hasPerm('sysRole:delete')">
                  <a-popconfirm placement="topRight" title="确认删除?" @confirm="() => sysRoleDelete(record)">
                  <a>删除</a>
                  </a-popconfirm>
                </a-menu-item>
              </a-menu>
            </a-dropdown>
          </span>
        </s-table>
    <s-table
      ref="table"
      size="default"
      :columns="columns"
      :data="loadData"
      :alert="true"
      :rowKey="(record) => record.code"
      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
    >
      <span slot="action" slot-scope="text, record">
        <a v-if="hasPerm('sysRole:edit')" @click="$refs.editForm.edit(record)">编辑</a>
        <a-divider type="vertical" v-if="hasPerm('sysRole:edit')"/>
        <a-dropdown v-if="hasPerm('sysRole:grantMenu') || hasPerm('sysRole:grantData') || hasPerm('sysRole:delete')">
          <a class="ant-dropdown-link">
            更多 <a-icon type="down" />
          </a>
          <a-menu slot="overlay">
            <a-menu-item v-if="hasPerm('sysRole:grantMenu')">
              <a @click="$refs.roleMenuForm.roleMenu(record)">授权菜单</a>
            </a-menu-item>
            <a-menu-item v-if="hasPerm('sysRole:grantData')">
              <a @click="$refs.roleOrgForm.roleOrg(record)">授权数据</a>
            </a-menu-item>
            <a-menu-item v-if="hasPerm('sysRole:delete')">
              <a-popconfirm placement="topRight" title="确认删除?" @confirm="() => sysRoleDelete(record)">
                <a>删除</a>
              </a-popconfirm>
            </a-menu-item>
          </a-menu>
        </a-dropdown>
      </span>
    </s-table>
    <add-form ref="addForm" @ok="handleOk" />
    <edit-form ref="editForm" @ok="handleOk" />
@ -71,7 +71,7 @@
<script>
  import { STable } from '@/components'
  import { getRolePage ,sysRoleDelete } from '@/api/modular/system/roleManage'
  import { getRolePage, sysRoleDelete } from '@/api/modular/system/roleManage'
  import addForm from './addForm'
  import editForm from './editForm'
  import roleMenuForm from './roleMenuForm'
@ -112,12 +112,12 @@
          })
        },
        selectedRowKeys: [],
        selectedRows: [],
        selectedRows: []
    }
    },
    created () {
      if(this.hasPerm('sysRole:edit') || this.hasPerm('sysRole:grantMenu') || this.hasPerm('sysRole:grantData') || this.hasPerm('sysRole:delete')){
      if (this.hasPerm('sysRole:edit') || this.hasPerm('sysRole:grantMenu') || this.hasPerm('sysRole:grantData') || this.hasPerm('sysRole:delete')) {
        this.columns.push({
          title: '操作',
          width: '150px',
@ -128,16 +128,16 @@
    },
    methods: {
      sysRoleDelete(record){
        sysRoleDelete(record).then((res)=>{
          if(res.success) {
      sysRoleDelete (record) {
        sysRoleDelete(record).then((res) => {
          if (res.success) {
            this.$message.success('删除成功')
            this.$refs.table.refresh()
          }else{
            this.$message.error('删除失败:'+res.message)
          } else {
            this.$message.error('删除失败:' + res.message)
          }
        }).catch((err)=>{
          this.$message.error('删除错误:'+err.message)
        }).catch((err) => {
          this.$message.error('删除错误:' + err.message)
        })
      },

+ 60 - 64
_web/src/views/system/role/roleMenuForm.vue

@ -8,47 +8,44 @@
    @cancel="handleCancel"
  >
    <a-spin :spinning="formLoading">
    <a-form :form="form">
      <a-form :form="form">
    <a-form-item
      label="菜单权限"
      :labelCol="labelCol"
      :wrapperCol="wrapperCol">
        <a-form-item
          label="菜单权限"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol">
      <a-tree
        v-model="checkedKeys"
        multiple
        checkable
        checkStrictly
        :auto-expand-parent="autoExpandParent"
        :expanded-keys="expandedKeys"
        :tree-data="menuTreeData"
        :selected-keys="selectedKeys"
        :replaceFields="replaceFields"
        @expand="onExpand"
        @select="onSelect"
        @check="treeCheck"
      />
    </a-form-item>
          <a-tree
            v-model="checkedKeys"
            multiple
            checkable
            checkStrictly
            :auto-expand-parent="autoExpandParent"
            :expanded-keys="expandedKeys"
            :tree-data="menuTreeData"
            :selected-keys="selectedKeys"
            :replaceFields="replaceFields"
            @expand="onExpand"
            @select="onSelect"
            @check="treeCheck"
          />
        </a-form-item>
    </a-form>
      </a-form>
    </a-spin>
  </a-modal>
</template>
<script>
  import { SysMenuTreeForGrant } from '@/api/modular/system/menuManage'
  import { sysRoleOwnMenu,sysRoleGrantMenu } from '@/api/modular/system/roleManage'
  import { sysRoleOwnMenu, sysRoleGrantMenu } from '@/api/modular/system/roleManage'
  export default {
    data () {
      return {
        labelCol: {
          style:{'padding-right':'20px'},
          style: { 'padding-right': '20px' },
          xs: { span: 24 },
          sm: { span: 5 }
        },
@ -56,29 +53,28 @@
          xs: { span: 24 },
          sm: { span: 15 }
        },
        menuTreeData:[],
        menuTreeData: [],
        expandedKeys: [],
        checkedKeys:[],
        checkedKeys: [],
        visible: false,
        confirmLoading: false,
        formLoading:true,
        formLoading: true,
        autoExpandParent: true,
        selectedKeys:[],
        subValues:[],
        roleEntity:[],
        selectedKeys: [],
        subValues: [],
        roleEntity: [],
        replaceFields: {
          key: 'id',
          key: 'id'
        },
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      roleMenu (record) {
        this.formLoading = true
        this.roleEntity=record
        this.roleEntity = record
        this.visible = true
        this.getMenuTree()
        this.expandedMenuKeys(record)
@ -87,12 +83,12 @@
      /**
       * 获取菜单列表
       */
      getMenuTree(){
        SysMenuTreeForGrant().then((res) =>{
           if(res.success){
             this.menuTreeData=res.data
             //默认展开目录级
             this.menuTreeData.forEach(item=>{
      getMenuTree () {
        SysMenuTreeForGrant().then((res) => {
           if (res.success) {
             this.menuTreeData = res.data
             // 默认展开目录级
             this.menuTreeData.forEach(item => {
               this.expandedKeys.push(item.id)
             })
           }
@ -102,26 +98,26 @@
      /**
       * 此角色已有菜单权限
       */
      expandedMenuKeys(record){
        sysRoleOwnMenu({id:record.id}).then((res)=>{
          if(res.success){
            this.checkedKeys=res.data
      expandedMenuKeys (record) {
        sysRoleOwnMenu({ id: record.id }).then((res) => {
          if (res.success) {
            this.checkedKeys = res.data
          }
          this.formLoading = false
        })
      },
      treeCheck(checkKeys){
      treeCheck (checkKeys) {
      },
      onExpand(expandedKeys) {
        this.expandedKeys = expandedKeys;
        this.autoExpandParent = false;
      onExpand (expandedKeys) {
        this.expandedKeys = expandedKeys
        this.autoExpandParent = false
      },
      onCheck(checkedKeys) {
        this.checkedKeys = checkedKeys;
      onCheck (checkedKeys) {
        this.checkedKeys = checkedKeys
      },
      onSelect(selectedKeys, info) {
        this.selectedKeys = selectedKeys;
      onSelect (selectedKeys, info) {
        this.selectedKeys = selectedKeys
      },
      handleSubmit () {
@ -129,16 +125,16 @@
        this.confirmLoading = true
        validateFields((errors, values) => {
          if (!errors) {
            sysRoleGrantMenu({id:this.roleEntity.id,grantMenuIdList:this.checkedKeys.checked}).then((res) => {
              if(res.success){
            sysRoleGrantMenu({ id: this.roleEntity.id, grantMenuIdList: this.checkedKeys.checked }).then((res) => {
              if (res.success) {
                this.$message.success('授权成功')
                this.confirmLoading = false
                this.$emit('ok', values)
                this.handleCancel ()
              }else{
                this.$message.error('授权失败:'+res.message)
                this.handleCancel()
              } else {
                this.$message.error('授权失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -147,10 +143,10 @@
        })
      },
      handleCancel () {
        //清空已选择的
        this.checkedKeys=[]
        //清空已展开的
        this.expandedKeys=[]
        // 清空已选择的
        this.checkedKeys = []
        // 清空已展开的
        this.expandedKeys = []
        this.visible = false
      }
    }

+ 63 - 61
_web/src/views/system/role/roleOrgForm.vue

@ -15,8 +15,8 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-select style="width: 100%" placeholder="请选择授权范围" v-decorator="['dataScopeType', {rules: [{ required: true, message: '请选择授权范围!' }]}]"  >
            <a-select-option v-for='(item,index) in dataScopeTypeData' :key="index" :value="item.code" @click="handleChange(item.code)">{{item.value}}</a-select-option>
          <a-select style="width: 100%" placeholder="请选择授权范围" v-decorator="['dataScopeType', {rules: [{ required: true, message: '请选择授权范围!' }]}]" >
            <a-select-option v-for="(item,index) in dataScopeTypeData" :key="index" :value="item.code" @click="handleChange(item.code)">{{ item.value }}</a-select-option>
          </a-select>
        </a-form-item>
        <div v-show="orgTreeShow">
@ -46,14 +46,14 @@
<script>
  import { getOrgTree } from '@/api/modular/system/orgManage'
  import { sysRoleOwnData,sysRoleGrantData } from '@/api/modular/system/roleManage'
  import { sysRoleOwnData, sysRoleGrantData } from '@/api/modular/system/roleManage'
  import { sysDictTypeDropDown } from '@/api/modular/system/dictManage'
  export default {
    data () {
      return {
        labelCol: {
          style:{'padding-right':'20px'},
          style: { 'padding-right': '20px' },
          xs: { span: 24 },
          sm: { span: 5 }
        },
@ -61,100 +61,102 @@
          xs: { span: 24 },
          sm: { span: 15 }
        },
        orgTreeData:[],
        orgTreeData: [],
        expandedKeys: [],
        checkedKeys:[],
        checkedKeys: [],
        visible: false,
        confirmLoading: false,
        formLoading:true,
        formLoading: true,
        autoExpandParent: true,
        selectedKeys:[],
        subValues:[],
        roleEntity:[],
        dataScopeTypeData:[],
        orgTreeShow:false,
        selectedKeys: [],
        subValues: [],
        roleEntity: [],
        dataScopeTypeData: [],
        orgTreeShow: false,
        replaceFields: {
          key: 'id',
          key: 'id'
        },
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      roleOrg (record) {
        this.roleEntity=record
        this.roleEntity = record
        this.visible = true
        this.formLoading = true
        this.sysDictTypeDropDown()
        this.form.getFieldDecorator('dataScopeType',{initialValue:record.dataScopeType.toString()})
        this.form.getFieldDecorator('dataScopeType', { initialValue: record.dataScopeType.toString() })
        this.handleChange(record.dataScopeType)
      },
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown() {
        //数据范围
        sysDictTypeDropDown({code: 'data_scope_type'}).then((res) => {
      sysDictTypeDropDown () {
        // 数据范围
        sysDictTypeDropDown({ code: 'data_scope_type' }).then((res) => {
          this.dataScopeTypeData = res.data
          this.formLoading = false
        })
      },
      //范围下拉框事件
      handleChange(value){
        if(value=='5'){
      // 范围下拉框事件
      handleChange (value) {
        // eslint-disable-next-line eqeqeq
        if (value == '5') {
          this.formLoading = true
          this.orgTreeShow=true
          //获取机构树
          this.orgTreeShow = true
          // 获取机构树
          this.getOrgTree()
          //已关联数据
          // 已关联数据
          this.sysRoleOwnData(this.roleEntity)
        }else{
          this.orgTreeShow=false
          //清理已选中机构
          this.checkedKeys=[]
        } else {
          this.orgTreeShow = false
          // 清理已选中机构
          this.checkedKeys = []
        }
      },
      /**
       * 获取机构树
       */
      getOrgTree(){
        getOrgTree().then((res) =>{
          if(res.success){
            this.orgTreeData=res.data
            //默认展开
            this.orgTreeData.forEach(item=>{
              this.expandedKeys.push(item.id)
            })
          }
      getOrgTree () {
        getOrgTree().then((res) => {
           if (res.success) {
             this.orgTreeData = res.data
             // 默认展开
             this.orgTreeData.forEach(item => {
               this.expandedKeys.push(item.id)
             })
           }
        })
      },
      /**
       * 此角色已有数据列表
       */
      sysRoleOwnData(record){
        sysRoleOwnData({id:record.id}).then((res)=>{
          if(res.success){
      sysRoleOwnData (record) {
        sysRoleOwnData({ id: record.id }).then((res) => {
          if (res.success) {
            console.log(JSON.stringify(res.data))
            this.checkedKeys=res.data
            this.checkedKeys = res.data
          }
          this.formLoading = false
        })
      },
      onExpand(expandedKeys) {
        this.expandedKeys = expandedKeys;
        this.autoExpandParent = false;
      onExpand (expandedKeys) {
        this.expandedKeys = expandedKeys
        this.autoExpandParent = false
      },
      onCheck(checkedKeys) {
      onCheck (checkedKeys) {
        console.log(JSON.stringify(checkedKeys))
        this.checkedKeys = checkedKeys
      },
      onSelect(selectedKeys, info) {
        this.selectedKeys = selectedKeys;
      onSelect (selectedKeys, info) {
        this.selectedKeys = selectedKeys
      },
      handleSubmit () {
@ -162,17 +164,17 @@
        this.confirmLoading = true
        validateFields((errors, values) => {
          if (!errors) {
            const checkedKeys=this.checkedKeys.checked === undefined? this.checkedKeys:this.checkedKeys.checked
            sysRoleGrantData({id:this.roleEntity.id,grantOrgIdList:checkedKeys,dataScopeType:values.dataScopeType}).then((res) => {
            const checkedKeys = this.checkedKeys.checked === undefined ? this.checkedKeys : this.checkedKeys.checked
            sysRoleGrantData({ id: this.roleEntity.id, grantOrgIdList: checkedKeys, dataScopeType: values.dataScopeType }).then((res) => {
              this.confirmLoading = false
              if(res.success){
              if (res.success) {
                this.$message.success('授权成功')
                this.$emit('ok', values)
                this.handleCancel()
              }else{
                this.$message.error('授权失败:'+res.message)
              } else {
                this.$message.error('授权失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -181,14 +183,14 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        //清空已选择的
        this.checkedKeys=[]
        //清空已展开的
        this.expandedKeys=[]
        this.form.resetFields()
        // 清空已选择的
        this.checkedKeys = []
        // 清空已展开的
        this.expandedKeys = []
        this.visible = false
        //隐藏机构树
        this.orgTreeShow=false
        // 隐藏机构树
        this.orgTreeShow = false
      }
    }
  }

+ 38 - 36
_web/src/views/system/sms/index.vue

@ -12,7 +12,7 @@
          <a-col :md="8" :sm="24">
            <a-form-item label="发送状态">
              <a-select v-model="queryParam.status" placeholder="请选择发送状态" >
                <a-select-option v-for='(item,index) in statusDictTypeDropDown' :key="index" :value="item.code" >{{item.value}}</a-select-option>
                <a-select-option v-for="(item,index) in statusDictTypeDropDown" :key="index" :value="item.code" >{{ item.value }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
@ -20,7 +20,7 @@
            <a-col :md="8" :sm="24">
              <a-form-item label="来源">
                <a-select v-model="queryParam.source" placeholder="请选择来源" >
                  <a-select-option v-for='(item,index) in sourceDictTypeDropDown' :key="index" :value="item.code" >{{item.value}}</a-select-option>
                  <a-select-option v-for="(item,index) in sourceDictTypeDropDown" :key="index" :value="item.code" >{{ item.value }}</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
@ -39,22 +39,22 @@
      </a-form>
    </div>
        <s-table
          ref="table"
          size="default"
          :columns="columns"
          :data="loadData"
          :alert="true"
          :rowKey="(record) => record.id"
          :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
        >
          <span slot="status" slot-scope="text">
            {{ statusFilter(text)  }}
          </span>
          <span slot="source" slot-scope="text">
              {{ sourceFilter(text)  }}
          </span>
        </s-table>
    <s-table
      ref="table"
      size="default"
      :columns="columns"
      :data="loadData"
      :alert="true"
      :rowKey="(record) => record.id"
      :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
    >
      <span slot="status" slot-scope="text">
        {{ statusFilter(text) }}
      </span>
      <span slot="source" slot-scope="text">
        {{ sourceFilter(text) }}
      </span>
    </s-table>
  </a-card>
</template>
@ -66,7 +66,7 @@
  export default {
    components: {
      STable,
      STable
    },
    data () {
@ -92,12 +92,12 @@
          {
            title: '发送状态',
            dataIndex: 'status',
            scopedSlots: { customRender: 'status' },
            scopedSlots: { customRender: 'status' }
          },
          {
            title: '来源',
            dataIndex: 'source',
            scopedSlots: { customRender: 'source' },
            scopedSlots: { customRender: 'source' }
          },
          {
            title: '失效时间',
@ -112,39 +112,41 @@
        },
        selectedRowKeys: [],
        selectedRows: [],
        statusDictTypeDropDown:[],
        sourceDictTypeDropDown:[]
        statusDictTypeDropDown: [],
        sourceDictTypeDropDown: []
    }
    },
    created(){
      this.sysDictTypeDropDown();
    created () {
      this.sysDictTypeDropDown()
    },
    methods: {
      sourceFilter (source) {
        const source_value = this.sourceDictTypeDropDown.filter(item => item.code == source)
        if(source_value.length>0){
          return source_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.sourceDictTypeDropDown.filter(item => item.code == source)
        if (values.length > 0) {
          return values[0].value
        }
      },
      statusFilter (status) {
        const status_value = this.statusDictTypeDropDown.filter(item => item.code == status)
        if(status_value.length>0){
          return status_value[0].value
        // eslint-disable-next-line eqeqeq
        const values = this.statusDictTypeDropDown.filter(item => item.code == status)
        if (values.length > 0) {
          return values[0].value
        }
      },
      /**
       * 获取字典数据
       */
      sysDictTypeDropDown(){
        sysDictTypeDropDown({code:'send_type'}).then((res)=>{
          this.statusDictTypeDropDown=res.data
      sysDictTypeDropDown () {
        sysDictTypeDropDown({ code: 'send_type' }).then((res) => {
          this.statusDictTypeDropDown = res.data
        })
        sysDictTypeDropDown({code:'sms_send_source'}).then((res)=>{
          this.sourceDictTypeDropDown=res.data
        sysDictTypeDropDown({ code: 'sms_send_source' }).then((res) => {
          this.sourceDictTypeDropDown = res.data
        })
      },

+ 50 - 53
_web/src/views/system/timers/addForm.vue

@ -9,42 +9,42 @@
  >
    <a-spin :spinning="formLoading">
      <a-form :form="form">
      <a-form-item
        label="任务名称"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-input placeholder="请输入任务名称" v-decorator="['timerName', {rules: [{required: true, message: '请输入任务名称!'}]}]" />
      </a-form-item>
        <a-form-item
          label="任务名称"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-input placeholder="请输入任务名称" v-decorator="['timerName', {rules: [{required: true, message: '请输入任务名称!'}]}]" />
        </a-form-item>
      <a-form-item
        label="任务class类名"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-select style="width: 100%" placeholder="请选择任务class类名" v-decorator="['actionClass', {rules: [{ required: true, message: '请选择任务class类名!' }]}]" >
          <a-select-option v-for='(item,index) in actionClassData' :key="index" :value="item" >{{item}}</a-select-option>
        </a-select>
      </a-form-item>
        <a-form-item
          label="任务class类名"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-select style="width: 100%" placeholder="请选择任务class类名" v-decorator="['actionClass', {rules: [{ required: true, message: '请选择任务class类名!' }]}]" >
            <a-select-option v-for="(item,index) in actionClassData" :key="index" :value="item" >{{ item }}</a-select-option>
          </a-select>
        </a-form-item>
      <a-form-item
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        label="任务表达式"
      >
        <a-input placeholder="请输入任务表达式" v-decorator="['cron', {rules: [{required: true,  message: '请输入任务class类名!'}]}]" />
      </a-form-item>
        <a-form-item
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          label="任务表达式"
        >
          <a-input placeholder="请输入任务表达式" v-decorator="['cron', {rules: [{required: true, message: '请输入任务class类名!'}]}]" />
        </a-form-item>
      <a-form-item
        label="备注"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        has-feedback
      >
        <a-textarea :rows="4" placeholder="请输入备注"  v-decorator="['remark']"></a-textarea>
      </a-form-item>
        <a-form-item
          label="备注"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']"></a-textarea>
        </a-form-item>
      </a-form>
@ -52,9 +52,8 @@
  </a-modal>
</template>
<script>
  import { sysTimersAdd ,sysTimersGetActionClasses} from '@/api/modular/system/timersManage'
  import { sysTimersAdd, sysTimersGetActionClasses } from '@/api/modular/system/timersManage'
  export default {
    data () {
      return {
@ -68,30 +67,28 @@
        },
        visible: false,
        confirmLoading: false,
        actionClassData:[],
        formLoading:false,
        actionClassData: [],
        formLoading: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      add (record) {
        this.visible = true
        this.formLoading=true
        this.formLoading = true
        this.getActionClass()
      },
      /**
       * 获取选择器下拉框数据
       */
      getActionClass(){
        sysTimersGetActionClasses().then((res)=>{
           this.formLoading=false
           if(res.success){
             this.actionClassData=res.data
           }else{
      getActionClass () {
        sysTimersGetActionClasses().then((res) => {
           this.formLoading = false
           if (res.success) {
             this.actionClassData = res.data
           } else {
             this.$message.error('获取选择器下拉框数据')
           }
        })
@ -103,16 +100,16 @@
        validateFields((errors, values) => {
          if (!errors) {
            sysTimersAdd(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('新增成功')
                this.visible = false
                this.confirmLoading = false
                this.$emit('ok', values)
                this.form.resetFields();
              }else{
                this.$message.error('新增失败:'+res.message)
                this.form.resetFields()
              } else {
                this.$message.error('新增失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -121,7 +118,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 29 - 32
_web/src/views/system/timers/editForm.vue

@ -37,7 +37,7 @@
          has-feedback
        >
          <a-select style="width: 100%" placeholder="请选择任务class类名" v-decorator="['actionClass', {rules: [{ required: true, message: '请选择任务class类名!' }]}]" >
            <a-select-option v-for='(item,index) in actionClassData' :key="index" :value="item" >{{item}}</a-select-option>
            <a-select-option v-for="(item,index) in actionClassData" :key="index" :value="item" >{{ item }}</a-select-option>
          </a-select>
        </a-form-item>
@ -46,7 +46,7 @@
          :wrapperCol="wrapperCol"
          label="任务表达式"
        >
          <a-input placeholder="请输入任务表达式" v-decorator="['cron', {rules: [{required: true,  message: '请输入任务class类名!'}]}]" />
          <a-input placeholder="请输入任务表达式" v-decorator="['cron', {rules: [{required: true, message: '请输入任务class类名!'}]}]" />
        </a-form-item>
        <a-form-item
@ -55,7 +55,7 @@
          :wrapperCol="wrapperCol"
          has-feedback
        >
          <a-textarea :rows="4" placeholder="请输入备注"  v-decorator="['remark']"></a-textarea>
          <a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']"></a-textarea>
        </a-form-item>
      </a-form>
@ -64,9 +64,8 @@
  </a-modal>
</template>
<script>
  import { sysTimersEdit,sysTimersGetActionClasses } from '@/api/modular/system/timersManage'
  import { sysTimersEdit, sysTimersGetActionClasses } from '@/api/modular/system/timersManage'
  export default {
    data () {
@ -81,42 +80,40 @@
        },
        visible: false,
        confirmLoading: false,
        actionClassData:[],
        formLoading:false,
        actionClassData: [],
        formLoading: false,
        form: this.$form.createForm(this)
      }
    },
    methods: {
      //初始化方法
      // 初始化方法
      edit (record) {
        this.visible = true
        this.formLoading=true
        this.formLoading = true
        this.getActionClass()
        setTimeout(()=>{
        setTimeout(() => {
          this.form.setFieldsValue(
            {
              id:record.id,
              timerName:record.timerName,
              actionClass:record.actionClass,
              cron:record.cron,
              jobStatus:record.jobStatus,
              remark:record.remark,
              id: record.id,
              timerName: record.timerName,
              actionClass: record.actionClass,
              cron: record.cron,
              jobStatus: record.jobStatus,
              remark: record.remark
            }
          );
        },100)
          )
        }, 100)
      },
      /**
       * 获取选择器下拉框数据
       */
      getActionClass(){
        sysTimersGetActionClasses().then((res)=>{
          this.formLoading=false
          if(res.success){
            this.actionClassData=res.data
          }else{
      getActionClass () {
        sysTimersGetActionClasses().then((res) => {
          this.formLoading = false
          if (res.success) {
            this.actionClassData = res.data
          } else {
            this.$message.error('获取选择器下拉框数据')
          }
        })
@ -128,16 +125,16 @@
        validateFields((errors, values) => {
          if (!errors) {
            sysTimersEdit(values).then((res) => {
              if(res.success){
              if (res.success) {
                this.$message.success('编辑成功')
                this.visible = false
                this.confirmLoading = false
                this.$emit('ok', values)
                this.form.resetFields();
              }else{
                this.$message.error('编辑失败:'+res.message)
                this.form.resetFields()
              } else {
                this.$message.error('编辑失败:' + res.message)
              }
            }).finally((res) =>{
            }).finally((res) => {
              this.confirmLoading = false
            })
          } else {
@ -146,7 +143,7 @@
        })
      },
      handleCancel () {
        this.form.resetFields();
        this.form.resetFields()
        this.visible = false
      }
    }

+ 0 - 0
_web/src/views/system/timers/index.vue


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