mooho-base-admin-plus 0.1.50 → 0.1.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/.env +1 -1
  2. package/dist/fa-brands-400.8ea87917.woff2 +0 -0
  3. package/dist/fa-brands-400.a3b98177.svg +3717 -0
  4. package/dist/fa-brands-400.cda59d6e.ttf +0 -0
  5. package/dist/fa-brands-400.e4299464.eot +0 -0
  6. package/dist/fa-brands-400.f9217f66.woff +0 -0
  7. package/dist/fa-regular-400.79d08806.eot +0 -0
  8. package/dist/fa-regular-400.be0a0849.svg +801 -0
  9. package/dist/fa-regular-400.cb9e9e69.woff +0 -0
  10. package/dist/fa-regular-400.e42a8844.woff2 +0 -0
  11. package/dist/fa-regular-400.e8711bbb.ttf +0 -0
  12. package/dist/fa-solid-900.373c04fd.eot +0 -0
  13. package/dist/fa-solid-900.3f6d3488.woff +0 -0
  14. package/dist/fa-solid-900.9674eb1b.svg +5034 -0
  15. package/dist/fa-solid-900.9834b82a.woff2 +0 -0
  16. package/dist/fa-solid-900.af639750.ttf +0 -0
  17. package/dist/header-theme-dark.932bb39b.svg +40 -0
  18. package/dist/header-theme-primary.10194387.svg +40 -0
  19. package/dist/index.css +4 -0
  20. package/dist/index.html +19 -0
  21. package/dist/ionicons.13d29fa1.ttf +0 -0
  22. package/dist/ionicons.503dc6b7.woff2 +0 -0
  23. package/dist/ionicons.fe9ddf45.woff +0 -0
  24. package/dist/mooho-base-admin-plus.min.esm.js +92 -120099
  25. package/dist/mooho-base-admin-plus.min.js +58 -54
  26. package/dist/nav-theme-dark.d93c9dff.svg +40 -0
  27. package/dist/nav-theme-light.f039dce7.svg +40 -0
  28. package/package.json +1 -1
  29. package/src/i18n/locale/en-US.js +1 -1
  30. package/src/i18n/locale/lang.js +1 -1
  31. package/src/i18n/locale/zh-CN.js +1 -1
  32. package/src/layouts/basic-layout/index.vue +1 -1
  33. package/src/layouts/basic-layout/mixins/click-item.js +21 -21
  34. package/src/layouts/basic-layout/mixins/sider-menu-badge.js +13 -13
  35. package/src/layouts/basic-layout/mixins/translate-title.js +11 -11
  36. package/src/layouts/basic-layout/water-mark/index.vue +29 -29
  37. package/src/libs/random_str.js +10 -10
  38. package/src/libs/water-mark.js +44 -44
  39. package/src/pages/system/user.vue +34 -0
  40. package/src/styles/common.less +47 -47
  41. package/src/styles/default/index.less +6 -6
  42. package/src/styles/font/iconfont.css +47 -47
  43. package/src/styles/font/iconfont.json +65 -65
  44. package/src/styles/font/ionicons.svg +869 -869
  45. package/src/styles/index.less +7 -7
  46. package/src/styles/layout/basic-layout/layout.less +527 -527
  47. package/src/styles/layout/basic-layout/menu.less +274 -274
  48. package/src/styles/layout/index.less +2 -2
  49. package/src/styles/setting.less +6 -6
  50. package/test/main.js +0 -1
  51. package/vite.config.js +6 -5
  52. package/dist/style.css +0 -4
  53. package/src/plugins/log/index.js +0 -25
  54. package/src/styles/font/demo.css +0 -539
  55. package/src/styles/font/demo_index.html +0 -372
  56. package/src/styles/font/icon-demo/demo.css +0 -539
  57. package/src/styles/font/icon-demo/demo_index.html +0 -423
  58. package/src/styles/font/icon-demo/iconfont.css +0 -61
  59. package/src/styles/font/icon-demo/iconfont.eot +0 -0
  60. package/src/styles/font/icon-demo/iconfont.js +0 -1
  61. package/src/styles/font/icon-demo/iconfont.svg +0 -59
  62. package/src/styles/font/icon-demo/iconfont.ttf +0 -0
  63. package/src/styles/font/icon-demo/iconfont.woff +0 -0
  64. package/src/styles/font/icon-demo/iconfont.woff2 +0 -0
