@xjw_/vue3-npm-system 1.0.7 → 1.0.9

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/dist/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import Cookies from "js-cookie";
2
2
  import axios from "axios";
3
3
  import { ElMessage } from "element-plus";
4
- import { defineComponent, computed, openBlock, createElementBlock, mergeProps, createElementVNode, ref, provide, resolveComponent, createBlock, withCtx, createVNode, normalizeStyle, renderSlot, inject, useSlots, createCommentVNode, withKeys, normalizeClass, unref, toDisplayString, createTextVNode, withDirectives, vShow, nextTick, watch, Fragment, renderList, createSlots, reactive, onMounted, getCurrentInstance, normalizeProps, guardReactiveProps } from "vue";
4
+ import { defineComponent, computed, openBlock, createElementBlock, mergeProps, createElementVNode, ref, watch, resolveComponent, createBlock, provide, withCtx, createVNode, normalizeStyle, renderSlot, inject, normalizeClass, createCommentVNode, Fragment, renderList, createSlots, getCurrentInstance, toDisplayString, useSlots, withKeys, unref, createTextVNode, withDirectives, vShow, nextTick, onMounted, normalizeProps, guardReactiveProps } from "vue";
5
5
  function debounce$1(func, wait) {
6
6
  let timeout = null;
7
7
  return function(...args) {
@@ -282,8 +282,8 @@ const directives = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
282
282
  registerDirectives,
283
283
  throttle
284
284
  }, Symbol.toStringTag, { value: "Module" }));
285
- const _hoisted_1$5 = ["href", "xlink:href"];
286
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
285
+ const _hoisted_1$4 = ["href", "xlink:href"];
286
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
287
287
  __name: "SvgIcon",
288
288
  props: {
289
289
  iconClass: {
@@ -324,7 +324,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
324
324
  createElementVNode("use", {
325
325
  href: iconName.value,
326
326
  "xlink:href": iconName.value
327
- }, null, 8, _hoisted_1$5)
327
+ }, null, 8, _hoisted_1$4)
328
328
  ], 16));
329
329
  };
330
330
  }
@@ -336,8 +336,216 @@ const _export_sfc = (sfc, props) => {
336
336
  }
337
337
  return target;
338
338
  };
339
- const SvgIcon = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-bc56d70e"]]);
340
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
339
+ const SvgIcon = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-bc56d70e"]]);
340
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
341
+ __name: "XDatePicker",
342
+ props: {
343
+ type: {
344
+ type: String,
345
+ default: "date",
346
+ validator: (val) => [
347
+ "year",
348
+ "years",
349
+ "month",
350
+ "months",
351
+ "date",
352
+ "dates",
353
+ "datetime",
354
+ "week",
355
+ "datetimerange",
356
+ "daterange",
357
+ "monthrange",
358
+ "yearrange"
359
+ ].includes(val)
360
+ },
361
+ valueFormat: {
362
+ type: String,
363
+ default: null
364
+ },
365
+ placeholder: {
366
+ type: String,
367
+ default: null
368
+ },
369
+ startPlaceholder: {
370
+ type: String,
371
+ default: null
372
+ },
373
+ endPlaceholder: {
374
+ type: String,
375
+ default: null
376
+ },
377
+ rangeSeparator: {
378
+ type: String,
379
+ default: "至"
380
+ },
381
+ defaultTime: {
382
+ type: [String, Array],
383
+ default: null
384
+ },
385
+ isEndTime: {
386
+ type: Boolean,
387
+ default: false
388
+ },
389
+ modelValue: {
390
+ type: [String, Number, Array, Date],
391
+ default: ""
392
+ },
393
+ size: {
394
+ type: String,
395
+ default: "default"
396
+ }
397
+ },
398
+ emits: ["update:modelValue"],
399
+ setup(__props, { emit: __emit }) {
400
+ const props = __props;
401
+ const emit = __emit;
402
+ const internalValue = ref(props.modelValue);
403
+ function toDayjsFormat(format) {
404
+ return format.replace(/yyyy/g, "YYYY").replace(/dd/g, "DD");
405
+ }
406
+ function getDefaultFormat(type) {
407
+ const formatMap = {
408
+ "year": "YYYY",
409
+ "years": "YYYY",
410
+ "month": "YYYY-MM",
411
+ "months": "YYYY-MM",
412
+ "date": "YYYY-MM-DD",
413
+ "dates": "YYYY-MM-DD",
414
+ "datetime": "YYYY-MM-DD HH:mm:ss",
415
+ "week": "YYYY-MM-DD",
416
+ "datetimerange": "YYYY-MM-DD HH:mm:ss",
417
+ "daterange": "YYYY-MM-DD",
418
+ "monthrange": "YYYY-MM",
419
+ "yearrange": "YYYY"
420
+ };
421
+ return formatMap[type] || "YYYY-MM-DD";
422
+ }
423
+ function getDefaultPlaceholder(type) {
424
+ const isRange = type.includes("range");
425
+ const hasTime = type.includes("time");
426
+ if (isRange) {
427
+ return {
428
+ start: hasTime ? "开始日期时间" : "开始日期",
429
+ end: hasTime ? "结束日期时间" : "结束日期"
430
+ };
431
+ } else {
432
+ if (type === "year" || type === "years") return "选择年";
433
+ if (type === "month" || type === "months") return "选择月";
434
+ if (type === "week") return "选择周";
435
+ if (hasTime) return "选择日期时间";
436
+ return "选择日期";
437
+ }
438
+ }
439
+ const currentPlaceholder = computed(() => {
440
+ if (props.placeholder !== null) return props.placeholder;
441
+ const isRange = props.type.includes("range");
442
+ if (isRange) return void 0;
443
+ return getDefaultPlaceholder(props.type);
444
+ });
445
+ const currentStartPlaceholder = computed(() => {
446
+ if (props.startPlaceholder !== null) return props.startPlaceholder;
447
+ const isRange = props.type.includes("range");
448
+ if (!isRange) return void 0;
449
+ const defaults = getDefaultPlaceholder(props.type);
450
+ return defaults.start;
451
+ });
452
+ const currentEndPlaceholder = computed(() => {
453
+ if (props.endPlaceholder !== null) return props.endPlaceholder;
454
+ const isRange = props.type.includes("range");
455
+ if (!isRange) return void 0;
456
+ const defaults = getDefaultPlaceholder(props.type);
457
+ return defaults.end;
458
+ });
459
+ const currentValueFormat = computed(() => {
460
+ if (props.valueFormat !== null && props.valueFormat !== void 0) {
461
+ return toDayjsFormat(props.valueFormat);
462
+ }
463
+ return getDefaultFormat(props.type);
464
+ });
465
+ const currentDefaultTime = computed(() => {
466
+ if (props.defaultTime !== null && props.defaultTime !== void 0) {
467
+ return props.defaultTime;
468
+ }
469
+ if (props.isEndTime && props.type === "datetimerange") {
470
+ return [new Date(2e3, 0, 1, 0, 0, 0), new Date(2e3, 0, 1, 23, 59, 59)];
471
+ }
472
+ if (props.isEndTime && props.type === "datetime") {
473
+ return new Date(2e3, 0, 1, 23, 59, 59);
474
+ }
475
+ return void 0;
476
+ });
477
+ function applyEndTime(value) {
478
+ const startTime = "00:00:00";
479
+ const endTime = "23:59:59";
480
+ if (props.type === "datetimerange" && Array.isArray(value) && value.length === 2) {
481
+ let startVal = value[0];
482
+ let endVal = value[1];
483
+ if (startVal instanceof Date) {
484
+ const newStart = new Date(startVal);
485
+ newStart.setHours(0, 0, 0, 0);
486
+ startVal = newStart;
487
+ } else if (typeof startVal === "string" && startVal) {
488
+ const datePart = startVal.substring(0, 10);
489
+ startVal = datePart + " " + startTime;
490
+ }
491
+ if (endVal instanceof Date) {
492
+ const newEnd = new Date(endVal);
493
+ newEnd.setHours(23, 59, 59, 0);
494
+ endVal = newEnd;
495
+ } else if (typeof endVal === "string" && endVal) {
496
+ const datePart = endVal.substring(0, 10);
497
+ endVal = datePart + " " + endTime;
498
+ }
499
+ return [startVal, endVal];
500
+ }
501
+ if (props.type === "datetime" && value) {
502
+ if (value instanceof Date) {
503
+ if (value.getHours() === 0 && value.getMinutes() === 0 && value.getSeconds() === 0) {
504
+ const newDate = new Date(value);
505
+ newDate.setHours(23, 59, 59, 0);
506
+ return newDate;
507
+ }
508
+ return value;
509
+ }
510
+ if (typeof value === "string") {
511
+ const timePart = value.length > 10 ? value.substring(11) : "";
512
+ if (!timePart) {
513
+ const datePart = value.substring(0, 10);
514
+ return datePart + " " + endTime;
515
+ }
516
+ }
517
+ }
518
+ return value;
519
+ }
520
+ watch(() => props.modelValue, (newVal) => {
521
+ let result = newVal;
522
+ if (props.isEndTime && newVal) {
523
+ result = applyEndTime(newVal);
524
+ }
525
+ internalValue.value = result;
526
+ });
527
+ function handleUpdate(value) {
528
+ internalValue.value = value;
529
+ emit("update:modelValue", value);
530
+ }
531
+ return (_ctx, _cache) => {
532
+ const _component_el_date_picker = resolveComponent("el-date-picker");
533
+ return openBlock(), createBlock(_component_el_date_picker, mergeProps({
534
+ "model-value": internalValue.value,
535
+ type: __props.type,
536
+ placeholder: currentPlaceholder.value,
537
+ "start-placeholder": currentStartPlaceholder.value,
538
+ "end-placeholder": currentEndPlaceholder.value,
539
+ "range-separator": __props.rangeSeparator,
540
+ "value-format": currentValueFormat.value,
541
+ "default-time": currentDefaultTime.value,
542
+ size: __props.size
543
+ }, _ctx.$attrs, { "onUpdate:modelValue": handleUpdate }), null, 16, ["model-value", "type", "placeholder", "start-placeholder", "end-placeholder", "range-separator", "value-format", "default-time", "size"]);
544
+ };
545
+ }
546
+ });
547
+ const XDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-264a8a79"]]);
548
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
341
549
  __name: "XElForm",
342
550
  props: {
343
551
  model: {
@@ -478,8 +686,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
478
686
  };
479
687
  }
480
688
  });
481
- const XElForm = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-441b419b"]]);
482
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
689
+ const XElForm = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-441b419b"]]);
690
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
483
691
  __name: "XElFormItem",
484
692
  props: {
485
693
  label: {
@@ -562,413 +770,192 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
562
770
  };
563
771
  }
564
772
  });
