@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,178 @@
1
+ <template>
2
+ <div class="ks-call">
3
+ <img class="ks-call_icon" src="https://erphostjs.kye-erp.com/kuasheng-h5/pe/ks-call-phone/phone.png" />
4
+ <div class="ks-call_desc">将使用此号码加密拨打</div>
5
+ <div class="ks-call_num">
6
+ <div class="ks-call_num_info" v-if="showPhoneInfo" @click="changePhoneStatus">
7
+ <div>{{ phone }}</div>
8
+ <img src="https://erphostjs.kye-erp.com/kuasheng-h5/assets/ks-call-phone/ks-call-phone-editor.png"/>
9
+ </div>
10
+ <div class="ks-call_num_editor" :class="{ 'ks-call_num_editor_error': showError}" v-else>
11
+ <van-field ref="callPhone" input-align="center" placeholder="请输入本机号码" v-model="phone" type="tel" label="" error-message="手机号格式错误" />
12
+ <img v-show="phone" @click="deletePhone" src="https://erphostjs.kye-erp.com/kuasheng-h5/assets/ks-call-phone/ks-call-phone-delete.png" />
13
+ </div>
14
+ </div>
15
+ <div class="ks-call_error" v-if="showError||!regPhone">请输入正确的手机号</div>
16
+ <div class="ks-call_tips">提示:本次通话记录会被监控</div>
17
+ <div class="ks-call_btn_group">
18
+ <ks-button type="primary" plain @click="cancelCall">取消</ks-button>
19
+ <ks-button type="primary" :disabled="!regPhone" @click="confirm">呼叫</ks-button>
20
+ </div>
21
+ </div>
22
+ </template>
23
+ <script>
24
+ export default {
25
+ name: 'KsCall',
26
+ props: {
27
+ model: {
28
+ type: Object
29
+ },
30
+ phone: {
31
+ type: String
32
+ }
33
+ },
34
+ data() {
35
+ return {
36
+ showPhoneInfo: true,
37
+ workStatusList: [],
38
+ showError: false
39
+ }
40
+ },
41
+ computed: {
42
+ regPhone() {
43
+ const reg = /^1[0-9]{10}$/
44
+ return reg.test(this.phone)
45
+ }
46
+ },
47
+ methods: {
48
+
49
+ // 呼叫事件
50
+ async confirm() {
51
+ if (this.regPhone) {
52
+ this.showError = false
53
+ const phone = await this.getCallPhone(this.model)
54
+ if (phone) {
55
+ location.href = "tel:" + phone
56
+ this.$emit('success', phone)
57
+ return
58
+ }
59
+ this.$toast('未找到对应手机号!')
60
+ this.$emit('callFail')
61
+ return
62
+ }
63
+ this.showError = true
64
+ this.$emit('callFail')
65
+ return
66
+ },
67
+ async getCallPhone() {
68
+ try {
69
+ const data = await this.$http('basevirtual.virtualPhoneV2.bindAxb', 10124 , {
70
+ callinPhone: this.model.callInPhone,
71
+ calloutPhone: this.phone,
72
+ business: 'sys',
73
+ source: '30',
74
+ isEncryptPhone: this.model.isEncrypt
75
+ })
76
+ return data.virtualPhone
77
+ } catch (error) {
78
+ console.log('error', error)
79
+ }
80
+ },
81
+ changePhoneStatus() {
82
+ this.showPhoneInfo = false
83
+ this.$nextTick(() => {
84
+ this.$refs.callPhone && this.$refs.callPhone.focus()
85
+ })
86
+ },
87
+ // 取消事件
88
+ cancelCall() {
89
+ this.$emit('cancel')
90
+ },
91
+ deletePhone () {
92
+ this.phone = ''
93
+ this.$emit('deletePhone')
94
+ this.$refs.callPhone && this.$refs.callPhone.focus()
95
+ }
96
+ },
97
+ }
98
+ </script>
99
+ <style lang="less">
100
+ .ks-call {
101
+ height: 100%;
102
+ width: 100%;
103
+ display: flex;
104
+ flex-direction: column;
105
+ align-items: center;
106
+ &_icon {
107
+ width: 88px;
108
+ margin-top: 10px;
109
+ }
110
+ &_desc {
111
+ font-size: 14px;
112
+ color: #181818;
113
+ line-height: 18px;
114
+ margin-top: 16px;
115
+ }
116
+ &_num {
117
+ color: #181818;
118
+ font-size: 24px;
119
+ margin-top: 20px;
120
+ display: flex;
121
+ &_info {
122
+ display: flex;
123
+ flex-direction: row;
124
+ align-items: center;
125
+ img {
126
+ width: 20px;
127
+ height: 20px;
128
+ margin-left: 10px;
129
+ }
130
+ }
131
+ &_editor {
132
+ padding-bottom: 10px;
133
+ border-bottom: 1px solid #d7d7db;
134
+ display: flex;
135
+ flex-direction: row;
136
+ align-items: center;
137
+ &_error {
138
+ border-bottom: 1px solid #FD4948;
139
+ }
140
+ .van-cell {
141
+ padding: 0;
142
+ font-size: 24px;
143
+ width: 220px;
144
+ }
145
+ .van-cell:not(:last-child)::after {
146
+ border-bottom: none;
147
+ }
148
+ img {
149
+ width: 22px;
150
+ height: 22px;
151
+ }
152
+ }
153
+ }
154
+ &_error {
155
+ font-size: 14px;
156
+ color: #FD4948;
157
+ margin-top: 10px;
158
+ }
159
+ &_tips {
160
+ font-size: 14px;
161
+ color: #858793;
162
+ margin-top: 20px;
163
+ }
164
+ &_btn_group {
165
+ width: 100%;
166
+ display: flex;
167
+ flex-direction: row;
168
+ justify-content: space-evenly;
169
+ margin-top: 26px;
170
+ margin-bottom: 30px;
171
+ .van-button {
172
+ width: 44%;
173
+ height: 40px;
174
+ border-radius: 8px;
175
+ }
176
+ }
177
+ }
178
+ </style>
@@ -0,0 +1,48 @@
1
+
2
+ import KsCallPhone from './index.vue'
3
+
4
+ class CallPhoneTool {
5
+ constructor() {
6
+ this.instance = null
7
+ }
8
+ open(model, eventHandlers = {}) {
9
+ // 创建一个新的 Vue 实例
10
+ const KsCallPhoneExtend = Vue.extend(KsCallPhone)
11
+ this.instance = new KsCallPhoneExtend({
12
+ el: document.createElement('div')
13
+ })
14
+ this.instance.model = model
15
+ this.instance.value = true
16
+ document.body.appendChild(this.instance.$el)
17
+
18
+ this.instance.$on('cancel', () => {
19
+ if (eventHandlers.cancel) {
20
+ eventHandlers.cancel()
21
+ }
22
+ this.close()
23
+ })
24
+
25
+ this.instance.$on('success', (val) => {
26
+ if (eventHandlers.success) {
27
+ eventHandlers.success(val)
28
+ }
29
+ this.close()
30
+ })
31
+
32
+ this.instance.$on('fail', () => {
33
+ if (eventHandlers.fail) {
34
+ eventHandlers.fail()
35
+ }
36
+ this.close()
37
+ })
38
+ }
39
+ close() {
40
+ if (this.instance) {
41
+ this.instance.$destroy() // 销毁实例
42
+ this.instance.$el.parentNode.removeChild(this.instance.$el) // 移除 DOM
43
+ this.instance = null // 清空实例
44
+ }
45
+ }
46
+ }
47
+
48
+ export default new CallPhoneTool()
@@ -0,0 +1,131 @@
1
+ <template>
2
+ <div class="ks-call-phone">
3
+ <ks-popup :value="showPopup"
4
+ class="ks-call-phone-popup"
5
+ v-on="$listeners"
6
+ v-bind="$attrs"
7
+ :lazy-render="false"
8
+ round
9
+ @closed="closed"
10
+ @click-overlay="cancel"
11
+ get-container="body"
12
+ position="bottom"
13
+ :safe-area-inset-bottom="true">
14
+ <ks-call ref="callPhone" :model="model" v-if="showCall" :phone="phone" @cancel="cancel" @success="success" @callFail="callFail"></ks-call>
15
+ <ks-call-tips :statusText="workStatusText" v-else @cancel="cancel" @changeCall="changeCall"></ks-call-tips>
16
+ </ks-popup>
17
+ </div>
18
+ </template>
19
+ <script>
20
+ import KsCall from './call.vue'
21
+ import { getLookup } from '../../utils/apis'
22
+ import KsCallTips from './call-tips.vue'
23
+ export default {
24
+ name: 'KsCallPhone',
25
+ components: {
26
+ KsCall,
27
+ KsCallTips
28
+ },
29
+ props: {
30
+ value: {
31
+ type: Boolean,
32
+ default: false
33
+ },
34
+ model: {
35
+ type: Object,
36
+ require: true,
37
+ default: () => {
38
+ return {
39
+ callOutUserId: '', // 呼叫用户id
40
+ callInPhone: '', // 呼入号码
41
+ callOutPhone: '', // 呼出号码
42
+ isEncrypt: 0, // 是否加密
43
+ }
44
+ }
45
+ }
46
+ },
47
+ data () {
48
+ return {
49
+ showCall: true,
50
+ workStatusText: '',
51
+ showPopup: false
52
+ }
53
+ },
54
+ watch: {
55
+ value(val) {
56
+ if (val) {
57
+ this.getEmployeeWorkStates()
58
+ }
59
+ }
60
+ },
61
+ mounted() {
62
+ this.getWorkList()
63
+ },
64
+ methods: {
65
+ setPhone() {
66
+ if (this.model.callOutPhone) {
67
+ this.phone = this.model.callOutPhone
68
+ } else {
69
+ ks.getUserInfo().then(res => {
70
+ const user = res.userInfo
71
+ this.phone = user.companyMobile || user.privateMobile
72
+ })
73
+ }
74
+ },
75
+ // 取消弹窗
76
+ cancel() {
77
+ this.showPopup = false
78
+ this.showCall = true
79
+ this.$refs.callPhone && (this.$refs.callPhone.showPhoneInfo = true)
80
+ ks.setCloseButton({ isShow: true })
81
+ this.$emit('input', false)
82
+ this.$emit('cancel')
83
+ },
84
+ closed() {
85
+ this.cancel()
86
+ },
87
+ changeCall() {
88
+ this.showCall = true
89
+ },
90
+ showPopUp() {
91
+ ks.setCloseButton({ isShow: false })
92
+ this.showPopup = true
93
+ this.setPhone()
94
+ },
95
+ // 判断当前用户的状态
96
+ async getEmployeeWorkStates() {
97
+ try {
98
+ const data = await this.$http('hr.remoteEmployee.getWorkStates', 10124, {
99
+ id: this.model.callOutUserId
100
+ })
101
+ const employeeStatus = data.workState
102
+ if (!this.workStatusList.length) {
103
+ await this.getWorkList()
104
+ }
105
+ // 判断是否为非工作中状态
106
+ if (employeeStatus && Number(employeeStatus)!== 10) {
107
+ this.workStatusText = this.workStatusList.find(item => Number(item.lookupCode) === Number(employeeStatus)).lookupValue
108
+ this.showCall = false
109
+ }
110
+ this.showPopUp()
111
+ } catch (error) {
112
+ this.changeCall()
113
+ this.showPopUp()
114
+ }
115
+ },
116
+ async getWorkList() {
117
+ const data = await getLookup(['hrms_employee_work_states'])
118
+ this.workStatusList = data[0].childrenLookupValues || []
119
+ },
120
+ success(val) {
121
+ this.$emit('success', val)
122
+ },
123
+ callFail() {
124
+ this.$emit('fail')
125
+ }
126
+ }
127
+ }
128
+ </script>
129
+ <style>
130
+
131
+ </style>
@@ -0,0 +1,23 @@
1
+ ## 日期选择组件
2
+
3
+ ### 参数
4
+
5
+ | 参数名 | 类型 | 说明 | 可选值 | 默认值 |
6
+ | ------------- | --------------------------------- | ------------------------------------------- | ---------------------------------------------------------------- | ------ |
7
+ | v-model | boolean | 是否显示 | true、false | false |
8
+ | horizontal | boolean | 是否横屏 | true、false | false |
9
+ | position | string | 弹出位置 | top、bottom、dropdown | bottom |
10
+ | top | number | position 为 dropdown 时需传入距屏幕顶部高度 | |
11
+ | default-value | date、number、string、array(范围) | 默认时间 | |
12
+ | year-range | array | 可选时间年限范围 | |
13
+ | min | date、number、string | 最小可选日期(月份) | |
14
+ | max | date、number、string | 最大可选日期(月份) | |
15
+ | showConfirm | boolean | 是否显示确认按钮 | true、false | true |
16
+ | type | string | 时间控件类型 | date、daterange、month、monthrange、week、quarter、dateweekmonth | date |
17
+
18
+ ### 事件
19
+
20
+ | 事件名 | 说明 |
21
+ | ------- | ---------------------------------------------------- |
22
+ | select | 选中日期或月份等触发,返回时间对象、范围选择返回数组 |
23
+ | confirm | 点击确认按钮触发,返回时间对象、范围选择返回数组 |
@@ -0,0 +1,123 @@
1
+ <template>
2
+ <van-popup
3
+ :value="value"
4
+ position="bottom"
5
+ get-container="body"
6
+ class="ks-date-picker-bottom-popup"
7
+ duration="0.2"
8
+ :closeable="true"
9
+ :close-on-click-overlay="closeOverlay"
10
+ safe-area-inset-bottom
11
+ @input="handleClosePopup"
12
+ @open="handleOpenPopup"
13
+ >
14
+ <div class="ks-date-picker ks-date-picker-bottom">
15
+ <div class="ks-date-picker-bottom__header">
16
+ <div class="ks-date-picker-bottom__header-title">
17
+ <span class="ks-date-picker-bottom__header-title-text">{{title}}</span>
18
+ <span class="ks-date-picker-bottom__header-title-start">{{startText}}</span>
19
+ <span v-show="type.includes('range') && startText" class="ks-date-picker-bottom__header-title-split"> - </span>
20
+ <span
21
+ v-show="type.includes('range') && startText"
22
+ class="ks-date-picker-bottom__header-title-end"
23
+ :class="{'ks-date-picker-bottom__header-title-end-not': startText && !endText}"
24
+ >
25
+ {{endText || (type === 'monthrange' ? '结束月份' : '结束时间')}}
26
+ </span>
27
+ </div>
28
+ </div>
29
+ <div class="ks-date-picker__body">
30
+ <component
31
+ ref="selector"
32
+ :is="currentCom"
33
+ v-bind="$attrs"
34
+ @select="handleSelect"
35
+ @change-type="changeType"
36
+ />
37
+ </div>
38
+ <div v-if="showConfirm" class="ks-date-picker-bottom__footer">
39
+ <slot name="reset"></slot>
40
+ <van-button type="primary" :disabled="!currentSelectedValue" block class="van-calendar__confirm" @click="handleConfirm">确定</van-button>
41
+ </div>
42
+ </div>
43
+ </van-popup>
44
+ </template>
45
+
46
+ <script>
47
+ import Mixins from './mixin.js'
48
+
49
+ const titleMap = {
50
+ 'date': '日期选择',
51
+ 'daterange': '日期选择',
52
+ 'month': '月份选择',
53
+ 'monthrange': '月份选择',
54
+ 'week': '周选择',
55
+ 'quarter': '季度选择',
56
+ }
57
+
58
+ export default {
59
+ name: 'date-picker-bottom',
60
+ mixins: [Mixins],
61
+ data () {
62
+ return {
63
+ dateweekmonthType: 'date'
64
+ }
65
+ },
66
+ computed: {
67
+ title () {
68
+ if (this.type === 'dateweekmonth') {
69
+ return titleMap[this.dateweekmonthType]
70
+ } else {
71
+ return titleMap[this.type]
72
+ }
73
+ }
74
+ },
75
+ methods: {
76
+ changeType (e) {
77
+ this.dateweekmonthType = e
78
+ }
79
+ }
80
+ }
81
+ </script>
82
+
83
+ <style lang="less">
84
+ @import url("./style.less");
85
+ .ks-date-picker-bottom-popup {
86
+ height: 82%;
87
+ border-radius: 12px 12px 0 0;
88
+ .van-popup__close-icon--top-right {
89
+ top: 13px;
90
+ color: #999999;
91
+ }
92
+ }
93
+ .ks-date-picker-bottom {
94
+ height: 82vh;
95
+ overflow: hidden;
96
+ display: flex;
97
+ flex-direction: column;
98
+ &__header {
99
+ height: 48px;
100
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
101
+ box-shadow: 0 3px 8px 0 rgba(235,235,235,0.30);
102
+ &-title {
103
+ position: relative;
104
+ .header-title-text(48px);
105
+ &-text {
106
+ font-size: 18px;
107
+ font-weight: bold;
108
+ position: absolute;
109
+ left: 16px;
110
+ color: #333;
111
+ }
112
+ }
113
+ }
114
+ &__footer {
115
+ display: flex;
116
+ flex-direction: row;
117
+ .van-calendar__confirm:nth-child(2) {
118
+ margin-left: 16px;
119
+ }
120
+ .footer-btn();
121
+ }
122
+ }
123
+ </style>
@@ -0,0 +1,80 @@
1
+ <template>
2
+ <div v-show="value" ref="datepickerDropdown" class="ks-date-picker-dropdown-warpper" :style="{top: `${top}px`}">
3
+ <van-popup
4
+ :value="value"
5
+ position="top"
6
+ :overlay-style="{position: 'absolute'}"
7
+ :get-container="getContainer"
8
+ class="ks-date-picker-dropdown-popup"
9
+ duration="0.2"
10
+ :closeable="false"
11
+ :close-on-click-overlay="closeOverlay"
12
+ @input="handleClosePopup"
13
+ @open="handleOpenPopup"
14
+ >
15
+ <div class="ks-date-picker ks-date-picker-dropdown">
16
+ <div class="ks-date-picker__body">
17
+ <component
18
+ ref="selector"
19
+ :is="currentCom"
20
+ v-bind="$attrs"
21
+ @select="handleSelect"
22
+ />
23
+ </div>
24
+ <div v-if="showConfirm" class="ks-date-picker-dropdown__footer">
25
+ <van-button type="primary" :disabled="!currentSelectedValue" block class="van-calendar__confirm" @click="handleConfirm">确定</van-button>
26
+ </div>
27
+ </div>
28
+ </van-popup>
29
+ </div>
30
+ </template>
31
+
32
+ <script>
33
+ import Mixins from './mixin.js'
34
+
35
+ export default {
36
+ name: 'date-picker-dropdown',
37
+ mixins: [Mixins],
38
+ props: {
39
+ top: {
40
+ type: Number,
41
+ default: 0
42
+ }
43
+ },
44
+ methods: {
45
+ getContainer () {
46
+ return this.$refs.datepickerDropdown
47
+ }
48
+ }
49
+ }
50
+ </script>
51
+
52
+ <style lang="less">
53
+ @import url("./style.less");
54
+ .ks-date-picker-dropdown-warpper {
55
+ position: fixed;
56
+ left: 0;
57
+ right: 0;
58
+ bottom: 0;
59
+ z-index: 10;
60
+ overflow: hidden;
61
+ }
62
+ .ks-date-picker-dropdown-popup {
63
+ position: absolute;
64
+ height: 88%;
65
+ border-radius: 0 0 12px 12px;
66
+ .van-popup__close-icon--top-left {
67
+ top: 10px;
68
+ color: #999999;
69
+ }
70
+ }
71
+ .ks-date-picker-dropdown {
72
+ height: 100%;
73
+ overflow: hidden;
74
+ display: flex;
75
+ flex-direction: column;
76
+ &__footer {
77
+ .footer-btn();
78
+ }
79
+ }
80
+ </style>
@@ -0,0 +1,87 @@
1
+ <template>
2
+ <van-popup
3
+ :value="value"
4
+ position="right"
5
+ get-container="body"
6
+ class="ks-date-picker-right-popup"
7
+ duration="0.2"
8
+ :closeable="true"
9
+ :close-on-click-overlay="closeOverlay"
10
+ close-icon-position="top-left"
11
+ close-icon="arrow-left"
12
+ @input="handleClosePopup"
13
+ @open="handleOpenPopup"
14
+ >
15
+ <div class="ks-date-picker ks-date-picker-right">
16
+ <div class="ks-date-picker-right__header">
17
+ <div class="ks-date-picker-right__header-title">
18
+ <span class="ks-date-picker-right__header-title-start">{{startText}}</span>
19
+ <span v-show="type.includes('range') && startText" class="ks-date-picker-right__header-title-split"> - </span>
20
+ <span
21
+ v-show="type.includes('range') && startText"
22
+ class="ks-date-picker-right__header-title-end"
23
+ :class="{'ks-date-picker-right__header-title-end-not': startText && !endText}"
24
+ >
25
+ {{endText || (type === 'monthrange' ? '结束月份' : '结束时间')}}
26
+ </span>
27
+ </div>
28
+ </div>
29
+ <div class="ks-date-picker__body">
30
+ <component
31
+ ref="selector"
32
+ :is="currentCom"
33
+ v-bind="$attrs"
34
+ @select="handleSelect"
35
+ />
36
+ </div>
37
+ <div v-if="showConfirm" class="ks-date-picker-right__footer">
38
+ <van-button type="primary" :disabled="!currentSelectedValue" block class="van-calendar__confirm" @click="handleConfirm">确定</van-button>
39
+ </div>
40
+ </div>
41
+ </van-popup>
42
+ </template>
43
+
44
+ <script>
45
+ import Mixins from './mixin.js'
46
+
47
+ export default {
48
+ name: 'date-picker-right',
49
+ mixins: [Mixins]
50
+ }
51
+ </script>
52
+
53
+ <style lang="less">
54
+ @import url("./style.less");
55
+ .ks-date-picker-right-popup {
56
+ width: 70%;
57
+ .van-popup__close-icon--top-left {
58
+ top: 10px;
59
+ color: #999999;
60
+ }
61
+ }
62
+ .ks-date-picker-right {
63
+ height: 100vh;
64
+ overflow: hidden;
65
+ display: flex;
66
+ flex-direction: column;
67
+ &__header {
68
+ height: 40px;
69
+ width: 375px;
70
+ margin: 0 auto;
71
+ &-title {
72
+ .header-title-text();
73
+ box-shadow: 0 3px 10px 0 rgba(235,235,235,0.30);
74
+ }
75
+ }
76
+ .ks-date-picker__body {
77
+ width: 375px;
78
+ margin: 0 auto;
79
+ }
80
+ &__footer {
81
+ height: 60px;
82
+ padding: 16px 80px 0 80px;
83
+ box-shadow: 0 0 4px 0 rgba(115,162,255,0.22);
84
+ z-index: 1;
85
+ }
86
+ }
87
+ </style>