@@ -0,0 +1,40 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="52px" height="45px" viewBox="0 0 52 45" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
4
+ <title>Group 5 Copy 5</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs>
7
+ <filter x="-9.4%" y="-6.2%" width="118.8%" height="122.5%" filterUnits="objectBoundingBox" id="filter-1">
8
+ <feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
9
+ <feGaussianBlur stdDeviation="1" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
10
+ <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0" type="matrix" in="shadowBlurOuter1" result="shadowMatrixOuter1"></feColorMatrix>
11
+ <feMerge>
12
+ <feMergeNode in="shadowMatrixOuter1"></feMergeNode>
13
+ <feMergeNode in="SourceGraphic"></feMergeNode>
14
+ </feMerge>
15
+ </filter>
16
+ <rect id="path-2" x="0" y="0" width="48" height="40" rx="4"></rect>
17
+ <filter x="-4.2%" y="-2.5%" width="108.3%" height="110.0%" filterUnits="objectBoundingBox" id="filter-4">
18
+ <feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
19
+ <feGaussianBlur stdDeviation="0.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
20
+ <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
21
+ </filter>
22
+ </defs>
23
+ <g id="配置面板" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24
+ <g id="setting-copy-2" transform="translate(-1190.000000, -136.000000)">
25
+ <g id="Group-8" transform="translate(1167.000000, 0.000000)">
26
+ <g id="Group-5-Copy-5" filter="url(#filter-1)" transform="translate(25.000000, 137.000000)">
27
+ <mask id="mask-3" fill="white">
28
+ <use xlink:href="#path-2"></use>
29
+ </mask>
30
+ <g id="Rectangle-18">
31
+ <use fill="black" fill-opacity="1" filter="url(#filter-4)" xlink:href="#path-2"></use>
32
+ <use fill="#F0F2F5" fill-rule="evenodd" xlink:href="#path-2"></use>
33
+ </g>
34
+ <rect id="Rectangle-11" fill="#FFFFFF" mask="url(#mask-3)" x="-1" y="0" width="49" height="10"></rect>
35
+ <rect id="Rectangle-18" fill="#303648" mask="url(#mask-3)" x="0" y="0" width="16" height="44"></rect>
36
+ </g>
37
+ </g>
38
+ </g>
39
+ </g>
40
+ </svg>
@@ -0,0 +1,40 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="52px" height="45px" viewBox="0 0 52 45" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
4
+ <title>Group 5</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs>
7
+ <filter x="-9.4%" y="-6.2%" width="118.8%" height="122.5%" filterUnits="objectBoundingBox" id="filter-1">
8
+ <feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
9
+ <feGaussianBlur stdDeviation="1" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
10
+ <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0" type="matrix" in="shadowBlurOuter1" result="shadowMatrixOuter1"></feColorMatrix>
11
+ <feMerge>
12
+ <feMergeNode in="shadowMatrixOuter1"></feMergeNode>
13
+ <feMergeNode in="SourceGraphic"></feMergeNode>
14
+ </feMerge>
15
+ </filter>
16
+ <rect id="path-2" x="0" y="0" width="48" height="40" rx="4"></rect>
17
+ <filter x="-4.2%" y="-2.5%" width="108.3%" height="110.0%" filterUnits="objectBoundingBox" id="filter-4">
18
+ <feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
19
+ <feGaussianBlur stdDeviation="0.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
20
+ <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
21
+ </filter>
22
+ </defs>
23
+ <g id="配置面板" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
24
+ <g id="setting-copy-2" transform="translate(-1254.000000, -136.000000)">
25
+ <g id="Group-8" transform="translate(1167.000000, 0.000000)">
26
+ <g id="Group-5" filter="url(#filter-1)" transform="translate(89.000000, 137.000000)">
27
+ <mask id="mask-3" fill="white">
28
+ <use xlink:href="#path-2"></use>
29
+ </mask>
30
+ <g id="Rectangle-18">
31
+ <use fill="black" fill-opacity="1" filter="url(#filter-4)" xlink:href="#path-2"></use>
32
+ <use fill="#F0F2F5" fill-rule="evenodd" xlink:href="#path-2"></use>
33
+ </g>
34
+ <rect id="Rectangle-18" fill="#FFFFFF" mask="url(#mask-3)" x="0" y="0" width="16" height="44"></rect>
35
+ <rect id="Rectangle-11" fill="#FFFFFF" mask="url(#mask-3)" x="-1" y="0" width="49" height="10"></rect>
36
+ </g>
37
+ </g>
38
+ </g>
39
+ </g>
40
+ </svg>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mooho-base-admin-plus",
3
3
  "description": "MOOHO basic framework for admin by Vue3",