565
- const XElFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-50c1c717"]]);
566
- const _hoisted_1$4 = {
567
- key: 0,
568
- class: "search-top"
569
- };
570
- const _hoisted_2$2 = { class: "search-top__inner" };
571
- const _hoisted_3$2 = { class: "search-top__row" };
572
- const _hoisted_4$2 = {
573
- key: 0,
574
- class: "search-top__label"
575
- };
576
- const _hoisted_5$2 = {
577
- key: 1,
578
- class: "search-top-input"
579
- };
580
- const _hoisted_6$2 = {
581
- key: 0,
582
- class: "search-top-extra-item"
583
- };
584
- const _hoisted_7$2 = {
585
- key: 0,
586
- class: "search-top-extra-label"
587
- };
588
- const _hoisted_8$2 = { class: "search-top-extra-content" };
589
- const _hoisted_9$1 = {
590
- key: 1,
591
- class: "search-top-extra-item"
592
- };
593
- const _hoisted_10$1 = {
594
- key: 0,
595
- class: "search-top-extra-label"
596
- };
597
- const _hoisted_11$1 = { class: "search-top-extra-content" };
598
- const _hoisted_12$1 = {
599
- key: 2,
600
- class: "search-top-extra-item"
601
- };
602
- const _hoisted_13$1 = {
603
- key: 0,
604
- class: "search-top-extra-label"
605
- };
606
- const _hoisted_14$1 = { class: "search-top-extra-content" };
607
- const _hoisted_15$1 = { class: "search-top__actions" };
608
- const _hoisted_16$1 = { class: "search-form__buttons" };
609
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
610
- __name: "XSearchBar",
773
+ const XElFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-50c1c717"]]);
774
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
775
+ __name: "XElOption",
611
776
  props: {
612
- modelValue: {
777
+ label: {
613
778
  type: [String, Number],
614
779
  default: void 0
615
780
  },
616
- placeholder: {
617
- type: String,
618
- default: "请输入搜索关键词"
619
- },
620
- queryForm: {
621
- type: Object,
622
- required: true,
623
- default: () => ({})
781
+ value: {
782
+ type: [String, Number],
783
+ default: void 0
624
784
  },
625
- rules: {
626
- type: Object,
627
- default: () => ({})
628
- },
629
- titleWidth: {
630
- type: String,
631
- default: "100px"
785
+ disabled: {
786
+ type: Boolean,
787
+ default: false
788
+ }
789
+ },
790
+ setup(__props) {
791
+ const props = __props;
792
+ const elSelectModelValue = inject("elSelectModelValue", null);
793
+ const computedValue = computed(() => {
794
+ const propValue = props.value;
795
+ if (!elSelectModelValue || !elSelectModelValue.value) {
796
+ return propValue;
797
+ }
798
+ const modelVal = elSelectModelValue.value;
799
+ if (Array.isArray(modelVal) && modelVal.length > 0) {
800
+ const firstValueType = typeof modelVal[0];
801
+ if (firstValueType === "number" && typeof propValue === "string") {
802
+ return Number(propValue);
803
+ }
804
+ if (firstValueType === "string" && typeof propValue === "number") {
805
+ return String(propValue);
806
+ }
807
+ }
808
+ if (!Array.isArray(modelVal)) {
809
+ const parentType = typeof modelVal;
810
+ if (parentType === "number" && typeof propValue === "string") {
811
+ return Number(propValue);
812
+ }
813
+ if (parentType === "string" && typeof propValue === "number") {
814
+ return String(propValue);
815
+ }
816
+ }
817
+ return propValue;
818
+ });
819
+ const computedLabel = computed(() => props.label);
820
+ return (_ctx, _cache) => {
821
+ const _component_el_option = resolveComponent("el-option");
822
+ return openBlock(), createBlock(_component_el_option, mergeProps(_ctx.$attrs, {
823
+ label: computedLabel.value,
824
+ value: computedValue.value
825
+ }), {
826
+ default: withCtx(() => [
827
+ renderSlot(_ctx.$slots, "default")
828
+ ]),
829
+ _: 3
830
+ }, 16, ["label", "value"]);
831
+ };
832
+ }
833
+ });
834
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
835
+ __name: "XElSelect",
836
+ props: {
837
+ modelValue: {
838
+ type: [String, Number, Array],
839
+ default: void 0
632
840
  },
633
- columns: {
634
- type: Number,
635
- default: 4
841
+ width: {
842
+ type: [String, Number],
843
+ default: "100%"
636
844
  },
637
- paddingBottom: {
638
- type: String,
639
- default: "16px"
845
+ multiple: {
846
+ type: Boolean,
847
+ default: false
640
848
  },
641
- showInput: {
849
+ typeConvert: {
642
850
  type: Boolean,
643
851
  default: true
644
852
  },
645
- showMoreBottom: {
853
+ separator: {
854
+ type: String,
855
+ default: ""
856
+ },
857
+ targetType: {
858
+ type: String,
859
+ default: "auto",
860
+ validator: (value) => ["string", "number", "auto"].includes(value)
861
+ },
862
+ clearable: {
646
863
  type: Boolean,
647
864
  default: true
648
865
  },
649
- showSearch: {
866
+ filterable: {
650
867
  type: Boolean,
651
868
  default: true
652
869
  },
653
- text1: {
654
- type: String,
655
- default: ""
656
- },
657
- text2: {
870
+ placeholder: {
658
871
  type: String,
659
- default: ""
872
+ default: void 0
660
873
  },
661
- text3: {
874
+ size: {
662
875
  type: String,
663
- default: ""
876
+ default: "default"
664
877
  }
665
878
  },
666
- emits: ["update:modelValue", "update:queryForm", "list-update", "data-reset"],
879
+ emits: ["update:modelValue", "change"],
667
880
  setup(__props, { expose: __expose, emit: __emit }) {
668
881
  const props = __props;
669
882
  const emit = __emit;
670
- const slots = useSlots();
671
- const showMore = ref(false);
672
- const queryFormRef = ref();
673
- const vxeFormRef = ref();
674
- const combinedQueries = computed({
675
- get() {
676
- if (props.modelValue !== void 0 && props.modelValue !== null) {
677
- return props.modelValue;
883
+ const selectRef = ref();
884
+ const localValue = ref(props.modelValue);
885
+ const modelValueRef = ref(null);
886
+ provide("elSelectModelValue", modelValueRef);
887
+ const computedLocalValue = computed(() => {
888
+ const val = localValue.value;
889
+ if (!props.typeConvert || val === null || val === void 0) {
890
+ return val;
891
+ }
892
+ if (props.multiple && props.separator) {
893
+ if (typeof val === "string" && val.includes(props.separator)) {
894
+ const values = val.split(props.separator);
895
+ if (props.targetType === "number") {
896
+ return values.map((v) => Number(v));
897
+ }
898
+ return values;
678
899
  }
679
- return props.queryForm.combinedQueries || "";
680
- },
681
- set(val) {
682
- if (props.modelValue !== void 0 && props.modelValue !== null) {
683
- emit("update:modelValue", val);
684
- } else {
685
- props.queryForm.combinedQueries = val;
900
+ if (Array.isArray(val)) {
901
+ return val;
686
902
  }
903
+ if (val === "" || val === null || val === void 0) {
904
+ return [];
905
+ }
906
+ return [val];
687
907
  }
908
+ return val;
688
909
  });
689
- const hasFormSlot = computed(() => !!slots.form);
690
- const hasVxeFormSlot = computed(() => !!slots.vxeForm);
691
- const vxeFormSpan = computed(() => Math.floor(24 / props.columns));
692
- const formContainerStyle = computed(() => ({
693
- "--form-columns": props.columns
694
- }));
695
- const buttonItemSpan = computed(() => {
696
- return 24;
910
+ watch(() => props.modelValue, (newVal) => {
911
+ localValue.value = newVal;
697
912
  });
698
- function reset() {
699
- combinedQueries.value = "";
700
- if (props.modelValue !== void 0 && props.modelValue !== null) {
701
- emit("update:modelValue", "");
702
- }
703
- if (hasFormSlot.value && queryFormRef.value && typeof queryFormRef.value.resetFields === "function") {
704
- nextTick(() => {
705
- queryFormRef.value.resetFields();
706
- });
707
- }
708
- if (hasVxeFormSlot.value && vxeFormRef.value && typeof vxeFormRef.value.reset === "function") {
709
- vxeFormRef.value.reset();
710
- }
711
- if (props.queryForm && Object.keys(props.queryForm).length > 0) {
712
- const emptyForm = {};
713
- Object.keys(props.queryForm).forEach((key) => {
714
- const value = props.queryForm[key];
715
- if (Array.isArray(value)) {
716
- emptyForm[key] = [];
717
- } else if (value !== null && typeof value === "object") {
718
- emptyForm[key] = {};
719
- } else {
720
- emptyForm[key] = "";
721
- }
722
- });
723
- emit("update:queryForm", emptyForm);
724
- }
725
- showMore.value = false;
726
- emit("data-reset");
727
- }
728
- function searchParentList() {
729
- if (props.rules && Object.keys(props.rules).length > 0) {
730
- if (hasVxeFormSlot.value && vxeFormRef.value) {
731
- return new Promise((resolve, reject) => {
732
- if (typeof vxeFormRef.value.validate === "function") {
733
- vxeFormRef.value.validate((valid) => {
734
- if (valid) {
735
- showMore.value = true;
736
- reject(false);
737
- } else {
738
- showMore.value = false;
739
- emit("list-update", 1);
740
- resolve(true);
741
- }
742
- });
743
- } else {
744
- emit("list-update", 1);
745
- resolve(true);
746
- }
747
- });
748
- }
749
- if (hasFormSlot.value && queryFormRef.value && typeof queryFormRef.value.validate === "function") {
750
- return new Promise((resolve, reject) => {
751
- queryFormRef.value.validate((valid) => {
752
- if (valid) {
753
- showMore.value = false;
754
- emit("list-update", 1);
755
- resolve(true);
756
- } else {
757
- showMore.value = true;
758
- reject(false);
759
- }
760
- });
761
- });
762
- }
913
+ watch(computedLocalValue, (newVal) => {
914
+ modelValueRef.value = newVal;
915
+ }, { immediate: true });
916
+ function handleLocalUpdate(val) {
917
+ localValue.value = val;
918
+ if (props.multiple && props.separator) {
919
+ const arr = Array.isArray(val) ? val : [val];
920
+ emit("update:modelValue", arr.join(props.separator));
763
921
  } else {
764
- showMore.value = false;
765
- emit("list-update", 1);
766
- return Promise.resolve(true);
922
+ emit("update:modelValue", val);
767
923
  }
768
924
  }
925
+ function handleChange(val) {
926
+ emit("change", val);
927
+ }
769
928
  __expose({
770
- queryFormRef,
771
- vxeFormRef
929
+ selectRef
772
930
  });
773
931
  return (_ctx, _cache) => {
774
- const _component_el_input = resolveComponent("el-input");
775
- const _component_el_button = resolveComponent("el-button");
776
- const _component_vxe_form_item = resolveComponent("vxe-form-item");
777
- const _component_vxe_form = resolveComponent("vxe-form");
778
- return openBlock(), createElementBlock("div", {
779
- class: "search",
780
- style: normalizeStyle({ paddingBottom: __props.paddingBottom })
781
- }, [
782
- __props.showSearch ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
783
- createElementVNode("div", _hoisted_2$2, [
784
- createElementVNode("div", _hoisted_3$2, [
785
- __props.showInput ? (openBlock(), createElementBlock("span", _hoisted_4$2, "快捷搜索 ")) : createCommentVNode("", true),
786
- __props.showInput ? (openBlock(), createElementBlock("div", _hoisted_5$2, [
787
- createVNode(_component_el_input, {
788
- type: "text",
789
- onKeyup: withKeys(searchParentList, ["enter"]),
790
- modelValue: combinedQueries.value,
791
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => combinedQueries.value = $event),
792
- placeholder: __props.placeholder,
793
- clearable: ""
794
- }, {
795
- prefix: withCtx(() => [
796
- createVNode(SvgIcon, {
797
- "icon-class": "search",
798
- "class-name": "svg-icon-22"
799
- })
800
- ]),
801
- _: 1
802
- }, 8, ["modelValue", "placeholder"])
803
- ])) : createCommentVNode("", true),
804
- __props.showMoreBottom ? (openBlock(), createElementBlock("div", {
805
- key: 2,
806
- class: "search-top-filter",
807
- onClick: _cache[1] || (_cache[1] = ($event) => showMore.value = !showMore.value)
808
- }, [
809
- createVNode(SvgIcon, {
810
- "icon-class": "filter",
811
- "class-name": "svg-icon-22 filter-icon"
812
- }),
813
- _cache[2] || (_cache[2] = createElementVNode("span", { class: "btn_more" }, "更多", -1))
814
- ])) : createCommentVNode("", true),
815
- createElementVNode("div", {
816
- class: normalizeClass([{ "search-top-extra--ml": __props.showInput }, "search-top-extra"])
817
- }, [
818
- renderSlot(_ctx.$slots, "default", {}, void 0, true),
819
- unref(slots).text1 ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
820
- __props.text1 ? (openBlock(), createElementBlock("span", _hoisted_7$2, toDisplayString(__props.text1) + ":", 1)) : createCommentVNode("", true),
821
- createElementVNode("div", _hoisted_8$2, [
822
- renderSlot(_ctx.$slots, "text1", {}, void 0, true)
823
- ])
824
- ])) : createCommentVNode("", true),
825
- unref(slots).text2 ? (openBlock(), createElementBlock("div", _hoisted_9$1, [
826
- __props.text2 ? (openBlock(), createElementBlock("span", _hoisted_10$1, toDisplayString(__props.text2) + ":", 1)) : createCommentVNode("", true),
827
- createElementVNode("div", _hoisted_11$1, [
828
- renderSlot(_ctx.$slots, "text2", {}, void 0, true)
829
- ])
830
- ])) : createCommentVNode("", true),
831
- unref(slots).text3 ? (openBlock(), createElementBlock("div", _hoisted_12$1, [
832
- __props.text3 ? (openBlock(), createElementBlock("span", _hoisted_13$1, toDisplayString(__props.text3) + ":", 1)) : createCommentVNode("", true),
833
- createElementVNode("div", _hoisted_14$1, [
834
- renderSlot(_ctx.$slots, "text3", {}, void 0, true)
835
- ])
836
- ])) : createCommentVNode("", true)
837
- ], 2)
838
- ]),
839
- createElementVNode("div", _hoisted_15$1, [
840
- createVNode(_component_el_button, {
841
- plain: "",
842
- onClick: reset
843
- }, {
844
- default: withCtx(() => _cache[3] || (_cache[3] = [
845
- createTextVNode("重 置")
846
- ])),
847
- _: 1,
848
- __: [3]
849
- }),
850
- createVNode(_component_el_button, {
851
- type: "primary",
852
- onClick: searchParentList
853
- }, {
854
- default: withCtx(() => _cache[4] || (_cache[4] = [
855
- createTextVNode("查 询")
856
- ])),
857
- _: 1,
858
- __: [4]
859
- })
860
- ])
861
- ])
862
- ])) : createCommentVNode("", true),
863
- withDirectives(createElementVNode("div", {
864
- class: normalizeClass([{ "show_search": __props.showSearch }, "search-form"])
865
- }, [
866
- createElementVNode("div", {
867
- class: "search-form__inner",
868
- style: normalizeStyle(formContainerStyle.value)
869
- }, [
870
- hasFormSlot.value ? (openBlock(), createBlock(XElForm, {
871
- key: 0,
872
- rules: __props.rules,
873
- model: __props.queryForm,
874
- ref_key: "queryFormRef",
875
- ref: queryFormRef,
876
- span: vxeFormSpan.value,
877
- "label-width": __props.titleWidth
878
- }, {
879
- default: withCtx(() => [
880
- renderSlot(_ctx.$slots, "form", {}, void 0, true),
881
- !__props.showSearch ? (openBlock(), createBlock(XElFormItem, {
882
- key: 0,
883
- label: "",
884
- span: buttonItemSpan.value
885
- }, {
886
- default: withCtx(() => [
887
- createElementVNode("div", _hoisted_16$1, [
888
- createVNode(_component_el_button, {
889
- plain: "",
890
- onClick: reset
891
- }, {
892
- default: withCtx(() => _cache[5] || (_cache[5] = [
893
- createTextVNode("重 置")
894
- ])),
895
- _: 1,
896
- __: [5]
897
- }),
898
- createVNode(_component_el_button, {
899
- type: "primary",
900
- onClick: searchParentList
901
- }, {
902
- default: withCtx(() => _cache[6] || (_cache[6] = [
903
- createTextVNode("查 询")
904
- ])),
905
- _: 1,
906
- __: [6]
907
- })
908
- ])
909
- ]),
910
- _: 1
911
- }, 8, ["span"])) : createCommentVNode("", true)
912
- ]),
913
- _: 3
914
- }, 8, ["rules", "model", "span", "label-width"])) : createCommentVNode("", true),
915
- hasVxeFormSlot.value ? (openBlock(), createBlock(_component_vxe_form, {
916
- key: 1,
917
- data: __props.queryForm,
918
- rules: __props.rules,
919
- span: vxeFormSpan.value,
920
- titleColon: "",
921
- vertical: "",
922
- "title-align": "right",
923
- "title-width": __props.titleWidth,
924
- ref_key: "vxeFormRef",
925
- ref: vxeFormRef
926
- }, {
927
- default: withCtx(() => [
928
- renderSlot(_ctx.$slots, "vxeForm", {}, void 0, true),
929
- !__props.showSearch ? (openBlock(), createBlock(_component_vxe_form_item, {
930
- key: 0,
931
- span: buttonItemSpan.value,
932
- align: "right"
933
- }, {
934
- default: withCtx(() => [
935
- createVNode(_component_el_button, {
936
- plain: "",
937
- onClick: reset
938
- }, {
939
- default: withCtx(() => _cache[7] || (_cache[7] = [
940
- createTextVNode("重 置")
941
- ])),
942
- _: 1,
943
- __: [7]
944
- }),
945
- createVNode(_component_el_button, {
946
- type: "primary",
947
- onClick: searchParentList
948
- }, {
949
- default: withCtx(() => _cache[8] || (_cache[8] = [
950
- createTextVNode("查 询")
951
- ])),
952
- _: 1,
953
- __: [8]
954
- })
955
- ]),
956
- _: 1
957
- }, 8, ["span"])) : createCommentVNode("", true)
958
- ]),
959
- _: 3
960
- }, 8, ["data", "rules", "span", "title-width"])) : createCommentVNode("", true)
961
- ], 4)
962
- ], 2), [
963
- [vShow, showMore.value || !__props.showSearch]
964
- ])
965
- ], 4);
932
+ const _component_el_select = resolveComponent("el-select");
933
+ return openBlock(), createBlock(_component_el_select, mergeProps({
934
+ ref_key: "selectRef",
935
+ ref: selectRef,
936
+ multiple: __props.multiple,
937
+ "model-value": computedLocalValue.value,
938
+ "onUpdate:modelValue": handleLocalUpdate,
939
+ onChange: handleChange
940
+ }, _ctx.$attrs, {
941
+ clearable: __props.clearable,
942
+ filterable: __props.filterable,
943
+ placeholder: __props.placeholder,
944
+ size: __props.size,
945
+ style: {
946
+ width: __props.width
947
+ }
948
+ }), {
949
+ default: withCtx(() => [
950
+ renderSlot(_ctx.$slots, "default")
951
+ ]),
952
+ _: 3
953
+ }, 16, ["multiple", "model-value", "clearable", "filterable", "placeholder", "size", "style"]);
966
954
  };
967
955
  }
968
956
  });
969
- const XSearchBar = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-8e55c95a"]]);
970
957
  const _hoisted_1$3 = { class: "x-pagination" };
971
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
958
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
972
959
  __name: "XPagination",
973
960
  props: {
974
961
  currentPage: {
@@ -1040,13 +1027,13 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1040
1027
  };
1041
1028
  }
1042
1029
  });
1043
- const XPagination = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-bd405b6e"]]);
1044
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1030
+ const XPagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-bd405b6e"]]);
1031
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1045
1032
  __name: "XVxeTable",
1046
1033
  props: {
1047
1034
  tableData: { type: Array, default: () => [] },
1048
1035
  isShowBg: { type: Boolean, default: true },
1049
- size: { type: String, default: void 0 },
1036
+ size: { type: String, default: "medium" },
1050
1037
  stripe: { type: Boolean, default: false },
1051
1038
  subHeight: { type: String, default: "200px" },
1052
1039
  maxHeight: { type: [Number, String], default: null },
@@ -1224,7 +1211,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1224
1211
  },
1225
1212
  data: __props.showFooter && __props.footerData.length < 1 ? __props.tableData.slice(0, -1) : __props.tableData,
1226
1213
  border: "",
1227
- size: __props.size || void 0,
1214
+ size: __props.size,
1228
1215
  stripe: __props.stripe,
1229
1216
  height: "100%",
1230
1217
  align: "center",
@@ -1305,1000 +1292,762 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1305
1292
  };
1306
1293
  }
1307
1294
  });
1308
- const XVxeTable = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-c926a34a"]]);
1309
- const _hoisted_1$2 = { class: "x-business-log" };
1310
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1311
- __name: "XBusinessLog",
1295
+ const XVxeTable = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-9111013e"]]);
1296
+ const _hoisted_1$2 = { class: "x-report-table" };
1297
+ const _hoisted_2$2 = { class: "report-header" };
1298
+ const _hoisted_3$2 = { class: "report-title" };
1299
+ const _hoisted_4$2 = { class: "report-actions" };
1300
+ const _hoisted_5$2 = ["onClick"];
1301
+ const _hoisted_6$2 = { class: "report-text-primary" };
1302
+ const _hoisted_7$2 = { class: "report-text-primary" };
1303
+ const _hoisted_8$2 = { class: "report-text-primary" };
1304
+ const _hoisted_9$1 = { class: "report-flex report-justify-between" };
1305
+ const _hoisted_10$1 = { class: "" };
1306
+ const _hoisted_11$1 = { class: "" };
1307
+ const _hoisted_12$1 = { key: 0 };
1308
+ const _hoisted_13$1 = { class: "" };
1309
+ const _hoisted_14$1 = { class: "" };
1310
+ const _hoisted_15$1 = { key: 1 };
1311
+ const _hoisted_16$1 = { class: "" };
1312
+ const _hoisted_17 = { class: "" };
1313
+ const _hoisted_18 = { class: "" };
1314
+ const _hoisted_19 = { class: "" };
1315
+ const _hoisted_20 = { class: "report-body" };
1316
+ const _hoisted_21 = { class: "report-flex report-justify-between" };
1317
+ const _hoisted_22 = { class: "" };
1318
+ const _hoisted_23 = { class: "" };
1319
+ const _hoisted_24 = { key: 0 };
1320
+ const _hoisted_25 = { class: "" };
1321
+ const _hoisted_26 = { class: "" };
1322
+ const _hoisted_27 = { class: "" };
1323
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1324
+ __name: "XReportTable",
1312
1325
  props: {
1313
- url: { type: String, default: "" },
1314
- baseUrl: { type: String, default: "" },
1315
- tokenCookieName: { type: String, default: "Authorization" },
1316
- withCredentials: { type: Boolean, default: false },
1317
- method: { type: String, default: "post" },
1318
1326
  tableData: { type: Array, default: () => [] },
1319
- pageSize: { type: Number, default: 10 },
1320
- subHeight: { type: String, default: "294px" }
1327
+ columns: { type: Array, default: () => [] },
1328
+ showFooter: { type: Boolean, default: false },
1329
+ reportTitle: { type: String, default: "" },
1330
+ organizationName: { type: String, default: "" },
1331
+ dateRange: { type: [String, Array], default: "" },
1332
+ customHeader1: { type: String, default: "" },
1333
+ customHeader1Label: { type: String, default: "" },
1334
+ customHeader2: { type: String, default: "" },
1335
+ customHeader2Label: { type: String, default: "" },
1336
+ customHeader3: { type: String, default: "" },
1337
+ customHeader3Label: { type: String, default: "" },
1338
+ auditorName: { type: String, default: "" },
1339
+ creatorName: { type: String, default: "" },
1340
+ customFooterField: { type: String, default: "" },
1341
+ customFooterFieldLabel: { type: String, default: "" },
1342
+ printDate: { type: String, default: "" },
1343
+ showPrint: { type: Boolean, default: true },
1344
+ showExport: { type: Boolean, default: true },
1345
+ subHeight: { type: String, default: "343px" },
1346
+ showToolbar: { type: Boolean, default: false },
1347
+ showPagination: { type: Boolean, default: true },
1348
+ pageSize: { type: Number, default: 20 },
1349
+ total: { type: Number, default: 0 },
1350
+ footerData: { type: Array, default: () => [] },
1351
+ currentPage: { type: Number, default: 1 },
1352
+ loading: { type: Boolean, default: false },
1353
+ printCallback: { type: Boolean, default: false },
1354
+ exportCallback: { type: Boolean, default: false },
1355
+ printText: { type: String, default: "打印" },
1356
+ printText1: { type: String, default: "" },
1357
+ customButtons: { type: Array, default: () => [] }
1321
1358
  },
1322
- setup(__props, { expose: __expose }) {
1359
+ emits: ["change-page", "customBtn", "printReport", "export"],
1360
+ setup(__props, { expose: __expose, emit: __emit }) {
1323
1361
  const props = __props;
1324
- const vxeTableRef = ref();
1325
- const loading = ref(false);
1326
- const tableData = ref([]);
1327
- const pageNum = ref(1);
1328
- const internalPageSize = ref(props.pageSize);
1329
- const total = ref(0);
1330
- let requestInstance = null;
1331
- const queryForm = reactive({
1332
- content: "",
1333
- module: "",
1334
- createUserName: "",
1335
- beginTime: "",
1336
- endTime: "",
1337
- createTimeRange: [],
1338
- combinedQueries: ""
1339
- });
1340
- const displayData = computed(() => {
1341
- if (props.tableData && props.tableData.length > 0) {
1342
- return props.tableData;
1362
+ const emit = __emit;
1363
+ const instance = getCurrentInstance();
1364
+ const repVxeTableRef = ref();
1365
+ const reportHeaderRef = ref();
1366
+ const reportFooterRef = ref();
1367
+ const organizationNameDisplay = computed(() => {
1368
+ var _a, _b, _c, _d, _e;
1369
+ if (props.organizationName) return props.organizationName;
1370
+ const store = (_c = (_b = (_a = instance == null ? void 0 : instance.appContext) == null ? void 0 : _a.config) == null ? void 0 : _b.globalProperties) == null ? void 0 : _c.$store;
1371
+ if ((_e = (_d = store == null ? void 0 : store.getters) == null ? void 0 : _d.tenantInfo) == null ? void 0 : _e.tenantName) {
1372
+ return store.getters.tenantInfo.tenantName;
1343
1373
  }
1344
- return tableData.value;
1374
+ return "";
1345
1375
  });
1346
- onMounted(() => {
1347
- if (!props.tableData || props.tableData.length === 0) {
1348
- getList();
1349
- }
1376
+ const displayTitle = computed(() => {
1377
+ var _a, _b, _c, _d;
1378
+ if (props.reportTitle) return props.reportTitle;
1379
+ const route = (_c = (_b = (_a = instance == null ? void 0 : instance.appContext) == null ? void 0 : _a.config) == null ? void 0 : _b.globalProperties) == null ? void 0 : _c.$route;
1380
+ if ((_d = route == null ? void 0 : route.meta) == null ? void 0 : _d.title) return route.meta.title;
1381
+ return "";
1350
1382
  });
1351
- function getList() {
1352
- if (props.tableData && props.tableData.length > 0) return;
1353
- if (!props.url) {
1354
- console.warn("XBusinessLog: 请提供 url 属性");
1355
- return;
1356
- }
1357
- if (!requestInstance) {
1358
- requestInstance = createRequest({
1359
- baseURL: props.baseUrl || "",
1360
- withCredentials: props.withCredentials,
1361
- timeout: 3e4,
1362
- tokenCookieName: props.tokenCookieName
1363
- });
1364
- }
1365
- loading.value = true;
1366
- const params = { ...queryForm };
1367
- requestInstance({
1368
- url: props.url,
1369
- method: props.method,
1370
- data: {
1371
- ...params,
1372
- pageSize: internalPageSize.value,
1373
- pageNum: pageNum.value
1374
- }
1375
- }).then((response) => {
1376
- tableData.value = response.rows || [];
1377
- total.value = response.total || 0;
1378
- loading.value = false;
1379
- }).catch(() => {
1380
- loading.value = false;
1381
- });
1383
+ const creatorNameDisplay = computed(() => {
1384
+ var _a, _b, _c, _d;
1385
+ if (props.creatorName) return props.creatorName;
1386
+ const store = (_c = (_b = (_a = instance == null ? void 0 : instance.appContext) == null ? void 0 : _a.config) == null ? void 0 : _b.globalProperties) == null ? void 0 : _c.$store;
1387
+ if ((_d = store == null ? void 0 : store.getters) == null ? void 0 : _d.name) return store.getters.name;
1388
+ return "";
1389
+ });
1390
+ const formattedPrintDate = computed(() => {
1391
+ if (props.printDate) return props.printDate;
1392
+ const now = /* @__PURE__ */ new Date();
1393
+ const year = now.getFullYear();
1394
+ const month = String(now.getMonth() + 1).padStart(2, "0");
1395
+ const day = String(now.getDate()).padStart(2, "0");
1396
+ return `${year}-${month}-${day}`;
1397
+ });
1398
+ const dateRangeDisplay = computed(() => {
1399
+ if (!props.dateRange) return "";
1400
+ if (Array.isArray(props.dateRange)) {
1401
+ return props.dateRange[0] + "至" + props.dateRange[1];
1402
+ }
1403
+ return props.dateRange;
1404
+ });
1405
+ function handlePageChange(page, size) {
1406
+ emit("change-page", page, size);
1407
+ }
1408
+ function handleCustomBtn(index2, btn) {
1409
+ emit("customBtn", index2, btn);
1410
+ }
1411
+ function printReport(type) {
1412
+ if (type === 2) {
1413
+ emit("printReport", type);
1414
+ } else if (props.printCallback) {
1415
+ emit("printReport", type);
1416
+ } else {
1417
+ handlePrint();
1418
+ }
1382
1419
  }
1383
- function handleSearch(type) {
1384
- if (type) {
1385
- pageNum.value = 1;
1420
+ function getTableInstance() {
1421
+ if (repVxeTableRef.value) {
1422
+ return repVxeTableRef.value.vxeTableRef;
1386
1423
  }
1387
- getList();
1424
+ return null;
1388
1425
  }
1389
- function handlePageChange(page, size) {
1390
- pageNum.value = page;
1391
- internalPageSize.value = size;
1392
- getList();
1426
+ function handlePrint(printData) {
1427
+ const tableEl = getTableInstance();
1428
+ if (!tableEl) {
1429
+ console.error("VXE Table instance not found");
1430
+ ElMessage.error("表格组件未加载完成,请稍后再试");
1431
+ return;
1432
+ }
1433
+ const headerEl = reportHeaderRef.value;
1434
+ const footerEl = reportFooterRef.value;
1435
+ if (!headerEl || !footerEl) {
1436
+ console.error("Report header or footer element not found");
1437
+ ElMessage.error("报表元素未加载完成,请稍后再试");
1438
+ return;
1439
+ }
1440
+ const headerHtml = headerEl.innerHTML;
1441
+ const footerHtml = footerEl.innerHTML;
1442
+ if (typeof tableEl.print === "function") {
1443
+ tableEl.print({
1444
+ sheetName: props.reportTitle || "报表",
1445
+ data: printData || props.tableData,
1446
+ style: `
1447
+ table td, table th {
1448
+ border: 1px solid #000!important;
1449
+ }
1450
+ .table-head{
1451
+ text-align: center;
1452
+ font-size: 20px;
1453
+ line-height: 40px;
1454
+ font-weight: bold;
1455
+ }
1456
+ .table-head-2{
1457
+ width: 33%;
1458
+ }
1459
+ .table-head-1{
1460
+ display: flex;
1461
+ line-height: 25px;
1462
+ }
1463
+ .btn-print{
1464
+ text-align: center;
1465
+ margin-top: 10px;
1466
+ }
1467
+ .report-info {
1468
+ font-weight: 400;
1469
+ font-size: 14px;
1470
+ color: #333333;
1471
+ line-height: 22px;
1472
+ }
1473
+ .report-flex {
1474
+ display: flex;
1475
+ }
1476
+ .report-justify-between {
1477
+ justify-content: space-between;
1478
+ }
1479
+ .report-pb-12 {
1480
+ padding-bottom: 12px;
1481
+ }
1482
+ .report-pt-12 {
1483
+ padding-top: 12px;
1484
+ }`,
1485
+ beforePrintMethod: ({ content }) => {
1486
+ if (displayTitle.value) {
1487
+ return `<div class="table-head">${displayTitle.value}</div>` + headerHtml + content + footerHtml;
1488
+ }
1489
+ return headerHtml + content + footerHtml;
1490
+ }
1491
+ });
1492
+ } else {
1493
+ console.error("VXE Table print method not found");
1494
+ ElMessage.error("打印功能暂不可用");
1495
+ }
1393
1496
  }
1394
- function handleCreateTimeChange(value) {
1395
- if (value && value.length) {
1396
- queryForm.beginTime = value[0] || "";
1397
- queryForm.endTime = value[1] || "";
1497
+ function handleExport() {
1498
+ if (props.exportCallback) {
1499
+ emit("export");
1398
1500
  } else {
1399
- queryForm.beginTime = "";
1400
- queryForm.endTime = "";
1501
+ const tableInstance = getTableInstance();
1502
+ if (tableInstance) {
1503
+ tableInstance.exportData({
1504
+ filename: `${displayTitle.value}`,
1505
+ sheetName: "Sheet1",
1506
+ type: "xlsx"
1507
+ });
1508
+ }
1401
1509
  }
1402
1510
  }
1403
- function resetForm() {
1404
- Object.assign(queryForm, {
1405
- content: "",
1406
- module: "",
1407
- createUserName: "",
1408
- beginTime: "",
1409
- endTime: "",
1410
- createTimeRange: [],
1411
- combinedQueries: ""
1412
- });
1413
- pageNum.value = 1;
1414
- getList();
1511
+ function clearCheckbox() {
1512
+ var _a;
1513
+ (_a = repVxeTableRef.value) == null ? void 0 : _a.clearCheckbox();
1415
1514
  }
1416
- function refresh() {
1417
- getList();
1515
+ function clearSort() {
1516
+ var _a;
1517
+ (_a = repVxeTableRef.value) == null ? void 0 : _a.clearSort();
1418
1518
  }
1419
1519
  __expose({
1420
- resetForm,
1421
- refresh
1520
+ clearCheckbox,
1521
+ clearSort,
1522
+ handlePrint,
1523
+ getTableInstance
1422
1524
  });
1423
1525
  return (_ctx, _cache) => {
1424
- const _component_el_date_picker = resolveComponent("el-date-picker");
1425
- const _component_vxe_form_item = resolveComponent("vxe-form-item");
1426
- const _component_el_input = resolveComponent("el-input");
1427
- const _component_vxe_column = resolveComponent("vxe-column");
1428
1526
  return openBlock(), createElementBlock("div", _hoisted_1$2, [
1429
- createVNode(XSearchBar, {
1430
- modelValue: queryForm.combinedQueries,
1431
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => queryForm.combinedQueries = $event),
1432
- "show-search": false,
1433
- "query-form": queryForm,
1434
- "title-width": "78px",
1435
- onListUpdate: _cache[5] || (_cache[5] = ($event) => handleSearch(1))
1436
- }, {
1437
- vxeForm: withCtx(() => [
1438
- createVNode(_component_vxe_form_item, {
1439
- title: "选择时间",
1440
- field: "createTimeRange"
1441
- }, {
1442
- default: withCtx(() => [
1443
- createVNode(_component_el_date_picker, {
1444
- modelValue: queryForm.createTimeRange,
1445
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => queryForm.createTimeRange = $event),
1446
- type: "datetimerange",
1447
- "range-separator": "",
1448
- "value-format": "YYYY-MM-DD HH:mm:ss",
1449
- "start-placeholder": "开始时间",
1450
- "end-placeholder": "结束时间",
1451
- size: "small",
1452
- style: { "width": "100%" },
1453
- onChange: handleCreateTimeChange
1454
- }, null, 8, ["modelValue"])
1455
- ]),
1456
- _: 1
1457
- }),
1458
- createVNode(_component_vxe_form_item, {
1459
- title: "内容",
1460
- field: "content"
1461
- }, {
1462
- default: withCtx(() => [
1463
- createVNode(_component_el_input, {
1464
- modelValue: queryForm.content,
1465
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => queryForm.content = $event),
1466
- placeholder: "请输入内容",
1467
- clearable: "",
1468
- size: "small",
1469
- onKeyup: withKeys(handleSearch, ["enter"])
1470
- }, null, 8, ["modelValue"])
1471
- ]),
1472
- _: 1
1473
- }),
1474
- createVNode(_component_vxe_form_item, {
1475
- title: "模块",
1476
- field: "module"
1477
- }, {
1478
- default: withCtx(() => [
1479
- createVNode(_component_el_input, {
1480
- modelValue: queryForm.module,
1481
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => queryForm.module = $event),
1482
- placeholder: "请输入模块",
1483
- clearable: "",
1484
- size: "small",
1485
- onKeyup: withKeys(handleSearch, ["enter"])
1486
- }, null, 8, ["modelValue"])
1487
- ]),
1488
- _: 1
1489
- }),
1490
- createVNode(_component_vxe_form_item, {
1491
- title: "操作人员",
1492
- field: "createUserName"
1493
- }, {
1494
- default: withCtx(() => [
1495
- createVNode(_component_el_input, {
1496
- modelValue: queryForm.createUserName,
1497
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => queryForm.createUserName = $event),
1498
- placeholder: "请输入操作人员",
1499
- clearable: "",
1500
- size: "small",
1501
- onKeyup: withKeys(handleSearch, ["enter"])
1502
- }, null, 8, ["modelValue"])
1503
- ]),
1504
- _: 1
1505
- })
1506
- ]),
1507
- _: 1
1508
- }, 8, ["modelValue", "query-form"]),
1509
- createVNode(XVxeTable, {
1510
- ref_key: "vxeTableRef",
1511
- ref: vxeTableRef,
1512
- "sub-height": __props.subHeight,
1513
- "table-data": displayData.value,
1514
- loading: loading.value,
1515
- "current-page": pageNum.value,
1516
- "page-size": __props.pageSize,
1517
- total: total.value,
1518
- onChangePage: handlePageChange
1519
- }, {
1520
- default: withCtx(() => [
1521
- createVNode(_component_vxe_column, {
1522
- title: "操作员账号",
1523
- field: "createUserName",
1524
- "min-width": "100",
1525
- "show-overflow": "title"
1526
- }),
1527
- createVNode(_component_vxe_column, {
1528
- title: "日志时间",
1529
- field: "createTime",
1530
- width: "150"
1531
- }, {
1532
- default: withCtx(({ row }) => [
1533
- createElementVNode("span", null, toDisplayString(unref(parseTime)(row.createTime)), 1)
1534
- ]),
1535
- _: 1
1536
- }),
1537
- createVNode(_component_vxe_column, {
1538
- title: "日志类型",
1539
- field: "type",
1540
- "min-width": "100"
1541
- }),
1542
- createVNode(_component_vxe_column, {
1543
- title: "终端IP",
1544
- field: "terminalIp",
1545
- "min-width": "100"
1546
- }),
1547
- createVNode(_component_vxe_column, {
1548
- title: "日志内容",
1549
- field: "content",
1550
- "min-width": "150",
1551
- "show-overflow": "tooltip"
1552
- })
1553
- ]),
1554
- _: 1
1555
- }, 8, ["sub-height", "table-data", "loading", "current-page", "page-size", "total"])
1556
- ]);
1557
- };
1558
- }
1559
- });
1560
- const XBusinessLog = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-244f5d5d"]]);
1561
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1562
- __name: "XDatePicker",
1563
- props: {
1564
- type: {
1565
- type: String,
1566
- default: "date",
1567
- validator: (val) => [
1568
- "year",
1569
- "years",
1570
- "month",
1571
- "months",
1572
- "date",
1573
- "dates",
1574
- "datetime",
1575
- "week",
1576
- "datetimerange",
1577
- "daterange",
1578
- "monthrange",
1579
- "yearrange"
1580
- ].includes(val)
1581
- },
1582
- valueFormat: {
1583
- type: String,
1584
- default: null
1585
- },
1586
- placeholder: {
1587
- type: String,
1588
- default: null
1589
- },
1590
- startPlaceholder: {
1591
- type: String,
1592
- default: null
1593
- },
1594
- endPlaceholder: {
1595
- type: String,
1596
- default: null
1597
- },
1598
- rangeSeparator: {
1599
- type: String,
1600
- default: "至"
1601
- },
1602
- defaultTime: {
1603
- type: [String, Array],
1604
- default: null
1605
- },
1606
- isEndTime: {
1607
- type: Boolean,
1608
- default: false
1609
- },
1610
- modelValue: {
1611
- type: [String, Number, Array, Date],
1612
- default: ""
1613
- },
1614
- size: {
1615
- type: String,
1616
- default: "default"
1617
- }
1618
- },
1619
- emits: ["update:modelValue"],
1620
- setup(__props, { emit: __emit }) {
1621
- const props = __props;
1622
- const emit = __emit;
1623
- const internalValue = ref(props.modelValue);
1624
- function toDayjsFormat(format) {
1625
- return format.replace(/yyyy/g, "YYYY").replace(/dd/g, "DD");
1626
- }
1627
- function getDefaultFormat(type) {
1628
- const formatMap = {
1629
- "year": "YYYY",
1630
- "years": "YYYY",
1631
- "month": "YYYY-MM",
1632
- "months": "YYYY-MM",
1633
- "date": "YYYY-MM-DD",
1634
- "dates": "YYYY-MM-DD",
1635
- "datetime": "YYYY-MM-DD HH:mm:ss",
1636
- "week": "YYYY-MM-DD",
1637
- "datetimerange": "YYYY-MM-DD HH:mm:ss",
1638
- "daterange": "YYYY-MM-DD",
1639
- "monthrange": "YYYY-MM",
1640
- "yearrange": "YYYY"
1641
- };
1642
- return formatMap[type] || "YYYY-MM-DD";
1643
- }
1644
- function getDefaultPlaceholder(type) {
1645
- const isRange = type.includes("range");
1646
- const hasTime = type.includes("time");
1647
- if (isRange) {
1648
- return {
1649
- start: hasTime ? "开始日期时间" : "开始日期",
1650
- end: hasTime ? "结束日期时间" : "结束日期"
1651
- };
1652
- } else {
1653
- if (type === "year" || type === "years") return "选择年";
1654
- if (type === "month" || type === "months") return "选择月";
1655
- if (type === "week") return "选择周";
1656
- if (hasTime) return "选择日期时间";
1657
- return "选择日期";
1658
- }
1659
- }
1660
- const currentPlaceholder = computed(() => {
1661
- if (props.placeholder !== null) return props.placeholder;
1662
- const isRange = props.type.includes("range");
1663
- if (isRange) return void 0;
1664
- return getDefaultPlaceholder(props.type);
1665
- });
1666
- const currentStartPlaceholder = computed(() => {
1667
- if (props.startPlaceholder !== null) return props.startPlaceholder;
1668
- const isRange = props.type.includes("range");
1669
- if (!isRange) return void 0;
1670
- const defaults = getDefaultPlaceholder(props.type);
1671
- return defaults.start;
1672
- });
1673
- const currentEndPlaceholder = computed(() => {
1674
- if (props.endPlaceholder !== null) return props.endPlaceholder;
1675
- const isRange = props.type.includes("range");
1676
- if (!isRange) return void 0;
1677
- const defaults = getDefaultPlaceholder(props.type);
1678
- return defaults.end;
1679
- });
1680
- const currentValueFormat = computed(() => {
1681
- if (props.valueFormat !== null && props.valueFormat !== void 0) {
1682
- return toDayjsFormat(props.valueFormat);
1683
- }
1684
- return getDefaultFormat(props.type);
1685
- });
1686
- const currentDefaultTime = computed(() => {
1687
- if (props.defaultTime !== null && props.defaultTime !== void 0) {
1688
- return props.defaultTime;
1689
- }
1690
- if (props.isEndTime && props.type === "datetimerange") {
1691
- return [new Date(2e3, 0, 1, 0, 0, 0), new Date(2e3, 0, 1, 23, 59, 59)];
1692
- }
1693
- if (props.isEndTime && props.type === "datetime") {
1694
- return new Date(2e3, 0, 1, 23, 59, 59);
1695
- }
1696
- return void 0;
1697
- });
1698
- function applyEndTime(value) {
1699
- const startTime = "00:00:00";
1700
- const endTime = "23:59:59";
1701
- if (props.type === "datetimerange" && Array.isArray(value) && value.length === 2) {
1702
- let startVal = value[0];
1703
- let endVal = value[1];
1704
- if (startVal instanceof Date) {
1705
- const newStart = new Date(startVal);
1706
- newStart.setHours(0, 0, 0, 0);
1707
- startVal = newStart;
1708
- } else if (typeof startVal === "string" && startVal) {
1709
- const datePart = startVal.substring(0, 10);
1710
- startVal = datePart + " " + startTime;
1711
- }
1712
- if (endVal instanceof Date) {
1713
- const newEnd = new Date(endVal);
1714
- newEnd.setHours(23, 59, 59, 0);
1715
- endVal = newEnd;
1716
- } else if (typeof endVal === "string" && endVal) {
1717
- const datePart = endVal.substring(0, 10);
1718
- endVal = datePart + " " + endTime;
1719
- }
1720
- return [startVal, endVal];
1721
- }
1722
- if (props.type === "datetime" && value) {
1723
- if (value instanceof Date) {
1724
- if (value.getHours() === 0 && value.getMinutes() === 0 && value.getSeconds() === 0) {
1725
- const newDate = new Date(value);
1726
- newDate.setHours(23, 59, 59, 0);
1727
- return newDate;
1728
- }
1729
- return value;
1730
- }
1731
- if (typeof value === "string") {
1732
- const timePart = value.length > 10 ? value.substring(11) : "";
1733
- if (!timePart) {
1734
- const datePart = value.substring(0, 10);
1735
- return datePart + " " + endTime;
1736
- }
1737
- }
1738
- }
1739
- return value;
1740
- }
1741
- watch(() => props.modelValue, (newVal) => {
1742
- let result = newVal;
1743
- if (props.isEndTime && newVal) {
1744
- result = applyEndTime(newVal);
1745
- }
1746
- internalValue.value = result;
1747
- });
1748
- function handleUpdate(value) {
1749
- internalValue.value = value;
1750
- emit("update:modelValue", value);
1751
- }
1752
- return (_ctx, _cache) => {
1753
- const _component_el_date_picker = resolveComponent("el-date-picker");
1754
- return openBlock(), createBlock(_component_el_date_picker, mergeProps({
1755
- "model-value": internalValue.value,
1756
- type: __props.type,
1757
- placeholder: currentPlaceholder.value,
1758
- "start-placeholder": currentStartPlaceholder.value,
1759
- "end-placeholder": currentEndPlaceholder.value,
1760
- "range-separator": __props.rangeSeparator,
1761
- "value-format": currentValueFormat.value,
1762
- "default-time": currentDefaultTime.value,
1763
- size: __props.size
1764
- }, _ctx.$attrs, { "onUpdate:modelValue": handleUpdate }), null, 16, ["model-value", "type", "placeholder", "start-placeholder", "end-placeholder", "range-separator", "value-format", "default-time", "size"]);
1527
+ createElementVNode("div", _hoisted_2$2, [
1528
+ createElementVNode("h2", _hoisted_3$2, toDisplayString(displayTitle.value), 1),
1529
+ createElementVNode("div", _hoisted_4$2, [
1530
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.customButtons, (btn, index2) => {
1531
+ return openBlock(), createElementBlock("div", {
1532
+ key: index2,
1533
+ class: "action-item report-cursor-pointer",
1534
+ onClick: ($event) => handleCustomBtn(index2, btn)
1535
+ }, [
1536
+ createElementVNode("span", _hoisted_6$2, toDisplayString(btn), 1)
1537
+ ], 8, _hoisted_5$2);
1538
+ }), 128)),
1539
+ __props.showPrint ? (openBlock(), createElementBlock("div", {
1540
+ key: 0,
1541
+ class: "action-item report-cursor-pointer",
1542
+ onClick: _cache[0] || (_cache[0] = ($event) => printReport(1))
1543
+ }, [
1544
+ createElementVNode("span", _hoisted_7$2, toDisplayString(__props.printText), 1)
1545
+ ])) : createCommentVNode("", true),
1546
+ __props.printText1 ? (openBlock(), createElementBlock("div", {
1547
+ key: 1,
1548
+ class: "action-item report-cursor-pointer",
1549
+ onClick: _cache[1] || (_cache[1] = ($event) => printReport(2))
1550
+ }, [
1551
+ createElementVNode("span", _hoisted_8$2, toDisplayString(__props.printText1), 1)
1552
+ ])) : createCommentVNode("", true),
1553
+ __props.showExport ? (openBlock(), createElementBlock("div", {
1554
+ key: 2,
1555
+ class: "action-item report-cursor-pointer",
1556
+ onClick: handleExport
1557
+ }, _cache[2] || (_cache[2] = [
1558
+ createElementVNode("span", { class: "report-text-primary" }, "导出", -1)
1559
+ ]))) : createCommentVNode("", true)
1560
+ ])
1561
+ ]),
1562
+ createElementVNode("div", {
1563
+ class: "report-info report-pb-12",
1564
+ ref_key: "reportHeaderRef",
1565
+ ref: reportHeaderRef
1566
+ }, [
1567
+ createElementVNode("div", _hoisted_9$1, [
1568
+ createElementVNode("div", null, [
1569
+ _cache[3] || (_cache[3] = createElementVNode("span", { class: "" }, "制表单位:", -1)),
1570
+ createElementVNode("span", _hoisted_10$1, toDisplayString(organizationNameDisplay.value), 1)
1571
+ ]),
1572
+ createElementVNode("div", null, [
1573
+ _cache[4] || (_cache[4] = createElementVNode("span", { class: "" }, "日期范围:", -1)),
1574
+ createElementVNode("span", _hoisted_11$1, toDisplayString(dateRangeDisplay.value), 1)
1575
+ ]),
1576
+ __props.customHeader1Label ? (openBlock(), createElementBlock("div", _hoisted_12$1, [
1577
+ createElementVNode("span", _hoisted_13$1, toDisplayString(__props.customHeader1Label) + ":", 1),
1578
+ createElementVNode("span", _hoisted_14$1, toDisplayString(__props.customHeader1 || ""), 1)
1579
+ ])) : createCommentVNode("", true),
1580
+ __props.customHeader2Label ? (openBlock(), createElementBlock("div", _hoisted_15$1, [
1581
+ createElementVNode("span", _hoisted_16$1, toDisplayString(__props.customHeader2Label) + "", 1),
1582
+ createElementVNode("span", _hoisted_17, toDisplayString(__props.customHeader2 || ""), 1)
1583
+ ])) : createCommentVNode("", true),
1584
+ createElementVNode("div", null, [
1585
+ createElementVNode("span", _hoisted_18, toDisplayString(__props.customHeader3Label) + toDisplayString(__props.customHeader3Label ? ":" : ""), 1),
1586
+ createElementVNode("span", _hoisted_19, toDisplayString(__props.customHeader3 || ""), 1)
1587
+ ])
1588
+ ])
1589
+ ], 512),
1590
+ createElementVNode("div", _hoisted_20, [
1591
+ createVNode(XVxeTable, {
1592
+ ref_key: "repVxeTableRef",
1593
+ ref: repVxeTableRef,
1594
+ "table-data": __props.tableData,
1595
+ "sub-height": __props.subHeight,
1596
+ "show-toolbar": __props.showToolbar,
1597
+ "show-pagination": __props.showPagination,
1598
+ loading: __props.loading,
1599
+ "is-show-bg": false,
1600
+ "page-size": __props.pageSize,
1601
+ "current-page": __props.currentPage,
1602
+ total: __props.total,
1603
+ "show-footer": __props.showFooter,
1604
+ "footer-data": __props.footerData,
1605
+ columns: __props.columns,
1606
+ onChangePage: handlePageChange
1607
+ }, {
1608
+ buttons: withCtx(() => [
1609
+ renderSlot(_ctx.$slots, "buttons", {}, void 0, true)
1610
+ ]),
1611
+ default: withCtx(() => [
1612
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
1613
+ ]),
1614
+ _: 3
1615
+ }, 8, ["table-data", "sub-height", "show-toolbar", "show-pagination", "loading", "page-size", "current-page", "total", "show-footer", "footer-data", "columns"])
1616
+ ]),
1617
+ createElementVNode("div", {
1618
+ class: "report-info report-pt-12",
1619
+ ref_key: "reportFooterRef",
1620
+ ref: reportFooterRef
1621
+ }, [
1622
+ createElementVNode("div", _hoisted_21, [
1623
+ createElementVNode("div", null, [
1624
+ _cache[5] || (_cache[5] = createElementVNode("span", { class: "" }, "审核人员:", -1)),
1625
+ createElementVNode("span", _hoisted_22, toDisplayString(__props.auditorName || ""), 1)
1626
+ ]),
1627
+ createElementVNode("div", null, [
1628
+ _cache[6] || (_cache[6] = createElementVNode("span", { class: "" }, "制表人员:", -1)),
1629
+ createElementVNode("span", _hoisted_23, toDisplayString(creatorNameDisplay.value), 1)
1630
+ ]),
1631
+ __props.customFooterFieldLabel ? (openBlock(), createElementBlock("div", _hoisted_24, [
1632
+ createElementVNode("span", _hoisted_25, toDisplayString(__props.customFooterFieldLabel) + ":", 1),
1633
+ createElementVNode("span", _hoisted_26, toDisplayString(__props.customFooterField || ""), 1)
1634
+ ])) : createCommentVNode("", true),
1635
+ createElementVNode("div", null, [
1636
+ _cache[7] || (_cache[7] = createElementVNode("span", { class: "" }, "打印日期:", -1)),
1637
+ createElementVNode("span", _hoisted_27, toDisplayString(formattedPrintDate.value), 1)
1638
+ ])
1639
+ ])
1640
+ ], 512)
1641
+ ]);
1765
1642
  };
1766
1643
  }
1767
1644
  });
1768
- const XDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-264a8a79"]]);
1769
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1770
- __name: "XElOption",
1645
+ const XReportTable = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-00481d7c"]]);
1646
+ const _hoisted_1$1 = {
1647
+ key: 0,
1648
+ class: "search-top"
1649
+ };
1650
+ const _hoisted_2$1 = { class: "search-top__inner" };
1651
+ const _hoisted_3$1 = { class: "search-top__row" };
1652
+ const _hoisted_4$1 = {
1653
+ key: 0,
1654
+ class: "search-top__label"
1655
+ };
1656
+ const _hoisted_5$1 = {
1657
+ key: 1,
1658
+ class: "search-top-input"
1659
+ };
1660
+ const _hoisted_6$1 = {
1661
+ key: 0,
1662
+ class: "search-top-extra-item"
1663
+ };
1664
+ const _hoisted_7$1 = {
1665
+ key: 0,
1666
+ class: "search-top-extra-label"
1667
+ };
1668
+ const _hoisted_8$1 = { class: "search-top-extra-content" };
1669
+ const _hoisted_9 = {
1670
+ key: 1,
1671
+ class: "search-top-extra-item"
1672
+ };
1673
+ const _hoisted_10 = {
1674
+ key: 0,
1675
+ class: "search-top-extra-label"
1676
+ };
1677
+ const _hoisted_11 = { class: "search-top-extra-content" };
1678
+ const _hoisted_12 = {
1679
+ key: 2,
1680
+ class: "search-top-extra-item"
1681
+ };
1682
+ const _hoisted_13 = {
1683
+ key: 0,
1684
+ class: "search-top-extra-label"
1685
+ };
1686
+ const _hoisted_14 = { class: "search-top-extra-content" };
1687
+ const _hoisted_15 = { class: "search-top__actions" };
1688
+ const _hoisted_16 = { class: "search-form__buttons" };
1689
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1690
+ __name: "XSearchBar",
1771
1691
  props: {
1772
- label: {
1692
+ modelValue: {
1773
1693
  type: [String, Number],
1774
1694
  default: void 0
1775
1695
  },
1776
- value: {
1777
- type: [String, Number],
1778
- default: void 0
1696
+ placeholder: {
1697
+ type: String,
1698
+ default: "请输入搜索关键词"
1779
1699
  },
1780
- disabled: {
1781
- type: Boolean,
1782
- default: false
1783
- }
1784
- },
1785
- setup(__props) {
1786
- const props = __props;
1787
- const elSelectModelValue = inject("elSelectModelValue", null);
1788
- const computedValue = computed(() => {
1789
- const propValue = props.value;
1790
- if (!elSelectModelValue || !elSelectModelValue.value) {
1791
- return propValue;
1792
- }
1793
- const modelVal = elSelectModelValue.value;
1794
- if (Array.isArray(modelVal) && modelVal.length > 0) {
1795
- const firstValueType = typeof modelVal[0];
1796
- if (firstValueType === "number" && typeof propValue === "string") {
1797
- return Number(propValue);
1798
- }
1799
- if (firstValueType === "string" && typeof propValue === "number") {
1800
- return String(propValue);
1801
- }
1802
- }
1803
- if (!Array.isArray(modelVal)) {
1804
- const parentType = typeof modelVal;
1805
- if (parentType === "number" && typeof propValue === "string") {
1806
- return Number(propValue);
1807
- }
1808
- if (parentType === "string" && typeof propValue === "number") {
1809
- return String(propValue);
1810
- }
1811
- }
1812
- return propValue;
1813
- });
1814
- const computedLabel = computed(() => props.label);
1815
- return (_ctx, _cache) => {
1816
- const _component_el_option = resolveComponent("el-option");
1817
- return openBlock(), createBlock(_component_el_option, mergeProps(_ctx.$attrs, {
1818
- label: computedLabel.value,
1819
- value: computedValue.value
1820
- }), {
1821
- default: withCtx(() => [
1822
- renderSlot(_ctx.$slots, "default")
1823
- ]),
1824
- _: 3
1825
- }, 16, ["label", "value"]);
1826
- };
1827
- }
1828
- });
1829
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1830
- __name: "XElSelect",
1831
- props: {
1832
- modelValue: {
1833
- type: [String, Number, Array],
1834
- default: void 0
1700
+ queryForm: {
1701
+ type: Object,
1702
+ required: true,
1703
+ default: () => ({})
1835
1704
  },
1836
- width: {
1837
- type: [String, Number],
1838
- default: "100%"
1705
+ rules: {
1706
+ type: Object,
1707
+ default: () => ({})
1839
1708
  },
1840
- multiple: {
1841
- type: Boolean,
1842
- default: false
1709
+ titleWidth: {
1710
+ type: String,
1711
+ default: "100px"
1843
1712
  },
1844
- typeConvert: {
1845
- type: Boolean,
1846
- default: true
1713
+ columns: {
1714
+ type: Number,
1715
+ default: 4
1847
1716
  },
1848
- separator: {
1717
+ paddingBottom: {
1849
1718
  type: String,
1850
- default: ""
1719
+ default: "16px"
1851
1720
  },
1852
- targetType: {
1853
- type: String,
1854
- default: "auto",
1855
- validator: (value) => ["string", "number", "auto"].includes(value)
1721
+ showInput: {
1722
+ type: Boolean,
1723
+ default: true
1856
1724
  },
1857
- clearable: {
1725
+ showMoreBottom: {
1858
1726
  type: Boolean,
1859
1727
  default: true
1860
1728
  },
1861
- filterable: {
1729
+ showSearch: {
1862
1730
  type: Boolean,
1863
1731
  default: true
1864
1732
  },
1865
- placeholder: {
1733
+ text1: {
1866
1734
  type: String,
1867
- default: void 0
1735
+ default: ""
1868
1736
  },
1869
- size: {
1737
+ text2: {
1870
1738
  type: String,
1871
- default: "default"
1739
+ default: ""
1740
+ },
1741
+ text3: {
1742
+ type: String,
1743
+ default: ""
1872
1744
  }
1873
1745
  },
1874
- emits: ["update:modelValue", "change"],
1746
+ emits: ["update:modelValue", "update:queryForm", "list-update", "data-reset"],
1875
1747
  setup(__props, { expose: __expose, emit: __emit }) {
1876
1748
  const props = __props;
1877
1749
  const emit = __emit;
1878
- const selectRef = ref();
1879
- const localValue = ref(props.modelValue);
1880
- const modelValueRef = ref(null);
1881
- provide("elSelectModelValue", modelValueRef);
1882
- const computedLocalValue = computed(() => {
1883
- const val = localValue.value;
1884
- if (!props.typeConvert || val === null || val === void 0) {
1885
- return val;
1886
- }
1887
- if (props.multiple && props.separator) {
1888
- if (typeof val === "string" && val.includes(props.separator)) {
1889
- const values = val.split(props.separator);
1890
- if (props.targetType === "number") {
1891
- return values.map((v) => Number(v));
1892
- }
1893
- return values;
1894
- }
1895
- if (Array.isArray(val)) {
1896
- return val;
1750
+ const slots = useSlots();
1751
+ const showMore = ref(false);
1752
+ const queryFormRef = ref();
1753
+ const vxeFormRef = ref();
1754
+ const combinedQueries = computed({
1755
+ get() {
1756
+ if (props.modelValue !== void 0 && props.modelValue !== null) {
1757
+ return props.modelValue;
1897
1758
  }
1898
- if (val === "" || val === null || val === void 0) {
1899
- return [];
1759
+ return props.queryForm.combinedQueries || "";
1760
+ },
1761
+ set(val) {
1762
+ if (props.modelValue !== void 0 && props.modelValue !== null) {
1763
+ emit("update:modelValue", val);
1764
+ } else {
1765
+ props.queryForm.combinedQueries = val;
1900
1766
  }
1901
- return [val];
1902
1767
  }
1903
- return val;
1904
1768
  });
1905
- watch(() => props.modelValue, (newVal) => {
1906
- localValue.value = newVal;
1769
+ const hasFormSlot = computed(() => !!slots.form);
1770
+ const hasVxeFormSlot = computed(() => !!slots.vxeForm);
1771
+ const vxeFormSpan = computed(() => Math.floor(24 / props.columns));
1772
+ const formContainerStyle = computed(() => ({
1773
+ "--form-columns": props.columns
1774
+ }));
1775
+ const buttonItemSpan = computed(() => {
1776
+ return 24;
1907
1777
  });
1908
- watch(computedLocalValue, (newVal) => {
1909
- modelValueRef.value = newVal;
1910
- }, { immediate: true });
1911
- function handleLocalUpdate(val) {
1912
- localValue.value = val;
1913
- if (props.multiple && props.separator) {
1914
- const arr = Array.isArray(val) ? val : [val];
1915
- emit("update:modelValue", arr.join(props.separator));
1916
- } else {
1917
- emit("update:modelValue", val);
1778
+ function reset() {
1779
+ combinedQueries.value = "";
1780
+ if (props.modelValue !== void 0 && props.modelValue !== null) {
1781
+ emit("update:modelValue", "");
1782
+ }
1783
+ if (hasFormSlot.value && queryFormRef.value && typeof queryFormRef.value.resetFields === "function") {
1784
+ nextTick(() => {
1785
+ queryFormRef.value.resetFields();
1786
+ });
1787
+ }
1788
+ if (hasVxeFormSlot.value && vxeFormRef.value && typeof vxeFormRef.value.reset === "function") {
1789
+ vxeFormRef.value.reset();
1790
+ }
1791
+ if (props.queryForm && Object.keys(props.queryForm).length > 0) {
1792
+ const emptyForm = {};
1793
+ Object.keys(props.queryForm).forEach((key) => {
1794
+ const value = props.queryForm[key];
1795
+ if (Array.isArray(value)) {
1796
+ emptyForm[key] = [];
1797
+ } else if (value !== null && typeof value === "object") {
1798
+ emptyForm[key] = {};
1799
+ } else {
1800
+ emptyForm[key] = "";
1801
+ }
1802
+ });
1803
+ emit("update:queryForm", emptyForm);
1918
1804
  }
1805
+ showMore.value = false;
1806
+ emit("data-reset");
1919
1807
  }
1920
- function handleChange(val) {
1921
- emit("change", val);
1808
+ function searchParentList() {
1809
+ if (props.rules && Object.keys(props.rules).length > 0) {
1810
+ if (hasVxeFormSlot.value && vxeFormRef.value) {
1811
+ return new Promise((resolve, reject) => {
1812
+ if (typeof vxeFormRef.value.validate === "function") {
1813
+ vxeFormRef.value.validate((valid) => {
1814
+ if (valid) {
1815
+ showMore.value = true;
1816
+ reject(false);
1817
+ } else {
1818
+ showMore.value = false;
1819
+ emit("list-update", 1);
1820
+ resolve(true);
1821
+ }
1822
+ });
1823
+ } else {
1824
+ emit("list-update", 1);
1825
+ resolve(true);
1826
+ }
1827
+ });
1828
+ }
1829
+ if (hasFormSlot.value && queryFormRef.value && typeof queryFormRef.value.validate === "function") {
1830
+ return new Promise((resolve, reject) => {
1831
+ queryFormRef.value.validate((valid) => {
1832
+ if (valid) {
1833
+ showMore.value = false;
1834
+ emit("list-update", 1);
1835
+ resolve(true);
1836
+ } else {
1837
+ showMore.value = true;
1838
+ reject(false);
1839
+ }
1840
+ });
1841
+ });
1842
+ }
1843
+ } else {
1844
+ showMore.value = false;
1845
+ emit("list-update", 1);
1846
+ return Promise.resolve(true);
1847
+ }
1922
1848
  }
1923
1849
  __expose({
1924
- selectRef
1850
+ queryFormRef,
1851
+ vxeFormRef
1925
1852
  });
1926
1853
  return (_ctx, _cache) => {
1927
- const _component_el_select = resolveComponent("el-select");
1928
- return openBlock(), createBlock(_component_el_select, mergeProps({
1929
- ref_key: "selectRef",
1930
- ref: selectRef,
1931
- multiple: __props.multiple,
1932
- "model-value": computedLocalValue.value,
1933
- "onUpdate:modelValue": handleLocalUpdate,
1934
- onChange: handleChange
1935
- }, _ctx.$attrs, {
1936
- clearable: __props.clearable,
1937
- filterable: __props.filterable,
1938
- placeholder: __props.placeholder,
1939
- size: __props.size,
1940
- style: {
1941
- width: __props.width
1942
- }
1943
- }), {
1944
- default: withCtx(() => [
1945
- renderSlot(_ctx.$slots, "default")
1946
- ]),
1947
- _: 3
1948
- }, 16, ["multiple", "model-value", "clearable", "filterable", "placeholder", "size", "style"]);
1949
- };
1950
- }
1951
- });
1952
- const _hoisted_1$1 = { class: "x-report-table" };
1953
- const _hoisted_2$1 = { class: "report-header" };
1954
- const _hoisted_3$1 = { class: "report-title" };
1955
- const _hoisted_4$1 = { class: "report-actions" };
1956
- const _hoisted_5$1 = ["onClick"];
1957
- const _hoisted_6$1 = { class: "report-text-primary" };
1958
- const _hoisted_7$1 = { class: "report-text-primary" };
1959
- const _hoisted_8$1 = { class: "report-text-primary" };
1960
- const _hoisted_9 = { class: "report-flex report-justify-between" };
1961
- const _hoisted_10 = { class: "" };
1962
- const _hoisted_11 = { class: "" };
1963
- const _hoisted_12 = { key: 0 };
1964
- const _hoisted_13 = { class: "" };
1965
- const _hoisted_14 = { class: "" };
1966
- const _hoisted_15 = { key: 1 };
1967
- const _hoisted_16 = { class: "" };
1968
- const _hoisted_17 = { class: "" };
1969
- const _hoisted_18 = { class: "" };
1970
- const _hoisted_19 = { class: "" };
1971
- const _hoisted_20 = { class: "report-body" };
1972
- const _hoisted_21 = { class: "report-flex report-justify-between" };
1973
- const _hoisted_22 = { class: "" };
1974
- const _hoisted_23 = { class: "" };
1975
- const _hoisted_24 = { key: 0 };
1976
- const _hoisted_25 = { class: "" };
1977
- const _hoisted_26 = { class: "" };
1978
- const _hoisted_27 = { class: "" };
1979
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1980
- __name: "XReportTable",
1981
- props: {
1982
- tableData: { type: Array, default: () => [] },
1983
- columns: { type: Array, default: () => [] },
1984
- showFooter: { type: Boolean, default: false },
1985
- reportTitle: { type: String, default: "" },
1986
- organizationName: { type: String, default: "" },
1987
- dateRange: { type: [String, Array], default: "" },
1988
- customHeader1: { type: String, default: "" },
1989
- customHeader1Label: { type: String, default: "" },
1990
- customHeader2: { type: String, default: "" },
1991
- customHeader2Label: { type: String, default: "" },
1992
- customHeader3: { type: String, default: "" },
1993
- customHeader3Label: { type: String, default: "" },
1994
- auditorName: { type: String, default: "" },
1995
- creatorName: { type: String, default: "" },
1996
- customFooterField: { type: String, default: "" },
1997
- customFooterFieldLabel: { type: String, default: "" },
1998
- printDate: { type: String, default: "" },
1999
- showPrint: { type: Boolean, default: true },
2000
- showExport: { type: Boolean, default: true },
2001
- subHeight: { type: String, default: "343px" },
2002
- showToolbar: { type: Boolean, default: false },
2003
- showPagination: { type: Boolean, default: true },
2004
- pageSize: { type: Number, default: 20 },
2005
- total: { type: Number, default: 0 },
2006
- footerData: { type: Array, default: () => [] },
2007
- currentPage: { type: Number, default: 1 },
2008
- loading: { type: Boolean, default: false },
2009
- printCallback: { type: Boolean, default: false },
2010
- exportCallback: { type: Boolean, default: false },
2011
- printText: { type: String, default: "打印" },
2012
- printText1: { type: String, default: "" },
2013
- customButtons: { type: Array, default: () => [] }
2014
- },
2015
- emits: ["change-page", "customBtn", "printReport", "export"],
2016
- setup(__props, { expose: __expose, emit: __emit }) {
2017
- const props = __props;
2018
- const emit = __emit;
2019
- const instance = getCurrentInstance();
2020
- const repVxeTableRef = ref();
2021
- const reportHeaderRef = ref();
2022
- const reportFooterRef = ref();
2023
- const organizationNameDisplay = computed(() => {
2024
- var _a, _b, _c, _d, _e;
2025
- if (props.organizationName) return props.organizationName;
2026
- const store = (_c = (_b = (_a = instance == null ? void 0 : instance.appContext) == null ? void 0 : _a.config) == null ? void 0 : _b.globalProperties) == null ? void 0 : _c.$store;
2027
- if ((_e = (_d = store == null ? void 0 : store.getters) == null ? void 0 : _d.tenantInfo) == null ? void 0 : _e.tenantName) {
2028
- return store.getters.tenantInfo.tenantName;
2029
- }
2030
- return "";
2031
- });
2032
- const displayTitle = computed(() => {
2033
- var _a, _b, _c, _d;
2034
- if (props.reportTitle) return props.reportTitle;
2035
- const route = (_c = (_b = (_a = instance == null ? void 0 : instance.appContext) == null ? void 0 : _a.config) == null ? void 0 : _b.globalProperties) == null ? void 0 : _c.$route;
2036
- if ((_d = route == null ? void 0 : route.meta) == null ? void 0 : _d.title) return route.meta.title;
2037
- return "";
2038
- });
2039
- const creatorNameDisplay = computed(() => {
2040
- var _a, _b, _c, _d;
2041
- if (props.creatorName) return props.creatorName;
2042
- const store = (_c = (_b = (_a = instance == null ? void 0 : instance.appContext) == null ? void 0 : _a.config) == null ? void 0 : _b.globalProperties) == null ? void 0 : _c.$store;
2043
- if ((_d = store == null ? void 0 : store.getters) == null ? void 0 : _d.name) return store.getters.name;
2044
- return "";
2045
- });
2046
- const formattedPrintDate = computed(() => {
2047
- if (props.printDate) return props.printDate;
2048
- const now = /* @__PURE__ */ new Date();
2049
- const year = now.getFullYear();
2050
- const month = String(now.getMonth() + 1).padStart(2, "0");
2051
- const day = String(now.getDate()).padStart(2, "0");
2052
- return `${year}-${month}-${day}`;
2053
- });
2054
- const dateRangeDisplay = computed(() => {
2055
- if (!props.dateRange) return "";
2056
- if (Array.isArray(props.dateRange)) {
2057
- return props.dateRange[0] + "至" + props.dateRange[1];
2058
- }
2059
- return props.dateRange;
2060
- });
2061
- function handlePageChange(page, size) {
2062
- emit("change-page", page, size);
2063
- }
2064
- function handleCustomBtn(index2, btn) {
2065
- emit("customBtn", index2, btn);
2066
- }
2067
- function printReport(type) {
2068
- if (type === 2) {
2069
- emit("printReport", type);
2070
- } else if (props.printCallback) {
2071
- emit("printReport", type);
2072
- } else {
2073
- handlePrint();
2074
- }
2075
- }
2076
- function getTableInstance() {
2077
- if (repVxeTableRef.value) {
2078
- return repVxeTableRef.value.vxeTableRef;
2079
- }
2080
- return null;
2081
- }
2082
- function handlePrint(printData) {
2083
- const tableEl = getTableInstance();
2084
- if (!tableEl) {
2085
- console.error("VXE Table instance not found");
2086
- ElMessage.error("表格组件未加载完成,请稍后再试");
2087
- return;
2088
- }
2089
- const headerEl = reportHeaderRef.value;
2090
- const footerEl = reportFooterRef.value;
2091
- if (!headerEl || !footerEl) {
2092
- console.error("Report header or footer element not found");
2093
- ElMessage.error("报表元素未加载完成,请稍后再试");
2094
- return;
2095
- }
2096
- const headerHtml = headerEl.innerHTML;
2097
- const footerHtml = footerEl.innerHTML;
2098
- if (typeof tableEl.print === "function") {
2099
- tableEl.print({
2100
- sheetName: props.reportTitle || "报表",
2101
- data: printData || props.tableData,
2102
- style: `
2103
- table td, table th {
2104
- border: 1px solid #000!important;
2105
- }
2106
- .table-head{
2107
- text-align: center;
2108
- font-size: 20px;
2109
- line-height: 40px;
2110
- font-weight: bold;
2111
- }
2112
- .table-head-2{
2113
- width: 33%;
2114
- }
2115
- .table-head-1{
2116
- display: flex;
2117
- line-height: 25px;
2118
- }
2119
- .btn-print{
2120
- text-align: center;
2121
- margin-top: 10px;
2122
- }
2123
- .report-info {
2124
- font-weight: 400;
2125
- font-size: 14px;
2126
- color: #333333;
2127
- line-height: 22px;
2128
- }
2129
- .report-flex {
2130
- display: flex;
2131
- }
2132
- .report-justify-between {
2133
- justify-content: space-between;
2134
- }
2135
- .report-pb-12 {
2136
- padding-bottom: 12px;
2137
- }
2138
- .report-pt-12 {
2139
- padding-top: 12px;
2140
- }`,
2141
- beforePrintMethod: ({ content }) => {
2142
- if (displayTitle.value) {
2143
- return `<div class="table-head">${displayTitle.value}</div>` + headerHtml + content + footerHtml;
2144
- }
2145
- return headerHtml + content + footerHtml;
2146
- }
2147
- });
2148
- } else {
2149
- console.error("VXE Table print method not found");
2150
- ElMessage.error("打印功能暂不可用");
2151
- }
2152
- }
2153
- function handleExport() {
2154
- if (props.exportCallback) {
2155
- emit("export");
2156
- } else {
2157
- const tableInstance = getTableInstance();
2158
- if (tableInstance) {
2159
- tableInstance.exportData({
2160
- filename: `${displayTitle.value}`,
2161
- sheetName: "Sheet1",
2162
- type: "xlsx"
2163
- });
2164
- }
2165
- }
2166
- }
2167
- function clearCheckbox() {
2168
- var _a;
2169
- (_a = repVxeTableRef.value) == null ? void 0 : _a.clearCheckbox();
2170
- }
2171
- function clearSort() {
2172
- var _a;
2173
- (_a = repVxeTableRef.value) == null ? void 0 : _a.clearSort();
2174
- }
2175
- __expose({
2176
- clearCheckbox,
2177
- clearSort,
2178
- handlePrint,
2179
- getTableInstance
2180
- });
2181
- return (_ctx, _cache) => {
2182
- return openBlock(), createElementBlock("div", _hoisted_1$1, [
2183
- createElementVNode("div", _hoisted_2$1, [
2184
- createElementVNode("h2", _hoisted_3$1, toDisplayString(displayTitle.value), 1),
2185
- createElementVNode("div", _hoisted_4$1, [
2186
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.customButtons, (btn, index2) => {
2187
- return openBlock(), createElementBlock("div", {
2188
- key: index2,
2189
- class: "action-item report-cursor-pointer",
2190
- onClick: ($event) => handleCustomBtn(index2, btn)
1854
+ const _component_el_input = resolveComponent("el-input");
1855
+ const _component_el_button = resolveComponent("el-button");
1856
+ const _component_vxe_form_item = resolveComponent("vxe-form-item");
1857
+ const _component_vxe_form = resolveComponent("vxe-form");
1858
+ return openBlock(), createElementBlock("div", {
1859
+ class: "search",
1860
+ style: normalizeStyle({ paddingBottom: __props.paddingBottom })
1861
+ }, [
1862
+ __props.showSearch ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
1863
+ createElementVNode("div", _hoisted_2$1, [
1864
+ createElementVNode("div", _hoisted_3$1, [
1865
+ __props.showInput ? (openBlock(), createElementBlock("span", _hoisted_4$1, "快捷搜索 ")) : createCommentVNode("", true),
1866
+ __props.showInput ? (openBlock(), createElementBlock("div", _hoisted_5$1, [
1867
+ createVNode(_component_el_input, {
1868
+ type: "text",
1869
+ onKeyup: withKeys(searchParentList, ["enter"]),
1870
+ modelValue: combinedQueries.value,
1871
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => combinedQueries.value = $event),
1872
+ placeholder: __props.placeholder,
1873
+ clearable: ""
1874
+ }, {
1875
+ prefix: withCtx(() => [
1876
+ createVNode(SvgIcon, {
1877
+ "icon-class": "search",
1878
+ "class-name": "svg-icon-22"
1879
+ })
1880
+ ]),
1881
+ _: 1
1882
+ }, 8, ["modelValue", "placeholder"])
1883
+ ])) : createCommentVNode("", true),
1884
+ __props.showMoreBottom ? (openBlock(), createElementBlock("div", {
1885
+ key: 2,
1886
+ class: "search-top-filter",
1887
+ onClick: _cache[1] || (_cache[1] = ($event) => showMore.value = !showMore.value)
2191
1888
  }, [
2192
- createElementVNode("span", _hoisted_6$1, toDisplayString(btn), 1)
2193
- ], 8, _hoisted_5$1);
2194
- }), 128)),
2195
- __props.showPrint ? (openBlock(), createElementBlock("div", {
2196
- key: 0,
2197
- class: "action-item report-cursor-pointer",
2198
- onClick: _cache[0] || (_cache[0] = ($event) => printReport(1))
2199
- }, [
2200
- createElementVNode("span", _hoisted_7$1, toDisplayString(__props.printText), 1)
2201
- ])) : createCommentVNode("", true),
2202
- __props.printText1 ? (openBlock(), createElementBlock("div", {
2203
- key: 1,
2204
- class: "action-item report-cursor-pointer",
2205
- onClick: _cache[1] || (_cache[1] = ($event) => printReport(2))
2206
- }, [
2207
- createElementVNode("span", _hoisted_8$1, toDisplayString(__props.printText1), 1)
2208
- ])) : createCommentVNode("", true),
2209
- __props.showExport ? (openBlock(), createElementBlock("div", {
2210
- key: 2,
2211
- class: "action-item report-cursor-pointer",
2212
- onClick: handleExport
2213
- }, _cache[2] || (_cache[2] = [
2214
- createElementVNode("span", { class: "report-text-primary" }, "导出", -1)
2215
- ]))) : createCommentVNode("", true)
2216
- ])
2217
- ]),
2218
- createElementVNode("div", {
2219
- class: "report-info report-pb-12",
2220
- ref_key: "reportHeaderRef",
2221
- ref: reportHeaderRef
2222
- }, [
2223
- createElementVNode("div", _hoisted_9, [
2224
- createElementVNode("div", null, [
2225
- _cache[3] || (_cache[3] = createElementVNode("span", { class: "" }, "制表单位:", -1)),
2226
- createElementVNode("span", _hoisted_10, toDisplayString(organizationNameDisplay.value), 1)
2227
- ]),
2228
- createElementVNode("div", null, [
2229
- _cache[4] || (_cache[4] = createElementVNode("span", { class: "" }, "日期范围:", -1)),
2230
- createElementVNode("span", _hoisted_11, toDisplayString(dateRangeDisplay.value), 1)
1889
+ createVNode(SvgIcon, {
1890
+ "icon-class": "filter",
1891
+ "class-name": "svg-icon-22 filter-icon"
1892
+ }),
1893
+ _cache[2] || (_cache[2] = createElementVNode("span", { class: "btn_more" }, "更多", -1))
1894
+ ])) : createCommentVNode("", true),
1895
+ createElementVNode("div", {
1896
+ class: normalizeClass([{ "search-top-extra--ml": __props.showInput }, "search-top-extra"])
1897
+ }, [
1898
+ renderSlot(_ctx.$slots, "default", {}, void 0, true),
1899
+ unref(slots).text1 ? (openBlock(), createElementBlock("div", _hoisted_6$1, [
1900
+ __props.text1 ? (openBlock(), createElementBlock("span", _hoisted_7$1, toDisplayString(__props.text1) + ":", 1)) : createCommentVNode("", true),
1901
+ createElementVNode("div", _hoisted_8$1, [
1902
+ renderSlot(_ctx.$slots, "text1", {}, void 0, true)
1903
+ ])
1904
+ ])) : createCommentVNode("", true),
1905
+ unref(slots).text2 ? (openBlock(), createElementBlock("div", _hoisted_9, [
1906
+ __props.text2 ? (openBlock(), createElementBlock("span", _hoisted_10, toDisplayString(__props.text2) + ":", 1)) : createCommentVNode("", true),
1907
+ createElementVNode("div", _hoisted_11, [
1908
+ renderSlot(_ctx.$slots, "text2", {}, void 0, true)
1909
+ ])
1910
+ ])) : createCommentVNode("", true),
1911
+ unref(slots).text3 ? (openBlock(), createElementBlock("div", _hoisted_12, [
1912
+ __props.text3 ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(__props.text3) + ":", 1)) : createCommentVNode("", true),
1913
+ createElementVNode("div", _hoisted_14, [
1914
+ renderSlot(_ctx.$slots, "text3", {}, void 0, true)
1915
+ ])
1916
+ ])) : createCommentVNode("", true)
1917
+ ], 2)
2231
1918
  ]),
2232
- __props.customHeader1Label ? (openBlock(), createElementBlock("div", _hoisted_12, [
2233
- createElementVNode("span", _hoisted_13, toDisplayString(__props.customHeader1Label) + ":", 1),
2234
- createElementVNode("span", _hoisted_14, toDisplayString(__props.customHeader1 || ""), 1)
2235
- ])) : createCommentVNode("", true),
2236
- __props.customHeader2Label ? (openBlock(), createElementBlock("div", _hoisted_15, [
2237
- createElementVNode("span", _hoisted_16, toDisplayString(__props.customHeader2Label) + ":", 1),
2238
- createElementVNode("span", _hoisted_17, toDisplayString(__props.customHeader2 || ""), 1)
2239
- ])) : createCommentVNode("", true),
2240
- createElementVNode("div", null, [
2241
- createElementVNode("span", _hoisted_18, toDisplayString(__props.customHeader3Label) + toDisplayString(__props.customHeader3Label ? ":" : ""), 1),
2242
- createElementVNode("span", _hoisted_19, toDisplayString(__props.customHeader3 || ""), 1)
1919
+ createElementVNode("div", _hoisted_15, [
1920
+ createVNode(_component_el_button, {
1921
+ plain: "",
1922
+ onClick: reset
1923
+ }, {
1924
+ default: withCtx(() => _cache[3] || (_cache[3] = [
1925
+ createTextVNode(" ")
1926
+ ])),
1927
+ _: 1,
1928
+ __: [3]
1929
+ }),
1930
+ createVNode(_component_el_button, {
1931
+ type: "primary",
1932
+ onClick: searchParentList
1933
+ }, {
1934
+ default: withCtx(() => _cache[4] || (_cache[4] = [
1935
+ createTextVNode("查 询")
1936
+ ])),
1937
+ _: 1,
1938
+ __: [4]
1939
+ })
2243
1940
  ])
2244
1941
  ])
2245
- ], 512),
2246
- createElementVNode("div", _hoisted_20, [
2247
- createVNode(XVxeTable, {
2248
- ref_key: "repVxeTableRef",
2249
- ref: repVxeTableRef,
2250
- "table-data": __props.tableData,
2251
- "sub-height": __props.subHeight,
2252
- "show-toolbar": __props.showToolbar,
2253
- "show-pagination": __props.showPagination,
2254
- loading: __props.loading,
2255
- "is-show-bg": false,
2256
- "page-size": __props.pageSize,
2257
- "current-page": __props.currentPage,
2258
- total: __props.total,
2259
- "show-footer": __props.showFooter,
2260
- "footer-data": __props.footerData,
2261
- columns: __props.columns,
2262
- onChangePage: handlePageChange
2263
- }, {
2264
- buttons: withCtx(() => [
2265
- renderSlot(_ctx.$slots, "buttons", {}, void 0, true)
2266
- ]),
2267
- default: withCtx(() => [
2268
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
2269
- ]),
2270
- _: 3
2271
- }, 8, ["table-data", "sub-height", "show-toolbar", "show-pagination", "loading", "page-size", "current-page", "total", "show-footer", "footer-data", "columns"])
2272
- ]),
2273
- createElementVNode("div", {
2274
- class: "report-info report-pt-12",
2275
- ref_key: "reportFooterRef",
2276
- ref: reportFooterRef
1942
+ ])) : createCommentVNode("", true),
1943
+ withDirectives(createElementVNode("div", {
1944
+ class: normalizeClass([{ "show_search": __props.showSearch }, "search-form"])
2277
1945
  }, [
2278
- createElementVNode("div", _hoisted_21, [
2279
- createElementVNode("div", null, [
2280
- _cache[5] || (_cache[5] = createElementVNode("span", { class: "" }, "审核人员:", -1)),
2281
- createElementVNode("span", _hoisted_22, toDisplayString(__props.auditorName || ""), 1)
2282
- ]),
2283
- createElementVNode("div", null, [
2284
- _cache[6] || (_cache[6] = createElementVNode("span", { class: "" }, "制表人员:", -1)),
2285
- createElementVNode("span", _hoisted_23, toDisplayString(creatorNameDisplay.value), 1)
2286
- ]),
2287
- __props.customFooterFieldLabel ? (openBlock(), createElementBlock("div", _hoisted_24, [
2288
- createElementVNode("span", _hoisted_25, toDisplayString(__props.customFooterFieldLabel) + ":", 1),
2289
- createElementVNode("span", _hoisted_26, toDisplayString(__props.customFooterField || ""), 1)
2290
- ])) : createCommentVNode("", true),
2291
- createElementVNode("div", null, [
2292
- _cache[7] || (_cache[7] = createElementVNode("span", { class: "" }, "打印日期:", -1)),
2293
- createElementVNode("span", _hoisted_27, toDisplayString(formattedPrintDate.value), 1)
2294
- ])
2295
- ])
2296
- ], 512)
2297
- ]);
1946
+ createElementVNode("div", {
1947
+ class: "search-form__inner",
1948
+ style: normalizeStyle(formContainerStyle.value)
1949
+ }, [
1950
+ hasFormSlot.value ? (openBlock(), createBlock(XElForm, {
1951
+ key: 0,
1952
+ rules: __props.rules,
1953
+ model: __props.queryForm,
1954
+ ref_key: "queryFormRef",
1955
+ ref: queryFormRef,
1956
+ span: vxeFormSpan.value,
1957
+ "label-width": __props.titleWidth
1958
+ }, {
1959
+ default: withCtx(() => [
1960
+ renderSlot(_ctx.$slots, "form", {}, void 0, true),
1961
+ !__props.showSearch ? (openBlock(), createBlock(XElFormItem, {
1962
+ key: 0,
1963
+ label: "",
1964
+ span: buttonItemSpan.value
1965
+ }, {
1966
+ default: withCtx(() => [
1967
+ createElementVNode("div", _hoisted_16, [
1968
+ createVNode(_component_el_button, {
1969
+ plain: "",
1970
+ onClick: reset
1971
+ }, {
1972
+ default: withCtx(() => _cache[5] || (_cache[5] = [
1973
+ createTextVNode("重 置")
1974
+ ])),
1975
+ _: 1,
1976
+ __: [5]
1977
+ }),
1978
+ createVNode(_component_el_button, {
1979
+ type: "primary",
1980
+ onClick: searchParentList
1981
+ }, {
1982
+ default: withCtx(() => _cache[6] || (_cache[6] = [
1983
+ createTextVNode("查 询")
1984
+ ])),
1985
+ _: 1,
1986
+ __: [6]
1987
+ })
1988
+ ])
1989
+ ]),
1990
+ _: 1
1991
+ }, 8, ["span"])) : createCommentVNode("", true)
1992
+ ]),
1993
+ _: 3
1994
+ }, 8, ["rules", "model", "span", "label-width"])) : createCommentVNode("", true),
1995
+ hasVxeFormSlot.value ? (openBlock(), createBlock(_component_vxe_form, {
1996
+ key: 1,
1997
+ data: __props.queryForm,
1998
+ rules: __props.rules,
1999
+ span: vxeFormSpan.value,
2000
+ titleColon: "",
2001
+ vertical: "",
2002
+ "title-align": "right",
2003
+ "title-width": __props.titleWidth,
2004
+ size: "medium",
2005
+ ref_key: "vxeFormRef",
2006
+ ref: vxeFormRef
2007
+ }, {
2008
+ default: withCtx(() => [
2009
+ renderSlot(_ctx.$slots, "vxeForm", {}, void 0, true),
2010
+ !__props.showSearch ? (openBlock(), createBlock(_component_vxe_form_item, {
2011
+ key: 0,
2012
+ span: buttonItemSpan.value,
2013
+ align: "right"
2014
+ }, {
2015
+ default: withCtx(() => [
2016
+ createVNode(_component_el_button, {
2017
+ plain: "",
2018
+ onClick: reset
2019
+ }, {
2020
+ default: withCtx(() => _cache[7] || (_cache[7] = [
2021
+ createTextVNode("重 置")
2022
+ ])),
2023
+ _: 1,
2024
+ __: [7]
2025
+ }),
2026
+ createVNode(_component_el_button, {
2027
+ type: "primary",
2028
+ onClick: searchParentList
2029
+ }, {
2030
+ default: withCtx(() => _cache[8] || (_cache[8] = [
2031
+ createTextVNode("查 询")
2032
+ ])),
2033
+ _: 1,
2034
+ __: [8]
2035
+ })
2036
+ ]),
2037
+ _: 1
2038
+ }, 8, ["span"])) : createCommentVNode("", true)
2039
+ ]),
2040
+ _: 3
2041
+ }, 8, ["data", "rules", "span", "title-width"])) : createCommentVNode("", true)
2042
+ ], 4)
2043
+ ], 2), [
2044
+ [vShow, showMore.value || !__props.showSearch]
2045
+ ])
2046
+ ], 4);
2298
2047
  };
2299
2048
  }
2300
2049
  });
2301
- const XReportTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-00481d7c"]]);
2050
+ const XSearchBar = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-39635b04"]]);
2302
2051
  const _hoisted_1 = { class: "x-split-layout__sidebar-menu" };
2303
2052
  const _hoisted_2 = ["onClick"];
2304
2053
  const _hoisted_3 = { class: "x-split-layout__menu-icon" };
@@ -2604,12 +2353,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2604
2353
  }
2605
2354
  });
2606
2355
  const components = {
2607
- XBusinessLog,
2608
2356
  XDatePicker,
2609
2357
  XElForm,
2610
2358
  XElFormItem,
2611
- XElOption: _sfc_main$4,
2612
- XElSelect: _sfc_main$3,
2359
+ XElOption: _sfc_main$7,
2360
+ XElSelect: _sfc_main$6,
2613
2361
  XPagination,
2614
2362
  XReportTable,
2615
2363
  XSearchBar,
@@ -2634,12 +2382,11 @@ const index = {
2634
2382
  };
2635
2383
  export {
2636
2384
  SvgIcon,
2637
- XBusinessLog,
2638
2385
  XDatePicker,
2639
2386
  XElForm,
2640
2387
  XElFormItem,
2641
- _sfc_main$4 as XElOption,
2642
- _sfc_main$3 as XElSelect,
2388
+ _sfc_main$7 as XElOption,
2389
+ _sfc_main$6 as XElSelect,
2643
2390
  XPagination,
2644
2391
  XReportTable,
2645
2392
  XSearchBar,