ljs-tools 0.2.8 → 0.2.10

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.
package/index.js CHANGED
@@ -9287,7 +9287,7 @@ const __default__$3 = defineComponent({
9287
9287
  name: "ElIcon",
9288
9288
  inheritAttrs: false
9289
9289
  });
9290
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
9290
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
9291
9291
  ...__default__$3,
9292
9292
  props: iconProps,
9293
9293
  setup(__props) {
@@ -9312,7 +9312,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
9312
9312
  };
9313
9313
  }
9314
9314
  });
9315
- var Icon = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/icon/src/icon.vue"]]);
9315
+ var Icon = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/icon/src/icon.vue"]]);
9316
9316
  const ElIcon = withInstall(Icon);
9317
9317
  const formContextKey = Symbol("formContextKey");
9318
9318
  const formItemContextKey = Symbol("formItemContextKey");
@@ -9556,14 +9556,14 @@ const inputEmits = {
9556
9556
  compositionupdate: (evt) => evt instanceof CompositionEvent,
9557
9557
  compositionend: (evt) => evt instanceof CompositionEvent
9558
9558
  };
9559
- const _hoisted_1$7 = ["role"];
9559
+ const _hoisted_1$8 = ["role"];
9560
9560
  const _hoisted_2$6 = ["id", "type", "disabled", "formatter", "parser", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus"];
9561
9561
  const _hoisted_3$4 = ["id", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus"];
9562
9562
  const __default__$2 = defineComponent({
9563
9563
  name: "ElInput",
9564
9564
  inheritAttrs: false
9565
9565
  });
9566
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
9566
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
9567
9567
  ...__default__$2,
9568
9568
  props: inputProps,
9569
9569
  emits: inputEmits,
@@ -9983,13 +9983,13 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
9983
9983
  class: normalizeClass(unref(nsInput).e("count"))
9984
9984
  }, toDisplayString(unref(textLength)) + " / " + toDisplayString(unref(attrs).maxlength), 7)) : createCommentVNode("v-if", true)
9985
9985
  ], 64))
9986
- ], 16, _hoisted_1$7)), [
9986
+ ], 16, _hoisted_1$8)), [
9987
9987
  [vShow, _ctx.type !== "hidden"]
9988
9988
  ]);
9989
9989
  };
9990
9990
  }
9991
9991
  });
9992
- var Input = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/input/src/input.vue"]]);
9992
+ var Input = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/input/src/input.vue"]]);
9993
9993
  const ElInput = withInstall(Input);
9994
9994
  const FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped";
9995
9995
  const FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released";
@@ -10139,7 +10139,7 @@ const createFocusOutPreventedEvent = (detail) => {
10139
10139
  detail
10140
10140
  });
10141
10141
  };
10142
- const _sfc_main$a = defineComponent({
10142
+ const _sfc_main$b = defineComponent({
10143
10143
  name: "ElFocusTrap",
10144
10144
  inheritAttrs: false,
10145
10145
  props: {
@@ -10375,10 +10375,10 @@ const _sfc_main$a = defineComponent({
10375
10375
  };
10376
10376
  }
10377
10377
  });
10378
- function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
10378
+ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
10379
10379
  return renderSlot(_ctx.$slots, "default", { handleKeydown: _ctx.onKeydown });
10380
10380
  }
10381
- var ElFocusTrap = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["render", _sfc_render$8], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/focus-trap/src/focus-trap.vue"]]);
10381
+ var ElFocusTrap = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["render", _sfc_render$9], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/focus-trap/src/focus-trap.vue"]]);
10382
10382
  const buttonGroupContextKey = Symbol("buttonGroupContextKey");
10383
10383
  const useButton = (props, emit) => {
10384
10384
  useDeprecated({
@@ -11431,7 +11431,7 @@ function useButtonCustomStyle(props) {
11431
11431
  const __default__$1 = defineComponent({
11432
11432
  name: "ElButton"
11433
11433
  });
11434
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
11434
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
11435
11435
  ...__default__$1,
11436
11436
  props: buttonProps,
11437
11437
  emits: buttonEmits,
@@ -11497,7 +11497,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
11497
11497
  };
11498
11498
  }
11499
11499
  });
11500
- var Button = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/button/src/button.vue"]]);
11500
+ var Button = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/button/src/button.vue"]]);
11501
11501
  const buttonGroupProps = {
11502
11502
  size: buttonProps.size,
11503
11503
  type: buttonProps.type
@@ -11505,7 +11505,7 @@ const buttonGroupProps = {
11505
11505
  const __default__ = defineComponent({
11506
11506
  name: "ElButtonGroup"
11507
11507
  });
11508
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
11508
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
11509
11509
  ...__default__,
11510
11510
  props: buttonGroupProps,
11511
11511
  setup(__props) {
@@ -11524,7 +11524,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
11524
11524
  };
11525
11525
  }
11526
11526
  });
11527
- var ButtonGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/button/src/button-group.vue"]]);
11527
+ var ButtonGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/button/src/button-group.vue"]]);
11528
11528
  const ElButton = withInstall(Button, {
11529
11529
  ButtonGroup
11530
11530
  });
@@ -11641,7 +11641,7 @@ var Overlay = defineComponent({
11641
11641
  }
11642
11642
  });