4
- "version": "0.1.50",
4
+ "version": "0.1.53",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "dotnetVersion": "1.3.97",
7
7
  "license": "MIT",
@@ -1 +1 @@
1
- import{s as e}from"./lang.js";const t={i:{locale:"en-US",select:{placeholder:"Select",noMatch:"No matching data",loading:"Loading"},table:{noDataText:"No Data",noFilteredDataText:"No filter data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},datepicker:{selectDate:"Select date",selectTime:"Select time",startTime:"Start Time",endTime:"End Time",clear:"Clear",ok:"OK",datePanelLabel:"[mmmm] [yyyy]",month:"Month",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",year:"Year",weekStartDay:"0",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},months:{m1:"Jan",m2:"Feb",m3:"Mar",m4:"Apr",m5:"May",m6:"Jun",m7:"Jul",m8:"Aug",m9:"Sep",m10:"Oct",m11:"Nov",m12:"Dec"}},transfer:{titles:{source:"Source",target:"Target"},filterPlaceholder:"Search here",notFoundText:"Not Found"},modal:{okText:"OK",cancelText:"Cancel"},poptip:{okText:"OK",cancelText:"Cancel"},page:{prev:"Previous Page",next:"Next Page",total:"Total",item:"item",items:"items",prev5:"Previous 5 Pages",next5:"Next 5 Pages",page:"/page",goto:"Goto",p:""},rate:{star:"Star",stars:"Stars"},time:{before:" ago",after:" after",just:"just now",seconds:" seconds",minutes:" minutes",hours:" hours",days:" days"},tree:{emptyText:"No Data"}}};e(t);export{t as default};
1
+ import{s as e}from"./lang.js";const t={i:{locale:"en-US",select:{placeholder:"Select",noMatch:"No matching data",loading:"Loading"},table:{noDataText:"No Data",noFilteredDataText:"No filter data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},datepicker:{selectDate:"Select date",selectTime:"Select time",startTime:"Start Time",endTime:"End Time",clear:"Clear",ok:"OK",datePanelLabel:"[mmmm] [yyyy]",month:"Month",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",year:"Year",weekStartDay:"0",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},months:{m1:"Jan",m2:"Feb",m3:"Mar",m4:"Apr",m5:"May",m6:"Jun",m7:"Jul",m8:"Aug",m9:"Sep",m10:"Oct",m11:"Nov",m12:"Dec"}},transfer:{titles:{source:"Source",target:"Target"},filterPlaceholder:"Search here",notFoundText:"Not Found"},modal:{okText:"OK",cancelText:"Cancel"},poptip:{okText:"OK",cancelText:"Cancel"},page:{prev:"Previous Page",next:"Next Page",total:"Total",item:"item",items:"items",prev5:"Previous 5 Pages",next5:"Next 5 Pages",page:"/page",goto:"Goto",p:""},rate:{star:"Star",stars:"Stars"},time:{before:" ago",after:" after",just:"just now",seconds:" seconds",minutes:" minutes",hours:" hours",days:" days"},tree:{emptyText:"No Data"}}};e(t);export{t as default};
@@ -1 +1 @@
1
- const e=typeof window!="undefined";function n(i){e&&typeof window.viewuiplus!="undefined"&&("langs"in viewuiplus||(viewuiplus.langs={}),viewuiplus.langs[i.i.locale]=i)}export{n as s};
1
+ const e=typeof window!="undefined";function n(i){e&&typeof window.viewuiplus!="undefined"&&("langs"in viewuiplus||(viewuiplus.langs={}),viewuiplus.langs[i.i.locale]=i)}export{n as s};
@@ -1 +1 @@
1
- import{s as e}from"./lang.js";const t={i:{locale:"zh-CN",select:{placeholder:"\u8BF7\u9009\u62E9",noMatch:"\u65E0\u5339\u914D\u6570\u636E",loading:"\u52A0\u8F7D\u4E2D"},table:{noDataText:"\u6682\u65E0\u6570\u636E",noFilteredDataText:"\u6682\u65E0\u7B5B\u9009\u7ED3\u679C",confirmFilter:"\u7B5B\u9009",resetFilter:"\u91CD\u7F6E",clearFilter:"\u5168\u90E8",sumText:"\u5408\u8BA1"},datepicker:{selectDate:"\u9009\u62E9\u65E5\u671F",selectTime:"\u9009\u62E9\u65F6\u95F4",startTime:"\u5F00\u59CB\u65F6\u95F4",endTime:"\u7ED3\u675F\u65F6\u95F4",clear:"\u6E05\u7A7A",ok:"\u786E\u5B9A",datePanelLabel:"[yyyy\u5E74] [m\u6708]",month:"\u6708",month1:"1 \u6708",month2:"2 \u6708",month3:"3 \u6708",month4:"4 \u6708",month5:"5 \u6708",month6:"6 \u6708",month7:"7 \u6708",month8:"8 \u6708",month9:"9 \u6708",month10:"10 \u6708",month11:"11 \u6708",month12:"12 \u6708",year:"\u5E74",weekStartDay:"0",weeks:{sun:"\u65E5",mon:"\u4E00",tue:"\u4E8C",wed:"\u4E09",thu:"\u56DB",fri:"\u4E94",sat:"\u516D"},months:{m1:"1\u6708",m2:"2\u6708",m3:"3\u6708",m4:"4\u6708",m5:"5\u6708",m6:"6\u6708",m7:"7\u6708",m8:"8\u6708",m9:"9\u6708",m10:"10\u6708",m11:"11\u6708",m12:"12\u6708"}},transfer:{titles:{source:"\u6E90\u5217\u8868",target:"\u76EE\u7684\u5217\u8868"},filterPlaceholder:"\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",notFoundText:"\u5217\u8868\u4E3A\u7A7A"},modal:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88"},poptip:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88"},page:{prev:"\u4E0A\u4E00\u9875",next:"\u4E0B\u4E00\u9875",total:"\u5171",item:"\u6761",items:"\u6761",prev5:"\u5411\u524D 5 \u9875",next5:"\u5411\u540E 5 \u9875",page:"\u6761/\u9875",goto:"\u8DF3\u81F3",p:"\u9875"},rate:{star:"\u661F",stars:"\u661F"},time:{before:"\u524D",after:"\u540E",just:"\u521A\u521A",seconds:"\u79D2",minutes:"\u5206\u949F",hours:"\u5C0F\u65F6",days:"\u5929"},tree:{emptyText:"\u6682\u65E0\u6570\u636E"}}};e(t);export{t as default};
1
+ import{s as e}from"./lang.js";const t={i:{locale:"zh-CN",select:{placeholder:"\u8BF7\u9009\u62E9",noMatch:"\u65E0\u5339\u914D\u6570\u636E",loading:"\u52A0\u8F7D\u4E2D"},table:{noDataText:"\u6682\u65E0\u6570\u636E",noFilteredDataText:"\u6682\u65E0\u7B5B\u9009\u7ED3\u679C",confirmFilter:"\u7B5B\u9009",resetFilter:"\u91CD\u7F6E",clearFilter:"\u5168\u90E8",sumText:"\u5408\u8BA1"},datepicker:{selectDate:"\u9009\u62E9\u65E5\u671F",selectTime:"\u9009\u62E9\u65F6\u95F4",startTime:"\u5F00\u59CB\u65F6\u95F4",endTime:"\u7ED3\u675F\u65F6\u95F4",clear:"\u6E05\u7A7A",ok:"\u786E\u5B9A",datePanelLabel:"[yyyy\u5E74] [m\u6708]",month:"\u6708",month1:"1 \u6708",month2:"2 \u6708",month3:"3 \u6708",month4:"4 \u6708",month5:"5 \u6708",month6:"6 \u6708",month7:"7 \u6708",month8:"8 \u6708",month9:"9 \u6708",month10:"10 \u6708",month11:"11 \u6708",month12:"12 \u6708",year:"\u5E74",weekStartDay:"0",weeks:{sun:"\u65E5",mon:"\u4E00",tue:"\u4E8C",wed:"\u4E09",thu:"\u56DB",fri:"\u4E94",sat:"\u516D"},months:{m1:"1\u6708",m2:"2\u6708",m3:"3\u6708",m4:"4\u6708",m5:"5\u6708",m6:"6\u6708",m7:"7\u6708",m8:"8\u6708",m9:"9\u6708",m10:"10\u6708",m11:"11\u6708",m12:"12\u6708"}},transfer:{titles:{source:"\u6E90\u5217\u8868",target:"\u76EE\u7684\u5217\u8868"},filterPlaceholder:"\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",notFoundText:"\u5217\u8868\u4E3A\u7A7A"},modal:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88"},poptip:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88"},page:{prev:"\u4E0A\u4E00\u9875",next:"\u4E0B\u4E00\u9875",total:"\u5171",item:"\u6761",items:"\u6761",prev5:"\u5411\u524D 5 \u9875",next5:"\u5411\u540E 5 \u9875",page:"\u6761/\u9875",goto:"\u8DF3\u81F3",p:"\u9875"},rate:{star:"\u661F",stars:"\u661F"},time:{before:"\u524D",after:"\u540E",just:"\u521A\u521A",seconds:"\u79D2",minutes:"\u5206\u949F",hours:"\u5C0F\u65F6",days:"\u5929"},tree:{emptyText:"\u6682\u65E0\u6570\u636E"}}};e(t);export{t as default};
@@ -33,7 +33,7 @@
33
33
  <div class="i-layout-content-main">
