md-iview 1.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. package/README.md +2 -0
  2. package/package.json +116 -0
  3. package/src/components/libs/util.js +117 -0
  4. package/src/components/md-error-page/403.less +92 -0
  5. package/src/components/md-error-page/403.vue +34 -0
  6. package/src/components/md-error-page/404.less +60 -0
  7. package/src/components/md-error-page/404.vue +34 -0
  8. package/src/components/md-error-page/500.less +73 -0
  9. package/src/components/md-error-page/500.vue +36 -0
  10. package/src/components/md-error-page/demo/index.less +22 -0
  11. package/src/components/md-error-page/demo/index.vue +97 -0
  12. package/src/components/md-form-item/index.js +3 -0
  13. package/src/components/md-icon/icon.vue +77 -0
  14. package/src/components/md-icon/icons.js +5 -0
  15. package/src/components/md-icon/index.js +11 -0
  16. package/src/components/md-icon/style/index.less +1 -0
  17. package/src/components/md-loading/index.js +55 -0
  18. package/src/components/md-loading/index.vue +53 -0
  19. package/src/components/md-loading/md-loading.js +38 -0
  20. package/src/components/md-print/demo/index.vue +260 -0
  21. package/src/components/md-print/index.js +123 -0
  22. package/src/components/md-rich-editor/index.vue +69 -0
  23. package/src/components/md-rich-editor/module/image-extend/index.js +216 -0
  24. package/src/components/md-scroll-bar/demo/index.vue +102 -0
  25. package/src/components/md-scroll-bar/index.js +3 -0
  26. package/src/components/md-scroll-bar/index.less +90 -0
  27. package/src/components/md-scroll-bar/index.vue +250 -0
  28. package/src/components/md-select/index.js +7 -0
  29. package/src/components/md-select/select.vue +841 -0
  30. package/src/components/md-shrinkable-menu/components/sidebarMenu.vue +167 -0
  31. package/src/components/md-shrinkable-menu/components/sidebarMenuShrink.vue +119 -0
  32. package/src/components/md-shrinkable-menu/demo/data/cachePage.js +1 -0
  33. package/src/components/md-shrinkable-menu/demo/data/currentPath.js +9 -0
  34. package/src/components/md-shrinkable-menu/demo/data/menu.js +575 -0
  35. package/src/components/md-shrinkable-menu/demo/data/menu2.js +1017 -0
  36. package/src/components/md-shrinkable-menu/demo/data/pageTagsList.js +153 -0
  37. package/src/components/md-shrinkable-menu/demo/index.less +297 -0
  38. package/src/components/md-shrinkable-menu/demo/index.vue +285 -0
  39. package/src/components/md-shrinkable-menu/index.vue +112 -0
  40. package/src/components/md-shrinkable-menu/sidebar.vue +195 -0
  41. package/src/components/md-shrinkable-menu/styles/menu.less +5 -0
  42. package/src/components/md-shrinkable-menu/styles/sidebar.less +363 -0
  43. package/src/components/md-split-pane/demo/index.vue +101 -0
  44. package/src/components/md-split-pane/index.js +3 -0
  45. package/src/components/md-split-pane/index.less +93 -0
  46. package/src/components/md-split-pane/index.vue +230 -0
  47. package/src/components/md-table/action-tooltip.vue +45 -0
  48. package/src/components/md-table/can-edit-v2.vue +823 -0
  49. package/src/components/md-table/can-edit.vue +723 -0
  50. package/src/components/md-table/custom-cell.vue +71 -0
  51. package/src/components/md-table/date-picker-cell-v2.vue +48 -0
  52. package/src/components/md-table/date-picker-cell.vue +39 -0
  53. package/src/components/md-table/demo/data/search.js +67 -0
  54. package/src/components/md-table/demo/data/table2csv.js +200 -0
  55. package/src/components/md-table/demo/data/table2excel.js +239 -0
  56. package/src/components/md-table/demo/data/table_data.js +251 -0
  57. package/src/components/md-table/demo/editable-table.vue +144 -0
  58. package/src/components/md-table/demo/exportable-table.vue +124 -0
  59. package/src/components/md-table/demo/widgets/header-search.vue +88 -0
  60. package/src/components/md-table/drop-down-cell-v2.vue +87 -0
  61. package/src/components/md-table/drop-down-cell.vue +81 -0
  62. package/src/components/md-table/editable-expand.vue +143 -0
  63. package/src/components/md-table/expand.vue +97 -0
  64. package/src/components/md-table/index.vue +53 -0
  65. package/src/components/md-table/iview-table/cell.vue +99 -0
  66. package/src/components/md-table/iview-table/expand.js +21 -0
  67. package/src/components/md-table/iview-table/export-csv.js +76 -0
  68. package/src/components/md-table/iview-table/header.js +16 -0
  69. package/src/components/md-table/iview-table/index.js +2 -0
  70. package/src/components/md-table/iview-table/mixin.js +31 -0
  71. package/src/components/md-table/iview-table/table-body.vue +101 -0
  72. package/src/components/md-table/iview-table/table-head.vue +311 -0
  73. package/src/components/md-table/iview-table/table-tr.vue +31 -0
  74. package/src/components/md-table/iview-table/table.vue +1026 -0
  75. package/src/components/md-table/iview-table/util.js +93 -0
  76. package/src/components/md-table/libs/table2excel.js +100 -0
  77. package/src/components/md-table/select-cell-v2.vue +64 -0
  78. package/src/components/md-table/select-cell.vue +46 -0
  79. package/src/components/md-table/table.less +76 -0
  80. package/src/components/md-toolbar/index.vue +171 -0
  81. package/src/components/md-tree/index.js +2 -0
  82. package/src/components/md-tree/node.vue +238 -0
  83. package/src/components/md-tree/render.js +17 -0
  84. package/src/components/md-tree/tree.vue +241 -0
  85. package/src/components/utilities/can.js +35 -0
  86. package/src/directives/index.js +34 -0
  87. package/src/directives/resize.js +27 -0
  88. package/src/directives/scroll.js +27 -0
  89. package/src/directives/style/bg-color.js +23 -0
  90. package/src/directives/style/color.js +23 -0
  91. package/src/directives/style/font-size.js +23 -0
  92. package/src/directives/style/height.js +23 -0
  93. package/src/directives/style/lineHeight.js +23 -0
  94. package/src/directives/style/margin.js +48 -0
  95. package/src/directives/style/opacity.js +23 -0
  96. package/src/directives/style/padding.js +48 -0
  97. package/src/directives/style/width.js +24 -0
  98. package/src/index.js +442 -0
  99. package/src/locale/lang.js +5 -0
  100. package/src/mixins/colorable.js +51 -0
  101. package/src/style/color/bezierEasing.less +110 -0
  102. package/src/style/color/colorPalette.less +75 -0
  103. package/src/style/color/colors.less +146 -0
  104. package/src/style/color/tinyColor.less +1184 -0
  105. package/src/style/common.less +72 -0
  106. package/src/style/components/_ripple.less +60 -0
  107. package/src/style/components/_shrinkable-menu.less +46 -0
  108. package/src/style/components/_toolbar.less +96 -0
  109. package/src/style/components/index.less +3 -0
  110. package/src/style/components/rich-editor.less +6 -0
  111. package/src/style/index.less +10 -0
  112. package/src/style/theme.less +155 -0
  113. package/src/utils/color.js +46 -0
  114. package/src/utils/console.js +105 -0
  115. package/src/utils/load.js +79 -0
  116. package/src/utils/mask.js +139 -0
  117. package/src/utils/mixins.js +5 -0
  118. package/src/utils/validate.js +271 -0
