qj-common 4.3.0 → 4.3.2

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 (229) hide show
  1. package/.babelrc +12 -12
  2. package/.eslintrc.js +25 -25
  3. package/.idea/common.iml +11 -11
  4. package/.idea/modules.xml +7 -7
  5. package/.idea/vcs.xml +5 -5
  6. package/.postcssrc.js +9 -9
  7. package/.prettierrc.js +7 -7
  8. package/.project +37 -37
  9. package/README.md +2 -2
  10. package/gulpfile.js +20 -20
  11. package/package.json +18 -18
  12. package/src/api/apimanage.js +146 -146
  13. package/src/api/common/index.js +192 -192
  14. package/src/api/login.js +160 -160
  15. package/src/api/shopFbu.js +515 -515
  16. package/src/api/upload.js +8 -8
  17. package/src/components/Bounced/index.vue +145 -145
  18. package/src/components/Breadcrumb/index.vue +71 -71
  19. package/src/components/Checkbox/index.vue +53 -53
  20. package/src/components/Hamburger/index.vue +48 -48
  21. package/src/components/Logistics/logic.vue +186 -186
  22. package/src/components/ScrollBar/index.vue +60 -60
  23. package/src/components/Sticky/index.vue +76 -76
  24. package/src/components/SvgIcon/index.vue +42 -42
  25. package/src/components/ThemePicker/index.vue +243 -243
  26. package/src/components/Tinymce/components/editorImage.vue +94 -94
  27. package/src/components/Tinymce/index.vue +166 -166
  28. package/src/components/Tinymce/plugins.js +7 -7
  29. package/src/components/Tinymce/toolbar.js +6 -6
  30. package/src/components/TreeTable/customEval.js +44 -44
  31. package/src/components/TreeTable/eval.js +29 -29
  32. package/src/components/TreeTable/index.vue +124 -124
  33. package/src/components/TreeTable/readme.md +89 -89
  34. package/src/components/TreeTableApi/customEval.js +49 -49
  35. package/src/components/TreeTableApi/eval.js +29 -29
  36. package/src/components/TreeTableApi/index.vue +124 -124
  37. package/src/components/TreeTableApi/readme.md +89 -89
  38. package/src/components/Upload/singleImage.vue +123 -123
  39. package/src/components/Upload/singleImage2.vue +118 -118
  40. package/src/components/Upload/singleImage3.vue +138 -138
  41. package/src/components/Upload/upload.vue +295 -295
  42. package/src/components/workOrderList/index.vue +158 -158
  43. package/src/dependencies.js +119 -119
  44. package/src/iconShop/demo.css +539 -539
  45. package/src/iconShop/demo_index.html +8445 -8445
  46. package/src/iconShop/iconfont.css +1451 -1451
  47. package/src/iconShop/iconfont.json +2522 -2522
  48. package/src/iconShop/iconfont.svg +1070 -1070
  49. package/src/iconfont/demo.css +539 -539
  50. package/src/iconfont/demo_index.html +5276 -5276
  51. package/src/iconfont/iconfont.css +905 -905
  52. package/src/iconfont/iconfont.json +1563 -1563
  53. package/src/iconfont/iconfont.svg +692 -692
  54. package/src/icons/index.js +9 -9
  55. package/src/lang/e.js +48 -48
  56. package/src/lang/en.js +48 -48
  57. package/src/lang/zh.js +48 -48
  58. package/src/main.js +62 -62
  59. package/src/permission.js +283 -283
  60. package/src/permissionForMall.backup.js +375 -375
  61. package/src/permissionForMall.js +375 -375
  62. package/src/preset.js +67 -67
  63. package/src/router/_import_common.js +1 -1
  64. package/src/router/_import_development.js +1 -1
  65. package/src/router/_import_production.js +1 -1
  66. package/src/store/getters.js +39 -39
  67. package/src/store/index.js +18 -18
  68. package/src/store/modules/app.js +34 -30
  69. package/src/store/modules/menu.js +82 -82
  70. package/src/store/modules/user.js +227 -227
  71. package/src/styles/element-ui.scss +1368 -1368
  72. package/src/styles/index.scss +166 -166
  73. package/src/styles/mixin.scss +27 -27
  74. package/src/styles/pc-ui.scss +1031 -1031
  75. package/src/styles/scrollBar.scss +21 -21
  76. package/src/styles/sidebar.scss +123 -123
  77. package/src/styles/transition.scss +32 -32
  78. package/src/styles/variables.scss +44 -44
  79. package/src/styles/wf-ui.scss +86 -86
  80. package/src/utils/auth.js +57 -57
  81. package/src/utils/dom.js +12 -12
  82. package/src/utils/getQueryString.js +5 -5
  83. package/src/utils/import.js +5 -5
  84. package/src/utils/index.js +355 -355
  85. package/src/utils/interceptor.js +34 -34
  86. package/src/utils/menu.js +116 -116
  87. package/src/utils/proapp.js +35 -35
  88. package/src/utils/query.js +26 -26
  89. package/src/utils/request.js +366 -366
  90. package/src/utils/routeMapping.js +39 -39
  91. package/src/utils/routeMapping.json +310 -310
  92. package/src/utils/utils.js +84 -84
  93. package/src/utils/validate.js +102 -102
  94. package/src/views/404.vue +72 -72
  95. package/src/views/Layout.vue +106 -106
  96. package/src/views/imgSwiper/index.vue +34 -34
  97. package/src/views/layout/Layout.vue +181 -170
  98. package/src/views/layout/components/AppMain.vue +20 -20
  99. package/src/views/layout/components/Footer.vue +22 -22
  100. package/src/views/layout/components/LeftNavbar.vue +318 -310
  101. package/src/views/layout/components/NavMenu.vue +15 -15
  102. package/src/views/layout/components/Navbar.vue +664 -661
  103. package/src/views/layout/components/Sidebar/SidebarItem.vue +116 -113
  104. package/src/views/layout/components/Sidebar/index.vue +203 -193
  105. package/src/views/layout/components/index.js +19 -19
  106. package/src/views/layout/theme/darkBlue/Layout.vue +140 -140
  107. package/src/views/layout/theme/darkBlue/components/AppMain.vue +38 -38
  108. package/src/views/layout/theme/darkBlue/components/Footer.vue +147 -147
  109. package/src/views/layout/theme/darkBlue/components/LeftNavbar(/345/261/225/347/244/272/345/205/250/351/203/250/350/217/234/345/215/225).vue +448 -448
  110. package/src/views/layout/theme/darkBlue/components/LeftNavbar.3.vue +191 -191
  111. package/src/views/layout/theme/darkBlue/components/LeftNavbar.vue +466 -466
  112. package/src/views/layout/theme/darkBlue/components/Navbar.vue +200 -200
  113. package/src/views/layout/theme/darkBlue/components/Sidebar/SidebarItem.vue +71 -71
  114. package/src/views/layout/theme/darkBlue/components/Sidebar/index.vue +49 -49
  115. package/src/views/layout/theme/darkBlue/components/index.js +15 -15
  116. package/src/views/layout-default/Layout.vue +134 -134
  117. package/src/views/layout-default/components/AppMain.vue +19 -19
  118. package/src/views/layout-default/components/Footer.vue +22 -22
  119. package/src/views/layout-default/components/LeftNavbar.vue +164 -164
  120. package/src/views/layout-default/components/Navbar.vue +295 -295
  121. package/src/views/layout-default/components/Sidebar/SidebarItem.vue +67 -67
  122. package/src/views/layout-default/components/Sidebar/index.vue +59 -59
  123. package/src/views/layout-default/components/index.js +4 -4
  124. package/src/views/layout-default/theme/darkBlue/Layout.vue +140 -140
  125. package/src/views/layout-default/theme/darkBlue/components/AppMain.vue +38 -38
  126. package/src/views/layout-default/theme/darkBlue/components/Footer.vue +147 -147
  127. package/src/views/layout-default/theme/darkBlue/components/LeftNavbar.vue +465 -465
  128. package/src/views/layout-default/theme/darkBlue/components/Navbar.vue +200 -200
  129. package/src/views/layout-default/theme/darkBlue/components/Sidebar/SidebarItem.vue +69 -69
  130. package/src/views/layout-default/theme/darkBlue/components/Sidebar/index.vue +49 -49
  131. package/src/views/layout-default/theme/darkBlue/components/index.js +15 -15
  132. package/src/views/pc/Internationalization.vue +80 -80
  133. package/src/views/pc/default/Layout.vue +442 -442
  134. package/src/views/pc/default/LayoutCard.vue +424 -424
  135. package/src/views/pc/default/assets/flex.scss +99 -99
  136. package/src/views/pc/default/footer-modules/DgFooter/index.vue +179 -179
  137. package/src/views/pc/default/footer-modules/DgFooter/indexSDX.vue +187 -187
  138. package/src/views/pc/default/footer-modules/footer.vue +171 -171
  139. package/src/views/pc/default/footer-modules/footerAns.vue +167 -167
  140. package/src/views/pc/default/footer-modules/footerBulk.vue +169 -169
  141. package/src/views/pc/default/footer-modules/footerDM.vue +254 -254
  142. package/src/views/pc/default/footer-modules/footerDefault.vue +267 -267
  143. package/src/views/pc/default/footer-modules/footerDefaultA.vue +270 -270
  144. package/src/views/pc/default/footer-modules/footerDefaultNew.vue +201 -201
  145. package/src/views/pc/default/footer-modules/footerHDB.vue +153 -153
  146. package/src/views/pc/default/footer-modules/footerHy.vue +63 -63
  147. package/src/views/pc/default/footer-modules/footerKYW.vue +163 -163
  148. package/src/views/pc/default/footer-modules/footerMh.vue +30 -30
  149. package/src/views/pc/default/footer-modules/footerNew.vue +116 -116
  150. package/src/views/pc/default/footer-modules/footer_yzj.vue +169 -169
  151. package/src/views/pc/default/footer-modules/footerayd.vue +85 -85
  152. package/src/views/pc/default/footer-modules/ymFooter.vue +154 -154
  153. package/src/views/pc/default/footer-modules/zgl.vue +250 -250
  154. package/src/views/pc/default/header-modules/DgHeader/Logo.vue +57 -57
  155. package/src/views/pc/default/header-modules/DgHeader/Search.vue +135 -135
  156. package/src/views/pc/default/header-modules/DgHeader/Settleup.vue +46 -46
  157. package/src/views/pc/default/header-modules/DgHeader/index.vue +38 -38
  158. package/src/views/pc/default/header-modules/active.vue +177 -177
  159. package/src/views/pc/default/header-modules/header.vue +97 -97
  160. package/src/views/pc/default/header-modules/headerA.vue +142 -142
  161. package/src/views/pc/default/header-modules/headerFLPT.vue +157 -157
  162. package/src/views/pc/default/header-modules/headerMh.vue +187 -187
  163. package/src/views/pc/default/header-modules/headerNew.vue +121 -121
  164. package/src/views/pc/default/header-modules/headerSDX.vue +304 -304
  165. package/src/views/pc/default/header-modules/headerStyle2.vue +173 -173
  166. package/src/views/pc/default/header-modules/headerStyle3.vue +190 -190
  167. package/src/views/pc/default/header-modules/headerStyle4.vue +163 -163
  168. package/src/views/pc/default/header-modules/headerStyleAns.vue +400 -400
  169. package/src/views/pc/default/header-modules/headerStyleBulk.vue +427 -427
  170. package/src/views/pc/default/header-modules/headerStyleDefalut.vue +209 -209
  171. package/src/views/pc/default/header-modules/headerStyleKYW.vue +435 -435
  172. package/src/views/pc/default/header-modules/headerStyle_yzj.vue +427 -427
  173. package/src/views/pc/default/header-modules/headerayd.vue +187 -187
  174. package/src/views/pc/default/header-modules/index.vue +466 -466
  175. package/src/views/pc/default/header-modules/ymHeader.vue +292 -292
  176. package/src/views/pc/default/header-modules/ysHeader.vue +248 -248
  177. package/src/views/pc/default/header-modules/zgl.vue +855 -855
  178. package/src/views/pc/default/leftMenu-modules/leftMenu-logo.vue +194 -194
  179. package/src/views/pc/default/leftMenu-modules/leftMenu-style2.vue +206 -206
  180. package/src/views/pc/default/leftMenu-modules/leftMenu-style3.vue +207 -207
  181. package/src/views/pc/default/leftMenu-modules/leftMenu-style4.vue +192 -192
  182. package/src/views/pc/default/leftMenu-modules/leftMenu.vue +183 -183
  183. package/src/views/pc/default/leftMenu-modules/leftMenuDefault.vue +212 -212
  184. package/src/views/pc/default/leftMenu-modules/leftMenuDefaultEn.vue +214 -214
  185. package/src/views/pc/default/leftMenu-modules/leftMenuDefaultFLPT.vue +220 -220
  186. package/src/views/pc/default/leftMenu-modules/leftMenuDefaultayd.vue +220 -220
  187. package/src/views/pc/default/nav-modules/nav.vue +52 -52
  188. package/src/views/pc/default/nav-modules/navAns.vue +60 -60
  189. package/src/views/pc/default/nav-modules/navBulk.vue +60 -60
  190. package/src/views/pc/default/top-modules/DgTopShortcut/index.vue +177 -177
  191. package/src/views/pc/default/top-modules/Toplg.vue +280 -280
  192. package/src/views/pc/default/top-modules/topA.vue +136 -136
  193. package/src/views/pc/default/top-modules/topAns.vue +261 -261
  194. package/src/views/pc/default/top-modules/topAns_yzj.vue +282 -282
  195. package/src/views/pc/default/top-modules/topBar.vue +304 -304
  196. package/src/views/pc/default/top-modules/topBulk.vue +280 -280
  197. package/src/views/pc/default/top-modules/topDefault.vue +244 -244
  198. package/src/views/pc/default/top-modules/topDefaultDM.vue +197 -197
  199. package/src/views/pc/default/top-modules/topDefaultNew.vue +271 -271
  200. package/src/views/pc/default/top-modules/topFLPT.vue +197 -197
  201. package/src/views/pc/default/top-modules/topHDB.vue +479 -479
  202. package/src/views/pc/default/top-modules/topKYW.vue +258 -258
  203. package/src/views/pc/default/top-modules/topMh.vue +174 -174
  204. package/src/views/pc/default/top-modules/topNew.vue +97 -97
  205. package/src/views/pc/default/top-modules/topSDX.vue +298 -298
  206. package/src/views/pc/default/top-modules/topSimple.vue +247 -247
  207. package/src/views/pc/default/top-modules/topSimpleHy.vue +256 -256
  208. package/src/views/pc/default/top-modules/topUcc.vue +264 -264
  209. package/src/views/pc/default/top-modules/topayd.vue +170 -170
  210. package/src/views/pc/default/top-modules/ymTop.vue +299 -299
  211. package/src/views/pc/default/top-modules/zgltop.vue +499 -499
  212. package/src/views/routerView.vue +9 -9
  213. package/src/views/templates/components/temp-select.vue +80 -80
  214. package/src/views/templates/components/temp-upload.vue +233 -233
  215. package/src/views/templates/readme.md +2 -2
  216. package/src/views/templates/templateInput.vue +421 -421
  217. package/src/views/templates/templateReadme.html +588 -588
  218. package/src/views/templates/templateReadme.md +619 -619
  219. package/src/views/templates/templateTable.vue +2243 -2243
  220. package/src/views/templates/templateTableData.vue +1883 -1883
  221. package/src/views/templates/templateUi/templateTableContent.vue +187 -187
  222. package/src/views/treeTemplate/index.vue +559 -559
  223. package/src/views/treeTemplate/treeTemplate.md +274 -274
  224. package/src/views/uploadDialog/index copy.vue +352 -352
  225. package/src/views/uploadDialog/index.vue +558 -558
  226. package/src/views/uploadDialog/indexOlay.vue +582 -582
  227. package/src/views/uploadDialog/indexPM.vue +578 -578
  228. package/src/views/uploadDialog/indexUpload.vue +543 -543
  229. package/src/views/uploadDialog/readme.md +45 -45