34
34
  <router-view #default="{ Component }">
35
35
  <keep-alive :include="keepAlive">
36
- <component :is="Component" v-if="loadRouter" />
36
+ <component :is="Component" :key="$route.name" v-if="loadRouter" />
37
37
  </keep-alive>
38
38
  </router-view>
39
39
  </div>
@@ -1,21 +1,21 @@
1
- import { findComponentUpward } from 'view-ui-plus/src/utils/assist';
2
- import { mapState } from 'vuex';
3
-
4
- export default {
5
- computed: {
6
- ...mapState('admin/layout', ['menuSiderReload', 'menuHeaderReload'])
7
- },
8
- methods: {
9
- handleClick(path, type = 'sider') {
10
- const current = this.$route.path;
11
- if (current === path) {
12
- if (type === 'sider' && this.menuSiderReload) this.handleReload();
13
- else if (type === 'header' && this.menuHeaderReload) this.handleReload();
14
- }
15
- },
16
- handleReload() {
17
- const $layout = findComponentUpward(this, 'BasicLayout');
18
- if ($layout) $layout.handleReload();
19
- }
20
- }
21
- };
1
+ import { findComponentUpward } from 'view-ui-plus/src/utils/assist';
2
+ import { mapState } from 'vuex';
3
+
4
+ export default {
5
+ computed: {
6
+ ...mapState('admin/layout', ['menuSiderReload', 'menuHeaderReload'])
7
+ },
8
+ methods: {
9
+ handleClick(path, type = 'sider') {
10
+ const current = this.$route.path;
11
+ if (current === path) {
12
+ if (type === 'sider' && this.menuSiderReload) this.handleReload();
13
+ else if (type === 'header' && this.menuHeaderReload) this.handleReload();
14
+ }
15
+ },
16
+ handleReload() {
17
+ const $layout = findComponentUpward(this, 'BasicLayout');
18
+ if ($layout) $layout.handleReload();
19
+ }
20
+ }
21
+ };
@@ -1,13 +1,13 @@
1
- import { mapState } from 'vuex';
2
-
3
- export default {
4
- computed: {
5
- ...mapState('admin/menu', ['siderMenuBadge']),
6
- badgeData() {
7
- let data = null;
8
- const siderMenuBadge = this.siderMenuBadge.find(item => item.path === this.menu.path);
9
- if (siderMenuBadge) data = siderMenuBadge;
10
- return data;
11
- }
12
- }
13
- };
1
+ import { mapState } from 'vuex';
2
+
3
+ export default {
4
+ computed: {
5
+ ...mapState('admin/menu', ['siderMenuBadge']),
6
+ badgeData() {
7
+ let data = null;
8
+ const siderMenuBadge = this.siderMenuBadge.find(item => item.path === this.menu.path);
9
+ if (siderMenuBadge) data = siderMenuBadge;
10
+ return data;
11
+ }
12
+ }
13
+ };
@@ -1,11 +1,11 @@
1
- export default {
2
- methods: {
3
- tTitle(title) {
4
- if (title && title.indexOf('$t:') === 0) {
5
- return this.$t(title.split('$t:')[1]);
6
- } else {
7
- return title;
8
- }
9
- }
10
- }
11
- };
1
+ export default {
2
+ methods: {
3
+ tTitle(title) {
4
+ if (title && title.indexOf('$t:') === 0) {
5
+ return this.$t(title.split('$t:')[1]);
6
+ } else {
7
+ return title;
8
+ }
9
+ }
10
+ }
11
+ };
@@ -1,29 +1,29 @@
1
- <template>
2
- <div :style="styles" v-if="waterMark.show"></div>
3
- </template>
4
- <script>
5
- import { mapState } from 'vuex';
6
- import getWaterMarkCanvas from '../../../libs/water-mark';
7
-
8
- export default {
9
- name: 'i-water-mark',
10
- computed: {
11
- ...mapState('admin/layout', ['waterMark']),
12
- styles() {
13
- const url = getWaterMarkCanvas(this.waterMark.text, this.waterMark.options);
14
- return {
15
- width: '100%',
16
- height: '100%',
17
- position: 'absolute',
18
- top: '0',
19
- left: '0',
20
- 'z-index': '2000',
21
- 'background-size': '320px',
22
- 'background-repeat': 'repeat',
23
- 'background-image': `url(${url})`,
24
- 'pointer-events': 'none'
25
- };
26
- }
27
- }
28
- };
29
- </script>
1
+ <template>
2
+ <div :style="styles" v-if="waterMark.show"></div>
3
+ </template>
4
+ <script>
5
+ import { mapState } from 'vuex';
6
+ import getWaterMarkCanvas from '../../../libs/water-mark';
7
+
8
+ export default {
9
+ name: 'i-water-mark',
10
+ computed: {
11
+ ...mapState('admin/layout', ['waterMark']),
12
+ styles() {
13
+ const url = getWaterMarkCanvas(this.waterMark.text, this.waterMark.options);
14
+ return {
15
+ width: '100%',
16
+ height: '100%',
17
+ position: 'absolute',
18
+ top: '0',
19
+ left: '0',
20
+ 'z-index': '2000',
21
+ 'background-size': '320px',
22
+ 'background-repeat': 'repeat',
23
+ 'background-image': `url(${url})`,
24
+ 'pointer-events': 'none'
25
+ };
26
+ }
27
+ }
28
+ };
29
+ </script>
@@ -1,10 +1,10 @@
1
- // 生成随机字符串
2
- export default function (len = 32) {
3
- const $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
4
- const maxPos = $chars.length;
5
- let str = '';
6
- for (let i = 0; i < len; i++) {
7
- str += $chars.charAt(Math.floor(Math.random() * maxPos));
8
- }
9
- return str;
10
- }
1
+ // 生成随机字符串
2
+ export default function (len = 32) {
3
+ const $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
4
+ const maxPos = $chars.length;
5
+ let str = '';
6
+ for (let i = 0; i < len; i++) {
7
+ str += $chars.charAt(Math.floor(Math.random() * maxPos));
8
+ }
9
+ return str;
10
+ }
@@ -1,44 +1,44 @@
1
- /**
2
- * @description 生成水印
3
- * */
4
- export default function getWaterMarkCanvas(text, options) {
5
- const canvas = document.createElement('canvas');
6
- const ctx = canvas.getContext('2d');
7
- const canvasWidth = 400;
8
- const canvasHeight = 400;
9
- canvas.width = canvasWidth;
10
- canvas.height = canvasHeight;
11
- ctx.textAlign = 'center';
12
- ctx.textBaseline = 'bottom';
13
- ctx.globalAlpha = options.globalAlpha || 0.1;
14
- ctx.font = options.font || '20px Microsoft Yahei';
15
-
16
- ctx.translate(canvasWidth / 2, canvasHeight / 2);
17
- ctx.rotate(options.rotateAngle || -0.4);
18
-
19
- ctx.translate((-canvasWidth / 2) * 1.2, (-canvasHeight / 2) * 1.2);
20
-
21
- const waterMarkText = [];
22
- const chunkWidth = options.chunkWidth || 400;
23
- const chunkHeight = options.chunkHeight || 120;
24
- const horizontalChunkCount = 0;
25
- const verticalChunkCount = 1;
26
-
27
- for (let j = 0, initY = chunkHeight / 2, indent = 0; j <= verticalChunkCount; j += 1) {
28
- indent = parseInt(j % 2);
29
-
30
- for (let i = 0, initX = chunkWidth / 2; i <= horizontalChunkCount; i += 1) {
31
- waterMarkText.push({
32
- text,
33
- x: i * chunkWidth + indent * initX,
34
- y: j * chunkHeight + initY
35
- });
36
- }
37
- }
38
-
39
- waterMarkText.forEach(item => {
40
- ctx.fillText(item.text, item.x, item.y);
41
- });
42
-
43
- return ctx.canvas.toDataURL();
44
- }
1
+ /**
2
+ * @description 生成水印
3
+ * */
4
+ export default function getWaterMarkCanvas(text, options) {
5
+ const canvas = document.createElement('canvas');
6
+ const ctx = canvas.getContext('2d');
7
+ const canvasWidth = 400;
8
+ const canvasHeight = 400;
9
+ canvas.width = canvasWidth;
10
+ canvas.height = canvasHeight;
11
+ ctx.textAlign = 'center';
12
+ ctx.textBaseline = 'bottom';
13
+ ctx.globalAlpha = options.globalAlpha || 0.1;
14
+ ctx.font = options.font || '20px Microsoft Yahei';
15
+
16
+ ctx.translate(canvasWidth / 2, canvasHeight / 2);
17
+ ctx.rotate(options.rotateAngle || -0.4);
18
+
19
+ ctx.translate((-canvasWidth / 2) * 1.2, (-canvasHeight / 2) * 1.2);
20
+
21
+ const waterMarkText = [];
22
+ const chunkWidth = options.chunkWidth || 400;
23
+ const chunkHeight = options.chunkHeight || 120;
24
+ const horizontalChunkCount = 0;
25
+ const verticalChunkCount = 1;
26
+
27
+ for (let j = 0, initY = chunkHeight / 2, indent = 0; j <= verticalChunkCount; j += 1) {
28
+ indent = parseInt(j % 2);
29
+
30
+ for (let i = 0, initX = chunkWidth / 2; i <= horizontalChunkCount; i += 1) {
31
+ waterMarkText.push({
32
+ text,
33
+ x: i * chunkWidth + indent * initX,
34
+ y: j * chunkHeight + initY
35
+ });
36
+ }
37
+ }
38
+
39
+ waterMarkText.forEach(item => {
40
+ ctx.fillText(item.text, item.x, item.y);
41
+ });
42
+
43
+ return ctx.canvas.toDataURL();
44
+ }
@@ -8,6 +8,7 @@
8
8
  <template #command="{ row }">
