@kyfe/ks-query-table 0.0.21 → 0.0.22

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 (310) 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 +15 -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/index.js} +3 -3
  208. package/qt-npm/package.json +13 -0
  209. package/src/App.vue +204 -0
  210. package/src/README.md +15 -0
  211. package/src/common/README.md +94 -0
  212. package/src/common/http/axios-adapter.js +47 -0
  213. package/src/common/http/common.js +88 -0
  214. package/src/common/http/http-interceptors.js +18 -0
  215. package/src/common/http/http-lock.js +45 -0
  216. package/src/common/http/index.js +163 -0
  217. package/src/common/http/token.js +9 -0
  218. package/src/common/styles/font/AlibabaSans102Ver2-Md.ttf +0 -0
  219. package/src/common/styles/font.less +12 -0
  220. package/src/common/styles/variables.less +43 -0
  221. package/src/common/utils/index.js +1 -0
  222. package/src/common/utils/platform/README.md +1 -0
  223. package/src/common/utils/platform/android/.gitkeep +0 -0
  224. package/src/common/utils/platform/core/index.js +24 -0
  225. package/src/common/utils/platform/index.js +164 -0
  226. package/src/common/utils/platform/ios/.gitkeep +0 -0
  227. package/src/common/utils/platform/subscribe/helper.js +38 -0
  228. package/src/common/utils/platform/subscribe/index.js +204 -0
  229. package/src/common/utils/platform/subscribe/table-animation.js +75 -0
  230. package/src/config/index.js +31 -0
  231. package/src/config.js +1 -0
  232. package/src/main.js +73 -0
  233. package/src/router.js +52 -0
  234. package/src/view/home/config.js +101 -0
  235. package/src/view/home/demo1.vue +223 -0
  236. package/src/view/home/demo2.vue +124 -0
  237. package/src/view/home/demo3.vue +51 -0
  238. package/src/view/home/demo4.vue +140 -0
  239. package/src/view/home/index.vue +97 -0
  240. package/src/view/home/query-table/README.md +45 -0
  241. package/src/view/home/query-table/api/index.js +12 -0
  242. package/src/view/home/query-table/assets/horizontal-back.svg +1 -0
  243. package/src/view/home/query-table/components/pe-table/cell.js +181 -0
  244. package/src/view/home/query-table/components/pe-table/collapse.js +334 -0
  245. package/src/view/home/query-table/components/pe-table/empty.vue +48 -0
  246. package/src/view/home/query-table/components/pe-table/header.js +328 -0
  247. package/src/view/home/query-table/components/pe-table/images/abnormal.png +0 -0
  248. package/src/view/home/query-table/components/pe-table/images/empty.png +0 -0
  249. package/src/view/home/query-table/components/pe-table/images/fold.svg +1 -0
  250. package/src/view/home/query-table/components/pe-table/images/sort.svg +1 -0
  251. package/src/view/home/query-table/components/pe-table/images/sorting.svg +1 -0
  252. package/src/view/home/query-table/components/pe-table/images/unfold.svg +1 -0
  253. package/src/view/home/query-table/components/pe-table/index.vue +847 -0
  254. package/src/view/home/query-table/components/pe-table/load-more.js +46 -0
  255. package/src/view/home/query-table/components/pe-table/props/index.js +193 -0
  256. package/src/view/home/query-table/components/pe-table/row.vue +118 -0
  257. package/src/view/home/query-table/components/pe-table/scrollbar.js +424 -0
  258. package/src/view/home/query-table/components/pe-table/stretch-damping.js +112 -0
  259. package/src/view/home/query-table/components/pe-table/style/cell.less +89 -0
  260. package/src/view/home/query-table/components/pe-table/style/empty.less +48 -0
  261. package/src/view/home/query-table/components/pe-table/style/header.less +141 -0
  262. package/src/view/home/query-table/components/pe-table/style/index.less +88 -0
  263. package/src/view/home/query-table/components/pe-table/style/load-more.less +61 -0
  264. package/src/view/home/query-table/components/pe-table/style/row.less +6 -0
  265. package/src/view/home/query-table/components/pe-table/table-loading.vue +120 -0
  266. package/src/view/home/query-table/components/pe-table/table-total.vue +57 -0
  267. package/src/view/home/query-table/components/pe-table/utils/animate.js +80 -0
  268. package/src/view/home/query-table/components/pe-table/utils/columns.js +290 -0
  269. package/src/view/home/query-table/components/pe-table/utils/data.js +12 -0
  270. package/src/view/home/query-table/components/pe-table/utils/fixed.js +69 -0
  271. package/src/view/home/query-table/components/pe-table/utils/formatter.js +327 -0
  272. package/src/view/home/query-table/components/pe-table/utils/render-cells.js +424 -0
  273. package/src/view/home/query-table/components/pe-table/utils/slot.js +28 -0
  274. package/src/view/home/query-table/components/pe-table/utils/tools.js +84 -0
  275. package/src/view/home/query-table/components/pe-table/utils/touch-scroll.js +417 -0
  276. package/src/view/home/query-table/components/query-table/index.vue +497 -0
  277. package/src/view/home/query-table/components/query-table/mixins/column-mixin.js +102 -0
  278. package/src/view/home/query-table/components/query-table/mixins/column-setting.js +143 -0
  279. package/src/view/home/query-table/components/query-table/mixins/data-mixin.js +519 -0
  280. package/src/view/home/query-table/components/query-table/mixins/pagination-mixin.js +26 -0
  281. package/src/view/home/query-table/components/query-table/mixins/table-fixed.js +130 -0
  282. package/src/view/home/query-table/components/query-table/mixins/table-horizontal.js +119 -0
  283. package/src/view/home/query-table/components/table-horizontal.vue +99 -0
  284. package/src/view/home/query-table/components/table-pagination.vue +32 -0
  285. package/src/view/home/query-table/components/table-settings/assets/arrpw-up.svg +1 -0
  286. package/src/view/home/query-table/components/table-settings/assets/disabled-down.svg +1 -0
  287. package/src/view/home/query-table/components/table-settings/assets/disabled-up.svg +1 -0
  288. package/src/view/home/query-table/components/table-settings/assets/down.svg +1 -0
  289. package/src/view/home/query-table/components/table-settings/assets/up.svg +1 -0
  290. package/src/view/home/query-table/components/table-settings/index.less +294 -0
  291. package/src/view/home/query-table/components/table-settings/index.vue +260 -0
  292. package/src/view/home/query-table/components/table-settings/settings.vue +479 -0
  293. package/src/view/home/query-table/components/table-settings/test.js +626 -0
  294. package/src/view/home/query-table/components/table-settings//344/270/252/346/200/247/350/256/276/347/275/256.md +0 -0
  295. package/src/view/home/query-table/components/tooltip.js +124 -0
  296. package/src/view/home/query-table/hooks/use-cache-promise.js +27 -0
  297. package/src/view/home/query-table/hooks/use-column-config.js +190 -0
  298. package/src/view/home/query-table/hooks/use-encryption.js +0 -0
  299. package/src/view/home/query-table/hooks/use-generic-search.js +95 -0
  300. package/src/view/home/query-table/index.js +7 -0
  301. package/src/view/home/query-table/store/column-store.js +0 -0
  302. package/src/view/home/query-table/styles/table.less +24 -0
  303. package/src/view/home/query-table/utils/column.js +36 -0
  304. package/src/view/home/query-table/utils/config.js +12 -0
  305. package/src/view/home/query-table/utils/encryption.js +32 -0
  306. package/src/view/home/query-table/utils/http.js +1 -0
  307. package/src/view/home/query-table/utils/localStorage.js +35 -0
  308. package/src/view/home//351/246/226/351/241/265.md +0 -0
  309. package/src/web.js +99 -0
  310. package/vue.config.js +131 -0
