uni-datetime-picker.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. "use strict";
  2. const common_vendor = require("../../../../common/vendor.js");
  3. const uni_modules_uniDatetimePicker_components_uniDatetimePicker_i18n_index = require("./i18n/index.js");
  4. const calendar = () => "./calendar.js";
  5. const timePicker = () => "./time-picker.js";
  6. const {
  7. t
  8. } = common_vendor.initVueI18n(uni_modules_uniDatetimePicker_components_uniDatetimePicker_i18n_index.messages);
  9. const _sfc_main = {
  10. name: "UniDatetimePicker",
  11. components: {
  12. calendar,
  13. timePicker
  14. },
  15. data() {
  16. return {
  17. isRange: false,
  18. hasTime: false,
  19. mobileRange: false,
  20. // 单选
  21. singleVal: "",
  22. tempSingleDate: "",
  23. defSingleDate: "",
  24. time: "",
  25. // 范围选
  26. caleRange: {
  27. startDate: "",
  28. startTime: "",
  29. endDate: "",
  30. endTime: ""
  31. },
  32. range: {
  33. startDate: "",
  34. // startTime: '',
  35. endDate: ""
  36. // endTime: ''
  37. },
  38. tempRange: {
  39. startDate: "",
  40. startTime: "",
  41. endDate: "",
  42. endTime: ""
  43. },
  44. // 左右日历同步数据
  45. startMultipleStatus: {
  46. before: "",
  47. after: "",
  48. data: [],
  49. fulldate: ""
  50. },
  51. endMultipleStatus: {
  52. before: "",
  53. after: "",
  54. data: [],
  55. fulldate: ""
  56. },
  57. visible: false,
  58. popup: false,
  59. popover: null,
  60. isEmitValue: false,
  61. isPhone: false,
  62. isFirstShow: true
  63. };
  64. },
  65. props: {
  66. type: {
  67. type: String,
  68. default: "datetime"
  69. },
  70. value: {
  71. type: [String, Number, Array, Date],
  72. default: ""
  73. },
  74. modelValue: {
  75. type: [String, Number, Array, Date],
  76. default: ""
  77. },
  78. start: {
  79. type: [Number, String],
  80. default: ""
  81. },
  82. end: {
  83. type: [Number, String],
  84. default: ""
  85. },
  86. returnType: {
  87. type: String,
  88. default: "string"
  89. },
  90. placeholder: {
  91. type: String,
  92. default: ""
  93. },
  94. startPlaceholder: {
  95. type: String,
  96. default: ""
  97. },
  98. endPlaceholder: {
  99. type: String,
  100. default: ""
  101. },
  102. rangeSeparator: {
  103. type: String,
  104. default: "-"
  105. },
  106. border: {
  107. type: [Boolean],
  108. default: true
  109. },
  110. disabled: {
  111. type: [Boolean],
  112. default: false
  113. },
  114. clearIcon: {
  115. type: [Boolean],
  116. default: true
  117. },
  118. hideSecond: {
  119. type: [Boolean],
  120. default: false
  121. }
  122. },
  123. watch: {
  124. type: {
  125. immediate: true,
  126. handler(newVal, oldVal) {
  127. if (newVal.indexOf("time") !== -1) {
  128. this.hasTime = true;
  129. } else {
  130. this.hasTime = false;
  131. }
  132. if (newVal.indexOf("range") !== -1) {
  133. this.isRange = true;
  134. } else {
  135. this.isRange = false;
  136. }
  137. }
  138. },
  139. modelValue: {
  140. immediate: true,
  141. handler(newVal, oldVal) {
  142. if (this.isEmitValue) {
  143. this.isEmitValue = false;
  144. return;
  145. }
  146. this.initPicker(newVal);
  147. }
  148. },
  149. start: {
  150. immediate: true,
  151. handler(newVal, oldVal) {
  152. if (!newVal)
  153. return;
  154. const {
  155. defDate,
  156. defTime
  157. } = this.parseDate(newVal);
  158. this.caleRange.startDate = defDate;
  159. if (this.hasTime) {
  160. this.caleRange.startTime = defTime;
  161. }
  162. }
  163. },
  164. end: {
  165. immediate: true,
  166. handler(newVal, oldVal) {
  167. if (!newVal)
  168. return;
  169. const {
  170. defDate,
  171. defTime
  172. } = this.parseDate(newVal);
  173. this.caleRange.endDate = defDate;
  174. if (this.hasTime) {
  175. this.caleRange.endTime = defTime;
  176. }
  177. }
  178. }
  179. },
  180. computed: {
  181. reactStartTime() {
  182. const activeDate = this.isRange ? this.tempRange.startDate : this.tempSingleDate;
  183. const res = activeDate === this.caleRange.startDate ? this.caleRange.startTime : "";
  184. return res;
  185. },
  186. reactEndTime() {
  187. const activeDate = this.isRange ? this.tempRange.endDate : this.tempSingleDate;
  188. const res = activeDate === this.caleRange.endDate ? this.caleRange.endTime : "";
  189. return res;
  190. },
  191. reactMobDefTime() {
  192. const times = {
  193. start: this.tempRange.startTime,
  194. end: this.tempRange.endTime
  195. };
  196. return this.isRange ? times : this.time;
  197. },
  198. mobSelectableTime() {
  199. return {
  200. start: this.caleRange.startTime,
  201. end: this.caleRange.endTime
  202. };
  203. },
  204. datePopupWidth() {
  205. return this.isRange ? 653 : 301;
  206. },
  207. /**
  208. * for i18n
  209. */
  210. singlePlaceholderText() {
  211. return this.placeholder || (this.type === "date" ? this.selectDateText : t(
  212. "uni-datetime-picker.selectDateTime"
  213. ));
  214. },
  215. startPlaceholderText() {
  216. return this.startPlaceholder || this.startDateText;
  217. },
  218. endPlaceholderText() {
  219. return this.endPlaceholder || this.endDateText;
  220. },
  221. selectDateText() {
  222. return t("uni-datetime-picker.selectDate");
  223. },
  224. selectTimeText() {
  225. return t("uni-datetime-picker.selectTime");
  226. },
  227. startDateText() {
  228. return this.startPlaceholder || t("uni-datetime-picker.startDate");
  229. },
  230. startTimeText() {
  231. return t("uni-datetime-picker.startTime");
  232. },
  233. endDateText() {
  234. return this.endPlaceholder || t("uni-datetime-picker.endDate");
  235. },
  236. endTimeText() {
  237. return t("uni-datetime-picker.endTime");
  238. },
  239. okText() {
  240. return t("uni-datetime-picker.ok");
  241. },
  242. clearText() {
  243. return t("uni-datetime-picker.clear");
  244. },
  245. showClearIcon() {
  246. const {
  247. clearIcon,
  248. disabled,
  249. singleVal,
  250. range
  251. } = this;
  252. const bool = clearIcon && !disabled && (singleVal || range.startDate && range.endDate);
  253. return bool;
  254. }
  255. },
  256. created() {
  257. this.form = this.getForm("uniForms");
  258. this.formItem = this.getForm("uniFormsItem");
  259. },
  260. mounted() {
  261. this.platform();
  262. },
  263. methods: {
  264. /**
  265. * 获取父元素实例
  266. */
  267. getForm(name = "uniForms") {
  268. let parent = this.$parent;
  269. let parentName = parent.$options.name;
  270. while (parentName !== name) {
  271. parent = parent.$parent;
  272. if (!parent)
  273. return false;
  274. parentName = parent.$options.name;
  275. }
  276. return parent;
  277. },
  278. initPicker(newVal) {
  279. if (!newVal || Array.isArray(newVal) && !newVal.length) {
  280. this.$nextTick(() => {
  281. this.clear(false);
  282. });
  283. return;
  284. }
  285. if (!Array.isArray(newVal) && !this.isRange) {
  286. const {
  287. defDate,
  288. defTime
  289. } = this.parseDate(newVal);
  290. this.singleVal = defDate;
  291. this.tempSingleDate = defDate;
  292. this.defSingleDate = defDate;
  293. if (this.hasTime) {
  294. this.singleVal = defDate + " " + defTime;
  295. this.time = defTime;
  296. }
  297. } else {
  298. const [before, after] = newVal;
  299. if (!before && !after)
  300. return;
  301. const defBefore = this.parseDate(before);
  302. const defAfter = this.parseDate(after);
  303. const startDate = defBefore.defDate;
  304. const endDate = defAfter.defDate;
  305. this.range.startDate = this.tempRange.startDate = startDate;
  306. this.range.endDate = this.tempRange.endDate = endDate;
  307. if (this.hasTime) {
  308. this.range.startDate = defBefore.defDate + " " + defBefore.defTime;
  309. this.range.endDate = defAfter.defDate + " " + defAfter.defTime;
  310. this.tempRange.startTime = defBefore.defTime;
  311. this.tempRange.endTime = defAfter.defTime;
  312. }
  313. const defaultRange = {
  314. before: defBefore.defDate,
  315. after: defAfter.defDate
  316. };
  317. this.startMultipleStatus = Object.assign({}, this.startMultipleStatus, defaultRange, {
  318. which: "right"
  319. });
  320. this.endMultipleStatus = Object.assign({}, this.endMultipleStatus, defaultRange, {
  321. which: "left"
  322. });
  323. }
  324. },
  325. updateLeftCale(e) {
  326. const left = this.$refs.left;
  327. left.cale.setHoverMultiple(e.after);
  328. left.setDate(this.$refs.left.nowDate.fullDate);
  329. },
  330. updateRightCale(e) {
  331. const right = this.$refs.right;
  332. right.cale.setHoverMultiple(e.after);
  333. right.setDate(this.$refs.right.nowDate.fullDate);
  334. },
  335. platform() {
  336. const systemInfo = common_vendor.index.getSystemInfoSync();
  337. this.isPhone = systemInfo.windowWidth <= 500;
  338. this.windowWidth = systemInfo.windowWidth;
  339. },
  340. show(event) {
  341. if (this.disabled) {
  342. return;
  343. }
  344. this.platform();
  345. if (this.isPhone) {
  346. this.$refs.mobile.open();
  347. return;
  348. }
  349. this.popover = {
  350. top: "10px"
  351. };
  352. const dateEditor = common_vendor.index.createSelectorQuery().in(this).select(".uni-date-editor");
  353. dateEditor.boundingClientRect((rect) => {
  354. if (this.windowWidth - rect.left < this.datePopupWidth) {
  355. this.popover.right = 0;
  356. }
  357. }).exec();
  358. setTimeout(() => {
  359. this.popup = !this.popup;
  360. if (!this.isPhone && this.isRange && this.isFirstShow) {
  361. this.isFirstShow = false;
  362. const {
  363. startDate,
  364. endDate
  365. } = this.range;
  366. if (startDate && endDate) {
  367. if (this.diffDate(startDate, endDate) < 30) {
  368. this.$refs.right.next();
  369. }
  370. } else {
  371. this.$refs.right.next();
  372. this.$refs.right.cale.lastHover = false;
  373. }
  374. }
  375. }, 50);
  376. },
  377. close() {
  378. setTimeout(() => {
  379. this.popup = false;
  380. this.$emit("maskClick", this.value);
  381. }, 20);
  382. },
  383. setEmit(value) {
  384. if (this.returnType === "timestamp" || this.returnType === "date") {
  385. if (!Array.isArray(value)) {
  386. if (!this.hasTime) {
  387. value = value + " 00:00:00";
  388. }
  389. value = this.createTimestamp(value);
  390. if (this.returnType === "date") {
  391. value = new Date(value);
  392. }
  393. } else {
  394. if (!this.hasTime) {
  395. value[0] = value[0] + " 00:00:00";
  396. value[1] = value[1] + " 00:00:00";
  397. }
  398. value[0] = this.createTimestamp(value[0]);
  399. value[1] = this.createTimestamp(value[1]);
  400. if (this.returnType === "date") {
  401. value[0] = new Date(value[0]);
  402. value[1] = new Date(value[1]);
  403. }
  404. }
  405. }
  406. this.formItem && this.formItem.setValue(value);
  407. this.$emit("change", value);
  408. this.$emit("input", value);
  409. this.$emit("update:modelValue", value);
  410. this.isEmitValue = true;
  411. },
  412. createTimestamp(date) {
  413. date = this.fixIosDateFormat(date);
  414. return Date.parse(new Date(date));
  415. },
  416. singleChange(e) {
  417. this.tempSingleDate = e.fulldate;
  418. if (this.hasTime)
  419. return;
  420. this.confirmSingleChange();
  421. },
  422. confirmSingleChange() {
  423. if (!this.tempSingleDate) {
  424. this.popup = false;
  425. return;
  426. }
  427. if (this.hasTime) {
  428. this.singleVal = this.tempSingleDate + " " + (this.time ? this.time : "00:00:00");
  429. } else {
  430. this.singleVal = this.tempSingleDate;
  431. }
  432. this.setEmit(this.singleVal);
  433. this.popup = false;
  434. },
  435. leftChange(e) {
  436. const {
  437. before,
  438. after
  439. } = e.range;
  440. this.rangeChange(before, after);
  441. const obj = {
  442. before: e.range.before,
  443. after: e.range.after,
  444. data: e.range.data,
  445. fulldate: e.fulldate
  446. };
  447. this.startMultipleStatus = Object.assign({}, this.startMultipleStatus, obj);
  448. },
  449. rightChange(e) {
  450. const {
  451. before,
  452. after
  453. } = e.range;
  454. this.rangeChange(before, after);
  455. const obj = {
  456. before: e.range.before,
  457. after: e.range.after,
  458. data: e.range.data,
  459. fulldate: e.fulldate
  460. };
  461. this.endMultipleStatus = Object.assign({}, this.endMultipleStatus, obj);
  462. },
  463. mobileChange(e) {
  464. if (this.isRange) {
  465. const {
  466. before,
  467. after
  468. } = e.range;
  469. this.handleStartAndEnd(before, after, true);
  470. if (this.hasTime) {
  471. const {
  472. startTime,
  473. endTime
  474. } = e.timeRange;
  475. this.tempRange.startTime = startTime;
  476. this.tempRange.endTime = endTime;
  477. }
  478. this.confirmRangeChange();
  479. } else {
  480. if (this.hasTime) {
  481. this.singleVal = e.fulldate + " " + e.time;
  482. } else {
  483. this.singleVal = e.fulldate;
  484. }
  485. this.setEmit(this.singleVal);
  486. }
  487. this.$refs.mobile.close();
  488. },
  489. rangeChange(before, after) {
  490. if (!(before && after))
  491. return;
  492. this.handleStartAndEnd(before, after, true);
  493. if (this.hasTime)
  494. return;
  495. this.confirmRangeChange();
  496. },
  497. confirmRangeChange() {
  498. if (!this.tempRange.startDate && !this.tempRange.endDate) {
  499. this.popup = false;
  500. return;
  501. }
  502. let start, end;
  503. if (!this.hasTime) {
  504. start = this.range.startDate = this.tempRange.startDate;
  505. end = this.range.endDate = this.tempRange.endDate;
  506. } else {
  507. start = this.range.startDate = this.tempRange.startDate + " " + (this.tempRange.startTime ? this.tempRange.startTime : "00:00:00");
  508. end = this.range.endDate = this.tempRange.endDate + " " + (this.tempRange.endTime ? this.tempRange.endTime : "00:00:00");
  509. }
  510. const displayRange = [start, end];
  511. this.setEmit(displayRange);
  512. this.popup = false;
  513. },
  514. handleStartAndEnd(before, after, temp = false) {
  515. if (!(before && after))
  516. return;
  517. const type = temp ? "tempRange" : "range";
  518. if (this.dateCompare(before, after)) {
  519. this[type].startDate = before;
  520. this[type].endDate = after;
  521. } else {
  522. this[type].startDate = after;
  523. this[type].endDate = before;
  524. }
  525. },
  526. /**
  527. * 比较时间大小
  528. */
  529. dateCompare(startDate, endDate) {
  530. startDate = new Date(startDate.replace("-", "/").replace("-", "/"));
  531. endDate = new Date(endDate.replace("-", "/").replace("-", "/"));
  532. if (startDate <= endDate) {
  533. return true;
  534. } else {
  535. return false;
  536. }
  537. },
  538. /**
  539. * 比较时间差
  540. */
  541. diffDate(startDate, endDate) {
  542. startDate = new Date(startDate.replace("-", "/").replace("-", "/"));
  543. endDate = new Date(endDate.replace("-", "/").replace("-", "/"));
  544. const diff = (endDate - startDate) / (24 * 60 * 60 * 1e3);
  545. return Math.abs(diff);
  546. },
  547. clear(needEmit = true) {
  548. if (!this.isRange) {
  549. this.singleVal = "";
  550. this.tempSingleDate = "";
  551. this.time = "";
  552. if (this.isPhone) {
  553. this.$refs.mobile && this.$refs.mobile.clearCalender();
  554. } else {
  555. this.$refs.pcSingle && this.$refs.pcSingle.clearCalender();
  556. }
  557. if (needEmit) {
  558. this.formItem && this.formItem.setValue("");
  559. this.$emit("change", "");
  560. this.$emit("input", "");
  561. this.$emit("update:modelValue", "");
  562. }
  563. } else {
  564. this.range.startDate = "";
  565. this.range.endDate = "";
  566. this.tempRange.startDate = "";
  567. this.tempRange.startTime = "";
  568. this.tempRange.endDate = "";
  569. this.tempRange.endTime = "";
  570. if (this.isPhone) {
  571. this.$refs.mobile && this.$refs.mobile.clearCalender();
  572. } else {
  573. this.$refs.left && this.$refs.left.clearCalender();
  574. this.$refs.right && this.$refs.right.clearCalender();
  575. this.$refs.right && this.$refs.right.next();
  576. }
  577. if (needEmit) {
  578. this.formItem && this.formItem.setValue([]);
  579. this.$emit("change", []);
  580. this.$emit("input", []);
  581. this.$emit("update:modelValue", []);
  582. }
  583. }
  584. },
  585. parseDate(date) {
  586. date = this.fixIosDateFormat(date);
  587. const defVal = new Date(date);
  588. const year = defVal.getFullYear();
  589. const month = defVal.getMonth() + 1;
  590. const day = defVal.getDate();
  591. const hour = defVal.getHours();
  592. const minute = defVal.getMinutes();
  593. const second = defVal.getSeconds();
  594. const defDate = year + "-" + this.lessTen(month) + "-" + this.lessTen(day);
  595. const defTime = this.lessTen(hour) + ":" + this.lessTen(minute) + (this.hideSecond ? "" : ":" + this.lessTen(second));
  596. return {
  597. defDate,
  598. defTime
  599. };
  600. },
  601. lessTen(item) {
  602. return item < 10 ? "0" + item : item;
  603. },
  604. //兼容 iOS、safari 日期格式
  605. fixIosDateFormat(value) {
  606. if (typeof value === "string") {
  607. value = value.replace(/-/g, "/");
  608. }
  609. return value;
  610. },
  611. leftMonthSwitch(e) {
  612. },
  613. rightMonthSwitch(e) {
  614. }
  615. }
  616. };
  617. if (!Array) {
  618. const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  619. const _component_time_picker = common_vendor.resolveComponent("time-picker");
  620. const _component_calendar = common_vendor.resolveComponent("calendar");
  621. (_easycom_uni_icons2 + _component_time_picker + _component_calendar)();
  622. }
  623. const _easycom_uni_icons = () => "../../../uni-icons/components/uni-icons/uni-icons.js";
  624. if (!Math) {
  625. _easycom_uni_icons();
  626. }
  627. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  628. return common_vendor.e({
  629. a: !$data.isRange
  630. }, !$data.isRange ? {
  631. b: common_vendor.p({
  632. type: "calendar",
  633. color: "#e1e1e1",
  634. size: "22"
  635. }),
  636. c: $options.singlePlaceholderText,
  637. d: $data.singleVal,
  638. e: common_vendor.o(($event) => $data.singleVal = $event.detail.value)
  639. } : {
  640. f: common_vendor.p({
  641. type: "calendar",
  642. color: "#e1e1e1",
  643. size: "22"
  644. }),
  645. g: $options.startPlaceholderText,
  646. h: $data.range.startDate,
  647. i: common_vendor.o(($event) => $data.range.startDate = $event.detail.value),
  648. j: common_vendor.t($props.rangeSeparator),
  649. k: $options.endPlaceholderText,
  650. l: $data.range.endDate,
  651. m: common_vendor.o(($event) => $data.range.endDate = $event.detail.value)
  652. }, {
  653. n: $options.showClearIcon
  654. }, $options.showClearIcon ? {
  655. o: common_vendor.p({
  656. type: "clear",
  657. color: "#e1e1e1",
  658. size: "18"
  659. }),
  660. p: common_vendor.o((...args) => $options.clear && $options.clear(...args))
  661. } : {}, {
  662. q: $props.disabled ? 1 : "",
  663. r: $props.border ? 1 : "",
  664. s: common_vendor.o((...args) => $options.show && $options.show(...args)),
  665. t: $data.popup,
  666. v: common_vendor.o((...args) => $options.close && $options.close(...args)),
  667. w: !$data.isPhone
  668. }, !$data.isPhone ? common_vendor.e({
  669. x: !$data.isRange
  670. }, !$data.isRange ? common_vendor.e({
  671. y: $data.hasTime
  672. }, $data.hasTime ? {
  673. z: $options.selectDateText,
  674. A: $data.tempSingleDate,
  675. B: common_vendor.o(($event) => $data.tempSingleDate = $event.detail.value),
  676. C: $options.selectTimeText,
  677. D: !$data.tempSingleDate,
  678. E: $data.time,
  679. F: common_vendor.o(($event) => $data.time = $event.detail.value),
  680. G: common_vendor.o(($event) => $data.time = $event),
  681. H: common_vendor.p({
  682. type: "time",
  683. border: false,
  684. disabled: !$data.tempSingleDate,
  685. start: $options.reactStartTime,
  686. end: $options.reactEndTime,
  687. hideSecond: $props.hideSecond,
  688. modelValue: $data.time
  689. })
  690. } : {}, {
  691. I: common_vendor.sr("pcSingle", "2ebed8e0-4"),
  692. J: common_vendor.o($options.singleChange),
  693. K: common_vendor.p({
  694. showMonth: false,
  695. ["start-date"]: $data.caleRange.startDate,
  696. ["end-date"]: $data.caleRange.endDate,
  697. date: $data.defSingleDate
  698. }),
  699. L: $data.hasTime
  700. }, $data.hasTime ? {
  701. M: common_vendor.t($options.okText),
  702. N: common_vendor.o((...args) => $options.confirmSingleChange && $options.confirmSingleChange(...args))
  703. } : {}, {
  704. O: common_vendor.s($data.popover)
  705. }) : common_vendor.e({
  706. P: $data.hasTime
  707. }, $data.hasTime ? {
  708. Q: $options.startDateText,
  709. R: $data.tempRange.startDate,
  710. S: common_vendor.o(($event) => $data.tempRange.startDate = $event.detail.value),
  711. T: $options.startTimeText,
  712. U: !$data.tempRange.startDate,
  713. V: $data.tempRange.startTime,
  714. W: common_vendor.o(($event) => $data.tempRange.startTime = $event.detail.value),
  715. X: common_vendor.o(($event) => $data.tempRange.startTime = $event),
  716. Y: common_vendor.p({
  717. type: "time",
  718. start: $options.reactStartTime,
  719. border: false,
  720. disabled: !$data.tempRange.startDate,
  721. hideSecond: $props.hideSecond,
  722. modelValue: $data.tempRange.startTime
  723. }),
  724. Z: common_vendor.p({
  725. type: "arrowthinright",
  726. color: "#999"
  727. }),
  728. aa: $options.endDateText,
  729. ab: $data.tempRange.endDate,
  730. ac: common_vendor.o(($event) => $data.tempRange.endDate = $event.detail.value),
  731. ad: $options.endTimeText,
  732. ae: !$data.tempRange.endDate,
  733. af: $data.tempRange.endTime,
  734. ag: common_vendor.o(($event) => $data.tempRange.endTime = $event.detail.value),
  735. ah: common_vendor.o(($event) => $data.tempRange.endTime = $event),
  736. ai: common_vendor.p({
  737. type: "time",
  738. end: $options.reactEndTime,
  739. border: false,
  740. disabled: !$data.tempRange.endDate,
  741. hideSecond: $props.hideSecond,
  742. modelValue: $data.tempRange.endTime
  743. })
  744. } : {}, {
  745. aj: common_vendor.sr("left", "2ebed8e0-8"),
  746. ak: common_vendor.o($options.leftChange),
  747. al: common_vendor.o($options.updateRightCale),
  748. am: common_vendor.o($options.leftMonthSwitch),
  749. an: common_vendor.p({
  750. showMonth: false,
  751. ["start-date"]: $data.caleRange.startDate,
  752. ["end-date"]: $data.caleRange.endDate,
  753. range: true,
  754. pleStatus: $data.endMultipleStatus
  755. }),
  756. ao: common_vendor.sr("right", "2ebed8e0-9"),
  757. ap: common_vendor.o($options.rightChange),
  758. aq: common_vendor.o($options.updateLeftCale),
  759. ar: common_vendor.o($options.rightMonthSwitch),
  760. as: common_vendor.p({
  761. showMonth: false,
  762. ["start-date"]: $data.caleRange.startDate,
  763. ["end-date"]: $data.caleRange.endDate,
  764. range: true,
  765. pleStatus: $data.startMultipleStatus
  766. }),
  767. at: $data.hasTime
  768. }, $data.hasTime ? {
  769. av: common_vendor.t($options.clearText),
  770. aw: common_vendor.o((...args) => $options.clear && $options.clear(...args)),
  771. ax: common_vendor.t($options.okText),
  772. ay: common_vendor.o((...args) => $options.confirmRangeChange && $options.confirmRangeChange(...args))
  773. } : {}, {
  774. az: common_vendor.s($data.popover)
  775. }), {
  776. aA: $data.popup
  777. }) : {}, {
  778. aB: common_vendor.sr("mobile", "2ebed8e0-10"),
  779. aC: $data.isPhone,
  780. aD: common_vendor.o($options.mobileChange),
  781. aE: common_vendor.p({
  782. clearDate: false,
  783. date: $data.defSingleDate,
  784. defTime: $options.reactMobDefTime,
  785. ["start-date"]: $data.caleRange.startDate,
  786. ["end-date"]: $data.caleRange.endDate,
  787. selectableTimes: $options.mobSelectableTime,
  788. pleStatus: $data.endMultipleStatus,
  789. showMonth: false,
  790. range: $data.isRange,
  791. typeHasTime: $data.hasTime,
  792. insert: false,
  793. hideSecond: $props.hideSecond
  794. })
  795. });
  796. }
  797. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-app/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue"]]);
  798. wx.createComponent(Component);