11643
11643
  const ElOverlay = Overlay;
11644
- const _sfc_main$7 = defineComponent({
11644
+ const _sfc_main$8 = defineComponent({
11645
11645
  name: "ElMessageBox",
11646
11646
  directives: {
11647
11647
  TrapFocus
@@ -11910,10 +11910,10 @@ const _sfc_main$7 = defineComponent({
11910
11910
  };
11911
11911
  }
11912
11912
  });
11913
- const _hoisted_1$6 = ["aria-label", "aria-describedby"];
11913
+ const _hoisted_1$7 = ["aria-label", "aria-describedby"];
11914
11914
  const _hoisted_2$5 = ["aria-label"];
11915
11915
  const _hoisted_3$3 = ["id"];
11916
- function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
11916
+ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
11917
11917
  const _component_el_icon = resolveComponent("el-icon");
11918
11918
  const _component_close = resolveComponent("close");
11919
11919
  const _component_el_input = resolveComponent("el-input");
@@ -12101,7 +12101,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
12101
12101
  ]),
12102
12102
  _: 3
12103
12103
  }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onReleaseRequested"])
12104
- ], 42, _hoisted_1$6)
12104
+ ], 42, _hoisted_1$7)
12105
12105
  ]),
12106
12106
  _: 3
12107
12107
  }, 8, ["z-index", "overlay-class", "mask"]), [
@@ -12111,7 +12111,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
12111
12111
  _: 3
12112
12112
  });
12113
12113
  }
12114
- var MessageBoxConstructor = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["render", _sfc_render$7], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/message-box/src/index.vue"]]);
12114
+ var MessageBoxConstructor = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["render", _sfc_render$8], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/message-box/src/index.vue"]]);
12115
12115
  const messageInstance = /* @__PURE__ */ new Map();