@@ -1,29 +1,29 @@
1
- /**
2
- * @Author: jianglei
3
- * @Date: 2017-10-12 12:06:49
4
- */
5
- 'use strict'
6
- import Vue from 'vue'
7
- export default function treeToArray(data, expandAll, parent = null, level = null) {
8
- let tmp = []
9
- Array.from(data).forEach(function(record) {
10
- if (record._expanded === undefined) {
11
- Vue.set(record, '_expanded', expandAll)
12
- }
13
- let _level = 1
14
- if (level !== undefined && level !== null) {
15
- _level = level + 1
16
- }
17
- Vue.set(record, '_level', _level)
18
- // 如果有父元素
19
- if (parent) {
20
- Vue.set(record, 'parent', parent)
21
- }
22
- tmp.push(record)
23
- if (record.children && record.children.length > 0) {
24
- const children = treeToArray(record.children, expandAll, record, _level)
25
- tmp = tmp.concat(children)
26
- }
27
- })
28
- return tmp
29
- }
1
+ /**
2
+ * @Author: jianglei
3
+ * @Date: 2017-10-12 12:06:49
4
+ */
5
+ 'use strict'
6
+ import Vue from 'vue'
7
+ export default function treeToArray(data, expandAll, parent = null, level = null) {
8
+ let tmp = []
9
+ Array.from(data).forEach(function(record) {
10
+ if (record._expanded === undefined) {
11
+ Vue.set(record, '_expanded', expandAll)
12
+ }
13
+ let _level = 1
14
+ if (level !== undefined && level !== null) {
15
+ _level = level + 1
16
+ }
17
+ Vue.set(record, '_level', _level)
18
+ // 如果有父元素
19
+ if (parent) {
20
+ Vue.set(record, 'parent', parent)
21
+ }
22
+ tmp.push(record)
23
+ if (record.children && record.children.length > 0) {
24
+ const children = treeToArray(record.children, expandAll, record, _level)
25
+ tmp = tmp.concat(children)
26
+ }
27
+ })
28
+ return tmp
29
+ }
@@ -1,124 +1,124 @@
1
- <template>
2
- <el-table :data="formatData" :row-style="showRow" v-bind="$attrs">
3
- <el-table-column v-if="columns.length===0" width="50">
4
- <template slot-scope="scope">
5
- <span v-for="space in scope.row._level" class="ms-tree-space" :key="space"></span>
6
- <span class="tree-ctrl" v-if="iconShow(0,scope.row)" @click="toggleExpanded(scope.$index)">
7
- <i v-if="!scope.row._expanded" class="el-icon-plus"></i>
8
- <i v-else class="el-icon-minus"></i>
9
- </span>
10
- <!-- {{scope.$index}} -->
11
- </template>
12
- </el-table-column>
13
- <el-table-column v-else v-for="(column, index) in columns" :key="column.value" :label="column.text" :width="column.width">
14
- <template slot-scope="scope">
15
- <span v-if="index === 0" v-for="space in scope.row._level" class="ms-tree-space" :key="space"></span>
16
- <span class="tree-ctrl" v-if="iconShow(index,scope.row)" @click="toggleExpanded(scope.$index)">
17
- <i v-if="!scope.row._expanded" class="el-icon-plus"></i>
18
- <i v-else class="el-icon-minus"></i>
19
- </span>
20
- {{scope.row[column.value]}}
21
- </template>
22
- </el-table-column>
23
- <slot></slot>
24
- </el-table>
25
- </template>
26
-
27
- <script>
28
- /**
29
- Auth: Lei.j1ang
30
- Created: 2018/1/19-13:59
31
- */
32
- import treeToArray from './eval'
33
- export default {
34
- name: 'treeTable',
35
- props: {
36
- data: {
37
- type: [Array, Object],
38
- required: true
39
- },
40
- columns: {
41
- type: Array,
42
- default: () => []
43
- },
44
- evalFunc: Function,
45
- evalArgs: Array,
46
- expandAll: {
47
- type: Boolean,
48
- default: false
49
- }
50
- },
51
- computed: {
52
- // 格式化数据源
53
- formatData: function() {
54
- let tmp
55
- if (!Array.isArray(this.data)) {
56
- tmp = [this.data]
57
- } else {
58
- tmp = this.data
59
- }
60
- const func = this.evalFunc || treeToArray
61
- const args = this.evalArgs ? Array.concat([tmp, this.expandAll], this.evalArgs) : [tmp, this.expandAll]
62
- return func.apply(null, args)
63
- }
64
- },
65
- methods: {
66
- showRow: function(row) {
67
- const show = (row.row.parent ? (row.row.parent._expanded && row.row.parent._show) : true)
68
- row.row._show = show
69
- return show ? 'animation:treeTableShow 1s;-webkit-animation:treeTableShow 1s;' : 'display:none;'
70
- },
71
- // 切换下级是否展开
72
- toggleExpanded: function(trIndex) {
73
- const record = this.formatData[trIndex]
74
- record._expanded = !record._expanded
75
- },
76
- // 图标显示
77
- iconShow(index, record) {
78
- return (index === 0 && record.children && record.children.length > 0)
79
- }
80
- }
81
- }
82
- </script>
83
- <style rel="stylesheet/css">
84
- @keyframes treeTableShow {
85
- from {opacity: 0;}
86
- to {opacity: 1;}
87
- }
88
- @-webkit-keyframes treeTableShow {
89
- from {opacity: 0;}
90
- to {opacity: 1;}
91
- }
92
- </style>
93
-
94
- <style lang="scss" rel="stylesheet/scss" scoped>
95
- $color-blue: #2196F3;
96
- $space-width: 18px;
97
- .ms-tree-space {
98
- position: relative;
99
- top: 1px;
100
- display: inline-block;
101
- font-style: normal;
102
- font-weight: 400;
103
- line-height: 1;
104
- width: $space-width;
105
- height: 14px;
106
- &::before {
107
- content: ""
108
- }
109
- }
110
- .processContainer{
111
- width: 100%;
112
- height: 100%;
113
- }
114
- table td {
115
- line-height: 26px;
116
- }
117
-
118
- .tree-ctrl{
119
- position: relative;
120
- cursor: pointer;
121
- color: $color-blue;
122
- margin-left: -$space-width;
123
- }
124
- </style>
1
+ <template>
2
+ <el-table :data="formatData" :row-style="showRow" v-bind="$attrs">
3
+ <el-table-column v-if="columns.length===0" width="50">
4
+ <template slot-scope="scope">
5
+ <span v-for="space in scope.row._level" class="ms-tree-space" :key="space"></span>
6
+ <span class="tree-ctrl" v-if="iconShow(0,scope.row)" @click="toggleExpanded(scope.$index)">
7
+ <i v-if="!scope.row._expanded" class="el-icon-plus"></i>
8
+ <i v-else class="el-icon-minus"></i>
9
+ </span>
10
+ <!-- {{scope.$index}} -->
11
+ </template>
12
+ </el-table-column>
13
+ <el-table-column v-else v-for="(column, index) in columns" :key="column.value" :label="column.text" :width="column.width">
14
+ <template slot-scope="scope">
15
+ <span v-if="index === 0" v-for="space in scope.row._level" class="ms-tree-space" :key="space"></span>
16
+ <span class="tree-ctrl" v-if="iconShow(index,scope.row)" @click="toggleExpanded(scope.$index)">
17
+ <i v-if="!scope.row._expanded" class="el-icon-plus"></i>
18
+ <i v-else class="el-icon-minus"></i>
19
+ </span>
20
+ {{scope.row[column.value]}}
21
+ </template>
22
+ </el-table-column>
23
+ <slot></slot>
24
+ </el-table>
25
+ </template>
26
+
27
+ <script>
28
+ /**
29
+ Auth: Lei.j1ang
30
+ Created: 2018/1/19-13:59
31
+ */
32
+ import treeToArray from './eval'
33
+ export default {
34
+ name: 'treeTable',
35
+ props: {
36
+ data: {
37
+ type: [Array, Object],
38
+ required: true
39
+ },
40
+ columns: {
41
+ type: Array,
42
+ default: () => []
43
+ },
44
+ evalFunc: Function,
45
+ evalArgs: Array,
46
+ expandAll: {
47
+ type: Boolean,
48
+ default: false
49
+ }
50
+ },
51
+ computed: {
52
+ // 格式化数据源
53
+ formatData: function() {
54
+ let tmp
55
+ if (!Array.isArray(this.data)) {
56
+ tmp = [this.data]
57
+ } else {
58
+ tmp = this.data
59
+ }
60
+ const func = this.evalFunc || treeToArray
61
+ const args = this.evalArgs ? Array.concat([tmp, this.expandAll], this.evalArgs) : [tmp, this.expandAll]
62
+ return func.apply(null, args)
63
+ }
64
+ },
65
+ methods: {
66
+ showRow: function(row) {
67
+ const show = (row.row.parent ? (row.row.parent._expanded && row.row.parent._show) : true)
68
+ row.row._show = show
69
+ return show ? 'animation:treeTableShow 1s;-webkit-animation:treeTableShow 1s;' : 'display:none;'
70
+ },
71
+ // 切换下级是否展开
72
+ toggleExpanded: function(trIndex) {
73
+ const record = this.formatData[trIndex]
74
+ record._expanded = !record._expanded
75
+ },
76
+ // 图标显示
77
+ iconShow(index, record) {
78
+ return (index === 0 && record.children && record.children.length > 0)
79
+ }
80
+ }
81
+ }
82
+ </script>
83
+ <style rel="stylesheet/css">
84
+ @keyframes treeTableShow {
85
+ from {opacity: 0;}
86
+ to {opacity: 1;}
87
+ }
88
+ @-webkit-keyframes treeTableShow {
89
+ from {opacity: 0;}
90
+ to {opacity: 1;}
91
+ }
92
+ </style>
93
+
94
+ <style lang="scss" rel="stylesheet/scss" scoped>
95
+ $color-blue: #2196F3;
96
+ $space-width: 18px;
97
+ .ms-tree-space {
98
+ position: relative;
99
+ top: 1px;
100
+ display: inline-block;
101
+ font-style: normal;
102
+ font-weight: 400;
103
+ line-height: 1;
104
+ width: $space-width;
105
+ height: 14px;
106
+ &::before {
107
+ content: ""
108
+ }
109
+ }
110
+ .processContainer{
111
+ width: 100%;
112
+ height: 100%;
113
+ }
114
+ table td {
115
+ line-height: 26px;
116
+ }
117
+
118
+ .tree-ctrl{
119
+ position: relative;
120
+ cursor: pointer;
121
+ color: $color-blue;
122
+ margin-left: -$space-width;
123
+ }
124
+ </style>
@@ -1,89 +1,89 @@
1
- ## 写在前面
2
- 此组件仅提供一个创建TreeTable的解决思路
3
-
4
- ## prop说明
5
- #### *data*
6
- **必填**
7
-
8
- 原始数据,要求是一个数组或者对象
9
- ```javascript
10
- [{
11
- key1: value1,
12
- key2: value2,
13
- children: [{
14
- key1: value1
15
- },
16
- {
17
- key1: value1
18
- }]
19
- },
20
- {
21
- key1: value1
22
- }]
23
- ```
24
- 或者
25
- ```javascript
26
- {
27
- key1: value1,
28
- key2: value2,
29
- children: [{
30
- key1: value1
31
- },
32
- {
33
- key1: value1
34
- }]
35
- }
36
- ```
37
-
38
- #### columns
39
- 列属性,要求是一个数组
40
-
41
- 1. text: 显示在表头的文字
42
- 2. value: 对应data的key。treeTable将显示相应的value
43
- 3. width: 每列的宽度,为一个数字(可选)
44
-
45
- 如果你想要每个字段都有自定义的样式或者嵌套其他组件,columns可不提供,直接像在el-table一样写即可,如果没有自定义内容,提供columns将更加的便捷方便
46
-
47
- 如果你有几个字段是需要自定义的,几个不需要,那么可以将不需要自定义的字段放入columns,将需要自定义的内容放入到slot中,详情见后文
48
- ```javascript
49
- [{
50
- value:string,
51
- text:string,
52
- width:number
53
- },{
54
- value:string,
55
- text:string,
56
- width:number
57
- }]
58
- ```
59
-
60
- #### expandAll
61
- 是否默认全部展开,boolean值,默认为false
62
-
63
- #### evalFunc
64
- 解析函数,function,非必须
65
-
66
- 如果不提供,将使用默认的[evalFunc](./eval.js)
67
-
68
- 如果提供了evalFunc,那么会用提供的evalFunc去解析data,并返回treeTable渲染所需要的值。如何编写一个evalFunc,请参考[*eval.js*](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/components/TreeTable/eval.js)或[*customEval.js*](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customEval.js)
69
-
70
- #### evalArgs
71
- 解析函数的参数,是一个数组
72
-
73
- **请注意,自定义的解析函数参数第一个为this.data,第二个参数为, this.expandAll,你不需要在evalArgs填写。一定记住,这两个参数是强制性的,并且位置不可颠倒** *this.data为需要解析的数据,this.expandAll为是否默认展开*
74
-
75
- 如你的解析函数需要的参数为`(this.data, this.expandAll,1,2,3,4)`,那么你只需要将`[1,2,3,4]`赋值给`evalArgs`就可以了
76
-
77
- 如果你的解析函数参数只有`(this.data, this.expandAll)`,那么就可以不用填写evalArgs了
78
-
79
- 具体可参考[*customEval.js*](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customEval.js)的函数参数和[customTreeTable](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customTreeTable.vue)的`evalArgs`属性值
80
-
81
- ## slot
82
- 这是一个自定义列的插槽。
83
-
84
- 默认情况下,treeTable只有一行行展示数据的功能。但是一般情况下,我们会要给行加上一个操作按钮或者根据当行数据展示不同的样式,这时我们就需要自定义列了。请参考[customTreeTable](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customTreeTable.vue),[实例效果](http://panjiachen.github.io/vue-element-admin/#/example/table/custom-tree-table)
85
-
86
- `slot`和`columns属性`可同时存在,columns里面的数据列会在slot自定义列的左边展示
87
-
88
- ## 其他
89
- 如果有其他的需求,请参考[el-table](http://element-cn.eleme.io/#/en-US/component/table)的api自行修改index.vue
1
+ ## 写在前面
2
+ 此组件仅提供一个创建TreeTable的解决思路
3
+
4
+ ## prop说明
5
+ #### *data*
6
+ **必填**
7
+
8
+ 原始数据,要求是一个数组或者对象
9
+ ```javascript
10
+ [{
11
+ key1: value1,
12
+ key2: value2,
13
+ children: [{
14
+ key1: value1
15
+ },
16
+ {
17
+ key1: value1
18
+ }]
19
+ },
20
+ {
21
+ key1: value1
22
+ }]
23
+ ```
24
+ 或者
25
+ ```javascript
26
+ {
27
+ key1: value1,
28
+ key2: value2,
29
+ children: [{
30
+ key1: value1
31
+ },
32
+ {
33
+ key1: value1
34
+ }]
35
+ }
36
+ ```
37
+
38
+ #### columns
39
+ 列属性,要求是一个数组
40
+
41
+ 1. text: 显示在表头的文字
42
+ 2. value: 对应data的key。treeTable将显示相应的value
43
+ 3. width: 每列的宽度,为一个数字(可选)
44
+
45
+ 如果你想要每个字段都有自定义的样式或者嵌套其他组件,columns可不提供,直接像在el-table一样写即可,如果没有自定义内容,提供columns将更加的便捷方便
46
+
47
+ 如果你有几个字段是需要自定义的,几个不需要,那么可以将不需要自定义的字段放入columns,将需要自定义的内容放入到slot中,详情见后文
48
+ ```javascript
49
+ [{
50
+ value:string,
51
+ text:string,
52
+ width:number
53
+ },{
54
+ value:string,
55
+ text:string,
56
+ width:number
57
+ }]
58
+ ```
59
+
60
+ #### expandAll
61
+ 是否默认全部展开,boolean值,默认为false
62
+
63
+ #### evalFunc
64
+ 解析函数,function,非必须
65
+
66
+ 如果不提供,将使用默认的[evalFunc](./eval.js)
67
+
68
+ 如果提供了evalFunc,那么会用提供的evalFunc去解析data,并返回treeTable渲染所需要的值。如何编写一个evalFunc,请参考[*eval.js*](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/components/TreeTable/eval.js)或[*customEval.js*](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customEval.js)
69
+
70
+ #### evalArgs
71
+ 解析函数的参数,是一个数组
72
+
73
+ **请注意,自定义的解析函数参数第一个为this.data,第二个参数为, this.expandAll,你不需要在evalArgs填写。一定记住,这两个参数是强制性的,并且位置不可颠倒** *this.data为需要解析的数据,this.expandAll为是否默认展开*
74
+
75
+ 如你的解析函数需要的参数为`(this.data, this.expandAll,1,2,3,4)`,那么你只需要将`[1,2,3,4]`赋值给`evalArgs`就可以了
76
+
77
+ 如果你的解析函数参数只有`(this.data, this.expandAll)`,那么就可以不用填写evalArgs了
78
+
79
+ 具体可参考[*customEval.js*](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customEval.js)的函数参数和[customTreeTable](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customTreeTable.vue)的`evalArgs`属性值
80
+
81
+ ## slot
82
+ 这是一个自定义列的插槽。
83
+
84
+ 默认情况下,treeTable只有一行行展示数据的功能。但是一般情况下,我们会要给行加上一个操作按钮或者根据当行数据展示不同的样式,这时我们就需要自定义列了。请参考[customTreeTable](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customTreeTable.vue),[实例效果](http://panjiachen.github.io/vue-element-admin/#/example/table/custom-tree-table)
85
+
86
+ `slot`和`columns属性`可同时存在,columns里面的数据列会在slot自定义列的左边展示
87
+
88
+ ## 其他
89
+ 如果有其他的需求,请参考[el-table](http://element-cn.eleme.io/#/en-US/component/table)的api自行修改index.vue
@@ -1,49 +1,49 @@
1
- /**
2
- * @Author: jianglei
3
- * @Date: 2017-10-12 12:06:49
4
- */
5
- 'use strict'
6
- import Vue from 'vue'
7
- export default function treeToArray(data, expandAll, parent, level, item) {
8
- const marLTemp = []
9
- let tmp = []
10
- Array.from(data).forEach(function(record) {
11
- if (record._expanded === undefined) {
12
- Vue.set(record, '_expanded', expandAll)
13
- }
14
- let _level = 1
15
- if (level !== undefined && level !== null) {
16
- _level = level + 1
17
- }
18
- Vue.set(record, '_level', _level)
19
- // 如果有父元素
20
- if (parent) {
21
- Vue.set(record, 'parent', parent)
22
- // 如果父元素有偏移量,需要计算在this的偏移量中
23
- // 偏移量还与前面同级元素有关,需要加上前面所有元素的长度和
24
- if (!marLTemp[_level]) {
25
- marLTemp[_level] = 0
26
- }
27
- Vue.set(record, '_marginLeft', marLTemp[_level] + parent._marginLeft)
28
- Vue.set(record, '_width', record[item] / parent[item] * parent._width)
29
- // 在本次计算过偏移量后加上自己长度,以供下一个元素使用
30
- marLTemp[_level] += record._width
31
- } else {
32
- // 如果为根
33
- // 初始化偏移量存储map
34
- marLTemp[record.id] = []
35
- // map中是一个数组,存储的是每级的长度和
36
- // 初始情况下为0
37
- marLTemp[record.id][_level] = 0
38
- Vue.set(record, '_marginLeft', 0)
39
- Vue.set(record, '_width', 1)
40
- }
41
- tmp.push(record)
42
- if (record.dataparamList && record.dataparamList.length > 0) {
43
-
44
- const dataparamList = treeToArray(record.dataparamList, expandAll, record, _level, item )
45
- tmp = tmp.concat(dataparamList)
46
- }
47
- })
48
- return tmp
49
- }
1
+ /**
2
+ * @Author: jianglei
3
+ * @Date: 2017-10-12 12:06:49
4
+ */
5
+ 'use strict'
6
+ import Vue from 'vue'
7
+ export default function treeToArray(data, expandAll, parent, level, item) {
8
+ const marLTemp = []
9
+ let tmp = []
10
+ Array.from(data).forEach(function(record) {
11
+ if (record._expanded === undefined) {
12
+ Vue.set(record, '_expanded', expandAll)
13
+ }
14
+ let _level = 1
15
+ if (level !== undefined && level !== null) {
16
+ _level = level + 1
17
+ }
18
+ Vue.set(record, '_level', _level)
19
+ // 如果有父元素
20
+ if (parent) {
21
+ Vue.set(record, 'parent', parent)
22
+ // 如果父元素有偏移量,需要计算在this的偏移量中
23
+ // 偏移量还与前面同级元素有关,需要加上前面所有元素的长度和
24
+ if (!marLTemp[_level]) {
25
+ marLTemp[_level] = 0
26
+ }
27
+ Vue.set(record, '_marginLeft', marLTemp[_level] + parent._marginLeft)
28
+ Vue.set(record, '_width', record[item] / parent[item] * parent._width)
29
+ // 在本次计算过偏移量后加上自己长度,以供下一个元素使用
30
+ marLTemp[_level] += record._width
31
+ } else {
32
+ // 如果为根
33
+ // 初始化偏移量存储map
34
+ marLTemp[record.id] = []
35
+ // map中是一个数组,存储的是每级的长度和
36
+ // 初始情况下为0
37
+ marLTemp[record.id][_level] = 0
38
+ Vue.set(record, '_marginLeft', 0)
39
+ Vue.set(record, '_width', 1)
40
+ }
41
+ tmp.push(record)
42
+ if (record.dataparamList && record.dataparamList.length > 0) {
43
+
44
+ const dataparamList = treeToArray(record.dataparamList, expandAll, record, _level, item )
45
+ tmp = tmp.concat(dataparamList)
46
+ }
47
+ })
48
+ return tmp
49
+ }
@@ -1,29 +1,29 @@
1
- /**
2
- * @Author: jianglei
3
- * @Date: 2017-10-12 12:06:49
4
- */
5
- 'use strict'
6
- import Vue from 'vue'
7
- export default function treeToArray(data, expandAll, parent = null, level = null) {
8
- let tmp = []
9
- Array.from(data).forEach(function(record) {
10
- if (record._expanded === undefined) {
11
- Vue.set(record, '_expanded', expandAll)
12
- }
13
- let _level = 1
14
- if (level !== undefined && level !== null) {
15
- _level = level + 1
16
- }
17
- Vue.set(record, '_level', _level)
18
- // 如果有父元素
19
- if (parent) {
20
- Vue.set(record, 'parent', parent)
21
- }
22
- tmp.push(record)
23
- if (record.dataparamList && record.dataparamList.length > 0) {
24
- const dataparamList = treeToArray(record.dataparamList, expandAll, record, _level)
25
- tmp = tmp.concat(dataparamList)
26
- }
27
- })
28
- return tmp
29
- }
1
+ /**
2
+ * @Author: jianglei
3
+ * @Date: 2017-10-12 12:06:49
4
+ */
5
+ 'use strict'
6
+ import Vue from 'vue'
7
+ export default function treeToArray(data, expandAll, parent = null, level = null) {
8
+ let tmp = []
9
+ Array.from(data).forEach(function(record) {
10
+ if (record._expanded === undefined) {
11
+ Vue.set(record, '_expanded', expandAll)
12
+ }
13
+ let _level = 1
14
+ if (level !== undefined && level !== null) {
15
+ _level = level + 1
16
+ }
17
+ Vue.set(record, '_level', _level)
18
+ // 如果有父元素
19
+ if (parent) {
20
+ Vue.set(record, 'parent', parent)
21
+ }
22
+ tmp.push(record)
23
+ if (record.dataparamList && record.dataparamList.length > 0) {
24
+ const dataparamList = treeToArray(record.dataparamList, expandAll, record, _level)
25
+ tmp = tmp.concat(dataparamList)
26
+ }
27
+ })
28
+ return tmp
29
+ }