@kyfe/ks-query-table 0.0.7 → 0.0.9

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 (318) hide show
  1. package/.bitmap +38 -0
  2. package/.editorconfig +5 -0
  3. package/.env.dev +2 -0
  4. package/.env.gray +2 -0
  5. package/.env.prod +2 -0
  6. package/.env.stg +3 -0
  7. package/.env.uat +2 -0
  8. package/.eslintignore +1 -0
  9. package/.eslintrc.js +25 -0
  10. package/.gitmodules +4 -0
  11. package/.prettierrc +11 -0
  12. package/README.md +6 -0
  13. package/babel.config.js +10 -0
  14. package/build-apm.sh +9 -0
  15. package/build.sh +16 -0
  16. package/config/index.js +20 -0
  17. package/jsconfig.json +7 -0
  18. package/kuasheng-sdk/index.js +80 -0
  19. package/kuasheng-sdk/lib/assets.js +304 -0
  20. package/kuasheng-sdk/lib/context.js +199 -0
  21. package/kuasheng-sdk/lib/layout.js +346 -0
  22. package/kuasheng-sdk/lib/location.js +46 -0
  23. package/kuasheng-sdk/lib/media.js +342 -0
  24. package/kuasheng-sdk/lib/navigation.js +30 -0
  25. package/kuasheng-sdk/lib/request.js +76 -0
  26. package/kuasheng-sdk/lib/system.js +190 -0
  27. package/kuasheng-sdk/lib/userinfo.js +98 -0
  28. package/kuasheng-sdk/util/check.js +102 -0
  29. package/kuasheng-sdk/util/config.js +47 -0
  30. package/kuasheng-sdk/util/device.js +25 -0
  31. package/kuasheng-sdk/util/error.js +19 -0
  32. package/kuasheng-sdk/util/funtional.js +153 -0
  33. package/kuasheng-sdk/util/mixin.js +36 -0
  34. package/kuasheng-sdk/util/requestUtil.js +41 -0
  35. package/kuasheng-sdk/util/response.js +33 -0
  36. package/kuasheng-sdk/util/warn.js +35 -0
  37. package/kuasheng-ui/CHANGELOG.md +9 -0
  38. package/kuasheng-ui/components/card.vue +57 -0
  39. package/kuasheng-ui/components/ks-area-select/README.md +43 -0
  40. package/kuasheng-ui/components/ks-area-select/area-picker.vue +554 -0
  41. package/kuasheng-ui/components/ks-area-select/area-search.vue +363 -0
  42. package/kuasheng-ui/components/ks-area-select/areas-pop.vue +56 -0
  43. package/kuasheng-ui/components/ks-area-select/common.js +183 -0
  44. package/kuasheng-ui/components/ks-area-select/index.vue +355 -0
  45. package/kuasheng-ui/components/ks-area-select/mixins.js +216 -0
  46. package/kuasheng-ui/components/ks-area-single-select/README.md +50 -0
  47. package/kuasheng-ui/components/ks-area-single-select/hot-city.js +45 -0
  48. package/kuasheng-ui/components/ks-area-single-select/index.vue +324 -0
  49. package/kuasheng-ui/components/ks-calendar/index.vue +269 -0
  50. package/kuasheng-ui/components/ks-call-phone/call-tips.vue +70 -0
  51. package/kuasheng-ui/components/ks-call-phone/call.vue +178 -0
  52. package/kuasheng-ui/components/ks-call-phone/index.js +48 -0
  53. package/kuasheng-ui/components/ks-call-phone/index.vue +131 -0
  54. package/kuasheng-ui/components/ks-call-phone//345/221/274/345/217/253/347/273/204/344/273/266.md +0 -0
  55. package/kuasheng-ui/components/ks-date-picker/README.md +23 -0
  56. package/kuasheng-ui/components/ks-date-picker/date-picker-bottom.vue +123 -0
  57. package/kuasheng-ui/components/ks-date-picker/date-picker-dropdown.vue +80 -0
  58. package/kuasheng-ui/components/ks-date-picker/date-picker-right.vue +87 -0
  59. package/kuasheng-ui/components/ks-date-picker/date-picker-top.vue +88 -0
  60. package/kuasheng-ui/components/ks-date-picker/date-picker.js +15 -0
  61. package/kuasheng-ui/components/ks-date-picker/date-range-select.vue +92 -0
  62. package/kuasheng-ui/components/ks-date-picker/date-select.vue +65 -0
  63. package/kuasheng-ui/components/ks-date-picker/date-week-month.vue +131 -0
  64. package/kuasheng-ui/components/ks-date-picker/index.js +12 -0
  65. package/kuasheng-ui/components/ks-date-picker/mixin.js +92 -0
  66. package/kuasheng-ui/components/ks-date-picker/month-range-select.vue +129 -0
  67. package/kuasheng-ui/components/ks-date-picker/month-select.vue +85 -0
  68. package/kuasheng-ui/components/ks-date-picker/quarter-select.vue +94 -0
  69. package/kuasheng-ui/components/ks-date-picker/style.less +121 -0
  70. package/kuasheng-ui/components/ks-date-picker/utils.js +109 -0
  71. package/kuasheng-ui/components/ks-date-picker/week-select.vue +99 -0
  72. package/kuasheng-ui/components/ks-decrypt/index.vue +159 -0
  73. package/kuasheng-ui/components/ks-employee/README.md +78 -0
  74. package/kuasheng-ui/components/ks-employee/employee-input.vue +173 -0
  75. package/kuasheng-ui/components/ks-employee/employee-list.vue +662 -0
  76. package/kuasheng-ui/components/ks-employee/employee-popup.vue +197 -0
  77. package/kuasheng-ui/components/ks-employee/employee-search.vue +250 -0
  78. package/kuasheng-ui/components/ks-employee/employee-selected.vue +173 -0
  79. package/kuasheng-ui/components/ks-employee/index.js +17 -0
  80. package/kuasheng-ui/components/ks-employee/package-lock.json +5 -0
  81. package/kuasheng-ui/components/ks-employee/package.json +15 -0
  82. package/kuasheng-ui/components/ks-employee/yarn.lock +4 -0
  83. package/kuasheng-ui/components/ks-field-money/index.js +8 -0
  84. package/kuasheng-ui/components/ks-field-money/index.vue +212 -0
  85. package/kuasheng-ui/components/ks-field-money/package.json +11 -0
  86. package/kuasheng-ui/components/ks-field-money/utils.js +65 -0
  87. 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
  88. package/kuasheng-ui/components/ks-history-search/history-input.vue +131 -0
  89. package/kuasheng-ui/components/ks-history-search/history-list.vue +188 -0
  90. package/kuasheng-ui/components/ks-history-search/img/delete.png +0 -0
  91. package/kuasheng-ui/components/ks-history-search/index.js +9 -0
  92. package/kuasheng-ui/components/ks-history-search/index.vue +125 -0
  93. package/kuasheng-ui/components/ks-history-search/package-lock.json +5 -0
  94. package/kuasheng-ui/components/ks-history-search/package.json +15 -0
  95. package/kuasheng-ui/components/ks-history-search/utils.js +35 -0
  96. package/kuasheng-ui/components/ks-input-search/index.vue +106 -0
  97. package/kuasheng-ui/components/ks-list/index.vue +75 -0
  98. package/kuasheng-ui/components/ks-loading/index.js +16 -0
  99. package/kuasheng-ui/components/ks-month/index.vue +47 -0
  100. package/kuasheng-ui/components/ks-month/package.json +3 -0
  101. package/kuasheng-ui/components/ks-month/range.vue +172 -0
  102. package/kuasheng-ui/components/ks-month/single.vue +136 -0
  103. package/kuasheng-ui/components/ks-month/style.less +125 -0
  104. package/kuasheng-ui/components/ks-month/utils.js +35 -0
  105. package/kuasheng-ui/components/ks-nav/index.vue +264 -0
  106. package/kuasheng-ui/components/ks-nav-bar.js +35 -0
  107. package/kuasheng-ui/components/ks-org/ks-org-tree.vue +247 -0
  108. package/kuasheng-ui/components/ks-org/ks-popup-tree.vue +154 -0
  109. package/kuasheng-ui/components/ks-org/ks-tree-input.vue +240 -0
  110. package/kuasheng-ui/components/ks-org/ks-tree-node.vue +94 -0
  111. package/kuasheng-ui/components/ks-org/ks-tree.vue +229 -0
  112. package/kuasheng-ui/components/ks-org/utils.js +54 -0
  113. package/kuasheng-ui/components/ks-popover/index.vue +457 -0
  114. package/kuasheng-ui/components/ks-popover/mixin.js +28 -0
  115. package/kuasheng-ui/components/ks-popover/utils.js +60 -0
  116. package/kuasheng-ui/components/ks-pull-refresh/index.vue +43 -0
  117. package/kuasheng-ui/components/ks-quarter/index.vue +256 -0
  118. package/kuasheng-ui/components/ks-table/README.md +103 -0
  119. package/kuasheng-ui/components/ks-table/cell.vue +31 -0
  120. package/kuasheng-ui/components/ks-table/index.js +8 -0
  121. package/kuasheng-ui/components/ks-table/index.less +486 -0
  122. package/kuasheng-ui/components/ks-table/index.vue +1088 -0
  123. package/kuasheng-ui/components/ks-table/package.json +12 -0
  124. package/kuasheng-ui/components/ks-table/release.md +7 -0
  125. package/kuasheng-ui/components/ks-toast.js +35 -0
  126. package/kuasheng-ui/components/ks-upload/index.vue +174 -0
  127. package/kuasheng-ui/components/ks-user-access.vue +229 -0
  128. package/kuasheng-ui/components/no-data/README.md +45 -0
  129. package/kuasheng-ui/components/no-data/image.js +1 -0
  130. package/kuasheng-ui/components/no-data/index.vue +83 -0
  131. package/kuasheng-ui/components/notice-bar.vue +16 -0
  132. package/kuasheng-ui/components/steps.js +11 -0
  133. package/kuasheng-ui/components/tabs.vue +40 -0
  134. package/kuasheng-ui/index.js +239 -0
  135. package/kuasheng-ui/patch/datetime-picker/datetimePicker.md +0 -0
  136. package/kuasheng-ui/patch/datetime-picker/index.js +46 -0
  137. package/kuasheng-ui/patch/datetime-picker/utils.js +78 -0
  138. package/kuasheng-ui/patch/field/field.md +1 -0
  139. package/kuasheng-ui/patch/field/index.js +122 -0
  140. package/kuasheng-ui/patch/field/utils.js +36 -0
  141. package/kuasheng-ui/patch/form/form.md +7 -0
  142. package/kuasheng-ui/patch/form/index.js +106 -0
  143. package/kuasheng-ui/patch/index.js +12 -0
  144. package/kuasheng-ui/patch/pagination/index.js +78 -0
  145. package/kuasheng-ui/style/animation-ui.less +31 -0
  146. package/kuasheng-ui/style/font/number/font-number1.otf +0 -0
  147. package/kuasheng-ui/style/font/number/font-number2.ttf +0 -0
  148. package/kuasheng-ui/style/images/checked.svg +1 -0
  149. package/kuasheng-ui/style/images/success.svg +1 -0
  150. package/kuasheng-ui/style/index.less +6 -0
  151. package/kuasheng-ui/style/kuasheng-ui.less +207 -0
  152. package/kuasheng-ui/style/reset-vant.less +307 -0
  153. package/kuasheng-ui/style/vant-var.less +138 -0
  154. package/kuasheng-ui/utils/apis.js +17 -0
  155. package/kuasheng-ui/utils/axios-adapter.js +47 -0
  156. package/kuasheng-ui/utils/bem.js +39 -0
  157. package/kuasheng-ui/utils/bus.js +97 -0
  158. package/kuasheng-ui/utils/common.js +88 -0
  159. package/kuasheng-ui/utils/decrypt/config.js +12 -0
  160. package/kuasheng-ui/utils/decrypt/decrypt-api.js +139 -0
  161. package/kuasheng-ui/utils/decrypt/index.js +6 -0
  162. package/kuasheng-ui/utils/decrypt/mask.js +36 -0
  163. package/kuasheng-ui/utils/decrypt/virtual.js +44 -0
  164. package/kuasheng-ui/utils/directive.js +57 -0
  165. package/kuasheng-ui/utils/directive.md +23 -0
  166. package/kuasheng-ui/utils/drcheck-plugin.js +219 -0
  167. package/kuasheng-ui/utils/error-plugin.js +88 -0
  168. package/kuasheng-ui/utils/filter.js +149 -0
  169. package/kuasheng-ui/utils/http-interceptors.js +18 -0
  170. package/kuasheng-ui/utils/http.js +140 -0
  171. package/kuasheng-ui/utils/index.js +5 -0
  172. package/kuasheng-ui/utils/init-event.js +20 -0
  173. package/kuasheng-ui/utils/log.js +309 -0
  174. package/kuasheng-ui/utils/token.js +9 -0
  175. package/kuasheng-ui/utils/type.js +45 -0
  176. package/kuasheng-ui/utils/validate.js +20 -0
  177. package/kuasheng-ui/utils/watermark.js +67 -0
  178. package/kuasheng-ui/version.js +1 -0
  179. package/ky-apm/client.js +37 -0
  180. package/ky-apm/customHttp.js +38 -0
  181. package/ky-apm/index.js +68 -0
  182. package/ky-apm/plugins/performance.js +84 -0
  183. package/ky-apm/plugins/self-error.js +26 -0
  184. package/ky-apm/warn-log.js +3 -0
  185. package/package.json +81 -10
  186. package/plugin/ks-chii-webpack-html/index.js +53 -0
  187. package/plugin/ks-chii-webpack-html/package.json +16 -0
  188. package/postcss.config.js +15 -0
  189. package/public/capsule-positon.js +50 -0
  190. package/public/fonts/DingTalkJinBuTi.ttf +0 -0
  191. package/public/framework/axios@0.19.0.min.js +9 -0
  192. package/public/framework/fastclick@1.0.6.min.js +1 -0
  193. package/public/framework/iconfont/iconfont.css +91 -0
  194. package/public/framework/iconfont/iconfont.js +1 -0
  195. package/public/framework/iconfont/iconfont.json +142 -0
  196. package/public/framework/iconfont/iconfont.ttf +0 -0
  197. package/public/framework/iconfont/iconfont.woff +0 -0
  198. package/public/framework/iconfont/iconfont.woff2 +0 -0
  199. package/public/framework/vant@2.5.6.min.js +7 -0
  200. package/public/framework/vue-router@3.1.3.min.js +6 -0
  201. package/public/framework/vue@2.6.10.runtime.min.js +6 -0
  202. package/public/framework/vuex@3.1.1.min.js +6 -0
  203. package/public/index.html +260 -0
  204. package/public/ks@3.0.8.umd.min.js +1 -0
  205. package/public/ksui@4.0.27.umd.min.js +10 -0
  206. package/public/status-bar-preset.js +39 -0
  207. package/{index.js → qt-npm/ks-query-table.common.js} +10 -6
  208. package/qt-npm/ks-query-table.common.js.map +1 -0
  209. package/{ks-query-table.umd.js → qt-npm/ks-query-table.umd.js} +10 -6
  210. package/qt-npm/ks-query-table.umd.js.map +1 -0
  211. package/{ks-query-table.umd.min.js → qt-npm/ks-query-table.umd.min.js} +2 -2
  212. package/qt-npm/ks-query-table.umd.min.js.map +1 -0
  213. package/qt-npm/package.json +13 -0
  214. package/src/App.vue +204 -0
  215. package/src/common/README.md +94 -0
  216. package/src/common/http/axios-adapter.js +47 -0
  217. package/src/common/http/common.js +88 -0
  218. package/src/common/http/http-interceptors.js +18 -0
  219. package/src/common/http/http-lock.js +45 -0
  220. package/src/common/http/index.js +163 -0
  221. package/src/common/http/token.js +9 -0
  222. package/src/common/styles/font/AlibabaSans102Ver2-Md.ttf +0 -0
  223. package/src/common/styles/font.less +12 -0
  224. package/src/common/styles/variables.less +43 -0
  225. package/src/common/utils/index.js +1 -0
  226. package/src/common/utils/platform/README.md +1 -0
  227. package/src/common/utils/platform/android/.gitkeep +0 -0
  228. package/src/common/utils/platform/core/index.js +24 -0
  229. package/src/common/utils/platform/index.js +164 -0
  230. package/src/common/utils/platform/ios/.gitkeep +0 -0
  231. package/src/common/utils/platform/subscribe/helper.js +38 -0
  232. package/src/common/utils/platform/subscribe/index.js +204 -0
  233. package/src/common/utils/platform/subscribe/table-animation.js +75 -0
  234. package/src/config/index.js +31 -0
  235. package/src/config.js +1 -0
  236. package/src/main.js +73 -0
  237. package/src/router.js +52 -0
  238. package/src/view/home/config.js +101 -0
  239. package/src/view/home/demo1.vue +223 -0
  240. package/src/view/home/demo2.vue +124 -0
  241. package/src/view/home/demo3.vue +51 -0
  242. package/src/view/home/demo4.vue +139 -0
  243. package/src/view/home/index.vue +97 -0
  244. package/src/view/home/query-table/README.md +45 -0
  245. package/src/view/home/query-table/api/index.js +12 -0
  246. package/src/view/home/query-table/assets/horizontal-back.svg +1 -0
  247. package/src/view/home/query-table/components/pe-table/cell.js +184 -0
  248. package/src/view/home/query-table/components/pe-table/collapse.js +334 -0
  249. package/src/view/home/query-table/components/pe-table/empty.vue +48 -0
  250. package/src/view/home/query-table/components/pe-table/header.js +328 -0
  251. package/src/view/home/query-table/components/pe-table/images/abnormal.png +0 -0
  252. package/src/view/home/query-table/components/pe-table/images/empty.png +0 -0
  253. package/src/view/home/query-table/components/pe-table/images/fold.svg +1 -0
  254. package/src/view/home/query-table/components/pe-table/images/sort.svg +1 -0
  255. package/src/view/home/query-table/components/pe-table/images/sorting.svg +1 -0
  256. package/src/view/home/query-table/components/pe-table/images/unfold.svg +1 -0
  257. package/src/view/home/query-table/components/pe-table/index.vue +841 -0
  258. package/src/view/home/query-table/components/pe-table/load-more.js +46 -0
  259. package/src/view/home/query-table/components/pe-table/props/index.js +193 -0
  260. package/src/view/home/query-table/components/pe-table/row.vue +118 -0
  261. package/src/view/home/query-table/components/pe-table/scrollbar.js +424 -0
  262. package/src/view/home/query-table/components/pe-table/stretch-damping.js +112 -0
  263. package/src/view/home/query-table/components/pe-table/style/cell.less +89 -0
  264. package/src/view/home/query-table/components/pe-table/style/empty.less +48 -0
  265. package/src/view/home/query-table/components/pe-table/style/header.less +141 -0
  266. package/src/view/home/query-table/components/pe-table/style/index.less +88 -0
  267. package/src/view/home/query-table/components/pe-table/style/load-more.less +61 -0
  268. package/src/view/home/query-table/components/pe-table/style/row.less +6 -0
  269. package/src/view/home/query-table/components/pe-table/table-loading.vue +119 -0
  270. package/src/view/home/query-table/components/pe-table/table-total.vue +53 -0
  271. package/src/view/home/query-table/components/pe-table/utils/animate.js +80 -0
  272. package/src/view/home/query-table/components/pe-table/utils/columns.js +290 -0
  273. package/src/view/home/query-table/components/pe-table/utils/data.js +12 -0
  274. package/src/view/home/query-table/components/pe-table/utils/fixed.js +69 -0
  275. package/src/view/home/query-table/components/pe-table/utils/formatter.js +327 -0
  276. package/src/view/home/query-table/components/pe-table/utils/render-cells.js +424 -0
  277. package/src/view/home/query-table/components/pe-table/utils/slot.js +28 -0
  278. package/src/view/home/query-table/components/pe-table/utils/tools.js +84 -0
  279. package/src/view/home/query-table/components/pe-table/utils/touch-scroll.js +417 -0
  280. package/src/view/home/query-table/components/query-table/index.vue +496 -0
  281. package/src/view/home/query-table/components/query-table/mixins/column-mixin.js +102 -0
  282. package/src/view/home/query-table/components/query-table/mixins/column-setting.js +143 -0
  283. package/src/view/home/query-table/components/query-table/mixins/data-mixin.js +511 -0
  284. package/src/view/home/query-table/components/query-table/mixins/pagination-mixin.js +26 -0
  285. package/src/view/home/query-table/components/query-table/mixins/table-fixed.js +115 -0
  286. package/src/view/home/query-table/components/query-table/mixins/table-horizontal.js +118 -0
  287. package/src/view/home/query-table/components/table-horizontal.vue +99 -0
  288. package/src/view/home/query-table/components/table-pagination.vue +32 -0
  289. package/src/view/home/query-table/components/table-settings/assets/arrpw-up.svg +1 -0
  290. package/src/view/home/query-table/components/table-settings/assets/disabled-down.svg +1 -0
  291. package/src/view/home/query-table/components/table-settings/assets/disabled-up.svg +1 -0
  292. package/src/view/home/query-table/components/table-settings/assets/down.svg +1 -0
  293. package/src/view/home/query-table/components/table-settings/assets/up.svg +1 -0
  294. package/src/view/home/query-table/components/table-settings/index.less +294 -0
  295. package/src/view/home/query-table/components/table-settings/index.vue +260 -0
  296. package/src/view/home/query-table/components/table-settings/settings.vue +479 -0
  297. package/src/view/home/query-table/components/table-settings/test.js +626 -0
  298. package/src/view/home/query-table/components/table-settings//344/270/252/346/200/247/350/256/276/347/275/256.md +0 -0
  299. package/src/view/home/query-table/components/tooltip.js +124 -0
  300. package/src/view/home/query-table/hooks/use-cache-promise.js +27 -0
  301. package/src/view/home/query-table/hooks/use-column-config.js +190 -0
  302. package/src/view/home/query-table/hooks/use-encryption.js +0 -0
  303. package/src/view/home/query-table/hooks/use-generic-search.js +95 -0
  304. package/src/view/home/query-table/index.js +7 -0
  305. package/src/view/home/query-table/store/column-store.js +0 -0
  306. package/src/view/home/query-table/styles/table.less +24 -0
  307. package/src/view/home/query-table/utils/column.js +36 -0
  308. package/src/view/home/query-table/utils/config.js +12 -0
  309. package/src/view/home/query-table/utils/encryption.js +32 -0
  310. package/src/view/home/query-table/utils/http.js +1 -0
  311. package/src/view/home/query-table/utils/localStorage.js +35 -0
  312. package/src/view/home//351/246/226/351/241/265.md +0 -0
  313. package/src/web.js +99 -0
  314. package/vue.config.js +128 -0
  315. package/ks-query-table.common.js.map +0 -1
  316. package/ks-query-table.umd.js.map +0 -1
  317. package/ks-query-table.umd.min.js.map +0 -1
  318. /package/{ks-query-table.css → qt-npm/ks-query-table.css} +0 -0