12116
12116
  const getAppendToElement = (props) => {
12117
12117
  let appendTo = document.body;
@@ -12277,7 +12277,7 @@ function delMessageBox({
12277
12277
  const LJSEl = {
12278
12278
  delMessageBox
12279
12279
  };
12280
- const index$1 = {
12280
+ const index$3 = {
12281
12281
  // emits: ['input', 'update:value'],
12282
12282
  props: {
12283
12283
  // 转速,单位秒
@@ -12320,13 +12320,13 @@ const _export_sfc = (sfc, props) => {
12320
12320
  }
12321
12321
  return target;
12322
12322
  };
12323
- const _sfc_main$6 = index$1;
12324
- const _withScopeId$1 = (n) => (pushScopeId("data-v-295da8be"), n = n(), popScopeId(), n);
12325
- const _hoisted_1$5 = { class: "text" };
12323
+ const _sfc_main$7 = index$3;
12324
+ const _withScopeId$3 = (n) => (pushScopeId("data-v-295da8be"), n = n(), popScopeId(), n);
12325
+ const _hoisted_1$6 = { class: "text" };
12326
12326
  const _hoisted_2$4 = { class: "g-container" };
12327
- const _hoisted_3$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("div", { class: "g-circle" }, null, -1));
12327
+ const _hoisted_3$2 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ createElementVNode("div", { class: "g-circle" }, null, -1));
12328
12328
  const _hoisted_4 = { class: "g-bubbles" };
12329
- function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
12329
+ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
12330
12330
  return openBlock(), createElementBlock("div", {
12331
12331
  class: "ljs-loading",
12332
12332
  id: "ljs-loading",
@@ -12338,7 +12338,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
12338
12338
  "--textcolor": _ctx.textColor
12339
12339
  })
12340
12340
  }, [
12341
- createElementVNode("div", _hoisted_1$5, [
12341
+ createElementVNode("div", _hoisted_1$6, [
12342
12342
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
12343
12343
  ]),
12344
12344
  createElementVNode("div", _hoisted_2$4, [
@@ -12354,9 +12354,9 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
12354
12354
  ])
12355
12355
  ], 4);
12356
12356
  }
12357
- const LJSLoading = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-295da8be"]]);
12357
+ const LJSLoading = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__scopeId", "data-v-295da8be"]]);
12358
12358
  const pagination_vue_vue_type_style_index_0_scoped_fc144f23_lang = "";
12359
- const _sfc_main$5 = {
12359
+ const _sfc_main$6 = {
12360
12360
  name: "pagination",
12361
12361
  props: {
12362
12362
  total: {
@@ -12436,11 +12436,11 @@ const _sfc_main$5 = {
12436
12436
  }
12437
12437
  }
12438
12438
  };
12439
- const _hoisted_1$4 = { class: "pagination" };
12439
+ const _hoisted_1$5 = { class: "pagination" };
12440
12440
  const _hoisted_2$3 = { class: "note" };
12441
- function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
12441
+ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
12442
12442
  const _component_el_pagination = resolveComponent("el-pagination");
12443
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
12443
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [
12444
12444
  createElementVNode("div", _hoisted_2$3, toDisplayString($props.note), 1),
12445
12445
  createVNode(_component_el_pagination, mergeProps({
12446
12446
  background: $props.background,
@@ -12458,8 +12458,8 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
12458
12458
  }), null, 16, ["background", "current-page", "page-size", "layout", "page-sizes", "pager-count", "total", "onSizeChange", "onCurrentChange"])
12459
12459
  ]);
12460
12460
  }
12461
- const Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-fc144f23"]]);
12462
- const index = {
12461
+ const Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-fc144f23"]]);
12462
+ const index$2 = {
12463
12463
  name: "RightMenu",
12464
12464
  props: {
12465
12465
  modelValue: [Boolean],
@@ -12490,8 +12490,8 @@ const index = {
12490
12490
  }
12491
12491
  };
12492
12492
  const index_vue_vue_type_style_index_0_scoped_a4322b42_lang = "";
12493
- const _sfc_main$4 = index;
12494
- function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
12493
+ const _sfc_main$5 = index$2;
12494
+ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
12495
12495
  return openBlock(), createBlock(Teleport, { to: "body" }, [
12496
12496
  _ctx.modelValue ? (openBlock(), createElementBlock("div", {
12497
12497
  key: 0,
@@ -12505,9 +12505,9 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
12505
12505
  ], 6)) : createCommentVNode("", true)
12506
12506
  ]);
12507
12507
  }
12508
- const RightMenu = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-a4322b42"]]);
12508
+ const RightMenu = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-a4322b42"]]);
12509
12509
  const index_vue_vue_type_style_index_0_scoped_2c007365_lang = "";
12510
- const _sfc_main$3 = {
12510
+ const _sfc_main$4 = {
12511
12511
  name: "DatetypeChooseDate",
12512
12512
  props: {
12513
12513
  // 日期区间数据
@@ -12657,9 +12657,9 @@ const _sfc_main$3 = {
12657
12657
  }
12658
12658
  }
12659
12659
  };
12660
- const _hoisted_1$3 = ["onClick"];
12660
+ const _hoisted_1$4 = ["onClick"];
12661
12661
  const _hoisted_2$2 = { class: "frequencyDate" };
12662
- function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
12662
+ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
12663
12663
  const _component_el_date_picker = resolveComponent("el-date-picker");
12664
12664
  const _component_el_form_item = resolveComponent("el-form-item");
12665
12665
  return openBlock(), createBlock(_component_el_form_item, {
@@ -12678,7 +12678,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
12678
12678
  class: normalizeClass(["one", { active: $options.dateType === dict.dictValue }]),
12679
12679
  onClick: ($event) => $options.dateTypeF(dict.dictValue),
12680
12680
  key: dict.dictValue
12681
- }, toDisplayString(dict.dictLabel), 11, _hoisted_1$3);
12681
+ }, toDisplayString(dict.dictLabel), 11, _hoisted_1$4);
12682
12682
  }), 128))