9
9
  <Button size="small" title="角色" type="info" custom-icon="fa fa-users" @click="$refs.userRoleTable.open({ userID: row.id })"></Button>
10
10
  <Button size="small" title="编辑" type="primary" custom-icon="fa fa-edit" @click="$refs.form.open(row)"></Button>
11
+ <Button size="small" title="数据权限" type="primary" custom-icon="fa fa-sitemap" @click="openDataPermission(row)"></Button>
11
12
  <Button size="small" title="删除" type="warning" custom-icon="fa fa-trash-alt" @click="$refs.table.remove(row)"></Button>
12
13
  </template>
13
14
  </view-table>
@@ -69,6 +70,11 @@
69
70
  <Button type="primary" custom-icon="fa fa-save" @click="userRoleSave">保存</Button>
70
71
  </template>
71
72
  </modal-form>
73
+ <modal-form ref="dataPermissionForm" view-code="DataPermission">
74
+ <template #footer>
75
+ <Button type="primary" custom-icon="fa fa-save" @click="saveDataPermission">保存</Button>
76
+ </template>
77
+ </modal-form>
72
78
  </div>
73
79
  </template>
74
80
  <script>
@@ -83,6 +89,7 @@
83
89
  components: {},
84
90
  data() {
85
91
  return {
92
+ user: null,
86
93
  userID: null,
87
94
  factories: []
88
95
  };
@@ -244,6 +251,33 @@
244
251
  await userApi.resetPassword(this.$refs.form.data.id);
245
252
  this.success('已重置为初始密码!');
246
253
  });