@@ -0,0 +1,143 @@
1
+ import { upDateLocalCache } from '../../../hooks/use-generic-search'
2
+ import TableSettings from '../../table-settings/index.vue'
3
+ import { setLocalStorageItem } from '../../../utils/localStorage'
4
+
5
+
6
+ export default {
7
+ data() {
8
+ return {
9
+ showSetting: false,
10
+ }
11
+ },
12
+ methods: {
13
+ createTableSetting() {
14
+ const $props = this.$props
15
+ if (!$props.showSettingDialog) {
16
+ return null
17
+ }
18
+ const slot = this.$slots.default ? this.$slots.default[0] : this.$scopedSlots
19
+ const tableSettingAttrs = {
20
+ props: {
21
+ value: this.showSetting,
22
+ tableColumns: this.onlineColumns,
23
+ innerTabVisible: this.$props.innerTabVisible,
24
+ disabledAutoHideClose: this.$props.disabledAutoHideClose,
25
+ isShowHorizontal: this.isShowHorizontal,
26
+ },
27
+ on: {
28
+ input: val => (this.showSetting = val),
29
+ confirm: this.settingsConfirm,
30
+ initColumns: this.initColumns,
31
+ cancel: this.settingsCancel,
32
+ back: this.settingsBack,
33
+ reset: this.settingsReset,
34
+ },
35
+ ref: 'tableSettings',
36
+ scopedSlots: {
37
+ top: slot['setting-top'],
38
+ },
39
+ }
40
+ return <TableSettings {...tableSettingAttrs}></TableSettings>
41
+ },
42
+ // 打开个性设置弹窗
43
+ openSetting() {
44
+ this.showSetting = true
45
+ },
46
+ // 个性设置弹窗关闭确认
47
+ settingsConfirm(val) {
48
+ // 关闭动画和设置列头同时执行,在低端机器下阻塞进程。
49
+ setTimeout(async () => {
50
+ this.setOnlineColumns(val)
51
+ this.setColsToStorage(val)
52
+ await this.saveConfigToHttp(this.onlineColumns)
53
+ this.$emit('settingsConfirm', this.onlineColumns)
54
+ }, 0)
55
+ },
56
+ setColsToStorage(clos) {
57
+ if (!this.needCache) return
58
+ setLocalStorageItem('pe_stocks_quotes_table_fields-' + this.searchCode || '', JSON.stringify(clos))
59
+ },
60
+ // 个性设置取消
61
+ settingsCancel() {
62
+ this.$emit('settingsCancel')
63
+ },
64
+ // 个性设置返回
65
+ settingsBack() {
66
+ this.$emit('settingsBack')
67
+ },
68
+ // 个性设置重置
69
+ async settingsReset() {
70
+ this.resizeColumnMap = this.clearResizeColumnMap()
71
+ let val = await this.resetToHttp()
72
+ this.setOnlineColumns(val)
73
+ this.setColsToStorage(val)
74
+ this.$emit('settingsReset', this.onlineColumns)
75
+ },
76
+ /**
77
+ * 用户变更列显示/隐藏后,保存状态
78
+ * @param {*} columns
79
+ * @returns
80
+ */
81
+ async saveConfigToHttp(columns) {
82
+ if (this.columns.length && !this.forceSaveSettings) {
83
+ return
84
+ }
85
+ this.genericId = await this.getGenericId()
86
+ let fieldContent = this.formatFieldContent(columns)
87
+ let fieldSnapshot = this.formatFieldSnapshot(columns)
88
+ let params = {
89
+ genericId: this.genericId,
90
+ menuId: ksui.menu.id,
91
+ fieldContent: JSON.stringify(fieldContent),
92
+ fieldSnapshot: JSON.stringify(fieldSnapshot),
93
+ }
94
+ await this.$http('system.genericSearch.field.saveOrUpdate', 10124, params)
95
+ await upDateLocalCache(params, 'update')
96
+ },
97
+ /**
98
+ * 个性设置重置
99
+ * @returns
100
+ */
101
+ async resetToHttp() {
102
+ this.genericId = await this.getGenericId()
103
+ let params = {
104
+ genericId: this.genericId,
105
+ menuId: ksui.menu.id
106
+ }
107
+ let res = await this.$http('system.genericSearch.field.reset', 10124, params)
108
+ window.vant.Toast('重置成功')
109
+ let resetCols = JSON.parse(res.genericSearch)
110
+ resetCols.forEach(v => this.mergeColumn(v))
111
+ // upDateCatch({ id: params.genericId })
112
+ await upDateLocalCache({ ...params, fieldContent: res.genericSearch }, 'reset')
113
+ return resetCols
114
+ },
115
+ // 获取show的列
116
+ formatFieldContent(columns) {
117
+ return columns.filter(v => v.show).map(v => {
118
+ if (v.children) {
119
+ return {
120
+ key: v.key,
121
+ child: (v.children || []).filter(c => c.show).map(c => c.key)
122
+ }
123
+ } else {
124
+ return v.key
125
+ }
126
+ })
127
+ },
128
+ // 获取快照
129
+ formatFieldSnapshot(columns) {
130
+ return columns.reduce((prev, cur) => {
131
+ let obj = { show: !!cur.show }
132
+ if (cur.children && cur.children.length) {
133
+ obj.children = cur.children.reduce((p, c) => {
134
+ p[c.key] = { show: !!c.show }
135
+ return p
136
+ }, {})
137
+ }
138
+ prev[cur.key] = obj
139
+ return prev
140
+ }, {})
141
+ },
142
+ }
143
+ }
@@ -0,0 +1,511 @@
1
+ import cloneDeep from 'lodash/cloneDeep'
2
+ import debounce from 'lodash/debounce'
3
+ // 无限滚动数据的更新时间,防止用户长时间停留,滑动后数据不更新
4
+ const UPDATE_INTERVAL = 5 * 60 * 1000
5
+ // 获取全量id的数量
6
+ const idsPageSize = 10000
7
+ // 每次更新数据的数量
8
+ const upLength = Math.ceil(window.screen.width / 44) + 2
9
+ // 无限滚动需要多加载的行数
10
+ const addRowLength = 500
11
+
12
+ export default {
13
+ props: {
14
+ autoLoadData: {
15
+ type: Boolean,
16
+ default: true
17
+ },
18
+ disabledLoading: {
19
+ type: Boolean,
20
+ default: false
21
+ }
22
+ },
23
+ data() {
24
+ return {
25
+ // 本次滚动前的开始行
26
+ beforeStartRow: 0,
27
+ // 本次滚动前的结束行
28
+ beforeEndRow: 0,
29
+ // 全量的ids
30
+ tableScrollIds: [],
31
+ // 所有的数据映射map
32
+ tableMap: {},
33
+ lastReqTime: null, // TODO 需要保证code与数据一致,且是最后一次的请求
34
+ // 缓存的排序参数
35
+ orderByClauses: null,
36
+ // querytable 默认300
37
+ innterDelayLoading: 300,
38
+ dataFinish_timeStamp: null, // 数据返回时间
39
+ idsFinish_timeStamp: null, // ids最后返回时间
40
+ isLoadingMore: false // 加载更多加载中状态
41
+ }
42
+ },
43
+ computed: {
44
+ // 无限滚动用来加载视口数据的key
45
+ idsKey() {
46
+ // 非无限滚动也需要生成map映射
47
+ return this.config.idsKey || this.config.scrollLoad?.idsKey || 'code'
48
+ }
49
+ },
50
+ created() {
51
+ this.initDefaultData()
52
+ },
53
+ mounted() {
54
+ if (!this.autoLoadData) {
55
+ return
56
+ }
57
+ this.loadData()
58
+ },
59
+ methods: {
60
+ async loadMoreData() {
61
+ // 防止重复加载及无数据时触发
62
+ if (this.isLoadingMore || this.isLoading || !this.tableData || this.tableData.leng === 0) return
63
+ this.isLoadingMore = true
64
+ this.loadData({ page: this.currentPage + 1, loadMore: true })
65
+ },
66
+ initDefaultData() {
67
+ // 不需要响应式
68
+ this.loadIdsMap = {}
69
+ // 需要更新进表格的数据
70
+ this.willUpdateDataArr = []
71
+ },
72
+ // 处理分页参数
73
+ formatPageParams(params, options) {
74
+ const { page } = options || {}
75
+ params.page = page ? page : 1
76
+ return params
77
+ },
78
+ // 处理当前页总数
79
+ formatRowTotal(res) {
80
+ const { scrollLoad } = this.config
81
+ if (!scrollLoad) {
82
+ // 非无限滚动,需要设置为出参表格行数
83
+ res.rowTotal = res.rows.length
84
+ }
85
+ return res
86
+ },
87
+ // 处理排序参数
88
+ formatSortParams(params, options) {
89
+ const { reqProp, order } = options || {}
90
+ if (!(reqProp || this.orderByClauses)) return params
91
+ if (reqProp) {
92
+ // 优先使用传入的排序参数,并保存
93
+ let _orderByClauses = [{ field: reqProp, orderByMode: order === 'ascending' ? 0 : 1 }]
94
+ params.orderByClauses = _orderByClauses
95
+ this.orderByClauses = _orderByClauses
96
+ } else if (this.orderByClauses) {
97
+ // 翻页或其他场景,使用缓存好的排序参数
98
+ params.orderByClauses = this.orderByClauses
99
+ }
100
+ return params
101
+ },
102
+ // 请求数据
103
+ async loadData(options) {
104
+ return new Promise(async (resolve, reject) => {
105
+ try {
106
+ if (!this.disabledLoading && !(options && options.loadMore)) {
107
+ // 底部加载更多时无需表格全局loading
108
+ this.isLoading = true
109
+ }
110
+ const { url, appkey, beforeHttp, afterHttp, scrollLoad, afterSetData, firstScreenDataCompleted } = this.config
111
+ const now = new Date().valueOf()
112
+ this.lastReqTime = now
113
+
114
+ // 需要无限滚动,加载全量id
115
+ scrollLoad && this.loadTableScrollIds(now, options)
116
+
117
+ let params = {
118
+ // 默认页码200
119
+ pageSize: this.config.pageSize || 200
120
+ }
121
+ // 请求前,外部可处理入参
122
+ let beforeParams = { url, appkey, params }
123
+ // 合并外部return的参数
124
+ let $params = typeof beforeHttp === 'function' ? { ...beforeParams, ...await beforeHttp(beforeParams) } : beforeParams
125
+
126
+ let { url: _url, appkey: _appkey, params: _params } = $params
127
+
128
+ // 每次请求,记录时间戳
129
+ let serach_time_stamp = now
130
+
131
+ // 处理分页参数
132
+ _params = this.formatPageParams(_params, options)
133
+ // 处理排序参数
134
+ _params = this.formatSortParams(_params, options)
135
+ let res = await this.$http(_url, _appkey, _params)
136
+ // 非无限滚动,重复请求,不赋值
137
+ if (!scrollLoad && serach_time_stamp < this.lastReqTime) {
138
+ return
139
+ }
140
+
141
+ // 只赋值最后一次的请求
142
+ if (serach_time_stamp && this.lastReqTime && serach_time_stamp < this.lastReqTime) return
143
+
144
+ // 请求后,外部可处理出参
145
+ res = typeof afterHttp === 'function' ? await afterHttp(res) : res
146
+ res = this.formatRowTotal(res)
147
+
148
+ const { rowTotal, rows } = res
149
+
150
+ this.setTableData({ rowTotal, rows }, now, options)
151
+
152
+ // TODO 首屏数据设置完成
153
+ typeof afterSetData === 'function' && afterSetData()
154
+ typeof firstScreenDataCompleted === 'function' && firstScreenDataCompleted({ rowTotal, rows })
155
+ // this.tableData = res.rows
156
+ // TODO 取出参配置有问题
157
+ !scrollLoad && this.setPage({ page: _params.page, pageTotal: res.pageTotal })
158
+ if (options && options.loadMore && _params.page >= res.pageTotal || !!scrollLoad) {
159
+ // 当前页码等于最大页码时 或者 无限滚动
160
+ this.loadMoreFinish = true
161
+ }
162
+ this.isLoading = false
163
+ resolve(res)
164
+ } catch (error) {
165
+ this.checkNetType(error)
166
+ // TODO 错误是否需要清空数据
167
+ console.error('[query-table-search-error]', error)
168
+ reject(error)
169
+ }
170
+ })
171
+ },
172
+ // TODO, 暂时处理单元格数据 key都不存在的情况。此方法影响性能,后续要去除
173
+ createBaseData() {
174
+ // return Object.keys(val).reduce((base, v) => {
175
+ // base[v] = '-'
176
+ // return base
177
+ // }, {})
178
+ return {}
179
+ },
180
+ // 获取无限滚动需要的全量id
181
+ async loadTableScrollIds(now, options) {
182
+ try {
183
+ const { scrollLoad, appkey } = this.config
184
+ if (!scrollLoad) return
185
+
186
+ const { getIdsUrl, idsBeforeHttp, idsAfterHttp } = scrollLoad
187
+
188
+ let params = {}
189
+
190
+ // 请求前,外部可处理入参
191
+ let idsBeforeParams = { url: getIdsUrl, appkey, params }
192
+ // 合并外部return的参数
193
+ let $params = typeof idsBeforeHttp === 'function' ? { ...idsBeforeParams, ...await idsBeforeHttp(idsBeforeParams) } : idsBeforeParams
194
+
195
+ let { url: _url, appkey: _appkey, params: _params } = $params
196
+ // 无限滚动,首页数据需要设置唯一时间戳,用于校验是否为最后一次请求,与首页数据时间戳一致
197
+ let serach_time_stamp = now
198
+
199
+ // 处理排序参数
200
+ _params = this.formatSortParams(_params, options)
201
+ // id写死最大请求数量
202
+ let res = await this.$http(_url, _appkey, { ..._params, pageSize: idsPageSize })
203
+
204
+ // 只赋值最后一次的请求
205
+ if (serach_time_stamp && this.lastReqTime && serach_time_stamp < this.lastReqTime) return
206
+
207
+ // 请求后,外部可处理出参
208
+ res = typeof idsAfterHttp === 'function' ? await idsAfterHttp(res) : res
209
+
210
+ // res 需要处理成字符串数组['id1', 'id2]
211
+ this.tableScrollIds = res
212
+
213
+ this.idsFinish_timeStamp = now
214
+
215
+ this.setTableScrollIds()
216
+ } catch (error) {
217
+ console.error('[query-table-search-ids]', error)
218
+ }
219
+ },
220
+ // 无限滚动过程中加载数据
221
+ async scrollLoadData(scrollOptions) {
222
+ try {
223
+ const { scrollLoad, appkey, url } = this.config
224
+ if (!scrollLoad) return
225
+
226
+ const { scrollBeforeHttp, scrollAfterHttp } = scrollLoad
227
+ let params = {}
228
+
229
+ // 请求前,外部可处理入参
230
+ let scrollBeforeParams = { url, appkey, params }
231
+
232
+ let $params = typeof scrollBeforeHttp === 'function' ? { ...scrollBeforeParams, ...await scrollBeforeHttp(scrollBeforeParams, scrollOptions) } : scrollBeforeParams
233
+
234
+ let { url: _url, appkey: _appkey, params: _params } = $params
235
+
236
+ let res = await this.$http(_url, _appkey, _params)
237
+
238
+ // 请求后,外部可处理出参
239
+ res = typeof scrollAfterHttp === 'function' ? await scrollAfterHttp(res) : res
240
+
241
+ this.updateTableData(res.rows, 'api')
242
+ } catch (error) {
243
+ console.error('[query-table-scrollLoadData]', error)
244
+ }
245
+ // 清空本次请求加载中的ids
246
+ this.clearLoadIds(scrollOptions.code)
247
+ },
248
+ // 清空加载中的ids
249
+ clearLoadIds(codes) {
250
+ for (let index = 0; index < codes.length; index++) {
251
+ delete this.loadIdsMap[codes[index]]
252
+ }
253
+ },
254
+ async setTableData(val, now, loadOptions) {
255
+ let { rowTotal, rows, options: scrollData } = val
256
+ const nowDateStr = +new Date()
257
+ if (!scrollData) {
258
+ // 第一页数据,非滚动
259
+ this.total = rowTotal
260
+ let tableData = []
261
+ let item = null
262
+ // 设置第一页数据,全部双向绑定
263
+ for (let index = 0; index < rows.length; index++) {
264
+ item = rows[index]
265
+ tableData.push({ ...item, id: 'pe_' + Math.random().toString(), __updateTime: nowDateStr })
266
+ }
267
+ // 根据总条数设置空行,用于一次展示所有数据,后续滚动过程中请求后合并空数据
268
+ for (let index = rows.length; index < rowTotal; index++) {
269
+ tableData.push({ ...this.createBaseData(rows[0]), id: 'pe_' + Math.random().toString(), name: '-', selectedFlag: null })
270
+ }
271
+
272
+ if (loadOptions && loadOptions.loadMore) {
273
+ rows.forEach(v => this.tableData.push(v))
274
+ } else {
275
+ this.tableData = tableData
276
+ }
277
+ this.isLoadingMore = false
278
+ this.dataFinish_timeStamp = now
279
+
280
+ this.setTableScrollIds()
281
+
282
+ // 第一页数据,让表格回到顶部
283
+ if (!(loadOptions && loadOptions.loadMore)) {
284
+ this.$refs.peTable && this.$refs.peTable.scrollToTop()
285
+ // 如果有数据,异步存入到map内
286
+ setTimeout(() => {
287
+ this.tableData.forEach(item => {
288
+ if (item.__updateTime) {
289
+ this.tableMap[item[this.idsKey]] = item
290
+ }
291
+ })
292
+ }, 0)
293
+ }
294
+ } else {
295
+ // 滚动加载的数据
296
+ this.updateTableData(rows, 'api')
297
+ }
298
+ },
299
+ // 表格滑动拉取数据
300
+ tableScrollPullData: debounce(async function (e) {
301
+ const { scrollLoad } = this.config
302
+ if (!scrollLoad) return
303
+ let { startRow, endRow, action, rowsPerViewport } = e
304
+
305
+ // code还没请求回来
306
+ if (!this.tableScrollIds.length) {
307
+ // 保存数据用于code取回来后立即执行
308
+ this.beforeStartRow = startRow
309
+ this.beforeEndRow = endRow
310
+ return
311
+ }
312
+
313
+ if (action === 'reload') {
314
+ // 立即请求
315
+ startRow = this.beforeStartRow
316
+ endRow = this.beforeEndRow
317
+ } else {
318
+ // 未产生行数变更时,不调用接口
319
+ if (this.beforeStartRow === startRow && this.beforeEndRow === endRow) {
320
+ return
321
+ } else {
322
+ this.beforeStartRow = startRow
323
+ this.beforeEndRow = endRow
324
+ }
325
+ }
326
+
327
+
328
+ // TODO ? 业务逻辑
329
+ // if (startRow !== undefined && endRow !== undefined && isPullKLine) {
330
+ // // 暂时隐藏,后续需要根据调用状态判断是否需要原生方法
331
+ // const curCodes = this.tableScrollIds.slice(startRow, endRow)
332
+ // try {
333
+ // window.ks.callFunc({ method: "preLoadStockKlineToFile", params: { ids: uniq(curCodes) } })
334
+ // } catch (error) {
335
+ // console.log(error)
336
+ // }
337
+ // }
338
+
339
+ // 优化处理,不重复请求已有数据
340
+ let codes = []
341
+ // 预加载多一屏数据
342
+
343
+ // 是否需要预加载
344
+ // 校验下一屏是否是空的
345
+ const checkNextViewData = () => {
346
+ const nowDateStr = +new Date()
347
+ let checkStartRow = startRow
348
+ let checkEndRow = endRow + rowsPerViewport
349
+ let id = null
350
+ let item = null
351
+ let load = false
352
+ while (checkStartRow <= checkEndRow) {
353
+ id = this.tableScrollIds[checkStartRow]
354
+ item = this.tableMap[id]
355
+ const noItem = id && !item
356
+ const oldItem = item && (!item.__updateTime || nowDateStr > UPDATE_INTERVAL + item.__updateTime)
357
+ if (id && (noItem || oldItem)) {
358
+ load = true
359
+ break
360
+ }
361
+ checkStartRow++
362
+ }
363
+ return load
364
+ }
365
+
366
+ if (!checkNextViewData()) {
367
+ return
368
+ }
369
+
370
+ let preloadEndRow = Math.min(endRow + addRowLength, this.tableScrollIds.length)
371
+ if (preloadEndRow > 0) {
372
+ let i = startRow
373
+ const nowDateStr = +new Date()
374
+ let id = null
375
+ let item = null
376
+ while (i <= preloadEndRow) {
377
+ // 如果已经有数据,不需要再请求获取
378
+ // 加入更新时间,如果超过指定时间需要重新获取
379
+ id = this.tableScrollIds[i] || ''
380
+ item = this.tableMap[id]
381
+
382
+ const noItem = id && !item
383
+ const oldItem = item && (!item.__updateTime || nowDateStr > UPDATE_INTERVAL + item.__updateTime)
384
+ const idLoad = this.loadIdsMap[id] // 加载中的数据
385
+
386
+ if (id && (noItem || oldItem) && !idLoad) {
387
+ codes.push(id)
388
+ this.loadIdsMap[id] = true
389
+ }
390
+ i++
391
+ }
392
+ }
393
+
394
+ if (!codes.length) return
395
+
396
+ let options = {
397
+ code: codes,
398
+ startRow,
399
+ endRow,
400
+ }
401
+ this.scrollLoadData(options)
402
+
403
+ }, 100),
404
+ /**
405
+ * 基于ID过滤并合并两个大型数组,保持原始顺序
406
+ * @param {Array} arr1 第一个数组(将被过滤)
407
+ * @param {Array} arr2 第二个数组(将完整保留)
408
+ * @returns {Array} 合并后的新数组
409
+ */
410
+ filterAndMergeArrays(arr1, arr2) {
411
+ // 创建第二个数组的ID集合用于快速查找
412
+ const arr2IdSet = new Set()
413
+ for (const item of arr2) {
414
+ if (item[this.idsKey]) {
415
+ arr2IdSet.add(item[this.idsKey])
416
+ }
417
+ }
418
+
419
+ // 过滤第一个数组中存在于第二个数组的项
420
+ const filteredArr1 = []
421
+ for (const item of arr1) {
422
+ if (item[this.idsKey] && !arr2IdSet.has(item[this.idsKey])) {
423
+ filteredArr1.push(item)
424
+ }
425
+ }
426
+
427
+ // 合并数组(保持顺序)
428
+ return [...filteredArr1, ...arr2]
429
+ },
430
+ // 更新数据
431
+ updateTableData(arr, type, callback) {
432
+ // 去除已在队列中的的重复数据,以新的为准,减少更新操作,提升性能
433
+ this.willUpdateDataArr = this.filterAndMergeArrays([...this.willUpdateDataArr], arr)
434
+ const nowDateStr = +new Date()
435
+ const step = () => {
436
+ if (this.willUpdateDataArr.length === 0) return
437
+ // 每次只更新设置好的行数
438
+ let upList = this.willUpdateDataArr.splice(0, upLength)
439
+ for (let index = 0; index < upList.length; index++) {
440
+ const item = upList[index]
441
+ const id = item[this.idsKey]
442
+ // 后端返回的直接赋值,实时数据需要该行不为空
443
+ if (this.tableMap[id] && (type === 'api' || this.tableMap[id].__updateTime)) {
444
+ const oldItem = cloneDeep(this.tableMap[id])
445
+ Object.assign(this.tableMap[id], item, { __updateTime: nowDateStr })
446
+ callback && callback(this.tableMap[id], oldItem)
447
+ }
448
+ }
449
+ // 每次设置完数据,主动更新
450
+ this.$refs?.peTable?.renderViewportRows()
451
+ requestAnimationFrame(step)
452
+ }
453
+ requestAnimationFrame(step)
454
+ },
455
+ resetTableData(i) {
456
+ // 重置下总数
457
+ this.total = i
458
+ if (this.tableData.length !== i) {
459
+ this.tableData = this.tableData.slice(0, i)
460
+ }
461
+ },
462
+ checkSetIds() {
463
+ // 数据返回是最新的,并且ids返回是最新的
464
+ return this.dataFinish_timeStamp === this.lastReqTime && this.idsFinish_timeStamp === this.lastReqTime
465
+ },
466
+ // 给每一行数据设置数据需要的id
467
+ setTableScrollIds() {
468
+ if (!this.config.scrollLoad) return
469
+ // 需要首页search 和 ids 是同一轮
470
+ if (!this.checkSetIds()) return
471
+ let i = Math.min(this.tableData.length, this.tableScrollIds.length)
472
+ // 兜底,ids与rowTotal 长度不一致时,用短的
473
+ this.resetTableData(i)
474
+ let id = null
475
+ let item = null
476
+ while (i--) {
477
+ item = this.tableData[i]
478
+ if (item[this.idsKey] === '-' || !item[this.idsKey]) {
479
+ id = this.tableScrollIds[i]
480
+ item[this.idsKey] = id
481
+ this.tableMap[id] = item
482
+ this.tableMap[id].__index = i
483
+ }
484
+ }
485
+ const { scrollLoad } = this.config
486
+ const { setScrollIdsAfter } = scrollLoad
487
+ typeof setScrollIdsAfter === 'function' && setScrollIdsAfter()
488
+ },
489
+ // 校验网络状态
490
+ async checkNetType(e) {
491
+ this.isLoading = false
492
+ // 后端超时
493
+ if (e.data && [27057].includes(e.data.code)) {
494
+ this.tableData = []
495
+ this.tableIsAbnormal = true
496
+ return
497
+ }
498
+ // 前端取消
499
+ if (e.message === (window.networkTimeoutMessage || '请求超时,服务器未响应')) {
500
+ this.tableData = []
501
+ this.tableIsAbnormal = true
502
+ return
503
+ }
504
+ if (window.ks) {
505
+ const netStatus = await window.ks.callFunc({ method: 'getNetType', params: {} })
506
+ this.tableData = netStatus === 1 ? [] : this.tableData
507
+ this.tableIsAbnormal = netStatus === 1
508
+ }
509
+ }
510
+ }
511
+ }
@@ -0,0 +1,26 @@
1
+
2
+ export default {
3
+ props: {
4
+ showPage: Boolean
5
+ },
6
+ data() {
7
+ return {
8
+ currentPage: 1,
9
+ totalPages: 1
10
+ }
11
+ },
12
+ methods: {
13
+ setPage(res) {
14
+ // TODO 需要缓存页码
15
+ // if (!this.showPage ) {
16
+ // return
17
+ // }
18
+ this.currentPage = res.page
19
+ this.totalPages = res.pageTotal
20
+ },
21
+ onPageChanged(newPage) {
22
+ this.currentPage = newPage
23
+ this.loadData({ page: newPage })
24
+ },
25
+ }
26
+ }