12683
12683
  ], 4),
12684
12684
  createVNode(Transition, { name: "frequencyDate" }, {
@@ -12703,9 +12703,8 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
12703
12703
  _: 1
12704
12704
  }, 8, ["label"]);
12705
12705
  }
12706
- const DatetypeChooseDate = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-2c007365"]]);
12707
- const index_vue_vue_type_style_index_0_scoped_6e589d4a_lang = "";
12708
- const _sfc_main$2 = {
12706
+ const DatetypeChooseDate = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-2c007365"]]);
12707
+ const index$1 = {
12709
12708
  name: "DatetypeChooseDateRange",
12710
12709
  props: {
12711
12710
  // 日期区间数据
@@ -12714,6 +12713,16 @@ const _sfc_main$2 = {
12714
12713
  dictValue: String,
12715
12714
  // 日期类型字典数据
12716
12715
  datetypeData: Array,
12716
+ // 清除按钮
12717
+ clearable: {
12718
+ type: Boolean,
12719
+ default: false
12720
+ },
12721
+ disabledDate: {
12722
+ type: Function,
12723
+ default: () => {
12724
+ }
12725
+ },
12717
12726
  // 字典key值对应的value值,按照年月日的顺序,默认年为1日为3
12718
12727
  dateTypeKeyValue: {
12719
12728
  type: Array,
@@ -12738,7 +12747,9 @@ const _sfc_main$2 = {
12738
12747
  date_type: [],
12739
12748
  // 日期参数
12740
12749
  opts: {
12741
- dateType: "daterange",
12750
+ startDate: null,
12751
+ endDate: null,
12752
+ dateType: "date",
12742
12753
  // 日期类型,年year,月month,日date
12743
12754
  dateTypeTag: true,
12744
12755
  // 日期控件是否显示
@@ -12754,14 +12765,6 @@ const _sfc_main$2 = {
12754
12765
  set(val) {
12755
12766
  this.$emit("update:dictValue", val);
12756
12767
  }
12757
- },
12758
- dateValue: {
12759
- get() {
12760
- return this.date;
12761
- },
12762
- set(val) {
12763
- this.$emit("update:date", val);
12764
- }
12765
12768
  }
12766
12769
  },
12767
12770
  watch: {
@@ -12786,12 +12789,23 @@ const _sfc_main$2 = {
12786
12789
  this.init();
12787
12790
  },
12788
12791
  methods: {
12789
- yearChange() {
12790
- if (Number(this.dateValue[1]) < Number(this.dateValue[0])) {
12791
- const temp0 = this.dateValue[0];
12792
- const temp1 = this.dateValue[1];
12793
- this.dateValue = [temp1, temp0];
12792
+ // 切换日期
12793
+ dateChange() {
12794
+ if (this.opts.startDate === null || this.opts.endDate === null) {
12795
+ return;
12796
+ }
12797
+ let start = this.opts.startDate;
12798
+ let end = this.opts.startDate;
12799
+ if (this.dateType !== "year") {
12800
+ start = new Date(this.opts.startDate).getTime();
12801
+ end = new Date(this.opts.endDate).getTime();
12802
+ }
12803
+ if (Number(start) > Number(end)) {
12804
+ const temp = this.opts.startDate;
12805
+ this.opts.startDate = this.opts.endDate;
12806
+ this.opts.endDate = temp;
12794
12807
  }
12808
+ this.$emit("update:date", [this.opts.startDate, this.opts.endDate]);
12795
12809
  },
12796
12810
  init() {
12797
12811
  this.initData();
@@ -12812,6 +12826,10 @@ const _sfc_main$2 = {
12812
12826
  });
12813
12827
  this.date_type = res1;
12814
12828
  }
12829
+ if (!LJSbase.fieldCheck(this.date) && this.date.length === 2) {
12830
+ this.opts.startDate = this.date[0];
12831
+ this.opts.endDate = this.date[1];
12832
+ }
12815
12833
  this.dateTypeF(this.dateType);
12816
12834
  },
12817
12835
  // 日期类型切换
@@ -12819,109 +12837,112 @@ const _sfc_main$2 = {
12819
12837
  this.opts.dateTypeTag = false;
12820
12838
  this.dateType = val;
12821
12839
  let dateValue = [];
12822
- const date = /* @__PURE__ */ new Date();
12840
+ let date = null;
12823
12841
  switch (val) {
12824
12842
  case this.dateTypeKeyValue[3]:
12825
- this.opts.dateType = "daterange";
12826
- this.opts.valueFormat = "YYYY-MM-DD";
12827
- dateValue = [LJSdate.formatTime(date, "{y}-{m}-{d}"), LJSdate.formatTime(date, "{y}-{m}-{d}")];
12843
+ this.opts.dateType = "datetime";
12844
+ this.opts.valueFormat = "YYYY-MM-DD HH:mm:ss";
12828
12845
  break;
12829
12846
  case this.dateTypeKeyValue[2]:
12830
- this.opts.dateType = "daterange";
12847
+ this.opts.dateType = "date";
12831
12848
  this.opts.valueFormat = "YYYY-MM-DD";
12832
- dateValue = [LJSdate.formatTime(date, "{y}-{m}-01"), LJSdate.formatTime(date, "{y}-{m}-{d}")];
12833
12849
  break;
12834
12850
  case this.dateTypeKeyValue[1]:
12835
- this.opts.dateType = "monthrange";
12851
+ this.opts.dateType = "month";
12836
12852
  this.opts.valueFormat = "YYYY-MM";
12837
- dateValue = [LJSdate.formatTime(date, "{y}-01"), LJSdate.formatTime(date, "{y}-{m}")];
12838
12853
  break;
12839
12854
  case this.dateTypeKeyValue[0]:
12840
12855
  this.opts.dateType = "year";
12841
12856
  this.opts.valueFormat = "YYYY";
12842
- dateValue = [(date.getFullYear() - 4).toString(), date.getFullYear().toString()];
12843
12857
  break;
12844
12858
  }
12845
- this.dateValue = dateValue;
12859
+ if (!LJSbase.fieldCheck(this.date) && this.date.length === 2) {
12860
+ date = [this.date[0], this.date[1]];
12861
+ switch (val) {
12862
+ case this.dateTypeKeyValue[3]:
12863
+ dateValue = [LJSdate.formatTime(date[0], "{y}-{m}-{d}"), LJSdate.formatTime(date[1], "{y}-{m}-{d}")];
12864
+ break;
12865
+ case this.dateTypeKeyValue[2]:
12866
+ dateValue = [LJSdate.formatTime(date[0], "{y}-{m}-{d}"), LJSdate.formatTime(date[1], "{y}-{m}-{d}")];
12867
+ break;
12868
+ case this.dateTypeKeyValue[1]:
12869
+ dateValue = [LJSdate.formatTime(date[0], "{y}-{m}"), LJSdate.formatTime(date[1], "{y}-{m}")];
12870
+ break;
12871
+ case this.dateTypeKeyValue[0]:
12872
+ dateValue = date;
12873
+ break;
12874
+ }
12875
+ this.dateValue = dateValue;
12876
+ }
12846
12877
  setTimeout(() => {
12847
12878
  this.opts.dateTypeTag = true;
12848
12879
  }, 0);
12849
12880
  }
12850
12881
  }
12851
12882
  };
12852
- const _hoisted_1$2 = ["onClick"];
12883
+ const index_vue_vue_type_style_index_0_scoped_e45b32bb_lang = "";
12884
+ const _sfc_main$3 = index$1;
12885
+ const _withScopeId$2 = (n) => (pushScopeId("data-v-e45b32bb"), n = n(), popScopeId(), n);
12886
+ const _hoisted_1$3 = ["onClick"];
12853
12887
  const _hoisted_2$1 = {
12854
12888
  key: 0,
12855
12889
  class: "frequencyDate"
12856
12890
  };
12857
- const _hoisted_3$1 = {
12858
- key: 2,
12859
- class: "zhi"
12860
- };
12861
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
12891
+ const _hoisted_3$1 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("span", { class: "zhi" }, "~", -1));
12892
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
12862
12893
  const _component_el_date_picker = resolveComponent("el-date-picker");
12863
12894
  const _component_el_form_item = resolveComponent("el-form-item");
12864
12895
  return openBlock(), createBlock(_component_el_form_item, {
12865
- label: $props.formItemLabel,
12896
+ label: _ctx.formItemLabel,
12866
12897
  prop: "date"
12867
12898
  }, {
12868
12899
  default: withCtx(() => [
12869
12900
  createElementVNode("div", {
12870
12901
  class: "frequency",
12871
12902
  style: normalizeStyle({
12872
- "--dateTypeNum": $data.date_type.length
12903
+ "--dateTypeNum": _ctx.date_type.length
12873
12904
  })
12874
12905
  }, [
12875
- (openBlock(true), createElementBlock(Fragment, null, renderList($data.date_type, (dict) => {
12906
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.date_type, (dict) => {
12876
12907
  return openBlock(), createElementBlock("div", {
12877
- class: normalizeClass(["one", { active: $options.dateType === dict.dictValue }]),
12878
- onClick: ($event) => $options.dateTypeF(dict.dictValue),
12908
+ class: normalizeClass(["one", { active: _ctx.dateType === dict.dictValue }]),
12909
+ onClick: ($event) => _ctx.dateTypeF(dict.dictValue),
12879
12910
  key: dict.dictValue
12880
- }, toDisplayString(dict.dictLabel), 11, _hoisted_1$2);
12911
+ }, toDisplayString(dict.dictLabel), 11, _hoisted_1$3);
12881
12912
  }), 128))
12882
12913
  ], 4),
12883
12914
  createVNode(Transition, { name: "frequencyDate" }, {
12884
12915
  default: withCtx(() => [
12885
- $data.opts.dateTypeTag ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
12886
- $data.opts.dateType !== "year" ? (openBlock(), createBlock(_component_el_date_picker, {
12887
- key: 0,
12888
- modelValue: $options.dateValue,
12889
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.dateValue = $event),
12890
- style: { "width": "240px" },
12891
- "value-format": $data.opts.valueFormat,
12892
- type: $data.opts.dateType,
12893
- placeholder: "请选择",
12894
- editable: false,
12895
- clearable: false,
12896
- "disabled-date": $data.LJSfc.pickerOptions()
12897
- }, null, 8, ["modelValue", "value-format", "type", "disabled-date"])) : createCommentVNode("", true),
12898
- $data.opts.dateType === "year" ? (openBlock(), createBlock(_component_el_date_picker, {
12899
- key: 1,
12900
- modelValue: $options.dateValue[0],
12901
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $options.dateValue[0] = $event),
12902
- style: { "width": "100px !important" },
12903
- "value-format": $data.opts.valueFormat,
12904
- type: $data.opts.dateType,
12916
+ _ctx.opts.dateTypeTag ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
12917
+ createVNode(_component_el_date_picker, {
12918
+ modelValue: _ctx.opts.startDate,
12919
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.opts.startDate = $event),
12920
+ style: normalizeStyle({
12921
+ width: `${_ctx.opts.dateType === "year" ? 100 : _ctx.opts.dateType === "month" ? 120 : _ctx.opts.dateType === "date" ? 140 : _ctx.opts.dateType === "datetime" ? 200 : 200}px !important`
12922
+ }),
12923
+ "value-format": _ctx.opts.valueFormat,
12924
+ type: _ctx.opts.dateType,
12905
12925
  placeholder: "请选择",
12906
12926
  editable: false,
12907
- clearable: false,
12908
- "disabled-date": $data.LJSfc.pickerOptions(),
12909
- onChange: $options.yearChange
12910
- }, null, 8, ["modelValue", "value-format", "type", "disabled-date", "onChange"])) : createCommentVNode("", true),
12911
- $data.opts.dateType === "year" ? (openBlock(), createElementBlock("span", _hoisted_3$1, "~")) : createCommentVNode("", true),
12912
- $data.opts.dateType === "year" ? (openBlock(), createBlock(_component_el_date_picker, {
12913
- key: 3,
12914
- modelValue: $options.dateValue[1],
12915
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $options.dateValue[1] = $event),
12916
- style: { "width": "100px !important" },
12917
- "value-format": $data.opts.valueFormat,
12918
- type: $data.opts.dateType,
12927
+ clearable: _ctx.clearable,
12928
+ "disabled-date": _ctx.disabledDate,
12929
+ onChange: _ctx.dateChange
12930
+ }, null, 8, ["modelValue", "style", "value-format", "type", "clearable", "disabled-date", "onChange"]),
12931
+ _hoisted_3$1,
12932
+ createVNode(_component_el_date_picker, {
12933
+ modelValue: _ctx.opts.endDate,
12934
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.opts.endDate = $event),
12935
+ style: normalizeStyle({
12936
+ width: `${_ctx.opts.dateType === "year" ? 100 : _ctx.opts.dateType === "month" ? 120 : _ctx.opts.dateType === "date" ? 140 : _ctx.opts.dateType === "datetime" ? 200 : 200}px !important`
12937
+ }),
12938
+ "value-format": _ctx.opts.valueFormat,
12939
+ type: _ctx.opts.dateType,
12919
12940
  placeholder: "请选择",
12920
12941
  editable: false,
12921
- clearable: false,
12922
- "disabled-date": $data.LJSfc.pickerOptions(),
12923
- onChange: $options.yearChange
12924
- }, null, 8, ["modelValue", "value-format", "type", "disabled-date", "onChange"])) : createCommentVNode("", true)
12942
+ clearable: _ctx.clearable,
12943
+ "disabled-date": _ctx.disabledDate,
12944
+ onChange: _ctx.dateChange
12945
+ }, null, 8, ["modelValue", "style", "value-format", "type", "clearable", "disabled-date", "onChange"])
12925
12946
  ])) : createCommentVNode("", true)
12926
12947
  ]),
12927
12948
  _: 1
@@ -12930,7 +12951,145 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
12930
12951
  _: 1
12931
12952
  }, 8, ["label"]);