254
+ },
255
+ // 打开数据权限
256
+ openDataPermission(row) {
257
+ let data = {};
258
+ if (!!(row.dataPermission || '').trim()) {
259
+ data = JSON.parse(row.dataPermission);
260
+ }
261
+
262
+ this.user = row;
263
+ this.$refs.dataPermissionForm.open(data);
264
+ },
265
+ // 数据权限保存
266
+ saveDataPermission() {
267
+ let data = this.$refs.dataPermissionForm.data;
268
+ for (let key in data) {
269
+ if (typeof data[key] == 'object') {
270
+ delete data[key];
271
+ }
272
+ }
273
+
274
+ this.user.dataPermission = JSON.stringify(data);
275
+
276
+ this.confirm('确定要保存数据权限吗?', async () => {
277
+ await modelApi.update('User', this.user);
278
+ this.success('操作成功!');
279
+ this.$refs.dataPermissionForm.close();
280
+ });
247
281
  }
248
282
  }
249
283
  };
@@ -1,47 +1,47 @@
1
- #app, body, html{
2
- height: 100%;
3
- }
4
- body{
5
- background-color: @background-color-base;
6
- font-size: 14px;
7
- }
8
-
9
- // 隐藏滚动条样式
10
- .i-scrollbar-hide{
11
- &::-webkit-scrollbar{
12
- width: 0;
13
- }
14
- &::-webkit-scrollbar-track{
15
- background-color: transparent;
16
- }
17
- &::-webkit-scrollbar-thumb{
18
- background: #e8eaec;
19
- }
20
- }
21
-
22
- // 极简滚动条样式
23
- .i-scrollbar{
24
- &::-webkit-scrollbar{
25
- width: 6px;
26
- }
27
- &::-webkit-scrollbar-track{
28
- background-color: transparent;
29
- }
30
- &::-webkit-scrollbar-thumb{
31
- background: #808695;
32
- border-radius: 4px;
33
- }
34
- }
35
-
36
- // 去除 Table 的左右边框,更精简
37
- .i-table-no-border{
38
- .ivu-table th{
39
- background-color: #fff;
40
- }
41
- .ivu-table-wrapper, .ivu-table tr:last-child td{
42
- border: none;
43
- }
44
- .ivu-table:before, .ivu-table:after{
45
- display: none;
46
- }
47
- }
1
+ #app, body, html{
2
+ height: 100%;
3
+ }
4
+ body{
5
+ background-color: @background-color-base;
6
+ font-size: 14px;
7
+ }
8
+
9
+ // 隐藏滚动条样式
10
+ .i-scrollbar-hide{
11
+ &::-webkit-scrollbar{
12
+ width: 0;
13
+ }
14
+ &::-webkit-scrollbar-track{
15
+ background-color: transparent;
16
+ }
17
+ &::-webkit-scrollbar-thumb{
18
+ background: #e8eaec;
19
+ }
20
+ }
21
+
22
+ // 极简滚动条样式
23
+ .i-scrollbar{
24
+ &::-webkit-scrollbar{
25
+ width: 6px;
26
+ }
27
+ &::-webkit-scrollbar-track{
28
+ background-color: transparent;
29
+ }
30
+ &::-webkit-scrollbar-thumb{
31
+ background: #808695;
32
+ border-radius: 4px;
33
+ }
34
+ }
35
+
36
+ // 去除 Table 的左右边框,更精简
37
+ .i-table-no-border{
38
+ .ivu-table th{
39
+ background-color: #fff;
40
+ }
41
+ .ivu-table-wrapper, .ivu-table tr:last-child td{
42
+ border: none;
43
+ }
44
+ .ivu-table:before, .ivu-table:after{
45
+ display: none;
46
+ }
47
+ }
@@ -1,6 +1,6 @@
1
- // 自定义主题
2
- // 详见 https://www.iviewui.com/docs/guide/theme
3
- @import 'view-ui-plus/src/styles/index.less';
4
-
5
- @menu-dark-title: #191a23;
6
- @menu-dark-active-bg: #101117;
1
+ // 自定义主题
2
+ // 详见 https://www.iviewui.com/docs/guide/theme
3
+ @import 'view-ui-plus/src/styles/index.less';
4
+
5
+ @menu-dark-title: #191a23;
6
+ @menu-dark-active-bg: #101117;