@@ -0,0 +1,167 @@
1
+ <template>
2
+ <md-menu
3
+ class="menus"
4
+ ref="sideMenu"
5
+ :active-name="activeName"
6
+ :open-names="openNames"
7
+ :theme="menuTheme"
8
+ width="auto"
9
+ @on-select="changeMenu"
10
+ >
11
+ <template v-for="item in menuList">
12
+ <md-menu-item
13
+ :name="genMenuItemName(item)"
14
+ :key="'menuitem' + item.name"
15
+ class="menus-item"
16
+ style="padding: 0 14px 0 14px"
17
+ :style="{'height':cellHeight+'px', 'line-height':cellHeight+'px'}"
18
+ v-if="item.childList.length<=0"
19
+ >
20
+ <md-col>
21
+ <md-icon class="menus-item__icon"
22
+ :type="item.icon"
23
+ :size="iconSize"
24
+ :color="iconColor"
25
+ :key="'menuicon' + item.name">
26
+ </md-icon>
27
+ <span :key="'title' + item.name" class="menus-item__title">{{ itemTitle(item) }}</span>
28
+ </md-col>
29
+ </md-menu-item>
30
+ <md-divider style="margin: 0" v-if="item.childList.length<=0" v-show="showDivider"/>
31
+ <md-submenu class="menus-item" v-if="item.childList && item.childList.length>0" :name="genMenuItemName(item)" :key="item.name">
32
+ <template slot="title">
33
+ <Col>
34
+ <md-icon class="menus-item__icon" :type="item.icon" :size="iconSize" :color="iconColor"></md-icon>
35
+ <span class="menus-item__title">{{ itemTitle(item) }}</span>
36
+ </Col>
37
+ </template>
38
+ <template v-for="(child, index) in item.childList">
39
+ <md-menu-item
40
+ :name="genMenuItemName(child)"
41
+ :key="'menuitem' + child.name"
42
+ class="menus-item__submenus"
43
+ style="padding: 0 14px 0 14px"
44
+ :style="{'height':cellHeight+'px', 'line-height':cellHeight+'px'}"
45
+ v-if="!child.childList || child.childList.length<=0"
46
+ >
47
+ <md-col offset="2">
48
+ <md-icon class="menus-item__icon" :type="child.icon" :size="iconSize" :color="iconColor"></md-icon>
49
+ <span :key="'title' + child.name" class="menus-item__title">{{ itemTitle(child) }}</span>
50
+ </md-col>
51
+ </md-menu-item>
52
+ <Submenu class="menus-item" v-if="child.childList && child.childList.length>0" :name="genMenuItemName(child)" :key="child.name">
53
+ <template slot="title">
54
+ <Col offset="2">
55
+ <md-icon class="menus-item__icon" :type="child.icon" :size="iconSize" :color="iconColor"></md-icon>
56
+ <span class="menus-item__title">{{ itemTitle(child) }}</span>
57
+ </Col>
58
+ </template>
59
+ <template v-for="child2 in child.childList">
60
+ <md-menu-item
61
+ :name="genMenuItemName(child2)"
62
+ :key="'menuitem' + child2.name"
63
+ class="menus-item__submenus"
64
+ style="padding: 0 14px 0 14px"
65
+ :style="{'height':cellHeight+'px', 'line-height':cellHeight+'px'}"
66
+ >
67
+ <md-col offset="4">
68
+ <md-icon class="menus-item__icon" :type="child2.icon" :size="iconSize" :color="iconColor"></md-icon>
69
+ <span :key="'title' + child2.route" class="menus-item__title">{{ itemTitle(child2) }}</span>
70
+ </md-col>
71
+ </md-menu-item>
72
+ </template>
73
+ </Submenu>
74
+ </template>
75
+ </md-submenu>
76
+ <md-divider style="margin: 0" v-if="item.childList && item.childList.length>0" v-show="showDivider"/>
77
+ </template>
78
+ </md-menu>
79
+ </template>
80
+
81
+ <script>
82
+ import {consoleError} from "../../../utils/console";
83
+
84
+ export default {
85
+ name: "sidebarMenu",
86
+ filters:{
87
+ emptyString(val) {
88
+ if (!val) return '';
89
+ return val
90
+ }
91
+ },
92
+ props: {
93
+ menuList: Array,
94
+ menuTheme: {
95
+ type: String,
96
+ default: "light"
97
+ },
98
+ openNames: {
99
+ type: Array
100
+ },
101
+ showDivider:{
102
+ type:Boolean,
103
+ default:true
104
+ },
105
+ iconColor:{
106
+ type:Object|String,
107
+ default:'#C5C8CD'
108
+ },
109
+ iconSize: {
110
+ type:Number,
111
+ default:16,
112
+ },
113
+ cellHeight:{
114
+ type:Number,
115
+ default:56,
116
+ }
117
+ },
118
+ data() {
119
+ return {
120
+ activeName:'',
121
+ }
122
+ },
123
+ watch:{
124
+ '$route':{
125
+ immediate:true,
126
+ handler(to) {
127
+ this.activeName = to.path;
128
+ }
129
+ }
130
+ },
131
+ methods: {
132
+ genMenuItemName(item) {
133
+ if (!item.route) {
134
+ return `/${item.level}`
135
+ };
136
+ return item.route
137
+ },
138
+ changeMenu(active) {
139
+ // this.$emit("on-change", this.$route.path);
140
+ this.activeName = active;
141
+ active && this.$emit("on-change", active);
142
+ },
143
+ itemTitle(item) {
144
+ if (!item) return "";
145
+ return item.name;
146
+
147
+ /* if (typeof item.title === "object") {
148
+ return item.name.i18n;
149
+ // return this.$t(item.title.i18n);
150
+ } else {
151
+ return item.name;
152
+ }*/
153
+ }
154
+ },
155
+ updated() {
156
+ this.$nextTick(() => {
157
+ if (this.$refs.sideMenu) {
158
+ this.$refs.sideMenu.updateOpened();
159
+ }
160
+ });
161
+ }
162
+ };
163
+ </script>
164
+
165
+ <style lang="less" scoped>
166
+ @import "../styles/menu.less";
167
+ </style>
@@ -0,0 +1,119 @@
1
+ <template>
2
+ <div class="sidebar-menu-shrink">
3
+ <template v-for="(item, index) in menuList">
4
+ <div style="text-align: center;position: relative;" :key="index">
5
+ <Dropdown transfer placement="right-start" :key="index" @on-click="changeMenu" :class="{'menu-shrink--active':isActive(item)}">
6
+ <Button style="width: 80px;padding:10px 0;" type="text" class="shrink-btn-item" @click="changeMenu(item)">
7
+ <md-icon :size="20" :color="iconColor" :type="item.icon"></md-icon>
8
+ </Button>
9
+ <DropdownMenu style="width: 250px;" slot="list" v-if="item.childList.length>0">
10
+ <template v-for="(child, i) in item.childList">
11
+ <DropdownItem :name="genMenuItemName(child)" :key="i" v-if="!child.childList || child.childList.length<=0">
12
+ <md-icon :type="child.icon" :color="iconColor" :size="iconSize"></md-icon>
13
+ <span style="padding-left:10px;" class="menus-item__title">{{ itemTitle(child) }}</span>
14
+ </DropdownItem>
15
+ <Dropdown transfer placement="right-start"
16
+ :key="i"
17
+ @on-click="changeMenu"
18
+ :class="{'menu-shrink--active':isActive(child)}"
19
+ v-if="child.childList && child.childList.length>0">
20
+ <DropdownItem :name="genMenuItemName(child)" :key="child.name">
21
+ <md-icon :type="child.icon" :color="iconColor" :size="iconSize"></md-icon>
22
+ <span style="padding-left:10px;" class="menus-item__title">{{ itemTitle(child) }}</span>
23
+ </DropdownItem>
24
+ <DropdownMenu style="width: 250px;" slot="list" v-if="child.childList.length>0">
25
+ <template v-for="(child2, i) in child.childList">
26
+
27
+ <DropdownItem :name="genMenuItemName(child2)" :key="i">
28
+ <md-icon :type="child2.icon" :color="iconColor" :size="iconSize"></md-icon>
29
+ <span style="padding-left:10px;" class="menus-item__title">{{ itemTitle(child2) }}</span>
30
+ </DropdownItem>
31
+ </template>
32
+ </DropdownMenu>
33
+ </Dropdown>
34
+ </template>
35
+ </DropdownMenu>
36
+ </Dropdown>
37
+ <!-- <Dropdown transfer v-else placement="right-start" :key="index" @on-click="changeMenu">
38
+ <Button @click="changeMenu(item.childList[index].name)" style="width: 70px;margin-left: -5px;padding:10px 0;" type="text">
39
+ <md-icon :size="20" :color="iconColor" :type="item.icon || item.icon"></md-icon>
40
+ </Button>
41
+ <DropdownMenu style="width: 250px;" slot="list">
42
+ <DropdownItem :name="item.childList[0].name" :key="'d' + index">
43
+ <md-icon :size="20" :color="iconColor" :type="item.childList[0].icon || item.icon"></md-icon>
44
+ <span style="padding-left:10px;">{{ itemTitle(item.childList[0]) }}</span>
45
+ </DropdownItem>
46
+ </DropdownMenu>
47
+ </Dropdown>-->
48
+ </div>
49
+ </template>
50
+ </div>
51
+ </template>
52
+
53
+ <script>
54
+ export default {
55
+ name: 'sidebarMenuShrink',
56
+ props: {
57
+ menuList: {
58
+ type: Array
59
+ },
60
+ iconColor: {
61
+ type: String,
62
+ default: 'white'
63
+ },
64
+ iconSize: {
65
+ type: Number,
66
+ default: 16,
67
+ },
68
+ menuTheme: {
69
+ type: String,
70
+ default: 'dark'
71
+ }
72
+ },
73
+ watch:{
74
+ '$route':{
75
+ immediate:true,
76
+ handler(to) {
77
+ this.activeName = to.path;
78
+ }
79
+ }
80
+ },
81
+ data() {
82
+ return {
83
+ activeName:'',
84
+ }
85
+ },
86
+ methods: {
87
+ isActive(item) {
88
+ return this.activeName.indexOf(this.genMenuItemName(item)) !== -1
89
+ //return this.genMenuItemName(item) === this.activeName;
90
+ },
91
+ genMenuItemName(item) {
92
+ if (!item.route) {
93
+ return `/${item.level}`
94
+ };
95
+ return item.route
96
+ },
97
+ changeMenu(active) {
98
+ // console.log(active, this.genMenuItemName(active))
99
+ if (Object.prototype.toString.call(active) === "[object String]") {
100
+ this.activeName = active
101
+ this.$emit('on-change', active);
102
+ } else {
103
+ this.activeName = this.genMenuItemName(active);
104
+ active.route && this.$emit('on-change', active.route);
105
+ }
106
+ },
107
+ itemTitle (item) {
108
+ return item.name;
109
+ // if (typeof item.title === 'object') {
110
+ // return item.title.i18n
111
+ // // return this.$t(item.title.i18n);
112
+ // } else {
113
+ // return item.title;
114
+ // }
115
+ }
116
+ }
117
+ };
118
+ </script>
119
+
@@ -0,0 +1 @@
1
+ export default ["errorpage_index", "mutative-router", "order-info", "argument-page", "shopping", "accesstest_index", "access_index", "exportable-table", "draggable-list", "searchable-table", "international_index"]
@@ -0,0 +1,9 @@
1
+ export default [{
2
+ "title": "首页",
3
+ "path": "/home",
4
+ "name": "home_index"
5
+ }, {
6
+ "title": "权限管理",
7
+ "path": "",
8
+ "name": "access_index"
9
+ }]