@kq_npm/client3d_webgl_vue 3.1.2-beta → 3.1.4-beta
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/gpuspatialquery/index.js +5 -2
- package/index.js +128 -122
- package/modelselect/index.js +123 -120
- package/modelselect/style/modelselect.css +1 -1
- package/package.json +1 -1
- package/scenceview/index.js +128 -122
- package/style.css +1 -1
package/modelselect/index.js
CHANGED
|
@@ -16,6 +16,7 @@ class ModelSelectViewModel {
|
|
|
16
16
|
//屏幕空间事件处理程序三维对象
|
|
17
17
|
//拾取状态
|
|
18
18
|
//高亮三维对象
|
|
19
|
+
//高亮颜色
|
|
19
20
|
constructor(scenceView, pickCallFunc) {
|
|
20
21
|
(0,_Users_zpc_Documents_KQGEOSpace_KQGISClientForVue_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(this, "_viewer", null);
|
|
21
22
|
|
|
@@ -25,7 +26,7 @@ class ModelSelectViewModel {
|
|
|
25
26
|
|
|
26
27
|
(0,_Users_zpc_Documents_KQGEOSpace_KQGISClientForVue_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(this, "_highlight", null);
|
|
27
28
|
|
|
28
|
-
(0,_Users_zpc_Documents_KQGEOSpace_KQGISClientForVue_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(this, "
|
|
29
|
+
(0,_Users_zpc_Documents_KQGEOSpace_KQGISClientForVue_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(this, "_highlightColor", "#FF0000");
|
|
29
30
|
|
|
30
31
|
this._viewer = scenceView._viewer;
|
|
31
32
|
this._drawManager = scenceView._drawManager;
|
|
@@ -34,32 +35,42 @@ class ModelSelectViewModel {
|
|
|
34
35
|
|
|
35
36
|
this._handler.setInputAction(function (movement) {
|
|
36
37
|
if (that._isPick) {
|
|
37
|
-
|
|
38
|
+
that.clearHighlight();
|
|
39
|
+
|
|
40
|
+
let pickedObject = that._viewer.scene.pick(movement.position); // console.log(pickedObject);
|
|
38
41
|
|
|
39
42
|
|
|
40
43
|
if (pickedObject) {
|
|
41
44
|
if (pickedObject instanceof Cesium.Cesium3DTileFeature) {
|
|
42
|
-
let properties = pickedObject.getPropertyNames() || [];
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
45
|
+
let properties = pickedObject.getPropertyNames() || []; // console.log(properties);
|
|
46
|
+
|
|
47
|
+
that._highlight = {
|
|
48
|
+
object: pickedObject.pickId.object,
|
|
49
|
+
color: pickedObject.pickId.object.color
|
|
50
|
+
};
|
|
51
|
+
pickedObject.pickId.object.color = Cesium.Color.fromCssColorString(that._highlightColor);
|
|
52
|
+
let attrs = {};
|
|
53
|
+
properties.forEach(prop => {
|
|
54
|
+
attrs[prop] = pickedObject.getProperty(prop);
|
|
55
|
+
});
|
|
56
|
+
pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs); // if (properties.indexOf(that._modeFiled) > -1) {
|
|
57
|
+
// let id = pickedObject.getProperty(that._modeFiled);
|
|
58
|
+
// // that.clear();
|
|
59
|
+
// that._highlight = new Cesium.Kq3dHighlight({
|
|
60
|
+
// viewer: that._viewer,
|
|
61
|
+
// tileset: pickedObject.tileset,
|
|
62
|
+
// attrName: that._modeFiled,
|
|
63
|
+
// attrValue: [id],
|
|
64
|
+
// color: [Cesium.Color.RED]
|
|
65
|
+
// });
|
|
66
|
+
// let attrs = {};
|
|
67
|
+
// properties.forEach(prop => {
|
|
68
|
+
// attrs[prop] = pickedObject.getProperty(prop);
|
|
69
|
+
// });
|
|
70
|
+
// pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs);
|
|
71
|
+
// } else {
|
|
72
|
+
// console.log("Feature has no id attribute!");
|
|
73
|
+
// }
|
|
63
74
|
}
|
|
64
75
|
}
|
|
65
76
|
}
|
|
@@ -88,12 +99,21 @@ class ModelSelectViewModel {
|
|
|
88
99
|
} else {
|
|
89
100
|
throw "请添加模型后拾取!";
|
|
90
101
|
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
clearHighlight() {
|
|
105
|
+
if (this._highlight) {
|
|
106
|
+
this._highlight.object.color = this._highlight.color;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
this._highlight = null;
|
|
91
110
|
} //清除
|
|
92
111
|
|
|
93
112
|
|
|
94
113
|
clear() {
|
|
95
|
-
this._highlight && this._highlight.remove();
|
|
96
|
-
this._highlight = null;
|
|
114
|
+
this.clearHighlight(); // this._highlight && this._highlight.remove();
|
|
115
|
+
// this._highlight = null;
|
|
116
|
+
|
|
97
117
|
this.setCursor("default");
|
|
98
118
|
this._isPick = false;
|
|
99
119
|
} //销毁
|
|
@@ -262,16 +282,21 @@ const _hoisted_1 = {
|
|
|
262
282
|
class: "kq3d-model-select-box"
|
|
263
283
|
};
|
|
264
284
|
const _hoisted_2 = {
|
|
265
|
-
class: "
|
|
285
|
+
class: "title"
|
|
266
286
|
};
|
|
267
|
-
|
|
287
|
+
|
|
288
|
+
const _hoisted_3 = /*#__PURE__*/(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("span", null, "所属图层名称:", -1
|
|
289
|
+
/* HOISTED */
|
|
290
|
+
);
|
|
291
|
+
|
|
292
|
+
const _hoisted_4 = {
|
|
268
293
|
class: "footer-buttons"
|
|
269
294
|
};
|
|
270
295
|
|
|
271
296
|
|
|
272
297
|
|
|
273
298
|
|
|
274
|
-
//
|
|
299
|
+
// tree数据源
|
|
275
300
|
|
|
276
301
|
const __default__ = {
|
|
277
302
|
name: "Kq3dModelSelect"
|
|
@@ -280,14 +305,15 @@ const __default__ = {
|
|
|
280
305
|
props: {
|
|
281
306
|
//指定组件绑定的viewer对象的div的id
|
|
282
307
|
mapTarget: String,
|
|
283
|
-
modeFiled: {
|
|
284
|
-
default: "id",
|
|
285
|
-
type: String
|
|
286
|
-
},
|
|
287
308
|
// 外部字段别名映射
|
|
288
309
|
aliasNameReflection: {
|
|
289
310
|
type: Function
|
|
290
311
|
},
|
|
312
|
+
// 高亮颜色
|
|
313
|
+
highlightColor: {
|
|
314
|
+
type: String,
|
|
315
|
+
default: "#FF0000"
|
|
316
|
+
},
|
|
291
317
|
// 是否显示阴影效果
|
|
292
318
|
showShadow: {
|
|
293
319
|
type: Boolean,
|
|
@@ -328,12 +354,7 @@ const __default__ = {
|
|
|
328
354
|
expose
|
|
329
355
|
}) {
|
|
330
356
|
const props = __props;
|
|
331
|
-
|
|
332
|
-
children: "children",
|
|
333
|
-
label: "label"
|
|
334
|
-
}); // tree数据源
|
|
335
|
-
|
|
336
|
-
let treeData = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)([]); // 属性值
|
|
357
|
+
let layerNameTitle = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(""); // 属性值
|
|
337
358
|
|
|
338
359
|
let tableData = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)([]); //语言
|
|
339
360
|
|
|
@@ -368,6 +389,7 @@ const __default__ = {
|
|
|
368
389
|
if (scenceView) {
|
|
369
390
|
language.value = scenceView._language;
|
|
370
391
|
viewModel = new ModelSelectViewModel/* default */.Z(scenceView, pickCallFunc);
|
|
392
|
+
viewModel._highlightColor = props.highlightColor;
|
|
371
393
|
}
|
|
372
394
|
});
|
|
373
395
|
});
|
|
@@ -382,36 +404,45 @@ const __default__ = {
|
|
|
382
404
|
}
|
|
383
405
|
};
|
|
384
406
|
|
|
385
|
-
function setModeFiled(val) {
|
|
386
|
-
viewModel._modeFiled = val;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
407
|
function pick() {
|
|
390
408
|
viewModel && viewModel.pick();
|
|
391
409
|
}
|
|
392
410
|
|
|
393
411
|
function pickCallFunc(layerName, properties) {
|
|
394
|
-
|
|
395
|
-
label: layerName,
|
|
396
|
-
children: [{
|
|
397
|
-
label: properties.id || "Model1"
|
|
398
|
-
}]
|
|
399
|
-
}];
|
|
400
|
-
treeData.value = newTreeData;
|
|
412
|
+
layerNameTitle.value = layerName;
|
|
401
413
|
let propertiesData = [];
|
|
402
414
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
415
|
+
if (props.aliasNameReflection) {
|
|
416
|
+
let arrKeys = [];
|
|
417
|
+
|
|
418
|
+
for (let key in properties) {
|
|
419
|
+
arrKeys.push(key);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
props.aliasNameReflection(arrKeys, item => {
|
|
423
|
+
console.log(item);
|
|
424
|
+
|
|
425
|
+
for (let key in properties) {
|
|
426
|
+
propertiesData.push({
|
|
427
|
+
field: item[key] ? item[key] : key,
|
|
428
|
+
value: properties[key]
|
|
429
|
+
});
|
|
430
|
+
}
|
|
407
431
|
});
|
|
432
|
+
} else {
|
|
433
|
+
for (let key in properties) {
|
|
434
|
+
propertiesData.push({
|
|
435
|
+
field: key,
|
|
436
|
+
value: properties[key]
|
|
437
|
+
});
|
|
438
|
+
}
|
|
408
439
|
}
|
|
409
440
|
|
|
410
441
|
tableData.value = propertiesData;
|
|
411
442
|
}
|
|
412
443
|
|
|
413
444
|
function clear() {
|
|
414
|
-
|
|
445
|
+
layerNameTitle.value = "";
|
|
415
446
|
tableData.value = [];
|
|
416
447
|
viewModel && viewModel.clear();
|
|
417
448
|
} // 销毁
|
|
@@ -423,22 +454,15 @@ const __default__ = {
|
|
|
423
454
|
expose({
|
|
424
455
|
pick,
|
|
425
456
|
clear,
|
|
426
|
-
pickCallFunc
|
|
427
|
-
setModeFiled
|
|
457
|
+
pickCallFunc
|
|
428
458
|
});
|
|
429
459
|
return (_ctx, _cache) => {
|
|
430
|
-
const
|
|
431
|
-
|
|
432
|
-
const _component_kq_scrollbar = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-scrollbar");
|
|
433
|
-
|
|
434
|
-
const _component_kq_col = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-col");
|
|
460
|
+
const _component_kq_row = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-row");
|
|
435
461
|
|
|
436
462
|
const _component_kq_table_column = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-table-column");
|
|
437
463
|
|
|
438
464
|
const _component_kq_table = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-table");
|
|
439
465
|
|
|
440
|
-
const _component_kq_row = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-row");
|
|
441
|
-
|
|
442
466
|
const _component_kq_button = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.resolveComponent)("kq-button");
|
|
443
467
|
|
|
444
468
|
return (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementBlock)("section", {
|
|
@@ -454,72 +478,51 @@ const __default__ = {
|
|
|
454
478
|
}, null, 512
|
|
455
479
|
/* NEED_PATCH */
|
|
456
480
|
)) : (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createCommentVNode)("v-if", true), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_1, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_row, null, {
|
|
457
|
-
default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}, {
|
|
463
|
-
default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_KqTree, {
|
|
464
|
-
data: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(treeData),
|
|
465
|
-
props: defaultProps,
|
|
466
|
-
"expand-on-click-node": false,
|
|
467
|
-
"default-expand-all": "",
|
|
468
|
-
"highlight-current": "",
|
|
469
|
-
"node-key": "id"
|
|
470
|
-
}, null, 8
|
|
471
|
-
/* PROPS */
|
|
472
|
-
, ["data", "props"])]),
|
|
473
|
-
_: 1
|
|
474
|
-
/* STABLE */
|
|
475
|
-
|
|
476
|
-
})])]),
|
|
477
|
-
_: 1
|
|
478
|
-
/* STABLE */
|
|
481
|
+
default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_2, [_hoisted_3, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("span", null, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(layerNameTitle)), 1
|
|
482
|
+
/* TEXT */
|
|
483
|
+
)])]),
|
|
484
|
+
_: 1
|
|
485
|
+
/* STABLE */
|
|
479
486
|
|
|
480
|
-
|
|
481
|
-
|
|
487
|
+
}), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_row, {
|
|
488
|
+
class: "modelTable"
|
|
489
|
+
}, {
|
|
490
|
+
default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_table, {
|
|
491
|
+
border: "",
|
|
492
|
+
stripe: "",
|
|
493
|
+
data: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(tableData),
|
|
494
|
+
style: {
|
|
495
|
+
"width": "100%",
|
|
496
|
+
"height": "100%"
|
|
497
|
+
},
|
|
498
|
+
"cell-style": {
|
|
499
|
+
padding: '8px 0'
|
|
500
|
+
},
|
|
501
|
+
"header-cell-style": (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(headClass)
|
|
482
502
|
}, {
|
|
483
|
-
default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
"
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
"header-cell-style": (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(headClass)
|
|
495
|
-
}, {
|
|
496
|
-
default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_table_column, {
|
|
497
|
-
label: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).fieldName,
|
|
498
|
-
prop: "field",
|
|
499
|
-
align: "center"
|
|
500
|
-
}, null, 8
|
|
501
|
-
/* PROPS */
|
|
502
|
-
, ["label"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_table_column, {
|
|
503
|
-
label: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).fieldValue,
|
|
504
|
-
prop: "value",
|
|
505
|
-
align: "center"
|
|
506
|
-
}, null, 8
|
|
507
|
-
/* PROPS */
|
|
508
|
-
, ["label"])]),
|
|
509
|
-
_: 1
|
|
510
|
-
/* STABLE */
|
|
511
|
-
|
|
512
|
-
}, 8
|
|
503
|
+
default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_table_column, {
|
|
504
|
+
label: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).fieldName,
|
|
505
|
+
prop: "field",
|
|
506
|
+
align: "center"
|
|
507
|
+
}, null, 8
|
|
508
|
+
/* PROPS */
|
|
509
|
+
, ["label"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_table_column, {
|
|
510
|
+
label: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).fieldValue,
|
|
511
|
+
prop: "value",
|
|
512
|
+
align: "center"
|
|
513
|
+
}, null, 8
|
|
513
514
|
/* PROPS */
|
|
514
|
-
, ["
|
|
515
|
+
, ["label"])]),
|
|
515
516
|
_: 1
|
|
516
517
|
/* STABLE */
|
|
517
518
|
|
|
518
|
-
}
|
|
519
|
+
}, 8
|
|
520
|
+
/* PROPS */
|
|
521
|
+
, ["data", "header-cell-style"])]),
|
|
519
522
|
_: 1
|
|
520
523
|
/* STABLE */
|
|
521
524
|
|
|
522
|
-
}), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div",
|
|
525
|
+
}), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_4, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_button, {
|
|
523
526
|
onClick: _cache[0] || (_cache[0] = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withModifiers)($event => pick(), ["stop"])),
|
|
524
527
|
title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).pick,
|
|
525
528
|
type: "primary"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.kq3d-model-select{z-index:999;border-radius:var(--kq-border-radius-base);padding:16px;pointer-events:auto;cursor:default;background-color:var(--kq-bg-color)}.kq3d-model-select .kq3d-model-select-box{
|
|
1
|
+
.kq3d-model-select{z-index:999;border-radius:var(--kq-border-radius-base);padding:16px;pointer-events:auto;cursor:default;background-color:var(--kq-bg-color)}.kq3d-model-select .kq3d-model-select-box{height:calc(100% - 35px)}.kq3d-model-select .kq3d-model-select-box .title span{font-weight:700;color:var(--kq-text-color-primary)}.kq3d-model-select .modelTable{width:100%;height:calc(100% - 70px);background-color:var(--kq-bg-color);pointer-events:auto}.kq3d-model-select .kq-row{margin-bottom:8px}.kq3d-model-select .footer-buttons{text-align:right}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@kq_npm/client3d_webgl_vue","description":"KQGIS Client3D for Vue.js","version":"3.1.
|
|
1
|
+
{"name":"@kq_npm/client3d_webgl_vue","description":"KQGIS Client3D for Vue.js","version":"3.1.4-beta","homepage":"","keywords":["KQGIS","webGL","Vue"],"browserslist":["> 1%","last 2 versions","not dead","not ie 11"],"author":"KQWEB GROUP","license":"Apache-2.0","dependencies":{"colorcolor":"^1.1.1","echarts":"^5.3.3","js-cookie":"^3.0.1","omit.js":"^2.0.2","save":"^2.5.0","tinycolor2":"^1.4.2","vue-i18n":"9.2.0-beta.36","xlsx":"^0.18.5","css-vars-ponyfill":"^2.4.8","html2canvas":"^1.4.1","xe-utils":"^3.5.4"}}
|