sun-card-design 1.1.37 → 1.1.38
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/package.json +1 -1
- package/dist/mobile/sun-card-design-mobile.es61.js +0 -98
- package/dist/mobile/sun-card-design-mobile.es62.js +0 -98
- package/dist/public/sun-card-designer.css +0 -1
- package/dist/sun-card-designer.es.js +0 -25
- package/dist/sun-card-designer.es10.js +0 -167
- package/dist/sun-card-designer.es11.js +0 -197
- package/dist/sun-card-designer.es12.js +0 -203
- package/dist/sun-card-designer.es13.js +0 -130
- package/dist/sun-card-designer.es14.js +0 -120
- package/dist/sun-card-designer.es151.js +0 -4
- package/dist/sun-card-designer.es152.js +0 -4
- package/dist/sun-card-designer.es153.js +0 -4
- package/dist/sun-card-designer.es154.js +0 -4
- package/dist/sun-card-designer.es155.js +0 -82
- package/dist/sun-card-designer.es156.js +0 -91
- package/dist/sun-card-designer.es157.js +0 -92
- package/dist/sun-card-designer.es158.js +0 -191
- package/dist/sun-card-designer.es159.js +0 -86
- package/dist/sun-card-designer.es16.js +0 -10
- package/dist/sun-card-designer.es160.js +0 -238
- package/dist/sun-card-designer.es161.js +0 -113
- package/dist/sun-card-designer.es162.js +0 -49
- package/dist/sun-card-designer.es163.js +0 -43
- package/dist/sun-card-designer.es164.js +0 -39
- package/dist/sun-card-designer.es165.js +0 -46
- package/dist/sun-card-designer.es166.js +0 -58
- package/dist/sun-card-designer.es167.js +0 -56
- package/dist/sun-card-designer.es168.js +0 -58
- package/dist/sun-card-designer.es169.js +0 -73
- package/dist/sun-card-designer.es17.js +0 -333
- package/dist/sun-card-designer.es170.js +0 -59
- package/dist/sun-card-designer.es171.js +0 -69
- package/dist/sun-card-designer.es172.js +0 -182
- package/dist/sun-card-designer.es173.js +0 -176
- package/dist/sun-card-designer.es174.js +0 -184
- package/dist/sun-card-designer.es175.js +0 -409
- package/dist/sun-card-designer.es176.js +0 -365
- package/dist/sun-card-designer.es177.js +0 -70
- package/dist/sun-card-designer.es178.js +0 -68
- package/dist/sun-card-designer.es179.js +0 -184
- package/dist/sun-card-designer.es18.js +0 -68
- package/dist/sun-card-designer.es180.js +0 -193
- package/dist/sun-card-designer.es181.js +0 -193
- package/dist/sun-card-designer.es182.js +0 -193
- package/dist/sun-card-designer.es184.js +0 -228
- package/dist/sun-card-designer.es185.js +0 -71
- package/dist/sun-card-designer.es19.js +0 -611
- package/dist/sun-card-designer.es196.js +0 -4
- package/dist/sun-card-designer.es20.js +0 -225
- package/dist/sun-card-designer.es201.js +0 -125
- package/dist/sun-card-designer.es21.js +0 -69
- package/dist/sun-card-designer.es22.js +0 -719
- package/dist/sun-card-designer.es220.js +0 -63
- package/dist/sun-card-designer.es221.js +0 -80
- package/dist/sun-card-designer.es222.js +0 -82
- package/dist/sun-card-designer.es223.js +0 -94
- package/dist/sun-card-designer.es224.js +0 -87
- package/dist/sun-card-designer.es225.js +0 -226
- package/dist/sun-card-designer.es226.js +0 -105
- package/dist/sun-card-designer.es227.js +0 -45
- package/dist/sun-card-designer.es228.js +0 -31
- package/dist/sun-card-designer.es229.js +0 -29
- package/dist/sun-card-designer.es23.js +0 -211
- package/dist/sun-card-designer.es230.js +0 -32
- package/dist/sun-card-designer.es231.js +0 -46
- package/dist/sun-card-designer.es232.js +0 -42
- package/dist/sun-card-designer.es233.js +0 -44
- package/dist/sun-card-designer.es234.js +0 -61
- package/dist/sun-card-designer.es235.js +0 -46
- package/dist/sun-card-designer.es236.js +0 -54
- package/dist/sun-card-designer.es237.js +0 -130
- package/dist/sun-card-designer.es238.js +0 -127
- package/dist/sun-card-designer.es239.js +0 -132
- package/dist/sun-card-designer.es24.js +0 -265
- package/dist/sun-card-designer.es240.js +0 -375
- package/dist/sun-card-designer.es241.js +0 -348
- package/dist/sun-card-designer.es242.js +0 -69
- package/dist/sun-card-designer.es243.js +0 -65
- package/dist/sun-card-designer.es244.js +0 -87
- package/dist/sun-card-designer.es245.js +0 -98
- package/dist/sun-card-designer.es246.js +0 -98
- package/dist/sun-card-designer.es247.js +0 -98
- package/dist/sun-card-designer.es25.js +0 -857
- package/dist/sun-card-designer.es26.js +0 -768
- package/dist/sun-card-designer.es260.js +0 -125
- package/dist/sun-card-designer.es27.js +0 -264
- package/dist/sun-card-designer.es273.js +0 -192
- package/dist/sun-card-designer.es28.js +0 -809
- package/dist/sun-card-designer.es29.js +0 -220
- package/dist/sun-card-designer.es3.js +0 -506
- package/dist/sun-card-designer.es30.js +0 -809
- package/dist/sun-card-designer.es31.js +0 -220
- package/dist/sun-card-designer.es32.js +0 -820
- package/dist/sun-card-designer.es33.js +0 -225
- package/dist/sun-card-designer.es34.js +0 -69
- package/dist/sun-card-designer.es35.js +0 -375
- package/dist/sun-card-designer.es36.js +0 -186
- package/dist/sun-card-designer.es37.js +0 -119
- package/dist/sun-card-designer.es38.js +0 -354
- package/dist/sun-card-designer.es39.js +0 -127
- package/dist/sun-card-designer.es4.js +0 -365
- package/dist/sun-card-designer.es40.js +0 -100
- package/dist/sun-card-designer.es41.js +0 -214
- package/dist/sun-card-designer.es42.js +0 -119
- package/dist/sun-card-designer.es43.js +0 -250
- package/dist/sun-card-designer.es44.js +0 -118
- package/dist/sun-card-designer.es45.js +0 -64
- package/dist/sun-card-designer.es46.js +0 -223
- package/dist/sun-card-designer.es47.js +0 -196
- package/dist/sun-card-designer.es48.js +0 -77
- package/dist/sun-card-designer.es49.js +0 -85
- package/dist/sun-card-designer.es5.js +0 -317
- package/dist/sun-card-designer.es50.js +0 -85
- package/dist/sun-card-designer.es51.js +0 -64
- package/dist/sun-card-designer.es52.js +0 -283
- package/dist/sun-card-designer.es53.js +0 -64
- package/dist/sun-card-designer.es54.js +0 -142
- package/dist/sun-card-designer.es55.js +0 -52
- package/dist/sun-card-designer.es56.js +0 -85
- package/dist/sun-card-designer.es57.js +0 -258
- package/dist/sun-card-designer.es58.js +0 -226
- package/dist/sun-card-designer.es59.js +0 -169
- package/dist/sun-card-designer.es6.js +0 -190
- package/dist/sun-card-designer.es60.js +0 -280
- package/dist/sun-card-designer.es61.js +0 -168
- package/dist/sun-card-designer.es62.js +0 -219
- package/dist/sun-card-designer.es63.js +0 -168
- package/dist/sun-card-designer.es64.js +0 -275
- package/dist/sun-card-designer.es65.js +0 -760
- package/dist/sun-card-designer.es66.js +0 -272
- package/dist/sun-card-designer.es67.js +0 -559
- package/dist/sun-card-designer.es68.js +0 -124
- package/dist/sun-card-designer.es69.js +0 -528
- package/dist/sun-card-designer.es7.js +0 -65
- package/dist/sun-card-designer.es70.js +0 -185
- package/dist/sun-card-designer.es71.js +0 -107
- package/dist/sun-card-designer.es72.js +0 -153
- package/dist/sun-card-designer.es73.js +0 -315
- package/dist/sun-card-designer.es74.js +0 -114
- package/dist/sun-card-designer.es76.js +0 -4211
- package/dist/sun-card-designer.es79.js +0 -4
- package/dist/sun-card-designer.es8.js +0 -171
- package/dist/sun-card-designer.es80.js +0 -4
- package/dist/sun-card-designer.es81.js +0 -4
- package/dist/sun-card-designer.es84.js +0 -228
- package/dist/sun-card-designer.es87.js +0 -52
- package/dist/sun-card-designer.es88.js +0 -52
- package/dist/sun-card-designer.es9.js +0 -207
- package/dist/sun-card-designer.es91.js +0 -344
- package/dist/sun-card-designer.es92.js +0 -199
- package/dist/sun-card-designer.es95.js +0 -180
|
@@ -1,348 +0,0 @@
|
|
|
1
|
-
import { ref, computed, onMounted, onUnmounted, createElementBlock, openBlock, normalizeStyle } from "vue";
|
|
2
|
-
import * as THREE from "three";
|
|
3
|
-
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
|
|
4
|
-
import { CSS2DRenderer, CSS2DObject } from "three/examples/jsm/renderers/CSS2DRenderer.js";
|
|
5
|
-
/* empty css */
|
|
6
|
-
import _export_sfc from "./sun-card-designer.es16.js";
|
|
7
|
-
const _sfc_main = {
|
|
8
|
-
__name: "pieChart3dComp",
|
|
9
|
-
props: ["record"],
|
|
10
|
-
setup(__props) {
|
|
11
|
-
const props = __props;
|
|
12
|
-
const containerRef = ref(null);
|
|
13
|
-
let renderer = null;
|
|
14
|
-
let labelRenderer = null;
|
|
15
|
-
let scene = null;
|
|
16
|
-
let camera = null;
|
|
17
|
-
let animationId = null;
|
|
18
|
-
let resizeObserver = null;
|
|
19
|
-
let controls = null;
|
|
20
|
-
let chartGroup = null;
|
|
21
|
-
let envTexture = null;
|
|
22
|
-
const chartStyle = computed(() => {
|
|
23
|
-
const style = props.record?.options?.style || {};
|
|
24
|
-
return {
|
|
25
|
-
width: style.width || "100%",
|
|
26
|
-
height: style.height || "260px"
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
function getPieConfig() {
|
|
30
|
-
const options = props.record?.options || {};
|
|
31
|
-
const series = Array.isArray(options?.seriesConfig) && options.seriesConfig[0] ? options.seriesConfig[0] : {
|
|
32
|
-
radius: "0%",
|
|
33
|
-
data: [
|
|
34
|
-
{ value: 1048, name: "饼图" },
|
|
35
|
-
{ value: 735, name: "柱状图" },
|
|
36
|
-
{ value: 580, name: "折线图" },
|
|
37
|
-
{ value: 484, name: "路径图" },
|
|
38
|
-
{ value: 300, name: "关系图" }
|
|
39
|
-
],
|
|
40
|
-
colors: ["#2b7fff", "#31D492", "#FFB93B", "#FB2C36", "#8E51FF"],
|
|
41
|
-
colorsMap: {}
|
|
42
|
-
};
|
|
43
|
-
const radius = series.radius;
|
|
44
|
-
const data = Array.isArray(series.data) ? series.data : [];
|
|
45
|
-
const colors = Array.isArray(series.colors) ? series.colors : [];
|
|
46
|
-
const colorsMap = series.colorsMap && typeof series.colorsMap === "object" ? series.colorsMap : {};
|
|
47
|
-
return { data, radius, colors, colorsMap };
|
|
48
|
-
}
|
|
49
|
-
function parseRadius(radiusStr, base) {
|
|
50
|
-
if (typeof radiusStr === "number") return radiusStr;
|
|
51
|
-
if (typeof radiusStr === "string" && radiusStr.trim().endsWith("%")) {
|
|
52
|
-
const pct = parseFloat(radiusStr) / 100;
|
|
53
|
-
return base * pct;
|
|
54
|
-
}
|
|
55
|
-
const val = parseFloat(radiusStr);
|
|
56
|
-
return Number.isFinite(val) ? val : base * 0.7;
|
|
57
|
-
}
|
|
58
|
-
function initScene() {
|
|
59
|
-
if (!containerRef.value) return;
|
|
60
|
-
const { clientWidth, clientHeight } = containerRef.value;
|
|
61
|
-
scene = new THREE.Scene();
|
|
62
|
-
scene.background = null;
|
|
63
|
-
const aspect = Math.max(clientWidth, 1) / Math.max(clientHeight, 1);
|
|
64
|
-
camera = new THREE.PerspectiveCamera(40, aspect, 0.1, 1e3);
|
|
65
|
-
camera.position.set(0, 6, 14);
|
|
66
|
-
camera.lookAt(0, 0, 0);
|
|
67
|
-
renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
|
|
68
|
-
renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));
|
|
69
|
-
renderer.setSize(clientWidth, clientHeight);
|
|
70
|
-
renderer.toneMapping = THREE.LinearToneMapping;
|
|
71
|
-
renderer.toneMappingExposure = 1.2;
|
|
72
|
-
renderer.outputColorSpace = THREE.SRGBColorSpace;
|
|
73
|
-
containerRef.value.appendChild(renderer.domElement);
|
|
74
|
-
try {
|
|
75
|
-
const jpgUrl = new URL("/assets/pic1.jpg", import.meta.url).href;
|
|
76
|
-
const textureLoader = new THREE.TextureLoader();
|
|
77
|
-
textureLoader.load(
|
|
78
|
-
jpgUrl,
|
|
79
|
-
(tex) => {
|
|
80
|
-
tex.mapping = THREE.EquirectangularReflectionMapping;
|
|
81
|
-
tex.colorSpace = THREE.SRGBColorSpace;
|
|
82
|
-
tex.userData = { brightness: 1.6, contrast: 1.2 };
|
|
83
|
-
envTexture = tex;
|
|
84
|
-
if (scene) {
|
|
85
|
-
scene.background = envTexture;
|
|
86
|
-
scene.environment = envTexture;
|
|
87
|
-
} else {
|
|
88
|
-
envTexture.dispose();
|
|
89
|
-
envTexture = null;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
} catch (e) {
|
|
94
|
-
}
|
|
95
|
-
labelRenderer = new CSS2DRenderer();
|
|
96
|
-
labelRenderer.setSize(clientWidth, clientHeight);
|
|
97
|
-
labelRenderer.domElement.style.position = "absolute";
|
|
98
|
-
labelRenderer.domElement.style.top = "0px";
|
|
99
|
-
labelRenderer.domElement.style.pointerEvents = "none";
|
|
100
|
-
containerRef.value.appendChild(labelRenderer.domElement);
|
|
101
|
-
const ambient = new THREE.AmbientLight(16777215, 1);
|
|
102
|
-
scene.add(ambient);
|
|
103
|
-
const dirLight = new THREE.DirectionalLight(16777215, 1);
|
|
104
|
-
dirLight.position.set(5, 10, 7);
|
|
105
|
-
scene.add(dirLight);
|
|
106
|
-
chartGroup = new THREE.Group();
|
|
107
|
-
chartGroup.name = "pie3d-group";
|
|
108
|
-
chartGroup.rotation.x = Math.PI / 4;
|
|
109
|
-
scene.add(chartGroup);
|
|
110
|
-
buildPie();
|
|
111
|
-
controls = new OrbitControls(camera, renderer.domElement);
|
|
112
|
-
controls.enableDamping = true;
|
|
113
|
-
controls.enablePan = true;
|
|
114
|
-
controls.enableRotate = true;
|
|
115
|
-
controls.enableZoom = true;
|
|
116
|
-
controls.screenSpacePanning = true;
|
|
117
|
-
controls.panSpeed = 1;
|
|
118
|
-
controls.rotateSpeed = 0.6;
|
|
119
|
-
controls.zoomSpeed = 1;
|
|
120
|
-
controls.autoRotate = false;
|
|
121
|
-
controls.target.set(0, 0, 0);
|
|
122
|
-
startAnimate();
|
|
123
|
-
observeResize();
|
|
124
|
-
}
|
|
125
|
-
function clearGroup(group) {
|
|
126
|
-
if (!group) return;
|
|
127
|
-
for (let i = group.children.length - 1; i >= 0; i--) {
|
|
128
|
-
const child = group.children[i];
|
|
129
|
-
if (child.children && child.children.length) {
|
|
130
|
-
clearGroup(child);
|
|
131
|
-
}
|
|
132
|
-
if (child.isCSS2DObject && child.element && child.element.parentNode) {
|
|
133
|
-
child.element.parentNode.removeChild(child.element);
|
|
134
|
-
}
|
|
135
|
-
group.remove(child);
|
|
136
|
-
if (child.geometry) child.geometry.dispose();
|
|
137
|
-
if (child.material) {
|
|
138
|
-
if (Array.isArray(child.material)) child.material.forEach((m) => m.dispose());
|
|
139
|
-
else child.material.dispose();
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
function buildPie() {
|
|
144
|
-
if (!chartGroup) return;
|
|
145
|
-
clearGroup(chartGroup);
|
|
146
|
-
const { data, radius, colors, colorsMap } = getPieConfig();
|
|
147
|
-
if (!Array.isArray(data) || data.length === 0) return;
|
|
148
|
-
const total = data.reduce((s, d) => s + (Number(d.value) || 0), 0);
|
|
149
|
-
if (total <= 0) return;
|
|
150
|
-
const baseR = 5;
|
|
151
|
-
let innerR = 0;
|
|
152
|
-
let outerR = baseR;
|
|
153
|
-
if (Array.isArray(radius)) {
|
|
154
|
-
innerR = parseRadius(radius[0] ?? "0%", baseR);
|
|
155
|
-
outerR = parseRadius(radius[1] ?? "100%", baseR);
|
|
156
|
-
} else {
|
|
157
|
-
innerR = parseRadius(radius ?? "0%", baseR);
|
|
158
|
-
outerR = parseRadius("100%", baseR);
|
|
159
|
-
}
|
|
160
|
-
const thickness = 1.4;
|
|
161
|
-
let startAngle = 0;
|
|
162
|
-
data.forEach((item, idx) => {
|
|
163
|
-
const value = Number(item.value) || 0;
|
|
164
|
-
let thetaLen = value / total * Math.PI * 2;
|
|
165
|
-
if (idx === data.length - 1) {
|
|
166
|
-
thetaLen = Math.max(0, Math.PI * 2 - startAngle);
|
|
167
|
-
}
|
|
168
|
-
const midAngle = startAngle + thetaLen / 2;
|
|
169
|
-
const sectorGeom = createWedgeGeometry(innerR, outerR, startAngle, thetaLen, thickness, 72);
|
|
170
|
-
const colorByName = item && typeof item.name === "string" ? colorsMap[item.name] : void 0;
|
|
171
|
-
const color = typeof colorByName === "string" ? colorByName : typeof colors[idx] === "string" ? colors[idx] : "#2b7fff";
|
|
172
|
-
const mat = new THREE.MeshStandardMaterial({ color: new THREE.Color(color), side: THREE.DoubleSide });
|
|
173
|
-
const sectorMesh = new THREE.Mesh(sectorGeom, mat);
|
|
174
|
-
chartGroup.add(sectorMesh);
|
|
175
|
-
const labelDiv = document.createElement("div");
|
|
176
|
-
labelDiv.className = "pie-label";
|
|
177
|
-
labelDiv.style.color = "#ffffff";
|
|
178
|
-
labelDiv.style.fontSize = "12px";
|
|
179
|
-
labelDiv.style.fontFamily = "Arial, sans-serif";
|
|
180
|
-
labelDiv.style.textAlign = "center";
|
|
181
|
-
labelDiv.style.pointerEvents = "none";
|
|
182
|
-
labelDiv.textContent = `${item.name ?? ""} ${value}`;
|
|
183
|
-
const label = new CSS2DObject(labelDiv);
|
|
184
|
-
const labelR = (innerR + outerR) / 2;
|
|
185
|
-
label.position.set(Math.cos(midAngle) * labelR, thickness + 0.3, Math.sin(midAngle) * labelR);
|
|
186
|
-
chartGroup.add(label);
|
|
187
|
-
startAngle += thetaLen;
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
function createWedgeGeometry(innerR, outerR, startAngle, thetaLen, thickness, radialSegments = 64) {
|
|
191
|
-
const topY = thickness / 2;
|
|
192
|
-
const botY = -thickness / 2;
|
|
193
|
-
const segs = Math.max(3, Math.floor(radialSegments));
|
|
194
|
-
const positions = [];
|
|
195
|
-
const indices = [];
|
|
196
|
-
const outerTop = [];
|
|
197
|
-
const innerTop = [];
|
|
198
|
-
const outerBot = [];
|
|
199
|
-
const innerBot = [];
|
|
200
|
-
for (let i = 0; i <= segs; i++) {
|
|
201
|
-
const t = i / segs;
|
|
202
|
-
const ang = startAngle + thetaLen * t;
|
|
203
|
-
const cos = Math.cos(ang);
|
|
204
|
-
const sin = Math.sin(ang);
|
|
205
|
-
outerTop.push([cos * outerR, topY, sin * outerR]);
|
|
206
|
-
outerBot.push([cos * outerR, botY, sin * outerR]);
|
|
207
|
-
const ir = Math.max(0, innerR);
|
|
208
|
-
const ix = ir > 0 ? cos * ir : 0;
|
|
209
|
-
const iz = ir > 0 ? sin * ir : 0;
|
|
210
|
-
innerTop.push([ix, topY, iz]);
|
|
211
|
-
innerBot.push([ix, botY, iz]);
|
|
212
|
-
}
|
|
213
|
-
const pushV = (v) => {
|
|
214
|
-
positions.push(v[0], v[1], v[2]);
|
|
215
|
-
};
|
|
216
|
-
const baseIndex = 0;
|
|
217
|
-
outerTop.forEach(pushV);
|
|
218
|
-
innerTop.forEach(pushV);
|
|
219
|
-
outerBot.forEach(pushV);
|
|
220
|
-
innerBot.forEach(pushV);
|
|
221
|
-
const ot = (i) => baseIndex + i;
|
|
222
|
-
const it = (i) => baseIndex + (segs + 1) + i;
|
|
223
|
-
const ob = (i) => baseIndex + (segs + 1) * 2 + i;
|
|
224
|
-
const ib = (i) => baseIndex + (segs + 1) * 3 + i;
|
|
225
|
-
for (let i = 0; i < segs; i++) {
|
|
226
|
-
indices.push(ot(i), it(i), it(i + 1));
|
|
227
|
-
indices.push(ot(i), it(i + 1), ot(i + 1));
|
|
228
|
-
}
|
|
229
|
-
for (let i = 0; i < segs; i++) {
|
|
230
|
-
indices.push(ob(i), ib(i + 1), ib(i));
|
|
231
|
-
indices.push(ob(i), ob(i + 1), ib(i + 1));
|
|
232
|
-
}
|
|
233
|
-
for (let i = 0; i < segs; i++) {
|
|
234
|
-
indices.push(ot(i), ob(i + 1), ob(i));
|
|
235
|
-
indices.push(ot(i), ot(i + 1), ob(i + 1));
|
|
236
|
-
}
|
|
237
|
-
if (innerR > 0) {
|
|
238
|
-
for (let i = 0; i < segs; i++) {
|
|
239
|
-
indices.push(it(i), ib(i), ib(i + 1));
|
|
240
|
-
indices.push(it(i), ib(i + 1), it(i + 1));
|
|
241
|
-
}
|
|
242
|
-
} else {
|
|
243
|
-
indices.push(ot(0), ob(0), it(0));
|
|
244
|
-
indices.push(it(0), ob(0), ib(0));
|
|
245
|
-
indices.push(ot(segs), it(segs), ob(segs));
|
|
246
|
-
indices.push(it(segs), ib(segs), ob(segs));
|
|
247
|
-
}
|
|
248
|
-
if (innerR > 0) {
|
|
249
|
-
indices.push(ot(0), ob(0), it(0));
|
|
250
|
-
indices.push(it(0), ob(0), ib(0));
|
|
251
|
-
indices.push(ot(segs), it(segs), ob(segs));
|
|
252
|
-
indices.push(it(segs), ib(segs), ob(segs));
|
|
253
|
-
}
|
|
254
|
-
const geom = new THREE.BufferGeometry();
|
|
255
|
-
geom.setAttribute("position", new THREE.Float32BufferAttribute(positions, 3));
|
|
256
|
-
geom.setIndex(indices);
|
|
257
|
-
geom.computeVertexNormals();
|
|
258
|
-
return geom;
|
|
259
|
-
}
|
|
260
|
-
function startAnimate() {
|
|
261
|
-
stopAnimate();
|
|
262
|
-
const animate = () => {
|
|
263
|
-
animationId = requestAnimationFrame(animate);
|
|
264
|
-
if (controls) controls.update();
|
|
265
|
-
renderer && renderer.render(scene, camera);
|
|
266
|
-
labelRenderer && labelRenderer.render(scene, camera);
|
|
267
|
-
};
|
|
268
|
-
animate();
|
|
269
|
-
}
|
|
270
|
-
function stopAnimate() {
|
|
271
|
-
if (animationId) {
|
|
272
|
-
cancelAnimationFrame(animationId);
|
|
273
|
-
animationId = null;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
function observeResize() {
|
|
277
|
-
if (!containerRef.value) return;
|
|
278
|
-
if (resizeObserver) resizeObserver.disconnect();
|
|
279
|
-
resizeObserver = new ResizeObserver((entries) => {
|
|
280
|
-
for (const entry of entries) {
|
|
281
|
-
const cr = entry.contentRect;
|
|
282
|
-
onResize(Math.max(cr.width, 1), Math.max(cr.height, 1));
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
resizeObserver.observe(containerRef.value);
|
|
286
|
-
}
|
|
287
|
-
function onResize(width, height) {
|
|
288
|
-
if (!renderer || !camera) return;
|
|
289
|
-
renderer.setSize(width, height);
|
|
290
|
-
labelRenderer && labelRenderer.setSize(width, height);
|
|
291
|
-
camera.aspect = width / height;
|
|
292
|
-
camera.updateProjectionMatrix();
|
|
293
|
-
}
|
|
294
|
-
onMounted(() => {
|
|
295
|
-
initScene();
|
|
296
|
-
});
|
|
297
|
-
onUnmounted(() => {
|
|
298
|
-
stopAnimate();
|
|
299
|
-
if (resizeObserver) {
|
|
300
|
-
resizeObserver.disconnect();
|
|
301
|
-
resizeObserver = null;
|
|
302
|
-
}
|
|
303
|
-
if (chartGroup) {
|
|
304
|
-
clearGroup(chartGroup);
|
|
305
|
-
chartGroup = null;
|
|
306
|
-
}
|
|
307
|
-
if (renderer) {
|
|
308
|
-
renderer.dispose();
|
|
309
|
-
if (renderer.domElement && renderer.domElement.parentNode) {
|
|
310
|
-
renderer.domElement.parentNode.removeChild(renderer.domElement);
|
|
311
|
-
}
|
|
312
|
-
renderer = null;
|
|
313
|
-
}
|
|
314
|
-
if (labelRenderer) {
|
|
315
|
-
if (labelRenderer.domElement && labelRenderer.domElement.parentNode) {
|
|
316
|
-
labelRenderer.domElement.parentNode.removeChild(labelRenderer.domElement);
|
|
317
|
-
}
|
|
318
|
-
labelRenderer = null;
|
|
319
|
-
}
|
|
320
|
-
if (envTexture) {
|
|
321
|
-
envTexture.dispose();
|
|
322
|
-
envTexture = null;
|
|
323
|
-
}
|
|
324
|
-
if (controls) {
|
|
325
|
-
controls.dispose();
|
|
326
|
-
controls = null;
|
|
327
|
-
}
|
|
328
|
-
camera = null;
|
|
329
|
-
scene = null;
|
|
330
|
-
});
|
|
331
|
-
return (_ctx, _cache) => {
|
|
332
|
-
return openBlock(), createElementBlock("div", {
|
|
333
|
-
class: "main-pieChart3d",
|
|
334
|
-
ref_key: "containerRef",
|
|
335
|
-
ref: containerRef,
|
|
336
|
-
style: normalizeStyle({
|
|
337
|
-
width: chartStyle.value.width,
|
|
338
|
-
height: chartStyle.value.height,
|
|
339
|
-
padding: `${props.record.options?.style?.tbPadding || 0}px ${props.record.options?.style?.lrPadding || 0}px`
|
|
340
|
-
})
|
|
341
|
-
}, null, 4);
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
const PieChart3D = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-26df6fca"]]);
|
|
346
|
-
export {
|
|
347
|
-
PieChart3D as default
|
|
348
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { ref, computed, resolveComponent, createElementBlock, openBlock, Fragment, createElementVNode, createVNode, normalizeStyle, withCtx, unref, createTextVNode } from "vue";
|
|
2
|
-
import { panoramaSvg } from "./sun-card-designer.es6.js";
|
|
3
|
-
import PanoramaView from "./sun-card-designer.es273.js";
|
|
4
|
-
/* empty css */
|
|
5
|
-
import _export_sfc from "./sun-card-designer.es16.js";
|
|
6
|
-
const _hoisted_1 = ["src"];
|
|
7
|
-
const _hoisted_2 = ["innerHTML"];
|
|
8
|
-
const _sfc_main = {
|
|
9
|
-
__name: "panoramaComp",
|
|
10
|
-
props: ["record"],
|
|
11
|
-
setup(__props) {
|
|
12
|
-
const props = __props;
|
|
13
|
-
const panoramaCompRef = ref();
|
|
14
|
-
const styleSize = computed(() => {
|
|
15
|
-
const s = props.record?.options?.style || {};
|
|
16
|
-
return {
|
|
17
|
-
width: s.width || "100%",
|
|
18
|
-
height: s.height || "360px"
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
const onView = () => {
|
|
22
|
-
panoramaCompRef.value.onOpen(props.record.options.src);
|
|
23
|
-
};
|
|
24
|
-
return (_ctx, _cache) => {
|
|
25
|
-
const _component_a_tooltip = resolveComponent("a-tooltip");
|
|
26
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
27
|
-
createElementVNode("div", {
|
|
28
|
-
class: "main-panorama",
|
|
29
|
-
style: normalizeStyle({ padding: `${props.record.options?.style?.tbPadding || 0}px ${props.record.options?.style?.lrPadding || 0}px` })
|
|
30
|
-
}, [
|
|
31
|
-
createElementVNode("div", {
|
|
32
|
-
class: "panorama-box",
|
|
33
|
-
style: normalizeStyle({
|
|
34
|
-
width: styleSize.value.width,
|
|
35
|
-
height: styleSize.value.height,
|
|
36
|
-
borderRadius: props.record.options.style.borderRadius + "px"
|
|
37
|
-
})
|
|
38
|
-
}, [
|
|
39
|
-
createElementVNode("img", {
|
|
40
|
-
src: props.record.options.briefSrc,
|
|
41
|
-
style: { "width": "100%", "height": "100%" }
|
|
42
|
-
}, null, 8, _hoisted_1),
|
|
43
|
-
createVNode(_component_a_tooltip, null, {
|
|
44
|
-
title: withCtx(() => [..._cache[0] || (_cache[0] = [
|
|
45
|
-
createTextVNode("点击预览", -1)
|
|
46
|
-
])]),
|
|
47
|
-
default: withCtx(() => [
|
|
48
|
-
createElementVNode("div", {
|
|
49
|
-
class: "panorama-box-icon",
|
|
50
|
-
innerHTML: unref(panoramaSvg)(),
|
|
51
|
-
onClick: onView
|
|
52
|
-
}, null, 8, _hoisted_2)
|
|
53
|
-
]),
|
|
54
|
-
_: 1
|
|
55
|
-
})
|
|
56
|
-
], 4)
|
|
57
|
-
], 4),
|
|
58
|
-
createVNode(PanoramaView, {
|
|
59
|
-
ref_key: "panoramaCompRef",
|
|
60
|
-
ref: panoramaCompRef
|
|
61
|
-
}, null, 512)
|
|
62
|
-
], 64);
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
const Panorama = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bf23cf13"]]);
|
|
67
|
-
export {
|
|
68
|
-
Panorama as default
|
|
69
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { markRaw, defineComponent, h, computed, createElementBlock, openBlock, normalizeStyle, createElementVNode, createBlock, resolveDynamicComponent } from "vue";
|
|
2
|
-
import * as Icons from "@ant-design/icons-vue";
|
|
3
|
-
import { customIcon } from "./sun-card-designer.es76.js";
|
|
4
|
-
/* empty css */
|
|
5
|
-
import _export_sfc from "./sun-card-designer.es16.js";
|
|
6
|
-
const _sfc_main = {
|
|
7
|
-
__name: "sunIconComp",
|
|
8
|
-
props: ["record"],
|
|
9
|
-
emits: ["clickEvent"],
|
|
10
|
-
setup(__props, { emit: __emit }) {
|
|
11
|
-
const props = __props;
|
|
12
|
-
const emit = __emit;
|
|
13
|
-
const customIconComponents = Object.entries(customIcon || {}).reduce((acc, [key, svg]) => {
|
|
14
|
-
const normalized = svg.replace(/fill="#000000"/gi, 'fill="currentColor"');
|
|
15
|
-
acc[key] = markRaw(
|
|
16
|
-
defineComponent({
|
|
17
|
-
name: `CustomIcon${key}`,
|
|
18
|
-
setup() {
|
|
19
|
-
return () => h("span", { innerHTML: normalized });
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
);
|
|
23
|
-
return acc;
|
|
24
|
-
}, {});
|
|
25
|
-
const iconMap = { ...Icons, ...customIconComponents };
|
|
26
|
-
const iconComponent = computed(() => {
|
|
27
|
-
const name = props?.record?.options?.style?.iconName || "CheckCircleOutlined";
|
|
28
|
-
return iconMap[name] || Icons["CheckCircleOutlined"];
|
|
29
|
-
});
|
|
30
|
-
const iconStyle = computed(() => {
|
|
31
|
-
const color = props?.record?.options?.style?.color || "#000000";
|
|
32
|
-
const align = props?.record?.options?.style?.align || "left";
|
|
33
|
-
const map = { left: "flex-start", center: "center", right: "flex-end" };
|
|
34
|
-
return {
|
|
35
|
-
color,
|
|
36
|
-
display: "flex",
|
|
37
|
-
justifyContent: map[align] || "flex-start",
|
|
38
|
-
alignItems: "center",
|
|
39
|
-
width: "100%"
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
function onClick() {
|
|
43
|
-
if (props.record.options.clickEvent) {
|
|
44
|
-
emit("clickEvent", props.record);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return (_ctx, _cache) => {
|
|
48
|
-
return openBlock(), createElementBlock("div", {
|
|
49
|
-
class: "main-icon",
|
|
50
|
-
style: normalizeStyle({ padding: `${props.record.options?.style?.tbPadding || 0}px ${props.record.options?.style?.lrPadding || 0}px` })
|
|
51
|
-
}, [
|
|
52
|
-
createElementVNode("span", {
|
|
53
|
-
style: normalizeStyle(iconStyle.value),
|
|
54
|
-
onClick
|
|
55
|
-
}, [
|
|
56
|
-
(openBlock(), createBlock(resolveDynamicComponent(iconComponent.value), { style: { "height": "18px", "width": "18px" } }))
|
|
57
|
-
], 4)
|
|
58
|
-
], 4);
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
const SunIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-084a636a"]]);
|
|
63
|
-
export {
|
|
64
|
-
SunIcon as default
|
|
65
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { resolveComponent, createElementBlock, openBlock, normalizeStyle, createVNode, withCtx, Fragment, renderList, createBlock, createElementVNode } from "vue";
|
|
2
|
-
import FormItem from "./sun-card-designer.es184.js";
|
|
3
|
-
/* empty css */
|
|
4
|
-
import _export_sfc from "./sun-card-designer.es16.js";
|
|
5
|
-
const _sfc_main = {
|
|
6
|
-
__name: "singleColumn",
|
|
7
|
-
props: ["record", "recordData", "columnsIndex"],
|
|
8
|
-
emits: ["clickEvent", "clickColumnsEvent", "fileUpdateEvent"],
|
|
9
|
-
setup(__props, { emit: __emit }) {
|
|
10
|
-
const props = __props;
|
|
11
|
-
const emit = __emit;
|
|
12
|
-
const onClick = (record) => {
|
|
13
|
-
emit("clickEvent", record);
|
|
14
|
-
};
|
|
15
|
-
const onUpdate = (record) => {
|
|
16
|
-
emit("fileUpdateEvent", record);
|
|
17
|
-
};
|
|
18
|
-
const onClickColumns = (record) => {
|
|
19
|
-
if (!record.options.clickEvent) return;
|
|
20
|
-
emit("clickColumnsEvent", record);
|
|
21
|
-
};
|
|
22
|
-
const getBackground = () => {
|
|
23
|
-
if (isGradientColor(props.recordData.config.background)) {
|
|
24
|
-
return "none";
|
|
25
|
-
}
|
|
26
|
-
return props.recordData.config.background;
|
|
27
|
-
};
|
|
28
|
-
function isGradientColor(color) {
|
|
29
|
-
return /^(linear|radial)-gradient\(.*\)$/.test(color);
|
|
30
|
-
}
|
|
31
|
-
return (_ctx, _cache) => {
|
|
32
|
-
const _component_a_col = resolveComponent("a-col");
|
|
33
|
-
const _component_a_row = resolveComponent("a-row");
|
|
34
|
-
return openBlock(), createElementBlock("div", {
|
|
35
|
-
class: "main-singleColumn",
|
|
36
|
-
style: normalizeStyle({ background: getBackground() })
|
|
37
|
-
}, [
|
|
38
|
-
createVNode(_component_a_row, {
|
|
39
|
-
gutter: [props.record.options.style.lrGutter, props.record.options.style.tbGutter]
|
|
40
|
-
}, {
|
|
41
|
-
default: withCtx(() => [
|
|
42
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(props.record.columns, (item, index) => {
|
|
43
|
-
return openBlock(), createBlock(_component_a_col, {
|
|
44
|
-
key: index.toString(),
|
|
45
|
-
flex: props.record.columns[index]?.flex,
|
|
46
|
-
span: 24
|
|
47
|
-
}, {
|
|
48
|
-
default: withCtx(() => [
|
|
49
|
-
createElementVNode("div", {
|
|
50
|
-
class: "box",
|
|
51
|
-
style: normalizeStyle({
|
|
52
|
-
background: props.record.options.style?.background,
|
|
53
|
-
border: props.record.options.style?.borderColor === "none" ? "none" : "1px solid " + (props.record.options.style?.borderColor || "transparent"),
|
|
54
|
-
borderRadius: props.record.options.style?.borderRadius + "px",
|
|
55
|
-
padding: props.record.options.style?.tbPadding + "px " + props.record.options.style?.lrPadding + "px",
|
|
56
|
-
justifyContent: props.record.options.style?.alignItems || "start",
|
|
57
|
-
minHeight: props.record.options.style?.minHeight + "px" || "48px",
|
|
58
|
-
boxShadow: props.record.options.style?.boxShadow || null
|
|
59
|
-
})
|
|
60
|
-
}, [
|
|
61
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (element, index2) => {
|
|
62
|
-
return openBlock(), createBlock(FormItem, {
|
|
63
|
-
record: element,
|
|
64
|
-
key: index2,
|
|
65
|
-
recordData: props.recordData,
|
|
66
|
-
columnsIndex: props.columnsIndex,
|
|
67
|
-
onClickEvent: onClick,
|
|
68
|
-
onFileUpdateEvent: onUpdate,
|
|
69
|
-
onClickColumnsEvent: onClickColumns
|
|
70
|
-
}, null, 8, ["record", "recordData", "columnsIndex"]);
|
|
71
|
-
}), 128))
|
|
72
|
-
], 4)
|
|
73
|
-
]),
|
|
74
|
-
_: 2
|
|
75
|
-
}, 1032, ["flex"]);
|
|
76
|
-
}), 128))
|
|
77
|
-
]),
|
|
78
|
-
_: 1
|
|
79
|
-
}, 8, ["gutter"])
|
|
80
|
-
], 4);
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
const SingleColumn = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1fc2bfb4"]]);
|
|
85
|
-
export {
|
|
86
|
-
SingleColumn as default
|
|
87
|
-
};
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { resolveComponent, createElementBlock, openBlock, normalizeStyle, createVNode, withCtx, Fragment, renderList, createBlock, createElementVNode } from "vue";
|
|
2
|
-
import FormItem from "./sun-card-designer.es184.js";
|
|
3
|
-
/* empty css */
|
|
4
|
-
import _export_sfc from "./sun-card-designer.es16.js";
|
|
5
|
-
const _hoisted_1 = ["onClick"];
|
|
6
|
-
const _sfc_main = {
|
|
7
|
-
__name: "multipleColumn",
|
|
8
|
-
props: ["record", "recordData", "columnsIndex"],
|
|
9
|
-
emits: ["clickEvent", "clickColumnsEvent", "fileUpdateEvent"],
|
|
10
|
-
setup(__props, { emit: __emit }) {
|
|
11
|
-
const props = __props;
|
|
12
|
-
const emit = __emit;
|
|
13
|
-
const getIndex = (index) => {
|
|
14
|
-
if (index !== void 0) {
|
|
15
|
-
return index;
|
|
16
|
-
}
|
|
17
|
-
return props.columnsIndex;
|
|
18
|
-
};
|
|
19
|
-
const onClick = (record) => {
|
|
20
|
-
emit("clickEvent", record);
|
|
21
|
-
};
|
|
22
|
-
const onUpdate = (record) => {
|
|
23
|
-
emit("fileUpdateEvent", record);
|
|
24
|
-
};
|
|
25
|
-
const onClickColumns = (record) => {
|
|
26
|
-
if (!record.options.clickEvent) return;
|
|
27
|
-
emit("clickColumnsEvent", record);
|
|
28
|
-
};
|
|
29
|
-
const getBackground = () => {
|
|
30
|
-
if (isGradientColor(props.recordData.config.background)) {
|
|
31
|
-
return "none";
|
|
32
|
-
}
|
|
33
|
-
return props.recordData.config.background;
|
|
34
|
-
};
|
|
35
|
-
function isGradientColor(color) {
|
|
36
|
-
return /^(linear|radial)-gradient\(.*\)$/.test(color);
|
|
37
|
-
}
|
|
38
|
-
return (_ctx, _cache) => {
|
|
39
|
-
const _component_a_col = resolveComponent("a-col");
|
|
40
|
-
const _component_a_row = resolveComponent("a-row");
|
|
41
|
-
return openBlock(), createElementBlock("div", {
|
|
42
|
-
class: "main-grid",
|
|
43
|
-
style: normalizeStyle({ background: getBackground() })
|
|
44
|
-
}, [
|
|
45
|
-
createVNode(_component_a_row, {
|
|
46
|
-
gutter: [props.record.options.style.lrGutter, props.record.options.style.tbGutter]
|
|
47
|
-
}, {
|
|
48
|
-
default: withCtx(() => [
|
|
49
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(props.record.columns, (item, index) => {
|
|
50
|
-
return openBlock(), createBlock(_component_a_col, {
|
|
51
|
-
key: index.toString(),
|
|
52
|
-
flex: props.record.columns[index]?.flex,
|
|
53
|
-
span: 24,
|
|
54
|
-
style: normalizeStyle({
|
|
55
|
-
flex: props.record.columns[index]?.flex
|
|
56
|
-
})
|
|
57
|
-
}, {
|
|
58
|
-
default: withCtx(() => [
|
|
59
|
-
createElementVNode("div", {
|
|
60
|
-
class: "box",
|
|
61
|
-
style: normalizeStyle({
|
|
62
|
-
background: props.record.options.style?.background,
|
|
63
|
-
border: props.record.options.style?.borderColor === "none" ? "none" : "1px solid " + (props.record.options.style?.borderColor || "transparent"),
|
|
64
|
-
borderRadius: props.record.options.style?.borderRadius + "px",
|
|
65
|
-
padding: props.record.options.style?.tbPadding + "px " + props.record.options.style?.lrPadding + "px",
|
|
66
|
-
justifyContent: props.record.options.style?.alignItems || "start",
|
|
67
|
-
minHeight: props.record.options.style?.minHeight + "px" || "48px",
|
|
68
|
-
boxShadow: props.record.options.style?.boxShadow || null
|
|
69
|
-
}),
|
|
70
|
-
onClick: ($event) => onClickColumns(item)
|
|
71
|
-
}, [
|
|
72
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (element, index2) => {
|
|
73
|
-
return openBlock(), createBlock(FormItem, {
|
|
74
|
-
record: element,
|
|
75
|
-
key: index2,
|
|
76
|
-
recordData: props.recordData,
|
|
77
|
-
columnsIndex: getIndex(item.index),
|
|
78
|
-
onClickEvent: onClick,
|
|
79
|
-
onFileUpdateEvent: onUpdate,
|
|
80
|
-
onClickColumnsEvent: onClickColumns
|
|
81
|
-
}, null, 8, ["record", "recordData", "columnsIndex"]);
|
|
82
|
-
}), 128))
|
|
83
|
-
], 12, _hoisted_1)
|
|
84
|
-
]),
|
|
85
|
-
_: 2
|
|
86
|
-
}, 1032, ["flex", "style"]);
|
|
87
|
-
}), 128))
|
|
88
|
-
]),
|
|
89
|
-
_: 1
|
|
90
|
-
}, 8, ["gutter"])
|
|
91
|
-
], 4);
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
const MultipleColumn = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-20b79e7a"]]);
|
|
96
|
-
export {
|
|
97
|
-
MultipleColumn as default
|
|
98
|
-
};
|