@@ -0,0 +1,9 @@
1
+ // 掉接口获取token
2
+ export const getToken = () => {
3
+ return sessionStorage.getItem('ks_token') || ''
4
+ }
5
+
6
+ export const setToken = token => {
7
+ token = token || ''
8
+ sessionStorage.setItem('ks_token', token)
9
+ }
@@ -0,0 +1,12 @@
1
+ // @font-face {
2
+ // font-family: "Money";
3
+ // src: url("/src/common/styles/font/AlibabaSans102Ver2-Md.ttf");
4
+ // }
5
+
6
+
7
+ .numFontFamily(@size: 12px) {
8
+ font-size: @size;
9
+ }
10
+
11
+
12
+ @fontsize: 17px;
@@ -0,0 +1,43 @@
1
+
2
+
3
+ // 主题色
4
+ // @C1-brand-01: #FCDDD4;
5
+ // @C1-brand-00: #FEF2EE;
6
+ // @C1-brand-02: #FAB9A9;
7
+ // @C1-brand-03: #F79380;
8
+ // @C1-brand-04: #F56B57;
9
+ // @C1-brand-05: #F2412F;
10
+ // @C1-brand-06: #CE2C22;
11
+ // @C1-brand-07: #AB1B17;
12
+ // @C1-brand-08: #870E0F;
13
+ // @C1-brand-09: #63070B;
14
+
15
+ @C9-gray-00: #F7F8FA;
16
+ @C9-gray-01: #F2F3F5;
17
+ @C9-gray-02: #E5E4E4;
18
+ @C9-gray-03: #C2C0C0;
19
+ @C9-gray-04: #9E9C9C;
20
+ @C9-gray-05: #7B7878;
21
+ @C9-gray-06: #575555;
22
+ @C9-gray-07: #3A3536;
23
+ @C9-gray-08: #2C2727;
24
+ @C9-gray-09: #1D1919;
25
+ @C9-gray-10: #FFFFFF;
26
+ @C9-gray-11: rgba(255, 255, 255, 0.4);
27
+ @C9-gray-12: #F1F1F1;
28
+ @C9-gray-13: #DEDEDE;
29
+ @C1-brand-00: #FEF2EE;
30
+ @C1-brand-01: #FCDDD4;
31
+ @C1-brand-02: #FAB9A9;
32
+ @C1-brand-03: #F79380;
33
+ @C1-brand-04: #F56B57;
34
+ @C1-brand-05: #F2412F;
35
+ @C1-brand-06: #CE2C22;
36
+ @C1-brand-07: #AB1B17;
37
+ @C1-brand-08: #870E0F;
38
+ @C1-brand-09: #63070B;
39
+ @C1-brand-10: #fff4f3;
40
+ @C10-Light-gray-01: rgba(29, 25, 25, 0.4);
41
+
42
+ // 字体
43
+ @import "./font.less";
@@ -0,0 +1 @@
1
+ export * from "./platform";
@@ -0,0 +1 @@
1
+ 平台能力调用
File without changes
@@ -0,0 +1,24 @@
1
+ /* eslint-disable no-console */
2
+ import isEmpty from 'lodash/isEmpty'
3
+
4
+ /**
5
+ * @description ks callFunc
6
+ * @param {string} method
7
+ * @param {object} params
8
+ * @returns {unknown}
9
+ */
10
+ export function callFunc(method, params) {
11
+ console.info(`🦕 Call Function`, { method, params })
12
+
13
+ return window.ks.callFunc({ method, params })
14
+ }
15
+
16
+ /**
17
+ * @description ks JsStock callFunc
18
+ * @param {string} method
19
+ * @param {array} params
20
+ */
21
+ export function jsStockCallFunc(method, params = []) {
22
+ if (isEmpty(method)) return false
23
+ window.jsStock && window.jsStock[method] && window.jsStock[method](...params)
24
+ }
@@ -0,0 +1,164 @@
1
+ import { callFunc, jsStockCallFunc } from './core'
2
+ import store from '@/store/index.js'
3
+ /**
4
+ * @description 跳转 0 股票 or 指数 1 详情页 2 K线弹窗
5
+ * @param { 0 | 1} type
6
+ * @param {{
7
+ * tag: string
8
+ * id: string
9
+ * list: string[]
10
+ * h5Params?: string
11
+ * }} params
12
+ */
13
+ export function stockNavigateTo(type, params) {
14
+ // 标记进入原生页面
15
+ if (`${type}` === '2') {
16
+ // const isSupport = window.compareAppVersion(window.ksAppVersion, '1.0.398')
17
+ // if (!isSupport) type = 0
18
+ type = 0
19
+ }
20
+ return callFunc('stockNavigateTo', { pageType: 'native', type, params })
21
+ }
22
+
23
+ /**
24
+ * @description 设置底部 tabs 是否显示
25
+ * @param {boolean} isShow
26
+ */
27
+ export const setStockTabVisible = isShow => {
28
+ return callFunc('setStockTabVisible', { isShow })
29
+ }
30
+
31
+ /**
32
+ * 隐藏/显示关闭按钮
33
+ * @param {boolean} isShow
34
+ */
35
+ export const setCloseButton = isShow => {
36
+ return callFunc('setCloseButton', { isShow })
37
+ }
38
+
39
+ /**
40
+ * @description 打开新的界面加载网页
41
+ * @param {string} url
42
+ */
43
+ export const openBrowser = url => {
44
+ return callFunc({ method: 'openBrowser', params: { url } })
45
+ }
46
+
47
+ /**
48
+ * @description 股票列表/指数列表传递
49
+ * @param {0 | 1} type 0 股票列表;1 指数列表
50
+ * @param {string} tag 列表数据唯一标识,传递相同会覆盖
51
+ * @param {string[]} list 股票列表/指数列表。如股票列表:["000001.SZ","000002.SZ"]
52
+ */
53
+ export const stockListTransfer = (type, tag, list) => {
54
+ return callFunc('stockListTransfer', { type, tag, list })
55
+ }
56
+
57
+ export async function getStatusBarHeight() {
58
+ try {
59
+ let statusBarHeight = window.__statusBarHeight__
60
+
61
+ statusBarHeight = statusBarHeight || window.getComputedStyle(document.documentElement).getPropertyValue('--status-bar-height').replace(/px$/gi, '')
62
+ statusBarHeight = statusBarHeight || (await callFunc('getKsStatusBarHeight', {})).statusHeight
63
+
64
+ return +statusBarHeight || 0
65
+ } catch {
66
+ return 0
67
+ }
68
+ }
69
+
70
+ export async function getKsStatusBarHeight() {
71
+ getStatusBarHeight()
72
+ }
73
+
74
+ /**
75
+ * @description 通知页面滚动到顶部或底部事件
76
+ * @param {Boolean} isTop 是否滚动到顶部
77
+ * @param {Boolean} isBottom 是否滚动到底部
78
+ */
79
+ export const webScrollVertical = (isTop, isBottom) => {
80
+ return jsStockCallFunc('webScrollVertical', [isTop, isBottom])
81
+ }
82
+
83
+ /**
84
+ * @description 通知页面滚动到顶部或底部事件
85
+ * @param {Boolean} isTop 是否滚动到顶部
86
+ * @param {Boolean} isBottom 是否滚动到底部
87
+ */
88
+ export const reload = () => {
89
+ return jsStockCallFunc('reload')
90
+ }
91
+
92
+ /**
93
+ * @description 调用原生能力存储本地数据
94
+ * 注意: key的值在轻应用中是全局存储的,需要注意唯一性,命名不要和其他业务线中的key产生冲突
95
+ * 踩坑点: value: 只能存储字符串,不能为数字
96
+ * @param {Object} params 存储对象{key: string, value: string}
97
+ */
98
+ export const storageSetItem = (params) => {
99
+ if (!params || typeof params.key !== 'string' || typeof params.value !== 'string') {
100
+ return false
101
+ }
102
+
103
+ return callFunc('storageSetItem', params)
104
+ }
105
+
106
+ /**
107
+ * @description 调用原生能力获取本地数据
108
+ * 注意: key的值在轻应用中是全局存储的,需要注意唯一性,命名不要和其他业务线中的key产生冲突
109
+ * @param {String} key 通过storageSetItem方法设置的唯一key键值
110
+ */
111
+ export const storageGetItem = async (key) => {
112
+ if (!key || typeof key !== 'string') {
113
+ return false
114
+ }
115
+
116
+ return await callFunc('storageGetItem', { key })
117
+ }
118
+
119
+ /**
120
+ * @description 通用弹窗原生能力
121
+ * @param {string} url
122
+ */
123
+ export const openNativeDialog = (params) => {
124
+ console.log('openNativeDialog', params)
125
+ return callFunc('CommonDialog', {
126
+ ...params,
127
+ title: '温馨提示',
128
+ leftText: '取消',
129
+ rightText: '确定',
130
+ rightTextColor: '#f2412f'
131
+ })
132
+ }
133
+
134
+ /**
135
+ * @description 通用Modal原生能力
136
+ * @param {object} params
137
+ */
138
+ export const openNativeModal = (params) => {
139
+ return callFunc('WebDialog', {
140
+ ...params,
141
+ direction: params.direction,
142
+ url: params.url,
143
+ })
144
+ }
145
+
146
+
147
+
148
+ export const platform = {
149
+ stockNavigateTo,
150
+ setStockTabVisible,
151
+ callFunc,
152
+ openBrowser,
153
+ stockListTransfer,
154
+ webScrollVertical,
155
+ reload,
156
+ storageSetItem,
157
+ storageGetItem,
158
+ openNativeDialog,
159
+ openNativeModal
160
+ }
161
+
162
+ export * from './subscribe'
163
+ export * from './subscribe/helper'
164
+ export * from './subscribe/table-animation'
File without changes
@@ -0,0 +1,38 @@
1
+ /* eslint-disable no-console */
2
+ import throttle from 'lodash/throttle'
3
+
4
+ const DEFAULT_BUFFER_SIZE = 120
5
+ const DEFAULT_WAIT = 400
6
+
7
+ export function createUpdateBuffer(updateHandle, hashKey = 'code', option = { size: DEFAULT_BUFFER_SIZE, wait: DEFAULT_WAIT }) {
8
+ let pool = {}
9
+ let count = 0
10
+
11
+ const throttleFlush = throttle(
12
+ function () {
13
+ updateHandle(Object.values(pool))
14
+ count = 0
15
+ pool = {}
16
+ },
17
+ option.wait,
18
+ { trailing: true },
19
+ )
20
+
21
+ const buffer = {
22
+ push(item) {
23
+ pool[item[hashKey]] = item
24
+ count++
25
+
26
+ if (count > option.size && option.size > 0) {
27
+ throttleFlush.flush()
28
+ } else {
29
+ throttleFlush()
30
+ }
31
+ },
32
+
33
+ flush: throttleFlush.flush,
34
+ throttleFlush: throttleFlush,
35
+ }
36
+
37
+ return buffer
38
+ }
@@ -0,0 +1,204 @@
1
+ /* eslint-disable no-console */
2
+ import { uuid } from '@/utils/tools'
3
+ import { callFunc } from '../core'
4
+
5
+ /**
6
+ * @param {{ ids: string[], type: number, isSubscribe: boolean, tag: string }} param
7
+ */
8
+ export function stockSubscribe(param) {
9
+ return callFunc('stockSubscribe', param)
10
+ }
11
+
12
+ /**
13
+ * @param {{ bizData: string, bizType: string, isSubscribe: boolean, tag: string }} param
14
+ */
15
+ export function stockCommonSubscribe(param) {
16
+ return callFunc('stockCommonSubscribe', param)
17
+ }
18
+
19
+ const idToHandle = new Map()
20
+ const handleToId = new WeakMap()
21
+
22
+ /**
23
+ * @param {number|string} typeOrCommand
24
+ * @param {unknown} param
25
+ * @param {(data: unknown) => unknown} handle
26
+ * @param {unknown} offParam
27
+ */
28
+
29
+ // 所有的订阅关系
30
+ const subscribeMap = {
31
+ holding: {},
32
+ entrust: {},
33
+ quotes: {},
34
+ selection: {}
35
+ }
36
+
37
+ // 保存到订阅关系
38
+ function saveStockSubscribeMap(val) {
39
+ const { module, isSubscribe, tag } = val
40
+ // 没有指定模块不操作
41
+ if (!module || !subscribeMap[module]) return
42
+ if (isSubscribe) {
43
+ // 订阅,追加
44
+ if (!needSubscribe(val)) {
45
+ // 非当前tab,状态置为false
46
+ val.isSubscribe = false
47
+ }
48
+ subscribeMap[module][tag] = val
49
+ } else {
50
+ // 取消订阅,删除
51
+ delete subscribeMap[module][tag]
52
+ }
53
+ }
54
+
55
+ // 批量处理订阅管理
56
+ function batchChangeStockSubscribe(isSubscribe, moduleKey) {
57
+ Object.keys(subscribeMap[moduleKey]).forEach(k => {
58
+ // 订阅状态无变化,不与原生交互
59
+ if (subscribeMap[moduleKey][k].isSubscribe === isSubscribe) return
60
+ const { isCommand } = subscribeMap[moduleKey][k]
61
+ subscribeMap[moduleKey][k].isSubscribe = isSubscribe
62
+ isCommand ? stockCommonSubscribe(subscribeMap[moduleKey][k]) : stockSubscribe(subscribeMap[moduleKey][k])
63
+ })
64
+ }
65
+
66
+ // 统一处理所有的订阅关系,息屏时关闭,亮屏时重新订阅
67
+ function changeStockSubscribeMap(type) {
68
+ Object.keys(subscribeMap).forEach(k => {
69
+ // 息屏全部关闭
70
+ let isSubscribe = type === 'hide' ? false : k === window.PE_ACTIVE_TAB
71
+ batchChangeStockSubscribe(isSubscribe, k)
72
+ })
73
+
74
+ // console.error('所有订阅', subscribeMap)
75
+ }
76
+
77
+ // 是否需要立即订阅
78
+ function needSubscribe(param) {
79
+ const { module } = param
80
+ return !module || module === window.PE_ACTIVE_TAB
81
+ }
82
+
83
+ window.changeStockSubscribeMap = changeStockSubscribeMap
84
+
85
+ function on(typeOrCommand, param, handle, offParam = {}, intervalTaskOptions) {
86
+
87
+ // 定时任务类型
88
+ if (typeOrCommand === 'intervalTask' && intervalTaskOptions) {
89
+ const { intervalTask, interval } = intervalTaskOptions;
90
+ let isTaskRunning = false;
91
+ let timerId = null;
92
+ let isActive = true; // 标记订阅是否仍然活跃
93
+
94
+ const executeTask = async () => {
95
+ if (!isActive || isTaskRunning) return;
96
+
97
+ isTaskRunning = true;
98
+ try {
99
+ const result = await intervalTask(param);
100
+ if (isActive) { // 检查是否仍然活跃
101
+ handle(result);
102
+ }
103
+ } catch (error) {
104
+ console.error('Interval task error:', error);
105
+ } finally {
106
+ isTaskRunning = false;
107
+ if (isActive) { // 检查是否仍然活跃
108
+ timerId = setTimeout(executeTask, interval);
109
+ }
110
+ }
111
+ };
112
+
113
+ // 立即执行第一次任务
114
+ executeTask();
115
+
116
+ return () => {
117
+ isActive = false; // 标记为不活跃
118
+ clearTimeout(timerId);
119
+ isTaskRunning = false;
120
+ };
121
+ }
122
+
123
+ const tag = uuid()
124
+
125
+ const wrapHandle = data => {
126
+ handle(data)
127
+ }
128
+
129
+ const parseHandle = data => {
130
+ wrapHandle(JSON.parse(data))
131
+ }
132
+
133
+ const isCommand = typeof typeOrCommand === 'string'
134
+
135
+ idToHandle.set(tag, isCommand ? parseHandle : wrapHandle)
136
+
137
+ handleToId.set(handle, tag)
138
+
139
+ let _params = { isSubscribe: true, tag, ...param }
140
+
141
+ saveStockSubscribeMap({ bizType: typeOrCommand, type: typeOrCommand, ..._params, isCommand })
142
+
143
+ if (!needSubscribe(_params)) return
144
+
145
+ isCommand
146
+ ? stockCommonSubscribe({ bizType: typeOrCommand, ..._params })
147
+ : stockSubscribe({ type: typeOrCommand, ..._params })
148
+
149
+ return () => {
150
+ return off(typeOrCommand, { ...param, ...offParam }, handle)
151
+ }
152
+ }
153
+
154
+ export function conditionOn(typeOrCommand, param, handle, lastTradeDate, currentDate, offParam = {}) {
155
+ if (+currentDate < +lastTradeDate) return null
156
+
157
+ return on(typeOrCommand, param, handle, offParam)
158
+ }
159
+
160
+ /**
161
+ * @param {number|string} typeOrCommand
162
+ * @param {unknown} params
163
+ * @param {(data: unknown) => unknown} handle
164
+ */
165
+ function off(typeOrCommand, params, handle) {
166
+ const tag = handleToId.get(handle)
167
+ const isCommand = typeof typeOrCommand === 'string'
168
+
169
+ if (tag) {
170
+ idToHandle.delete(tag)
171
+ handleToId.delete(handle)
172
+
173
+ let _params = { isSubscribe: false, tag, ...params }
174
+ saveStockSubscribeMap({ bizType: typeOrCommand, type: typeOrCommand, ..._params, isCommand })
175
+
176
+ return isCommand
177
+ ? stockCommonSubscribe({ bizType: typeOrCommand, ..._params })
178
+ : stockSubscribe({ type: typeOrCommand, ..._params })
179
+ }
180
+ }
181
+
182
+ /**
183
+ * @param {{ type: string, tags: string[], data: unknown }} event
184
+ */
185
+ function callback(event) {
186
+ let { tags, data } = event || {}
187
+
188
+ tags = tags || []
189
+ data = data || {}
190
+
191
+ tags.forEach(tag => {
192
+ const handle = idToHandle.get(tag)
193
+ if (handle) {
194
+ handle(data)
195
+ } else {
196
+ console.warn('no handle for tag:', tag)
197
+ }
198
+ })
199
+ }
200
+
201
+ window.stockCallback = callback
202
+ window.stockCommonCallback = callback
203
+
204
+ export const subscribe = { on, off }
@@ -0,0 +1,75 @@
1
+ /**
2
+ * [datasetValue animation]; [start timestamp];
3
+ * @type {Map<string, number>}
4
+ */
5
+ const cellDomMap = new Map()
6
+ let timer = null
7
+
8
+ function timeAwait(ms) {
9
+ return new Promise((resolve) => {
10
+ setTimeout(() => {
11
+ resolve();
12
+ }, ms);
13
+ });
14
+ }
15
+
16
+ export function runTimeoutLoop() {
17
+
18
+ clearTimeout(timer)
19
+ timer = null
20
+
21
+ const cells = cellDomMap.keys()
22
+
23
+ for (const cell of cells) {
24
+ const timestamp = cellDomMap.get(cell) || 0
25
+ if (timestamp + 1000 < Date.now()) {
26
+ removeAnimation(cell)
27
+ }
28
+ }
29
+
30
+ if (cellDomMap.size) {
31
+ timer = setTimeout(runTimeoutLoop, 1000)
32
+ }
33
+ }
34
+
35
+ /**
36
+ * @param {HTMLElement} cell
37
+ * @param {'up' | 'down'} type
38
+ */
39
+ export async function addAnimation(cell, type) {
40
+ if (!cell) return
41
+ if (cell.dataset['stock']) {
42
+ // 取消上一次的动画
43
+ removeAnimation(cell)
44
+ await timeAwait(1)
45
+ }
46
+
47
+ // 没有动画或不一致
48
+ if (cell.dataset['stock'] !== type) {
49
+ cell.dataset['stock'] = type
50
+ cellDomMap.set(cell, Date.now())
51
+ }
52
+ runTimeoutLoop()
53
+ }
54
+
55
+ export function removeAnimation(cell) {
56
+ if (!cell) return
57
+ try {
58
+ cell.dataset['stock'] = ''
59
+ cellDomMap.delete(cell)
60
+ } catch (error) {
61
+ console.error('removeAnimation Error', error)
62
+ }
63
+ }
64
+
65
+ export function updateSingleCellAnimation(cell, oldValue, newValue) {
66
+
67
+ oldValue = +oldValue
68
+ newValue = +newValue
69
+ // 如果有上涨下跌,重新添加动画
70
+ if (newValue > oldValue) {
71
+ addAnimation(cell, 'up')
72
+ } else if (newValue < oldValue) {
73
+ addAnimation(cell, 'down')
74
+ }
75
+ }
@@ -0,0 +1,31 @@
1
+ function isProd() {
2
+ return window.location.origin.indexOf('www.ycfm-erp.com') >= 0 || window.navigator.userAgent.indexOf('prod') > 0
3
+ }
4
+
5
+ // 是否是生产环境
6
+ export const IS_PROD = isProd()
7
+
8
+
9
+ // 应用名称
10
+ export const APP_TITLE = '股票'
11
+
12
+ // cas用到,值固定,不要更改
13
+ export const APP_ID = 'WYpeAOwQrfWnqzZZnAntSw=='
14
+
15
+ // 预留字段,暂不用到
16
+ export const MODULE_ID = 'moduleId'
17
+
18
+ // 在 erp/菜单管理/iaa/ 配置的菜单id,h5请求接口时,请求头x-menu-id会用到这个id
19
+ export const MENU = {
20
+ id: '156439900739872047',
21
+ title: '股票',
22
+ }
23
+
24
+ // keep-alive需要缓存的页面组件名称(name选项),逗号分隔,cahce_page = ['a', 'b']
25
+ export const CACHE_PAGE = 'home'
26
+
27
+ // 表格无限滚动 预加载的系数
28
+ export const rowsPerViewportRatio = 5
29
+
30
+ // 实时数据推送频率参数
31
+ window.updateTableBufferTime = { wait: 100, size: -1 }
package/src/config.js ADDED
@@ -0,0 +1 @@
1
+ export * from '@/config/index'
package/src/main.js ADDED
@@ -0,0 +1,73 @@
1
+ const Vue = window.Vue
2
+ window.ks = window.ks && window.ks.default
3
+ // window.ksui = window.ksui && window.ksui.default
4
+ import KSUI from '../kuasheng-ui/index.js'
5
+ window.ksui = KSUI
6
+
7
+ import initWeb from './web'
8
+ import {
9
+ MENU
10
+ } from './config'
11
+ window.ksui.menu = MENU || {}
12
+
13
+ import App from './App.vue'
14
+ import router from './router'
15
+ import("vconsole").then((module) => {
16
+ const VConsole = module.default
17
+ new VConsole({
18
+ defaultPlugins: [],
19
+ log: { maxLogNumber: 100, showTimestamps: true },
20
+ })
21
+ })
22
+ ks && ks.mock({
23
+ // getPushInfo: {
24
+ // userInfo: { employeeNumber: '093263', id: '109978' }
25
+ // },
26
+ setFullScreen: {},
27
+ request: {}
28
+ })
29
+
30
+ Vue.config.productionTip = true
31
+
32
+ // 初始化Vue
33
+ new Vue({
34
+ router,
35
+ data: {
36
+ init: true
37
+ },
38
+ render: h => h(App)
39
+ }).$mount('#app')
40
+
41
+ // 浏览器环境
42
+ if (navigator.userAgent.toLowerCase().indexOf('kuasheng-2.0') < 0) {
43
+ initWeb(function () {
44
+ // 初始化完成
45
+ })
46
+ }
47
+
48
+ let err = new ksui.errorPlugin({
49
+ type: '跨声H5'
50
+ })
51
+ err.vueErrorHandler(Vue)
52
+
53
+ // 启动全屏会隐藏(安卓/ios)自带的导航条,右上角会出现圆型关闭按钮
54
+ ks.setFullScreen({
55
+ isFullScreen: true
56
+ })
57
+
58
+ // 获取当前用户信息
59
+ ks.getUserInfo().then(res => {
60
+ window.ksui.user = res.userInfo || {}
61
+ ksui.watermark(res.userInfo.employeeNumber)
62
+ window.kyApm && window.kyApm.init({
63
+ whiteList: [],
64
+ userId: window.ksui.user.employeeNumber,
65
+ userName: window.ksui.user.name,
66
+ app: 'apm-ks',
67
+ module: 'H5Demo', // 模块名称
68
+ performance: { // 性能相关参数
69
+ durationTime: 2000, // 性能采集的统计时长阀值
70
+ },
71
+ })
72
+ })
73
+