@realsee/dnalogel 0.1.7-alpha.2 → 0.1.7-alpha.3
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/data/PrXel3aqGbp34JQn.js +139 -1
- package/data/vLykj3NWrllMrG06.js +335 -71
- package/libs/gltf-viewer/index.d.ts +5 -0
- package/libs/gltf-viewer/index.js +39 -7
- package/package.json +3 -3
- package/plugins/ModelRoomLabelPlugin/Controller.js +1 -0
- package/plugins/ModelRoomLabelPlugin/RoomLabelItem.js +5 -5
- package/plugins/floorplan/ModelFloorplanPlugin/Controller.d.ts +5 -2
- package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +22 -11
- package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +4 -4
- package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +5 -5
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +2 -2
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomMaterial.d.ts +11 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomMaterial.js +174 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RuleLabels.d.ts +8 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RuleLabels.js +179 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.d.ts +2 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +14 -2
- package/plugins/floorplan/ModelFloorplanPlugin/components/index.d.ts +3 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +1 -1
- package/plugins/floorplan/ModelFloorplanPlugin/typings/utility.d.ts +2 -0
- package/plugins/floorplan/ModelFloorplanPlugin/typings/utility.js +7 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +1 -1
- package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +1 -1
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +4 -4
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +2 -2
- package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +3 -3
- package/plugins/floorplan/typings/floorplanData.d.ts +2 -0
- package/plugins/floorplan/typings/floorplanServerData.d.ts +2 -0
- package/plugins/floorplan/utils/formatData.js +2 -1
- package/shared-utils/changeModelCanvasOpacity.d.ts +2 -0
- package/shared-utils/{changeModelCanvansOpacity.js → changeModelCanvasOpacity.js} +2 -2
- package/shared-utils/three/loadTexture.d.ts +2 -2
- package/shared-utils/three/loadTexture.js +21 -2
- package/shared-utils/changeModelCanvansOpacity.d.ts +0 -2
|
@@ -37,8 +37,6 @@ require("core-js/modules/es.date.to-string.js");
|
|
|
37
37
|
|
|
38
38
|
require("core-js/modules/es.regexp.to-string.js");
|
|
39
39
|
|
|
40
|
-
require("core-js/modules/es.number.is-integer.js");
|
|
41
|
-
|
|
42
40
|
require("core-js/modules/es.number.constructor.js");
|
|
43
41
|
|
|
44
42
|
require("core-js/modules/es.array.concat.js");
|
|
@@ -104,7 +102,7 @@ var Controller = /*#__PURE__*/function () {
|
|
|
104
102
|
(0, _classCallCheck2["default"])(this, Controller);
|
|
105
103
|
(0, _defineProperty2["default"])(this, "fov", 35);
|
|
106
104
|
(0, _defineProperty2["default"])(this, "longitude", 0);
|
|
107
|
-
(0, _defineProperty2["default"])(this, "latitude",
|
|
105
|
+
(0, _defineProperty2["default"])(this, "latitude", 0);
|
|
108
106
|
(0, _defineProperty2["default"])(this, "needsRender", false);
|
|
109
107
|
this.config = config; // 异步事件回调
|
|
110
108
|
|
|
@@ -236,8 +234,7 @@ var Controller = /*#__PURE__*/function () {
|
|
|
236
234
|
key: "clear",
|
|
237
235
|
value: function clear() {
|
|
238
236
|
if (this.target) {
|
|
239
|
-
this.scene.remove(this.target.scene);
|
|
240
|
-
|
|
237
|
+
this.scene.remove(this.target.scene);
|
|
241
238
|
this.update(defaultPos);
|
|
242
239
|
this.target = undefined;
|
|
243
240
|
}
|
|
@@ -269,7 +266,30 @@ var Controller = /*#__PURE__*/function () {
|
|
|
269
266
|
|
|
270
267
|
this.target = object;
|
|
271
268
|
this.target.scene.visible = false;
|
|
272
|
-
this.scene.add(this.target.scene);
|
|
269
|
+
this.scene.add(this.target.scene); // ==== 调试逻辑 =====
|
|
270
|
+
|
|
271
|
+
{// const boxHelper = new THREE.BoxHelper(this.target.scene, 0x2bb8aa)
|
|
272
|
+
// this.scene.add(boxHelper)
|
|
273
|
+
// const axesHelper = new THREE.AxesHelper(300)
|
|
274
|
+
// this.scene.add(axesHelper)
|
|
275
|
+
// const boundingSphere = boxHelper.geometry.boundingSphere
|
|
276
|
+
// if (boundingSphere) {
|
|
277
|
+
// const { center, radius } = boundingSphere
|
|
278
|
+
// const fov = Math.PI / 2 - Math.asin(this.renderer.domElement.offsetWidth / 2 / radius)
|
|
279
|
+
// console.log('fov', fov, this.renderer.domElement.offsetWidth / 2, radius)
|
|
280
|
+
// }
|
|
281
|
+
// const VFov = 45
|
|
282
|
+
// const aspect = this.camera.aspect
|
|
283
|
+
// // // 计算水平 fov
|
|
284
|
+
// const HFov = (2 * Math.atan(Math.tan((VFov * Math.PI) / 180 / 2) * aspect) * 180) / Math.PI
|
|
285
|
+
// const zEye = Math.abs(radius) / Math.sin(((HFov / 2) * Math.PI) / 180)
|
|
286
|
+
// console.log('HFOV', HFov, zEye)
|
|
287
|
+
// const lookPos = new THREE.Vector3(
|
|
288
|
+
// center.x + this.scene.position.x,
|
|
289
|
+
// center.x + this.scene.position.y,
|
|
290
|
+
// center.x + this.scene.position.z,
|
|
291
|
+
// )
|
|
292
|
+
}
|
|
273
293
|
setTimeout(function () {
|
|
274
294
|
if (object === _this3.target) {
|
|
275
295
|
_this3.target.scene.visible = true;
|
|
@@ -598,7 +618,7 @@ var GLTFViewer = /*#__PURE__*/function (_Subscribe) {
|
|
|
598
618
|
}, {
|
|
599
619
|
set: function set(obj, prop, value) {
|
|
600
620
|
if (prop === 'fov') {
|
|
601
|
-
if (
|
|
621
|
+
if (Number(value) === NaN) {
|
|
602
622
|
throw new TypeError('The fov is not an number');
|
|
603
623
|
}
|
|
604
624
|
|
|
@@ -653,6 +673,18 @@ var GLTFViewer = /*#__PURE__*/function (_Subscribe) {
|
|
|
653
673
|
if (!controller) throw new Error(ERROR_NO_CONTROLLER);
|
|
654
674
|
controller.appendTo(container, size);
|
|
655
675
|
}
|
|
676
|
+
/**
|
|
677
|
+
* 刷新:如果传递宽高则以该宽高重新绘制;否则,以父容器的宽高重新绘制。
|
|
678
|
+
* @param size
|
|
679
|
+
*/
|
|
680
|
+
|
|
681
|
+
}, {
|
|
682
|
+
key: "refresh",
|
|
683
|
+
value: function refresh(size) {
|
|
684
|
+
var controller = caches[this.uuid];
|
|
685
|
+
if (!controller) throw new Error(ERROR_NO_CONTROLLER);
|
|
686
|
+
controller.refresh(size);
|
|
687
|
+
}
|
|
656
688
|
/**
|
|
657
689
|
* 销毁
|
|
658
690
|
*/
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realsee/dnalogel",
|
|
3
|
-
"version": "0.1.7-alpha.
|
|
4
|
-
"description": "如视前端
|
|
3
|
+
"version": "0.1.7-alpha.3",
|
|
4
|
+
"description": "如视前端 Components、Plugins 兼部分 SDKs \"Dnalogel\" 库。",
|
|
5
5
|
"author": "BEIKE REALSEE TECHNOLOGY (HK) LIMITED",
|
|
6
6
|
"peerDependencies": {
|
|
7
|
-
"@realsee/five": "^5.0.0-alpha.
|
|
7
|
+
"@realsee/five": "^5.0.0-alpha.84",
|
|
8
8
|
"@tweenjs/tween.js": "^18.6.4",
|
|
9
9
|
"@types/styled-jsx": "^2.2.9",
|
|
10
10
|
"hammerjs": "^2.0.8",
|
|
@@ -71,6 +71,7 @@ var ModelRoomLabelController = /*#__PURE__*/function () {
|
|
|
71
71
|
this.container.style.width = '100%';
|
|
72
72
|
this.container.style.height = '100%';
|
|
73
73
|
this.container.style.position = 'absolute';
|
|
74
|
+
this.container.style.pointerEvents = 'none';
|
|
74
75
|
this.container.style.left = '0';
|
|
75
76
|
this.container.style.top = '0'; // five lisenter
|
|
76
77
|
|
|
@@ -50,14 +50,14 @@ function RoomLabelItem(props, ref) {
|
|
|
50
50
|
return /*#__PURE__*/React.createElement("div", {
|
|
51
51
|
onClick: handleClick,
|
|
52
52
|
ref: ref,
|
|
53
|
-
className: _style["default"].dynamic([["
|
|
53
|
+
className: _style["default"].dynamic([["312299051", [(0, _px2rem["default"])(roomName.length > 3 ? 8 : 10), (0, _px2rem["default"])(-64), (0, _px2rem["default"])(20), (0, _px2rem["default"])(32), (0, _px2rem["default"])(6), (0, _px2rem["default"])(-44), (0, _px2rem["default"])(48), (0, _px2rem["default"])(1)]]]) + " " + "room-guid-label-plugin__item"
|
|
54
54
|
}, /*#__PURE__*/React.createElement(_style["default"], {
|
|
55
|
-
id: "
|
|
55
|
+
id: "312299051",
|
|
56
56
|
dynamic: [(0, _px2rem["default"])(roomName.length > 3 ? 8 : 10), (0, _px2rem["default"])(-64), (0, _px2rem["default"])(20), (0, _px2rem["default"])(32), (0, _px2rem["default"])(6), (0, _px2rem["default"])(-44), (0, _px2rem["default"])(48), (0, _px2rem["default"])(1)]
|
|
57
|
-
}, [".room-guid-label-plugin__item.__jsx-style-dynamic-selector{position:absolute;z-index:0;font-size:".concat((0, _px2rem["default"])(roomName.length > 3 ? 8 : 10), ";-webkit-transform:'';-ms-transform:'';transform:'';cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}"), ".room-guid-label-plugin__item-text.__jsx-style-dynamic-selector{position:absolute;left:0;top:".concat((0, _px2rem["default"])(-64), ";-webkit-transform:translate(-50%,0);-ms-transform:translate(-50%,0);transform:translate(-50%,0);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:").concat((0, _px2rem["default"])(20), ";min-width:").concat((0, _px2rem["default"])(32), ";padding:0 ").concat((0, _px2rem["default"])(6), ";pointer-events:all;background:url('//vrlab-static.ljcdn.com/release/web/room-label-bg.23e9d038.png') no-repeat;background-size:100% 100%;white-space:nowrap;}"), ".room-guid-label-plugin__item-bar.__jsx-style-dynamic-selector{position:absolute;top:".concat((0, _px2rem["default"])(-44), ";height:").concat((0, _px2rem["default"])(48), ";width:").concat((0, _px2rem["default"])(1), ";background-image:linear-gradient(to bottom,rgba(255,255,255,1),rgba(255,255,255,0));}")]), /*#__PURE__*/React.createElement("span", {
|
|
58
|
-
className: _style["default"].dynamic([["
|
|
57
|
+
}, [".room-guid-label-plugin__item.__jsx-style-dynamic-selector{position:absolute;z-index:0;font-size:".concat((0, _px2rem["default"])(roomName.length > 3 ? 8 : 10), ";-webkit-transform:'';-ms-transform:'';transform:'';cursor:pointer;point-events:auto;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}"), ".room-guid-label-plugin__item-text.__jsx-style-dynamic-selector{position:absolute;left:0;top:".concat((0, _px2rem["default"])(-64), ";-webkit-transform:translate(-50%,0);-ms-transform:translate(-50%,0);transform:translate(-50%,0);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:").concat((0, _px2rem["default"])(20), ";min-width:").concat((0, _px2rem["default"])(32), ";padding:0 ").concat((0, _px2rem["default"])(6), ";pointer-events:all;background:url('//vrlab-static.ljcdn.com/release/web/room-label-bg.23e9d038.png') no-repeat;background-size:100% 100%;white-space:nowrap;}"), ".room-guid-label-plugin__item-bar.__jsx-style-dynamic-selector{position:absolute;top:".concat((0, _px2rem["default"])(-44), ";height:").concat((0, _px2rem["default"])(48), ";width:").concat((0, _px2rem["default"])(1), ";background-image:linear-gradient(to bottom,rgba(255,255,255,1),rgba(255,255,255,0));}")]), /*#__PURE__*/React.createElement("span", {
|
|
58
|
+
className: _style["default"].dynamic([["312299051", [(0, _px2rem["default"])(roomName.length > 3 ? 8 : 10), (0, _px2rem["default"])(-64), (0, _px2rem["default"])(20), (0, _px2rem["default"])(32), (0, _px2rem["default"])(6), (0, _px2rem["default"])(-44), (0, _px2rem["default"])(48), (0, _px2rem["default"])(1)]]]) + " " + "room-guid-label-plugin__item-text"
|
|
59
59
|
}, roomName), /*#__PURE__*/React.createElement("div", {
|
|
60
|
-
className: _style["default"].dynamic([["
|
|
60
|
+
className: _style["default"].dynamic([["312299051", [(0, _px2rem["default"])(roomName.length > 3 ? 8 : 10), (0, _px2rem["default"])(-64), (0, _px2rem["default"])(20), (0, _px2rem["default"])(32), (0, _px2rem["default"])(6), (0, _px2rem["default"])(-44), (0, _px2rem["default"])(48), (0, _px2rem["default"])(1)]]]) + " " + "room-guid-label-plugin__item-bar"
|
|
61
61
|
}));
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -8,6 +8,9 @@ export interface ModelFloorplanParameterType {
|
|
|
8
8
|
scale?: number;
|
|
9
9
|
autoShowEnable?: boolean;
|
|
10
10
|
hoverEnable?: boolean;
|
|
11
|
+
compassEnable?: boolean;
|
|
12
|
+
ruleLabelsEnable?: boolean;
|
|
13
|
+
roomLabelsEnable?: boolean;
|
|
11
14
|
cameraImage?: {
|
|
12
15
|
style: React.CSSProperties;
|
|
13
16
|
};
|
|
@@ -18,7 +21,7 @@ export interface ModelFloorplanPluginsShowOpts {
|
|
|
18
21
|
floorIndex?: number;
|
|
19
22
|
isAutoShow?: boolean;
|
|
20
23
|
modelOpacity?: number;
|
|
21
|
-
|
|
24
|
+
immediately?: boolean;
|
|
22
25
|
userAction?: boolean;
|
|
23
26
|
}
|
|
24
27
|
export declare const MODEL_FLOORPLAN_PLUGIN_NAME = "modelFloorplanPlugin";
|
|
@@ -64,7 +67,7 @@ export default class ModelFloorplanPluginController {
|
|
|
64
67
|
* 5. 如果多次调用 show 方法,参数与上次参数不一致时,上次 show Promise 会被 reject
|
|
65
68
|
* @param opts.floorIndex 楼层
|
|
66
69
|
* @param opts.modelOpacity 模型透明度
|
|
67
|
-
* @param opts.
|
|
70
|
+
* @param opts.immediately 是否立即展示
|
|
68
71
|
* @param opts.isAutoShow 是否是自动展示
|
|
69
72
|
*/
|
|
70
73
|
show: (opts?: ModelFloorplanPluginsShowOpts | undefined) => Promise<boolean>;
|
|
@@ -57,7 +57,7 @@ var _getPxmm = _interopRequireDefault(require("../../../shared-utils/getPxmm"));
|
|
|
57
57
|
|
|
58
58
|
var _correctFiveState = _interopRequireWildcard(require("./utils/correctFiveState"));
|
|
59
59
|
|
|
60
|
-
var
|
|
60
|
+
var _changeModelCanvasOpacity = _interopRequireDefault(require("../../../shared-utils/changeModelCanvasOpacity"));
|
|
61
61
|
|
|
62
62
|
var _controller = require("./controller.style");
|
|
63
63
|
|
|
@@ -210,7 +210,7 @@ var ModelFloorplanPluginController = /*#__PURE__*/function () {
|
|
|
210
210
|
|
|
211
211
|
_this.showRejection = function (errorMsg) {
|
|
212
212
|
hasRejected = true;
|
|
213
|
-
reject(errorMsg ? new Error(errorMsg) : new Error(_constant.FloorplanErrorType.
|
|
213
|
+
reject(errorMsg ? new Error(errorMsg) : new Error(_constant.FloorplanErrorType.UnknownError));
|
|
214
214
|
};
|
|
215
215
|
|
|
216
216
|
_context.next = 4;
|
|
@@ -234,7 +234,7 @@ var ModelFloorplanPluginController = /*#__PURE__*/function () {
|
|
|
234
234
|
break;
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
return _context.abrupt("return", reject(new Error(_constant.FloorplanErrorType.
|
|
237
|
+
return _context.abrupt("return", reject(new Error(_constant.FloorplanErrorType.UnknownError)));
|
|
238
238
|
|
|
239
239
|
case 11:
|
|
240
240
|
if (_this.visible) {
|
|
@@ -242,7 +242,7 @@ var ModelFloorplanPluginController = /*#__PURE__*/function () {
|
|
|
242
242
|
break;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
return _context.abrupt("return", reject(new Error(_constant.FloorplanErrorType.
|
|
245
|
+
return _context.abrupt("return", reject(new Error(_constant.FloorplanErrorType.UnknownError)));
|
|
246
246
|
|
|
247
247
|
case 13:
|
|
248
248
|
// 更新户型图状态
|
|
@@ -259,8 +259,8 @@ var ModelFloorplanPluginController = /*#__PURE__*/function () {
|
|
|
259
259
|
|
|
260
260
|
|
|
261
261
|
modelOpacity = (_opts$modelOpacity = opts === null || opts === void 0 ? void 0 : opts.modelOpacity) !== null && _opts$modelOpacity !== void 0 ? _opts$modelOpacity : 0.01;
|
|
262
|
-
renderDuration = opts !== null && opts !== void 0 && opts.
|
|
263
|
-
(0,
|
|
262
|
+
renderDuration = opts !== null && opts !== void 0 && opts.immediately ? 0 : _constant.SHOW_ANIME_DURATION;
|
|
263
|
+
(0, _changeModelCanvasOpacity["default"])(_this.five, modelOpacity, renderDuration);
|
|
264
264
|
|
|
265
265
|
_this.render(renderDuration); // 展示之后的事件监听
|
|
266
266
|
|
|
@@ -329,7 +329,7 @@ var ModelFloorplanPluginController = /*#__PURE__*/function () {
|
|
|
329
329
|
|
|
330
330
|
_this.visible = false;
|
|
331
331
|
(_this$showRejection2 = _this.showRejection) === null || _this$showRejection2 === void 0 ? void 0 : _this$showRejection2.call(_this, _constant.FloorplanErrorType.BreakOffByHide);
|
|
332
|
-
(0,
|
|
332
|
+
(0, _changeModelCanvasOpacity["default"])(_this.five, 1, 0);
|
|
333
333
|
|
|
334
334
|
_this.render();
|
|
335
335
|
|
|
@@ -601,7 +601,15 @@ var ModelFloorplanPluginController = /*#__PURE__*/function () {
|
|
|
601
601
|
key: "render",
|
|
602
602
|
value: function render(duration) {
|
|
603
603
|
if (!this.container) return;
|
|
604
|
-
if (this.size.width === 0) return;
|
|
604
|
+
if (this.size.width === 0) return; // eslint-disable-next-line prettier/prettier
|
|
605
|
+
|
|
606
|
+
var _this$configs = this.configs,
|
|
607
|
+
cameraImage = _this$configs.cameraImage,
|
|
608
|
+
hoverEnable = _this$configs.hoverEnable,
|
|
609
|
+
getLabelElement = _this$configs.getLabelElement,
|
|
610
|
+
roomLabelsEnable = _this$configs.roomLabelsEnable,
|
|
611
|
+
compassEnable = _this$configs.compassEnable,
|
|
612
|
+
ruleLabelsEnable = _this$configs.ruleLabelsEnable;
|
|
605
613
|
var props = {
|
|
606
614
|
five: this.five,
|
|
607
615
|
pxmm: this.pxmm,
|
|
@@ -611,9 +619,12 @@ var ModelFloorplanPluginController = /*#__PURE__*/function () {
|
|
|
611
619
|
floorIndex: this.floorIndex,
|
|
612
620
|
floorplanData: this.floorplanData,
|
|
613
621
|
onRoomHeightClick: this.handleClick,
|
|
614
|
-
cameraImage:
|
|
615
|
-
hoverEnable:
|
|
616
|
-
getLabelElement:
|
|
622
|
+
cameraImage: cameraImage,
|
|
623
|
+
hoverEnable: hoverEnable !== null && hoverEnable !== void 0 ? hoverEnable : true,
|
|
624
|
+
getLabelElement: getLabelElement,
|
|
625
|
+
roomLabelsEnable: roomLabelsEnable !== null && roomLabelsEnable !== void 0 ? roomLabelsEnable : true,
|
|
626
|
+
compassEnable: compassEnable !== null && compassEnable !== void 0 ? compassEnable : true,
|
|
627
|
+
ruleLabelsEnable: ruleLabelsEnable !== null && ruleLabelsEnable !== void 0 ? ruleLabelsEnable : true,
|
|
617
628
|
lastPanoramaLongitude: this.lastPanoramaLongitude
|
|
618
629
|
};
|
|
619
630
|
|
|
@@ -57,10 +57,10 @@ function Camera(props) {
|
|
|
57
57
|
var size = bodyWidth < 500 || bodyHeight < 500 ? 17 : 37;
|
|
58
58
|
var rotateBaseStyle = {
|
|
59
59
|
position: 'absolute',
|
|
60
|
-
left:
|
|
61
|
-
top:
|
|
62
|
-
width:
|
|
63
|
-
height:
|
|
60
|
+
left: (0, _px2rem["default"])(-15),
|
|
61
|
+
top: (0, _px2rem["default"])(-15),
|
|
62
|
+
width: (0, _px2rem["default"])(size),
|
|
63
|
+
height: (0, _px2rem["default"])(size),
|
|
64
64
|
transformOrigin: "".concat((0, _px2rem["default"])(15), " ").concat((0, _px2rem["default"])(15)),
|
|
65
65
|
transform: "rotate(".concat(rotate, "deg)"),
|
|
66
66
|
backgroundImage: "url('//vrlab-image4.ljcdn.com/release/web/default-sidemap-camera.c9772225.png')",
|
|
@@ -38,11 +38,11 @@ function Compass(props) {
|
|
|
38
38
|
if (!northRad) return null;
|
|
39
39
|
var rotate = rad2Deg(northRad);
|
|
40
40
|
var compassStyle = {
|
|
41
|
-
width:
|
|
42
|
-
height:
|
|
41
|
+
width: (0, _px2rem["default"])(231),
|
|
42
|
+
height: (0, _px2rem["default"])(41),
|
|
43
43
|
position: 'absolute',
|
|
44
44
|
left: '50%',
|
|
45
|
-
top:
|
|
45
|
+
top: (0, _px2rem["default"])(-46),
|
|
46
46
|
willChange: 'opacity',
|
|
47
47
|
transformOrigin: "center ".concat((0, _px2rem["default"])(184)),
|
|
48
48
|
transform: "translateX(-50%) translateZ(10px) rotate(".concat(-rotate + 90, "deg)")
|
|
@@ -60,11 +60,11 @@ function Compass(props) {
|
|
|
60
60
|
var textStyle = {
|
|
61
61
|
position: 'absolute',
|
|
62
62
|
left: '50%',
|
|
63
|
-
top:
|
|
63
|
+
top: (0, _px2rem["default"])(15),
|
|
64
64
|
transform: 'translateX(-50%)',
|
|
65
65
|
opacity: '.2',
|
|
66
66
|
fontWeight: 'bold',
|
|
67
|
-
fontSize:
|
|
67
|
+
fontSize: (0, _px2rem["default"])(10),
|
|
68
68
|
color: '#fff'
|
|
69
69
|
};
|
|
70
70
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -80,8 +80,8 @@ function RoomLabel(props) {
|
|
|
80
80
|
display: 'flex',
|
|
81
81
|
flexFlow: 'column',
|
|
82
82
|
alignItems: 'center',
|
|
83
|
-
fontSize:
|
|
84
|
-
lineHeight:
|
|
83
|
+
fontSize: (0, _px2rem["default"])(10),
|
|
84
|
+
lineHeight: (0, _px2rem["default"])(15),
|
|
85
85
|
color: '#fff',
|
|
86
86
|
transform: 'translate(-50%, -50%)',
|
|
87
87
|
whiteSpace: 'nowrap'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FloorplanData, FloorplanRoomItem } from '../../../typings/floorplanData';
|
|
3
|
+
/** 为不同的房间添加不同的样式 */
|
|
4
|
+
export default function RoomMaterial(props: {
|
|
5
|
+
floorIndex: number;
|
|
6
|
+
floorplanData: FloorplanData;
|
|
7
|
+
pxmm: number;
|
|
8
|
+
}): JSX.Element;
|
|
9
|
+
export declare function RoomMaterialSwitch(props: {
|
|
10
|
+
room: FloorplanRoomItem;
|
|
11
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.array.iterator.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.object.to-string.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.string.iterator.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.weak-map.js");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.object.define-property.js");
|
|
14
|
+
|
|
15
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
16
|
+
|
|
17
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
18
|
+
|
|
19
|
+
Object.defineProperty(exports, "__esModule", {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
exports.RoomMaterialSwitch = RoomMaterialSwitch;
|
|
23
|
+
exports["default"] = RoomMaterial;
|
|
24
|
+
|
|
25
|
+
require("core-js/modules/es.array.map.js");
|
|
26
|
+
|
|
27
|
+
require("core-js/modules/es.object.assign.js");
|
|
28
|
+
|
|
29
|
+
require("core-js/modules/es.array.concat.js");
|
|
30
|
+
|
|
31
|
+
var React = _interopRequireWildcard(require("react"));
|
|
32
|
+
|
|
33
|
+
var _formatPosition = _interopRequireWildcard(require("../../../utils/formatPosition"));
|
|
34
|
+
|
|
35
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
36
|
+
|
|
37
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
38
|
+
|
|
39
|
+
/** 为不同的房间添加不同的样式 */
|
|
40
|
+
function RoomMaterial(props) {
|
|
41
|
+
var bounding = props.floorplanData.bounding;
|
|
42
|
+
var rooms = props.floorplanData.floorDatas[props.floorIndex].rooms;
|
|
43
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: "floorplan__floor-item floorplan__room-material"
|
|
45
|
+
}, rooms // 户型图坐标转 Svg 坐标
|
|
46
|
+
.map(function (room) {
|
|
47
|
+
return Object.assign({}, room, {
|
|
48
|
+
path: room.path.map(function (p) {
|
|
49
|
+
return (0, _formatPosition["default"])(p, props.pxmm, bounding);
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
}).map(function (room) {
|
|
53
|
+
return /*#__PURE__*/React.createElement(RoomMaterialSvgWrapper, {
|
|
54
|
+
key: room.id
|
|
55
|
+
}, /*#__PURE__*/React.createElement(RoomMaterialSwitch, {
|
|
56
|
+
room: room
|
|
57
|
+
}));
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function RoomMaterialSwitch(props) {
|
|
62
|
+
var floorType = props.room.floorType;
|
|
63
|
+
if (floorType === 1) return /*#__PURE__*/React.createElement(RoomMaterial_0, {
|
|
64
|
+
path: props.room.path
|
|
65
|
+
});
|
|
66
|
+
if (floorType === 0) return /*#__PURE__*/React.createElement(RoomMaterial_2, {
|
|
67
|
+
path: props.room.path
|
|
68
|
+
});
|
|
69
|
+
return /*#__PURE__*/React.createElement(RoomMaterial_1, {
|
|
70
|
+
path: props.room.path
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function RoomMaterialSvgWrapper(props) {
|
|
75
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
76
|
+
style: {
|
|
77
|
+
position: 'absolute',
|
|
78
|
+
width: '100%',
|
|
79
|
+
height: '100%',
|
|
80
|
+
overflow: 'visible'
|
|
81
|
+
}
|
|
82
|
+
}, props.children);
|
|
83
|
+
}
|
|
84
|
+
/** 纯色背景 */
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
function RoomMaterial_0(props) {
|
|
88
|
+
var d = (0, _formatPosition.pathD)(props.path, {
|
|
89
|
+
needZ: true
|
|
90
|
+
});
|
|
91
|
+
return /*#__PURE__*/React.createElement("path", {
|
|
92
|
+
d: d,
|
|
93
|
+
fill: "#2F313A"
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/** 瓷砖地板,偏蓝的格格 */
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
function RoomMaterial_1(props) {
|
|
100
|
+
var d = (0, _formatPosition.pathD)(props.path, {
|
|
101
|
+
needZ: true
|
|
102
|
+
});
|
|
103
|
+
var halfWidth = 6;
|
|
104
|
+
var width = halfWidth * 2;
|
|
105
|
+
var patternPathD = "M0 ".concat(halfWidth, " h ").concat(width, " M").concat(halfWidth, " 0 v ").concat(width);
|
|
106
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("pattern", {
|
|
107
|
+
id: "fpm-room-pattern-0",
|
|
108
|
+
x: "0",
|
|
109
|
+
y: "0",
|
|
110
|
+
width: width,
|
|
111
|
+
height: width,
|
|
112
|
+
patternUnits: "userSpaceOnUse"
|
|
113
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
114
|
+
x: "0",
|
|
115
|
+
y: "0",
|
|
116
|
+
width: width,
|
|
117
|
+
height: width,
|
|
118
|
+
fill: "#323747"
|
|
119
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
120
|
+
d: patternPathD,
|
|
121
|
+
stroke: "#ffffff",
|
|
122
|
+
strokeOpacity: "0.06",
|
|
123
|
+
strokeWidth: "0.5",
|
|
124
|
+
fill: "none"
|
|
125
|
+
}))), /*#__PURE__*/React.createElement("path", {
|
|
126
|
+
d: d,
|
|
127
|
+
fill: "url(#fpm-room-pattern-0)"
|
|
128
|
+
}));
|
|
129
|
+
}
|
|
130
|
+
/** 木地板,偏灰的格格 */
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
function RoomMaterial_2(props) {
|
|
134
|
+
var d = (0, _formatPosition.pathD)(props.path, {
|
|
135
|
+
needZ: true
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
var PatternRect = function PatternRect() {
|
|
139
|
+
return /*#__PURE__*/React.createElement("rect", {
|
|
140
|
+
x: "0.5",
|
|
141
|
+
y: "0.5",
|
|
142
|
+
width: "6",
|
|
143
|
+
height: "50",
|
|
144
|
+
fill: "none",
|
|
145
|
+
stroke: "#4B4B57",
|
|
146
|
+
strokeWidth: "0.5"
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("pattern", {
|
|
151
|
+
id: "room-material-pattern-1",
|
|
152
|
+
x: "0",
|
|
153
|
+
y: "0",
|
|
154
|
+
width: "13",
|
|
155
|
+
height: "51",
|
|
156
|
+
patternUnits: "userSpaceOnUse"
|
|
157
|
+
}, /*#__PURE__*/React.createElement(PatternRect, null)), /*#__PURE__*/React.createElement("pattern", {
|
|
158
|
+
id: "room-material-pattern-2",
|
|
159
|
+
x: "7",
|
|
160
|
+
y: "25",
|
|
161
|
+
width: "13",
|
|
162
|
+
height: "51",
|
|
163
|
+
patternUnits: "userSpaceOnUse"
|
|
164
|
+
}, /*#__PURE__*/React.createElement(PatternRect, null))), /*#__PURE__*/React.createElement("path", {
|
|
165
|
+
d: d,
|
|
166
|
+
fill: "#43434D"
|
|
167
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
168
|
+
d: d,
|
|
169
|
+
fill: "url(#room-material-pattern-1)"
|
|
170
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
171
|
+
d: d,
|
|
172
|
+
fill: "url(#room-material-pattern-2)"
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FloorplanData } from '../../../typings/floorplanData';
|
|
3
|
+
/** 展示当前楼层的户型图对应上下左右的标尺 */
|
|
4
|
+
export default function RuleLabels(props: {
|
|
5
|
+
floorIndex: number;
|
|
6
|
+
floorplanData: FloorplanData;
|
|
7
|
+
pxmm: number;
|
|
8
|
+
}): JSX.Element | null;
|