web-component-gallery 1.3.12 → 2.0.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 (218) hide show
  1. package/dist/923.umd.js +1 -0
  2. package/dist/index.umd.js +1 -12252
  3. package/dist/js.umd.js +1 -0
  4. package/dist/style.css +17 -0
  5. package/dist/style.umd.js +1 -0
  6. package/{method → extensions}/AMap.js +1 -5
  7. package/{plugins/method → extensions}/Dialog.js +2 -2
  8. package/{lib/lazy_use.js → extensions/index.js} +16 -2
  9. package/lib/{amap/components/AmapSearch/index.jsx → amap-comp/AmapSearch.jsx} +3 -5
  10. package/lib/amap-comp/index.js +18 -0
  11. package/{plugins/lib/amap/components/AmapSearch/index.less → lib/amap-comp/style/AmapSearch.less} +5 -3
  12. package/lib/amap-comp/style/index.js +1 -0
  13. package/lib/amap-comp/style/index.less +1 -0
  14. package/lib/{amap/AmapDraw.jsx → amap-draw/index.jsx} +2 -4
  15. package/lib/amap-draw/style/index.js +1 -0
  16. package/lib/{amap/AmapDraw.less → amap-draw/style/index.less} +6 -3
  17. package/lib/browse/index.jsx +0 -2
  18. package/lib/browse/style/index.js +1 -0
  19. package/lib/button/Button.js +1 -3
  20. package/lib/button/style/index.js +1 -0
  21. package/{plugins/lib/dateTime → lib/date-time}/index.vue +3 -13
  22. package/lib/date-time/style/index.js +1 -0
  23. package/lib/date-time/style/index.less +7 -0
  24. package/lib/{descriptions → descriptions-list}/index.jsx +1 -3
  25. package/lib/descriptions-list/style/index.js +1 -0
  26. package/{plugins/lib/tree → lib/directory}/Directory.js +4 -21
  27. package/lib/directory/index.js +8 -0
  28. package/lib/directory/style/index.js +1 -0
  29. package/lib/{tree/style/Directory.less → directory/style/index.less} +3 -4
  30. package/{plugins/lib/form/components → lib/form-comp}/ACascaderMultiple.vue +1 -106
  31. package/lib/form-comp/ARadio.vue +70 -0
  32. package/lib/{form/components → form-comp}/ARangePicker.vue +9 -20
  33. package/lib/{form/components → form-comp}/ASelectCustom.vue +1 -8
  34. package/lib/form-comp/ATagsInput.vue +88 -0
  35. package/lib/form-comp/ATimePicker.vue +127 -0
  36. package/lib/{form/components → form-comp}/AUpload.vue +2 -17
  37. package/lib/form-comp/index.js +37 -0
  38. package/lib/form-comp/style/ACascaderMultiple.less +117 -0
  39. package/lib/form-comp/style/ARadio.less +0 -0
  40. package/lib/form-comp/style/ARangePicker.less +11 -0
  41. package/lib/form-comp/style/ASelectCustom.less +4 -0
  42. package/lib/form-comp/style/ATagsInput.less +24 -0
  43. package/lib/form-comp/style/ATimePicker.less +8 -0
  44. package/lib/form-comp/style/AUpload.less +15 -0
  45. package/lib/form-comp/style/index.js +1 -0
  46. package/lib/form-comp/style/index.less +7 -0
  47. package/lib/index.js +60 -45
  48. package/lib/modal/index.jsx +4 -6
  49. package/lib/modal/style/index.js +1 -0
  50. package/lib/modal/{index.less → style/index.less} +6 -7
  51. package/{plugins/lib/form → lib/model}/Model.js +1 -3
  52. package/lib/model/index.js +7 -0
  53. package/lib/model/style/index.js +1 -0
  54. package/lib/{form/style/Model.less → model/style/index.less} +10 -10
  55. package/{plugins/lib/form → lib/model}/utils/render.js +1 -1
  56. package/lib/{form → model}/utils/resetFields.js +1 -1
  57. package/lib/no-data/directive.js +65 -0
  58. package/lib/no-data/index.js +21 -0
  59. package/lib/no-data/index.vue +35 -0
  60. package/lib/no-data/style/index.js +1 -0
  61. package/lib/no-data/style/index.less +15 -0
  62. package/lib/search/index.js +7 -0
  63. package/{plugins/lib/form/Search.vue → lib/search/index.vue} +3 -6
  64. package/lib/search/style/index.js +1 -0
  65. package/{plugins/lib/form/style/Search.less → lib/search/style/index.less} +7 -8
  66. package/lib/style/mixins.less +1 -1
  67. package/lib/{svgIcon → svg-icon}/index.vue +1 -17
  68. package/lib/svg-icon/style/index.js +1 -0
  69. package/lib/svg-icon/style/index.less +15 -0
  70. package/lib/table/index.vue +4 -8
  71. package/lib/table/style/index.js +1 -0
  72. package/lib/table/style/index.less +12 -13
  73. package/lib/tree/index.js +2 -11
  74. package/{plugins/lib/tree/Tree.vue → lib/tree/index.vue} +2 -5
  75. package/lib/tree/style/index.js +1 -0
  76. package/{plugins/lib/tree/style/Tree.less → lib/tree/style/index.less} +4 -4
  77. package/lib/weather/index.vue +1 -9
  78. package/lib/weather/style/index.js +1 -0
  79. package/lib/weather/style/index.less +7 -0
  80. package/package.json +16 -34
  81. package/utils/Axios.js +91 -82
  82. package/utils/Postcss.js +12 -8
  83. package/README.md +0 -24
  84. package/dist/amap.umd.js +0 -12252
  85. package/dist/avatar.umd.js +0 -5337
  86. package/dist/button.umd.js +0 -5845
  87. package/dist/dateTime.umd.js +0 -1287
  88. package/dist/form.umd.js +0 -9981
  89. package/dist/multiTab.umd.js +0 -5556
  90. package/dist/svgIcon.umd.js +0 -1167
  91. package/dist/table.umd.js +0 -6306
  92. package/dist/tree.umd.js +0 -5393
  93. package/dist/weather.umd.js +0 -1167
  94. package/lib/amap/components/AmapSearch/index.less +0 -16
  95. package/lib/amap/index.js +0 -13
  96. package/lib/avatar/index.js +0 -7
  97. package/lib/avatar/index.vue +0 -47
  98. package/lib/basic/404.vue +0 -24
  99. package/lib/dateTime/index.vue +0 -43
  100. package/lib/form/Model.js +0 -153
  101. package/lib/form/Search.vue +0 -159
  102. package/lib/form/components/ACascaderMultiple.vue +0 -766
  103. package/lib/form/components/ARadio.vue +0 -74
  104. package/lib/form/components/ATagsInput.vue +0 -93
  105. package/lib/form/components/ATimePicker.vue +0 -73
  106. package/lib/form/index.js +0 -55
  107. package/lib/form/style/Search.less +0 -34
  108. package/lib/form/utils/render.js +0 -85
  109. package/lib/iframe/events.js +0 -2
  110. package/lib/iframe/index.jsx +0 -234
  111. package/lib/iframe/index.less +0 -19
  112. package/lib/multiTab/APIEnums.js +0 -17
  113. package/lib/multiTab/MultiTab.jsx +0 -237
  114. package/lib/multiTab/RouteAPI.js +0 -71
  115. package/lib/multiTab/RouteContent.jsx +0 -90
  116. package/lib/multiTab/RouteKeepAlive.js +0 -183
  117. package/lib/multiTab/events.js +0 -2
  118. package/lib/multiTab/index.js +0 -15
  119. package/lib/multiTab/index.less +0 -73
  120. package/lib/style/index.less +0 -2
  121. package/lib/tree/Directory.js +0 -428
  122. package/lib/tree/Tree.vue +0 -181
  123. package/lib/tree/style/Tree.less +0 -52
  124. package/method/Dialog.js +0 -134
  125. package/method/index.js +0 -12
  126. package/plugins/lib/amap/AmapDraw.jsx +0 -349
  127. package/plugins/lib/amap/AmapDraw.less +0 -45
  128. package/plugins/lib/amap/components/AmapSearch/index.jsx +0 -73
  129. package/plugins/lib/amap/index.js +0 -13
  130. package/plugins/lib/avatar/index.js +0 -7
  131. package/plugins/lib/avatar/index.vue +0 -47
  132. package/plugins/lib/basic/404.vue +0 -24
  133. package/plugins/lib/browse/index.jsx +0 -76
  134. package/plugins/lib/browse/index.less +0 -4
  135. package/plugins/lib/button/Button.js +0 -89
  136. package/plugins/lib/button/index.js +0 -7
  137. package/plugins/lib/dateTime/index.js +0 -7
  138. package/plugins/lib/descriptions/index.jsx +0 -108
  139. package/plugins/lib/descriptions/index.less +0 -15
  140. package/plugins/lib/form/components/ARadio.vue +0 -74
  141. package/plugins/lib/form/components/ARangePicker.vue +0 -129
  142. package/plugins/lib/form/components/ASelectCustom.vue +0 -226
  143. package/plugins/lib/form/components/ATagsInput.vue +0 -93
  144. package/plugins/lib/form/components/ATimePicker.vue +0 -73
  145. package/plugins/lib/form/components/AUpload.vue +0 -183
  146. package/plugins/lib/form/components/RenderComp.vue +0 -69
  147. package/plugins/lib/form/index.js +0 -55
  148. package/plugins/lib/form/style/Model.less +0 -53
  149. package/plugins/lib/form/utils/resetFields.js +0 -16
  150. package/plugins/lib/iframe/events.js +0 -2
  151. package/plugins/lib/iframe/index.jsx +0 -234
  152. package/plugins/lib/iframe/index.less +0 -19
  153. package/plugins/lib/index.js +0 -72
  154. package/plugins/lib/lazy_use.js +0 -40
  155. package/plugins/lib/modal/index.jsx +0 -53
  156. package/plugins/lib/modal/index.less +0 -50
  157. package/plugins/lib/multiTab/APIEnums.js +0 -17
  158. package/plugins/lib/multiTab/MultiTab.jsx +0 -237
  159. package/plugins/lib/multiTab/RouteAPI.js +0 -71
  160. package/plugins/lib/multiTab/RouteContent.jsx +0 -90
  161. package/plugins/lib/multiTab/RouteKeepAlive.js +0 -183
  162. package/plugins/lib/multiTab/events.js +0 -2
  163. package/plugins/lib/multiTab/index.js +0 -15
  164. package/plugins/lib/multiTab/index.less +0 -73
  165. package/plugins/lib/style/index.less +0 -2
  166. package/plugins/lib/style/mixins.less +0 -79
  167. package/plugins/lib/svgIcon/index.js +0 -7
  168. package/plugins/lib/svgIcon/index.vue +0 -77
  169. package/plugins/lib/table/index.js +0 -7
  170. package/plugins/lib/table/index.vue +0 -217
  171. package/plugins/lib/table/style/index.less +0 -50
  172. package/plugins/lib/tree/index.js +0 -17
  173. package/plugins/lib/tree/style/Directory.less +0 -119
  174. package/plugins/lib/weather/index.js +0 -7
  175. package/plugins/lib/weather/index.vue +0 -58
  176. package/plugins/method/AMap.js +0 -368
  177. package/plugins/method/PageLoading.jsx +0 -106
  178. package/plugins/method/Theme.js +0 -88
  179. package/plugins/method/index.js +0 -12
  180. package/plugins/store/auth.js +0 -31
  181. package/plugins/store/cache.js +0 -56
  182. package/plugins/store/chat.js +0 -74
  183. package/plugins/store/project.js +0 -46
  184. package/plugins/utils/Axios.js +0 -105
  185. package/plugins/utils/Base64.js +0 -314
  186. package/plugins/utils/Filter.js +0 -249
  187. package/plugins/utils/PostMessage.js +0 -16
  188. package/plugins/utils/Postcss.js +0 -9
  189. package/plugins/utils/Rem.js +0 -24
  190. package/plugins/utils/Request.js +0 -38
  191. package/plugins/utils/Storage.js +0 -73
  192. package/plugins/utils/Tree.js +0 -169
  193. package/plugins/utils/Utils.js +0 -51
  194. package/plugins/utils/Validate.js +0 -33
  195. package/plugins/utils/Websocket.js +0 -186
  196. package/utils/PostMessage.js +0 -16
  197. package/utils/Request.js +0 -38
  198. /package/{method → extensions}/PageLoading.jsx +0 -0
  199. /package/{method → extensions}/Theme.js +0 -0
  200. /package/{plugins/font → font}/DS-DIGI-1.ttf +0 -0
  201. /package/{plugins/font → font}/DS-DIGIB-2.ttf +0 -0
  202. /package/{plugins/font → font}/DS-DIGII-3.ttf +0 -0
  203. /package/{plugins/font → font}/DS-DIGIT-4.ttf +0 -0
  204. /package/{plugins/font → font}/Orbitron-Black.ttf +0 -0
  205. /package/{plugins/font → font}/Orbitron-Bold.ttf +0 -0
  206. /package/{plugins/font → font}/Orbitron-Medium.ttf +0 -0
  207. /package/{plugins/font → font}/Orbitron-Regular.ttf +0 -0
  208. /package/{plugins/font → font}/PANGMENZHENGDAOBIAOTITI-1.TTF +0 -0
  209. /package/{plugins/font → font}/PingFang SC.ttf +0 -0
  210. /package/{plugins/font → font}/YouSheBiaoTiHei.ttf +0 -0
  211. /package/{plugins/font → font}/font.css +0 -0
  212. /package/{plugins/font → font}//345/255/227/351/255/20235/345/217/267-/347/273/217/345/205/270/351/233/205/351/273/221.ttf" +0 -0
  213. /package/lib/browse/{index.less → style/index.less} +0 -0
  214. /package/{dist/css/index.css → lib/button/style/index.less} +0 -0
  215. /package/lib/{dateTime → date-time}/index.js +0 -0
  216. /package/lib/{descriptions → descriptions-list/style}/index.less +0 -0
  217. /package/lib/{form/components → form-comp}/RenderComp.vue +0 -0
  218. /package/lib/{svgIcon → svg-icon}/index.js +0 -0
