sctj-components 1.0.47 → 1.0.49

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.
@@ -38,9 +38,9 @@ const _export_sfc = (sfc, props) => {
38
38
  }
39
39
  return target;
40
40
  };
41
- const _hoisted_1$l = { class: "dict-tag-container" };
42
- const _hoisted_2$c = ["index"];
43
- const _sfc_main$s = {
41
+ const _hoisted_1$m = { class: "dict-tag-container" };
42
+ const _hoisted_2$d = ["index"];
43
+ const _sfc_main$u = {
44
44
  __name: "index",
45
45
  props: {
46
46
  options: {
@@ -60,7 +60,7 @@ const _sfc_main$s = {
60
60
  });
61
61
  return (_ctx, _cache) => {
62
62
  const _component_el_tag = resolveComponent("el-tag");
63
- return openBlock(), createElementBlock("div", _hoisted_1$l, [
63
+ return openBlock(), createElementBlock("div", _hoisted_1$m, [
64
64
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item, index2) => {
65
65
  return openBlock(), createElementBlock(Fragment, null, [
66
66
  unref(values).includes(item.value) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
@@ -68,7 +68,7 @@ const _sfc_main$s = {
68
68
  key: item.value,
69
69
  index: index2,
70
70
  class: normalizeClass(item.elTagClass)
71
- }, toDisplayString(item.label), 11, _hoisted_2$c)) : (openBlock(), createBlock(_component_el_tag, {
71
+ }, toDisplayString(item.label), 11, _hoisted_2$d)) : (openBlock(), createBlock(_component_el_tag, {
72
72
  "disable-transitions": true,
73
73
  key: item.value + "",
74
74
  index: index2,
@@ -87,10 +87,10 @@ const _sfc_main$s = {
87
87
  };
88
88
  }
89
89
  };
90
- const SCTJDictTag = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-659e1d01"]]);
90
+ const SCTJDictTag = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-659e1d01"]]);
91
91
  const index_vue_vue_type_style_index_0_scope_true_lang = "";
92
- const _hoisted_1$k = ["xlink:href", "fill"];
93
- const _sfc_main$r = {
92
+ const _hoisted_1$l = ["xlink:href", "fill"];
93
+ const _sfc_main$t = {
94
94
  __name: "index",
95
95
  props: {
96
96
  iconClass: {
@@ -123,7 +123,7 @@ const _sfc_main$r = {
123
123
  createElementVNode("use", {
124
124
  "xlink:href": unref(iconName),
125
125
  fill: __props.color
126
- }, null, 8, _hoisted_1$k)
126
+ }, null, 8, _hoisted_1$l)
127
127
  ], 2);
128
128
  };
129
129
  }
@@ -132,14 +132,14 @@ const index$2 = "";
132
132
  const index$1 = "";
133
133
  const index_vue_vue_type_style_index_0_scoped_006fbc77_lang = "";
134
134
  const index_vue_vue_type_style_index_1_lang = "";
135
- const _hoisted_1$j = { class: "upload-file" };
136
- const _hoisted_2$b = { class: "el-upload__tip" };
135
+ const _hoisted_1$k = { class: "upload-file" };
136
+ const _hoisted_2$c = { class: "el-upload__tip" };
137
137
  const _hoisted_3$9 = { style: { "color": "#f56c6c" } };
138
138
  const _hoisted_4$7 = { style: { "color": "#f56c6c" } };
139
139
  const _hoisted_5$6 = ["title"];
140
140
  const _hoisted_6$3 = { class: "ele-upload-list__item-content-action" };
141
141
  const _hoisted_7$3 = { style: { "width": "100%", "height": "100%", "overflow": "auto" } };
142
- const _sfc_main$q = {
142
+ const _sfc_main$s = {
143
143
  __name: "index",
144
144
  props: {
145
145
  modelValue: [String, Object, Array],
@@ -371,7 +371,7 @@ const _sfc_main$q = {
371
371
  const _component_el_icon = resolveComponent("el-icon");
372
372
  const _component_el_image = resolveComponent("el-image");
373
373
  const _component_el_dialog = resolveComponent("el-dialog");
374
- return openBlock(), createElementBlock("div", _hoisted_1$j, [
374
+ return openBlock(), createElementBlock("div", _hoisted_1$k, [
375
375
  !__props.disabled ? (openBlock(), createBlock(_component_el_upload, mergeProps({
376
376
  key: 0,
377
377
  multiple: "",
@@ -410,7 +410,7 @@ const _sfc_main$q = {
410
410
  unref(showTip) ? {
411
411
  name: "tip",
412
412
  fn: withCtx(() => [
413
- createElementVNode("div", _hoisted_2$b, [
413
+ createElementVNode("div", _hoisted_2$c, [
414
414
  createTextVNode(" \u8BF7\u4E0A\u4F20 "),
415
415
  __props.fileSize ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
416
416
  createTextVNode(" \u5927\u5C0F\u4E0D\u8D85\u8FC7 "),
@@ -517,17 +517,17 @@ const _sfc_main$q = {
517
517
  };
518
518
  }
519
519
  };
520
- const SCTJFileUpload = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-006fbc77"]]);
520
+ const SCTJFileUpload = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-006fbc77"]]);
521
521
  const index_vue_vue_type_style_index_0_scoped_672e5149_lang = "";
522
- const _hoisted_1$i = { class: "component-upload-image" };
523
- const _hoisted_2$a = {
522
+ const _hoisted_1$j = { class: "component-upload-image" };
523
+ const _hoisted_2$b = {
524
524
  key: 0,
525
525
  class: "el-upload__tip"
526
526
  };
527
527
  const _hoisted_3$8 = { style: { "color": "#f56c6c" } };
528
528
  const _hoisted_4$6 = { style: { "color": "#f56c6c" } };
529
529
  const _hoisted_5$5 = ["src"];
530
- const _sfc_main$p = {
530
+ const _sfc_main$r = {
531
531
  __name: "index",
532
532
  props: {
533
533
  modelValue: {
@@ -728,7 +728,7 @@ const _sfc_main$p = {
728
728
  const _component_el_icon = resolveComponent("el-icon");
729
729
  const _component_el_upload = resolveComponent("el-upload");
730
730
  const _component_el_dialog = resolveComponent("el-dialog");
731
- return openBlock(), createElementBlock("div", _hoisted_1$i, [
731
+ return openBlock(), createElementBlock("div", _hoisted_1$j, [
732
732
  createVNode(_component_el_upload, mergeProps({
733
733
  disabled: props.disabled,
734
734
  multiple: "",
@@ -760,7 +760,7 @@ const _sfc_main$p = {
760
760
  ]),
761
761
  _: 1
762
762
  }, 16, ["disabled", "action", "limit", "http-request", "headers", "file-list", "drag", "class"]),
763
- unref(showTip) ? (openBlock(), createElementBlock("div", _hoisted_2$a, [
763
+ unref(showTip) ? (openBlock(), createElementBlock("div", _hoisted_2$b, [
764
764
  createTextVNode(" \u8BF7\u4E0A\u4F20 "),
765
765
  props.fileSize ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
766
766
  createTextVNode(" \u5927\u5C0F\u4E0D\u8D85\u8FC7 "),
@@ -791,10 +791,10 @@ const _sfc_main$p = {
791
791
  };
792
792
  }
793
793
  };
794
- const SCTJImageUpload = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-672e5149"]]);
794
+ const SCTJImageUpload = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-672e5149"]]);
795
795
  const index_vue_vue_type_style_index_0_scoped_e91fd2ba_lang = "";
796
- const _hoisted_1$h = { class: "image-slot" };
797
- const _sfc_main$o = {
796
+ const _hoisted_1$i = { class: "image-slot" };
797
+ const _sfc_main$q = {
798
798
  __name: "index",
799
799
  props: {
800
800
  enableDelete: {
@@ -908,7 +908,7 @@ const _sfc_main$o = {
908
908
  "preview-src-list": unref(realSrcList)
909
909
  }, {
910
910
  error: withCtx(() => [
911
- createElementVNode("div", _hoisted_1$h, [
911
+ createElementVNode("div", _hoisted_1$i, [
912
912
  createVNode(_component_el_icon, { class: "el-icon-picture-outline" }, {
913
913
  default: withCtx(() => [
914
914
  createVNode(unref(Picture))
@@ -925,7 +925,7 @@ const _sfc_main$o = {
925
925
  };
926
926
  }
927
927
  };
928
- const SCTJImagePreview = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-e91fd2ba"]]);
928
+ const SCTJImagePreview = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-e91fd2ba"]]);
929
929
  const icons = [
930
930
  "404",
931
931
  "asset",
@@ -1017,10 +1017,10 @@ const icons = [
1017
1017
  "zip"
1018
1018
  ];
1019
1019
  const index_vue_vue_type_style_index_0_scoped_37029e19_lang = "";
1020
- const _hoisted_1$g = { class: "icon-content" };
1021
- const _hoisted_2$9 = { class: "icon-list" };
1020
+ const _hoisted_1$h = { class: "icon-content" };
1021
+ const _hoisted_2$a = { class: "icon-list" };
1022
1022
  const _hoisted_3$7 = ["onClick"];
1023
- const _sfc_main$n = {
1023
+ const _sfc_main$p = {
1024
1024
  __name: "index",
1025
1025
  props: {
1026
1026
  modelValue: {
@@ -1111,12 +1111,12 @@ const _sfc_main$n = {
1111
1111
  unref(iconName) ? {
1112
1112
  name: "prefix",
1113
1113
  fn: withCtx(() => [
1114
- createVNode(_sfc_main$r, { "icon-class": unref(iconName) }, null, 8, ["icon-class"])
1114
+ createVNode(_sfc_main$t, { "icon-class": unref(iconName) }, null, 8, ["icon-class"])
1115
1115
  ]),
1116
1116
  key: "0"
1117
1117
  } : void 0
1118
1118
  ]), 1032, ["modelValue"]),
1119
- withDirectives(createElementVNode("div", _hoisted_1$g, [
1119
+ withDirectives(createElementVNode("div", _hoisted_1$h, [
1120
1120
  createElementVNode("div", null, [
1121
1121
  createVNode(_component_el_input, {
1122
1122
  modelValue: keyWord.value,
@@ -1138,13 +1138,13 @@ const _sfc_main$n = {
1138
1138
  _: 1
1139
1139
  }, 8, ["modelValue"])
1140
1140
  ]),
1141
- createElementVNode("div", _hoisted_2$9, [
1141
+ createElementVNode("div", _hoisted_2$a, [
1142
1142
  (openBlock(true), createElementBlock(Fragment, null, renderList(iconList.value, (item, index2) => {
1143
1143
  return openBlock(), createElementBlock("div", {
1144
1144
  key: index2,
1145
1145
  onClick: ($event) => selectedIcon(item)
1146
1146
  }, [
1147
- createVNode(_sfc_main$r, {
1147
+ createVNode(_sfc_main$t, {
1148
1148
  "icon-class": item,
1149
1149
  style: { "height": "30px", "width": "16px", "flex-shrink": "0" }
1150
1150
  }, null, 8, ["icon-class"]),
@@ -1159,7 +1159,7 @@ const _sfc_main$n = {
1159
1159
  };
1160
1160
  }
1161
1161
  };
1162
- const SCTJIconSelect = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-37029e19"]]);
1162
+ const SCTJIconSelect = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-37029e19"]]);
1163
1163
  function useMobile() {
1164
1164
  const isMobile = ref$1(false);
1165
1165
  const checkIsMobile = () => {
@@ -1186,7 +1186,7 @@ function useMobile() {
1186
1186
  checkIsMobile
1187
1187
  };
1188
1188
  }
1189
- const _sfc_main$m = {
1189
+ const _sfc_main$o = {
1190
1190
  __name: "index",
1191
1191
  props: {
1192
1192
  modelValue: {
@@ -1291,8 +1291,8 @@ const _sfc_main$m = {
1291
1291
  }
1292
1292
  };
1293
1293
  const index_vue_vue_type_style_index_0_scoped_a2fe1763_lang = "";
1294
- const _hoisted_1$f = { class: "el-tree-select" };
1295
- const _sfc_main$l = {
1294
+ const _hoisted_1$g = { class: "el-tree-select" };
1295
+ const _sfc_main$n = {
1296
1296
  __name: "index",
1297
1297
  props: {
1298
1298
  objMap: {
@@ -1386,7 +1386,7 @@ const _sfc_main$l = {
1386
1386
  const _component_el_tree = resolveComponent("el-tree");
1387
1387
  const _component_el_option = resolveComponent("el-option");
1388
1388
  const _component_el_select = resolveComponent("el-select");
1389
- return openBlock(), createElementBlock("div", _hoisted_1$f, [
1389
+ return openBlock(), createElementBlock("div", _hoisted_1$g, [
1390
1390
  createVNode(_component_el_select, {
1391
1391
  style: { "width": "100%" },
1392
1392
  modelValue: unref(valueId),
@@ -1426,8 +1426,8 @@ const _sfc_main$l = {
1426
1426
  };
1427
1427
  }
1428
1428
  };
1429
- const SCTJTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-a2fe1763"]]);
1430
- const _sfc_main$k = {
1429
+ const SCTJTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-a2fe1763"]]);
1430
+ const _sfc_main$m = {
1431
1431
  __name: "index",
1432
1432
  props: {
1433
1433
  modelValue: {
@@ -1457,7 +1457,7 @@ const _sfc_main$k = {
1457
1457
  const selectValue = computed$1({
1458
1458
  get() {
1459
1459
  if (props.multiple) {
1460
- return Array.isArray(props.modelValue) ? props.modelValue : props.modelValue.split(",");
1460
+ return Array.isArray(props.modelValue) ? props.modelValue : props.modelValue.split(",").filter((item) => item !== "");
1461
1461
  } else {
1462
1462
  return props.modelValue;
1463
1463
  }
@@ -1472,7 +1472,7 @@ const _sfc_main$k = {
1472
1472
  return openBlock(), createBlock(_component_el_select, mergeProps({
1473
1473
  modelValue: unref(selectValue),
1474
1474
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(selectValue) ? selectValue.value = $event : null),
1475
- placeholder: "\u8BF7\u9009\u62E9\u4E0B\u62C9\u6846\u590D\u9009",
1475
+ placeholder: "\u8BF7\u9009\u62E9",
1476
1476
  multiple: __props.multiple,
1477
1477
  filterable: "",
1478
1478
  clearable: ""
@@ -1491,6 +1491,349 @@ const _sfc_main$k = {
1491
1491
  };
1492
1492
  }
1493
1493
  };
1494
+ const _sfc_main$l = {
1495
+ __name: "index",
1496
+ props: {
1497
+ modelValue: {
1498
+ type: [String, Array],
1499
+ default: ""
1500
+ },
1501
+ options: {
1502
+ type: Array,
1503
+ default: () => []
1504
+ },
1505
+ valueProp: {
1506
+ type: String,
1507
+ default: "value"
1508
+ },
1509
+ labelProp: {
1510
+ type: String,
1511
+ default: "label"
1512
+ }
1513
+ },
1514
+ emits: ["update:modelValue"],
1515
+ setup(__props, { emit }) {
1516
+ const props = __props;
1517
+ const checkBoxValue = computed$1({
1518
+ get() {
1519
+ return Array.isArray(props.modelValue) ? props.modelValue : props.modelValue.split(",").filter((item) => item !== "");
1520
+ },
1521
+ set(val) {
1522
+ emit("update:modelValue", Array.isArray(val) ? val.join(",") : val);
1523
+ }
1524
+ });
1525
+ return (_ctx, _cache) => {
1526
+ const _component_el_checkbox = resolveComponent("el-checkbox");
1527
+ const _component_el_checkbox_group = resolveComponent("el-checkbox-group");
1528
+ return openBlock(), createBlock(_component_el_checkbox_group, mergeProps({
1529
+ modelValue: unref(checkBoxValue),
1530
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(checkBoxValue) ? checkBoxValue.value = $event : null)
1531
+ }, _ctx.$attrs), {
1532
+ default: withCtx(() => [
1533
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (dict) => {
1534
+ return openBlock(), createBlock(_component_el_checkbox, {
1535
+ key: dict[__props.valueProp],
1536
+ label: dict[__props.valueProp],
1537
+ disabled: dict.disabled
1538
+ }, {
1539
+ default: withCtx(() => [
1540
+ createTextVNode(toDisplayString(dict[__props.labelProp]), 1)
1541
+ ]),
1542
+ _: 2
1543
+ }, 1032, ["label", "disabled"]);
1544
+ }), 128))
1545
+ ]),
1546
+ _: 1
1547
+ }, 16, ["modelValue"]);
1548
+ };
1549
+ }
1550
+ };
1551
+ const index_vue_vue_type_style_index_0_scoped_96b24d3b_lang = "";
1552
+ const _hoisted_1$f = { class: "time-line-slider-container" };
1553
+ const _hoisted_2$9 = { class: "time-line-slider-wrapper" };
1554
+ const _sfc_main$k = {
1555
+ __name: "index",
1556
+ props: {
1557
+ timeConfig: {
1558
+ type: [Array, Object],
1559
+ default: () => ({
1560
+ startTime: "2025-01-13",
1561
+ endTime: "2025-06-18"
1562
+ })
1563
+ },
1564
+ modelValue: {
1565
+ type: [Number, String],
1566
+ default: void 0
1567
+ }
1568
+ },
1569
+ emits: ["update:modelValue"],
1570
+ setup(__props, { emit }) {
1571
+ const props = __props;
1572
+ const selectDate = computed$1({
1573
+ get() {
1574
+ return normalizeDate(props.modelValue);
1575
+ },
1576
+ set(value) {
1577
+ if (typeof props.modelValue === "string") {
1578
+ emit("update:modelValue", value);
1579
+ } else {
1580
+ const timestamp = dateStringToTimestamp(value);
1581
+ emit("update:modelValue", timestamp);
1582
+ }
1583
+ }
1584
+ });
1585
+ const selectChange = async () => {
1586
+ await nextTick();
1587
+ setTimeout(() => {
1588
+ const sliderButton = document.querySelector(".el-slider__button-wrapper");
1589
+ if (sliderButton) {
1590
+ const scrollContainer = document.querySelector(".time-line-slider-wrapper");
1591
+ if (scrollContainer) {
1592
+ const buttonRect = sliderButton.getBoundingClientRect();
1593
+ const containerRect = scrollContainer.getBoundingClientRect();
1594
+ const scrollLeft = scrollContainer.scrollLeft + (buttonRect.left - containerRect.left) - containerRect.width / 2 + buttonRect.width / 2;
1595
+ scrollContainer.scrollTo({
1596
+ left: scrollLeft,
1597
+ behavior: "smooth"
1598
+ });
1599
+ } else {
1600
+ sliderButton.scrollIntoView({
1601
+ behavior: "smooth",
1602
+ block: "center",
1603
+ inline: "center"
1604
+ });
1605
+ }
1606
+ }
1607
+ }, 100);
1608
+ };
1609
+ const generateDateRange = (startTime, endTime) => {
1610
+ const dates = [];
1611
+ const start = new Date(startTime);
1612
+ const end = new Date(endTime);
1613
+ if (isNaN(start.getTime()) || isNaN(end.getTime())) {
1614
+ return [];
1615
+ }
1616
+ start.setHours(0, 0, 0, 0);
1617
+ end.setHours(0, 0, 0, 0);
1618
+ if (start > end) {
1619
+ [start, end] = [end, start];
1620
+ }
1621
+ const currentDate = new Date(start);
1622
+ while (currentDate <= end) {
1623
+ const year = currentDate.getFullYear();
1624
+ const month = String(currentDate.getMonth() + 1).padStart(2, "0");
1625
+ const day = String(currentDate.getDate()).padStart(2, "0");
1626
+ dates.push(`${year}-${month}-${day}`);
1627
+ currentDate.setDate(currentDate.getDate() + 1);
1628
+ }
1629
+ return dates;
1630
+ };
1631
+ const timePoints = computed$1(() => {
1632
+ if (Array.isArray(props.timeConfig)) {
1633
+ return props.timeConfig;
1634
+ } else if (typeof props.timeConfig === "object" && props.timeConfig !== null) {
1635
+ if (props.timeConfig.startTime && props.timeConfig.endTime) {
1636
+ return generateDateRange(props.timeConfig.startTime, props.timeConfig.endTime);
1637
+ }
1638
+ if (Array.isArray(props.timeConfig.data)) {
1639
+ return props.timeConfig.data;
1640
+ } else if (Array.isArray(props.timeConfig.list)) {
1641
+ return props.timeConfig.list;
1642
+ } else {
1643
+ return Object.values(props.timeConfig);
1644
+ }
1645
+ }
1646
+ return [];
1647
+ });
1648
+ const min = computed$1(() => 0);
1649
+ const max = computed$1(() => Math.max(0, timePoints.value.length - 1));
1650
+ const step = computed$1(() => 1);
1651
+ const sliderWidth = computed$1(() => {
1652
+ const pointCount = timePoints.value.length;
1653
+ if (pointCount === 0) {
1654
+ return "100%";
1655
+ }
1656
+ const minWidthPerPoint = 80;
1657
+ const minTotalWidth = 300;
1658
+ const maxTotalWidth = 12e3;
1659
+ const calculatedWidth = pointCount * minWidthPerPoint;
1660
+ const finalWidth = Math.max(minTotalWidth, Math.min(calculatedWidth, maxTotalWidth));
1661
+ return `${finalWidth}px`;
1662
+ });
1663
+ const marks = computed$1(() => {
1664
+ const marksObj = {};
1665
+ timePoints.value.forEach((point, index2) => {
1666
+ marksObj[index2] = formatTimeLabel(point);
1667
+ });
1668
+ return marksObj;
1669
+ });
1670
+ const formatTimeLabel = (time) => {
1671
+ if (typeof time === "string") {
1672
+ if (time.includes("T") || time.includes(" ")) {
1673
+ return time.split(" ")[0] || time.split("T")[0];
1674
+ }
1675
+ return time;
1676
+ } else if (typeof time === "number") {
1677
+ const date = new Date(time);
1678
+ return date.toLocaleDateString("zh-CN");
1679
+ } else if (time && typeof time === "object") {
1680
+ return time.label || time.name || time.value || String(time);
1681
+ }
1682
+ return String(time);
1683
+ };
1684
+ const formatTooltip = (val) => {
1685
+ const index2 = Math.round(val);
1686
+ if (index2 >= 0 && index2 < timePoints.value.length) {
1687
+ const point = timePoints.value[index2];
1688
+ return formatTimeLabel(point);
1689
+ }
1690
+ return String(val);
1691
+ };
1692
+ const dateStringToTimestamp = (dateStr) => {
1693
+ const cleanDateStr = dateStr.split("T")[0].split(" ")[0];
1694
+ const [year, month, day] = cleanDateStr.split("-").map(Number);
1695
+ const date = new Date(year, month - 1, day);
1696
+ return date.getTime();
1697
+ };
1698
+ const normalizeDate = (date) => {
1699
+ if (typeof date === "string") {
1700
+ return date.split("T")[0].split(" ")[0];
1701
+ } else if (typeof date === "number") {
1702
+ const d = new Date(date);
1703
+ const year = d.getFullYear();
1704
+ const month = String(d.getMonth() + 1).padStart(2, "0");
1705
+ const day = String(d.getDate()).padStart(2, "0");
1706
+ return `${year}-${month}-${day}`;
1707
+ }
1708
+ return String(date);
1709
+ };
1710
+ const getIndexFromModalValue = (modalValue) => {
1711
+ if (Number.isInteger(modalValue) && modalValue >= 0 && modalValue < timePoints.value.length) {
1712
+ return modalValue;
1713
+ }
1714
+ const modalDateStr = normalizeDate(modalValue);
1715
+ const index2 = timePoints.value.findIndex((point) => {
1716
+ const pointDateStr = normalizeDate(point);
1717
+ return pointDateStr === modalDateStr;
1718
+ });
1719
+ if (index2 !== -1) {
1720
+ return index2;
1721
+ }
1722
+ return 0;
1723
+ };
1724
+ const selectValue = ref$1(0);
1725
+ let lastEmittedValue = null;
1726
+ let modalValueType = null;
1727
+ const getValueFromIndex = (index2) => {
1728
+ if (index2 >= 0 && index2 < timePoints.value.length) {
1729
+ const point = timePoints.value[index2];
1730
+ if (modalValueType === "string") {
1731
+ if (typeof point === "string") {
1732
+ return point;
1733
+ } else if (typeof point === "number") {
1734
+ return normalizeDate(point);
1735
+ } else {
1736
+ return String(point);
1737
+ }
1738
+ } else {
1739
+ if (typeof point === "number") {
1740
+ return point;
1741
+ } else if (typeof point === "string") {
1742
+ const timestamp = dateStringToTimestamp(point);
1743
+ if (!isNaN(timestamp)) {
1744
+ return timestamp;
1745
+ } else {
1746
+ return index2;
1747
+ }
1748
+ } else {
1749
+ return index2;
1750
+ }
1751
+ }
1752
+ }
1753
+ return modalValueType === "string" ? "" : 0;
1754
+ };
1755
+ const updateSelectValueFromProps = () => {
1756
+ const value = props.modelValue;
1757
+ if (value === void 0) {
1758
+ selectValue.value = 0;
1759
+ return;
1760
+ }
1761
+ modalValueType = typeof value === "string" ? "string" : "number";
1762
+ const index2 = getIndexFromModalValue(value);
1763
+ if (selectValue.value !== index2) {
1764
+ selectValue.value = index2;
1765
+ }
1766
+ };
1767
+ updateSelectValueFromProps();
1768
+ watch(
1769
+ () => [props.modelValue, timePoints.value],
1770
+ () => {
1771
+ const value = props.modelValue;
1772
+ if (lastEmittedValue !== null) {
1773
+ if (value === lastEmittedValue) {
1774
+ lastEmittedValue = null;
1775
+ return;
1776
+ }
1777
+ const modalDateStr = normalizeDate(value);
1778
+ const emittedDateStr = normalizeDate(lastEmittedValue);
1779
+ if (modalDateStr === emittedDateStr) {
1780
+ lastEmittedValue = null;
1781
+ return;
1782
+ }
1783
+ }
1784
+ updateSelectValueFromProps();
1785
+ },
1786
+ { deep: true }
1787
+ );
1788
+ watch(selectValue, (val) => {
1789
+ const index2 = Math.round(val);
1790
+ const emitValue = getValueFromIndex(index2);
1791
+ lastEmittedValue = emitValue;
1792
+ console.log("emitValue", emitValue);
1793
+ emit("update:modelValue", emitValue);
1794
+ });
1795
+ return (_ctx, _cache) => {
1796
+ const _component_el_slider = resolveComponent("el-slider");
1797
+ const _component_el_option = resolveComponent("el-option");
1798
+ const _component_el_select = resolveComponent("el-select");
1799
+ return openBlock(), createElementBlock("div", _hoisted_1$f, [
1800
+ createElementVNode("div", _hoisted_2$9, [
1801
+ createVNode(_component_el_slider, {
1802
+ style: normalizeStyle({ width: unref(sliderWidth) }),
1803
+ modelValue: selectValue.value,
1804
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectValue.value = $event),
1805
+ min: unref(min),
1806
+ max: unref(max),
1807
+ step: unref(step),
1808
+ marks: unref(marks),
1809
+ "show-stops": true,
1810
+ "show-tooltip": true,
1811
+ "format-tooltip": formatTooltip
1812
+ }, null, 8, ["style", "modelValue", "min", "max", "step", "marks"])
1813
+ ]),
1814
+ createVNode(_component_el_select, {
1815
+ modelValue: unref(selectDate),
1816
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(selectDate) ? selectDate.value = $event : null),
1817
+ placeholder: "\u8BF7\u9009\u62E9",
1818
+ filterable: "",
1819
+ onChange: selectChange
1820
+ }, {
1821
+ default: withCtx(() => [
1822
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(timePoints), (point, index2) => {
1823
+ return openBlock(), createBlock(_component_el_option, {
1824
+ key: index2,
1825
+ label: formatTimeLabel(point),
1826
+ value: normalizeDate(point)
1827
+ }, null, 8, ["label", "value"]);
1828
+ }), 128))
1829
+ ]),
1830
+ _: 1
1831
+ }, 8, ["modelValue"])
1832
+ ]);
1833
+ };
1834
+ }
1835
+ };
1836
+ const SCTJTimeLineSelect = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-96b24d3b"]]);
1494
1837
  const index_vue_vue_type_style_index_0_scoped_0e809a5c_lang = "";
1495
1838
  const _hoisted_1$e = { class: "table-container" };
1496
1839
  const _sfc_main$j = {
@@ -9056,13 +9399,13 @@ const _sfc_main$2 = {
9056
9399
  }
9057
9400
  };
9058
9401
  const SCTJBusinessMapDrawingDialog = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-d0bea808"]]);
9059
- const BimViewer_vue_vue_type_style_index_0_scoped_b60f1ba4_lang = "";
9402
+ const BimViewer_vue_vue_type_style_index_0_scoped_c145e90e_lang = "";
9060
9403
  const _sfc_main$1 = {
9061
9404
  __name: "BimViewer",
9062
9405
  props: {
9063
9406
  viewToken: {
9064
9407
  type: String,
9065
- default: "121d1db2a4cd444983d0871aa47786eb"
9408
+ default: ""
9066
9409
  },
9067
9410
  extraContextMenu: {
9068
9411
  type: Array,
@@ -9085,7 +9428,7 @@ const _sfc_main$1 = {
9085
9428
  }
9086
9429
  },
9087
9430
  emits: ["contextMenuClick"],
9088
- setup(__props, { emit }) {
9431
+ setup(__props, { expose, emit }) {
9089
9432
  const props = __props;
9090
9433
  const bimContainer = ref$1(null);
9091
9434
  const viewer3D = ref$1(null);
@@ -9246,6 +9589,10 @@ const _sfc_main$1 = {
9246
9589
  console.error("\u5BB9\u5668\u5143\u7D20\u672A\u51C6\u5907\u597D");
9247
9590
  return;
9248
9591
  }
9592
+ if (!props.viewToken) {
9593
+ console.error("\u7F3A\u5C11\u5FC5\u8981\u53C2\u6570viewToken");
9594
+ return;
9595
+ }
9249
9596
  const options = new BimfaceSDKLoaderConfig();
9250
9597
  options.viewToken = props.viewToken;
9251
9598
  BimfaceSDKLoader.load(options, successCallback, failureCallback);
@@ -9284,17 +9631,73 @@ const _sfc_main$1 = {
9284
9631
  viewer3D.value = null;
9285
9632
  app.value = null;
9286
9633
  };
9634
+ const freezeComponent = (idArr, colorRgba = [128, 128, 128, 0.5]) => {
9635
+ let newColor = new Glodon.Web.Graphics.Color(...colorRgba);
9636
+ const model3D = viewer3D.value.getModel();
9637
+ model3D.overrideComponentsColorById(idArr, newColor);
9638
+ model3D.deactivateComponentsById(idArr);
9639
+ viewer3D.value.render();
9640
+ };
9641
+ const unfreezeComponent = () => {
9642
+ const model3D = viewer3D.value.getModel();
9643
+ model3D.activateAllComponents();
9644
+ model3D.clearOverrideColorComponents();
9645
+ viewer3D.value.render();
9646
+ };
9647
+ const hideComponent = (mode = "id", arr) => {
9648
+ const model3D = viewer3D.value.getModel();
9649
+ if (mode === "id") {
9650
+ arr && arr.length ? model3D.hideComponentsById(arr) : model3D.hideAllComponents();
9651
+ } else {
9652
+ arr && arr.length ? model3D.hideComponentsByObjectData(arr) : model3D.hideAllComponents();
9653
+ }
9654
+ viewer3D.value.render();
9655
+ };
9656
+ const showComponent = (mode = "id", arr) => {
9657
+ const model3D = viewer3D.value.getModel();
9658
+ if (mode === "id") {
9659
+ arr && arr.length ? model3D.showComponentsById(arr) : model3D.showAllComponents();
9660
+ } else {
9661
+ arr && arr.length ? model3D.showComponentsByObjectData(arr) : model3D.showAllComponents();
9662
+ }
9663
+ viewer3D.value.render();
9664
+ };
9665
+ const isolateComponent = (arr, mode = "id") => {
9666
+ const model3D = viewer3D.value.getModel();
9667
+ const makeOthersTranslucent = Glodon.Bimface.Viewer.IsolateOption.MakeOthersTranslucent;
9668
+ if (mode === "id") {
9669
+ model3D.isolateComponentsById(arr, makeOthersTranslucent);
9670
+ } else if (mode === "objectData") {
9671
+ model3D.isolateComponentsByObjectData(arr, makeOthersTranslucent);
9672
+ }
9673
+ viewer3D.value.render();
9674
+ };
9675
+ const unIsolateComponent = () => {
9676
+ const model3D = viewer3D.value.getModel();
9677
+ model3D.clearIsolation();
9678
+ viewer3D.value.render();
9679
+ };
9287
9680
  const initBim = () => {
9288
9681
  nextTick(() => {
9289
9682
  loadModel();
9290
9683
  });
9291
9684
  };
9292
- onMounted$1(() => {
9293
- initBim();
9294
- });
9685
+ watch(() => props.viewToken, () => {
9686
+ if (props.viewToken) {
9687
+ initBim();
9688
+ }
9689
+ }, { immediate: true });
9295
9690
  onBeforeUnmount(() => {
9296
9691
  cleanup();
9297
9692
  });
9693
+ expose({
9694
+ freezeComponent,
9695
+ unfreezeComponent,
9696
+ hideComponent,
9697
+ showComponent,
9698
+ isolateComponent,
9699
+ unIsolateComponent
9700
+ });
9298
9701
  return (_ctx, _cache) => {
9299
9702
  return openBlock(), createElementBlock("div", {
9300
9703
  class: "model-container",
@@ -9304,7 +9707,7 @@ const _sfc_main$1 = {
9304
9707
  };
9305
9708
  }
9306
9709
  };
9307
- const SCTJBimViewer = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-b60f1ba4"]]);
9710
+ const SCTJBimViewer = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-c145e90e"]]);
9308
9711
  const DwgViewer_vue_vue_type_style_index_0_scoped_ab9c8ebd_lang = "";
9309
9712
  const _sfc_main = {
9310
9713
  __name: "DwgViewer",
@@ -9548,14 +9951,16 @@ const SCTJDwgViewer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "dat
9548
9951
  const components = [
9549
9952
  { component: SCTJDictTag, name: "SCTJDictTag" },
9550
9953
  { component: SCTJTreeSelect, name: "SCTJTreeSelect" },
9551
- { component: _sfc_main$k, name: "SCTJSelect" },
9552
- { component: _sfc_main$r, name: "SCTJIcon" },
9954
+ { component: _sfc_main$m, name: "SCTJSelect" },
9955
+ { component: _sfc_main$l, name: "SCTJCheckBox" },
9956
+ { component: SCTJTimeLineSelect, name: "SCTJTimeLineSelect" },
9957
+ { component: _sfc_main$t, name: "SCTJIcon" },
9553
9958
  { component: SCTJFileUpload, name: "SCTJFileUpload" },
9554
9959
  { component: SCTJImageUpload, name: "SCTJImageUpload" },
9555
9960
  { component: SCTJImagePreview, name: "SCTJImagePreview" },
9556
9961
  { component: SCTJIconSelect, name: "SCTJIconSelect" },
9557
9962
  { component: SCTJSearch, name: "SCTJSearch" },
9558
- { component: _sfc_main$m, name: "SCTJDateRangePicker" },
9963
+ { component: _sfc_main$o, name: "SCTJDateRangePicker" },
9559
9964
  { component: SCTJTable, name: "SCTJTable" },
9560
9965
  { component: SCTJTableContainer, name: "SCTJTableContainer" },
9561
9966
  { component: SCTJTablePageContainer, name: "SCTJTablePageContainer" },
@@ -9585,14 +9990,16 @@ const index = {
9585
9990
  install,
9586
9991
  SCTJDictTag,
9587
9992
  SCTJTreeSelect,
9588
- SCTJSelect: _sfc_main$k,
9589
- SCTJIcon: _sfc_main$r,
9993
+ SCTJSelect: _sfc_main$m,
9994
+ SCTJCheckBox: _sfc_main$l,
9995
+ SCTJTimeLineSelect,
9996
+ SCTJIcon: _sfc_main$t,
9590
9997
  SCTJFileUpload,
9591
9998
  SCTJImageUpload,
9592
9999
  SCTJImagePreview,
9593
10000
  SCTJIconSelect,
9594
10001
  SCTJSearch,
9595
- SCTJDateRangePicker: _sfc_main$m,
10002
+ SCTJDateRangePicker: _sfc_main$o,
9596
10003
  SCTJTable,
9597
10004
  SCTJTableContainer,
9598
10005
  SCTJTablePageContainer,
@@ -9618,14 +10025,15 @@ export {
9618
10025
  SCTJBimViewer,
9619
10026
  _sfc_main$d as SCTJBtnContainer,
9620
10027
  SCTJBusinessMapDrawingDialog,
10028
+ _sfc_main$l as SCTJCheckBox,
9621
10029
  SCTJCommonChart,
9622
- _sfc_main$m as SCTJDateRangePicker,
10030
+ _sfc_main$o as SCTJDateRangePicker,
9623
10031
  SCTJDialogTable,
9624
10032
  SCTJDictTag,
9625
10033
  SCTJDwgViewer,
9626
10034
  SCTJFileUpload,
9627
10035
  SCTJFlvPlayer,
9628
- _sfc_main$r as SCTJIcon,
10036
+ _sfc_main$t as SCTJIcon,
9629
10037
  SCTJIconSelect,
9630
10038
  _sfc_main$6 as SCTJIframe,
9631
10039
  SCTJImagePreview,
@@ -9637,11 +10045,12 @@ export {
9637
10045
  SCTJRightToolbar,
9638
10046
  SCTJScrollTable,
9639
10047
  SCTJSearch,
9640
- _sfc_main$k as SCTJSelect,
10048
+ _sfc_main$m as SCTJSelect,
9641
10049
  SCTJTable,
9642
10050
  SCTJTableContainer,
9643
10051
  SCTJTablePageContainer,
9644
10052
  SCTJTableTopActionContainer,
10053
+ SCTJTimeLineSelect,
9645
10054
  SCTJTreeSelect,
9646
10055
  index as default
9647
10056
  };