已添加397个文件
已删除1个文件
已修改2个文件
| | |
| | | MIT License |
| | | The MIT License (MIT) |
| | | |
| | | Copyright (c) 2019 è¥ä¾ |
| | | Copyright (c) 2018 RuoYi |
| | | |
| | | Permission is hereby granted, free of charge, to any person obtaining a copy |
| | | of this software and associated documentation files (the "Software"), to deal |
| | | in the Software without restriction, including without limitation the rights |
| | | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| | | copies of the Software, and to permit persons to whom the Software is |
| | | furnished to do so, subject to the following conditions: |
| | | Permission is hereby granted, free of charge, to any person obtaining a copy of |
| | | this software and associated documentation files (the "Software"), to deal in |
| | | the Software without restriction, including without limitation the rights to |
| | | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
| | | the Software, and to permit persons to whom the Software is furnished to do so, |
| | | subject to the following conditions: |
| | | |
| | | The above copyright notice and this permission notice shall be included in all |
| | | copies or substantial portions of the Software. |
| | | |
| | | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| | | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| | | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| | | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| | | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| | | SOFTWARE. |
| | | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | |
| | | # RuoYi-Vue |
| | | ## å¹³å°ç®ä» |
| | | |
| | | #### ä»ç» |
| | | {**以䏿¯ç äºå¹³å°è¯´æï¼æ¨å¯ä»¥æ¿æ¢æ¤ç®ä»** |
| | | ç äºæ¯ OSCHINA æ¨åºçåºäº Git çä»£ç æç®¡å¹³å°ï¼åæ¶æ¯æ SVNï¼ãä¸ä¸ºå¼åè
æä¾ç¨³å®ã髿ãå®å
¨çäºç«¯è½¯ä»¶å¼ååä½å¹³å° |
| | | æ 论æ¯ä¸ªäººãå¢éãææ¯ä¼ä¸ï¼é½è½å¤ç¨ç äºå®ç°ä»£ç æç®¡ã项ç®ç®¡çãåä½å¼åãä¼ä¸é¡¹ç®è¯·ç [https://gitee.com/enterprises](https://gitee.com/enterprises)} |
| | | ä¸ç´æ³å䏿¬¾åå°ç®¡çç³»ç»ï¼çäºå¾å¤ä¼ç§ç弿ºé¡¹ç®ä½æ¯åç°æ²¡æåéçãäºæ¯å©ç¨ç©ºé²ä¼æ¯æ¶é´å¼å§èªå·±åäºä¸å¥åå°ç³»ç»ã妿¤æäºè¥ä¾ã她å¯ä»¥ç¨äºææçWebåºç¨ç¨åºï¼å¦ç½ç«ç®¡çåå°ï¼ç½ç«ä¼åä¸å¿ï¼CMSï¼CRMï¼OAãææå端åå°ä»£ç å°è£
è¿åååç²¾ç®æä¸æï¼åºéæ¦çä½ãåæ¶æ¯æç§»å¨å®¢æ·ç«¯è®¿é®ãç³»ç»ä¼éç»æ´æ°ä¸äºå®ç¨åè½ã |
| | | |
| | | #### è½¯ä»¶æ¶æ |
| | | è½¯ä»¶æ¶æè¯´æ |
| | | æ§å«ç·ï¼è¥ä¾æ¯ç»è¿æ²¡æåºç女å¿åçååï¼å¯æï¼ä½ è¥ä¸ç¦»ä¸å¼ï¼æå¿
çæ»ç¸ä¾ï¼ |
| | | |
| | | åèåå°æ¨¡æ¿[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) |
| | | |
| | | > å¦éä¸å离åºç¨ï¼è¯·ç§»æ¥ [RuoYi](https://gitee.com/y_project/RuoYi) `(ä¿æåæ¥æ´æ°)`ï¼å¦éå
¶ä»çæ¬ï¼è¯·ç§»æ¥ [é¡¹ç®æ©å±](http://doc.ruoyi.vip/ruoyi/document/xmkz.html) `(ä¸å®æ¶æ´æ°)` |
| | | |
| | | > é¿éäºéç¨äºäº§å1888伿 å¸ ï¼[ç¹æé¢å](https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=brki8iof) è
¾è®¯äºéç¨äºäº§å2860伿 å¸ ï¼[ç¹æé¢å](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console) `(ä»
éæ°ç¨æ·)` |
| | | |
| | | > é¿éäºHiæ¼è´ ééçæ¬¾ ä½è³199å
/å¹´ [ç¹æè¿å
¥](https://www.aliyun.com/acts/hi-group-buying?userCode=brki8iof) `(ä»
éæ°ç¨æ·)` |
| | | |
| | | ## å
ç½®åè½ |
| | | |
| | | 1. ç¨æ·ç®¡çï¼ç¨æ·æ¯ç³»ç»æä½è
ï¼è¯¥åè½ä¸»è¦å®æç³»ç»ç¨æ·é
ç½®ã |
| | | 2. é¨é¨ç®¡çï¼é
置系ç»ç»ç»æºæï¼å
¬å¸ãé¨é¨ãå°ç»ï¼ï¼æ ç»æå±ç°æ¯ææ°æ®æéã |
| | | 3. å²ä½ç®¡çï¼é
置系ç»ç¨æ·æå±æ
ä»»èå¡ã |
| | | 4. èå管çï¼é
置系ç»èåï¼æä½æéï¼æé®æéæ è¯çã |
| | | 5. è§è²ç®¡çï¼è§è²èåæéåé
ã设置è§è²ææºæè¿è¡æ°æ®èå´æéååã |
| | | 6. åå
¸ç®¡çï¼å¯¹ç³»ç»ä¸ç»å¸¸ä½¿ç¨çä¸äºè¾ä¸ºåºå®çæ°æ®è¿è¡ç»´æ¤ã |
| | | 7. åæ°ç®¡çï¼å¯¹ç³»ç»å¨æé
置常ç¨åæ°ã |
| | | 8. éç¥å
¬åï¼ç³»ç»éç¥å
¬åä¿¡æ¯åå¸ç»´æ¤ã |
| | | 9. æä½æ¥å¿ï¼ç³»ç»æ£å¸¸æä½æ¥å¿è®°å½åæ¥è¯¢ï¼ç³»ç»å¼å¸¸ä¿¡æ¯æ¥å¿è®°å½åæ¥è¯¢ã |
| | | 10. ç»å½æ¥å¿ï¼ç³»ç»ç»å½æ¥å¿è®°å½æ¥è¯¢å
å«ç»å½å¼å¸¸ã |
| | | 11. å¨çº¿ç¨æ·ï¼å½åç³»ç»ä¸æ´»è·ç¨æ·ç¶æçæ§ã |
| | | 12. 宿¶ä»»å¡ï¼å¨çº¿ï¼æ·»å ãä¿®æ¹ãå é¤)ä»»å¡è°åº¦å
嫿§è¡ç»ææ¥å¿ã |
| | | 13. 代ç çæï¼åå端代ç ççæï¼javaãhtmlãxmlãsqlï¼æ¯æCRUDä¸è½½ ã |
| | | 14. ç³»ç»æ¥å£ï¼æ ¹æ®ä¸å¡ä»£ç èªå¨çæç¸å
³çapiæ¥å£ææ¡£ã |
| | | 15. æå¡çæ§ï¼çè§å½åç³»ç»CPUãå
åãç£çãå æ çç¸å
³ä¿¡æ¯ã |
| | | 16. å¨çº¿æå»ºå¨ï¼æå¨è¡¨åå
ç´ çæç¸åºçHTML代ç ã |
| | | 17. è¿æ¥æ± çè§ï¼çè§å½åç³»ç»æ°æ®åºè¿æ¥æ± ç¶æï¼å¯è¿è¡åæSQLæ¾åºç³»ç»æ§è½ç¶é¢ã |
| | | ## å¨çº¿ä½éª |
| | | > admin/admin123 |
| | | > ééç»ç»æ¶å°ä¸äºæèµï¼ä¸ºäºæ´å¥½çä½éªå·²ç¨äºæ¼ç¤ºæå¡å¨å级ã谢谢åä½å°ä¼ä¼´ã |
| | | |
| | | æ¼ç¤ºå°åï¼http://vue.ruoyi.vip |
| | | |
| | | ææ¡£å°åï¼http://doc.ruoyi.vip |
| | | |
| | | ## æ¼ç¤ºå¾ |
| | | |
| | | <table> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/97fcdc766fa04c03722aef4b3d77f71e8d2.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/642858372da91853c39e2d4746f036ea171.jpg"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/8678d5204148e2610c9d02822274a961dcf.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/feb2b25a08bf9dd121b8f51274ae935ead6.jpg"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/71c2d48905221a09a728df4aff4160b8607.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/c14c1ee9a64a6a9c2c22f67d43198767dbe.jpg"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/c162686bf3a39e3cd6b4fd6b5919f515ebf.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/412fb931faa8b3e3de6f9cbbc5b7979cf36.jpg"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/5f3d39a141f21f81b90536f391b8408f1fa.jpg"/></td> |
| | | </tr> |
| | | </table> |
| | | |
| | | |
| | | #### å®è£
æç¨ |
| | | ## è¥ä¾äº¤æµç¾¤ |
| | | |
| | | 1. xxxx |
| | | 2. xxxx |
| | | 3. xxxx |
| | | |
| | | #### 使ç¨è¯´æ |
| | | |
| | | 1. xxxx |
| | | 2. xxxx |
| | | 3. xxxx |
| | | |
| | | #### åä¸è´¡ç® |
| | | |
| | | 1. Fork æ¬ä»åº |
| | | 2. æ°å»º Feat_xxx 忝 |
| | | 3. æäº¤ä»£ç |
| | | 4. æ°å»º Pull Request |
| | | |
| | | |
| | | #### ç äºç¹æ |
| | | |
| | | 1. ä½¿ç¨ Readme\_XXX.md æ¥æ¯æä¸åçè¯è¨ï¼ä¾å¦ Readme\_en.md, Readme\_zh.md |
| | | 2. ç äºå®æ¹å客 [blog.gitee.com](https://blog.gitee.com) |
| | | 3. ä½ å¯ä»¥ [https://gitee.com/explore](https://gitee.com/explore) è¿ä¸ªå°åæ¥äºè§£ç äºä¸çä¼ç§å¼æºé¡¹ç® |
| | | 4. [GVP](https://gitee.com/gvp) å
¨ç§°æ¯ç äºææä»·å¼å¼æºé¡¹ç®ï¼æ¯ç äºç»¼åè¯å®åºçä¼ç§å¼æºé¡¹ç® |
| | | 5. ç äºå®æ¹æä¾çä½¿ç¨æå [https://gitee.com/help](https://gitee.com/help) |
| | | 6. ç äºå°é¢äººç©æ¯ä¸æ¡£ç¨æ¥å±ç¤ºç äºä¼åé£éçæ ç® [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) |
| | | QQç¾¤ï¼ [](https://jq.qq.com/?_wv=1027&k=5PjgQ8e) ç¹å»æé®å
¥ç¾¤ã |
¶Ô±ÈÐÂÎļþ |
| | |
| | | # åè¯EditorConfigæä»¶ï¼è¿æ¯æ ¹æä»¶ï¼ä¸ç¨ç»§ç»å¾ä¸æ¥æ¾
|
| | | root = true
|
| | |
|
| | | # å¹é
å
¨é¨æä»¶
|
| | | [*]
|
| | | # 设置å符é
|
| | | charset = utf-8
|
| | | # 缩è¿é£æ ¼ï¼å¯éspaceãtab
|
| | | indent_style = space
|
| | | # 缩è¿çç©ºæ ¼æ°
|
| | | indent_size = 2
|
| | | # ç»å°¾æ¢è¡ç¬¦ï¼å¯élfãcrãcrlf
|
| | | end_of_line = lf
|
| | | # 卿件ç»å°¾æå
¥æ°è¡
|
| | | insert_final_newline = true
|
| | | # å é¤ä¸è¡ä¸çååç©ºæ ¼
|
| | | trim_trailing_whitespace = true
|
| | |
|
| | | # å¹é
mdç»å°¾çæä»¶
|
| | | [*.md]
|
| | | insert_final_newline = false
|
| | | trim_trailing_whitespace = false
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | # å¼åç¯å¢é
ç½®
|
| | | ENV = 'development'
|
| | |
|
| | | # è¥ä¾ç®¡çç³»ç»/å¼åç¯å¢
|
| | | VUE_APP_BASE_API = '/dev-api'
|
| | |
|
| | | # è·¯ç±æå è½½
|
| | | VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | # ç产ç¯å¢é
ç½®
|
| | | ENV = 'production'
|
| | |
|
| | | # è¥ä¾ç®¡çç³»ç»/ç产ç¯å¢
|
| | | VUE_APP_BASE_API = '/prod-api'
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | NODE_ENV = production
|
| | |
|
| | | # æµè¯ç¯å¢é
ç½®
|
| | | ENV = 'staging'
|
| | |
|
| | | # è¥ä¾ç®¡çç³»ç»/æµè¯ç¯å¢
|
| | | VUE_APP_BASE_API = '/stage-api'
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | # 忽ç¥buildç®å½ä¸ç±»å为jsçæä»¶çè¯æ³æ£æ¥
|
| | | build/*.js
|
| | | # 忽ç¥src/assetsç®å½ä¸æä»¶çè¯æ³æ£æ¥
|
| | | src/assets
|
| | | # 忽ç¥publicç®å½ä¸æä»¶çè¯æ³æ£æ¥
|
| | | public
|
| | | # 忽ç¥å½åç®å½ä¸ä¸ºjsçæä»¶çè¯æ³æ£æ¥
|
| | | *.js
|
| | | # 忽ç¥å½åç®å½ä¸ä¸ºvueçæä»¶çè¯æ³æ£æ¥
|
| | | *.vue |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // ESlint æ£æ¥é
ç½®
|
| | | module.exports = {
|
| | | root: true,
|
| | | parserOptions: {
|
| | | parser: 'babel-eslint',
|
| | | sourceType: 'module'
|
| | | },
|
| | | env: {
|
| | | browser: true,
|
| | | node: true,
|
| | | es6: true,
|
| | | },
|
| | | extends: ['plugin:vue/recommended', 'eslint:recommended'],
|
| | |
|
| | | // add your custom rules here
|
| | | //it is base on https://github.com/vuejs/eslint-config-vue
|
| | | rules: {
|
| | | "vue/max-attributes-per-line": [2, {
|
| | | "singleline": 10,
|
| | | "multiline": {
|
| | | "max": 1,
|
| | | "allowFirstLine": false
|
| | | }
|
| | | }],
|
| | | "vue/singleline-html-element-content-newline": "off",
|
| | | "vue/multiline-html-element-content-newline":"off",
|
| | | "vue/name-property-casing": ["error", "PascalCase"],
|
| | | "vue/no-v-html": "off",
|
| | | 'accessor-pairs': 2,
|
| | | 'arrow-spacing': [2, {
|
| | | 'before': true,
|
| | | 'after': true
|
| | | }],
|
| | | 'block-spacing': [2, 'always'],
|
| | | 'brace-style': [2, '1tbs', {
|
| | | 'allowSingleLine': true
|
| | | }],
|
| | | 'camelcase': [0, {
|
| | | 'properties': 'always'
|
| | | }],
|
| | | 'comma-dangle': [2, 'never'],
|
| | | 'comma-spacing': [2, {
|
| | | 'before': false,
|
| | | 'after': true
|
| | | }],
|
| | | 'comma-style': [2, 'last'],
|
| | | 'constructor-super': 2,
|
| | | 'curly': [2, 'multi-line'],
|
| | | 'dot-location': [2, 'property'],
|
| | | 'eol-last': 2,
|
| | | 'eqeqeq': ["error", "always", {"null": "ignore"}],
|
| | | 'generator-star-spacing': [2, {
|
| | | 'before': true,
|
| | | 'after': true
|
| | | }],
|
| | | 'handle-callback-err': [2, '^(err|error)$'],
|
| | | 'indent': [2, 2, {
|
| | | 'SwitchCase': 1
|
| | | }],
|
| | | 'jsx-quotes': [2, 'prefer-single'],
|
| | | 'key-spacing': [2, {
|
| | | 'beforeColon': false,
|
| | | 'afterColon': true
|
| | | }],
|
| | | 'keyword-spacing': [2, {
|
| | | 'before': true,
|
| | | 'after': true
|
| | | }],
|
| | | 'new-cap': [2, {
|
| | | 'newIsCap': true,
|
| | | 'capIsNew': false
|
| | | }],
|
| | | 'new-parens': 2,
|
| | | 'no-array-constructor': 2,
|
| | | 'no-caller': 2,
|
| | | 'no-console': 'off',
|
| | | 'no-class-assign': 2,
|
| | | 'no-cond-assign': 2,
|
| | | 'no-const-assign': 2,
|
| | | 'no-control-regex': 0,
|
| | | 'no-delete-var': 2,
|
| | | 'no-dupe-args': 2,
|
| | | 'no-dupe-class-members': 2,
|
| | | 'no-dupe-keys': 2,
|
| | | 'no-duplicate-case': 2,
|
| | | 'no-empty-character-class': 2,
|
| | | 'no-empty-pattern': 2,
|
| | | 'no-eval': 2,
|
| | | 'no-ex-assign': 2,
|
| | | 'no-extend-native': 2,
|
| | | 'no-extra-bind': 2,
|
| | | 'no-extra-boolean-cast': 2,
|
| | | 'no-extra-parens': [2, 'functions'],
|
| | | 'no-fallthrough': 2,
|
| | | 'no-floating-decimal': 2,
|
| | | 'no-func-assign': 2,
|
| | | 'no-implied-eval': 2,
|
| | | 'no-inner-declarations': [2, 'functions'],
|
| | | 'no-invalid-regexp': 2,
|
| | | 'no-irregular-whitespace': 2,
|
| | | 'no-iterator': 2,
|
| | | 'no-label-var': 2,
|
| | | 'no-labels': [2, {
|
| | | 'allowLoop': false,
|
| | | 'allowSwitch': false
|
| | | }],
|
| | | 'no-lone-blocks': 2,
|
| | | 'no-mixed-spaces-and-tabs': 2,
|
| | | 'no-multi-spaces': 2,
|
| | | 'no-multi-str': 2,
|
| | | 'no-multiple-empty-lines': [2, {
|
| | | 'max': 1
|
| | | }],
|
| | | 'no-native-reassign': 2,
|
| | | 'no-negated-in-lhs': 2,
|
| | | 'no-new-object': 2,
|
| | | 'no-new-require': 2,
|
| | | 'no-new-symbol': 2,
|
| | | 'no-new-wrappers': 2,
|
| | | 'no-obj-calls': 2,
|
| | | 'no-octal': 2,
|
| | | 'no-octal-escape': 2,
|
| | | 'no-path-concat': 2,
|
| | | 'no-proto': 2,
|
| | | 'no-redeclare': 2,
|
| | | 'no-regex-spaces': 2,
|
| | | 'no-return-assign': [2, 'except-parens'],
|
| | | 'no-self-assign': 2,
|
| | | 'no-self-compare': 2,
|
| | | 'no-sequences': 2,
|
| | | 'no-shadow-restricted-names': 2,
|
| | | 'no-spaced-func': 2,
|
| | | 'no-sparse-arrays': 2,
|
| | | 'no-this-before-super': 2,
|
| | | 'no-throw-literal': 2,
|
| | | 'no-trailing-spaces': 2,
|
| | | 'no-undef': 2,
|
| | | 'no-undef-init': 2,
|
| | | 'no-unexpected-multiline': 2,
|
| | | 'no-unmodified-loop-condition': 2,
|
| | | 'no-unneeded-ternary': [2, {
|
| | | 'defaultAssignment': false
|
| | | }],
|
| | | 'no-unreachable': 2,
|
| | | 'no-unsafe-finally': 2,
|
| | | 'no-unused-vars': [2, {
|
| | | 'vars': 'all',
|
| | | 'args': 'none'
|
| | | }],
|
| | | 'no-useless-call': 2,
|
| | | 'no-useless-computed-key': 2,
|
| | | 'no-useless-constructor': 2,
|
| | | 'no-useless-escape': 0,
|
| | | 'no-whitespace-before-property': 2,
|
| | | 'no-with': 2,
|
| | | 'one-var': [2, {
|
| | | 'initialized': 'never'
|
| | | }],
|
| | | 'operator-linebreak': [2, 'after', {
|
| | | 'overrides': {
|
| | | '?': 'before',
|
| | | ':': 'before'
|
| | | }
|
| | | }],
|
| | | 'padded-blocks': [2, 'never'],
|
| | | 'quotes': [2, 'single', {
|
| | | 'avoidEscape': true,
|
| | | 'allowTemplateLiterals': true
|
| | | }],
|
| | | 'semi': [2, 'never'],
|
| | | 'semi-spacing': [2, {
|
| | | 'before': false,
|
| | | 'after': true
|
| | | }],
|
| | | 'space-before-blocks': [2, 'always'],
|
| | | 'space-before-function-paren': [2, 'never'],
|
| | | 'space-in-parens': [2, 'never'],
|
| | | 'space-infix-ops': 2,
|
| | | 'space-unary-ops': [2, {
|
| | | 'words': true,
|
| | | 'nonwords': false
|
| | | }],
|
| | | 'spaced-comment': [2, 'always', {
|
| | | 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
|
| | | }],
|
| | | 'template-curly-spacing': [2, 'never'],
|
| | | 'use-isnan': 2,
|
| | | 'valid-typeof': 2,
|
| | | 'wrap-iife': [2, 'any'],
|
| | | 'yield-star-spacing': [2, 'both'],
|
| | | 'yoda': [2, 'never'],
|
| | | 'prefer-const': 2,
|
| | | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
| | | 'object-curly-spacing': [2, 'always', {
|
| | | objectsInObjects: false
|
| | | }],
|
| | | 'array-bracket-spacing': [2, 'never']
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | .DS_Store
|
| | | node_modules/
|
| | | dist/
|
| | | npm-debug.log*
|
| | | yarn-debug.log*
|
| | | yarn-error.log*
|
| | | **/*.log
|
| | |
|
| | | tests/**/coverage/
|
| | | tests/e2e/reports
|
| | | selenium-debug.log
|
| | |
|
| | | # Editor directories and files
|
| | | .idea
|
| | | .vscode
|
| | | *.suo
|
| | | *.ntvs*
|
| | | *.njsproj
|
| | | *.sln
|
| | | *.local
|
| | |
|
| | | package-lock.json
|
| | | yarn.lock
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | ## å¼å
|
| | |
|
| | | ```bash
|
| | | # å
é项ç®
|
| | | git clone https://gitee.com/y_project/RuoYi-Vue
|
| | |
|
| | | # è¿å
¥é¡¹ç®ç®å½
|
| | | cd ruoyi-ui
|
| | |
|
| | | # å®è£
ä¾èµ
|
| | | npm install
|
| | |
|
| | | # 建议ä¸è¦ç´æ¥ä½¿ç¨ cnpm å®è£
ä¾èµï¼ä¼æåç§è¯¡å¼ç bugãå¯ä»¥éè¿å¦ä¸æä½è§£å³ npm ä¸è½½é度æ
¢çé®é¢
|
| | | npm install --registry=https://registry.npm.taobao.org
|
| | |
|
| | | # å¯å¨æå¡
|
| | | npm run dev
|
| | | ```
|
| | |
|
| | | æµè§å¨è®¿é® http://localhost:80
|
| | |
|
| | | ## åå¸
|
| | |
|
| | | ```bash
|
| | | # æå»ºæµè¯ç¯å¢
|
| | | npm run build:stage
|
| | |
|
| | | # æå»ºç产ç¯å¢
|
| | | npm run build:prod
|
| | | ``` |
¶Ô±ÈÐÂÎļþ |
| | |
| | | module.exports = {
|
| | | presets: [
|
| | | '@vue/app'
|
| | | ]
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | @echo off
|
| | | echo.
|
| | | echo [ä¿¡æ¯] æå
Webå·¥ç¨ï¼çænode_moduleså
æä»¶ã
|
| | | echo.
|
| | |
|
| | | %~d0
|
| | | cd %~dp0
|
| | |
|
| | | cd ..
|
| | | npm install --registry=https://registry.npm.taobao.org
|
| | |
|
| | | pause |
¶Ô±ÈÐÂÎļþ |
| | |
| | | @echo off
|
| | | echo.
|
| | | echo [ä¿¡æ¯] ä½¿ç¨ Vue è¿è¡ Web å·¥ç¨ã
|
| | | echo.
|
| | |
|
| | | %~d0
|
| | | cd %~dp0
|
| | |
|
| | | cd ..
|
| | | npm run dev
|
| | |
|
| | | pause |
¶Ô±ÈÐÂÎļþ |
| | |
| | | const { run } = require('runjs')
|
| | | const chalk = require('chalk')
|
| | | const config = require('../vue.config.js')
|
| | | const rawArgv = process.argv.slice(2)
|
| | | const args = rawArgv.join(' ')
|
| | |
|
| | | if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
|
| | | const report = rawArgv.includes('--report')
|
| | |
|
| | | run(`vue-cli-service build ${args}`)
|
| | |
|
| | | const port = 9526
|
| | | const publicPath = config.publicPath
|
| | |
|
| | | var connect = require('connect')
|
| | | var serveStatic = require('serve-static')
|
| | | const app = connect()
|
| | |
|
| | | app.use(
|
| | | publicPath,
|
| | | serveStatic('./dist', {
|
| | | index: ['index.html', '/']
|
| | | })
|
| | | )
|
| | |
|
| | | app.listen(port, function () {
|
| | | console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
|
| | | if (report) {
|
| | | console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
|
| | | }
|
| | |
|
| | | })
|
| | | } else {
|
| | | run(`vue-cli-service build ${args}`)
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | {
|
| | | "name": "ruoyi",
|
| | | "version": "1.0.0",
|
| | | "description": "è¥ä¾ç®¡çç³»ç»",
|
| | | "author": "è¥ä¾",
|
| | | "license": "MIT",
|
| | | "scripts": {
|
| | | "dev": "vue-cli-service serve",
|
| | | "build:prod": "vue-cli-service build",
|
| | | "build:stage": "vue-cli-service build --mode staging",
|
| | | "preview": "node build/index.js --preview",
|
| | | "lint": "eslint --ext .js,.vue src",
|
| | | "test:unit": "jest --clearCache && vue-cli-service test:unit",
|
| | | "test:ci": "npm run lint && npm run test:unit",
|
| | | "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
|
| | | "new": "plop"
|
| | | },
|
| | | "husky": {
|
| | | "hooks": {
|
| | | "pre-commit": "lint-staged"
|
| | | }
|
| | | },
|
| | | "lint-staged": {
|
| | | "src/**/*.{js,vue}": [
|
| | | "eslint --fix",
|
| | | "git add"
|
| | | ]
|
| | | },
|
| | | "keywords": [
|
| | | "vue",
|
| | | "admin",
|
| | | "dashboard",
|
| | | "element-ui",
|
| | | "boilerplate",
|
| | | "admin-template",
|
| | | "management-system"
|
| | | ],
|
| | | "repository": {
|
| | | "type": "git",
|
| | | "url": "https://gitee.com/y_project/RuoYi-Vue.git"
|
| | | },
|
| | | "dependencies": {
|
| | | "@riophae/vue-treeselect": "0.1.0",
|
| | | "vue-quill-editor": "3.0.6",
|
| | | "vue-cropper": "0.4.9",
|
| | | "axios": "0.18.1",
|
| | | "echarts": "4.2.1",
|
| | | "element-ui": "2.11.1",
|
| | | "fuse.js": "3.4.4",
|
| | | "js-cookie": "2.2.0",
|
| | | "normalize.css": "7.0.0",
|
| | | "nprogress": "0.2.0",
|
| | | "path-to-regexp": "2.4.0",
|
| | | "screenfull": "4.2.0",
|
| | | "vue": "2.6.10",
|
| | | "vue-count-to": "1.0.13",
|
| | | "vue-router": "3.0.2",
|
| | | "vue-splitpane": "1.0.4",
|
| | | "vuex": "3.1.0"
|
| | | },
|
| | | "devDependencies": {
|
| | | "@babel/core": "7.0.0",
|
| | | "@babel/register": "7.0.0",
|
| | | "@vue/cli-plugin-babel": "3.5.3",
|
| | | "@vue/cli-plugin-eslint": "^3.9.1",
|
| | | "@vue/cli-plugin-unit-jest": "3.5.3",
|
| | | "@vue/cli-service": "3.5.3",
|
| | | "@vue/test-utils": "1.0.0-beta.29",
|
| | | "autoprefixer": "^9.5.1",
|
| | | "babel-core": "7.0.0-bridge.0",
|
| | | "babel-eslint": "10.0.1",
|
| | | "babel-jest": "23.6.0",
|
| | | "chalk": "2.4.2",
|
| | | "chokidar": "2.1.5",
|
| | | "connect": "3.6.6",
|
| | | "eslint": "5.15.3",
|
| | | "eslint-plugin-vue": "5.2.2",
|
| | | "html-webpack-plugin": "3.2.0",
|
| | | "http-proxy-middleware": "^0.19.1",
|
| | | "husky": "1.3.1",
|
| | | "lint-staged": "8.1.5",
|
| | | "mockjs": "1.0.1-beta3",
|
| | | "node-sass": "^4.9.0",
|
| | | "plop": "2.3.0",
|
| | | "runjs": "^4.3.2",
|
| | | "sass-loader": "^7.1.0",
|
| | | "script-ext-html-webpack-plugin": "2.1.3",
|
| | | "script-loader": "0.7.2",
|
| | | "serve-static": "^1.13.2",
|
| | | "svg-sprite-loader": "4.1.3",
|
| | | "svgo": "1.2.0",
|
| | | "vue-template-compiler": "2.6.10"
|
| | | },
|
| | | "engines": {
|
| | | "node": ">=8.9",
|
| | | "npm": ">= 3.0.0"
|
| | | },
|
| | | "browserslist": [
|
| | | "> 1%",
|
| | | "last 2 versions"
|
| | | ]
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!DOCTYPE html>
|
| | | <html>
|
| | | <head>
|
| | | <meta charset="utf-8">
|
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
| | | <meta name="renderer" content="webkit">
|
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
| | | <link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
| | | <title><%= webpackConfig.name %></title>
|
| | | <style>
|
| | | html,
|
| | | body,
|
| | | #app {
|
| | | height: 100%;
|
| | | margin: 0px;
|
| | | padding: 0px;
|
| | | }
|
| | | .chromeframe {
|
| | | margin: 0.2em 0;
|
| | | background: #ccc;
|
| | | color: #000;
|
| | | padding: 0.2em 0;
|
| | | }
|
| | |
|
| | | #loader-wrapper {
|
| | | position: fixed;
|
| | | top: 0;
|
| | | left: 0;
|
| | | width: 100%;
|
| | | height: 100%;
|
| | | z-index: 999999;
|
| | | }
|
| | |
|
| | | #loader {
|
| | | display: block;
|
| | | position: relative;
|
| | | left: 50%;
|
| | | top: 50%;
|
| | | width: 150px;
|
| | | height: 150px;
|
| | | margin: -75px 0 0 -75px;
|
| | | border-radius: 50%;
|
| | | border: 3px solid transparent;
|
| | | border-top-color: #FFF;
|
| | | -webkit-animation: spin 2s linear infinite;
|
| | | -ms-animation: spin 2s linear infinite;
|
| | | -moz-animation: spin 2s linear infinite;
|
| | | -o-animation: spin 2s linear infinite;
|
| | | animation: spin 2s linear infinite;
|
| | | z-index: 1001;
|
| | | }
|
| | |
|
| | | #loader:before {
|
| | | content: "";
|
| | | position: absolute;
|
| | | top: 5px;
|
| | | left: 5px;
|
| | | right: 5px;
|
| | | bottom: 5px;
|
| | | border-radius: 50%;
|
| | | border: 3px solid transparent;
|
| | | border-top-color: #FFF;
|
| | | -webkit-animation: spin 3s linear infinite;
|
| | | -moz-animation: spin 3s linear infinite;
|
| | | -o-animation: spin 3s linear infinite;
|
| | | -ms-animation: spin 3s linear infinite;
|
| | | animation: spin 3s linear infinite;
|
| | | }
|
| | |
|
| | | #loader:after {
|
| | | content: "";
|
| | | position: absolute;
|
| | | top: 15px;
|
| | | left: 15px;
|
| | | right: 15px;
|
| | | bottom: 15px;
|
| | | border-radius: 50%;
|
| | | border: 3px solid transparent;
|
| | | border-top-color: #FFF;
|
| | | -moz-animation: spin 1.5s linear infinite;
|
| | | -o-animation: spin 1.5s linear infinite;
|
| | | -ms-animation: spin 1.5s linear infinite;
|
| | | -webkit-animation: spin 1.5s linear infinite;
|
| | | animation: spin 1.5s linear infinite;
|
| | | }
|
| | |
|
| | |
|
| | | @-webkit-keyframes spin {
|
| | | 0% {
|
| | | -webkit-transform: rotate(0deg);
|
| | | -ms-transform: rotate(0deg);
|
| | | transform: rotate(0deg);
|
| | | }
|
| | | 100% {
|
| | | -webkit-transform: rotate(360deg);
|
| | | -ms-transform: rotate(360deg);
|
| | | transform: rotate(360deg);
|
| | | }
|
| | | }
|
| | |
|
| | | @keyframes spin {
|
| | | 0% {
|
| | | -webkit-transform: rotate(0deg);
|
| | | -ms-transform: rotate(0deg);
|
| | | transform: rotate(0deg);
|
| | | }
|
| | | 100% {
|
| | | -webkit-transform: rotate(360deg);
|
| | | -ms-transform: rotate(360deg);
|
| | | transform: rotate(360deg);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | #loader-wrapper .loader-section {
|
| | | position: fixed;
|
| | | top: 0;
|
| | | width: 51%;
|
| | | height: 100%;
|
| | | background: #7171C6;
|
| | | z-index: 1000;
|
| | | -webkit-transform: translateX(0);
|
| | | -ms-transform: translateX(0);
|
| | | transform: translateX(0);
|
| | | }
|
| | |
|
| | | #loader-wrapper .loader-section.section-left {
|
| | | left: 0;
|
| | | }
|
| | |
|
| | | #loader-wrapper .loader-section.section-right {
|
| | | right: 0;
|
| | | }
|
| | |
|
| | |
|
| | | .loaded #loader-wrapper .loader-section.section-left {
|
| | | -webkit-transform: translateX(-100%);
|
| | | -ms-transform: translateX(-100%);
|
| | | transform: translateX(-100%);
|
| | | -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
|
| | | transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
|
| | | }
|
| | |
|
| | | .loaded #loader-wrapper .loader-section.section-right {
|
| | | -webkit-transform: translateX(100%);
|
| | | -ms-transform: translateX(100%);
|
| | | transform: translateX(100%);
|
| | | -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
|
| | | transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
|
| | | }
|
| | |
|
| | | .loaded #loader {
|
| | | opacity: 0;
|
| | | -webkit-transition: all 0.3s ease-out;
|
| | | transition: all 0.3s ease-out;
|
| | | }
|
| | |
|
| | | .loaded #loader-wrapper {
|
| | | visibility: hidden;
|
| | | -webkit-transform: translateY(-100%);
|
| | | -ms-transform: translateY(-100%);
|
| | | transform: translateY(-100%);
|
| | | -webkit-transition: all 0.3s 1s ease-out;
|
| | | transition: all 0.3s 1s ease-out;
|
| | | }
|
| | |
|
| | | .no-js #loader-wrapper {
|
| | | display: none;
|
| | | }
|
| | |
|
| | | .no-js h1 {
|
| | | color: #222222;
|
| | | }
|
| | |
|
| | | #loader-wrapper .load_title {
|
| | | font-family: 'Open Sans';
|
| | | color: #FFF;
|
| | | font-size: 19px;
|
| | | width: 100%;
|
| | | text-align: center;
|
| | | z-index: 9999999999999;
|
| | | position: absolute;
|
| | | top: 60%;
|
| | | opacity: 1;
|
| | | line-height: 30px;
|
| | | }
|
| | |
|
| | | #loader-wrapper .load_title span {
|
| | | font-weight: normal;
|
| | | font-style: italic;
|
| | | font-size: 13px;
|
| | | color: #FFF;
|
| | | opacity: 0.5;
|
| | | }
|
| | | </style>
|
| | | </head>
|
| | | <body>
|
| | | <div id="app">
|
| | | <div id="loader-wrapper">
|
| | | <div id="loader"></div>
|
| | | <div class="loader-section section-left"></div>
|
| | | <div class="loader-section section-right"></div>
|
| | | <div class="load_title">æ£å¨å 载系ç»èµæºï¼è¯·èå¿çå¾
</div>
|
| | | </div>
|
| | | </div>
|
| | | </body>
|
| | | </html>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div id="app">
|
| | | <router-view />
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | export default {
|
| | | name: 'App'
|
| | | }
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'
|
| | |
|
| | | // ç»å½æ¹æ³
|
| | | export function login(username, password, code, uuid) {
|
| | | const data = {
|
| | | username,
|
| | | password,
|
| | | code,
|
| | | uuid
|
| | | }
|
| | | return request({
|
| | | url: '/login',
|
| | | method: 'post',
|
| | | params: data
|
| | | })
|
| | | }
|
| | |
|
| | | // è·åç¨æ·è¯¦ç»ä¿¡æ¯
|
| | | export function getInfo() {
|
| | | return request({
|
| | | url: '/getInfo',
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // éåºæ¹æ³
|
| | | export function logout() {
|
| | | return request({
|
| | | url: '/logout',
|
| | | method: 'post'
|
| | | })
|
| | | }
|
| | |
|
| | | // è·åéªè¯ç
|
| | | export function getCodeImg() {
|
| | | return request({
|
| | | url: '/captchaImage',
|
| | | method: 'get'
|
| | | })
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'
|
| | |
|
| | | // è·åè·¯ç±
|
| | | export const getRouters = () => {
|
| | | return request({
|
| | | url: '/getRouters',
|
| | | method: 'get'
|
| | | })
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'
|
| | |
|
| | | // æ¥è¯¢ç»å½æ¥å¿å表
|
| | | export function list(query) {
|
| | | return request({
|
| | | url: '/monitor/logininfor/list',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'
|
| | |
|
| | | // æ¥è¯¢æä½æ¥å¿å表
|
| | | export function list(query) {
|
| | | return request({
|
| | | url: '/monitor/operlog/list',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'
|
| | |
|
| | | // æ¥è¯¢æå¡å¨è¯¦ç»
|
| | | export function getServer() {
|
| | | return request({
|
| | | url: '/monitor/server',
|
| | | method: 'get'
|
| | | })
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'
|
| | |
|
| | | // æ¥è¯¢åæ°å表
|
| | | export function listConfig(query) {
|
| | | return request({
|
| | | url: '/system/config/list',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | }
|
| | |
|
| | | // æ¥è¯¢åæ°è¯¦ç»
|
| | | export function getConfig(configId) {
|
| | | return request({
|
| | | url: '/system/config/' + configId,
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ ¹æ®åæ°é®åæ¥è¯¢åæ°å¼
|
| | | export function getConfigKey(configKey) {
|
| | | return request({
|
| | | url: '/system/config/configKey/' + configKey,
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ°å¢åæ°é
ç½®
|
| | | export function addConfig(data) {
|
| | | return request({
|
| | | url: '/system/config',
|
| | | method: 'post',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // ä¿®æ¹åæ°é
ç½®
|
| | | export function updateConfig(data) {
|
| | | return request({
|
| | | url: '/system/config',
|
| | | method: 'put',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // å é¤åæ°é
ç½®
|
| | | export function delConfig(configId) {
|
| | | return request({
|
| | | url: '/system/config/' + configId,
|
| | | method: 'delete'
|
| | | })
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'
|
| | |
|
| | | // æ¥è¯¢é¨é¨å表
|
| | | export function listDept(query) {
|
| | | return request({
|
| | | url: '/system/dept/list',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | }
|
| | |
|
| | | // æ¥è¯¢é¨é¨è¯¦ç»
|
| | | export function getDept(deptId) {
|
| | | return request({
|
| | | url: '/system/dept/' + deptId,
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ¥è¯¢é¨é¨ä¸ææ ç»æ
|
| | | export function treeselect() {
|
| | | return request({
|
| | | url: '/system/dept/treeselect',
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ ¹æ®è§è²IDæ¥è¯¢é¨é¨æ ç»æ
|
| | | export function roleDeptTreeselect(roleId) {
|
| | | return request({
|
| | | url: '/system/dept/roleDeptTreeselect/' + roleId,
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ°å¢é¨é¨
|
| | | export function addDept(data) {
|
| | | return request({
|
| | | url: '/system/dept',
|
| | | method: 'post',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // ä¿®æ¹é¨é¨
|
| | | export function updateDept(data) {
|
| | | return request({
|
| | | url: '/system/dept',
|
| | | method: 'put',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // å é¤é¨é¨
|
| | | export function delDept(deptId) {
|
| | | return request({
|
| | | url: '/system/dept/' + deptId,
|
| | | method: 'delete'
|
| | | })
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'
|
| | |
|
| | | // æ¥è¯¢åå
¸æ°æ®å表
|
| | | export function listData(query) {
|
| | | return request({
|
| | | url: '/system/dict/data/list',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | }
|
| | |
|
| | | // æ¥è¯¢åå
¸æ°æ®è¯¦ç»
|
| | | export function getData(dictCode) {
|
| | | return request({
|
| | | url: '/system/dict/data/' + dictCode,
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ ¹æ®åå
¸ç±»åæ¥è¯¢åå
¸æ°æ®ä¿¡æ¯
|
| | | export function getDicts(dictType) {
|
| | | return request({
|
| | | url: '/system/dict/data/dictType/' + dictType,
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ°å¢åå
¸æ°æ®
|
| | | export function addData(data) {
|
| | | return request({
|
| | | url: '/system/dict/data',
|
| | | method: 'post',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // ä¿®æ¹åå
¸æ°æ®
|
| | | export function updateData(data) {
|
| | | return request({
|
| | | url: '/system/dict/data',
|
| | | method: 'put',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // å é¤åå
¸æ°æ®
|
| | | export function delData(dictCode) {
|
| | | return request({
|
| | | url: '/system/dict/data/' + dictCode,
|
| | | method: 'delete'
|
| | | })
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'
|
| | |
|
| | | // æ¥è¯¢åå
¸ç±»åå表
|
| | | export function listType(query) {
|
| | | return request({
|
| | | url: '/system/dict/type/list',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | }
|
| | |
|
| | | // æ¥è¯¢åå
¸ç±»å详ç»
|
| | | export function getType(dictId) {
|
| | | return request({
|
| | | url: '/system/dict/type/' + dictId,
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ°å¢åå
¸ç±»å
|
| | | export function addType(data) {
|
| | | return request({
|
| | | url: '/system/dict/type',
|
| | | method: 'post',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // ä¿®æ¹åå
¸ç±»å
|
| | | export function updateType(data) {
|
| | | return request({
|
| | | url: '/system/dict/type',
|
| | | method: 'put',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // å é¤åå
¸ç±»å
|
| | | export function delType(dictId) {
|
| | | return request({
|
| | | url: '/system/dict/type/' + dictId,
|
| | | method: 'delete'
|
| | | })
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'
|
| | |
|
| | | // æ¥è¯¢èåå表
|
| | | export function listMenu(query) {
|
| | | return request({
|
| | | url: '/system/menu/list',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | }
|
| | |
|
| | | // æ¥è¯¢èå详ç»
|
| | | export function getMenu(menuId) {
|
| | | return request({
|
| | | url: '/system/menu/' + menuId,
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ¥è¯¢èå䏿æ ç»æ
|
| | | export function treeselect() {
|
| | | return request({
|
| | | url: '/system/menu/treeselect',
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ ¹æ®è§è²IDæ¥è¯¢èå䏿æ ç»æ
|
| | | export function roleMenuTreeselect(roleId) {
|
| | | return request({
|
| | | url: '/system/menu/roleMenuTreeselect/' + roleId,
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ°å¢èå
|
| | | export function addMenu(data) {
|
| | | return request({
|
| | | url: '/system/menu',
|
| | | method: 'post',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // ä¿®æ¹èå
|
| | | export function updateMenu(data) {
|
| | | return request({
|
| | | url: '/system/menu',
|
| | | method: 'put',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // å é¤èå
|
| | | export function delMenu(menuId) {
|
| | | return request({
|
| | | url: '/system/menu/' + menuId,
|
| | | method: 'delete'
|
| | | })
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'
|
| | |
|
| | | // æ¥è¯¢å
¬åå表
|
| | | export function listNotice(query) {
|
| | | return request({
|
| | | url: '/system/notice/list',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | }
|
| | |
|
| | | // æ¥è¯¢å
¬å详ç»
|
| | | export function getNotice(noticeId) {
|
| | | return request({
|
| | | url: '/system/notice/' + noticeId,
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ°å¢å
Œ
|
| | | export function addNotice(data) {
|
| | | return request({
|
| | | url: '/system/notice',
|
| | | method: 'post',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // ä¿®æ¹å
Œ
|
| | | export function updateNotice(data) {
|
| | | return request({
|
| | | url: '/system/notice',
|
| | | method: 'put',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // å é¤å
Œ
|
| | | export function delNotice(noticeId) {
|
| | | return request({
|
| | | url: '/system/notice/' + noticeId,
|
| | | method: 'delete'
|
| | | })
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'
|
| | |
|
| | | // æ¥è¯¢å²ä½å表
|
| | | export function listPost(query) {
|
| | | return request({
|
| | | url: '/system/post/list',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | }
|
| | |
|
| | | // æ¥è¯¢å²ä½è¯¦ç»
|
| | | export function getPost(postId) {
|
| | | return request({
|
| | | url: '/system/post/' + postId,
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ°å¢å²ä½
|
| | | export function addPost(data) {
|
| | | return request({
|
| | | url: '/system/post',
|
| | | method: 'post',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // ä¿®æ¹å²ä½
|
| | | export function updatePost(data) {
|
| | | return request({
|
| | | url: '/system/post',
|
| | | method: 'put',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // å é¤å²ä½
|
| | | export function delPost(postId) {
|
| | | return request({
|
| | | url: '/system/post/' + postId,
|
| | | method: 'delete'
|
| | | })
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'
|
| | |
|
| | | // æ¥è¯¢è§è²å表
|
| | | export function listRole(query) {
|
| | | return request({
|
| | | url: '/system/role/list',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | }
|
| | |
|
| | | // æ¥è¯¢è§è²è¯¦ç»
|
| | | export function getRole(roleId) {
|
| | | return request({
|
| | | url: '/system/role/' + roleId,
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ°å¢è§è²
|
| | | export function addRole(data) {
|
| | | return request({
|
| | | url: '/system/role',
|
| | | method: 'post',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // ä¿®æ¹è§è²
|
| | | export function updateRole(data) {
|
| | | return request({
|
| | | url: '/system/role',
|
| | | method: 'put',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // è§è²æ°æ®æé
|
| | | export function dataScope(data) {
|
| | | return request({
|
| | | url: '/system/role/dataScope',
|
| | | method: 'put',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // è§è²ç¶æä¿®æ¹
|
| | | export function changeRoleStatus(roleId, status) {
|
| | | const data = {
|
| | | roleId,
|
| | | status
|
| | | }
|
| | | return request({
|
| | | url: '/system/role/changeStatus',
|
| | | method: 'put',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // å é¤è§è²
|
| | | export function delRole(roleId) {
|
| | | return request({
|
| | | url: '/system/role/' + roleId,
|
| | | method: 'delete'
|
| | | })
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'
|
| | |
|
| | | // æ¥è¯¢ç¨æ·å表
|
| | | export function listUser(query) {
|
| | | return request({
|
| | | url: '/system/user/list',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | }
|
| | |
|
| | | // æ¥è¯¢ç¨æ·è¯¦ç»
|
| | | export function getUser(userId) {
|
| | | return request({
|
| | | url: '/system/user/' + userId,
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // æ°å¢ç¨æ·
|
| | | export function addUser(data) {
|
| | | return request({
|
| | | url: '/system/user',
|
| | | method: 'post',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // ä¿®æ¹ç¨æ·
|
| | | export function updateUser(data) {
|
| | | return request({
|
| | | url: '/system/user',
|
| | | method: 'put',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // å é¤ç¨æ·
|
| | | export function delUser(userId) {
|
| | | return request({
|
| | | url: '/system/user/' + userId,
|
| | | method: 'delete'
|
| | | })
|
| | | }
|
| | |
|
| | | // ç¨æ·å¯ç éç½®
|
| | | export function resetUserPwd(userId, password) {
|
| | | const data = {
|
| | | userId,
|
| | | password
|
| | | }
|
| | | return request({
|
| | | url: '/system/user/resetPwd',
|
| | | method: 'put',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // ç¨æ·ç¶æä¿®æ¹
|
| | | export function changeUserStatus(userId, status) {
|
| | | const data = {
|
| | | userId,
|
| | | status
|
| | | }
|
| | | return request({
|
| | | url: '/system/user/changeStatus',
|
| | | method: 'put',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // æ¥è¯¢ç¨æ·ä¸ªäººä¿¡æ¯
|
| | | export function getUserProfile() {
|
| | | return request({
|
| | | url: '/system/user/profile',
|
| | | method: 'get'
|
| | | })
|
| | | }
|
| | |
|
| | | // ä¿®æ¹ç¨æ·ä¸ªäººä¿¡æ¯
|
| | | export function updateUserProfile(data) {
|
| | | return request({
|
| | | url: '/system/user/profile',
|
| | | method: 'put',
|
| | | data: data
|
| | | })
|
| | | }
|
| | |
|
| | | // ç¨æ·å¯ç éç½®
|
| | | export function updateUserPwd(oldPassword, newPassword) {
|
| | | const data = {
|
| | | oldPassword,
|
| | | newPassword
|
| | | }
|
| | | return request({
|
| | | url: '/system/user/profile/updatePwd',
|
| | | method: 'put',
|
| | | params: data
|
| | | })
|
| | | }
|
| | |
|
| | | // ç¨æ·å¤´åä¸ä¼
|
| | | export function uploadAvatar(data) {
|
| | | return request({
|
| | | url: '/system/user/profile/avatar',
|
| | | method: 'post',
|
| | | data: data
|
| | | })
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import Vue from 'vue'
|
| | | import SvgIcon from '@/components/SvgIcon'// svg component
|
| | |
|
| | | // register globally
|
| | | Vue.component('svg-icon', SvgIcon)
|
| | |
|
| | | const req = require.context('./svg', false, /\.svg$/)
|
| | | const requireAll = requireContext => requireContext.keys().map(requireContext)
|
| | | requireAll(req)
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M121.718 73.272v9.953c3.957-7.584 6.199-16.05 6.199-24.995C127.917 26.079 99.273 0 63.958 0 28.644 0 0 26.079 0 58.23c0 .403.028.806.028 1.21l22.97-25.953h13.34l-19.76 27.187h6.42V53.77l13.728-19.477v49.361H22.998V73.272H2.158c5.951 20.284 23.608 36.208 45.998 41.399-1.44 3.3-5.618 11.263-12.565 12.674-8.607 1.764 23.358.428 46.163-13.178 17.519-4.611 31.938-15.849 39.77-30.513h-13.506V73.272H85.02V59.464l22.998-25.977h13.008l-19.429 27.187h6.421v-7.433l13.727-19.402v39.433h-.027zm-78.24 2.822a10.516 10.516 0 0 1-.996-4.535V44.548c0-1.613.332-3.124.996-4.535a11.66 11.66 0 0 1 2.713-3.68c1.134-1.032 2.49-1.864 4.04-2.468 1.55-.605 3.21-.908 4.982-.908h11.292c1.77 0 3.431.303 4.981.908 1.522.604 2.85 1.41 3.986 2.418l-12.26 16.303v-2.898a1.96 1.96 0 0 0-.665-1.512c-.443-.403-.996-.604-1.66-.604-.665 0-1.218.201-1.661.604a1.96 1.96 0 0 0-.664 1.512v9.071L44.364 77.606a10.556 10.556 0 0 1-.886-1.512zm35.73-4.535c0 1.613-.332 3.124-.997 4.535a11.66 11.66 0 0 1-2.712 3.68c-1.134 1.032-2.49 1.864-4.04 2.469-1.55.604-3.21.907-4.982.907H55.185c-1.77 0-3.431-.303-4.981-.907-1.55-.605-2.906-1.437-4.041-2.47a12.49 12.49 0 0 1-1.384-1.512l13.727-18.217v6.375c0 .605.222 1.109.665 1.512.442.403.996.604 1.66.604.664 0 1.218-.201 1.66-.604a1.96 1.96 0 0 0 .665-1.512V53.87L75.97 36.838c.913.932 1.66 1.99 2.214 3.175.664 1.41.996 2.922.996 4.535v27.011h.028z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M127.88 73.143c0 1.412-.506 2.635-1.518 3.669-1.011 1.033-2.209 1.55-3.592 1.55h-17.887c0 9.296-1.783 17.178-5.35 23.645l16.609 17.044c1.011 1.034 1.517 2.257 1.517 3.67 0 1.412-.506 2.635-1.517 3.668-.958 1.033-2.155 1.55-3.593 1.55-1.438 0-2.635-.517-3.593-1.55l-15.811-16.063a15.49 15.49 0 0 1-1.196 1.06c-.532.434-1.65 1.208-3.353 2.322a50.104 50.104 0 0 1-5.192 2.974c-1.758.87-3.94 1.658-6.546 2.364-2.607.706-5.189 1.06-7.748 1.06V47.044H58.89v73.062c-2.716 0-5.417-.367-8.106-1.102-2.688-.734-5.003-1.631-6.945-2.692a66.769 66.769 0 0 1-5.268-3.179c-1.571-1.057-2.73-1.94-3.476-2.65L33.9 109.34l-14.611 16.877c-1.066 1.14-2.344 1.711-3.833 1.711-1.277 0-2.422-.434-3.434-1.304-1.012-.978-1.557-2.187-1.635-3.627-.079-1.44.333-2.705 1.236-3.794l16.129-18.51c-3.087-6.197-4.63-13.644-4.63-22.342H5.235c-1.383 0-2.58-.517-3.592-1.55S.125 74.545.125 73.132c0-1.412.506-2.635 1.518-3.668 1.012-1.034 2.21-1.55 3.592-1.55h17.887V43.939L9.308 29.833c-1.012-1.033-1.517-2.256-1.517-3.669 0-1.412.505-2.635 1.517-3.668 1.012-1.034 2.21-1.55 3.593-1.55s2.58.516 3.593 1.55l13.813 14.106h67.396l13.814-14.106c1.012-1.034 2.21-1.55 3.592-1.55 1.384 0 2.581.516 3.593 1.55 1.012 1.033 1.518 2.256 1.518 3.668 0 1.413-.506 2.636-1.518 3.67l-13.814 14.105v23.975h17.887c1.383 0 2.58.516 3.593 1.55 1.011 1.033 1.517 2.256 1.517 3.668l-.005.01zM89.552 26.175H38.448c0-7.23 2.489-13.386 7.466-18.469C50.892 2.623 56.92.082 64 .082c7.08 0 13.108 2.541 18.086 7.624 4.977 5.083 7.466 11.24 7.466 18.469z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1568899741379" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2054" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M960 591.424V368.96c0-0.288 0.16-0.512 0.16-0.768S960 367.68 960 367.424V192a32 32 0 0 0-32-32H96a32 32 0 0 0-32 32v175.424c0 0.288-0.16 0.512-0.16 0.768s0.16 0.48 0.16 0.768v222.464c0 0.288-0.16 0.512-0.16 0.768s0.16 0.48 0.16 0.768V864a32 32 0 0 0 32 32h832a32 32 0 0 0 32-32v-271.04c0-0.288 0.16-0.512 0.16-0.768S960 591.68 960 591.424z m-560-31.232v-160H608v160h-208z m208 64V832h-208v-207.808H608z m-480-224h208v160H128v-160z m544 0h224v160h-224v-160zM896 224v112.192H128V224h768zM128 624.192h208V832H128v-207.808zM672 832v-207.808h224V832h-224z" p-id="2055"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M0 54.857h36.571V128H0V54.857zM91.429 27.43H128V128H91.429V27.429zM45.714 0h36.572v128H45.714V0z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M54.857 118.857h64V73.143H89.143c-1.902 0-3.52-.668-4.855-2.002-1.335-1.335-2.002-2.954-2.002-4.855V36.57H54.857v82.286zM73.143 16v-4.571a2.2 2.2 0 0 0-.677-1.61 2.198 2.198 0 0 0-1.609-.676H20.571c-.621 0-1.158.225-1.609.676a2.198 2.198 0 0 0-.676 1.61V16a2.2 2.2 0 0 0 .676 1.61c.451.45.988.676 1.61.676h50.285c.622 0 1.158-.226 1.61-.677.45-.45.676-.987.676-1.609zm18.286 48h21.357L91.43 42.642V64zM128 73.143v48c0 1.902-.667 3.52-2.002 4.855-1.335 1.335-2.953 2.002-4.855 2.002H52.57c-1.901 0-3.52-.667-4.854-2.002-1.335-1.335-2.003-2.953-2.003-4.855v-11.429H6.857c-1.902 0-3.52-.667-4.855-2.002C.667 106.377 0 104.759 0 102.857v-96c0-1.902.667-3.52 2.002-4.855C3.337.667 4.955 0 6.857 0h77.714c1.902 0 3.52.667 4.855 2.002 1.335 1.335 2.003 2.953 2.003 4.855V30.29c1 .622 1.856 1.29 2.569 2.003l29.147 29.147c1.335 1.335 2.478 3.145 3.429 5.43.95 2.287 1.426 4.383 1.426 6.291v-.018z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1546567861908" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2422" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M318.577778 819.2L17.066667 512l301.511111-307.2 45.511111 45.511111L96.711111 512l267.377778 261.688889zM705.422222 819.2l-45.511111-45.511111L927.288889 512l-267.377778-261.688889 45.511111-45.511111L1006.933333 512zM540.785778 221.866667l55.751111 11.150222L483.157333 802.133333l-55.751111-11.093333z" fill="#bfbfbf" p-id="2423"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h54.857v54.857H0V0zm0 73.143h54.857V128H0V73.143zm73.143 0H128V128H73.143V73.143zm27.428-18.286C115.72 54.857 128 42.577 128 27.43 128 12.28 115.72 0 100.571 0 85.423 0 73.143 12.28 73.143 27.429c0 15.148 12.28 27.428 27.428 27.428z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M27.429 63.638c0-2.508-.893-4.65-2.679-6.424-1.786-1.775-3.94-2.662-6.464-2.662-2.524 0-4.679.887-6.465 2.662-1.785 1.774-2.678 3.916-2.678 6.424 0 2.508.893 4.65 2.678 6.424 1.786 1.775 3.94 2.662 6.465 2.662 2.524 0 4.678-.887 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zm13.714-31.801c0-2.508-.893-4.65-2.679-6.424-1.785-1.775-3.94-2.662-6.464-2.662-2.524 0-4.679.887-6.464 2.662-1.786 1.774-2.679 3.916-2.679 6.424 0 2.508.893 4.65 2.679 6.424 1.785 1.774 3.94 2.662 6.464 2.662 2.524 0 4.679-.888 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zM71.714 65.98l7.215-27.116c.285-1.23.107-2.378-.536-3.443-.643-1.064-1.56-1.762-2.75-2.094-1.19-.33-2.333-.177-3.429.462-1.095.639-1.81 1.573-2.143 2.804l-7.214 27.116c-2.857.237-5.405 1.266-7.643 3.088-2.238 1.822-3.738 4.152-4.5 6.992-.952 3.644-.476 7.098 1.429 10.364 1.905 3.265 4.69 5.37 8.357 6.317 3.667.947 7.143.474 10.429-1.42 3.285-1.892 5.404-4.66 6.357-8.305.762-2.84.619-5.607-.429-8.305-1.047-2.697-2.762-4.85-5.143-6.46zm47.143-2.342c0-2.508-.893-4.65-2.678-6.424-1.786-1.775-3.94-2.662-6.465-2.662-2.524 0-4.678.887-6.464 2.662-1.786 1.774-2.679 3.916-2.679 6.424 0 2.508.893 4.65 2.679 6.424 1.786 1.775 3.94 2.662 6.464 2.662 2.524 0 4.679-.887 6.465-2.662 1.785-1.775 2.678-3.916 2.678-6.424zm-45.714-45.43c0-2.509-.893-4.65-2.679-6.425C68.68 10.01 66.524 9.122 64 9.122c-2.524 0-4.679.887-6.464 2.661-1.786 1.775-2.679 3.916-2.679 6.425 0 2.508.893 4.65 2.679 6.424 1.785 1.774 3.94 2.662 6.464 2.662 2.524 0 4.679-.888 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zm32 13.629c0-2.508-.893-4.65-2.679-6.424-1.785-1.775-3.94-2.662-6.464-2.662-2.524 0-4.679.887-6.464 2.662-1.786 1.774-2.679 3.916-2.679 6.424 0 2.508.893 4.65 2.679 6.424 1.785 1.774 3.94 2.662 6.464 2.662 2.524 0 4.679-.888 6.464-2.662 1.786-1.775 2.679-3.916 2.679-6.424zM128 63.638c0 12.351-3.357 23.78-10.071 34.286-.905 1.372-2.19 2.058-3.858 2.058H13.93c-1.667 0-2.953-.686-3.858-2.058C3.357 87.465 0 76.037 0 63.638c0-8.613 1.69-16.847 5.071-24.703C8.452 31.08 13 24.312 18.714 18.634c5.715-5.68 12.524-10.199 20.429-13.559C47.048 1.715 55.333.035 64 .035c8.667 0 16.952 1.68 24.857 5.04 7.905 3.36 14.714 7.88 20.429 13.559 5.714 5.678 10.262 12.446 13.643 20.301 3.38 7.856 5.071 16.09 5.071 24.703z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1567417179372" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1155" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M947.2 1024 76.8 1024C38.4 1024 0 992 0 953.6L0 172.8c0-38.4 38.4-70.4 76.8-70.4l38.4 0 0 102.4c0 38.4 38.4 70.4 76.8 70.4l76.8 0c44.8 0 76.8-32 76.8-70.4L345.6 102.4l313.6 0 0 102.4c0 38.4 38.4 70.4 76.8 70.4l76.8 0c44.8 0 76.8-32 76.8-70.4L889.6 102.4l38.4 0c44.8 0 76.8 32 76.8 70.4l0 787.2C1024 992 985.6 1024 947.2 1024zM352 339.2 115.2 339.2 115.2 512l236.8 0L352 339.2zM352 544 115.2 544l0 172.8 236.8 0L352 544zM352 748.8 115.2 748.8l0 172.8 236.8 0L352 748.8zM627.2 339.2 396.8 339.2 396.8 512l236.8 0L633.6 339.2zM627.2 544 396.8 544l0 172.8 236.8 0L633.6 544zM627.2 748.8 396.8 748.8l0 172.8 236.8 0L633.6 748.8zM908.8 339.2l-236.8 0L672 512l236.8 0L908.8 339.2zM908.8 544l-236.8 0 0 172.8 236.8 0L908.8 544zM908.8 748.8l-236.8 0 0 172.8 236.8 0L908.8 748.8zM787.2 236.8c-44.8 0-76.8-32-76.8-70.4L710.4 70.4c0-38.4 38.4-70.4 76.8-70.4s76.8 32 76.8 70.4l0 102.4C864 211.2 832 236.8 787.2 236.8zM236.8 236.8C192 236.8 160 211.2 160 172.8L160 70.4C160 32 192 0 236.8 0s76.8 32 76.8 70.4l0 102.4C313.6 211.2 281.6 236.8 236.8 236.8z" p-id="1156"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1566035680909" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3601" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M1002.0848 744.672l-33.568 10.368c0.96 7.264 2.144 14.304 2.144 21.76 0 7.328-1.184 14.432-2.368 21.568l33.792 10.56c7.936 2.24 14.496 7.616 18.336 14.752 3.84 7.328 4.672 15.808 1.952 23.552-5.376 16-23.168 24.672-39.936 19.68l-34.176-10.624c-7.136 12.8-15.776 24.672-26.208 35.2l20.8 27.488a28.96 28.96 0 0 1 5.824 22.816 29.696 29.696 0 0 1-12.704 19.616 32.544 32.544 0 0 1-44.416-6.752l-20.8-27.552c-13.696 6.56-28.192 11.2-43.008 13.888v33.632c0 16.736-14.112 30.432-31.648 30.432-17.6 0-31.872-13.696-31.872-30.432v-33.632a167.616 167.616 0 0 1-42.88-13.888l-20.928 27.552c-10.72 13.76-30.08 16.64-44.288 6.752a29.632 29.632 0 0 1-12.704-19.616 29.28 29.28 0 0 1 5.696-22.816l20.896-27.808a166.72 166.72 0 0 1-27.008-34.688l-33.376 10.432c-16.8 5.184-34.56-3.552-39.936-19.616a29.824 29.824 0 0 1 20.224-38.24l33.472-10.432c-0.8-7.264-2.016-14.304-2.016-21.824 0-7.36 1.184-14.496 2.304-21.632l-33.792-10.368c-16.672-5.376-25.632-22.496-20.224-38.432 5.376-16 23.136-24.672 39.936-19.68l34.016 10.752c7.328-12.672 15.84-24.8 26.336-35.328l-20.8-27.552a29.44 29.44 0 0 1 6.944-42.432 32.704 32.704 0 0 1 44.384 6.752l20.832 27.616c13.696-6.432 28.224-11.2 43.104-13.952v-33.568c0-16.736 14.048-30.432 31.648-30.432 17.536 0 31.808 13.568 31.808 30.432v33.504c15.072 2.688 29.344 7.808 42.848 14.016l20.992-27.616a32.48 32.48 0 0 1 44.224-6.752 29.568 29.568 0 0 1 7.136 42.432l-21.024 27.808c10.432 10.432 19.872 21.888 27.04 34.752l33.376-10.432c16.768-5.12 34.56 3.68 39.936 19.68 5.536 15.936-3.712 33.056-20.32 38.304z m-206.016-74.432c-61.344 0-111.136 47.808-111.136 106.56 0 58.88 49.792 106.496 111.136 106.496 61.312 0 111.104-47.616 111.104-106.496 0-58.752-49.792-106.56-111.104-106.56z" p-id="3602"></path><path d="M802.7888 57.152h-76.448c0-22.08-21.024-38.24-42.848-38.24H39.3968a39.68 39.68 0 0 0-39.36 40.032v795.616s41.888 120.192 110.752 120.192H673.2848a227.488 227.488 0 0 1-107.04-97.44H117.6368s-40.608-13.696-40.608-41.248l470.304-0.256 1.664 3.36a227.68 227.68 0 0 1-12.64-73.632c0-60.576 24-118.624 66.88-161.44a228.352 228.352 0 0 1 123.552-63.392l-3.2 0.288 2.144-424.672h38.208l0.576 421.024c27.04 0 52.672 4.8 76.64 13.344V101.536c0.032 0-6.304-44.384-38.368-44.384zM149.7648 514.336H72.3888v-77.408H149.7648v77.408z m0-144.32H72.3888v-77.44H149.7648v77.44z m0-137.248H72.3888v-77.44H149.7648v77.44z m501.856 281.568H206.0848v-77.408h445.536v77.408z m0-144.32H206.0848v-77.44h445.536v77.44z m0-137.248H206.0848v-77.44h445.536v77.44z" p-id="3603"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M71.984 44.815H115.9L71.984 9.642v35.173zM16.094.05h63.875l47.906 38.37v76.74c0 3.392-1.682 6.645-4.677 9.044-2.995 2.399-7.056 3.746-11.292 3.746H16.094c-4.236 0-8.297-1.347-11.292-3.746-2.995-2.399-4.677-5.652-4.677-9.044V12.84C.125 5.742 7.23.05 16.094.05zm71.86 102.32V89.58h-71.86v12.79h71.86zm23.952-25.58V64H16.094v12.79h95.812z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1569915748289" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3062" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M768.35456 416a256 256 0 1 0-512 0 192 192 0 1 0 0 384v64a256 256 0 0 1-58.88-505.216 320.128 320.128 0 0 1 629.76 0A256.128 256.128 0 0 1 768.35456 864v-64a192 192 0 0 0 0-384z m-512 384h64v64H256.35456v-64z m448 0h64v64h-64v-64z" fill="#333333" p-id="3063"></path><path d="M539.04256 845.248V512.192a32.448 32.448 0 0 0-32-32.192c-17.664 0-32 14.912-32 32.192v333.056l-36.096-36.096a32.192 32.192 0 0 0-45.056 0.192 31.616 31.616 0 0 0-0.192 45.056l90.88 90.944a31.36 31.36 0 0 0 22.528 9.088 30.08 30.08 0 0 0 22.4-9.088l90.88-90.88a32.192 32.192 0 0 0-0.192-45.12 31.616 31.616 0 0 0-45.056-0.192l-36.096 36.096z" fill="#333333" p-id="3064"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M73.137 29.08h-9.209 29.7L63.886.093 34.373 29.08h20.49v27.035H27.238v17.948h27.625v27.133h18.274V74.063h27.41V56.115h-27.41V29.08zm-9.245 98.827l27.518-26.711H36.59l27.302 26.71zM.042 64.982l27.196 27.029V38.167L.042 64.982zm100.505-26.815V92.01l27.41-27.029-27.41-26.815z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1566036347051" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5853" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M832 128H192a64.19 64.19 0 0 0-64 64v640a64.19 64.19 0 0 0 64 64h640a64.19 64.19 0 0 0 64-64V192a64.19 64.19 0 0 0-64-64z m0 703.89l-0.11 0.11H192.11l-0.11-0.11V768h640zM832 544H720L605.6 696.54 442.18 435.07 333.25 544H192v-64h114.75l147.07-147.07L610.4 583.46 688 480h144z m0-288H192v-63.89l0.11-0.11h639.78l0.11 0.11z" p-id="5854"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M106.133 67.2a4.797 4.797 0 0 0-4.8 4.8c0 .187.014.36.027.533h-.027V118.4H9.6V26.667h50.133c2.654 0 4.8-2.147 4.8-4.8 0-2.654-2.146-4.8-4.8-4.8H9.6a9.594 9.594 0 0 0-9.6 9.6V118.4c0 5.307 4.293 9.6 9.6 9.6h91.733c5.307 0 9.6-4.293 9.6-9.6V72.533h-.026c.013-.173.026-.346.026-.533 0-2.653-2.146-4.8-4.8-4.8z"/><path d="M125.16 13.373L114.587 2.8c-3.747-3.747-9.854-3.72-13.6.027l-52.96 52.96a4.264 4.264 0 0 0-.907 1.36L33.813 88.533c-.746 1.76-.226 3.534.907 4.68 1.133 1.147 2.92 1.667 4.693.92l31.4-13.293c.507-.213.96-.52 1.36-.907l52.96-52.96c3.747-3.746 3.774-9.853.027-13.6zM66.107 72.4l-18.32 7.76 7.76-18.32L92.72 24.667l10.56 10.56L66.107 72.4zm52.226-52.227l-8.266 8.267-10.56-10.56 8.266-8.267.027-.026 10.56 10.56-.027.026z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M88.883 119.565c-7.284 0-19.434 2.495-21.333 8.25v.127c-4.232.13-5.222 0-7.108 0-1.895-5.76-14.045-8.256-21.333-8.256H0V0h42.523c9.179 0 17.109 5.47 21.47 13.551C68.352 5.475 76.295 0 85.478 0H128v119.57l-39.113-.005h-.004zM60.442 24.763c0-9.651-8.978-16.507-17.777-16.507H7.108V111.43H39.11c7.054-.14 18.177.082 21.333 6.12v-4.628c-.134-5.722-.004-13.522 0-13.832V27.413l.004-2.655-.004.005zm60.442-16.517h-35.55c-8.802 0-17.78 6.856-17.78 16.493v74.259c.004.32.138 8.115 0 13.813v4.627c3.155-6.022 14.279-6.26 21.333-6.114h32V8.25l-.003-.005z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="96" xmlns="http://www.w3.org/2000/svg"><path d="M64.125 56.975L120.188.912A12.476 12.476 0 0 0 115.5 0h-103c-1.588 0-3.113.3-4.513.838l56.138 56.137z"/><path d="M64.125 68.287l-62.3-62.3A12.42 12.42 0 0 0 0 12.5v71C0 90.4 5.6 96 12.5 96h103c6.9 0 12.5-5.6 12.5-12.5v-71a12.47 12.47 0 0 0-1.737-6.35L64.125 68.287z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M96.258 57.462h31.421C124.794 27.323 100.426 2.956 70.287.07v31.422a32.856 32.856 0 0 1 25.971 25.97zm-38.796-25.97V.07C27.323 2.956 2.956 27.323.07 57.462h31.422a32.856 32.856 0 0 1 25.97-25.97zm12.825 64.766v31.421c30.46-2.885 54.507-27.253 57.713-57.712H96.579c-2.886 13.466-13.146 23.726-26.292 26.291zM31.492 70.287H.07c2.886 30.46 27.253 54.507 57.713 57.713V96.579c-13.466-2.886-23.726-13.146-26.291-26.292z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M78.208 16.576v8.384h38.72v5.376h-38.72v8.704h38.72v5.376h-38.72v8.576h38.72v5.376h-38.72v8.576h38.72v5.376h-38.72v8.576h38.72v5.376h-38.72v8.512h38.72v5.376h-38.72v11.136H128v-94.72H78.208zM0 114.368L72.128 128V0L0 13.632v100.736z"/><path d="M28.672 82.56h-11.2l14.784-23.488-14.08-22.592h11.52l8.192 14.976 8.448-14.976h11.136l-14.08 22.208L58.368 82.56H46.656l-8.768-15.68z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M49.217 41.329l-.136-35.24c-.06-2.715-2.302-4.345-5.022-4.405h-3.65c-2.712-.06-4.866 2.303-4.806 5.016l.152 19.164-24.151-23.79a6.698 6.698 0 0 0-9.499 0 6.76 6.76 0 0 0 0 9.526l23.93 23.713-18.345.074c-2.712-.069-5.228 1.813-5.64 5.02v3.462c.069 2.721 2.31 4.97 5.022 5.03l35.028-.207c.052.005.087.025.133.025l2.457.054a4.626 4.626 0 0 0 3.436-1.38c.88-.874 1.205-2.096 1.169-3.462l-.262-2.465c0-.048.182-.081.182-.136h.002zm52.523 51.212l18.32-.073c2.713.06 5.224-1.609 5.64-4.815v-3.462c-.068-2.722-2.317-4.97-5.021-5.04l-34.58.21c-.053 0-.086-.021-.138-.021l-2.451-.06a4.64 4.64 0 0 0-3.445 1.381c-.885.868-1.201 2.094-1.174 3.46l.27 2.46c.005.06-.177.095-.177.141l.141 34.697c.069 2.713 2.31 4.338 5.022 4.397l3.45.006c2.705.062 4.867-2.31 4.8-5.026l-.153-18.752 24.151 23.946a6.69 6.69 0 0 0 9.494 0 6.747 6.747 0 0 0 0-9.523L101.74 92.54v.001zM48.125 80.662a4.636 4.636 0 0 0-3.437-1.382l-2.457.06c-.05 0-.082.022-.137.022l-35.025-.21c-2.712.07-4.957 2.318-5.022 5.04v3.462c.409 3.206 2.925 4.874 5.633 4.814l18.554.06-24.132 23.928c-2.62 2.626-2.62 6.89 0 9.524a6.694 6.694 0 0 0 9.496 0l24.155-23.79-.155 18.866c-.06 2.722 2.094 5.093 4.801 5.025h3.65c2.72-.069 4.962-1.685 5.022-4.406l.141-34.956c0-.05-.182-.082-.182-.136l.262-2.46c.03-1.366-.286-2.592-1.166-3.46h-.001zM80.08 47.397a4.62 4.62 0 0 0 3.443 1.374l2.45-.054c.055 0 .088-.02.143-.028l35.08.21c2.712-.062 4.953-2.312 5.021-5.033l.009-3.463c-.417-3.211-2.937-5.084-5.64-5.025l-18.615-.073 23.917-23.715c2.63-2.623 2.63-6.879.008-9.513a6.691 6.691 0 0 0-9.494 0L92.251 26.016l.155-19.312c.065-2.713-2.097-5.085-4.802-5.025h-3.45c-2.713.069-4.954 1.693-5.022 4.406l-.139 35.247c0 .054.18.088.18.136l-.267 2.465c-.028 1.366.288 2.588 1.174 3.463v.001z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="128" height="128"><defs><style/></defs><path d="M512 128q69.675 0 135.51 21.163t115.498 54.997 93.483 74.837 73.685 82.006 51.67 74.837 32.17 54.827L1024 512q-2.347 4.992-6.315 13.483T998.87 560.17t-31.658 51.669-44.331 59.99-56.832 64.34-69.504 60.16-82.347 51.5-94.848 34.687T512 896q-69.675 0-135.51-21.163t-115.498-54.826-93.483-74.326-73.685-81.493-51.67-74.496-32.17-54.997L0 513.707q2.347-4.992 6.315-13.483t18.816-34.816 31.658-51.84 44.331-60.33 56.832-64.683 69.504-60.331 82.347-51.84 94.848-34.816T512 128.085zm0 85.333q-46.677 0-91.648 12.331t-81.152 31.83-70.656 47.146-59.648 54.485-48.853 57.686-37.675 52.821-26.325 43.99q12.33 21.674 26.325 43.52t37.675 52.351 48.853 57.003 59.648 53.845T339.2 767.02t81.152 31.488T512 810.667t91.648-12.331 81.152-31.659 70.656-46.848 59.648-54.186 48.853-57.344 37.675-52.651T927.957 512q-12.33-21.675-26.325-43.648t-37.675-52.65-48.853-57.345-59.648-54.186-70.656-46.848-81.152-31.659T512 213.334zm0 128q70.656 0 120.661 50.006T682.667 512 632.66 632.661 512 682.667 391.339 632.66 341.333 512t50.006-120.661T512 341.333zm0 85.334q-35.328 0-60.33 25.002T426.666 512t25.002 60.33T512 597.334t60.33-25.002T597.334 512t-25.002-60.33T512 426.666z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="64" xmlns="http://www.w3.org/2000/svg"><path d="M127.072 7.994c1.37-2.208.914-5.152-.914-6.87-2.056-1.717-4.797-1.226-6.396.982-.229.245-25.586 32.382-55.74 32.382-29.24 0-55.74-32.382-55.968-32.627-1.6-1.963-4.57-2.208-6.397-.49C-.17 3.086-.399 6.275 1.2 8.238c.457.736 5.94 7.36 14.62 14.72L4.17 35.96c-1.828 1.963-1.6 5.152.228 6.87.457.98 1.6 1.471 2.742 1.471s2.284-.49 3.198-1.472l12.564-13.983c5.94 4.416 13.021 8.587 20.788 11.53l-4.797 17.418c-.685 2.699.686 5.397 3.198 6.133h1.37c2.057 0 3.884-1.472 4.341-3.68L52.6 42.83c3.655.736 7.538 1.227 11.422 1.227 3.883 0 7.767-.49 11.422-1.227l4.797 17.173c.457 2.208 2.513 3.68 4.34 3.68.457 0 .914 0 1.143-.246 2.513-.736 3.883-3.434 3.198-6.133l-4.797-17.172c7.767-2.944 14.848-7.114 20.788-11.53l12.336 13.738c.913.981 2.056 1.472 3.198 1.472s2.284-.49 3.198-1.472c1.828-1.963 1.828-4.906.228-6.87l-11.65-13.001c9.366-7.36 14.849-14.474 14.849-14.474z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M84.068 23.784c-1.02 0-1.877-.32-2.572-.96a8.588 8.588 0 0 1-1.738-2.237 11.524 11.524 0 0 1-1.042-2.621c-.232-.895-.348-1.641-.348-2.238V0h.278c.834 0 1.622.085 2.363.256.742.17 1.645.575 2.711 1.214 1.066.64 2.363 1.535 3.892 2.686 1.53 1.15 3.453 2.664 5.77 4.54 2.502 2.045 4.494 3.771 5.977 5.178 1.483 1.406 2.618 2.6 3.406 3.58.787.98 1.274 1.812 1.46 2.494.185.682.277 1.278.277 1.79v2.046H84.068zM127.3 84.01c.278.682.464 1.535.556 2.558.093 1.023-.37 2.003-1.39 2.94-.463.427-.88.832-1.25 1.215-.372.384-.696.704-.974.96a6.69 6.69 0 0 1-.973.767l-11.816-10.741a44.331 44.331 0 0 0 1.877-1.535 31.028 31.028 0 0 1 1.737-1.406c1.112-.938 2.317-1.343 3.615-1.215 1.297.128 2.363.405 3.197.83.927.427 1.923 1.173 2.989 2.239 1.065 1.065 1.876 2.195 2.432 3.388zM78.23 95.902c2.038 0 3.752-.511 5.143-1.534l-26.969 25.83H18.037c-1.761 0-3.684-.47-5.77-1.407a24.549 24.549 0 0 1-5.838-3.709 21.373 21.373 0 0 1-4.518-5.306c-1.204-2.003-1.807-4.07-1.807-6.202V16.495c0-1.79.44-3.665 1.32-5.626A18.41 18.41 0 0 1 5.04 5.562a21.798 21.798 0 0 1 5.213-3.964C12.198.533 14.237 0 16.37 0h53.24v15.984c0 1.62.278 3.367.834 5.242a16.704 16.704 0 0 0 2.572 5.179c1.159 1.577 2.665 2.898 4.518 3.964 1.853 1.066 4.078 1.598 6.673 1.598h20.295v42.325L85.458 92.45c1.02-1.364 1.529-2.856 1.529-4.476 0-2.216-.857-4.113-2.572-5.69-1.714-1.577-3.776-2.366-6.186-2.366H26.1c-2.409 0-4.448.789-6.116 2.366-1.668 1.577-2.502 3.474-2.502 5.69 0 2.217.834 4.092 2.502 5.626 1.668 1.535 3.707 2.302 6.117 2.302h52.13zM26.1 47.951c-2.41 0-4.449.789-6.117 2.366-1.668 1.577-2.502 3.473-2.502 5.69 0 2.216.834 4.092 2.502 5.626 1.668 1.534 3.707 2.302 6.117 2.302h52.13c2.409 0 4.47-.768 6.185-2.302 1.715-1.534 2.572-3.41 2.572-5.626 0-2.217-.857-4.113-2.572-5.69-1.714-1.577-3.776-2.366-6.186-2.366H26.1zm52.407 64.063l1.807-1.663 3.476-3.196a479.75 479.75 0 0 0 4.587-4.284 500.757 500.757 0 0 1 5.004-4.667c3.985-3.666 8.48-7.758 13.485-12.276l11.677 10.741-13.485 12.404-5.004 4.603-4.587 4.22a179.46 179.46 0 0 0-3.267 3.068c-.88.853-1.367 1.322-1.46 1.407-.463.341-.973.703-1.529 1.087-.556.383-1.112.703-1.668.959-.556.256-1.413.575-2.572.959a83.5 83.5 0 0 1-3.545 1.087 72.2 72.2 0 0 1-3.475.895c-1.112.256-1.946.426-2.502.511-1.112.17-1.854.043-2.224-.383-.371-.426-.464-1.151-.278-2.174.092-.511.278-1.279.556-2.302.278-1.023.602-2.067.973-3.132l1.042-3.005c.325-.938.58-1.577.765-1.918a10.157 10.157 0 0 1 2.224-2.941z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M38.47 52L52 38.462l-23.648-23.67L43.209 0H.035L0 43.137l14.757-14.865L38.47 52zm74.773 47.726L89.526 76 76 89.536l23.648 23.672L84.795 128h43.174L128 84.863l-14.757 14.863zM89.538 52l23.668-23.648L128 43.207V.038L84.866 0 99.73 14.76 76 38.472 89.538 52zM38.46 76L14.792 99.651 0 84.794v43.173l43.137.033-14.865-14.757L52 89.53 38.46 76z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M1.482 70.131l36.204 16.18 69.932-65.485-61.38 70.594 46.435 18.735c1.119.425 2.397-.17 2.797-1.363v-.085L127.998.047 1.322 65.874c-1.12.597-1.519 1.959-1.04 3.151.32.511.72.937 1.2 1.107zm44.676 57.821L64.22 107.26l-18.062-7.834v28.527z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M115.147.062a13 13 0 0 1 4.94.945c1.55.63 2.907 1.526 4.069 2.688a13.148 13.148 0 0 1 2.761 4.069c.678 1.55 1.017 3.245 1.017 5.086v102.3c0 3.681-1.187 6.733-3.56 9.155-2.373 2.422-5.352 3.633-8.937 3.633H12.992c-3.875 0-7-1.26-9.373-3.779-2.373-2.518-3.56-5.667-3.56-9.445V12.704c0-3.39 1.163-6.345 3.488-8.863C5.872 1.32 8.972.062 12.847.062h102.3zM81.434 109.047c1.744 0 3.003-.412 3.778-1.235.775-.824 1.163-1.914 1.163-3.27 0-1.26-.388-2.325-1.163-3.197-.775-.872-2.034-1.307-3.778-1.307H72.57c.097-.194.145-.485.145-.872V27.09h9.01c1.743 0 2.954-.436 3.633-1.308.678-.872 1.017-1.938 1.017-3.197 0-1.26-.34-2.325-1.017-3.197-.679-.872-1.89-1.308-3.633-1.308H46.268c-1.743 0-2.954.436-3.632 1.308-.678.872-1.018 1.938-1.018 3.197 0 1.26.34 2.325 1.018 3.197.678.872 1.889 1.308 3.632 1.308h8.138v72.075c0 .193.024.339.073.436.048.096.072.242.072.436H46.56c-1.744 0-3.003.435-3.778 1.307-.775.872-1.163 1.938-1.163 3.197 0 1.356.388 2.446 1.163 3.27.775.823 2.034 1.235 3.778 1.235h34.875z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M83.287 103.01c-1.57-3.84-6.778-10.414-15.447-19.548-2.327-2.444-2.182-4.306-1.338-9.862v-.64c.553-3.81 1.513-6.05 14.313-8.087 6.516-1.018 8.203 1.57 10.589 5.178l.785 1.193a12.625 12.625 0 0 0 6.43 5.207c1.134.524 2.53 1.164 4.421 2.24 4.596 2.53 4.596 5.41 4.596 11.753v.727a26.91 26.91 0 0 1-5.178 17.454 59.055 59.055 0 0 1-19.025 11.026c3.49-6.546.814-14.313 0-16.553l-.146-.087zM64 5.12a58.502 58.502 0 0 1 25.484 5.818 54.313 54.313 0 0 0-12.859 10.327c-.93 1.28-1.716 2.473-2.472 3.579-2.444 3.694-3.637 5.352-5.818 5.614a25.105 25.105 0 0 1-4.219 0c-4.276-.29-10.094-.64-11.956 4.422-1.193 3.23-1.396 11.956 2.444 16.495.66 1.077.778 2.4.32 3.578a7.01 7.01 0 0 1-2.066 3.229 18.938 18.938 0 0 1-2.909-2.91 18.91 18.91 0 0 0-8.32-6.603c-1.25-.349-2.647-.64-3.985-.93-3.782-.786-8.03-1.688-9.019-3.812a14.895 14.895 0 0 1-.727-5.818 21.935 21.935 0 0 0-1.396-9.25 8.873 8.873 0 0 0-5.557-4.946A58.705 58.705 0 0 1 64 5.12zM0 64c0 35.346 28.654 64 64 64 35.346 0 64-28.654 64-64 0-35.346-28.654-64-64-64C28.654 0 0 28.654 0 64z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1566036191400" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5472" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M934.912 1016.832H192c-14.336 0-25.6-11.264-25.6-25.6v-189.44c0-14.336 11.264-25.6 25.6-25.6s25.6 11.264 25.6 25.6v163.84h691.712V64H217.6v148.48c0 14.336-11.264 25.6-25.6 25.6s-25.6-11.264-25.6-25.6v-174.08c0-14.336 11.264-25.6 25.6-25.6h742.912c14.336 0 25.6 11.264 25.6 25.6v952.832c0 14.336-11.264 25.6-25.6 25.6z" p-id="5473"></path><path d="M232.96 371.2h-117.76c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h117.76c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6zM232.96 540.16h-117.76c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h117.76c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6zM232.96 698.88h-117.76c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h117.76c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6zM574.464 762.88c-134.144 0-243.2-109.056-243.2-243.2S440.32 276.48 574.464 276.48s243.2 109.056 243.2 243.2-109.056 243.2-243.2 243.2z m0-435.2c-105.984 0-192 86.016-192 192S468.48 711.68 574.464 711.68s192-86.016 192-192S680.448 327.68 574.464 327.68z" p-id="5474"></path><path d="M663.04 545.28h-87.04c-14.336 0-25.6-11.264-25.6-25.6s11.264-25.6 25.6-25.6h87.04c14.336 0 25.6 11.264 25.6 25.6s-11.264 25.6-25.6 25.6z" p-id="5475"></path><path d="M576 545.28c-14.336 0-25.6-11.264-25.6-25.6v-87.04c0-14.336 11.264-25.6 25.6-25.6s25.6 11.264 25.6 25.6v87.04c0 14.336-11.264 25.6-25.6 25.6z" p-id="5476"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M84.742 36.8c2.398 7.2 5.595 12.8 11.19 18.4 4.795-4.8 7.992-11.2 10.39-18.4h-21.58zm-52.748 40h20.78l-10.39-28-10.39 28z"/><path d="M111.916 0H16.009C7.218 0 .025 7.2.025 16v96c0 8.8 7.193 16 15.984 16h95.907c8.791 0 15.984-7.2 15.984-16V16c0-8.8-6.394-16-15.984-16zM72.754 103.2c-1.598 1.6-3.197 1.6-4.795 1.6-.8 0-2.398 0-3.197-.8-.8-.8-1.599 0-1.599-.8s-.799-1.6-1.598-3.2c-.8-1.6-.8-2.4-1.599-4l-3.196-8.8H28.797L25.6 96c-1.598 3.2-2.398 5.6-3.197 7.2-.8 1.6-2.398 1.6-4.795 1.6-1.599 0-3.197-.8-4.796-1.6-1.598-1.6-2.397-2.4-2.397-4 0-.8 0-1.6.799-3.2.8-1.6.8-2.4 1.598-4l17.583-44.8c.8-1.6.8-3.2 1.599-4.8.799-1.6 1.598-3.2 2.397-4 .8-.8 1.599-2.4 3.197-3.2 1.599-.8 3.197-.8 4.796-.8 1.598 0 3.196 0 4.795.8 1.598.8 2.398 1.6 3.197 3.2.799.8 1.598 2.4 2.397 4 .8 1.6 1.599 3.2 2.398 5.6l17.583 44c1.598 3.2 2.398 5.6 2.398 7.2-.8.8-1.599 2.4-2.398 4zM116.711 72c-8.791-3.2-15.185-7.2-20.78-12-5.594 5.6-12.787 9.6-21.579 12l-2.397-4c8.791-2.4 15.984-5.6 21.579-11.2C87.939 51.2 83.144 44 81.545 36h-7.992v-3.2h21.58c-1.6-2.4-3.198-5.6-4.796-8l2.397-.8c1.599 2.4 3.997 5.6 5.595 8.8h19.98v4h-7.992c-2.397 8-6.393 15.2-11.189 20 5.595 4.8 11.988 8.8 20.78 11.2l-3.197 4z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M115.625 127.937H.063V12.375h57.781v12.374H12.438v90.813h90.813V70.156h12.374z"/><path d="M116.426 2.821l8.753 8.753-56.734 56.734-8.753-8.745z"/><path d="M127.893 37.982h-12.375V12.375H88.706V0h39.187z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M1.585 12.087c0 6.616 3.974 11.98 8.877 11.98 4.902 0 8.877-5.364 8.877-11.98 0-6.616-3.975-11.98-8.877-11.98-4.903 0-8.877 5.364-8.877 11.98zM125.86.107H35.613c-1.268 0-2.114 1.426-2.114 2.852v18.255c0 1.712 1.057 2.853 2.114 2.853h90.247c1.268 0 2.114-1.426 2.114-2.853V2.96c0-1.711-1.057-2.852-2.114-2.852zM.106 62.86c0 6.615 3.974 11.979 8.876 11.979 4.903 0 8.877-5.364 8.877-11.98 0-6.616-3.974-11.98-8.877-11.98-4.902 0-8.876 5.364-8.876 11.98zM124.17 50.88H33.921c-1.268 0-2.114 1.425-2.114 2.851v18.256c0 1.711 1.057 2.852 2.114 2.852h90.247c1.268 0 2.114-1.426 2.114-2.852V53.73c0-1.426-.846-2.852-2.114-2.852zM.106 115.913c0 6.616 3.974 11.98 8.876 11.98 4.903 0 8.877-5.364 8.877-11.98 0-6.616-3.974-11.98-8.877-11.98-4.902 0-8.876 5.364-8.876 11.98zm124.064-11.98H33.921c-1.268 0-2.114 1.426-2.114 2.853v18.255c0 1.711 1.057 2.852 2.114 2.852h90.247c1.268 0 2.114-1.426 2.114-2.852v-18.255c0-1.427-.846-2.853-2.114-2.853z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M119.88 49.674h-7.987V39.52C111.893 17.738 90.45.08 63.996.08 37.543.08 16.1 17.738 16.1 39.52v10.154H8.113c-4.408 0-7.987 2.94-7.987 6.577v65.13c0 3.637 3.57 6.577 7.987 6.577H119.88c4.407 0 7.987-2.94 7.987-6.577v-65.13c-.008-3.636-3.58-6.577-7.987-6.577zm-23.953 0H32.065V39.52c0-14.524 14.301-26.295 31.931-26.295 17.63 0 31.932 11.777 31.932 26.295v10.153z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1566035943711" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4805" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M208.736 566.336H64.384v59.328h144.352v-59.328z m0-336.096H165.44V74.592c0-7.968 4.896-14.848 10.464-14.848h502.016V0.448H175.936c-38.72 1.248-69.248 34.368-68.192 74.144v155.648H64.384V289.6h144.352V230.24z m0 168.096H64.384v59.328h144.352v-59.328z m714.656 76.576h-57.76v474.496c0 7.936-4.896 14.848-10.464 14.848H175.936c-5.568 0-10.464-6.912-10.464-14.848v-155.68h43.296v-59.296H64.384v59.296h43.328v155.68c-1.024 39.776 29.472 72.896 68.192 74.144h679.232c38.72-1.184 69.248-34.368 68.256-74.144V474.912z m14.944-290.336l-83.072-85.312a71.264 71.264 0 0 0-52.544-21.728 71.52 71.52 0 0 0-51.616 23.872L386.528 507.264a30.496 30.496 0 0 0-6.176 10.72L308.16 740.512a30.016 30.016 0 0 0 6.976 30.24c7.712 7.968 19.2 10.752 29.568 7.2l216.544-74.112a28.736 28.736 0 0 0 12.128-7.936L940.448 287.456a75.552 75.552 0 0 0-2.112-102.88z m-557.12 518.272l39.104-120.64 78.336 80.416-117.44 40.224z m170.048-70.016l-103.552-106.016 200.16-222.4 103.52 106.304-200.128 222.112zM897.952 247.072l-0.256 0.224-107.136 119.168-103.52-106.528 106.432-118.624a14.144 14.144 0 0 1 10.304-4.736 13.44 13.44 0 0 1 10.464 4.288l83.264 85.696c5.472 5.6 5.664 14.72 0.448 20.512z" p-id="4806"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1566036016814" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5261" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M896 128h-85.333333a42.666667 42.666667 0 0 0 0 85.333333h42.666666v640H170.666667V213.333333h42.666666a42.666667 42.666667 0 0 0 0-85.333333H128a42.666667 42.666667 0 0 0-42.666667 42.666667v725.333333a42.666667 42.666667 0 0 0 42.666667 42.666667h768a42.666667 42.666667 0 0 0 42.666667-42.666667V170.666667a42.666667 42.666667 0 0 0-42.666667-42.666667z" p-id="5262"></path><path d="M341.333333 298.666667a42.666667 42.666667 0 0 0 42.666667-42.666667V128a42.666667 42.666667 0 0 0-85.333333 0v128a42.666667 42.666667 0 0 0 42.666666 42.666667zM512 298.666667a42.666667 42.666667 0 0 0 42.666667-42.666667V128a42.666667 42.666667 0 0 0-85.333334 0v128a42.666667 42.666667 0 0 0 42.666667 42.666667zM682.666667 298.666667a42.666667 42.666667 0 0 0 42.666666-42.666667V128a42.666667 42.666667 0 0 0-85.333333 0v128a42.666667 42.666667 0 0 0 42.666667 42.666667zM341.333333 768a42.666667 42.666667 0 0 0 42.666667-42.666667 128 128 0 0 1 256 0 42.666667 42.666667 0 0 0 85.333333 0 213.333333 213.333333 0 0 0-107.52-184.32A128 128 0 0 0 640 469.333333a128 128 0 0 0-256 0 128 128 0 0 0 22.186667 71.68A213.333333 213.333333 0 0 0 298.666667 725.333333a42.666667 42.666667 0 0 0 42.666666 42.666667z m128-298.666667a42.666667 42.666667 0 1 1 42.666667 42.666667 42.666667 42.666667 0 0 1-42.666667-42.666667z" p-id="5263"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M0 20.967v59.59c0 11.59 8.537 20.966 19.075 20.966h28.613l1 26.477L76.8 101.523h32.125c10.538 0 19.075-9.377 19.075-20.966v-59.59C128 9.377 119.463 0 108.925 0h-89.85C8.538 0 0 9.377 0 20.967zm82.325 33.1c0-5.524 4.013-9.935 9.037-9.935 5.026 0 9.038 4.41 9.038 9.934 0 5.524-4.025 9.934-9.038 9.934-5.024 0-9.037-4.41-9.037-9.934zm-27.613 0c0-5.524 4.013-9.935 9.038-9.935s9.037 4.41 9.037 9.934c0 5.524-4.025 9.934-9.037 9.934-5.025 0-9.038-4.41-9.038-9.934zm-27.1 0c0-5.524 4.013-9.935 9.038-9.935s9.038 4.41 9.038 9.934c0 5.524-4.026 9.934-9.05 9.934-5.013 0-9.025-4.41-9.025-9.934z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M54.122 127.892v-28.68H7.513V87.274h46.609v-12.4H7.513v-12.86h38.003L.099 0h22.6l32.556 45.07c3.617 5.144 6.44 9.611 8.487 13.385 1.788-3.05 4.89-7.779 9.301-14.186L103.93 0h24.01L82.385 62.013h38.34v12.862h-46.41v12.4h46.41v11.937h-46.41v28.68H54.123z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1543827393750" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4695" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css">@font-face { font-family: rbicon; src: url("chrome-extension://dipiagiiohfljcicegpgffpbnjmgjcnf/fonts/rbicon.woff2") format("woff2"); font-weight: normal; font-style: normal; }
|
| | | </style></defs><path d="M64 64V640H896V64H64zM0 0h960v704H0V0z" p-id="4696"></path><path d="M192 896H768v64H192zM448 640H512v256h-64z" p-id="4697"></path><path d="M479.232 561.604267l309.9904-348.330667-47.803733-42.5472-259.566934 291.669333L303.957333 240.008533 163.208533 438.6048l52.224 37.009067 91.6224-129.28z" p-id="4698"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M.002 9.2c0 5.044 3.58 9.133 7.998 9.133 4.417 0 7.997-4.089 7.997-9.133 0-5.043-3.58-9.132-7.997-9.132S.002 4.157.002 9.2zM31.997.066h95.981V18.33H31.997V.066zm0 45.669c0 5.044 3.58 9.132 7.998 9.132 4.417 0 7.997-4.088 7.997-9.132 0-3.263-1.524-6.278-3.998-7.91-2.475-1.63-5.524-1.63-7.998 0-2.475 1.632-4 4.647-4 7.91zM63.992 36.6h63.986v18.265H63.992V36.6zm-31.995 82.2c0 5.043 3.58 9.132 7.998 9.132 4.417 0 7.997-4.089 7.997-9.132 0-5.044-3.58-9.133-7.997-9.133s-7.998 4.089-7.998 9.133zm31.995-9.131h63.986v18.265H63.992V109.67zm0-27.404c0 5.044 3.58 9.133 7.998 9.133 4.417 0 7.997-4.089 7.997-9.133 0-3.263-1.524-6.277-3.998-7.909-2.475-1.631-5.524-1.631-7.998 0-2.475 1.632-4 4.646-4 7.91zm31.995-9.13h31.991V91.4H95.987V73.135z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1568899557259" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="535" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M356.246145 681.56286c-68.156286-41.949414-107.246583-103.84102-107.246583-169.805384 0-65.966411 39.090297-127.860063 107.246583-169.809477 12.046361-7.414877 15.800871-23.190165 8.385994-35.236526-7.413853-12.046361-23.191188-15.801894-35.236526-8.387018-39.640836 24.399713-72.539106 56.044434-95.137801 91.515297-23.86657 37.461193-36.481889 79.620385-36.481889 121.917724 0 42.297338 12.615319 84.454484 36.481889 121.914654 22.598694 35.469839 55.496965 67.11456 95.137801 91.51325 4.185322 2.576685 8.821923 3.804652 13.400195 3.804652 8.598842 0 16.998139-4.329609 21.836331-12.190647C372.047016 704.752002 368.291482 688.976714 356.246145 681.56286zM263.943926 754.580874c-92.603071-61.111846-145.713686-149.623739-145.713686-242.840794 0-93.195565 53.094242-181.682899 145.667637-242.774279 11.805884-7.79043 15.061021-23.677259 7.269567-35.483142-7.79043-11.805884-23.677259-15.062044-35.483142-7.269567C128.487861 296.954249 67.006602 401.024489 67.006602 511.74008c0 110.73708 61.496609 214.830857 168.721703 285.593504 4.343935 2.867304 9.240455 4.238534 14.08274 4.238534 8.317433 0 16.476253-4.046153 21.400403-11.507078C279.003923 778.258133 275.748786 762.372328 263.943926 754.580874zM788.660552 226.213092c-11.80486-7.791453-27.692712-4.536316-35.483142 7.269567-7.79043 11.805884-4.536316 27.692712 7.269567 35.483142 92.575442 61.092403 145.670707 149.579737 145.670707 242.774279 0 93.216032-53.111638 181.727924-145.715733 242.840794-11.805884 7.79043-15.059997 23.678282-7.269567 35.484166 4.925173 7.461949 13.081946 11.507078 21.400403 11.507078 4.841262 0 9.739828-1.37123 14.083763-4.238534 107.22714-70.761624 168.724773-174.857447 168.724773-285.593504C957.341323 401.025513 895.860063 296.955272 788.660552 226.213092zM790.090111 633.67213c23.865547-37.459147 36.480866-79.617315 36.480866-121.914654 0-42.298362-12.615319-84.45653-36.480866-121.917724-22.598694-35.470863-55.496965-67.115584-95.139847-91.515297-12.047384-7.413853-27.821649-3.659343-35.236526 8.387018-7.414877 12.045337-3.659343 27.821649 8.385994 35.236526 68.156286 41.949414 107.247606 103.842043 107.247606 169.809477 0 65.964364-39.090297 127.85597-107.247606 169.804361-12.045337 7.414877-15.800871 23.190165-8.385994 35.237549 4.838192 7.861038 13.236466 12.190647 21.835308 12.190647 4.579295 0 9.215896-1.227967 13.400195-3.804652C734.591099 700.786691 767.490394 669.142993 790.090111 633.67213zM567.129086 518.274914c24.12342-17.150612 39.887452-45.305859 39.887452-77.07133 0-52.128241-42.452881-94.538143-94.634334-94.538143-52.18043 0-94.633311 42.408879-94.633311 94.538143 0 31.695886 15.696494 59.797921 39.730886 76.958766-49.875944 21.128203-84.917018 70.234621-84.917018 127.301338 0 2.366907 0.061398 4.762467 0.182149 7.119141l1.249457 24.296359 276.373515 0 1.238201-24.308639c0.119727-2.358721 0.181125-4.750187 0.181125-7.106862C651.786185 588.497255 616.865861 539.465538 567.129086 518.274914zM512.381182 397.889079c23.937179 0 43.411719 19.430538 43.411719 43.314505 0 23.882943-19.47454 43.313481-43.411719 43.313481-23.936155 0-43.409672-19.430538-43.409672-43.313481C468.971509 417.320641 488.445026 397.889079 512.381182 397.889079zM426.08884 625.656573c9.119705-38.542828 44.254923-67.337641 86.085634-67.337641s76.966952 28.794813 86.085634 67.337641L426.08884 625.656573z" p-id="536"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M108.8 44.322H89.6v-5.36c0-9.04-3.308-24.163-25.6-24.163-23.145 0-25.6 16.881-25.6 24.162v5.361H19.2v-5.36C19.2 15.281 36.798 0 64 0c27.202 0 44.8 15.281 44.8 38.961v5.361zm-32 39.356c0-5.44-5.763-9.832-12.8-9.832-7.037 0-12.8 4.392-12.8 9.832 0 3.682 2.567 6.808 6.407 8.477v11.205c0 2.718 2.875 4.962 6.4 4.962 3.524 0 6.4-2.244 6.4-4.962V92.155c3.833-1.669 6.393-4.795 6.393-8.477zM128 64v49.201c0 8.158-8.645 14.799-19.2 14.799H19.2C8.651 128 0 121.359 0 113.201V64c0-8.153 8.645-14.799 19.2-14.799h89.6c10.555 0 19.2 6.646 19.2 14.799z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="128" height="128"><path d="M869.073 277.307H657.111V65.344l211.962 211.963zm-238.232 26.27V65.344l-476.498-.054v416.957h714.73v-178.67H630.841zm-335.836 360.57c-5.07-3.064-10.944-5.133-17.61-6.201-6.67-1.064-13.603-1.6-20.81-1.6h-48.821v85.641h48.822c7.206 0 14.14-.532 20.81-1.6 6.665-1.065 12.54-3.133 17.609-6.202 5.064-3.063 9.134-7.406 12.208-13.007 3.065-5.602 4.6-12.937 4.6-22.011 0-9.07-1.535-16.408-4.6-22.01-3.074-5.603-7.144-9.94-12.208-13.01zM35.82 541.805v416.904h952.358V541.805H35.821zm331.421 191.179c-3.6 11.071-9.343 20.879-17.209 29.413-7.874 8.542-18.078 15.408-30.617 20.61-12.544 5.206-27.747 7.807-45.621 7.807h-66.036v102.45h-62.831V607.517h128.867c17.874 0 33.077 2.6 45.62 7.802 12.541 5.207 22.745 12.076 30.618 20.615 7.866 8.538 13.604 18.277 17.21 29.212 3.6 10.943 5.401 22.278 5.401 34.018 0 11.477-1.8 22.752-5.402 33.819zM644.9 806.417c-5.343 17.61-13.408 32.818-24.212 45.627-10.807 12.803-24.283 22.879-40.423 30.213-16.146 7.343-35.155 11.007-57.03 11.007h-123.26V607.518h123.26c18.41 0 35.552 2.941 51.428 8.808 15.873 5.869 29.618 14.671 41.22 26.412 11.608 11.744 20.674 26.411 27.217 44.02 6.535 17.61 9.803 38.288 9.803 62.035 0 20.81-2.67 40.02-8.003 57.624zm245.362-146.07h-138.07v66.03h119.66v48.829h-119.66v118.058h-62.83V607.518h200.9v52.829h-.001zm-318.2 25.611c-6.402-8.266-14.877-14.604-25.412-19.01-10.544-4.402-23.551-6.602-39.019-6.602h-44.825v180.088h56.029c9.07 0 17.872-1.463 26.415-4.401 8.535-2.932 16.14-7.802 22.812-14.609 6.665-6.8 12.007-15.667 16.007-26.61 4.003-10.94 6.003-24.275 6.003-40.021 0-14.408-1.4-27.416-4.202-39.019-2.8-11.607-7.406-21.542-13.808-29.816zm0 0"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M104.185 95.254c8.161 7.574 13.145 17.441 13.145 28.28 0 1.508-.098 2.998-.285 4.466h-10.784c.238-1.465.403-2.948.403-4.465 0-8.983-4.36-17.115-11.419-23.216C86 104.66 75.355 107.162 64 107.162c-11.344 0-21.98-2.495-31.22-6.83-7.064 6.099-11.444 14.218-11.444 23.203 0 1.517.165 3 .403 4.465H10.955a35.444 35.444 0 0 1-.285-4.465c0-10.838 4.974-20.713 13.127-28.291C9.294 85.42.003 70.417.003 53.58.003 23.99 28.656.001 64 .001s63.997 23.988 63.997 53.58c0 16.842-9.299 31.85-23.812 41.673zM64 36.867c-29.454 0-53.33-10.077-53.33 15.342 0 25.418 23.876 46.023 53.33 46.023 29.454 0 53.33-20.605 53.33-46.023 0-25.419-23.876-15.342-53.33-15.342zm24.888 25.644c-3.927 0-7.111-2.665-7.111-5.953 0-3.288 3.184-5.954 7.11-5.954 3.928 0 7.111 2.666 7.111 5.954s-3.183 5.953-7.11 5.953zm-3.556 16.372c0 4.11-9.55 7.442-21.332 7.442-11.781 0-21.332-3.332-21.332-7.442 0-1.06.656-2.064 1.8-2.976 3.295 2.626 10.79 4.465 19.532 4.465 8.743 0 16.237-1.84 19.531-4.465 1.145.912 1.801 1.916 1.801 2.976zm-46.22-16.372c-3.927 0-7.11-2.665-7.11-5.953 0-3.288 3.183-5.954 7.11-5.954 3.927 0 7.111 2.666 7.111 5.954s-3.184 5.953-7.11 5.953z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M95.648 118.762c0 5.035-3.563 9.121-7.979 9.121H7.98c-4.416 0-7.979-4.086-7.979-9.121C0 100.519 15.408 83.47 31.152 76.75c-9.099-6.43-15.216-17.863-15.216-30.987v-9.128c0-20.16 14.293-36.518 31.893-36.518s31.894 16.358 31.894 36.518v9.122c0 13.137-6.123 24.556-15.216 30.993 15.738 6.726 31.141 23.769 31.141 42.012z"/><path d="M106.032 118.252h15.867c3.376 0 6.101-3.125 6.101-6.972 0-13.957-11.787-26.984-23.819-32.123 6.955-4.919 11.638-13.66 11.638-23.704v-6.985c0-15.416-10.928-27.926-24.39-27.926-1.674 0-3.306.193-4.89.561 1.936 4.713 3.018 9.974 3.018 15.526v9.121c0 13.137-3.056 23.111-11.066 30.993 14.842 4.41 27.312 23.42 27.541 41.509z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1567417214476" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2266" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M761.503029 2.90619 242.121921 2.90619c-32.405037 0-58.932204 26.060539-58.932204 58.527998l0 902.302287c0 32.156374 26.217105 58.216913 58.932204 58.216913l519.381108 0c32.344662 0 58.591443-26.060539 58.591443-58.216913L820.094472 61.123103C820.094472 28.966729 793.847691 2.90619 761.503029 2.90619M452.878996 61.123103l98.147344 0c6.780427 0 12.31549 5.536087 12.31549 12.253068 0 6.748704-5.535063 12.253068-12.31549 12.253068l-98.147344 0c-6.779404 0-12.345166-5.504364-12.345166-12.253068C440.532807 66.659189 446.099592 61.123103 452.878996 61.123103M501.641583 980.593398c-29.636994 0-53.987588-23.946388-53.987588-53.677527 0-29.356608 24.039509-53.614082 53.987588-53.614082 29.91738 0 53.987588 23.883967 53.987588 53.614082C555.629171 956.647009 531.559986 980.593398 501.641583 980.593398M766.35657 803.142893c0 16.23373-13.186324 29.107945-29.233811 29.107945l-470.618521 0c-16.35755 0-29.325909-13.186324-29.325909-29.107945L237.178329 163.500794c0-16.232706 13.279445-29.138644 29.325909-29.138644l470.246037 0c16.420995 0 29.357632 13.1853 29.357632 29.138644l0 639.642099L766.35657 803.142893zM766.35657 803.142893" p-id="2267"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1566035724641" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3998" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M136.4 434.3h77.7c21.5 0 38.9-17.4 38.9-38.9s-17.4-38.9-38.9-38.9h-77.7c-21.5 0-38.9 17.4-38.9 38.9s17.4 38.9 38.9 38.9zM252.9 628.6c0-21.5-17.4-38.9-38.9-38.9h-77.7c-21.5 0-38.9 17.4-38.9 38.9s17.4 38.9 38.9 38.9H214c21.5-0.1 38.9-17.5 38.9-38.9z" p-id="3999"></path><path d="M874.7 97.5H227c-28.6 0-51.8 23.2-51.8 51.8v194.3h38.9c28.6 0 51.8 23.2 51.8 51.8 0 28.6-23.2 51.8-51.8 51.8h-38.9v129.5h38.9c28.6 0 51.8 23.2 51.8 51.8 0 28.6-23.2 51.8-51.8 51.8h-38.9v194.3c0 28.6 23.2 51.8 51.8 51.8h647.7c28.6 0 51.8-23.2 51.8-51.8V149.3c0-28.6-23.2-51.8-51.8-51.8z m-311.3 723c-15.6 0-146.7-71.6-146.7-91 0-19.4 102-368.6 102-368.6l-83.6-104s-12.3-23.1 24.6-23.1h208.9c36.9 0 18.4 23.1 18.4 23.1l-79 104s102 351.3 102 368.6c0.1 17.3-131 91-146.6 91z m169.2-253.6l-27.9 40.2-74.5-240 103.4 171.7c4.6 7.9 4.2 20.6-1 28.1z" p-id="4000"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M18.448 57.545l-.244-.744-.198-.968-.132-.53v-2.181l.236-.859.24-.908.317-.953.428-1.06.561-1.103.794-1.104v-.773l.077-.724.123-.984.34-1.106.313-1.194.25-.548.289-.511.371-.569.405-.423v-2.73l.234-1.407.236-1.633.42-1.955.577-2.035.43-1.118.426-1.217.468-1.135.559-1.216.57-1.332.655-1.247.737-1.331.929-1.33.43-.762.457-.624.995-1.406 1.025-1.403 1.163-1.444 1.246-1.405 1.352-1.384 1.41-1.423 1.708-1.536 1.083-.934 1.322-1.008 1.34-.89 1.448-.855 1.392-.76 1.57-.63 1.667-.775 1.657-.532 1.653-.552 1.787-.548 1.785-.417 1.876-.347L59.128.68l1.879-.245 1.876-.252 2.002-.106h5.912l1.97.243 1.981.231 2.019.207 1.874.441 1.979.413 1.857.475 2.035.53 1.862.646 1.782.738 1.904.78 1.736.853 1.689.95 1.655 1.044 1.425.971.662.548.693.401 1.323 1.1 1.115 1.064 1.112 1.1 1.083 1.214.894 1.178 1.064 1.217.74 1.306.752 1.162.798 1.352.661 1.175 1.113 2.489.546 1.286.428 1.192.428 1.294.384 1.217.267 1.047.347 1.231.607 2.198.388 1.924.253 1.861.217 1.497.342 2.28.077.362.274.41.737 1.18.473.8.42.832.534.892.472 1.07.307 1.093.334 1.2.252 1.232.115.605.106.746v.648l-.106.643v.8l-.192.774-.35 1.5-.403.76-.299.852v.213l.142.264.4.623 1.746 2.53 1.377 1.9.66 1.267.889 1.389.774 1.52.893 1.627.894 1.828 1.006 2.069.567 1.268.518 1.239.447 1.307.44 1.175.336 1.235.342 1.16.432 2.261.343 2.31.235 2.05v2.891l-.158 1.025-.226 1.768-.308 1.59-.48 1.44-.18.588-.336.707-.28.493-.375.607-.33.383-.42.494-.375.4-.401.34-.48.207-.432.207-.355.114h-.543l-.346-.114-.66-.32-.302-.212-.317-.223-.347-.304-.35-.342-.579-.63-.684-.89-.539-.917-.538-.734-.526-.855-.741-1.517-.833-1.579-.098-.055h-.138l-.338.247-.196.415-.326.516-.567 1.533-.856 2.182-1.096 2.626-.824 1.308-.864 1.366-1.027 1.536-1.09 1.503-.557.68-.676.743-1.555 1.497.136.135.21.214.777.446 3.235 1.524 1.41.779 1.347.756 1.332.953 1.187.982.574.443.432.511.445.593.367.643.198.533.242.64.105.554.115.647-.115.433v.44l-.105.454-.242.415-.092.325-.22.394-.587.784-.543.627-.42.47-.35.348-.893.638-1.01.556-1.077.532-1.155.511-1.287.495-.693.207-.608.167-1.496.342-1.545.325-1.552.323-1.689.27-1.74.072-1.785.21h-5.539l-1.998-.114-1.86-.168-2.005-.27-1.99-.209-2.095-.286-2.03-.495-1.981-.374-1.968-.552-2.019-.707-1.98-.585-1.044-.342-.927-.323-.586-.223-.582-.12h-1.647l-1.904-.131-.962-.096-1.24-.135-.795.705-1.085.665-1.471.701-1.628.875-.99.475-1.033.376-2.281.914-1.24.305-1.3.343-1.803.344-1.13.086-1.193.1-1.246.135-1.45.053h-5.926l-3.346-.053-3.25-.321-1.644-.23-1.589-.23-1.546-.227-1.547-.305-1.442-.456-1.434-.325-1.294-.51-1.223-.474-1.142-.533-.99-.583-.984-.71-.336-.343-.44-.415-.334-.362-.3-.417-.278-.415-.215-.42-.311-.89-.109-.46-.138-.51v-.473l.138-.533v-.53l.109-.53v-1.069l.052-.564.259-.647.215-.646.39-.779.286-.3.236-.348.615-.738.49-.38.464-.266.428-.338.676-.21.543-.324.676-.341.77-.227.775-.231.897-.192.85-.11 1.008-.13 1.093-.081.284-.092h.063l.137-.115v-.13l-.2-.266-.58-.27-1.45-1.231-.975-.761-1.127-.967-1.136-1.082-1.181-1.382-1.36-1.558-.508-.843-.672-.87-.58-1.007-.522-1.1-.704-1.047-.459-1.194-.547-1.192-.546-1.33-.397-1.273-.378-1.575-.112-.057h-.115l-.059-.113h-.14l-.23.113-.114.057-.158.264-.057.321-.119.286-.206.477-.664 1.157-.345.701-.546.612-.58.736-.641.816-.677.724-.795.701-.734.658-.814.524-.89.546-.855.325-1.008.247-.99.095h-.233l-.228-.095-.18-.384-.29-.188-.38-.912-.237-.493-.255-.707-.21-.734-.113-.724-.313-1.648-.12-.972v-3.185l.12-2.379.196-1.214.23-1.252.21-1.347.374-1.254.42-1.443.431-1.407.578-1.448.545-1.38.754-1.4.699-1.52.855-1.425 1.006-1.538 1.023-1.382 1.069-1.538.891-1.071 1.142-1.227 1.202-1.237.56-.59.678-.662.985-.836 1.012-.853 1.647-1.446 1.242-.889z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M124.884 109.812L94.256 79.166c-.357-.357-.757-.629-1.129-.914a50.366 50.366 0 0 0 8.186-27.59C101.327 22.689 78.656 0 50.67 0 22.685 0 0 22.688 0 50.663c0 27.989 22.685 50.663 50.656 50.663 10.186 0 19.643-3.03 27.6-8.201.286.385.557.771.9 1.114l30.628 30.632a10.633 10.633 0 0 0 7.543 3.129c2.728 0 5.457-1.043 7.543-3.115 4.171-4.157 4.171-10.915.014-15.073M50.671 85.338C31.557 85.338 16 69.78 16 50.663c0-19.102 15.557-34.661 34.67-34.661 19.115 0 34.657 15.559 34.657 34.675 0 19.102-15.557 34.661-34.656 34.661"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1547360688278" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6717" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M890 120H134a70 70 0 0 0-70 70v500a70 70 0 0 0 70 70h756a70 70 0 0 0 70-70V190a70 70 0 0 0-70-70z m-10 520a40 40 0 0 1-40 40H712V448a40 40 0 0 0-80 0v232h-80V368a40 40 0 0 0-80 0v312h-80V512a40 40 0 0 0-80 0v168H184a40 40 0 0 1-40-40V240a40 40 0 0 1 40-40h656a40 40 0 0 1 40 40zM696 824H328a40 40 0 0 0 0 80h368a40 40 0 0 0 0-80z" fill="#bfbfbf" p-id="6718"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M42.913 101.36c1.642 0 3.198.332 4.667.996a12.28 12.28 0 0 1 3.89 2.772c1.123 1.184 1.987 2.582 2.592 4.193.605 1.612.908 3.318.908 5.118 0 1.8-.303 3.507-.908 5.118-.605 1.611-1.469 3.01-2.593 4.194a13.3 13.3 0 0 1-3.889 2.843 10.582 10.582 0 0 1-4.667 1.066c-1.729 0-3.306-.355-4.732-1.066a13.604 13.604 0 0 1-3.825-2.843c-1.123-1.185-1.988-2.583-2.593-4.194a14.437 14.437 0 0 1-.907-5.118c0-1.8.302-3.506.907-5.118.605-1.61 1.47-3.009 2.593-4.193a12.515 12.515 0 0 1 3.825-2.772c1.426-.664 3.003-.996 4.732-.996zm53.932.285c1.643 0 3.22.331 4.733.995a11.386 11.386 0 0 1 3.889 2.772c1.08 1.185 1.945 2.583 2.593 4.194.648 1.61.972 3.317.972 5.118 0 1.8-.324 3.506-.972 5.117-.648 1.611-1.513 3.01-2.593 4.194a12.253 12.253 0 0 1-3.89 2.843 11 11 0 0 1-4.732 1.066 10.58 10.58 0 0 1-4.667-1.066 12.478 12.478 0 0 1-3.824-2.843c-1.08-1.185-1.945-2.583-2.593-4.194a13.581 13.581 0 0 1-.973-5.117c0-1.801.325-3.507.973-5.118.648-1.611 1.512-3.01 2.593-4.194a11.559 11.559 0 0 1 3.824-2.772 11.212 11.212 0 0 1 4.667-.995zm21.781-80.747c2.42 0 4.3.355 5.64 1.066 1.34.71 2.29 1.587 2.852 2.63a6.427 6.427 0 0 1 .778 3.34c-.044 1.185-.195 2.204-.454 3.057-.26.853-.8 2.606-1.62 5.26a589.268 589.268 0 0 1-2.788 8.743 1236.373 1236.373 0 0 0-3.047 9.453c-.994 3.128-1.75 5.592-2.269 7.393-1.123 3.79-2.55 6.42-4.278 7.89-1.728 1.469-3.846 2.203-6.352 2.203H39.023l1.945 12.795h65.342c4.148 0 6.223 1.943 6.223 5.828 0 1.896-.41 3.53-1.232 4.905-.821 1.374-2.442 2.061-4.862 2.061H38.505c-1.729 0-3.176-.426-4.343-1.28-1.167-.852-2.14-1.966-2.917-3.34a21.277 21.277 0 0 1-1.88-4.478 44.128 44.128 0 0 1-1.102-4.55c-.087-.568-.324-1.942-.713-4.122-.39-2.18-.865-4.904-1.426-8.174l-1.88-10.947c-.692-4.027-1.383-8.079-2.075-12.154-1.642-9.572-3.5-20.234-5.574-31.986H6.87c-1.296 0-2.377-.356-3.24-1.067a9.024 9.024 0 0 1-2.14-2.558 10.416 10.416 0 0 1-1.167-3.2C.108 8.53 0 7.488 0 6.54c0-1.896.583-3.46 1.75-4.69C2.917.615 4.494 0 6.482 0h13.095c1.728 0 3.111.284 4.148.853 1.037.569 1.858 1.28 2.463 2.132a8.548 8.548 0 0 1 1.297 2.701c.26.948.475 1.754.648 2.417.173.758.346 1.825.519 3.199.173 1.374.345 2.772.518 4.193.26 1.706.519 3.507.778 5.403h88.678z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M0 54.857h54.796v18.286H36.531V128H18.265V73.143H0V54.857zm127.857-36.571H91.935V128H72.456V18.286H36.534V0h91.326l-.003 18.286z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M31.652 93.206h33.401c1.44 2.418 3.077 4.663 4.93 6.692h-38.33v-6.692zm0-10.586h28.914a44.8 44.8 0 0 1-1.264-6.688h-27.65v6.688zm0-17.27H59.39c.288-2.286.714-4.532 1.34-6.687H31.65v6.687h.003zm53.913 44.84v5.85c0 2.798-2.095 5.075-4.667 5.075h-70.07c-2.576 0-4.663-2.277-4.663-5.075V31.26l23.22-20.96v22.25H17.16v6.688h18.39V6.688h45.348c2.576 0 4.667 2.277 4.667 5.066v20.009c1.987-.675 4.053-1.128 6.17-1.445v-18.56C91.738 5.28 86.874 0 80.902 0H31.15L0 28.118v87.917c0 6.48 4.859 11.759 10.832 11.759h70.07c5.974 0 10.837-5.27 10.837-11.759v-4.41c-2.117-.312-4.183-.765-6.17-1.435h-.004zM23.279 58.667h-7.96v6.688h7.96v-6.688zm-7.956 41.23h7.96v-6.691h-7.96v6.692zm7.956-23.96h-7.96v6.687h7.96v-6.688zm89.718-15.042l-4.896-4.07-12.447 17.613-11.19-9.305-3.762 5.311 16.091 13.38 16.204-22.929zM128 70.978c0-18.632-13.97-33.782-31.147-33.782-17.168 0-31.135 15.155-31.135 33.782 0 18.628 13.97 33.783 31.135 33.783 17.172 0 31.143-15.15 31.143-33.783H128zm-6.17 0c0 14.933-11.203 27.1-24.981 27.1-13.77 0-24.987-12.158-24.987-27.1 0-14.941 11.195-27.099 24.987-27.099 13.778 0 24.982 12.158 24.982 27.1z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M70.66 4.328l14.01 29.693c1.088 2.29 3.177 3.882 5.603 4.25l31.347 4.76c6.087.926 8.528 8.756 4.117 13.247L103.05 79.395c-1.75 1.78-2.544 4.352-2.132 6.867l5.352 32.641c1.043 6.337-5.33 11.182-10.778 8.19l-28.039-15.409a7.13 7.13 0 0 0-6.91 0l-28.039 15.41c-5.448 2.99-11.821-1.854-10.777-8.19l5.352-32.642c.415-2.515-.387-5.088-2.136-6.867L2.264 56.278C-2.146 51.787.286 43.957 6.38 43.031l31.343-4.76c2.419-.368 4.51-1.96 5.595-4.25L57.334 4.328c2.728-5.77 10.605-5.77 13.325 0z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1566036776944" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6463" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M64 223.995345h168.001164v47.997673c0 26.428509 18.878836 47.997673 41.984 47.997673h140.036654c23.095855 0 41.984-21.569164 41.984-47.997673v-47.997673h504.003491a32.004655 32.004655 0 0 0 0-64.009309H455.996509V111.988364c0-26.428509-18.878836-47.997673-41.984-47.997673H273.985164c-23.095855 0-41.984 21.569164-41.984 47.997673v47.997672H64a32.004655 32.004655 0 0 0 0 64.009309zM288.004655 128h111.997672V256H288.004655V128zM960 479.995345H791.998836v-47.997672c0-26.372655-18.878836-47.997673-41.984-47.997673H609.978182c-23.095855 0-41.984 21.634327-41.984 47.997673v47.997672H64a32.004655 32.004655 0 0 0 0 64.00931h504.003491v47.997672c0 26.363345 18.878836 47.997673 41.984 47.997673h140.036654c23.095855 0 41.984-21.634327 41.984-47.997673v-47.997672h168.001164a32.004655 32.004655 0 1 0-0.009309-64.00931zM735.995345 576H623.997673v-128h111.997672v128zM960 800.293236v-0.288581H455.996509v-47.997673c0-26.363345-18.878836-47.997673-41.984-47.997673H274.050327c-23.105164 0-41.984 21.634327-41.984 47.997673v47.997673H64v0.288581a32.004655 32.004655 0 0 0 0 64.009309c0.986764 0 1.917673-0.195491 2.885818-0.288581h165.115346v47.997672c0 26.363345 18.878836 47.997673 41.984 47.997673h140.036654c23.095855 0 41.984-21.634327 41.984-47.997673v-47.997672h501.108364c0.968145 0.093091 1.899055 0.288582 2.895127 0.288581a32.004655 32.004655 0 1 0-0.009309-64.009309zM400.002327 896H288.004655V768h111.997672v128z" fill="" p-id="6464"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1543827724451" class="icon" style="" viewBox="0 0 1084 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10233" xmlns:xlink="http://www.w3.org/1999/xlink" width="211.71875" height="200"><defs><style type="text/css">@font-face { font-family: rbicon; src: url("chrome-extension://dipiagiiohfljcicegpgffpbnjmgjcnf/fonts/rbicon.woff2") format("woff2"); font-weight: normal; font-style: normal; }
|
| | | </style></defs><path d="M1080.09609 434.500756c-4.216302-23.731757-26.9241-47.945376-50.595623-53.185637l-17.648235-4.095836a175.940257 175.940257 0 0 1-101.612877-80.832531 177.807476 177.807476 0 0 1-18.732427-129.801867l5.541425-16.684509c7.10748-23.129428-2.108151-54.992624-20.599646-70.833873 0 0-16.624276-14.094495-63.244529-41.199293-46.800951-26.984332-66.858502-34.513443-66.858502-34.513443-22.76803-8.372371-54.631227-0.361397-71.255503 17.407304l-12.287509 13.251234a173.470708 173.470708 0 0 1-120.465769 48.065842A174.13327 174.13327 0 0 1 421.329029 33.590675L409.583617 20.761071C393.140039 2.99237 361.096144-4.898138 338.267881 3.353767c0 0-20.358715 7.529111-67.099434 34.513443-46.800951 27.34573-63.244529 41.440225-63.244529 41.440225-18.431263 15.66055-27.646894 47.222582-20.539413 70.592941l5.059562 16.865207a178.048407 178.048407 0 0 1-18.672194 129.621169 174.916297 174.916297 0 0 1-102.275439 81.073463l-17.045906 3.854904c-23.310126 5.42096-46.258856 29.333415-50.595623 53.185637 0 0-3.854905 21.382674-3.854905 75.712737 0 54.330062 3.854905 75.712736 3.854905 75.712736 4.216302 23.972688 26.9241 47.945376 50.595623 53.185637l16.624276 3.854905a174.253736 174.253736 0 0 1 102.395904 81.314394c23.310126 40.837896 28.911785 87.337683 18.732427 129.801867l-4.81863 16.443578c-7.10748 23.129428 2.108151 54.992624 20.599646 70.833872 0 0 16.624276 14.094495 63.244529 41.199293 46.800951 27.104798 66.918735 34.513443 66.918735 34.513443 22.707798 8.372371 54.631227 0.361397 71.255503-17.407303l11.624947-12.588673a175.096996 175.096996 0 0 1 242.256662 0.120465l11.624947 12.648906c16.383345 17.708468 48.427239 25.598976 71.255503 17.347071 0 0 20.358715-7.529111 67.159666-34.513443 46.740719-27.104798 63.124063-41.199293 63.124064-41.199293 18.491496-15.600317 27.707127-47.463513 20.599646-70.833873l-5.059562-17.106139a176.723284 176.723284 0 0 1 18.672194-129.139305 176.060722 176.060722 0 0 1 102.395904-81.314394l16.68451-3.854905c23.310126-5.42096 46.258856-29.333415 50.595623-53.185637 0 0 3.854905-21.382674 3.854904-75.712737-0.240932-54.330062-4.095836-75.833202-4.095836-75.833202z m-537.819428 293.334149c-119.261112 0-216.175824-97.336342-216.175824-217.621412a216.657687 216.657687 0 0 1 216.236057-217.320249c119.200879 0 216.115591 97.276109 216.11559 217.56118-0.240932 120.044139-96.974945 217.320248-216.175823 217.320249z" p-id="10234" fill="#bfbfbf"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M78.921.052H49.08c-1.865 0-3.198 1.599-3.198 3.464v6.661c0 1.865 1.6 3.464 3.198 3.464h29.84c1.865 0 3.198-1.599 3.198-3.464V3.516C82.385 1.65 80.786.052 78.92.052zm45.563 0H94.642c-1.865 0-3.464 1.599-3.464 3.464v6.661c0 1.865 1.599 3.464 3.464 3.464h29.842c1.865-.266 3.464-1.599 3.464-3.464V3.516c0-1.865-1.599-3.464-3.464-3.464zm0 22.382H40.02c-1.866 0-3.464-1.599-3.464-3.464V3.516c0-1.865-1.599-3.464-3.464-3.464H3.516C1.65.052.052 1.651.052 3.516V124.75c0 1.598 1.599 3.197 3.464 3.197h120.968c1.865 0 3.464-1.599 3.464-3.464V25.898c0-1.865-1.599-3.464-3.464-3.464z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M.006.064h127.988v31.104H.006V.064zm0 38.016h38.396v41.472H.006V38.08zm0 48.384h38.396v41.472H.006V86.464zM44.802 38.08h38.396v41.472H44.802V38.08zm0 48.384h38.396v41.472H44.802V86.464zM89.598 38.08h38.396v41.472H89.598zm0 48.384h38.396v41.472H89.598z"/><path d="M.006.064h127.988v31.104H.006V.064zm0 38.016h38.396v41.472H.006V38.08zm0 48.384h38.396v41.472H.006V86.464zM44.802 38.08h38.396v41.472H44.802V38.08zm0 48.384h38.396v41.472H44.802V86.464zM89.598 38.08h38.396v41.472H89.598zm0 48.384h38.396v41.472H89.598z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M125.5 36.984L95.336 2.83C93.735 1.018 91.565 0 89.3 0c-2.263 0-4.433 1.018-6.033 2.83l-3.786 4.286c-1.6 1.812-3.77 2.83-6.032 2.831H54.553c-2.263 0-4.434-1.018-6.033-2.83L44.734 2.83C43.134 1.018 40.964 0 38.701 0c-2.263 0-4.434 1.018-6.034 2.83L2.5 36.984C.9 38.796 0 41.254 0 43.815c0 2.562.899 5.02 2.5 6.831L14.565 64.31c2.178 2.468 5.367 3.403 8.33 2.444 1.35-.435 2.709.592 2.709 2.18v49.407c0 5.313 3.84 9.66 8.532 9.66h59.726c4.693 0 8.532-4.347 8.532-9.66V68.934c0-1.59 1.36-2.616 2.71-2.181 2.962.96 6.15.024 8.329-2.444L125.5 50.646c1.6-1.811 2.499-4.269 2.499-6.83 0-2.563-.899-5.02-2.5-6.832z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1553828490559" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1684" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M898.831744 900.517641 103.816972 900.517641c-36.002982 0-65.363683-29.286-65.363683-65.313541l0-554.949184c0-36.041868 29.361725-65.326844 65.363683-65.326844l795.015795 0c36.002982 0 65.198931 29.284977 65.198931 65.326844l0 554.949184C964.030675 871.231641 934.834726 900.517641 898.831744 900.517641L898.831744 900.517641zM103.816972 255.593236c-13.576203 0-24.711821 11.085476-24.711821 24.662703l0 554.949184c0 13.576203 11.136641 24.662703 24.711821 24.662703l795.015795 0c13.577227 0 24.547069-11.086499 24.547069-24.662703l0-554.949184c0-13.577227-10.970866-24.662703-24.547069-24.662703L103.816972 255.593236 103.816972 255.593236zM664.346245 251.774257c-11.161201 0-20.332071-9.080819-20.332071-20.332071l0-101.278661c0-13.576203-11.047614-24.623817-24.699542-24.623817L383.181611 105.539708c-13.576203 0-24.712845 11.04659-24.712845 24.623817l0 101.278661c0 11.252275-9.041934 20.332071-20.332071 20.332071-11.20111 0-20.319791-9.080819-20.319791-20.332071l0-101.278661c0-35.989679 29.323862-65.275679 65.364707-65.275679l236.133022 0c36.06745 0 65.402569 29.284977 65.402569 65.275679l0 101.278661C684.717202 242.694461 675.636383 251.774257 664.346245 251.774257L664.346245 251.774257zM413.233044 521.725502 75.694471 521.725502c-11.163247 0-20.333094-9.117658-20.333094-20.35663 0-11.252275 9.169847-20.332071 20.333094-20.332071l337.538573 0c11.277858 0 20.319791 9.080819 20.319791 20.332071C433.552835 512.607844 424.510902 521.725502 413.233044 521.725502L413.233044 521.725502zM912.894018 521.725502 575.367725 521.725502c-11.213389 0-20.332071-9.117658-20.332071-20.35663 0-11.252275 9.118682-20.332071 20.332071-20.332071l337.526293 0c11.290137 0 20.332071 9.080819 20.332071 20.332071C933.226089 512.607844 924.184155 521.725502 912.894018 521.725502L912.894018 521.725502zM557.56322 634.217552 445.085496 634.217552c-11.213389 0-20.332071-9.079796-20.332071-20.331048l0-168.763658c0-11.251252 9.118682-20.332071 20.332071-20.332071l112.478747 0c11.290137 0 20.370956 9.080819 20.370956 20.332071l0 168.763658C577.934177 625.137757 568.853357 634.217552 557.56322 634.217552L557.56322 634.217552zM465.417567 593.514525l71.827909 0L537.245476 465.454918l-71.827909 0L465.417567 593.514525 465.417567 593.514525z" p-id="1685" fill="#bfbfbf"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M44.8 0h79.543C126.78 0 128 1.422 128 4.267v23.466c0 2.845-1.219 4.267-3.657 4.267H44.8c-2.438 0-3.657-1.422-3.657-4.267V4.267C41.143 1.422 42.362 0 44.8 0zm22.857 48h56.686c2.438 0 3.657 1.422 3.657 4.267v23.466c0 2.845-1.219 4.267-3.657 4.267H67.657C65.22 80 64 78.578 64 75.733V52.267C64 49.422 65.219 48 67.657 48zm0 48h56.686c2.438 0 3.657 1.422 3.657 4.267v23.466c0 2.845-1.219 4.267-3.657 4.267H67.657C65.22 128 64 126.578 64 123.733v-23.466C64 97.422 65.219 96 67.657 96zM50.286 68.267c2.02 0 3.657-1.91 3.657-4.267 0-2.356-1.638-4.267-3.657-4.267H17.37V32h6.4c2.02 0 3.658-1.91 3.658-4.267V4.267C27.429 1.91 25.79 0 23.77 0H3.657C1.637 0 0 1.91 0 4.267v23.466C0 30.09 1.637 32 3.657 32h6.4v80c0 2.356 1.638 4.267 3.657 4.267h36.572c2.02 0 3.657-1.91 3.657-4.267 0-2.356-1.638-4.267-3.657-4.267H17.37V68.267h32.915z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M126.713 90.023c.858.985 1.287 2.134 1.287 3.447v29.553c0 1.423-.429 2.6-1.287 3.53-.858.93-1.907 1.395-3.146 1.395H97.824c-1.145 0-2.146-.465-3.004-1.395-.858-.93-1.287-2.107-1.287-3.53V93.47c0-.875.19-1.696.572-2.462.382-.766.906-1.368 1.573-1.806a3.84 3.84 0 0 1 2.146-.657h9.725V69.007a3.84 3.84 0 0 0-.43-1.806 3.569 3.569 0 0 0-1.143-1.313 2.714 2.714 0 0 0-1.573-.492h-36.47v23.149h9.725c1.144 0 2.145.492 3.004 1.478.858.985 1.287 2.134 1.287 3.447v29.553c0 .876-.191 1.696-.573 2.463-.38.766-.905 1.368-1.573 1.806a3.84 3.84 0 0 1-2.145.656H51.915a3.84 3.84 0 0 1-2.145-.656c-.668-.438-1.216-1.04-1.645-1.806a4.96 4.96 0 0 1-.644-2.463V93.47c0-1.313.43-2.462 1.288-3.447.858-.986 1.907-1.478 3.146-1.478h9.582v-23.15h-37.9c-.953 0-1.74.356-2.359 1.068-.62.711-.93 1.56-.93 2.544v19.538h9.726c1.239 0 2.264.492 3.074 1.478.81.985 1.216 2.134 1.216 3.447v29.553c0 1.423-.405 2.6-1.216 3.53-.81.93-1.835 1.395-3.074 1.395H4.29c-.476 0-.93-.082-1.358-.246a4.1 4.1 0 0 1-1.144-.657 4.658 4.658 0 0 1-.93-1.067 5.186 5.186 0 0 1-.643-1.395 5.566 5.566 0 0 1-.215-1.56V93.47c0-.437.048-.875.143-1.313a3.95 3.95 0 0 1 .429-1.15c.19-.328.429-.656.715-.984.286-.329.572-.602.858-.821.286-.22.62-.383 1.001-.493.382-.11.763-.164 1.144-.164h9.726V61.619c0-.985.31-1.833.93-2.544.619-.712 1.358-1.068 2.216-1.068h44.335V39.62h-9.582c-1.24 0-2.288-.492-3.146-1.477a5.09 5.09 0 0 1-1.287-3.448V5.14c0-1.423.429-2.627 1.287-3.612.858-.985 1.907-1.477 3.146-1.477h25.743c.763 0 1.478.246 2.145.739a5.17 5.17 0 0 1 1.573 1.888c.382.766.573 1.587.573 2.462v29.553c0 1.313-.43 2.463-1.287 3.448-.859.985-1.86 1.477-3.004 1.477h-9.725v18.389h42.762c.954 0 1.74.355 2.36 1.067.62.711.93 1.56.93 2.545v26.925h9.582c1.239 0 2.288.492 3.146 1.478z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="130" height="130" xmlns="http://www.w3.org/2000/svg"><path d="M63.444 64.996c20.633 0 37.359-14.308 37.359-31.953 0-17.649-16.726-31.952-37.359-31.952-20.631 0-37.36 14.303-37.358 31.952 0 17.645 16.727 31.953 37.359 31.953zM80.57 75.65H49.434c-26.652 0-48.26 18.477-48.26 41.27v2.664c0 9.316 21.608 9.325 48.26 9.325H80.57c26.649 0 48.256-.344 48.256-9.325v-2.663c0-22.794-21.605-41.271-48.256-41.271z" stroke="#979797"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1569580729849" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1939" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M513.3 958.5c-142.2 0-397.9-222.1-401.6-440.5V268c1.7-39.6 31.7-72.3 71.1-77.3 49-4.6 97.1-16.5 142.7-35.3 47.8-14 91.9-38.3 129.4-71.1 30.3-24.4 72.9-26.3 105.3-4.6 39.9 30.7 83.8 55.9 130.5 74.6 48.6 14.7 98.2 25.9 148.4 33.7 38.5 7.6 67.1 40.3 69.5 79.5 3.3 84.9 2.5 169.9-2.6 254.7-33.7 281.6-253.7 436.4-392.7 436.3z m-0.1-813.7c-7.2-0.2-14.3 2-20 6.4-39.7 35.2-86.8 61.1-137.7 75.7-46.8 19.2-96.2 31-146.6 35.2-11 3.2-18.8 13-19.5 24.4v230.1c3.5 180.3 223.3 361 323.9 361s287.3-120.2 317.6-360.5c7.3-142.7 0-228.6 0-229.6-1.3-13.3-11-24.3-24-27.3-49.6-7.7-98.6-19-146.5-33.7-46.3-19.5-89.7-45.3-129-76.7-5.8-3.8-12.7-5.5-19.5-4.9l1.3-0.1z" fill="#C6CCDA" p-id="1940"></path><path d="M750.1 428L490.7 673.2c-11.7 11.1-29.5 12.9-43.1 4.2l-6.8-5.8-141.2-149.4c-9.3-9.3-12.7-22.9-9-35.5 3.8-12.6 14.1-22.1 27-24.8 12.9-2.7 26.1 1.9 34.6 11.9L469 597.5l233.7-221c14.6-12.8 36.8-11.6 49.9 2.7 13.2 14.2 11.5 35.3-2.5 48.8" fill="#C6CCDA" p-id="1941"></path></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="110" xmlns="http://www.w3.org/2000/svg"><path d="M86.635 33.334c1.467 0 2.917.113 4.358.283C87.078 14.392 67.58.111 45.321.111 20.44.111.055 17.987.055 40.687c0 13.104 6.781 23.863 18.115 32.209l-4.527 14.352 15.82-8.364c5.666 1.182 10.207 2.395 15.858 2.395 1.42 0 2.829-.073 4.227-.189-.886-3.19-1.398-6.53-1.398-9.996 0-20.845 16.98-37.76 38.485-37.76zm-24.34-12.936c3.407 0 5.665 2.363 5.665 5.954 0 3.576-2.258 5.97-5.666 5.97-3.392 0-6.795-2.395-6.795-5.97 0-3.591 3.403-5.954 6.795-5.954zM30.616 32.323c-3.393 0-6.818-2.395-6.818-5.971 0-3.591 3.425-5.954 6.818-5.954 3.392 0 5.65 2.363 5.65 5.954 0 3.576-2.258 5.97-5.65 5.97z"/><path d="M127.945 70.52c0-19.075-18.108-34.623-38.448-34.623-21.537 0-38.5 15.548-38.5 34.623 0 19.108 16.963 34.622 38.5 34.622 4.508 0 9.058-1.2 13.584-2.395l12.414 7.167-3.404-11.923c9.087-7.184 15.854-16.712 15.854-27.471zm-50.928-5.97c-2.254 0-4.53-2.362-4.53-4.773 0-2.378 2.276-4.771 4.53-4.771 3.422 0 5.665 2.393 5.665 4.771 0 2.41-2.243 4.773-5.665 4.773zm24.897 0c-2.24 0-4.498-2.362-4.498-4.773 0-2.378 2.258-4.771 4.498-4.771 3.392 0 5.665 2.393 5.665 4.771 0 2.41-2.273 4.773-5.665 4.773z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M78.527 116.793c.178.008.348.024.527.024h40.233c4.711-.005 8.53-3.677 8.534-8.21V18.895c-.004-4.532-3.823-8.204-8.534-8.209H79.054c-.179 0-.353.016-.527.024V0L0 10.082v107.406l78.527 10.342v-11.037zm0-101.362c.174-.024.348-.052.527-.052h40.233c2.018 0 3.659 1.578 3.659 3.52v89.713c-.003 1.942-1.64 3.517-3.659 3.519H79.054c-.179 0-.353-.028-.527-.052V15.431zM30.262 75.757l-18.721-.46V72.37l11.3-16.673v-.148l-10.266.164v-4.51l17.504-.44v3.264L18.696 70.76v.144l11.566.176v4.678zm9.419.231l-5.823-.144V50.671l5.823-.144v25.461zm22.255-11.632c-2.168 1.922-5.353 2.76-9.02 2.736-.702.004-1.402-.04-2.097-.131v9.303l-5.997-.148V50.743c1.852-.352 4.473-.647 8.218-.743 3.838-.096 6.608.539 8.48 1.913 1.807 1.306 3.032 3.5 3.032 6.112s-.926 4.833-2.612 6.331h-.004zM53.36 54.45c-.856-.01-1.71.083-2.541.275v7.682c.523.116 1.167.152 2.06.152 3.301-.004 5.36-1.614 5.36-4.314 0-2.425-1.772-3.843-4.875-3.791l-.004-.004zm39.847-37.066h9.564v3.795h-9.564v-3.795zm-9.568 5.68h9.564v3.8h-9.564v-3.8zm9.568 6.216h9.564v3.799h-9.564V29.28zm0 12h9.564v3.794h-9.564V41.28zm-9.568-6.096h9.564v3.795h-9.564v-3.795zm9.472 47.064c2.512 0 4.921-.96 6.697-2.67 1.776-1.708 2.773-4.026 2.772-6.442l-1.748-15.263c0-5.033-2.492-9.112-7.725-9.112-5.232 0-7.72 4.079-7.72 9.112l-1.752 15.263c-.001 2.417.996 4.735 2.773 6.444 1.777 1.71 4.187 2.669 6.7 2.668h.003zm-3.135-16.75h6.27v12.743h-6.27V65.5z"/></svg> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | # replace default config
|
| | |
|
| | | # multipass: true
|
| | | # full: true
|
| | |
|
| | | plugins:
|
| | |
|
| | | # - name
|
| | | #
|
| | | # or:
|
| | | # - name: false
|
| | | # - name: true
|
| | | #
|
| | | # or:
|
| | | # - name:
|
| | | # param1: 1
|
| | | # param2: 2
|
| | |
|
| | | - removeAttrs:
|
| | | attrs:
|
| | | - 'fill'
|
| | | - 'fill-rule'
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | @import './variables.scss';
|
| | |
|
| | | @mixin colorBtn($color) {
|
| | | background: $color;
|
| | |
|
| | | &:hover {
|
| | | color: $color;
|
| | |
|
| | | &:before,
|
| | | &:after {
|
| | | background: $color;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .blue-btn {
|
| | | @include colorBtn($blue)
|
| | | }
|
| | |
|
| | | .light-blue-btn {
|
| | | @include colorBtn($light-blue)
|
| | | }
|
| | |
|
| | | .red-btn {
|
| | | @include colorBtn($red)
|
| | | }
|
| | |
|
| | | .pink-btn {
|
| | | @include colorBtn($pink)
|
| | | }
|
| | |
|
| | | .green-btn {
|
| | | @include colorBtn($green)
|
| | | }
|
| | |
|
| | | .tiffany-btn {
|
| | | @include colorBtn($tiffany)
|
| | | }
|
| | |
|
| | | .yellow-btn {
|
| | | @include colorBtn($yellow)
|
| | | }
|
| | |
|
| | | .pan-btn {
|
| | | font-size: 14px;
|
| | | color: #fff;
|
| | | padding: 14px 36px;
|
| | | border-radius: 8px;
|
| | | border: none;
|
| | | outline: none;
|
| | | transition: 600ms ease all;
|
| | | position: relative;
|
| | | display: inline-block;
|
| | |
|
| | | &:hover {
|
| | | background: #fff;
|
| | |
|
| | | &:before,
|
| | | &:after {
|
| | | width: 100%;
|
| | | transition: 600ms ease all;
|
| | | }
|
| | | }
|
| | |
|
| | | &:before,
|
| | | &:after {
|
| | | content: '';
|
| | | position: absolute;
|
| | | top: 0;
|
| | | right: 0;
|
| | | height: 2px;
|
| | | width: 0;
|
| | | transition: 400ms ease all;
|
| | | }
|
| | |
|
| | | &::after {
|
| | | right: inherit;
|
| | | top: inherit;
|
| | | left: 0;
|
| | | bottom: 0;
|
| | | }
|
| | | }
|
| | |
|
| | | .custom-button {
|
| | | display: inline-block;
|
| | | line-height: 1;
|
| | | white-space: nowrap;
|
| | | cursor: pointer;
|
| | | background: #fff;
|
| | | color: #fff;
|
| | | -webkit-appearance: none;
|
| | | text-align: center;
|
| | | box-sizing: border-box;
|
| | | outline: 0;
|
| | | margin: 0;
|
| | | padding: 10px 15px;
|
| | | font-size: 14px;
|
| | | border-radius: 4px;
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | // cover some element-ui styles
|
| | |
|
| | | .el-breadcrumb__inner,
|
| | | .el-breadcrumb__inner a {
|
| | | font-weight: 400 !important;
|
| | | }
|
| | |
|
| | | .el-upload {
|
| | | input[type="file"] {
|
| | | display: none !important;
|
| | | }
|
| | | }
|
| | |
|
| | | .el-upload__input {
|
| | | display: none;
|
| | | }
|
| | |
|
| | | .cell {
|
| | | .el-tag {
|
| | | margin-right: 0px;
|
| | | }
|
| | | }
|
| | |
|
| | | .small-padding {
|
| | | .cell {
|
| | | padding-left: 5px;
|
| | | padding-right: 5px;
|
| | | }
|
| | | }
|
| | |
|
| | | .fixed-width {
|
| | | .el-button--mini {
|
| | | padding: 7px 10px;
|
| | | width: 60px;
|
| | | }
|
| | | }
|
| | |
|
| | | .status-col {
|
| | | .cell {
|
| | | padding: 0 10px;
|
| | | text-align: center;
|
| | |
|
| | | .el-tag {
|
| | | margin-right: 0px;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // to fixed https://github.com/ElemeFE/element/issues/2461
|
| | | .el-dialog {
|
| | | transform: none;
|
| | | left: 0;
|
| | | position: relative;
|
| | | margin: 0 auto;
|
| | | }
|
| | |
|
| | | // refine element ui upload
|
| | | .upload-container {
|
| | | .el-upload {
|
| | | width: 100%;
|
| | |
|
| | | .el-upload-dragger {
|
| | | width: 100%;
|
| | | height: 200px;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // dropdown
|
| | | .el-dropdown-menu {
|
| | | a {
|
| | | display: block
|
| | | }
|
| | | }
|
| | |
|
| | | // fix date-picker ui bug in filter-item
|
| | | .el-range-editor.el-input__inner {
|
| | | display: inline-flex !important;
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | /**
|
| | | * I think element-ui's default theme color is too light for long-term use.
|
| | | * So I modified the default color and you can modify it to your liking.
|
| | | **/
|
| | |
|
| | | /* theme color */
|
| | | $--color-primary: #1890ff;
|
| | | $--color-success: #13ce66;
|
| | | $--color-warning: #FFBA00;
|
| | | $--color-danger: #ff4949;
|
| | | // $--color-info: #1E1E1E;
|
| | |
|
| | | $--button-font-weight: 400;
|
| | |
|
| | | // $--color-text-regular: #1f2d3d;
|
| | |
|
| | | $--border-color-light: #dfe4ed;
|
| | | $--border-color-lighter: #e6ebf5;
|
| | |
|
| | | $--table-border:1px solid#dfe6ec;
|
| | |
|
| | | /* icon font path, required */
|
| | | $--font-path: '~element-ui/lib/theme-chalk/fonts';
|
| | |
|
| | | @import "~element-ui/packages/theme-chalk/src/index";
|
| | |
|
| | | // the :export directive is the magic sauce for webpack
|
| | | // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
|
| | | :export {
|
| | | theme: $--color-primary;
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | @import './variables.scss';
|
| | | @import './mixin.scss';
|
| | | @import './transition.scss';
|
| | | @import './element-ui.scss';
|
| | | @import './sidebar.scss';
|
| | | @import './btn.scss';
|
| | |
|
| | | body {
|
| | | height: 100%;
|
| | | -moz-osx-font-smoothing: grayscale;
|
| | | -webkit-font-smoothing: antialiased;
|
| | | text-rendering: optimizeLegibility;
|
| | | font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
|
| | | }
|
| | |
|
| | | label {
|
| | | font-weight: 700;
|
| | | }
|
| | |
|
| | | html {
|
| | | height: 100%;
|
| | | box-sizing: border-box;
|
| | | }
|
| | |
|
| | | #app {
|
| | | height: 100%;
|
| | | }
|
| | |
|
| | | *,
|
| | | *:before,
|
| | | *:after {
|
| | | box-sizing: inherit;
|
| | | }
|
| | |
|
| | | .no-padding {
|
| | | padding: 0px !important;
|
| | | }
|
| | |
|
| | | .padding-content {
|
| | | padding: 4px 0;
|
| | | }
|
| | |
|
| | | a:focus,
|
| | | a:active {
|
| | | outline: none;
|
| | | }
|
| | |
|
| | | a,
|
| | | a:focus,
|
| | | a:hover {
|
| | | cursor: pointer;
|
| | | color: inherit;
|
| | | text-decoration: none;
|
| | | }
|
| | |
|
| | | div:focus {
|
| | | outline: none;
|
| | | }
|
| | |
|
| | | .fr {
|
| | | float: right;
|
| | | }
|
| | |
|
| | | .fl {
|
| | | float: left;
|
| | | }
|
| | |
|
| | | .pr-5 {
|
| | | padding-right: 5px;
|
| | | }
|
| | |
|
| | | .pl-5 {
|
| | | padding-left: 5px;
|
| | | }
|
| | |
|
| | | .block {
|
| | | display: block;
|
| | | }
|
| | |
|
| | | .pointer {
|
| | | cursor: pointer;
|
| | | }
|
| | |
|
| | | .inlineBlock {
|
| | | display: block;
|
| | | }
|
| | |
|
| | | .clearfix {
|
| | | &:after {
|
| | | visibility: hidden;
|
| | | display: block;
|
| | | font-size: 0;
|
| | | content: " ";
|
| | | clear: both;
|
| | | height: 0;
|
| | | }
|
| | | }
|
| | |
|
| | | aside {
|
| | | background: #eef1f6;
|
| | | padding: 8px 24px;
|
| | | margin-bottom: 20px;
|
| | | border-radius: 2px;
|
| | | display: block;
|
| | | line-height: 32px;
|
| | | font-size: 16px;
|
| | | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
| | | color: #2c3e50;
|
| | | -webkit-font-smoothing: antialiased;
|
| | | -moz-osx-font-smoothing: grayscale;
|
| | |
|
| | | a {
|
| | | color: #337ab7;
|
| | | cursor: pointer;
|
| | |
|
| | | &:hover {
|
| | | color: rgb(32, 160, 255);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | //main-containerå
¨å±æ ·å¼
|
| | | .app-container {
|
| | | padding: 20px;
|
| | | }
|
| | |
|
| | | .components-container {
|
| | | margin: 30px 50px;
|
| | | position: relative;
|
| | | }
|
| | |
|
| | | .pagination-container {
|
| | | margin-top: 30px;
|
| | | }
|
| | |
|
| | | .text-center {
|
| | | text-align: center
|
| | | }
|
| | |
|
| | | .sub-navbar {
|
| | | height: 50px;
|
| | | line-height: 50px;
|
| | | position: relative;
|
| | | width: 100%;
|
| | | text-align: right;
|
| | | padding-right: 20px;
|
| | | transition: 600ms ease position;
|
| | | background: linear-gradient(90deg, rgba(32, 182, 249, 1) 0%, rgba(32, 182, 249, 1) 0%, rgba(33, 120, 241, 1) 100%, rgba(33, 120, 241, 1) 100%);
|
| | |
|
| | | .subtitle {
|
| | | font-size: 20px;
|
| | | color: #fff;
|
| | | }
|
| | |
|
| | | &.draft {
|
| | | background: #d0d0d0;
|
| | | }
|
| | |
|
| | | &.deleted {
|
| | | background: #d0d0d0;
|
| | | }
|
| | | }
|
| | |
|
| | | .link-type,
|
| | | .link-type:focus {
|
| | | color: #337ab7;
|
| | | cursor: pointer;
|
| | |
|
| | | &:hover {
|
| | | color: rgb(32, 160, 255);
|
| | | }
|
| | | }
|
| | |
|
| | | .filter-container {
|
| | | padding-bottom: 10px;
|
| | |
|
| | | .filter-item {
|
| | | display: inline-block;
|
| | | vertical-align: middle;
|
| | | margin-bottom: 10px;
|
| | | }
|
| | | }
|
| | |
|
| | | //refine vue-multiselect plugin
|
| | | .multiselect {
|
| | | line-height: 16px;
|
| | | }
|
| | |
|
| | | .multiselect--active {
|
| | | z-index: 1000 !important;
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | @mixin clearfix {
|
| | | &:after {
|
| | | content: "";
|
| | | display: table;
|
| | | clear: both;
|
| | | }
|
| | | }
|
| | |
|
| | | @mixin scrollBar {
|
| | | &::-webkit-scrollbar-track-piece {
|
| | | background: #d3dce6;
|
| | | }
|
| | |
|
| | | &::-webkit-scrollbar {
|
| | | width: 6px;
|
| | | }
|
| | |
|
| | | &::-webkit-scrollbar-thumb {
|
| | | background: #99a9bf;
|
| | | border-radius: 20px;
|
| | | }
|
| | | }
|
| | |
|
| | | @mixin relative {
|
| | | position: relative;
|
| | | width: 100%;
|
| | | height: 100%;
|
| | | }
|
| | |
|
| | | @mixin pct($pct) {
|
| | | width: #{$pct};
|
| | | position: relative;
|
| | | margin: 0 auto;
|
| | | }
|
| | |
|
| | | @mixin triangle($width, $height, $color, $direction) {
|
| | | $width: $width/2;
|
| | | $color-border-style: $height solid $color;
|
| | | $transparent-border-style: $width solid transparent;
|
| | | height: 0;
|
| | | width: 0;
|
| | |
|
| | | @if $direction==up {
|
| | | border-bottom: $color-border-style;
|
| | | border-left: $transparent-border-style;
|
| | | border-right: $transparent-border-style;
|
| | | }
|
| | |
|
| | | @else if $direction==right {
|
| | | border-left: $color-border-style;
|
| | | border-top: $transparent-border-style;
|
| | | border-bottom: $transparent-border-style;
|
| | | }
|
| | |
|
| | | @else if $direction==down {
|
| | | border-top: $color-border-style;
|
| | | border-left: $transparent-border-style;
|
| | | border-right: $transparent-border-style;
|
| | | }
|
| | |
|
| | | @else if $direction==left {
|
| | | border-right: $color-border-style;
|
| | | border-top: $transparent-border-style;
|
| | | border-bottom: $transparent-border-style;
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | /**
|
| | | * éç¨cssæ ·å¼å¸å±å¤ç
|
| | | * Copyright (c) 2019 ruoyi
|
| | | */
|
| | |
|
| | | .el-table .el-table__header-wrapper th {
|
| | | word-break: break-word;
|
| | | background-color: #f8f8f9;
|
| | | color: #515a6e;
|
| | | height: 40px;
|
| | | font-size: 13px;
|
| | | }
|
| | |
|
| | | .pagination-container {
|
| | | position: relative;
|
| | | height: 25px;
|
| | | margin-bottom: 10px;
|
| | | margin-top: 15px;
|
| | | padding: 10px 20px !important;
|
| | | }
|
| | |
|
| | | .pagination-container .el-pagination {
|
| | | right: 0;
|
| | | position: absolute;
|
| | | }
|
| | |
|
| | | .el-table .fixed-width .el-button--mini {
|
| | | color: #409EFF;
|
| | | padding-left: 0;
|
| | | padding-right: 0;
|
| | | width: inherit;
|
| | | }
|
| | |
|
| | | .el-tree-node__content > .el-checkbox {
|
| | | margin-right: 8px;
|
| | | }
|
| | |
|
| | | .list-group-striped > .list-group-item {
|
| | | border-left: 0;
|
| | | border-right: 0;
|
| | | border-radius: 0;
|
| | | padding-left: 0;
|
| | | padding-right: 0;
|
| | | }
|
| | |
|
| | | .list-group {
|
| | | padding-left: 0px;
|
| | | list-style: none;
|
| | | }
|
| | |
|
| | | .list-group-item {
|
| | | border-bottom: 1px solid #e7eaec;
|
| | | border-top: 1px solid #e7eaec;
|
| | | margin-bottom: -1px;
|
| | | padding: 11px 0px;
|
| | | font-size: 13px;
|
| | | }
|
| | |
|
| | | .pull-right {
|
| | | float: right !important;
|
| | | }
|
| | |
|
| | | .el-card__header {
|
| | | padding: 14px 15px 7px;
|
| | | min-height: 40px;
|
| | | }
|
| | |
|
| | | .el-card__body {
|
| | | padding: 15px 20px 20px 20px;
|
| | | }
|
| | |
|
| | | .card-box {
|
| | | padding-right: 15px;
|
| | | padding-left: 15px;
|
| | | margin-bottom: 10px;
|
| | | }
|
| | | |
| | | /* text color */
|
| | | .text-navy {
|
| | | color: #1ab394;
|
| | | }
|
| | |
|
| | | .text-primary {
|
| | | color: inherit;
|
| | | }
|
| | |
|
| | | .text-success {
|
| | | color: #1c84c6;
|
| | | }
|
| | |
|
| | | .text-info {
|
| | | color: #23c6c8;
|
| | | }
|
| | |
|
| | | .text-warning {
|
| | | color: #f8ac59;
|
| | | }
|
| | |
|
| | | .text-danger {
|
| | | color: #ed5565;
|
| | | }
|
| | |
|
| | | .text-muted {
|
| | | color: #888888;
|
| | | }
|
| | |
|
| | | /* image */
|
| | | .img-circle {
|
| | | border-radius: 50%;
|
| | | }
|
| | |
|
| | | .img-lg {
|
| | | width: 120px;
|
| | | height: 120px;
|
| | | }
|
| | |
|
| | | .avatar-upload-preview {
|
| | | position: absolute;
|
| | | top: 50%;
|
| | | transform: translate(50%, -50%);
|
| | | width: 180px;
|
| | | height: 180px;
|
| | | border-radius: 50%;
|
| | | box-shadow: 0 0 4px #ccc;
|
| | | overflow: hidden;
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | #app {
|
| | |
|
| | | .main-container {
|
| | | min-height: 100%;
|
| | | transition: margin-left .28s;
|
| | | margin-left: $sideBarWidth;
|
| | | position: relative;
|
| | | }
|
| | |
|
| | | .sidebar-container {
|
| | | transition: width 0.28s;
|
| | | width: $sideBarWidth !important;
|
| | | background-color: $menuBg;
|
| | | height: 100%;
|
| | | position: fixed;
|
| | | font-size: 0px;
|
| | | top: 0;
|
| | | bottom: 0;
|
| | | left: 0;
|
| | | z-index: 1001;
|
| | | overflow: hidden;
|
| | |
|
| | | // reset element-ui css
|
| | | .horizontal-collapse-transition {
|
| | | transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
|
| | | }
|
| | |
|
| | | .scrollbar-wrapper {
|
| | | overflow-x: hidden !important;
|
| | | }
|
| | |
|
| | | .el-scrollbar__bar.is-vertical {
|
| | | right: 0px;
|
| | | }
|
| | |
|
| | | .el-scrollbar {
|
| | | height: 100%;
|
| | | }
|
| | |
|
| | | &.has-logo {
|
| | | .el-scrollbar {
|
| | | height: calc(100% - 50px);
|
| | | }
|
| | | }
|
| | |
|
| | | .is-horizontal {
|
| | | display: none;
|
| | | }
|
| | |
|
| | | a {
|
| | | display: inline-block;
|
| | | width: 100%;
|
| | | overflow: hidden;
|
| | | }
|
| | |
|
| | | .svg-icon {
|
| | | margin-right: 16px;
|
| | | }
|
| | |
|
| | | .el-menu {
|
| | | border: none;
|
| | | height: 100%;
|
| | | width: 100% !important;
|
| | | }
|
| | |
|
| | | // menu hover
|
| | | .submenu-title-noDropdown,
|
| | | .el-submenu__title {
|
| | | &:hover {
|
| | | background-color: $menuHover !important;
|
| | | }
|
| | | }
|
| | |
|
| | | .is-active>.el-submenu__title {
|
| | | color: $subMenuActiveText !important;
|
| | | }
|
| | |
|
| | | & .nest-menu .el-submenu>.el-submenu__title,
|
| | | & .el-submenu .el-menu-item {
|
| | | min-width: $sideBarWidth !important;
|
| | | background-color: $subMenuBg !important;
|
| | |
|
| | | &:hover {
|
| | | background-color: $subMenuHover !important;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .hideSidebar {
|
| | | .sidebar-container {
|
| | | width: 54px !important;
|
| | | }
|
| | |
|
| | | .main-container {
|
| | | margin-left: 54px;
|
| | | }
|
| | |
|
| | | .submenu-title-noDropdown {
|
| | | padding: 0 !important;
|
| | | position: relative;
|
| | |
|
| | | .el-tooltip {
|
| | | padding: 0 !important;
|
| | |
|
| | | .svg-icon {
|
| | | margin-left: 20px;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .el-submenu {
|
| | | overflow: hidden;
|
| | |
|
| | | &>.el-submenu__title {
|
| | | padding: 0 !important;
|
| | |
|
| | | .svg-icon {
|
| | | margin-left: 20px;
|
| | | }
|
| | |
|
| | | .el-submenu__icon-arrow {
|
| | | display: none;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .el-menu--collapse {
|
| | | .el-submenu {
|
| | | &>.el-submenu__title {
|
| | | &>span {
|
| | | height: 0;
|
| | | width: 0;
|
| | | overflow: hidden;
|
| | | visibility: hidden;
|
| | | display: inline-block;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .el-menu--collapse .el-menu .el-submenu {
|
| | | min-width: $sideBarWidth !important;
|
| | | }
|
| | |
|
| | | // mobile responsive
|
| | | .mobile {
|
| | | .main-container {
|
| | | margin-left: 0px;
|
| | | }
|
| | |
|
| | | .sidebar-container {
|
| | | transition: transform .28s;
|
| | | width: $sideBarWidth !important;
|
| | | }
|
| | |
|
| | | &.hideSidebar {
|
| | | .sidebar-container {
|
| | | pointer-events: none;
|
| | | transition-duration: 0.3s;
|
| | | transform: translate3d(-$sideBarWidth, 0, 0);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .withoutAnimation {
|
| | |
|
| | | .main-container,
|
| | | .sidebar-container {
|
| | | transition: none;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // when menu collapsed
|
| | | .el-menu--vertical {
|
| | | &>.el-menu {
|
| | | .svg-icon {
|
| | | margin-right: 16px;
|
| | | }
|
| | | }
|
| | |
|
| | | .nest-menu .el-submenu>.el-submenu__title,
|
| | | .el-menu-item {
|
| | | &:hover {
|
| | | // you can use $subMenuHover
|
| | | background-color: $menuHover !important;
|
| | | }
|
| | | }
|
| | |
|
| | | // the scroll bar appears when the subMenu is too long
|
| | | >.el-menu--popup {
|
| | | max-height: 100vh;
|
| | | overflow-y: auto;
|
| | |
|
| | | &::-webkit-scrollbar-track-piece {
|
| | | background: #d3dce6;
|
| | | }
|
| | |
|
| | | &::-webkit-scrollbar {
|
| | | width: 6px;
|
| | | }
|
| | |
|
| | | &::-webkit-scrollbar-thumb {
|
| | | background: #99a9bf;
|
| | | border-radius: 20px;
|
| | | }
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | // global transition css
|
| | |
|
| | | /* fade */
|
| | | .fade-enter-active,
|
| | | .fade-leave-active {
|
| | | transition: opacity 0.28s;
|
| | | }
|
| | |
|
| | | .fade-enter,
|
| | | .fade-leave-active {
|
| | | opacity: 0;
|
| | | }
|
| | |
|
| | | /* fade-transform */
|
| | | .fade-transform-leave-active,
|
| | | .fade-transform-enter-active {
|
| | | transition: all .5s;
|
| | | }
|
| | |
|
| | | .fade-transform-enter {
|
| | | opacity: 0;
|
| | | transform: translateX(-30px);
|
| | | }
|
| | |
|
| | | .fade-transform-leave-to {
|
| | | opacity: 0;
|
| | | transform: translateX(30px);
|
| | | }
|
| | |
|
| | | /* breadcrumb transition */
|
| | | .breadcrumb-enter-active,
|
| | | .breadcrumb-leave-active {
|
| | | transition: all .5s;
|
| | | }
|
| | |
|
| | | .breadcrumb-enter,
|
| | | .breadcrumb-leave-active {
|
| | | opacity: 0;
|
| | | transform: translateX(20px);
|
| | | }
|
| | |
|
| | | .breadcrumb-move {
|
| | | transition: all .5s;
|
| | | }
|
| | |
|
| | | .breadcrumb-leave-active {
|
| | | position: absolute;
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | // base color
|
| | | $blue:#324157;
|
| | | $light-blue:#3A71A8;
|
| | | $red:#C03639;
|
| | | $pink: #E65D6E;
|
| | | $green: #30B08F;
|
| | | $tiffany: #4AB7BD;
|
| | | $yellow:#FEC171;
|
| | | $panGreen: #30B08F;
|
| | |
|
| | | // sidebar
|
| | | $menuText:#bfcbd9;
|
| | | $menuActiveText:#409EFF;
|
| | | $subMenuActiveText:#f4f4f5; // https://github.com/ElemeFE/element/issues/12951
|
| | |
|
| | | $menuBg:#304156;
|
| | | $menuHover:#263445;
|
| | |
|
| | | $subMenuBg:#1f2d3d;
|
| | | $subMenuHover:#001528;
|
| | |
|
| | | $sideBarWidth: 200px;
|
| | |
|
| | | // the :export directive is the magic sauce for webpack
|
| | | // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
|
| | | :export {
|
| | | menuText: $menuText;
|
| | | menuActiveText: $menuActiveText;
|
| | | subMenuActiveText: $subMenuActiveText;
|
| | | menuBg: $menuBg;
|
| | | menuHover: $menuHover;
|
| | | subMenuBg: $subMenuBg;
|
| | | subMenuHover: $subMenuHover;
|
| | | sideBarWidth: $sideBarWidth;
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <el-breadcrumb class="app-breadcrumb" separator="/">
|
| | | <transition-group name="breadcrumb">
|
| | | <el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
|
| | | <span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span>
|
| | | <a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
|
| | | </el-breadcrumb-item>
|
| | | </transition-group>
|
| | | </el-breadcrumb>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import pathToRegexp from 'path-to-regexp'
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | levelList: null
|
| | | }
|
| | | },
|
| | | watch: {
|
| | | $route(route) {
|
| | | // if you go to the redirect page, do not update the breadcrumbs
|
| | | if (route.path.startsWith('/redirect/')) {
|
| | | return
|
| | | }
|
| | | this.getBreadcrumb()
|
| | | }
|
| | | },
|
| | | created() {
|
| | | this.getBreadcrumb()
|
| | | },
|
| | | methods: {
|
| | | getBreadcrumb() {
|
| | | // only show routes with meta.title
|
| | | let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
|
| | | const first = matched[0]
|
| | |
|
| | | if (!this.isDashboard(first)) {
|
| | | matched = [{ path: '/index', meta: { title: 'é¦é¡µ' }}].concat(matched)
|
| | | }
|
| | |
|
| | | this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
|
| | | },
|
| | | isDashboard(route) {
|
| | | const name = route && route.name
|
| | | if (!name) {
|
| | | return false
|
| | | }
|
| | | return name.trim() === 'é¦é¡µ'
|
| | | },
|
| | | pathCompile(path) {
|
| | | const { params } = this.$route
|
| | | var toPath = pathToRegexp.compile(path)
|
| | | return toPath(params)
|
| | | },
|
| | | handleLink(item) {
|
| | | const { redirect, path } = item
|
| | | if (redirect) {
|
| | | this.$router.push(redirect)
|
| | | return
|
| | | }
|
| | | this.$router.push(this.pathCompile(path))
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .app-breadcrumb.el-breadcrumb {
|
| | | display: inline-block;
|
| | | font-size: 14px;
|
| | | line-height: 50px;
|
| | | margin-left: 8px;
|
| | |
|
| | | .no-redirect {
|
| | | color: #97a8be;
|
| | | cursor: text;
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div>
|
| | | <!-- å¾çä¸ä¼ ç»ä»¶è¾
å© -->
|
| | | <el-upload
|
| | | class="avatar-uploader quill-img"
|
| | | :action="uploadImgUrl"
|
| | | name="file"
|
| | | :headers="headers"
|
| | | :show-file-list="false"
|
| | | :on-success="quillImgSuccess"
|
| | | :on-error="uploadError"
|
| | | :before-upload="quillImgBefore"
|
| | | accept='.jpg,.jpeg,.png,.gif'
|
| | | ></el-upload>
|
| | |
|
| | | <!-- 坿æ¬ç»ä»¶ -->
|
| | | <quill-editor
|
| | | class="editor"
|
| | | v-model="content"
|
| | | ref="quillEditor"
|
| | | :options="editorOption"
|
| | | @blur="onEditorBlur($event)"
|
| | | @focus="onEditorFocus($event)"
|
| | | @change="onEditorChange($event)"
|
| | | ></quill-editor>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { getToken } from '@/utils/auth'
|
| | |
|
| | | // å·¥å
·æ é
ç½®
|
| | | const toolbarOptions = [
|
| | | ["bold", "italic", "underline", "strike"], // å ç² æä½ ä¸å线 å é¤çº¿
|
| | | ["blockquote", "code-block"], // å¼ç¨ 代ç å
|
| | | [{ list: "ordered" }, { list: "bullet" }], // æåºãæ åºå表
|
| | | [{ indent: "-1" }, { indent: "+1" }], // 缩è¿
|
| | | [{ size: ["small", false, "large", "huge"] }], // åä½å¤§å°
|
| | | [{ header: [1, 2, 3, 4, 5, 6, false] }], // æ é¢
|
| | | [{ color: [] }, { background: [] }], // åä½é¢è²ãåä½èæ¯é¢è²
|
| | | [{ align: [] }], // 坹齿¹å¼
|
| | | ["clean"], // æ¸
é¤ææ¬æ ¼å¼
|
| | | ["link", "image", "video"] // 龿¥ãå¾çãè§é¢
|
| | | ];
|
| | |
|
| | | import { quillEditor } from "vue-quill-editor";
|
| | | import "quill/dist/quill.core.css";
|
| | | import "quill/dist/quill.snow.css";
|
| | | import "quill/dist/quill.bubble.css";
|
| | |
|
| | | export default {
|
| | | props: {
|
| | | /* ç¼è¾å¨çå
容 */
|
| | | value: {
|
| | | type: String
|
| | | },
|
| | | /* å¾çå¤§å° */
|
| | | maxSize: {
|
| | | type: Number,
|
| | | default: 4000 //kb
|
| | | }
|
| | | },
|
| | | components: { quillEditor },
|
| | | data() {
|
| | | return {
|
| | | content: this.value,
|
| | | uploadImgUrl: "",
|
| | | editorOption: {
|
| | | placeholder: "",
|
| | | theme: "snow", // or 'bubble'
|
| | | placeholder: "请è¾å
¥å
容",
|
| | | modules: {
|
| | | toolbar: {
|
| | | container: toolbarOptions,
|
| | | handlers: {
|
| | | image: function(value) {
|
| | | if (value) {
|
| | | // 触åinputæ¡éæ©å¾çæä»¶
|
| | | document.querySelector(".quill-img input").click();
|
| | | } else {
|
| | | this.quill.format("image", false);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | },
|
| | | uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // ä¸ä¼ çå¾çæå¡å¨å°å
|
| | | headers: {
|
| | | Authorization: 'Bearer ' + getToken()
|
| | | }
|
| | | };
|
| | | },
|
| | | watch: {
|
| | | value: function() {
|
| | | this.content = this.value;
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | onEditorBlur() {
|
| | | //失å»ç¦ç¹äºä»¶
|
| | | },
|
| | | onEditorFocus() {
|
| | | //è·å¾ç¦ç¹äºä»¶
|
| | | },
|
| | | onEditorChange() {
|
| | | //å
容æ¹åäºä»¶
|
| | | this.$emit("input", this.content);
|
| | | },
|
| | |
|
| | | // 坿æ¬å¾çä¸ä¼ å
|
| | | quillImgBefore(file) {
|
| | | let fileType = file.type;
|
| | | if(fileType === 'image/jpeg' || fileType === 'image/png'){
|
| | | return true;
|
| | | }else {
|
| | | this.$message.error('请æå
¥å¾çç±»åæä»¶(jpg/jpeg/png)');
|
| | | return false;
|
| | | }
|
| | | },
|
| | |
|
| | | quillImgSuccess(res, file) {
|
| | | // res为å¾çæå¡å¨è¿åçæ°æ®
|
| | | // è·å坿æ¬ç»ä»¶å®ä¾
|
| | | let quill = this.$refs.quillEditor.quill;
|
| | | // 妿ä¸ä¼ æå
|
| | | if (res.code == 200) {
|
| | | // è·åå
æ æå¨ä½ç½®
|
| | | let length = quill.getSelection().index;
|
| | | // æå
¥å¾ç res.url为æå¡å¨è¿åçå¾çå°å
|
| | | quill.insertEmbed(length, "image", res.url);
|
| | | // è°æ´å
æ å°æå
|
| | | quill.setSelection(length + 1);
|
| | | } else {
|
| | | this.$message.error("å¾çæå
¥å¤±è´¥");
|
| | | }
|
| | | },
|
| | | // 坿æ¬å¾çä¸ä¼ 失败
|
| | | uploadError() {
|
| | | // loadingå¨ç»æ¶å¤±
|
| | | this.$message.error("å¾çæå
¥å¤±è´¥");
|
| | | }
|
| | | }
|
| | | };
|
| | | </script> |
| | |
|
| | | <style>
|
| | | .editor {
|
| | | line-height: normal !important;
|
| | | height: 192px;
|
| | | }
|
| | | .el-upload {
|
| | | display: none;
|
| | | }
|
| | | .ql-snow .ql-tooltip[data-mode="link"]::before {
|
| | | content: "请è¾å
¥é¾æ¥å°å:";
|
| | | }
|
| | | .ql-snow .ql-tooltip.ql-editing a.ql-action::after {
|
| | | border-right: 0px;
|
| | | content: "ä¿å";
|
| | | padding-right: 0px;
|
| | | }
|
| | |
|
| | | .ql-snow .ql-tooltip[data-mode="video"]::before {
|
| | | content: "请è¾å
¥è§é¢å°å:";
|
| | | }
|
| | |
|
| | | .ql-snow .ql-picker.ql-size .ql-picker-label::before,
|
| | | .ql-snow .ql-picker.ql-size .ql-picker-item::before {
|
| | | content: "14px";
|
| | | }
|
| | | .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
|
| | | .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
|
| | | content: "10px";
|
| | | }
|
| | | .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
|
| | | .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
|
| | | content: "18px";
|
| | | }
|
| | | .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
|
| | | .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
|
| | | content: "32px";
|
| | | }
|
| | |
|
| | | .ql-snow .ql-picker.ql-header .ql-picker-label::before,
|
| | | .ql-snow .ql-picker.ql-header .ql-picker-item::before {
|
| | | content: "ææ¬";
|
| | | }
|
| | | .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
|
| | | .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
|
| | | content: "æ é¢1";
|
| | | }
|
| | | .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
|
| | | .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
|
| | | content: "æ é¢2";
|
| | | }
|
| | | .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
|
| | | .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
|
| | | content: "æ é¢3";
|
| | | }
|
| | | .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
|
| | | .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
|
| | | content: "æ é¢4";
|
| | | }
|
| | | .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
|
| | | .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
|
| | | content: "æ é¢5";
|
| | | }
|
| | | .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
|
| | | .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
|
| | | content: "æ é¢6";
|
| | | }
|
| | |
|
| | | .ql-snow .ql-picker.ql-font .ql-picker-label::before,
|
| | | .ql-snow .ql-picker.ql-font .ql-picker-item::before {
|
| | | content: "æ ååä½";
|
| | | }
|
| | | .ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
|
| | | .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
|
| | | content: "衬线åä½";
|
| | | }
|
| | | .ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
|
| | | .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
|
| | | content: "ç宽åä½";
|
| | | }
|
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div style="padding: 0 15px;" @click="toggleClick">
|
| | | <svg
|
| | | :class="{'is-active':isActive}"
|
| | | class="hamburger"
|
| | | viewBox="0 0 1024 1024"
|
| | | xmlns="http://www.w3.org/2000/svg"
|
| | | width="64"
|
| | | height="64"
|
| | | >
|
| | | <path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z" />
|
| | | </svg>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | export default {
|
| | | name: 'Hamburger',
|
| | | props: {
|
| | | isActive: {
|
| | | type: Boolean,
|
| | | default: false
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | toggleClick() {
|
| | | this.$emit('toggleClick')
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style scoped>
|
| | | .hamburger {
|
| | | display: inline-block;
|
| | | vertical-align: middle;
|
| | | width: 20px;
|
| | | height: 20px;
|
| | | }
|
| | |
|
| | | .hamburger.is-active {
|
| | | transform: rotate(180deg);
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div :class="{'show':show}" class="header-search">
|
| | | <svg-icon class-name="search-icon" icon-class="search" @click.stop="click" />
|
| | | <el-select
|
| | | ref="headerSearchSelect"
|
| | | v-model="search"
|
| | | :remote-method="querySearch"
|
| | | filterable
|
| | | default-first-option
|
| | | remote
|
| | | placeholder="Search"
|
| | | class="header-search-select"
|
| | | @change="change"
|
| | | >
|
| | | <el-option v-for="item in options" :key="item.path" :value="item" :label="item.title.join(' > ')" />
|
| | | </el-select>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | // fuse is a lightweight fuzzy-search module
|
| | | // make search results more in line with expectations
|
| | | import Fuse from 'fuse.js'
|
| | | import path from 'path'
|
| | |
|
| | | export default {
|
| | | name: 'HeaderSearch',
|
| | | data() {
|
| | | return {
|
| | | search: '',
|
| | | options: [],
|
| | | searchPool: [],
|
| | | show: false,
|
| | | fuse: undefined
|
| | | }
|
| | | },
|
| | | computed: {
|
| | | routes() {
|
| | | return this.$store.getters.permission_routes
|
| | | }
|
| | | },
|
| | | watch: {
|
| | | routes() {
|
| | | this.searchPool = this.generateRoutes(this.routes)
|
| | | },
|
| | | searchPool(list) {
|
| | | this.initFuse(list)
|
| | | },
|
| | | show(value) {
|
| | | if (value) {
|
| | | document.body.addEventListener('click', this.close)
|
| | | } else {
|
| | | document.body.removeEventListener('click', this.close)
|
| | | }
|
| | | }
|
| | | },
|
| | | mounted() {
|
| | | this.searchPool = this.generateRoutes(this.routes)
|
| | | },
|
| | | methods: {
|
| | | click() {
|
| | | this.show = !this.show
|
| | | if (this.show) {
|
| | | this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.focus()
|
| | | }
|
| | | },
|
| | | close() {
|
| | | this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.blur()
|
| | | this.options = []
|
| | | this.show = false
|
| | | },
|
| | | change(val) {
|
| | | this.$router.push(val.path)
|
| | | this.search = ''
|
| | | this.options = []
|
| | | this.$nextTick(() => {
|
| | | this.show = false
|
| | | })
|
| | | },
|
| | | initFuse(list) {
|
| | | this.fuse = new Fuse(list, {
|
| | | shouldSort: true,
|
| | | threshold: 0.4,
|
| | | location: 0,
|
| | | distance: 100,
|
| | | maxPatternLength: 32,
|
| | | minMatchCharLength: 1,
|
| | | keys: [{
|
| | | name: 'title',
|
| | | weight: 0.7
|
| | | }, {
|
| | | name: 'path',
|
| | | weight: 0.3
|
| | | }]
|
| | | })
|
| | | },
|
| | | // Filter out the routes that can be displayed in the sidebar
|
| | | // And generate the internationalized title
|
| | | generateRoutes(routes, basePath = '/', prefixTitle = []) {
|
| | | let res = []
|
| | |
|
| | | for (const router of routes) {
|
| | | // skip hidden router
|
| | | if (router.hidden) { continue }
|
| | |
|
| | | const data = {
|
| | | path: path.resolve(basePath, router.path),
|
| | | title: [...prefixTitle]
|
| | | }
|
| | |
|
| | | if (router.meta && router.meta.title) {
|
| | | data.title = [...data.title, router.meta.title]
|
| | |
|
| | | if (router.redirect !== 'noRedirect') {
|
| | | // only push the routes with title
|
| | | // special case: need to exclude parent router without redirect
|
| | | res.push(data)
|
| | | }
|
| | | }
|
| | |
|
| | | // recursive child routes
|
| | | if (router.children) {
|
| | | const tempRoutes = this.generateRoutes(router.children, data.path, data.title)
|
| | | if (tempRoutes.length >= 1) {
|
| | | res = [...res, ...tempRoutes]
|
| | | }
|
| | | }
|
| | | }
|
| | | return res
|
| | | },
|
| | | querySearch(query) {
|
| | | if (query !== '') {
|
| | | this.options = this.fuse.search(query)
|
| | | } else {
|
| | | this.options = []
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .header-search {
|
| | | font-size: 0 !important;
|
| | |
|
| | | .search-icon {
|
| | | cursor: pointer;
|
| | | font-size: 18px;
|
| | | vertical-align: middle;
|
| | | }
|
| | |
|
| | | .header-search-select {
|
| | | font-size: 18px;
|
| | | transition: width 0.2s;
|
| | | width: 0;
|
| | | overflow: hidden;
|
| | | background: transparent;
|
| | | border-radius: 0;
|
| | | display: inline-block;
|
| | | vertical-align: middle;
|
| | |
|
| | | /deep/ .el-input__inner {
|
| | | border-radius: 0;
|
| | | border: 0;
|
| | | padding-left: 0;
|
| | | padding-right: 0;
|
| | | box-shadow: none !important;
|
| | | border-bottom: 1px solid #d9d9d9;
|
| | | vertical-align: middle;
|
| | | }
|
| | | }
|
| | |
|
| | | &.show {
|
| | | .header-search-select {
|
| | | width: 210px;
|
| | | margin-left: 10px;
|
| | | }
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- @author zhengjie -->
|
| | | <template>
|
| | | <div class="icon-body">
|
| | | <el-input v-model="name" style="position: relative;" clearable placeholder="请è¾å
¥å¾æ åç§°" @clear="filterIcons" @input.native="filterIcons">
|
| | | <i slot="suffix" class="el-icon-search el-input__icon" />
|
| | | </el-input>
|
| | | <div class="icon-list">
|
| | | <div v-for="(item, index) in iconList" :key="index" @click="selectedIcon(item)">
|
| | | <svg-icon :icon-class="item" style="height: 30px;width: 16px;" />
|
| | | <span>{{ item }}</span>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import icons from './requireIcons'
|
| | | export default {
|
| | | name: 'IconSelect',
|
| | | data() {
|
| | | return {
|
| | | name: '',
|
| | | iconList: icons
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | filterIcons() {
|
| | | if (this.name) {
|
| | | this.iconList = this.iconList.filter(item => item.includes(this.name))
|
| | | } else {
|
| | | this.iconList = icons
|
| | | }
|
| | | },
|
| | | selectedIcon(name) {
|
| | | this.$emit('selected', name)
|
| | | document.body.click()
|
| | | },
|
| | | reset() {
|
| | | this.name = ''
|
| | | this.iconList = icons
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style rel="stylesheet/scss" lang="scss" scoped>
|
| | | .icon-body {
|
| | | width: 100%;
|
| | | padding: 10px;
|
| | | .icon-list {
|
| | | height: 200px;
|
| | | overflow-y: scroll;
|
| | | div {
|
| | | height: 30px;
|
| | | line-height: 30px;
|
| | | margin-bottom: -5px;
|
| | | cursor: pointer;
|
| | | width: 33%;
|
| | | float: left;
|
| | | }
|
| | | span {
|
| | | display: inline-block;
|
| | | vertical-align: -0.15em;
|
| | | fill: currentColor;
|
| | | overflow: hidden;
|
| | | }
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | |
|
| | | const req = require.context('../../assets/icons/svg', false, /\.svg$/)
|
| | | const requireAll = requireContext => requireContext.keys()
|
| | |
|
| | | const re = /\.\/(.*)\.svg/
|
| | |
|
| | | const icons = requireAll(req).map(i => {
|
| | | return i.match(re)[1]
|
| | | })
|
| | |
|
| | | export default icons
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div :class="{'hidden':hidden}" class="pagination-container">
|
| | | <el-pagination
|
| | | :background="background"
|
| | | :current-page.sync="currentPage"
|
| | | :page-size.sync="pageSize"
|
| | | :layout="layout"
|
| | | :page-sizes="pageSizes"
|
| | | :total="total"
|
| | | v-bind="$attrs"
|
| | | @size-change="handleSizeChange"
|
| | | @current-change="handleCurrentChange"
|
| | | />
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { scrollTo } from '@/utils/scroll-to'
|
| | |
|
| | | export default {
|
| | | name: 'Pagination',
|
| | | props: {
|
| | | total: {
|
| | | required: true,
|
| | | type: Number
|
| | | },
|
| | | page: {
|
| | | type: Number,
|
| | | default: 1
|
| | | },
|
| | | limit: {
|
| | | type: Number,
|
| | | default: 20
|
| | | },
|
| | | pageSizes: {
|
| | | type: Array,
|
| | | default() {
|
| | | return [10, 20, 30, 50]
|
| | | }
|
| | | },
|
| | | layout: {
|
| | | type: String,
|
| | | default: 'total, sizes, prev, pager, next, jumper'
|
| | | },
|
| | | background: {
|
| | | type: Boolean,
|
| | | default: true
|
| | | },
|
| | | autoScroll: {
|
| | | type: Boolean,
|
| | | default: true
|
| | | },
|
| | | hidden: {
|
| | | type: Boolean,
|
| | | default: false
|
| | | }
|
| | | },
|
| | | computed: {
|
| | | currentPage: {
|
| | | get() {
|
| | | return this.page
|
| | | },
|
| | | set(val) {
|
| | | this.$emit('update:page', val)
|
| | | }
|
| | | },
|
| | | pageSize: {
|
| | | get() {
|
| | | return this.limit
|
| | | },
|
| | | set(val) {
|
| | | this.$emit('update:limit', val)
|
| | | }
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | handleSizeChange(val) {
|
| | | this.$emit('pagination', { page: this.currentPage, limit: val })
|
| | | if (this.autoScroll) {
|
| | | scrollTo(0, 800)
|
| | | }
|
| | | },
|
| | | handleCurrentChange(val) {
|
| | | this.$emit('pagination', { page: val, limit: this.pageSize })
|
| | | if (this.autoScroll) {
|
| | | scrollTo(0, 800)
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style scoped>
|
| | | .pagination-container {
|
| | | background: #fff;
|
| | | padding: 32px 16px;
|
| | | }
|
| | | .pagination-container.hidden {
|
| | | display: none;
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div :style="{zIndex:zIndex,height:height,width:width}" class="pan-item">
|
| | | <div class="pan-info">
|
| | | <div class="pan-info-roles-container">
|
| | | <slot />
|
| | | </div>
|
| | | </div>
|
| | | <!-- eslint-disable-next-line -->
|
| | | <div :style="{backgroundImage: `url(${image})`}" class="pan-thumb"></div>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | export default {
|
| | | name: 'PanThumb',
|
| | | props: {
|
| | | image: {
|
| | | type: String,
|
| | | required: true
|
| | | },
|
| | | zIndex: {
|
| | | type: Number,
|
| | | default: 1
|
| | | },
|
| | | width: {
|
| | | type: String,
|
| | | default: '150px'
|
| | | },
|
| | | height: {
|
| | | type: String,
|
| | | default: '150px'
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style scoped>
|
| | | .pan-item {
|
| | | width: 200px;
|
| | | height: 200px;
|
| | | border-radius: 50%;
|
| | | display: inline-block;
|
| | | position: relative;
|
| | | cursor: default;
|
| | | box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
| | | }
|
| | |
|
| | | .pan-info-roles-container {
|
| | | padding: 20px;
|
| | | text-align: center;
|
| | | }
|
| | |
|
| | | .pan-thumb {
|
| | | width: 100%;
|
| | | height: 100%;
|
| | | background-position: center center;
|
| | | background-size: cover;
|
| | | border-radius: 50%;
|
| | | overflow: hidden;
|
| | | position: absolute;
|
| | | transform-origin: 95% 40%;
|
| | | transition: all 0.3s ease-in-out;
|
| | | }
|
| | |
|
| | | /* .pan-thumb:after {
|
| | | content: '';
|
| | | width: 8px;
|
| | | height: 8px;
|
| | | position: absolute;
|
| | | border-radius: 50%;
|
| | | top: 40%;
|
| | | left: 95%;
|
| | | margin: -4px 0 0 -4px;
|
| | | background: radial-gradient(ellipse at center, rgba(14, 14, 14, 1) 0%, rgba(125, 126, 125, 1) 100%);
|
| | | box-shadow: 0 0 1px rgba(255, 255, 255, 0.9);
|
| | | } */
|
| | |
|
| | | .pan-info {
|
| | | position: absolute;
|
| | | width: inherit;
|
| | | height: inherit;
|
| | | border-radius: 50%;
|
| | | overflow: hidden;
|
| | | box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.05);
|
| | | }
|
| | |
|
| | | .pan-info h3 {
|
| | | color: #fff;
|
| | | text-transform: uppercase;
|
| | | position: relative;
|
| | | letter-spacing: 2px;
|
| | | font-size: 18px;
|
| | | margin: 0 60px;
|
| | | padding: 22px 0 0 0;
|
| | | height: 85px;
|
| | | font-family: 'Open Sans', Arial, sans-serif;
|
| | | text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
|
| | | }
|
| | |
|
| | | .pan-info p {
|
| | | color: #fff;
|
| | | padding: 10px 5px;
|
| | | font-style: italic;
|
| | | margin: 0 30px;
|
| | | font-size: 12px;
|
| | | border-top: 1px solid rgba(255, 255, 255, 0.5);
|
| | | }
|
| | |
|
| | | .pan-info p a {
|
| | | display: block;
|
| | | color: #333;
|
| | | width: 80px;
|
| | | height: 80px;
|
| | | background: rgba(255, 255, 255, 0.3);
|
| | | border-radius: 50%;
|
| | | color: #fff;
|
| | | font-style: normal;
|
| | | font-weight: 700;
|
| | | text-transform: uppercase;
|
| | | font-size: 9px;
|
| | | letter-spacing: 1px;
|
| | | padding-top: 24px;
|
| | | margin: 7px auto 0;
|
| | | font-family: 'Open Sans', Arial, sans-serif;
|
| | | opacity: 0;
|
| | | transition: transform 0.3s ease-in-out 0.2s, opacity 0.3s ease-in-out 0.2s, background 0.2s linear 0s;
|
| | | transform: translateX(60px) rotate(90deg);
|
| | | }
|
| | |
|
| | | .pan-info p a:hover {
|
| | | background: rgba(255, 255, 255, 0.5);
|
| | | }
|
| | |
|
| | | .pan-item:hover .pan-thumb {
|
| | | transform: rotate(-110deg);
|
| | | }
|
| | |
|
| | | .pan-item:hover .pan-info p a {
|
| | | opacity: 1;
|
| | | transform: translateX(0px) rotate(0deg);
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div ref="rightPanel" :class="{show:show}" class="rightPanel-container">
|
| | | <div class="rightPanel-background" />
|
| | | <div class="rightPanel">
|
| | | <div class="rightPanel-items">
|
| | | <slot />
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { addClass, removeClass } from '@/utils'
|
| | |
|
| | | export default {
|
| | | name: 'RightPanel',
|
| | | props: {
|
| | | clickNotClose: {
|
| | | default: false,
|
| | | type: Boolean
|
| | | },
|
| | | buttonTop: {
|
| | | default: 250,
|
| | | type: Number
|
| | | }
|
| | | },
|
| | | computed: {
|
| | | show: {
|
| | | get() {
|
| | | return this.$store.state.settings.showSettings
|
| | | },
|
| | | set(val) {
|
| | | this.$store.dispatch('settings/changeSetting', {
|
| | | key: 'showSettings',
|
| | | value: val
|
| | | })
|
| | | }
|
| | | },
|
| | | theme() {
|
| | | return this.$store.state.settings.theme
|
| | | },
|
| | | },
|
| | | watch: {
|
| | | show(value) {
|
| | | if (value && !this.clickNotClose) {
|
| | | this.addEventClick()
|
| | | }
|
| | | if (value) {
|
| | | addClass(document.body, 'showRightPanel')
|
| | | } else {
|
| | | removeClass(document.body, 'showRightPanel')
|
| | | }
|
| | | }
|
| | | },
|
| | | mounted() {
|
| | | this.insertToBody()
|
| | | this.addEventClick()
|
| | | },
|
| | | beforeDestroy() {
|
| | | const elx = this.$refs.rightPanel
|
| | | elx.remove()
|
| | | },
|
| | | methods: {
|
| | | addEventClick() {
|
| | | window.addEventListener('click', this.closeSidebar)
|
| | | },
|
| | | closeSidebar(evt) {
|
| | | const parent = evt.target.closest('.rightPanel')
|
| | | if (!parent) {
|
| | | this.show = false
|
| | | window.removeEventListener('click', this.closeSidebar)
|
| | | }
|
| | | },
|
| | | insertToBody() {
|
| | | const elx = this.$refs.rightPanel
|
| | | const body = document.querySelector('body')
|
| | | body.insertBefore(elx, body.firstChild)
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style>
|
| | | .showRightPanel {
|
| | | overflow: hidden;
|
| | | position: relative;
|
| | | width: calc(100% - 15px);
|
| | | }
|
| | | </style>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .rightPanel-background {
|
| | | position: fixed;
|
| | | top: 0;
|
| | | left: 0;
|
| | | opacity: 0;
|
| | | transition: opacity .3s cubic-bezier(.7, .3, .1, 1);
|
| | | background: rgba(0, 0, 0, .2);
|
| | | z-index: -1;
|
| | | }
|
| | |
|
| | | .rightPanel {
|
| | | width: 100%;
|
| | | max-width: 260px;
|
| | | height: 100vh;
|
| | | position: fixed;
|
| | | top: 0;
|
| | | right: 0;
|
| | | box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, .05);
|
| | | transition: all .25s cubic-bezier(.7, .3, .1, 1);
|
| | | transform: translate(100%);
|
| | | background: #fff;
|
| | | z-index: 40000;
|
| | | }
|
| | |
|
| | | .show {
|
| | | transition: all .3s cubic-bezier(.7, .3, .1, 1);
|
| | |
|
| | | .rightPanel-background {
|
| | | z-index: 20000;
|
| | | opacity: 1;
|
| | | width: 100%;
|
| | | height: 100%;
|
| | | }
|
| | |
|
| | | .rightPanel {
|
| | | transform: translate(0);
|
| | | }
|
| | | }
|
| | |
|
| | | .handle-button {
|
| | | width: 48px;
|
| | | height: 48px;
|
| | | position: absolute;
|
| | | left: -48px;
|
| | | text-align: center;
|
| | | font-size: 24px;
|
| | | border-radius: 6px 0 0 6px !important;
|
| | | z-index: 0;
|
| | | pointer-events: auto;
|
| | | cursor: pointer;
|
| | | color: #fff;
|
| | | line-height: 48px;
|
| | | i {
|
| | | font-size: 24px;
|
| | | line-height: 48px;
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div>
|
| | | <svg-icon icon-class="download" @click="handleDownload"/>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | export default {
|
| | | name: 'RuoYi',
|
| | | data() {
|
| | | return {
|
| | | url: 'https://gitee.com/y_project/RuoYi-Vue'
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | handleDownload() {
|
| | | window.open(this.url)
|
| | | }
|
| | | }
|
| | | }
|
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div>
|
| | | <svg-icon :icon-class="isFullscreen?'exit-fullscreen':'fullscreen'" @click="click" />
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import screenfull from 'screenfull'
|
| | |
|
| | | export default {
|
| | | name: 'Screenfull',
|
| | | data() {
|
| | | return {
|
| | | isFullscreen: false
|
| | | }
|
| | | },
|
| | | mounted() {
|
| | | this.init()
|
| | | },
|
| | | beforeDestroy() {
|
| | | this.destroy()
|
| | | },
|
| | | methods: {
|
| | | click() {
|
| | | if (!screenfull.enabled) {
|
| | | this.$message({
|
| | | message: 'you browser can not work',
|
| | | type: 'warning'
|
| | | })
|
| | | return false
|
| | | }
|
| | | screenfull.toggle()
|
| | | },
|
| | | change() {
|
| | | this.isFullscreen = screenfull.isFullscreen
|
| | | },
|
| | | init() {
|
| | | if (screenfull.enabled) {
|
| | | screenfull.on('change', this.change)
|
| | | }
|
| | | },
|
| | | destroy() {
|
| | | if (screenfull.enabled) {
|
| | | screenfull.off('change', this.change)
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style scoped>
|
| | | .screenfull-svg {
|
| | | display: inline-block;
|
| | | cursor: pointer;
|
| | | fill: #5a5e66;;
|
| | | width: 20px;
|
| | | height: 20px;
|
| | | vertical-align: 10px;
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <el-dropdown trigger="click" @command="handleSetSize">
|
| | | <div>
|
| | | <svg-icon class-name="size-icon" icon-class="size" />
|
| | | </div>
|
| | | <el-dropdown-menu slot="dropdown">
|
| | | <el-dropdown-item v-for="item of sizeOptions" :key="item.value" :disabled="size===item.value" :command="item.value">
|
| | | {{
|
| | | item.label }}
|
| | | </el-dropdown-item>
|
| | | </el-dropdown-menu>
|
| | | </el-dropdown>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | sizeOptions: [
|
| | | { label: 'Default', value: 'default' },
|
| | | { label: 'Medium', value: 'medium' },
|
| | | { label: 'Small', value: 'small' },
|
| | | { label: 'Mini', value: 'mini' }
|
| | | ]
|
| | | }
|
| | | },
|
| | | computed: {
|
| | | size() {
|
| | | return this.$store.getters.size
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | handleSetSize(size) {
|
| | | this.$ELEMENT.size = size
|
| | | this.$store.dispatch('app/setSize', size)
|
| | | this.refreshView()
|
| | | this.$message({
|
| | | message: 'Switch Size Success',
|
| | | type: 'success'
|
| | | })
|
| | | },
|
| | | refreshView() {
|
| | | // In order to make the cached page re-rendered
|
| | | this.$store.dispatch('tagsView/delAllCachedViews', this.$route)
|
| | |
|
| | | const { fullPath } = this.$route
|
| | |
|
| | | this.$nextTick(() => {
|
| | | this.$router.replace({
|
| | | path: '/redirect' + fullPath
|
| | | })
|
| | | })
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div v-if="isExternal" :style="styleExternalIcon" class="svg-external-icon svg-icon" v-on="$listeners" />
|
| | | <svg v-else :class="svgClass" aria-hidden="true" v-on="$listeners">
|
| | | <use :xlink:href="iconName" />
|
| | | </svg>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { isExternal } from '@/utils/validate'
|
| | |
|
| | | export default {
|
| | | name: 'SvgIcon',
|
| | | props: {
|
| | | iconClass: {
|
| | | type: String,
|
| | | required: true
|
| | | },
|
| | | className: {
|
| | | type: String,
|
| | | default: ''
|
| | | }
|
| | | },
|
| | | computed: {
|
| | | isExternal() {
|
| | | return isExternal(this.iconClass)
|
| | | },
|
| | | iconName() {
|
| | | return `#icon-${this.iconClass}`
|
| | | },
|
| | | svgClass() {
|
| | | if (this.className) {
|
| | | return 'svg-icon ' + this.className
|
| | | } else {
|
| | | return 'svg-icon'
|
| | | }
|
| | | },
|
| | | styleExternalIcon() {
|
| | | return {
|
| | | mask: `url(${this.iconClass}) no-repeat 50% 50%`,
|
| | | '-webkit-mask': `url(${this.iconClass}) no-repeat 50% 50%`
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style scoped>
|
| | | .svg-icon {
|
| | | width: 1em;
|
| | | height: 1em;
|
| | | vertical-align: -0.15em;
|
| | | fill: currentColor;
|
| | | overflow: hidden;
|
| | | }
|
| | |
|
| | | .svg-external-icon {
|
| | | background-color: currentColor;
|
| | | mask-size: cover!important;
|
| | | display: inline-block;
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <el-color-picker
|
| | | v-model="theme"
|
| | | :predefine="['#409EFF', '#1890ff', '#304156','#212121','#11a983', '#13c2c2', '#6959CD', '#f5222d', ]"
|
| | | class="theme-picker"
|
| | | popper-class="theme-picker-dropdown"
|
| | | />
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | const version = require('element-ui/package.json').version // element-ui version from node_modules
|
| | | const ORIGINAL_THEME = '#409EFF' // default color
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | chalk: '', // content of theme-chalk css
|
| | | theme: ''
|
| | | }
|
| | | },
|
| | | computed: {
|
| | | defaultTheme() {
|
| | | return this.$store.state.settings.theme
|
| | | }
|
| | | },
|
| | | watch: {
|
| | | defaultTheme: {
|
| | | handler: function(val, oldVal) {
|
| | | this.theme = val
|
| | | },
|
| | | immediate: true
|
| | | },
|
| | | async theme(val) {
|
| | | const oldVal = this.chalk ? this.theme : ORIGINAL_THEME
|
| | | if (typeof val !== 'string') return
|
| | | const themeCluster = this.getThemeCluster(val.replace('#', ''))
|
| | | const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
|
| | | console.log(themeCluster, originalCluster)
|
| | |
|
| | | const $message = this.$message({
|
| | | message: ' Compiling the theme',
|
| | | customClass: 'theme-message',
|
| | | type: 'success',
|
| | | duration: 0,
|
| | | iconClass: 'el-icon-loading'
|
| | | })
|
| | |
|
| | | const getHandler = (variable, id) => {
|
| | | return () => {
|
| | | const originalCluster = this.getThemeCluster(ORIGINAL_THEME.replace('#', ''))
|
| | | const newStyle = this.updateStyle(this[variable], originalCluster, themeCluster)
|
| | |
|
| | | let styleTag = document.getElementById(id)
|
| | | if (!styleTag) {
|
| | | styleTag = document.createElement('style')
|
| | | styleTag.setAttribute('id', id)
|
| | | document.head.appendChild(styleTag)
|
| | | }
|
| | | styleTag.innerText = newStyle
|
| | | }
|
| | | }
|
| | |
|
| | | if (!this.chalk) {
|
| | | const url = `https://unpkg.com/element-ui@${version}/lib/theme-chalk/index.css`
|
| | | await this.getCSSString(url, 'chalk')
|
| | | }
|
| | |
|
| | | const chalkHandler = getHandler('chalk', 'chalk-style')
|
| | |
|
| | | chalkHandler()
|
| | |
|
| | | const styles = [].slice.call(document.querySelectorAll('style'))
|
| | | .filter(style => {
|
| | | const text = style.innerText
|
| | | return new RegExp(oldVal, 'i').test(text) && !/Chalk Variables/.test(text)
|
| | | })
|
| | | styles.forEach(style => {
|
| | | const { innerText } = style
|
| | | if (typeof innerText !== 'string') return
|
| | | style.innerText = this.updateStyle(innerText, originalCluster, themeCluster)
|
| | | })
|
| | |
|
| | | this.$emit('change', val)
|
| | |
|
| | | $message.close()
|
| | | }
|
| | | },
|
| | |
|
| | | methods: {
|
| | | updateStyle(style, oldCluster, newCluster) {
|
| | | let newStyle = style
|
| | | oldCluster.forEach((color, index) => {
|
| | | newStyle = newStyle.replace(new RegExp(color, 'ig'), newCluster[index])
|
| | | })
|
| | | return newStyle
|
| | | },
|
| | |
|
| | | getCSSString(url, variable) {
|
| | | return new Promise(resolve => {
|
| | | const xhr = new XMLHttpRequest()
|
| | | xhr.onreadystatechange = () => {
|
| | | if (xhr.readyState === 4 && xhr.status === 200) {
|
| | | this[variable] = xhr.responseText.replace(/@font-face{[^}]+}/, '')
|
| | | resolve()
|
| | | }
|
| | | }
|
| | | xhr.open('GET', url)
|
| | | xhr.send()
|
| | | })
|
| | | },
|
| | |
|
| | | getThemeCluster(theme) {
|
| | | const tintColor = (color, tint) => {
|
| | | let red = parseInt(color.slice(0, 2), 16)
|
| | | let green = parseInt(color.slice(2, 4), 16)
|
| | | let blue = parseInt(color.slice(4, 6), 16)
|
| | |
|
| | | if (tint === 0) { // when primary color is in its rgb space
|
| | | return [red, green, blue].join(',')
|
| | | } else {
|
| | | red += Math.round(tint * (255 - red))
|
| | | green += Math.round(tint * (255 - green))
|
| | | blue += Math.round(tint * (255 - blue))
|
| | |
|
| | | red = red.toString(16)
|
| | | green = green.toString(16)
|
| | | blue = blue.toString(16)
|
| | |
|
| | | return `#${red}${green}${blue}`
|
| | | }
|
| | | }
|
| | |
|
| | | const shadeColor = (color, shade) => {
|
| | | let red = parseInt(color.slice(0, 2), 16)
|
| | | let green = parseInt(color.slice(2, 4), 16)
|
| | | let blue = parseInt(color.slice(4, 6), 16)
|
| | |
|
| | | red = Math.round((1 - shade) * red)
|
| | | green = Math.round((1 - shade) * green)
|
| | | blue = Math.round((1 - shade) * blue)
|
| | |
|
| | | red = red.toString(16)
|
| | | green = green.toString(16)
|
| | | blue = blue.toString(16)
|
| | |
|
| | | return `#${red}${green}${blue}`
|
| | | }
|
| | |
|
| | | const clusters = [theme]
|
| | | for (let i = 0; i <= 9; i++) {
|
| | | clusters.push(tintColor(theme, Number((i / 10).toFixed(2))))
|
| | | }
|
| | | clusters.push(shadeColor(theme, 0.1))
|
| | | return clusters
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style>
|
| | | .theme-message,
|
| | | .theme-picker-dropdown {
|
| | | z-index: 99999 !important;
|
| | | }
|
| | |
|
| | | .theme-picker .el-color-picker__trigger {
|
| | | height: 26px !important;
|
| | | width: 26px !important;
|
| | | padding: 2px;
|
| | | }
|
| | |
|
| | | .theme-picker-dropdown .el-color-dropdown__link-btn {
|
| | | display: none;
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | /**
|
| | | * æä½æéå¤ç
|
| | | * Copyright (c) 2019 ruoyi
|
| | | */
|
| | | |
| | | import store from '@/store'
|
| | |
|
| | | export default {
|
| | | inserted(el, binding, vnode) {
|
| | | const { value } = binding
|
| | | const all_permission = "*:*:*";
|
| | | const permissions = store.getters && store.getters.permissions
|
| | |
|
| | | if (value && value instanceof Array && value.length > 0) {
|
| | | const permissionFlag = value
|
| | |
|
| | | const hasPermissions = permissions.some(permission => {
|
| | | return all_permission === permission || permissionFlag.includes(permission)
|
| | | })
|
| | |
|
| | | if (!hasPermissions) {
|
| | | el.parentNode && el.parentNode.removeChild(el)
|
| | | }
|
| | | } else {
|
| | | throw new Error(`请设置æä½æéæ ç¾å¼`)
|
| | | }
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | /**
|
| | | * è§è²æéå¤ç
|
| | | * Copyright (c) 2019 ruoyi
|
| | | */
|
| | | |
| | | import store from '@/store'
|
| | |
|
| | | export default {
|
| | | inserted(el, binding, vnode) {
|
| | | const { value } = binding
|
| | | const super_admin = "admin";
|
| | | const roles = store.getters && store.getters.roles
|
| | |
|
| | | if (value && value instanceof Array && value.length > 0) {
|
| | | const roleFlag = value
|
| | |
|
| | | const hasRole = roles.some(role => {
|
| | | return super_admin === role || roleFlag.includes(role)
|
| | | })
|
| | |
|
| | | if (!hasRole) {
|
| | | el.parentNode && el.parentNode.removeChild(el)
|
| | | }
|
| | | } else {
|
| | | throw new Error(`请设置è§è²æéæ ç¾å¼"`)
|
| | | }
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import hasRole from './hasRole'
|
| | | import hasPermi from './hasPermi'
|
| | |
|
| | | const install = function(Vue) {
|
| | | Vue.directive('hasRole', hasRole)
|
| | | Vue.directive('hasPermi', hasPermi)
|
| | | }
|
| | |
|
| | | if (window.Vue) {
|
| | | window['hasRole'] = hasRole
|
| | | window['hasPermi'] = hasPermi
|
| | | Vue.use(install); // eslint-disable-line
|
| | | }
|
| | |
|
| | | export default install
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <section class="app-main">
|
| | | <transition name="fade-transform" mode="out-in">
|
| | | <keep-alive :include="cachedViews">
|
| | | <router-view :key="key" />
|
| | | </keep-alive>
|
| | | </transition>
|
| | | </section>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | export default {
|
| | | name: 'AppMain',
|
| | | computed: {
|
| | | cachedViews() {
|
| | | return this.$store.state.tagsView.cachedViews
|
| | | },
|
| | | key() {
|
| | | return this.$route.path
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .app-main {
|
| | | /* 50= navbar 50 */
|
| | | min-height: calc(100vh - 50px);
|
| | | width: 100%;
|
| | | position: relative;
|
| | | overflow: hidden;
|
| | | }
|
| | |
|
| | | .fixed-header+.app-main {
|
| | | padding-top: 50px;
|
| | | }
|
| | |
|
| | | .hasTagsView {
|
| | | .app-main {
|
| | | /* 84 = navbar + tags-view = 50 + 34 */
|
| | | min-height: calc(100vh - 84px);
|
| | | }
|
| | |
|
| | | .fixed-header+.app-main {
|
| | | padding-top: 84px;
|
| | | }
|
| | | }
|
| | | </style>
|
| | |
|
| | | <style lang="scss">
|
| | | // fix css style bug in open el-dialog
|
| | | .el-popup-parent--hidden {
|
| | | .fixed-header {
|
| | | padding-right: 15px;
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="navbar">
|
| | | <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
| | |
|
| | | <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
|
| | |
|
| | | <div class="right-menu">
|
| | | <template v-if="device!=='mobile'">
|
| | | <search id="header-search" class="right-menu-item" />
|
| | | |
| | | <el-tooltip content="ä¸è½½æºç " effect="dark" placement="bottom">
|
| | | <ruo-yi id="ruoyi" class="right-menu-item hover-effect" />
|
| | | </el-tooltip>
|
| | |
|
| | | <screenfull id="screenfull" class="right-menu-item hover-effect" />
|
| | |
|
| | | <el-tooltip content="å¸å±å¤§å°" effect="dark" placement="bottom">
|
| | | <size-select id="size-select" class="right-menu-item hover-effect" />
|
| | | </el-tooltip>
|
| | |
|
| | | </template>
|
| | |
|
| | | <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
| | | <div class="avatar-wrapper">
|
| | | <img :src="avatar" class="user-avatar">
|
| | | <i class="el-icon-caret-bottom" />
|
| | | </div>
|
| | | <el-dropdown-menu slot="dropdown">
|
| | | <router-link to="/user/profile">
|
| | | <el-dropdown-item>个人ä¸å¿</el-dropdown-item>
|
| | | </router-link>
|
| | | <el-dropdown-item>
|
| | | <span @click="setting = true">å¸å±è®¾ç½®</span>
|
| | | </el-dropdown-item>
|
| | | <el-dropdown-item divided>
|
| | | <span @click="logout">éåºç»å½</span>
|
| | | </el-dropdown-item>
|
| | | </el-dropdown-menu>
|
| | | </el-dropdown>
|
| | | </div>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { mapGetters } from 'vuex'
|
| | | import Breadcrumb from '@/components/Breadcrumb'
|
| | | import Hamburger from '@/components/Hamburger'
|
| | | import Screenfull from '@/components/Screenfull'
|
| | | import SizeSelect from '@/components/SizeSelect'
|
| | | import Search from '@/components/HeaderSearch'
|
| | | import RuoYi from '@/components/RuoYi'
|
| | |
|
| | | export default {
|
| | | components: {
|
| | | Breadcrumb,
|
| | | Hamburger,
|
| | | Screenfull,
|
| | | SizeSelect,
|
| | | Search,
|
| | | RuoYi
|
| | | },
|
| | | computed: {
|
| | | ...mapGetters([
|
| | | 'sidebar',
|
| | | 'avatar',
|
| | | 'device'
|
| | | ]),
|
| | | setting: {
|
| | | get() {
|
| | | return this.$store.state.settings.showSettings
|
| | | },
|
| | | set(val) {
|
| | | this.$store.dispatch('settings/changeSetting', {
|
| | | key: 'showSettings',
|
| | | value: val
|
| | | })
|
| | | }
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | toggleSideBar() {
|
| | | this.$store.dispatch('app/toggleSideBar')
|
| | | },
|
| | | async logout() {
|
| | | this.$confirm('ç¡®å®æ³¨éå¹¶éåºç³»ç»åï¼', 'æç¤º', {
|
| | | confirmButtonText: 'ç¡®å®',
|
| | | cancelButtonText: 'åæ¶',
|
| | | type: 'warning'
|
| | | }).then(() => {
|
| | | this.$store.dispatch('LogOut').then(() => {
|
| | | location.reload()
|
| | | })
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .navbar {
|
| | | height: 50px;
|
| | | overflow: hidden;
|
| | | position: relative;
|
| | | background: #fff;
|
| | | box-shadow: 0 1px 4px rgba(0,21,41,.08);
|
| | |
|
| | | .hamburger-container {
|
| | | line-height: 46px;
|
| | | height: 100%;
|
| | | float: left;
|
| | | cursor: pointer;
|
| | | transition: background .3s;
|
| | | -webkit-tap-highlight-color:transparent;
|
| | |
|
| | | &:hover {
|
| | | background: rgba(0, 0, 0, .025)
|
| | | }
|
| | | }
|
| | |
|
| | | .breadcrumb-container {
|
| | | float: left;
|
| | | }
|
| | |
|
| | | .errLog-container {
|
| | | display: inline-block;
|
| | | vertical-align: top;
|
| | | }
|
| | |
|
| | | .right-menu {
|
| | | float: right;
|
| | | height: 100%;
|
| | | line-height: 50px;
|
| | |
|
| | | &:focus {
|
| | | outline: none;
|
| | | }
|
| | |
|
| | | .right-menu-item {
|
| | | display: inline-block;
|
| | | padding: 0 8px;
|
| | | height: 100%;
|
| | | font-size: 18px;
|
| | | color: #5a5e66;
|
| | | vertical-align: text-bottom;
|
| | |
|
| | | &.hover-effect {
|
| | | cursor: pointer;
|
| | | transition: background .3s;
|
| | |
|
| | | &:hover {
|
| | | background: rgba(0, 0, 0, .025)
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .avatar-container {
|
| | | margin-right: 30px;
|
| | |
|
| | | .avatar-wrapper {
|
| | | margin-top: 5px;
|
| | | position: relative;
|
| | |
|
| | | .user-avatar {
|
| | | cursor: pointer;
|
| | | width: 40px;
|
| | | height: 40px;
|
| | | border-radius: 10px;
|
| | | }
|
| | |
|
| | | .el-icon-caret-bottom {
|
| | | cursor: pointer;
|
| | | position: absolute;
|
| | | right: -20px;
|
| | | top: 25px;
|
| | | font-size: 12px;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="drawer-container">
|
| | | <div>
|
| | | <h3 class="drawer-title">ç³»ç»å¸å±é
ç½®</h3>
|
| | |
|
| | | <div class="drawer-item">
|
| | | <span>主é¢é¢è²</span>
|
| | | <theme-picker style="float: right;height: 26px;margin: -3px 8px 0 0;" @change="themeChange" />
|
| | | </div>
|
| | |
|
| | | <div class="drawer-item">
|
| | | <span>å¼å¯ Tags-Views</span>
|
| | | <el-switch v-model="tagsView" class="drawer-switch" />
|
| | | </div>
|
| | |
|
| | | <div class="drawer-item">
|
| | | <span>åºå® Header</span>
|
| | | <el-switch v-model="fixedHeader" class="drawer-switch" />
|
| | | </div>
|
| | |
|
| | | <div class="drawer-item">
|
| | | <span>æ¾ç¤º Logo</span>
|
| | | <el-switch v-model="sidebarLogo" class="drawer-switch" />
|
| | | </div>
|
| | |
|
| | | </div>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import ThemePicker from '@/components/ThemePicker'
|
| | |
|
| | | export default {
|
| | | components: { ThemePicker },
|
| | | data() {
|
| | | return {}
|
| | | },
|
| | | computed: {
|
| | | fixedHeader: {
|
| | | get() {
|
| | | return this.$store.state.settings.fixedHeader
|
| | | },
|
| | | set(val) {
|
| | | this.$store.dispatch('settings/changeSetting', {
|
| | | key: 'fixedHeader',
|
| | | value: val
|
| | | })
|
| | | }
|
| | | },
|
| | | tagsView: {
|
| | | get() {
|
| | | return this.$store.state.settings.tagsView
|
| | | },
|
| | | set(val) {
|
| | | this.$store.dispatch('settings/changeSetting', {
|
| | | key: 'tagsView',
|
| | | value: val
|
| | | })
|
| | | }
|
| | | },
|
| | | sidebarLogo: {
|
| | | get() {
|
| | | return this.$store.state.settings.sidebarLogo
|
| | | },
|
| | | set(val) {
|
| | | this.$store.dispatch('settings/changeSetting', {
|
| | | key: 'sidebarLogo',
|
| | | value: val
|
| | | })
|
| | | }
|
| | | },
|
| | | },
|
| | | methods: {
|
| | | themeChange(val) {
|
| | | this.$store.dispatch('settings/changeSetting', {
|
| | | key: 'theme',
|
| | | value: val
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .drawer-container {
|
| | | padding: 24px;
|
| | | font-size: 14px;
|
| | | line-height: 1.5;
|
| | | word-wrap: break-word;
|
| | |
|
| | | .drawer-title {
|
| | | margin-bottom: 12px;
|
| | | color: rgba(0, 0, 0, .85);
|
| | | font-size: 14px;
|
| | | line-height: 22px;
|
| | | }
|
| | |
|
| | | .drawer-item {
|
| | | color: rgba(0, 0, 0, .65);
|
| | | font-size: 14px;
|
| | | padding: 12px 0;
|
| | | }
|
| | |
|
| | | .drawer-switch {
|
| | | float: right
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | export default {
|
| | | computed: {
|
| | | device() {
|
| | | return this.$store.state.app.device
|
| | | }
|
| | | },
|
| | | mounted() {
|
| | | // In order to fix the click on menu on the ios device will trigger the mouseleave bug
|
| | | this.fixBugIniOS()
|
| | | },
|
| | | methods: {
|
| | | fixBugIniOS() {
|
| | | const $subMenu = this.$refs.subMenu
|
| | | if ($subMenu) {
|
| | | const handleMouseleave = $subMenu.handleMouseleave
|
| | | $subMenu.handleMouseleave = (e) => {
|
| | | if (this.device === 'mobile') {
|
| | | return
|
| | | }
|
| | | handleMouseleave(e)
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script>
|
| | | export default {
|
| | | name: 'MenuItem',
|
| | | functional: true,
|
| | | props: {
|
| | | icon: {
|
| | | type: String,
|
| | | default: ''
|
| | | },
|
| | | title: {
|
| | | type: String,
|
| | | default: ''
|
| | | }
|
| | | },
|
| | | render(h, context) {
|
| | | const { icon, title } = context.props
|
| | | const vnodes = []
|
| | |
|
| | | if (icon) {
|
| | | vnodes.push(<svg-icon icon-class={icon}/>)
|
| | | }
|
| | |
|
| | | if (title) {
|
| | | vnodes.push(<span slot='title'>{(title)}</span>)
|
| | | }
|
| | | return vnodes
|
| | | }
|
| | | }
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | |
|
| | | <template>
|
| | | <!-- eslint-disable vue/require-component-is -->
|
| | | <component v-bind="linkProps(to)">
|
| | | <slot />
|
| | | </component>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { isExternal } from '@/utils/validate'
|
| | |
|
| | | export default {
|
| | | props: {
|
| | | to: {
|
| | | type: String,
|
| | | required: true
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | linkProps(url) {
|
| | | if (isExternal(url)) {
|
| | | return {
|
| | | is: 'a',
|
| | | href: url,
|
| | | target: '_blank',
|
| | | rel: 'noopener'
|
| | | }
|
| | | }
|
| | | return {
|
| | | is: 'router-link',
|
| | | to: url
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="sidebar-logo-container" :class="{'collapse':collapse}">
|
| | | <transition name="sidebarLogoFade">
|
| | | <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
|
| | | <img v-if="logo" :src="logo" class="sidebar-logo">
|
| | | <h1 v-else class="sidebar-title">{{ title }} </h1>
|
| | | </router-link>
|
| | | <router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
| | | <img v-if="logo" :src="logo" class="sidebar-logo">
|
| | | <h1 class="sidebar-title">{{ title }} </h1>
|
| | | </router-link>
|
| | | </transition>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import logoImg from '@/assets/logo/logo.png'
|
| | |
|
| | | export default {
|
| | | name: 'SidebarLogo',
|
| | | props: {
|
| | | collapse: {
|
| | | type: Boolean,
|
| | | required: true
|
| | | }
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | title: 'è¥ä¾ç®¡çç³»ç»',
|
| | | logo: logoImg
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .sidebarLogoFade-enter-active {
|
| | | transition: opacity 1.5s;
|
| | | }
|
| | |
|
| | | .sidebarLogoFade-enter,
|
| | | .sidebarLogoFade-leave-to {
|
| | | opacity: 0;
|
| | | }
|
| | |
|
| | | .sidebar-logo-container {
|
| | | position: relative;
|
| | | width: 100%;
|
| | | height: 50px;
|
| | | line-height: 50px;
|
| | | background: #2b2f3a;
|
| | | text-align: center;
|
| | | overflow: hidden;
|
| | |
|
| | | & .sidebar-logo-link {
|
| | | height: 100%;
|
| | | width: 100%;
|
| | |
|
| | | & .sidebar-logo {
|
| | | width: 32px;
|
| | | height: 32px;
|
| | | vertical-align: middle;
|
| | | margin-right: 12px;
|
| | | }
|
| | |
|
| | | & .sidebar-title {
|
| | | display: inline-block;
|
| | | margin: 0;
|
| | | color: #fff;
|
| | | font-weight: 600;
|
| | | line-height: 50px;
|
| | | font-size: 14px;
|
| | | font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
|
| | | vertical-align: middle;
|
| | | }
|
| | | }
|
| | |
|
| | | &.collapse {
|
| | | .sidebar-logo {
|
| | | margin-right: 0px;
|
| | | }
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div v-if="!item.hidden" class="menu-wrapper">
|
| | | <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
|
| | | <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
|
| | | <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
|
| | | <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
|
| | | </el-menu-item>
|
| | | </app-link>
|
| | | </template>
|
| | |
|
| | | <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
|
| | | <template slot="title">
|
| | | <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
|
| | | </template>
|
| | | <sidebar-item
|
| | | v-for="child in item.children"
|
| | | :key="child.path"
|
| | | :is-nest="true"
|
| | | :item="child"
|
| | | :base-path="resolvePath(child.path)"
|
| | | class="nest-menu"
|
| | | />
|
| | | </el-submenu>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import path from 'path'
|
| | | import { isExternal } from '@/utils/validate'
|
| | | import Item from './Item'
|
| | | import AppLink from './Link'
|
| | | import FixiOSBug from './FixiOSBug'
|
| | |
|
| | | export default {
|
| | | name: 'SidebarItem',
|
| | | components: { Item, AppLink },
|
| | | mixins: [FixiOSBug],
|
| | | props: {
|
| | | // route object
|
| | | item: {
|
| | | type: Object,
|
| | | required: true
|
| | | },
|
| | | isNest: {
|
| | | type: Boolean,
|
| | | default: false
|
| | | },
|
| | | basePath: {
|
| | | type: String,
|
| | | default: ''
|
| | | }
|
| | | },
|
| | | data() {
|
| | | this.onlyOneChild = null
|
| | | return {}
|
| | | },
|
| | | methods: {
|
| | | hasOneShowingChild(children = [], parent) {
|
| | | const showingChildren = children.filter(item => {
|
| | | if (item.hidden) {
|
| | | return false
|
| | | } else {
|
| | | // Temp set(will be used if only has one showing child)
|
| | | this.onlyOneChild = item
|
| | | return true
|
| | | }
|
| | | })
|
| | |
|
| | | // When there is only one child router, the child router is displayed by default
|
| | | if (showingChildren.length === 1) {
|
| | | return true
|
| | | }
|
| | |
|
| | | // Show parent if there are no child router to display
|
| | | if (showingChildren.length === 0) {
|
| | | this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
|
| | | return true
|
| | | }
|
| | |
|
| | | return false
|
| | | },
|
| | | resolvePath(routePath) {
|
| | | if (isExternal(routePath)) {
|
| | | return routePath
|
| | | }
|
| | | if (isExternal(this.basePath)) {
|
| | | return this.basePath
|
| | | }
|
| | | return path.resolve(this.basePath, routePath)
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div :class="{'has-logo':showLogo}">
|
| | | <logo v-if="showLogo" :collapse="isCollapse" />
|
| | | <el-scrollbar wrap-class="scrollbar-wrapper">
|
| | | <el-menu
|
| | | :default-active="activeMenu"
|
| | | :collapse="isCollapse"
|
| | | :background-color="variables.menuBg"
|
| | | :text-color="variables.menuText"
|
| | | :unique-opened="true"
|
| | | :active-text-color="variables.menuActiveText"
|
| | | :collapse-transition="false"
|
| | | mode="vertical"
|
| | | >
|
| | | <sidebar-item v-for="route in permission_routes" :key="route.path" :item="route" :base-path="route.path" />
|
| | | </el-menu>
|
| | | </el-scrollbar>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { mapGetters } from 'vuex'
|
| | | import Logo from './Logo'
|
| | | import SidebarItem from './SidebarItem'
|
| | | import variables from '@/assets/styles/variables.scss'
|
| | |
|
| | | export default {
|
| | | components: { SidebarItem, Logo },
|
| | | computed: {
|
| | | ...mapGetters([
|
| | | 'permission_routes',
|
| | | 'sidebar'
|
| | | ]),
|
| | | activeMenu() {
|
| | | const route = this.$route
|
| | | const { meta, path } = route
|
| | | // if set path, the sidebar will highlight the path you set
|
| | | if (meta.activeMenu) {
|
| | | return meta.activeMenu
|
| | | }
|
| | | return path
|
| | | },
|
| | | showLogo() {
|
| | | return this.$store.state.settings.sidebarLogo
|
| | | },
|
| | | variables() {
|
| | | return variables
|
| | | },
|
| | | isCollapse() {
|
| | | return !this.sidebar.opened
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <el-scrollbar ref="scrollContainer" :vertical="false" class="scroll-container" @wheel.native.prevent="handleScroll">
|
| | | <slot />
|
| | | </el-scrollbar>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | const tagAndTagSpacing = 4 // tagAndTagSpacing
|
| | |
|
| | | export default {
|
| | | name: 'ScrollPane',
|
| | | data() {
|
| | | return {
|
| | | left: 0
|
| | | }
|
| | | },
|
| | | computed: {
|
| | | scrollWrapper() {
|
| | | return this.$refs.scrollContainer.$refs.wrap
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | handleScroll(e) {
|
| | | const eventDelta = e.wheelDelta || -e.deltaY * 40
|
| | | const $scrollWrapper = this.scrollWrapper
|
| | | $scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4
|
| | | },
|
| | | moveToTarget(currentTag) {
|
| | | const $container = this.$refs.scrollContainer.$el
|
| | | const $containerWidth = $container.offsetWidth
|
| | | const $scrollWrapper = this.scrollWrapper
|
| | | const tagList = this.$parent.$refs.tag
|
| | |
|
| | | let firstTag = null
|
| | | let lastTag = null
|
| | |
|
| | | // find first tag and last tag
|
| | | if (tagList.length > 0) {
|
| | | firstTag = tagList[0]
|
| | | lastTag = tagList[tagList.length - 1]
|
| | | }
|
| | |
|
| | | if (firstTag === currentTag) {
|
| | | $scrollWrapper.scrollLeft = 0
|
| | | } else if (lastTag === currentTag) {
|
| | | $scrollWrapper.scrollLeft = $scrollWrapper.scrollWidth - $containerWidth
|
| | | } else {
|
| | | // find preTag and nextTag
|
| | | const currentIndex = tagList.findIndex(item => item === currentTag)
|
| | | const prevTag = tagList[currentIndex - 1]
|
| | | const nextTag = tagList[currentIndex + 1]
|
| | |
|
| | | // the tag's offsetLeft after of nextTag
|
| | | const afterNextTagOffsetLeft = nextTag.$el.offsetLeft + nextTag.$el.offsetWidth + tagAndTagSpacing
|
| | |
|
| | | // the tag's offsetLeft before of prevTag
|
| | | const beforePrevTagOffsetLeft = prevTag.$el.offsetLeft - tagAndTagSpacing
|
| | |
|
| | | if (afterNextTagOffsetLeft > $scrollWrapper.scrollLeft + $containerWidth) {
|
| | | $scrollWrapper.scrollLeft = afterNextTagOffsetLeft - $containerWidth
|
| | | } else if (beforePrevTagOffsetLeft < $scrollWrapper.scrollLeft) {
|
| | | $scrollWrapper.scrollLeft = beforePrevTagOffsetLeft
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .scroll-container {
|
| | | white-space: nowrap;
|
| | | position: relative;
|
| | | overflow: hidden;
|
| | | width: 100%;
|
| | | /deep/ {
|
| | | .el-scrollbar__bar {
|
| | | bottom: 0px;
|
| | | }
|
| | | .el-scrollbar__wrap {
|
| | | height: 49px;
|
| | | }
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div id="tags-view-container" class="tags-view-container">
|
| | | <scroll-pane ref="scrollPane" class="tags-view-wrapper">
|
| | | <router-link
|
| | | v-for="tag in visitedViews"
|
| | | ref="tag"
|
| | | :key="tag.path"
|
| | | :class="isActive(tag)?'active':''"
|
| | | :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
|
| | | tag="span"
|
| | | class="tags-view-item"
|
| | | @click.middle.native="closeSelectedTag(tag)"
|
| | | @contextmenu.prevent.native="openMenu(tag,$event)"
|
| | | >
|
| | | {{ tag.title }}
|
| | | <span v-if="!tag.meta.affix" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
|
| | | </router-link>
|
| | | </scroll-pane>
|
| | | <ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
|
| | | <li @click="refreshSelectedTag(selectedTag)">å·æ°é¡µé¢</li>
|
| | | <li v-if="!(selectedTag.meta&&selectedTag.meta.affix)" @click="closeSelectedTag(selectedTag)">å
³éå½å</li>
|
| | | <li @click="closeOthersTags">å
³éå
¶ä»</li>
|
| | | <li @click="closeAllTags(selectedTag)">å
³éææ</li>
|
| | | </ul>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import ScrollPane from './ScrollPane'
|
| | | import path from 'path'
|
| | |
|
| | | export default {
|
| | | components: { ScrollPane },
|
| | | data() {
|
| | | return {
|
| | | visible: false,
|
| | | top: 0,
|
| | | left: 0,
|
| | | selectedTag: {},
|
| | | affixTags: []
|
| | | }
|
| | | },
|
| | | computed: {
|
| | | visitedViews() {
|
| | | return this.$store.state.tagsView.visitedViews
|
| | | },
|
| | | routes() {
|
| | | return this.$store.state.permission.routes
|
| | | }
|
| | | },
|
| | | watch: {
|
| | | $route() {
|
| | | this.addTags()
|
| | | this.moveToCurrentTag()
|
| | | },
|
| | | visible(value) {
|
| | | if (value) {
|
| | | document.body.addEventListener('click', this.closeMenu)
|
| | | } else {
|
| | | document.body.removeEventListener('click', this.closeMenu)
|
| | | }
|
| | | }
|
| | | },
|
| | | mounted() {
|
| | | this.initTags()
|
| | | this.addTags()
|
| | | },
|
| | | methods: {
|
| | | isActive(route) {
|
| | | return route.path === this.$route.path
|
| | | },
|
| | | filterAffixTags(routes, basePath = '/') {
|
| | | let tags = []
|
| | | routes.forEach(route => {
|
| | | if (route.meta && route.meta.affix) {
|
| | | const tagPath = path.resolve(basePath, route.path)
|
| | | tags.push({
|
| | | fullPath: tagPath,
|
| | | path: tagPath,
|
| | | name: route.name,
|
| | | meta: { ...route.meta }
|
| | | })
|
| | | }
|
| | | if (route.children) {
|
| | | const tempTags = this.filterAffixTags(route.children, route.path)
|
| | | if (tempTags.length >= 1) {
|
| | | tags = [...tags, ...tempTags]
|
| | | }
|
| | | }
|
| | | })
|
| | | return tags
|
| | | },
|
| | | initTags() {
|
| | | const affixTags = this.affixTags = this.filterAffixTags(this.routes)
|
| | | for (const tag of affixTags) {
|
| | | // Must have tag name
|
| | | if (tag.name) {
|
| | | this.$store.dispatch('tagsView/addVisitedView', tag)
|
| | | }
|
| | | }
|
| | | },
|
| | | addTags() {
|
| | | const { name } = this.$route
|
| | | if (name) {
|
| | | this.$store.dispatch('tagsView/addView', this.$route)
|
| | | }
|
| | | return false
|
| | | },
|
| | | moveToCurrentTag() {
|
| | | const tags = this.$refs.tag
|
| | | this.$nextTick(() => {
|
| | | for (const tag of tags) {
|
| | | if (tag.to.path === this.$route.path) {
|
| | | this.$refs.scrollPane.moveToTarget(tag)
|
| | | // when query is different then update
|
| | | if (tag.to.fullPath !== this.$route.fullPath) {
|
| | | this.$store.dispatch('tagsView/updateVisitedView', this.$route)
|
| | | }
|
| | | break
|
| | | }
|
| | | }
|
| | | })
|
| | | },
|
| | | refreshSelectedTag(view) {
|
| | | this.$store.dispatch('tagsView/delCachedView', view).then(() => {
|
| | | const { fullPath } = view
|
| | | this.$nextTick(() => {
|
| | | this.$router.replace({
|
| | | path: '/redirect' + fullPath
|
| | | })
|
| | | })
|
| | | })
|
| | | },
|
| | | closeSelectedTag(view) {
|
| | | this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
|
| | | if (this.isActive(view)) {
|
| | | this.toLastView(visitedViews, view)
|
| | | }
|
| | | })
|
| | | },
|
| | | closeOthersTags() {
|
| | | this.$router.push(this.selectedTag)
|
| | | this.$store.dispatch('tagsView/delOthersViews', this.selectedTag).then(() => {
|
| | | this.moveToCurrentTag()
|
| | | })
|
| | | },
|
| | | closeAllTags(view) {
|
| | | this.$store.dispatch('tagsView/delAllViews').then(({ visitedViews }) => {
|
| | | if (this.affixTags.some(tag => tag.path === view.path)) {
|
| | | return
|
| | | }
|
| | | this.toLastView(visitedViews, view)
|
| | | })
|
| | | },
|
| | | toLastView(visitedViews, view) {
|
| | | const latestView = visitedViews.slice(-1)[0]
|
| | | if (latestView) {
|
| | | this.$router.push(latestView)
|
| | | } else {
|
| | | // now the default is to redirect to the home page if there is no tags-view,
|
| | | // you can adjust it according to your needs.
|
| | | if (view.name === 'Dashboard') {
|
| | | // to reload home page
|
| | | this.$router.replace({ path: '/redirect' + view.fullPath })
|
| | | } else {
|
| | | this.$router.push('/')
|
| | | }
|
| | | }
|
| | | },
|
| | | openMenu(tag, e) {
|
| | | const menuMinWidth = 105
|
| | | const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
|
| | | const offsetWidth = this.$el.offsetWidth // container width
|
| | | const maxLeft = offsetWidth - menuMinWidth // left boundary
|
| | | const left = e.clientX - offsetLeft + 15 // 15: margin right
|
| | |
|
| | | if (left > maxLeft) {
|
| | | this.left = maxLeft
|
| | | } else {
|
| | | this.left = left
|
| | | }
|
| | |
|
| | | this.top = e.clientY
|
| | | this.visible = true
|
| | | this.selectedTag = tag
|
| | | },
|
| | | closeMenu() {
|
| | | this.visible = false
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .tags-view-container {
|
| | | height: 34px;
|
| | | width: 100%;
|
| | | background: #fff;
|
| | | border-bottom: 1px solid #d8dce5;
|
| | | box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
|
| | | .tags-view-wrapper {
|
| | | .tags-view-item {
|
| | | display: inline-block;
|
| | | position: relative;
|
| | | cursor: pointer;
|
| | | height: 26px;
|
| | | line-height: 26px;
|
| | | border: 1px solid #d8dce5;
|
| | | color: #495060;
|
| | | background: #fff;
|
| | | padding: 0 8px;
|
| | | font-size: 12px;
|
| | | margin-left: 5px;
|
| | | margin-top: 4px;
|
| | | &:first-of-type {
|
| | | margin-left: 15px;
|
| | | }
|
| | | &:last-of-type {
|
| | | margin-right: 15px;
|
| | | }
|
| | | &.active {
|
| | | background-color: #42b983;
|
| | | color: #fff;
|
| | | border-color: #42b983;
|
| | | &::before {
|
| | | content: '';
|
| | | background: #fff;
|
| | | display: inline-block;
|
| | | width: 8px;
|
| | | height: 8px;
|
| | | border-radius: 50%;
|
| | | position: relative;
|
| | | margin-right: 2px;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | .contextmenu {
|
| | | margin: 0;
|
| | | background: #fff;
|
| | | z-index: 3000;
|
| | | position: absolute;
|
| | | list-style-type: none;
|
| | | padding: 5px 0;
|
| | | border-radius: 4px;
|
| | | font-size: 12px;
|
| | | font-weight: 400;
|
| | | color: #333;
|
| | | box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3);
|
| | | li {
|
| | | margin: 0;
|
| | | padding: 7px 16px;
|
| | | cursor: pointer;
|
| | | &:hover {
|
| | | background: #eee;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | </style>
|
| | |
|
| | | <style lang="scss">
|
| | | //reset element css of el-icon-close
|
| | | .tags-view-wrapper {
|
| | | .tags-view-item {
|
| | | .el-icon-close {
|
| | | width: 16px;
|
| | | height: 16px;
|
| | | vertical-align: 2px;
|
| | | border-radius: 50%;
|
| | | text-align: center;
|
| | | transition: all .3s cubic-bezier(.645, .045, .355, 1);
|
| | | transform-origin: 100% 50%;
|
| | | &:before {
|
| | | transform: scale(.6);
|
| | | display: inline-block;
|
| | | vertical-align: -3px;
|
| | | }
|
| | | &:hover {
|
| | | background-color: #b4bccc;
|
| | | color: #fff;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | export { default as AppMain } from './AppMain'
|
| | | export { default as Navbar } from './Navbar'
|
| | | export { default as Settings } from './Settings'
|
| | | export { default as Sidebar } from './Sidebar/index.vue'
|
| | | export { default as TagsView } from './TagsView/index.vue'
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div :class="classObj" class="app-wrapper">
|
| | | <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
|
| | | <sidebar class="sidebar-container" />
|
| | | <div :class="{hasTagsView:needTagsView}" class="main-container">
|
| | | <div :class="{'fixed-header':fixedHeader}">
|
| | | <navbar />
|
| | | <tags-view v-if="needTagsView" />
|
| | | </div>
|
| | | <app-main />
|
| | | <right-panel v-if="showSettings">
|
| | | <settings />
|
| | | </right-panel>
|
| | | </div>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import RightPanel from '@/components/RightPanel'
|
| | | import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'
|
| | | import ResizeMixin from './mixin/ResizeHandler'
|
| | | import { mapState } from 'vuex'
|
| | |
|
| | | export default {
|
| | | name: 'Layout',
|
| | | components: {
|
| | | AppMain,
|
| | | Navbar,
|
| | | RightPanel,
|
| | | Settings,
|
| | | Sidebar,
|
| | | TagsView
|
| | | },
|
| | | mixins: [ResizeMixin],
|
| | | computed: {
|
| | | ...mapState({
|
| | | sidebar: state => state.app.sidebar,
|
| | | device: state => state.app.device,
|
| | | showSettings: state => state.settings.showSettings,
|
| | | needTagsView: state => state.settings.tagsView,
|
| | | fixedHeader: state => state.settings.fixedHeader
|
| | | }),
|
| | | classObj() {
|
| | | return {
|
| | | hideSidebar: !this.sidebar.opened,
|
| | | openSidebar: this.sidebar.opened,
|
| | | withoutAnimation: this.sidebar.withoutAnimation,
|
| | | mobile: this.device === 'mobile'
|
| | | }
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | handleClickOutside() {
|
| | | this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | @import "~@/assets/styles/mixin.scss";
|
| | | @import "~@/assets/styles/variables.scss";
|
| | |
|
| | | .app-wrapper {
|
| | | @include clearfix;
|
| | | position: relative;
|
| | | height: 100%;
|
| | | width: 100%;
|
| | |
|
| | | &.mobile.openSidebar {
|
| | | position: fixed;
|
| | | top: 0;
|
| | | }
|
| | | }
|
| | |
|
| | | .drawer-bg {
|
| | | background: #000;
|
| | | opacity: 0.3;
|
| | | width: 100%;
|
| | | top: 0;
|
| | | height: 100%;
|
| | | position: absolute;
|
| | | z-index: 999;
|
| | | }
|
| | |
|
| | | .fixed-header {
|
| | | position: fixed;
|
| | | top: 0;
|
| | | right: 0;
|
| | | z-index: 9;
|
| | | width: calc(100% - #{$sideBarWidth});
|
| | | transition: width 0.28s;
|
| | | }
|
| | |
|
| | | .hideSidebar .fixed-header {
|
| | | width: calc(100% - 54px)
|
| | | }
|
| | |
|
| | | .mobile .fixed-header {
|
| | | width: 100%;
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import store from '@/store'
|
| | |
|
| | | const { body } = document
|
| | | const WIDTH = 992 // refer to Bootstrap's responsive design
|
| | |
|
| | | export default {
|
| | | watch: {
|
| | | $route(route) {
|
| | | if (this.device === 'mobile' && this.sidebar.opened) {
|
| | | store.dispatch('app/closeSideBar', { withoutAnimation: false })
|
| | | }
|
| | | }
|
| | | },
|
| | | beforeMount() {
|
| | | window.addEventListener('resize', this.$_resizeHandler)
|
| | | },
|
| | | beforeDestroy() {
|
| | | window.removeEventListener('resize', this.$_resizeHandler)
|
| | | },
|
| | | mounted() {
|
| | | const isMobile = this.$_isMobile()
|
| | | if (isMobile) {
|
| | | store.dispatch('app/toggleDevice', 'mobile')
|
| | | store.dispatch('app/closeSideBar', { withoutAnimation: true })
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | // use $_ for mixins properties
|
| | | // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
|
| | | $_isMobile() {
|
| | | const rect = body.getBoundingClientRect()
|
| | | return rect.width - 1 < WIDTH
|
| | | },
|
| | | $_resizeHandler() {
|
| | | if (!document.hidden) {
|
| | | const isMobile = this.$_isMobile()
|
| | | store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop')
|
| | |
|
| | | if (isMobile) {
|
| | | store.dispatch('app/closeSideBar', { withoutAnimation: true })
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import Vue from 'vue'
|
| | |
|
| | | import Cookies from 'js-cookie'
|
| | |
|
| | | import 'normalize.css/normalize.css' // a modern alternative to CSS resets
|
| | |
|
| | | import Element from 'element-ui'
|
| | | import './assets/styles/element-variables.scss'
|
| | |
|
| | | import '@/assets/styles/index.scss' // global css
|
| | | import '@/assets/styles/ruoyi.scss' // ruoyi css
|
| | | import App from './App'
|
| | | import store from './store'
|
| | | import router from './router'
|
| | | import permission from './directive/permission'
|
| | |
|
| | | import './assets/icons' // icon
|
| | | import './permission' // permission control
|
| | | import { getDicts } from "@/api/system/dict/data";
|
| | | import { getConfigKey } from "@/api/system/config";
|
| | | import { dateFormat, resetForm, addDateRange, selectDictLabel } from "@/utils/ruoyi";
|
| | | import Pagination from "@/components/Pagination";
|
| | |
|
| | | // å
¨å±æ¹æ³æè½½
|
| | | Vue.prototype.getDicts = getDicts
|
| | | Vue.prototype.getConfigKey = getConfigKey
|
| | | Vue.prototype.dateFormat = dateFormat
|
| | | Vue.prototype.resetForm = resetForm
|
| | | Vue.prototype.addDateRange = addDateRange
|
| | | Vue.prototype.selectDictLabel = selectDictLabel
|
| | |
|
| | | Vue.prototype.msgSuccess = function (msg) {
|
| | | this.$message({ showClose: true, message: msg, type: "success" });
|
| | | }
|
| | |
|
| | | Vue.prototype.msgError = function (msg) {
|
| | | this.$message({ showClose: true, message: msg, type: "error" });
|
| | | }
|
| | |
|
| | | Vue.prototype.msgInfo = function (msg) {
|
| | | this.$message.info(msg);
|
| | | }
|
| | |
|
| | | // å
¨å±ç»ä»¶æè½½
|
| | | Vue.component('Pagination', Pagination)
|
| | |
|
| | | Vue.use(permission)
|
| | |
|
| | | /**
|
| | | * If you don't want to use mock-server
|
| | | * you want to use MockJs for mock api
|
| | | * you can execute: mockXHR()
|
| | | *
|
| | | * Currently MockJs will be used in the production environment,
|
| | | * please remove it before going online! ! !
|
| | | */
|
| | |
|
| | | Vue.use(Element, {
|
| | | size: Cookies.get('size') || 'medium' // set element-ui default size
|
| | | })
|
| | |
|
| | | Vue.config.productionTip = false
|
| | |
|
| | | new Vue({
|
| | | el: '#app',
|
| | | router,
|
| | | store,
|
| | | render: h => h(App)
|
| | | })
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import router from './router'
|
| | | import store from './store'
|
| | | import { Message } from 'element-ui'
|
| | | import NProgress from 'nprogress'
|
| | | import 'nprogress/nprogress.css'
|
| | | import { getToken } from '@/utils/auth'
|
| | |
|
| | | NProgress.configure({ showSpinner: false })
|
| | |
|
| | | const whiteList = ['/login', '/auth-redirect', '/bind', '/register']
|
| | |
|
| | | router.beforeEach((to, from, next) => {
|
| | | NProgress.start()
|
| | | if (getToken()) {
|
| | | /* has token*/
|
| | | if (to.path === '/login') {
|
| | | next({ path: '/' })
|
| | | NProgress.done()
|
| | | } else {
|
| | | if (store.getters.roles.length === 0) {
|
| | | // 夿å½åç¨æ·æ¯å¦å·²æåå®user_infoä¿¡æ¯
|
| | | store.dispatch('GetInfo').then(res => {
|
| | | // æåuser_info
|
| | | const roles = res.roles
|
| | | store.dispatch('GenerateRoutes', { roles }).then(accessRoutes => {
|
| | | // æµè¯ é»è®¤éæé¡µé¢
|
| | | // store.dispatch('permission/generateRoutes', { roles }).then(accessRoutes => {
|
| | | // æ ¹æ®rolesæéçæå¯è®¿é®çè·¯ç±è¡¨
|
| | | router.addRoutes(accessRoutes) // å¨ææ·»å å¯è®¿é®è·¯ç±è¡¨
|
| | | next({ ...to, replace: true }) // hackæ¹æ³ ç¡®ä¿addRoutes已宿
|
| | | })
|
| | | })
|
| | | .catch(err => {
|
| | | store.dispatch('FedLogOut').then(() => {
|
| | | Message.error(err)
|
| | | next({ path: '/' })
|
| | | })
|
| | | })
|
| | | } else {
|
| | | next()
|
| | | // 没æå¨ææ¹åæéçéæ±å¯ç´æ¥next() å é¤ä¸æ¹æé夿 â
|
| | | // if (hasPermission(store.getters.roles, to.meta.roles)) {
|
| | | // next()
|
| | | // } else {
|
| | | // next({ path: '/401', replace: true, query: { noGoBack: true }})
|
| | | // }
|
| | | // å¯å â
|
| | | }
|
| | | }
|
| | | } else {
|
| | | // 没ætoken
|
| | | if (whiteList.indexOf(to.path) !== -1) {
|
| | | // å¨å
ç»å½ç½ååï¼ç´æ¥è¿å
¥
|
| | | next()
|
| | | } else {
|
| | | next(`/login?redirect=${to.path}`) // å¦åå
¨é¨éå®åå°ç»å½é¡µ
|
| | | NProgress.done()
|
| | | }
|
| | | }
|
| | | })
|
| | |
|
| | | router.afterEach(() => {
|
| | | NProgress.done()
|
| | | })
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import Vue from 'vue'
|
| | | import Router from 'vue-router'
|
| | |
|
| | | Vue.use(Router)
|
| | |
|
| | | /* Layout */
|
| | | import Layout from '@/layout'
|
| | |
|
| | | /**
|
| | | * Note: è·¯ç±é
置项
|
| | | *
|
| | | * hidden: true // å½è®¾ç½® true çæ¶å该路ç±ä¸ä¼åä¾§è¾¹æ åºç° å¦401ï¼loginç页é¢ï¼æè
å¦ä¸äºç¼è¾é¡µé¢/edit/1
|
| | | * alwaysShow: true // å½ä½ ä¸ä¸ªè·¯ç±ä¸é¢ç children 声æçè·¯ç±å¤§äº1个æ¶ï¼èªå¨ä¼åæåµå¥ç模å¼--å¦ç»ä»¶é¡µé¢
|
| | | * // åªæä¸ä¸ªæ¶ï¼ä¼å°é£ä¸ªåè·¯ç±å½åæ ¹è·¯ç±æ¾ç¤ºå¨ä¾§è¾¹æ --å¦å¼å¯¼é¡µé¢
|
| | | * // è¥ä½ æ³ä¸ç®¡è·¯ç±ä¸é¢ç children 声æç个æ°é½æ¾ç¤ºä½ çæ ¹è·¯ç±
|
| | | * // ä½ å¯ä»¥è®¾ç½® alwaysShow: trueï¼è¿æ ·å®å°±ä¼å¿½ç¥ä¹åå®ä¹çè§åï¼ä¸ç´æ¾ç¤ºæ ¹è·¯ç±
|
| | | * redirect: noRedirect // å½è®¾ç½® noRedirect çæ¶å该路ç±å¨é¢å
å±å¯¼èªä¸ä¸å¯è¢«ç¹å»
|
| | | * name:'router-name' // 设å®è·¯ç±çååï¼ä¸å®è¦å¡«åä¸ç¶ä½¿ç¨<keep-alive>æ¶ä¼åºç°åç§é®é¢
|
| | | * meta : {
|
| | | roles: ['admin','editor'] // 设置该路ç±è¿å
¥çæéï¼æ¯æå¤ä¸ªæéå å
|
| | | title: 'title' // 设置该路ç±å¨ä¾§è¾¹æ åé¢å
å±ä¸å±ç¤ºçåå
|
| | | icon: 'svg-name' // 设置该路ç±ç徿 ï¼å¯¹åºè·¯å¾src/icons/svg
|
| | | breadcrumb: false // å¦æè®¾ç½®ä¸ºfalseï¼åä¸ä¼å¨breadcrumbé¢å
å±ä¸æ¾ç¤º
|
| | | }
|
| | | */
|
| | |
|
| | | // å
Œ
±è·¯ç±
|
| | | export const constantRoutes = [
|
| | | {
|
| | | path: '/redirect',
|
| | | component: Layout,
|
| | | hidden: true,
|
| | | children: [
|
| | | {
|
| | | path: '/redirect/:path*',
|
| | | component: () => import('@/views/redirect')
|
| | | }
|
| | | ]
|
| | | },
|
| | | {
|
| | | path: '/login',
|
| | | component: () => import('@/views/login'),
|
| | | hidden: true
|
| | | },
|
| | | {
|
| | | path: '/404',
|
| | | component: () => import('@/views/error/404'),
|
| | | hidden: true
|
| | | },
|
| | | {
|
| | | path: '/401',
|
| | | component: () => import('@/views/error/401'),
|
| | | hidden: true
|
| | | },
|
| | | {
|
| | | path: '',
|
| | | component: Layout,
|
| | | redirect: 'index',
|
| | | children: [
|
| | | {
|
| | | path: 'index',
|
| | | component: () => import('@/views/index'),
|
| | | name: 'é¦é¡µ',
|
| | | meta: { title: 'é¦é¡µ', icon: 'dashboard', noCache: true, affix: true }
|
| | | }
|
| | | ]
|
| | | },
|
| | | {
|
| | | path: '/user',
|
| | | component: Layout,
|
| | | hidden: true,
|
| | | redirect: 'noredirect',
|
| | | children: [
|
| | | {
|
| | | path: 'profile',
|
| | | component: () => import('@/views/system/user/profile/index'),
|
| | | name: '个人ä¸å¿',
|
| | | meta: { title: '个人ä¸å¿', icon: 'user' }
|
| | | }
|
| | | ]
|
| | | },
|
| | | {
|
| | | path: '/dict',
|
| | | component: Layout,
|
| | | hidden: true,
|
| | | children: [
|
| | | {
|
| | | path: 'type/data/:dictId(\\d+)',
|
| | | component: () => import('@/views/system/dict/data'),
|
| | | name: 'åå
¸æ°æ®',
|
| | | meta: { title: 'åå
¸æ°æ®', icon: '' }
|
| | | }
|
| | | ]
|
| | | }
|
| | | ]
|
| | |
|
| | | export default new Router({
|
| | | mode: 'history', // 廿urlä¸ç#
|
| | | scrollBehavior: () => ({ y: 0 }),
|
| | | routes: constantRoutes
|
| | | })
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | module.exports = {
|
| | | title: 'è¥ä¾ç®¡çç³»ç»',
|
| | |
|
| | | /**
|
| | | * æ¯å¦ç³»ç»å¸å±é
ç½®
|
| | | */
|
| | | showSettings: false,
|
| | |
|
| | | /**
|
| | | * æ¯å¦æ¾ç¤º tagsView
|
| | | */
|
| | | tagsView: true,
|
| | |
|
| | | /**
|
| | | * æ¯å¦åºå®å¤´é¨
|
| | | */
|
| | | fixedHeader: false,
|
| | |
|
| | | /**
|
| | | * æ¯å¦æ¾ç¤ºlogo
|
| | | */
|
| | | sidebarLogo: true,
|
| | |
|
| | | /**
|
| | | * @type {string | array} 'production' | ['production', 'development']
|
| | | * @description Need show err logs component.
|
| | | * The default is only used in the production env
|
| | | * If you want to also use it in dev, you can pass ['production', 'development']
|
| | | */
|
| | | errorLog: 'production'
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | const getters = {
|
| | | sidebar: state => state.app.sidebar,
|
| | | size: state => state.app.size,
|
| | | device: state => state.app.device,
|
| | | visitedViews: state => state.tagsView.visitedViews,
|
| | | cachedViews: state => state.tagsView.cachedViews,
|
| | | token: state => state.user.token,
|
| | | avatar: state => state.user.avatar,
|
| | | name: state => state.user.name,
|
| | | introduction: state => state.user.introduction,
|
| | | roles: state => state.user.roles,
|
| | | permissions: state => state.user.permissions,
|
| | | permission_routes: state => state.permission.routes
|
| | | }
|
| | | export default getters
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import Vue from 'vue'
|
| | | import Vuex from 'vuex'
|
| | | import app from './modules/app'
|
| | | import user from './modules/user'
|
| | | import tagsView from './modules/tagsView'
|
| | | import permission from './modules/permission'
|
| | | import settings from './modules/settings'
|
| | | import getters from './getters'
|
| | |
|
| | | Vue.use(Vuex)
|
| | |
|
| | | const store = new Vuex.Store({
|
| | | modules: {
|
| | | app,
|
| | | user,
|
| | | tagsView,
|
| | | permission,
|
| | | settings
|
| | | },
|
| | | getters
|
| | | })
|
| | |
|
| | | export default store
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import Cookies from 'js-cookie'
|
| | |
|
| | | const state = {
|
| | | sidebar: {
|
| | | opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
|
| | | withoutAnimation: false
|
| | | },
|
| | | device: 'desktop',
|
| | | size: Cookies.get('size') || 'medium'
|
| | | }
|
| | |
|
| | | const mutations = {
|
| | | TOGGLE_SIDEBAR: state => {
|
| | | state.sidebar.opened = !state.sidebar.opened
|
| | | state.sidebar.withoutAnimation = false
|
| | | if (state.sidebar.opened) {
|
| | | Cookies.set('sidebarStatus', 1)
|
| | | } else {
|
| | | Cookies.set('sidebarStatus', 0)
|
| | | }
|
| | | },
|
| | | CLOSE_SIDEBAR: (state, withoutAnimation) => {
|
| | | Cookies.set('sidebarStatus', 0)
|
| | | state.sidebar.opened = false
|
| | | state.sidebar.withoutAnimation = withoutAnimation
|
| | | },
|
| | | TOGGLE_DEVICE: (state, device) => {
|
| | | state.device = device
|
| | | },
|
| | | SET_SIZE: (state, size) => {
|
| | | state.size = size
|
| | | Cookies.set('size', size)
|
| | | }
|
| | | }
|
| | |
|
| | | const actions = {
|
| | | toggleSideBar({ commit }) {
|
| | | commit('TOGGLE_SIDEBAR')
|
| | | },
|
| | | closeSideBar({ commit }, { withoutAnimation }) {
|
| | | commit('CLOSE_SIDEBAR', withoutAnimation)
|
| | | },
|
| | | toggleDevice({ commit }, device) {
|
| | | commit('TOGGLE_DEVICE', device)
|
| | | },
|
| | | setSize({ commit }, size) {
|
| | | commit('SET_SIZE', size)
|
| | | }
|
| | | }
|
| | |
|
| | | export default {
|
| | | namespaced: true,
|
| | | state,
|
| | | mutations,
|
| | | actions
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { constantRoutes } from '@/router'
|
| | | import { getRouters } from '@/api/menu'
|
| | | import Layout from '@/layout/index'
|
| | |
|
| | | const permission = {
|
| | | state: {
|
| | | routes: [],
|
| | | addRoutes: []
|
| | | },
|
| | | mutations: {
|
| | | SET_ROUTES: (state, routes) => {
|
| | | state.addRoutes = routes
|
| | | state.routes = constantRoutes.concat(routes)
|
| | | }
|
| | | },
|
| | | actions: {
|
| | | // çæè·¯ç±
|
| | | GenerateRoutes({ commit }) {
|
| | | return new Promise(resolve => {
|
| | | // åå端请æ±è·¯ç±æ°æ®
|
| | | getRouters().then(res => {
|
| | | const accessedRoutes = filterAsyncRouter(res.data)
|
| | | commit('SET_ROUTES', accessedRoutes)
|
| | | resolve(accessedRoutes)
|
| | | })
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // éååå°ä¼ æ¥çè·¯ç±å符串ï¼è½¬æ¢ä¸ºç»ä»¶å¯¹è±¡
|
| | | function filterAsyncRouter(asyncRouterMap) {
|
| | | return asyncRouterMap.filter(route => {
|
| | | if (route.component) {
|
| | | // Layoutç»ä»¶ç¹æ®å¤ç
|
| | | if (route.component === 'Layout') {
|
| | | route.component = Layout
|
| | | } else {
|
| | | route.component = loadView(route.component)
|
| | | }
|
| | | }
|
| | | if (route.children != null && route.children && route.children.length) {
|
| | | route.children = filterAsyncRouter(route.children)
|
| | | }
|
| | | return true
|
| | | })
|
| | | }
|
| | |
|
| | | export const loadView = (view) => { // è·¯ç±æå è½½
|
| | | return () => import(`@/views/${view}`)
|
| | | }
|
| | |
|
| | | export default permission
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import variables from '@/assets/styles/element-variables.scss'
|
| | | import defaultSettings from '@/settings'
|
| | |
|
| | | const { showSettings, tagsView, fixedHeader, sidebarLogo } = defaultSettings
|
| | |
|
| | | const state = {
|
| | | theme: variables.theme,
|
| | | showSettings: showSettings,
|
| | | tagsView: tagsView,
|
| | | fixedHeader: fixedHeader,
|
| | | sidebarLogo: sidebarLogo
|
| | | }
|
| | |
|
| | | const mutations = {
|
| | | CHANGE_SETTING: (state, { key, value }) => {
|
| | | if (state.hasOwnProperty(key)) {
|
| | | state[key] = value
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | const actions = {
|
| | | changeSetting({ commit }, data) {
|
| | | commit('CHANGE_SETTING', data)
|
| | | }
|
| | | }
|
| | |
|
| | | export default {
|
| | | namespaced: true,
|
| | | state,
|
| | | mutations,
|
| | | actions
|
| | | }
|
| | |
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | const state = {
|
| | | visitedViews: [],
|
| | | cachedViews: []
|
| | | }
|
| | |
|
| | | const mutations = {
|
| | | ADD_VISITED_VIEW: (state, view) => {
|
| | | if (state.visitedViews.some(v => v.path === view.path)) return
|
| | | state.visitedViews.push(
|
| | | Object.assign({}, view, {
|
| | | title: view.meta.title || 'no-name'
|
| | | })
|
| | | )
|
| | | },
|
| | | ADD_CACHED_VIEW: (state, view) => {
|
| | | if (state.cachedViews.includes(view.name)) return
|
| | | if (!view.meta.noCache) {
|
| | | state.cachedViews.push(view.name)
|
| | | }
|
| | | },
|
| | |
|
| | | DEL_VISITED_VIEW: (state, view) => {
|
| | | for (const [i, v] of state.visitedViews.entries()) {
|
| | | if (v.path === view.path) {
|
| | | state.visitedViews.splice(i, 1)
|
| | | break
|
| | | }
|
| | | }
|
| | | },
|
| | | DEL_CACHED_VIEW: (state, view) => {
|
| | | for (const i of state.cachedViews) {
|
| | | if (i === view.name) {
|
| | | const index = state.cachedViews.indexOf(i)
|
| | | state.cachedViews.splice(index, 1)
|
| | | break
|
| | | }
|
| | | }
|
| | | },
|
| | |
|
| | | DEL_OTHERS_VISITED_VIEWS: (state, view) => {
|
| | | state.visitedViews = state.visitedViews.filter(v => {
|
| | | return v.meta.affix || v.path === view.path
|
| | | })
|
| | | },
|
| | | DEL_OTHERS_CACHED_VIEWS: (state, view) => {
|
| | | for (const i of state.cachedViews) {
|
| | | if (i === view.name) {
|
| | | const index = state.cachedViews.indexOf(i)
|
| | | state.cachedViews = state.cachedViews.slice(index, index + 1)
|
| | | break
|
| | | }
|
| | | }
|
| | | },
|
| | |
|
| | | DEL_ALL_VISITED_VIEWS: state => {
|
| | | // keep affix tags
|
| | | const affixTags = state.visitedViews.filter(tag => tag.meta.affix)
|
| | | state.visitedViews = affixTags
|
| | | },
|
| | | DEL_ALL_CACHED_VIEWS: state => {
|
| | | state.cachedViews = []
|
| | | },
|
| | |
|
| | | UPDATE_VISITED_VIEW: (state, view) => {
|
| | | for (let v of state.visitedViews) {
|
| | | if (v.path === view.path) {
|
| | | v = Object.assign(v, view)
|
| | | break
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | const actions = {
|
| | | addView({ dispatch }, view) {
|
| | | dispatch('addVisitedView', view)
|
| | | dispatch('addCachedView', view)
|
| | | },
|
| | | addVisitedView({ commit }, view) {
|
| | | commit('ADD_VISITED_VIEW', view)
|
| | | },
|
| | | addCachedView({ commit }, view) {
|
| | | commit('ADD_CACHED_VIEW', view)
|
| | | },
|
| | |
|
| | | delView({ dispatch, state }, view) {
|
| | | return new Promise(resolve => {
|
| | | dispatch('delVisitedView', view)
|
| | | dispatch('delCachedView', view)
|
| | | resolve({
|
| | | visitedViews: [...state.visitedViews],
|
| | | cachedViews: [...state.cachedViews]
|
| | | })
|
| | | })
|
| | | },
|
| | | delVisitedView({ commit, state }, view) {
|
| | | return new Promise(resolve => {
|
| | | commit('DEL_VISITED_VIEW', view)
|
| | | resolve([...state.visitedViews])
|
| | | })
|
| | | },
|
| | | delCachedView({ commit, state }, view) {
|
| | | return new Promise(resolve => {
|
| | | commit('DEL_CACHED_VIEW', view)
|
| | | resolve([...state.cachedViews])
|
| | | })
|
| | | },
|
| | |
|
| | | delOthersViews({ dispatch, state }, view) {
|
| | | return new Promise(resolve => {
|
| | | dispatch('delOthersVisitedViews', view)
|
| | | dispatch('delOthersCachedViews', view)
|
| | | resolve({
|
| | | visitedViews: [...state.visitedViews],
|
| | | cachedViews: [...state.cachedViews]
|
| | | })
|
| | | })
|
| | | },
|
| | | delOthersVisitedViews({ commit, state }, view) {
|
| | | return new Promise(resolve => {
|
| | | commit('DEL_OTHERS_VISITED_VIEWS', view)
|
| | | resolve([...state.visitedViews])
|
| | | })
|
| | | },
|
| | | delOthersCachedViews({ commit, state }, view) {
|
| | | return new Promise(resolve => {
|
| | | commit('DEL_OTHERS_CACHED_VIEWS', view)
|
| | | resolve([...state.cachedViews])
|
| | | })
|
| | | },
|
| | |
|
| | | delAllViews({ dispatch, state }, view) {
|
| | | return new Promise(resolve => {
|
| | | dispatch('delAllVisitedViews', view)
|
| | | dispatch('delAllCachedViews', view)
|
| | | resolve({
|
| | | visitedViews: [...state.visitedViews],
|
| | | cachedViews: [...state.cachedViews]
|
| | | })
|
| | | })
|
| | | },
|
| | | delAllVisitedViews({ commit, state }) {
|
| | | return new Promise(resolve => {
|
| | | commit('DEL_ALL_VISITED_VIEWS')
|
| | | resolve([...state.visitedViews])
|
| | | })
|
| | | },
|
| | | delAllCachedViews({ commit, state }) {
|
| | | return new Promise(resolve => {
|
| | | commit('DEL_ALL_CACHED_VIEWS')
|
| | | resolve([...state.cachedViews])
|
| | | })
|
| | | },
|
| | |
|
| | | updateVisitedView({ commit }, view) {
|
| | | commit('UPDATE_VISITED_VIEW', view)
|
| | | }
|
| | | }
|
| | |
|
| | | export default {
|
| | | namespaced: true,
|
| | | state,
|
| | | mutations,
|
| | | actions
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { login, logout, getInfo } from '@/api/login'
|
| | | import { getToken, setToken, removeToken } from '@/utils/auth'
|
| | |
|
| | | const user = {
|
| | | state: {
|
| | | token: getToken(),
|
| | | name: '',
|
| | | avatar: '',
|
| | | roles: [],
|
| | | permissions: []
|
| | | },
|
| | |
|
| | | mutations: {
|
| | | SET_TOKEN: (state, token) => {
|
| | | state.token = token
|
| | | },
|
| | | SET_NAME: (state, name) => {
|
| | | state.name = name
|
| | | },
|
| | | SET_AVATAR: (state, avatar) => {
|
| | | state.avatar = avatar
|
| | | },
|
| | | SET_ROLES: (state, roles) => {
|
| | | state.roles = roles
|
| | | },
|
| | | SET_PERMISSIONS: (state, permissions) => {
|
| | | state.permissions = permissions
|
| | | }
|
| | | },
|
| | |
|
| | | actions: {
|
| | | // ç»å½
|
| | | Login({ commit }, userInfo) {
|
| | | const username = userInfo.username.trim()
|
| | | const password = userInfo.password
|
| | | const code = userInfo.code
|
| | | const uuid = userInfo.uuid
|
| | | return new Promise((resolve, reject) => {
|
| | | login(username, password, code, uuid).then(res => {
|
| | | setToken(res.token)
|
| | | commit('SET_TOKEN', res.token)
|
| | | resolve()
|
| | | }).catch(error => {
|
| | | reject(error)
|
| | | })
|
| | | })
|
| | | },
|
| | |
|
| | | // è·åç¨æ·ä¿¡æ¯
|
| | | GetInfo({ commit, state }) {
|
| | | return new Promise((resolve, reject) => {
|
| | | getInfo(state.token).then(res => {
|
| | | const user = res.user
|
| | | const avatar = user.avatar == "" ? require("@/assets/image/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
|
| | | if (res.roles && res.roles.length > 0) { // éªè¯è¿åçrolesæ¯å¦æ¯ä¸ä¸ªé空æ°ç»
|
| | | commit('SET_ROLES', res.roles)
|
| | | commit('SET_PERMISSIONS', res.permissions)
|
| | | } else {
|
| | | commit('SET_ROLES', ['ROLE_DEFAULT'])
|
| | | }
|
| | | commit('SET_NAME', user.username)
|
| | | commit('SET_AVATAR', avatar)
|
| | | resolve(res)
|
| | | }).catch(error => {
|
| | | reject(error)
|
| | | })
|
| | | })
|
| | | },
|
| | | |
| | | // éåºç³»ç»
|
| | | LogOut({ commit, state }) {
|
| | | return new Promise((resolve, reject) => {
|
| | | logout(state.token).then(() => {
|
| | | commit('SET_TOKEN', '')
|
| | | commit('SET_ROLES', [])
|
| | | commit('SET_PERMISSIONS', [])
|
| | | removeToken()
|
| | | resolve()
|
| | | }).catch(error => {
|
| | | reject(error)
|
| | | })
|
| | | })
|
| | | },
|
| | |
|
| | | // å端 ç»åº
|
| | | FedLogOut({ commit }) {
|
| | | return new Promise(resolve => {
|
| | | commit('SET_TOKEN', '')
|
| | | removeToken()
|
| | | resolve()
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | export default user
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import Cookies from 'js-cookie'
|
| | |
|
| | | const TokenKey = 'Admin-Token'
|
| | |
|
| | | export function getToken() {
|
| | | return Cookies.get(TokenKey)
|
| | | }
|
| | |
|
| | | export function setToken(token) {
|
| | | return Cookies.set(TokenKey, token)
|
| | | }
|
| | |
|
| | | export function removeToken() {
|
| | | return Cookies.remove(TokenKey)
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | /**
|
| | | * è¡¨æ ¼æ¶é´æ ¼å¼å
|
| | | */
|
| | | export function formatDate(cellValue) {
|
| | | if (cellValue == null || cellValue == "") return "";
|
| | | var date = new Date(cellValue) |
| | | var year = date.getFullYear()
|
| | | var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
|
| | | var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() |
| | | var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() |
| | | var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() |
| | | var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
|
| | | return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {number} time
|
| | | * @param {string} option
|
| | | * @returns {string}
|
| | | */
|
| | | export function formatTime(time, option) {
|
| | | if (('' + time).length === 10) {
|
| | | time = parseInt(time) * 1000
|
| | | } else {
|
| | | time = +time
|
| | | }
|
| | | const d = new Date(time)
|
| | | const now = Date.now()
|
| | |
|
| | | const diff = (now - d) / 1000
|
| | |
|
| | | if (diff < 30) {
|
| | | return 'åå'
|
| | | } else if (diff < 3600) {
|
| | | // less 1 hour
|
| | | return Math.ceil(diff / 60) + 'åéå'
|
| | | } else if (diff < 3600 * 24) {
|
| | | return Math.ceil(diff / 3600) + 'å°æ¶å'
|
| | | } else if (diff < 3600 * 24 * 2) {
|
| | | return '1天å'
|
| | | }
|
| | | if (option) {
|
| | | return parseTime(time, option)
|
| | | } else {
|
| | | return (
|
| | | d.getMonth() +
|
| | | 1 +
|
| | | 'æ' +
|
| | | d.getDate() +
|
| | | 'æ¥' +
|
| | | d.getHours() +
|
| | | 'æ¶' +
|
| | | d.getMinutes() +
|
| | | 'å'
|
| | | )
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {string} url
|
| | | * @returns {Object}
|
| | | */
|
| | | export function getQueryObject(url) {
|
| | | url = url == null ? window.location.href : url
|
| | | const search = url.substring(url.lastIndexOf('?') + 1)
|
| | | const obj = {}
|
| | | const reg = /([^?&=]+)=([^?&=]*)/g
|
| | | search.replace(reg, (rs, $1, $2) => {
|
| | | const name = decodeURIComponent($1)
|
| | | let val = decodeURIComponent($2)
|
| | | val = String(val)
|
| | | obj[name] = val
|
| | | return rs
|
| | | })
|
| | | return obj
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {string} input value
|
| | | * @returns {number} output value
|
| | | */
|
| | | export function byteLength(str) {
|
| | | // returns the byte length of an utf8 string
|
| | | let s = str.length
|
| | | for (var i = str.length - 1; i >= 0; i--) {
|
| | | const code = str.charCodeAt(i)
|
| | | if (code > 0x7f && code <= 0x7ff) s++
|
| | | else if (code > 0x7ff && code <= 0xffff) s += 2
|
| | | if (code >= 0xDC00 && code <= 0xDFFF) i--
|
| | | }
|
| | | return s
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {Array} actual
|
| | | * @returns {Array}
|
| | | */
|
| | | export function cleanArray(actual) {
|
| | | const newArray = []
|
| | | for (let i = 0; i < actual.length; i++) {
|
| | | if (actual[i]) {
|
| | | newArray.push(actual[i])
|
| | | }
|
| | | }
|
| | | return newArray
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {Object} json
|
| | | * @returns {Array}
|
| | | */
|
| | | export function param(json) {
|
| | | if (!json) return ''
|
| | | return cleanArray(
|
| | | Object.keys(json).map(key => {
|
| | | if (json[key] === undefined) return ''
|
| | | return encodeURIComponent(key) + '=' + encodeURIComponent(json[key])
|
| | | })
|
| | | ).join('&')
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {string} url
|
| | | * @returns {Object}
|
| | | */
|
| | | export function param2Obj(url) {
|
| | | const search = url.split('?')[1]
|
| | | if (!search) {
|
| | | return {}
|
| | | }
|
| | | return JSON.parse(
|
| | | '{"' +
|
| | | decodeURIComponent(search)
|
| | | .replace(/"/g, '\\"')
|
| | | .replace(/&/g, '","')
|
| | | .replace(/=/g, '":"')
|
| | | .replace(/\+/g, ' ') +
|
| | | '"}'
|
| | | )
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {string} val
|
| | | * @returns {string}
|
| | | */
|
| | | export function html2Text(val) {
|
| | | const div = document.createElement('div')
|
| | | div.innerHTML = val
|
| | | return div.textContent || div.innerText
|
| | | }
|
| | |
|
| | | /**
|
| | | * Merges two objects, giving the last one precedence
|
| | | * @param {Object} target
|
| | | * @param {(Object|Array)} source
|
| | | * @returns {Object}
|
| | | */
|
| | | export function objectMerge(target, source) {
|
| | | if (typeof target !== 'object') {
|
| | | target = {}
|
| | | }
|
| | | if (Array.isArray(source)) {
|
| | | return source.slice()
|
| | | }
|
| | | Object.keys(source).forEach(property => {
|
| | | const sourceProperty = source[property]
|
| | | if (typeof sourceProperty === 'object') {
|
| | | target[property] = objectMerge(target[property], sourceProperty)
|
| | | } else {
|
| | | target[property] = sourceProperty
|
| | | }
|
| | | })
|
| | | return target
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {HTMLElement} element
|
| | | * @param {string} className
|
| | | */
|
| | | export function toggleClass(element, className) {
|
| | | if (!element || !className) {
|
| | | return
|
| | | }
|
| | | let classString = element.className
|
| | | const nameIndex = classString.indexOf(className)
|
| | | if (nameIndex === -1) {
|
| | | classString += '' + className
|
| | | } else {
|
| | | classString =
|
| | | classString.substr(0, nameIndex) +
|
| | | classString.substr(nameIndex + className.length)
|
| | | }
|
| | | element.className = classString
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {string} type
|
| | | * @returns {Date}
|
| | | */
|
| | | export function getTime(type) {
|
| | | if (type === 'start') {
|
| | | return new Date().getTime() - 3600 * 1000 * 24 * 90
|
| | | } else {
|
| | | return new Date(new Date().toDateString())
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {Function} func
|
| | | * @param {number} wait
|
| | | * @param {boolean} immediate
|
| | | * @return {*}
|
| | | */
|
| | | export function debounce(func, wait, immediate) {
|
| | | let timeout, args, context, timestamp, result
|
| | |
|
| | | const later = function() {
|
| | | // æ®ä¸ä¸æ¬¡è§¦åæ¶é´é´é
|
| | | const last = +new Date() - timestamp
|
| | |
|
| | | // 䏿¬¡è¢«å
è£
彿°è¢«è°ç¨æ¶é´é´é last å°äºè®¾å®æ¶é´é´é wait
|
| | | if (last < wait && last > 0) {
|
| | | timeout = setTimeout(later, wait - last)
|
| | | } else {
|
| | | timeout = null
|
| | | // å¦æè®¾å®ä¸ºimmediate===trueï¼å 为å¼å§è¾¹çå·²ç»è°ç¨è¿äºæ¤å¤æ éè°ç¨
|
| | | if (!immediate) {
|
| | | result = func.apply(context, args)
|
| | | if (!timeout) context = args = null
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return function(...args) {
|
| | | context = this
|
| | | timestamp = +new Date()
|
| | | const callNow = immediate && !timeout
|
| | | // 妿延æ¶ä¸åå¨ï¼éæ°è®¾å®å»¶æ¶
|
| | | if (!timeout) timeout = setTimeout(later, wait)
|
| | | if (callNow) {
|
| | | result = func.apply(context, args)
|
| | | context = args = null
|
| | | }
|
| | |
|
| | | return result
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * This is just a simple version of deep copy
|
| | | * Has a lot of edge cases bug
|
| | | * If you want to use a perfect deep copy, use lodash's _.cloneDeep
|
| | | * @param {Object} source
|
| | | * @returns {Object}
|
| | | */
|
| | | export function deepClone(source) {
|
| | | if (!source && typeof source !== 'object') {
|
| | | throw new Error('error arguments', 'deepClone')
|
| | | }
|
| | | const targetObj = source.constructor === Array ? [] : {}
|
| | | Object.keys(source).forEach(keys => {
|
| | | if (source[keys] && typeof source[keys] === 'object') {
|
| | | targetObj[keys] = deepClone(source[keys])
|
| | | } else {
|
| | | targetObj[keys] = source[keys]
|
| | | }
|
| | | })
|
| | | return targetObj
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {Array} arr
|
| | | * @returns {Array}
|
| | | */
|
| | | export function uniqueArr(arr) {
|
| | | return Array.from(new Set(arr))
|
| | | }
|
| | |
|
| | | /**
|
| | | * @returns {string}
|
| | | */
|
| | | export function createUniqueString() {
|
| | | const timestamp = +new Date() + ''
|
| | | const randomNum = parseInt((1 + Math.random()) * 65536) + ''
|
| | | return (+(randomNum + timestamp)).toString(32)
|
| | | }
|
| | |
|
| | | /**
|
| | | * Check if an element has a class
|
| | | * @param {HTMLElement} elm
|
| | | * @param {string} cls
|
| | | * @returns {boolean}
|
| | | */
|
| | | export function hasClass(ele, cls) {
|
| | | return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'))
|
| | | }
|
| | |
|
| | | /**
|
| | | * Add class to element
|
| | | * @param {HTMLElement} elm
|
| | | * @param {string} cls
|
| | | */
|
| | | export function addClass(ele, cls) {
|
| | | if (!hasClass(ele, cls)) ele.className += ' ' + cls
|
| | | }
|
| | |
|
| | | /**
|
| | | * Remove class from element
|
| | | * @param {HTMLElement} elm
|
| | | * @param {string} cls
|
| | | */
|
| | | export function removeClass(ele, cls) {
|
| | | if (hasClass(ele, cls)) {
|
| | | const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)')
|
| | | ele.className = ele.className.replace(reg, ' ')
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import store from '@/store'
|
| | |
|
| | | /**
|
| | | * @param {Array} value
|
| | | * @returns {Boolean}
|
| | | */
|
| | | export default function checkPermission(value) {
|
| | | if (value && value instanceof Array && value.length > 0) {
|
| | | const roles = store.getters && store.getters.roles
|
| | | const permissionRoles = value
|
| | |
|
| | | const hasPermission = roles.some(role => {
|
| | | return permissionRoles.includes(role)
|
| | | })
|
| | |
|
| | | if (!hasPermission) {
|
| | | return false
|
| | | }
|
| | | return true
|
| | | } else {
|
| | | console.error(`need roles! Like v-permission="['admin','editor']"`)
|
| | | return false
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import axios from 'axios'
|
| | | import { Notification, MessageBox } from 'element-ui'
|
| | | import store from '@/store'
|
| | | import { getToken } from '@/utils/auth'
|
| | |
|
| | | axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
| | | // å建axioså®ä¾
|
| | | const service = axios.create({
|
| | | // axiosä¸è¯·æ±é
ç½®æbaseURLé项ï¼è¡¨ç¤ºè¯·æ±URLå
Œ
±é¨å
|
| | | baseURL: process.env.VUE_APP_BASE_API,
|
| | | // è¶
æ¶
|
| | | timeout: 10000
|
| | | })
|
| | | // requestæ¦æªå¨
|
| | | service.interceptors.request.use(
|
| | | config => {
|
| | | if (getToken()) {
|
| | | config.headers['Authorization'] = 'Bearer ' + getToken() // 让æ¯ä¸ªè¯·æ±æºå¸¦èªå®ä¹token è¯·æ ¹æ®å®é
æ
åµèªè¡ä¿®æ¹
|
| | | }
|
| | | return config
|
| | | },
|
| | | error => {
|
| | | console.log(error)
|
| | | Promise.reject(error)
|
| | | }
|
| | | )
|
| | |
|
| | | // ååºæ¦æªå¨
|
| | | service.interceptors.response.use(res => {
|
| | | const code = res.data.code
|
| | | if (code === 401) {
|
| | | MessageBox.confirm(
|
| | | 'ç»å½ç¶æå·²è¿æï¼æ¨å¯ä»¥ç»§ç»çå¨è¯¥é¡µé¢ï¼æè
éæ°ç»å½',
|
| | | 'ç³»ç»æç¤º',
|
| | | {
|
| | | confirmButtonText: 'éæ°ç»å½',
|
| | | cancelButtonText: 'åæ¶',
|
| | | type: 'warning'
|
| | | }
|
| | | ).then(() => {
|
| | | store.dispatch('LogOut').then(() => {
|
| | | location.reload() // 为äºéæ°å®ä¾åvue-router对象 é¿å
bug
|
| | | })
|
| | | })
|
| | | } else if (code !== 200) {
|
| | | Notification.error({
|
| | | title: res.data.msg
|
| | | })
|
| | | return Promise.reject('error')
|
| | | } else {
|
| | | return res.data
|
| | | }
|
| | | },
|
| | | error => {
|
| | | console.log('err' + error)
|
| | | Message({
|
| | | message: error.message,
|
| | | type: 'error',
|
| | | duration: 5 * 1000
|
| | | })
|
| | | return Promise.reject(error)
|
| | | }
|
| | | )
|
| | |
|
| | | export default service
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | /**
|
| | | * éç¨jsæ¹æ³å°è£
å¤ç
|
| | | * Copyright (c) 2019 ruoyi
|
| | | */
|
| | |
|
| | | // æ¥ææ ¼å¼å
|
| | | export function dateFormat(date, pattern) {
|
| | | var d = new Date(date).Format("yyyy-MM-dd hh:mm:ss");
|
| | | if (pattern) {
|
| | | d = new Date(date).Format(pattern);
|
| | | }
|
| | | return d.toLocaleString();
|
| | | }
|
| | |
|
| | | // 表åéç½®
|
| | | export function resetForm(refName) {
|
| | | if (this.$refs[refName] !== undefined) {
|
| | | this.$refs[refName].resetFields();
|
| | | }
|
| | | }
|
| | |
|
| | | // æ·»å æ¥æèå´
|
| | | export function addDateRange(params, dateRange) {
|
| | | var search = params;
|
| | | if (null != dateRange) {
|
| | | search.params = {
|
| | | beginTime: this.dateRange[0],
|
| | | endTime: this.dateRange[1]
|
| | | };
|
| | | }
|
| | | return search;
|
| | | }
|
| | |
|
| | | // åæ¾æ°æ®åå
¸
|
| | | export function selectDictLabel(datas, value) {
|
| | | var actions = [];
|
| | | Object.keys(datas).map((key) => {
|
| | | if (datas[key].dictValue == ('' + value)) {
|
| | | actions.push(datas[key].dictLabel);
|
| | | return false;
|
| | | }
|
| | | })
|
| | | return actions.join('');
|
| | | }
|
| | |
|
| | | // åç¬¦ä¸²æ ¼å¼å(%s )
|
| | | export function sprintf(str) {
|
| | | var args = arguments, flag = true, i = 1;
|
| | | str = str.replace(/%s/g, function () {
|
| | | var arg = args[i++];
|
| | | if (typeof arg === 'undefined') {
|
| | | flag = false;
|
| | | return '';
|
| | | }
|
| | | return arg;
|
| | | });
|
| | | return flag ? str : '';
|
| | | }
|
| | |
|
| | | Date.prototype.Format = function (fmt) {
|
| | | var o = {
|
| | | "M+": this.getMonth() + 1, // æä»½
|
| | | "d+": this.getDate(), // æ¥
|
| | | "h+": this.getHours(), // å°æ¶
|
| | | "m+": this.getMinutes(), // å
|
| | | "s+": this.getSeconds(), // ç§
|
| | | "q+": Math.floor((this.getMonth() + 3) / 3), // å£åº¦
|
| | | "S": this.getMilliseconds() // 毫ç§
|
| | | };
|
| | | if (/(y+)/.test(fmt))
|
| | | fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
| | | for (var k in o)
|
| | | if (new RegExp("(" + k + ")").test(fmt))
|
| | | fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
| | | return fmt;
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Math.easeInOutQuad = function(t, b, c, d) {
|
| | | t /= d / 2
|
| | | if (t < 1) {
|
| | | return c / 2 * t * t + b
|
| | | }
|
| | | t--
|
| | | return -c / 2 * (t * (t - 2) - 1) + b
|
| | | }
|
| | |
|
| | | // requestAnimationFrame for Smart Animating http://goo.gl/sx5sts
|
| | | var requestAnimFrame = (function() {
|
| | | return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) }
|
| | | })()
|
| | |
|
| | | /**
|
| | | * Because it's so fucking difficult to detect the scrolling element, just move them all
|
| | | * @param {number} amount
|
| | | */
|
| | | function move(amount) {
|
| | | document.documentElement.scrollTop = amount
|
| | | document.body.parentNode.scrollTop = amount
|
| | | document.body.scrollTop = amount
|
| | | }
|
| | |
|
| | | function position() {
|
| | | return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {number} to
|
| | | * @param {number} duration
|
| | | * @param {Function} callback
|
| | | */
|
| | | export function scrollTo(to, duration, callback) {
|
| | | const start = position()
|
| | | const change = to - start
|
| | | const increment = 20
|
| | | let currentTime = 0
|
| | | duration = (typeof (duration) === 'undefined') ? 500 : duration
|
| | | var animateScroll = function() {
|
| | | // increment the time
|
| | | currentTime += increment
|
| | | // find the value with the quadratic in-out easing function
|
| | | var val = Math.easeInOutQuad(currentTime, start, change, duration)
|
| | | // move the document.body
|
| | | move(val)
|
| | | // do the animation unless its over
|
| | | if (currentTime < duration) {
|
| | | requestAnimFrame(animateScroll)
|
| | | } else {
|
| | | if (callback && typeof (callback) === 'function') {
|
| | | // the animation is done so lets callback
|
| | | callback()
|
| | | }
|
| | | }
|
| | | }
|
| | | animateScroll()
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | /**
|
| | | * @param {string} path
|
| | | * @returns {Boolean}
|
| | | */
|
| | | export function isExternal(path) {
|
| | | return /^(https?:|mailto:|tel:)/.test(path)
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {string} str
|
| | | * @returns {Boolean}
|
| | | */
|
| | | export function validUsername(str) {
|
| | | const valid_map = ['admin', 'editor']
|
| | | return valid_map.indexOf(str.trim()) >= 0
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {string} url
|
| | | * @returns {Boolean}
|
| | | */
|
| | | export function validURL(url) {
|
| | | const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
|
| | | return reg.test(url)
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {string} str
|
| | | * @returns {Boolean}
|
| | | */
|
| | | export function validLowerCase(str) {
|
| | | const reg = /^[a-z]+$/
|
| | | return reg.test(str)
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {string} str
|
| | | * @returns {Boolean}
|
| | | */
|
| | | export function validUpperCase(str) {
|
| | | const reg = /^[A-Z]+$/
|
| | | return reg.test(str)
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {string} str
|
| | | * @returns {Boolean}
|
| | | */
|
| | | export function validAlphabets(str) {
|
| | | const reg = /^[A-Za-z]+$/
|
| | | return reg.test(str)
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {string} email
|
| | | * @returns {Boolean}
|
| | | */
|
| | | export function validEmail(email) {
|
| | | const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
| | | return reg.test(email)
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {string} str
|
| | | * @returns {Boolean}
|
| | | */
|
| | | export function isString(str) {
|
| | | if (typeof str === 'string' || str instanceof String) {
|
| | | return true
|
| | | }
|
| | | return false
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param {Array} arg
|
| | | * @returns {Boolean}
|
| | | */
|
| | | export function isArray(arg) {
|
| | | if (typeof Array.isArray === 'undefined') {
|
| | | return Object.prototype.toString.call(arg) === '[object Array]'
|
| | | }
|
| | | return Array.isArray(arg)
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | const elementIcons = [
|
| | | 'info',
|
| | | 'error',
|
| | | 'success',
|
| | | 'warning',
|
| | | 'question',
|
| | | 'back',
|
| | | 'arrow-left',
|
| | | 'arrow-down',
|
| | | 'arrow-right',
|
| | | 'arrow-up',
|
| | | 'caret-left',
|
| | | 'caret-bottom',
|
| | | 'caret-top',
|
| | | 'caret-right',
|
| | | 'd-arrow-left',
|
| | | 'd-arrow-right',
|
| | | 'minus',
|
| | | 'plus',
|
| | | 'remove',
|
| | | 'circle-plus',
|
| | | 'remove-outline',
|
| | | 'circle-plus-outline',
|
| | | 'close',
|
| | | 'check',
|
| | | 'circle-close',
|
| | | 'circle-check',
|
| | | 'circle-close-outline',
|
| | | 'circle-check-outline',
|
| | | 'zoom-out',
|
| | | 'zoom-in',
|
| | | 'd-caret',
|
| | | 'sort',
|
| | | 'sort-down',
|
| | | 'sort-up',
|
| | | 'tickets',
|
| | | 'document',
|
| | | 'goods',
|
| | | 'sold-out',
|
| | | 'news',
|
| | | 'message',
|
| | | 'date',
|
| | | 'printer',
|
| | | 'time',
|
| | | 'bell',
|
| | | 'mobile-phone',
|
| | | 'service',
|
| | | 'view',
|
| | | 'menu',
|
| | | 'more',
|
| | | 'more-outline',
|
| | | 'star-on',
|
| | | 'star-off',
|
| | | 'location',
|
| | | 'location-outline',
|
| | | 'phone',
|
| | | 'phone-outline',
|
| | | 'picture',
|
| | | 'picture-outline',
|
| | | 'delete',
|
| | | 'search',
|
| | | 'edit',
|
| | | 'edit-outline',
|
| | | 'rank',
|
| | | 'refresh',
|
| | | 'share',
|
| | | 'setting',
|
| | | 'upload',
|
| | | 'upload2',
|
| | | 'download',
|
| | | 'loading'
|
| | | ]
|
| | |
|
| | | export default elementIcons
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="icons-container">
|
| | | <aside>
|
| | | <a href="#" target="_blank">Add and use
|
| | | </a>
|
| | | </aside>
|
| | | <el-tabs type="border-card">
|
| | | <el-tab-pane label="Icons">
|
| | | <div v-for="item of svgIcons" :key="item">
|
| | | <el-tooltip placement="top">
|
| | | <div slot="content">
|
| | | {{ generateIconCode(item) }}
|
| | | </div>
|
| | | <div class="icon-item">
|
| | | <svg-icon :icon-class="item" class-name="disabled" />
|
| | | <span>{{ item }}</span>
|
| | | </div>
|
| | | </el-tooltip>
|
| | | </div>
|
| | | </el-tab-pane>
|
| | | <el-tab-pane label="Element-UI Icons">
|
| | | <div v-for="item of elementIcons" :key="item">
|
| | | <el-tooltip placement="top">
|
| | | <div slot="content">
|
| | | {{ generateElementIconCode(item) }}
|
| | | </div>
|
| | | <div class="icon-item">
|
| | | <i :class="'el-icon-' + item" />
|
| | | <span>{{ item }}</span>
|
| | | </div>
|
| | | </el-tooltip>
|
| | | </div>
|
| | | </el-tab-pane>
|
| | | </el-tabs>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import svgIcons from './svg-icons'
|
| | | import elementIcons from './element-icons'
|
| | |
|
| | | export default {
|
| | | name: 'Icons',
|
| | | data() {
|
| | | return {
|
| | | svgIcons,
|
| | | elementIcons
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | generateIconCode(symbol) {
|
| | | return `<svg-icon icon-class="${symbol}" />`
|
| | | },
|
| | | generateElementIconCode(symbol) {
|
| | | return `<i class="el-icon-${symbol}" />`
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .icons-container {
|
| | | margin: 10px 20px 0;
|
| | | overflow: hidden;
|
| | |
|
| | | .icon-item {
|
| | | margin: 20px;
|
| | | height: 85px;
|
| | | text-align: center;
|
| | | width: 100px;
|
| | | float: left;
|
| | | font-size: 30px;
|
| | | color: #24292e;
|
| | | cursor: pointer;
|
| | | }
|
| | |
|
| | | span {
|
| | | display: block;
|
| | | font-size: 16px;
|
| | | margin-top: 10px;
|
| | | }
|
| | |
|
| | | .disabled {
|
| | | pointer-events: none;
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | const req = require.context('../../../assets/icons/svg', false, /\.svg$/)
|
| | | const requireAll = requireContext => requireContext.keys()
|
| | |
|
| | | const re = /\.\/(.*)\.svg/
|
| | |
|
| | | const svgIcons = requireAll(req).map(i => {
|
| | | return i.match(re)[1]
|
| | | })
|
| | |
|
| | | export default svgIcons
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div :class="className" :style="{height:height,width:width}" />
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import echarts from 'echarts'
|
| | | require('echarts/theme/macarons') // echarts theme
|
| | | import resize from './mixins/resize'
|
| | |
|
| | | const animationDuration = 6000
|
| | |
|
| | | export default {
|
| | | mixins: [resize],
|
| | | props: {
|
| | | className: {
|
| | | type: String,
|
| | | default: 'chart'
|
| | | },
|
| | | width: {
|
| | | type: String,
|
| | | default: '100%'
|
| | | },
|
| | | height: {
|
| | | type: String,
|
| | | default: '300px'
|
| | | }
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | chart: null
|
| | | }
|
| | | },
|
| | | mounted() {
|
| | | this.$nextTick(() => {
|
| | | this.initChart()
|
| | | })
|
| | | },
|
| | | beforeDestroy() {
|
| | | if (!this.chart) {
|
| | | return
|
| | | }
|
| | | this.chart.dispose()
|
| | | this.chart = null
|
| | | },
|
| | | methods: {
|
| | | initChart() {
|
| | | this.chart = echarts.init(this.$el, 'macarons')
|
| | |
|
| | | this.chart.setOption({
|
| | | tooltip: {
|
| | | trigger: 'axis',
|
| | | axisPointer: { // åæ è½´æç¤ºå¨ï¼åæ è½´è§¦åææ
|
| | | type: 'shadow' // é»è®¤ä¸ºç´çº¿ï¼å¯é为ï¼'line' | 'shadow'
|
| | | }
|
| | | },
|
| | | grid: {
|
| | | top: 10,
|
| | | left: '2%',
|
| | | right: '2%',
|
| | | bottom: '3%',
|
| | | containLabel: true
|
| | | },
|
| | | xAxis: [{
|
| | | type: 'category',
|
| | | data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
| | | axisTick: {
|
| | | alignWithLabel: true
|
| | | }
|
| | | }],
|
| | | yAxis: [{
|
| | | type: 'value',
|
| | | axisTick: {
|
| | | show: false
|
| | | }
|
| | | }],
|
| | | series: [{
|
| | | name: 'pageA',
|
| | | type: 'bar',
|
| | | stack: 'vistors',
|
| | | barWidth: '60%',
|
| | | data: [79, 52, 200, 334, 390, 330, 220],
|
| | | animationDuration
|
| | | }, {
|
| | | name: 'pageB',
|
| | | type: 'bar',
|
| | | stack: 'vistors',
|
| | | barWidth: '60%',
|
| | | data: [80, 52, 200, 334, 390, 330, 220],
|
| | | animationDuration
|
| | | }, {
|
| | | name: 'pageC',
|
| | | type: 'bar',
|
| | | stack: 'vistors',
|
| | | barWidth: '60%',
|
| | | data: [30, 52, 200, 334, 390, 330, 220],
|
| | | animationDuration
|
| | | }]
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div :class="className" :style="{height:height,width:width}" />
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import echarts from 'echarts'
|
| | | require('echarts/theme/macarons') // echarts theme
|
| | | import resize from './mixins/resize'
|
| | |
|
| | | export default {
|
| | | mixins: [resize],
|
| | | props: {
|
| | | className: {
|
| | | type: String,
|
| | | default: 'chart'
|
| | | },
|
| | | width: {
|
| | | type: String,
|
| | | default: '100%'
|
| | | },
|
| | | height: {
|
| | | type: String,
|
| | | default: '350px'
|
| | | },
|
| | | autoResize: {
|
| | | type: Boolean,
|
| | | default: true
|
| | | },
|
| | | chartData: {
|
| | | type: Object,
|
| | | required: true
|
| | | }
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | chart: null
|
| | | }
|
| | | },
|
| | | watch: {
|
| | | chartData: {
|
| | | deep: true,
|
| | | handler(val) {
|
| | | this.setOptions(val)
|
| | | }
|
| | | }
|
| | | },
|
| | | mounted() {
|
| | | this.$nextTick(() => {
|
| | | this.initChart()
|
| | | })
|
| | | },
|
| | | beforeDestroy() {
|
| | | if (!this.chart) {
|
| | | return
|
| | | }
|
| | | this.chart.dispose()
|
| | | this.chart = null
|
| | | },
|
| | | methods: {
|
| | | initChart() {
|
| | | this.chart = echarts.init(this.$el, 'macarons')
|
| | | this.setOptions(this.chartData)
|
| | | },
|
| | | setOptions({ expectedData, actualData } = {}) {
|
| | | this.chart.setOption({
|
| | | xAxis: {
|
| | | data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
| | | boundaryGap: false,
|
| | | axisTick: {
|
| | | show: false
|
| | | }
|
| | | },
|
| | | grid: {
|
| | | left: 10,
|
| | | right: 10,
|
| | | bottom: 20,
|
| | | top: 30,
|
| | | containLabel: true
|
| | | },
|
| | | tooltip: {
|
| | | trigger: 'axis',
|
| | | axisPointer: {
|
| | | type: 'cross'
|
| | | },
|
| | | padding: [5, 10]
|
| | | },
|
| | | yAxis: {
|
| | | axisTick: {
|
| | | show: false
|
| | | }
|
| | | },
|
| | | legend: {
|
| | | data: ['expected', 'actual']
|
| | | },
|
| | | series: [{
|
| | | name: 'expected', itemStyle: {
|
| | | normal: {
|
| | | color: '#FF005A',
|
| | | lineStyle: {
|
| | | color: '#FF005A',
|
| | | width: 2
|
| | | }
|
| | | }
|
| | | },
|
| | | smooth: true,
|
| | | type: 'line',
|
| | | data: expectedData,
|
| | | animationDuration: 2800,
|
| | | animationEasing: 'cubicInOut'
|
| | | },
|
| | | {
|
| | | name: 'actual',
|
| | | smooth: true,
|
| | | type: 'line',
|
| | | itemStyle: {
|
| | | normal: {
|
| | | color: '#3888fa',
|
| | | lineStyle: {
|
| | | color: '#3888fa',
|
| | | width: 2
|
| | | },
|
| | | areaStyle: {
|
| | | color: '#f3f8ff'
|
| | | }
|
| | | }
|
| | | },
|
| | | data: actualData,
|
| | | animationDuration: 2800,
|
| | | animationEasing: 'quadraticOut'
|
| | | }]
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <el-row :gutter="40" class="panel-group">
|
| | | <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
| | | <div class="card-panel" @click="handleSetLineChartData('newVisitis')">
|
| | | <div class="card-panel-icon-wrapper icon-people">
|
| | | <svg-icon icon-class="peoples" class-name="card-panel-icon" />
|
| | | </div>
|
| | | <div class="card-panel-description">
|
| | | <div class="card-panel-text">
|
| | | 访客
|
| | | </div>
|
| | | <count-to :start-val="0" :end-val="102400" :duration="2600" class="card-panel-num" />
|
| | | </div>
|
| | | </div>
|
| | | </el-col>
|
| | | <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
| | | <div class="card-panel" @click="handleSetLineChartData('messages')">
|
| | | <div class="card-panel-icon-wrapper icon-message">
|
| | | <svg-icon icon-class="message" class-name="card-panel-icon" />
|
| | | </div>
|
| | | <div class="card-panel-description">
|
| | | <div class="card-panel-text">
|
| | | æ¶æ¯
|
| | | </div>
|
| | | <count-to :start-val="0" :end-val="81212" :duration="3000" class="card-panel-num" />
|
| | | </div>
|
| | | </div>
|
| | | </el-col>
|
| | | <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
| | | <div class="card-panel" @click="handleSetLineChartData('purchases')">
|
| | | <div class="card-panel-icon-wrapper icon-money">
|
| | | <svg-icon icon-class="money" class-name="card-panel-icon" />
|
| | | </div>
|
| | | <div class="card-panel-description">
|
| | | <div class="card-panel-text">
|
| | | éé¢
|
| | | </div>
|
| | | <count-to :start-val="0" :end-val="9280" :duration="3200" class="card-panel-num" />
|
| | | </div>
|
| | | </div>
|
| | | </el-col>
|
| | | <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
| | | <div class="card-panel" @click="handleSetLineChartData('shoppings')">
|
| | | <div class="card-panel-icon-wrapper icon-shopping">
|
| | | <svg-icon icon-class="shopping" class-name="card-panel-icon" />
|
| | | </div>
|
| | | <div class="card-panel-description">
|
| | | <div class="card-panel-text">
|
| | | 订å
|
| | | </div>
|
| | | <count-to :start-val="0" :end-val="13600" :duration="3600" class="card-panel-num" />
|
| | | </div>
|
| | | </div>
|
| | | </el-col>
|
| | | </el-row>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import CountTo from 'vue-count-to'
|
| | |
|
| | | export default {
|
| | | components: {
|
| | | CountTo
|
| | | },
|
| | | methods: {
|
| | | handleSetLineChartData(type) {
|
| | | this.$emit('handleSetLineChartData', type)
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .panel-group {
|
| | | margin-top: 18px;
|
| | |
|
| | | .card-panel-col {
|
| | | margin-bottom: 32px;
|
| | | }
|
| | |
|
| | | .card-panel {
|
| | | height: 108px;
|
| | | cursor: pointer;
|
| | | font-size: 12px;
|
| | | position: relative;
|
| | | overflow: hidden;
|
| | | color: #666;
|
| | | background: #fff;
|
| | | box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
|
| | | border-color: rgba(0, 0, 0, .05);
|
| | |
|
| | | &:hover {
|
| | | .card-panel-icon-wrapper {
|
| | | color: #fff;
|
| | | }
|
| | |
|
| | | .icon-people {
|
| | | background: #40c9c6;
|
| | | }
|
| | |
|
| | | .icon-message {
|
| | | background: #36a3f7;
|
| | | }
|
| | |
|
| | | .icon-money {
|
| | | background: #f4516c;
|
| | | }
|
| | |
|
| | | .icon-shopping {
|
| | | background: #34bfa3
|
| | | }
|
| | | }
|
| | |
|
| | | .icon-people {
|
| | | color: #40c9c6;
|
| | | }
|
| | |
|
| | | .icon-message {
|
| | | color: #36a3f7;
|
| | | }
|
| | |
|
| | | .icon-money {
|
| | | color: #f4516c;
|
| | | }
|
| | |
|
| | | .icon-shopping {
|
| | | color: #34bfa3
|
| | | }
|
| | |
|
| | | .card-panel-icon-wrapper {
|
| | | float: left;
|
| | | margin: 14px 0 0 14px;
|
| | | padding: 16px;
|
| | | transition: all 0.38s ease-out;
|
| | | border-radius: 6px;
|
| | | }
|
| | |
|
| | | .card-panel-icon {
|
| | | float: left;
|
| | | font-size: 48px;
|
| | | }
|
| | |
|
| | | .card-panel-description {
|
| | | float: right;
|
| | | font-weight: bold;
|
| | | margin: 26px;
|
| | | margin-left: 0px;
|
| | |
|
| | | .card-panel-text {
|
| | | line-height: 18px;
|
| | | color: rgba(0, 0, 0, 0.45);
|
| | | font-size: 16px;
|
| | | margin-bottom: 12px;
|
| | | }
|
| | |
|
| | | .card-panel-num {
|
| | | font-size: 20px;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @media (max-width:550px) {
|
| | | .card-panel-description {
|
| | | display: none;
|
| | | }
|
| | |
|
| | | .card-panel-icon-wrapper {
|
| | | float: none !important;
|
| | | width: 100%;
|
| | | height: 100%;
|
| | | margin: 0 !important;
|
| | |
|
| | | .svg-icon {
|
| | | display: block;
|
| | | margin: 14px auto !important;
|
| | | float: none !important;
|
| | | }
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div :class="className" :style="{height:height,width:width}" />
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import echarts from 'echarts'
|
| | | require('echarts/theme/macarons') // echarts theme
|
| | | import resize from './mixins/resize'
|
| | |
|
| | | export default {
|
| | | mixins: [resize],
|
| | | props: {
|
| | | className: {
|
| | | type: String,
|
| | | default: 'chart'
|
| | | },
|
| | | width: {
|
| | | type: String,
|
| | | default: '100%'
|
| | | },
|
| | | height: {
|
| | | type: String,
|
| | | default: '300px'
|
| | | }
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | chart: null
|
| | | }
|
| | | },
|
| | | mounted() {
|
| | | this.$nextTick(() => {
|
| | | this.initChart()
|
| | | })
|
| | | },
|
| | | beforeDestroy() {
|
| | | if (!this.chart) {
|
| | | return
|
| | | }
|
| | | this.chart.dispose()
|
| | | this.chart = null
|
| | | },
|
| | | methods: {
|
| | | initChart() {
|
| | | this.chart = echarts.init(this.$el, 'macarons')
|
| | |
|
| | | this.chart.setOption({
|
| | | tooltip: {
|
| | | trigger: 'item',
|
| | | formatter: '{a} <br/>{b} : {c} ({d}%)'
|
| | | },
|
| | | legend: {
|
| | | left: 'center',
|
| | | bottom: '10',
|
| | | data: ['Industries', 'Technology', 'Forex', 'Gold', 'Forecasts']
|
| | | },
|
| | | series: [
|
| | | {
|
| | | name: 'WEEKLY WRITE ARTICLES',
|
| | | type: 'pie',
|
| | | roseType: 'radius',
|
| | | radius: [15, 95],
|
| | | center: ['50%', '38%'],
|
| | | data: [
|
| | | { value: 320, name: 'Industries' },
|
| | | { value: 240, name: 'Technology' },
|
| | | { value: 149, name: 'Forex' },
|
| | | { value: 100, name: 'Gold' },
|
| | | { value: 59, name: 'Forecasts' }
|
| | | ],
|
| | | animationEasing: 'cubicInOut',
|
| | | animationDuration: 2600
|
| | | }
|
| | | ]
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div :class="className" :style="{height:height,width:width}" />
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import echarts from 'echarts'
|
| | | require('echarts/theme/macarons') // echarts theme
|
| | | import resize from './mixins/resize'
|
| | |
|
| | | const animationDuration = 3000
|
| | |
|
| | | export default {
|
| | | mixins: [resize],
|
| | | props: {
|
| | | className: {
|
| | | type: String,
|
| | | default: 'chart'
|
| | | },
|
| | | width: {
|
| | | type: String,
|
| | | default: '100%'
|
| | | },
|
| | | height: {
|
| | | type: String,
|
| | | default: '300px'
|
| | | }
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | chart: null
|
| | | }
|
| | | },
|
| | | mounted() {
|
| | | this.$nextTick(() => {
|
| | | this.initChart()
|
| | | })
|
| | | },
|
| | | beforeDestroy() {
|
| | | if (!this.chart) {
|
| | | return
|
| | | }
|
| | | this.chart.dispose()
|
| | | this.chart = null
|
| | | },
|
| | | methods: {
|
| | | initChart() {
|
| | | this.chart = echarts.init(this.$el, 'macarons')
|
| | |
|
| | | this.chart.setOption({
|
| | | tooltip: {
|
| | | trigger: 'axis',
|
| | | axisPointer: { // åæ è½´æç¤ºå¨ï¼åæ è½´è§¦åææ
|
| | | type: 'shadow' // é»è®¤ä¸ºç´çº¿ï¼å¯é为ï¼'line' | 'shadow'
|
| | | }
|
| | | },
|
| | | radar: {
|
| | | radius: '66%',
|
| | | center: ['50%', '42%'],
|
| | | splitNumber: 8,
|
| | | splitArea: {
|
| | | areaStyle: {
|
| | | color: 'rgba(127,95,132,.3)',
|
| | | opacity: 1,
|
| | | shadowBlur: 45,
|
| | | shadowColor: 'rgba(0,0,0,.5)',
|
| | | shadowOffsetX: 0,
|
| | | shadowOffsetY: 15
|
| | | }
|
| | | },
|
| | | indicator: [
|
| | | { name: 'Sales', max: 10000 },
|
| | | { name: 'Administration', max: 20000 },
|
| | | { name: 'Information Techology', max: 20000 },
|
| | | { name: 'Customer Support', max: 20000 },
|
| | | { name: 'Development', max: 20000 },
|
| | | { name: 'Marketing', max: 20000 }
|
| | | ]
|
| | | },
|
| | | legend: {
|
| | | left: 'center',
|
| | | bottom: '10',
|
| | | data: ['Allocated Budget', 'Expected Spending', 'Actual Spending']
|
| | | },
|
| | | series: [{
|
| | | type: 'radar',
|
| | | symbolSize: 0,
|
| | | areaStyle: {
|
| | | normal: {
|
| | | shadowBlur: 13,
|
| | | shadowColor: 'rgba(0,0,0,.2)',
|
| | | shadowOffsetX: 0,
|
| | | shadowOffsetY: 10,
|
| | | opacity: 1
|
| | | }
|
| | | },
|
| | | data: [
|
| | | {
|
| | | value: [5000, 7000, 12000, 11000, 15000, 14000],
|
| | | name: 'Allocated Budget'
|
| | | },
|
| | | {
|
| | | value: [4000, 9000, 15000, 15000, 13000, 11000],
|
| | | name: 'Expected Spending'
|
| | | },
|
| | | {
|
| | | value: [5500, 11000, 12000, 15000, 12000, 12000],
|
| | | name: 'Actual Spending'
|
| | | }
|
| | | ],
|
| | | animationDuration: animationDuration
|
| | | }]
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { debounce } from '@/utils'
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | $_sidebarElm: null
|
| | | }
|
| | | },
|
| | | mounted() {
|
| | | this.$_initResizeEvent()
|
| | | this.$_initSidebarResizeEvent()
|
| | | },
|
| | | beforeDestroy() {
|
| | | this.$_destroyResizeEvent()
|
| | | this.$_destroySidebarResizeEvent()
|
| | | },
|
| | | activated() {
|
| | | this.$_initResizeEvent()
|
| | | this.$_initSidebarResizeEvent()
|
| | | },
|
| | | deactivated() {
|
| | | this.$_destroyResizeEvent()
|
| | | this.$_destroySidebarResizeEvent()
|
| | | },
|
| | | methods: {
|
| | | $_resizeHandler() {
|
| | | return debounce(() => {
|
| | | if (this.chart) {
|
| | | this.chart.resize()
|
| | | }
|
| | | }, 100)()
|
| | | },
|
| | | $_initResizeEvent() {
|
| | | window.addEventListener('resize', this.$_resizeHandler)
|
| | | },
|
| | | $_destroyResizeEvent() {
|
| | | window.removeEventListener('resize', this.$_resizeHandler)
|
| | | },
|
| | | $_sidebarResizeHandler(e) {
|
| | | if (e.propertyName === 'width') {
|
| | | this.$_resizeHandler()
|
| | | }
|
| | | },
|
| | | $_initSidebarResizeEvent() {
|
| | | this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
|
| | | this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
|
| | | },
|
| | | $_destroySidebarResizeEvent() {
|
| | | this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
|
| | | }
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="errPage-container">
|
| | | <el-button icon="arrow-left" class="pan-back-btn" @click="back">
|
| | | è¿å
|
| | | </el-button>
|
| | | <el-row>
|
| | | <el-col :span="12">
|
| | | <h1 class="text-jumbo text-ginormous">
|
| | | Oops!
|
| | | </h1>
|
| | | gifæ¥æº<a href="https://zh.airbnb.com/" target="_blank">airbnb</a> 页é¢
|
| | | <h2>ä½ æ²¡ææéå»è¯¥é¡µé¢</h2>
|
| | | <h6>妿䏿»¡è¯·èç³»ä½ é¢å¯¼</h6>
|
| | | <ul class="list-unstyled">
|
| | | <li>æè
ä½ å¯ä»¥å»:</li>
|
| | | <li class="link-type">
|
| | | <router-link to="/dashboard">
|
| | | åé¦é¡µ
|
| | | </router-link>
|
| | | </li>
|
| | | <li class="link-type">
|
| | | <a href="https://www.taobao.com/">é便çç</a>
|
| | | </li>
|
| | | <li><a href="#" @click.prevent="dialogVisible=true">ç¹æçå¾</a></li>
|
| | | </ul>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <img :src="errGif" width="313" height="428" alt="Girl has dropped her ice cream.">
|
| | | </el-col>
|
| | | </el-row>
|
| | | <el-dialog :visible.sync="dialogVisible" title="é便ç">
|
| | | <img :src="ewizardClap" class="pan-img">
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import errGif from '@/assets/401_images/401.gif'
|
| | |
|
| | | export default {
|
| | | name: 'Page401',
|
| | | data() {
|
| | | return {
|
| | | errGif: errGif + '?' + +new Date(),
|
| | | ewizardClap: 'https://wpimg.wallstcn.com/007ef517-bafd-4066-aae4-6883632d9646',
|
| | | dialogVisible: false
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | back() {
|
| | | if (this.$route.query.noGoBack) {
|
| | | this.$router.push({ path: '/dashboard' })
|
| | | } else {
|
| | | this.$router.go(-1)
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .errPage-container {
|
| | | width: 800px;
|
| | | max-width: 100%;
|
| | | margin: 100px auto;
|
| | | .pan-back-btn {
|
| | | background: #008489;
|
| | | color: #fff;
|
| | | border: none!important;
|
| | | }
|
| | | .pan-gif {
|
| | | margin: 0 auto;
|
| | | display: block;
|
| | | }
|
| | | .pan-img {
|
| | | display: block;
|
| | | margin: 0 auto;
|
| | | width: 100%;
|
| | | }
|
| | | .text-jumbo {
|
| | | font-size: 60px;
|
| | | font-weight: 700;
|
| | | color: #484848;
|
| | | }
|
| | | .list-unstyled {
|
| | | font-size: 14px;
|
| | | li {
|
| | | padding-bottom: 5px;
|
| | | }
|
| | | a {
|
| | | color: #008489;
|
| | | text-decoration: none;
|
| | | &:hover {
|
| | | text-decoration: underline;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="wscn-http404-container">
|
| | | <div class="wscn-http404">
|
| | | <div class="pic-404">
|
| | | <img class="pic-404__parent" src="@/assets/404_images/404.png" alt="404">
|
| | | <img class="pic-404__child left" src="@/assets/404_images/404_cloud.png" alt="404">
|
| | | <img class="pic-404__child mid" src="@/assets/404_images/404_cloud.png" alt="404">
|
| | | <img class="pic-404__child right" src="@/assets/404_images/404_cloud.png" alt="404">
|
| | | </div>
|
| | | <div class="bullshit">
|
| | | <div class="bullshit__oops">OOPS!</div>
|
| | | <div class="bullshit__info">All rights reserved
|
| | | <a style="color:#20a0ff" href="https://wallstreetcn.com" target="_blank">wallstreetcn</a>
|
| | | </div>
|
| | | <div class="bullshit__headline">{{ message }}</div>
|
| | | <div class="bullshit__info">Please check that the URL you entered is correct, or click the button below to return to the homepage.</div>
|
| | | <a href="" class="bullshit__return-home">Back to home</a>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | |
|
| | | export default {
|
| | | name: 'Page404',
|
| | | computed: {
|
| | | message() {
|
| | | return 'The webmaster said that you can not enter this page...'
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .wscn-http404-container{
|
| | | transform: translate(-50%,-50%);
|
| | | position: absolute;
|
| | | top: 40%;
|
| | | left: 50%;
|
| | | }
|
| | | .wscn-http404 {
|
| | | position: relative;
|
| | | width: 1200px;
|
| | | padding: 0 50px;
|
| | | overflow: hidden;
|
| | | .pic-404 {
|
| | | position: relative;
|
| | | float: left;
|
| | | width: 600px;
|
| | | overflow: hidden;
|
| | | &__parent {
|
| | | width: 100%;
|
| | | }
|
| | | &__child {
|
| | | position: absolute;
|
| | | &.left {
|
| | | width: 80px;
|
| | | top: 17px;
|
| | | left: 220px;
|
| | | opacity: 0;
|
| | | animation-name: cloudLeft;
|
| | | animation-duration: 2s;
|
| | | animation-timing-function: linear;
|
| | | animation-fill-mode: forwards;
|
| | | animation-delay: 1s;
|
| | | }
|
| | | &.mid {
|
| | | width: 46px;
|
| | | top: 10px;
|
| | | left: 420px;
|
| | | opacity: 0;
|
| | | animation-name: cloudMid;
|
| | | animation-duration: 2s;
|
| | | animation-timing-function: linear;
|
| | | animation-fill-mode: forwards;
|
| | | animation-delay: 1.2s;
|
| | | }
|
| | | &.right {
|
| | | width: 62px;
|
| | | top: 100px;
|
| | | left: 500px;
|
| | | opacity: 0;
|
| | | animation-name: cloudRight;
|
| | | animation-duration: 2s;
|
| | | animation-timing-function: linear;
|
| | | animation-fill-mode: forwards;
|
| | | animation-delay: 1s;
|
| | | }
|
| | | @keyframes cloudLeft {
|
| | | 0% {
|
| | | top: 17px;
|
| | | left: 220px;
|
| | | opacity: 0;
|
| | | }
|
| | | 20% {
|
| | | top: 33px;
|
| | | left: 188px;
|
| | | opacity: 1;
|
| | | }
|
| | | 80% {
|
| | | top: 81px;
|
| | | left: 92px;
|
| | | opacity: 1;
|
| | | }
|
| | | 100% {
|
| | | top: 97px;
|
| | | left: 60px;
|
| | | opacity: 0;
|
| | | }
|
| | | }
|
| | | @keyframes cloudMid {
|
| | | 0% {
|
| | | top: 10px;
|
| | | left: 420px;
|
| | | opacity: 0;
|
| | | }
|
| | | 20% {
|
| | | top: 40px;
|
| | | left: 360px;
|
| | | opacity: 1;
|
| | | }
|
| | | 70% {
|
| | | top: 130px;
|
| | | left: 180px;
|
| | | opacity: 1;
|
| | | }
|
| | | 100% {
|
| | | top: 160px;
|
| | | left: 120px;
|
| | | opacity: 0;
|
| | | }
|
| | | }
|
| | | @keyframes cloudRight {
|
| | | 0% {
|
| | | top: 100px;
|
| | | left: 500px;
|
| | | opacity: 0;
|
| | | }
|
| | | 20% {
|
| | | top: 120px;
|
| | | left: 460px;
|
| | | opacity: 1;
|
| | | }
|
| | | 80% {
|
| | | top: 180px;
|
| | | left: 340px;
|
| | | opacity: 1;
|
| | | }
|
| | | 100% {
|
| | | top: 200px;
|
| | | left: 300px;
|
| | | opacity: 0;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | .bullshit {
|
| | | position: relative;
|
| | | float: left;
|
| | | width: 300px;
|
| | | padding: 30px 0;
|
| | | overflow: hidden;
|
| | | &__oops {
|
| | | font-size: 32px;
|
| | | font-weight: bold;
|
| | | line-height: 40px;
|
| | | color: #1482f0;
|
| | | opacity: 0;
|
| | | margin-bottom: 20px;
|
| | | animation-name: slideUp;
|
| | | animation-duration: 0.5s;
|
| | | animation-fill-mode: forwards;
|
| | | }
|
| | | &__headline {
|
| | | font-size: 20px;
|
| | | line-height: 24px;
|
| | | color: #222;
|
| | | font-weight: bold;
|
| | | opacity: 0;
|
| | | margin-bottom: 10px;
|
| | | animation-name: slideUp;
|
| | | animation-duration: 0.5s;
|
| | | animation-delay: 0.1s;
|
| | | animation-fill-mode: forwards;
|
| | | }
|
| | | &__info {
|
| | | font-size: 13px;
|
| | | line-height: 21px;
|
| | | color: grey;
|
| | | opacity: 0;
|
| | | margin-bottom: 30px;
|
| | | animation-name: slideUp;
|
| | | animation-duration: 0.5s;
|
| | | animation-delay: 0.2s;
|
| | | animation-fill-mode: forwards;
|
| | | }
|
| | | &__return-home {
|
| | | display: block;
|
| | | float: left;
|
| | | width: 110px;
|
| | | height: 36px;
|
| | | background: #1482f0;
|
| | | border-radius: 100px;
|
| | | text-align: center;
|
| | | color: #ffffff;
|
| | | opacity: 0;
|
| | | font-size: 14px;
|
| | | line-height: 36px;
|
| | | cursor: pointer;
|
| | | animation-name: slideUp;
|
| | | animation-duration: 0.5s;
|
| | | animation-delay: 0.3s;
|
| | | animation-fill-mode: forwards;
|
| | | }
|
| | | @keyframes slideUp {
|
| | | 0% {
|
| | | transform: translateY(60px);
|
| | | opacity: 0;
|
| | | }
|
| | | 100% {
|
| | | transform: translateY(0);
|
| | | opacity: 1;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="dashboard-editor-container">
|
| | |
|
| | | <panel-group @handleSetLineChartData="handleSetLineChartData" />
|
| | |
|
| | | <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
|
| | | <line-chart :chart-data="lineChartData" />
|
| | | </el-row>
|
| | |
|
| | | <el-row :gutter="32">
|
| | | <el-col :xs="24" :sm="24" :lg="8">
|
| | | <div class="chart-wrapper">
|
| | | <raddar-chart />
|
| | | </div>
|
| | | </el-col>
|
| | | <el-col :xs="24" :sm="24" :lg="8">
|
| | | <div class="chart-wrapper">
|
| | | <pie-chart />
|
| | | </div>
|
| | | </el-col>
|
| | | <el-col :xs="24" :sm="24" :lg="8">
|
| | | <div class="chart-wrapper">
|
| | | <bar-chart />
|
| | | </div>
|
| | | </el-col>
|
| | | </el-row>
|
| | |
|
| | | |
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import PanelGroup from './dashboard/PanelGroup'
|
| | | import LineChart from './dashboard/LineChart'
|
| | | import RaddarChart from './dashboard/RaddarChart'
|
| | | import PieChart from './dashboard/PieChart'
|
| | | import BarChart from './dashboard/BarChart'
|
| | |
|
| | | const lineChartData = {
|
| | | newVisitis: {
|
| | | expectedData: [100, 120, 161, 134, 105, 160, 165],
|
| | | actualData: [120, 82, 91, 154, 162, 140, 145]
|
| | | },
|
| | | messages: {
|
| | | expectedData: [200, 192, 120, 144, 160, 130, 140],
|
| | | actualData: [180, 160, 151, 106, 145, 150, 130]
|
| | | },
|
| | | purchases: {
|
| | | expectedData: [80, 100, 121, 104, 105, 90, 100],
|
| | | actualData: [120, 90, 100, 138, 142, 130, 130]
|
| | | },
|
| | | shoppings: {
|
| | | expectedData: [130, 140, 141, 142, 145, 150, 160],
|
| | | actualData: [120, 82, 91, 154, 162, 140, 130]
|
| | | }
|
| | | }
|
| | |
|
| | | export default {
|
| | | name: 'Index',
|
| | | components: {
|
| | | PanelGroup,
|
| | | LineChart,
|
| | | RaddarChart,
|
| | | PieChart,
|
| | | BarChart
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | lineChartData: lineChartData.newVisitis
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | handleSetLineChartData(type) {
|
| | | this.lineChartData = lineChartData[type]
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .dashboard-editor-container {
|
| | | padding: 32px;
|
| | | background-color: rgb(240, 242, 245);
|
| | | position: relative;
|
| | |
|
| | | .chart-wrapper {
|
| | | background: #fff;
|
| | | padding: 16px 16px 0;
|
| | | margin-bottom: 32px;
|
| | | }
|
| | | }
|
| | |
|
| | | @media (max-width:1024px) {
|
| | | .chart-wrapper {
|
| | | padding: 8px;
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="login">
|
| | | <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
| | | <h3 class="title">è¥ä¾åå°ç®¡çç³»ç»</h3>
|
| | | <el-form-item prop="username">
|
| | | <el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="è´¦å·">
|
| | | <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
| | | </el-input>
|
| | | </el-form-item>
|
| | | <el-form-item prop="password">
|
| | | <el-input
|
| | | v-model="loginForm.password"
|
| | | type="password"
|
| | | auto-complete="off"
|
| | | placeholder="å¯ç "
|
| | | @keyup.enter.native="handleLogin"
|
| | | >
|
| | | <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
| | | </el-input>
|
| | | </el-form-item>
|
| | | <el-form-item prop="code">
|
| | | <el-input
|
| | | v-model="loginForm.code"
|
| | | auto-complete="off"
|
| | | placeholder="éªè¯ç "
|
| | | style="width: 63%"
|
| | | @keyup.enter.native="handleLogin"
|
| | | >
|
| | | <svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
|
| | | </el-input>
|
| | | <div class="login-code">
|
| | | <img :src="codeUrl" @click="getCode" />
|
| | | </div>
|
| | | </el-form-item>
|
| | | <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">è®°ä½å¯ç </el-checkbox>
|
| | | <el-form-item style="width:100%;">
|
| | | <el-button
|
| | | :loading="loading"
|
| | | size="medium"
|
| | | type="primary"
|
| | | style="width:100%;"
|
| | | @click.native.prevent="handleLogin"
|
| | | >
|
| | | <span v-if="!loading">ç» å½</span>
|
| | | <span v-else>ç» å½ ä¸...</span>
|
| | | </el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | <!-- åºé¨ -->
|
| | | <div class="el-login-footer">
|
| | | <span>Copyright © 2018-2019 ruoyi.vip All Rights Reserved.</span>
|
| | | </div>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { getCodeImg } from "@/api/login";
|
| | | import Cookies from "js-cookie";
|
| | |
|
| | | export default {
|
| | | name: "Login",
|
| | | data() {
|
| | | return {
|
| | | codeUrl: "",
|
| | | cookiePassword: "",
|
| | | loginForm: {
|
| | | username: "admin",
|
| | | password: "admin123",
|
| | | rememberMe: false,
|
| | | code: "",
|
| | | uuid: ""
|
| | | },
|
| | | loginRules: {
|
| | | username: [
|
| | | { required: true, trigger: "blur", message: "ç¨æ·åä¸è½ä¸ºç©º" }
|
| | | ],
|
| | | password: [
|
| | | { required: true, trigger: "blur", message: "å¯ç ä¸è½ä¸ºç©º" }
|
| | | ],
|
| | | code: [{ required: true, trigger: "change", message: "éªè¯ç ä¸è½ä¸ºç©º" }]
|
| | | },
|
| | | loading: false,
|
| | | redirect: undefined
|
| | | };
|
| | | },
|
| | | watch: {
|
| | | $route: {
|
| | | handler: function(route) {
|
| | | this.redirect = route.query && route.query.redirect;
|
| | | },
|
| | | immediate: true
|
| | | }
|
| | | },
|
| | | created() {
|
| | | this.getCode();
|
| | | this.getCookie();
|
| | | },
|
| | | methods: {
|
| | | getCode() {
|
| | | getCodeImg().then(res => {
|
| | | this.codeUrl = "data:image/gif;base64," + res.img;
|
| | | this.loginForm.uuid = res.uuid;
|
| | | });
|
| | | },
|
| | | getCookie() {
|
| | | const username = Cookies.get("username");
|
| | | const password = Cookies.get("password");
|
| | | const rememberMe = Cookies.get('rememberMe')
|
| | | this.loginForm = {
|
| | | username: username === undefined ? this.loginForm.username : username,
|
| | | password: password === undefined ? this.loginForm.password : password,
|
| | | rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
|
| | | };
|
| | | },
|
| | | handleLogin() {
|
| | | this.$refs.loginForm.validate(valid => {
|
| | | if (valid) {
|
| | | this.loading = true;
|
| | | if (this.loginForm.rememberMe) {
|
| | | Cookies.set("username", this.loginForm.username, { expires: 30 });
|
| | | Cookies.set("password", this.loginForm.password, { expires: 30 });
|
| | | Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
|
| | | } else {
|
| | | Cookies.remove("username");
|
| | | Cookies.remove("password");
|
| | | Cookies.remove('rememberMe');
|
| | | }
|
| | | this.$store
|
| | | .dispatch("Login", this.loginForm)
|
| | | .then(() => {
|
| | | this.loading = false;
|
| | | this.$router.push({ path: this.redirect || "/" });
|
| | | })
|
| | | .catch(() => {
|
| | | this.loading = false;
|
| | | this.getCode();
|
| | | });
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | };
|
| | | </script>
|
| | |
|
| | | <style rel="stylesheet/scss" lang="scss">
|
| | | .login {
|
| | | display: flex;
|
| | | justify-content: center;
|
| | | align-items: center;
|
| | | height: 100%;
|
| | | background-image: url("../assets/image/login-background.jpg");
|
| | | background-size: cover;
|
| | | }
|
| | | .title {
|
| | | margin: 0px auto 30px auto;
|
| | | text-align: center;
|
| | | color: #707070;
|
| | | }
|
| | |
|
| | | .login-form {
|
| | | border-radius: 6px;
|
| | | background: #ffffff;
|
| | | width: 400px;
|
| | | padding: 25px 25px 5px 25px;
|
| | | .el-input {
|
| | | height: 38px;
|
| | | input {
|
| | | height: 38px;
|
| | | }
|
| | | }
|
| | | .input-icon {
|
| | | height: 39px;
|
| | | width: 14px;
|
| | | margin-left: 2px;
|
| | | }
|
| | | }
|
| | | .login-tip {
|
| | | font-size: 13px;
|
| | | text-align: center;
|
| | | color: #bfbfbf;
|
| | | }
|
| | | .login-code {
|
| | | width: 33%;
|
| | | height: 38px;
|
| | | float: right;
|
| | | img {
|
| | | cursor: pointer;
|
| | | vertical-align: middle;
|
| | | }
|
| | | }
|
| | | .el-login-footer {
|
| | | height: 40px;
|
| | | line-height: 40px;
|
| | | position: fixed;
|
| | | bottom: 0;
|
| | | width: 100%;
|
| | | text-align: center;
|
| | | color: #fff;
|
| | | font-family: Arial;
|
| | | font-size: 12px;
|
| | | letter-spacing: 1px;
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script>
|
| | | export default {
|
| | | name: 'AuthRedirect',
|
| | | created() {
|
| | | const hash = window.location.search.slice(1)
|
| | | if (window.localStorage) {
|
| | | window.localStorage.setItem('x-admin-oauth-code', hash)
|
| | | window.close()
|
| | | }
|
| | | },
|
| | | render: function(h) {
|
| | | return h() // avoid warning message
|
| | | }
|
| | | }
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="social-signup-container">
|
| | | <div class="sign-btn" @click="wechatHandleClick('wechat')">
|
| | | <span class="wx-svg-container"><svg-icon icon-class="wechat" class="icon" /></span>
|
| | | WeChat
|
| | | </div>
|
| | | <div class="sign-btn" @click="tencentHandleClick('tencent')">
|
| | | <span class="qq-svg-container"><svg-icon icon-class="qq" class="icon" /></span>
|
| | | QQ
|
| | | </div>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | // import openWindow from '@/utils/open-window'
|
| | |
|
| | | export default {
|
| | | name: 'SocialSignin',
|
| | | methods: {
|
| | | wechatHandleClick(thirdpart) {
|
| | | alert('ok')
|
| | | // this.$store.commit('SET_AUTH_TYPE', thirdpart)
|
| | | // const appid = 'xxxxx'
|
| | | // const redirect_uri = encodeURIComponent('xxx/redirect?redirect=' + window.location.origin + '/auth-redirect')
|
| | | // const url = 'https://open.weixin.qq.com/connect/qrconnect?appid=' + appid + '&redirect_uri=' + redirect_uri + '&response_type=code&scope=snsapi_login#wechat_redirect'
|
| | | // openWindow(url, thirdpart, 540, 540)
|
| | | },
|
| | | tencentHandleClick(thirdpart) {
|
| | | alert('ok')
|
| | | // this.$store.commit('SET_AUTH_TYPE', thirdpart)
|
| | | // const client_id = 'xxxxx'
|
| | | // const redirect_uri = encodeURIComponent('xxx/redirect?redirect=' + window.location.origin + '/auth-redirect')
|
| | | // const url = 'https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=' + client_id + '&redirect_uri=' + redirect_uri
|
| | | // openWindow(url, thirdpart, 540, 540)
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .social-signup-container {
|
| | | margin: 20px 0;
|
| | | .sign-btn {
|
| | | display: inline-block;
|
| | | cursor: pointer;
|
| | | }
|
| | | .icon {
|
| | | color: #fff;
|
| | | font-size: 24px;
|
| | | margin-top: 8px;
|
| | | }
|
| | | .wx-svg-container,
|
| | | .qq-svg-container {
|
| | | display: inline-block;
|
| | | width: 40px;
|
| | | height: 40px;
|
| | | line-height: 40px;
|
| | | text-align: center;
|
| | | padding-top: 1px;
|
| | | border-radius: 4px;
|
| | | margin-bottom: 20px;
|
| | | margin-right: 5px;
|
| | | }
|
| | | .wx-svg-container {
|
| | | background-color: #24da70;
|
| | | }
|
| | | .qq-svg-container {
|
| | | background-color: #6BA2D6;
|
| | | margin-left: 50px;
|
| | | }
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div v-loading="loading" :style="'height:'+ height">
|
| | | <iframe :src="src" frameborder="no" style="width: 100%;height: 100%" scrolling="auto" />
|
| | | </div>
|
| | | </template>
|
| | | <script>
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | src: process.env.VUE_APP_BASE_API + "/druid/index.html",
|
| | | height: document.documentElement.clientHeight - 94.5 + "px;",
|
| | | loading: true
|
| | | };
|
| | | },
|
| | | mounted: function() {
|
| | | setTimeout(() => {
|
| | | this.loading = false;
|
| | | }, 230);
|
| | | const that = this;
|
| | | window.onresize = function temp() {
|
| | | that.height = document.documentElement.clientHeight - 94.5 + "px;";
|
| | | };
|
| | | }
|
| | | };
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | 宿¶ä»»å¡
|
| | | </div>
|
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true" label-width="68px">
|
| | | <el-form-item label="ç»å½å°å">
|
| | | <el-input
|
| | | v-model="queryParams.ipaddr"
|
| | | placeholder="请è¾å
¥ç»å½å°å"
|
| | | clearable
|
| | | style="width: 240px;"
|
| | | size="small"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¨æ·åç§°">
|
| | | <el-input
|
| | | v-model="queryParams.userName"
|
| | | placeholder="请è¾å
¥ç¨æ·åç§°"
|
| | | clearable
|
| | | style="width: 240px;"
|
| | | size="small"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-select
|
| | | v-model="queryParams.status"
|
| | | placeholder="ç»å½ç¶æ"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | >
|
| | | <el-option
|
| | | v-for="dict in statusOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictLabel"
|
| | | :value="dict.dictValue"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="ç»å½æ¶é´">
|
| | | <el-date-picker
|
| | | v-model="dateRange"
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | value-format="yyyy-MM-dd"
|
| | | type="daterange"
|
| | | range-separator="-"
|
| | | start-placeholder="å¼å§æ¥æ"
|
| | | end-placeholder="ç»ææ¥æ"
|
| | | ></el-date-picker>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="list" style="width: 100%;">
|
| | | <el-table-column label="访é®ç¼å·" align="center" prop="infoId" />
|
| | | <el-table-column label="ç¨æ·åç§°" align="center" prop="userName" />
|
| | | <el-table-column label="ç»å½å°å" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="ç»å½å°ç¹" align="center" prop="loginLocation" />
|
| | | <el-table-column label="æµè§å¨" align="center" prop="browser" />
|
| | | <el-table-column label="æä½ç³»ç»" align="center" prop="os" />
|
| | | <el-table-column label="ç»å½ç¶æ" align="center" prop="status" :formatter="statusFormat" />
|
| | | <el-table-column label="æä½ä¿¡æ¯" align="center" prop="msg" />
|
| | | <el-table-column label="ç»å½æ¥æ" align="center" prop="loginTime" width="180">
|
| | | <template slot-scope="scope">
|
| | | <span>{{ dateFormat(scope.row.loginTime) }}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <pagination
|
| | | v-show="total>0"
|
| | | :total="total"
|
| | | :page.sync="queryParams.pageNum"
|
| | | :limit.sync="queryParams.pageSize"
|
| | | @pagination="getList"
|
| | | />
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { list } from "@/api/monitor/logininfor";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // è¡¨æ ¼æ°æ®
|
| | | list: [],
|
| | | // ç¶ææ°æ®åå
¸
|
| | | statusOptions: [],
|
| | | // æ¥æèå´
|
| | | dateRange: [],
|
| | | // æ¥è¯¢åæ°
|
| | | queryParams: {
|
| | | pageNum: 1,
|
| | | pageSize: 10,
|
| | | ipaddr: undefined,
|
| | | userName: undefined,
|
| | | status: undefined
|
| | | }
|
| | | };
|
| | | },
|
| | | created() {
|
| | | this.getList();
|
| | | this.getDicts("sys_common_status").then(response => {
|
| | | this.statusOptions = response.data;
|
| | | });
|
| | | },
|
| | | methods: {
|
| | | /** æ¥è¯¢ç»å½æ¥å¿å表 */
|
| | | getList() {
|
| | | this.loading = true;
|
| | | list(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
| | | this.list = response.rows;
|
| | | this.total = response.total;
|
| | | this.loading = false;
|
| | | }
|
| | | );
|
| | | },
|
| | | // ç»å½ç¶æåå
¸ç¿»è¯
|
| | | statusFormat(row, column) {
|
| | | return this.selectDictLabel(this.statusOptions, row.status);
|
| | | },
|
| | | /** æç´¢æé®æä½ */
|
| | | handleQuery() {
|
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | }
|
| | | }
|
| | | };
|
| | | </script>
|
| | |
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | å¨çº¿ç¨æ·
|
| | | </div>
|
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true" label-width="68px">
|
| | | <el-form-item label="ç³»ç»æ¨¡å">
|
| | | <el-input
|
| | | v-model="queryParams.title"
|
| | | placeholder="请è¾å
¥ç³»ç»æ¨¡å"
|
| | | clearable
|
| | | style="width: 240px;"
|
| | | size="small"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="æä½äººå">
|
| | | <el-input
|
| | | v-model="queryParams.operName"
|
| | | placeholder="请è¾å
¥æä½äººå"
|
| | | clearable
|
| | | style="width: 240px;"
|
| | | size="small"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç±»å">
|
| | | <el-select
|
| | | v-model="queryParams.businessType"
|
| | | placeholder="æä½ç±»å"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | >
|
| | | <el-option
|
| | | v-for="dict in typeOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictLabel"
|
| | | :value="dict.dictValue"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-select
|
| | | v-model="queryParams.status"
|
| | | placeholder="æä½ç¶æ"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | >
|
| | | <el-option
|
| | | v-for="dict in statusOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictLabel"
|
| | | :value="dict.dictValue"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="æä½æ¶é´">
|
| | | <el-date-picker
|
| | | v-model="dateRange"
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | value-format="yyyy-MM-dd"
|
| | | type="daterange"
|
| | | range-separator="-"
|
| | | start-placeholder="å¼å§æ¥æ"
|
| | | end-placeholder="ç»ææ¥æ"
|
| | | ></el-date-picker>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="list" style="width: 100%;">
|
| | | <el-table-column label="æ¥å¿ç¼å·" align="center" prop="operId" />
|
| | | <el-table-column label="ç³»ç»æ¨¡å" align="center" prop="title" />
|
| | | <el-table-column label="æä½ç±»å" align="center" prop="businessType" :formatter="typeFormat" />
|
| | | <el-table-column label="è¯·æ±æ¹å¼" align="center" prop="requestMethod" />
|
| | | <el-table-column label="æä½äººå" align="center" prop="operName" />
|
| | | <el-table-column label="主æº" align="center" prop="operIp" width="130" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="æä½å°ç¹" align="center" prop="operLocation" />
|
| | | <el-table-column label="æä½ç¶æ" align="center" prop="status" :formatter="statusFormat" />
|
| | | <el-table-column label="æä½æ¥æ" align="center" prop="operTime" width="180">
|
| | | <template slot-scope="scope">
|
| | | <span>{{ dateFormat(scope.row.operTime) }}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width">
|
| | | <template slot-scope="scope">
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-view"
|
| | | @click="handleView(scope.row,scope.index)"
|
| | | v-hasPermi="['monitor:operlog:query']"
|
| | | >详ç»</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <pagination
|
| | | v-show="total>0"
|
| | | :total="total"
|
| | | :page.sync="queryParams.pageNum"
|
| | | :limit.sync="queryParams.pageSize"
|
| | | @pagination="getList"
|
| | | />
|
| | |
|
| | | <!-- æä½æ¥å¿è¯¦ç» -->
|
| | | <el-dialog title="æä½æ¥å¿è¯¦ç»" :visible.sync="open" width="700px">
|
| | | <el-form ref="form" :model="form" label-width="100px" size="mini">
|
| | | <el-row>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="æä½æ¨¡åï¼">{{ form.title }} / ä¿®æ¹</el-form-item>
|
| | | <el-form-item
|
| | | label="ç»å½ä¿¡æ¯ï¼"
|
| | | >{{ form.operName }} / {{ form.operIp }} / {{ form.operLocation }}</el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="请æ±å°åï¼">{{ form.operUrl }}</el-form-item>
|
| | | <el-form-item label="è¯·æ±æ¹å¼ï¼">{{ form.requestMethod }}</el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="24">
|
| | | <el-form-item label="æä½æ¹æ³ï¼">{{ form.method }}</el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="24">
|
| | | <el-form-item label="请æ±åæ°ï¼">{{ form.operParam }}</el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="24">
|
| | | <el-form-item label="è¿ååæ°ï¼">{{ form.jsonResult }}</el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="æä½ç¶æï¼">
|
| | | <div v-if="form.status === 0">æ£å¸¸</div>
|
| | | <div v-else-if="form.status === 1">失败</div>
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="æä½æ¶é´ï¼">{{ dateFormat(form.operTime) }}</el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="24">
|
| | | <el-form-item label="å¼å¸¸ä¿¡æ¯ï¼" v-if="form.status === 1">{{ form.errorMsg }}</el-form-item>
|
| | | </el-col>
|
| | | </el-row>
|
| | | </el-form>
|
| | | <div slot="footer" class="dialog-footer">
|
| | | <el-button @click="open = false">å
³ é</el-button>
|
| | | </div>
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { list } from "@/api/monitor/operlog";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // è¡¨æ ¼æ°æ®
|
| | | list: [],
|
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±
|
| | | open: false,
|
| | | // ç±»åæ°æ®åå
¸
|
| | | typeOptions: [],
|
| | | // ç±»åæ°æ®åå
¸
|
| | | statusOptions: [],
|
| | | // æ¥æèå´
|
| | | dateRange: [],
|
| | | // 表ååæ°
|
| | | form: {},
|
| | | // æ¥è¯¢åæ°
|
| | | queryParams: {
|
| | | pageNum: 1,
|
| | | pageSize: 10,
|
| | | title: undefined,
|
| | | operName: undefined,
|
| | | businessType: undefined,
|
| | | status: undefined
|
| | | }
|
| | | };
|
| | | },
|
| | | created() {
|
| | | this.getList();
|
| | | this.getDicts("sys_oper_type").then(response => {
|
| | | this.typeOptions = response.data;
|
| | | });
|
| | | this.getDicts("sys_common_status").then(response => {
|
| | | this.statusOptions = response.data;
|
| | | });
|
| | | },
|
| | | methods: {
|
| | | /** æ¥è¯¢ç»å½æ¥å¿ */
|
| | | getList() {
|
| | | this.loading = true;
|
| | | list(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
|
| | | this.list = response.rows;
|
| | | this.total = response.total;
|
| | | this.loading = false;
|
| | | }
|
| | | );
|
| | | },
|
| | | // æä½æ¥å¿ç¶æåå
¸ç¿»è¯
|
| | | statusFormat(row, column) {
|
| | | return this.selectDictLabel(this.statusOptions, row.status);
|
| | | },
|
| | | // æä½æ¥å¿ç±»ååå
¸ç¿»è¯
|
| | | typeFormat(row, column) {
|
| | | return this.selectDictLabel(this.typeOptions, row.businessType);
|
| | | },
|
| | | /** æç´¢æé®æä½ */
|
| | | handleQuery() {
|
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** è¯¦ç»æé®æä½ */
|
| | | handleView(row) {
|
| | | this.open = true;
|
| | | this.form = row;
|
| | | }
|
| | | }
|
| | | };
|
| | | </script>
|
| | |
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-row>
|
| | | <el-col :span="12" class="card-box">
|
| | | <el-card>
|
| | | <div slot="header"><span>CPU</span></div>
|
| | | <div class="el-table el-table--enable-row-hover el-table--medium">
|
| | | <table cellspacing="0" style="width: 100%;">
|
| | | <thead>
|
| | | <tr>
|
| | | <th class="is-leaf"><div class="cell">屿§</div></th>
|
| | | <th class="is-leaf"><div class="cell">å¼</div></th>
|
| | | </tr>
|
| | | </thead>
|
| | | <tbody>
|
| | | <tr>
|
| | | <td><div class="cell">æ ¸å¿æ°</div></td>
|
| | | <td><div class="cell" v-if="server.cpu">{{ server.cpu.cpuNum }}</div></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td><div class="cell">ç¨æ·ä½¿ç¨ç</div></td>
|
| | | <td><div class="cell" v-if="server.cpu">{{ server.cpu.used }}%</div></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td><div class="cell">ç³»ç»ä½¿ç¨ç</div></td>
|
| | | <td><div class="cell" v-if="server.cpu">{{ server.cpu.sys }}%</div></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td><div class="cell">å½å空é²ç</div></td>
|
| | | <td><div class="cell" v-if="server.cpu">{{ server.cpu.free }}%</div></td>
|
| | | </tr>
|
| | | </tbody>
|
| | | </table>
|
| | | </div>
|
| | | </el-card>
|
| | | </el-col>
|
| | |
|
| | | <el-col :span="12" class="card-box">
|
| | | <el-card>
|
| | | <div slot="header"><span>å
å</span></div>
|
| | | <div class="el-table el-table--enable-row-hover el-table--medium">
|
| | | <table cellspacing="0" style="width: 100%;">
|
| | | <thead>
|
| | | <tr>
|
| | | <th class="is-leaf"><div class="cell">屿§</div></th>
|
| | | <th class="is-leaf"><div class="cell">å
å</div></th>
|
| | | <th class="is-leaf"><div class="cell">JVM</div></th>
|
| | | </tr>
|
| | | </thead>
|
| | | <tbody>
|
| | | <tr>
|
| | | <td><div class="cell">æ»å
å</div></td>
|
| | | <td><div class="cell" v-if="server.mem">{{ server.mem.total }}G</div></td>
|
| | | <td><div class="cell" v-if="server.jvm">{{ server.jvm.total }}M</div></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td><div class="cell">å·²ç¨å
å</div></td>
|
| | | <td><div class="cell" v-if="server.mem">{{ server.mem.used}}G</div></td>
|
| | | <td><div class="cell" v-if="server.jvm">{{ server.jvm.used}}M</div></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td><div class="cell">å©ä½å
å</div></td>
|
| | | <td><div class="cell" v-if="server.mem">{{ server.mem.free }}G</div></td>
|
| | | <td><div class="cell" v-if="server.jvm">{{ server.jvm.free }}M</div></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td><div class="cell">使ç¨ç</div></td>
|
| | | <td><div class="cell" v-if="server.mem" :class="{'text-danger': server.mem.usage > 80}">{{ server.mem.usage }}%</div></td>
|
| | | <td><div class="cell" v-if="server.jvm" :class="{'text-danger': server.jvm.usage > 80}">{{ server.jvm.usage }}%</div></td>
|
| | | </tr>
|
| | | </tbody>
|
| | | </table>
|
| | | </div>
|
| | | </el-card>
|
| | | </el-col>
|
| | |
|
| | | <el-col :span="24" class="card-box">
|
| | | <el-card>
|
| | | <div slot="header">
|
| | | <span>æå¡å¨ä¿¡æ¯</span>
|
| | | </div>
|
| | | <div class="el-table el-table--enable-row-hover el-table--medium">
|
| | | <table cellspacing="0" style="width: 100%;">
|
| | | <tbody>
|
| | | <tr>
|
| | | <td><div class="cell">æå¡å¨åç§°</div></td>
|
| | | <td><div class="cell" v-if="server.sys">{{ server.sys.computerName }}</div></td>
|
| | | <td><div class="cell">æä½ç³»ç»</div></td>
|
| | | <td><div class="cell" v-if="server.sys">{{ server.sys.osName }}</div></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td><div class="cell">æå¡å¨IP</div></td>
|
| | | <td><div class="cell" v-if="server.sys">{{ server.sys.computerIp }}</div></td>
|
| | | <td><div class="cell">ç³»ç»æ¶æ</div></td>
|
| | | <td><div class="cell" v-if="server.sys">{{ server.sys.osArch }}</div></td>
|
| | | </tr>
|
| | | </tbody>
|
| | | </table>
|
| | | </div>
|
| | | </el-card>
|
| | | </el-col>
|
| | |
|
| | | <el-col :span="24" class="card-box">
|
| | | <el-card>
|
| | | <div slot="header">
|
| | | <span>Javaèææºä¿¡æ¯</span>
|
| | | </div>
|
| | | <div class="el-table el-table--enable-row-hover el-table--medium">
|
| | | <table cellspacing="0" style="width: 100%;">
|
| | | <tbody>
|
| | | <tr>
|
| | | <td><div class="cell">Javaåç§°</div></td>
|
| | | <td><div class="cell" v-if="server.jvm">{{ server.jvm.name }}</div></td>
|
| | | <td><div class="cell">Javaçæ¬</div></td>
|
| | | <td><div class="cell" v-if="server.jvm">{{ server.jvm.version }}</div></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td><div class="cell">å¯å¨æ¶é´</div></td>
|
| | | <td><div class="cell" v-if="server.jvm">{{ server.jvm.startTime }}</div></td>
|
| | | <td><div class="cell">è¿è¡æ¶é¿</div></td>
|
| | | <td><div class="cell" v-if="server.jvm">{{ server.jvm.runTime }}</div></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td colspan="1"><div class="cell">å®è£
è·¯å¾</div></td>
|
| | | <td colspan="3"><div class="cell" v-if="server.jvm">{{ server.jvm.home }}</div></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <td colspan="1"><div class="cell">项ç®è·¯å¾</div></td>
|
| | | <td colspan="3"><div class="cell" v-if="server.sys">{{ server.sys.userDir }}</div></td>
|
| | | </tr>
|
| | | </tbody>
|
| | | </table>
|
| | | </div>
|
| | | </el-card>
|
| | | </el-col>
|
| | |
|
| | | <el-col :span="24" class="card-box">
|
| | | <el-card>
|
| | | <div slot="header">
|
| | | <span>ç£çç¶æ</span>
|
| | | </div>
|
| | | <div class="el-table el-table--enable-row-hover el-table--medium">
|
| | | <table cellspacing="0" style="width: 100%;">
|
| | | <thead>
|
| | | <tr>
|
| | | <th class="is-leaf"><div class="cell">ç符路å¾</div></th>
|
| | | <th class="is-leaf"><div class="cell">æä»¶ç³»ç»</div></th>
|
| | | <th class="is-leaf"><div class="cell">ç符类å</div></th>
|
| | | <th class="is-leaf"><div class="cell">æ»å¤§å°</div></th>
|
| | | <th class="is-leaf"><div class="cell">å¯ç¨å¤§å°</div></th>
|
| | | <th class="is-leaf"><div class="cell">å·²ç¨å¤§å°</div></th>
|
| | | <th class="is-leaf"><div class="cell">å·²ç¨ç¾åæ¯</div></th>
|
| | | </tr>
|
| | | </thead>
|
| | | <tbody v-if="server.sysFiles">
|
| | | <tr v-for="sysFile in server.sysFiles">
|
| | | <td><div class="cell">{{ sysFile.dirName }}</div></td>
|
| | | <td><div class="cell">{{ sysFile.sysTypeName }}</div></td>
|
| | | <td><div class="cell">{{ sysFile.typeName }}</div></td>
|
| | | <td><div class="cell">{{ sysFile.total }}</div></td>
|
| | | <td><div class="cell">{{ sysFile.free }}</div></td>
|
| | | <td><div class="cell">{{ sysFile.used }}</div></td>
|
| | | <td><div class="cell" :class="{'text-danger': sysFile.usage > 80}">{{ sysFile.usage }}%</div></td>
|
| | | </tr>
|
| | | </tbody>
|
| | | </table>
|
| | | </div>
|
| | | </el-card>
|
| | | </el-col>
|
| | | </el-row>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { getServer } from "@/api/monitor/server";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | // å è½½å±ä¿¡æ¯
|
| | | loading: [],
|
| | | // æå¡å¨ä¿¡æ¯
|
| | | server: []
|
| | | };
|
| | | },
|
| | | created() {
|
| | | this.getList();
|
| | | this.openLoading();
|
| | | },
|
| | | methods: {
|
| | | /** æ¥è¯¢æå¡å¨ä¿¡æ¯ */
|
| | | getList() {
|
| | | getServer().then(response => {
|
| | | this.server = response.data;
|
| | | this.loading.close();
|
| | | });
|
| | | },
|
| | | // æå¼å è½½å±
|
| | | openLoading() {
|
| | | this.loading = this.$loading({
|
| | | lock: true,
|
| | | text: "æ¼å½è¯»åä¸",
|
| | | spinner: "el-icon-loading",
|
| | | background: "rgba(0, 0, 0, 0.7)"
|
| | | });
|
| | | }
|
| | | }
|
| | | };
|
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script>
|
| | | export default {
|
| | | created() {
|
| | | const { params, query } = this.$route
|
| | | const { path } = params
|
| | | this.$router.replace({ path: '/' + path, query })
|
| | | },
|
| | | render: function(h) {
|
| | | return h() // avoid warning message
|
| | | }
|
| | | }
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true" label-width="68px">
|
| | | <el-form-item label="åæ°åç§°">
|
| | | <el-input
|
| | | v-model="queryParams.configName"
|
| | | placeholder="请è¾å
¥åæ°åç§°"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="åæ°é®å">
|
| | | <el-input
|
| | | v-model="queryParams.configKey"
|
| | | placeholder="请è¾å
¥åæ°é®å"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç³»ç»å
ç½®">
|
| | | <el-select v-model="queryParams.configType" placeholder="ç³»ç»å
ç½®" clearable size="small">
|
| | | <el-option
|
| | | v-for="dict in typeOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictLabel"
|
| | | :value="dict.dictValue"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="å建æ¶é´">
|
| | | <el-date-picker
|
| | | v-model="dateRange"
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | value-format="yyyy-MM-dd"
|
| | | type="daterange"
|
| | | range-separator="-"
|
| | | start-placeholder="å¼å§æ¥æ"
|
| | | end-placeholder="ç»ææ¥æ"
|
| | | ></el-date-picker>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:config:add']">æ°å¢</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="configList">
|
| | | <el-table-column label="忰䏻é®" align="center" prop="configId" />
|
| | | <el-table-column label="åæ°åç§°" align="center" prop="configName" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="åæ°é®å" align="center" prop="configKey" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="åæ°é®å¼" align="center" prop="configValue" />
|
| | | <el-table-column label="ç³»ç»å
ç½®" align="center" prop="configType" :formatter="typeFormat" />
|
| | | <el-table-column label="夿³¨" align="center" prop="remark" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180">
|
| | | <template slot-scope="scope">
|
| | | <span>{{ dateFormat(scope.row.createTime) }}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width">
|
| | | <template slot-scope="scope">
|
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['system:config:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-delete"
|
| | | @click="handleDelete(scope.row)"
|
| | | v-hasPermi="['system:config:remove']"
|
| | | >å é¤</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <pagination
|
| | | v-show="total>0"
|
| | | :total="total"
|
| | | :page.sync="queryParams.pageNum"
|
| | | :limit.sync="queryParams.pageSize"
|
| | | @pagination="getList"
|
| | | />
|
| | |
|
| | | <!-- æ·»å æä¿®æ¹åæ°é
ç½®å¯¹è¯æ¡ -->
|
| | | <el-dialog :title="title" :visible.sync="open" width="500px">
|
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
| | | <el-form-item label="åæ°åç§°" prop="configName">
|
| | | <el-input v-model="form.configName" placeholder="请è¾å
¥åæ°åç§°" />
|
| | | </el-form-item>
|
| | | <el-form-item label="åæ°é®å" prop="configKey">
|
| | | <el-input v-model="form.configKey" placeholder="请è¾å
¥åæ°é®å" />
|
| | | </el-form-item>
|
| | | <el-form-item label="åæ°é®å¼" prop="configValue">
|
| | | <el-input v-model="form.configValue" placeholder="请è¾å
¥åæ°é®å¼" />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç³»ç»å
ç½®" prop="configType">
|
| | | <el-radio-group v-model="form.configType">
|
| | | <el-radio
|
| | | v-for="dict in typeOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictValue"
|
| | | >{{dict.dictLabel}}</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | | <el-form-item label="夿³¨" prop="remark">
|
| | | <el-input v-model="form.remark" type="textarea" placeholder="请è¾å
¥å
容" />
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | <div slot="footer" class="dialog-footer">
|
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button>
|
| | | <el-button @click="cancel">å æ¶</el-button>
|
| | | </div>
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listConfig, getConfig, delConfig, addConfig, updateConfig } from "@/api/system/config";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // åæ°è¡¨æ ¼æ°æ®
|
| | | configList: [],
|
| | | // å¼¹åºå±æ é¢
|
| | | title: "",
|
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±
|
| | | open: false,
|
| | | // ç±»åæ°æ®åå
¸
|
| | | typeOptions: [],
|
| | | // æ¥æèå´
|
| | | dateRange: [],
|
| | | // æ¥è¯¢åæ°
|
| | | queryParams: {
|
| | | pageNum: 1,
|
| | | pageSize: 10,
|
| | | configName: undefined,
|
| | | configKey: undefined,
|
| | | configType: undefined
|
| | | },
|
| | | // 表ååæ°
|
| | | form: {},
|
| | | // è¡¨åæ ¡éª
|
| | | rules: {
|
| | | configName: [
|
| | | { required: true, message: "åæ°åç§°ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | configKey: [
|
| | | { required: true, message: "åæ°é®åä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | configValue: [
|
| | | { required: true, message: "åæ°é®å¼ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ]
|
| | | }
|
| | | };
|
| | | },
|
| | | created() {
|
| | | this.getList();
|
| | | this.getDicts("sys_yes_no").then(response => {
|
| | | this.typeOptions = response.data;
|
| | | });
|
| | | },
|
| | | methods: {
|
| | | /** æ¥è¯¢åæ°å表 */
|
| | | getList() {
|
| | | this.loading = true;
|
| | | listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
| | | this.configList = response.rows;
|
| | | this.total = response.total;
|
| | | this.loading = false;
|
| | | }
|
| | | );
|
| | | },
|
| | | // åæ°ç³»ç»å
ç½®åå
¸ç¿»è¯
|
| | | typeFormat(row, column) {
|
| | | return this.selectDictLabel(this.typeOptions, row.configType);
|
| | | },
|
| | | // åæ¶æé®
|
| | | cancel() {
|
| | | this.open = false;
|
| | | this.reset();
|
| | | },
|
| | | // 表åéç½®
|
| | | reset() {
|
| | | this.form = {
|
| | | configId: undefined,
|
| | | configName: undefined,
|
| | | configKey: undefined,
|
| | | configValue: undefined,
|
| | | configType: "Y",
|
| | | remark: undefined
|
| | | };
|
| | | this.resetForm("form");
|
| | | },
|
| | | /** æç´¢æé®æä½ */
|
| | | handleQuery() {
|
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | | this.open = true;
|
| | | this.title = "æ·»å åæ°";
|
| | | },
|
| | | /** ä¿®æ¹æé®æä½ */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | getConfig(row.configId).then(response => {
|
| | | this.form = response.data;
|
| | | this.open = true;
|
| | | this.title = "ä¿®æ¹åæ°";
|
| | | });
|
| | | },
|
| | | /** æäº¤æé® */
|
| | | submitForm: function() {
|
| | | this.$refs["form"].validate(valid => {
|
| | | if (valid) {
|
| | | if (this.form.configId != undefined) {
|
| | | updateConfig(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("ä¿®æ¹æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | } else {
|
| | | addConfig(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("æ°å¢æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | });
|
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å称为"' + row.configName + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delConfig(row.configId);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true">
|
| | | <el-form-item label="é¨é¨åç§°">
|
| | | <el-input
|
| | | v-model="queryParams.deptName"
|
| | | placeholder="请è¾å
¥é¨é¨åç§°"
|
| | | clearable
|
| | | size="small"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-select v-model="queryParams.status" placeholder="é¨é¨ç¶æ" clearable size="small">
|
| | | <el-option
|
| | | v-for="dict in statusOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictLabel"
|
| | | :value="dict.dictValue"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button
|
| | | class="filter-item"
|
| | | type="primary"
|
| | | icon="el-icon-search"
|
| | | size="mini"
|
| | | @click="handleQuery"
|
| | | >æç´¢</el-button>
|
| | | <el-button
|
| | | class="filter-item"
|
| | | type="primary"
|
| | | icon="el-icon-plus"
|
| | | size="mini"
|
| | | @click="handleAdd"
|
| | | v-hasPermi="['system:dept:add']"
|
| | | >æ°å¢</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table
|
| | | v-loading="loading"
|
| | | :data="deptList"
|
| | | row-key="deptId"
|
| | | default-expand-all
|
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
| | | >
|
| | | <el-table-column prop="deptName" label="é¨é¨åç§°" width="200"></el-table-column>
|
| | | <el-table-column prop="orderNum" label="æåº" width="200"></el-table-column>
|
| | | <el-table-column prop="status" label="ç¶æ" :formatter="statusFormat" width="100"></el-table-column>
|
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="200">
|
| | | <template slot-scope="scope">
|
| | | <span>{{ dateFormat(scope.row.createTime) }}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width">
|
| | | <template slot-scope="scope">
|
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['system:dept:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-plus" |
| | | @click="handleAdd(scope.row)"
|
| | | v-hasPermi="['system:dept:add']"
|
| | | >æ°å¢</el-button>
|
| | | <el-button
|
| | | v-if="scope.row.parentId != 0"
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-delete"
|
| | | @click="handleDelete(scope.row)"
|
| | | v-hasPermi="['system:dept:remove']"
|
| | | >å é¤</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <!-- æ·»å æä¿®æ¹é¨é¨å¯¹è¯æ¡ -->
|
| | | <el-dialog :title="title" :visible.sync="open" width="600px">
|
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
| | | <el-row>
|
| | | <el-col :span="24" v-if="form.parentId !== 0">
|
| | | <el-form-item label="ä¸çº§é¨é¨" prop="parentId">
|
| | | <treeselect v-model="form.parentId" :options="deptOptions" placeholder="éæ©ä¸çº§é¨é¨" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="é¨é¨åç§°" prop="deptName">
|
| | | <el-input v-model="form.deptName" placeholder="请è¾å
¥é¨é¨åç§°" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="æ¾ç¤ºæåº" prop="orderNum">
|
| | | <el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="è´è´£äºº" prop="leader">
|
| | | <el-input v-model="form.leader" placeholder="请è¾å
¥è´è´£äºº" maxlength="20" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="èç³»çµè¯" prop="phone">
|
| | | <el-input v-model="form.phone" placeholder="请è¾å
¥èç³»çµè¯" maxlength="11" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="é®ç®±" prop="email">
|
| | | <el-input v-model="form.email" placeholder="请è¾å
¥é®ç®±" maxlength="50" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="é¨é¨ç¶æ">
|
| | | <el-radio-group v-model="form.status">
|
| | | <el-radio
|
| | | v-for="dict in statusOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictValue"
|
| | | >{{dict.dictLabel}}</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | </el-row>
|
| | | </el-form>
|
| | | <div slot="footer" class="dialog-footer">
|
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button>
|
| | | <el-button @click="cancel">å æ¶</el-button>
|
| | | </div>
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listDept, getDept, treeselect, delDept, addDept, updateDept } from "@/api/system/dept";
|
| | | import Treeselect from "@riophae/vue-treeselect";
|
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
| | |
|
| | | export default {
|
| | | components: { Treeselect },
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // è¡¨æ ¼æ æ°æ®
|
| | | deptList: [],
|
| | | // é¨é¨é¨é¨æ é项
|
| | | deptOptions: undefined,
|
| | | // å¼¹åºå±æ é¢
|
| | | title: "",
|
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±
|
| | | open: false,
|
| | | // ç¶ææ°æ®åå
¸
|
| | | statusOptions: [],
|
| | | // æ¥è¯¢åæ°
|
| | | queryParams: {
|
| | | deptName: undefined,
|
| | | status: undefined
|
| | | },
|
| | | // 表ååæ°
|
| | | form: {},
|
| | | // è¡¨åæ ¡éª
|
| | | rules: {
|
| | | parentId: [
|
| | | { required: true, message: "ä¸çº§é¨é¨ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | deptName: [
|
| | | { required: true, message: "é¨é¨åç§°ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | orderNum: [
|
| | | { required: true, message: "èå顺åºä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | email: [
|
| | | {
|
| | | type: "email",
|
| | | message: "'请è¾å
¥æ£ç¡®çé®ç®±å°å",
|
| | | trigger: ["blur", "change"]
|
| | | }
|
| | | ],
|
| | | phone: [
|
| | | {
|
| | | pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
| | | message: "请è¾å
¥æ£ç¡®çææºå·ç ",
|
| | | trigger: "blur"
|
| | | }
|
| | | ]
|
| | | }
|
| | | };
|
| | | },
|
| | | created() {
|
| | | this.getList();
|
| | | this.getDicts("sys_normal_disable").then(response => {
|
| | | this.statusOptions = response.data;
|
| | | });
|
| | | },
|
| | | methods: {
|
| | | /** æ¥è¯¢é¨é¨å表 */
|
| | | getList() {
|
| | | this.loading = true;
|
| | | listDept(this.queryParams).then(response => {
|
| | | this.deptList = response.data;
|
| | | this.loading = false;
|
| | | });
|
| | | },
|
| | | /** æ¥è¯¢é¨é¨ä¸ææ ç»æ */
|
| | | getTreeselect() {
|
| | | treeselect().then(response => {
|
| | | this.deptOptions = response.data;
|
| | | });
|
| | | },
|
| | | // åå
¸ç¶æåå
¸ç¿»è¯
|
| | | statusFormat(row, column) {
|
| | | return this.selectDictLabel(this.statusOptions, row.status);
|
| | | },
|
| | | // åæ¶æé®
|
| | | cancel() {
|
| | | this.open = false;
|
| | | this.reset();
|
| | | },
|
| | | // 表åéç½®
|
| | | reset() {
|
| | | this.form = {
|
| | | deptId: undefined,
|
| | | parentId: 100,
|
| | | deptName: undefined,
|
| | | orderNum: undefined,
|
| | | leader: undefined,
|
| | | phone: undefined,
|
| | | email: undefined,
|
| | | status: "0"
|
| | | };
|
| | | this.resetForm("form");
|
| | | },
|
| | | /** æç´¢æé®æä½ */
|
| | | handleQuery() {
|
| | | this.getList();
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd(row) {
|
| | | this.reset();
|
| | | this.getTreeselect();
|
| | | if (row != undefined) {
|
| | | this.form.parentId = row.deptId;
|
| | | }
|
| | | this.open = true;
|
| | | this.title = "æ·»å é¨é¨";
|
| | | },
|
| | | /** ä¿®æ¹æé®æä½ */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | this.getTreeselect();
|
| | | getDept(row.deptId).then(response => {
|
| | | this.form = response.data;
|
| | | this.open = true;
|
| | | this.title = "ä¿®æ¹é¨é¨";
|
| | | });
|
| | | },
|
| | | /** æäº¤æé® */
|
| | | submitForm: function() {
|
| | | this.$refs["form"].validate(valid => {
|
| | | if (valid) {
|
| | | if (this.form.deptId != undefined) {
|
| | | updateDept(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("ä¿®æ¹æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | } else {
|
| | | addDept(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("æ°å¢æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | });
|
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å称为"' + row.deptName + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delDept(row.deptId);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true">
|
| | | <el-form-item label="åå
¸åç§°">
|
| | | <el-select v-model="queryParams.dictType" size="small">
|
| | | <el-option
|
| | | v-for="item in typeOptions"
|
| | | :key="item.dictId"
|
| | | :label="item.dictName"
|
| | | :value="item.dictType"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="åå
¸æ ç¾">
|
| | | <el-input
|
| | | v-model="queryParams.dictLabel"
|
| | | placeholder="请è¾å
¥åå
¸æ ç¾"
|
| | | clearable
|
| | | size="small"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-select v-model="queryParams.status" placeholder="æ°æ®ç¶æ" clearable size="small">
|
| | | <el-option
|
| | | v-for="dict in statusOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictLabel"
|
| | | :value="dict.dictValue"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:dict:add']">æ°å¢</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="dataList" style="width: 100%;">
|
| | | <el-table-column label="åå
¸ç¼ç " align="center" prop="dictCode" />
|
| | | <el-table-column label="åå
¸æ ç¾" align="center" prop="dictLabel" />
|
| | | <el-table-column label="åå
¸é®å¼" align="center" prop="dictValue" />
|
| | | <el-table-column label="åå
¸æåº" align="center" prop="dictSort" />
|
| | | <el-table-column label="ç¶æ" align="center" prop="status" :formatter="statusFormat" />
|
| | | <el-table-column label="夿³¨" align="center" prop="remark" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180">
|
| | | <template slot-scope="scope">
|
| | | <span>{{ dateFormat(scope.row.createTime) }}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width">
|
| | | <template slot-scope="scope">
|
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['system:dict:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-delete"
|
| | | @click="handleDelete(scope.row)"
|
| | | v-hasPermi="['system:dict:remove']"
|
| | | >å é¤</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <pagination
|
| | | v-show="total>0"
|
| | | :total="total"
|
| | | :page.sync="queryParams.pageNum"
|
| | | :limit.sync="queryParams.pageSize"
|
| | | @pagination="getList"
|
| | | />
|
| | |
|
| | | <!-- æ·»å æä¿®æ¹åæ°é
ç½®å¯¹è¯æ¡ -->
|
| | | <el-dialog :title="title" :visible.sync="open" width="500px">
|
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
| | | <el-form-item label="åå
¸ç±»å">
|
| | | <el-input v-model="form.dictType" :disabled="true" />
|
| | | </el-form-item>
|
| | | <el-form-item label="æ°æ®æ ç¾" prop="dictLabel">
|
| | | <el-input v-model="form.dictLabel" placeholder="请è¾å
¥æ°æ®æ ç¾" />
|
| | | </el-form-item>
|
| | | <el-form-item label="æ°æ®é®å¼" prop="dictValue">
|
| | | <el-input v-model="form.dictValue" placeholder="请è¾å
¥æ°æ®é®å¼" />
|
| | | </el-form-item>
|
| | | <el-form-item label="æ¾ç¤ºæåº" prop="dictSort">
|
| | | <el-input-number v-model="form.dictSort" controls-position="right" :min="0" />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ" prop="status">
|
| | | <el-radio-group v-model="form.status">
|
| | | <el-radio
|
| | | v-for="dict in statusOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictValue"
|
| | | >{{dict.dictLabel}}</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | | <el-form-item label="夿³¨" prop="remark">
|
| | | <el-input v-model="form.remark" type="textarea" placeholder="请è¾å
¥å
容"></el-input>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | <div slot="footer" class="dialog-footer">
|
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button>
|
| | | <el-button @click="cancel">å æ¶</el-button>
|
| | | </div>
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data";
|
| | | import { listType, getType } from "@/api/system/dict/type";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // åå
¸è¡¨æ ¼æ°æ®
|
| | | dataList: [],
|
| | | // å¼¹åºå±æ é¢
|
| | | title: "",
|
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±
|
| | | open: false,
|
| | | // ç¶ææ°æ®åå
¸
|
| | | statusOptions: [],
|
| | | // ç±»åæ°æ®åå
¸
|
| | | typeOptions: [],
|
| | | // æ¥è¯¢åæ°
|
| | | queryParams: {
|
| | | pageNum: 1,
|
| | | pageSize: 10,
|
| | | dictName: undefined,
|
| | | dictType: undefined,
|
| | | status: undefined
|
| | | },
|
| | | // 表ååæ°
|
| | | form: {},
|
| | | // è¡¨åæ ¡éª
|
| | | rules: {
|
| | | dictLabel: [
|
| | | { required: true, message: "æ°æ®æ ç¾ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | dictValue: [
|
| | | { required: true, message: "æ°æ®é®å¼ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | dictSort: [
|
| | | { required: true, message: "æ°æ®é¡ºåºä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ]
|
| | | }
|
| | | };
|
| | | },
|
| | | created() {
|
| | | const dictId = this.$route.params && this.$route.params.dictId;
|
| | | this.getType(dictId);
|
| | | this.getTypeList();
|
| | | this.getDicts("sys_normal_disable").then(response => {
|
| | | this.statusOptions = response.data;
|
| | | });
|
| | | },
|
| | | methods: {
|
| | | /** æ¥è¯¢åå
¸ç±»åè¯¦ç» */
|
| | | getType(dictId) {
|
| | | getType(dictId).then(response => {
|
| | | this.queryParams.dictType = response.data.dictType;
|
| | | this.getList();
|
| | | });
|
| | | },
|
| | | /** æ¥è¯¢åå
¸ç±»åå表 */
|
| | | getTypeList() {
|
| | | listType().then(response => {
|
| | | this.typeOptions = response.rows;
|
| | | });
|
| | | },
|
| | | /** æ¥è¯¢åå
¸æ°æ®å表 */
|
| | | getList() {
|
| | | this.loading = true;
|
| | | listData(this.queryParams).then(response => {
|
| | | this.dataList = response.rows;
|
| | | this.total = response.total;
|
| | | this.loading = false;
|
| | | });
|
| | | },
|
| | | // æ°æ®ç¶æåå
¸ç¿»è¯
|
| | | statusFormat(row, column) {
|
| | | return this.selectDictLabel(this.statusOptions, row.status);
|
| | | },
|
| | | // åæ¶æé®
|
| | | cancel() {
|
| | | this.open = false;
|
| | | this.reset();
|
| | | },
|
| | | // 表åéç½®
|
| | | reset() {
|
| | | this.form = {
|
| | | dictCode: undefined,
|
| | | dictLabel: undefined,
|
| | | dictValue: undefined,
|
| | | dictSort: 0,
|
| | | status: "0",
|
| | | remark: undefined
|
| | | };
|
| | | this.resetForm("form");
|
| | | },
|
| | | /** æç´¢æé®æä½ */
|
| | | handleQuery() {
|
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | | this.open = true;
|
| | | this.title = "æ·»å åå
¸æ°æ®";
|
| | | this.form.dictType = this.queryParams.dictType;
|
| | | },
|
| | | /** ä¿®æ¹æé®æä½ */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | getData(row.dictCode).then(response => {
|
| | | this.form = response.data;
|
| | | this.open = true;
|
| | | this.title = "ä¿®æ¹åå
¸æ°æ®";
|
| | | });
|
| | | },
|
| | | /** æäº¤æé® */
|
| | | submitForm: function() {
|
| | | this.$refs["form"].validate(valid => {
|
| | | if (valid) {
|
| | | if (this.form.dictCode != undefined) {
|
| | | updateData(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("ä¿®æ¹æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | } else {
|
| | | addData(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("æ°å¢æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | });
|
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å称为"' + row.dictLabel + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delData(row.dictCode);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true" label-width="68px">
|
| | | <el-form-item label="åå
¸åç§°">
|
| | | <el-input
|
| | | v-model="queryParams.dictName"
|
| | | placeholder="请è¾å
¥åå
¸åç§°"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="åå
¸ç±»å">
|
| | | <el-input
|
| | | v-model="queryParams.dictType"
|
| | | placeholder="请è¾å
¥åå
¸ç±»å"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-select
|
| | | v-model="queryParams.status"
|
| | | placeholder="åå
¸ç¶æ"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | >
|
| | | <el-option
|
| | | v-for="dict in statusOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictLabel"
|
| | | :value="dict.dictValue"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="å建æ¶é´">
|
| | | <el-date-picker
|
| | | v-model="queryParams.createTime"
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | value-format="yyyy-MM-dd"
|
| | | type="daterange"
|
| | | range-separator="-"
|
| | | start-placeholder="å¼å§æ¥æ"
|
| | | end-placeholder="ç»ææ¥æ"
|
| | | ></el-date-picker>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:dict:add']">æ°å¢</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="typeList" style="width: 100%;">
|
| | | <el-table-column label="åå
¸ä¸»é®" align="center" prop="dictId" />
|
| | | <el-table-column label="åå
¸åç§°" align="center" prop="dictName" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="åå
¸ç±»å" align="center">
|
| | | <template slot-scope="scope">
|
| | | <router-link :to="'/dict/type/data/' + scope.row.dictId" class="link-type">
|
| | | <span>{{ scope.row.dictType }}</span>
|
| | | </router-link>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="ç¶æ" align="center" prop="status" :formatter="statusFormat" />
|
| | | <el-table-column label="夿³¨" align="center" prop="remark" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180">
|
| | | <template slot-scope="scope">
|
| | | <span>{{ dateFormat(scope.row.createTime) }}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width">
|
| | | <template slot-scope="scope">
|
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['system:dict:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-delete"
|
| | | @click="handleDelete(scope.row)"
|
| | | v-hasPermi="['system:dict:remove']"
|
| | | >å é¤</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <pagination
|
| | | v-show="total>0"
|
| | | :total="total"
|
| | | :page.sync="queryParams.pageNum"
|
| | | :limit.sync="queryParams.pageSize"
|
| | | @pagination="getList"
|
| | | />
|
| | |
|
| | | <!-- æ·»å æä¿®æ¹åæ°é
ç½®å¯¹è¯æ¡ -->
|
| | | <el-dialog :title="title" :visible.sync="open" width="500px">
|
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
| | | <el-form-item label="åå
¸åç§°" prop="dictName">
|
| | | <el-input v-model="form.dictName" placeholder="请è¾å
¥åå
¸åç§°" />
|
| | | </el-form-item>
|
| | | <el-form-item label="åå
¸ç±»å" prop="dictType">
|
| | | <el-input v-model="form.dictType" placeholder="请è¾å
¥åå
¸ç±»å" />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ" prop="status">
|
| | | <el-radio-group v-model="form.status">
|
| | | <el-radio
|
| | | v-for="dict in statusOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictValue"
|
| | | >{{dict.dictLabel}}</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | | <el-form-item label="夿³¨" prop="remark">
|
| | | <el-input v-model="form.remark" type="textarea" placeholder="请è¾å
¥å
容"></el-input>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | <div slot="footer" class="dialog-footer">
|
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button>
|
| | | <el-button @click="cancel">å æ¶</el-button>
|
| | | </div>
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listType, getType, delType, addType, updateType } from "@/api/system/dict/type";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // åå
¸è¡¨æ ¼æ°æ®
|
| | | typeList: [],
|
| | | // å¼¹åºå±æ é¢
|
| | | title: "",
|
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±
|
| | | open: false,
|
| | | // ç¶ææ°æ®åå
¸
|
| | | statusOptions: [],
|
| | | // æ¥æèå´
|
| | | dateRange: [],
|
| | | // æ¥è¯¢åæ°
|
| | | queryParams: {
|
| | | pageNum: 1,
|
| | | pageSize: 10,
|
| | | dictName: undefined,
|
| | | dictType: undefined,
|
| | | status: undefined
|
| | | },
|
| | | // 表ååæ°
|
| | | form: {},
|
| | | // è¡¨åæ ¡éª
|
| | | rules: {
|
| | | dictName: [
|
| | | { required: true, message: "åå
¸åç§°ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | dictType: [
|
| | | { required: true, message: "åå
¸ç±»åä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ]
|
| | | }
|
| | | };
|
| | | },
|
| | | created() {
|
| | | this.getList();
|
| | | this.getDicts("sys_normal_disable").then(response => {
|
| | | this.statusOptions = response.data;
|
| | | });
|
| | | },
|
| | | methods: {
|
| | | /** æ¥è¯¢åå
¸ç±»åå表 */
|
| | | getList() {
|
| | | this.loading = true;
|
| | | listType(this.addDateRange(this.queryParams, this.dateRange)).then(
|
| | | response => {
|
| | | this.typeList = response.rows;
|
| | | this.total = response.total;
|
| | | this.loading = false;
|
| | | }
|
| | | );
|
| | | },
|
| | | // åå
¸ç¶æåå
¸ç¿»è¯
|
| | | statusFormat(row, column) {
|
| | | return this.selectDictLabel(this.statusOptions, row.status);
|
| | | },
|
| | | // åæ¶æé®
|
| | | cancel() {
|
| | | this.open = false;
|
| | | this.reset();
|
| | | },
|
| | | // 表åéç½®
|
| | | reset() {
|
| | | this.form = {
|
| | | dictId: undefined,
|
| | | dictName: undefined,
|
| | | dictType: undefined,
|
| | | status: "0",
|
| | | remark: undefined
|
| | | };
|
| | | this.resetForm("form");
|
| | | },
|
| | | /** æç´¢æé®æä½ */
|
| | | handleQuery() {
|
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | | this.open = true;
|
| | | this.title = "æ·»å åå
¸ç±»å";
|
| | | },
|
| | | /** ä¿®æ¹æé®æä½ */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | getType(row.dictId).then(response => {
|
| | | this.form = response.data;
|
| | | this.open = true;
|
| | | this.title = "ä¿®æ¹åå
¸ç±»å";
|
| | | });
|
| | | },
|
| | | /** æäº¤æé® */
|
| | | submitForm: function() {
|
| | | this.$refs["form"].validate(valid => {
|
| | | if (valid) {
|
| | | if (this.form.dictId != undefined) {
|
| | | updateType(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("ä¿®æ¹æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | } else {
|
| | | addType(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("æ°å¢æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | });
|
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å称为"' + row.dictName + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delType(row.dictId);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template >
|
| | | <router-view />
|
| | | </template>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true">
|
| | | <el-form-item label="èååç§°">
|
| | | <el-input
|
| | | v-model="queryParams.menuName"
|
| | | placeholder="请è¾å
¥èååç§°"
|
| | | clearable
|
| | | size="small"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-select v-model="queryParams.visible" placeholder="èåç¶æ" clearable size="small">
|
| | | <el-option
|
| | | v-for="dict in visibleOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictLabel"
|
| | | :value="dict.dictValue"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:menu:add']">æ°å¢</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table
|
| | | v-loading="loading"
|
| | | :data="menuList"
|
| | | row-key="menuId"
|
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
| | | >
|
| | | <el-table-column prop="menuName" label="èååç§°" :show-overflow-tooltip="true" width="130px"></el-table-column>
|
| | | <el-table-column prop="icon" label="徿 " align="center" width="100px">
|
| | | <template slot-scope="scope">
|
| | | <svg-icon :icon-class="scope.row.icon" />
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column prop="orderNum" label="æåº" width="60px"></el-table-column>
|
| | | <el-table-column prop="perms" label="æéæ è¯" width="130px" :show-overflow-tooltip="true"></el-table-column>
|
| | | <el-table-column prop="component" label="ç»ä»¶è·¯å¾" width="180px" :show-overflow-tooltip="true"></el-table-column>
|
| | | <el-table-column prop="visible" label=" å¯è§" :formatter="visibleFormat" width="80px"></el-table-column>
|
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180">
|
| | | <template slot-scope="scope">
|
| | | <span>{{ dateFormat(scope.row.createTime) }}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="æä½" align="center" width="180" class-name="small-padding fixed-width">
|
| | | <template slot-scope="scope">
|
| | | <el-button size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['system:menu:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-plus" |
| | | @click="handleAdd(scope.row)"
|
| | | v-hasPermi="['system:menu:add']"
|
| | | >æ°å¢</el-button>
|
| | | <el-button
|
| | | v-if="scope.row.parentId != 0"
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-delete"
|
| | | @click="handleDelete(scope.row)"
|
| | | v-hasPermi="['system:menu:remove']"
|
| | | >å é¤</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <!-- æ·»å æä¿®æ¹èåå¯¹è¯æ¡ -->
|
| | | <el-dialog :title="title" :visible.sync="open" width="600px">
|
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
| | | <el-row>
|
| | | <el-col :span="24" v-if="form.parentId !== 0">
|
| | | <el-form-item label="ä¸çº§èå" prop="parentId">
|
| | | <treeselect
|
| | | v-model="form.parentId"
|
| | | :options="menuOptions"
|
| | | :show-count="true"
|
| | | placeholder="éæ©ä¸çº§èå"
|
| | | />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="24">
|
| | | <el-form-item label="èåç±»å" prop="menuType">
|
| | | <el-radio-group v-model="form.menuType">
|
| | | <el-radio label="M">ç®å½</el-radio>
|
| | | <el-radio label="C">èå</el-radio>
|
| | | <el-radio label="F">æé®</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="24">
|
| | | <el-form-item v-if="form.menuType != 'F'" label="èå徿 ">
|
| | | <el-popover
|
| | | placement="bottom-start"
|
| | | width="460"
|
| | | trigger="click"
|
| | | @show="$refs['iconSelect'].reset()"
|
| | | >
|
| | | <IconSelect ref="iconSelect" @selected="selected" />
|
| | | <el-input slot="reference" v-model="form.icon" placeholder="ç¹å»éæ©å¾æ " readonly>
|
| | | <svg-icon
|
| | | v-if="form.icon"
|
| | | slot="prefix"
|
| | | :icon-class="form.icon"
|
| | | class="el-input__icon"
|
| | | style="height: 32px;width: 16px;"
|
| | | />
|
| | | <i v-else slot="prefix" class="el-icon-search el-input__icon" />
|
| | | </el-input>
|
| | | </el-popover>
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="èååç§°" prop="menuName">
|
| | | <el-input v-model="form.menuName" placeholder="请è¾å
¥èååç§°" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="æ¾ç¤ºæåº" prop="orderNum">
|
| | | <el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item v-if="form.menuType != 'F'" label="æ¯å¦å¤é¾">
|
| | | <el-radio-group v-model="form.isFrame">
|
| | | <el-radio label="0">æ¯</el-radio>
|
| | | <el-radio label="1">å¦</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item v-if="form.menuType != 'F'" label="è·¯ç±å°å" prop="path">
|
| | | <el-input v-model="form.path" placeholder="请è¾å
¥è·¯ç±å°å" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12" v-if="form.menuType == 'C'">
|
| | | <el-form-item label="ç»ä»¶è·¯å¾" prop="component">
|
| | | <el-input v-model="form.component" placeholder="请è¾å
¥ç»ä»¶è·¯å¾" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item v-if="form.menuType == 'C'" label="æéæ è¯">
|
| | | <el-input v-model="form.perms" placeholder="请æéæ è¯" maxlength="50" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="24">
|
| | | <el-form-item v-if="form.menuType != 'F'" label="èåç¶æ">
|
| | | <el-radio-group v-model="form.visible">
|
| | | <el-radio
|
| | | v-for="dict in visibleOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictValue"
|
| | | >{{dict.dictLabel}}</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | </el-row>
|
| | | </el-form>
|
| | | <div slot="footer" class="dialog-footer">
|
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button>
|
| | | <el-button @click="cancel">å æ¶</el-button>
|
| | | </div>
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listMenu, getMenu, treeselect, delMenu, addMenu, updateMenu } from "@/api/system/menu";
|
| | | import Treeselect from "@riophae/vue-treeselect";
|
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
| | | import IconSelect from "@/components/IconSelect";
|
| | |
|
| | | export default {
|
| | | components: { Treeselect, IconSelect },
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // èåè¡¨æ ¼æ æ°æ®
|
| | | menuList: [],
|
| | | // èåæ é项
|
| | | menuOptions: undefined,
|
| | | // å¼¹åºå±æ é¢
|
| | | title: "",
|
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±
|
| | | open: false,
|
| | | // èåç¶ææ°æ®åå
¸
|
| | | visibleOptions: [],
|
| | | // æ¥è¯¢åæ°
|
| | | queryParams: {
|
| | | menuName: undefined,
|
| | | visible: undefined
|
| | | },
|
| | | // 表ååæ°
|
| | | form: {},
|
| | | // è¡¨åæ ¡éª
|
| | | rules: {
|
| | | parentId: [
|
| | | { required: true, message: "ä¸çº§èåä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | menuName: [
|
| | | { required: true, message: "èååç§°ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | orderNum: [
|
| | | { required: true, message: "èå顺åºä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ]
|
| | | }
|
| | | };
|
| | | },
|
| | | created() {
|
| | | this.getList();
|
| | | this.getDicts("sys_show_hide").then(response => {
|
| | | this.visibleOptions = response.data;
|
| | | });
|
| | | },
|
| | | methods: {
|
| | | // 鿩徿
|
| | | selected(name) {
|
| | | this.form.icon = name;
|
| | | },
|
| | | /** æ¥è¯¢èåå表 */
|
| | | getList() {
|
| | | this.loading = true;
|
| | | listMenu(this.queryParams).then(response => {
|
| | | this.menuList = response.data;
|
| | | this.loading = false;
|
| | | });
|
| | | },
|
| | | /** æ¥è¯¢èå䏿æ ç»æ */
|
| | | getTreeselect() {
|
| | | treeselect().then(response => {
|
| | | this.menuOptions = response.data;
|
| | | });
|
| | | },
|
| | | // èåæ¾ç¤ºç¶æåå
¸ç¿»è¯
|
| | | visibleFormat(row, column) {
|
| | | if (row.menuType == "F") {
|
| | | return "";
|
| | | }
|
| | | return this.selectDictLabel(this.visibleOptions, row.visible);
|
| | | },
|
| | | // åæ¶æé®
|
| | | cancel() {
|
| | | this.open = false;
|
| | | this.reset();
|
| | | },
|
| | | // 表åéç½®
|
| | | reset() {
|
| | | this.form = {
|
| | | menuId: undefined,
|
| | | parentId: 0,
|
| | | menuName: undefined,
|
| | | icon: undefined,
|
| | | menuType: "M",
|
| | | orderNum: undefined,
|
| | | isFrame: "1",
|
| | | visible: "0"
|
| | | };
|
| | | this.resetForm("form");
|
| | | },
|
| | | /** æç´¢æé®æä½ */
|
| | | handleQuery() {
|
| | | this.getList();
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd(row) {
|
| | | this.reset();
|
| | | this.getTreeselect();
|
| | | if (row != null) {
|
| | | this.form.parentId = row.menuId;
|
| | | }
|
| | | this.open = true;
|
| | | this.title = "æ·»å èå";
|
| | | },
|
| | | /** ä¿®æ¹æé®æä½ */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | this.getTreeselect();
|
| | | getMenu(row.menuId).then(response => {
|
| | | this.form = response.data;
|
| | | this.open = true;
|
| | | this.title = "ä¿®æ¹èå";
|
| | | });
|
| | | },
|
| | | /** æäº¤æé® */
|
| | | submitForm: function() {
|
| | | this.$refs["form"].validate(valid => {
|
| | | if (valid) {
|
| | | if (this.form.menuId != undefined) {
|
| | | updateMenu(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("ä¿®æ¹æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | } else {
|
| | | addMenu(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("æ°å¢æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | });
|
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å称为"' + row.menuName + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delMenu(row.menuId);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true" label-width="68px">
|
| | | <el-form-item label="å
¬åæ é¢">
|
| | | <el-input
|
| | | v-model="queryParams.noticeTitle"
|
| | | placeholder="请è¾å
¥å
¬åæ é¢"
|
| | | clearable
|
| | | size="small"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="æä½äººå">
|
| | | <el-input
|
| | | v-model="queryParams.createBy"
|
| | | placeholder="请è¾å
¥æä½äººå"
|
| | | clearable
|
| | | size="small"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç±»å">
|
| | | <el-select v-model="queryParams.noticeType" placeholder="å
¬åç±»å" clearable size="small">
|
| | | <el-option
|
| | | v-for="dict in typeOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictLabel"
|
| | | :value="dict.dictValue"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:notice:add']">æ°å¢</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="noticeList">
|
| | | <el-table-column label="åºå·" align="center" prop="noticeId" width="100" />
|
| | | <el-table-column
|
| | | label="å
¬åæ é¢"
|
| | | align="center"
|
| | | prop="noticeTitle"
|
| | | :show-overflow-tooltip="true"
|
| | | />
|
| | | <el-table-column
|
| | | label="å
¬åç±»å"
|
| | | align="center"
|
| | | prop="noticeType"
|
| | | :formatter="typeFormat"
|
| | | width="100"
|
| | | />
|
| | | <el-table-column
|
| | | label="ç¶æ"
|
| | | align="center"
|
| | | prop="status"
|
| | | :formatter="statusFormat"
|
| | | width="100"
|
| | | />
|
| | | <el-table-column label="å建è
" align="center" prop="createBy" width="100" />
|
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="100">
|
| | | <template slot-scope="scope">
|
| | | <span>{{ dateFormat(scope.row.createTime, 'yyyy-MM-dd') }}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width">
|
| | | <template slot-scope="scope">
|
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['system:notice:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-delete"
|
| | | @click="handleDelete(scope.row)"
|
| | | v-hasPermi="['system:notice:remove']"
|
| | | >å é¤</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <pagination
|
| | | v-show="total>0"
|
| | | :total="total"
|
| | | :page.sync="queryParams.pageNum"
|
| | | :limit.sync="queryParams.pageSize"
|
| | | @pagination="getList"
|
| | | />
|
| | |
|
| | | <!-- æ·»å æä¿®æ¹å
¬åå¯¹è¯æ¡ -->
|
| | | <el-dialog :title="title" :visible.sync="open" width="780px">
|
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
| | | <el-row>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="å
¬åæ é¢" prop="noticeTitle">
|
| | | <el-input v-model="form.noticeTitle" placeholder="请è¾å
¥å
¬åæ é¢" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="å
¬åç±»å" prop="noticeType">
|
| | | <el-select v-model="form.noticeType" placeholder="è¯·éæ©">
|
| | | <el-option
|
| | | v-for="dict in typeOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictLabel"
|
| | | :value="dict.dictValue"
|
| | | ></el-option>
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="24">
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-radio-group v-model="form.status">
|
| | | <el-radio
|
| | | v-for="dict in statusOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictValue"
|
| | | >{{dict.dictLabel}}</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="24">
|
| | | <el-form-item label="å
容">
|
| | | <Editor v-model="form.noticeContent"/>
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | </el-row>
|
| | | </el-form>
|
| | | <div slot="footer" class="dialog-footer" style="padding-top:20px">
|
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button>
|
| | | <el-button @click="cancel">å æ¶</el-button>
|
| | | </div>
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
|
| | | import Editor from '@/components/Editor';
|
| | |
|
| | | export default {
|
| | | components: {
|
| | | Editor
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // å
¬åè¡¨æ ¼æ°æ®
|
| | | noticeList: [],
|
| | | // å¼¹åºå±æ é¢
|
| | | title: "",
|
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±
|
| | | open: false,
|
| | | // ç±»åæ°æ®åå
¸
|
| | | statusOptions: [],
|
| | | // ç¶ææ°æ®åå
¸
|
| | | typeOptions: [],
|
| | | // æ¥è¯¢åæ°
|
| | | queryParams: {
|
| | | pageNum: 1,
|
| | | pageSize: 10,
|
| | | noticeTitle: undefined,
|
| | | createBy: undefined,
|
| | | status: undefined
|
| | | },
|
| | | // 表ååæ°
|
| | | form: {},
|
| | | // è¡¨åæ ¡éª
|
| | | rules: {
|
| | | noticeTitle: [
|
| | | { required: true, message: "å
¬åæ é¢ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | noticeType: [
|
| | | { required: true, message: "å
¬åç±»åä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ]
|
| | | }
|
| | | };
|
| | | },
|
| | | created() {
|
| | | this.getList();
|
| | | this.getDicts("sys_notice_status").then(response => {
|
| | | this.statusOptions = response.data;
|
| | | });
|
| | | this.getDicts("sys_notice_type").then(response => {
|
| | | this.typeOptions = response.data;
|
| | | });
|
| | | },
|
| | | methods: {
|
| | | /** æ¥è¯¢å
¬åå表 */
|
| | | getList() {
|
| | | this.loading = true;
|
| | | listNotice(this.queryParams).then(response => {
|
| | | this.noticeList = response.rows;
|
| | | this.total = response.total;
|
| | | this.loading = false;
|
| | | });
|
| | | },
|
| | | // å
¬åç¶æåå
¸ç¿»è¯
|
| | | statusFormat(row, column) {
|
| | | return this.selectDictLabel(this.statusOptions, row.status);
|
| | | },
|
| | | // å
¬åç¶æåå
¸ç¿»è¯
|
| | | typeFormat(row, column) {
|
| | | return this.selectDictLabel(this.typeOptions, row.noticeType);
|
| | | },
|
| | | // åæ¶æé®
|
| | | cancel() {
|
| | | this.open = false;
|
| | | this.reset();
|
| | | },
|
| | | // 表åéç½®
|
| | | reset() {
|
| | | this.form = {
|
| | | noticeId: undefined,
|
| | | noticeTitle: undefined,
|
| | | noticeType: undefined,
|
| | | noticeContent: undefined,
|
| | | status: "0"
|
| | | };
|
| | | this.resetForm("form");
|
| | | },
|
| | | /** æç´¢æé®æä½ */
|
| | | handleQuery() {
|
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | | this.open = true;
|
| | | this.title = "æ·»å å
Œ";
|
| | | },
|
| | | /** ä¿®æ¹æé®æä½ */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | getNotice(row.noticeId).then(response => {
|
| | | this.form = response.data;
|
| | | this.open = true;
|
| | | this.title = "ä¿®æ¹å
Œ";
|
| | | });
|
| | | },
|
| | | /** æäº¤æé® */
|
| | | submitForm: function() {
|
| | | this.$refs["form"].validate(valid => {
|
| | | if (valid) {
|
| | | if (this.form.noticeId != undefined) {
|
| | | updateNotice(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("ä¿®æ¹æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | } else {
|
| | | addNotice(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("æ°å¢æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | });
|
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å
¬åæ é¢ä¸º"' + row.noticeTitle + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delNotice(row.noticeId);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true" label-width="68px">
|
| | | <el-form-item label="å²ä½ç¼ç ">
|
| | | <el-input
|
| | | v-model="queryParams.postCode"
|
| | | placeholder="请è¾å
¥å²ä½ç¼ç "
|
| | | clearable
|
| | | size="small"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="å²ä½åç§°">
|
| | | <el-input
|
| | | v-model="queryParams.postName"
|
| | | placeholder="请è¾å
¥å²ä½åç§°"
|
| | | clearable
|
| | | size="small"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-select v-model="queryParams.status" placeholder="å²ä½ç¶æ" clearable size="small">
|
| | | <el-option
|
| | | v-for="dict in statusOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictLabel"
|
| | | :value="dict.dictValue"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:post:add']">æ°å¢</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="postList">
|
| | | <el-table-column label="å²ä½ç¼å·" align="center" prop="postId" />
|
| | | <el-table-column label="å²ä½ç¼ç " align="center" prop="postCode" />
|
| | | <el-table-column label="å²ä½åç§°" align="center" prop="postName" />
|
| | | <el-table-column label="å²ä½æåº" align="center" prop="postSort" />
|
| | | <el-table-column label="ç¶æ" align="center" prop="status" :formatter="statusFormat" />
|
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180">
|
| | | <template slot-scope="scope">
|
| | | <span>{{ dateFormat(scope.row.createTime) }}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width">
|
| | | <template slot-scope="scope">
|
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['system:post:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-delete"
|
| | | @click="handleDelete(scope.row)"
|
| | | v-hasPermi="['system:post:remove']"
|
| | | >å é¤</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <pagination
|
| | | v-show="total>0"
|
| | | :total="total"
|
| | | :page.sync="queryParams.pageNum"
|
| | | :limit.sync="queryParams.pageSize"
|
| | | @pagination="getList"
|
| | | />
|
| | |
|
| | | <!-- æ·»å æä¿®æ¹å²ä½å¯¹è¯æ¡ -->
|
| | | <el-dialog :title="title" :visible.sync="open" width="500px">
|
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
| | | <el-form-item label="å²ä½åç§°" prop="postName">
|
| | | <el-input v-model="form.postName" placeholder="请è¾å
¥å²ä½åç§°" />
|
| | | </el-form-item>
|
| | | <el-form-item label="å²ä½ç¼ç " prop="postCode">
|
| | | <el-input v-model="form.postCode" placeholder="请è¾å
¥ç¼ç åç§°" />
|
| | | </el-form-item>
|
| | | <el-form-item label="å²ä½é¡ºåº" prop="postSort">
|
| | | <el-input-number v-model="form.postSort" controls-position="right" :min="0" />
|
| | | </el-form-item>
|
| | | <el-form-item label="å²ä½ç¶æ" prop="status">
|
| | | <el-radio-group v-model="form.status">
|
| | | <el-radio
|
| | | v-for="dict in statusOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictValue"
|
| | | >{{dict.dictLabel}}</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | | <el-form-item label="夿³¨" prop="remark">
|
| | | <el-input v-model="form.remark" type="textarea" placeholder="请è¾å
¥å
容" />
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | <div slot="footer" class="dialog-footer">
|
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button>
|
| | | <el-button @click="cancel">å æ¶</el-button>
|
| | | </div>
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // å²ä½è¡¨æ ¼æ°æ®
|
| | | postList: [],
|
| | | // å¼¹åºå±æ é¢
|
| | | title: "",
|
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±
|
| | | open: false,
|
| | | // ç¶ææ°æ®åå
¸
|
| | | statusOptions: [],
|
| | | // æ¥è¯¢åæ°
|
| | | queryParams: {
|
| | | pageNum: 1,
|
| | | pageSize: 10,
|
| | | postCode: undefined,
|
| | | postName: undefined,
|
| | | status: undefined
|
| | | },
|
| | | // 表ååæ°
|
| | | form: {},
|
| | | // è¡¨åæ ¡éª
|
| | | rules: {
|
| | | postName: [
|
| | | { required: true, message: "å²ä½åç§°ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | postCode: [
|
| | | { required: true, message: "å²ä½ç¼ç ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | postSort: [
|
| | | { required: true, message: "å²ä½é¡ºåºä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ]
|
| | | }
|
| | | };
|
| | | },
|
| | | created() {
|
| | | this.getList();
|
| | | this.getDicts("sys_normal_disable").then(response => {
|
| | | this.statusOptions = response.data;
|
| | | });
|
| | | },
|
| | | methods: {
|
| | | /** æ¥è¯¢å²ä½å表 */
|
| | | getList() {
|
| | | this.loading = true;
|
| | | listPost(this.queryParams).then(response => {
|
| | | this.postList = response.rows;
|
| | | this.total = response.total;
|
| | | this.loading = false;
|
| | | });
|
| | | },
|
| | | // å²ä½ç¶æåå
¸ç¿»è¯
|
| | | statusFormat(row, column) {
|
| | | return this.selectDictLabel(this.statusOptions, row.status);
|
| | | },
|
| | | // åæ¶æé®
|
| | | cancel() {
|
| | | this.open = false;
|
| | | this.reset();
|
| | | },
|
| | | // 表åéç½®
|
| | | reset() {
|
| | | this.form = {
|
| | | postId: undefined,
|
| | | postCode: undefined,
|
| | | postName: undefined,
|
| | | postSort: 0,
|
| | | status: "0",
|
| | | remark: undefined
|
| | | };
|
| | | this.resetForm("form");
|
| | | },
|
| | | /** æç´¢æé®æä½ */
|
| | | handleQuery() {
|
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | | this.open = true;
|
| | | this.title = "æ·»å å²ä½";
|
| | | },
|
| | | /** ä¿®æ¹æé®æä½ */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | getPost(row.postId).then(response => {
|
| | | this.form = response.data;
|
| | | this.open = true;
|
| | | this.title = "ä¿®æ¹å²ä½";
|
| | | });
|
| | | },
|
| | | /** æäº¤æé® */
|
| | | submitForm: function() {
|
| | | this.$refs["form"].validate(valid => {
|
| | | if (valid) {
|
| | | if (this.form.postId != undefined) {
|
| | | updatePost(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("ä¿®æ¹æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | } else {
|
| | | addPost(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("æ°å¢æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | });
|
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å²ä½å称为"' + row.postName + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delPost(row.postId);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :inline="true">
|
| | | <el-form-item label="è§è²åç§°">
|
| | | <el-input
|
| | | v-model="queryParams.roleName"
|
| | | placeholder="请è¾å
¥è§è²åç§°"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="æéå符">
|
| | | <el-input
|
| | | v-model="queryParams.roleKey"
|
| | | placeholder="请è¾å
¥æéå符"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-select
|
| | | v-model="queryParams.status"
|
| | | placeholder="è§è²ç¶æ"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | >
|
| | | <el-option
|
| | | v-for="dict in statusOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictLabel"
|
| | | :value="dict.dictValue"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="å建æ¶é´">
|
| | | <el-date-picker
|
| | | v-model="dateRange"
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | value-format="yyyy-MM-dd"
|
| | | type="daterange"
|
| | | range-separator="-"
|
| | | start-placeholder="å¼å§æ¥æ"
|
| | | end-placeholder="ç»ææ¥æ"
|
| | | ></el-date-picker>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button
|
| | | type="primary"
|
| | | icon="el-icon-plus"
|
| | | size="mini"
|
| | | @click="handleAdd"
|
| | | v-hasPermi="['system:role:add']"
|
| | | >æ°å¢</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="roleList">
|
| | | <el-table-column label="è§è²ç¼å·" prop="roleId" width="120" />
|
| | | <el-table-column label="è§è²åç§°" prop="roleName" :show-overflow-tooltip="true" width="150" />
|
| | | <el-table-column label="æéå符" prop="roleKey" :show-overflow-tooltip="true" width="180" />
|
| | | <el-table-column label="æ¾ç¤ºé¡ºåº" prop="roleSort" width="120" />
|
| | | <el-table-column label="ç¶æ" align="center" width="120">
|
| | | <template slot-scope="scope">
|
| | | <el-switch
|
| | | v-model="scope.row.status"
|
| | | active-value="0"
|
| | | inactive-value="1"
|
| | | @change="handleStatusChange(scope.row)"
|
| | | ></el-switch>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180">
|
| | | <template slot-scope="scope">
|
| | | <span>{{ dateFormat(scope.row.createTime) }}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width">
|
| | | <template slot-scope="scope">
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-edit"
|
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['system:role:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-circle-check"
|
| | | @click="handleDataScope(scope.row)"
|
| | | v-hasPermi="['system:role:edit']"
|
| | | >æ°æ®æé</el-button>
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-delete"
|
| | | @click="handleDelete(scope.row)"
|
| | | v-hasPermi="['system:role:remove']"
|
| | | >å é¤</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <pagination
|
| | | v-show="total>0"
|
| | | :total="total"
|
| | | :page.sync="queryParams.pageNum"
|
| | | :limit.sync="queryParams.pageSize"
|
| | | @pagination="getList"
|
| | | />
|
| | |
|
| | | <!-- æ·»å æä¿®æ¹è§è²é
ç½®å¯¹è¯æ¡ -->
|
| | | <el-dialog :title="title" :visible.sync="open" width="500px">
|
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
| | | <el-form-item label="è§è²åç§°" prop="roleName">
|
| | | <el-input v-model="form.roleName" placeholder="请è¾å
¥è§è²åç§°" />
|
| | | </el-form-item>
|
| | | <el-form-item label="æéå符" prop="roleKey">
|
| | | <el-input v-model="form.roleKey" placeholder="请è¾å
¥æéå符" />
|
| | | </el-form-item>
|
| | | <el-form-item label="è§è²é¡ºåº" prop="roleSort">
|
| | | <el-input-number v-model="form.roleSort" controls-position="right" :min="0" />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-radio-group v-model="form.status">
|
| | | <el-radio
|
| | | v-for="dict in statusOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictValue"
|
| | | >{{dict.dictLabel}}</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | | <el-form-item label="èåæé">
|
| | | <el-tree
|
| | | :data="menuOptions"
|
| | | show-checkbox
|
| | | ref="menu"
|
| | | node-key="id"
|
| | | empty-text="å è½½ä¸ï¼è¯·ç¨å"
|
| | | :props="defaultProps"
|
| | | ></el-tree>
|
| | | </el-form-item>
|
| | | <el-form-item label="夿³¨">
|
| | | <el-input v-model="form.remark" type="textarea" placeholder="请è¾å
¥å
容"></el-input>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | <div slot="footer" class="dialog-footer">
|
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button>
|
| | | <el-button @click="cancel">å æ¶</el-button>
|
| | | </div>
|
| | | </el-dialog>
|
| | |
|
| | | <!-- åé
è§è²æ°æ®æéå¯¹è¯æ¡ -->
|
| | | <el-dialog :title="title" :visible.sync="openDataScope" width="500px">
|
| | | <el-form :model="form" label-width="80px">
|
| | | <el-form-item label="è§è²åç§°">
|
| | | <el-input v-model="form.roleName" :disabled="true" />
|
| | | </el-form-item>
|
| | | <el-form-item label="æéå符">
|
| | | <el-input v-model="form.roleKey" :disabled="true" />
|
| | | </el-form-item>
|
| | | <el-form-item label="æéèå´">
|
| | | <el-select v-model="form.dataScope">
|
| | | <el-option
|
| | | v-for="item in dataScopeOptions"
|
| | | :key="item.value"
|
| | | :label="item.label"
|
| | | :value="item.value"
|
| | | ></el-option>
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="æ°æ®æé" v-show="form.dataScope == 2">
|
| | | <el-tree
|
| | | :data="deptOptions"
|
| | | show-checkbox
|
| | | default-expand-all
|
| | | ref="dept"
|
| | | node-key="id"
|
| | | empty-text="å è½½ä¸ï¼è¯·ç¨å"
|
| | | :props="defaultProps"
|
| | | ></el-tree>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | <div slot="footer" class="dialog-footer">
|
| | | <el-button type="primary" @click="submitDataScope">ç¡® å®</el-button>
|
| | | <el-button @click="cancelDataScope">å æ¶</el-button>
|
| | | </div>
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus } from "@/api/system/role";
|
| | | import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
|
| | | import { treeselect as deptTreeselect, roleDeptTreeselect } from "@/api/system/dept";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // è§è²è¡¨æ ¼æ°æ®
|
| | | roleList: [],
|
| | | // å¼¹åºå±æ é¢
|
| | | title: "",
|
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±
|
| | | open: false,
|
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±ï¼æ°æ®æéï¼
|
| | | openDataScope: false,
|
| | | // æ¥æèå´
|
| | | dateRange: [],
|
| | | // ç¶ææ°æ®åå
¸
|
| | | statusOptions: [],
|
| | | // æ°æ®èå´é项
|
| | | dataScopeOptions: [
|
| | | {
|
| | | value: "1",
|
| | | label: "å
¨é¨æ°æ®æé"
|
| | | },
|
| | | {
|
| | | value: "2",
|
| | | label: "èªå®æ°æ®æé"
|
| | | },
|
| | | {
|
| | | value: "3",
|
| | | label: "æ¬é¨é¨æ°æ®æé"
|
| | | },
|
| | | {
|
| | | value: "4",
|
| | | label: "æ¬é¨é¨å以䏿°æ®æé"
|
| | | },
|
| | | {
|
| | | value: "5",
|
| | | label: "ä»
æ¬äººæ°æ®æé"
|
| | | }
|
| | | ],
|
| | | // èåå表
|
| | | menuOptions: [],
|
| | | // é¨é¨å表
|
| | | deptOptions: [],
|
| | | // æ¥è¯¢åæ°
|
| | | queryParams: {
|
| | | pageNum: 1,
|
| | | pageSize: 10,
|
| | | roleName: undefined,
|
| | | roleKey: undefined,
|
| | | status: undefined
|
| | | },
|
| | | // 表ååæ°
|
| | | form: {},
|
| | | defaultProps: {
|
| | | children: "children",
|
| | | label: "label"
|
| | | },
|
| | | // è¡¨åæ ¡éª
|
| | | rules: {
|
| | | roleName: [
|
| | | { required: true, message: "è§è²åç§°ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | roleKey: [
|
| | | { required: true, message: "æéå符ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | roleSort: [
|
| | | { required: true, message: "è§è²é¡ºåºä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ]
|
| | | }
|
| | | };
|
| | | },
|
| | | created() {
|
| | | this.getList();
|
| | | this.getDicts("sys_normal_disable").then(response => {
|
| | | this.statusOptions = response.data;
|
| | | });
|
| | | },
|
| | | methods: {
|
| | | /** æ¥è¯¢è§è²å表 */
|
| | | getList() {
|
| | | this.loading = true;
|
| | | listRole(this.addDateRange(this.queryParams, this.dateRange)).then(
|
| | | response => {
|
| | | this.roleList = response.rows;
|
| | | this.total = response.total;
|
| | | this.loading = false;
|
| | | }
|
| | | );
|
| | | },
|
| | | /** æ¥è¯¢èåæ ç»æ */
|
| | | getMenuTreeselect() {
|
| | | menuTreeselect().then(response => {
|
| | | this.menuOptions = response.data;
|
| | | });
|
| | | },
|
| | | /** æ¥è¯¢é¨é¨æ ç»æ */
|
| | | getDeptTreeselect() {
|
| | | deptTreeselect().then(response => {
|
| | | this.deptOptions = response.data;
|
| | | });
|
| | | },
|
| | | // ææèåèç¹æ°æ®
|
| | | getMenuAllCheckedKeys() {
|
| | | // ç®å被éä¸çèåèç¹
|
| | | let checkedKeys = this.$refs.menu.getHalfCheckedKeys();
|
| | | // åéä¸çèåèç¹
|
| | | let halfCheckedKeys = this.$refs.menu.getCheckedKeys();
|
| | | checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
|
| | | return checkedKeys;
|
| | | },
|
| | | // ææé¨é¨èç¹æ°æ®
|
| | | getDeptAllCheckedKeys() {
|
| | | // ç®å被éä¸çé¨é¨èç¹
|
| | | let checkedKeys = this.$refs.dept.getHalfCheckedKeys();
|
| | | // åéä¸çé¨é¨èç¹
|
| | | let halfCheckedKeys = this.$refs.dept.getCheckedKeys();
|
| | | checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
|
| | | return checkedKeys;
|
| | | },
|
| | | /** æ ¹æ®è§è²IDæ¥è¯¢èåæ ç»æ */
|
| | | getRoleMenuTreeselect(roleId) {
|
| | | roleMenuTreeselect(roleId).then(response => {
|
| | | this.getMenuTreeselect();
|
| | | this.$refs.menu.setCheckedKeys(response.data);
|
| | | });
|
| | | },
|
| | | /** æ ¹æ®è§è²IDæ¥è¯¢é¨é¨æ ç»æ */
|
| | | getRoleDeptTreeselect(roleId) {
|
| | | roleDeptTreeselect(roleId).then(response => {
|
| | | this.getDeptTreeselect();
|
| | | this.$refs.dept.setCheckedKeys(response.data);
|
| | | });
|
| | | },
|
| | | // è§è²ç¶æä¿®æ¹
|
| | | handleStatusChange(row) {
|
| | | let text = row.status === "0" ? "å¯ç¨" : "åç¨";
|
| | | this.$confirm('确认è¦"' + text + '""' + row.roleName + '"è§è²å?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return changeRoleStatus(row.roleId, row.status);
|
| | | }).then(() => {
|
| | | this.msgSuccess(text + "æå");
|
| | | }).catch(function() {
|
| | | row.status = row.status === "0" ? "1" : "0";
|
| | | });
|
| | | },
|
| | | // åæ¶æé®
|
| | | cancel() {
|
| | | this.open = false;
|
| | | this.reset();
|
| | | },
|
| | | // åæ¶æé®ï¼æ°æ®æéï¼
|
| | | cancelDataScope() {
|
| | | this.openDataScope = false;
|
| | | this.reset();
|
| | | },
|
| | | // 表åéç½®
|
| | | reset() {
|
| | | if (this.$refs.tree != undefined) {
|
| | | this.$refs.tree.setCheckedKeys([]);
|
| | | }
|
| | | this.form = {
|
| | | roleId: undefined,
|
| | | roleName: undefined,
|
| | | roleKey: undefined,
|
| | | roleSort: 0,
|
| | | status: "0",
|
| | | menuIds: [],
|
| | | deptIds: [],
|
| | | remark: undefined
|
| | | };
|
| | | this.resetForm("form");
|
| | | },
|
| | | /** æç´¢æé®æä½ */
|
| | | handleQuery() {
|
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | | this.getMenuTreeselect();
|
| | | this.open = true;
|
| | | this.title = "æ·»å è§è²";
|
| | | },
|
| | | /** ä¿®æ¹æé®æä½ */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | this.$nextTick(() => {
|
| | | this.getRoleMenuTreeselect(row.roleId);
|
| | | });
|
| | | getRole(row.roleId).then(response => {
|
| | | this.form = response.data;
|
| | | this.open = true;
|
| | | this.title = "ä¿®æ¹è§è²";
|
| | | });
|
| | | },
|
| | | /** åé
æ°æ®æéæä½ */
|
| | | handleDataScope(row) {
|
| | | this.reset();
|
| | | this.$nextTick(() => {
|
| | | this.getRoleDeptTreeselect(row.roleId);
|
| | | });
|
| | | getRole(row.roleId).then(response => {
|
| | | this.form = response.data;
|
| | | this.openDataScope = true;
|
| | | this.title = "åé
æ°æ®æé";
|
| | | });
|
| | | },
|
| | | /** æäº¤æé® */
|
| | | submitForm: function() {
|
| | | this.$refs["form"].validate(valid => {
|
| | | if (valid) {
|
| | | if (this.form.roleId != undefined) {
|
| | | this.form.menuIds = this.getMenuAllCheckedKeys();
|
| | | updateRole(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("ä¿®æ¹æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | } else {
|
| | | this.form.menuIds = this.getMenuAllCheckedKeys();
|
| | | addRole(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("æ°å¢æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | });
|
| | | },
|
| | | /** æäº¤æé®ï¼æ°æ®æéï¼ */
|
| | | submitDataScope: function() {
|
| | | if (this.form.roleId != undefined) {
|
| | | this.form.deptIds = this.getDeptAllCheckedKeys();
|
| | | dataScope(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("ä¿®æ¹æå");
|
| | | this.openDataScope = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | }
|
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å称为"' + row.roleName + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delRole(row.roleId);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-row :gutter="20">
|
| | | <!--é¨é¨æ°æ®-->
|
| | | <el-col :span="4" :xs="24">
|
| | | <div class="head-container">
|
| | | <el-input
|
| | | v-model="deptName"
|
| | | placeholder="请è¾å
¥é¨é¨åç§°"
|
| | | clearable
|
| | | size="small"
|
| | | prefix-icon="el-icon-search"
|
| | | style="margin-bottom: 20px"
|
| | | />
|
| | | </div>
|
| | | <div class="head-container">
|
| | | <el-tree
|
| | | :data="deptOptions"
|
| | | :props="defaultProps"
|
| | | :expand-on-click-node="false"
|
| | | :filter-node-method="filterNode"
|
| | | ref="tree"
|
| | | default-expand-all
|
| | | @node-click="handleNodeClick"
|
| | | />
|
| | | </div>
|
| | | </el-col>
|
| | | <!--ç¨æ·æ°æ®-->
|
| | | <el-col :span="20" :xs="24">
|
| | | <el-form :inline="true" label-width="68px">
|
| | | <el-form-item label="ç¨æ·åç§°">
|
| | | <el-input
|
| | | v-model="queryParams.userName"
|
| | | placeholder="请è¾å
¥ç¨æ·åç§°"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ææºå·ç ">
|
| | | <el-input
|
| | | v-model="queryParams.phonenumber"
|
| | | placeholder="请è¾å
¥ææºå·ç "
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-select
|
| | | v-model="queryParams.status"
|
| | | placeholder="ç¨æ·ç¶æ"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | >
|
| | | <el-option
|
| | | v-for="dict in statusOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictLabel"
|
| | | :value="dict.dictValue"
|
| | | />
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | <el-form-item label="å建æ¶é´">
|
| | | <el-date-picker
|
| | | v-model="dateRange"
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | value-format="yyyy-MM-dd"
|
| | | type="daterange"
|
| | | range-separator="-"
|
| | | start-placeholder="å¼å§æ¥æ"
|
| | | end-placeholder="ç»ææ¥æ"
|
| | | ></el-date-picker>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:user:add']">æ°å¢</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-table v-loading="loading" :data="userList">
|
| | | <el-table-column label="ç¨æ·ç¼å·" align="center" prop="userId" />
|
| | | <el-table-column label="ç¨æ·åç§°" align="center" prop="userName" />
|
| | | <el-table-column label="ç¨æ·æµç§°" align="center" prop="nickName" />
|
| | | <el-table-column label="é¨é¨" align="center" prop="dept.deptName" />
|
| | | <el-table-column label="ææºå·ç " align="center" prop="phonenumber" width="120" />
|
| | | <el-table-column label="ç¶æ" align="center">
|
| | | <template slot-scope="scope">
|
| | | <el-switch
|
| | | v-model="scope.row.status"
|
| | | active-value="0"
|
| | | inactive-value="1"
|
| | | @change="handleStatusChange(scope.row)"
|
| | | ></el-switch>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="160">
|
| | | <template slot-scope="scope">
|
| | | <span>{{ dateFormat(scope.row.createTime) }}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column
|
| | | label="æä½"
|
| | | align="center"
|
| | | width="180"
|
| | | class-name="small-padding fixed-width"
|
| | | >
|
| | | <template slot-scope="scope">
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-edit"
|
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['system:user:edit']"
|
| | | >ä¿®æ¹</el-button>
|
| | | <el-button
|
| | | v-if="scope.row.userId !== 1"
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-delete"
|
| | | @click="handleDelete(scope.row)"
|
| | | v-hasPermi="['system:user:remove']"
|
| | | >å é¤</el-button>
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-key"
|
| | | @click="handleResetPwd(scope.row)"
|
| | | v-hasPermi="['system:user:resetPwd']"
|
| | | >éç½®</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <pagination
|
| | | v-show="total>0"
|
| | | :total="total"
|
| | | :page.sync="queryParams.pageNum"
|
| | | :limit.sync="queryParams.pageSize"
|
| | | @pagination="getList"
|
| | | />
|
| | | </el-col>
|
| | | </el-row>
|
| | |
|
| | | <!-- æ·»å æä¿®æ¹åæ°é
ç½®å¯¹è¯æ¡ -->
|
| | | <el-dialog :title="title" :visible.sync="open" width="600px">
|
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
| | | <el-row>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="ç¨æ·æµç§°" prop="nickName">
|
| | | <el-input v-model="form.nickName" placeholder="请è¾å
¥ç¨æ·æµç§°" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="å½å±é¨é¨" prop="deptId">
|
| | | <treeselect v-model="form.deptId" :options="deptOptions" placeholder="è¯·éæ©å½å±é¨é¨" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="ææºå·ç " prop="phonenumber">
|
| | | <el-input v-model="form.phonenumber" placeholder="请è¾å
¥ææºå·ç " maxlength="11" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="é®ç®±" prop="email">
|
| | | <el-input v-model="form.email" placeholder="请è¾å
¥é®ç®±" maxlength="50" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="ç¨æ·åç§°" prop="userName">
|
| | | <el-input v-model="form.userName" placeholder="请è¾å
¥ç¨æ·åç§°" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item v-if="form.userId == undefined" label="ç¨æ·å¯ç " prop="password">
|
| | | <el-input v-model="form.password" placeholder="请è¾å
¥ç¨æ·å¯ç " type="password" />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="ç¨æ·æ§å«">
|
| | | <el-select v-model="form.sex" placeholder="è¯·éæ©">
|
| | | <el-option
|
| | | v-for="dict in sexOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictLabel"
|
| | | :value="dict.dictValue"
|
| | | ></el-option>
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="ç¶æ">
|
| | | <el-radio-group v-model="form.status">
|
| | | <el-radio
|
| | | v-for="dict in statusOptions"
|
| | | :key="dict.dictValue"
|
| | | :label="dict.dictValue"
|
| | | >{{dict.dictLabel}}</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | | </el-col>
|
| | |
|
| | | <el-col :span="12">
|
| | | <el-form-item label="å²ä½">
|
| | | <el-select v-model="form.postIds" multiple placeholder="è¯·éæ©">
|
| | | <el-option
|
| | | v-for="item in postOptions"
|
| | | :key="item.postId"
|
| | | :label="item.postName"
|
| | | :value="item.postId"
|
| | | :disabled="item.status == 1"
|
| | | ></el-option>
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="12">
|
| | | <el-form-item label="è§è²">
|
| | | <el-select v-model="form.roleIds" multiple placeholder="è¯·éæ©">
|
| | | <el-option
|
| | | v-for="item in roleOptions"
|
| | | :key="item.roleId"
|
| | | :label="item.roleName"
|
| | | :value="item.roleId"
|
| | | :disabled="item.status == 1"
|
| | | ></el-option>
|
| | | </el-select>
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="24">
|
| | | <el-form-item label="夿³¨">
|
| | | <el-input v-model="form.remark" type="textarea" placeholder="请è¾å
¥å
容"></el-input>
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | </el-row>
|
| | | </el-form>
|
| | | <div slot="footer" class="dialog-footer">
|
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button>
|
| | | <el-button @click="cancel">å æ¶</el-button>
|
| | | </div>
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
|
| | | import { treeselect } from "@/api/system/dept";
|
| | | import { listPost } from "@/api/system/post";
|
| | | import { listRole } from "@/api/system/role";
|
| | | import Treeselect from "@riophae/vue-treeselect";
|
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
| | |
|
| | | export default {
|
| | | components: { Treeselect },
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // ç¨æ·è¡¨æ ¼æ°æ®
|
| | | userList: null,
|
| | | // å¼¹åºå±æ é¢
|
| | | title: "",
|
| | | // é¨é¨æ é项
|
| | | deptOptions: undefined,
|
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±
|
| | | open: false,
|
| | | // é¨é¨åç§°
|
| | | deptName: undefined,
|
| | | // é»è®¤å¯ç
|
| | | initPassword: undefined,
|
| | | // æ¥æèå´
|
| | | dateRange: [],
|
| | | // ç¶ææ°æ®åå
¸
|
| | | statusOptions: [],
|
| | | // æ§å«ç¶æåå
¸
|
| | | sexOptions: [],
|
| | | // å²ä½é项
|
| | | postOptions: [],
|
| | | // è§è²é项
|
| | | roleOptions: [],
|
| | | // 表ååæ°
|
| | | form: {},
|
| | | defaultProps: {
|
| | | children: "children",
|
| | | label: "label"
|
| | | },
|
| | | // æ¥è¯¢åæ°
|
| | | queryParams: {
|
| | | pageNum: 1,
|
| | | pageSize: 10,
|
| | | userName: undefined,
|
| | | phonenumber: undefined,
|
| | | status: undefined,
|
| | | deptId: undefined
|
| | | },
|
| | | // è¡¨åæ ¡éª
|
| | | rules: {
|
| | | userName: [
|
| | | { required: true, message: "ç¨æ·åç§°ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | nickName: [
|
| | | { required: true, message: "ç¨æ·æµç§°ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | deptId: [
|
| | | { required: true, message: "å½å±é¨é¨ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | password: [
|
| | | { required: true, message: "ç¨æ·å¯ç ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | email: [
|
| | | {
|
| | | type: "email",
|
| | | message: "'请è¾å
¥æ£ç¡®çé®ç®±å°å",
|
| | | trigger: ["blur", "change"]
|
| | | }
|
| | | ],
|
| | | phonenumber: [
|
| | | {
|
| | | pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
| | | message: "请è¾å
¥æ£ç¡®çææºå·ç ",
|
| | | trigger: "blur"
|
| | | }
|
| | | ]
|
| | | }
|
| | | };
|
| | | },
|
| | | watch: {
|
| | | // æ ¹æ®åç§°çéé¨é¨æ
|
| | | deptName(val) {
|
| | | this.$refs.tree.filter(val);
|
| | | }
|
| | | },
|
| | | created() {
|
| | | this.getList();
|
| | | this.getTreeselect();
|
| | | this.getDicts("sys_normal_disable").then(response => {
|
| | | this.statusOptions = response.data;
|
| | | });
|
| | | this.getDicts("sys_user_sex").then(response => {
|
| | | this.sexOptions = response.data;
|
| | | });
|
| | | this.getConfigKey("sys.user.initPassword").then(response => {
|
| | | this.initPassword = response.data;
|
| | | });
|
| | | },
|
| | | methods: {
|
| | | /** æ¥è¯¢ç¨æ·å表 */
|
| | | getList() {
|
| | | this.loading = true;
|
| | | listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
| | | this.userList = response.rows;
|
| | | this.total = response.total;
|
| | | this.loading = false;
|
| | | }
|
| | | );
|
| | | },
|
| | | /** æ¥è¯¢é¨é¨ä¸ææ ç»æ */
|
| | | getTreeselect() {
|
| | | treeselect().then(response => {
|
| | | this.deptOptions = response.data;
|
| | | });
|
| | | },
|
| | | // çéèç¹
|
| | | filterNode(value, data) {
|
| | | if (!value) return true;
|
| | | return data.label.indexOf(value) !== -1;
|
| | | },
|
| | | // èç¹åå»äºä»¶
|
| | | handleNodeClick(data) {
|
| | | this.queryParams.deptId = data.id;
|
| | | this.getList();
|
| | | },
|
| | | /** æ¥è¯¢å²ä½å表 */
|
| | | getPosts() {
|
| | | listPost().then(response => {
|
| | | this.postOptions = response.rows;
|
| | | });
|
| | | },
|
| | | /** æ¥è¯¢è§è²å表 */
|
| | | getRoles() {
|
| | | listRole().then(response => {
|
| | | this.roleOptions = response.rows;
|
| | | });
|
| | | },
|
| | | // ç¨æ·ç¶æä¿®æ¹
|
| | | handleStatusChange(row) {
|
| | | let text = row.status === "0" ? "å¯ç¨" : "åç¨";
|
| | | this.$confirm('确认è¦"' + text + '""' + row.userName + '"ç¨æ·å?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return changeUserStatus(row.userId, row.status);
|
| | | }).then(() => {
|
| | | this.msgSuccess(text + "æå");
|
| | | }).catch(function() {
|
| | | row.status = row.status === "0" ? "1" : "0";
|
| | | });
|
| | | },
|
| | | // åæ¶æé®
|
| | | cancel() {
|
| | | this.open = false;
|
| | | this.reset();
|
| | | },
|
| | | // 表åéç½®
|
| | | reset() {
|
| | | this.form = {
|
| | | userId: undefined,
|
| | | deptId: 100,
|
| | | userName: undefined,
|
| | | nickName: undefined,
|
| | | phonenumber: undefined,
|
| | | email: undefined,
|
| | | sex: undefined,
|
| | | status: "0",
|
| | | remark: undefined,
|
| | | postIds: [],
|
| | | roleIds: []
|
| | | };
|
| | | this.resetForm("form");
|
| | | },
|
| | | /** æç´¢æé®æä½ */
|
| | | handleQuery() {
|
| | | this.queryParams.page = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** æ°å¢æé®æä½ */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | | this.getTreeselect();
|
| | | this.getPosts();
|
| | | this.getRoles();
|
| | | this.open = true;
|
| | | this.title = "æ·»å ç¨æ·";
|
| | | this.form.password = this.initPassword;
|
| | | },
|
| | | /** ä¿®æ¹æé®æä½ */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | this.getTreeselect();
|
| | | this.getPosts();
|
| | | this.getRoles();
|
| | | getUser(row.userId).then(response => {
|
| | | this.form = response.data;
|
| | | this.form.postIds = response.postIds;
|
| | | this.form.roleIds = response.roleIds;
|
| | | this.open = true;
|
| | | this.title = "ä¿®æ¹ç¨æ·";
|
| | | this.form.password = "";
|
| | | });
|
| | | },
|
| | | /** éç½®å¯ç æé®æä½ */
|
| | | handleResetPwd(row) {
|
| | | this.$prompt('请è¾å
¥"' + row.userName + '"çæ°å¯ç ', "æç¤º", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶"
|
| | | }).then(({ value }) => {
|
| | | resetUserPwd(row.userId, value).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("ä¿®æ¹æåï¼æ°å¯ç æ¯ï¼" + value);
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | }).catch(() => {});
|
| | | },
|
| | | /** æäº¤æé® */
|
| | | submitForm: function() {
|
| | | this.$refs["form"].validate(valid => {
|
| | | if (valid) {
|
| | | if (this.form.userId != undefined) {
|
| | | updateUser(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("ä¿®æ¹æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | } else {
|
| | | addUser(this.form).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("æ°å¢æå");
|
| | | this.open = false;
|
| | | this.getList();
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | });
|
| | | },
|
| | | /** å é¤æé®æä½ */
|
| | | handleDelete(row) {
|
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤å称为"' + row.userName + '"çæ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return delUser(row.userId);
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("å 餿å");
|
| | | }).catch(function() {});
|
| | | }
|
| | | }
|
| | | };
|
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-row :gutter="20">
|
| | | <el-col :span="6" :xs="24">
|
| | | <el-card class="box-card">
|
| | | <div slot="header" class="clearfix">
|
| | | <span>个人信æ¯</span>
|
| | | </div>
|
| | | <div>
|
| | | <div class="text-center">
|
| | | <userAvatar :user="user" />
|
| | | </div>
|
| | | <ul class="list-group list-group-striped">
|
| | | <li class="list-group-item">
|
| | | <svg-icon icon-class="user" />ç¨æ·åç§°
|
| | | <div class="pull-right">{{ user.userName }}</div>
|
| | | </li>
|
| | | <li class="list-group-item">
|
| | | <svg-icon icon-class="phone" />ææºå·ç
|
| | | <div class="pull-right">{{ user.phonenumber }}</div>
|
| | | </li>
|
| | | <li class="list-group-item">
|
| | | <svg-icon icon-class="email" />ç¨æ·é®ç®±
|
| | | <div class="pull-right">{{ user.email }}</div>
|
| | | </li>
|
| | | <li class="list-group-item">
|
| | | <svg-icon icon-class="tree" />æå±é¨é¨
|
| | | <div class="pull-right" v-if="user.dept">{{ user.dept.deptName }} / {{ postGroup }}</div>
|
| | | </li>
|
| | | <li class="list-group-item">
|
| | | <svg-icon icon-class="peoples" />æå±è§è²
|
| | | <div class="pull-right">{{ roleGroup }}</div>
|
| | | </li>
|
| | | <li class="list-group-item">
|
| | | <svg-icon icon-class="date" />åå»ºæ¥æ
|
| | | <div class="pull-right">2018-08-23 09:11:56</div>
|
| | | </li>
|
| | | </ul>
|
| | | </div>
|
| | | </el-card>
|
| | | </el-col>
|
| | | <el-col :span="18" :xs="24">
|
| | | <el-card>
|
| | | <div slot="header" class="clearfix">
|
| | | <span>åºæ¬èµæ</span>
|
| | | </div>
|
| | | <el-tabs v-model="activeTab">
|
| | | <el-tab-pane label="åºæ¬èµæ" name="userinfo">
|
| | | <userInfo :user="user" />
|
| | | </el-tab-pane>
|
| | | <el-tab-pane label="ä¿®æ¹å¯ç " name="resetPwd">
|
| | | <resetPwd :user="user" />
|
| | | </el-tab-pane>
|
| | | </el-tabs>
|
| | | </el-card>
|
| | | </el-col>
|
| | | </el-row>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import userAvatar from "./userAvatar";
|
| | | import userInfo from "./userInfo";
|
| | | import resetPwd from "./resetPwd";
|
| | | import { getUserProfile } from "@/api/system/user";
|
| | |
|
| | | export default {
|
| | | name: "Profile",
|
| | | components: { userAvatar, userInfo, resetPwd },
|
| | | data() {
|
| | | return {
|
| | | user: {},
|
| | | roleGroup: {},
|
| | | postGroup: {},
|
| | | activeTab: "userinfo"
|
| | | };
|
| | | },
|
| | | created() {
|
| | | this.getUser();
|
| | | },
|
| | | methods: {
|
| | | getUser() {
|
| | | getUserProfile().then(response => {
|
| | | this.user = response.data;
|
| | | this.roleGroup = response.roleGroup;
|
| | | this.postGroup = response.postGroup;
|
| | | });
|
| | | }
|
| | | }
|
| | | };
|
| | | </script>
|
| | |
|
| | | <style rel="stylesheet/scss" lang="scss">
|
| | | .avatar-uploader-icon {
|
| | | font-size: 28px;
|
| | | width: 120px;
|
| | | height: 120px;
|
| | | line-height: 120px;
|
| | | text-align: center;
|
| | | }
|
| | | </style>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <el-form ref="form" :model="user" :rules="rules" label-width="80px">
|
| | | <el-form-item label="æ§å¯ç " prop="oldPassword">
|
| | | <el-input v-model="user.oldPassword" placeholder="请è¾å
¥æ§å¯ç " type="password" />
|
| | | </el-form-item>
|
| | | <el-form-item label="æ°å¯ç " prop="newPassword">
|
| | | <el-input v-model="user.newPassword" placeholder="请è¾å
¥æ°å¯ç " type="password" />
|
| | | </el-form-item>
|
| | | <el-form-item label="确认å¯ç " prop="confirmPassword">
|
| | | <el-input v-model="user.confirmPassword" placeholder="请确认å¯ç " type="password" />
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" size="mini" @click="submit">ä¿å</el-button>
|
| | | <el-button type="danger" size="mini" @click="close">å
³é</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { updateUserPwd } from "@/api/system/user";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | const equalToPassword = (rule, value, callback) => {
|
| | | if (this.user.newPassword !== value) {
|
| | | callback(new Error("两次è¾å
¥çå¯ç ä¸ä¸è´"));
|
| | | } else {
|
| | | callback();
|
| | | }
|
| | | };
|
| | | return {
|
| | | test: "1test",
|
| | | user: {
|
| | | oldPassword: undefined,
|
| | | newPassword: undefined,
|
| | | confirmPassword: undefined
|
| | | },
|
| | | // è¡¨åæ ¡éª
|
| | | rules: {
|
| | | oldPassword: [
|
| | | { required: true, message: "æ§å¯ç ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | newPassword: [
|
| | | { required: true, message: "æ°å¯ç ä¸è½ä¸ºç©º", trigger: "blur" },
|
| | | { min: 6, max: 20, message: "é¿åº¦å¨ 6 å° 20 个å符", trigger: "blur" }
|
| | | ],
|
| | | confirmPassword: [
|
| | | { required: true, message: "确认å¯ç ä¸è½ä¸ºç©º", trigger: "blur" },
|
| | | { required: true, validator: equalToPassword, trigger: "blur" }
|
| | | ]
|
| | | }
|
| | | };
|
| | | },
|
| | | methods: {
|
| | | submit() {
|
| | | this.$refs["form"].validate(valid => {
|
| | | if (valid) {
|
| | | updateUserPwd(this.user.oldPassword, this.user.newPassword).then(
|
| | | response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("ä¿®æ¹æå");
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | }
|
| | | );
|
| | | }
|
| | | });
|
| | | },
|
| | | close() {
|
| | | this.$store.dispatch("tagsView/delView", this.$route);
|
| | | this.$router.push({ path: "/index" });
|
| | | }
|
| | | }
|
| | | };
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div>
|
| | | <img v-bind:src="options.img" @click="editCropper()" title="ç¹å»ä¸ä¼ 头å" class="img-circle img-lg" />
|
| | | <el-dialog :title="title" :visible.sync="open" width="800px">
|
| | | <el-row>
|
| | | <el-col :xs="24" :md="12" :style="{height: '350px'}">
|
| | | <vue-cropper
|
| | | ref="cropper"
|
| | | :img="options.img"
|
| | | :info="true"
|
| | | :autoCrop="options.autoCrop"
|
| | | :autoCropWidth="options.autoCropWidth"
|
| | | :autoCropHeight="options.autoCropHeight"
|
| | | :fixedBox="options.fixedBox"
|
| | | @realTime="realTime"
|
| | | />
|
| | | </el-col>
|
| | | <el-col :xs="24" :md="12" :style="{height: '350px'}">
|
| | | <div class="avatar-upload-preview">
|
| | | <img :src="previews.url" :style="previews.img" />
|
| | | </div>
|
| | | </el-col>
|
| | | </el-row>
|
| | | <br />
|
| | | <el-row>
|
| | | <el-col :lg="2" :md="2">
|
| | | <el-upload :show-file-list="false" :before-upload="beforeUpload">
|
| | | <el-button size="small">
|
| | | ä¸ä¼
|
| | | <i class="el-icon-upload el-icon--right"></i>
|
| | | </el-button>
|
| | | </el-upload>
|
| | | </el-col>
|
| | | <el-col :lg="{span: 1, offset: 2}" :md="2">
|
| | | <el-button icon="el-icon-plus" size="small" @click="changeScale(1)"></el-button>
|
| | | </el-col>
|
| | | <el-col :lg="{span: 1, offset: 1}" :md="2">
|
| | | <el-button icon="el-icon-minus" size="small" @click="changeScale(-1)"></el-button>
|
| | | </el-col>
|
| | | <el-col :lg="{span: 1, offset: 1}" :md="2">
|
| | | <el-button icon="el-icon-refresh-left" size="small" @click="rotateLeft()"></el-button>
|
| | | </el-col>
|
| | | <el-col :lg="{span: 1, offset: 1}" :md="2">
|
| | | <el-button icon="el-icon-refresh-right" size="small" @click="rotateRight()"></el-button>
|
| | | </el-col>
|
| | | <el-col :lg="{span: 2, offset: 6}" :md="2">
|
| | | <el-button type="primary" size="small" @click="uploadImg()">ä¸ ä¼ </el-button>
|
| | | </el-col>
|
| | | </el-row>
|
| | | </el-dialog>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import store from "@/store";
|
| | | import { VueCropper } from "vue-cropper";
|
| | | import { uploadAvatar } from "@/api/system/user";
|
| | |
|
| | | export default {
|
| | | components: { VueCropper },
|
| | | props: {
|
| | | user: {
|
| | | type: Object
|
| | | }
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±
|
| | | open: false,
|
| | | // å¼¹åºå±æ é¢
|
| | | title: "ä¿®æ¹å¤´å",
|
| | | options: {
|
| | | img: store.getters.avatar, //è£åªå¾ççå°å
|
| | | autoCrop: true, // æ¯å¦é»è®¤çææªå¾æ¡
|
| | | autoCropWidth: 200, // é»è®¤çææªå¾æ¡å®½åº¦
|
| | | autoCropHeight: 200, // é»è®¤çææªå¾æ¡é«åº¦
|
| | | fixedBox: true // åºå®æªå¾æ¡å¤§å° ä¸å
许æ¹å
|
| | | },
|
| | | previews: {}
|
| | | };
|
| | | },
|
| | | methods: {
|
| | | // ç¼è¾å¤´å
|
| | | editCropper() {
|
| | | this.open = true;
|
| | | },
|
| | | // åå·¦æè½¬
|
| | | rotateLeft() {
|
| | | this.$refs.cropper.rotateLeft();
|
| | | },
|
| | | // åå³æè½¬
|
| | | rotateRight() {
|
| | | this.$refs.cropper.rotateRight();
|
| | | },
|
| | | // å¾ç缩æ¾
|
| | | changeScale(num) {
|
| | | num = num || 1;
|
| | | this.$refs.cropper.changeScale(num);
|
| | | },
|
| | | // ä¸ä¼ é¢å¤ç
|
| | | beforeUpload(file) {
|
| | | if (file.type.indexOf("image/") == -1) {
|
| | | this.msgError("æä»¶æ ¼å¼é误ï¼è¯·ä¸ä¼ å¾çç±»å,å¦ï¼JPGï¼PNGåç¼çæä»¶ã");
|
| | | } else {
|
| | | const reader = new FileReader();
|
| | | reader.readAsDataURL(file);
|
| | | reader.onload = () => {
|
| | | this.options.img = reader.result;
|
| | | };
|
| | | }
|
| | | },
|
| | | // ä¸ä¼ å¾ç
|
| | | uploadImg() {
|
| | | this.$refs.cropper.getCropBlob(data => {
|
| | | let formData = new FormData();
|
| | | formData.append("avatarfile", data);
|
| | | uploadAvatar(formData).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.open = false;
|
| | | this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
|
| | | this.msgSuccess("ä¿®æ¹æå");
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | this.$refs.cropper.clearCrop();
|
| | | });
|
| | | });
|
| | | },
|
| | | // 宿¶é¢è§
|
| | | realTime(data) {
|
| | | this.previews = data;
|
| | | }
|
| | | }
|
| | | };
|
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <el-form ref="form" :model="user" :rules="rules" label-width="80px">
|
| | | <el-form-item label="ç¨æ·æµç§°" prop="nickName">
|
| | | <el-input v-model="user.nickName" />
|
| | | </el-form-item> |
| | | <el-form-item label="ææºå·ç " prop="phonenumber">
|
| | | <el-input v-model="user.phonenumber" maxlength="11" />
|
| | | </el-form-item>
|
| | | <el-form-item label="é®ç®±" prop="email">
|
| | | <el-input v-model="user.email" maxlength="50" />
|
| | | </el-form-item>
|
| | | <el-form-item label="æ§å«">
|
| | | <el-radio-group v-model="user.sex">
|
| | | <el-radio label="0">ç·</el-radio>
|
| | | <el-radio label="1">女</el-radio>
|
| | | </el-radio-group>
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" size="mini" @click="submit">ä¿å</el-button>
|
| | | <el-button type="danger" size="mini" @click="close">å
³é</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { updateUserProfile } from "@/api/system/user";
|
| | |
|
| | | export default {
|
| | | props: {
|
| | | user: {
|
| | | type: Object
|
| | | }
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | // è¡¨åæ ¡éª
|
| | | rules: {
|
| | | nickName: [
|
| | | { required: true, message: "ç¨æ·æµç§°ä¸è½ä¸ºç©º", trigger: "blur" }
|
| | | ],
|
| | | email: [
|
| | | { required: true, message: "é®ç®±å°åä¸è½ä¸ºç©º", trigger: "blur" },
|
| | | {
|
| | | type: "email",
|
| | | message: "'请è¾å
¥æ£ç¡®çé®ç®±å°å",
|
| | | trigger: ["blur", "change"]
|
| | | }
|
| | | ],
|
| | | phonenumber: [
|
| | | { required: true, message: "ææºå·ç ä¸è½ä¸ºç©º", trigger: "blur" },
|
| | | {
|
| | | pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
| | | message: "请è¾å
¥æ£ç¡®çææºå·ç ",
|
| | | trigger: "blur"
|
| | | }
|
| | | ]
|
| | | }
|
| | | };
|
| | | },
|
| | | methods: {
|
| | | submit() {
|
| | | this.$refs["form"].validate(valid => {
|
| | | if (valid) {
|
| | | updateUserProfile(this.user).then(response => {
|
| | | if (response.code === 200) {
|
| | | this.msgSuccess("ä¿®æ¹æå");
|
| | | } else {
|
| | | this.msgError(response.msg);
|
| | | }
|
| | | });
|
| | | }
|
| | | });
|
| | | },
|
| | | close() {
|
| | | this.$store.dispatch("tagsView/delView", this.$route);
|
| | | this.$router.push({ path: "/index" });
|
| | | }
|
| | | }
|
| | | };
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | æå»ºå·¥å
·
|
| | | </div>
|
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | 代ç çæ
|
| | | </div>
|
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div v-loading="loading" :style="'height:'+ height">
|
| | | <iframe :src="src" frameborder="no" style="width: 100%;height: 100%" scrolling="auto" />
|
| | | </div>
|
| | | </template>
|
| | | <script>
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | src: process.env.VUE_APP_BASE_API + "/swagger-ui.html",
|
| | | height: document.documentElement.clientHeight - 94.5 + "px;",
|
| | | loading: true
|
| | | };
|
| | | },
|
| | | mounted: function() {
|
| | | setTimeout(() => {
|
| | | this.loading = false;
|
| | | }, 230);
|
| | | const that = this;
|
| | | window.onresize = function temp() {
|
| | | that.height = document.documentElement.clientHeight - 94.5 + "px;";
|
| | | };
|
| | | }
|
| | | };
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | 'use strict'
|
| | | const path = require('path')
|
| | | const defaultSettings = require('./src/settings.js')
|
| | |
|
| | | function resolve(dir) {
|
| | | return path.join(__dirname, dir)
|
| | | }
|
| | |
|
| | | const name = defaultSettings.title || 'è¥ä¾ç®¡çç³»ç»' // æ é¢
|
| | |
|
| | | const port = process.env.port || process.env.npm_config_port || 80 // 端å£
|
| | |
|
| | | // vue.config.js é
置说æ
|
| | | //宿¹vue.config.js åèææ¡£ https://cli.vuejs.org/zh/config/#css-loaderoptions
|
| | | // è¿éåªåä¸é¨åï¼å
·ä½é
ç½®åèææ¡£
|
| | | module.exports = {
|
| | | // é¨ç½²ç产ç¯å¢åå¼åç¯å¢ä¸çURLã
|
| | | // é»è®¤æ
åµä¸ï¼Vue CLI ä¼åè®¾ä½ çåºç¨æ¯è¢«é¨ç½²å¨ä¸ä¸ªååçæ ¹è·¯å¾ä¸
|
| | | // ä¾å¦ https://www.ruoyi.vip/ã妿åºç¨è¢«é¨ç½²å¨ä¸ä¸ªåè·¯å¾ä¸ï¼ä½ å°±éè¦ç¨è¿ä¸ªé项æå®è¿ä¸ªåè·¯å¾ãä¾å¦ï¼å¦æä½ çåºç¨è¢«é¨ç½²å¨ https://www.ruoyi.vip/admin/ï¼å设置 baseUrl 为 /admin/ã
|
| | | publicPath: process.env.NODE_ENV === "production" ? "./" : "/",
|
| | | // å¨npm run build æ yarn build æ¶ ï¼çææä»¶çç®å½åç§°ï¼è¦åbaseUrlçç产ç¯å¢è·¯å¾ä¸è´ï¼ï¼é»è®¤distï¼
|
| | | outputDir: 'dist',
|
| | | // ç¨äºæ¾ç½®çæçéæèµæº (jsãcssãimgãfonts) çï¼ï¼é¡¹ç®æå
ä¹åï¼éæèµæºä¼æ¾å¨è¿ä¸ªæä»¶å¤¹ä¸ï¼
|
| | | assetsDir: 'static',
|
| | | // æ¯å¦å¼å¯eslintä¿åæ£æµï¼ææå¼ï¼ture | false | 'error'
|
| | | lintOnSave: process.env.NODE_ENV === 'development',
|
| | | // å¦æä½ ä¸éè¦ç产ç¯å¢ç source mapï¼å¯ä»¥å°å
¶è®¾ç½®ä¸º false 以å éç产ç¯å¢æå»ºã
|
| | | productionSourceMap: false,
|
| | | // webpack-dev-server ç¸å
³é
ç½®
|
| | | devServer: {
|
| | | host: '0.0.0.0',
|
| | | port: port,
|
| | | proxy: {
|
| | | // detail: https://cli.vuejs.org/config/#devserver-proxy
|
| | | [process.env.VUE_APP_BASE_API]: {
|
| | | target: `http://localhost:8080`,
|
| | | changeOrigin: true,
|
| | | pathRewrite: {
|
| | | ['^' + process.env.VUE_APP_BASE_API]: ''
|
| | | }
|
| | | }
|
| | | },
|
| | | disableHostCheck: true
|
| | | },
|
| | | configureWebpack: {
|
| | | name: name,
|
| | | resolve: {
|
| | | alias: {
|
| | | '@': resolve('src')
|
| | | }
|
| | | }
|
| | | },
|
| | | chainWebpack(config) {
|
| | | config.plugins.delete('preload') // TODO: need test
|
| | | config.plugins.delete('prefetch') // TODO: need test
|
| | |
|
| | | // set svg-sprite-loader
|
| | | config.module
|
| | | .rule('svg')
|
| | | .exclude.add(resolve('src/assets/icons'))
|
| | | .end()
|
| | | config.module
|
| | | .rule('icons')
|
| | | .test(/\.svg$/)
|
| | | .include.add(resolve('src/assets/icons'))
|
| | | .end()
|
| | | .use('svg-sprite-loader')
|
| | | .loader('svg-sprite-loader')
|
| | | .options({
|
| | | symbolId: 'icon-[name]'
|
| | | })
|
| | | .end()
|
| | |
|
| | | // set preserveWhitespace
|
| | | config.module
|
| | | .rule('vue')
|
| | | .use('vue-loader')
|
| | | .loader('vue-loader')
|
| | | .tap(options => {
|
| | | options.compilerOptions.preserveWhitespace = true
|
| | | return options
|
| | | })
|
| | | .end()
|
| | |
|
| | | config
|
| | | // https://webpack.js.org/configuration/devtool/#development
|
| | | .when(process.env.NODE_ENV === 'development',
|
| | | config => config.devtool('cheap-source-map')
|
| | | )
|
| | |
|
| | | config
|
| | | .when(process.env.NODE_ENV !== 'development',
|
| | | config => {
|
| | | config
|
| | | .plugin('ScriptExtHtmlWebpackPlugin')
|
| | | .after('html')
|
| | | .use('script-ext-html-webpack-plugin', [{
|
| | | // `runtime` must same as runtimeChunk name. default is `runtime`
|
| | | inline: /runtime\..*\.js$/
|
| | | }])
|
| | | .end()
|
| | | config
|
| | | .optimization.splitChunks({
|
| | | chunks: 'all',
|
| | | cacheGroups: {
|
| | | libs: {
|
| | | name: 'chunk-libs',
|
| | | test: /[\\/]node_modules[\\/]/,
|
| | | priority: 10,
|
| | | chunks: 'initial' // only package third parties that are initially dependent
|
| | | },
|
| | | elementUI: {
|
| | | name: 'chunk-elementUI', // split elementUI into a single package
|
| | | priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
| | | test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
|
| | | },
|
| | | commons: {
|
| | | name: 'chunk-commons',
|
| | | test: resolve('src/components'), // can customize your rules
|
| | | minChunks: 3, // minimum common number
|
| | | priority: 5,
|
| | | reuseExistingChunk: true
|
| | | }
|
| | | }
|
| | | })
|
| | | config.optimization.runtimeChunk('single')
|
| | | }
|
| | | )
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | ######################################################################
|
| | | # Build Tools
|
| | |
|
| | | .gradle
|
| | | /build/
|
| | | !gradle/wrapper/gradle-wrapper.jar
|
| | |
|
| | | target/
|
| | | !.mvn/wrapper/maven-wrapper.jar
|
| | |
|
| | | ######################################################################
|
| | | # IDE
|
| | |
|
| | | ### STS ###
|
| | | .apt_generated
|
| | | .classpath
|
| | | .factorypath
|
| | | .project
|
| | | .settings
|
| | | .springBeans
|
| | |
|
| | | ### IntelliJ IDEA ###
|
| | | .idea
|
| | | *.iws
|
| | | *.iml
|
| | | *.ipr
|
| | |
|
| | | ### NetBeans ###
|
| | | nbproject/private/
|
| | | build/*
|
| | | nbbuild/
|
| | | dist/
|
| | | nbdist/
|
| | | .nb-gradle/
|
| | |
|
| | | ######################################################################
|
| | | # Others
|
| | | *.log
|
| | | *.xml.versionsBackup
|
| | |
|
| | | !*/build/*.java
|
| | | !*/build/*.html
|
| | | !*/build/*.xml |
¶Ô±ÈÐÂÎļþ |
| | |
| | | @echo off
|
| | | echo.
|
| | | echo [ä¿¡æ¯] æ¸
ççæè·¯å¾ã
|
| | | echo.
|
| | |
|
| | | %~d0
|
| | | cd %~dp0
|
| | |
|
| | | cd ..
|
| | | call mvn clean
|
| | |
|
| | | pause |
¶Ô±ÈÐÂÎļþ |
| | |
| | | @echo off
|
| | | echo.
|
| | | echo [ä¿¡æ¯] æå
Webå·¥ç¨ï¼çæwar/jarå
æä»¶ã
|
| | | echo.
|
| | |
|
| | | %~d0
|
| | | cd %~dp0
|
| | |
|
| | | cd ..
|
| | | call mvn clean package -Dmaven.test.skip=true
|
| | |
|
| | | pause |
¶Ô±ÈÐÂÎļþ |
| | |
| | | @echo off
|
| | | echo.
|
| | | echo [ä¿¡æ¯] ä½¿ç¨ Spring Boot Tomcat è¿è¡ Web å·¥ç¨ã
|
| | | echo.
|
| | |
|
| | | %~d0
|
| | | cd %~dp0
|
| | |
|
| | | cd ..
|
| | | title %cd%
|
| | | set MAVEN_OPTS=%MAVEN_OPTS% -Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
|
| | | call mvn clean spring-boot:run -Dmaven.test.skip=true -U
|
| | |
|
| | | pause |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
| | | <modelVersion>4.0.0</modelVersion>
|
| | |
|
| | | <groupId>com.ruoyi</groupId>
|
| | | <artifactId>ruoyi</artifactId>
|
| | | <version>1.0</version>
|
| | | <packaging>jar</packaging>
|
| | |
|
| | | <name>ruoyi</name>
|
| | | <url>http://www.ruoyi.vip</url>
|
| | | <description>è¥ä¾ç®¡çç³»ç»</description>
|
| | |
|
| | | <parent>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-starter-parent</artifactId>
|
| | | <version>2.1.1.RELEASE</version>
|
| | | <relativePath />
|
| | | </parent>
|
| | |
|
| | | <properties>
|
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
| | | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
| | | <java.version>1.8</java.version>
|
| | | <mybatis.spring.boot.starter.version>1.3.2</mybatis.spring.boot.starter.version>
|
| | | <pagehelper.spring.boot.starter.version>1.2.5</pagehelper.spring.boot.starter.version>
|
| | | <fastjson.version>1.2.47</fastjson.version>
|
| | | <druid.version>1.1.14</druid.version>
|
| | | <commons.io.version>2.5</commons.io.version>
|
| | | <commons.fileupload.version>1.3.3</commons.fileupload.version>
|
| | | <bitwalker.version>1.19</bitwalker.version>
|
| | | <jwt.version>0.9.0</jwt.version>
|
| | | <swagger.version>2.9.2</swagger.version>
|
| | | <oshi.version>3.9.1</oshi.version>
|
| | | </properties>
|
| | |
|
| | | <dependencies>
|
| | |
|
| | | <!-- SpringBoot æ ¸å¿å
-->
|
| | | <dependency>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-starter</artifactId>
|
| | | <!--
|
| | | <exclusions>
|
| | | <exclusion>
|
| | | <artifactId>spring-boot-starter-tomcat</artifactId>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | </exclusion>
|
| | | </exclusions>
|
| | | -->
|
| | | </dependency>
|
| | |
|
| | | <!-- SpringBoot æµè¯ -->
|
| | | <dependency>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-starter-test</artifactId>
|
| | | <scope>test</scope>
|
| | | </dependency>
|
| | |
|
| | | <!-- SpringBoot æ¦æªå¨ -->
|
| | | <dependency>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-starter-aop</artifactId>
|
| | | </dependency>
|
| | |
|
| | | <!-- SpringBoot Webå®¹å¨ -->
|
| | | <dependency>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-starter-web</artifactId>
|
| | | </dependency>
|
| | | |
| | | <!-- spring-boot-devtools -->
|
| | | <dependency>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-devtools</artifactId>
|
| | | <optional>true</optional> <!-- 表示ä¾èµä¸ä¼ä¼ é -->
|
| | | </dependency>
|
| | | |
| | | <!-- spring security å®å
¨è®¤è¯ -->
|
| | | <dependency>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-starter-security</artifactId>
|
| | | </dependency>
|
| | | |
| | | <!-- redis ç¼åæä½ -->
|
| | | <dependency>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-starter-data-redis</artifactId>
|
| | | </dependency>
|
| | | |
| | | <!-- pool å¯¹è±¡æ± -->
|
| | | <dependency>
|
| | | <groupId>org.apache.commons</groupId>
|
| | | <artifactId>commons-pool2</artifactId>
|
| | | </dependency>
|
| | |
|
| | | <!-- Mysql驱å¨å
-->
|
| | | <dependency>
|
| | | <groupId>mysql</groupId>
|
| | | <artifactId>mysql-connector-java</artifactId>
|
| | | <scope>runtime</scope>
|
| | | </dependency>
|
| | |
|
| | | <!-- SpringBootéæmybatisæ¡æ¶ -->
|
| | | <dependency>
|
| | | <groupId>org.mybatis.spring.boot</groupId>
|
| | | <artifactId>mybatis-spring-boot-starter</artifactId>
|
| | | <version>${mybatis.spring.boot.starter.version}</version>
|
| | | </dependency>
|
| | | |
| | | <!-- pagehelper å页æä»¶ -->
|
| | | <dependency>
|
| | | <groupId>com.github.pagehelper</groupId>
|
| | | <artifactId>pagehelper-spring-boot-starter</artifactId>
|
| | | <version>${pagehelper.spring.boot.starter.version}</version>
|
| | | </dependency>
|
| | |
|
| | | <!--é¿éæ°æ®åºè¿æ¥æ± -->
|
| | | <dependency>
|
| | | <groupId>com.alibaba</groupId>
|
| | | <artifactId>druid-spring-boot-starter</artifactId>
|
| | | <version>${druid.version}</version>
|
| | | </dependency>
|
| | |
|
| | | <!--常ç¨å·¥å
·ç±» -->
|
| | | <dependency>
|
| | | <groupId>org.apache.commons</groupId>
|
| | | <artifactId>commons-lang3</artifactId>
|
| | | </dependency>
|
| | |
|
| | | <!--io常ç¨å·¥å
·ç±» -->
|
| | | <dependency>
|
| | | <groupId>commons-io</groupId>
|
| | | <artifactId>commons-io</artifactId>
|
| | | <version>${commons.io.version}</version>
|
| | | </dependency>
|
| | | |
| | | <!--æä»¶ä¸ä¼ å·¥å
·ç±» -->
|
| | | <dependency>
|
| | | <groupId>commons-fileupload</groupId>
|
| | | <artifactId>commons-fileupload</artifactId>
|
| | | <version>${commons.fileupload.version}</version>
|
| | | </dependency>
|
| | | |
| | | <!-- è§£æå®¢æ·ç«¯æä½ç³»ç»ãæµè§å¨ç -->
|
| | | <dependency>
|
| | | <groupId>eu.bitwalker</groupId>
|
| | | <artifactId>UserAgentUtils</artifactId>
|
| | | <version>${bitwalker.version}</version>
|
| | | </dependency>
|
| | |
|
| | | <!-- é¿éJSONè§£æå¨ -->
|
| | | <dependency>
|
| | | <groupId>com.alibaba</groupId>
|
| | | <artifactId>fastjson</artifactId>
|
| | | <version>${fastjson.version}</version>
|
| | | </dependency>
|
| | |
|
| | | <!--Springæ¡æ¶åºæ¬çæ ¸å¿å·¥å
·-->
|
| | | <dependency>
|
| | | <groupId>org.springframework</groupId>
|
| | | <artifactId>spring-context-support</artifactId>
|
| | | </dependency>
|
| | | |
| | | <!--Tokençæä¸è§£æ-->
|
| | | <dependency>
|
| | | <groupId>io.jsonwebtoken</groupId>
|
| | | <artifactId>jjwt</artifactId>
|
| | | <version>${jwt.version}</version>
|
| | | </dependency>
|
| | | |
| | | <!-- swagger2-->
|
| | | <dependency>
|
| | | <groupId>io.springfox</groupId>
|
| | | <artifactId>springfox-swagger2</artifactId>
|
| | | <version>${swagger.version}</version>
|
| | | <exclusions>
|
| | | <exclusion>
|
| | | <groupId>io.swagger</groupId>
|
| | | <artifactId>swagger-annotations</artifactId>
|
| | | </exclusion>
|
| | | <exclusion>
|
| | | <groupId>io.swagger</groupId>
|
| | | <artifactId>swagger-models</artifactId>
|
| | | </exclusion>
|
| | | </exclusions>
|
| | | </dependency>
|
| | | |
| | | <!--鲿¢è¿å
¥swagger页颿¥ç±»å转æ¢éè¯¯ï¼æé¤2.9.2ä¸çå¼ç¨ï¼æå¨å¢å 1.5.21çæ¬-->
|
| | | <dependency>
|
| | | <groupId>io.swagger</groupId>
|
| | | <artifactId>swagger-annotations</artifactId>
|
| | | <version>1.5.21</version>
|
| | | </dependency>
|
| | | |
| | | <dependency>
|
| | | <groupId>io.swagger</groupId>
|
| | | <artifactId>swagger-models</artifactId>
|
| | | <version>1.5.21</version>
|
| | | </dependency>
|
| | | |
| | | <!-- swagger2-UI-->
|
| | | <dependency>
|
| | | <groupId>io.springfox</groupId>
|
| | | <artifactId>springfox-swagger-ui</artifactId>
|
| | | <version>${swagger.version}</version>
|
| | | </dependency>
|
| | | |
| | | <!-- è·åç³»ç»ä¿¡æ¯ -->
|
| | | <dependency>
|
| | | <groupId>com.github.oshi</groupId>
|
| | | <artifactId>oshi-core</artifactId>
|
| | | <version>${oshi.version}</version>
|
| | | </dependency>
|
| | | |
| | | <dependency>
|
| | | <groupId>net.java.dev.jna</groupId>
|
| | | <artifactId>jna</artifactId>
|
| | | </dependency>
|
| | | |
| | | <dependency>
|
| | | <groupId>net.java.dev.jna</groupId>
|
| | | <artifactId>jna-platform</artifactId>
|
| | | </dependency>
|
| | |
|
| | | </dependencies>
|
| | |
|
| | | <build>
|
| | | <finalName>${project.artifactId}</finalName>
|
| | | <plugins>
|
| | | <plugin>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-maven-plugin</artifactId>
|
| | | <configuration>
|
| | | <fork>true</fork> <!-- å¦ææ²¡æè¯¥é
ç½®ï¼devtoolsä¸ä¼çæ -->
|
| | | </configuration>
|
| | | </plugin>
|
| | | </plugins>
|
| | | </build>
|
| | |
|
| | | <repositories>
|
| | | <repository>
|
| | | <id>public</id>
|
| | | <name>aliyun nexus</name>
|
| | | <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
| | | <releases>
|
| | | <enabled>true</enabled>
|
| | | </releases>
|
| | | </repository>
|
| | | </repositories>
|
| | |
|
| | | <pluginRepositories>
|
| | | <pluginRepository>
|
| | | <id>public</id>
|
| | | <name>aliyun nexus</name>
|
| | | <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
| | | <releases>
|
| | | <enabled>true</enabled>
|
| | | </releases>
|
| | | <snapshots>
|
| | | <enabled>false</enabled>
|
| | | </snapshots>
|
| | | </pluginRepository>
|
| | | </pluginRepositories>
|
| | |
|
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | #!/bin/bash
|
| | |
|
| | | AppName=ruoyi.jar
|
| | |
|
| | | #JVMåæ°
|
| | | JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
|
| | | APP_HOME=`pwd`
|
| | | LOG_PATH=$APP_HOME/logs/$AppName.log
|
| | |
|
| | | if [ "$1" = "" ];
|
| | | then
|
| | | echo -e "\033[0;31m æªè¾å
¥æä½å \033[0m \033[0;34m {start|stop|restart|status} \033[0m"
|
| | | exit 1
|
| | | fi
|
| | |
|
| | | if [ "$AppName" = "" ];
|
| | | then
|
| | | echo -e "\033[0;31m æªè¾å
¥åºç¨å \033[0m"
|
| | | exit 1
|
| | | fi
|
| | |
|
| | | function start()
|
| | | {
|
| | | PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'`
|
| | |
|
| | | if [ x"$PID" != x"" ]; then
|
| | | echo "$AppName is running..."
|
| | | else
|
| | | nohup java -jar $JVM_OPTS target/$AppName > /dev/null 2>&1 &
|
| | | echo "Start $AppName success..."
|
| | | fi
|
| | | }
|
| | |
|
| | | function stop()
|
| | | {
|
| | | echo "Stop $AppName"
|
| | | |
| | | PID=""
|
| | | query(){
|
| | | PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'`
|
| | | }
|
| | |
|
| | | query
|
| | | if [ x"$PID" != x"" ]; then
|
| | | kill -TERM $PID
|
| | | echo "$AppName (pid:$PID) exiting..."
|
| | | while [ x"$PID" != x"" ]
|
| | | do
|
| | | sleep 1
|
| | | query
|
| | | done
|
| | | echo "$AppName exited."
|
| | | else
|
| | | echo "$AppName already stopped."
|
| | | fi
|
| | | }
|
| | |
|
| | | function restart()
|
| | | {
|
| | | stop
|
| | | sleep 2
|
| | | start
|
| | | }
|
| | |
|
| | | function status()
|
| | | {
|
| | | PID=`ps -ef |grep java|grep $AppName|grep -v grep|wc -l`
|
| | | if [ $PID != 0 ];then
|
| | | echo "$AppName is running..."
|
| | | else
|
| | | echo "$AppName is not running..."
|
| | | fi
|
| | | }
|
| | |
|
| | | case $1 in
|
| | | start)
|
| | | start;;
|
| | | stop)
|
| | | stop;;
|
| | | restart)
|
| | | restart;;
|
| | | status)
|
| | | status;;
|
| | | *)
|
| | |
|
| | | esac
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | -- ----------------------------
|
| | | -- 1ãé¨é¨è¡¨
|
| | | -- ----------------------------
|
| | | drop table if exists sys_dept;
|
| | | create table sys_dept (
|
| | | dept_id bigint(20) not null auto_increment comment 'é¨é¨id',
|
| | | parent_id bigint(20) default 0 comment 'ç¶é¨é¨id',
|
| | | ancestors varchar(50) default '' comment 'ç¥çº§å表',
|
| | | dept_name varchar(30) default '' comment 'é¨é¨åç§°',
|
| | | order_num int(4) default 0 comment 'æ¾ç¤ºé¡ºåº',
|
| | | leader varchar(20) default null comment 'è´è´£äºº',
|
| | | phone varchar(11) default null comment 'èç³»çµè¯',
|
| | | email varchar(50) default null comment 'é®ç®±',
|
| | | status char(1) default '0' comment 'é¨é¨ç¶æï¼0æ£å¸¸ 1åç¨ï¼',
|
| | | del_flag char(1) default '0' comment 'å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼',
|
| | | create_by varchar(64) default '' comment 'å建è
',
|
| | | create_time datetime comment 'å建æ¶é´',
|
| | | update_by varchar(64) default '' comment 'æ´æ°è
',
|
| | | update_time datetime comment 'æ´æ°æ¶é´',
|
| | | primary key (dept_id)
|
| | | ) engine=innodb auto_increment=200 comment = 'é¨é¨è¡¨';
|
| | |
|
| | | -- ----------------------------
|
| | | -- åå§å-é¨é¨è¡¨æ°æ®
|
| | | -- ----------------------------
|
| | | insert into sys_dept values(100, 0, '0', 'è¥ä¾ç§æ', 0, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
| | | insert into sys_dept values(101, 100, '0,100', 'æ·±å³æ»å
¬å¸', 1, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
| | | insert into sys_dept values(102, 100, '0,100', 'é¿æ²åå
¬å¸', 2, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
| | | insert into sys_dept values(103, 101, '0,100,101', 'ç åé¨é¨', 1, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
| | | insert into sys_dept values(104, 101, '0,100,101', 'å¸åºé¨é¨', 2, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
| | | insert into sys_dept values(105, 101, '0,100,101', 'æµè¯é¨é¨', 3, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
| | | insert into sys_dept values(106, 101, '0,100,101', 'è´¢å¡é¨é¨', 4, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
| | | insert into sys_dept values(107, 101, '0,100,101', 'è¿ç»´é¨é¨', 5, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
| | | insert into sys_dept values(108, 102, '0,100,102', 'å¸åºé¨é¨', 1, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
| | | insert into sys_dept values(109, 102, '0,100,102', 'è´¢å¡é¨é¨', 2, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00');
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 2ãç¨æ·ä¿¡æ¯è¡¨
|
| | | -- ----------------------------
|
| | | drop table if exists sys_user;
|
| | | create table sys_user (
|
| | | user_id bigint(20) not null auto_increment comment 'ç¨æ·ID',
|
| | | dept_id bigint(20) default null comment 'é¨é¨ID',
|
| | | user_name varchar(30) not null comment 'ç¨æ·è´¦å·',
|
| | | nick_name varchar(30) not null comment 'ç¨æ·æµç§°',
|
| | | user_type varchar(2) default '00' comment 'ç¨æ·ç±»åï¼00ç³»ç»ç¨æ·ï¼',
|
| | | email varchar(50) default '' comment 'ç¨æ·é®ç®±',
|
| | | phonenumber varchar(11) default '' comment 'ææºå·ç ',
|
| | | sex char(1) default '0' comment 'ç¨æ·æ§å«ï¼0ç· 1女 2æªç¥ï¼',
|
| | | avatar varchar(100) default '' comment '头åå°å',
|
| | | password varchar(100) default '' comment 'å¯ç ',
|
| | | status char(1) default '0' comment 'å¸å·ç¶æï¼0æ£å¸¸ 1åç¨ï¼',
|
| | | del_flag char(1) default '0' comment 'å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼',
|
| | | login_ip varchar(50) default '' comment 'æåç»éIP',
|
| | | login_date datetime comment 'æåç»éæ¶é´',
|
| | | create_by varchar(64) default '' comment 'å建è
',
|
| | | create_time datetime comment 'å建æ¶é´',
|
| | | update_by varchar(64) default '' comment 'æ´æ°è
',
|
| | | update_time datetime comment 'æ´æ°æ¶é´',
|
| | | remark varchar(500) default null comment '夿³¨',
|
| | | primary key (user_id)
|
| | | ) engine=innodb auto_increment=100 comment = 'ç¨æ·ä¿¡æ¯è¡¨';
|
| | |
|
| | | -- ----------------------------
|
| | | -- åå§å-ç¨æ·ä¿¡æ¯è¡¨æ°æ®
|
| | | -- ----------------------------
|
| | | insert into sys_user values(1, 103, 'admin', 'è¥ä¾', '00', 'ry@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', '2018-03-16 11-33-00', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管çå');
|
| | | insert into sys_user values(2, 105, 'ry', 'è¥ä¾', '00', 'ry@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', '2018-03-16 11-33-00', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æµè¯å');
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 3ãå²ä½ä¿¡æ¯è¡¨
|
| | | -- ----------------------------
|
| | | drop table if exists sys_post;
|
| | | create table sys_post
|
| | | (
|
| | | post_id bigint(20) not null auto_increment comment 'å²ä½ID',
|
| | | post_code varchar(64) not null comment 'å²ä½ç¼ç ',
|
| | | post_name varchar(50) not null comment 'å²ä½åç§°',
|
| | | post_sort int(4) not null comment 'æ¾ç¤ºé¡ºåº',
|
| | | status char(1) not null comment 'ç¶æï¼0æ£å¸¸ 1åç¨ï¼',
|
| | | create_by varchar(64) default '' comment 'å建è
',
|
| | | create_time datetime comment 'å建æ¶é´',
|
| | | update_by varchar(64) default '' comment 'æ´æ°è
',
|
| | | update_time datetime comment 'æ´æ°æ¶é´',
|
| | | remark varchar(500) default null comment '夿³¨',
|
| | | primary key (post_id)
|
| | | ) engine=innodb comment = 'å²ä½ä¿¡æ¯è¡¨';
|
| | |
|
| | | -- ----------------------------
|
| | | -- åå§å-å²ä½ä¿¡æ¯è¡¨æ°æ®
|
| | | -- ----------------------------
|
| | | insert into sys_post values(1, 'ceo', 'è£äºé¿', 1, '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_post values(2, 'se', '项ç®ç»ç', 2, '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_post values(3, 'hr', '人åèµæº', 3, '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_post values(4, 'user', 'æ®éåå·¥', 4, '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 4ãè§è²ä¿¡æ¯è¡¨
|
| | | -- ----------------------------
|
| | | drop table if exists sys_role;
|
| | | create table sys_role (
|
| | | role_id bigint(20) not null auto_increment comment 'è§è²ID',
|
| | | role_name varchar(30) not null comment 'è§è²åç§°',
|
| | | role_key varchar(100) not null comment 'è§è²æéå符串',
|
| | | role_sort int(4) not null comment 'æ¾ç¤ºé¡ºåº',
|
| | | data_scope char(1) default '1' comment 'æ°æ®èå´ï¼1ï¼å
¨é¨æ°æ®æé 2ï¼èªå®æ°æ®æé 3ï¼æ¬é¨é¨æ°æ®æé 4ï¼æ¬é¨é¨å以䏿°æ®æéï¼',
|
| | | status char(1) not null comment 'è§è²ç¶æï¼0æ£å¸¸ 1åç¨ï¼',
|
| | | del_flag char(1) default '0' comment 'å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼',
|
| | | create_by varchar(64) default '' comment 'å建è
',
|
| | | create_time datetime comment 'å建æ¶é´',
|
| | | update_by varchar(64) default '' comment 'æ´æ°è
',
|
| | | update_time datetime comment 'æ´æ°æ¶é´',
|
| | | remark varchar(500) default null comment '夿³¨',
|
| | | primary key (role_id)
|
| | | ) engine=innodb auto_increment=100 comment = 'è§è²ä¿¡æ¯è¡¨';
|
| | |
|
| | | -- ----------------------------
|
| | | -- åå§å-è§è²ä¿¡æ¯è¡¨æ°æ®
|
| | | -- ----------------------------
|
| | | insert into sys_role values('1', '管çå', 'admin', 1, 1, '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管çå');
|
| | | insert into sys_role values('2', 'æ®éè§è²', 'common', 2, 2, '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æ®éè§è²');
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 5ãèåæé表
|
| | | -- ----------------------------
|
| | | drop table if exists sys_menu;
|
| | | create table sys_menu (
|
| | | menu_id bigint(20) not null auto_increment comment 'èåID',
|
| | | menu_name varchar(50) not null comment 'èååç§°',
|
| | | parent_id bigint(20) default 0 comment 'ç¶èåID',
|
| | | order_num int(4) default 0 comment 'æ¾ç¤ºé¡ºåº',
|
| | | path varchar(200) default '' comment 'è·¯ç±å°å',
|
| | | component varchar(255) default null comment 'ç»ä»¶è·¯å¾',
|
| | | is_frame int(1) default 1 comment 'æ¯å¦ä¸ºå¤é¾ï¼0æ¯ 1å¦ï¼',
|
| | | menu_type char(1) default '' comment 'èåç±»åï¼0ç®å½ 1èå 2æé®ï¼',
|
| | | visible char(1) default 0 comment 'èåç¶æï¼0æ¾ç¤º 1éèï¼',
|
| | | perms varchar(100) default null comment 'æéæ è¯',
|
| | | icon varchar(100) default '#' comment 'èå徿 ',
|
| | | create_by varchar(64) default '' comment 'å建è
',
|
| | | create_time datetime comment 'å建æ¶é´',
|
| | | update_by varchar(64) default '' comment 'æ´æ°è
',
|
| | | update_time datetime comment 'æ´æ°æ¶é´',
|
| | | remark varchar(500) default '' comment '夿³¨',
|
| | | primary key (menu_id)
|
| | | ) engine=innodb auto_increment=2000 comment = 'èåæé表';
|
| | |
|
| | | -- ----------------------------
|
| | | -- åå§å-èåä¿¡æ¯è¡¨æ°æ®
|
| | | -- ----------------------------
|
| | | -- ä¸çº§èå
|
| | | insert into sys_menu values('1', 'ç³»ç»ç®¡ç', '0', '1', 'system', null, 1, 'M', '0', '', 'system', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç³»ç»ç®¡çç®å½');
|
| | | insert into sys_menu values('2', 'ç³»ç»çæ§', '0', '2', 'monitor', null, 1, 'M', '0', '', 'monitor', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç³»ç»çæ§ç®å½');
|
| | | insert into sys_menu values('3', 'ç³»ç»å·¥å
·', '0', '3', 'tool', null, 1, 'M', '0', '', 'tool', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç³»ç»å·¥å
·ç®å½');
|
| | | INSERT INTO sys_menu VALUES('4', 'è¥ä¾å®ç½', '0', '4', 'http://ruoyi.vip', NULL , 0, 'M', '0', '', 'guide', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'è¥ä¾å®ç½');
|
| | | -- äºçº§èå
|
| | | insert into sys_menu values('100', 'ç¨æ·ç®¡ç', '1', '1', 'user', 'system/user/index', 1, 'C', '0', 'system:user:list', 'user', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç¨æ·ç®¡çèå');
|
| | | insert into sys_menu values('101', 'è§è²ç®¡ç', '1', '2', 'role', 'system/role/index', 1, 'C', '0', 'system:role:list', 'peoples', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'è§è²ç®¡çèå');
|
| | | insert into sys_menu values('102', 'èå管ç', '1', '3', 'menu', 'system/menu/index', 1, 'C', '0', 'system:menu:list', 'tree-table', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'èå管çèå');
|
| | | insert into sys_menu values('103', 'é¨é¨ç®¡ç', '1', '4', 'dept', 'system/dept/index', 1, 'C', '0', 'system:dept:list', 'tree', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'é¨é¨ç®¡çèå');
|
| | | insert into sys_menu values('104', 'å²ä½ç®¡ç', '1', '5', 'post', 'system/post/index', 1, 'C', '0', 'system:post:list', 'post', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'å²ä½ç®¡çèå');
|
| | | insert into sys_menu values('105', 'åå
¸ç®¡ç', '1', '6', 'dict', 'system/dict/index', 1, 'C', '0', 'system:dict:list', 'dict', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'åå
¸ç®¡çèå');
|
| | | insert into sys_menu values('106', 'åæ°è®¾ç½®', '1', '7', 'config', 'system/config/index', 1, 'C', '0', 'system:config:list', 'edit', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'åæ°è®¾ç½®èå');
|
| | | insert into sys_menu values('107', 'éç¥å
¬å', '1', '8', 'notice', 'system/notice/index', 1, 'C', '0', 'system:notice:list', 'message', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'éç¥å
¬åèå');
|
| | | insert into sys_menu values('108', 'æ¥å¿ç®¡ç', '1', '9', 'log', 'system/log/index', 1, 'M', '0', '', 'log', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æ¥å¿ç®¡çèå');
|
| | | insert into sys_menu values('109', 'å¨çº¿ç¨æ·', '2', '1', 'online', 'monitor/online/index', 1, 'C', '0', 'monitor:online:list', 'online', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'å¨çº¿ç¨æ·èå');
|
| | | insert into sys_menu values('110', '宿¶ä»»å¡', '2', '2', 'job', 'monitor/job/index', 1, 'C', '0', 'monitor:job:list', 'job', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '宿¶ä»»å¡èå');
|
| | | insert into sys_menu values('111', 'æ°æ®çæ§', '2', '3', 'druid', 'monitor/druid/index', 1, 'C', '0', 'monitor:druid:list', 'druid', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æ°æ®çæ§èå');
|
| | | insert into sys_menu values('112', 'æå¡çæ§', '2', '4', 'server', 'monitor/server/index', 1, 'C', '0', 'monitor:server:list', 'server', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æå¡çæ§èå');
|
| | | insert into sys_menu values('113', '表åæå»º', '3', '1', 'build', 'tool/build/index', 1 ,'C', '0', 'tool:build:list', 'build', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '表åæå»ºèå');
|
| | | insert into sys_menu values('114', '代ç çæ', '3', '2', 'server', 'tool/gen/index', 1, 'C', '0', 'tool:gen:list', 'code', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '代ç çæèå');
|
| | | insert into sys_menu values('115', 'ç³»ç»æ¥å£', '3', '3', 'swagger', 'tool/swagger/index', 1, 'C', '0', 'tool:swagger:list', 'swagger', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç³»ç»æ¥å£èå');
|
| | | -- ä¸çº§èå
|
| | | insert into sys_menu values('500', 'æä½æ¥å¿', '108', '1', 'operlog', 'monitor/operlog/index', 1, 'C', '0', 'monitor:operlog:list', 'form', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æä½æ¥å¿èå');
|
| | | insert into sys_menu values('501', 'ç»å½æ¥å¿', '108', '2', 'logininfor', 'monitor/logininfor/index', 1, 'C', '0', 'monitor:logininfor:list', 'logininfor', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç»å½æ¥å¿èå');
|
| | | -- ç¨æ·ç®¡çæé®
|
| | | insert into sys_menu values('1001', 'ç¨æ·æ¥è¯¢', '100', '1', '', '', 1, 'F', '0', 'system:user:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1002', 'ç¨æ·æ°å¢', '100', '2', '', '', 1, 'F', '0', 'system:user:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1003', 'ç¨æ·ä¿®æ¹', '100', '3', '', '', 1, 'F', '0', 'system:user:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1004', 'ç¨æ·å é¤', '100', '4', '', '', 1, 'F', '0', 'system:user:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1005', 'ç¨æ·å¯¼åº', '100', '5', '', '', 1, 'F', '0', 'system:user:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1006', 'ç¨æ·å¯¼å
¥', '100', '6', '', '', 1, 'F', '0', 'system:user:import', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1007', 'éç½®å¯ç ', '100', '7', '', '', 1, 'F', '0', 'system:user:resetPwd', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | -- è§è²ç®¡çæé®
|
| | | insert into sys_menu values('1008', 'è§è²æ¥è¯¢', '101', '1', '', '', 1, 'F', '0', 'system:role:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1009', 'è§è²æ°å¢', '101', '2', '', '', 1, 'F', '0', 'system:role:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1010', 'è§è²ä¿®æ¹', '101', '3', '', '', 1, 'F', '0', 'system:role:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1011', 'è§è²å é¤', '101', '4', '', '', 1, 'F', '0', 'system:role:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1012', 'è§è²å¯¼åº', '101', '5', '', '', 1, 'F', '0', 'system:role:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | -- èå管çæé®
|
| | | insert into sys_menu values('1013', 'èåæ¥è¯¢', '102', '1', '', '', 1, 'F', '0', 'system:menu:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1014', 'èåæ°å¢', '102', '2', '', '', 1, 'F', '0', 'system:menu:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1015', 'èåä¿®æ¹', '102', '3', '', '', 1, 'F', '0', 'system:menu:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1016', 'èåå é¤', '102', '4', '', '', 1, 'F', '0', 'system:menu:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | -- é¨é¨ç®¡çæé®
|
| | | insert into sys_menu values('1017', 'é¨é¨æ¥è¯¢', '103', '1', '', '', 1, 'F', '0', 'system:dept:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1018', 'é¨é¨æ°å¢', '103', '2', '', '', 1, 'F', '0', 'system:dept:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1019', 'é¨é¨ä¿®æ¹', '103', '3', '', '', 1, 'F', '0', 'system:dept:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1020', 'é¨é¨å é¤', '103', '4', '', '', 1, 'F', '0', 'system:dept:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | -- å²ä½ç®¡çæé®
|
| | | insert into sys_menu values('1021', 'å²ä½æ¥è¯¢', '104', '1', '', '', 1, 'F', '0', 'system:post:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1022', 'å²ä½æ°å¢', '104', '2', '', '', 1, 'F', '0', 'system:post:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1023', 'å²ä½ä¿®æ¹', '104', '3', '', '', 1, 'F', '0', 'system:post:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1024', 'å²ä½å é¤', '104', '4', '', '', 1, 'F', '0', 'system:post:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1025', 'å²ä½å¯¼åº', '104', '5', '', '', 1, 'F', '0', 'system:post:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | -- åå
¸ç®¡çæé®
|
| | | insert into sys_menu values('1026', 'åå
¸æ¥è¯¢', '105', '1', '#', '', 1, 'F', '0', 'system:dict:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1027', 'åå
¸æ°å¢', '105', '2', '#', '', 1, 'F', '0', 'system:dict:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1028', 'åå
¸ä¿®æ¹', '105', '3', '#', '', 1, 'F', '0', 'system:dict:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1029', 'åå
¸å é¤', '105', '4', '#', '', 1, 'F', '0', 'system:dict:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1030', 'åå
¸å¯¼åº', '105', '5', '#', '', 1, 'F', '0', 'system:dict:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | -- åæ°è®¾ç½®æé®
|
| | | insert into sys_menu values('1031', 'åæ°æ¥è¯¢', '106', '1', '#', '', 1, 'F', '0', 'system:config:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1032', 'åæ°æ°å¢', '106', '2', '#', '', 1, 'F', '0', 'system:config:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1033', 'åæ°ä¿®æ¹', '106', '3', '#', '', 1, 'F', '0', 'system:config:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1034', 'åæ°å é¤', '106', '4', '#', '', 1, 'F', '0', 'system:config:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1035', '忰坼åº', '106', '5', '#', '', 1, 'F', '0', 'system:config:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | -- éç¥å
¬åæé®
|
| | | insert into sys_menu values('1036', 'å
¬åæ¥è¯¢', '107', '1', '#', '', 1, 'F', '0', 'system:notice:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1037', 'å
¬åæ°å¢', '107', '2', '#', '', 1, 'F', '0', 'system:notice:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1038', 'å
¬åä¿®æ¹', '107', '3', '#', '', 1, 'F', '0', 'system:notice:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1039', 'å
¬åå é¤', '107', '4', '#', '', 1, 'F', '0', 'system:notice:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | -- æä½æ¥å¿æé®
|
| | | insert into sys_menu values('1040', 'æä½æ¥è¯¢', '500', '1', '#', '', 1, 'F', '0', 'monitor:operlog:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1041', 'æä½å é¤', '500', '2', '#', '', 1, 'F', '0', 'monitor:operlog:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1042', 'æ¥å¿å¯¼åº', '500', '4', '#', '', 1, 'F', '0', 'monitor:operlog:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | -- ç»å½æ¥å¿æé®
|
| | | insert into sys_menu values('1043', 'ç»å½æ¥è¯¢', '501', '1', '#', '', 1, 'F', '0', 'monitor:logininfor:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1044', 'ç»å½å é¤', '501', '2', '#', '', 1, 'F', '0', 'monitor:logininfor:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1045', 'æ¥å¿å¯¼åº', '501', '3', '#', '', 1, 'F', '0', 'monitor:logininfor:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | -- å¨çº¿ç¨æ·æé®
|
| | | insert into sys_menu values('1046', 'å¨çº¿æ¥è¯¢', '109', '1', '#', '', 1, 'F', '0', 'monitor:online:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1047', 'æ¹é强é', '109', '2', '#', '', 1, 'F', '0', 'monitor:online:batchLogout', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1048', 'åæ¡å¼ºé', '109', '3', '#', '', 1, 'F', '0', 'monitor:online:forceLogout', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | -- 宿¶ä»»å¡æé®
|
| | | insert into sys_menu values('1049', '任塿¥è¯¢', '110', '1', '#', '', 1, 'F', '0', 'monitor:job:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1050', '任塿°å¢', '110', '2', '#', '', 1, 'F', '0', 'monitor:job:add', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1051', 'ä»»å¡ä¿®æ¹', '110', '3', '#', '', 1, 'F', '0', 'monitor:job:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1052', 'ä»»å¡å é¤', '110', '4', '#', '', 1, 'F', '0', 'monitor:job:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1053', 'ç¶æä¿®æ¹', '110', '5', '#', '', 1, 'F', '0', 'monitor:job:changeStatus', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1054', 'ä»»å¡å¯¼åº', '110', '7', '#', '', 1, 'F', '0', 'monitor:job:export', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | -- 代ç çææé®
|
| | | insert into sys_menu values('1055', 'çææ¥è¯¢', '114', '1', '#', '', 1, 'F', '0', 'tool:gen:query', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1056', 'çæä¿®æ¹', '114', '2', '#', '', 1, 'F', '0', 'tool:gen:edit', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1057', 'çæå é¤', '114', '3', '#', '', 1, 'F', '0', 'tool:gen:remove', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1058', 'é¢è§ä»£ç ', '114', '4', '#', '', 1, 'F', '0', 'tool:gen:preview', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_menu values('1059', 'çæä»£ç ', '114', '5', '#', '', 1, 'F', '0', 'tool:gen:code', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 6ãç¨æ·åè§è²å
³è表 ç¨æ·N-1è§è²
|
| | | -- ----------------------------
|
| | | drop table if exists sys_user_role;
|
| | | create table sys_user_role (
|
| | | user_id bigint(20) not null comment 'ç¨æ·ID',
|
| | | role_id bigint(20) not null comment 'è§è²ID',
|
| | | primary key(user_id, role_id)
|
| | | ) engine=innodb comment = 'ç¨æ·åè§è²å
³è表';
|
| | |
|
| | | -- ----------------------------
|
| | | -- åå§å-ç¨æ·åè§è²å
³èè¡¨æ°æ®
|
| | | -- ----------------------------
|
| | | insert into sys_user_role values ('1', '1');
|
| | | insert into sys_user_role values ('2', '2');
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 7ãè§è²åèåå
³è表 è§è²1-Nèå
|
| | | -- ----------------------------
|
| | | drop table if exists sys_role_menu;
|
| | | create table sys_role_menu (
|
| | | role_id bigint(20) not null comment 'è§è²ID',
|
| | | menu_id bigint(20) not null comment 'èåID',
|
| | | primary key(role_id, menu_id)
|
| | | ) engine=innodb comment = 'è§è²åèåå
³è表';
|
| | |
|
| | | -- ----------------------------
|
| | | -- åå§å-è§è²åèåå
³èè¡¨æ°æ®
|
| | | -- ----------------------------
|
| | | insert into sys_role_menu values ('2', '1');
|
| | | insert into sys_role_menu values ('2', '2');
|
| | | insert into sys_role_menu values ('2', '3');
|
| | | insert into sys_role_menu values ('2', '4');
|
| | | insert into sys_role_menu values ('2', '100');
|
| | | insert into sys_role_menu values ('2', '101');
|
| | | insert into sys_role_menu values ('2', '102');
|
| | | insert into sys_role_menu values ('2', '103');
|
| | | insert into sys_role_menu values ('2', '104');
|
| | | insert into sys_role_menu values ('2', '105');
|
| | | insert into sys_role_menu values ('2', '106');
|
| | | insert into sys_role_menu values ('2', '107');
|
| | | insert into sys_role_menu values ('2', '108');
|
| | | insert into sys_role_menu values ('2', '109');
|
| | | insert into sys_role_menu values ('2', '110');
|
| | | insert into sys_role_menu values ('2', '111');
|
| | | insert into sys_role_menu values ('2', '112');
|
| | | insert into sys_role_menu values ('2', '113');
|
| | | insert into sys_role_menu values ('2', '114');
|
| | | insert into sys_role_menu values ('2', '115');
|
| | | insert into sys_role_menu values ('2', '500');
|
| | | insert into sys_role_menu values ('2', '501');
|
| | | insert into sys_role_menu values ('2', '1000');
|
| | | insert into sys_role_menu values ('2', '1001');
|
| | | insert into sys_role_menu values ('2', '1002');
|
| | | insert into sys_role_menu values ('2', '1003');
|
| | | insert into sys_role_menu values ('2', '1004');
|
| | | insert into sys_role_menu values ('2', '1005');
|
| | | insert into sys_role_menu values ('2', '1006');
|
| | | insert into sys_role_menu values ('2', '1007');
|
| | | insert into sys_role_menu values ('2', '1008');
|
| | | insert into sys_role_menu values ('2', '1009');
|
| | | insert into sys_role_menu values ('2', '1010');
|
| | | insert into sys_role_menu values ('2', '1011');
|
| | | insert into sys_role_menu values ('2', '1012');
|
| | | insert into sys_role_menu values ('2', '1013');
|
| | | insert into sys_role_menu values ('2', '1014');
|
| | | insert into sys_role_menu values ('2', '1015');
|
| | | insert into sys_role_menu values ('2', '1016');
|
| | | insert into sys_role_menu values ('2', '1017');
|
| | | insert into sys_role_menu values ('2', '1018');
|
| | | insert into sys_role_menu values ('2', '1019');
|
| | | insert into sys_role_menu values ('2', '1020');
|
| | | insert into sys_role_menu values ('2', '1021');
|
| | | insert into sys_role_menu values ('2', '1022');
|
| | | insert into sys_role_menu values ('2', '1023');
|
| | | insert into sys_role_menu values ('2', '1024');
|
| | | insert into sys_role_menu values ('2', '1025');
|
| | | insert into sys_role_menu values ('2', '1026');
|
| | | insert into sys_role_menu values ('2', '1027');
|
| | | insert into sys_role_menu values ('2', '1028');
|
| | | insert into sys_role_menu values ('2', '1029');
|
| | | insert into sys_role_menu values ('2', '1030');
|
| | | insert into sys_role_menu values ('2', '1031');
|
| | | insert into sys_role_menu values ('2', '1032');
|
| | | insert into sys_role_menu values ('2', '1033');
|
| | | insert into sys_role_menu values ('2', '1034');
|
| | | insert into sys_role_menu values ('2', '1035');
|
| | | insert into sys_role_menu values ('2', '1036');
|
| | | insert into sys_role_menu values ('2', '1037');
|
| | | insert into sys_role_menu values ('2', '1038');
|
| | | insert into sys_role_menu values ('2', '1039');
|
| | | insert into sys_role_menu values ('2', '1040');
|
| | | insert into sys_role_menu values ('2', '1041');
|
| | | insert into sys_role_menu values ('2', '1042');
|
| | | insert into sys_role_menu values ('2', '1043');
|
| | | insert into sys_role_menu values ('2', '1044');
|
| | | insert into sys_role_menu values ('2', '1045');
|
| | | insert into sys_role_menu values ('2', '1046');
|
| | | insert into sys_role_menu values ('2', '1047');
|
| | | insert into sys_role_menu values ('2', '1048');
|
| | | insert into sys_role_menu values ('2', '1049');
|
| | | insert into sys_role_menu values ('2', '1050');
|
| | | insert into sys_role_menu values ('2', '1051');
|
| | | insert into sys_role_menu values ('2', '1052');
|
| | | insert into sys_role_menu values ('2', '1053');
|
| | | insert into sys_role_menu values ('2', '1054');
|
| | | insert into sys_role_menu values ('2', '1055');
|
| | | insert into sys_role_menu values ('2', '1056');
|
| | | insert into sys_role_menu values ('2', '1057');
|
| | | insert into sys_role_menu values ('2', '1058');
|
| | | insert into sys_role_menu values ('2', '1059');
|
| | |
|
| | | -- ----------------------------
|
| | | -- 8ãè§è²åé¨é¨å
³è表 è§è²1-Né¨é¨
|
| | | -- ----------------------------
|
| | | drop table if exists sys_role_dept;
|
| | | create table sys_role_dept (
|
| | | role_id bigint(20) not null comment 'è§è²ID',
|
| | | dept_id bigint(20) not null comment 'é¨é¨ID',
|
| | | primary key(role_id, dept_id)
|
| | | ) engine=innodb comment = 'è§è²åé¨é¨å
³è表';
|
| | |
|
| | | -- ----------------------------
|
| | | -- åå§å-è§è²åé¨é¨å
³èè¡¨æ°æ®
|
| | | -- ----------------------------
|
| | | insert into sys_role_dept values ('2', '100');
|
| | | insert into sys_role_dept values ('2', '101');
|
| | | insert into sys_role_dept values ('2', '105');
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 9ãç¨æ·ä¸å²ä½å
³è表 ç¨æ·1-Nå²ä½
|
| | | -- ----------------------------
|
| | | drop table if exists sys_user_post;
|
| | | create table sys_user_post
|
| | | (
|
| | | user_id bigint(20) not null comment 'ç¨æ·ID',
|
| | | post_id bigint(20) not null comment 'å²ä½ID',
|
| | | primary key (user_id, post_id)
|
| | | ) engine=innodb comment = 'ç¨æ·ä¸å²ä½å
³è表';
|
| | |
|
| | | -- ----------------------------
|
| | | -- åå§å-ç¨æ·ä¸å²ä½å
³èè¡¨æ°æ®
|
| | | -- ----------------------------
|
| | | insert into sys_user_post values ('1', '1');
|
| | | insert into sys_user_post values ('2', '2');
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 10ãæä½æ¥å¿è®°å½
|
| | | -- ----------------------------
|
| | | drop table if exists sys_oper_log;
|
| | | create table sys_oper_log (
|
| | | oper_id bigint(20) not null auto_increment comment 'æ¥å¿ä¸»é®',
|
| | | title varchar(50) default '' comment 'æ¨¡åæ é¢',
|
| | | business_type int(2) default 0 comment 'ä¸å¡ç±»åï¼0å
¶å® 1æ°å¢ 2ä¿®æ¹ 3å é¤ï¼',
|
| | | method varchar(100) default '' comment 'æ¹æ³åç§°',
|
| | | request_method varchar(10) default '' comment 'è¯·æ±æ¹å¼',
|
| | | operator_type int(1) default 0 comment 'æä½ç±»å«ï¼0å
¶å® 1åå°ç¨æ· 2ææºç«¯ç¨æ·ï¼',
|
| | | oper_name varchar(50) default '' comment 'æä½äººå',
|
| | | dept_name varchar(50) default '' comment 'é¨é¨åç§°',
|
| | | oper_url varchar(255) default '' comment '请æ±URL',
|
| | | oper_ip varchar(50) default '' comment '主æºå°å',
|
| | | oper_location varchar(255) default '' comment 'æä½å°ç¹',
|
| | | oper_param varchar(2000) default '' comment '请æ±åæ°',
|
| | | json_result varchar(2000) default '' comment 'è¿ååæ°',
|
| | | status int(1) default 0 comment 'æä½ç¶æï¼0æ£å¸¸ 1å¼å¸¸ï¼',
|
| | | error_msg varchar(2000) default '' comment 'éè¯¯æ¶æ¯',
|
| | | oper_time datetime comment 'æä½æ¶é´',
|
| | | primary key (oper_id)
|
| | | ) engine=innodb auto_increment=100 comment = 'æä½æ¥å¿è®°å½';
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 11ãåå
¸ç±»å表
|
| | | -- ----------------------------
|
| | | drop table if exists sys_dict_type;
|
| | | create table sys_dict_type
|
| | | (
|
| | | dict_id bigint(20) not null auto_increment comment 'åå
¸ä¸»é®',
|
| | | dict_name varchar(100) default '' comment 'åå
¸åç§°',
|
| | | dict_type varchar(100) default '' comment 'åå
¸ç±»å',
|
| | | status char(1) default '0' comment 'ç¶æï¼0æ£å¸¸ 1åç¨ï¼',
|
| | | create_by varchar(64) default '' comment 'å建è
',
|
| | | create_time datetime comment 'å建æ¶é´',
|
| | | update_by varchar(64) default '' comment 'æ´æ°è
',
|
| | | update_time datetime comment 'æ´æ°æ¶é´',
|
| | | remark varchar(500) default null comment '夿³¨',
|
| | | primary key (dict_id),
|
| | | unique (dict_type)
|
| | | ) engine=innodb auto_increment=100 comment = 'åå
¸ç±»å表';
|
| | |
|
| | | insert into sys_dict_type values(1, 'ç¨æ·æ§å«', 'sys_user_sex', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç¨æ·æ§å«å表');
|
| | | insert into sys_dict_type values(2, 'èåç¶æ', 'sys_show_hide', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'èåç¶æå表');
|
| | | insert into sys_dict_type values(3, 'ç³»ç»å¼å
³', 'sys_normal_disable', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç³»ç»å¼å
³å表');
|
| | | insert into sys_dict_type values(4, 'ä»»å¡ç¶æ', 'sys_job_status', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ä»»å¡ç¶æå表');
|
| | | insert into sys_dict_type values(5, 'ä»»å¡åç»', 'sys_job_group', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ä»»å¡åç»å表');
|
| | | insert into sys_dict_type values(6, 'ç³»ç»æ¯å¦', 'sys_yes_no', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç³»ç»æ¯å¦å表');
|
| | | insert into sys_dict_type values(7, 'éç¥ç±»å', 'sys_notice_type', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'éç¥ç±»åå表');
|
| | | insert into sys_dict_type values(8, 'éç¥ç¶æ', 'sys_notice_status', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'éç¥ç¶æå表');
|
| | | insert into sys_dict_type values(9, 'æä½ç±»å', 'sys_oper_type', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æä½ç±»åå表');
|
| | | insert into sys_dict_type values(10, 'ç³»ç»ç¶æ', 'sys_common_status', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç»å½ç¶æå表');
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 12ãåå
¸æ°æ®è¡¨
|
| | | -- ----------------------------
|
| | | drop table if exists sys_dict_data;
|
| | | create table sys_dict_data
|
| | | (
|
| | | dict_code bigint(20) not null auto_increment comment 'åå
¸ç¼ç ',
|
| | | dict_sort int(4) default 0 comment 'åå
¸æåº',
|
| | | dict_label varchar(100) default '' comment 'åå
¸æ ç¾',
|
| | | dict_value varchar(100) default '' comment 'åå
¸é®å¼',
|
| | | dict_type varchar(100) default '' comment 'åå
¸ç±»å',
|
| | | css_class varchar(100) default null comment 'æ ·å¼å±æ§ï¼å
¶ä»æ ·å¼æ©å±ï¼',
|
| | | list_class varchar(100) default null comment 'è¡¨æ ¼åæ¾æ ·å¼',
|
| | | is_default char(1) default 'N' comment 'æ¯å¦é»è®¤ï¼Yæ¯ Nå¦ï¼',
|
| | | status char(1) default '0' comment 'ç¶æï¼0æ£å¸¸ 1åç¨ï¼',
|
| | | create_by varchar(64) default '' comment 'å建è
',
|
| | | create_time datetime comment 'å建æ¶é´',
|
| | | update_by varchar(64) default '' comment 'æ´æ°è
',
|
| | | update_time datetime comment 'æ´æ°æ¶é´',
|
| | | remark varchar(500) default null comment '夿³¨',
|
| | | primary key (dict_code)
|
| | | ) engine=innodb auto_increment=100 comment = 'åå
¸æ°æ®è¡¨';
|
| | |
|
| | | insert into sys_dict_data values(1, 1, 'ç·', '0', 'sys_user_sex', '', '', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æ§å«ç·');
|
| | | insert into sys_dict_data values(2, 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æ§å«å¥³');
|
| | | insert into sys_dict_data values(3, 3, 'æªç¥', '2', 'sys_user_sex', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æ§å«æªç¥');
|
| | | insert into sys_dict_data values(4, 1, 'æ¾ç¤º', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æ¾ç¤ºèå');
|
| | | insert into sys_dict_data values(5, 2, 'éè', '1', 'sys_show_hide', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'éèèå');
|
| | | insert into sys_dict_data values(6, 1, 'æ£å¸¸', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æ£å¸¸ç¶æ');
|
| | | insert into sys_dict_data values(7, 2, 'åç¨', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'åç¨ç¶æ');
|
| | | insert into sys_dict_data values(8, 1, 'æ£å¸¸', '0', 'sys_job_status', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æ£å¸¸ç¶æ');
|
| | | insert into sys_dict_data values(9, 2, 'æå', '1', 'sys_job_status', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'åç¨ç¶æ');
|
| | | insert into sys_dict_data values(10, 1, 'é»è®¤', 'DEFAULT', 'sys_job_group', '', '', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'é»è®¤åç»');
|
| | | insert into sys_dict_data values(11, 2, 'ç³»ç»', 'SYSTEM', 'sys_job_group', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç³»ç»åç»');
|
| | | insert into sys_dict_data values(12, 1, 'æ¯', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç³»ç»é»è®¤æ¯');
|
| | | insert into sys_dict_data values(13, 2, 'å¦', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ç³»ç»é»è®¤å¦');
|
| | | insert into sys_dict_data values(14, 1, 'éç¥', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'éç¥');
|
| | | insert into sys_dict_data values(15, 2, 'å
¬å', '2', 'sys_notice_type', '', 'success', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'å
Œ');
|
| | | insert into sys_dict_data values(16, 1, 'æ£å¸¸', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æ£å¸¸ç¶æ');
|
| | | insert into sys_dict_data values(17, 2, 'å
³é', '1', 'sys_notice_status', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'å
³éç¶æ');
|
| | | insert into sys_dict_data values(18, 1, 'æ°å¢', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æ°å¢æä½');
|
| | | insert into sys_dict_data values(19, 2, 'ä¿®æ¹', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'ä¿®æ¹æä½');
|
| | | insert into sys_dict_data values(20, 3, 'å é¤', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'å 餿ä½');
|
| | | insert into sys_dict_data values(21, 4, 'ææ', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æææä½');
|
| | | insert into sys_dict_data values(22, 5, '导åº', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'å¯¼åºæä½');
|
| | | insert into sys_dict_data values(23, 6, '导å
¥', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '导å
¥æä½');
|
| | | insert into sys_dict_data values(24, 7, '强é', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '强éæä½');
|
| | | insert into sys_dict_data values(25, 8, 'çæä»£ç ', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'çææä½');
|
| | | insert into sys_dict_data values(26, 9, 'æ¸
ç©ºæ°æ®', '9', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æ¸
空æä½');
|
| | | insert into sys_dict_data values(27, 1, 'æå', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æ£å¸¸ç¶æ');
|
| | | insert into sys_dict_data values(28, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'åç¨ç¶æ');
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 13ãåæ°é
置表
|
| | | -- ----------------------------
|
| | | drop table if exists sys_config;
|
| | | create table sys_config (
|
| | | config_id int(5) not null auto_increment comment '忰䏻é®',
|
| | | config_name varchar(100) default '' comment 'åæ°åç§°',
|
| | | config_key varchar(100) default '' comment 'åæ°é®å',
|
| | | config_value varchar(500) default '' comment 'åæ°é®å¼',
|
| | | config_type char(1) default 'N' comment 'ç³»ç»å
ç½®ï¼Yæ¯ Nå¦ï¼',
|
| | | create_by varchar(64) default '' comment 'å建è
',
|
| | | create_time datetime comment 'å建æ¶é´',
|
| | | update_by varchar(64) default '' comment 'æ´æ°è
',
|
| | | update_time datetime comment 'æ´æ°æ¶é´',
|
| | | remark varchar(500) default null comment '夿³¨',
|
| | | primary key (config_id)
|
| | | ) engine=innodb auto_increment=100 comment = 'åæ°é
置表';
|
| | |
|
| | | insert into sys_config values(1, 'ä¸»æ¡æ¶é¡µ-é»è®¤ç®è¤æ ·å¼åç§°', 'sys.index.skinName', 'skin-blue', 'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'èè² skin-blueãç»¿è² skin-greenãç´«è² skin-purpleãçº¢è² skin-redãé»è² skin-yellow' );
|
| | | insert into sys_config values(2, 'ç¨æ·ç®¡ç-è´¦å·åå§å¯ç ', 'sys.user.initPassword', '123456', 'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'åå§åå¯ç 123456' );
|
| | | insert into sys_config values(3, 'ä¸»æ¡æ¶é¡µ-ä¾§è¾¹æ 主é¢', 'sys.index.sideTheme', 'theme-dark', 'Y', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', 'æ·±è²ä¸»é¢theme-darkï¼æµ
è²ä¸»é¢theme-light' );
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 14ãç³»ç»è®¿é®è®°å½
|
| | | -- ----------------------------
|
| | | drop table if exists sys_logininfor;
|
| | | create table sys_logininfor (
|
| | | info_id bigint(20) not null auto_increment comment '访é®ID',
|
| | | user_name varchar(50) default '' comment 'ç¨æ·è´¦å·',
|
| | | ipaddr varchar(50) default '' comment 'ç»å½IPå°å',
|
| | | login_location varchar(255) default '' comment 'ç»å½å°ç¹',
|
| | | browser varchar(50) default '' comment 'æµè§å¨ç±»å',
|
| | | os varchar(50) default '' comment 'æä½ç³»ç»',
|
| | | status char(1) default '0' comment 'ç»å½ç¶æï¼0æå 1失败ï¼',
|
| | | msg varchar(255) default '' comment 'æç¤ºæ¶æ¯',
|
| | | login_time datetime comment 'è®¿é®æ¶é´',
|
| | | primary key (info_id)
|
| | | ) engine=innodb auto_increment=100 comment = 'ç³»ç»è®¿é®è®°å½';
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 15ãå¨çº¿ç¨æ·è®°å½
|
| | | -- ----------------------------
|
| | | drop table if exists sys_user_online;
|
| | | create table sys_user_online (
|
| | | sessionId varchar(50) default '' comment 'ç¨æ·ä¼è¯id',
|
| | | user_name varchar(50) default '' comment 'ç¨æ·è´¦å·',
|
| | | dept_name varchar(50) default '' comment 'é¨é¨åç§°',
|
| | | ipaddr varchar(50) default '' comment 'ç»å½IPå°å',
|
| | | login_location varchar(255) default '' comment 'ç»å½å°ç¹',
|
| | | browser varchar(50) default '' comment 'æµè§å¨ç±»å',
|
| | | os varchar(50) default '' comment 'æä½ç³»ç»',
|
| | | status varchar(10) default '' comment 'å¨çº¿ç¶æon_lineå¨çº¿off_line离线',
|
| | | start_timestamp datetime comment 'sessionå建æ¶é´',
|
| | | last_access_time datetime comment 'sessionæåè®¿é®æ¶é´',
|
| | | expire_time int(5) default 0 comment 'è¶
æ¶æ¶é´ï¼åä½ä¸ºåé',
|
| | | primary key (sessionId)
|
| | | ) engine=innodb comment = 'å¨çº¿ç¨æ·è®°å½';
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 16ã宿¶ä»»å¡è°åº¦è¡¨
|
| | | -- ----------------------------
|
| | | drop table if exists sys_job;
|
| | | create table sys_job (
|
| | | job_id bigint(20) not null auto_increment comment 'ä»»å¡ID',
|
| | | job_name varchar(64) default '' comment 'ä»»å¡åç§°',
|
| | | job_group varchar(64) default 'DEFAULT' comment 'ä»»å¡ç»å',
|
| | | invoke_target varchar(500) not null comment 'è°ç¨ç®æ å符串',
|
| | | cron_expression varchar(255) default '' comment 'cronæ§è¡è¡¨è¾¾å¼',
|
| | | misfire_policy varchar(20) default '3' comment 'è®¡åæ§è¡é误çç¥ï¼1ç«å³æ§è¡ 2æ§è¡ä¸æ¬¡ 3æ¾å¼æ§è¡ï¼',
|
| | | concurrent char(1) default '1' comment 'æ¯å¦å¹¶åæ§è¡ï¼0å
许 1ç¦æ¢ï¼',
|
| | | status char(1) default '0' comment 'ç¶æï¼0æ£å¸¸ 1æåï¼',
|
| | | create_by varchar(64) default '' comment 'å建è
',
|
| | | create_time datetime comment 'å建æ¶é´',
|
| | | update_by varchar(64) default '' comment 'æ´æ°è
',
|
| | | update_time datetime comment 'æ´æ°æ¶é´',
|
| | | remark varchar(500) default '' comment '夿³¨ä¿¡æ¯',
|
| | | primary key (job_id, job_name, job_group)
|
| | | ) engine=innodb auto_increment=100 comment = '宿¶ä»»å¡è°åº¦è¡¨';
|
| | |
|
| | | insert into sys_job values(1, 'ç³»ç»é»è®¤ï¼æ åï¼', 'DEFAULT', 'ryTask.ryNoParams', '0/10 * * * * ?', '3', '1', '1', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_job values(2, 'ç³»ç»é»è®¤ï¼æåï¼', 'DEFAULT', 'ryTask.ryParams(\'ry\')', '0/15 * * * * ?', '3', '1', '1', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | | insert into sys_job values(3, 'ç³»ç»é»è®¤ï¼å¤åï¼', 'DEFAULT', 'ryTask.ryMultipleParams(\'ry\', true, 2000L, 316.50D, 100)', '0/20 * * * * ?', '3', '1', '1', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 17ã宿¶ä»»å¡è°åº¦æ¥å¿è¡¨
|
| | | -- ----------------------------
|
| | | drop table if exists sys_job_log;
|
| | | create table sys_job_log (
|
| | | job_log_id bigint(20) not null auto_increment comment '任塿¥å¿ID',
|
| | | job_name varchar(64) not null comment 'ä»»å¡åç§°',
|
| | | job_group varchar(64) not null comment 'ä»»å¡ç»å',
|
| | | invoke_target varchar(500) not null comment 'è°ç¨ç®æ å符串',
|
| | | job_message varchar(500) comment 'æ¥å¿ä¿¡æ¯',
|
| | | status char(1) default '0' comment 'æ§è¡ç¶æï¼0æ£å¸¸ 1失败ï¼',
|
| | | exception_info varchar(2000) default '' comment 'å¼å¸¸ä¿¡æ¯',
|
| | | create_time datetime comment 'å建æ¶é´',
|
| | | primary key (job_log_id)
|
| | | ) engine=innodb comment = '宿¶ä»»å¡è°åº¦æ¥å¿è¡¨';
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 18ãéç¥å
¬å表
|
| | | -- ----------------------------
|
| | | drop table if exists sys_notice;
|
| | | create table sys_notice (
|
| | | notice_id int(4) not null auto_increment comment 'å
ŒID',
|
| | | notice_title varchar(50) not null comment 'å
¬åæ é¢',
|
| | | notice_type char(1) not null comment 'å
¬åç±»åï¼1éç¥ 2å
¬åï¼',
|
| | | notice_content varchar(2000) default null comment 'å
¬åå
容',
|
| | | status char(1) default '0' comment 'å
¬åç¶æï¼0æ£å¸¸ 1å
³éï¼',
|
| | | create_by varchar(64) default '' comment 'å建è
',
|
| | | create_time datetime comment 'å建æ¶é´',
|
| | | update_by varchar(64) default '' comment 'æ´æ°è
',
|
| | | update_time datetime comment 'æ´æ°æ¶é´',
|
| | | remark varchar(255) default null comment '夿³¨',
|
| | | primary key (notice_id)
|
| | | ) engine=innodb auto_increment=10 comment = 'éç¥å
¬å表';
|
| | |
|
| | | -- ----------------------------
|
| | | -- åå§å-å
¬åä¿¡æ¯è¡¨æ°æ®
|
| | | -- ----------------------------
|
| | | insert into sys_notice values('1', '温馨æéï¼2018-07-01 è¥ä¾æ°çæ¬åå¸å¦', '2', 'æ°çæ¬å
容', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管çå');
|
| | | insert into sys_notice values('2', 'ç»´æ¤éç¥ï¼2018-07-01 è¥ä¾ç³»ç»åæ¨ç»´æ¤', '1', 'ç»´æ¤å
容', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管çå');
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 19ã代ç çæä¸å¡è¡¨
|
| | | -- ----------------------------
|
| | | drop table if exists gen_table;
|
| | | create table gen_table (
|
| | | table_id bigint(20) not null auto_increment comment 'ç¼å·',
|
| | | table_name varchar(200) default '' comment '表åç§°',
|
| | | table_comment varchar(500) default '' comment '表æè¿°',
|
| | | class_name varchar(100) default '' comment 'å®ä½ç±»åç§°',
|
| | | tpl_category varchar(200) default 'crud' comment '使ç¨ç模æ¿ï¼crudå表æä½ treeæ 表æä½ï¼',
|
| | | package_name varchar(100) comment 'çæå
è·¯å¾',
|
| | | module_name varchar(30) comment 'çææ¨¡åå',
|
| | | business_name varchar(30) comment 'çæä¸å¡å',
|
| | | function_name varchar(50) comment 'çæåè½å',
|
| | | function_author varchar(50) comment 'çæåè½ä½è
',
|
| | | options varchar(1000) comment 'å
¶å®çæé项',
|
| | | create_by varchar(64) default '' comment 'å建è
',
|
| | | create_time datetime comment 'å建æ¶é´',
|
| | | update_by varchar(64) default '' comment 'æ´æ°è
',
|
| | | update_time datetime comment 'æ´æ°æ¶é´',
|
| | | remark varchar(500) default null comment '夿³¨',
|
| | | primary key (table_id)
|
| | | ) engine=innodb auto_increment=1 comment = '代ç çæä¸å¡è¡¨';
|
| | |
|
| | |
|
| | | -- ----------------------------
|
| | | -- 20ã代ç çæä¸å¡è¡¨å段
|
| | | -- ----------------------------
|
| | | drop table if exists gen_table_column;
|
| | | create table gen_table_column (
|
| | | column_id bigint(20) not null auto_increment comment 'ç¼å·',
|
| | | table_id varchar(64) comment 'å½å±è¡¨ç¼å·',
|
| | | column_name varchar(200) comment 'ååç§°',
|
| | | column_comment varchar(500) comment 'åæè¿°',
|
| | | column_type varchar(100) comment 'åç±»å',
|
| | | java_type varchar(500) comment 'JAVAç±»å',
|
| | | java_field varchar(200) comment 'JAVAåæ®µå',
|
| | | is_pk char(1) comment 'æ¯å¦ä¸»é®ï¼1æ¯ï¼',
|
| | | is_increment char(1) comment 'æ¯å¦èªå¢ï¼1æ¯ï¼',
|
| | | is_required char(1) comment 'æ¯å¦å¿
å¡«ï¼1æ¯ï¼',
|
| | | is_insert char(1) comment 'æ¯å¦ä¸ºæå
¥å段ï¼1æ¯ï¼',
|
| | | is_edit char(1) comment 'æ¯å¦ç¼è¾å段ï¼1æ¯ï¼',
|
| | | is_list char(1) comment 'æ¯å¦åè¡¨åæ®µï¼1æ¯ï¼',
|
| | | is_query char(1) comment 'æ¯å¦æ¥è¯¢å段ï¼1æ¯ï¼',
|
| | | query_type varchar(200) default 'EQ' comment 'æ¥è¯¢æ¹å¼ï¼çäºãä¸çäºã大äºãå°äºãèå´ï¼',
|
| | | html_type varchar(200) comment 'æ¾ç¤ºç±»åï¼ææ¬æ¡ãææ¬åã䏿æ¡ãå¤éæ¡ãåéæ¡ãæ¥ææ§ä»¶ï¼',
|
| | | dict_type varchar(200) default '' comment 'åå
¸ç±»å',
|
| | | sort int comment 'æåº',
|
| | | create_by varchar(64) default '' comment 'å建è
',
|
| | | create_time datetime comment 'å建æ¶é´',
|
| | | update_by varchar(64) default '' comment 'æ´æ°è
',
|
| | | update_time datetime comment 'æ´æ°æ¶é´',
|
| | | primary key (column_id)
|
| | | ) engine=innodb auto_increment=1 comment = '代ç çæä¸å¡è¡¨å段'; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi;
|
| | |
|
| | | import org.springframework.boot.SpringApplication;
|
| | | import org.springframework.boot.autoconfigure.SpringBootApplication;
|
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
| | |
|
| | | /**
|
| | | * å¯å¨ç¨åº
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
| | | public class RuoYiApplication
|
| | | {
|
| | | public static void main(String[] args)
|
| | | {
|
| | | // System.setProperty("spring.devtools.restart.enabled", "false");
|
| | | SpringApplication.run(RuoYiApplication.class, args);
|
| | | System.out.println("(â¥â â¿â )ï¾ï¾ è¥ä¾å¯å¨æå á(´ڡ`á)ï¾ \n" +
|
| | | " .-------. ____ __ \n" +
|
| | | " | _ _ \\ \\ \\ / / \n" +
|
| | | " | ( ' ) | \\ _. / ' \n" +
|
| | | " |(_ o _) / _( )_ .' \n" +
|
| | | " | (_,_).' __ ___(_ o _)' \n" +
|
| | | " | |\\ \\ | || |(_,_)' \n" +
|
| | | " | | \\ `' /| `-' / \n" +
|
| | | " | | \\ / \\ / \n" +
|
| | | " ''-' `'-' `-..-' ");
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi;
|
| | |
|
| | | import org.springframework.boot.builder.SpringApplicationBuilder;
|
| | | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
| | |
|
| | | /**
|
| | | * web容å¨ä¸è¿è¡é¨ç½²
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class RuoYiServletInitializer extends SpringBootServletInitializer
|
| | | {
|
| | | @Override
|
| | | protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
|
| | | {
|
| | | return application.sources(RuoYiApplication.class);
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.constant;
|
| | |
|
| | | import io.jsonwebtoken.Claims;
|
| | |
|
| | | /**
|
| | | * éç¨å¸¸éä¿¡æ¯
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class Constants
|
| | | {
|
| | | /**
|
| | | * éç¨æåæ è¯
|
| | | */
|
| | | public static final String SUCCESS = "0";
|
| | |
|
| | | /**
|
| | | * éç¨å¤±è´¥æ è¯
|
| | | */
|
| | | public static final String FAIL = "1";
|
| | |
|
| | | /**
|
| | | * ç»å½æå
|
| | | */
|
| | | public static final String LOGIN_SUCCESS = "Success";
|
| | |
|
| | | /**
|
| | | * 注é
|
| | | */
|
| | | public static final String LOGOUT = "Logout";
|
| | |
|
| | | /**
|
| | | * ç»å½å¤±è´¥
|
| | | */
|
| | | public static final String LOGIN_FAIL = "Error";
|
| | |
|
| | | /**
|
| | | * éªè¯ç redis key
|
| | | */
|
| | | public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
|
| | |
|
| | | /**
|
| | | * ç»å½ç¨æ· redis key
|
| | | */
|
| | | public static final String LOGIN_TOKEN_KEY = "login_tokens:";
|
| | |
|
| | | /**
|
| | | * éªè¯ç æææï¼åéï¼
|
| | | */
|
| | | public static final Integer CAPTCHA_EXPIRATION = 2;
|
| | |
|
| | | /**
|
| | | * 令ç
|
| | | */
|
| | | public static final String TOKEN = "token";
|
| | |
|
| | | /**
|
| | | * 令çåç¼
|
| | | */
|
| | | public static final String TOKEN_PREFIX = "Bearer ";
|
| | |
|
| | | /**
|
| | | * 令çåç¼
|
| | | */
|
| | | public static final String LOGIN_USER_KEY = "login_user_key";
|
| | |
|
| | | /**
|
| | | * ç¨æ·ID
|
| | | */
|
| | | public static final String JWT_USERID = "userid";
|
| | |
|
| | | /**
|
| | | * ç¨æ·åç§°
|
| | | */
|
| | | public static final String JWT_USERNAME = Claims.SUBJECT;
|
| | |
|
| | | /**
|
| | | * ç¨æ·å¤´å
|
| | | */
|
| | | public static final String JWT_AVATAR = "avatar";
|
| | |
|
| | | /**
|
| | | * å建æ¶é´
|
| | | */
|
| | | public static final String JWT_CREATED = "created";
|
| | |
|
| | | /**
|
| | | * ç¨æ·æé
|
| | | */
|
| | | public static final String JWT_AUTHORITIES = "authorities";
|
| | |
|
| | | /**
|
| | | * èµæºæ å°è·¯å¾ åç¼
|
| | | */
|
| | | public static final String RESOURCE_PREFIX = "/profile";
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.constant;
|
| | |
|
| | | /**
|
| | | * è¿åç¶æç
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public interface HttpStatus
|
| | | {
|
| | | /**
|
| | | * æä½æå
|
| | | */
|
| | | public static final int SUCCESS = 200;
|
| | |
|
| | | /**
|
| | | * 对象å建æå
|
| | | */
|
| | | public static final int CREATED = 201;
|
| | |
|
| | | /**
|
| | | * 请æ±å·²ç»è¢«æ¥å
|
| | | */
|
| | | public static final int ACCEPTED = 202;
|
| | |
|
| | | /**
|
| | | * æä½å·²ç»æ§è¡æåï¼ä½æ¯æ²¡æè¿åæ°æ®
|
| | | */
|
| | | public static final int NO_CONTENT = 204;
|
| | |
|
| | | /**
|
| | | * èµæºå·²è¢«ç§»é¤
|
| | | */
|
| | | public static final int MOVED_PERM = 301;
|
| | |
|
| | | /**
|
| | | * éå®å
|
| | | */
|
| | | public static final int SEE_OTHER = 303;
|
| | |
|
| | | /**
|
| | | * èµæºæ²¡æè¢«ä¿®æ¹
|
| | | */
|
| | | public static final int NOT_MODIFIED = 304;
|
| | |
|
| | | /**
|
| | | * åæ°å表é误ï¼ç¼ºå°ï¼æ ¼å¼ä¸å¹é
ï¼
|
| | | */
|
| | | public static final int BAD_REQUEST = 400;
|
| | |
|
| | | /**
|
| | | * æªææ
|
| | | */
|
| | | public static final int UNAUTHORIZED = 401;
|
| | |
|
| | | /**
|
| | | * 访é®åéï¼ææè¿æ
|
| | | */
|
| | | public static final int FORBIDDEN = 403;
|
| | |
|
| | | /**
|
| | | * èµæºï¼æå¡æªæ¾å°
|
| | | */
|
| | | public static final int NOT_FOUND = 404;
|
| | |
|
| | | /**
|
| | | * ä¸å
许çhttpæ¹æ³
|
| | | */
|
| | | public static final int BAD_METHOD = 405;
|
| | |
|
| | | /**
|
| | | * èµæºå²çªï¼æè
èµæºè¢«é
|
| | | */
|
| | | public static final int CONFLICT = 409;
|
| | |
|
| | | /**
|
| | | * 䏿¯æçæ°æ®ï¼åªä½ç±»å
|
| | | */
|
| | | public static final int UNSUPPORTED_TYPE = 415;
|
| | |
|
| | | /**
|
| | | * ç³»ç»å
é¨é误
|
| | | */
|
| | | public static final int ERROR = 500;
|
| | |
|
| | | /**
|
| | | * æ¥å£æªå®ç°
|
| | | */
|
| | | public static final int NOT_IMPLEMENTED = 501;
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.constant;
|
| | |
|
| | | /**
|
| | | * ç¨æ·å¸¸éä¿¡æ¯
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class UserConstants
|
| | | {
|
| | | /**
|
| | | * å¹³å°å
ç³»ç»ç¨æ·çå¯ä¸æ å¿
|
| | | */
|
| | | public static final String SYS_USER = "SYS_USER";
|
| | |
|
| | | /** æ£å¸¸ç¶æ */
|
| | | public static final String NORMAL = "0";
|
| | |
|
| | | /** å¼å¸¸ç¶æ */
|
| | | public static final String EXCEPTION = "1";
|
| | |
|
| | | /** ç¨æ·å°ç¦ç¶æ */
|
| | | public static final String USER_BLOCKED = "1";
|
| | |
|
| | | /** è§è²å°ç¦ç¶æ */
|
| | | public static final String ROLE_BLOCKED = "1";
|
| | |
|
| | | /** é¨é¨æ£å¸¸ç¶æ */
|
| | | public static final String DEPT_NORMAL = "0";
|
| | |
|
| | | /** åå
¸æ£å¸¸ç¶æ */
|
| | | public static final String DICT_NORMAL = "0";
|
| | |
|
| | | /** æ¯å¦ä¸ºç³»ç»é»è®¤ï¼æ¯ï¼ */
|
| | | public static final String YES = "Y";
|
| | |
|
| | | /** æ ¡éªè¿åç»æç */
|
| | | public final static String UNIQUE = "0";
|
| | | public final static String NOT_UNIQUE = "1";
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.lang;
|
| | |
|
| | | import java.security.MessageDigest;
|
| | | import java.security.NoSuchAlgorithmException;
|
| | | import java.security.SecureRandom;
|
| | | import java.util.Random;
|
| | | import java.util.concurrent.ThreadLocalRandom;
|
| | | import com.ruoyi.common.exception.UtilException;
|
| | |
|
| | | /**
|
| | | * æä¾éç¨å¯ä¸è¯å«ç ï¼universally unique identifierï¼ï¼UUIDï¼å®ç°
|
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | public final class UUID implements java.io.Serializable, Comparable<UUID>
|
| | | {
|
| | | private static final long serialVersionUID = -1185015143654744140L;
|
| | |
|
| | | /**
|
| | | * SecureRandom çåä¾
|
| | | *
|
| | | */
|
| | | private static class Holder
|
| | | {
|
| | | static final SecureRandom numberGenerator = getSecureRandom();
|
| | | }
|
| | |
|
| | | /** æ¤UUIDçæé«64ææä½ */
|
| | | private final long mostSigBits;
|
| | |
|
| | | /** æ¤UUIDçæä½64ææä½ */
|
| | | private final long leastSigBits;
|
| | |
|
| | | /**
|
| | | * ç§ææé
|
| | | * |
| | | * @param data æ°æ®
|
| | | */
|
| | | private UUID(byte[] data)
|
| | | {
|
| | | long msb = 0;
|
| | | long lsb = 0;
|
| | | assert data.length == 16 : "data must be 16 bytes in length";
|
| | | for (int i = 0; i < 8; i++)
|
| | | {
|
| | | msb = (msb << 8) | (data[i] & 0xff);
|
| | | }
|
| | | for (int i = 8; i < 16; i++)
|
| | | {
|
| | | lsb = (lsb << 8) | (data[i] & 0xff);
|
| | | }
|
| | | this.mostSigBits = msb;
|
| | | this.leastSigBits = lsb;
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä½¿ç¨æå®çæ°æ®æé æ°ç UUIDã
|
| | | *
|
| | | * @param mostSigBits ç¨äº {@code UUID} çæé«ææ 64 ä½
|
| | | * @param leastSigBits ç¨äº {@code UUID} çæä½ææ 64 ä½
|
| | | */
|
| | | public UUID(long mostSigBits, long leastSigBits)
|
| | | {
|
| | | this.mostSigBits = mostSigBits;
|
| | | this.leastSigBits = leastSigBits;
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åç±»å 4ï¼ä¼ªéæºçæçï¼UUID çéæå·¥åã 使ç¨å å¯çæ¬å°çº¿ç¨ä¼ªéæºæ°çæå¨çæè¯¥ UUIDã
|
| | | * |
| | | * @return éæºçæç {@code UUID}
|
| | | */
|
| | | public static UUID fastUUID()
|
| | | {
|
| | | return randomUUID(false);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åç±»å 4ï¼ä¼ªéæºçæçï¼UUID çéæå·¥åã 使ç¨å å¯çå¼ºä¼ªéæºæ°çæå¨çæè¯¥ UUIDã
|
| | | * |
| | | * @return éæºçæç {@code UUID}
|
| | | */
|
| | | public static UUID randomUUID()
|
| | | {
|
| | | return randomUUID(true);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åç±»å 4ï¼ä¼ªéæºçæçï¼UUID çéæå·¥åã 使ç¨å å¯çå¼ºä¼ªéæºæ°çæå¨çæè¯¥ UUIDã
|
| | | * |
| | | * @param isSecure æ¯å¦ä½¿ç¨{@link SecureRandom}妿æ¯å¯ä»¥è·å¾æ´å®å
¨çéæºç ï¼å¦åå¯ä»¥å¾å°æ´å¥½çæ§è½
|
| | | * @return éæºçæç {@code UUID}
|
| | | */
|
| | | public static UUID randomUUID(boolean isSecure)
|
| | | {
|
| | | final Random ng = isSecure ? Holder.numberGenerator : getRandom();
|
| | |
|
| | | byte[] randomBytes = new byte[16];
|
| | | ng.nextBytes(randomBytes);
|
| | | randomBytes[6] &= 0x0f; /* clear version */
|
| | | randomBytes[6] |= 0x40; /* set to version 4 */
|
| | | randomBytes[8] &= 0x3f; /* clear variant */
|
| | | randomBytes[8] |= 0x80; /* set to IETF variant */
|
| | | return new UUID(randomBytes);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®æå®çåèæ°ç»è·åç±»å 3ï¼åºäºåç§°çï¼UUID çéæå·¥åã
|
| | | *
|
| | | * @param name ç¨äºæé UUID çåèæ°ç»ã
|
| | | *
|
| | | * @return æ ¹æ®æå®æ°ç»çæç {@code UUID}
|
| | | */
|
| | | public static UUID nameUUIDFromBytes(byte[] name)
|
| | | {
|
| | | MessageDigest md;
|
| | | try
|
| | | {
|
| | | md = MessageDigest.getInstance("MD5");
|
| | | }
|
| | | catch (NoSuchAlgorithmException nsae)
|
| | | {
|
| | | throw new InternalError("MD5 not supported");
|
| | | }
|
| | | byte[] md5Bytes = md.digest(name);
|
| | | md5Bytes[6] &= 0x0f; /* clear version */
|
| | | md5Bytes[6] |= 0x30; /* set to version 3 */
|
| | | md5Bytes[8] &= 0x3f; /* clear variant */
|
| | | md5Bytes[8] |= 0x80; /* set to IETF variant */
|
| | | return new UUID(md5Bytes);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ® {@link #toString()} æ¹æ³ä¸æè¿°çå符串æ å表示形å¼å建{@code UUID}ã
|
| | | *
|
| | | * @param name æå® {@code UUID} å符串
|
| | | * @return å
·ææå®å¼ç {@code UUID}
|
| | | * @throws IllegalArgumentException 妿 name ä¸ {@link #toString} ä¸æè¿°çå符串表示形å¼ä¸ç¬¦æåºæ¤å¼å¸¸
|
| | | *
|
| | | */
|
| | | public static UUID fromString(String name)
|
| | | {
|
| | | String[] components = name.split("-");
|
| | | if (components.length != 5)
|
| | | {
|
| | | throw new IllegalArgumentException("Invalid UUID string: " + name);
|
| | | }
|
| | | for (int i = 0; i < 5; i++)
|
| | | {
|
| | | components[i] = "0x" + components[i];
|
| | | }
|
| | |
|
| | | long mostSigBits = Long.decode(components[0]).longValue();
|
| | | mostSigBits <<= 16;
|
| | | mostSigBits |= Long.decode(components[1]).longValue();
|
| | | mostSigBits <<= 16;
|
| | | mostSigBits |= Long.decode(components[2]).longValue();
|
| | |
|
| | | long leastSigBits = Long.decode(components[3]).longValue();
|
| | | leastSigBits <<= 48;
|
| | | leastSigBits |= Long.decode(components[4]).longValue();
|
| | |
|
| | | return new UUID(mostSigBits, leastSigBits);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è¿åæ¤ UUID ç 128 ä½å¼ä¸çæä½ææ 64 ä½ã
|
| | | *
|
| | | * @return æ¤ UUID ç 128 ä½å¼ä¸çæä½ææ 64 ä½ã
|
| | | */
|
| | | public long getLeastSignificantBits()
|
| | | {
|
| | | return leastSigBits;
|
| | | }
|
| | |
|
| | | /**
|
| | | * è¿åæ¤ UUID ç 128 ä½å¼ä¸çæé«ææ 64 ä½ã
|
| | | *
|
| | | * @return æ¤ UUID ç 128 ä½å¼ä¸æé«ææ 64 ä½ã
|
| | | */
|
| | | public long getMostSignificantBits()
|
| | | {
|
| | | return mostSigBits;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 䏿¤ {@code UUID} ç¸å
³èççæ¬å·. çæ¬å·æè¿°æ¤ {@code UUID} æ¯å¦ä½çæçã
|
| | | * <p>
|
| | | * çæ¬å·å
·æä»¥ä¸å«æ:
|
| | | * <ul>
|
| | | * <li>1 åºäºæ¶é´ç UUID
|
| | | * <li>2 DCE å®å
¨ UUID
|
| | | * <li>3 åºäºåç§°ç UUID
|
| | | * <li>4 éæºçæç UUID
|
| | | * </ul>
|
| | | *
|
| | | * @return æ¤ {@code UUID} ççæ¬å·
|
| | | */
|
| | | public int version()
|
| | | {
|
| | | // Version is bits masked by 0x000000000000F000 in MS long
|
| | | return (int) ((mostSigBits >> 12) & 0x0f);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 䏿¤ {@code UUID} ç¸å
³èçåä½å·ãåä½å·æè¿° {@code UUID} çå¸å±ã
|
| | | * <p>
|
| | | * åä½å·å
·æä»¥ä¸å«æï¼
|
| | | * <ul>
|
| | | * <li>0 为 NCS ååå
¼å®¹ä¿ç
|
| | | * <li>2 <a href="http://www.ietf.org/rfc/rfc4122.txt">IETF RFC 4122</a>(Leach-Salz), ç¨äºæ¤ç±»
|
| | | * <li>6 ä¿çï¼å¾®è½¯ååå
¼å®¹
|
| | | * <li>7 ä¿çä¾ä»¥åå®ä¹ä½¿ç¨
|
| | | * </ul>
|
| | | *
|
| | | * @return æ¤ {@code UUID} ç¸å
³èçåä½å·
|
| | | */
|
| | | public int variant()
|
| | | {
|
| | | // This field is composed of a varying number of bits.
|
| | | // 0 - - Reserved for NCS backward compatibility
|
| | | // 1 0 - The IETF aka Leach-Salz variant (used by this class)
|
| | | // 1 1 0 Reserved, Microsoft backward compatibility
|
| | | // 1 1 1 Reserved for future definition.
|
| | | return (int) ((leastSigBits >>> (64 - (leastSigBits >>> 62))) & (leastSigBits >> 63));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 䏿¤ UUID ç¸å
³èçæ¶é´æ³å¼ã
|
| | | *
|
| | | * <p>
|
| | | * 60 ä½çæ¶é´æ³å¼æ ¹æ®æ¤ {@code UUID} ç time_lowãtime_mid å time_hi åæ®µæé ã<br>
|
| | | * æå¾å°çæ¶é´æ³ä»¥ 100 毫微ç§ä¸ºåä½ï¼ä» UTCï¼éç¨åè°æ¶é´ï¼ 1582 å¹´ 10 æ 15 æ¥é¶æ¶å¼å§ã
|
| | | *
|
| | | * <p>
|
| | | * æ¶é´æ³å¼ä»
å¨å¨åºäºæ¶é´ç UUIDï¼å
¶ version ç±»å为 1ï¼ä¸æææä¹ã<br>
|
| | | * å¦ææ¤ {@code UUID} 䏿¯åºäºæ¶é´ç UUIDï¼åæ¤æ¹æ³æåº UnsupportedOperationExceptionã
|
| | | *
|
| | | * @throws UnsupportedOperationException å¦ææ¤ {@code UUID} 䏿¯ version 为 1 ç UUIDã
|
| | | */
|
| | | public long timestamp() throws UnsupportedOperationException
|
| | | {
|
| | | checkTimeBase();
|
| | | return (mostSigBits & 0x0FFFL) << 48//
|
| | | | ((mostSigBits >> 16) & 0x0FFFFL) << 32//
|
| | | | mostSigBits >>> 32;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 䏿¤ UUID ç¸å
³èçæ¶éåºåå¼ã
|
| | | *
|
| | | * <p>
|
| | | * 14 ä½çæ¶éåºå弿 ¹æ®æ¤ UUID ç clock_seq åæ®µæé ãclock_seq åæ®µç¨äºä¿è¯å¨åºäºæ¶é´ç UUID ä¸çæ¶é´å¯ä¸æ§ã
|
| | | * <p>
|
| | | * {@code clockSequence} å¼ä»
å¨åºäºæ¶é´ç UUIDï¼å
¶ version ç±»å为 1ï¼ä¸æææä¹ã å¦ææ¤ UUID 䏿¯åºäºæ¶é´ç UUIDï¼åæ¤æ¹æ³æåº
|
| | | * UnsupportedOperationExceptionã
|
| | | *
|
| | | * @return æ¤ {@code UUID} çæ¶éåºå
|
| | | *
|
| | | * @throws UnsupportedOperationException å¦ææ¤ UUID ç version ä¸ä¸º 1
|
| | | */
|
| | | public int clockSequence() throws UnsupportedOperationException
|
| | | {
|
| | | checkTimeBase();
|
| | | return (int) ((leastSigBits & 0x3FFF000000000000L) >>> 48);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 䏿¤ UUID ç¸å
³çèç¹å¼ã
|
| | | *
|
| | | * <p>
|
| | | * 48 ä½çèç¹å¼æ ¹æ®æ¤ UUID ç node åæ®µæé ãæ¤åæ®µæ¨å¨ç¨äºä¿åæºå¨ç IEEE 802 å°åï¼è¯¥å°åç¨äºçææ¤ UUID 以ä¿è¯ç©ºé´å¯ä¸æ§ã
|
| | | * <p>
|
| | | * èç¹å¼ä»
å¨åºäºæ¶é´ç UUIDï¼å
¶ version ç±»å为 1ï¼ä¸æææä¹ã<br>
|
| | | * å¦ææ¤ UUID 䏿¯åºäºæ¶é´ç UUIDï¼åæ¤æ¹æ³æåº UnsupportedOperationExceptionã
|
| | | *
|
| | | * @return æ¤ {@code UUID} çèç¹å¼
|
| | | *
|
| | | * @throws UnsupportedOperationException å¦ææ¤ UUID ç version ä¸ä¸º 1
|
| | | */
|
| | | public long node() throws UnsupportedOperationException
|
| | | {
|
| | | checkTimeBase();
|
| | | return leastSigBits & 0x0000FFFFFFFFFFFFL;
|
| | | }
|
| | |
|
| | | /**
|
| | | * è¿åæ¤{@code UUID} çå符串表ç°å½¢å¼ã
|
| | | *
|
| | | * <p>
|
| | | * UUID çå符串表示形å¼ç±æ¤ BNF æè¿°ï¼
|
| | | * |
| | | * <pre>
|
| | | * {@code
|
| | | * UUID = <time_low>-<time_mid>-<time_high_and_version>-<variant_and_sequence>-<node>
|
| | | * time_low = 4*<hexOctet>
|
| | | * time_mid = 2*<hexOctet>
|
| | | * time_high_and_version = 2*<hexOctet>
|
| | | * variant_and_sequence = 2*<hexOctet>
|
| | | * node = 6*<hexOctet>
|
| | | * hexOctet = <hexDigit><hexDigit>
|
| | | * hexDigit = [0-9a-fA-F]
|
| | | * }
|
| | | * </pre>
|
| | | * |
| | | * </blockquote>
|
| | | *
|
| | | * @return æ¤{@code UUID} çå符串表ç°å½¢å¼
|
| | | * @see #toString(boolean)
|
| | | */
|
| | | @Override
|
| | | public String toString()
|
| | | {
|
| | | return toString(false);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è¿åæ¤{@code UUID} çå符串表ç°å½¢å¼ã
|
| | | *
|
| | | * <p>
|
| | | * UUID çå符串表示形å¼ç±æ¤ BNF æè¿°ï¼
|
| | | * |
| | | * <pre>
|
| | | * {@code
|
| | | * UUID = <time_low>-<time_mid>-<time_high_and_version>-<variant_and_sequence>-<node>
|
| | | * time_low = 4*<hexOctet>
|
| | | * time_mid = 2*<hexOctet>
|
| | | * time_high_and_version = 2*<hexOctet>
|
| | | * variant_and_sequence = 2*<hexOctet>
|
| | | * node = 6*<hexOctet>
|
| | | * hexOctet = <hexDigit><hexDigit>
|
| | | * hexDigit = [0-9a-fA-F]
|
| | | * }
|
| | | * </pre>
|
| | | * |
| | | * </blockquote>
|
| | | *
|
| | | * @param isSimple æ¯å¦ç®å模å¼ï¼ç®å模å¼ä¸ºä¸å¸¦'-'çUUIDå符串
|
| | | * @return æ¤{@code UUID} çå符串表ç°å½¢å¼
|
| | | */
|
| | | public String toString(boolean isSimple)
|
| | | {
|
| | | final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36);
|
| | | // time_low
|
| | | builder.append(digits(mostSigBits >> 32, 8));
|
| | | if (false == isSimple)
|
| | | {
|
| | | builder.append('-');
|
| | | }
|
| | | // time_mid
|
| | | builder.append(digits(mostSigBits >> 16, 4));
|
| | | if (false == isSimple)
|
| | | {
|
| | | builder.append('-');
|
| | | }
|
| | | // time_high_and_version
|
| | | builder.append(digits(mostSigBits, 4));
|
| | | if (false == isSimple)
|
| | | {
|
| | | builder.append('-');
|
| | | }
|
| | | // variant_and_sequence
|
| | | builder.append(digits(leastSigBits >> 48, 4));
|
| | | if (false == isSimple)
|
| | | {
|
| | | builder.append('-');
|
| | | }
|
| | | // node
|
| | | builder.append(digits(leastSigBits, 12));
|
| | |
|
| | | return builder.toString();
|
| | | }
|
| | |
|
| | | /**
|
| | | * è¿åæ¤ UUID çåå¸ç ã
|
| | | *
|
| | | * @return UUID çåå¸ç å¼ã
|
| | | */
|
| | | public int hashCode()
|
| | | {
|
| | | long hilo = mostSigBits ^ leastSigBits;
|
| | | return ((int) (hilo >> 32)) ^ (int) hilo;
|
| | | }
|
| | |
|
| | | /**
|
| | | * å°æ¤å¯¹è±¡ä¸æå®å¯¹è±¡æ¯è¾ã
|
| | | * <p>
|
| | | * å½ä¸ä»
å½åæ°ä¸ä¸º {@code null}ãèæ¯ä¸ä¸ª UUID 对象ãå
·æä¸æ¤ UUID ç¸åç varriantãå
å«ç¸åçå¼ï¼æ¯ä¸ä½åç¸åï¼æ¶ï¼ç»ææä¸º {@code true}ã
|
| | | *
|
| | | * @param obj è¦ä¸ä¹æ¯è¾ç对象
|
| | | *
|
| | | * @return å¦æå¯¹è±¡ç¸åï¼åè¿å {@code true}ï¼å¦åè¿å {@code false}
|
| | | */
|
| | | public boolean equals(Object obj)
|
| | | {
|
| | | if ((null == obj) || (obj.getClass() != UUID.class))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | UUID id = (UUID) obj;
|
| | | return (mostSigBits == id.mostSigBits && leastSigBits == id.leastSigBits);
|
| | | }
|
| | |
|
| | | // Comparison Operations
|
| | |
|
| | | /**
|
| | | * å°æ¤ UUID 䏿å®ç UUID æ¯è¾ã
|
| | | *
|
| | | * <p>
|
| | | * å¦æä¸¤ä¸ª UUID ä¸åï¼ä¸ç¬¬ä¸ä¸ª UUID çæé«ææå段大äºç¬¬äºä¸ª UUID ç对åºå段ï¼å第ä¸ä¸ª UUID 大äºç¬¬äºä¸ª UUIDã
|
| | | *
|
| | | * @param val 䏿¤ UUID æ¯è¾ç UUID
|
| | | *
|
| | | * @return 卿¤ UUID å°äºãçäºæå¤§äº val æ¶ï¼åå«è¿å -1ã0 æ 1ã
|
| | | *
|
| | | */
|
| | | public int compareTo(UUID val)
|
| | | {
|
| | | // The ordering is intentionally set up so that the UUIDs
|
| | | // can simply be numerically compared as two numbers
|
| | | return (this.mostSigBits < val.mostSigBits ? -1 : //
|
| | | (this.mostSigBits > val.mostSigBits ? 1 : //
|
| | | (this.leastSigBits < val.leastSigBits ? -1 : //
|
| | | (this.leastSigBits > val.leastSigBits ? 1 : //
|
| | | 0))));
|
| | | }
|
| | |
|
| | | // -------------------------------------------------------------------------------------------------------------------
|
| | | // Private method start
|
| | | /**
|
| | | * è¿åæå®æ°å对åºçhexå¼
|
| | | * |
| | | * @param val å¼
|
| | | * @param digits ä½
|
| | | * @return å¼
|
| | | */
|
| | | private static String digits(long val, int digits)
|
| | | {
|
| | | long hi = 1L << (digits * 4);
|
| | | return Long.toHexString(hi | (val & (hi - 1))).substring(1);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ£æ¥æ¯å¦ä¸ºtime-basedçæ¬UUID
|
| | | */
|
| | | private void checkTimeBase()
|
| | | {
|
| | | if (version() != 1)
|
| | | {
|
| | | throw new UnsupportedOperationException("Not a time-based UUID");
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·å{@link SecureRandom}ï¼ç±»æä¾å å¯çå¼ºéæºæ°çæå¨ (RNG)
|
| | | * |
| | | * @return {@link SecureRandom}
|
| | | */
|
| | | public static SecureRandom getSecureRandom()
|
| | | {
|
| | | try
|
| | | {
|
| | | return SecureRandom.getInstance("SHA1PRNG");
|
| | | }
|
| | | catch (NoSuchAlgorithmException e)
|
| | | {
|
| | | throw new UtilException(e);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åéæºæ°çæå¨å¯¹è±¡<br>
|
| | | * ThreadLocalRandomæ¯JDK 7ä¹åæä¾å¹¶å产çéæºæ°ï¼è½å¤è§£å³å¤ä¸ªçº¿ç¨åççç«äºäºå¤ºã
|
| | | * |
| | | * @return {@link ThreadLocalRandom}
|
| | | */
|
| | | public static ThreadLocalRandom getRandom()
|
| | | {
|
| | | return ThreadLocalRandom.current();
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.text;
|
| | |
|
| | | import java.nio.charset.Charset;
|
| | | import java.nio.charset.StandardCharsets;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | |
|
| | | /**
|
| | | * å符éå·¥å
·ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class CharsetKit
|
| | | {
|
| | | /** ISO-8859-1 */
|
| | | public static final String ISO_8859_1 = "ISO-8859-1";
|
| | | /** UTF-8 */
|
| | | public static final String UTF_8 = "UTF-8";
|
| | | /** GBK */
|
| | | public static final String GBK = "GBK";
|
| | |
|
| | | /** ISO-8859-1 */
|
| | | public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1);
|
| | | /** UTF-8 */
|
| | | public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8);
|
| | | /** GBK */
|
| | | public static final Charset CHARSET_GBK = Charset.forName(GBK);
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºCharset对象
|
| | | * |
| | | * @param charset å符éï¼ä¸ºç©ºåè¿åé»è®¤å符é
|
| | | * @return Charset
|
| | | */
|
| | | public static Charset charset(String charset)
|
| | | {
|
| | | return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢å符串çå符éç¼ç
|
| | | * |
| | | * @param source å符串
|
| | | * @param srcCharset æºå符éï¼é»è®¤ISO-8859-1
|
| | | * @param destCharset ç®æ å符éï¼é»è®¤UTF-8
|
| | | * @return 转æ¢åçå符é
|
| | | */
|
| | | public static String convert(String source, String srcCharset, String destCharset)
|
| | | {
|
| | | return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢å符串çå符éç¼ç
|
| | | * |
| | | * @param source å符串
|
| | | * @param srcCharset æºå符éï¼é»è®¤ISO-8859-1
|
| | | * @param destCharset ç®æ å符éï¼é»è®¤UTF-8
|
| | | * @return 转æ¢åçå符é
|
| | | */
|
| | | public static String convert(String source, Charset srcCharset, Charset destCharset)
|
| | | {
|
| | | if (null == srcCharset)
|
| | | {
|
| | | srcCharset = StandardCharsets.ISO_8859_1;
|
| | | }
|
| | |
|
| | | if (null == destCharset)
|
| | | {
|
| | | srcCharset = StandardCharsets.UTF_8;
|
| | | }
|
| | |
|
| | | if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset))
|
| | | {
|
| | | return source;
|
| | | }
|
| | | return new String(source.getBytes(srcCharset), destCharset);
|
| | | }
|
| | |
|
| | | /**
|
| | | * @return ç³»ç»å符éç¼ç
|
| | | */
|
| | | public static String systemCharset()
|
| | | {
|
| | | return Charset.defaultCharset().name();
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.text;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.math.BigInteger;
|
| | | import java.nio.ByteBuffer;
|
| | | import java.nio.charset.Charset;
|
| | | import java.text.NumberFormat;
|
| | | import java.util.Set;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | |
|
| | | /**
|
| | | * ç±»å转æ¢å¨
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class Convert
|
| | | {
|
| | | /**
|
| | | * 转æ¢ä¸ºå符串<br>
|
| | | * 妿ç»å®çå¼ä¸ºnullï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @param defaultValue 转æ¢é误æ¶çé»è®¤å¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static String toStr(Object value, String defaultValue)
|
| | | {
|
| | | if (null == value)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | if (value instanceof String)
|
| | | {
|
| | | return (String) value;
|
| | | }
|
| | | return value.toString();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºå符串<br>
|
| | | * 妿ç»å®çå¼ä¸º<code>null</code>ï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<code>null</code><br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static String toStr(Object value)
|
| | | {
|
| | | return toStr(value, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºå符<br>
|
| | | * 妿ç»å®çå¼ä¸ºnullï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @param defaultValue 转æ¢é误æ¶çé»è®¤å¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Character toChar(Object value, Character defaultValue)
|
| | | {
|
| | | if (null == value)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | if (value instanceof Character)
|
| | | {
|
| | | return (Character) value;
|
| | | }
|
| | |
|
| | | final String valueStr = toStr(value, null);
|
| | | return StringUtils.isEmpty(valueStr) ? defaultValue : valueStr.charAt(0);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºå符<br>
|
| | | * 妿ç»å®çå¼ä¸º<code>null</code>ï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<code>null</code><br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Character toChar(Object value)
|
| | | {
|
| | | return toChar(value, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºbyte<br>
|
| | | * 妿ç»å®çå¼ä¸º<code>null</code>ï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @param defaultValue 转æ¢é误æ¶çé»è®¤å¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Byte toByte(Object value, Byte defaultValue)
|
| | | {
|
| | | if (value == null)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | if (value instanceof Byte)
|
| | | {
|
| | | return (Byte) value;
|
| | | }
|
| | | if (value instanceof Number)
|
| | | {
|
| | | return ((Number) value).byteValue();
|
| | | }
|
| | | final String valueStr = toStr(value, null);
|
| | | if (StringUtils.isEmpty(valueStr))
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | try
|
| | | {
|
| | | return Byte.parseByte(valueStr);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºbyte<br>
|
| | | * 妿ç»å®çå¼ä¸º<code>null</code>ï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<code>null</code><br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Byte toByte(Object value)
|
| | | {
|
| | | return toByte(value, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºShort<br>
|
| | | * 妿ç»å®çå¼ä¸º<code>null</code>ï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @param defaultValue 转æ¢é误æ¶çé»è®¤å¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Short toShort(Object value, Short defaultValue)
|
| | | {
|
| | | if (value == null)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | if (value instanceof Short)
|
| | | {
|
| | | return (Short) value;
|
| | | }
|
| | | if (value instanceof Number)
|
| | | {
|
| | | return ((Number) value).shortValue();
|
| | | }
|
| | | final String valueStr = toStr(value, null);
|
| | | if (StringUtils.isEmpty(valueStr))
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | try
|
| | | {
|
| | | return Short.parseShort(valueStr.trim());
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºShort<br>
|
| | | * 妿ç»å®çå¼ä¸º<code>null</code>ï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<code>null</code><br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Short toShort(Object value)
|
| | | {
|
| | | return toShort(value, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºNumber<br>
|
| | | * 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @param defaultValue 转æ¢é误æ¶çé»è®¤å¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Number toNumber(Object value, Number defaultValue)
|
| | | {
|
| | | if (value == null)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | if (value instanceof Number)
|
| | | {
|
| | | return (Number) value;
|
| | | }
|
| | | final String valueStr = toStr(value, null);
|
| | | if (StringUtils.isEmpty(valueStr))
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | try
|
| | | {
|
| | | return NumberFormat.getInstance().parse(valueStr);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºNumber<br>
|
| | | * 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<code>null</code><br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Number toNumber(Object value)
|
| | | {
|
| | | return toNumber(value, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºint<br>
|
| | | * 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @param defaultValue 转æ¢é误æ¶çé»è®¤å¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Integer toInt(Object value, Integer defaultValue)
|
| | | {
|
| | | if (value == null)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | if (value instanceof Integer)
|
| | | {
|
| | | return (Integer) value;
|
| | | }
|
| | | if (value instanceof Number)
|
| | | {
|
| | | return ((Number) value).intValue();
|
| | | }
|
| | | final String valueStr = toStr(value, null);
|
| | | if (StringUtils.isEmpty(valueStr))
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | try
|
| | | {
|
| | | return Integer.parseInt(valueStr.trim());
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºint<br>
|
| | | * 妿ç»å®çå¼ä¸º<code>null</code>ï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<code>null</code><br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Integer toInt(Object value)
|
| | | {
|
| | | return toInt(value, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºIntegeræ°ç»<br>
|
| | | * |
| | | * @param str 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Integer[] toIntArray(String str)
|
| | | {
|
| | | return toIntArray(",", str);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºLongæ°ç»<br>
|
| | | * |
| | | * @param str 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Long[] toLongArray(String str)
|
| | | {
|
| | | return toLongArray(",", str);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºIntegeræ°ç»<br>
|
| | | * |
| | | * @param split åé符
|
| | | * @param split 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Integer[] toIntArray(String split, String str)
|
| | | {
|
| | | if (StringUtils.isEmpty(str))
|
| | | {
|
| | | return new Integer[] {};
|
| | | }
|
| | | String[] arr = str.split(split);
|
| | | final Integer[] ints = new Integer[arr.length];
|
| | | for (int i = 0; i < arr.length; i++)
|
| | | {
|
| | | final Integer v = toInt(arr[i], 0);
|
| | | ints[i] = v;
|
| | | }
|
| | | return ints;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºLongæ°ç»<br>
|
| | | * |
| | | * @param split åé符
|
| | | * @param str 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Long[] toLongArray(String split, String str)
|
| | | {
|
| | | if (StringUtils.isEmpty(str))
|
| | | {
|
| | | return new Long[] {};
|
| | | }
|
| | | String[] arr = str.split(split);
|
| | | final Long[] longs = new Long[arr.length];
|
| | | for (int i = 0; i < arr.length; i++)
|
| | | {
|
| | | final Long v = toLong(arr[i], null);
|
| | | longs[i] = v;
|
| | | }
|
| | | return longs;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºStringæ°ç»<br>
|
| | | * |
| | | * @param str 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static String[] toStrArray(String str)
|
| | | {
|
| | | return toStrArray(",", str);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºStringæ°ç»<br>
|
| | | * |
| | | * @param split åé符
|
| | | * @param split 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static String[] toStrArray(String split, String str)
|
| | | {
|
| | | return str.split(split);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºlong<br>
|
| | | * 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @param defaultValue 转æ¢é误æ¶çé»è®¤å¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Long toLong(Object value, Long defaultValue)
|
| | | {
|
| | | if (value == null)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | if (value instanceof Long)
|
| | | {
|
| | | return (Long) value;
|
| | | }
|
| | | if (value instanceof Number)
|
| | | {
|
| | | return ((Number) value).longValue();
|
| | | }
|
| | | final String valueStr = toStr(value, null);
|
| | | if (StringUtils.isEmpty(valueStr))
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | try
|
| | | {
|
| | | // æ¯æç§å¦è®¡æ°æ³
|
| | | return new BigDecimal(valueStr.trim()).longValue();
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºlong<br>
|
| | | * 妿ç»å®çå¼ä¸º<code>null</code>ï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<code>null</code><br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Long toLong(Object value)
|
| | | {
|
| | | return toLong(value, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºdouble<br>
|
| | | * 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @param defaultValue 转æ¢é误æ¶çé»è®¤å¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Double toDouble(Object value, Double defaultValue)
|
| | | {
|
| | | if (value == null)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | if (value instanceof Double)
|
| | | {
|
| | | return (Double) value;
|
| | | }
|
| | | if (value instanceof Number)
|
| | | {
|
| | | return ((Number) value).doubleValue();
|
| | | }
|
| | | final String valueStr = toStr(value, null);
|
| | | if (StringUtils.isEmpty(valueStr))
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | try
|
| | | {
|
| | | // æ¯æç§å¦è®¡æ°æ³
|
| | | return new BigDecimal(valueStr.trim()).doubleValue();
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºdouble<br>
|
| | | * 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<code>null</code><br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Double toDouble(Object value)
|
| | | {
|
| | | return toDouble(value, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºFloat<br>
|
| | | * 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @param defaultValue 转æ¢é误æ¶çé»è®¤å¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Float toFloat(Object value, Float defaultValue)
|
| | | {
|
| | | if (value == null)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | if (value instanceof Float)
|
| | | {
|
| | | return (Float) value;
|
| | | }
|
| | | if (value instanceof Number)
|
| | | {
|
| | | return ((Number) value).floatValue();
|
| | | }
|
| | | final String valueStr = toStr(value, null);
|
| | | if (StringUtils.isEmpty(valueStr))
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | try
|
| | | {
|
| | | return Float.parseFloat(valueStr.trim());
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºFloat<br>
|
| | | * 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<code>null</code><br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Float toFloat(Object value)
|
| | | {
|
| | | return toFloat(value, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºboolean<br>
|
| | | * Stringæ¯æçå¼ä¸ºï¼trueãfalseãyesãokãnoï¼1,0 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @param defaultValue 转æ¢é误æ¶çé»è®¤å¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Boolean toBool(Object value, Boolean defaultValue)
|
| | | {
|
| | | if (value == null)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | if (value instanceof Boolean)
|
| | | {
|
| | | return (Boolean) value;
|
| | | }
|
| | | String valueStr = toStr(value, null);
|
| | | if (StringUtils.isEmpty(valueStr))
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | valueStr = valueStr.trim().toLowerCase();
|
| | | switch (valueStr)
|
| | | {
|
| | | case "true":
|
| | | return true;
|
| | | case "false":
|
| | | return false;
|
| | | case "yes":
|
| | | return true;
|
| | | case "ok":
|
| | | return true;
|
| | | case "no":
|
| | | return false;
|
| | | case "1":
|
| | | return true;
|
| | | case "0":
|
| | | return false;
|
| | | default:
|
| | | return defaultValue;
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºboolean<br>
|
| | | * 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<code>null</code><br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static Boolean toBool(Object value)
|
| | | {
|
| | | return toBool(value, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºEnum对象<br>
|
| | | * 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<br>
|
| | | * |
| | | * @param clazz EnumçClass
|
| | | * @param value å¼
|
| | | * @param defaultValue é»è®¤å¼
|
| | | * @return Enum
|
| | | */
|
| | | public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value, E defaultValue)
|
| | | {
|
| | | if (value == null)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | if (clazz.isAssignableFrom(value.getClass()))
|
| | | {
|
| | | @SuppressWarnings("unchecked")
|
| | | E myE = (E) value;
|
| | | return myE;
|
| | | }
|
| | | final String valueStr = toStr(value, null);
|
| | | if (StringUtils.isEmpty(valueStr))
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | try
|
| | | {
|
| | | return Enum.valueOf(clazz, valueStr);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºEnum对象<br>
|
| | | * 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<code>null</code><br>
|
| | | * |
| | | * @param clazz EnumçClass
|
| | | * @param value å¼
|
| | | * @return Enum
|
| | | */
|
| | | public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value)
|
| | | {
|
| | | return toEnum(clazz, value, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºBigInteger<br>
|
| | | * 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @param defaultValue 转æ¢é误æ¶çé»è®¤å¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static BigInteger toBigInteger(Object value, BigInteger defaultValue)
|
| | | {
|
| | | if (value == null)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | if (value instanceof BigInteger)
|
| | | {
|
| | | return (BigInteger) value;
|
| | | }
|
| | | if (value instanceof Long)
|
| | | {
|
| | | return BigInteger.valueOf((Long) value);
|
| | | }
|
| | | final String valueStr = toStr(value, null);
|
| | | if (StringUtils.isEmpty(valueStr))
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | try
|
| | | {
|
| | | return new BigInteger(valueStr);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºBigInteger<br>
|
| | | * 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<code>null</code><br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static BigInteger toBigInteger(Object value)
|
| | | {
|
| | | return toBigInteger(value, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºBigDecimal<br>
|
| | | * 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @param defaultValue 转æ¢é误æ¶çé»è®¤å¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static BigDecimal toBigDecimal(Object value, BigDecimal defaultValue)
|
| | | {
|
| | | if (value == null)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | if (value instanceof BigDecimal)
|
| | | {
|
| | | return (BigDecimal) value;
|
| | | }
|
| | | if (value instanceof Long)
|
| | | {
|
| | | return new BigDecimal((Long) value);
|
| | | }
|
| | | if (value instanceof Double)
|
| | | {
|
| | | return new BigDecimal((Double) value);
|
| | | }
|
| | | if (value instanceof Integer)
|
| | | {
|
| | | return new BigDecimal((Integer) value);
|
| | | }
|
| | | final String valueStr = toStr(value, null);
|
| | | if (StringUtils.isEmpty(valueStr))
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | try
|
| | | {
|
| | | return new BigDecimal(valueStr);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | return defaultValue;
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转æ¢ä¸ºBigDecimal<br>
|
| | | * 妿ç»å®çå¼ä¸ºç©ºï¼æè
转æ¢å¤±è´¥ï¼è¿åé»è®¤å¼<br>
|
| | | * 转æ¢å¤±è´¥ä¸ä¼æ¥é
|
| | | * |
| | | * @param value 被转æ¢çå¼
|
| | | * @return ç»æ
|
| | | */
|
| | | public static BigDecimal toBigDecimal(Object value)
|
| | | {
|
| | | return toBigDecimal(value, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * å°å¯¹è±¡è½¬ä¸ºå符串<br>
|
| | | * 1ãByteæ°ç»åByteBufferä¼è¢«è½¬æ¢ä¸ºå¯¹åºåç¬¦ä¸²çæ°ç» 2ã对象æ°ç»ä¼è°ç¨Arrays.toStringæ¹æ³
|
| | | * |
| | | * @param obj 对象
|
| | | * @return å符串
|
| | | */
|
| | | public static String utf8Str(Object obj)
|
| | | {
|
| | | return str(obj, CharsetKit.CHARSET_UTF_8);
|
| | | }
|
| | |
|
| | | /**
|
| | | * å°å¯¹è±¡è½¬ä¸ºå符串<br>
|
| | | * 1ãByteæ°ç»åByteBufferä¼è¢«è½¬æ¢ä¸ºå¯¹åºåç¬¦ä¸²çæ°ç» 2ã对象æ°ç»ä¼è°ç¨Arrays.toStringæ¹æ³
|
| | | * |
| | | * @param obj 对象
|
| | | * @param charsetName å符é
|
| | | * @return å符串
|
| | | */
|
| | | public static String str(Object obj, String charsetName)
|
| | | {
|
| | | return str(obj, Charset.forName(charsetName));
|
| | | }
|
| | |
|
| | | /**
|
| | | * å°å¯¹è±¡è½¬ä¸ºå符串<br>
|
| | | * 1ãByteæ°ç»åByteBufferä¼è¢«è½¬æ¢ä¸ºå¯¹åºåç¬¦ä¸²çæ°ç» 2ã对象æ°ç»ä¼è°ç¨Arrays.toStringæ¹æ³
|
| | | * |
| | | * @param obj 对象
|
| | | * @param charset å符é
|
| | | * @return å符串
|
| | | */
|
| | | public static String str(Object obj, Charset charset)
|
| | | {
|
| | | if (null == obj)
|
| | | {
|
| | | return null;
|
| | | }
|
| | |
|
| | | if (obj instanceof String)
|
| | | {
|
| | | return (String) obj;
|
| | | }
|
| | | else if (obj instanceof byte[] || obj instanceof Byte[])
|
| | | {
|
| | | return str((Byte[]) obj, charset);
|
| | | }
|
| | | else if (obj instanceof ByteBuffer)
|
| | | {
|
| | | return str((ByteBuffer) obj, charset);
|
| | | }
|
| | | return obj.toString();
|
| | | }
|
| | |
|
| | | /**
|
| | | * å°byteæ°ç»è½¬ä¸ºå符串
|
| | | * |
| | | * @param bytes byteæ°ç»
|
| | | * @param charset å符é
|
| | | * @return å符串
|
| | | */
|
| | | public static String str(byte[] bytes, String charset)
|
| | | {
|
| | | return str(bytes, StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset));
|
| | | }
|
| | |
|
| | | /**
|
| | | * è§£ç åèç
|
| | | * |
| | | * @param data å符串
|
| | | * @param charset å符éï¼å¦ææ¤å段为空ï¼åè§£ç çç»æåå³äºå¹³å°
|
| | | * @return è§£ç åçå符串
|
| | | */
|
| | | public static String str(byte[] data, Charset charset)
|
| | | {
|
| | | if (data == null)
|
| | | {
|
| | | return null;
|
| | | }
|
| | |
|
| | | if (null == charset)
|
| | | {
|
| | | return new String(data);
|
| | | }
|
| | | return new String(data, charset);
|
| | | }
|
| | |
|
| | | /**
|
| | | * å°ç¼ç çbyteBufferæ°æ®è½¬æ¢ä¸ºå符串
|
| | | * |
| | | * @param data æ°æ®
|
| | | * @param charset å符éï¼å¦æä¸ºç©ºä½¿ç¨å½åç³»ç»å符é
|
| | | * @return å符串
|
| | | */
|
| | | public static String str(ByteBuffer data, String charset)
|
| | | {
|
| | | if (data == null)
|
| | | {
|
| | | return null;
|
| | | }
|
| | |
|
| | | return str(data, Charset.forName(charset));
|
| | | }
|
| | |
|
| | | /**
|
| | | * å°ç¼ç çbyteBufferæ°æ®è½¬æ¢ä¸ºå符串
|
| | | * |
| | | * @param data æ°æ®
|
| | | * @param charset å符éï¼å¦æä¸ºç©ºä½¿ç¨å½åç³»ç»å符é
|
| | | * @return å符串
|
| | | */
|
| | | public static String str(ByteBuffer data, Charset charset)
|
| | | {
|
| | | if (null == charset)
|
| | | {
|
| | | charset = Charset.defaultCharset();
|
| | | }
|
| | | return charset.decode(data).toString();
|
| | | }
|
| | |
|
| | | // ----------------------------------------------------------------------- å
¨è§åè§è½¬æ¢
|
| | | /**
|
| | | * åè§è½¬å
¨è§
|
| | | * |
| | | * @param input String.
|
| | | * @return å
¨è§å符串.
|
| | | */
|
| | | public static String toSBC(String input)
|
| | | {
|
| | | return toSBC(input, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * åè§è½¬å
¨è§
|
| | | * |
| | | * @param input String
|
| | | * @param notConvertSet 䏿¿æ¢çå符éå
|
| | | * @return å
¨è§å符串.
|
| | | */
|
| | | public static String toSBC(String input, Set<Character> notConvertSet)
|
| | | {
|
| | | char c[] = input.toCharArray();
|
| | | for (int i = 0; i < c.length; i++)
|
| | | {
|
| | | if (null != notConvertSet && notConvertSet.contains(c[i]))
|
| | | {
|
| | | // è·³è¿ä¸æ¿æ¢çå符
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (c[i] == ' ')
|
| | | {
|
| | | c[i] = '\u3000';
|
| | | }
|
| | | else if (c[i] < '\177')
|
| | | {
|
| | | c[i] = (char) (c[i] + 65248);
|
| | |
|
| | | }
|
| | | }
|
| | | return new String(c);
|
| | | }
|
| | |
|
| | | /**
|
| | | * å
¨è§è½¬åè§
|
| | | * |
| | | * @param input String.
|
| | | * @return åè§å符串
|
| | | */
|
| | | public static String toDBC(String input)
|
| | | {
|
| | | return toDBC(input, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¿æ¢å
¨è§ä¸ºåè§
|
| | | * |
| | | * @param text ææ¬
|
| | | * @param notConvertSet 䏿¿æ¢çå符éå
|
| | | * @return æ¿æ¢åçå符
|
| | | */
|
| | | public static String toDBC(String text, Set<Character> notConvertSet)
|
| | | {
|
| | | char c[] = text.toCharArray();
|
| | | for (int i = 0; i < c.length; i++)
|
| | | {
|
| | | if (null != notConvertSet && notConvertSet.contains(c[i]))
|
| | | {
|
| | | // è·³è¿ä¸æ¿æ¢çå符
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (c[i] == '\u3000')
|
| | | {
|
| | | c[i] = ' ';
|
| | | }
|
| | | else if (c[i] > '\uFF00' && c[i] < '\uFF5F')
|
| | | {
|
| | | c[i] = (char) (c[i] - 65248);
|
| | | }
|
| | | }
|
| | | String returnString = new String(c);
|
| | |
|
| | | return returnString;
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ°åéé¢å¤§åè½¬æ¢ å
åä¸ªå®æ´çç¶åå°å¦é¶æ¾æ¿æ¢æé¶
|
| | | * |
| | | * @param n æ°å
|
| | | * @return 䏿大忰å
|
| | | */
|
| | | public static String digitUppercase(double n)
|
| | | {
|
| | | String[] fraction = { "è§", "å" };
|
| | | String[] digit = { "é¶", "壹", "è´°", "å", "è", "ä¼", "é", "æ", "æ", "ç" };
|
| | | String[][] unit = { { "å
", "ä¸", "亿" }, { "", "æ¾", "ä½°", "ä»" } };
|
| | |
|
| | | String head = n < 0 ? "è´" : "";
|
| | | n = Math.abs(n);
|
| | |
|
| | | String s = "";
|
| | | for (int i = 0; i < fraction.length; i++)
|
| | | {
|
| | | s += (digit[(int) (Math.floor(n * 10 * Math.pow(10, i)) % 10)] + fraction[i]).replaceAll("(é¶.)+", "");
|
| | | }
|
| | | if (s.length() < 1)
|
| | | {
|
| | | s = "æ´";
|
| | | }
|
| | | int integerPart = (int) Math.floor(n);
|
| | |
|
| | | for (int i = 0; i < unit[0].length && integerPart > 0; i++)
|
| | | {
|
| | | String p = "";
|
| | | for (int j = 0; j < unit[1].length && n > 0; j++)
|
| | | {
|
| | | p = digit[integerPart % 10] + unit[1][j] + p;
|
| | | integerPart = integerPart / 10;
|
| | | }
|
| | | s = p.replaceAll("(é¶.)*é¶$", "").replaceAll("^$", "é¶") + unit[0][i] + s;
|
| | | }
|
| | | return head + s.replaceAll("(é¶.)*é¶å
", "å
").replaceFirst("(é¶.)+", "").replaceAll("(é¶.)+", "é¶").replaceAll("^æ´$", "é¶å
æ´");
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.text;
|
| | |
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | |
|
| | | /**
|
| | | * åç¬¦ä¸²æ ¼å¼å
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class StrFormatter
|
| | | {
|
| | | public static final String EMPTY_JSON = "{}";
|
| | | public static final char C_BACKSLASH = '\\';
|
| | | public static final char C_DELIM_START = '{';
|
| | | public static final char C_DELIM_END = '}';
|
| | |
|
| | | /**
|
| | | * æ ¼å¼åå符串<br>
|
| | | * æ¤æ¹æ³åªæ¯ç®åå°å ä½ç¬¦ {} æç
§é¡ºåºæ¿æ¢ä¸ºåæ°<br>
|
| | | * 妿æ³è¾åº {} ä½¿ç¨ \\è½¬ä¹ { å³å¯ï¼å¦ææ³è¾åº {} ä¹åç \ 使ç¨å转ä¹ç¬¦ \\\\ å³å¯<br>
|
| | | * ä¾ï¼<br>
|
| | | * é常使ç¨ï¼format("this is {} for {}", "a", "b") -> this is a for b<br>
|
| | | * 转ä¹{}ï¼ format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
|
| | | * 转ä¹\ï¼ format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
|
| | | * |
| | | * @param strPattern å符串模æ¿
|
| | | * @param argArray åæ°å表
|
| | | * @return ç»æ
|
| | | */
|
| | | public static String format(final String strPattern, final Object... argArray)
|
| | | {
|
| | | if (StringUtils.isEmpty(strPattern) || StringUtils.isEmpty(argArray))
|
| | | {
|
| | | return strPattern;
|
| | | }
|
| | | final int strPatternLength = strPattern.length();
|
| | |
|
| | | // åå§åå®ä¹å¥½çé¿åº¦ä»¥è·å¾æ´å¥½çæ§è½
|
| | | StringBuilder sbuf = new StringBuilder(strPatternLength + 50);
|
| | |
|
| | | int handledPosition = 0;
|
| | | int delimIndex;// å ä½ç¬¦æå¨ä½ç½®
|
| | | for (int argIndex = 0; argIndex < argArray.length; argIndex++)
|
| | | {
|
| | | delimIndex = strPattern.indexOf(EMPTY_JSON, handledPosition);
|
| | | if (delimIndex == -1)
|
| | | {
|
| | | if (handledPosition == 0)
|
| | | {
|
| | | return strPattern;
|
| | | }
|
| | | else
|
| | | { // å符串模æ¿å©ä½é¨åä¸åå
å«å ä½ç¬¦ï¼å å
¥å©ä½é¨ååè¿åç»æ
|
| | | sbuf.append(strPattern, handledPosition, strPatternLength);
|
| | | return sbuf.toString();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (delimIndex > 0 && strPattern.charAt(delimIndex - 1) == C_BACKSLASH)
|
| | | {
|
| | | if (delimIndex > 1 && strPattern.charAt(delimIndex - 2) == C_BACKSLASH)
|
| | | {
|
| | | // 转ä¹ç¬¦ä¹åè¿æä¸ä¸ªè½¬ä¹ç¬¦ï¼å ä½ç¬¦ä¾æ§ææ
|
| | | sbuf.append(strPattern, handledPosition, delimIndex - 1);
|
| | | sbuf.append(Convert.utf8Str(argArray[argIndex]));
|
| | | handledPosition = delimIndex + 2;
|
| | | }
|
| | | else
|
| | | {
|
| | | // å ä½ç¬¦è¢«è½¬ä¹
|
| | | argIndex--;
|
| | | sbuf.append(strPattern, handledPosition, delimIndex - 1);
|
| | | sbuf.append(C_DELIM_START);
|
| | | handledPosition = delimIndex + 1;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | // æ£å¸¸å ä½ç¬¦
|
| | | sbuf.append(strPattern, handledPosition, delimIndex);
|
| | | sbuf.append(Convert.utf8Str(argArray[argIndex]));
|
| | | handledPosition = delimIndex + 2;
|
| | | }
|
| | | }
|
| | | }
|
| | | // å å
¥æåä¸ä¸ªå ä½ç¬¦åææçå符
|
| | | sbuf.append(strPattern, handledPosition, strPattern.length());
|
| | |
|
| | | return sbuf.toString();
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | | import org.springframework.lang.Nullable;
|
| | |
|
| | | /**
|
| | | * è¯·æ±æ¹å¼
|
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | public enum HttpMethod
|
| | | {
|
| | | GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE;
|
| | |
|
| | | private static final Map<String, HttpMethod> mappings = new HashMap<>(16);
|
| | |
|
| | | static
|
| | | {
|
| | | for (HttpMethod httpMethod : values())
|
| | | {
|
| | | mappings.put(httpMethod.name(), httpMethod);
|
| | | }
|
| | | }
|
| | |
|
| | | @Nullable
|
| | | public static HttpMethod resolve(@Nullable String method)
|
| | | {
|
| | | return (method != null ? mappings.get(method) : null);
|
| | | }
|
| | |
|
| | | public boolean matches(String method)
|
| | | {
|
| | | return (this == resolve(method));
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums;
|
| | |
|
| | | /**
|
| | | * ç¨æ·ç¶æ
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public enum UserStatus
|
| | | {
|
| | | OK("0", "æ£å¸¸"), DISABLE("1", "åç¨"), DELETED("2", "å é¤");
|
| | |
|
| | | private final String code;
|
| | | private final String info;
|
| | |
|
| | | UserStatus(String code, String info)
|
| | | {
|
| | | this.code = code;
|
| | | this.info = info;
|
| | | }
|
| | |
|
| | | public String getCode()
|
| | | {
|
| | | return code;
|
| | | }
|
| | |
|
| | | public String getInfo()
|
| | | {
|
| | | return info;
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.exception;
|
| | |
|
| | | import com.ruoyi.common.utils.MessageUtils;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | |
|
| | | /**
|
| | | * åºç¡å¼å¸¸
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class BaseException extends RuntimeException
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | /**
|
| | | * æå±æ¨¡å
|
| | | */
|
| | | private String module;
|
| | |
|
| | | /**
|
| | | * é误ç
|
| | | */
|
| | | private String code;
|
| | |
|
| | | /**
|
| | | * é误ç 对åºçåæ°
|
| | | */
|
| | | private Object[] args;
|
| | |
|
| | | /**
|
| | | * éè¯¯æ¶æ¯
|
| | | */
|
| | | private String defaultMessage;
|
| | |
|
| | | public BaseException(String module, String code, Object[] args, String defaultMessage)
|
| | | {
|
| | | this.module = module;
|
| | | this.code = code;
|
| | | this.args = args;
|
| | | this.defaultMessage = defaultMessage;
|
| | | }
|
| | |
|
| | | public BaseException(String module, String code, Object[] args)
|
| | | {
|
| | | this(module, code, args, null);
|
| | | }
|
| | |
|
| | | public BaseException(String module, String defaultMessage)
|
| | | {
|
| | | this(module, null, null, defaultMessage);
|
| | | }
|
| | |
|
| | | public BaseException(String code, Object[] args)
|
| | | {
|
| | | this(null, code, args, null);
|
| | | }
|
| | |
|
| | | public BaseException(String defaultMessage)
|
| | | {
|
| | | this(null, null, null, defaultMessage);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String getMessage()
|
| | | {
|
| | | String message = null;
|
| | | if (!StringUtils.isEmpty(code))
|
| | | {
|
| | | message = MessageUtils.message(code, args);
|
| | | }
|
| | | if (message == null)
|
| | | {
|
| | | message = defaultMessage;
|
| | | }
|
| | | return message;
|
| | | }
|
| | |
|
| | | public String getModule()
|
| | | {
|
| | | return module;
|
| | | }
|
| | |
|
| | | public String getCode()
|
| | | {
|
| | | return code;
|
| | | }
|
| | |
|
| | | public Object[] getArgs()
|
| | | {
|
| | | return args;
|
| | | }
|
| | |
|
| | | public String getDefaultMessage()
|
| | | {
|
| | | return defaultMessage;
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.exception;
|
| | |
|
| | | /**
|
| | | * èªå®ä¹å¼å¸¸
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class CustomException extends RuntimeException
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | private Integer code;
|
| | |
|
| | | private String message;
|
| | |
|
| | | public CustomException(String message)
|
| | | {
|
| | | this.message = message;
|
| | | }
|
| | |
|
| | | public CustomException(String message, Integer code)
|
| | | {
|
| | | this.message = message;
|
| | | this.code = code;
|
| | | }
|
| | |
|
| | | public CustomException(String message, Throwable e)
|
| | | {
|
| | | super(message, e);
|
| | | this.message = message;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String getMessage()
|
| | | {
|
| | | return message;
|
| | | }
|
| | |
|
| | | public Integer getCode()
|
| | | {
|
| | | return code;
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.exception;
|
| | |
|
| | | /**
|
| | | * æ¼ç¤ºæ¨¡å¼å¼å¸¸
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class DemoModeException extends RuntimeException
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public DemoModeException()
|
| | | {
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.exception;
|
| | |
|
| | | /**
|
| | | * å·¥å
·ç±»å¼å¸¸
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class UtilException extends RuntimeException
|
| | | {
|
| | | private static final long serialVersionUID = 8247610319171014183L;
|
| | |
|
| | | public UtilException(Throwable e)
|
| | | {
|
| | | super(e.getMessage(), e);
|
| | | }
|
| | |
|
| | | public UtilException(String message)
|
| | | {
|
| | | super(message);
|
| | | }
|
| | |
|
| | | public UtilException(String message, Throwable throwable)
|
| | | {
|
| | | super(message, throwable);
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.exception.file;
|
| | |
|
| | | import com.ruoyi.common.exception.BaseException;
|
| | |
|
| | | /**
|
| | | * æä»¶ä¿¡æ¯å¼å¸¸ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class FileException extends BaseException
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public FileException(String code, Object[] args)
|
| | | {
|
| | | super("file", code, args, null);
|
| | | }
|
| | |
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.exception.file;
|
| | |
|
| | | /**
|
| | | * æä»¶åç§°è¶
é¿éå¶å¼å¸¸ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class FileNameLengthLimitExceededException extends FileException
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public FileNameLengthLimitExceededException(int defaultFileNameLength)
|
| | | {
|
| | | super("upload.filename.exceed.length", new Object[] { defaultFileNameLength });
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.exception.file;
|
| | |
|
| | | /**
|
| | | * æä»¶å大å°éå¶å¼å¸¸ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class FileSizeLimitExceededException extends FileException
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public FileSizeLimitExceededException(long defaultMaxSize)
|
| | | {
|
| | | super("upload.exceed.maxSize", new Object[] { defaultMaxSize });
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.exception.file;
|
| | |
|
| | | import java.util.Arrays;
|
| | | import org.apache.commons.fileupload.FileUploadException;
|
| | |
|
| | | /**
|
| | | * æä»¶ä¸ä¼ 误å¼å¸¸ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class InvalidExtensionException extends FileUploadException
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | private String[] allowedExtension;
|
| | | private String extension;
|
| | | private String filename;
|
| | |
|
| | | public InvalidExtensionException(String[] allowedExtension, String extension, String filename)
|
| | | {
|
| | | super("filename : [" + filename + "], extension : [" + extension + "], allowed extension : [" + Arrays.toString(allowedExtension) + "]");
|
| | | this.allowedExtension = allowedExtension;
|
| | | this.extension = extension;
|
| | | this.filename = filename;
|
| | | }
|
| | |
|
| | | public String[] getAllowedExtension()
|
| | | {
|
| | | return allowedExtension;
|
| | | }
|
| | |
|
| | | public String getExtension()
|
| | | {
|
| | | return extension;
|
| | | }
|
| | |
|
| | | public String getFilename()
|
| | | {
|
| | | return filename;
|
| | | }
|
| | |
|
| | | public static class InvalidImageExtensionException extends InvalidExtensionException
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public InvalidImageExtensionException(String[] allowedExtension, String extension, String filename)
|
| | | {
|
| | | super(allowedExtension, extension, filename);
|
| | | }
|
| | | }
|
| | |
|
| | | public static class InvalidFlashExtensionException extends InvalidExtensionException
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public InvalidFlashExtensionException(String[] allowedExtension, String extension, String filename)
|
| | | {
|
| | | super(allowedExtension, extension, filename);
|
| | | }
|
| | | }
|
| | |
|
| | | public static class InvalidMediaExtensionException extends InvalidExtensionException
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public InvalidMediaExtensionException(String[] allowedExtension, String extension, String filename)
|
| | | {
|
| | | super(allowedExtension, extension, filename);
|
| | | }
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.exception.user;
|
| | |
|
| | | /**
|
| | | * éªè¯ç é误å¼å¸¸ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class CaptchaException extends UserException
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public CaptchaException()
|
| | | {
|
| | | super("user.jcaptcha.error", null);
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.exception.user;
|
| | |
|
| | | /**
|
| | | * éªè¯ç 失æå¼å¸¸ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class CaptchaExpireException extends UserException
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public CaptchaExpireException()
|
| | | {
|
| | | super("user.jcaptcha.expire", null);
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.exception.user;
|
| | |
|
| | | import com.ruoyi.common.exception.BaseException;
|
| | |
|
| | | /**
|
| | | * ç¨æ·ä¿¡æ¯å¼å¸¸ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class UserException extends BaseException
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public UserException(String code, Object[] args)
|
| | | {
|
| | | super("user", code, args, null);
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.exception.user;
|
| | |
|
| | | /**
|
| | | * ç¨æ·å¯ç 䏿£ç¡®æä¸ç¬¦åè§èå¼å¸¸ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class UserPasswordNotMatchException extends UserException
|
| | | {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public UserPasswordNotMatchException()
|
| | | {
|
| | | super("user.password.not.match", null);
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.math.RoundingMode;
|
| | |
|
| | | /**
|
| | | * ç²¾ç¡®çæµ®ç¹æ°è¿ç®
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class Arith
|
| | | {
|
| | |
|
| | | /** é»è®¤é¤æ³è¿ç®ç²¾åº¦ */
|
| | | private static final int DEF_DIV_SCALE = 10;
|
| | |
|
| | | /** è¿ä¸ªç±»ä¸è½å®ä¾å */
|
| | | private Arith()
|
| | | {
|
| | | }
|
| | |
|
| | | /**
|
| | | * æä¾ç²¾ç¡®çå æ³è¿ç®ã
|
| | | * @param v1 è¢«å æ°
|
| | | * @param v2 å æ°
|
| | | * @return ä¸¤ä¸ªåæ°çå
|
| | | */
|
| | | public static double add(double v1, double v2)
|
| | | {
|
| | | BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
| | | BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
| | | return b1.add(b2).doubleValue();
|
| | | }
|
| | |
|
| | | /**
|
| | | * æä¾ç²¾ç¡®çåæ³è¿ç®ã
|
| | | * @param v1 è¢«åæ°
|
| | | * @param v2 åæ°
|
| | | * @return ä¸¤ä¸ªåæ°çå·®
|
| | | */
|
| | | public static double sub(double v1, double v2)
|
| | | {
|
| | | BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
| | | BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
| | | return b1.subtract(b2).doubleValue();
|
| | | }
|
| | |
|
| | | /**
|
| | | * æä¾ç²¾ç¡®ç乿³è¿ç®ã
|
| | | * @param v1 è¢«ä¹æ°
|
| | | * @param v2 乿°
|
| | | * @return ä¸¤ä¸ªåæ°ç积
|
| | | */
|
| | | public static double mul(double v1, double v2)
|
| | | {
|
| | | BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
| | | BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
| | | return b1.multiply(b2).doubleValue();
|
| | | }
|
| | |
|
| | | /**
|
| | | * æä¾ï¼ç¸å¯¹ï¼ç²¾ç¡®ç餿³è¿ç®ï¼å½åçé¤ä¸å°½çæ
嵿¶ï¼ç²¾ç¡®å°
|
| | | * å°æ°ç¹ä»¥å10ä½ï¼ä»¥åçæ°ååèäºå
¥ã
|
| | | * @param v1 è¢«é¤æ°
|
| | | * @param v2 餿°
|
| | | * @return ä¸¤ä¸ªåæ°çå
|
| | | */
|
| | | public static double div(double v1, double v2)
|
| | | {
|
| | | return div(v1, v2, DEF_DIV_SCALE);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æä¾ï¼ç¸å¯¹ï¼ç²¾ç¡®ç餿³è¿ç®ãå½åçé¤ä¸å°½çæ
嵿¶ï¼ç±scaleåæ°æ
|
| | | * å®ç²¾åº¦ï¼ä»¥åçæ°ååèäºå
¥ã
|
| | | * @param v1 è¢«é¤æ°
|
| | | * @param v2 餿°
|
| | | * @param scale 表示表示éè¦ç²¾ç¡®å°å°æ°ç¹ä»¥åå ä½ã
|
| | | * @return ä¸¤ä¸ªåæ°çå
|
| | | */
|
| | | public static double div(double v1, double v2, int scale)
|
| | | {
|
| | | if (scale < 0)
|
| | | {
|
| | | throw new IllegalArgumentException(
|
| | | "The scale must be a positive integer or zero");
|
| | | }
|
| | | BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
| | | BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
| | | if (b1.compareTo(BigDecimal.ZERO) == 0)
|
| | | {
|
| | | return BigDecimal.ZERO.doubleValue();
|
| | | }
|
| | | return b1.divide(b2, scale, RoundingMode.HALF_UP).doubleValue();
|
| | | }
|
| | |
|
| | | /**
|
| | | * æä¾ç²¾ç¡®çå°æ°ä½åèäºå
¥å¤çã
|
| | | * @param v éè¦åèäºå
¥çæ°å
|
| | | * @param scale å°æ°ç¹åä¿çå ä½
|
| | | * @return åèäºå
¥åçç»æ
|
| | | */
|
| | | public static double round(double v, int scale)
|
| | | {
|
| | | if (scale < 0)
|
| | | {
|
| | | throw new IllegalArgumentException(
|
| | | "The scale must be a positive integer or zero");
|
| | | }
|
| | | BigDecimal b = new BigDecimal(Double.toString(v));
|
| | | BigDecimal one = new BigDecimal("1");
|
| | | return b.divide(one, scale, RoundingMode.HALF_UP).doubleValue();
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils;
|
| | |
|
| | | import java.lang.management.ManagementFactory;
|
| | | import java.text.ParseException;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.Date;
|
| | | import org.apache.commons.lang3.time.DateFormatUtils;
|
| | |
|
| | | /**
|
| | | * æ¶é´å·¥å
·ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
| | | {
|
| | | public static String YYYY = "yyyy";
|
| | |
|
| | | public static String YYYY_MM = "yyyy-MM";
|
| | |
|
| | | public static String YYYY_MM_DD = "yyyy-MM-dd";
|
| | |
|
| | | public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
|
| | |
|
| | | public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
| | | |
| | | private static String[] parsePatterns = {
|
| | | "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", |
| | | "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
| | | "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
|
| | |
|
| | | /**
|
| | | * è·åå½åDate忥æ
|
| | | * |
| | | * @return Date() å½åæ¥æ
|
| | | */
|
| | | public static Date getNowDate()
|
| | | {
|
| | | return new Date();
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åå½åæ¥æ, é»è®¤æ ¼å¼ä¸ºyyyy-MM-dd
|
| | | * |
| | | * @return String
|
| | | */
|
| | | public static String getDate()
|
| | | {
|
| | | return dateTimeNow(YYYY_MM_DD);
|
| | | }
|
| | |
|
| | | public static final String getTime()
|
| | | {
|
| | | return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
|
| | | }
|
| | |
|
| | | public static final String dateTimeNow()
|
| | | {
|
| | | return dateTimeNow(YYYYMMDDHHMMSS);
|
| | | }
|
| | |
|
| | | public static final String dateTimeNow(final String format)
|
| | | {
|
| | | return parseDateToStr(format, new Date());
|
| | | }
|
| | |
|
| | | public static final String dateTime(final Date date)
|
| | | {
|
| | | return parseDateToStr(YYYY_MM_DD, date);
|
| | | }
|
| | |
|
| | | public static final String parseDateToStr(final String format, final Date date)
|
| | | {
|
| | | return new SimpleDateFormat(format).format(date);
|
| | | }
|
| | |
|
| | | public static final Date dateTime(final String format, final String ts)
|
| | | {
|
| | | try
|
| | | {
|
| | | return new SimpleDateFormat(format).parse(ts);
|
| | | }
|
| | | catch (ParseException e)
|
| | | {
|
| | | throw new RuntimeException(e);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¥æè·¯å¾ å³å¹´/æ/æ¥ å¦2018/08/08
|
| | | */
|
| | | public static final String datePath()
|
| | | {
|
| | | Date now = new Date();
|
| | | return DateFormatUtils.format(now, "yyyy/MM/dd");
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¥æè·¯å¾ å³å¹´/æ/æ¥ å¦20180808
|
| | | */
|
| | | public static final String dateTime()
|
| | | {
|
| | | Date now = new Date();
|
| | | return DateFormatUtils.format(now, "yyyyMMdd");
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¥æåå符串转åä¸ºæ¥æ æ ¼å¼
|
| | | */
|
| | | public static Date parseDate(Object str)
|
| | | {
|
| | | if (str == null)
|
| | | {
|
| | | return null;
|
| | | }
|
| | | try
|
| | | {
|
| | | return parseDate(str.toString(), parsePatterns);
|
| | | }
|
| | | catch (ParseException e)
|
| | | {
|
| | | return null;
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * è·åæå¡å¨å¯å¨æ¶é´
|
| | | */
|
| | | public static Date getServerStartDate()
|
| | | {
|
| | | long time = ManagementFactory.getRuntimeMXBean().getStartTime();
|
| | | return new Date(time);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 计ç®ä¸¤ä¸ªæ¶é´å·®
|
| | | */
|
| | | public static String getDatePoor(Date endDate, Date nowDate)
|
| | | {
|
| | | long nd = 1000 * 24 * 60 * 60;
|
| | | long nh = 1000 * 60 * 60;
|
| | | long nm = 1000 * 60;
|
| | | // long ns = 1000;
|
| | | // è·å¾ä¸¤ä¸ªæ¶é´çæ¯«ç§æ¶é´å·®å¼
|
| | | long diff = endDate.getTime() - nowDate.getTime();
|
| | | // 计ç®å·®å¤å°å¤©
|
| | | long day = diff / nd;
|
| | | // 计ç®å·®å¤å°å°æ¶
|
| | | long hour = diff % nd / nh;
|
| | | // 计ç®å·®å¤å°åé
|
| | | long min = diff % nd % nh / nm;
|
| | | // 计ç®å·®å¤å°ç§//è¾åºç»æ
|
| | | // long sec = diff % nd % nh % nm / ns;
|
| | | return day + "天" + hour + "å°æ¶" + min + "åé";
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils;
|
| | |
|
| | | import com.ruoyi.common.core.lang.UUID;
|
| | |
|
| | | /**
|
| | | * IDçæå¨å·¥å
·ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class IdUtils
|
| | | {
|
| | | /**
|
| | | * è·åéæºUUID
|
| | | * |
| | | * @return éæºUUID
|
| | | */
|
| | | public static String randomUUID()
|
| | | {
|
| | | return UUID.randomUUID().toString();
|
| | | }
|
| | |
|
| | | /**
|
| | | * ç®åçUUIDï¼å»æäºæ¨ªçº¿
|
| | | * |
| | | * @return ç®åçUUIDï¼å»æäºæ¨ªçº¿
|
| | | */
|
| | | public static String simpleUUID()
|
| | | {
|
| | | return UUID.randomUUID().toString(true);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åéæºUUIDï¼ä½¿ç¨æ§è½æ´å¥½çThreadLocalRandomçæUUID
|
| | | * |
| | | * @return éæºUUID
|
| | | */
|
| | | public static String fastUUID()
|
| | | {
|
| | | return UUID.fastUUID().toString();
|
| | | }
|
| | |
|
| | | /**
|
| | | * ç®åçUUIDï¼å»æäºæ¨ªçº¿ï¼ä½¿ç¨æ§è½æ´å¥½çThreadLocalRandomçæUUID
|
| | | * |
| | | * @return ç®åçUUIDï¼å»æäºæ¨ªçº¿
|
| | | */
|
| | | public static String fastSimpleUUID()
|
| | | {
|
| | | return UUID.fastUUID().toString(true);
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils;
|
| | |
|
| | | /**
|
| | | * å¤çå¹¶è®°å½æ¥å¿æä»¶
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class LogUtils
|
| | | {
|
| | | public static String getBlock(Object msg)
|
| | | {
|
| | | if (msg == null)
|
| | | {
|
| | | msg = "";
|
| | | }
|
| | | return "[" + msg.toString() + "]";
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils;
|
| | |
|
| | | import org.springframework.context.MessageSource;
|
| | | import org.springframework.context.i18n.LocaleContextHolder;
|
| | | import com.ruoyi.common.utils.spring.SpringUtils;
|
| | |
|
| | | /**
|
| | | * è·åi18nèµæºæä»¶
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class MessageUtils
|
| | | {
|
| | | /**
|
| | | * æ ¹æ®æ¶æ¯é®ååæ° è·åæ¶æ¯ å§æç»spring messageSource
|
| | | *
|
| | | * @param code æ¶æ¯é®
|
| | | * @param args åæ°
|
| | | * @return è·åå½é
åç¿»è¯å¼
|
| | | */
|
| | | public static String message(String code, Object... args)
|
| | | {
|
| | | MessageSource messageSource = SpringUtils.getBean(MessageSource.class);
|
| | | return messageSource.getMessage(code, args, LocaleContextHolder.getLocale());
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils;
|
| | |
|
| | | import org.springframework.security.core.Authentication;
|
| | | import org.springframework.security.core.context.SecurityContextHolder;
|
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
| | | import com.ruoyi.common.constant.HttpStatus;
|
| | | import com.ruoyi.common.exception.CustomException;
|
| | | import com.ruoyi.framework.security.LoginUser;
|
| | |
|
| | | /**
|
| | | * å®å
¨æå¡å·¥å
·ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class SecurityUtils
|
| | | {
|
| | | /**
|
| | | * è·åç¨æ·è´¦æ·
|
| | | **/
|
| | | public static String getUsername()
|
| | | {
|
| | | try
|
| | | {
|
| | | return getLoginUser().getUsername();
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | throw new CustomException("è·åç¨æ·è´¦æ·å¼å¸¸", HttpStatus.UNAUTHORIZED);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åç¨æ·
|
| | | **/
|
| | | public static LoginUser getLoginUser()
|
| | | {
|
| | | try
|
| | | {
|
| | | return (LoginUser) getAuthentication().getPrincipal();
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | throw new CustomException("è·åç¨æ·ä¿¡æ¯å¼å¸¸", HttpStatus.UNAUTHORIZED);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åAuthentication
|
| | | */
|
| | | public static Authentication getAuthentication()
|
| | | {
|
| | | return SecurityContextHolder.getContext().getAuthentication();
|
| | | }
|
| | |
|
| | | /**
|
| | | * çæBCryptPasswordEncoderå¯ç
|
| | | *
|
| | | * @param password å¯ç
|
| | | * @return å å¯å符串
|
| | | */
|
| | | public static String encryptPassword(String password)
|
| | | {
|
| | | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
| | | return passwordEncoder.encode(password);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 夿å¯ç æ¯å¦ç¸å
|
| | | *
|
| | | * @param rawPassword çå®å¯ç
|
| | | * @param encodedPassword å å¯åå符
|
| | | * @return ç»æ
|
| | | */
|
| | | public static boolean matchesPassword(String rawPassword, String encodedPassword)
|
| | | {
|
| | | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
| | | return passwordEncoder.matches(rawPassword, encodedPassword);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¯å¦ä¸ºç®¡çå
|
| | | * |
| | | * @param userId ç¨æ·ID
|
| | | * @return ç»æ
|
| | | */
|
| | | public static boolean isAdmin(Long userId)
|
| | | {
|
| | | return userId != null && 1L == userId;
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils;
|
| | |
|
| | | import java.io.IOException;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | | import javax.servlet.http.HttpSession;
|
| | | import org.springframework.web.context.request.RequestAttributes;
|
| | | import org.springframework.web.context.request.RequestContextHolder;
|
| | | import org.springframework.web.context.request.ServletRequestAttributes;
|
| | | import com.ruoyi.common.core.text.Convert;
|
| | |
|
| | | /**
|
| | | * 客æ·ç«¯å·¥å
·ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class ServletUtils
|
| | | {
|
| | | /**
|
| | | * è·åStringåæ°
|
| | | */
|
| | | public static String getParameter(String name)
|
| | | {
|
| | | return getRequest().getParameter(name);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åStringåæ°
|
| | | */
|
| | | public static String getParameter(String name, String defaultValue)
|
| | | {
|
| | | return Convert.toStr(getRequest().getParameter(name), defaultValue);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åIntegeråæ°
|
| | | */
|
| | | public static Integer getParameterToInt(String name)
|
| | | {
|
| | | return Convert.toInt(getRequest().getParameter(name));
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åIntegeråæ°
|
| | | */
|
| | | public static Integer getParameterToInt(String name, Integer defaultValue)
|
| | | {
|
| | | return Convert.toInt(getRequest().getParameter(name), defaultValue);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·årequest
|
| | | */
|
| | | public static HttpServletRequest getRequest()
|
| | | {
|
| | | return getRequestAttributes().getRequest();
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åresponse
|
| | | */
|
| | | public static HttpServletResponse getResponse()
|
| | | {
|
| | | return getRequestAttributes().getResponse();
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åsession
|
| | | */
|
| | | public static HttpSession getSession()
|
| | | {
|
| | | return getRequest().getSession();
|
| | | }
|
| | |
|
| | | public static ServletRequestAttributes getRequestAttributes()
|
| | | {
|
| | | RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
|
| | | return (ServletRequestAttributes) attributes;
|
| | | }
|
| | |
|
| | | /**
|
| | | * å°å符串渲æå°å®¢æ·ç«¯
|
| | | * |
| | | * @param response 渲æå¯¹è±¡
|
| | | * @param string å¾
渲æçå符串
|
| | | * @return null
|
| | | */
|
| | | public static String renderString(HttpServletResponse response, String string)
|
| | | {
|
| | | try
|
| | | {
|
| | | response.setStatus(200);
|
| | | response.setContentType("application/json");
|
| | | response.setCharacterEncoding("utf-8");
|
| | | response.getWriter().print(string);
|
| | | }
|
| | | catch (IOException e)
|
| | | {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¯å¦æ¯Ajax弿¥è¯·æ±
|
| | | * |
| | | * @param request
|
| | | */
|
| | | public static boolean isAjaxRequest(HttpServletRequest request)
|
| | | {
|
| | | String accept = request.getHeader("accept");
|
| | | if (accept != null && accept.indexOf("application/json") != -1)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | String xRequestedWith = request.getHeader("X-Requested-With");
|
| | | if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | String uri = request.getRequestURI();
|
| | | if (StringUtils.inStringIgnoreCase(uri, ".json", ".xml"))
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | String ajax = request.getParameter("__ajax");
|
| | | if (StringUtils.inStringIgnoreCase(ajax, "json", "xml"))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collection;
|
| | | import java.util.HashSet;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Set;
|
| | | import com.ruoyi.common.core.text.StrFormatter;
|
| | |
|
| | | /**
|
| | | * å符串工å
·ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class StringUtils extends org.apache.commons.lang3.StringUtils
|
| | | {
|
| | | /** 空å符串 */
|
| | | private static final String NULLSTR = "";
|
| | |
|
| | | /** ä¸å线 */
|
| | | private static final char SEPARATOR = '_';
|
| | |
|
| | | /**
|
| | | * è·ååæ°ä¸ä¸ºç©ºå¼
|
| | | * |
| | | * @param value defaultValue è¦å¤æçvalue
|
| | | * @return value è¿åå¼
|
| | | */
|
| | | public static <T> T nvl(T value, T defaultValue)
|
| | | {
|
| | | return value != null ? value : defaultValue;
|
| | | }
|
| | |
|
| | | /**
|
| | | * * 夿ä¸ä¸ªCollectionæ¯å¦ä¸ºç©ºï¼ å
å«Listï¼Setï¼Queue
|
| | | * |
| | | * @param coll è¦å¤æçCollection
|
| | | * @return trueï¼ä¸ºç©º falseï¼é空
|
| | | */
|
| | | public static boolean isEmpty(Collection<?> coll)
|
| | | {
|
| | | return isNull(coll) || coll.isEmpty();
|
| | | }
|
| | |
|
| | | /**
|
| | | * * 夿ä¸ä¸ªCollectionæ¯å¦é空ï¼å
å«Listï¼Setï¼Queue
|
| | | * |
| | | * @param coll è¦å¤æçCollection
|
| | | * @return trueï¼é空 falseï¼ç©º
|
| | | */
|
| | | public static boolean isNotEmpty(Collection<?> coll)
|
| | | {
|
| | | return !isEmpty(coll);
|
| | | }
|
| | |
|
| | | /**
|
| | | * * 夿ä¸ä¸ªå¯¹è±¡æ°ç»æ¯å¦ä¸ºç©º
|
| | | * |
| | | * @param objects è¦å¤æç对象æ°ç»
|
| | | ** @return trueï¼ä¸ºç©º falseï¼é空
|
| | | */
|
| | | public static boolean isEmpty(Object[] objects)
|
| | | {
|
| | | return isNull(objects) || (objects.length == 0);
|
| | | }
|
| | |
|
| | | /**
|
| | | * * 夿ä¸ä¸ªå¯¹è±¡æ°ç»æ¯å¦é空
|
| | | * |
| | | * @param objects è¦å¤æç对象æ°ç»
|
| | | * @return trueï¼é空 falseï¼ç©º
|
| | | */
|
| | | public static boolean isNotEmpty(Object[] objects)
|
| | | {
|
| | | return !isEmpty(objects);
|
| | | }
|
| | |
|
| | | /**
|
| | | * * 夿ä¸ä¸ªMapæ¯å¦ä¸ºç©º
|
| | | * |
| | | * @param map è¦å¤æçMap
|
| | | * @return trueï¼ä¸ºç©º falseï¼é空
|
| | | */
|
| | | public static boolean isEmpty(Map<?, ?> map)
|
| | | {
|
| | | return isNull(map) || map.isEmpty();
|
| | | }
|
| | |
|
| | | /**
|
| | | * * 夿ä¸ä¸ªMapæ¯å¦ä¸ºç©º
|
| | | * |
| | | * @param map è¦å¤æçMap
|
| | | * @return trueï¼é空 falseï¼ç©º
|
| | | */
|
| | | public static boolean isNotEmpty(Map<?, ?> map)
|
| | | {
|
| | | return !isEmpty(map);
|
| | | }
|
| | |
|
| | | /**
|
| | | * * 夿ä¸ä¸ªå符串æ¯å¦ä¸ºç©ºä¸²
|
| | | * |
| | | * @param str String
|
| | | * @return trueï¼ä¸ºç©º falseï¼é空
|
| | | */
|
| | | public static boolean isEmpty(String str)
|
| | | {
|
| | | return isNull(str) || NULLSTR.equals(str.trim());
|
| | | }
|
| | |
|
| | | /**
|
| | | * * 夿ä¸ä¸ªå符串æ¯å¦ä¸ºé空串
|
| | | * |
| | | * @param str String
|
| | | * @return trueï¼é空串 falseï¼ç©ºä¸²
|
| | | */
|
| | | public static boolean isNotEmpty(String str)
|
| | | {
|
| | | return !isEmpty(str);
|
| | | }
|
| | |
|
| | | /**
|
| | | * * 夿ä¸ä¸ªå¯¹è±¡æ¯å¦ä¸ºç©º
|
| | | * |
| | | * @param object Object
|
| | | * @return trueï¼ä¸ºç©º falseï¼é空
|
| | | */
|
| | | public static boolean isNull(Object object)
|
| | | {
|
| | | return object == null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * * 夿ä¸ä¸ªå¯¹è±¡æ¯å¦é空
|
| | | * |
| | | * @param object Object
|
| | | * @return trueï¼é空 falseï¼ç©º
|
| | | */
|
| | | public static boolean isNotNull(Object object)
|
| | | {
|
| | | return !isNull(object);
|
| | | }
|
| | |
|
| | | /**
|
| | | * * 夿ä¸ä¸ªå¯¹è±¡æ¯å¦æ¯æ°ç»ç±»åï¼Javaåºæ¬åå«çæ°ç»ï¼
|
| | | * |
| | | * @param object 对象
|
| | | * @return trueï¼æ¯æ°ç» falseï¼ä¸æ¯æ°ç»
|
| | | */
|
| | | public static boolean isArray(Object object)
|
| | | {
|
| | | return isNotNull(object) && object.getClass().isArray();
|
| | | }
|
| | |
|
| | | /**
|
| | | * å»ç©ºæ ¼
|
| | | */
|
| | | public static String trim(String str)
|
| | | {
|
| | | return (str == null ? "" : str.trim());
|
| | | }
|
| | |
|
| | | /**
|
| | | * æªåå符串
|
| | | * |
| | | * @param str å符串
|
| | | * @param start å¼å§
|
| | | * @return ç»æ
|
| | | */
|
| | | public static String substring(final String str, int start)
|
| | | {
|
| | | if (str == null)
|
| | | {
|
| | | return NULLSTR;
|
| | | }
|
| | |
|
| | | if (start < 0)
|
| | | {
|
| | | start = str.length() + start;
|
| | | }
|
| | |
|
| | | if (start < 0)
|
| | | {
|
| | | start = 0;
|
| | | }
|
| | | if (start > str.length())
|
| | | {
|
| | | return NULLSTR;
|
| | | }
|
| | |
|
| | | return str.substring(start);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æªåå符串
|
| | | * |
| | | * @param str å符串
|
| | | * @param start å¼å§
|
| | | * @param end ç»æ
|
| | | * @return ç»æ
|
| | | */
|
| | | public static String substring(final String str, int start, int end)
|
| | | {
|
| | | if (str == null)
|
| | | {
|
| | | return NULLSTR;
|
| | | }
|
| | |
|
| | | if (end < 0)
|
| | | {
|
| | | end = str.length() + end;
|
| | | }
|
| | | if (start < 0)
|
| | | {
|
| | | start = str.length() + start;
|
| | | }
|
| | |
|
| | | if (end > str.length())
|
| | | {
|
| | | end = str.length();
|
| | | }
|
| | |
|
| | | if (start > end)
|
| | | {
|
| | | return NULLSTR;
|
| | | }
|
| | |
|
| | | if (start < 0)
|
| | | {
|
| | | start = 0;
|
| | | }
|
| | | if (end < 0)
|
| | | {
|
| | | end = 0;
|
| | | }
|
| | |
|
| | | return str.substring(start, end);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¼å¼åææ¬, {} 表示å ä½ç¬¦<br>
|
| | | * æ¤æ¹æ³åªæ¯ç®åå°å ä½ç¬¦ {} æç
§é¡ºåºæ¿æ¢ä¸ºåæ°<br>
|
| | | * 妿æ³è¾åº {} ä½¿ç¨ \\è½¬ä¹ { å³å¯ï¼å¦ææ³è¾åº {} ä¹åç \ 使ç¨å转ä¹ç¬¦ \\\\ å³å¯<br>
|
| | | * ä¾ï¼<br>
|
| | | * é常使ç¨ï¼format("this is {} for {}", "a", "b") -> this is a for b<br>
|
| | | * 转ä¹{}ï¼ format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
|
| | | * 转ä¹\ï¼ format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
|
| | | * |
| | | * @param template ææ¬æ¨¡æ¿ï¼è¢«æ¿æ¢çé¨åç¨ {} 表示
|
| | | * @param params åæ°å¼
|
| | | * @return æ ¼å¼ååçææ¬
|
| | | */
|
| | | public static String format(String template, Object... params)
|
| | | {
|
| | | if (isEmpty(params) || isEmpty(template))
|
| | | {
|
| | | return template;
|
| | | }
|
| | | return StrFormatter.format(template, params);
|
| | | }
|
| | |
|
| | | /**
|
| | | * å符串转set
|
| | | * |
| | | * @param str å符串
|
| | | * @param sep åé符
|
| | | * @return setéå
|
| | | */
|
| | | public static final Set<String> str2Set(String str, String sep)
|
| | | {
|
| | | return new HashSet<String>(str2List(str, sep, true, false));
|
| | | }
|
| | |
|
| | | /**
|
| | | * å符串转list
|
| | | * |
| | | * @param str å符串
|
| | | * @param sep åé符
|
| | | * @param filterBlank è¿æ»¤çº¯ç©ºç½
|
| | | * @param trim 廿é¦å°¾ç©ºç½
|
| | | * @return listéå
|
| | | */
|
| | | public static final List<String> str2List(String str, String sep, boolean filterBlank, boolean trim)
|
| | | {
|
| | | List<String> list = new ArrayList<String>();
|
| | | if (StringUtils.isEmpty(str))
|
| | | {
|
| | | return list;
|
| | | }
|
| | |
|
| | | // è¿æ»¤ç©ºç½å符串
|
| | | if (filterBlank && StringUtils.isBlank(str))
|
| | | {
|
| | | return list;
|
| | | }
|
| | | String[] split = str.split(sep);
|
| | | for (String string : split)
|
| | | {
|
| | | if (filterBlank && StringUtils.isBlank(string))
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (trim)
|
| | | {
|
| | | string = string.trim();
|
| | | }
|
| | | list.add(string);
|
| | | }
|
| | |
|
| | | return list;
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¸å线转驼峰å½å
|
| | | */
|
| | | public static String toUnderScoreCase(String str)
|
| | | {
|
| | | if (str == null)
|
| | | {
|
| | | return null;
|
| | | }
|
| | | StringBuilder sb = new StringBuilder();
|
| | | // åç½®å符æ¯å¦å¤§å
|
| | | boolean preCharIsUpperCase = true;
|
| | | // å½åå符æ¯å¦å¤§å
|
| | | boolean curreCharIsUpperCase = true;
|
| | | // ä¸ä¸å符æ¯å¦å¤§å
|
| | | boolean nexteCharIsUpperCase = true;
|
| | | for (int i = 0; i < str.length(); i++)
|
| | | {
|
| | | char c = str.charAt(i);
|
| | | if (i > 0)
|
| | | {
|
| | | preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
|
| | | }
|
| | | else
|
| | | {
|
| | | preCharIsUpperCase = false;
|
| | | }
|
| | |
|
| | | curreCharIsUpperCase = Character.isUpperCase(c);
|
| | |
|
| | | if (i < (str.length() - 1))
|
| | | {
|
| | | nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
|
| | | }
|
| | |
|
| | | if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase)
|
| | | {
|
| | | sb.append(SEPARATOR);
|
| | | }
|
| | | else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase)
|
| | | {
|
| | | sb.append(SEPARATOR);
|
| | | }
|
| | | sb.append(Character.toLowerCase(c));
|
| | | }
|
| | |
|
| | | return sb.toString();
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¯å¦å
å«å符串
|
| | | * |
| | | * @param str éªè¯å符串
|
| | | * @param strs å符串ç»
|
| | | * @return å
å«è¿åtrue
|
| | | */
|
| | | public static boolean inStringIgnoreCase(String str, String... strs)
|
| | | {
|
| | | if (str != null && strs != null)
|
| | | {
|
| | | for (String s : strs)
|
| | | {
|
| | | if (str.equalsIgnoreCase(trim(s)))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | /**
|
| | | * å°ä¸åçº¿å¤§åæ¹å¼å½åçå符串转æ¢ä¸ºé©¼å³°å¼ãå¦æè½¬æ¢åçä¸åçº¿å¤§åæ¹å¼å½åçå符串为空ï¼åè¿å空å符串ã ä¾å¦ï¼HELLO_WORLD->HelloWorld
|
| | | * |
| | | * @param name 转æ¢åçä¸åçº¿å¤§åæ¹å¼å½åçå符串
|
| | | * @return 转æ¢åç驼峰å¼å½åçå符串
|
| | | */
|
| | | public static String convertToCamelCase(String name)
|
| | | {
|
| | | StringBuilder result = new StringBuilder();
|
| | | // å¿«éæ£æ¥
|
| | | if (name == null || name.isEmpty())
|
| | | {
|
| | | // 没å¿
è¦è½¬æ¢
|
| | | return "";
|
| | | }
|
| | | else if (!name.contains("_"))
|
| | | {
|
| | | // ä¸å«ä¸å线ï¼ä»
å°é¦åæ¯å¤§å
|
| | | return name.substring(0, 1).toUpperCase() + name.substring(1);
|
| | | }
|
| | | // ç¨ä¸å线å°åå§å符串åå²
|
| | | String[] camels = name.split("_");
|
| | | for (String camel : camels)
|
| | | {
|
| | | // è·³è¿åå§å符串ä¸å¼å¤´ãç»å°¾ç䏿¢çº¿æåéä¸å线
|
| | | if (camel.isEmpty())
|
| | | {
|
| | | continue;
|
| | | }
|
| | | // é¦åæ¯å¤§å
|
| | | result.append(camel.substring(0, 1).toUpperCase());
|
| | | result.append(camel.substring(1).toLowerCase());
|
| | | }
|
| | | return result.toString();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 驼峰å¼å½åæ³ ä¾å¦ï¼user_name->userName
|
| | | */
|
| | | public static String toCamelCase(String s)
|
| | | {
|
| | | if (s == null)
|
| | | {
|
| | | return null;
|
| | | }
|
| | | s = s.toLowerCase();
|
| | | StringBuilder sb = new StringBuilder(s.length());
|
| | | boolean upperCase = false;
|
| | | for (int i = 0; i < s.length(); i++)
|
| | | {
|
| | | char c = s.charAt(i);
|
| | |
|
| | | if (c == SEPARATOR)
|
| | | {
|
| | | upperCase = true;
|
| | | }
|
| | | else if (upperCase)
|
| | | {
|
| | | sb.append(Character.toUpperCase(c));
|
| | | upperCase = false;
|
| | | }
|
| | | else
|
| | | {
|
| | | sb.append(c);
|
| | | }
|
| | | }
|
| | | return sb.toString();
|
| | | }
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils;
|
| | |
|
| | | import java.util.concurrent.CancellationException;
|
| | | import java.util.concurrent.ExecutionException;
|
| | | import java.util.concurrent.ExecutorService;
|
| | | import java.util.concurrent.Future;
|
| | | import java.util.concurrent.TimeUnit;
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | |
|
| | | /**
|
| | | * 线ç¨ç¸å
³å·¥å
·ç±».
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class Threads
|
| | | {
|
| | | private static final Logger logger = LoggerFactory.getLogger(Threads.class);
|
| | |
|
| | | /**
|
| | | * sleepçå¾
,åä½ä¸ºæ¯«ç§
|
| | | */
|
| | | public static void sleep(long milliseconds)
|
| | | {
|
| | | try
|
| | | {
|
| | | Thread.sleep(milliseconds);
|
| | | }
|
| | | catch (InterruptedException e)
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * åæ¢çº¿ç¨æ±
|
| | | * å
使ç¨shutdown, åæ¢æ¥æ¶æ°ä»»å¡å¹¶å°è¯å®æææå·²åå¨ä»»å¡.
|
| | | * 妿è¶
æ¶, åè°ç¨shutdownNow, åæ¶å¨workQueueä¸Pendingçä»»å¡,并䏿ææé»å¡å½æ°.
|
| | | * 妿ä»äººè¶
æï¼åå¼·å¶éåº.
|
| | | * å¦å¯¹å¨shutdownæ¶çº¿ç¨æ¬èº«è¢«è°ç¨ä¸æåäºå¤ç.
|
| | | */
|
| | | public static void shutdownAndAwaitTermination(ExecutorService pool)
|
| | | {
|
| | | if (pool != null && !pool.isShutdown())
|
| | | {
|
| | | pool.shutdown();
|
| | | try
|
| | | {
|
| | | if (!pool.awaitTermination(120, TimeUnit.SECONDS))
|
| | | {
|
| | | pool.shutdownNow();
|
| | | if (!pool.awaitTermination(120, TimeUnit.SECONDS))
|
| | | {
|
| | | logger.info("Pool did not terminate");
|
| | | }
|
| | | }
|
| | | }
|
| | | catch (InterruptedException ie)
|
| | | {
|
| | | pool.shutdownNow();
|
| | | Thread.currentThread().interrupt();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * æå°çº¿ç¨å¼å¸¸ä¿¡æ¯
|
| | | */
|
| | | public static void printException(Runnable r, Throwable t)
|
| | | {
|
| | | if (t == null && r instanceof Future<?>)
|
| | | {
|
| | | try
|
| | | {
|
| | | Future<?> future = (Future<?>) r;
|
| | | if (future.isDone())
|
| | | {
|
| | | future.get();
|
| | | }
|
| | | }
|
| | | catch (CancellationException ce)
|
| | | {
|
| | | t = ce;
|
| | | }
|
| | | catch (ExecutionException ee)
|
| | | {
|
| | | t = ee.getCause();
|
| | | }
|
| | | catch (InterruptedException ie)
|
| | | {
|
| | | Thread.currentThread().interrupt();
|
| | | }
|
| | | }
|
| | | if (t != null)
|
| | | {
|
| | | logger.error(t.getMessage(), t);
|
| | | }
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils;
|
| | |
|
| | | import java.awt.Color;
|
| | | import java.awt.Font;
|
| | | import java.awt.Graphics;
|
| | | import java.awt.Graphics2D;
|
| | | import java.awt.RenderingHints;
|
| | | import java.awt.geom.AffineTransform;
|
| | | import java.awt.image.BufferedImage;
|
| | | import java.io.IOException;
|
| | | import java.io.OutputStream;
|
| | | import java.security.SecureRandom;
|
| | | import java.util.Arrays;
|
| | | import java.util.Random;
|
| | | import javax.imageio.ImageIO;
|
| | |
|
| | | /**
|
| | | * éªè¯ç å·¥å
·ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class VerifyCodeUtils
|
| | | {
|
| | | // 使ç¨å°Algerianåä½ï¼ç³»ç»é没æçè¯éè¦å®è£
åä½ï¼åä½åªæ¾ç¤ºå¤§åï¼å»æäº1,0,i,oå ä¸ªå®¹ææ··æ·çå符
|
| | | public static final String VERIFY_CODES = "123456789ABCDEFGHJKLMNPQRSTUVWXYZ";
|
| | |
|
| | | private static Random random = new SecureRandom();
|
| | |
|
| | | /**
|
| | | * 使ç¨ç³»ç»é»è®¤å符æºçæéªè¯ç
|
| | | * |
| | | * @param verifySize éªè¯ç é¿åº¦
|
| | | * @return
|
| | | */
|
| | | public static String generateVerifyCode(int verifySize)
|
| | | {
|
| | | return generateVerifyCode(verifySize, VERIFY_CODES);
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä½¿ç¨æå®æºçæéªè¯ç
|
| | | * |
| | | * @param verifySize éªè¯ç é¿åº¦
|
| | | * @param sources éªè¯ç å符æº
|
| | | * @return
|
| | | */
|
| | | public static String generateVerifyCode(int verifySize, String sources)
|
| | | {
|
| | | if (sources == null || sources.length() == 0)
|
| | | {
|
| | | sources = VERIFY_CODES;
|
| | | }
|
| | | int codesLen = sources.length();
|
| | | Random rand = new Random(System.currentTimeMillis());
|
| | | StringBuilder verifyCode = new StringBuilder(verifySize);
|
| | | for (int i = 0; i < verifySize; i++)
|
| | | {
|
| | | verifyCode.append(sources.charAt(rand.nextInt(codesLen - 1)));
|
| | | }
|
| | | return verifyCode.toString();
|
| | | }
|
| | |
|
| | | /**
|
| | | * è¾åºæå®éªè¯ç å¾çæµ
|
| | | * |
| | | * @param w
|
| | | * @param h
|
| | | * @param os
|
| | | * @param code
|
| | | * @throws IOException
|
| | | */
|
| | | public static void outputImage(int w, int h, OutputStream os, String code) throws IOException
|
| | | {
|
| | | int verifySize = code.length();
|
| | | BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
|
| | | Random rand = new Random();
|
| | | Graphics2D g2 = image.createGraphics();
|
| | | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
| | | Color[] colors = new Color[5];
|
| | | Color[] colorSpaces = new Color[] { Color.WHITE, Color.CYAN, Color.GRAY, Color.LIGHT_GRAY, Color.MAGENTA,
|
| | | Color.ORANGE, Color.PINK, Color.YELLOW };
|
| | | float[] fractions = new float[colors.length];
|
| | | for (int i = 0; i < colors.length; i++)
|
| | | {
|
| | | colors[i] = colorSpaces[rand.nextInt(colorSpaces.length)];
|
| | | fractions[i] = rand.nextFloat();
|
| | | }
|
| | | Arrays.sort(fractions);
|
| | |
|
| | | g2.setColor(Color.GRAY);// 设置边æ¡è²
|
| | | g2.fillRect(0, 0, w, h);
|
| | |
|
| | | Color c = getRandColor(200, 250);
|
| | | g2.setColor(c);// è®¾ç½®èæ¯è²
|
| | | g2.fillRect(0, 2, w, h - 4);
|
| | |
|
| | | // ç»å¶å¹²æ°çº¿
|
| | | Random random = new Random();
|
| | | g2.setColor(getRandColor(160, 200));// 设置线æ¡çé¢è²
|
| | | for (int i = 0; i < 20; i++)
|
| | | {
|
| | | int x = random.nextInt(w - 1);
|
| | | int y = random.nextInt(h - 1);
|
| | | int xl = random.nextInt(6) + 1;
|
| | | int yl = random.nextInt(12) + 1;
|
| | | g2.drawLine(x, y, x + xl + 40, y + yl + 20);
|
| | | }
|
| | |
|
| | | // æ·»å åªç¹
|
| | | float yawpRate = 0.05f;// åªå£°ç
|
| | | int area = (int) (yawpRate * w * h);
|
| | | for (int i = 0; i < area; i++)
|
| | | {
|
| | | int x = random.nextInt(w);
|
| | | int y = random.nextInt(h);
|
| | | int rgb = getRandomIntColor();
|
| | | image.setRGB(x, y, rgb);
|
| | | }
|
| | |
|
| | | shear(g2, w, h, c);// 使å¾çææ²
|
| | |
|
| | | g2.setColor(getRandColor(100, 160));
|
| | | int fontSize = h - 4;
|
| | | Font font = new Font("Algerian", Font.ITALIC, fontSize);
|
| | | g2.setFont(font);
|
| | | char[] chars = code.toCharArray();
|
| | | for (int i = 0; i < verifySize; i++)
|
| | | {
|
| | | AffineTransform affine = new AffineTransform();
|
| | | affine.setToRotation(Math.PI / 4 * rand.nextDouble() * (rand.nextBoolean() ? 1 : -1),
|
| | | (w / verifySize) * i + fontSize / 2, h / 2);
|
| | | g2.setTransform(affine);
|
| | | g2.drawChars(chars, i, 1, ((w - 10) / verifySize) * i + 5, h / 2 + fontSize / 2 - 10);
|
| | | }
|
| | |
|
| | | g2.dispose();
|
| | | ImageIO.write(image, "jpg", os);
|
| | | }
|
| | |
|
| | | private static Color getRandColor(int fc, int bc)
|
| | | {
|
| | | if (fc > 255)
|
| | | fc = 255;
|
| | | if (bc > 255)
|
| | | bc = 255;
|
| | | int r = fc + random.nextInt(bc - fc);
|
| | | int g = fc + random.nextInt(bc - fc);
|
| | | int b = fc + random.nextInt(bc - fc);
|
| | | return new Color(r, g, b);
|
| | | }
|
| | |
|
| | | private static int getRandomIntColor()
|
| | | {
|
| | | int[] rgb = getRandomRgb();
|
| | | int color = 0;
|
| | | for (int c : rgb)
|
| | | {
|
| | | color = color << 8;
|
| | | color = color | c;
|
| | | }
|
| | | return color;
|
| | | }
|
| | |
|
| | | private static int[] getRandomRgb()
|
| | | {
|
| | | int[] rgb = new int[3];
|
| | | for (int i = 0; i < 3; i++)
|
| | | {
|
| | | rgb[i] = random.nextInt(255);
|
| | | }
|
| | | return rgb;
|
| | | }
|
| | |
|
| | | private static void shear(Graphics g, int w1, int h1, Color color)
|
| | | {
|
| | | shearX(g, w1, h1, color);
|
| | | shearY(g, w1, h1, color);
|
| | | }
|
| | |
|
| | | private static void shearX(Graphics g, int w1, int h1, Color color)
|
| | | {
|
| | |
|
| | | int period = random.nextInt(2);
|
| | |
|
| | | boolean borderGap = true;
|
| | | int frames = 1;
|
| | | int phase = random.nextInt(2);
|
| | |
|
| | | for (int i = 0; i < h1; i++)
|
| | | {
|
| | | double d = (double) (period >> 1)
|
| | | * Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames);
|
| | | g.copyArea(0, i, w1, 1, (int) d, 0);
|
| | | if (borderGap)
|
| | | {
|
| | | g.setColor(color);
|
| | | g.drawLine((int) d, i, 0, i);
|
| | | g.drawLine((int) d + w1, i, w1, i);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private static void shearY(Graphics g, int w1, int h1, Color color)
|
| | | {
|
| | |
|
| | | int period = random.nextInt(40) + 10; // 50;
|
| | |
|
| | | boolean borderGap = true;
|
| | | int frames = 20;
|
| | | int phase = 7;
|
| | | for (int i = 0; i < w1; i++)
|
| | | {
|
| | | double d = (double) (period >> 1)
|
| | | * Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames);
|
| | | g.copyArea(i, 0, 1, h1, 0, (int) d);
|
| | | if (borderGap)
|
| | | {
|
| | | g.setColor(color);
|
| | | g.drawLine(i, (int) d, i, 0);
|
| | | g.drawLine(i, (int) d + h1, i, h1);
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.file;
|
| | |
|
| | | import java.io.File;
|
| | | import java.io.IOException;
|
| | | import org.apache.commons.io.FilenameUtils;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import com.ruoyi.common.constant.Constants;
|
| | | import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException;
|
| | | import com.ruoyi.common.exception.file.FileSizeLimitExceededException;
|
| | | import com.ruoyi.common.exception.file.InvalidExtensionException;
|
| | | import com.ruoyi.common.utils.DateUtils;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.utils.security.Md5Utils;
|
| | | import com.ruoyi.framework.config.RuoYiConfig;
|
| | |
|
| | | /**
|
| | | * æä»¶ä¸ä¼ å·¥å
·ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class FileUploadUtils
|
| | | {
|
| | | /**
|
| | | * é»è®¤å¤§å° 50M
|
| | | */
|
| | | public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024;
|
| | |
|
| | | /**
|
| | | * é»è®¤çæä»¶åæå¤§é¿åº¦ 100
|
| | | */
|
| | | public static final int DEFAULT_FILE_NAME_LENGTH = 100;
|
| | |
|
| | | /**
|
| | | * é»è®¤ä¸ä¼ çå°å
|
| | | */
|
| | | private static String defaultBaseDir = RuoYiConfig.getProfile();
|
| | |
|
| | | private static int counter = 0;
|
| | |
|
| | | public static void setDefaultBaseDir(String defaultBaseDir)
|
| | | {
|
| | | FileUploadUtils.defaultBaseDir = defaultBaseDir;
|
| | | }
|
| | |
|
| | | public static String getDefaultBaseDir()
|
| | | {
|
| | | return defaultBaseDir;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 以é»è®¤é
ç½®è¿è¡æä»¶ä¸ä¼
|
| | | *
|
| | | * @param file ä¸ä¼ çæä»¶
|
| | | * @return æä»¶åç§°
|
| | | * @throws Exception
|
| | | */
|
| | | public static final String upload(MultipartFile file) throws IOException
|
| | | {
|
| | | try
|
| | | {
|
| | | return upload(getDefaultBaseDir(), file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | throw new IOException(e.getMessage(), e);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ ¹æ®æä»¶è·¯å¾ä¸ä¼
|
| | | *
|
| | | * @param baseDir ç¸å¯¹åºç¨çåºç®å½
|
| | | * @param file ä¸ä¼ çæä»¶
|
| | | * @return æä»¶åç§°
|
| | | * @throws IOException
|
| | | */
|
| | | public static final String upload(String baseDir, MultipartFile file) throws IOException
|
| | | {
|
| | | try
|
| | | {
|
| | | return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | throw new IOException(e.getMessage(), e);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * æä»¶ä¸ä¼
|
| | | *
|
| | | * @param baseDir ç¸å¯¹åºç¨çåºç®å½
|
| | | * @param file ä¸ä¼ çæä»¶
|
| | | * @param extension ä¸ä¼ æä»¶ç±»å
|
| | | * @return è¿åä¸ä¼ æåçæä»¶å
|
| | | * @throws FileSizeLimitExceededException 妿è¶
åºæå¤§å¤§å°
|
| | | * @throws FileNameLengthLimitExceededException æä»¶å太é¿
|
| | | * @throws IOException æ¯å¦è¯»åæä»¶åºéæ¶
|
| | | * @throws InvalidExtensionException æä»¶æ ¡éªå¼å¸¸
|
| | | */
|
| | | public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension)
|
| | | throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
|
| | | InvalidExtensionException
|
| | | {
|
| | | int fileNamelength = file.getOriginalFilename().length();
|
| | | if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
|
| | | {
|
| | | throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
|
| | | }
|
| | |
|
| | | assertAllowed(file, allowedExtension);
|
| | |
|
| | | String fileName = extractFilename(file);
|
| | |
|
| | | File desc = getAbsoluteFile(baseDir, fileName);
|
| | | file.transferTo(desc);
|
| | | String pathFileName = getPathFileName(baseDir, fileName);
|
| | | return pathFileName;
|
| | | }
|
| | |
|
| | | /**
|
| | | * ç¼ç æä»¶å
|
| | | */
|
| | | public static final String extractFilename(MultipartFile file)
|
| | | {
|
| | | String fileName = file.getOriginalFilename();
|
| | | String extension = getExtension(file);
|
| | | fileName = DateUtils.datePath() + "/" + encodingFilename(fileName) + "." + extension;
|
| | | return fileName;
|
| | | }
|
| | |
|
| | | private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
| | | {
|
| | | File desc = new File(uploadDir + File.separator + fileName);
|
| | |
|
| | | if (!desc.getParentFile().exists())
|
| | | {
|
| | | desc.getParentFile().mkdirs();
|
| | | }
|
| | | if (!desc.exists())
|
| | | {
|
| | | desc.createNewFile();
|
| | | }
|
| | | return desc;
|
| | | }
|
| | |
|
| | | private static final String getPathFileName(String uploadDir, String fileName) throws IOException
|
| | | {
|
| | | int dirLastIndex = uploadDir.lastIndexOf("/") + 1;
|
| | | String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
|
| | | String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
|
| | | return pathFileName;
|
| | | }
|
| | |
|
| | | /**
|
| | | * ç¼ç æä»¶å
|
| | | */
|
| | | private static final String encodingFilename(String fileName)
|
| | | {
|
| | | fileName = fileName.replace("_", " ");
|
| | | fileName = Md5Utils.hash(fileName + System.nanoTime() + counter++);
|
| | | return fileName;
|
| | | }
|
| | |
|
| | | /**
|
| | | * æä»¶å¤§å°æ ¡éª
|
| | | *
|
| | | * @param file ä¸ä¼ çæä»¶
|
| | | * @return
|
| | | * @throws FileSizeLimitExceededException 妿è¶
åºæå¤§å¤§å°
|
| | | * @throws InvalidExtensionException
|
| | | */
|
| | | public static final void assertAllowed(MultipartFile file, String[] allowedExtension)
|
| | | throws FileSizeLimitExceededException, InvalidExtensionException
|
| | | {
|
| | | long size = file.getSize();
|
| | | if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE)
|
| | | {
|
| | | throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024);
|
| | | }
|
| | |
|
| | | String fileName = file.getOriginalFilename();
|
| | | String extension = getExtension(file);
|
| | | if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension))
|
| | | {
|
| | | if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION)
|
| | | {
|
| | | throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
|
| | | fileName);
|
| | | }
|
| | | else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION)
|
| | | {
|
| | | throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension,
|
| | | fileName);
|
| | | }
|
| | | else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION)
|
| | | {
|
| | | throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
|
| | | fileName);
|
| | | }
|
| | | else
|
| | | {
|
| | | throw new InvalidExtensionException(allowedExtension, extension, fileName);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 夿MIMEç±»åæ¯å¦æ¯å
许çMIMEç±»å
|
| | | *
|
| | | * @param extension
|
| | | * @param allowedExtension
|
| | | * @return
|
| | | */
|
| | | public static final boolean isAllowedExtension(String extension, String[] allowedExtension)
|
| | | {
|
| | | for (String str : allowedExtension)
|
| | | {
|
| | | if (str.equalsIgnoreCase(extension))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åæä»¶åçåç¼
|
| | | * |
| | | * @param file 表åæä»¶
|
| | | * @return åç¼å
|
| | | */
|
| | | public static final String getExtension(MultipartFile file)
|
| | | {
|
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename());
|
| | | if (StringUtils.isEmpty(extension))
|
| | | {
|
| | | extension = MimeTypeUtils.getExtension(file.getContentType());
|
| | | }
|
| | | return extension;
|
| | | }
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.file;
|
| | |
|
| | | import java.io.File;
|
| | | import java.io.FileInputStream;
|
| | | import java.io.FileNotFoundException;
|
| | | import java.io.IOException;
|
| | | import java.io.OutputStream;
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.net.URLEncoder;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | /**
|
| | | * æä»¶å¤çå·¥å
·ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class FileUtils
|
| | | {
|
| | | public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
|
| | |
|
| | | /**
|
| | | * è¾åºæå®æä»¶çbyteæ°ç»
|
| | | * |
| | | * @param filePath æä»¶è·¯å¾
|
| | | * @param os è¾åºæµ
|
| | | * @return
|
| | | */
|
| | | public static void writeBytes(String filePath, OutputStream os) throws IOException
|
| | | {
|
| | | FileInputStream fis = null;
|
| | | try
|
| | | {
|
| | | File file = new File(filePath);
|
| | | if (!file.exists())
|
| | | {
|
| | | throw new FileNotFoundException(filePath);
|
| | | }
|
| | | fis = new FileInputStream(file);
|
| | | byte[] b = new byte[1024];
|
| | | int length;
|
| | | while ((length = fis.read(b)) > 0)
|
| | | {
|
| | | os.write(b, 0, length);
|
| | | }
|
| | | }
|
| | | catch (IOException e)
|
| | | {
|
| | | throw e;
|
| | | }
|
| | | finally
|
| | | {
|
| | | if (os != null)
|
| | | {
|
| | | try
|
| | | {
|
| | | os.close();
|
| | | }
|
| | | catch (IOException e1)
|
| | | {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | if (fis != null)
|
| | | {
|
| | | try
|
| | | {
|
| | | fis.close();
|
| | | }
|
| | | catch (IOException e1)
|
| | | {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * å 餿件
|
| | | * |
| | | * @param filePath æä»¶
|
| | | * @return
|
| | | */
|
| | | public static boolean deleteFile(String filePath)
|
| | | {
|
| | | boolean flag = false;
|
| | | File file = new File(filePath);
|
| | | // è·¯å¾ä¸ºæä»¶ä¸ä¸ä¸ºç©ºåè¿è¡å é¤
|
| | | if (file.isFile() && file.exists())
|
| | | {
|
| | | file.delete();
|
| | | flag = true;
|
| | | }
|
| | | return flag;
|
| | | }
|
| | |
|
| | | /**
|
| | | * æä»¶åç§°éªè¯
|
| | | * |
| | | * @param filename æä»¶åç§°
|
| | | * @return true æ£å¸¸ false éæ³
|
| | | */
|
| | | public static boolean isValidFilename(String filename)
|
| | | {
|
| | | return filename.matches(FILENAME_PATTERN);
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¸è½½æä»¶åéæ°ç¼ç
|
| | | * |
| | | * @param request 请æ±å¯¹è±¡
|
| | | * @param fileName æä»¶å
|
| | | * @return ç¼ç åçæä»¶å
|
| | | */
|
| | | public static String setFileDownloadHeader(HttpServletRequest request, String fileName)
|
| | | throws UnsupportedEncodingException
|
| | | {
|
| | | final String agent = request.getHeader("USER-AGENT");
|
| | | String filename = fileName;
|
| | | if (agent.contains("MSIE"))
|
| | | {
|
| | | // IEæµè§å¨
|
| | | filename = URLEncoder.encode(filename, "utf-8");
|
| | | filename = filename.replace("+", " ");
|
| | | }
|
| | | else if (agent.contains("Firefox"))
|
| | | {
|
| | | // ç«çæµè§å¨
|
| | | filename = new String(fileName.getBytes(), "ISO8859-1");
|
| | | }
|
| | | else if (agent.contains("Chrome"))
|
| | | {
|
| | | // googleæµè§å¨
|
| | | filename = URLEncoder.encode(filename, "utf-8");
|
| | | }
|
| | | else
|
| | | {
|
| | | // å
¶å®æµè§å¨
|
| | | filename = URLEncoder.encode(filename, "utf-8");
|
| | | }
|
| | | return filename;
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.file;
|
| | |
|
| | | /**
|
| | | * åªä½ç±»åå·¥å
·ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class MimeTypeUtils
|
| | | {
|
| | | public static final String IMAGE_PNG = "image/png";
|
| | |
|
| | | public static final String IMAGE_JPG = "image/jpg";
|
| | |
|
| | | public static final String IMAGE_JPEG = "image/jpeg";
|
| | |
|
| | | public static final String IMAGE_BMP = "image/bmp";
|
| | |
|
| | | public static final String IMAGE_GIF = "image/gif";
|
| | | |
| | | public static final String[] IMAGE_EXTENSION = { "bmp", "gif", "jpg", "jpeg", "png" };
|
| | |
|
| | | public static final String[] FLASH_EXTENSION = { "swf", "flv" };
|
| | |
|
| | | public static final String[] MEDIA_EXTENSION = { "swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg",
|
| | | "asf", "rm", "rmvb" };
|
| | |
|
| | | public static final String[] DEFAULT_ALLOWED_EXTENSION = {
|
| | | // å¾ç
|
| | | "bmp", "gif", "jpg", "jpeg", "png",
|
| | | // word excel powerpoint
|
| | | "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt",
|
| | | // å缩æä»¶
|
| | | "rar", "zip", "gz", "bz2",
|
| | | // pdf
|
| | | "pdf" };
|
| | |
|
| | | public static String getExtension(String prefix)
|
| | | {
|
| | | switch (prefix)
|
| | | {
|
| | | case IMAGE_PNG:
|
| | | return "png";
|
| | | case IMAGE_JPG:
|
| | | return "jpg";
|
| | | case IMAGE_JPEG:
|
| | | return "jpeg";
|
| | | case IMAGE_BMP:
|
| | | return "bmp";
|
| | | case IMAGE_GIF:
|
| | | return "gif";
|
| | | default:
|
| | | return "";
|
| | | }
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.html;
|
| | |
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | |
|
| | | /**
|
| | | * 转ä¹åå转ä¹å·¥å
·ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class EscapeUtil
|
| | | {
|
| | | public static final String RE_HTML_MARK = "(<[^<]*?>)|(<[\\s]*?/[^<]*?>)|(<[^<]*?/[\\s]*?>)";
|
| | |
|
| | | private static final char[][] TEXT = new char[64][];
|
| | |
|
| | | static
|
| | | {
|
| | | for (int i = 0; i < 64; i++)
|
| | | {
|
| | | TEXT[i] = new char[] { (char) i };
|
| | | }
|
| | |
|
| | | // special HTML characters
|
| | | TEXT['\''] = "'".toCharArray(); // åå¼å·
|
| | | TEXT['"'] = """.toCharArray(); // åå¼å·
|
| | | TEXT['&'] = "&".toCharArray(); // &符
|
| | | TEXT['<'] = "<".toCharArray(); // å°äºå·
|
| | | TEXT['>'] = ">".toCharArray(); // 大äºå·
|
| | | }
|
| | |
|
| | | /**
|
| | | * è½¬ä¹ææ¬ä¸çHTMLå符为å®å
¨çå符
|
| | | * |
| | | * @param text 被转ä¹çææ¬
|
| | | * @return 转ä¹åçææ¬
|
| | | */
|
| | | public static String escape(String text)
|
| | | {
|
| | | return encode(text);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è¿å被转ä¹çHTMLç¹æ®å符
|
| | | * |
| | | * @param content å
å«è½¬ä¹ç¬¦çHTMLå
容
|
| | | * @return 转æ¢åçå符串
|
| | | */
|
| | | public static String unescape(String content)
|
| | | {
|
| | | return decode(content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¸
餿æHTMLæ ç¾ï¼ä½æ¯ä¸å 餿 ç¾å
çå
容
|
| | | * |
| | | * @param content ææ¬
|
| | | * @return æ¸
餿 ç¾åçææ¬
|
| | | */
|
| | | public static String clean(String content)
|
| | | {
|
| | | return content.replaceAll(RE_HTML_MARK, "");
|
| | | }
|
| | |
|
| | | /**
|
| | | * Escapeç¼ç
|
| | | * |
| | | * @param text 被ç¼ç çææ¬
|
| | | * @return ç¼ç åçå符
|
| | | */
|
| | | private static String encode(String text)
|
| | | {
|
| | | int len;
|
| | | if ((text == null) || ((len = text.length()) == 0))
|
| | | {
|
| | | return StringUtils.EMPTY;
|
| | | }
|
| | | StringBuilder buffer = new StringBuilder(len + (len >> 2));
|
| | | char c;
|
| | | for (int i = 0; i < len; i++)
|
| | | {
|
| | | c = text.charAt(i);
|
| | | if (c < 64)
|
| | | {
|
| | | buffer.append(TEXT[c]);
|
| | | }
|
| | | else
|
| | | {
|
| | | buffer.append(c);
|
| | | }
|
| | | }
|
| | | return buffer.toString();
|
| | | }
|
| | |
|
| | | /**
|
| | | * Escapeè§£ç
|
| | | * |
| | | * @param content 被转ä¹çå
容
|
| | | * @return è§£ç åçå符串
|
| | | */
|
| | | public static String decode(String content)
|
| | | {
|
| | | if (StringUtils.isEmpty(content))
|
| | | {
|
| | | return content;
|
| | | }
|
| | |
|
| | | StringBuilder tmp = new StringBuilder(content.length());
|
| | | int lastPos = 0, pos = 0;
|
| | | char ch;
|
| | | while (lastPos < content.length())
|
| | | {
|
| | | pos = content.indexOf("%", lastPos);
|
| | | if (pos == lastPos)
|
| | | {
|
| | | if (content.charAt(pos + 1) == 'u')
|
| | | {
|
| | | ch = (char) Integer.parseInt(content.substring(pos + 2, pos + 6), 16);
|
| | | tmp.append(ch);
|
| | | lastPos = pos + 6;
|
| | | }
|
| | | else
|
| | | {
|
| | | ch = (char) Integer.parseInt(content.substring(pos + 1, pos + 3), 16);
|
| | | tmp.append(ch);
|
| | | lastPos = pos + 3;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (pos == -1)
|
| | | {
|
| | | tmp.append(content.substring(lastPos));
|
| | | lastPos = content.length();
|
| | | }
|
| | | else
|
| | | {
|
| | | tmp.append(content.substring(lastPos, pos));
|
| | | lastPos = pos;
|
| | | }
|
| | | }
|
| | | }
|
| | | return tmp.toString();
|
| | | }
|
| | |
|
| | | public static void main(String[] args)
|
| | | {
|
| | | String html = "<script>alert(1);</script>";
|
| | | System.out.println(EscapeUtil.clean(html));
|
| | | System.out.println(EscapeUtil.escape(html));
|
| | | System.out.println(EscapeUtil.unescape(html));
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.http;
|
| | |
|
| | | import java.io.BufferedReader;
|
| | | import java.io.IOException;
|
| | | import java.io.InputStream;
|
| | | import java.io.InputStreamReader;
|
| | | import java.io.PrintWriter;
|
| | | import java.net.ConnectException;
|
| | | import java.net.SocketTimeoutException;
|
| | | import java.net.URL;
|
| | | import java.net.URLConnection;
|
| | | import java.security.cert.X509Certificate;
|
| | | import javax.net.ssl.HostnameVerifier;
|
| | | import javax.net.ssl.HttpsURLConnection;
|
| | | import javax.net.ssl.SSLContext;
|
| | | import javax.net.ssl.SSLSession;
|
| | | import javax.net.ssl.TrustManager;
|
| | | import javax.net.ssl.X509TrustManager;
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | |
|
| | | /**
|
| | | * éç¨httpåéæ¹æ³
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class HttpUtils
|
| | | {
|
| | | private static final Logger log = LoggerFactory.getLogger(HttpUtils.class);
|
| | |
|
| | | /**
|
| | | * åæå® URL åéGETæ¹æ³ç请æ±
|
| | | *
|
| | | * @param url åé请æ±ç URL
|
| | | * @param param 请æ±åæ°ï¼è¯·æ±åæ°åºè¯¥æ¯ name1=value1&name2=value2 çå½¢å¼ã
|
| | | * @return æä»£è¡¨è¿ç¨èµæºçååºç»æ
|
| | | */
|
| | | public static String sendGet(String url, String param)
|
| | | {
|
| | | StringBuilder result = new StringBuilder();
|
| | | BufferedReader in = null;
|
| | | try
|
| | | {
|
| | | String urlNameString = url + "?" + param;
|
| | | log.info("sendGet - {}", urlNameString);
|
| | | URL realUrl = new URL(urlNameString);
|
| | | URLConnection connection = realUrl.openConnection();
|
| | | connection.setRequestProperty("accept", "*/*");
|
| | | connection.setRequestProperty("connection", "Keep-Alive");
|
| | | connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
|
| | | connection.connect();
|
| | | in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
| | | String line;
|
| | | while ((line = in.readLine()) != null)
|
| | | {
|
| | | result.append(line);
|
| | | }
|
| | | log.info("recv - {}", result);
|
| | | }
|
| | | catch (ConnectException e)
|
| | | {
|
| | | log.error("è°ç¨HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e);
|
| | | }
|
| | | catch (SocketTimeoutException e)
|
| | | {
|
| | | log.error("è°ç¨HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e);
|
| | | }
|
| | | catch (IOException e)
|
| | | {
|
| | | log.error("è°ç¨HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | log.error("è°ç¨HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e);
|
| | | }
|
| | | finally
|
| | | {
|
| | | try
|
| | | {
|
| | | if (in != null)
|
| | | {
|
| | | in.close();
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | log.error("è°ç¨in.close Exception, url=" + url + ",param=" + param, ex);
|
| | | }
|
| | | }
|
| | | return result.toString();
|
| | | }
|
| | |
|
| | | /**
|
| | | * åæå® URL åéPOSTæ¹æ³ç请æ±
|
| | | *
|
| | | * @param url åé请æ±ç URL
|
| | | * @param param 请æ±åæ°ï¼è¯·æ±åæ°åºè¯¥æ¯ name1=value1&name2=value2 çå½¢å¼ã
|
| | | * @return æä»£è¡¨è¿ç¨èµæºçååºç»æ
|
| | | */
|
| | | public static String sendPost(String url, String param)
|
| | | {
|
| | | PrintWriter out = null;
|
| | | BufferedReader in = null;
|
| | | StringBuilder result = new StringBuilder();
|
| | | try
|
| | | {
|
| | | String urlNameString = url + "?" + param;
|
| | | log.info("sendPost - {}", urlNameString);
|
| | | URL realUrl = new URL(urlNameString);
|
| | | URLConnection conn = realUrl.openConnection();
|
| | | conn.setRequestProperty("accept", "*/*");
|
| | | conn.setRequestProperty("connection", "Keep-Alive");
|
| | | conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
|
| | | conn.setRequestProperty("Accept-Charset", "utf-8");
|
| | | conn.setRequestProperty("contentType", "utf-8");
|
| | | conn.setDoOutput(true);
|
| | | conn.setDoInput(true);
|
| | | out = new PrintWriter(conn.getOutputStream());
|
| | | out.print(param);
|
| | | out.flush();
|
| | | in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
|
| | | String line;
|
| | | while ((line = in.readLine()) != null)
|
| | | {
|
| | | result.append(line);
|
| | | }
|
| | | log.info("recv - {}", result);
|
| | | }
|
| | | catch (ConnectException e)
|
| | | {
|
| | | log.error("è°ç¨HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e);
|
| | | }
|
| | | catch (SocketTimeoutException e)
|
| | | {
|
| | | log.error("è°ç¨HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e);
|
| | | }
|
| | | catch (IOException e)
|
| | | {
|
| | | log.error("è°ç¨HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | log.error("è°ç¨HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e);
|
| | | }
|
| | | finally
|
| | | {
|
| | | try
|
| | | {
|
| | | if (out != null)
|
| | | {
|
| | | out.close();
|
| | | }
|
| | | if (in != null)
|
| | | {
|
| | | in.close();
|
| | | }
|
| | | }
|
| | | catch (IOException ex)
|
| | | {
|
| | | log.error("è°ç¨in.close Exception, url=" + url + ",param=" + param, ex);
|
| | | }
|
| | | }
|
| | | return result.toString();
|
| | | }
|
| | |
|
| | | public static String sendSSLPost(String url, String param)
|
| | | {
|
| | | StringBuilder result = new StringBuilder();
|
| | | String urlNameString = url + "?" + param;
|
| | | try
|
| | | {
|
| | | log.info("sendSSLPost - {}", urlNameString);
|
| | | SSLContext sc = SSLContext.getInstance("SSL");
|
| | | sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom());
|
| | | URL console = new URL(urlNameString);
|
| | | HttpsURLConnection conn = (HttpsURLConnection) console.openConnection();
|
| | | conn.setRequestProperty("accept", "*/*");
|
| | | conn.setRequestProperty("connection", "Keep-Alive");
|
| | | conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
|
| | | conn.setRequestProperty("Accept-Charset", "utf-8");
|
| | | conn.setRequestProperty("contentType", "utf-8");
|
| | | conn.setDoOutput(true);
|
| | | conn.setDoInput(true);
|
| | |
|
| | | conn.setSSLSocketFactory(sc.getSocketFactory());
|
| | | conn.setHostnameVerifier(new TrustAnyHostnameVerifier());
|
| | | conn.connect();
|
| | | InputStream is = conn.getInputStream();
|
| | | BufferedReader br = new BufferedReader(new InputStreamReader(is));
|
| | | String ret = "";
|
| | | while ((ret = br.readLine()) != null)
|
| | | {
|
| | | if (ret != null && !ret.trim().equals(""))
|
| | | {
|
| | | result.append(new String(ret.getBytes("ISO-8859-1"), "utf-8"));
|
| | | }
|
| | | }
|
| | | log.info("recv - {}", result);
|
| | | conn.disconnect();
|
| | | br.close();
|
| | | }
|
| | | catch (ConnectException e)
|
| | | {
|
| | | log.error("è°ç¨HttpUtils.sendSSLPost ConnectException, url=" + url + ",param=" + param, e);
|
| | | }
|
| | | catch (SocketTimeoutException e)
|
| | | {
|
| | | log.error("è°ç¨HttpUtils.sendSSLPost SocketTimeoutException, url=" + url + ",param=" + param, e);
|
| | | }
|
| | | catch (IOException e)
|
| | | {
|
| | | log.error("è°ç¨HttpUtils.sendSSLPost IOException, url=" + url + ",param=" + param, e);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | log.error("è°ç¨HttpsUtil.sendSSLPost Exception, url=" + url + ",param=" + param, e);
|
| | | }
|
| | | return result.toString();
|
| | | }
|
| | |
|
| | | private static class TrustAnyTrustManager implements X509TrustManager
|
| | | {
|
| | | @Override
|
| | | public void checkClientTrusted(X509Certificate[] chain, String authType)
|
| | | {
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void checkServerTrusted(X509Certificate[] chain, String authType)
|
| | | {
|
| | | }
|
| | |
|
| | | @Override
|
| | | public X509Certificate[] getAcceptedIssuers()
|
| | | {
|
| | | return new X509Certificate[] {};
|
| | | }
|
| | | }
|
| | |
|
| | | private static class TrustAnyHostnameVerifier implements HostnameVerifier
|
| | | {
|
| | | @Override
|
| | | public boolean verify(String hostname, SSLSession session)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.ip;
|
| | |
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.utils.http.HttpUtils;
|
| | |
|
| | | /**
|
| | | * è·åå°åç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class AddressUtils
|
| | | {
|
| | | private static final Logger log = LoggerFactory.getLogger(AddressUtils.class);
|
| | |
|
| | | public static final String IP_URL = "http://ip.taobao.com/service/getIpInfo.php";
|
| | |
|
| | | public static String getRealAddressByIP(String ip)
|
| | | {
|
| | | String address = "XX XX";
|
| | | // å
ç½ä¸æ¥è¯¢
|
| | | if (IpUtils.internalIp(ip))
|
| | | {
|
| | | return "å
ç½IP";
|
| | | }
|
| | | String rspStr = HttpUtils.sendPost(IP_URL, "ip=" + ip);
|
| | | if (StringUtils.isEmpty(rspStr))
|
| | | {
|
| | | log.error("è·åå°çä½ç½®å¼å¸¸ {}", ip);
|
| | | return address;
|
| | | }
|
| | | JSONObject obj = JSONObject.parseObject(rspStr);
|
| | | JSONObject data = obj.getObject("data", JSONObject.class);
|
| | | String region = data.getString("region");
|
| | | String city = data.getString("city");
|
| | | address = region + " " + city;
|
| | | return address;
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.ip;
|
| | |
|
| | | import java.net.InetAddress;
|
| | | import java.net.UnknownHostException;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | |
|
| | | /**
|
| | | * è·åIPæ¹æ³
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class IpUtils
|
| | | {
|
| | | public static String getIpAddr(HttpServletRequest request)
|
| | | {
|
| | | if (request == null)
|
| | | {
|
| | | return "unknown";
|
| | | }
|
| | | String ip = request.getHeader("x-forwarded-for");
|
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
|
| | | {
|
| | | ip = request.getHeader("Proxy-Client-IP");
|
| | | }
|
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
|
| | | {
|
| | | ip = request.getHeader("X-Forwarded-For");
|
| | | }
|
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
|
| | | {
|
| | | ip = request.getHeader("WL-Proxy-Client-IP");
|
| | | }
|
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
|
| | | {
|
| | | ip = request.getHeader("X-Real-IP");
|
| | | }
|
| | |
|
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
|
| | | {
|
| | | ip = request.getRemoteAddr();
|
| | | }
|
| | |
|
| | | return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
|
| | | }
|
| | |
|
| | | public static boolean internalIp(String ip)
|
| | | {
|
| | | byte[] addr = textToNumericFormatV4(ip);
|
| | | return internalIp(addr) || "127.0.0.1".equals(ip);
|
| | | }
|
| | |
|
| | | private static boolean internalIp(byte[] addr)
|
| | | {
|
| | | if (StringUtils.isNull(addr) || addr.length < 2)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | final byte b0 = addr[0];
|
| | | final byte b1 = addr[1];
|
| | | // 10.x.x.x/8
|
| | | final byte SECTION_1 = 0x0A;
|
| | | // 172.16.x.x/12
|
| | | final byte SECTION_2 = (byte) 0xAC;
|
| | | final byte SECTION_3 = (byte) 0x10;
|
| | | final byte SECTION_4 = (byte) 0x1F;
|
| | | // 192.168.x.x/16
|
| | | final byte SECTION_5 = (byte) 0xC0;
|
| | | final byte SECTION_6 = (byte) 0xA8;
|
| | | switch (b0)
|
| | | {
|
| | | case SECTION_1:
|
| | | return true;
|
| | | case SECTION_2:
|
| | | if (b1 >= SECTION_3 && b1 <= SECTION_4)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | case SECTION_5:
|
| | | switch (b1)
|
| | | {
|
| | | case SECTION_6:
|
| | | return true;
|
| | | }
|
| | | default:
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * å°IPv4å°åè½¬æ¢æåè
|
| | | * |
| | | * @param text IPv4å°å
|
| | | * @return byte åè
|
| | | */
|
| | | public static byte[] textToNumericFormatV4(String text)
|
| | | {
|
| | | if (text.length() == 0)
|
| | | {
|
| | | return null;
|
| | | }
|
| | |
|
| | | byte[] bytes = new byte[4];
|
| | | String[] elements = text.split("\\.", -1);
|
| | | try
|
| | | {
|
| | | long l;
|
| | | int i;
|
| | | switch (elements.length)
|
| | | {
|
| | | case 1:
|
| | | l = Long.parseLong(elements[0]);
|
| | | if ((l < 0L) || (l > 4294967295L))
|
| | | return null;
|
| | | bytes[0] = (byte) (int) (l >> 24 & 0xFF);
|
| | | bytes[1] = (byte) (int) ((l & 0xFFFFFF) >> 16 & 0xFF);
|
| | | bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF);
|
| | | bytes[3] = (byte) (int) (l & 0xFF);
|
| | | break;
|
| | | case 2:
|
| | | l = Integer.parseInt(elements[0]);
|
| | | if ((l < 0L) || (l > 255L))
|
| | | return null;
|
| | | bytes[0] = (byte) (int) (l & 0xFF);
|
| | | l = Integer.parseInt(elements[1]);
|
| | | if ((l < 0L) || (l > 16777215L))
|
| | | return null;
|
| | | bytes[1] = (byte) (int) (l >> 16 & 0xFF);
|
| | | bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF);
|
| | | bytes[3] = (byte) (int) (l & 0xFF);
|
| | | break;
|
| | | case 3:
|
| | | for (i = 0; i < 2; ++i)
|
| | | {
|
| | | l = Integer.parseInt(elements[i]);
|
| | | if ((l < 0L) || (l > 255L))
|
| | | return null;
|
| | | bytes[i] = (byte) (int) (l & 0xFF);
|
| | | }
|
| | | l = Integer.parseInt(elements[2]);
|
| | | if ((l < 0L) || (l > 65535L))
|
| | | return null;
|
| | | bytes[2] = (byte) (int) (l >> 8 & 0xFF);
|
| | | bytes[3] = (byte) (int) (l & 0xFF);
|
| | | break;
|
| | | case 4:
|
| | | for (i = 0; i < 4; ++i)
|
| | | {
|
| | | l = Integer.parseInt(elements[i]);
|
| | | if ((l < 0L) || (l > 255L))
|
| | | return null;
|
| | | bytes[i] = (byte) (int) (l & 0xFF);
|
| | | }
|
| | | break;
|
| | | default:
|
| | | return null;
|
| | | }
|
| | | }
|
| | | catch (NumberFormatException e)
|
| | | {
|
| | | return null;
|
| | | }
|
| | | return bytes;
|
| | | }
|
| | |
|
| | | public static String getHostIp()
|
| | | {
|
| | | try
|
| | | {
|
| | | return InetAddress.getLocalHost().getHostAddress();
|
| | | }
|
| | | catch (UnknownHostException e)
|
| | | {
|
| | | }
|
| | | return "127.0.0.1";
|
| | | }
|
| | |
|
| | | public static String getHostName()
|
| | | {
|
| | | try
|
| | | {
|
| | | return InetAddress.getLocalHost().getHostName();
|
| | | }
|
| | | catch (UnknownHostException e)
|
| | | {
|
| | | }
|
| | | return "æªç¥";
|
| | | }
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.security;
|
| | |
|
| | | import java.security.MessageDigest;
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | |
|
| | | /**
|
| | | * Md5å 坿¹æ³
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class Md5Utils
|
| | | {
|
| | | private static final Logger log = LoggerFactory.getLogger(Md5Utils.class);
|
| | |
|
| | | private static byte[] md5(String s)
|
| | | {
|
| | | MessageDigest algorithm;
|
| | | try
|
| | | {
|
| | | algorithm = MessageDigest.getInstance("MD5");
|
| | | algorithm.reset();
|
| | | algorithm.update(s.getBytes("UTF-8"));
|
| | | byte[] messageDigest = algorithm.digest();
|
| | | return messageDigest;
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | log.error("MD5 Error...", e);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | private static final String toHex(byte hash[])
|
| | | {
|
| | | if (hash == null)
|
| | | {
|
| | | return null;
|
| | | }
|
| | | StringBuffer buf = new StringBuffer(hash.length * 2);
|
| | | int i;
|
| | |
|
| | | for (i = 0; i < hash.length; i++)
|
| | | {
|
| | | if ((hash[i] & 0xff) < 0x10)
|
| | | {
|
| | | buf.append("0");
|
| | | }
|
| | | buf.append(Long.toString(hash[i] & 0xff, 16));
|
| | | }
|
| | | return buf.toString();
|
| | | }
|
| | |
|
| | | public static String hash(String s)
|
| | | {
|
| | | try
|
| | | {
|
| | | return new String(toHex(md5(s)).getBytes("UTF-8"), "UTF-8");
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | log.error("not supported charset...{}", e);
|
| | | return s;
|
| | | }
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.sign;
|
| | |
|
| | | /**
|
| | | * Base64å·¥å
·ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public final class Base64
|
| | | {
|
| | | static private final int BASELENGTH = 128;
|
| | | static private final int LOOKUPLENGTH = 64;
|
| | | static private final int TWENTYFOURBITGROUP = 24;
|
| | | static private final int EIGHTBIT = 8;
|
| | | static private final int SIXTEENBIT = 16;
|
| | | static private final int FOURBYTE = 4;
|
| | | static private final int SIGN = -128;
|
| | | static private final char PAD = '=';
|
| | | static final private byte[] base64Alphabet = new byte[BASELENGTH];
|
| | | static final private char[] lookUpBase64Alphabet = new char[LOOKUPLENGTH];
|
| | |
|
| | | static
|
| | | {
|
| | | for (int i = 0; i < BASELENGTH; ++i)
|
| | | {
|
| | | base64Alphabet[i] = -1;
|
| | | }
|
| | | for (int i = 'Z'; i >= 'A'; i--)
|
| | | {
|
| | | base64Alphabet[i] = (byte) (i - 'A');
|
| | | }
|
| | | for (int i = 'z'; i >= 'a'; i--)
|
| | | {
|
| | | base64Alphabet[i] = (byte) (i - 'a' + 26);
|
| | | }
|
| | |
|
| | | for (int i = '9'; i >= '0'; i--)
|
| | | {
|
| | | base64Alphabet[i] = (byte) (i - '0' + 52);
|
| | | }
|
| | |
|
| | | base64Alphabet['+'] = 62;
|
| | | base64Alphabet['/'] = 63;
|
| | |
|
| | | for (int i = 0; i <= 25; i++)
|
| | | {
|
| | | lookUpBase64Alphabet[i] = (char) ('A' + i);
|
| | | }
|
| | |
|
| | | for (int i = 26, j = 0; i <= 51; i++, j++)
|
| | | {
|
| | | lookUpBase64Alphabet[i] = (char) ('a' + j);
|
| | | }
|
| | |
|
| | | for (int i = 52, j = 0; i <= 61; i++, j++)
|
| | | {
|
| | | lookUpBase64Alphabet[i] = (char) ('0' + j);
|
| | | }
|
| | | lookUpBase64Alphabet[62] = (char) '+';
|
| | | lookUpBase64Alphabet[63] = (char) '/';
|
| | | }
|
| | |
|
| | | private static boolean isWhiteSpace(char octect)
|
| | | {
|
| | | return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9);
|
| | | }
|
| | |
|
| | | private static boolean isPad(char octect)
|
| | | {
|
| | | return (octect == PAD);
|
| | | }
|
| | |
|
| | | private static boolean isData(char octect)
|
| | | {
|
| | | return (octect < BASELENGTH && base64Alphabet[octect] != -1);
|
| | | }
|
| | |
|
| | | /**
|
| | | * Encodes hex octects into Base64
|
| | | *
|
| | | * @param binaryData Array containing binaryData
|
| | | * @return Encoded Base64 array
|
| | | */
|
| | | public static String encode(byte[] binaryData)
|
| | | {
|
| | | if (binaryData == null)
|
| | | {
|
| | | return null;
|
| | | }
|
| | |
|
| | | int lengthDataBits = binaryData.length * EIGHTBIT;
|
| | | if (lengthDataBits == 0)
|
| | | {
|
| | | return "";
|
| | | }
|
| | |
|
| | | int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
|
| | | int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
|
| | | int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;
|
| | | char encodedData[] = null;
|
| | |
|
| | | encodedData = new char[numberQuartet * 4];
|
| | |
|
| | | byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;
|
| | |
|
| | | int encodedIndex = 0;
|
| | | int dataIndex = 0;
|
| | |
|
| | | for (int i = 0; i < numberTriplets; i++)
|
| | | {
|
| | | b1 = binaryData[dataIndex++];
|
| | | b2 = binaryData[dataIndex++];
|
| | | b3 = binaryData[dataIndex++];
|
| | |
|
| | | l = (byte) (b2 & 0x0f);
|
| | | k = (byte) (b1 & 0x03);
|
| | |
|
| | | byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
|
| | | byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
|
| | | byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc);
|
| | |
|
| | | encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
|
| | | encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
|
| | | encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3];
|
| | | encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f];
|
| | | }
|
| | |
|
| | | // form integral number of 6-bit groups
|
| | | if (fewerThan24bits == EIGHTBIT)
|
| | | {
|
| | | b1 = binaryData[dataIndex];
|
| | | k = (byte) (b1 & 0x03);
|
| | | byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
|
| | | encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
|
| | | encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4];
|
| | | encodedData[encodedIndex++] = PAD;
|
| | | encodedData[encodedIndex++] = PAD;
|
| | | }
|
| | | else if (fewerThan24bits == SIXTEENBIT)
|
| | | {
|
| | | b1 = binaryData[dataIndex];
|
| | | b2 = binaryData[dataIndex + 1];
|
| | | l = (byte) (b2 & 0x0f);
|
| | | k = (byte) (b1 & 0x03);
|
| | |
|
| | | byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
|
| | | byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
|
| | |
|
| | | encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
|
| | | encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
|
| | | encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2];
|
| | | encodedData[encodedIndex++] = PAD;
|
| | | }
|
| | | return new String(encodedData);
|
| | | }
|
| | |
|
| | | /**
|
| | | * Decodes Base64 data into octects
|
| | | *
|
| | | * @param encoded string containing Base64 data
|
| | | * @return Array containind decoded data.
|
| | | */
|
| | | public static byte[] decode(String encoded)
|
| | | {
|
| | | if (encoded == null)
|
| | | {
|
| | | return null;
|
| | | }
|
| | |
|
| | | char[] base64Data = encoded.toCharArray();
|
| | | // remove white spaces
|
| | | int len = removeWhiteSpace(base64Data);
|
| | |
|
| | | if (len % FOURBYTE != 0)
|
| | | {
|
| | | return null;// should be divisible by four
|
| | | }
|
| | |
|
| | | int numberQuadruple = (len / FOURBYTE);
|
| | |
|
| | | if (numberQuadruple == 0)
|
| | | {
|
| | | return new byte[0];
|
| | | }
|
| | |
|
| | | byte decodedData[] = null;
|
| | | byte b1 = 0, b2 = 0, b3 = 0, b4 = 0;
|
| | | char d1 = 0, d2 = 0, d3 = 0, d4 = 0;
|
| | |
|
| | | int i = 0;
|
| | | int encodedIndex = 0;
|
| | | int dataIndex = 0;
|
| | | decodedData = new byte[(numberQuadruple) * 3];
|
| | |
|
| | | for (; i < numberQuadruple - 1; i++)
|
| | | {
|
| | |
|
| | | if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))
|
| | | || !isData((d3 = base64Data[dataIndex++])) || !isData((d4 = base64Data[dataIndex++])))
|
| | | {
|
| | | return null;
|
| | | } // if found "no data" just return null
|
| | |
|
| | | b1 = base64Alphabet[d1];
|
| | | b2 = base64Alphabet[d2];
|
| | | b3 = base64Alphabet[d3];
|
| | | b4 = base64Alphabet[d4];
|
| | |
|
| | | decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
|
| | | decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
|
| | | decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
|
| | | }
|
| | |
|
| | | if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++])))
|
| | | {
|
| | | return null;// if found "no data" just return null
|
| | | }
|
| | |
|
| | | b1 = base64Alphabet[d1];
|
| | | b2 = base64Alphabet[d2];
|
| | |
|
| | | d3 = base64Data[dataIndex++];
|
| | | d4 = base64Data[dataIndex++];
|
| | | if (!isData((d3)) || !isData((d4)))
|
| | | {// Check if they are PAD characters
|
| | | if (isPad(d3) && isPad(d4))
|
| | | {
|
| | | if ((b2 & 0xf) != 0)// last 4 bits should be zero
|
| | | {
|
| | | return null;
|
| | | }
|
| | | byte[] tmp = new byte[i * 3 + 1];
|
| | | System.arraycopy(decodedData, 0, tmp, 0, i * 3);
|
| | | tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);
|
| | | return tmp;
|
| | | }
|
| | | else if (!isPad(d3) && isPad(d4))
|
| | | {
|
| | | b3 = base64Alphabet[d3];
|
| | | if ((b3 & 0x3) != 0)// last 2 bits should be zero
|
| | | {
|
| | | return null;
|
| | | }
|
| | | byte[] tmp = new byte[i * 3 + 2];
|
| | | System.arraycopy(decodedData, 0, tmp, 0, i * 3);
|
| | | tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
|
| | | tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
|
| | | return tmp;
|
| | | }
|
| | | else
|
| | | {
|
| | | return null;
|
| | | }
|
| | | }
|
| | | else
|
| | | { // No PAD e.g 3cQl
|
| | | b3 = base64Alphabet[d3];
|
| | | b4 = base64Alphabet[d4];
|
| | | decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
|
| | | decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
|
| | | decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
|
| | |
|
| | | }
|
| | | return decodedData;
|
| | | }
|
| | |
|
| | | /**
|
| | | * remove WhiteSpace from MIME containing encoded Base64 data.
|
| | | *
|
| | | * @param data the byte array of base64 data (with WS)
|
| | | * @return the new length
|
| | | */
|
| | | private static int removeWhiteSpace(char[] data)
|
| | | {
|
| | | if (data == null)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | |
|
| | | // count characters that's not whitespace
|
| | | int newSize = 0;
|
| | | int len = data.length;
|
| | | for (int i = 0; i < len; i++)
|
| | | {
|
| | | if (!isWhiteSpace(data[i]))
|
| | | {
|
| | | data[newSize++] = data[i];
|
| | | }
|
| | | }
|
| | | return newSize;
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.spring;
|
| | |
|
| | | import org.springframework.aop.framework.AopContext;
|
| | | import org.springframework.beans.BeansException;
|
| | | import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
| | | import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
| | | import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | /**
|
| | | * springå·¥å
·ç±» æ¹ä¾¿å¨éspring管çç¯å¢ä¸è·åbean
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @Component
|
| | | public final class SpringUtils implements BeanFactoryPostProcessor
|
| | | {
|
| | | /** Springåºç¨ä¸ä¸æç¯å¢ */
|
| | | private static ConfigurableListableBeanFactory beanFactory;
|
| | |
|
| | | @Override
|
| | | public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
|
| | | {
|
| | | SpringUtils.beanFactory = beanFactory;
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·å对象
|
| | | *
|
| | | * @param name
|
| | | * @return Object ä¸ä¸ªä»¥æç»ååæ³¨åçbeançå®ä¾
|
| | | * @throws org.springframework.beans.BeansException
|
| | | *
|
| | | */
|
| | | @SuppressWarnings("unchecked")
|
| | | public static <T> T getBean(String name) throws BeansException
|
| | | {
|
| | | return (T) beanFactory.getBean(name);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åç±»å为requiredTypeç对象
|
| | | *
|
| | | * @param clz
|
| | | * @return
|
| | | * @throws org.springframework.beans.BeansException
|
| | | *
|
| | | */
|
| | | public static <T> T getBean(Class<T> clz) throws BeansException
|
| | | {
|
| | | T result = (T) beanFactory.getBean(clz);
|
| | | return result;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 妿BeanFactoryå
å«ä¸ä¸ªä¸æç»åç§°å¹é
çbeanå®ä¹ï¼åè¿åtrue
|
| | | *
|
| | | * @param name
|
| | | * @return boolean
|
| | | */
|
| | | public static boolean containsBean(String name)
|
| | | {
|
| | | return beanFactory.containsBean(name);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 夿以ç»å®ååæ³¨åçbeanå®ä¹æ¯ä¸ä¸ªsingletonè¿æ¯ä¸ä¸ªprototypeã 妿ä¸ç»å®ååç¸åºçbeanå®ä¹æ²¡æè¢«æ¾å°ï¼å°ä¼æåºä¸ä¸ªå¼å¸¸ï¼NoSuchBeanDefinitionExceptionï¼
|
| | | *
|
| | | * @param name
|
| | | * @return boolean
|
| | | * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
|
| | | *
|
| | | */
|
| | | public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException
|
| | | {
|
| | | return beanFactory.isSingleton(name);
|
| | | }
|
| | |
|
| | | /**
|
| | | * @param name
|
| | | * @return Class 注å对象çç±»å
|
| | | * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
|
| | | *
|
| | | */
|
| | | public static Class<?> getType(String name) throws NoSuchBeanDefinitionException
|
| | | {
|
| | | return beanFactory.getType(name);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 妿ç»å®çbeanååå¨beanå®ä¹ä¸æå«åï¼åè¿åè¿äºå«å
|
| | | *
|
| | | * @param name
|
| | | * @return
|
| | | * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
|
| | | *
|
| | | */
|
| | | public static String[] getAliases(String name) throws NoSuchBeanDefinitionException
|
| | | {
|
| | | return beanFactory.getAliases(name);
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åaop代ç对象
|
| | | * |
| | | * @param invoker
|
| | | * @return
|
| | | */
|
| | | @SuppressWarnings("unchecked")
|
| | | public static <T> T getAopProxy(T invoker)
|
| | | {
|
| | | return (T) AopContext.currentProxy();
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.sql;
|
| | |
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | |
|
| | | /**
|
| | | * sqlæä½å·¥å
·ç±»
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class SqlUtil
|
| | | {
|
| | | /**
|
| | | * ä»
æ¯æåæ¯ãæ°åãä¸å线ãç©ºæ ¼ãéå·ï¼æ¯æå¤ä¸ªå段æåºï¼
|
| | | */
|
| | | public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,]+";
|
| | |
|
| | | /**
|
| | | * æ£æ¥å符ï¼é²æ¢æ³¨å
¥ç»è¿
|
| | | */
|
| | | public static String escapeOrderBySql(String value)
|
| | | {
|
| | | if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value))
|
| | | {
|
| | | return StringUtils.EMPTY;
|
| | | }
|
| | | return value;
|
| | | }
|
| | |
|
| | | /**
|
| | | * éªè¯ order by è¯æ³æ¯å¦ç¬¦åè§è
|
| | | */
|
| | | public static boolean isValidOrderBySql(String value)
|
| | | {
|
| | | return value.matches(SQL_PATTERN);
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.xss;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.regex.Matcher;
|
| | | import java.util.regex.Pattern;
|
| | | import javax.servlet.Filter;
|
| | | import javax.servlet.FilterChain;
|
| | | import javax.servlet.FilterConfig;
|
| | | import javax.servlet.ServletException;
|
| | | import javax.servlet.ServletRequest;
|
| | | import javax.servlet.ServletResponse;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | |
|
| | | /**
|
| | | * 鲿¢XSSæ»å»çè¿æ»¤å¨
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class XssFilter implements Filter
|
| | | {
|
| | | /**
|
| | | * æé¤é¾æ¥
|
| | | */
|
| | | public List<String> excludes = new ArrayList<>();
|
| | |
|
| | | /**
|
| | | * xssè¿æ»¤å¼å
³
|
| | | */
|
| | | public boolean enabled = false;
|
| | |
|
| | | @Override
|
| | | public void init(FilterConfig filterConfig) throws ServletException
|
| | | {
|
| | | String tempExcludes = filterConfig.getInitParameter("excludes");
|
| | | String tempEnabled = filterConfig.getInitParameter("enabled");
|
| | | if (StringUtils.isNotEmpty(tempExcludes))
|
| | | {
|
| | | String[] url = tempExcludes.split(",");
|
| | | for (int i = 0; url != null && i < url.length; i++)
|
| | | {
|
| | | excludes.add(url[i]);
|
| | | }
|
| | | }
|
| | | if (StringUtils.isNotEmpty(tempEnabled))
|
| | | {
|
| | | enabled = Boolean.valueOf(tempEnabled);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
|
| | | throws IOException, ServletException
|
| | | {
|
| | | HttpServletRequest req = (HttpServletRequest) request;
|
| | | HttpServletResponse resp = (HttpServletResponse) response;
|
| | | if (handleExcludeURL(req, resp))
|
| | | {
|
| | | chain.doFilter(request, response);
|
| | | return;
|
| | | }
|
| | | XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper((HttpServletRequest) request);
|
| | | chain.doFilter(xssRequest, response);
|
| | | }
|
| | |
|
| | | private boolean handleExcludeURL(HttpServletRequest request, HttpServletResponse response)
|
| | | {
|
| | | if (!enabled)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | if (excludes == null || excludes.isEmpty())
|
| | | {
|
| | | return false;
|
| | | }
|
| | | String url = request.getServletPath();
|
| | | for (String pattern : excludes)
|
| | | {
|
| | | Pattern p = Pattern.compile("^" + pattern);
|
| | | Matcher m = p.matcher(url);
|
| | | if (m.find())
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void destroy()
|
| | | {
|
| | |
|
| | | }
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.xss;
|
| | |
|
| | | import java.io.ByteArrayInputStream;
|
| | | import java.io.IOException;
|
| | | import javax.servlet.ReadListener;
|
| | | import javax.servlet.ServletInputStream;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletRequestWrapper;
|
| | | import org.apache.commons.io.IOUtils;
|
| | | import org.springframework.http.HttpHeaders;
|
| | | import org.springframework.http.MediaType;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.utils.html.EscapeUtil;
|
| | |
|
| | | /**
|
| | | * XSSè¿æ»¤å¤ç
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper
|
| | | {
|
| | | /**
|
| | | * @param request
|
| | | */
|
| | | public XssHttpServletRequestWrapper(HttpServletRequest request)
|
| | | {
|
| | | super(request);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String[] getParameterValues(String name)
|
| | | {
|
| | | String[] values = super.getParameterValues(name);
|
| | | if (values != null)
|
| | | {
|
| | | int length = values.length;
|
| | | String[] escapseValues = new String[length];
|
| | | for (int i = 0; i < length; i++)
|
| | | {
|
| | | // é²xssæ»å»åè¿æ»¤ååç©ºæ ¼
|
| | | escapseValues[i] = EscapeUtil.clean(values[i]).trim();
|
| | | }
|
| | | return escapseValues;
|
| | | }
|
| | | return super.getParameterValues(name);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public ServletInputStream getInputStream() throws IOException
|
| | | {
|
| | | // éjsonç±»åï¼ç´æ¥è¿å
|
| | | if (!isJsonRequest())
|
| | | {
|
| | | return super.getInputStream();
|
| | | }
|
| | |
|
| | | // 为空ï¼ç´æ¥è¿å
|
| | | String json = IOUtils.toString(super.getInputStream(), "utf-8");
|
| | | if (StringUtils.isEmpty(json))
|
| | | {
|
| | | return super.getInputStream();
|
| | | }
|
| | |
|
| | | // xssè¿æ»¤
|
| | | json = EscapeUtil.clean(json).trim();
|
| | | final ByteArrayInputStream bis = new ByteArrayInputStream(json.getBytes("utf-8"));
|
| | | return new ServletInputStream()
|
| | | {
|
| | | @Override
|
| | | public boolean isFinished()
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public boolean isReady()
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void setReadListener(ReadListener readListener)
|
| | | {
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int read() throws IOException
|
| | | {
|
| | | return bis.read();
|
| | | }
|
| | | };
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¯å¦æ¯Json请æ±
|
| | | * |
| | | * @param request
|
| | | */
|
| | | public boolean isJsonRequest()
|
| | | {
|
| | | String header = super.getHeader(HttpHeaders.CONTENT_TYPE);
|
| | | return MediaType.APPLICATION_JSON_VALUE.equalsIgnoreCase(header)
|
| | | || MediaType.APPLICATION_JSON_UTF8_VALUE.equalsIgnoreCase(header);
|
| | | }
|
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.aspectj;
|
| | |
|
| | | import java.lang.reflect.Method;
|
| | | import org.aspectj.lang.JoinPoint;
|
| | | import org.aspectj.lang.Signature;
|
| | | import org.aspectj.lang.annotation.Aspect;
|
| | | import org.aspectj.lang.annotation.Before;
|
| | | import org.aspectj.lang.annotation.Pointcut;
|
| | | import org.aspectj.lang.reflect.MethodSignature;
|
| | | import org.springframework.stereotype.Component;
|
| | | import com.ruoyi.common.utils.ServletUtils;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.utils.spring.SpringUtils;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
|
| | | import com.ruoyi.framework.security.LoginUser;
|
| | | import com.ruoyi.framework.security.service.TokenService;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | | import com.ruoyi.project.system.domain.SysRole;
|
| | | import com.ruoyi.project.system.domain.SysUser;
|
| | |
|
| | | /**
|
| | | * æ°æ®è¿æ»¤å¤ç
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @Aspect
|
| | | @Component
|
| | | public class DataScopeAspect
|
| | | {
|
| | | /**
|
| | | * å
¨é¨æ°æ®æé
|
| | | */
|
| | | public static final String DATA_SCOPE_ALL = "1";
|
| | |
|
| | | /**
|
| | | * èªå®æ°æ®æé
|
| | | */
|
| | | public static final String DATA_SCOPE_CUSTOM = "2";
|
| | |
|
| | | /**
|
| | | * é¨é¨æ°æ®æé
|
| | | */
|
| | | public static final String DATA_SCOPE_DEPT = "3";
|
| | |
|
| | | /**
|
| | | * é¨é¨å以䏿°æ®æé
|
| | | */
|
| | | public static final String DATA_SCOPE_DEPT_AND_CHILD = "4";
|
| | |
|
| | | /**
|
| | | * ä»
æ¬äººæ°æ®æé
|
| | | */
|
| | | public static final String DATA_SCOPE_SELF = "5";
|
| | |
|
| | | // é
ç½®ç»å
¥ç¹
|
| | | @Pointcut("@annotation(com.ruoyi.framework.aspectj.lang.annotation.DataScope)")
|
| | | public void dataScopePointCut()
|
| | | {
|
| | | }
|
| | |
|
| | | @Before("dataScopePointCut()")
|
| | | public void doBefore(JoinPoint point) throws Throwable
|
| | | {
|
| | | handleDataScope(point);
|
| | | }
|
| | |
|
| | | protected void handleDataScope(final JoinPoint joinPoint)
|
| | | {
|
| | | // è·å¾æ³¨è§£
|
| | | DataScope controllerDataScope = getAnnotationLog(joinPoint);
|
| | | if (controllerDataScope == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | // è·åå½åçç¨æ·
|
| | | LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
|
| | | SysUser currentUser = loginUser.getUser();
|
| | | if (currentUser != null)
|
| | | {
|
| | | // 妿æ¯è¶
级管çåï¼åä¸è¿æ»¤æ°æ®
|
| | | if (!currentUser.isAdmin())
|
| | | {
|
| | | dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(),
|
| | | controllerDataScope.userAlias());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ°æ®èå´è¿æ»¤
|
| | | * |
| | | * @param joinPoint åç¹
|
| | | * @param user ç¨æ·
|
| | | * @param alias å«å
|
| | | */
|
| | | public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias)
|
| | | {
|
| | | StringBuilder sqlString = new StringBuilder();
|
| | |
|
| | | for (SysRole role : user.getRoles())
|
| | | {
|
| | | String dataScope = role.getDataScope();
|
| | | if (DATA_SCOPE_ALL.equals(dataScope))
|
| | | {
|
| | | sqlString = new StringBuilder();
|
| | | break;
|
| | | }
|
| | | else if (DATA_SCOPE_CUSTOM.equals(dataScope))
|
| | | {
|
| | | sqlString.append(StringUtils.format(
|
| | | " OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias,
|
| | | role.getRoleId()));
|
| | | }
|
| | | else if (DATA_SCOPE_DEPT.equals(dataScope))
|
| | | {
|
| | | sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId()));
|
| | | }
|
| | | else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope))
|
| | | {
|
| | | sqlString.append(StringUtils.format(
|
| | | " OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )",
|
| | | deptAlias, user.getDeptId(), user.getDeptId()));
|
| | | }
|
| | | else if (DATA_SCOPE_SELF.equals(dataScope))
|
| | | {
|
| | | if (StringUtils.isNotBlank(userAlias))
|
| | | {
|
| | | sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId()));
|
| | | }
|
| | | else
|
| | | {
|
| | | // æ°æ®æé为ä»
æ¬äººä¸æ²¡æuserAliaså«å䏿¥è¯¢ä»»ä½æ°æ®
|
| | | sqlString.append(" OR 1=0 ");
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (StringUtils.isNotBlank(sqlString.toString()))
|
| | | {
|
| | | BaseEntity baseEntity = (BaseEntity) joinPoint.getArgs()[0];
|
| | | baseEntity.setDataScope(" AND (" + sqlString.substring(4) + ")");
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¯å¦å卿³¨è§£ï¼å¦æåå¨å°±è·å
|
| | | */
|
| | | private DataScope getAnnotationLog(JoinPoint joinPoint)
|
| | | {
|
| | | Signature signature = joinPoint.getSignature();
|
| | | MethodSignature methodSignature = (MethodSignature) signature;
|
| | | Method method = methodSignature.getMethod();
|
| | |
|
| | | if (method != null)
|
| | | {
|
| | | return method.getAnnotation(DataScope.class);
|
| | | }
|
| | | return null;
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.aspectj;
|
| | |
|
| | | import java.lang.reflect.Method;
|
| | | import org.aspectj.lang.ProceedingJoinPoint;
|
| | | import org.aspectj.lang.annotation.Around;
|
| | | import org.aspectj.lang.annotation.Aspect;
|
| | | import org.aspectj.lang.annotation.Pointcut;
|
| | | import org.aspectj.lang.reflect.MethodSignature;
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | | import org.springframework.core.annotation.Order;
|
| | | import org.springframework.stereotype.Component;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
|
| | | import com.ruoyi.framework.datasource.DynamicDataSourceContextHolder;
|
| | |
|
| | | /**
|
| | | * 夿°æ®æºå¤ç
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @Aspect
|
| | | @Order(1)
|
| | | @Component
|
| | | public class DataSourceAspect
|
| | | {
|
| | | protected Logger logger = LoggerFactory.getLogger(getClass());
|
| | |
|
| | | @Pointcut("@annotation(com.ruoyi.framework.aspectj.lang.annotation.DataSource)"
|
| | | + "|| @within(com.ruoyi.framework.aspectj.lang.annotation.DataSource)")
|
| | | public void dsPointCut()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | @Around("dsPointCut()")
|
| | | public Object around(ProceedingJoinPoint point) throws Throwable
|
| | | {
|
| | | DataSource dataSource = getDataSource(point);
|
| | |
|
| | | if (StringUtils.isNotNull(dataSource))
|
| | | {
|
| | | DynamicDataSourceContextHolder.setDataSourceType(dataSource.value().name());
|
| | | }
|
| | |
|
| | | try
|
| | | {
|
| | | return point.proceed();
|
| | | }
|
| | | finally
|
| | | {
|
| | | // éæ¯æ°æ®æº 卿§è¡æ¹æ³ä¹å
|
| | | DynamicDataSourceContextHolder.clearDataSourceType();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·åéè¦åæ¢çæ°æ®æº
|
| | | */
|
| | | public DataSource getDataSource(ProceedingJoinPoint point)
|
| | | {
|
| | | MethodSignature signature = (MethodSignature) point.getSignature();
|
| | | Class<? extends Object> targetClass = point.getTarget().getClass();
|
| | | DataSource targetDataSource = targetClass.getAnnotation(DataSource.class);
|
| | | if (StringUtils.isNotNull(targetDataSource))
|
| | | {
|
| | | return targetDataSource;
|
| | | }
|
| | | else
|
| | | {
|
| | | Method method = signature.getMethod();
|
| | | DataSource dataSource = method.getAnnotation(DataSource.class);
|
| | | return dataSource;
|
| | | }
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.aspectj;
|
| | |
|
| | | import java.lang.reflect.Method;
|
| | | import java.util.Map;
|
| | | import org.aspectj.lang.JoinPoint;
|
| | | import org.aspectj.lang.Signature;
|
| | | import org.aspectj.lang.annotation.AfterReturning;
|
| | | import org.aspectj.lang.annotation.AfterThrowing;
|
| | | import org.aspectj.lang.annotation.Aspect;
|
| | | import org.aspectj.lang.annotation.Pointcut;
|
| | | import org.aspectj.lang.reflect.MethodSignature;
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | | import org.springframework.stereotype.Component;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.springframework.web.servlet.HandlerMapping;
|
| | | import com.alibaba.fastjson.JSON;
|
| | | import com.ruoyi.common.enums.HttpMethod;
|
| | | import com.ruoyi.common.utils.ServletUtils;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.utils.ip.IpUtils;
|
| | | import com.ruoyi.common.utils.spring.SpringUtils;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessStatus;
|
| | | import com.ruoyi.framework.manager.AsyncManager;
|
| | | import com.ruoyi.framework.manager.factory.AsyncFactory;
|
| | | import com.ruoyi.framework.security.LoginUser;
|
| | | import com.ruoyi.framework.security.service.TokenService;
|
| | | import com.ruoyi.project.monitor.domain.SysOperLog;
|
| | |
|
| | | /**
|
| | | * æä½æ¥å¿è®°å½å¤ç
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @Aspect
|
| | | @Component
|
| | | public class LogAspect
|
| | | {
|
| | | private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
|
| | |
|
| | | // é
ç½®ç»å
¥ç¹
|
| | | @Pointcut("@annotation(com.ruoyi.framework.aspectj.lang.annotation.Log)")
|
| | | public void logPointCut()
|
| | | {
|
| | | }
|
| | |
|
| | | /**
|
| | | * å¤çå®è¯·æ±åæ§è¡
|
| | | *
|
| | | * @param joinPoint åç¹
|
| | | */
|
| | | @AfterReturning(pointcut = "logPointCut()", returning = "jsonResult")
|
| | | public void doAfterReturning(JoinPoint joinPoint, Object jsonResult)
|
| | | {
|
| | | handleLog(joinPoint, null, jsonResult);
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¦æªå¼å¸¸æä½
|
| | | * |
| | | * @param joinPoint åç¹
|
| | | * @param e å¼å¸¸
|
| | | */
|
| | | @AfterThrowing(value = "logPointCut()", throwing = "e")
|
| | | public void doAfterThrowing(JoinPoint joinPoint, Exception e)
|
| | | {
|
| | | handleLog(joinPoint, e, null);
|
| | | }
|
| | |
|
| | | protected void handleLog(final JoinPoint joinPoint, final Exception e, Object jsonResult)
|
| | | {
|
| | | try
|
| | | {
|
| | | // è·å¾æ³¨è§£
|
| | | Log controllerLog = getAnnotationLog(joinPoint);
|
| | | if (controllerLog == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | // è·åå½åçç¨æ·
|
| | | LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
|
| | |
|
| | | // *========æ°æ®åºæ¥å¿=========*//
|
| | | SysOperLog operLog = new SysOperLog();
|
| | | operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
|
| | | // 请æ±çå°å
|
| | | String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
|
| | | operLog.setOperIp(ip);
|
| | | // è¿ååæ°
|
| | | operLog.setJsonResult(JSON.toJSONString(jsonResult));
|
| | |
|
| | | operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
|
| | | if (loginUser != null)
|
| | | {
|
| | | operLog.setOperName(loginUser.getUsername());
|
| | | }
|
| | |
|
| | | if (e != null)
|
| | | {
|
| | | operLog.setStatus(BusinessStatus.FAIL.ordinal());
|
| | | operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
|
| | | }
|
| | | // è®¾ç½®æ¹æ³åç§°
|
| | | String className = joinPoint.getTarget().getClass().getName();
|
| | | String methodName = joinPoint.getSignature().getName();
|
| | | operLog.setMethod(className + "." + methodName + "()");
|
| | | // è®¾ç½®è¯·æ±æ¹å¼
|
| | | operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
|
| | | // å¤ç设置注解ä¸çåæ°
|
| | | getControllerMethodDescription(joinPoint, controllerLog, operLog);
|
| | | // ä¿åæ°æ®åº
|
| | | AsyncManager.me().execute(AsyncFactory.recordOper(operLog));
|
| | | }
|
| | | catch (Exception exp)
|
| | | {
|
| | | // è®°å½æ¬å°å¼å¸¸æ¥å¿
|
| | | log.error("==åç½®éç¥å¼å¸¸==");
|
| | | log.error("å¼å¸¸ä¿¡æ¯:{}", exp.getMessage());
|
| | | exp.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·å注解ä¸å¯¹æ¹æ³çæè¿°ä¿¡æ¯ ç¨äºController屿³¨è§£
|
| | | * |
| | | * @param log æ¥å¿
|
| | | * @param operLog æä½æ¥å¿
|
| | | * @throws Exception
|
| | | */
|
| | | public void getControllerMethodDescription(JoinPoint joinPoint, Log log, SysOperLog operLog) throws Exception
|
| | | {
|
| | | // 设置actionå¨ä½
|
| | | operLog.setBusinessType(log.businessType().ordinal());
|
| | | // 设置æ é¢
|
| | | operLog.setTitle(log.title());
|
| | | // 设置æä½äººç±»å«
|
| | | operLog.setOperatorType(log.operatorType().ordinal());
|
| | | // æ¯å¦éè¦ä¿årequestï¼åæ°åå¼
|
| | | if (log.isSaveRequestData())
|
| | | {
|
| | | // è·ååæ°çä¿¡æ¯ï¼ä¼ å
¥å°æ°æ®åºä¸ã
|
| | | setRequestValue(joinPoint, operLog);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * è·å请æ±çåæ°ï¼æ¾å°logä¸
|
| | | * |
| | | * @param operLog æä½æ¥å¿
|
| | | * @throws Exception å¼å¸¸
|
| | | */
|
| | | private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog) throws Exception
|
| | | {
|
| | | String requestMethod = operLog.getRequestMethod();
|
| | | if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod))
|
| | | {
|
| | | String params = argsArrayToString(joinPoint.getArgs());
|
| | | operLog.setOperParam(StringUtils.substring(params, 0, 2000));
|
| | | }
|
| | | else
|
| | | {
|
| | | Map<?, ?> paramsMap = (Map<?, ?>) ServletUtils.getRequest().getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
|
| | | operLog.setOperParam(StringUtils.substring(paramsMap.toString(), 0, 2000));
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * æ¯å¦å卿³¨è§£ï¼å¦æåå¨å°±è·å
|
| | | */
|
| | | private Log getAnnotationLog(JoinPoint joinPoint) throws Exception
|
| | | {
|
| | | Signature signature = joinPoint.getSignature();
|
| | | MethodSignature methodSignature = (MethodSignature) signature;
|
| | | Method method = methodSignature.getMethod();
|
| | |
|
| | | if (method != null)
|
| | | {
|
| | | return method.getAnnotation(Log.class);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * åæ°æ¼è£
|
| | | */
|
| | | private String argsArrayToString(Object[] paramsArray)
|
| | | {
|
| | | String params = "";
|
| | | if (paramsArray != null && paramsArray.length > 0)
|
| | | {
|
| | | for (int i = 0; i < paramsArray.length; i++)
|
| | | {
|
| | | if (!(paramsArray[i] instanceof MultipartFile))
|
| | | {
|
| | | Object jsonObj = JSON.toJSON(paramsArray[i]);
|
| | | params += jsonObj.toString() + " ";
|
| | | }
|
| | | }
|
| | | }
|
| | | return params.trim();
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.aspectj.lang.annotation;
|
| | |
|
| | | import java.lang.annotation.Documented;
|
| | | import java.lang.annotation.ElementType;
|
| | | import java.lang.annotation.Retention;
|
| | | import java.lang.annotation.RetentionPolicy;
|
| | | import java.lang.annotation.Target;
|
| | |
|
| | | /**
|
| | | * æ°æ®æéè¿æ»¤æ³¨è§£
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @Target(ElementType.METHOD)
|
| | | @Retention(RetentionPolicy.RUNTIME)
|
| | | @Documented
|
| | | public @interface DataScope
|
| | | {
|
| | | /**
|
| | | * é¨é¨è¡¨çå«å
|
| | | */
|
| | | public String deptAlias() default "";
|
| | |
|
| | | /**
|
| | | * ç¨æ·è¡¨çå«å
|
| | | */
|
| | | public String userAlias() default "";
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.aspectj.lang.annotation;
|
| | |
|
| | | import java.lang.annotation.Documented;
|
| | | import java.lang.annotation.ElementType;
|
| | | import java.lang.annotation.Inherited;
|
| | | import java.lang.annotation.Retention;
|
| | | import java.lang.annotation.RetentionPolicy;
|
| | | import java.lang.annotation.Target;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
|
| | |
|
| | | /**
|
| | | * èªå®ä¹å¤æ°æ®æºåæ¢æ³¨è§£
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @Target({ ElementType.METHOD, ElementType.TYPE })
|
| | | @Retention(RetentionPolicy.RUNTIME)
|
| | | @Documented
|
| | | @Inherited
|
| | | public @interface DataSource
|
| | | {
|
| | | /**
|
| | | * åæ¢æ°æ®æºåç§°
|
| | | */
|
| | | public DataSourceType value() default DataSourceType.MASTER;
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.aspectj.lang.annotation;
|
| | |
|
| | | import java.lang.annotation.Documented;
|
| | | import java.lang.annotation.ElementType;
|
| | | import java.lang.annotation.Retention;
|
| | | import java.lang.annotation.RetentionPolicy;
|
| | | import java.lang.annotation.Target;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.OperatorType;
|
| | |
|
| | | /**
|
| | | * èªå®ä¹æä½æ¥å¿è®°å½æ³¨è§£
|
| | | * |
| | | * @author ruoyi
|
| | | *
|
| | | */
|
| | | @Target({ ElementType.PARAMETER, ElementType.METHOD })
|
| | | @Retention(RetentionPolicy.RUNTIME)
|
| | | @Documented
|
| | | public @interface Log
|
| | | {
|
| | | /**
|
| | | * 模å |
| | | */
|
| | | public String title() default "";
|
| | |
|
| | | /**
|
| | | * åè½
|
| | | */
|
| | | public BusinessType businessType() default BusinessType.OTHER;
|
| | |
|
| | | /**
|
| | | * æä½äººç±»å«
|
| | | */
|
| | | public OperatorType operatorType() default OperatorType.MANAGE;
|
| | |
|
| | | /**
|
| | | * æ¯å¦ä¿å请æ±çåæ°
|
| | | */
|
| | | public boolean isSaveRequestData() default true;
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.aspectj.lang.enums;
|
| | |
|
| | | /**
|
| | | * æä½ç¶æ
|
| | | * |
| | | * @author ruoyi
|
| | | *
|
| | | */
|
| | | public enum BusinessStatus
|
| | | {
|
| | | /**
|
| | | * æå
|
| | | */
|
| | | SUCCESS,
|
| | |
|
| | | /**
|
| | | * 失败
|
| | | */
|
| | | FAIL,
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.aspectj.lang.enums;
|
| | |
|
| | | /**
|
| | | * ä¸å¡æä½ç±»å
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public enum BusinessType
|
| | | {
|
| | | /**
|
| | | * å
¶å®
|
| | | */
|
| | | OTHER,
|
| | |
|
| | | /**
|
| | | * æ°å¢
|
| | | */
|
| | | INSERT,
|
| | |
|
| | | /**
|
| | | * ä¿®æ¹
|
| | | */
|
| | | UPDATE,
|
| | |
|
| | | /**
|
| | | * å é¤
|
| | | */
|
| | | DELETE,
|
| | |
|
| | | /**
|
| | | * ææ
|
| | | */
|
| | | GRANT,
|
| | |
|
| | | /**
|
| | | * 导åº
|
| | | */
|
| | | EXPORT,
|
| | |
|
| | | /**
|
| | | * 导å
¥
|
| | | */
|
| | | IMPORT,
|
| | |
|
| | | /**
|
| | | * 强é
|
| | | */
|
| | | FORCE,
|
| | |
|
| | | /**
|
| | | * çæä»£ç
|
| | | */
|
| | | GENCODE,
|
| | | |
| | | /**
|
| | | * æ¸
ç©ºæ°æ®
|
| | | */
|
| | | CLEAN,
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.aspectj.lang.enums;
|
| | |
|
| | | /**
|
| | | * æ°æ®æº
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public enum DataSourceType
|
| | | {
|
| | | /**
|
| | | * 主åº
|
| | | */
|
| | | MASTER,
|
| | |
|
| | | /**
|
| | | * ä»åº
|
| | | */
|
| | | SLAVE
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.aspectj.lang.enums;
|
| | |
|
| | | /**
|
| | | * æä½äººç±»å«
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public enum OperatorType
|
| | | {
|
| | | /**
|
| | | * å
¶å®
|
| | | */
|
| | | OTHER,
|
| | |
|
| | | /**
|
| | | * åå°ç¨æ·
|
| | | */
|
| | | MANAGE,
|
| | |
|
| | | /**
|
| | | * ææºç«¯ç¨æ·
|
| | | */
|
| | | MOBILE
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.config;
|
| | |
|
| | | import org.mybatis.spring.annotation.MapperScan;
|
| | | import org.springframework.context.annotation.Configuration;
|
| | | import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
| | |
|
| | | /**
|
| | | * ç¨åºæ³¨è§£é
ç½®
|
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | @Configuration
|
| | | // 表示éè¿aopæ¡æ¶æ´é²è¯¥ä»£ç对象,AopContextè½å¤è®¿é®
|
| | | @EnableAspectJAutoProxy(exposeProxy = true)
|
| | | // æå®è¦æ«æçMapperç±»çå
çè·¯å¾
|
| | | @MapperScan("com.ruoyi.project.**.mapper")
|
| | | public class ApplicationConfig
|
| | | {
|
| | |
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.config;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | | import javax.servlet.Filter;
|
| | | import javax.servlet.FilterChain;
|
| | | import javax.servlet.ServletException;
|
| | | import javax.servlet.ServletRequest;
|
| | | import javax.servlet.ServletResponse;
|
| | | import javax.sql.DataSource;
|
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
| | | import org.springframework.boot.context.properties.ConfigurationProperties;
|
| | | import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
| | | import org.springframework.context.annotation.Bean;
|
| | | import org.springframework.context.annotation.Configuration;
|
| | | import org.springframework.context.annotation.Primary;
|
| | | import com.alibaba.druid.pool.DruidDataSource;
|
| | | import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
|
| | | import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
|
| | | import com.alibaba.druid.util.Utils;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
|
| | | import com.ruoyi.framework.config.properties.DruidProperties;
|
| | | import com.ruoyi.framework.datasource.DynamicDataSource;
|
| | |
|
| | | /**
|
| | | * druid é
ç½®å¤æ°æ®æº
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @Configuration
|
| | | public class DruidConfig
|
| | | {
|
| | | @Bean
|
| | | @ConfigurationProperties("spring.datasource.druid.master")
|
| | | public DataSource masterDataSource(DruidProperties druidProperties)
|
| | | {
|
| | | DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
| | | return druidProperties.dataSource(dataSource);
|
| | | }
|
| | |
|
| | | @Bean
|
| | | @ConfigurationProperties("spring.datasource.druid.slave")
|
| | | @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true")
|
| | | public DataSource slaveDataSource(DruidProperties druidProperties)
|
| | | {
|
| | | DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
|
| | | return druidProperties.dataSource(dataSource);
|
| | | }
|
| | |
|
| | | @Bean(name = "dynamicDataSource")
|
| | | @Primary
|
| | | public DynamicDataSource dataSource(DataSource masterDataSource, DataSource slaveDataSource)
|
| | | {
|
| | | Map<Object, Object> targetDataSources = new HashMap<>();
|
| | | targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
|
| | | targetDataSources.put(DataSourceType.SLAVE.name(), slaveDataSource);
|
| | | return new DynamicDataSource(masterDataSource, targetDataSources);
|
| | | }
|
| | |
|
| | | /**
|
| | | * å»é¤çæ§é¡µé¢åºé¨ç广å
|
| | | */
|
| | | @SuppressWarnings({ "rawtypes", "unchecked" })
|
| | | @Bean
|
| | | @ConditionalOnProperty(name = "spring.datasource.druid.statViewServlet.enabled", havingValue = "true")
|
| | | public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties)
|
| | | {
|
| | | // è·åwebçæ§é¡µé¢çåæ°
|
| | | DruidStatProperties.StatViewServlet config = properties.getStatViewServlet();
|
| | | // æåcommon.jsçé
置路å¾
|
| | | String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*";
|
| | | String commonJsPattern = pattern.replaceAll("\\*", "js/common.js");
|
| | | final String filePath = "support/http/resources/js/common.js";
|
| | | // å建filterè¿è¡è¿æ»¤
|
| | | Filter filter = new Filter()
|
| | | {
|
| | | @Override
|
| | | public void init(javax.servlet.FilterConfig filterConfig) throws ServletException
|
| | | {
|
| | | }
|
| | | @Override
|
| | | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
|
| | | throws IOException, ServletException
|
| | | {
|
| | | chain.doFilter(request, response);
|
| | | // éç½®ç¼å²åºï¼ååºå¤´ä¸ä¼è¢«éç½®
|
| | | response.resetBuffer();
|
| | | // è·åcommon.js
|
| | | String text = Utils.readFromResource(filePath);
|
| | | // æ£åæ¿æ¢banner, é¤å»åºé¨ç广åä¿¡æ¯
|
| | | text = text.replaceAll("<a.*?banner\"></a><br/>", "");
|
| | | text = text.replaceAll("powered.*?shrek.wang</a>", "");
|
| | | response.getWriter().write(text);
|
| | | }
|
| | | @Override
|
| | | public void destroy()
|
| | | {
|
| | | }
|
| | | };
|
| | | FilterRegistrationBean registrationBean = new FilterRegistrationBean();
|
| | | registrationBean.setFilter(filter);
|
| | | registrationBean.addUrlPatterns(commonJsPattern);
|
| | | return registrationBean;
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.config;
|
| | |
|
| | | import com.alibaba.fastjson.JSON;
|
| | | import com.alibaba.fastjson.serializer.SerializerFeature;
|
| | | import com.fasterxml.jackson.databind.JavaType;
|
| | | import com.fasterxml.jackson.databind.ObjectMapper;
|
| | | import com.fasterxml.jackson.databind.type.TypeFactory;
|
| | | import org.springframework.data.redis.serializer.RedisSerializer;
|
| | | import org.springframework.data.redis.serializer.SerializationException;
|
| | | import com.alibaba.fastjson.parser.ParserConfig;
|
| | | import org.springframework.util.Assert;
|
| | | import java.nio.charset.Charset;
|
| | |
|
| | | /**
|
| | | * Redis使ç¨FastJsonåºåå
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T>
|
| | | {
|
| | | @SuppressWarnings("unused")
|
| | | private ObjectMapper objectMapper = new ObjectMapper();
|
| | |
|
| | | public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
|
| | |
|
| | | private Class<T> clazz;
|
| | |
|
| | | static
|
| | | {
|
| | | ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
|
| | | }
|
| | |
|
| | | public FastJson2JsonRedisSerializer(Class<T> clazz)
|
| | | {
|
| | | super();
|
| | | this.clazz = clazz;
|
| | | }
|
| | |
|
| | | public byte[] serialize(T t) throws SerializationException
|
| | | {
|
| | | if (t == null)
|
| | | {
|
| | | return new byte[0];
|
| | | }
|
| | | return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(DEFAULT_CHARSET);
|
| | | }
|
| | |
|
| | | public T deserialize(byte[] bytes) throws SerializationException
|
| | | {
|
| | | if (bytes == null || bytes.length <= 0)
|
| | | {
|
| | | return null;
|
| | | }
|
| | | String str = new String(bytes, DEFAULT_CHARSET);
|
| | |
|
| | | return JSON.parseObject(str, clazz);
|
| | | }
|
| | |
|
| | | public void setObjectMapper(ObjectMapper objectMapper)
|
| | | {
|
| | | Assert.notNull(objectMapper, "'objectMapper' must not be null");
|
| | | this.objectMapper = objectMapper;
|
| | | }
|
| | |
|
| | | protected JavaType getJavaType(Class<?> clazz)
|
| | | {
|
| | | return TypeFactory.defaultInstance().constructType(clazz);
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.config;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | | import javax.servlet.DispatcherType;
|
| | | import org.springframework.beans.factory.annotation.Value;
|
| | | import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
| | | import org.springframework.context.annotation.Bean;
|
| | | import org.springframework.context.annotation.Configuration;
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.common.xss.XssFilter;
|
| | |
|
| | | /**
|
| | | * Filteré
ç½®
|
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | @Configuration
|
| | | public class FilterConfig
|
| | | {
|
| | | @Value("${xss.enabled}")
|
| | | private String enabled;
|
| | |
|
| | | @Value("${xss.excludes}")
|
| | | private String excludes;
|
| | |
|
| | | @Value("${xss.urlPatterns}")
|
| | | private String urlPatterns;
|
| | |
|
| | | @SuppressWarnings({ "rawtypes", "unchecked" })
|
| | | @Bean
|
| | | public FilterRegistrationBean xssFilterRegistration()
|
| | | {
|
| | | FilterRegistrationBean registration = new FilterRegistrationBean();
|
| | | registration.setDispatcherTypes(DispatcherType.REQUEST);
|
| | | registration.setFilter(new XssFilter());
|
| | | registration.addUrlPatterns(StringUtils.split(urlPatterns, ","));
|
| | | registration.setName("xssFilter");
|
| | | registration.setOrder(Integer.MAX_VALUE);
|
| | | Map<String, String> initParameters = new HashMap<String, String>();
|
| | | initParameters.put("excludes", excludes);
|
| | | initParameters.put("enabled", enabled);
|
| | | registration.setInitParameters(initParameters);
|
| | | return registration;
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.framework.config;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashSet;
|
| | | import java.util.List;
|
| | | import javax.sql.DataSource;
|
| | | import org.apache.ibatis.io.VFS;
|
| | | import org.apache.ibatis.session.SqlSessionFactory;
|
| | | import org.mybatis.spring.SqlSessionFactoryBean;
|
| | | import org.mybatis.spring.boot.autoconfigure.SpringBootVFS;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.context.annotation.Bean;
|
| | | import org.springframework.context.annotation.Configuration;
|
| | | import org.springframework.core.env.Environment;
|
| | | import org.springframework.core.io.Resource;
|
| | | import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
| | | import org.springframework.core.io.support.ResourcePatternResolver;
|
| | | import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
|
| | | import org.springframework.core.type.classreading.MetadataReader;
|
| | | import org.springframework.core.type.classreading.MetadataReaderFactory;
|
| | | import org.springframework.util.ClassUtils;
|
| | |
|
| | | /**
|
| | | * Mybatisæ¯æ*å¹é
æ«æå
|
| | | * |
| | | * @author ruoyi
|
| | | */
|
| | | @Configuration
|
| | | public class MyBatisConfig
|
| | | {
|
| | | @Autowired
|
| | | private Environment env;
|
| | |
|
| | | static final String DEFAULT_RESOURCE_PATTERN = "**/*.class";
|
| | |
|
| | | public static String setTypeAliasesPackage(String typeAliasesPackage)
|
| | | {
|
| | | ResourcePatternResolver resolver = (ResourcePatternResolver) new PathMatchingResourcePatternResolver();
|
| | | MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resolver);
|
| | | List<String> allResult = new ArrayList<String>();
|
| | | try
|
| | | {
|
| | | for (String aliasesPackage : typeAliasesPackage.split(","))
|
| | | {
|
| | | List<String> result = new ArrayList<String>();
|
| | | aliasesPackage = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX
|
| | | + ClassUtils.convertClassNameToResourcePath(aliasesPackage.trim()) + "/" + DEFAULT_RESOURCE_PATTERN;
|
| | | Resource[] resources = resolver.getResources(aliasesPackage);
|
| | | if (resources != null && resources.length > 0)
|
| | | {
|
| | | MetadataReader metadataReader = null;
|
| | | for (Resource resource : resources)
|
| | | {
|
| | | if (resource.isReadable())
|
| | | {
|
| | | metadataReader = metadataReaderFactory.getMetadataReader(resource);
|
| | | try
|
| | | {
|
| | | result.add(Class.forName(metadataReader.getClassMetadata().getClassName()).getPackage().getName());
|
| | | }
|
| | | catch (ClassNotFoundException e)
|
| | | {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | if (result.size() > 0)
|
| | | {
|
| | | HashSet<String> hashResult = new HashSet<String>(result);
|
| | | allResult.addAll(hashResult);
|
| | | }
|
| | | }
|
| | | if (allResult.size() > 0)
|
| | | {
|
| | | typeAliasesPackage = String.join(",", (String[]) allResult.toArray(new String[0]));
|
| | | }
|
| | | else
|
| | | {
|
| | | throw new RuntimeException("mybatis typeAliasesPackage è·¯å¾æ«æé误,åæ°typeAliasesPackage:" + typeAliasesPackage + "æªæ¾å°ä»»ä½å
");
|
| | | }
|
| | | }
|
| | | catch (IOException e)
|
| | | {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return typeAliasesPackage;
|
| | | }
|
| | |
|
| | | @Bean
|
| | | public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception
|
| | | {
|
| | | String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage");
|
| | | String mapperLocations = env.getProperty("mybatis.mapperLocations");
|
| | | typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage);
|
| | | VFS.addImplClass(SpringBootVFS.class);
|
| | |
|
| | | final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
|
| | | sessionFactory.setDataSource(dataSource);
|
| | | sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
|
| | | sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(mapperLocations));
|
| | | return sessionFactory.getObject();
|
| | | }
|
| | | } |
ruoyi/src/main/java/com/ruoyi/framework/config/RedisConfig.java
ruoyi/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
ruoyi/src/main/java/com/ruoyi/framework/config/RuoYiConfig.java
ruoyi/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
ruoyi/src/main/java/com/ruoyi/framework/config/ServerConfig.java
ruoyi/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java
ruoyi/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java
ruoyi/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java
ruoyi/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java
ruoyi/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java
ruoyi/src/main/java/com/ruoyi/framework/manager/AsyncManager.java
ruoyi/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java
ruoyi/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java
ruoyi/src/main/java/com/ruoyi/framework/redis/RedisCache.java
ruoyi/src/main/java/com/ruoyi/framework/security/LoginUser.java
ruoyi/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java
ruoyi/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java
ruoyi/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java
ruoyi/src/main/java/com/ruoyi/framework/security/service/PermissionService.java
ruoyi/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java
ruoyi/src/main/java/com/ruoyi/framework/security/service/SysPermissionService.java
ruoyi/src/main/java/com/ruoyi/framework/security/service/TokenService.java
ruoyi/src/main/java/com/ruoyi/framework/security/service/UserDetailsServiceImpl.java
ruoyi/src/main/java/com/ruoyi/framework/web/controller/BaseController.java
ruoyi/src/main/java/com/ruoyi/framework/web/domain/AjaxResult.java
ruoyi/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java
ruoyi/src/main/java/com/ruoyi/framework/web/domain/Server.java
ruoyi/src/main/java/com/ruoyi/framework/web/domain/TreeSelect.java
ruoyi/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java
ruoyi/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java
ruoyi/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java
ruoyi/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java
ruoyi/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java
ruoyi/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java
ruoyi/src/main/java/com/ruoyi/framework/web/page/PageDomain.java
ruoyi/src/main/java/com/ruoyi/framework/web/page/TableDataInfo.java
ruoyi/src/main/java/com/ruoyi/framework/web/page/TableSupport.java
ruoyi/src/main/java/com/ruoyi/project/common/CaptchaController.java
ruoyi/src/main/java/com/ruoyi/project/common/CommonController.java
ruoyi/src/main/java/com/ruoyi/project/monitor/controller/ServerController.java
ruoyi/src/main/java/com/ruoyi/project/monitor/controller/SysLogininforController.java
ruoyi/src/main/java/com/ruoyi/project/monitor/controller/SysOperlogController.java
ruoyi/src/main/java/com/ruoyi/project/monitor/domain/SysLogininfor.java
ruoyi/src/main/java/com/ruoyi/project/monitor/domain/SysOperLog.java
ruoyi/src/main/java/com/ruoyi/project/monitor/mapper/SysLogininforMapper.java
ruoyi/src/main/java/com/ruoyi/project/monitor/mapper/SysOperLogMapper.java
ruoyi/src/main/java/com/ruoyi/project/monitor/service/ISysLogininforService.java
ruoyi/src/main/java/com/ruoyi/project/monitor/service/ISysOperLogService.java
ruoyi/src/main/java/com/ruoyi/project/monitor/service/impl/SysLogininforServiceImpl.java
ruoyi/src/main/java/com/ruoyi/project/monitor/service/impl/SysOperLogServiceImpl.java
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysConfigController.java
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDictDataController.java
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysLoginController.java
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysMenuController.java
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysNoticeController.java
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysPostController.java
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysProfileController.java
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysRoleController.java
ruoyi/src/main/java/com/ruoyi/project/system/controller/SysUserController.java
ruoyi/src/main/java/com/ruoyi/project/system/domain/SysConfig.java
ruoyi/src/main/java/com/ruoyi/project/system/domain/SysDept.java
ruoyi/src/main/java/com/ruoyi/project/system/domain/SysDictData.java
ruoyi/src/main/java/com/ruoyi/project/system/domain/SysDictType.java
ruoyi/src/main/java/com/ruoyi/project/system/domain/SysMenu.java
ruoyi/src/main/java/com/ruoyi/project/system/domain/SysNotice.java
ruoyi/src/main/java/com/ruoyi/project/system/domain/SysPost.java
ruoyi/src/main/java/com/ruoyi/project/system/domain/SysRole.java
ruoyi/src/main/java/com/ruoyi/project/system/domain/SysRoleDept.java
ruoyi/src/main/java/com/ruoyi/project/system/domain/SysRoleMenu.java
ruoyi/src/main/java/com/ruoyi/project/system/domain/SysUser.java
ruoyi/src/main/java/com/ruoyi/project/system/domain/SysUserPost.java
ruoyi/src/main/java/com/ruoyi/project/system/domain/SysUserRole.java
ruoyi/src/main/java/com/ruoyi/project/system/domain/vo/MetaVo.java
ruoyi/src/main/java/com/ruoyi/project/system/domain/vo/RouterVo.java
ruoyi/src/main/java/com/ruoyi/project/system/mapper/SysConfigMapper.java
ruoyi/src/main/java/com/ruoyi/project/system/mapper/SysDeptMapper.java
ruoyi/src/main/java/com/ruoyi/project/system/mapper/SysDictDataMapper.java
ruoyi/src/main/java/com/ruoyi/project/system/mapper/SysDictTypeMapper.java
ruoyi/src/main/java/com/ruoyi/project/system/mapper/SysMenuMapper.java
ruoyi/src/main/java/com/ruoyi/project/system/mapper/SysNoticeMapper.java
ruoyi/src/main/java/com/ruoyi/project/system/mapper/SysPostMapper.java
ruoyi/src/main/java/com/ruoyi/project/system/mapper/SysRoleDeptMapper.java
ruoyi/src/main/java/com/ruoyi/project/system/mapper/SysRoleMapper.java
ruoyi/src/main/java/com/ruoyi/project/system/mapper/SysRoleMenuMapper.java
ruoyi/src/main/java/com/ruoyi/project/system/mapper/SysUserMapper.java
ruoyi/src/main/java/com/ruoyi/project/system/mapper/SysUserPostMapper.java
ruoyi/src/main/java/com/ruoyi/project/system/mapper/SysUserRoleMapper.java
ruoyi/src/main/java/com/ruoyi/project/system/service/ISysConfigService.java
ruoyi/src/main/java/com/ruoyi/project/system/service/ISysDeptService.java
ruoyi/src/main/java/com/ruoyi/project/system/service/ISysDictDataService.java
ruoyi/src/main/java/com/ruoyi/project/system/service/ISysDictTypeService.java
ruoyi/src/main/java/com/ruoyi/project/system/service/ISysMenuService.java
ruoyi/src/main/java/com/ruoyi/project/system/service/ISysNoticeService.java
ruoyi/src/main/java/com/ruoyi/project/system/service/ISysPostService.java
ruoyi/src/main/java/com/ruoyi/project/system/service/ISysRoleService.java
ruoyi/src/main/java/com/ruoyi/project/system/service/ISysUserService.java
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysConfigServiceImpl.java
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysDeptServiceImpl.java
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysDictDataServiceImpl.java
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysDictTypeServiceImpl.java
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysMenuServiceImpl.java
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysNoticeServiceImpl.java
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysPostServiceImpl.java
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysRoleServiceImpl.java
ruoyi/src/main/java/com/ruoyi/project/system/service/impl/SysUserServiceImpl.java
ruoyi/src/main/java/com/ruoyi/project/tool/swagger/TestController.java
ruoyi/src/main/resources/application-druid.yml
ruoyi/src/main/resources/application.yml
ruoyi/src/main/resources/banner.txt
ruoyi/src/main/resources/i18n/messages.properties
ruoyi/src/main/resources/logback.xml
ruoyi/src/main/resources/mybatis/monitor/SysLogininforMapper.xml
ruoyi/src/main/resources/mybatis/monitor/SysOperLogMapper.xml
ruoyi/src/main/resources/mybatis/mybatis-config.xml
ruoyi/src/main/resources/mybatis/system/SysConfigMapper.xml
ruoyi/src/main/resources/mybatis/system/SysDeptMapper.xml
ruoyi/src/main/resources/mybatis/system/SysDictDataMapper.xml
ruoyi/src/main/resources/mybatis/system/SysDictTypeMapper.xml
ruoyi/src/main/resources/mybatis/system/SysMenuMapper.xml
ruoyi/src/main/resources/mybatis/system/SysNoticeMapper.xml
ruoyi/src/main/resources/mybatis/system/SysPostMapper.xml
ruoyi/src/main/resources/mybatis/system/SysRoleDeptMapper.xml
ruoyi/src/main/resources/mybatis/system/SysRoleMapper.xml
ruoyi/src/main/resources/mybatis/system/SysRoleMenuMapper.xml
ruoyi/src/main/resources/mybatis/system/SysUserMapper.xml
ruoyi/src/main/resources/mybatis/system/SysUserPostMapper.xml
ruoyi/src/main/resources/mybatis/system/SysUserRoleMapper.xml |