12932
12953
  }
12933
- const DatetypeChooseDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-6e589d4a"]]);
12954
+ const DatetypeChooseDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-e45b32bb"]]);
12955
+ const index = {
12956
+ name: "DatetypeChooseDateRange",
12957
+ props: {
12958
+ // 日期区间数据
12959
+ modelValue: Array,
12960
+ // 日期类型
12961
+ dateType: {
12962
+ type: String,
12963
+ default: "date"
12964
+ },
12965
+ // 默认类型,默认值:日。字典value
12966
+ formItemLabel: {
12967
+ type: String,
12968
+ default: "日期"
12969
+ },
12970
+ // 清除按钮
12971
+ clearable: {
12972
+ type: Boolean,
12973
+ default: true
12974
+ },
12975
+ disabledDate: {
12976
+ type: Function,
12977
+ default: () => {
12978
+ }
12979
+ }
12980
+ },
12981
+ data() {
12982
+ return {
12983
+ // 日期参数
12984
+ opts: {
12985
+ startDate: null,
12986
+ endDate: null,
12987
+ valueFormat: "YYYY-MM-DD"
12988
+ }
12989
+ };
12990
+ },
12991
+ watch: {
12992
+ modelValue: {
12993
+ handler(val) {
12994
+ if (!LJSbase.fieldCheck(this.modelValue) && this.modelValue.length === 2) {
12995
+ this.opts.startDate = this.modelValue[0];
12996
+ this.opts.endDate = this.modelValue[1];
12997
+ }
12998
+ },
12999
+ deep: true,
13000
+ immediate: true
13001
+ }
13002
+ },
13003
+ mounted() {
13004
+ this.init();
13005
+ },
13006
+ methods: {
13007
+ // 切换日期
13008
+ dateChange() {
13009
+ if (this.opts.startDate === null || this.opts.endDate === null) {
13010
+ return;
13011
+ }
13012
+ let start = this.opts.startDate;
13013
+ let end = this.opts.startDate;
13014
+ if (this.dateType !== "year") {
13015
+ start = new Date(this.opts.startDate).getTime();
13016
+ end = new Date(this.opts.endDate).getTime();
13017
+ }
13018
+ if (Number(start) > Number(end)) {
13019
+ const temp = this.opts.startDate;
13020
+ this.opts.startDate = this.opts.endDate;
13021
+ this.opts.endDate = temp;
13022
+ }
13023
+ this.$emit("update:modelValue", [this.opts.startDate, this.opts.endDate]);
13024
+ },
13025
+ init() {
13026
+ this.dateTypeF();
13027
+ },
13028
+ // 日期类型切换
13029
+ dateTypeF() {
13030
+ switch (this.dateType) {
13031
+ case "datetime":
13032
+ this.opts.valueFormat = "YYYY-MM-DD HH:mm:ss";
13033
+ break;
13034
+ case "date":
13035
+ this.opts.valueFormat = "YYYY-MM-DD";
13036
+ break;
13037
+ case "month":
13038
+ this.opts.valueFormat = "YYYY-MM";
13039
+ break;
13040
+ case "year":
13041
+ this.opts.valueFormat = "YYYY";
13042
+ break;
13043
+ }
13044
+ }
13045
+ }
13046
+ };
13047
+ const index_vue_vue_type_style_index_0_scoped_bb586ec7_lang = "";
13048
+ const _sfc_main$2 = index;
13049
+ const _withScopeId$1 = (n) => (pushScopeId("data-v-bb586ec7"), n = n(), popScopeId(), n);
13050
+ const _hoisted_1$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("span", { class: "and" }, "~", -1));
13051
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
13052
+ const _component_el_date_picker = resolveComponent("el-date-picker");
13053
+ const _component_el_form_item = resolveComponent("el-form-item");
13054
+ return openBlock(), createBlock(_component_el_form_item, {
13055
+ label: _ctx.formItemLabel,
13056
+ prop: "date"
13057
+ }, {
13058
+ default: withCtx(() => [
13059
+ createVNode(_component_el_date_picker, {
13060
+ modelValue: _ctx.opts.startDate,
13061
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.opts.startDate = $event),
13062
+ style: normalizeStyle({
13063
+ width: `${_ctx.dateType === "year" ? 100 : _ctx.dateType === "month" ? 120 : _ctx.dateType === "date" ? 140 : _ctx.dateType === "datetime" ? 200 : 200}px !important`
13064
+ }),
13065
+ "value-format": _ctx.opts.valueFormat,
13066
+ type: _ctx.dateType,
13067
+ placeholder: "开始日期",
13068
+ editable: false,
13069
+ clearable: _ctx.clearable,
13070
+ "disabled-date": _ctx.disabledDate,
13071
+ onChange: _ctx.dateChange
13072
+ }, null, 8, ["modelValue", "style", "value-format", "type", "clearable", "disabled-date", "onChange"]),
13073
+ _hoisted_1$2,
13074
+ createVNode(_component_el_date_picker, {
13075
+ modelValue: _ctx.opts.endDate,
13076
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.opts.endDate = $event),
13077
+ style: normalizeStyle({
13078
+ width: `${_ctx.dateType === "year" ? 100 : _ctx.dateType === "month" ? 120 : _ctx.dateType === "date" ? 140 : _ctx.dateType === "datetime" ? 200 : 200}px !important`
13079
+ }),
13080
+ "value-format": _ctx.opts.valueFormat,
13081
+ type: _ctx.dateType,
13082
+ placeholder: "结束日期",
13083
+ editable: false,
13084
+ clearable: _ctx.clearable,
13085
+ "disabled-date": _ctx.disabledDate,
13086
+ onChange: _ctx.dateChange
13087
+ }, null, 8, ["modelValue", "style", "value-format", "type", "clearable", "disabled-date", "onChange"])
13088
+ ]),
13089
+ _: 1
13090
+ }, 8, ["label"]);
13091
+ }
13092
+ const DateRange = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-bb586ec7"]]);
12934
13093
  const index_vue_vue_type_style_index_0_scoped_f2de2f23_lang = "";
12935
13094
  const _sfc_main$1 = {
12936
13095
  name: "DictTag",
@@ -14262,6 +14421,7 @@ const tools = [
14262
14421
  { type: "component", name: "RightMenu", entity: RightMenu },
14263
14422
  { type: "component", name: "DatetypeChooseDate", entity: DatetypeChooseDate },
14264
14423
  { type: "component", name: "DatetypeChooseDateRange", entity: DatetypeChooseDateRange },
14424
+ { type: "component", name: "DateRange", entity: DateRange },
14265
14425
  { type: "component", name: "DictTag", entity: DictTag },
14266
14426
  { type: "component", name: "Particles", entity: Particles },
14267
14427
  { type: "other_function", name: "self", entity: self$1 }
@@ -14290,6 +14450,7 @@ const globals = {
14290
14450
  RightMenu,
14291
14451
  DatetypeChooseDate,
14292
14452
  DatetypeChooseDateRange,
14453
+ DateRange,
14293
14454
  DictTag,
14294
14455
  Particles,
14295
14456
  // 方法