@@ -1,79 +0,0 @@
1
- /* 布局( 纯为了不想多写一行 */
2
- .layout( @w: 100%, @h: 100% ) {
3
- width: @w;
4
- height: @h;
5
- }
6
-
7
- /* 正方体盒子 */
8
- .square(@size) {
9
- .layout(@size; @size);
10
- }
11
-
12
- // 提示文字样式
13
- .placeholder(@color: @input-placeholder-color) {
14
- // Firefox
15
- &::-moz-placeholder {
16
- color: @color;
17
- opacity: 1;
18
- }
19
- // Internet Explorer 10+
20
- &:-ms-input-placeholder {
21
- color: @color;
22
- }
23
- // Safari and Chrome
24
- &::-webkit-input-placeholder {
25
- color: @color;
26
- }
27
-
28
- &:placeholder-shown {
29
- text-overflow: ellipsis;
30
- }
31
- }
32
-
33
- /* 滚动条样式 */
34
- .scrollbarStyle( @w: 6px, @h: 6px, @color1: @primary-color, @color2: transparent ) {
35
- &::-webkit-scrollbar-track {
36
- border-radius: 0;
37
- background-color: transparent;
38
- }
39
- &::-webkit-scrollbar-thumb {
40
- border-radius: 0;
41
- border-radius: 5px;
42
- background-image: -webkit-linear-gradient(270deg, @color1 0%, @color2 100%);
43
- -webkit-transition: all 0.2s;
44
- transition: all 0.2s;
45
- }
46
- &::-webkit-scrollbar-corner {
47
- background-color: transparent;
48
- }
49
- &::-webkit-scrollbar {
50
- width: @w;
51
- height: @h;
52
- }
53
- }
54
-
55
- /* 文字换行省略(默认1行)*/
56
- .ellipsis( @row: 1 ) {
57
- text-overflow: -o-ellipsis-lastline;
58
- overflow: hidden;
59
- text-overflow: ellipsis;
60
- display: -webkit-box;
61
- -webkit-line-clamp: @row;
62
- line-clamp: @row;
63
- -webkit-box-orient: vertical;
64
- }
65
-
66
- /* flex布局 */
67
- .flex-layout( @flexDirection: row, @flexGap: 0 ) {
68
- display: flex;
69
- gap: @flexGap;
70
- flex-direction: @flexDirection;
71
- }
72
-
73
- /* flex排版方式 */
74
- .flex-mixins(@direction: row, @align: center, @justify: center, @gap: 0 ) {
75
- .flex-layout(@direction, @gap);
76
- flex-wrap: wrap;
77
- align-items: @align;
78
- justify-content: @justify;
79
- }
@@ -1,7 +0,0 @@
1
- import SvgIcon from './index.vue'
2
-
3
- SvgIcon.install = function (Vue) {
4
- Vue.component(SvgIcon.name, SvgIcon)
5
- }
6
-
7
- export default SvgIcon
@@ -1,77 +0,0 @@
1
- <template>
2
- <div v-if="isExternal" :style="styleExternalIcon" class="svg-external-icon svg-icon" v-on="$listeners" />
3
- <svg v-else :class="svgClass" aria-hidden="true" v-on="$listeners">
4
- <use :xlink:href="iconName" />
5
- <text :x="x" :y="y" :class="textClass">{{text}}</text>
6
- </svg>
7
- </template>
8
-
9
- <script>
10
-
11
- export default {
12
- name: "svgIcon",
13
- props: {
14
- iconClass: {
15
- type: String,
16
- required: true
17
- },
18
- textClass: {
19
- type: String,
20
- default: ""
21
- },
22
- className: {
23
- type: String,
24
- default: ""
25
- },
26
- text: {
27
- type: String,
28
- default: ""
29
- },
30
- x: {
31
- type: Number,
32
- default: 0
33
- },
34
- y: {
35
- type: Number,
36
- default: 0
37
- }
38
- },
39
- computed: {
40
- isExternal() {
41
- return /^(https?:|mailto:|tel:)/.test(this.iconClass);
42
- },
43
- iconName() {
44
- return `#icon-${this.iconClass}`;
45
- },
46
- svgClass() {
47
- if (this.className) {
48
- return "svg-icon " + this.className;
49
- } else {
50
- return "svg-icon";
51
- }
52
- },
53
- styleExternalIcon() {
54
- return {
55
- mask: `url(${this.iconClass}) no-repeat 50% 50%`,
56
- "-webkit-mask": `url(${this.iconClass}) no-repeat 50% 50%`
57
- };
58
- }
59
- }
60
- };
61
- </script>
62
-
63
- <style scoped lang="less">
64
- .svg-icon {
65
- width: 90px;
66
- height: 90px;
67
- vertical-align: -0.15em;
68
- fill: currentColor;
69
- overflow: hidden;
70
- }
71
-
72
- .svg-external-icon {
73
- background-color: currentColor;
74
- mask-size: cover;
75
- display: inline-block;
76
- }
77
- </style>
@@ -1,7 +0,0 @@
1
- import Table from './index.vue'
2
-
3
- Table.install = function (Vue) {
4
- Vue.component(Table.name, Table)
5
- }
6
-
7
- export default Table
@@ -1,217 +0,0 @@
1
- <template>
2
- <div :class="[tableStyle, 'WebComponentTable']" ref="Table">
3
-
4
- <div class="WebComponentTable__Head" ref="TableHead">
5
- <slot name="ATableHead" />
6
- </div>
7
-
8
- <Table
9
- ref="TableList"
10
- :size="tableSize"
11
- :data-source="tableDatas"
12
- v-on="$listeners"
13
- v-bind="setAttrs"
14
- class="WebComponentTable__List"
15
- >
16
- <!-- 下次更改一下title的传递方式 -->
17
- <div class="WebComponentTable__List__Title" ref="TableListTitle" slot="title">
18
- <slot name="ATableTitle" />
19
- </div>
20
-
21
- <template v-for="{ dataIndex } in $attrs.columns" #[dataIndex]>
22
- <!-- 自定义头部渲染 -->
23
- <slot :name="dataIndex" />
24
- </template>
25
-
26
- <template #customRender="text, record, i, column">
27
- <slot :name="column.dataIndex" :customProps="record" :text="text" :index="i" />
28
- </template>
29
- </Table>
30
-
31
- <div class="WebComponentTable__Pagination" ref="TablePagination">
32
- <slot name="ATablePagination">
33
- <Pagination
34
- size="small"
35
- :pageSizeOptions="pageSizeOptions"
36
- :show-total="total => `共 ${total} 条记录`"
37
- show-size-changer
38
- show-quick-jumper
39
- :defaultCurrent="1"
40
- :pageSize.sync="pagination.size"
41
- :current="pagination.current"
42
- @showSizeChange="paginationChange"
43
- @change="paginationChange"
44
- :total="pagination.total"
45
- />
46
- </slot>
47
- </div>
48
-
49
- </div>
50
- </template>
51
-
52
- <script>
53
-
54
- import { Table, Pagination, Icon } from 'ant-design-vue/es'
55
-
56
- const IconFont = Icon.createFromIconfontCN({
57
- scriptUrl: '//at.alicdn.com/t/c/font_4640977_auv55jur50b.js'
58
- })
59
-
60
- export default {
61
- components: {
62
- Table,
63
- Pagination
64
- },
65
- name: 'uTable',
66
- data() {
67
- return {
68
- pagination: {
69
- total: 0,
70
- size: 10,
71
- current: 1
72
- },
73
- tableScrollBody: 600,
74
- /** 跨分页记录选中数据 */
75
- selectedRecords: []
76
- }
77
- },
78
- props: {
79
- // 紧凑型和宽松型
80
- // relax 宽松型
81
- // compact 紧凑型
82
- tableStyle: {
83
- type: String,
84
- default: 'compact'
85
- },
86
- // compact 紧凑型情况下是否有分割线
87
- tableSplit: {
88
- type: Boolean,
89
- default: true
90
- },
91
- // 表格数据
92
- datas: {
93
- type: Array,
94
- default: () => []
95
- },
96
- emptySymbol: {
97
- type: String,
98
- default: '-'
99
- },
100
- // 选中数据项
101
- selectedRowKeys: {
102
- type: Array,
103
- default: () => []
104
- },
105
- // 分页默认值
106
- paginationParams: {
107
- type: Object,
108
- default: () => ({
109
- total: 0,
110
- size: 10,
111
- current: 1
112
- })
113
- },
114
- // 配置分页数据
115
- pageSizeOptions: {
116
- type: Array,
117
- default: () => ['10', '15', '20', '30', '50']
118
- }
119
- },
120
- computed: {
121
- setAttrs() {
122
- return {
123
- pagination: false,
124
- rowKey: (record, i) => record.id ?? `${this.pagination.current}${i}`,
125
- rowSelection: { selectedRowKeys: this.selectedRowKeys, onChange: this.onSelectChange },
126
- locale: {
127
- emptyText: <div class="WebComponentTable__List__Empty">
128
- <IconFont type="icon-zanwushuju" />
129
- <span>暂无数据</span>
130
- </div>
131
- },
132
- scroll: { y: this.tableScrollBody, x: this.$attrs.scrollX },
133
- ...this.$attrs
134
- }
135
- },
136
- tableSize() {
137
- return this.tableStyle == 'compact' ? 'middle' : 'default'
138
- },
139
- tableDatas() {
140
- /** 字段数据为空则添加默认占位符 */
141
- const dataKeys = this.$attrs.columns.map(column => column.dataIndex)
142
- return this.datas.map(dataItem => {
143
- const cloneItem = {...dataItem}
144
- dataKeys.forEach(key => {
145
- const value = cloneItem[key]
146
- if (value === null || value === undefined ||
147
- (typeof value === 'string' && !value.trim())) {
148
- cloneItem[key] = this.emptySymbol
149
- }
150
- })
151
- return cloneItem
152
- })
153
- }
154
- },
155
- watch: {
156
- paginationParams(newValue) {
157
- this.pagination = { ...newValue }
158
- }
159
- },
160
- mounted() {
161
- this.pagination = { ...this.paginationParams }
162
- const scrollTimer = setTimeout(() => {
163
- this.getScrollBodyH()
164
- clearTimeout(scrollTimer)
165
- }, 300)
166
- window.addEventListener('resize', () => this.getScrollBodyH())
167
- this.removeDomElement()
168
- },
169
- destroyed() {
170
- // window.removeEventListener( 'resize' )
171
- },
172
- methods: {
173
- /** 根据内容高度计算滚动长度 */
174
- getScrollBodyH() {
175
- this.tableScrollBody =
176
- this.$refs.Table.clientHeight -
177
- this.$refs.TableHead.offsetHeight -
178
- this.$refs.TablePagination.offsetHeight -
179
- 16 -
180
- this.$refs.TableListTitle.offsetHeight -
181
- document.querySelector('.ant-table-thead').offsetHeight -
182
- 20
183
- /** 20为获取高度时抹掉的小数点后两位的浮动空间(存在叠加多个获取错误的情况) */
184
- console.log(this.$refs.Table.clientHeight, this.tableScrollBody, 'tableScrollBody滚动高度')
185
- },
186
- /** 根据高度判断dom元素是否加载 进行删除 */
187
- removeDomElement() {
188
- let domElement
189
- this.$refs.Table.querySelectorAll('div').forEach( node => {
190
- node.className == 'ant-table-title' && (domElement = node)
191
- } )
192
- !this.$scopedSlots.ATableHead && this.$refs.TableHead.remove()
193
- !this.$scopedSlots.ATableTitle && ( domElement.style.padding = '0' )
194
- },
195
- onSelectChange(selectedKey, selectedRecord) {
196
- const {setAttrs, selectedRecords} = this
197
- const setRecords = selectedRecords.filter(recordItem =>
198
- selectedKey.includes(recordItem[setAttrs.rowKey])
199
- )
200
- setRecords.length < selectedKey.length && selectedRecords.push(selectedRecord[selectedRecord.length - 1])
201
- this.$emit('selectedRecords', selectedKey, selectedRecords)
202
- },
203
- paginationChange(current, pageSize) {
204
- this.pagination = {
205
- ...this.pagination,
206
- size: pageSize,
207
- current
208
- }
209
- this.$emit('pageSizeChange', this.pagination)
210
- }
211
- }
212
- }
213
- </script>
214
-
215
- <style lang="less" scoped>
216
- @import url('./style/index.less');
217
- </style>
@@ -1,50 +0,0 @@
1
- /* 混入样式 */
2
- @import url('../../style/mixins.less');
3
- @import '~ant-design-vue/lib/style/themes/default.less';
4
-
5
- .WebComponentTable {
6
- .layout();
7
- .flex-layout( column, 16px 0 );
8
-
9
- &__Head {
10
-
11
- }
12
-
13
- &__List {
14
-
15
- &__Title {
16
- display: flex;
17
- align-items: center;
18
- }
19
-
20
- &__Empty {
21
- gap: 16px 0;
22
- height: 120px;
23
- .flex-mixins( column );
24
-
25
- i {
26
- font-size: 80px;
27
- }
28
-
29
- span {
30
- // margin-right: 16px;
31
- }
32
- }
33
-
34
- :deep(.ant-table-title) {
35
- padding: 0;
36
- margin-bottom: @padding-sm;
37
- }
38
-
39
- :deep(.ant-table-body) {
40
- .scrollbarStyle();
41
- }
42
-
43
- }
44
-
45
- &__Pagination {
46
- display: flex;
47
- justify-content: flex-end;
48
- }
49
-
50
- }
@@ -1,17 +0,0 @@
1
- /* 查询tree穿梭 */
2
- import Tree from './Tree.vue'
3
- /* treeMenu树形菜单目录 */
4
- import Directory from './Directory.js'
5
-
6
- Tree.install = function (Vue) {
7
- Vue.component(Tree.name, Tree)
8
- }
9
-
10
- Directory.install = function (Vue) {
11
- Vue.component(Directory.name, Directory)
12
- }
13
-
14
- export {
15
- Tree,
16
- Directory
17
- }
@@ -1,119 +0,0 @@
1
- /* 混入样式 */
2
- @import '../../style/mixins.less';
3
- @import '~ant-design-vue/lib/style/themes/default.less';
4
-
5
- .DirectoryTreeMenu {
6
- height: 100%;
7
- padding: @padding-md;
8
- box-sizing: border-box;
9
-
10
- &__Actions {
11
- .flex-layout(@flexGap: 0 @padding-xs);
12
- position: relative;
13
-
14
- .ActionsIcons.ActionsIcons {
15
- cursor: pointer;
16
- .square(16px);
17
-
18
- &:focus {
19
- outline: none;
20
- }
21
- }
22
- }
23
-
24
- .treeDirectory {
25
- .layout( 100%, 40px );
26
- .flex-mixins(@justify: flex-start);
27
-
28
- & > span {
29
- flex: 1;
30
- color: @white;
31
- text-align: left;
32
- font-size: @font-size-lg;
33
- font-weight: 700;
34
- padding-left: @padding-sm;
35
- box-sizing: border-box;
36
- position: relative;
37
-
38
- &::after {
39
- left: 0;
40
- top: calc((100% - 12px) / 2);
41
- content: '';
42
- position: absolute;
43
- background: @primary-color;
44
- border-radius: @border-radius-sm;
45
- .layout(4px, 12px);
46
- }
47
- }
48
-
49
- :deep(.ant-btn) {
50
- line-height: 16px;
51
- margin-right: @padding-sm;
52
- border-color: @white;
53
- .square(16px);
54
- .flex-mixins();
55
-
56
- i {
57
- font-size: @font-size-sm;
58
- color: @white;
59
- }
60
- }
61
- }
62
-
63
- &__Tree {
64
- height: calc(100% - 40px);
65
- overflow-y: auto;
66
- .scrollbarStyle();
67
- }
68
- }
69
-
70
- .DirectoryTreeMenu__Dropdown {
71
- &__Menu {
72
- .layout( 140px, auto );
73
- padding: @padding-xs 0;
74
- box-sizing: border-box;
75
- border-radius: @border-radius-sm;
76
-
77
- span {
78
- display: flex;
79
- align-items: center;
80
- margin-bottom: 2px;
81
- font-size: @font-size-base;
82
- padding: 0 @padding-md;
83
- box-sizing: border-box;
84
- cursor: pointer;
85
- .layout( 100%, 26px );
86
-
87
- &:last-child {
88
- margin: 0;
89
- }
90
-
91
- .svg-icon {
92
- margin-right: @padding-xs;
93
- .square(16px);
94
- }
95
- }
96
- }
97
- }
98
-
99
- .DirectoryTreeMenu__Node {
100
- .ant-tree-node-content-wrapper {
101
- width: calc(100% - 24px);
102
-
103
- .ant-tree-title {
104
- display: inline-block;
105
- .layout( calc( 100% - 24px ), 100% );
106
-
107
- .__Title {
108
- .square(100%);
109
- .flex-mixins(@justify: flex-start, @gap: 0 @padding-xs);
110
-
111
- & > span {
112
- white-space: normal;
113
- width: calc(100% - 56px);
114
- .ellipsis();
115
- }
116
- }
117
- }
118
- }
119
- }
@@ -1,7 +0,0 @@
1
- import Weather from './index.vue'
2
-
3
- Weather.install = function (Vue) {
4
- Vue.component(Weather.name, Weather)
5
- }
6
-
7
- export default Weather
@@ -1,58 +0,0 @@
1
- <template>
2
- <div class="weather">
3
- <slot name="weatherIcon" :weatherInfo="weatherInfo" />
4
- <span class="weather__Info">{{ weatherInfo.weather }}</span>
5
- <span class="weather__Temp">温度{{ weatherInfo.temperature }}°</span>
6
- </div>
7
- </template>
8
-
9
- <script>
10
-
11
- export default {
12
- name: 'weather',
13
- props: {
14
- /** 当前城市高德code编码 */
15
- adCode: String,
16
- AMapServiceKey: {
17
- type: String,
18
- default: '76aa516e74e87a1b9d169e796f2bbdc3'
19
- }
20
- },
21
- data() {
22
- return {
23
- weatherInfo: {}
24
- }
25
- },
26
- mounted() {
27
- this.getWeatherInfo()
28
- },
29
- methods: {
30
- async getWeatherInfo() {
31
- await fetch(
32
- `https://restapi.amap.com/v3/weather/weatherInfo?key=${this.AMapServiceKey}&city=${this.adCode}`,
33
- {
34
- method: 'GET',
35
- headers: {
36
- 'Content-Type': 'application/json'
37
- }
38
- })
39
- .then(response => response.json())
40
- .then(({infocode, lives}) => {
41
- infocode == '10000' && (this.weatherInfo = { ...lives[0] })
42
- console.log(lives, '获取的天气信息详情')
43
- })
44
- .catch(error => {
45
- console.error('Error:', error)
46
- })
47
- }
48
- }
49
- }
50
- </script>
51
-
52
- <style scoped lang="less">
53
- .weather {
54
- display: flex;
55
- gap: 0 14px;
56
- font-size: 16px;
57
- }
58
- </style>