@kengic/uni 0.6.3-beta.4 → 0.6.3-beta.41

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 (208) hide show
  1. package/{dist/api → api}/WMS/Controllers/CommonController/GetLatestApkVersion.ts +21 -21
  2. package/{dist/api → api}/WMS/Controllers/CommonController/index.ts +1 -1
  3. package/{dist/api → api}/WMS/Controllers/LoginController/GetUserInfo.ts +21 -21
  4. package/{dist/api → api}/WMS/Controllers/LoginController/Logout.ts +21 -21
  5. package/{dist/api → api}/WMS/Controllers/LoginController/index.ts +2 -2
  6. package/{dist/api → api}/WMS/Controllers/WhController/ListVO.ts +88 -88
  7. package/{dist/api → api}/WMS/Controllers/WhController/index.ts +1 -1
  8. package/{dist/api → api}/WMS/Controllers/WorkstationController/List.ts +45 -45
  9. package/{dist/api → api}/WMS/Controllers/WorkstationController/index.ts +1 -1
  10. package/{dist/api → api}/WMS/Controllers/index.ts +4 -4
  11. package/{dist/api → api}/WMS/index.ts +2 -2
  12. package/{dist/api → api}/WMS/models.ts +342 -318
  13. package/{dist/api → api}/api.ts +1 -1
  14. package/{dist/api → api}/def.ts +1 -1
  15. package/{dist/api → api}/index.ts +2 -2
  16. package/{dist/component → component}/KgStation/KgStation.vue +120 -9
  17. package/{dist/component → component}/KgStation/index.hooks.ts +1 -1
  18. package/{dist/component → component}/KgUpdatePopup/KgUpdatePopup.vue +1 -1
  19. package/{dist/component → component}/KgWarehouse/KgWarehouse.vue +1 -1
  20. package/{dist/const → const}/index.vm.ts +10 -0
  21. package/index.css +73 -0
  22. package/lodash-es.ts +1 -0
  23. package/package.json +10 -44
  24. package/{dist/service → service}/http-client.ts +109 -63
  25. package/{dist/store → store}/app.store.ts +12 -0
  26. package/{dist/uni → uni}/uni-ui/uni-data-select/uni-data-select.vue +5 -4
  27. package/uni/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +1071 -0
  28. package/{dist/uni → uni}/uni-ui/uni-easyinput/common.js +1 -0
  29. package/{dist/uni → uni}/uni-ui/uni-easyinput/uni-easyinput.vue +23 -70
  30. package/{dist/uni → uni}/uni-ui/uni-pagination/uni-pagination.vue +8 -4
  31. package/{dist/uni → uni}/uni-ui/uni-segmented-control/uni-segmented-control.vue +4 -4
  32. package/uni/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +403 -0
  33. package/{dist/util → util}/kg.ts +62 -14
  34. package/CHANGELOG.md +0 -15
  35. package/README.md +0 -1
  36. package/dist/index.css +0 -28
  37. package/dist/src/index.d.ts +0 -1
  38. package/dist/uni/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +0 -1026
  39. package/dist/uni/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +0 -347
  40. package/dist/uni/uni-ui/uni-swipe-action-item/wx.wxs +0 -341
  41. /package/{dist/component → component}/KgNavBar/KgNavBar.vue +0 -0
  42. /package/{dist/component → component}/KgNavBar/index.ts +0 -0
  43. /package/{dist/component → component}/KgStation/index.store.ts +0 -0
  44. /package/{dist/component → component}/KgStation/index.ts +0 -0
  45. /package/{dist/component → component}/KgTabBar/KgTabBar.vue +0 -0
  46. /package/{dist/component → component}/KgTabBar/index.ts +0 -0
  47. /package/{dist/component → component}/KgUpdatePopup/index.ts +0 -0
  48. /package/{dist/component → component}/KgWarehouse/index.hooks.ts +0 -0
  49. /package/{dist/component → component}/KgWarehouse/index.store.ts +0 -0
  50. /package/{dist/component → component}/KgWarehouse/index.ts +0 -0
  51. /package/{dist/component → component}/index.ts +0 -0
  52. /package/{dist/config → config}/index.ts +0 -0
  53. /package/{dist/config → config}/setup.ts +0 -0
  54. /package/{dist/const → const}/index.ts +0 -0
  55. /package/{dist/index.ts → index.ts} +0 -0
  56. /package/{dist/service → service}/index.ts +0 -0
  57. /package/{dist/uni → uni}/index.ts +0 -0
  58. /package/{dist/uni → uni}/uni-ui/README.md +0 -0
  59. /package/{dist/uni → uni}/uni-ui/index.ts +0 -0
  60. /package/{dist/uni → uni}/uni-ui/uni-badge/uni-badge.vue +0 -0
  61. /package/{dist/uni → uni}/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +0 -0
  62. /package/{dist/uni → uni}/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +0 -0
  63. /package/{dist/uni → uni}/uni-ui/uni-calendar/calendar.js +0 -0
  64. /package/{dist/uni → uni}/uni-ui/uni-calendar/i18n/en.json +0 -0
  65. /package/{dist/uni → uni}/uni-ui/uni-calendar/i18n/index.js +0 -0
  66. /package/{dist/uni → uni}/uni-ui/uni-calendar/i18n/zh-Hans.json +0 -0
  67. /package/{dist/uni → uni}/uni-ui/uni-calendar/i18n/zh-Hant.json +0 -0
  68. /package/{dist/uni → uni}/uni-ui/uni-calendar/uni-calendar-item.vue +0 -0
  69. /package/{dist/uni → uni}/uni-ui/uni-calendar/uni-calendar.vue +0 -0
  70. /package/{dist/uni → uni}/uni-ui/uni-calendar/util.js +0 -0
  71. /package/{dist/uni → uni}/uni-ui/uni-card/uni-card.vue +0 -0
  72. /package/{dist/uni → uni}/uni-ui/uni-col/uni-col.vue +0 -0
  73. /package/{dist/uni → uni}/uni-ui/uni-collapse/uni-collapse.vue +0 -0
  74. /package/{dist/uni → uni}/uni-ui/uni-collapse-item/uni-collapse-item.vue +0 -0
  75. /package/{dist/uni → uni}/uni-ui/uni-combox/uni-combox.vue +0 -0
  76. /package/{dist/uni → uni}/uni-ui/uni-countdown/i18n/en.json +0 -0
  77. /package/{dist/uni → uni}/uni-ui/uni-countdown/i18n/index.js +0 -0
  78. /package/{dist/uni → uni}/uni-ui/uni-countdown/i18n/zh-Hans.json +0 -0
  79. /package/{dist/uni → uni}/uni-ui/uni-countdown/i18n/zh-Hant.json +0 -0
  80. /package/{dist/uni → uni}/uni-ui/uni-countdown/uni-countdown.vue +0 -0
  81. /package/{dist/uni → uni}/uni-ui/uni-data-checkbox/uni-data-checkbox.vue +0 -0
  82. /package/{dist/uni → uni}/uni-ui/uni-data-picker/keypress.js +0 -0
  83. /package/{dist/uni → uni}/uni-ui/uni-data-picker/uni-data-picker.vue +0 -0
  84. /package/{dist/uni → uni}/uni-ui/uni-data-pickerview/uni-data-picker.js +0 -0
  85. /package/{dist/uni → uni}/uni-ui/uni-data-pickerview/uni-data-pickerview.vue +0 -0
  86. /package/{dist/uni → uni}/uni-ui/uni-dateformat/date-format.js +0 -0
  87. /package/{dist/uni → uni}/uni-ui/uni-dateformat/uni-dateformat.vue +0 -0
  88. /package/{dist/uni → uni}/uni-ui/uni-datetime-picker/calendar-item.vue +0 -0
  89. /package/{dist/uni → uni}/uni-ui/uni-datetime-picker/calendar.vue +0 -0
  90. /package/{dist/uni → uni}/uni-ui/uni-datetime-picker/i18n/en.json +0 -0
  91. /package/{dist/uni → uni}/uni-ui/uni-datetime-picker/i18n/index.js +0 -0
  92. /package/{dist/uni → uni}/uni-ui/uni-datetime-picker/i18n/zh-Hans.json +0 -0
  93. /package/{dist/uni → uni}/uni-ui/uni-datetime-picker/i18n/zh-Hant.json +0 -0
  94. /package/{dist/uni → uni}/uni-ui/uni-datetime-picker/time-picker.vue +0 -0
  95. /package/{dist/uni → uni}/uni-ui/uni-datetime-picker/util.js +0 -0
  96. /package/{dist/uni → uni}/uni-ui/uni-drawer/keypress.js +0 -0
  97. /package/{dist/uni → uni}/uni-ui/uni-drawer/uni-drawer.vue +0 -0
  98. /package/{dist/uni → uni}/uni-ui/uni-fab/uni-fab.vue +0 -0
  99. /package/{dist/uni → uni}/uni-ui/uni-fav/i18n/en.json +0 -0
  100. /package/{dist/uni → uni}/uni-ui/uni-fav/i18n/index.js +0 -0
  101. /package/{dist/uni → uni}/uni-ui/uni-fav/i18n/zh-Hans.json +0 -0
  102. /package/{dist/uni → uni}/uni-ui/uni-fav/i18n/zh-Hant.json +0 -0
  103. /package/{dist/uni → uni}/uni-ui/uni-fav/uni-fav.vue +0 -0
  104. /package/{dist/uni → uni}/uni-ui/uni-file-picker/choose-and-upload-file.js +0 -0
  105. /package/{dist/uni → uni}/uni-ui/uni-file-picker/uni-file-picker.vue +0 -0
  106. /package/{dist/uni → uni}/uni-ui/uni-file-picker/upload-file.vue +0 -0
  107. /package/{dist/uni → uni}/uni-ui/uni-file-picker/upload-image.vue +0 -0
  108. /package/{dist/uni → uni}/uni-ui/uni-file-picker/utils.js +0 -0
  109. /package/{dist/uni → uni}/uni-ui/uni-forms/uni-forms.vue +0 -0
  110. /package/{dist/uni → uni}/uni-ui/uni-forms/utils.js +0 -0
  111. /package/{dist/uni → uni}/uni-ui/uni-forms/validate.js +0 -0
  112. /package/{dist/uni → uni}/uni-ui/uni-forms-item/uni-forms-item.vue +0 -0
  113. /package/{dist/uni → uni}/uni-ui/uni-goods-nav/i18n/en.json +0 -0
  114. /package/{dist/uni → uni}/uni-ui/uni-goods-nav/i18n/index.js +0 -0
  115. /package/{dist/uni → uni}/uni-ui/uni-goods-nav/i18n/zh-Hans.json +0 -0
  116. /package/{dist/uni → uni}/uni-ui/uni-goods-nav/i18n/zh-Hant.json +0 -0
  117. /package/{dist/uni → uni}/uni-ui/uni-goods-nav/uni-goods-nav.vue +0 -0
  118. /package/{dist/uni → uni}/uni-ui/uni-grid/uni-grid.vue +0 -0
  119. /package/{dist/uni → uni}/uni-ui/uni-grid-item/uni-grid-item.vue +0 -0
  120. /package/{dist/uni → uni}/uni-ui/uni-group/uni-group.vue +0 -0
  121. /package/{dist/uni → uni}/uni-ui/uni-icons/icons.js +0 -0
  122. /package/{dist/uni → uni}/uni-ui/uni-icons/uni-icons.vue +0 -0
  123. /package/{dist/uni → uni}/uni-ui/uni-icons/uniicons.css +0 -0
  124. /package/{dist/uni → uni}/uni-ui/uni-icons/uniicons.ttf +0 -0
  125. /package/{dist/uni → uni}/uni-ui/uni-icons/uniicons_file.ts +0 -0
  126. /package/{dist/uni → uni}/uni-ui/uni-icons/uniicons_file_vue.js +0 -0
  127. /package/{dist/uni → uni}/uni-ui/uni-indexed-list/uni-indexed-list-item.vue +0 -0
  128. /package/{dist/uni → uni}/uni-ui/uni-indexed-list/uni-indexed-list.vue +0 -0
  129. /package/{dist/uni → uni}/uni-ui/uni-link/uni-link.vue +0 -0
  130. /package/{dist/uni → uni}/uni-ui/uni-list/uni-list.vue +0 -0
  131. /package/{dist/uni → uni}/uni-ui/uni-list/uni-refresh.vue +0 -0
  132. /package/{dist/uni → uni}/uni-ui/uni-list/uni-refresh.wxs +0 -0
  133. /package/{dist/uni → uni}/uni-ui/uni-list-ad/uni-list-ad.vue +0 -0
  134. /package/{dist/uni → uni}/uni-ui/uni-list-chat/uni-list-chat.scss +0 -0
  135. /package/{dist/uni → uni}/uni-ui/uni-list-chat/uni-list-chat.vue +0 -0
  136. /package/{dist/uni → uni}/uni-ui/uni-list-item/uni-list-item.vue +0 -0
  137. /package/{dist/uni → uni}/uni-ui/uni-load-more/i18n/en.json +0 -0
  138. /package/{dist/uni → uni}/uni-ui/uni-load-more/i18n/index.js +0 -0
  139. /package/{dist/uni → uni}/uni-ui/uni-load-more/i18n/zh-Hans.json +0 -0
  140. /package/{dist/uni → uni}/uni-ui/uni-load-more/i18n/zh-Hant.json +0 -0
  141. /package/{dist/uni → uni}/uni-ui/uni-load-more/uni-load-more.vue +0 -0
  142. /package/{dist/uni → uni}/uni-ui/uni-nav-bar/uni-nav-bar.vue +0 -0
  143. /package/{dist/uni → uni}/uni-ui/uni-nav-bar/uni-status-bar.vue +0 -0
  144. /package/{dist/uni → uni}/uni-ui/uni-notice-bar/uni-notice-bar.vue +0 -0
  145. /package/{dist/uni → uni}/uni-ui/uni-number-box/uni-number-box.vue +0 -0
  146. /package/{dist/uni → uni}/uni-ui/uni-pagination/i18n/en.json +0 -0
  147. /package/{dist/uni → uni}/uni-ui/uni-pagination/i18n/es.json +0 -0
  148. /package/{dist/uni → uni}/uni-ui/uni-pagination/i18n/fr.json +0 -0
  149. /package/{dist/uni → uni}/uni-ui/uni-pagination/i18n/index.js +0 -0
  150. /package/{dist/uni → uni}/uni-ui/uni-pagination/i18n/zh-Hans.json +0 -0
  151. /package/{dist/uni → uni}/uni-ui/uni-pagination/i18n/zh-Hant.json +0 -0
  152. /package/{dist/uni → uni}/uni-ui/uni-popup/i18n/en.json +0 -0
  153. /package/{dist/uni → uni}/uni-ui/uni-popup/i18n/index.js +0 -0
  154. /package/{dist/uni → uni}/uni-ui/uni-popup/i18n/zh-Hans.json +0 -0
  155. /package/{dist/uni → uni}/uni-ui/uni-popup/i18n/zh-Hant.json +0 -0
  156. /package/{dist/uni → uni}/uni-ui/uni-popup/keypress.js +0 -0
  157. /package/{dist/uni → uni}/uni-ui/uni-popup/popup.js +0 -0
  158. /package/{dist/uni → uni}/uni-ui/uni-popup/uni-popup.vue +0 -0
  159. /package/{dist/uni → uni}/uni-ui/uni-popup-dialog/keypress.js +0 -0
  160. /package/{dist/uni → uni}/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +0 -0
  161. /package/{dist/uni → uni}/uni-ui/uni-popup-message/uni-popup-message.vue +0 -0
  162. /package/{dist/uni → uni}/uni-ui/uni-popup-share/uni-popup-share.vue +0 -0
  163. /package/{dist/uni → uni}/uni-ui/uni-rate/uni-rate.vue +0 -0
  164. /package/{dist/uni → uni}/uni-ui/uni-row/uni-row.vue +0 -0
  165. /package/{dist/uni → uni}/uni-ui/uni-scss/changelog.md +0 -0
  166. /package/{dist/uni → uni}/uni-ui/uni-scss/index.scss +0 -0
  167. /package/{dist/uni → uni}/uni-ui/uni-scss/package.json +0 -0
  168. /package/{dist/uni → uni}/uni-ui/uni-scss/readme.md +0 -0
  169. /package/{dist/uni → uni}/uni-ui/uni-scss/styles/index.scss +0 -0
  170. /package/{dist/uni → uni}/uni-ui/uni-scss/styles/setting/_border.scss +0 -0
  171. /package/{dist/uni → uni}/uni-ui/uni-scss/styles/setting/_color.scss +0 -0
  172. /package/{dist/uni → uni}/uni-ui/uni-scss/styles/setting/_radius.scss +0 -0
  173. /package/{dist/uni → uni}/uni-ui/uni-scss/styles/setting/_space.scss +0 -0
  174. /package/{dist/uni → uni}/uni-ui/uni-scss/styles/setting/_styles.scss +0 -0
  175. /package/{dist/uni → uni}/uni-ui/uni-scss/styles/setting/_text.scss +0 -0
  176. /package/{dist/uni → uni}/uni-ui/uni-scss/styles/setting/_variables.scss +0 -0
  177. /package/{dist/uni → uni}/uni-ui/uni-scss/styles/tools/functions.scss +0 -0
  178. /package/{dist/uni → uni}/uni-ui/uni-scss/theme.scss +0 -0
  179. /package/{dist/uni → uni}/uni-ui/uni-scss/variables.scss +0 -0
  180. /package/{dist/uni → uni}/uni-ui/uni-search-bar/i18n/en.json +0 -0
  181. /package/{dist/uni → uni}/uni-ui/uni-search-bar/i18n/index.js +0 -0
  182. /package/{dist/uni → uni}/uni-ui/uni-search-bar/i18n/zh-Hans.json +0 -0
  183. /package/{dist/uni → uni}/uni-ui/uni-search-bar/i18n/zh-Hant.json +0 -0
  184. /package/{dist/uni → uni}/uni-ui/uni-search-bar/uni-search-bar.vue +0 -0
  185. /package/{dist/uni → uni}/uni-ui/uni-section/uni-section.vue +0 -0
  186. /package/{dist/uni → uni}/uni-ui/uni-steps/uni-steps.vue +0 -0
  187. /package/{dist/uni → uni}/uni-ui/uni-swipe-action/uni-swipe-action.vue +0 -0
  188. /package/{dist/uni → uni}/uni-ui/uni-swipe-action-item/bindingx.js +0 -0
  189. /package/{dist/uni → uni}/uni-ui/uni-swipe-action-item/isPC.js +0 -0
  190. /package/{dist/uni → uni}/uni-ui/uni-swipe-action-item/mpalipay.js +0 -0
  191. /package/{dist/uni → uni}/uni-ui/uni-swipe-action-item/mpother.js +0 -0
  192. /package/{dist/uni → uni}/uni-ui/uni-swipe-action-item/mpwxs.js +0 -0
  193. /package/{dist/uni → uni}/uni-ui/uni-swipe-action-item/render.js +0 -0
  194. /package/{dist/uni → uni}/uni-ui/uni-swiper-dot/uni-swiper-dot.vue +0 -0
  195. /package/{dist/uni → uni}/uni-ui/uni-table/uni-table.vue +0 -0
  196. /package/{dist/uni → uni}/uni-ui/uni-tag/uni-tag.vue +0 -0
  197. /package/{dist/uni → uni}/uni-ui/uni-tbody/uni-tbody.vue +0 -0
  198. /package/{dist/uni → uni}/uni-ui/uni-td/uni-td.vue +0 -0
  199. /package/{dist/uni → uni}/uni-ui/uni-th/filter-dropdown.vue +0 -0
  200. /package/{dist/uni → uni}/uni-ui/uni-th/uni-th.vue +0 -0
  201. /package/{dist/uni → uni}/uni-ui/uni-thead/uni-thead.vue +0 -0
  202. /package/{dist/uni → uni}/uni-ui/uni-title/uni-title.vue +0 -0
  203. /package/{dist/uni → uni}/uni-ui/uni-tooltip/uni-tooltip.vue +0 -0
  204. /package/{dist/uni → uni}/uni-ui/uni-tr/table-checkbox.vue +0 -0
  205. /package/{dist/uni → uni}/uni-ui/uni-tr/uni-tr.vue +0 -0
  206. /package/{dist/uni → uni}/uni-ui/uni-transition/createAnimation.js +0 -0
  207. /package/{dist/uni → uni}/uni-ui/uni-transition/uni-transition.vue +0 -0
  208. /package/{dist/util → util}/index.ts +0 -0
