@kyfe/ks-query-table 0.0.9 → 0.0.10

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 (315) hide show
  1. package/{qt-npm/ks-query-table.common.js → index.js} +1 -1
  2. package/{qt-npm/ks-query-table.umd.js → ks-query-table.umd.js} +1 -1
  3. package/{qt-npm/ks-query-table.umd.min.js → ks-query-table.umd.min.js} +1 -1
  4. package/{qt-npm/ks-query-table.umd.min.js.map → ks-query-table.umd.min.js.map} +1 -1
  5. package/package.json +10 -81
  6. package/.bitmap +0 -38
  7. package/.editorconfig +0 -5
  8. package/.env.dev +0 -2
  9. package/.env.gray +0 -2
  10. package/.env.prod +0 -2
  11. package/.env.stg +0 -3
  12. package/.env.uat +0 -2
  13. package/.eslintignore +0 -1
  14. package/.eslintrc.js +0 -25
  15. package/.gitmodules +0 -4
  16. package/.prettierrc +0 -11
  17. package/README.md +0 -6
  18. package/babel.config.js +0 -10
  19. package/build-apm.sh +0 -9
  20. package/build.sh +0 -16
  21. package/config/index.js +0 -20
  22. package/jsconfig.json +0 -7
  23. package/kuasheng-sdk/index.js +0 -80
  24. package/kuasheng-sdk/lib/assets.js +0 -304
  25. package/kuasheng-sdk/lib/context.js +0 -199
  26. package/kuasheng-sdk/lib/layout.js +0 -346
  27. package/kuasheng-sdk/lib/location.js +0 -46
  28. package/kuasheng-sdk/lib/media.js +0 -342
  29. package/kuasheng-sdk/lib/navigation.js +0 -30
  30. package/kuasheng-sdk/lib/request.js +0 -76
  31. package/kuasheng-sdk/lib/system.js +0 -190
  32. package/kuasheng-sdk/lib/userinfo.js +0 -98
  33. package/kuasheng-sdk/util/check.js +0 -102
  34. package/kuasheng-sdk/util/config.js +0 -47
  35. package/kuasheng-sdk/util/device.js +0 -25
  36. package/kuasheng-sdk/util/error.js +0 -19
  37. package/kuasheng-sdk/util/funtional.js +0 -153
  38. package/kuasheng-sdk/util/mixin.js +0 -36
  39. package/kuasheng-sdk/util/requestUtil.js +0 -41
  40. package/kuasheng-sdk/util/response.js +0 -33
  41. package/kuasheng-sdk/util/warn.js +0 -35
  42. package/kuasheng-ui/CHANGELOG.md +0 -9
  43. package/kuasheng-ui/components/card.vue +0 -57
  44. package/kuasheng-ui/components/ks-area-select/README.md +0 -43
  45. package/kuasheng-ui/components/ks-area-select/area-picker.vue +0 -554
  46. package/kuasheng-ui/components/ks-area-select/area-search.vue +0 -363
  47. package/kuasheng-ui/components/ks-area-select/areas-pop.vue +0 -56
  48. package/kuasheng-ui/components/ks-area-select/common.js +0 -183
  49. package/kuasheng-ui/components/ks-area-select/index.vue +0 -355
  50. package/kuasheng-ui/components/ks-area-select/mixins.js +0 -216
  51. package/kuasheng-ui/components/ks-area-single-select/README.md +0 -50
  52. package/kuasheng-ui/components/ks-area-single-select/hot-city.js +0 -45
  53. package/kuasheng-ui/components/ks-area-single-select/index.vue +0 -324
  54. package/kuasheng-ui/components/ks-calendar/index.vue +0 -269
  55. package/kuasheng-ui/components/ks-call-phone/call-tips.vue +0 -70
  56. package/kuasheng-ui/components/ks-call-phone/call.vue +0 -178
  57. package/kuasheng-ui/components/ks-call-phone/index.js +0 -48
  58. package/kuasheng-ui/components/ks-call-phone/index.vue +0 -131
  59. package/kuasheng-ui/components/ks-call-phone//345/221/274/345/217/253/347/273/204/344/273/266.md +0 -0
  60. package/kuasheng-ui/components/ks-date-picker/README.md +0 -23
  61. package/kuasheng-ui/components/ks-date-picker/date-picker-bottom.vue +0 -123
  62. package/kuasheng-ui/components/ks-date-picker/date-picker-dropdown.vue +0 -80
  63. package/kuasheng-ui/components/ks-date-picker/date-picker-right.vue +0 -87
  64. package/kuasheng-ui/components/ks-date-picker/date-picker-top.vue +0 -88
  65. package/kuasheng-ui/components/ks-date-picker/date-picker.js +0 -15
  66. package/kuasheng-ui/components/ks-date-picker/date-range-select.vue +0 -92
  67. package/kuasheng-ui/components/ks-date-picker/date-select.vue +0 -65
  68. package/kuasheng-ui/components/ks-date-picker/date-week-month.vue +0 -131
  69. package/kuasheng-ui/components/ks-date-picker/index.js +0 -12
  70. package/kuasheng-ui/components/ks-date-picker/mixin.js +0 -92
  71. package/kuasheng-ui/components/ks-date-picker/month-range-select.vue +0 -129
  72. package/kuasheng-ui/components/ks-date-picker/month-select.vue +0 -85
  73. package/kuasheng-ui/components/ks-date-picker/quarter-select.vue +0 -94
  74. package/kuasheng-ui/components/ks-date-picker/style.less +0 -121
  75. package/kuasheng-ui/components/ks-date-picker/utils.js +0 -109
  76. package/kuasheng-ui/components/ks-date-picker/week-select.vue +0 -99
  77. package/kuasheng-ui/components/ks-decrypt/index.vue +0 -159
  78. package/kuasheng-ui/components/ks-employee/README.md +0 -78
  79. package/kuasheng-ui/components/ks-employee/employee-input.vue +0 -173
  80. package/kuasheng-ui/components/ks-employee/employee-list.vue +0 -662
  81. package/kuasheng-ui/components/ks-employee/employee-popup.vue +0 -197
  82. package/kuasheng-ui/components/ks-employee/employee-search.vue +0 -250
  83. package/kuasheng-ui/components/ks-employee/employee-selected.vue +0 -173
  84. package/kuasheng-ui/components/ks-employee/index.js +0 -17
  85. package/kuasheng-ui/components/ks-employee/package-lock.json +0 -5
  86. package/kuasheng-ui/components/ks-employee/package.json +0 -15
  87. package/kuasheng-ui/components/ks-employee/yarn.lock +0 -4
  88. package/kuasheng-ui/components/ks-field-money/index.js +0 -8
  89. package/kuasheng-ui/components/ks-field-money/index.vue +0 -212
  90. package/kuasheng-ui/components/ks-field-money/package.json +0 -11
  91. package/kuasheng-ui/components/ks-field-money/utils.js +0 -65
  92. package/kuasheng-ui/components/ks-field-money//351/207/221/351/242/235/350/275/254/346/215/242/345/231/250.md +0 -0
  93. package/kuasheng-ui/components/ks-history-search/history-input.vue +0 -131
  94. package/kuasheng-ui/components/ks-history-search/history-list.vue +0 -188
  95. package/kuasheng-ui/components/ks-history-search/img/delete.png +0 -0
  96. package/kuasheng-ui/components/ks-history-search/index.js +0 -9
  97. package/kuasheng-ui/components/ks-history-search/index.vue +0 -125
  98. package/kuasheng-ui/components/ks-history-search/package-lock.json +0 -5
  99. package/kuasheng-ui/components/ks-history-search/package.json +0 -15
  100. package/kuasheng-ui/components/ks-history-search/utils.js +0 -35
  101. package/kuasheng-ui/components/ks-input-search/index.vue +0 -106
  102. package/kuasheng-ui/components/ks-list/index.vue +0 -75
  103. package/kuasheng-ui/components/ks-loading/index.js +0 -16
  104. package/kuasheng-ui/components/ks-month/index.vue +0 -47
  105. package/kuasheng-ui/components/ks-month/package.json +0 -3
  106. package/kuasheng-ui/components/ks-month/range.vue +0 -172
  107. package/kuasheng-ui/components/ks-month/single.vue +0 -136
  108. package/kuasheng-ui/components/ks-month/style.less +0 -125
  109. package/kuasheng-ui/components/ks-month/utils.js +0 -35
  110. package/kuasheng-ui/components/ks-nav/index.vue +0 -264
  111. package/kuasheng-ui/components/ks-nav-bar.js +0 -35
  112. package/kuasheng-ui/components/ks-org/ks-org-tree.vue +0 -247
  113. package/kuasheng-ui/components/ks-org/ks-popup-tree.vue +0 -154
  114. package/kuasheng-ui/components/ks-org/ks-tree-input.vue +0 -240
  115. package/kuasheng-ui/components/ks-org/ks-tree-node.vue +0 -94
  116. package/kuasheng-ui/components/ks-org/ks-tree.vue +0 -229
  117. package/kuasheng-ui/components/ks-org/utils.js +0 -54
  118. package/kuasheng-ui/components/ks-popover/index.vue +0 -457
  119. package/kuasheng-ui/components/ks-popover/mixin.js +0 -28
  120. package/kuasheng-ui/components/ks-popover/utils.js +0 -60
  121. package/kuasheng-ui/components/ks-pull-refresh/index.vue +0 -43
  122. package/kuasheng-ui/components/ks-quarter/index.vue +0 -256
  123. package/kuasheng-ui/components/ks-table/README.md +0 -103
  124. package/kuasheng-ui/components/ks-table/cell.vue +0 -31
  125. package/kuasheng-ui/components/ks-table/index.js +0 -8
  126. package/kuasheng-ui/components/ks-table/index.less +0 -486
  127. package/kuasheng-ui/components/ks-table/index.vue +0 -1088
  128. package/kuasheng-ui/components/ks-table/package.json +0 -12
  129. package/kuasheng-ui/components/ks-table/release.md +0 -7
  130. package/kuasheng-ui/components/ks-toast.js +0 -35
  131. package/kuasheng-ui/components/ks-upload/index.vue +0 -174
  132. package/kuasheng-ui/components/ks-user-access.vue +0 -229
  133. package/kuasheng-ui/components/no-data/README.md +0 -45
  134. package/kuasheng-ui/components/no-data/image.js +0 -1
  135. package/kuasheng-ui/components/no-data/index.vue +0 -83
  136. package/kuasheng-ui/components/notice-bar.vue +0 -16
  137. package/kuasheng-ui/components/steps.js +0 -11
  138. package/kuasheng-ui/components/tabs.vue +0 -40
  139. package/kuasheng-ui/index.js +0 -239
  140. package/kuasheng-ui/patch/datetime-picker/datetimePicker.md +0 -0
  141. package/kuasheng-ui/patch/datetime-picker/index.js +0 -46
  142. package/kuasheng-ui/patch/datetime-picker/utils.js +0 -78
  143. package/kuasheng-ui/patch/field/field.md +0 -1
  144. package/kuasheng-ui/patch/field/index.js +0 -122
  145. package/kuasheng-ui/patch/field/utils.js +0 -36
  146. package/kuasheng-ui/patch/form/form.md +0 -7
  147. package/kuasheng-ui/patch/form/index.js +0 -106
  148. package/kuasheng-ui/patch/index.js +0 -12
  149. package/kuasheng-ui/patch/pagination/index.js +0 -78
  150. package/kuasheng-ui/style/animation-ui.less +0 -31
  151. package/kuasheng-ui/style/font/number/font-number1.otf +0 -0
  152. package/kuasheng-ui/style/font/number/font-number2.ttf +0 -0
  153. package/kuasheng-ui/style/images/checked.svg +0 -1
  154. package/kuasheng-ui/style/images/success.svg +0 -1
  155. package/kuasheng-ui/style/index.less +0 -6
  156. package/kuasheng-ui/style/kuasheng-ui.less +0 -207
  157. package/kuasheng-ui/style/reset-vant.less +0 -307
  158. package/kuasheng-ui/style/vant-var.less +0 -138
  159. package/kuasheng-ui/utils/apis.js +0 -17
  160. package/kuasheng-ui/utils/axios-adapter.js +0 -47
  161. package/kuasheng-ui/utils/bem.js +0 -39
  162. package/kuasheng-ui/utils/bus.js +0 -97
  163. package/kuasheng-ui/utils/common.js +0 -88
  164. package/kuasheng-ui/utils/decrypt/config.js +0 -12
  165. package/kuasheng-ui/utils/decrypt/decrypt-api.js +0 -139
  166. package/kuasheng-ui/utils/decrypt/index.js +0 -6
  167. package/kuasheng-ui/utils/decrypt/mask.js +0 -36
  168. package/kuasheng-ui/utils/decrypt/virtual.js +0 -44
  169. package/kuasheng-ui/utils/directive.js +0 -57
  170. package/kuasheng-ui/utils/directive.md +0 -23
  171. package/kuasheng-ui/utils/drcheck-plugin.js +0 -219
  172. package/kuasheng-ui/utils/error-plugin.js +0 -88
  173. package/kuasheng-ui/utils/filter.js +0 -149
  174. package/kuasheng-ui/utils/http-interceptors.js +0 -18
  175. package/kuasheng-ui/utils/http.js +0 -140
  176. package/kuasheng-ui/utils/index.js +0 -5
  177. package/kuasheng-ui/utils/init-event.js +0 -20
  178. package/kuasheng-ui/utils/log.js +0 -309
  179. package/kuasheng-ui/utils/token.js +0 -9
  180. package/kuasheng-ui/utils/type.js +0 -45
  181. package/kuasheng-ui/utils/validate.js +0 -20
  182. package/kuasheng-ui/utils/watermark.js +0 -67
  183. package/kuasheng-ui/version.js +0 -1
  184. package/ky-apm/client.js +0 -37
  185. package/ky-apm/customHttp.js +0 -38
  186. package/ky-apm/index.js +0 -68
  187. package/ky-apm/plugins/performance.js +0 -84
  188. package/ky-apm/plugins/self-error.js +0 -26
  189. package/ky-apm/warn-log.js +0 -3
  190. package/plugin/ks-chii-webpack-html/index.js +0 -53
  191. package/plugin/ks-chii-webpack-html/package.json +0 -16
  192. package/postcss.config.js +0 -15
  193. package/public/capsule-positon.js +0 -50
  194. package/public/fonts/DingTalkJinBuTi.ttf +0 -0
  195. package/public/framework/axios@0.19.0.min.js +0 -9
  196. package/public/framework/fastclick@1.0.6.min.js +0 -1
  197. package/public/framework/iconfont/iconfont.css +0 -91
  198. package/public/framework/iconfont/iconfont.js +0 -1
  199. package/public/framework/iconfont/iconfont.json +0 -142
  200. package/public/framework/iconfont/iconfont.ttf +0 -0
  201. package/public/framework/iconfont/iconfont.woff +0 -0
  202. package/public/framework/iconfont/iconfont.woff2 +0 -0
  203. package/public/framework/vant@2.5.6.min.js +0 -7
  204. package/public/framework/vue-router@3.1.3.min.js +0 -6
  205. package/public/framework/vue@2.6.10.runtime.min.js +0 -6
  206. package/public/framework/vuex@3.1.1.min.js +0 -6
  207. package/public/index.html +0 -260
  208. package/public/ks@3.0.8.umd.min.js +0 -1
  209. package/public/ksui@4.0.27.umd.min.js +0 -10
  210. package/public/status-bar-preset.js +0 -39
  211. package/qt-npm/package.json +0 -13
  212. package/src/App.vue +0 -204
  213. package/src/common/README.md +0 -94
  214. package/src/common/http/axios-adapter.js +0 -47
  215. package/src/common/http/common.js +0 -88
  216. package/src/common/http/http-interceptors.js +0 -18
  217. package/src/common/http/http-lock.js +0 -45
  218. package/src/common/http/index.js +0 -163
  219. package/src/common/http/token.js +0 -9
  220. package/src/common/styles/font/AlibabaSans102Ver2-Md.ttf +0 -0
  221. package/src/common/styles/font.less +0 -12
  222. package/src/common/styles/variables.less +0 -43
  223. package/src/common/utils/index.js +0 -1
  224. package/src/common/utils/platform/README.md +0 -1
  225. package/src/common/utils/platform/android/.gitkeep +0 -0
  226. package/src/common/utils/platform/core/index.js +0 -24
  227. package/src/common/utils/platform/index.js +0 -164
  228. package/src/common/utils/platform/ios/.gitkeep +0 -0
  229. package/src/common/utils/platform/subscribe/helper.js +0 -38
  230. package/src/common/utils/platform/subscribe/index.js +0 -204
  231. package/src/common/utils/platform/subscribe/table-animation.js +0 -75
  232. package/src/config/index.js +0 -31
  233. package/src/config.js +0 -1
  234. package/src/main.js +0 -73
  235. package/src/router.js +0 -52
  236. package/src/view/home/config.js +0 -101
  237. package/src/view/home/demo1.vue +0 -223
  238. package/src/view/home/demo2.vue +0 -124
  239. package/src/view/home/demo3.vue +0 -51
  240. package/src/view/home/demo4.vue +0 -139
  241. package/src/view/home/index.vue +0 -97
  242. package/src/view/home/query-table/README.md +0 -45
  243. package/src/view/home/query-table/api/index.js +0 -12
  244. package/src/view/home/query-table/assets/horizontal-back.svg +0 -1
  245. package/src/view/home/query-table/components/pe-table/cell.js +0 -184
  246. package/src/view/home/query-table/components/pe-table/collapse.js +0 -334
  247. package/src/view/home/query-table/components/pe-table/empty.vue +0 -48
  248. package/src/view/home/query-table/components/pe-table/header.js +0 -328
  249. package/src/view/home/query-table/components/pe-table/images/abnormal.png +0 -0
  250. package/src/view/home/query-table/components/pe-table/images/empty.png +0 -0
  251. package/src/view/home/query-table/components/pe-table/images/fold.svg +0 -1
  252. package/src/view/home/query-table/components/pe-table/images/sort.svg +0 -1
  253. package/src/view/home/query-table/components/pe-table/images/sorting.svg +0 -1
  254. package/src/view/home/query-table/components/pe-table/images/unfold.svg +0 -1
  255. package/src/view/home/query-table/components/pe-table/index.vue +0 -841
  256. package/src/view/home/query-table/components/pe-table/load-more.js +0 -46
  257. package/src/view/home/query-table/components/pe-table/props/index.js +0 -193
  258. package/src/view/home/query-table/components/pe-table/row.vue +0 -118
  259. package/src/view/home/query-table/components/pe-table/scrollbar.js +0 -424
  260. package/src/view/home/query-table/components/pe-table/stretch-damping.js +0 -112
  261. package/src/view/home/query-table/components/pe-table/style/cell.less +0 -89
  262. package/src/view/home/query-table/components/pe-table/style/empty.less +0 -48
  263. package/src/view/home/query-table/components/pe-table/style/header.less +0 -141
  264. package/src/view/home/query-table/components/pe-table/style/index.less +0 -88
  265. package/src/view/home/query-table/components/pe-table/style/load-more.less +0 -61
  266. package/src/view/home/query-table/components/pe-table/style/row.less +0 -6
  267. package/src/view/home/query-table/components/pe-table/table-loading.vue +0 -119
  268. package/src/view/home/query-table/components/pe-table/table-total.vue +0 -53
  269. package/src/view/home/query-table/components/pe-table/utils/animate.js +0 -80
  270. package/src/view/home/query-table/components/pe-table/utils/columns.js +0 -290
  271. package/src/view/home/query-table/components/pe-table/utils/data.js +0 -12
  272. package/src/view/home/query-table/components/pe-table/utils/fixed.js +0 -69
  273. package/src/view/home/query-table/components/pe-table/utils/formatter.js +0 -327
  274. package/src/view/home/query-table/components/pe-table/utils/render-cells.js +0 -424
  275. package/src/view/home/query-table/components/pe-table/utils/slot.js +0 -28
  276. package/src/view/home/query-table/components/pe-table/utils/tools.js +0 -84
  277. package/src/view/home/query-table/components/pe-table/utils/touch-scroll.js +0 -417
  278. package/src/view/home/query-table/components/query-table/index.vue +0 -496
  279. package/src/view/home/query-table/components/query-table/mixins/column-mixin.js +0 -102
  280. package/src/view/home/query-table/components/query-table/mixins/column-setting.js +0 -143
  281. package/src/view/home/query-table/components/query-table/mixins/data-mixin.js +0 -511
  282. package/src/view/home/query-table/components/query-table/mixins/pagination-mixin.js +0 -26
  283. package/src/view/home/query-table/components/query-table/mixins/table-fixed.js +0 -115
  284. package/src/view/home/query-table/components/query-table/mixins/table-horizontal.js +0 -118
  285. package/src/view/home/query-table/components/table-horizontal.vue +0 -99
  286. package/src/view/home/query-table/components/table-pagination.vue +0 -32
  287. package/src/view/home/query-table/components/table-settings/assets/arrpw-up.svg +0 -1
  288. package/src/view/home/query-table/components/table-settings/assets/disabled-down.svg +0 -1
  289. package/src/view/home/query-table/components/table-settings/assets/disabled-up.svg +0 -1
  290. package/src/view/home/query-table/components/table-settings/assets/down.svg +0 -1
  291. package/src/view/home/query-table/components/table-settings/assets/up.svg +0 -1
  292. package/src/view/home/query-table/components/table-settings/index.less +0 -294
  293. package/src/view/home/query-table/components/table-settings/index.vue +0 -260
  294. package/src/view/home/query-table/components/table-settings/settings.vue +0 -479
  295. package/src/view/home/query-table/components/table-settings/test.js +0 -626
  296. package/src/view/home/query-table/components/table-settings//344/270/252/346/200/247/350/256/276/347/275/256.md +0 -0
  297. package/src/view/home/query-table/components/tooltip.js +0 -124
  298. package/src/view/home/query-table/hooks/use-cache-promise.js +0 -27
  299. package/src/view/home/query-table/hooks/use-column-config.js +0 -190
  300. package/src/view/home/query-table/hooks/use-encryption.js +0 -0
  301. package/src/view/home/query-table/hooks/use-generic-search.js +0 -95
  302. package/src/view/home/query-table/index.js +0 -7
  303. package/src/view/home/query-table/store/column-store.js +0 -0
  304. package/src/view/home/query-table/styles/table.less +0 -24
  305. package/src/view/home/query-table/utils/column.js +0 -36
  306. package/src/view/home/query-table/utils/config.js +0 -12
  307. package/src/view/home/query-table/utils/encryption.js +0 -32
  308. package/src/view/home/query-table/utils/http.js +0 -1
  309. package/src/view/home/query-table/utils/localStorage.js +0 -35
  310. package/src/view/home//351/246/226/351/241/265.md +0 -0
  311. package/src/web.js +0 -99
  312. package/vue.config.js +0 -128
  313. /package/{qt-npm/ks-query-table.common.js.map → ks-query-table.common.js.map} +0 -0
  314. /package/{qt-npm/ks-query-table.css → ks-query-table.css} +0 -0
  315. /package/{qt-npm/ks-query-table.umd.js.map → ks-query-table.umd.js.map} +0 -0
