qy-vue-plugins 1.0.2-beta → 1.0.2
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/apply-element-plus-theme.cjs +1 -0
- package/dist/apply-element-plus-theme.mjs +22 -0
- package/dist/beijihua-map-icon/hiper-map-icon-1.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-10.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-11.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-12.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-13.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-14.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-15.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-16.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-17.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-18.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-19.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-2.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-20.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-21.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-22.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-23.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-24.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-25.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-26.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-27.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-28.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-29.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-3.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-30.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-31.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-32.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-33.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-34.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-35.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-36.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-37.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-38.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-39.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-4.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-40.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-41.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-42.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-43.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-44.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-45.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-46.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-47.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-48.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-49.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-5.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-50.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-51.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-52.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-53.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-54.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-55.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-56.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-57.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-58.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-59.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-6.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-60.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-61.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-62.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-63.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-64.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-65.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-7.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-8.png +0 -0
- package/dist/beijihua-map-icon/hiper-map-icon-9.png +0 -0
- package/dist/chunks/{EventKeys-1aL9cgT0.js → EventKeys-DZ_Hahro.js} +4 -4
- package/dist/chunks/{MapTools.vue_vue_type_style_index_0_lang-C3__NQXN.js → MapTools.vue_vue_type_style_index_0_lang-C0C9opKY.js} +1 -1
- package/dist/chunks/{MapTools.vue_vue_type_style_index_0_lang-BJi8BdV8.js → MapTools.vue_vue_type_style_index_0_lang-CZ_dEmHg.js} +2 -2
- package/dist/chunks/{ReplaceSpeciesNameDialog.vue_vue_type_script_setup_true_lang-C8wD6gZS.js → ReplaceSpeciesNameDialog.vue_vue_type_script_setup_true_lang-CjJ3e53H.js} +12 -13
- package/dist/chunks/ReplaceSpeciesNameDialog.vue_vue_type_script_setup_true_lang-m9hkScAC.js +1 -0
- package/dist/chunks/apply-element-plus-theme-DdN9KOhk.js +1 -0
- package/dist/chunks/apply-element-plus-theme-UHVxP4VN.js +22 -0
- package/dist/chunks/aria-B5rZ0WFy.js +5 -0
- package/dist/chunks/aria-BEkkcjlH.js +115 -0
- package/dist/chunks/constant-Bq4ASE9Q.js +1 -0
- package/dist/chunks/{constant-BqK1UnfT.js → constant-E83OJqPQ.js} +17 -36
- package/dist/chunks/debounce-CHS-N31c.js +1 -0
- package/dist/chunks/debounce-DBq5TVsN.js +55 -0
- package/dist/chunks/{el-loading-CBXyo6la.js → directive-C-4KkhaM.js} +2 -2
- package/dist/chunks/directive-DRO4tFsQ.js +1 -0
- package/dist/chunks/index-03UF6hCZ.js +14 -0
- package/dist/chunks/index-B6SD5IcP.js +1 -0
- package/dist/chunks/{index-DHO_7w-5.js → index-BCQYbM-I.js} +22 -22
- package/dist/chunks/{el-input-DCpRXscw.js → index-BdloQTv1.js} +171 -175
- package/dist/chunks/{el-overlay-BJQjrf5W.js → index-BeskO4C8.js} +76 -75
- package/dist/chunks/index-BoFuR9-k.js +2 -0
- package/dist/chunks/index-Bs9zhLlD.js +1 -0
- package/dist/chunks/index-C-WIOEu8.js +1 -0
- package/dist/chunks/index-CD-vLVPt.js +1 -0
- package/dist/chunks/index-CD4bijv7.js +1 -0
- package/dist/chunks/index-CHRyd-8X.js +1 -0
- package/dist/chunks/{el-button-Dh7ROB0R.js → index-CgKiWbxR.js} +110 -117
- package/dist/chunks/{el-popper-zUql4Vp-.js → index-Cv_K9rbv.js} +47 -46
- package/dist/chunks/{el-select-Dil0JEvg.js → index-Cyrc4mj-.js} +467 -492
- package/dist/chunks/index-DLBjU25P.js +3 -0
- package/dist/chunks/index-DgwQEHlD.js +12 -0
- package/dist/chunks/index-LWCtnbZP.js +13 -0
- package/dist/chunks/index-OtE8c8y9.js +1 -0
- package/dist/chunks/index-Qzqd5jTh.js +1 -0
- package/dist/chunks/index-VbRYJz2E.js +1 -0
- package/dist/chunks/index-YiSmXvH8.js +975 -0
- package/dist/chunks/{index-Dq3Y5qiS.js → index-_At9ftZd.js} +35 -35
- package/dist/chunks/{index-Cw_w6CLf.js → index-ieQ_IULW.js} +11 -11
- package/dist/chunks/{el-form-item-CXLLocXw.js → index-mDs-Bipv.js} +151 -150
- package/dist/chunks/mapSetting-B1a88k-v.js +635 -0
- package/dist/chunks/mapSetting-Ba76lOJd.js +1 -0
- package/dist/chunks/{base-DfCoKyyG.js → style-COMeMpO8.js} +81 -80
- package/dist/chunks/{base-DK_JFP90.js → style-DiDWGUIe.js} +1 -1
- package/dist/chunks/toNumber-CCcOx5KD.js +1 -0
- package/dist/chunks/toNumber-CDwzVyqL.js +30 -0
- package/dist/chunks/use-form-common-props-BQtZKazE.js +66 -0
- package/dist/chunks/use-form-common-props-SdGVhyVk.js +1 -0
- package/dist/chunks/{use-global-config-DXAWJFeA.js → use-global-config-Ba3i7fKX.js} +18 -17
- package/dist/chunks/use-global-config-PaSl-b_9.js +1 -0
- package/dist/chunks/utils-BJ8Lu8TY.js +516 -0
- package/dist/chunks/utils-CrwGKkIz.js +1 -0
- package/dist/chunks/vnode-CvqQoLhR.js +1 -0
- package/dist/chunks/vnode-DpjFDm4v.js +70 -0
- package/dist/element-plus-style.cjs +1 -0
- package/dist/element-plus-style.mjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +13 -10
- package/dist/manageTable/ReplaceSpeciesNameDialog.cjs +1 -1
- package/dist/manageTable/ReplaceSpeciesNameDialog.mjs +1 -1
- package/dist/manageTable/index.cjs +1 -1
- package/dist/manageTable/index.mjs +10 -8
- package/dist/manageTable/manageTable.cjs +1 -1
- package/dist/manageTable/manageTable.mjs +1 -1
- package/dist/mapbox/components/VideoDialog.cjs +1 -1
- package/dist/mapbox/components/VideoDialog.mjs +16 -17
- package/dist/mapbox/widgets/LayerAttributeDialog.cjs +1 -1
- package/dist/mapbox/widgets/LayerAttributeDialog.mjs +30 -31
- package/dist/mapbox.cjs +1 -1
- package/dist/mapbox.mjs +22 -20
- package/dist/mapboxV2/MapView.cjs +1 -1
- package/dist/mapboxV2/MapView.mjs +3728 -1256
- package/dist/mapboxV2/components/MapLegend.cjs +1 -1
- package/dist/mapboxV2/components/MapLegend.mjs +51 -167
- package/dist/mapboxV2/components/MapTools.cjs +1 -1
- package/dist/mapboxV2/components/MapTools.mjs +1 -1
- package/dist/mapboxV2/components/VideoDialog.cjs +1 -1
- package/dist/mapboxV2/components/VideoDialog.mjs +12 -13
- package/dist/mapboxV2/components/mapSetting.cjs +1 -1
- package/dist/mapboxV2/components/mapSetting.mjs +1 -1
- package/dist/mapboxV2/components/mapTopic.cjs +1 -1
- package/dist/mapboxV2/components/mapTopic.mjs +349 -446
- package/dist/mapboxV2/constant.cjs +1 -1
- package/dist/mapboxV2/constant.mjs +13 -17
- package/dist/mapboxV2/useTif.cjs +1 -1
- package/dist/mapboxV2/useTif.mjs +86 -86
- package/dist/mapboxV2/utils.cjs +1 -1
- package/dist/mapboxV2/utils.mjs +362 -279
- package/dist/mapboxV2/widgets/CustomShapeDialog.cjs +1 -1
- package/dist/mapboxV2/widgets/CustomShapeDialog.mjs +87 -67
- package/dist/mapboxV2/widgets/IconPicker.cjs +1 -1
- package/dist/mapboxV2/widgets/IconPicker.mjs +59 -48
- package/dist/mapboxV2/widgets/LayerAttributeDialog.cjs +1 -1
- package/dist/mapboxV2/widgets/LayerAttributeDialog.mjs +17 -18
- package/dist/mapboxV2/widgets/LayerDialog.cjs +1 -1
- package/dist/mapboxV2/widgets/LayerDialog.mjs +94 -86
- package/dist/mapboxV2/widgets/LegendDialogLine.cjs +1 -1
- package/dist/mapboxV2/widgets/LegendDialogLine.mjs +95 -90
- package/dist/mapboxV2/widgets/LegendDialogPoint.cjs +1 -1
- package/dist/mapboxV2/widgets/LegendDialogPoint.mjs +90 -85
- package/dist/mapboxV2/widgets/LegendLine.cjs +1 -1
- package/dist/mapboxV2/widgets/LegendLine.mjs +28 -61
- package/dist/mapboxV2/widgets/LegendPoint.cjs +1 -1
- package/dist/mapboxV2/widgets/LegendPoint.mjs +52 -66
- package/dist/mapboxV2/widgets/LegendPopInterestPoint.cjs +1 -1
- package/dist/mapboxV2/widgets/LegendPopInterestPoint.mjs +16 -18
- package/dist/mapboxV2/widgets/LegendPopLine.cjs +1 -1
- package/dist/mapboxV2/widgets/LegendPopLine.mjs +72 -73
- package/dist/mapboxV2/widgets/LegendPopPoint.cjs +1 -1
- package/dist/mapboxV2/widgets/LegendPopPoint.mjs +113 -112
- package/dist/mapboxV2/widgets/LegendShape.cjs +1 -1
- package/dist/mapboxV2/widgets/LegendShape.mjs +17 -14
- package/dist/mapboxV2/widgets/LegendSymbol.cjs +1 -1
- package/dist/mapboxV2/widgets/LegendSymbol.mjs +5 -5
- package/dist/mapboxV2/widgets/ShapeDialog.cjs +1 -1
- package/dist/mapboxV2/widgets/ShapeDialog.mjs +1663 -1422
- package/dist/mapboxV2/widgets/TopicItemPop.cjs +1 -1
- package/dist/mapboxV2/widgets/TopicItemPop.mjs +2 -2
- package/dist/mapboxV2/widgets/TopicPop.mjs +1 -1
- package/dist/mapboxV2.cjs +3 -3
- package/dist/mapboxV2.mjs +673 -824
- package/dist/qy-vue-plugins.css +1 -1
- package/dist/types/apply-element-plus-theme.d.ts +1 -0
- package/dist/types/element-plus-style.d.ts +0 -0
- package/dist/types/manageTable/manageTable.vue.d.ts +2 -2
- package/dist/types/mapboxV2/MapView.vue.d.ts +130 -3
- package/dist/types/mapboxV2/components/mapTopic.vue.d.ts +10 -591
- package/dist/types/mapboxV2/types/map-layer.d.ts +185 -3
- package/dist/types/mapboxV2/useTif.d.ts +2 -2
- package/dist/types/mapboxV2/utils/geojsonRenderer.d.ts +123 -0
- package/dist/types/mapboxV2/utils.d.ts +5 -0
- package/dist/types/mapboxV2/widgets/IconPicker.vue.d.ts +8 -10
- package/dist/types/mapboxV2/widgets/index.d.ts +3 -0
- package/dist/types/mapboxV2/widgets/track/TrackImageDialog.vue.d.ts +11 -0
- package/dist/types/mapboxV2/widgets/track/TrackTextDialog.vue.d.ts +11 -0
- package/dist/types/mapboxV2/widgets/track/TrackVoiceDialog.vue.d.ts +11 -0
- package/dist/types/mapboxV2/widgets/track/index.d.ts +3 -0
- package/dist/types/store/mapStore.d.ts +122 -0
- package/dist/types/types/map.d.ts +111 -7
- package/package/apply-element-plus-theme.ts +23 -0
- package/package/css/common.scss +33 -0
- package/package/css/element-plus-theme.scss +30 -0
- package/package/css/map.scss +42 -0
- package/package/element-plus-style.ts +48 -0
- package/package/manageTable/index.ts +5 -0
- package/package/mapbox/index.ts +5 -0
- package/package/mapboxV2/constant.ts +4 -12
- package/package/mapboxV2/index.ts +5 -0
- package/package/mapboxV2/useTif.ts +18 -13
- package/package/mapboxV2/utils.ts +303 -143
- package/package/mapboxV2/widgets/index.ts +5 -0
- package/package/types/map.ts +129 -32
- package/package.json +27 -3
- package/dist/chunks/ReplaceSpeciesNameDialog.vue_vue_type_script_setup_true_lang-DnYed7Kh.js +0 -1
- package/dist/chunks/aria-B-Cm8P6h.js +0 -5
- package/dist/chunks/aria-GiGFrmP1.js +0 -175
- package/dist/chunks/constant-mXEWtcQf.js +0 -1
- package/dist/chunks/el-button-w9UOZkmd.js +0 -3
- package/dist/chunks/el-color-picker-panel-BWjyXHBz.js +0 -1
- package/dist/chunks/el-color-picker-panel-BfOVWDkH.js +0 -1024
- package/dist/chunks/el-form-item-ECXS8pAs.js +0 -12
- package/dist/chunks/el-input-tAiZBp5N.js +0 -1
- package/dist/chunks/el-loading-BDhLUhme.js +0 -1
- package/dist/chunks/el-overlay-BEd31jh6.js +0 -1
- package/dist/chunks/el-popper-C6hJmTeX.js +0 -1
- package/dist/chunks/el-select-BXP0YqqB.js +0 -1
- package/dist/chunks/index-BIPr63lF.js +0 -1
- package/dist/chunks/index-BIaoqnN4.js +0 -1
- package/dist/chunks/index-D9eecDRK.js +0 -2
- package/dist/chunks/mapSetting-BRasGCqk.js +0 -597
- package/dist/chunks/mapSetting-CfE-5SCc.js +0 -1
- package/dist/chunks/use-global-config-y6gk28OO.js +0 -1
- package/dist/chunks/utils-CZxmwfl_.js +0 -1
- package/dist/chunks/utils-n1i0zWzc.js +0 -454
- package/dist/chunks/vnode-CyTnPoXJ.js +0 -47
- package/dist/chunks/vnode-eKMqbqaC.js +0 -1
- package/dist/chunks//346/255/243/344/270/211/350/247/222/345/275/242-BRUTHTNe.js +0 -12
- package/dist/chunks//346/255/243/344/270/211/350/247/222/345/275/242-CksusXxb.js +0 -28
- package/dist/chunks//346/255/243/344/270/211/350/247/222/345/275/242-DchJeGnp.js +0 -1
- package/dist/chunks//346/255/243/344/270/211/350/247/222/345/275/242-yXKDlNvO.js +0 -17
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
import { useId as L } from "vue";
|
|
2
|
+
import { d, a as w } from "./constant-E83OJqPQ.js";
|
|
3
|
+
function z(i, e) {
|
|
4
|
+
let t = {
|
|
5
|
+
marginTop: "-2px"
|
|
6
|
+
};
|
|
7
|
+
switch (i) {
|
|
8
|
+
case "solid":
|
|
9
|
+
case "solid-line":
|
|
10
|
+
t.borderBottom = `4px solid ${e}`;
|
|
11
|
+
break;
|
|
12
|
+
case "dash":
|
|
13
|
+
case "dotted":
|
|
14
|
+
case "simple-dash":
|
|
15
|
+
t.borderBottom = `4px dashed ${e}`;
|
|
16
|
+
break;
|
|
17
|
+
case "dot-dash":
|
|
18
|
+
t.backgroundImage = `linear-gradient(to right, ${e} 25%, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, 0) 50%, ${e} 50%, ${e} 75%, rgba(255, 255, 255, 0) 75%)`;
|
|
19
|
+
break;
|
|
20
|
+
case "long-dash":
|
|
21
|
+
t.backgroundImage = `linear-gradient(to right, ${e} 50%, rgba(255, 255, 255, 0) 50%)`;
|
|
22
|
+
break;
|
|
23
|
+
case "dot-line":
|
|
24
|
+
t.backgroundImage = `linear-gradient(to right, ${e} 25%, rgba(255, 255, 255, 0) 10%)`;
|
|
25
|
+
break;
|
|
26
|
+
case "complex-pattern":
|
|
27
|
+
t.backgroundImage = `linear-gradient(to right, ${e} 20%, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0) 40%, ${e} 40%, ${e} 60%, rgba(255, 255, 255, 0) 60%)`;
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
t.borderBottom = `4px solid ${e}`;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
return t;
|
|
34
|
+
}
|
|
35
|
+
function F(i, e) {
|
|
36
|
+
if (i && typeof i != "string")
|
|
37
|
+
return i;
|
|
38
|
+
switch (e) {
|
|
39
|
+
case "symbol":
|
|
40
|
+
// 符号图层
|
|
41
|
+
case "geojson":
|
|
42
|
+
case "species-group":
|
|
43
|
+
// 物种组图层
|
|
44
|
+
case "sample-group":
|
|
45
|
+
// 样地样线分组
|
|
46
|
+
case "track":
|
|
47
|
+
// 调查轨迹
|
|
48
|
+
case "interest-point":
|
|
49
|
+
return i ? JSON.parse(i || "{}") : w;
|
|
50
|
+
case "point":
|
|
51
|
+
return JSON.parse(i || "{}");
|
|
52
|
+
case "line":
|
|
53
|
+
return JSON.parse(i || "{}");
|
|
54
|
+
case "shape":
|
|
55
|
+
// 形状图层
|
|
56
|
+
case "shp":
|
|
57
|
+
// SHP 文件图层
|
|
58
|
+
case "kml":
|
|
59
|
+
// KML 文件图层
|
|
60
|
+
case "kmz":
|
|
61
|
+
// KMZ 文件图层
|
|
62
|
+
case "tif":
|
|
63
|
+
return i ? JSON.parse(i || "{}") : d;
|
|
64
|
+
default:
|
|
65
|
+
throw new Error(`Unsupported layer type: ${e}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function T(i) {
|
|
69
|
+
try {
|
|
70
|
+
return `layer-id-${i.id}`;
|
|
71
|
+
} catch (e) {
|
|
72
|
+
return console.error("Error getting layer ID:", e), `layer-id-${L()}`;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function M(i) {
|
|
76
|
+
try {
|
|
77
|
+
return `source-id-${i.id}`;
|
|
78
|
+
} catch (e) {
|
|
79
|
+
return console.error("Error getting source ID:", e), `source-id-${L()}`;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function N(i) {
|
|
83
|
+
try {
|
|
84
|
+
const e = i.layerPaintConfig ? JSON.parse(i.layerPaintConfig) : d;
|
|
85
|
+
if (e && typeof e == "object") {
|
|
86
|
+
const t = e, l = {
|
|
87
|
+
...d,
|
|
88
|
+
...t
|
|
89
|
+
}, u = Array.isArray(t.symbolConfigList) ? t.symbolConfigList : [], s = Array.isArray(t.circleConfigList) ? t.circleConfigList : [];
|
|
90
|
+
return !u.length && s.length && (l.symbolConfigList = JSON.parse(JSON.stringify(s))), !s.length && u.length && (l.circleConfigList = JSON.parse(JSON.stringify(u))), (!Array.isArray(l.fillColorList) || l.fillColorList.length === 0) && (l.fillColorList = JSON.parse(JSON.stringify(d.fillColorList || []))), (!Array.isArray(l.outlineConfigList) || l.outlineConfigList.length === 0) && (l.outlineConfigList = JSON.parse(JSON.stringify(d.outlineConfigList || []))), (!Array.isArray(l.symbolConfigList) || l.symbolConfigList.length === 0) && (l.symbolConfigList = JSON.parse(JSON.stringify(d.symbolConfigList || []))), (!Array.isArray(l.circleConfigList) || l.circleConfigList.length === 0) && (l.circleConfigList = JSON.parse(JSON.stringify(d.circleConfigList || []))), (!l.fillOpacityConfig || typeof l.fillOpacityConfig.value != "number") && (l.fillOpacityConfig = JSON.parse(JSON.stringify(d.fillOpacityConfig || { value: 1 }))), l;
|
|
91
|
+
}
|
|
92
|
+
return d;
|
|
93
|
+
} catch {
|
|
94
|
+
return d;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const C = (i) => {
|
|
98
|
+
const e = i.symbolConfigList, t = i.circleConfigList;
|
|
99
|
+
return Array.isArray(e) && e.length > 0 ? JSON.parse(JSON.stringify(e)) : Array.isArray(t) && t.length > 0 ? JSON.parse(JSON.stringify(t)) : JSON.parse(JSON.stringify(d.circleConfigList || []));
|
|
100
|
+
};
|
|
101
|
+
function E(i) {
|
|
102
|
+
let e = "fill";
|
|
103
|
+
switch (i.layerType) {
|
|
104
|
+
case "shp":
|
|
105
|
+
case "kml":
|
|
106
|
+
case "kmz":
|
|
107
|
+
if (i.layerShapes) {
|
|
108
|
+
const t = i.layerShapes.split(",").map((l) => l.trim().toLowerCase());
|
|
109
|
+
t.length === 1 ? t[0] === "point" ? e = "circle" : t[0] === "line" ? e = "line" : e = "fill" : e = "fill";
|
|
110
|
+
} else
|
|
111
|
+
e = "fill";
|
|
112
|
+
break;
|
|
113
|
+
case "line":
|
|
114
|
+
e = "line";
|
|
115
|
+
break;
|
|
116
|
+
case "symbol":
|
|
117
|
+
if (e = "circle", i.layerPaintConfig) {
|
|
118
|
+
const t = JSON.parse(i.layerPaintConfig), l = t.symbolConfigList || t.circleConfigList;
|
|
119
|
+
l && l?.length > 0 && l[0].circleType == "symbol" && (e = "symbol");
|
|
120
|
+
}
|
|
121
|
+
break;
|
|
122
|
+
default:
|
|
123
|
+
e = "fill";
|
|
124
|
+
}
|
|
125
|
+
return e;
|
|
126
|
+
}
|
|
127
|
+
function A(i) {
|
|
128
|
+
try {
|
|
129
|
+
let e = {}, t = JSON.parse(JSON.stringify(i.fillColorList));
|
|
130
|
+
const l = t.find((n) => n.type === "default"), u = t.filter((n) => n.type === "custom");
|
|
131
|
+
l && (t = [...u, l]), console.log("[getFillStyle] 排序后的 fillColorList:", t);
|
|
132
|
+
let s = t.filter((n) => n.type === "custom" ? n.key && n.value : !0);
|
|
133
|
+
const f = s[s.length - 1];
|
|
134
|
+
if (!f || f.type !== "default")
|
|
135
|
+
return console.warn("[getFillStyle] 未找到默认配置,使用系统默认颜色"), e["fill-color"] = "rgba(103, 194, 58, 0.6)", e["fill-outline-color"] = "rgba(103, 194, 58, 1)", e;
|
|
136
|
+
console.log("[getFillStyle] 默认颜色配置:", f);
|
|
137
|
+
let r = [];
|
|
138
|
+
if (s.forEach((n) => {
|
|
139
|
+
if (n.type == "custom") {
|
|
140
|
+
let a = -1;
|
|
141
|
+
r.forEach((o, c) => {
|
|
142
|
+
o.key == n.key && (a = c);
|
|
143
|
+
}), a > -1 ? r[a].list.push(n) : r.push({
|
|
144
|
+
key: n.key,
|
|
145
|
+
list: [n]
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}), console.log("[getFillStyle] fillColorGroupList:", r), r.length > 0) {
|
|
149
|
+
let n = f.color;
|
|
150
|
+
[...r].reverse().forEach((a) => {
|
|
151
|
+
const o = [
|
|
152
|
+
"match",
|
|
153
|
+
["to-string", ["get", a.key]]
|
|
154
|
+
];
|
|
155
|
+
a.list.forEach((c) => {
|
|
156
|
+
o.push(String(c.value)), o.push(c.color);
|
|
157
|
+
}), o.push(n), n = o;
|
|
158
|
+
}), e["fill-color"] = n, console.log("[getFillStyle] 使用条件渲染,colorExpression:", n);
|
|
159
|
+
} else
|
|
160
|
+
e["fill-color"] = f.color, console.log("[getFillStyle] 使用单一颜色:", f.color);
|
|
161
|
+
return e["fill-outline-color"] = f.color, e["fill-opacity"] = i?.fillOpacityConfig?.value ?? 1, console.log("[getFillStyle] 生成 fillStyle 成功:", e), e;
|
|
162
|
+
} catch (e) {
|
|
163
|
+
console.log("[getFillStyle] 生成 fillStyle 失败:", e);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function B(i) {
|
|
167
|
+
if (!i || !i.showLabel)
|
|
168
|
+
return null;
|
|
169
|
+
const e = {
|
|
170
|
+
// 设置标注文本字段
|
|
171
|
+
"text-field": ["get", i.labelField || "FID"],
|
|
172
|
+
// 设置字体大小
|
|
173
|
+
"text-size": i.fontSize || 14,
|
|
174
|
+
// 设置字体颜色
|
|
175
|
+
"text-color": i.fontColor || "#000000",
|
|
176
|
+
// 设置字体 - 使用 Mapbox 默认字体
|
|
177
|
+
"text-font": ["Open Sans Regular"],
|
|
178
|
+
// 文本锚点设置为多边形中心
|
|
179
|
+
"text-anchor": "center",
|
|
180
|
+
// 文本偏移,让文字居中显示
|
|
181
|
+
"text-offset": [0, 0],
|
|
182
|
+
// 允许文本重叠
|
|
183
|
+
"text-allow-overlap": !1,
|
|
184
|
+
// 避免文本被边缘裁剪
|
|
185
|
+
"text-avoid-edges": !0
|
|
186
|
+
};
|
|
187
|
+
return console.log("生成labelStyle成功---->", e), e;
|
|
188
|
+
}
|
|
189
|
+
function J(i) {
|
|
190
|
+
try {
|
|
191
|
+
let { outlineConfigList: e } = i;
|
|
192
|
+
if (!e || e.length === 0)
|
|
193
|
+
return console.warn("[getOutLineStyle] outlineConfigList 为空,使用默认样式"), {
|
|
194
|
+
"line-color": "rgba(103, 194, 58, 1)",
|
|
195
|
+
"line-width": 2,
|
|
196
|
+
"line-dasharray": ["literal", []]
|
|
197
|
+
};
|
|
198
|
+
let t = JSON.parse(JSON.stringify(e));
|
|
199
|
+
const l = t.find((n) => n.type === "default"), u = t.filter((n) => n.type === "custom");
|
|
200
|
+
l && (t = [...u, l]);
|
|
201
|
+
const s = t[t.length - 1];
|
|
202
|
+
if (!s || s.type !== "default")
|
|
203
|
+
return console.warn("[getOutLineStyle] 未找到默认配置,使用系统默认值"), {
|
|
204
|
+
"line-color": "rgba(103, 194, 58, 1)",
|
|
205
|
+
"line-width": 1
|
|
206
|
+
};
|
|
207
|
+
let f = {
|
|
208
|
+
"line-color": s.outlineColor || "rgba(103, 194, 58, 1)",
|
|
209
|
+
"line-width": s.outlineWidth ?? 1
|
|
210
|
+
};
|
|
211
|
+
s.lineStyle === "dash" ? f["line-dasharray"] = [2, 2] : f["line-dasharray"] = ["literal", []];
|
|
212
|
+
let r = [];
|
|
213
|
+
if (t.forEach((n) => {
|
|
214
|
+
if (n.type === "custom" && n.key && n.value) {
|
|
215
|
+
let a = -1;
|
|
216
|
+
r.forEach((o, c) => {
|
|
217
|
+
o.key === n.key && (a = c);
|
|
218
|
+
}), a > -1 ? r[a].list.push(n) : r.push({
|
|
219
|
+
key: n.key,
|
|
220
|
+
list: [n]
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}), r.length > 0 && (["line-color", "line-width"].forEach((a) => {
|
|
224
|
+
const o = a === "line-color" ? "outlineColor" : "outlineWidth";
|
|
225
|
+
if (r.some((g) => g.list.some((h) => h[o] !== void 0))) {
|
|
226
|
+
const g = [
|
|
227
|
+
"match",
|
|
228
|
+
["to-string", ["get", r[0].key]]
|
|
229
|
+
];
|
|
230
|
+
r.forEach((h) => {
|
|
231
|
+
h.list.forEach((p) => {
|
|
232
|
+
p.value !== void 0 && p[o] !== void 0 && (g.push(String(p.value)), g.push(p[o]));
|
|
233
|
+
});
|
|
234
|
+
}), g.push(l[o] ?? f[a]), f[a] = g;
|
|
235
|
+
}
|
|
236
|
+
}), r.some((a) => a.list.some((o) => o.lineStyle !== void 0)))) {
|
|
237
|
+
const a = [
|
|
238
|
+
"match",
|
|
239
|
+
["to-string", ["get", r[0].key]]
|
|
240
|
+
];
|
|
241
|
+
r.forEach((o) => {
|
|
242
|
+
o.list.forEach((c) => {
|
|
243
|
+
c.value !== void 0 && c.lineStyle && (a.push(String(c.value)), a.push(c.lineStyle === "dash" ? [2, 2] : ["literal", []]));
|
|
244
|
+
});
|
|
245
|
+
}), a.push(l.lineStyle === "dash" ? [2, 2] : ["literal", []]), f["line-dasharray"] = a;
|
|
246
|
+
}
|
|
247
|
+
return f;
|
|
248
|
+
} catch (e) {
|
|
249
|
+
return console.log("生成outlineStyle失败", e), {
|
|
250
|
+
"line-color": "rgba(103, 194, 58, 1)",
|
|
251
|
+
"line-width": 2,
|
|
252
|
+
"line-dasharray": []
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
function I(i) {
|
|
257
|
+
let e = C(i), t = JSON.parse(JSON.stringify(e));
|
|
258
|
+
const l = t.find((o) => o.type === "default"), u = t.filter((o) => o.type === "custom");
|
|
259
|
+
l && (t = [...u, l]), console.log("[getCircleStyle] 排序后的 circleConfigList:", t);
|
|
260
|
+
const s = t[t.length - 1], f = s && (s.renderMode === "color" || s.renderMode === "icon");
|
|
261
|
+
if (!s || s.type !== "default")
|
|
262
|
+
return console.warn("[getCircleStyle] 未找到默认配置,使用系统默认值"), {
|
|
263
|
+
_useNewFormat: !0,
|
|
264
|
+
_circleConfigList: [
|
|
265
|
+
{
|
|
266
|
+
type: "default",
|
|
267
|
+
renderMode: "color",
|
|
268
|
+
pointStyle: "118",
|
|
269
|
+
pointTintColor: "rgba(103, 194, 58, 0.6)",
|
|
270
|
+
pointSize: 2
|
|
271
|
+
}
|
|
272
|
+
],
|
|
273
|
+
"icon-image": "custom-icon-default-118-1031945806",
|
|
274
|
+
"icon-size": 1
|
|
275
|
+
};
|
|
276
|
+
if (console.log("[getCircleStyle] 默认配置:", s), f) {
|
|
277
|
+
const o = {
|
|
278
|
+
_useNewFormat: !0,
|
|
279
|
+
// 标记使用了新格式
|
|
280
|
+
_circleConfigList: t
|
|
281
|
+
// 保存完整配置列表供后续使用
|
|
282
|
+
};
|
|
283
|
+
o["icon-image"] = [], o["icon-size"] = [];
|
|
284
|
+
const c = t.filter((g) => g.type === "custom" && g.value !== "" && g.value != null);
|
|
285
|
+
if (c.length > 0) {
|
|
286
|
+
const g = c[0].key;
|
|
287
|
+
let h = "string";
|
|
288
|
+
for (const y of c)
|
|
289
|
+
if (typeof y.value == "number") {
|
|
290
|
+
h = "number";
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
const p = (y) => h === "number" ? typeof y == "number" ? y : Number(y) : String(y), m = ["match", ["get", g]];
|
|
294
|
+
c.forEach((y) => {
|
|
295
|
+
let k;
|
|
296
|
+
if (y.renderMode === "color") {
|
|
297
|
+
const O = (y.pointTintColor || "rgba(103, 194, 58, 1)").replace(/[^a-zA-Z0-9]/g, "");
|
|
298
|
+
k = `custom-icon-${y.key}-${y.pointStyle || ""}-${O}`;
|
|
299
|
+
} else
|
|
300
|
+
k = y.pointStyle || "";
|
|
301
|
+
m.push(p(y.value)), m.push(k);
|
|
302
|
+
});
|
|
303
|
+
let b;
|
|
304
|
+
if (s.renderMode === "color") {
|
|
305
|
+
const y = (s.pointTintColor || "#67c23a").replace(/[^a-zA-Z0-9]/g, "");
|
|
306
|
+
b = `custom-icon-default-${s.pointStyle || ""}-${y}`;
|
|
307
|
+
} else
|
|
308
|
+
b = s.pointStyle || "";
|
|
309
|
+
m.push(b), o["icon-image"] = m;
|
|
310
|
+
const S = ["match", ["get", g]];
|
|
311
|
+
c.forEach((y) => {
|
|
312
|
+
S.push(p(y.value)), S.push((y.pointSize || 10) / 20);
|
|
313
|
+
}), S.push((s.pointSize || 10) / 20), o["icon-size"] = S;
|
|
314
|
+
} else {
|
|
315
|
+
let g;
|
|
316
|
+
if (s.renderMode === "color") {
|
|
317
|
+
const h = (s.pointTintColor || "#67c23a").replace(/[^a-zA-Z0-9]/g, "");
|
|
318
|
+
g = `custom-icon-default-${s.pointStyle || ""}-${h}`;
|
|
319
|
+
} else
|
|
320
|
+
g = s.pointStyle || "";
|
|
321
|
+
o["icon-image"] = g, o["icon-size"] = (s.pointSize || 10) / 20;
|
|
322
|
+
}
|
|
323
|
+
return o;
|
|
324
|
+
}
|
|
325
|
+
const r = {
|
|
326
|
+
"circle-radius": [],
|
|
327
|
+
"circle-stroke-width": [],
|
|
328
|
+
"circle-color": [],
|
|
329
|
+
"circle-stroke-color": [],
|
|
330
|
+
"icon-image": []
|
|
331
|
+
};
|
|
332
|
+
e = [...e];
|
|
333
|
+
const n = e[e.length - 1];
|
|
334
|
+
e.splice(e.length - 1, 1), r["circle-radius"] = [n.circleRadius], r["circle-stroke-width"] = [n.circleStrokeWidth], r["circle-color"] = [n.circleColor], r["circle-stroke-color"] = [n.circleStrokeColor], r["icon-image"] = [
|
|
335
|
+
n.iconImageUrl || ""
|
|
336
|
+
];
|
|
337
|
+
let a = [];
|
|
338
|
+
return e.forEach((o) => {
|
|
339
|
+
if (o.type == "custom") {
|
|
340
|
+
let c = -1;
|
|
341
|
+
a.forEach((g, h) => {
|
|
342
|
+
g.key == o.key && (c = h);
|
|
343
|
+
}), c > -1 ? a[c].list.push(o) : a.push({
|
|
344
|
+
key: o.key,
|
|
345
|
+
list: [o]
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
}), a.forEach((o) => {
|
|
349
|
+
n.circleType != "symbol" && (o.list.forEach((c) => {
|
|
350
|
+
r["circle-radius"].unshift(c.circleRadius), r["circle-radius"].unshift(c.value);
|
|
351
|
+
}), r["circle-radius"].unshift(["get", o.key]), r["circle-radius"].unshift("match"), o.list.forEach((c) => {
|
|
352
|
+
r["circle-stroke-width"].unshift(c.circleStrokeWidth), r["circle-stroke-width"].unshift(c.value);
|
|
353
|
+
}), r["circle-stroke-width"].unshift([
|
|
354
|
+
"get",
|
|
355
|
+
o.key
|
|
356
|
+
]), r["circle-stroke-width"].unshift("match"), o.list.forEach((c) => {
|
|
357
|
+
r["circle-color"].unshift(c.circleColor), r["circle-color"].unshift(c.value);
|
|
358
|
+
}), r["circle-color"].unshift(["get", o.key]), r["circle-color"].unshift("match"), o.list.forEach((c) => {
|
|
359
|
+
r["circle-stroke-color"].unshift(c.circleStrokeColor), r["circle-stroke-color"].unshift(c.value);
|
|
360
|
+
}), r["circle-stroke-color"].unshift([
|
|
361
|
+
"get",
|
|
362
|
+
o.key
|
|
363
|
+
]), r["circle-stroke-color"].unshift("match")), n.circleType == "symbol" && (o.list.forEach((c) => {
|
|
364
|
+
r["icon-image"].unshift(c.iconImageUrl || ""), r["icon-image"].unshift(c.value);
|
|
365
|
+
}), r["icon-image"].unshift(["get", o.key]), r["icon-image"].unshift("match"));
|
|
366
|
+
}), e.length == 0 && (r["circle-radius"] = r["circle-radius"][0], r["circle-stroke-width"] = r["circle-stroke-width"][0], r["circle-color"] = r["circle-color"][0], r["circle-stroke-color"] = r["circle-stroke-color"][0], r["icon-image"] = r["icon-image"][0]), r;
|
|
367
|
+
}
|
|
368
|
+
function x(i) {
|
|
369
|
+
let e = C(i);
|
|
370
|
+
const t = {
|
|
371
|
+
"icon-image": []
|
|
372
|
+
}, l = e[e.length - 1];
|
|
373
|
+
e = e.slice(0, -1), t["icon-image"] = [
|
|
374
|
+
l.iconImageUrl || ""
|
|
375
|
+
];
|
|
376
|
+
let u = [];
|
|
377
|
+
return e.forEach((s) => {
|
|
378
|
+
if (s.type == "custom") {
|
|
379
|
+
let f = -1;
|
|
380
|
+
u.forEach((r, n) => {
|
|
381
|
+
r.key == s.key && (f = n);
|
|
382
|
+
}), f > -1 ? u[f].list.push(s) : u.push({
|
|
383
|
+
key: s.key,
|
|
384
|
+
list: [s]
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
}), u.forEach((s) => {
|
|
388
|
+
l.circleType == "symbol" && (s.list.forEach((f) => {
|
|
389
|
+
t["icon-image"].unshift(f.iconImageUrl || ""), t["icon-image"].unshift(f.value);
|
|
390
|
+
}), t["icon-image"].unshift(["get", s.key]), t["icon-image"].unshift("match"));
|
|
391
|
+
}), e.length == 0 && (t["icon-image"] = t["icon-image"][0]), t;
|
|
392
|
+
}
|
|
393
|
+
function U(i) {
|
|
394
|
+
const e = N(i), t = E(i), l = {
|
|
395
|
+
"fill-color": "rgba(103, 194, 58, 0.6)",
|
|
396
|
+
// 默认填充颜色为浅绿色,半透明
|
|
397
|
+
"fill-opacity": 1,
|
|
398
|
+
// 默认填充透明度为1
|
|
399
|
+
"fill-outline-color": "rgba(103, 194, 58, 1)"
|
|
400
|
+
// 默认轮廓颜色为绿色,不透明
|
|
401
|
+
}, u = {
|
|
402
|
+
"line-width": 2,
|
|
403
|
+
// 默认线宽为2像素(与 LayerStyleEditDialog 保持一致)
|
|
404
|
+
"line-color": "rgba(103, 194, 58, 1)"
|
|
405
|
+
// 默认线颜色为绿色,不透明
|
|
406
|
+
}, s = {
|
|
407
|
+
"circle-radius": ["interpolate", ["linear"], ["zoom"], 1, 6, 10, 8, 22, 12],
|
|
408
|
+
// 根据缩放级别调整圆点半径
|
|
409
|
+
"circle-stroke-width": [
|
|
410
|
+
"interpolate",
|
|
411
|
+
["linear"],
|
|
412
|
+
["zoom"],
|
|
413
|
+
1,
|
|
414
|
+
2,
|
|
415
|
+
10,
|
|
416
|
+
5,
|
|
417
|
+
22,
|
|
418
|
+
10
|
|
419
|
+
],
|
|
420
|
+
// 根据缩放级别调整描边宽度
|
|
421
|
+
"circle-stroke-color": [
|
|
422
|
+
"interpolate",
|
|
423
|
+
["linear"],
|
|
424
|
+
["zoom"],
|
|
425
|
+
0,
|
|
426
|
+
"rgba(103, 194, 58, 0.6)",
|
|
427
|
+
22,
|
|
428
|
+
"rgba(103, 194, 58, 0.6)"
|
|
429
|
+
],
|
|
430
|
+
// 根据缩放级别调整描边颜色
|
|
431
|
+
"circle-stroke-opacity": ["interpolate", ["linear"], ["zoom"], 0, 1, 22, 1],
|
|
432
|
+
// 根据缩放级别调整描边透明度
|
|
433
|
+
"circle-color": "rgba(103, 194, 58, 0.6)"
|
|
434
|
+
// 默认圆点颜色为浅绿色,半透明
|
|
435
|
+
};
|
|
436
|
+
if (!e)
|
|
437
|
+
switch (console.warn("当前图层样式配置不存在,使用默认样式,还有执行到这里的情况?"), t) {
|
|
438
|
+
case "fill":
|
|
439
|
+
return l;
|
|
440
|
+
case "line":
|
|
441
|
+
return u;
|
|
442
|
+
case "circle":
|
|
443
|
+
return s;
|
|
444
|
+
}
|
|
445
|
+
switch (t) {
|
|
446
|
+
case "fill":
|
|
447
|
+
const f = A(e);
|
|
448
|
+
return f || l;
|
|
449
|
+
case "line":
|
|
450
|
+
const r = J(e);
|
|
451
|
+
return r || u;
|
|
452
|
+
case "circle":
|
|
453
|
+
const n = I(e);
|
|
454
|
+
return n || s;
|
|
455
|
+
case "symbol":
|
|
456
|
+
const a = x(e);
|
|
457
|
+
return a || {
|
|
458
|
+
"icon-image": ""
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
function W(i) {
|
|
463
|
+
return new Promise((e, t) => {
|
|
464
|
+
const l = new FileReader();
|
|
465
|
+
l.onload = () => {
|
|
466
|
+
l.result instanceof ArrayBuffer ? e(l.result) : t(new Error("Failed to read file as ArrayBuffer"));
|
|
467
|
+
}, l.onerror = t, l.readAsArrayBuffer(i);
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
function D(i) {
|
|
471
|
+
const e = i.fileDirectory || {}, t = e.ModelTiepoint || [], l = e.ModelPixelScale || [];
|
|
472
|
+
if (t.length >= 6 && l.length >= 3) {
|
|
473
|
+
console.log("情况1:使用ModelTiepoint和ModelPixelScale计算边界", t, l);
|
|
474
|
+
const u = t[3], s = t[4], f = l[0], r = l[1], n = i.getWidth(), a = i.getHeight(), o = u, c = s, g = u + n * f, h = s - a * Math.abs(r);
|
|
475
|
+
return [o, h, g, c];
|
|
476
|
+
} else if (e.ModelTransformation) {
|
|
477
|
+
console.log("情况2:使用ModelTransformation矩阵计算边界");
|
|
478
|
+
const u = e.ModelTransformation;
|
|
479
|
+
if (u && u.length >= 16) {
|
|
480
|
+
const s = i.getWidth(), f = i.getHeight(), r = u[3], n = u[7], a = r + s * u[0], o = n + f * u[5];
|
|
481
|
+
return [r, n, a, o];
|
|
482
|
+
}
|
|
483
|
+
} else if (e.GeographicTypeGeoKey)
|
|
484
|
+
return console.warn("Limited geographic information. Using approximated bounds."), [-180, -90, 180, 90];
|
|
485
|
+
return console.warn("No geographic reference found. Using default bounds."), [-180, -90, 180, 90];
|
|
486
|
+
}
|
|
487
|
+
function R(i) {
|
|
488
|
+
i = i.replace(/^#/, "");
|
|
489
|
+
let e = 0, t = 0, l = 0;
|
|
490
|
+
return i.length === 3 ? (e = parseInt(i.charAt(0) + i.charAt(0), 16), t = parseInt(i.charAt(1) + i.charAt(1), 16), l = parseInt(i.charAt(2) + i.charAt(2), 16)) : i.length === 6 && (e = parseInt(i.substring(0, 2), 16), t = parseInt(i.substring(2, 4), 16), l = parseInt(i.substring(4, 6), 16)), [e, t, l];
|
|
491
|
+
}
|
|
492
|
+
function P(i, e, t) {
|
|
493
|
+
return Math.max(e, Math.min(t, i));
|
|
494
|
+
}
|
|
495
|
+
function X(i, e) {
|
|
496
|
+
if (i)
|
|
497
|
+
return e.find((t) => t.id === i);
|
|
498
|
+
}
|
|
499
|
+
export {
|
|
500
|
+
P as a,
|
|
501
|
+
X as b,
|
|
502
|
+
D as c,
|
|
503
|
+
T as d,
|
|
504
|
+
E as e,
|
|
505
|
+
A as f,
|
|
506
|
+
z as g,
|
|
507
|
+
R as h,
|
|
508
|
+
J as i,
|
|
509
|
+
U as j,
|
|
510
|
+
B as k,
|
|
511
|
+
M as l,
|
|
512
|
+
N as m,
|
|
513
|
+
I as n,
|
|
514
|
+
F as p,
|
|
515
|
+
W as r
|
|
516
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const C=require("vue"),h=require("./constant-Bq4ASE9Q.js");function J(i,e){let t={marginTop:"-2px"};switch(i){case"solid":case"solid-line":t.borderBottom=`4px solid ${e}`;break;case"dash":case"dotted":case"simple-dash":t.borderBottom=`4px dashed ${e}`;break;case"dot-dash":t.backgroundImage=`linear-gradient(to right, ${e} 25%, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, 0) 50%, ${e} 50%, ${e} 75%, rgba(255, 255, 255, 0) 75%)`;break;case"long-dash":t.backgroundImage=`linear-gradient(to right, ${e} 50%, rgba(255, 255, 255, 0) 50%)`;break;case"dot-line":t.backgroundImage=`linear-gradient(to right, ${e} 25%, rgba(255, 255, 255, 0) 10%)`;break;case"complex-pattern":t.backgroundImage=`linear-gradient(to right, ${e} 20%, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0) 40%, ${e} 40%, ${e} 60%, rgba(255, 255, 255, 0) 60%)`;break;default:t.borderBottom=`4px solid ${e}`;break}return t}function x(i,e){if(i&&typeof i!="string")return i;switch(e){case"symbol":case"geojson":case"species-group":case"sample-group":case"track":case"interest-point":return i?JSON.parse(i||"{}"):h.defaultPointLayerPaintConfig;case"point":return JSON.parse(i||"{}");case"line":return JSON.parse(i||"{}");case"shape":case"shp":case"kml":case"kmz":case"tif":return i?JSON.parse(i||"{}"):h.defaultStyleConfig;default:throw new Error(`Unsupported layer type: ${e}`)}}function v(i){try{return`layer-id-${i.id}`}catch(e){return console.error("Error getting layer ID:",e),`layer-id-${C.useId()}`}}function $(i){try{return`source-id-${i.id}`}catch(e){return console.error("Error getting source ID:",e),`source-id-${C.useId()}`}}function k(i){try{const e=i.layerPaintConfig?JSON.parse(i.layerPaintConfig):h.defaultStyleConfig;if(e&&typeof e=="object"){const t=e,r={...h.defaultStyleConfig,...t},u=Array.isArray(t.symbolConfigList)?t.symbolConfigList:[],s=Array.isArray(t.circleConfigList)?t.circleConfigList:[];return!u.length&&s.length&&(r.symbolConfigList=JSON.parse(JSON.stringify(s))),!s.length&&u.length&&(r.circleConfigList=JSON.parse(JSON.stringify(u))),(!Array.isArray(r.fillColorList)||r.fillColorList.length===0)&&(r.fillColorList=JSON.parse(JSON.stringify(h.defaultStyleConfig.fillColorList||[]))),(!Array.isArray(r.outlineConfigList)||r.outlineConfigList.length===0)&&(r.outlineConfigList=JSON.parse(JSON.stringify(h.defaultStyleConfig.outlineConfigList||[]))),(!Array.isArray(r.symbolConfigList)||r.symbolConfigList.length===0)&&(r.symbolConfigList=JSON.parse(JSON.stringify(h.defaultStyleConfig.symbolConfigList||[]))),(!Array.isArray(r.circleConfigList)||r.circleConfigList.length===0)&&(r.circleConfigList=JSON.parse(JSON.stringify(h.defaultStyleConfig.circleConfigList||[]))),(!r.fillOpacityConfig||typeof r.fillOpacityConfig.value!="number")&&(r.fillOpacityConfig=JSON.parse(JSON.stringify(h.defaultStyleConfig.fillOpacityConfig||{value:1}))),r}return h.defaultStyleConfig}catch{return h.defaultStyleConfig}}const O=i=>{const e=i.symbolConfigList,t=i.circleConfigList;return Array.isArray(e)&&e.length>0?JSON.parse(JSON.stringify(e)):Array.isArray(t)&&t.length>0?JSON.parse(JSON.stringify(t)):JSON.parse(JSON.stringify(h.defaultStyleConfig.circleConfigList||[]))};function w(i){let e="fill";switch(i.layerType){case"shp":case"kml":case"kmz":if(i.layerShapes){const t=i.layerShapes.split(",").map(r=>r.trim().toLowerCase());t.length===1?t[0]==="point"?e="circle":t[0]==="line"?e="line":e="fill":e="fill"}else e="fill";break;case"line":e="line";break;case"symbol":if(e="circle",i.layerPaintConfig){const t=JSON.parse(i.layerPaintConfig),r=t.symbolConfigList||t.circleConfigList;r&&r?.length>0&&r[0].circleType=="symbol"&&(e="symbol")}break;default:e="fill"}return e}function N(i){try{let e={},t=JSON.parse(JSON.stringify(i.fillColorList));const r=t.find(n=>n.type==="default"),u=t.filter(n=>n.type==="custom");r&&(t=[...u,r]),console.log("[getFillStyle] 排序后的 fillColorList:",t);let s=t.filter(n=>n.type==="custom"?n.key&&n.value:!0);const f=s[s.length-1];if(!f||f.type!=="default")return console.warn("[getFillStyle] 未找到默认配置,使用系统默认颜色"),e["fill-color"]="rgba(103, 194, 58, 0.6)",e["fill-outline-color"]="rgba(103, 194, 58, 1)",e;console.log("[getFillStyle] 默认颜色配置:",f);let l=[];if(s.forEach(n=>{if(n.type=="custom"){let a=-1;l.forEach((o,c)=>{o.key==n.key&&(a=c)}),a>-1?l[a].list.push(n):l.push({key:n.key,list:[n]})}}),console.log("[getFillStyle] fillColorGroupList:",l),l.length>0){let n=f.color;[...l].reverse().forEach(a=>{const o=["match",["to-string",["get",a.key]]];a.list.forEach(c=>{o.push(String(c.value)),o.push(c.color)}),o.push(n),n=o}),e["fill-color"]=n,console.log("[getFillStyle] 使用条件渲染,colorExpression:",n)}else e["fill-color"]=f.color,console.log("[getFillStyle] 使用单一颜色:",f.color);return e["fill-outline-color"]=f.color,e["fill-opacity"]=i?.fillOpacityConfig?.value??1,console.log("[getFillStyle] 生成 fillStyle 成功:",e),e}catch(e){console.log("[getFillStyle] 生成 fillStyle 失败:",e)}}function F(i){if(!i||!i.showLabel)return null;const e={"text-field":["get",i.labelField||"FID"],"text-size":i.fontSize||14,"text-color":i.fontColor||"#000000","text-font":["Open Sans Regular"],"text-anchor":"center","text-offset":[0,0],"text-allow-overlap":!1,"text-avoid-edges":!0};return console.log("生成labelStyle成功---->",e),e}function A(i){try{let{outlineConfigList:e}=i;if(!e||e.length===0)return console.warn("[getOutLineStyle] outlineConfigList 为空,使用默认样式"),{"line-color":"rgba(103, 194, 58, 1)","line-width":2,"line-dasharray":["literal",[]]};let t=JSON.parse(JSON.stringify(e));const r=t.find(n=>n.type==="default"),u=t.filter(n=>n.type==="custom");r&&(t=[...u,r]);const s=t[t.length-1];if(!s||s.type!=="default")return console.warn("[getOutLineStyle] 未找到默认配置,使用系统默认值"),{"line-color":"rgba(103, 194, 58, 1)","line-width":1};let f={"line-color":s.outlineColor||"rgba(103, 194, 58, 1)","line-width":s.outlineWidth??1};s.lineStyle==="dash"?f["line-dasharray"]=[2,2]:f["line-dasharray"]=["literal",[]];let l=[];if(t.forEach(n=>{if(n.type==="custom"&&n.key&&n.value){let a=-1;l.forEach((o,c)=>{o.key===n.key&&(a=c)}),a>-1?l[a].list.push(n):l.push({key:n.key,list:[n]})}}),l.length>0&&(["line-color","line-width"].forEach(a=>{const o=a==="line-color"?"outlineColor":"outlineWidth";if(l.some(g=>g.list.some(d=>d[o]!==void 0))){const g=["match",["to-string",["get",l[0].key]]];l.forEach(d=>{d.list.forEach(p=>{p.value!==void 0&&p[o]!==void 0&&(g.push(String(p.value)),g.push(p[o]))})}),g.push(r[o]??f[a]),f[a]=g}}),l.some(a=>a.list.some(o=>o.lineStyle!==void 0)))){const a=["match",["to-string",["get",l[0].key]]];l.forEach(o=>{o.list.forEach(c=>{c.value!==void 0&&c.lineStyle&&(a.push(String(c.value)),a.push(c.lineStyle==="dash"?[2,2]:["literal",[]]))})}),a.push(r.lineStyle==="dash"?[2,2]:["literal",[]]),f["line-dasharray"]=a}return f}catch(e){return console.log("生成outlineStyle失败",e),{"line-color":"rgba(103, 194, 58, 1)","line-width":2,"line-dasharray":[]}}}function E(i){let e=O(i),t=JSON.parse(JSON.stringify(e));const r=t.find(o=>o.type==="default"),u=t.filter(o=>o.type==="custom");r&&(t=[...u,r]),console.log("[getCircleStyle] 排序后的 circleConfigList:",t);const s=t[t.length-1],f=s&&(s.renderMode==="color"||s.renderMode==="icon");if(!s||s.type!=="default")return console.warn("[getCircleStyle] 未找到默认配置,使用系统默认值"),{_useNewFormat:!0,_circleConfigList:[{type:"default",renderMode:"color",pointStyle:"118",pointTintColor:"rgba(103, 194, 58, 0.6)",pointSize:2}],"icon-image":"custom-icon-default-118-1031945806","icon-size":1};if(console.log("[getCircleStyle] 默认配置:",s),f){const o={_useNewFormat:!0,_circleConfigList:t};o["icon-image"]=[],o["icon-size"]=[];const c=t.filter(g=>g.type==="custom"&&g.value!==""&&g.value!=null);if(c.length>0){const g=c[0].key;let d="string";for(const y of c)if(typeof y.value=="number"){d="number";break}const p=y=>d==="number"?typeof y=="number"?y:Number(y):String(y),m=["match",["get",g]];c.forEach(y=>{let L;if(y.renderMode==="color"){const I=(y.pointTintColor||"rgba(103, 194, 58, 1)").replace(/[^a-zA-Z0-9]/g,"");L=`custom-icon-${y.key}-${y.pointStyle||""}-${I}`}else L=y.pointStyle||"";m.push(p(y.value)),m.push(L)});let b;if(s.renderMode==="color"){const y=(s.pointTintColor||"#67c23a").replace(/[^a-zA-Z0-9]/g,"");b=`custom-icon-default-${s.pointStyle||""}-${y}`}else b=s.pointStyle||"";m.push(b),o["icon-image"]=m;const S=["match",["get",g]];c.forEach(y=>{S.push(p(y.value)),S.push((y.pointSize||10)/20)}),S.push((s.pointSize||10)/20),o["icon-size"]=S}else{let g;if(s.renderMode==="color"){const d=(s.pointTintColor||"#67c23a").replace(/[^a-zA-Z0-9]/g,"");g=`custom-icon-default-${s.pointStyle||""}-${d}`}else g=s.pointStyle||"";o["icon-image"]=g,o["icon-size"]=(s.pointSize||10)/20}return o}const l={"circle-radius":[],"circle-stroke-width":[],"circle-color":[],"circle-stroke-color":[],"icon-image":[]};e=[...e];const n=e[e.length-1];e.splice(e.length-1,1),l["circle-radius"]=[n.circleRadius],l["circle-stroke-width"]=[n.circleStrokeWidth],l["circle-color"]=[n.circleColor],l["circle-stroke-color"]=[n.circleStrokeColor],l["icon-image"]=[n.iconImageUrl||""];let a=[];return e.forEach(o=>{if(o.type=="custom"){let c=-1;a.forEach((g,d)=>{g.key==o.key&&(c=d)}),c>-1?a[c].list.push(o):a.push({key:o.key,list:[o]})}}),a.forEach(o=>{n.circleType!="symbol"&&(o.list.forEach(c=>{l["circle-radius"].unshift(c.circleRadius),l["circle-radius"].unshift(c.value)}),l["circle-radius"].unshift(["get",o.key]),l["circle-radius"].unshift("match"),o.list.forEach(c=>{l["circle-stroke-width"].unshift(c.circleStrokeWidth),l["circle-stroke-width"].unshift(c.value)}),l["circle-stroke-width"].unshift(["get",o.key]),l["circle-stroke-width"].unshift("match"),o.list.forEach(c=>{l["circle-color"].unshift(c.circleColor),l["circle-color"].unshift(c.value)}),l["circle-color"].unshift(["get",o.key]),l["circle-color"].unshift("match"),o.list.forEach(c=>{l["circle-stroke-color"].unshift(c.circleStrokeColor),l["circle-stroke-color"].unshift(c.value)}),l["circle-stroke-color"].unshift(["get",o.key]),l["circle-stroke-color"].unshift("match")),n.circleType=="symbol"&&(o.list.forEach(c=>{l["icon-image"].unshift(c.iconImageUrl||""),l["icon-image"].unshift(c.value)}),l["icon-image"].unshift(["get",o.key]),l["icon-image"].unshift("match"))}),e.length==0&&(l["circle-radius"]=l["circle-radius"][0],l["circle-stroke-width"]=l["circle-stroke-width"][0],l["circle-color"]=l["circle-color"][0],l["circle-stroke-color"]=l["circle-stroke-color"][0],l["icon-image"]=l["icon-image"][0]),l}function T(i){let e=O(i);const t={"icon-image":[]},r=e[e.length-1];e=e.slice(0,-1),t["icon-image"]=[r.iconImageUrl||""];let u=[];return e.forEach(s=>{if(s.type=="custom"){let f=-1;u.forEach((l,n)=>{l.key==s.key&&(f=n)}),f>-1?u[f].list.push(s):u.push({key:s.key,list:[s]})}}),u.forEach(s=>{r.circleType=="symbol"&&(s.list.forEach(f=>{t["icon-image"].unshift(f.iconImageUrl||""),t["icon-image"].unshift(f.value)}),t["icon-image"].unshift(["get",s.key]),t["icon-image"].unshift("match"))}),e.length==0&&(t["icon-image"]=t["icon-image"][0]),t}function z(i){const e=k(i),t=w(i),r={"fill-color":"rgba(103, 194, 58, 0.6)","fill-opacity":1,"fill-outline-color":"rgba(103, 194, 58, 1)"},u={"line-width":2,"line-color":"rgba(103, 194, 58, 1)"},s={"circle-radius":["interpolate",["linear"],["zoom"],1,6,10,8,22,12],"circle-stroke-width":["interpolate",["linear"],["zoom"],1,2,10,5,22,10],"circle-stroke-color":["interpolate",["linear"],["zoom"],0,"rgba(103, 194, 58, 0.6)",22,"rgba(103, 194, 58, 0.6)"],"circle-stroke-opacity":["interpolate",["linear"],["zoom"],0,1,22,1],"circle-color":"rgba(103, 194, 58, 0.6)"};if(!e)switch(console.warn("当前图层样式配置不存在,使用默认样式,还有执行到这里的情况?"),t){case"fill":return r;case"line":return u;case"circle":return s}switch(t){case"fill":const f=N(e);return f||r;case"line":const l=A(e);return l||u;case"circle":const n=E(e);return n||s;case"symbol":const a=T(e);return a||{"icon-image":""}}}function M(i){return new Promise((e,t)=>{const r=new FileReader;r.onload=()=>{r.result instanceof ArrayBuffer?e(r.result):t(new Error("Failed to read file as ArrayBuffer"))},r.onerror=t,r.readAsArrayBuffer(i)})}function B(i){const e=i.fileDirectory||{},t=e.ModelTiepoint||[],r=e.ModelPixelScale||[];if(t.length>=6&&r.length>=3){console.log("情况1:使用ModelTiepoint和ModelPixelScale计算边界",t,r);const u=t[3],s=t[4],f=r[0],l=r[1],n=i.getWidth(),a=i.getHeight(),o=u,c=s,g=u+n*f,d=s-a*Math.abs(l);return[o,d,g,c]}else if(e.ModelTransformation){console.log("情况2:使用ModelTransformation矩阵计算边界");const u=e.ModelTransformation;if(u&&u.length>=16){const s=i.getWidth(),f=i.getHeight(),l=u[3],n=u[7],a=l+s*u[0],o=n+f*u[5];return[l,n,a,o]}}else if(e.GeographicTypeGeoKey)return console.warn("Limited geographic information. Using approximated bounds."),[-180,-90,180,90];return console.warn("No geographic reference found. Using default bounds."),[-180,-90,180,90]}function U(i){i=i.replace(/^#/,"");let e=0,t=0,r=0;return i.length===3?(e=parseInt(i.charAt(0)+i.charAt(0),16),t=parseInt(i.charAt(1)+i.charAt(1),16),r=parseInt(i.charAt(2)+i.charAt(2),16)):i.length===6&&(e=parseInt(i.substring(0,2),16),t=parseInt(i.substring(2,4),16),r=parseInt(i.substring(4,6),16)),[e,t,r]}function R(i,e,t){return Math.max(e,Math.min(t,i))}function W(i,e){if(i)return e.find(t=>t.id===i)}exports.calculateBounds=B;exports.clamp=R;exports.getCircleStyle=E;exports.getFillStyle=N;exports.getLabelStyle=F;exports.getLayerId=v;exports.getLayerStyle=z;exports.getLayerType=w;exports.getLineLegendStyle=J;exports.getOutLineStyle=A;exports.getSourceId=$;exports.hexToRgb=U;exports.parseLayerPaintConfig=x;exports.parseStyleConfig=k;exports.readFileAsArrayBuffer=M;exports.resolveAssetById=W;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const f=require("@vueuse/core"),u=require("./style-DiDWGUIe.js"),E=require("vue"),A=(e,r)=>{if(!f.isClient)return!1;const o={undefined:"overflow",true:"overflow-y",false:"overflow-x"}[String(r)],t=u.getStyle(e,o);return["scroll","auto","overlay"].some(n=>t.includes(n))},v=(e,r)=>{if(!f.isClient)return;let o=e;for(;o;){if([window,document,document.documentElement].includes(o))return window;if(A(o,r))return o;o=o.parentNode}return o};let l;const w=e=>{var r;if(!f.isClient)return 0;if(l!==void 0)return l;const o=document.createElement("div");o.className=`${e}-scrollbar__wrap`,o.style.visibility="hidden",o.style.width="100px",o.style.position="absolute",o.style.top="-9999px",document.body.appendChild(o);const t=o.offsetWidth;o.style.overflow="scroll";const n=document.createElement("div");n.style.width="100%",o.appendChild(n);const s=n.offsetWidth;return(r=o.parentNode)==null||r.removeChild(o),l=t-s,l};function _(e,r){if(!f.isClient)return;if(!r){e.scrollTop=0;return}const o=[];let t=r.offsetParent;for(;t!==null&&e!==t&&e.contains(t);)o.push(t),t=t.offsetParent;const n=r.offsetTop+o.reduce((S,N)=>S+N.offsetTop,0),s=n+r.offsetHeight,T=e.scrollTop,d=T+e.clientHeight;n<T?e.scrollTop=n:s>d&&(e.scrollTop=s-e.clientHeight)}var p=(e=>(e[e.TEXT=1]="TEXT",e[e.CLASS=2]="CLASS",e[e.STYLE=4]="STYLE",e[e.PROPS=8]="PROPS",e[e.FULL_PROPS=16]="FULL_PROPS",e[e.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",e[e.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",e[e.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",e[e.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",e[e.NEED_PATCH=512]="NEED_PATCH",e[e.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",e[e.HOISTED=-1]="HOISTED",e[e.BAIL=-2]="BAIL",e))(p||{});const i=e=>{const r=u.isArray(e)?e:[e],o=[];return r.forEach(t=>{var n;u.isArray(t)?o.push(...i(t)):E.isVNode(t)&&((n=t.component)!=null&&n.subTree)?o.push(t,...i(t.component.subTree)):E.isVNode(t)&&u.isArray(t.children)?o.push(...i(t.children)):E.isVNode(t)&&t.shapeFlag===2?o.push(...i(t.type())):o.push(t)}),o};exports.PatchFlags=p;exports.flattedChildren=i;exports.getScrollBarWidth=w;exports.getScrollContainer=v;exports.scrollIntoView=_;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { isClient as u } from "@vueuse/core";
|
|
2
|
+
import { g as m, i as l } from "./style-COMeMpO8.js";
|
|
3
|
+
import { isVNode as E } from "vue";
|
|
4
|
+
const N = (e, r) => {
|
|
5
|
+
if (!u)
|
|
6
|
+
return !1;
|
|
7
|
+
const o = {
|
|
8
|
+
undefined: "overflow",
|
|
9
|
+
true: "overflow-y",
|
|
10
|
+
false: "overflow-x"
|
|
11
|
+
}[String(r)], t = m(e, o);
|
|
12
|
+
return ["scroll", "auto", "overlay"].some((n) => t.includes(n));
|
|
13
|
+
}, y = (e, r) => {
|
|
14
|
+
if (!u)
|
|
15
|
+
return;
|
|
16
|
+
let o = e;
|
|
17
|
+
for (; o; ) {
|
|
18
|
+
if ([window, document, document.documentElement].includes(o))
|
|
19
|
+
return window;
|
|
20
|
+
if (N(o, r))
|
|
21
|
+
return o;
|
|
22
|
+
o = o.parentNode;
|
|
23
|
+
}
|
|
24
|
+
return o;
|
|
25
|
+
};
|
|
26
|
+
let i;
|
|
27
|
+
const L = (e) => {
|
|
28
|
+
var r;
|
|
29
|
+
if (!u)
|
|
30
|
+
return 0;
|
|
31
|
+
if (i !== void 0)
|
|
32
|
+
return i;
|
|
33
|
+
const o = document.createElement("div");
|
|
34
|
+
o.className = `${e}-scrollbar__wrap`, o.style.visibility = "hidden", o.style.width = "100px", o.style.position = "absolute", o.style.top = "-9999px", document.body.appendChild(o);
|
|
35
|
+
const t = o.offsetWidth;
|
|
36
|
+
o.style.overflow = "scroll";
|
|
37
|
+
const n = document.createElement("div");
|
|
38
|
+
n.style.width = "100%", o.appendChild(n);
|
|
39
|
+
const s = n.offsetWidth;
|
|
40
|
+
return (r = o.parentNode) == null || r.removeChild(o), i = t - s, i;
|
|
41
|
+
};
|
|
42
|
+
function R(e, r) {
|
|
43
|
+
if (!u)
|
|
44
|
+
return;
|
|
45
|
+
if (!r) {
|
|
46
|
+
e.scrollTop = 0;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const o = [];
|
|
50
|
+
let t = r.offsetParent;
|
|
51
|
+
for (; t !== null && e !== t && e.contains(t); )
|
|
52
|
+
o.push(t), t = t.offsetParent;
|
|
53
|
+
const n = r.offsetTop + o.reduce((S, d) => S + d.offsetTop, 0), s = n + r.offsetHeight, p = e.scrollTop, T = p + e.clientHeight;
|
|
54
|
+
n < p ? e.scrollTop = n : s > T && (e.scrollTop = s - e.clientHeight);
|
|
55
|
+
}
|
|
56
|
+
var v = /* @__PURE__ */ ((e) => (e[e.TEXT = 1] = "TEXT", e[e.CLASS = 2] = "CLASS", e[e.STYLE = 4] = "STYLE", e[e.PROPS = 8] = "PROPS", e[e.FULL_PROPS = 16] = "FULL_PROPS", e[e.HYDRATE_EVENTS = 32] = "HYDRATE_EVENTS", e[e.STABLE_FRAGMENT = 64] = "STABLE_FRAGMENT", e[e.KEYED_FRAGMENT = 128] = "KEYED_FRAGMENT", e[e.UNKEYED_FRAGMENT = 256] = "UNKEYED_FRAGMENT", e[e.NEED_PATCH = 512] = "NEED_PATCH", e[e.DYNAMIC_SLOTS = 1024] = "DYNAMIC_SLOTS", e[e.HOISTED = -1] = "HOISTED", e[e.BAIL = -2] = "BAIL", e))(v || {});
|
|
57
|
+
const f = (e) => {
|
|
58
|
+
const r = l(e) ? e : [e], o = [];
|
|
59
|
+
return r.forEach((t) => {
|
|
60
|
+
var n;
|
|
61
|
+
l(t) ? o.push(...f(t)) : E(t) && ((n = t.component) != null && n.subTree) ? o.push(t, ...f(t.component.subTree)) : E(t) && l(t.children) ? o.push(...f(t.children)) : E(t) && t.shapeFlag === 2 ? o.push(...f(t.type())) : o.push(t);
|
|
62
|
+
}), o;
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
v as P,
|
|
66
|
+
y as a,
|
|
67
|
+
f,
|
|
68
|
+
L as g,
|
|
69
|
+
R as s
|
|
70
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("vue");function u(e="build-time.json"){let t=new Date;return{name:"vite-plugin-build-time",enforce:"post",config:()=>(console.log("vite-plugin-build-time: config"),{define:{"import.meta.env.BUILD_TIME":JSON.stringify(t.getTime())}}),generateBundle(){console.log("vite-plugin-build-time: generateBundle");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("./chunks/apply-element-plus-theme-DdN9KOhk.js"),c=require("vue");function u(e="build-time.json"){let t=new Date;return{name:"vite-plugin-build-time",enforce:"post",config:()=>(console.log("vite-plugin-build-time: config"),{define:{"import.meta.env.BUILD_TIME":JSON.stringify(t.getTime())}}),generateBundle(){console.log("vite-plugin-build-time: generateBundle");const i=JSON.stringify({timestamp:t.getTime(),isoString:t.toISOString(),localeString:t.toLocaleString()},null,2);this.emitFile({type:"asset",fileName:e,source:i})}}}const n=c.ref(!1),m=c.ref(""),g=async(e,t=1e3,i)=>{if(n.value)return{stop:()=>{}};n.value=!0;const s=new AbortController,f=s.signal;try{const o=async()=>{if(f.aborted)return;let p=`//${window.location.host}${m.value}/version.json?t=${new Date().getTime()}`;try{const r=await fetch(p,{method:"GET"});if(r.status===200){const l=await r.json();let a=l.timestamp||l.version||0;if(!e)return;e<a&&i(a)}}catch{}};await o();const d=setInterval(o,t);return{stop:()=>{clearInterval(d),s.abort(),n.value=!1}}}catch{return n.value=!1,{stop:()=>{}}}},b=e=>{e&&(e.endsWith("/")&&(e=e.slice(0,-1)),m.value=e)};v.applyElementPlusTheme();const h={compileTimePlugin:u,isNewVersion:g};exports.compileTimePlugin=u;exports.default=h;exports.isNewVersion=g;exports.setBaseUrl=b;
|