@@ -1,1026 +0,0 @@
1
- <template>
2
- <view class="uni-date">
3
- <view class="uni-date-editor" @click="show">
4
- <slot>
5
- <view
6
- class="uni-date-editor--x"
7
- :class="{'uni-date-editor--x__disabled': disabled,'uni-date-x--border': border}"
8
- >
9
- <view v-if="!isRange" class="uni-date-x uni-date-single">
10
- <uni-icons class="icon-calendar" type="calendar" color="#c0c4cc" size="22"></uni-icons>
11
- <view class="uni-date__x-input">{{ displayValue || singlePlaceholderText }}</view>
12
- </view>
13
-
14
- <view v-else class="uni-date-x uni-date-range">
15
- <uni-icons class="icon-calendar" type="calendar" color="#c0c4cc" size="22"></uni-icons>
16
- <view class="uni-date__x-input text-center">{{ displayRangeValue.startDate || startPlaceholderText }}</view>
17
-
18
- <view class="range-separator">{{rangeSeparator}}</view>
19
-
20
- <view class="uni-date__x-input text-center">{{ displayRangeValue.endDate || endPlaceholderText }}</view>
21
- </view>
22
-
23
- <view v-if="showClearIcon" class="uni-date__icon-clear" @click.stop="clear">
24
- <uni-icons type="clear" color="#c0c4cc" size="22"></uni-icons>
25
- </view>
26
- </view>
27
- </slot>
28
- </view>
29
-
30
- <view v-show="pickerVisible" class="uni-date-mask--pc" @click="close"></view>
31
-
32
- <view v-if="!isPhone" v-show="pickerVisible" ref="datePicker" class="uni-date-picker__container">
33
- <view v-if="!isRange" class="uni-date-single--x" :style="pickerPositionStyle">
34
- <view class="uni-popper__arrow"></view>
35
-
36
- <view v-if="hasTime" class="uni-date-changed popup-x-header">
37
- <input class="uni-date__input text-center" type="text" v-model="inputDate"
38
- :placeholder="selectDateText" />
39
-
40
- <time-picker type="time" v-model="pickerTime" :border="false" :disabled="!inputDate"
41
- :start="timepickerStartTime" :end="timepickerEndTime" :hideSecond="hideSecond" style="width: 100%;">
42
- <input class="uni-date__input text-center" type="text" v-model="pickerTime" :placeholder="selectTimeText"
43
- :disabled="!inputDate" />
44
- </time-picker>
45
- </view>
46
-
47
- <Calendar ref="pcSingle" :showMonth="false" :start-date="calendarRange.startDate"
48
- :end-date="calendarRange.endDate" :date="calendarDate" @change="singleChange"
49
- :default-value="defaultValue"
50
- style="padding: 0 8px;" />
51
-
52
- <view v-if="hasTime" class="popup-x-footer">
53
- <text class="confirm-text" @click="confirmSingleChange">{{okText}}</text>
54
- </view>
55
- </view>
56
-
57
- <view v-else class="uni-date-range--x" :style="pickerPositionStyle">
58
- <view class="uni-popper__arrow"></view>
59
- <view v-if="hasTime" class="popup-x-header uni-date-changed">
60
- <view class="popup-x-header--datetime">
61
- <input class="uni-date__input uni-date-range__input" type="text" v-model="tempRange.startDate"
62
- :placeholder="startDateText" />
63
-
64
- <time-picker type="time" v-model="tempRange.startTime" :start="timepickerStartTime" :border="false"
65
- :disabled="!tempRange.startDate" :hideSecond="hideSecond">
66
- <input class="uni-date__input uni-date-range__input" type="text"
67
- v-model="tempRange.startTime" :placeholder="startTimeText"
68
- :disabled="!tempRange.startDate" />
69
- </time-picker>
70
- </view>
71
-
72
- <uni-icons type="arrowthinright" color="#999" style="line-height: 40px;"></uni-icons>
73
-
74
- <view class="popup-x-header--datetime">
75
- <input class="uni-date__input uni-date-range__input" type="text" v-model="tempRange.endDate"
76
- :placeholder="endDateText" />
77
-
78
- <time-picker type="time" v-model="tempRange.endTime" :end="timepickerEndTime" :border="false"
79
- :disabled="!tempRange.endDate" :hideSecond="hideSecond">
80
- <input class="uni-date__input uni-date-range__input" type="text" v-model="tempRange.endTime"
81
- :placeholder="endTimeText" :disabled="!tempRange.endDate" />
82
- </time-picker>
83
- </view>
84
- </view>
85
-
86
- <view class="popup-x-body">
87
- <Calendar ref="left" :showMonth="false" :start-date="calendarRange.startDate"
88
- :end-date="calendarRange.endDate" :range="true" :pleStatus="endMultipleStatus"
89
- @change="leftChange" @firstEnterCale="updateRightCale" style="padding: 0 8px;" />
90
- <Calendar ref="right" :showMonth="false" :start-date="calendarRange.startDate"
91
- :end-date="calendarRange.endDate" :range="true" @change="rightChange"
92
- :pleStatus="startMultipleStatus" @firstEnterCale="updateLeftCale"
93
- style="padding: 0 8px;border-left: 1px solid #F1F1F1;" />
94
- </view>
95
-
96
- <view v-if="hasTime" class="popup-x-footer">
97
- <text @click="clear">{{clearText}}</text>
98
- <text class="confirm-text" @click="confirmRangeChange">{{okText}}</text>
99
- </view>
100
- </view>
101
- </view>
102
-
103
- <Calendar v-if="isPhone" ref="mobile" :clearDate="false" :date="calendarDate" :defTime="mobileCalendarTime"
104
- :start-date="calendarRange.startDate" :end-date="calendarRange.endDate" :selectableTimes="mobSelectableTime"
105
- :startPlaceholder="startPlaceholder" :endPlaceholder="endPlaceholder"
106
- :default-value="defaultValue"
107
- :pleStatus="endMultipleStatus" :showMonth="false" :range="isRange" :hasTime="hasTime" :insert="false"
108
- :hideSecond="hideSecond" @confirm="mobileChange" @maskClose="close" />
109
- </view>
110
- </template>
111
- <script>
112
- /**
113
- * DatetimePicker 时间选择器
114
- * @description 同时支持 PC 和移动端使用日历选择日期和日期范围
115
- * @tutorial https://ext.dcloud.net.cn/plugin?id=3962
116
- * @property {String} type 选择器类型
117
- * @property {String|Number|Array|Date} value 绑定值
118
- * @property {String} placeholder 单选择时的占位内容
119
- * @property {String} start 起始时间
120
- * @property {String} end 终止时间
121
- * @property {String} start-placeholder 范围选择时开始日期的占位内容
122
- * @property {String} end-placeholder 范围选择时结束日期的占位内容
123
- * @property {String} range-separator 选择范围时的分隔符
124
- * @property {Boolean} border = [true|false] 是否有边框
125
- * @property {Boolean} disabled = [true|false] 是否禁用
126
- * @property {Boolean} clearIcon = [true|false] 是否显示清除按钮(仅PC端适用)
127
- * @property {[String} defaultValue 选择器打开时默认显示的时间
128
- * @event {Function} change 确定日期时触发的事件
129
- * @event {Function} maskClick 点击遮罩层触发的事件
130
- * @event {Function} show 打开弹出层
131
- * @event {Function} close 关闭弹出层
132
- * @event {Function} clear 清除上次选中的状态和值
133
- **/
134
- import Calendar from './calendar.vue'
135
- import TimePicker from './time-picker.vue'
136
- import { initVueI18n } from '@dcloudio/uni-i18n'
137
- import i18nMessages from './i18n'
138
- import { getDateTime, getDate, getTime, getDefaultSecond, dateCompare, checkDate, fixIosDateFormat } from './util'
139
-
140
- export default {
141
- name: 'UniDatetimePicker',
142
- options: {
143
- virtualHost: true
144
- },
145
- components: {
146
- Calendar,
147
- TimePicker
148
- },
149
- data() {
150
- return {
151
- isRange: false,
152
- hasTime: false,
153
- displayValue: '',
154
- inputDate: '',
155
- calendarDate: '',
156
- pickerTime: '',
157
- calendarRange: {
158
- startDate: '',
159
- startTime: '',
160
- endDate: '',
161
- endTime: ''
162
- },
163
- displayRangeValue: {
164
- startDate: '',
165
- endDate: '',
166
- },
167
- tempRange: {
168
- startDate: '',
169
- startTime: '',
170
- endDate: '',
171
- endTime: ''
172
- },
173
- // 左右日历同步数据
174
- startMultipleStatus: {
175
- before: '',
176
- after: '',
177
- data: [],
178
- fulldate: ''
179
- },
180
- endMultipleStatus: {
181
- before: '',
182
- after: '',
183
- data: [],
184
- fulldate: ''
185
- },
186
- pickerVisible: false,
187
- pickerPositionStyle: null,
188
- isEmitValue: false,
189
- isPhone: false,
190
- isFirstShow: true,
191
- i18nT: () => {}
192
- }
193
- },
194
- props: {
195
- type: {
196
- type: String,
197
- default: 'datetime'
198
- },
199
- value: {
200
- type: [String, Number, Array, Date],
201
- default: ''
202
- },
203
- modelValue: {
204
- type: [String, Number, Array, Date],
205
- default: ''
206
- },
207
- start: {
208
- type: [Number, String],
209
- default: ''
210
- },
211
- end: {
212
- type: [Number, String],
213
- default: ''
214
- },
215
- returnType: {
216
- type: String,
217
- default: 'string'
218
- },
219
- placeholder: {
220
- type: String,
221
- default: ''
222
- },
223
- startPlaceholder: {
224
- type: String,
225
- default: ''
226
- },
227
- endPlaceholder: {
228
- type: String,
229
- default: ''
230
- },
231
- rangeSeparator: {
232
- type: String,
233
- default: '-'
234
- },
235
- border: {
236
- type: [Boolean],
237
- default: true
238
- },
239
- disabled: {
240
- type: [Boolean],
241
- default: false
242
- },
243
- clearIcon: {
244
- type: [Boolean],
245
- default: true
246
- },
247
- hideSecond: {
248
- type: [Boolean],
249
- default: false
250
- },
251
- defaultValue: {
252
- type: [String, Object, Array],
253
- default: ''
254
- }
255
- },
256
- watch: {
257
- type: {
258
- immediate: true,
259
- handler(newVal) {
260
- this.hasTime = newVal.indexOf('time') !== -1
261
- this.isRange = newVal.indexOf('range') !== -1
262
- }
263
- },
264
- // #ifndef VUE3
265
- value: {
266
- immediate: true,
267
- handler(newVal) {
268
- if (this.isEmitValue) {
269
- this.isEmitValue = false
270
- return
271
- }
272
- this.initPicker(newVal)
273
- }
274
- },
275
- // #endif
276
- // #ifdef VUE3
277
- modelValue: {
278
- immediate: true,
279
- handler(newVal) {
280
- if (this.isEmitValue) {
281
- this.isEmitValue = false
282
- return
283
- }
284
- this.initPicker(newVal)
285
- }
286
- },
287
- // #endif
288
- start: {
289
- immediate: true,
290
- handler(newVal) {
291
- if (!newVal) return
292
- this.calendarRange.startDate = getDate(newVal)
293
- if (this.hasTime) {
294
- this.calendarRange.startTime = getTime(newVal)
295
- }
296
- }
297
- },
298
- end: {
299
- immediate: true,
300
- handler(newVal) {
301
- if (!newVal) return
302
- this.calendarRange.endDate = getDate(newVal)
303
- if (this.hasTime) {
304
- this.calendarRange.endTime = getTime(newVal, this.hideSecond)
305
- }
306
- }
307
- },
308
- },
309
- computed: {
310
- timepickerStartTime() {
311
- const activeDate = this.isRange ? this.tempRange.startDate : this.inputDate
312
- return activeDate === this.calendarRange.startDate ? this.calendarRange.startTime : ''
313
- },
314
- timepickerEndTime() {
315
- const activeDate = this.isRange ? this.tempRange.endDate : this.inputDate
316
- return activeDate === this.calendarRange.endDate ? this.calendarRange.endTime : ''
317
- },
318
- mobileCalendarTime() {
319
- const timeRange = {
320
- start: this.tempRange.startTime,
321
- end: this.tempRange.endTime
322
- }
323
- return this.isRange ? timeRange : this.pickerTime
324
- },
325
- mobSelectableTime() {
326
- return {
327
- start: this.calendarRange.startTime,
328
- end: this.calendarRange.endTime
329
- }
330
- },
331
- datePopupWidth() {
332
- // todo
333
- return this.isRange ? 653 : 301
334
- },
335
-
336
- /**
337
- * for i18n
338
- */
339
- singlePlaceholderText() {
340
- return this.placeholder || (this.type === 'date' ? this.selectDateText : this.selectDateTimeText)
341
- },
342
- startPlaceholderText() {
343
- return this.startPlaceholder || this.startDateText
344
- },
345
- endPlaceholderText() {
346
- return this.endPlaceholder || this.endDateText
347
- },
348
- selectDateText() {
349
- return this.i18nT("uni-datetime-picker.selectDate")
350
- },
351
- selectDateTimeText() {
352
- return this.i18nT("uni-datetime-picker.selectDateTime")
353
- },
354
- selectTimeText() {
355
- return this.i18nT("uni-datetime-picker.selectTime")
356
- },
357
- startDateText() {
358
- return this.startPlaceholder || this.i18nT("uni-datetime-picker.startDate")
359
- },
360
- startTimeText() {
361
- return this.i18nT("uni-datetime-picker.startTime")
362
- },
363
- endDateText() {
364
- return this.endPlaceholder || this.i18nT("uni-datetime-picker.endDate")
365
- },
366
- endTimeText() {
367
- return this.i18nT("uni-datetime-picker.endTime")
368
- },
369
- okText() {
370
- return this.i18nT("uni-datetime-picker.ok")
371
- },
372
- clearText() {
373
- return this.i18nT("uni-datetime-picker.clear")
374
- },
375
- showClearIcon() {
376
- return this.clearIcon && !this.disabled && (this.displayValue || (this.displayRangeValue.startDate && this.displayRangeValue.endDate))
377
- }
378
- },
379
- created() {
380
- this.initI18nT()
381
- this.platform()
382
- },
383
- methods: {
384
- initI18nT() {
385
- const vueI18n = initVueI18n(i18nMessages)
386
- this.i18nT = vueI18n.t
387
- },
388
- initPicker(newVal) {
389
- if ((!newVal && !this.defaultValue) || Array.isArray(newVal) && !newVal.length) {
390
- this.$nextTick(() => {
391
- this.clear(false)
392
- })
393
- return
394
- }
395
-
396
- if (!Array.isArray(newVal) && !this.isRange) {
397
- if(newVal){
398
- this.displayValue = this.inputDate = this.calendarDate = getDate(newVal)
399
- if (this.hasTime) {
400
- this.pickerTime = getTime(newVal, this.hideSecond)
401
- this.displayValue = `${this.displayValue} ${this.pickerTime}`
402
- }
403
- }else if(this.defaultValue){
404
- this.inputDate = this.calendarDate = getDate(this.defaultValue)
405
- if(this.hasTime){
406
- this.pickerTime = getTime(this.defaultValue, this.hideSecond)
407
- }
408
- }
409
- } else {
410
- const [before, after] = newVal
411
- if (!before && !after) return
412
- const beforeDate = getDate(before)
413
- const beforeTime = getTime(before, this.hideSecond)
414
-
415
- const afterDate = getDate(after)
416
- const afterTime = getTime(after, this.hideSecond)
417
- const startDate = beforeDate
418
- const endDate = afterDate
419
- this.displayRangeValue.startDate = this.tempRange.startDate = startDate
420
- this.displayRangeValue.endDate = this.tempRange.endDate = endDate
421
-
422
- if (this.hasTime) {
423
- this.displayRangeValue.startDate = `${beforeDate} ${beforeTime}`
424
- this.displayRangeValue.endDate = `${afterDate} ${afterTime}`
425
- this.tempRange.startTime = beforeTime
426
- this.tempRange.endTime = afterTime
427
- }
428
- const defaultRange = {
429
- before: beforeDate,
430
- after: afterDate
431
- }
432
- this.startMultipleStatus = Object.assign({}, this.startMultipleStatus, defaultRange, {
433
- which: 'right'
434
- })
435
- this.endMultipleStatus = Object.assign({}, this.endMultipleStatus, defaultRange, {
436
- which: 'left'
437
- })
438
- }
439
- },
440
- updateLeftCale(e) {
441
- const left = this.$refs.left
442
- // 设置范围选
443
- left.cale.setHoverMultiple(e.after)
444
- left.setDate(this.$refs.left.nowDate.fullDate)
445
- },
446
- updateRightCale(e) {
447
- const right = this.$refs.right
448
- // 设置范围选
449
- right.cale.setHoverMultiple(e.after)
450
- right.setDate(this.$refs.right.nowDate.fullDate)
451
- },
452
- platform() {
453
- const { windowWidth } = uni.getSystemInfoSync()
454
- this.isPhone = windowWidth <= 500
455
- this.windowWidth = windowWidth
456
- },
457
- show() {
458
- if (this.disabled) {
459
- return
460
- }
461
- this.platform()
462
- if (this.isPhone) {
463
- this.$refs.mobile.open()
464
- return
465
- }
466
- this.pickerPositionStyle = {
467
- top: '10px'
468
- }
469
- const dateEditor = uni.createSelectorQuery().in(this).select(".uni-date-editor")
470
- dateEditor.boundingClientRect(rect => {
471
- if (this.windowWidth - rect.left < this.datePopupWidth) {
472
- this.pickerPositionStyle.right = 0
473
- }
474
- }).exec()
475
- setTimeout(() => {
476
- this.pickerVisible = !this.pickerVisible
477
- if (!this.isPhone && this.isRange && this.isFirstShow) {
478
- this.isFirstShow = false
479
- const {
480
- startDate,
481
- endDate
482
- } = this.calendarRange
483
- if (startDate && endDate) {
484
- if (this.diffDate(startDate, endDate) < 30) {
485
- this.$refs.right.changeMonth('pre')
486
- }
487
- } else {
488
- this.$refs.right.changeMonth('next')
489
- this.$refs.right.cale.lastHover = false
490
- }
491
- }
492
-
493
- }, 50)
494
- },
495
- close() {
496
- setTimeout(() => {
497
- this.pickerVisible = false
498
- this.$emit('maskClick', this.value)
499
- this.$refs.mobile && this.$refs.mobile.close()
500
- }, 20)
501
- },
502
- setEmit(value) {
503
- if (this.returnType === "timestamp" || this.returnType === "date") {
504
- if (!Array.isArray(value)) {
505
- if (!this.hasTime) {
506
- value = value + ' ' + '00:00:00'
507
- }
508
- value = this.createTimestamp(value)
509
- if (this.returnType === "date") {
510
- value = new Date(value)
511
- }
512
- } else {
513
- if (!this.hasTime) {
514
- value[0] = value[0] + ' ' + '00:00:00'
515
- value[1] = value[1] + ' ' + '00:00:00'
516
- }
517
- value[0] = this.createTimestamp(value[0])
518
- value[1] = this.createTimestamp(value[1])
519
- if (this.returnType === "date") {
520
- value[0] = new Date(value[0])
521
- value[1] = new Date(value[1])
522
- }
523
- }
524
- }
525
-
526
- this.$emit('update:modelValue', value)
527
- this.$emit('input', value)
528
- this.$emit('change', value)
529
- this.isEmitValue = true
530
- },
531
- createTimestamp(date) {
532
- date = fixIosDateFormat(date)
533
- return Date.parse(new Date(date))
534
- },
535
- singleChange(e) {
536
- this.calendarDate = this.inputDate = e.fulldate
537
- if (this.hasTime) return
538
- this.confirmSingleChange()
539
- },
540
- confirmSingleChange() {
541
- if(!checkDate(this.inputDate)){
542
- const now = new Date()
543
- this.calendarDate = this.inputDate = getDate(now)
544
- this.pickerTime = getTime(now, this.hideSecond)
545
- }
546
-
547
- let startLaterInputDate = false
548
- let startDate, startTime
549
- if(this.start) {
550
- let startString = this.start
551
- if(typeof this.start === 'number'){
552
- startString = getDateTime(this.start, this.hideSecond)
553
- }
554
- [startDate, startTime] = startString.split(' ')
555
- if(this.start && !dateCompare(startDate, this.inputDate)) {
556
- startLaterInputDate = true
557
- this.inputDate = startDate
558
- }
559
- }
560
-
561
- let endEarlierInputDate = false
562
- let endDate, endTime
563
- if(this.end) {
564
- let endString = this.end
565
- if(typeof this.end === 'number'){
566
- endString = getDateTime(this.end, this.hideSecond)
567
- }
568
- [endDate, endTime] = endString.split(' ')
569
- if(this.end && !dateCompare(this.inputDate, endDate)) {
570
- endEarlierInputDate = true
571
- this.inputDate = endDate
572
- }
573
- }
574
- if (this.hasTime) {
575
- if(startLaterInputDate){
576
- this.pickerTime = startTime || getDefaultSecond(this.hideSecond)
577
- }
578
- if(endEarlierInputDate){
579
- this.pickerTime = endTime || getDefaultSecond(this.hideSecond)
580
- }
581
- if(!this.pickerTime){
582
- this.pickerTime = getTime(Date.now(), this.hideSecond)
583
- }
584
- this.displayValue = `${this.inputDate} ${this.pickerTime}`
585
- } else {
586
- this.displayValue = this.inputDate
587
- }
588
- this.setEmit(this.displayValue)
589
- this.pickerVisible = false
590
- },
591
- leftChange(e) {
592
- const {
593
- before,
594
- after
595
- } = e.range
596
- this.rangeChange(before, after)
597
- const obj = {
598
- before: e.range.before,
599
- after: e.range.after,
600
- data: e.range.data,
601
- fulldate: e.fulldate
602
- }
603
- this.startMultipleStatus = Object.assign({}, this.startMultipleStatus, obj)
604
- },
605
- rightChange(e) {
606
- const {
607
- before,
608
- after
609
- } = e.range
610
- this.rangeChange(before, after)
611
- const obj = {
612
- before: e.range.before,
613
- after: e.range.after,
614
- data: e.range.data,
615
- fulldate: e.fulldate
616
- }
617
- this.endMultipleStatus = Object.assign({}, this.endMultipleStatus, obj)
618
- },
619
- mobileChange(e) {
620
- if (this.isRange) {
621
- const {before, after} = e.range
622
-
623
- if(!before || !after){
624
- return
625
- }
626
-
627
- this.handleStartAndEnd(before, after, true)
628
- if (this.hasTime) {
629
- const {
630
- startTime,
631
- endTime
632
- } = e.timeRange
633
- this.tempRange.startTime = startTime
634
- this.tempRange.endTime = endTime
635
- }
636
- this.confirmRangeChange()
637
- } else {
638
- if (this.hasTime) {
639
- this.displayValue = e.fulldate + ' ' + e.time
640
- } else {
641
- this.displayValue = e.fulldate
642
- }
643
- this.setEmit(this.displayValue)
644
- }
645
- this.$refs.mobile.close()
646
- },
647
- rangeChange(before, after) {
648
- if (!(before && after)) return
649
- this.handleStartAndEnd(before, after, true)
650
- if (this.hasTime) return
651
- this.confirmRangeChange()
652
- },
653
- confirmRangeChange() {
654
- if (!this.tempRange.startDate || !this.tempRange.endDate) {
655
- this.pickerVisible = false
656
- return
657
- }
658
- if(!checkDate(this.tempRange.startDate)){
659
- this.tempRange.startDate = getDate(Date.now())
660
- }
661
- if(!checkDate(this.tempRange.endDate)){
662
- this.tempRange.endDate = getDate(Date.now())
663
- }
664
-
665
- let start, end
666
-
667
- let startDateLaterRangeStartDate = false
668
- let startDateLaterRangeEndDate = false
669
- let startDate, startTime
670
- if(this.start) {
671
- let startString = this.start
672
- if(typeof this.start === 'number'){
673
- startString = getDateTime(this.start, this.hideSecond)
674
- }
675
- [startDate,startTime] = startString.split(' ')
676
- if(this.start && !dateCompare(this.start, this.tempRange.startDate)) {
677
- startDateLaterRangeStartDate = true
678
- this.tempRange.startDate = startDate
679
- }
680
- if(this.start && !dateCompare(this.start, this.tempRange.endDate)) {
681
- startDateLaterRangeEndDate = true
682
- this.tempRange.endDate = startDate
683
- }
684
- }
685
- let endDateEarlierRangeStartDate = false
686
- let endDateEarlierRangeEndDate = false
687
- let endDate, endTime
688
- if(this.end) {
689
- let endString = this.end
690
- if(typeof this.end === 'number'){
691
- endString = getDateTime(this.end, this.hideSecond)
692
- }
693
- [endDate,endTime] = endString.split(' ')
694
-
695
- if(this.end && !dateCompare(this.tempRange.startDate, this.end)) {
696
- endDateEarlierRangeStartDate = true
697
- this.tempRange.startDate = endDate
698
- }
699
- if(this.end && !dateCompare(this.tempRange.endDate, this.end)) {
700
- endDateEarlierRangeEndDate = true
701
- this.tempRange.endDate = endDate
702
- }
703
- }
704
- if (!this.hasTime) {
705
- start = this.displayRangeValue.startDate = this.tempRange.startDate
706
- end = this.displayRangeValue.endDate = this.tempRange.endDate
707
- } else {
708
- if(startDateLaterRangeStartDate){
709
- this.tempRange.startTime = startTime || getDefaultSecond(this.hideSecond)
710
- }else if(endDateEarlierRangeStartDate){
711
- this.tempRange.startTime = endTime || getDefaultSecond(this.hideSecond)
712
- }
713
- if(!this.tempRange.startTime){
714
- this.tempRange.startTime = getTime(Date.now(), this.hideSecond)
715
- }
716
-
717
- if(startDateLaterRangeEndDate){
718
- this.tempRange.endTime = startTime || getDefaultSecond(this.hideSecond)
719
- }else if(endDateEarlierRangeEndDate){
720
- this.tempRange.endTime = endTime || getDefaultSecond(this.hideSecond)
721
- }
722
- if(!this.tempRange.endTime){
723
- this.tempRange.endTime = getTime(Date.now(), this.hideSecond)
724
- }
725
- start = this.displayRangeValue.startDate = `${this.tempRange.startDate} ${this.tempRange.startTime}`
726
- end = this.displayRangeValue.endDate = `${this.tempRange.endDate} ${this.tempRange.endTime}`
727
- }
728
- if(!dateCompare(start,end)){
729
- [start, end] = [end, start]
730
- }
731
- this.displayRangeValue.startDate = start
732
- this.displayRangeValue.endDate = end
733
- const displayRange = [start, end]
734
- this.setEmit(displayRange)
735
- this.pickerVisible = false
736
- },
737
- handleStartAndEnd(before, after, temp = false) {
738
- if (!(before && after)) return
739
-
740
- const type = temp ? 'tempRange' : 'range'
741
- const isStartEarlierEnd = dateCompare(before, after)
742
- this[type].startDate = isStartEarlierEnd ? before : after
743
- this[type].endDate = isStartEarlierEnd ? after : before
744
- },
745
- /**
746
- * 比较时间大小
747
- */
748
- dateCompare(startDate, endDate) {
749
- // 计算截止时间
750
- startDate = new Date(startDate.replace('-', '/').replace('-', '/'))
751
- // 计算详细项的截止时间
752
- endDate = new Date(endDate.replace('-', '/').replace('-', '/'))
753
- return startDate <= endDate
754
- },
755
-
756
- /**
757
- * 比较时间差
758
- */
759
- diffDate(startDate, endDate) {
760
- // 计算截止时间
761
- startDate = new Date(startDate.replace('-', '/').replace('-', '/'))
762
- // 计算详细项的截止时间
763
- endDate = new Date(endDate.replace('-', '/').replace('-', '/'))
764
- const diff = (endDate - startDate) / (24 * 60 * 60 * 1000)
765
- return Math.abs(diff)
766
- },
767
-
768
- clear(needEmit = true) {
769
- if (!this.isRange) {
770
- this.displayValue = ''
771
- this.inputDate = ''
772
- this.pickerTime = ''
773
- if (this.isPhone) {
774
- this.$refs.mobile && this.$refs.mobile.clearCalender()
775
- } else {
776
- this.$refs.pcSingle && this.$refs.pcSingle.clearCalender()
777
- }
778
- if (needEmit) {
779
- this.$emit('change', '')
780
- this.$emit('input', '')
781
- this.$emit('update:modelValue', '')
782
- }
783
- } else {
784
- this.displayRangeValue.startDate = ''
785
- this.displayRangeValue.endDate = ''
786
- this.tempRange.startDate = ''
787
- this.tempRange.startTime = ''
788
- this.tempRange.endDate = ''
789
- this.tempRange.endTime = ''
790
- if (this.isPhone) {
791
- this.$refs.mobile && this.$refs.mobile.clearCalender()
792
- } else {
793
- this.$refs.left && this.$refs.left.clearCalender()
794
- this.$refs.right && this.$refs.right.clearCalender()
795
- this.$refs.right && this.$refs.right.changeMonth('next')
796
- }
797
- if (needEmit) {
798
- this.$emit('change', [])
799
- this.$emit('input', [])
800
- this.$emit('update:modelValue', [])
801
- }
802
- }
803
- }
804
- }
805
- }
806
- </script>
807
-
808
- <style lang="scss">
809
- $uni-primary: #007aff !default;
810
-
811
- .uni-date {
812
- width: 100%;
813
- flex: 1;
814
- }
815
- .uni-date-x {
816
- display: flex;
817
- flex-direction: row;
818
- align-items: center;
819
- justify-content: center;
820
- border-radius: 4px;
821
- background-color: #fff;
822
- color: #666;
823
- font-size: 14px;
824
- flex: 1;
825
-
826
- .icon-calendar{
827
- padding-left: 3px;
828
- }
829
- .range-separator{
830
- height: 35px;
831
- /* #ifndef MP */
832
- padding: 0 2px;
833
- /* #endif */
834
- line-height: 35px;
835
- }
836
- }
837
-
838
- .uni-date-x--border {
839
- box-sizing: border-box;
840
- border-radius: 4px;
841
- border: 1px solid #e5e5e5;
842
- }
843
-
844
- .uni-date-editor--x {
845
- display: flex;
846
- align-items: center;
847
- position: relative;
848
- }
849
-
850
- .uni-date-editor--x .uni-date__icon-clear {
851
- padding-right: 3px;
852
- display: flex;
853
- align-items: center;
854
- /* #ifdef H5 */
855
- cursor: pointer;
856
- /* #endif */
857
- }
858
-
859
- .uni-date__x-input {
860
- width: auto;
861
- height: 35px;
862
- /* #ifndef MP */
863
- padding-left: 5px;
864
- /* #endif */
865
- position: relative;
866
- flex: 1;
867
- line-height: 35px;
868
- font-size: 14px;
869
- overflow: hidden;
870
- }
871
-
872
- .text-center {
873
- text-align: center;
874
- }
875
-
876
- .uni-date__input {
877
- height: 40px;
878
- width: 100%;
879
- line-height: 40px;
880
- font-size: 14px;
881
- }
882
-
883
- .uni-date-range__input {
884
- text-align: center;
885
- max-width: 142px;
886
- }
887
-
888
- .uni-date-picker__container {
889
- position: relative;
890
- }
891
-
892
- .uni-date-mask--pc {
893
- position: fixed;
894
- bottom: 0px;
895
- top: 0px;
896
- left: 0px;
897
- right: 0px;
898
- background-color: rgba(0, 0, 0, 0);
899
- transition-duration: 0.3s;
900
- z-index: 996;
901
- }
902
-
903
- .uni-date-single--x {
904
- background-color: #fff;
905
- position: absolute;
906
- top: 0;
907
- z-index: 999;
908
- border: 1px solid #EBEEF5;
909
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
910
- border-radius: 4px;
911
- }
912
-
913
- .uni-date-range--x {
914
- background-color: #fff;
915
- position: absolute;
916
- top: 0;
917
- z-index: 999;
918
- border: 1px solid #EBEEF5;
919
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
920
- border-radius: 4px;
921
- }
922
-
923
- .uni-date-editor--x__disabled {
924
- opacity: 0.4;
925
- cursor: default;
926
- }
927
-
928
- .uni-date-editor--logo {
929
- width: 16px;
930
- height: 16px;
931
- vertical-align: middle;
932
- }
933
-
934
- /* 添加时间 */
935
- .popup-x-header {
936
- /* #ifndef APP-NVUE */
937
- display: flex;
938
- /* #endif */
939
- flex-direction: row;
940
- }
941
-
942
- .popup-x-header--datetime {
943
- /* #ifndef APP-NVUE */
944
- display: flex;
945
- /* #endif */
946
- flex-direction: row;
947
- flex: 1;
948
- }
949
-
950
- .popup-x-body {
951
- display: flex;
952
- }
953
-
954
- .popup-x-footer {
955
- padding: 0 15px;
956
- border-top-color: #F1F1F1;
957
- border-top-style: solid;
958
- border-top-width: 1px;
959
- line-height: 40px;
960
- text-align: right;
961
- color: #666;
962
- }
963
-
964
- .popup-x-footer text:hover {
965
- color: $uni-primary;
966
- cursor: pointer;
967
- opacity: 0.8;
968
- }
969
-
970
- .popup-x-footer .confirm-text {
971
- margin-left: 20px;
972
- color: $uni-primary;
973
- }
974
-
975
- .uni-date-changed {
976
- text-align: center;
977
- color: #333;
978
- border-bottom-color: #F1F1F1;
979
- border-bottom-style: solid;
980
- border-bottom-width: 1px;
981
- }
982
-
983
- .uni-date-changed--time text {
984
- height: 50px;
985
- line-height: 50px;
986
- }
987
-
988
- .uni-date-changed .uni-date-changed--time {
989
- flex: 1;
990
- }
991
-
992
- .uni-date-changed--time-date {
993
- color: #333;
994
- opacity: 0.6;
995
- }
996
-
997
- .mr-50 {
998
- margin-right: 50px;
999
- }
1000
-
1001
- /* picker 弹出层通用的指示小三角, todo:扩展至上下左右方向定位 */
1002
- .uni-popper__arrow,
1003
- .uni-popper__arrow::after {
1004
- position: absolute;
1005
- display: block;
1006
- width: 0;
1007
- height: 0;
1008
- border: 6px solid transparent;
1009
- border-top-width: 0;
1010
- }
1011
-
1012
- .uni-popper__arrow {
1013
- filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
1014
- top: -6px;
1015
- left: 10%;
1016
- margin-right: 3px;
1017
- border-bottom-color: #EBEEF5;
1018
- }
1019
-
1020
- .uni-popper__arrow::after {
1021
- content: " ";
1022
- top: 1px;
1023
- margin-left: -6px;
1024
- border-bottom-color: #fff;
1025
- }
1026
- </style>