@@ -1,424 +0,0 @@
1
- /** @format */
2
- import { animateScroll } from './utils/animate'
3
-
4
- export default {
5
- data() {
6
- return {
7
- isScrolling: false,
8
- transientScrollOffsetY: 0,
9
- transientScrollOffsetX: 0,
10
- }
11
- },
12
- mounted() {
13
- // 添加滚动条到网格容器
14
- this.refreshThumb()
15
-
16
- // 绑定事件
17
- // this.$refs.trackX.addEventListener('mousemove', this.onTrackMouseMoveX)
18
- // this.$refs.trackX.addEventListener('mousedown', this.onTrackMouseDownX)
19
- // this.$refs.trackY.addEventListener('mousemove', this.onTrackMouseMoveY)
20
- // this.$refs.trackY.addEventListener('mousedown', this.onTrackMouseDownY)
21
- // this.$refs.thumbX.addEventListener('mousedown', this.onThumbMouseDownX)
22
- // this.$refs.thumbY.addEventListener('mousedown', this.onThumbMouseDownY)
23
- this.$refs.container.addEventListener('wheel', this.onContainerWheel)
24
- },
25
- beforeDestroy() {
26
- // 移除事件监听器
27
- this.$refs.trackX.removeEventListener('mousemove', this.onTrackMouseMoveX)
28
- this.$refs.trackX.removeEventListener('mousedown', this.onTrackMouseDownX)
29
- this.$refs.trackY.removeEventListener('mousemove', this.onTrackMouseMoveY)
30
- this.$refs.trackY.removeEventListener('mousedown', this.onTrackMouseDownY)
31
- this.$refs.thumbX.removeEventListener('mousedown', this.onThumbMouseDownX)
32
- this.$refs.thumbY.removeEventListener('mousedown', this.onThumbMouseDownY)
33
- this.$refs.container.removeEventListener('wheel', this.onContainerWheel)
34
- },
35
- methods: {
36
- renderViewportCellsColumns() {
37
- return [...this.renderCellsColumns.filter(col => col.fixed), ...this.renderCellsColumns.slice(this.state.startCell, this.state.endCell + 1)]
38
- },
39
- renderScollXTable(x) {
40
- this.setScrollOffsetX(x);
41
- this.createHeader();
42
- this.renderViewportCells();
43
- this.emitScroll()
44
- },
45
- renderScrollYTable(y) {
46
- this.setScrollOffsetY(y)
47
- this.renderViewportRows()
48
- this.emitScroll()
49
- },
50
- /**
51
- * 垂直滚动到指定行
52
- * @param {Number} rowKey 数据源中的行Key(从0开始)
53
- * @param {Number} [offset=0] 额外偏移量(像素)
54
- * @param {Number} [duration] 动画持续时间(毫秒)
55
- */
56
- scrollToColumn(key, offset = 0, duration) {
57
- const state = this.getState();
58
- const maxScrollLeft = state.scrollableWidth;
59
- const column = this.mainColumns.find(col => col.key === key);
60
-
61
- if (!column) return;
62
-
63
- const fixedList = this.mainColumns.filter(col => col.fixed === 'left' || col.fixed);
64
-
65
- const fixedWidth = fixedList.reduce((acc, col) => acc + col.width, 0);
66
-
67
- const targetScrollLeft = Math.min(
68
- Math.max(0, column.offsetX - fixedWidth - offset),
69
- maxScrollLeft
70
- );
71
-
72
- if (duration) {
73
- animateScroll({
74
- from: this.offsetX,
75
- to: targetScrollLeft,
76
- duration,
77
- onUpdate: (currentPos) => {
78
- this.renderScollXTable(currentPos)
79
- },
80
- })
81
- } else {
82
- this.renderScollXTable(targetScrollLeft)
83
- }
84
- },
85
- /**
86
- * 垂直滚动到指定行
87
- * @param {Number} rowIndex 数据源中的行索引(从0开始)
88
- * @param {Number} [offset=0] 额外偏移量(像素)
89
- * @param {Number} [duration] 动画持续时间(毫秒)
90
- */
91
- scrollToRow(targetIndex, offset = 0, duration) {
92
- const targetScrollTop = this.getTargetScrollTop(targetIndex, offset)
93
- if (duration) {
94
- animateScroll({
95
- from: this.offsetY,
96
- to: targetScrollTop,
97
- duration,
98
- onUpdate: (currentPos) => {
99
- this.renderScrollYTable(currentPos)
100
- },
101
- })
102
- } else {
103
- this.renderScrollYTable(targetScrollTop)
104
- }
105
- },
106
- // 获取Y轴滚动距离
107
- getTargetScrollTop(targetIndex, offset = 0) {
108
- // 边界处理(确保索引在有效范围内)
109
- const maxIndex = this.tableData.length - 1
110
- const safeIndex = Math.max(0, Math.min(targetIndex, maxIndex))
111
-
112
- // 核心计算参数
113
- const rowHeight = this.$props.rowHeight
114
- const availableHeight = this.viewportHeight - this.headerTotalHeight // 实际可用高度
115
- const totalRowHeight = this.tableData.length * rowHeight // 总行高(不含表头)
116
-
117
- // 计算基础偏移量
118
- let baseOffset = safeIndex * rowHeight
119
-
120
- // 最终偏移量计算(包含边界限制)
121
- const maxScrollTop = Math.max(0, totalRowHeight - availableHeight)
122
- return Math.max(0, Math.min(baseOffset + offset, maxScrollTop))
123
-
124
- },
125
- resetStretch(timeout = 100) {
126
- setTimeout(() => {
127
- const maxScrollTop = this.getTargetScrollTop(this.tableData.length - 1, 0)
128
- if (this.offsetY >= maxScrollTop) {
129
- animateScroll({
130
- from: this.offsetY,
131
- to: maxScrollTop,
132
- duration: 10,
133
- onUpdate: (currentPos) => {
134
- this.renderScrollYTable(currentPos)
135
- },
136
- })
137
- }
138
- }, timeout);
139
-
140
- },
141
- refreshThumb() {
142
- const state = this.getState()
143
- this.translateThumbY(state.thumbOffsetY)
144
- this.setThumbSizeY(state.thumbSizeY - this.headerTotalHeight)
145
- this.translateThumbX(state.thumbOffsetX)
146
- this.setThumbSizeX(state.thumbSizeX)
147
- },
148
- clampThumbIfNeeded() {
149
- const state = this.getState()
150
- let shouldTranslateThumb = false
151
- if (this.offsetY != null && (this.offsetY < 0 || this.offsetY > state.scrollableHeight)) {
152
- const clampedOffsetY = Math.max(0, Math.min(this.offsetY, state.scrollableHeight))
153
- this.offsetY = clampedOffsetY
154
- shouldTranslateThumb = true
155
- }
156
- if (this.offsetX != null && (this.offsetX < 0 || this.offsetX > state.scrollableWidth)) {
157
- const clampedOffsetX = Math.max(0, Math.min(this.offsetX, state.scrollableWidth))
158
- this.offsetX = clampedOffsetX
159
- shouldTranslateThumb = true
160
- }
161
- if (shouldTranslateThumb) {
162
- const state2 = this.getState()
163
- this.translateThumbX(state2.thumbOffsetX)
164
- this.translateThumbY(state2.thumbOffsetY)
165
- }
166
- },
167
- setScrollOffsetX(x) {
168
- const state = this.getState()
169
- const clampedOffsetX = Math.max(0, Math.min(x, state.scrollableWidth))
170
- this.offsetX = clampedOffsetX
171
-
172
- const state2 = this.getState()
173
- this.translateThumbX(state2.thumbOffsetX)
174
- },
175
- ease(currentScroll, distance) {
176
- // 最大距离
177
- const maxScrollY = this.state.tableHeight - this.viewportHeight + this.loadMoreHeight
178
- let damping = 1
179
- // 剩余距离
180
- const remainingDistance = maxScrollY - currentScroll
181
- damping = remainingDistance / maxScrollY
182
-
183
- let newDistance = distance * damping * 10
184
-
185
- return newDistance
186
- },
187
- setScrollOffsetY(y) {
188
- const state = this.getState()
189
- let scrollableHeight = state.scrollableHeight
190
- // 如果开启了上拉加载更多,这里最大滚动高度加上上拉加载更多的高度
191
- if (this.enableLoadMore) {
192
- const loadMoreHeight = this.loadMoreHeight || 0
193
- // const dyc = (this.isHasOffsetY && this.isLoadFinished) ? 0 : loadMoreHeight
194
- const dyc = loadMoreHeight
195
- // 表格条数加上加载更多的距离够才需要加可滚动距离
196
- if ((state.tableHeight + dyc) > this.viewportHeight) {
197
- scrollableHeight += dyc
198
- }
199
- }
200
- const clampedOffsetY = Math.max(0, Math.min(y, scrollableHeight))
201
- this.offsetY = clampedOffsetY
202
- const state2 = this.getState()
203
- this.translateThumbY(state2.thumbOffsetY)
204
- },
205
- emitScroll() {
206
- // const renderViewportCellsColumns = [...this.renderCellsColumns.filter(col => col.fixed), ...this.renderCellsColumns.slice(this.state.startCell, this.state.endCell + 1)]
207
- const params = {
208
- direction: this.scrollDirection,
209
- scrollLeft: this.offsetX,
210
- scrollTop: this.offsetY,
211
- startRow: this.state.startRow,
212
- endRow: this.state.endRow,
213
- startCell: this.state.startCell,
214
- endCell: this.state.endCell,
215
- rowsPerViewport: this.state.rowsPerViewport,
216
- viewportEndRowIndex: this.getViewportEndRowIndex(),
217
- // renderViewportCellsColumns
218
- }
219
- this.$emit('scroll', params)
220
- if (this.isScrollShowTotal) {
221
- this.showTotalView()
222
- }
223
- },
224
- scrollBy(x, y) {
225
- // console.log(x, y, 'scrollBy')
226
-
227
- let renderRows = false
228
- let renderCells = false
229
-
230
- // 仅处理垂直滚动
231
- if (y != null && y !== 0) {
232
- if (!this.$props.scrollY && this.scrollDirection === 'Y' && !this.isShowHorizontal) {
233
- return
234
- }
235
- if (this.offsetY + y > (this.state.tableHeight - this.viewportHeight + 100)) {
236
- y = this.ease(this.offsetY + y, y)
237
- }
238
- this.setScrollOffsetY(this.offsetY + y)
239
- renderRows = true
240
- }
241
- // 仅处理水平滚动
242
- if (x != null && x !== 0) {
243
- if (!this.$props.scrollX && this.scrollDirection === 'X') {
244
- return
245
- }
246
- this.setScrollOffsetX(this.offsetX + x)
247
- renderCells = true
248
- }
249
-
250
- // 根据滚动方向渲染对应的部分
251
- if (renderRows) {
252
- this.renderViewportRows()
253
- }
254
- if (renderCells) {
255
- this.renderViewportCells()
256
- }
257
-
258
- this.emitScroll()
259
- },
260
- getViewportEndRowIndex() {
261
- if (this.state.endRow === this.tableData.length) {
262
- return this.state.endRow
263
- }
264
- return this.state.endRow - Math.floor(this.headerTotalHeight / this.$props.rowHeight)
265
- },
266
- onContainerWheel(e) {
267
- e.preventDefault()
268
- e.stopPropagation()
269
-
270
- let deltaY = e.deltaY
271
- let deltaX = e.deltaX
272
- if (Math.abs(deltaY) > 30 && Math.abs(deltaX) < 15) {
273
- deltaX = 0
274
- } else if (Math.abs(deltaX) > 30 && Math.abs(deltaY) < 15) {
275
- deltaY = 0
276
- }
277
-
278
- // 判断滚动方向
279
- const isHorizontal = Math.abs(deltaX) > Math.abs(deltaY) // 水平滚动
280
- const isVertical = Math.abs(deltaY) > Math.abs(deltaX) // 垂直滚动
281
-
282
- // 如果是水平滚动,则忽略垂直滚动
283
- if (isHorizontal) {
284
- this.scrollDirection = 'X'
285
- deltaY = 0
286
- }
287
- // 如果是垂直滚动,则忽略水平滚动
288
- if (isVertical) {
289
- this.scrollDirection = 'Y'
290
- deltaX = 0
291
- }
292
-
293
- this.transientScrollOffsetX += deltaX
294
- this.transientScrollOffsetY += deltaY
295
- if (this.isScrolling) {
296
- return
297
- }
298
-
299
- this.isScrolling = true
300
- window.requestAnimationFrame(() => {
301
- const scrollX = this.transientScrollOffsetX !== 0 ? this.transientScrollOffsetX : undefined
302
- const scrollY = this.transientScrollOffsetY !== 0 ? this.transientScrollOffsetY : undefined
303
- this.scrollBy(scrollX, scrollY)
304
- this.isScrolling = false
305
- this.transientScrollOffsetX = 0
306
- this.transientScrollOffsetY = 0
307
- })
308
- },
309
- onThumbMouseDownY(e) {
310
- e.preventDefault()
311
- e.stopPropagation()
312
- document.body.style.setProperty('cursor', 'grabbing', 'important')
313
- document.addEventListener('mousemove', this.onThumbDragY)
314
- document.addEventListener('mouseup', this.onThumbMouseUpY)
315
- },
316
- onThumbDragY(e) {
317
- e.preventDefault()
318
- e.stopPropagation()
319
- const state = this.getState()
320
-
321
- // 仅处理垂直滚动
322
- this.transientScrollOffsetY += (e.movementY / this.viewportHeight) * state.tableHeight
323
- if (this.isScrolling) {
324
- return
325
- }
326
-
327
- this.isScrolling = true
328
- window.requestAnimationFrame(() => {
329
- this.scrollBy(undefined, this.transientScrollOffsetY) // 仅滚动垂直方向
330
- this.isScrolling = false
331
- this.transientScrollOffsetY = 0
332
- })
333
- },
334
- onThumbMouseUpY() {
335
- document.body.style.removeProperty('cursor')
336
- document.removeEventListener('mousemove', this.onThumbDragY)
337
- document.removeEventListener('mouseup', this.onThumbMouseUpY)
338
- this.isScrolling = false
339
- if (this.transientScrollOffsetY > 0) {
340
- this.scrollBy(undefined, this.transientScrollOffsetY)
341
- }
342
- this.transientScrollOffsetY = 0
343
- },
344
- onThumbMouseDownX(e) {
345
- e.preventDefault()
346
- e.stopPropagation()
347
- document.body.style.setProperty('cursor', 'grabbing', 'important')
348
- document.addEventListener('mousemove', this.onThumbDragX)
349
- document.addEventListener('mouseup', this.onThumbMouseUpX)
350
- },
351
- onThumbDragX(e) {
352
- e.stopPropagation()
353
- e.preventDefault()
354
- const state = this.getState()
355
- // 仅处理垂直滚动
356
- this.transientScrollOffsetX += (e.movementX / this.viewportWidth) * state.tableWidth
357
- if (this.isScrolling) {
358
- return
359
- }
360
-
361
- this.isScrolling = true
362
- window.requestAnimationFrame(() => {
363
- this.scrollBy(this.transientScrollOffsetX, undefined) // 仅滚动水平方向
364
- this.isScrolling = false
365
- this.transientScrollOffsetX = 0
366
- })
367
- },
368
- onThumbMouseUpX() {
369
- document.body.style.removeProperty('cursor')
370
- document.removeEventListener('mousemove', this.onThumbDragX)
371
- document.removeEventListener('mouseup', this.onThumbMouseUpX)
372
- this.isScrolling = false
373
- if (this.transientScrollOffsetX > 0) {
374
- this.scrollBy(this.transientScrollOffsetX, undefined)
375
- }
376
- this.transientScrollOffsetX = 0
377
- },
378
- onTrackMouseMoveY(e) {
379
- e.preventDefault()
380
- },
381
- onTrackMouseMoveX(e) {
382
- e.preventDefault()
383
- },
384
- // 滚动到指定的top值
385
- scrollToTop(scrollTop = 0) {
386
- const state = this.getState()
387
- const relativeOffset = (scrollTop / this.viewportHeight) * state.tableHeight
388
- this.setScrollOffsetY(relativeOffset)
389
- this.renderViewportRows()
390
- },
391
- onTrackMouseDownY(e) {
392
- e.preventDefault()
393
- this.scrollToTop(e.offsetY - this.headerTotalHeight) // 仅滚动垂直方向
394
- },
395
- onTrackMouseDownX(e) {
396
- e.preventDefault()
397
- this.scrollToLeft(e.offsetX, false) // 仅滚动水平方向
398
- },
399
- // 滚动到指定的left值
400
- scrollToLeft(scrollLeft = 0, createHeader = true) {
401
- const state = this.getState()
402
- const relativeOffset = (scrollLeft / this.viewportWidth) * state.tableWidth
403
- createHeader && this.createHeader()
404
- this.setScrollOffsetX(relativeOffset)
405
- this.renderViewportCells()
406
- },
407
- translateThumbY(offset) {
408
- this.$refs.thumbY.style.transform = `translateY(${offset + this.headerTotalHeight}px)`
409
- },
410
- translateThumbX(offset) {
411
- if (this.$refs.thumbX) {
412
- this.$refs.thumbX.style.transform = `translateX(${offset}px)`
413
- }
414
- },
415
- setThumbSizeY(height) {
416
- // const _height = height < 0 ? 60 : height
417
- // TODO 数据超出太多时,此时的滑块高度为负数,需要处理极致情况。
418
- this.$refs.thumbY.style.height = `${height}px`
419
- },
420
- setThumbSizeX(width) {
421
- this.$refs.thumbX.style.width = `${width}px`
422
- },
423
- },
424
- }
@@ -1,112 +0,0 @@
1
- /**
2
- * 获取元素的 transform 属性值
3
- * @param {HTMLElement} element - 需要获取 transform 的元素
4
- * @param {*} element
5
- * @returns
6
- */
7
- function getMatrixTransform (element) {
8
- const computedStyle = window.getComputedStyle(element)
9
- const transformValue = computedStyle.transform
10
-
11
- if (transformValue && transformValue!== 'none') {
12
- const matrix = new DOMMatrix(transformValue)
13
- return matrix.m42
14
- }
15
- return 0
16
- }
17
-
18
- export default {
19
- computed: {
20
- useStretchFeature() {
21
- return this.$props.stretchEnabled && !!this.$props.scrollY && this.isHasOffsetY
22
- },
23
- },
24
- data() {
25
- return {
26
- // 是否正在拖动
27
- isDragging: false,
28
- // 记录手指开始触摸时的Y坐标
29
- startY: 0,
30
- startTime: 0,
31
- // 当前的translateY值
32
- currentTranslateY: 0,
33
- maxTranslateY: 120,
34
- isMoving: false
35
- }
36
- },
37
- methods: {
38
- /**
39
- * 触摸开始事件处理
40
- * @param {*} event
41
- */
42
- containerHandleTouchStart(event) {
43
- if (!this.useStretchFeature) return
44
- // const touch = event.changedTouches[0]
45
- this.startY = event.touches[0].clientY
46
- this.startTime = Date.now()
47
- this.isMoving = true
48
- },
49
- /**
50
- * 仅 y 轴滚动执行
51
- * @param {*} event
52
- */
53
- containerHandleTouchMove(event) {
54
- if (!this.useStretchFeature || !this.isMoving) return
55
-
56
- // const touch = event.changedTouches[0]
57
- const currentY = event.touches[0].clientY
58
- const distance = this.startY - currentY
59
-
60
- // 滚动到底部执行(滚动偏移量 = 表格高度 - 可视口高度)
61
- if (this.offsetY === (this.state.tableHeight - this.viewportHeight) && distance > 0) {
62
-
63
- const currentTime = Date.now()
64
- const duration = currentTime - this.startTime
65
-
66
- // 计算速度(距离差/时间差)
67
- const speed = distance / duration
68
-
69
- // 计算阻尼系数,越接近最大偏移距离阻尼越大
70
- let damping = 1
71
- const container = this.$refs.container
72
- const currentTranslateY = getMatrixTransform(container)
73
- const remainingDistance = this.maxTranslateY - currentTranslateY
74
- damping = remainingDistance / this.maxTranslateY
75
-
76
- // 计算新的 translateY
77
- let newTranslateY = currentTranslateY + (distance * speed * damping)
78
- newTranslateY = Math.min(newTranslateY, this.maxTranslateY)
79
- newTranslateY = Math.max(newTranslateY, 0)
80
-
81
- container.style.transform = `translateY(${-newTranslateY}px)`
82
- container.style.transition = 'transform 0.2s ease'
83
- } else {
84
- // 如果没有到达底部,重置 translateY
85
- this.resetStretch()
86
- }
87
- },
88
- /**
89
- * 松开手势时 清空动画数据
90
- * @param {*} event
91
- */
92
- containerHandleTouchEnd(event) {
93
-
94
- if (!this.useStretchFeature) return
95
-
96
- this.resetStretch()
97
- },
98
- /**
99
- * 重置各种参数
100
- */
101
- resetStretch () {
102
-
103
- this.isMoving = false
104
- this.startY = 0
105
- this.startTime = 0
106
-
107
- const container = this.$refs.container
108
- container.style.transform = 'translateY(0px)'
109
- container.style.transition = 'transform 0.3s ease'
110
- }
111
- },
112
- }
@@ -1,89 +0,0 @@
1
- .pe-table-cell {
2
- position: absolute;
3
- left: 0;
4
- display: flex;
5
- align-items: center;
6
- box-sizing: border-box;
7
- font-size: 13PX;
8
- padding: 0 8PX;
9
- height: 100%;
10
- overflow: hidden;
11
- background-color: transparent;
12
- // transform: translateZ(0);
13
- // will-change: transform; 单元格会发生偏移
14
- }
15
- .ks-multi-screen .pe-table-cell {
16
- font-size: 14PX !important;
17
- }
18
- .pe-table-cell::after {
19
- content: '';
20
- position: absolute;
21
- bottom: 0;
22
- left: 0;
23
- width: 100%;
24
- height: 1px;
25
- background-color: #F1F1F1;
26
- transform-origin: bottom;
27
- transform: scaleY(0.5);
28
- }
29
-
30
- .pe-table-cell.overflow span {
31
- overflow: hidden;
32
- white-space: nowrap;
33
- text-overflow: ellipsis;
34
- }
35
- .pe-table-cell_label {
36
- width: 100%;
37
- }
38
- .pe-table-cell.right .pe-table-cell_label {
39
- text-align: right;
40
- }
41
- .pe-table-cell.left .pe-table-cell_label {
42
- text-align: left;
43
- }
44
- .pe-table-cell.center .pe-table-cell_label {
45
- text-align: center;
46
- }
47
-
48
- .pe-table-cell.collapse-bg {
49
- // background: rgba(21, 88, 202, 0.04);
50
- background-color: #F8FAFD;
51
- }
52
-
53
- .pe-table-scrolling__x {
54
- .pe-table-cell__last-fixed {
55
- // border-right: none;
56
- box-shadow: 4px 0 6px -4px rgba(28, 32, 35, 0.1);
57
- // background-color: #fff;
58
- }
59
- .pe-table-cell__fixed {
60
- background-color: #fff;
61
- }
62
- }
63
-
64
- .pe-table-header_cell[data-cellkey="$index"] {
65
- padding-right: 4PX;
66
- white-space: nowrap;
67
- }
68
- .pe-table-cell[data-cellkey="$index"] {
69
- padding-right: 4PX;
70
- white-space: nowrap;
71
- font-size: 12PX;
72
- }
73
- .ks-multi-screen {
74
- .pe-table-cell[data-cellkey="$index"] {
75
- font-size: 13PX;
76
- }
77
- }
78
- .pe-table-show-index {
79
- .pe-table-cell[data-cellkey="name"] {
80
- padding-left: 0;
81
- padding-right: 2PX;
82
- .collect-icon-area {
83
- margin-left: -12PX;
84
- .collect-icon-wrap {
85
- padding-left: 8PX;
86
- }
87
- }
88
- }
89
- }
@@ -1,48 +0,0 @@
1
- .pe-table-empty {
2
- display: flex;
3
- width: 100PX;
4
- // height: 118PX;
5
- flex-direction: column;
6
- justify-content: center;
7
- align-items: center;
8
- position: absolute;
9
- // top: 40PX;
10
- left: 50%;
11
- transform: translateX(-50%)
12
- }
13
- .pe-table-empty_label {
14
- margin-top: 12PX;
15
- color: #888B92;
16
- font-size: 13PX;
17
- line-height: 1;
18
- }
19
- .pe-table-empty_bg {
20
- width: 100PX;
21
- height: 80PX;
22
- background: url('../images/empty.png');
23
- background-size: contain;
24
- }
25
- .abnormal {
26
- width: 130PX;
27
- display: flex;
28
- flex-direction: column;
29
- align-items: center;
30
- .abnormal-img {
31
- width: 108PX;
32
- height: 69PX;
33
- margin-bottom: 10PX;
34
- font-size: 0;
35
- background: url('../images/abnormal.png');
36
- background-size: 108PX 69PX;
37
- background-repeat: no-repeat;
38
- }
39
- .abnormal-desc {
40
- margin-bottom: 8PX;
41
- font-size: 12PX;
42
- font-weight: normal;
43
- line-height: 18PX;
44
- text-align: center;
45
- letter-spacing: 0em;
46
- color: #888B92;
47
- }
48
- }