hy-dispatch-ui-v3 0.2.65 → 0.2.67
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/tailwind.css +51 -13
- package/es/api/organization.mjs +43 -0
- package/es/bussiness/hyAcquisitionStationTree/acquisitionStationTree.vue.mjs +245 -0
- package/es/bussiness/hyAcquisitionStationTree/index.mjs +7 -0
- package/es/bussiness/hyAcquisitionStationTree/js/index.mjs +124 -0
- package/es/bussiness/hyAcquisitionStationTree/style/acquisitionStationTree.scss +0 -0
- package/es/bussiness/hyDeviceTree/deviceTree.vue.mjs +249 -0
- package/es/bussiness/hyDeviceTree/index.mjs +7 -0
- package/es/bussiness/hyDeviceTree/js/index.mjs +126 -0
- package/es/bussiness/hyDeviceTree/style/deviceTree.scss +0 -0
- package/es/bussiness/hyOrgGroupTree/index.mjs +7 -0
- package/es/bussiness/hyOrgGroupTree/js/index.mjs +124 -0
- package/es/bussiness/hyOrgGroupTree/orgGroupTree.vue.mjs +245 -0
- package/es/bussiness/hyOrgGroupTree/style/orgGroupTree.scss +0 -0
- package/es/bussiness/hyPlanGroupDeviceTree/index.mjs +7 -0
- package/es/bussiness/hyPlanGroupDeviceTree/js/index.mjs +124 -0
- package/es/bussiness/hyPlanGroupDeviceTree/planGroupDeviceTree.vue.mjs +245 -0
- package/es/bussiness/hyPlanGroupDeviceTree/style/planGroupDeviceTree.scss +0 -0
- package/es/bussiness/hyUserTree/index.mjs +7 -0
- package/es/bussiness/hyUserTree/js/index.mjs +126 -0
- package/es/bussiness/hyUserTree/style/userTree.scss +0 -0
- package/es/bussiness/hyUserTree/userTree.vue.mjs +239 -0
- package/es/bussiness/index.mjs +5 -0
- package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +183 -149
- package/es/components/hyButton/button.vue.mjs +19 -5
- package/es/components/hyButton/style/button.scss +72 -0
- package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +1 -2
- package/es/components/hyForm/cpns/formItem.vue.mjs +254 -32
- package/es/components/hyForm/cpns/locationSelect.vue.mjs +8 -1
- package/es/components/hyForm/form.vue.mjs +88 -19
- package/es/components/hyForm/js/index.mjs +2 -1
- package/es/components/hyForm/js/useAppForm.mjs +3 -3
- package/es/components/hyIcon/style/icon.scss +1 -0
- package/es/components/hyMap/js/index.mjs +6 -6
- package/es/components/hyMap/map.vue.mjs +14 -4
- package/es/components/hyNoPermissions/noPermissions.vue.mjs +1 -1
- package/es/components/hyNoPermissionsMap/noPermissionsMap.vue.mjs +1 -1
- package/es/components/hyOrgCascader/orgCascader.vue.mjs +75 -15
- package/es/components/hyRadioGroup/radioGroup.vue.mjs +5 -4
- package/es/components/hySearch/cpns/searchItem.vue.mjs +434 -206
- package/es/components/hySearch/js/index.mjs +2 -1
- package/es/components/hySearch/search.vue.mjs +71 -10
- package/es/components/hySearch/style/search.scss +7 -0
- package/es/components/hyTable/cpns/columnSelect.vue.mjs +21 -22
- package/es/components/hyTable/cpns/virtualTable.vue.mjs +35 -21
- package/es/components/hyTable/js/index.mjs +16 -17
- package/es/components/hyTable/js/search.mjs +28 -2
- package/es/components/hyTable/style/table.scss +13 -0
- package/es/components/hyTable/table.vue.mjs +55 -22
- package/es/components/hyTableActionButton/tableActionButton.vue.mjs +17 -12
- package/es/components/hyTableForm/batchTableForm.vue.mjs +36 -5
- package/es/components/hyTableForm/js/useAppTableForm.mjs +1 -1
- package/es/components/hyTableForm/tableForm.vue.mjs +84 -32
- package/es/components/hyTour/index.mjs +7 -0
- package/es/components/hyTour/style/tour.scss +0 -0
- package/es/components/hyTour/tour.vue.mjs +23 -0
- package/es/components/hyTree/config/tree-config.mjs +5 -2
- package/es/components/hyTree/js/index.mjs +128 -56
- package/es/components/hyTree/tree.vue.mjs +22 -37
- package/es/components/index.mjs +1 -0
- package/es/index.mjs +6 -0
- package/es/static/hy-svg-icons/hy-icon-ops-linear-arrow.js +10 -0
- package/es/style/element/hy-element.scss +24 -3
- package/es/style/index.scss +0 -1
- package/es/style/tailwind.scss +0 -1
- package/es/style/theme.scss +1 -0
- package/es/utils/is.mjs +3 -1
- package/es/utils/map/hook/bigMap.mjs +11 -1
- package/es/utils/map/hook/gaode.mjs +60 -17
- package/es/utils/map/hook/leafletjs.mjs +25 -4
- package/es/utils/map/index.mjs +1 -1
- package/es/version.mjs +1 -1
- package/lib/api/organization.js +47 -0
- package/lib/bussiness/hyAcquisitionStationTree/acquisitionStationTree.vue.js +249 -0
- package/lib/bussiness/hyAcquisitionStationTree/index.js +12 -0
- package/lib/bussiness/hyAcquisitionStationTree/js/index.js +126 -0
- package/lib/bussiness/hyAcquisitionStationTree/style/acquisitionStationTree.scss +0 -0
- package/lib/bussiness/hyDeviceTree/deviceTree.vue.js +253 -0
- package/lib/bussiness/hyDeviceTree/index.js +12 -0
- package/lib/bussiness/hyDeviceTree/js/index.js +128 -0
- package/lib/bussiness/hyDeviceTree/style/deviceTree.scss +0 -0
- package/lib/bussiness/hyOrgGroupTree/index.js +12 -0
- package/lib/bussiness/hyOrgGroupTree/js/index.js +126 -0
- package/lib/bussiness/hyOrgGroupTree/orgGroupTree.vue.js +249 -0
- package/lib/bussiness/hyOrgGroupTree/style/orgGroupTree.scss +0 -0
- package/lib/bussiness/hyPlanGroupDeviceTree/index.js +12 -0
- package/lib/bussiness/hyPlanGroupDeviceTree/js/index.js +126 -0
- package/lib/bussiness/hyPlanGroupDeviceTree/planGroupDeviceTree.vue.js +249 -0
- package/lib/bussiness/hyPlanGroupDeviceTree/style/planGroupDeviceTree.scss +0 -0
- package/lib/bussiness/hyUserTree/index.js +12 -0
- package/lib/bussiness/hyUserTree/js/index.js +128 -0
- package/lib/bussiness/hyUserTree/style/userTree.scss +0 -0
- package/lib/bussiness/hyUserTree/userTree.vue.js +243 -0
- package/lib/bussiness/index.js +14 -4
- package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +182 -148
- package/lib/components/hyButton/button.vue.js +18 -4
- package/lib/components/hyButton/style/button.scss +72 -0
- package/lib/components/hyConfirmDialog/confirmDialog.vue.js +0 -1
- package/lib/components/hyForm/cpns/formItem.vue.js +250 -28
- package/lib/components/hyForm/cpns/locationSelect.vue.js +8 -1
- package/lib/components/hyForm/form.vue.js +86 -17
- package/lib/components/hyForm/js/index.js +2 -0
- package/lib/components/hyForm/js/useAppForm.js +3 -3
- package/lib/components/hyIcon/style/icon.scss +1 -0
- package/lib/components/hyMap/js/index.js +5 -5
- package/lib/components/hyMap/map.vue.js +13 -3
- package/lib/components/hyNoPermissions/noPermissions.vue.js +1 -1
- package/lib/components/hyNoPermissionsMap/noPermissionsMap.vue.js +1 -1
- package/lib/components/hyOrgCascader/orgCascader.vue.js +73 -13
- package/lib/components/hyRadioGroup/radioGroup.vue.js +5 -4
- package/lib/components/hySearch/cpns/searchItem.vue.js +431 -203
- package/lib/components/hySearch/js/index.js +2 -0
- package/lib/components/hySearch/search.vue.js +69 -8
- package/lib/components/hySearch/style/search.scss +7 -0
- package/lib/components/hyTable/cpns/columnSelect.vue.js +20 -21
- package/lib/components/hyTable/cpns/virtualTable.vue.js +51 -37
- package/lib/components/hyTable/js/index.js +16 -16
- package/lib/components/hyTable/js/search.js +28 -2
- package/lib/components/hyTable/style/table.scss +13 -0
- package/lib/components/hyTable/table.vue.js +53 -20
- package/lib/components/hyTableActionButton/tableActionButton.vue.js +16 -11
- package/lib/components/hyTableForm/batchTableForm.vue.js +36 -5
- package/lib/components/hyTableForm/js/useAppTableForm.js +1 -1
- package/lib/components/hyTableForm/tableForm.vue.js +85 -33
- package/lib/components/hyTour/index.js +12 -0
- package/lib/components/hyTour/style/tour.scss +0 -0
- package/lib/components/hyTour/tour.vue.js +27 -0
- package/lib/components/hyTree/config/tree-config.js +5 -2
- package/lib/components/hyTree/js/index.js +128 -56
- package/lib/components/hyTree/tree.vue.js +22 -37
- package/lib/components/index.js +8 -6
- package/lib/index.js +67 -55
- package/lib/static/hy-svg-icons/hy-icon-ops-linear-arrow.js +10 -0
- package/lib/style/element/hy-element.scss +24 -3
- package/lib/style/index.scss +0 -1
- package/lib/style/tailwind.scss +0 -1
- package/lib/style/theme.scss +1 -0
- package/lib/utils/is.js +5 -3
- package/lib/utils/map/hook/bigMap.js +11 -1
- package/lib/utils/map/hook/gaode.js +60 -17
- package/lib/utils/map/hook/leafletjs.js +25 -4
- package/lib/utils/map/index.js +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
package/es/style/theme.scss
CHANGED
package/es/utils/is.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { isRef, isReactive, isReadonly, isProxy } from 'vue';
|
|
2
2
|
import '../hooks/index.mjs';
|
|
3
|
+
import './index.mjs';
|
|
3
4
|
import { usePermissionMap } from '../hooks/usePermissionMap.mjs';
|
|
5
|
+
import { PERMISSION } from './permission.mjs';
|
|
4
6
|
|
|
5
7
|
const isString = (e) => typeof e === "string";
|
|
6
8
|
const isNumber = (e) => typeof e === "number";
|
|
@@ -45,7 +47,7 @@ function isPermission(permission) {
|
|
|
45
47
|
if (!permission) {
|
|
46
48
|
return true;
|
|
47
49
|
}
|
|
48
|
-
return permissionMap.value.has(permission);
|
|
50
|
+
return permissionMap.value.has(PERMISSION[`${permission}`]);
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
export { isArray, isBoolean, isEmpty, isFile, isFunction, isNull, isNumber, isObject, isOverflowing, isPermission, isString, isSupportH265, isSymbol, isUndefined, isVueProxy };
|
|
@@ -343,6 +343,8 @@ class bigMap extends EventEmitter {
|
|
|
343
343
|
off: function(target, types, fn, context) {
|
|
344
344
|
const wrappedFn = wrappedHandlers.take(types, fn);
|
|
345
345
|
return target.off(types, wrappedFn || fn, context);
|
|
346
|
+
},
|
|
347
|
+
satelliteMapFn: function() {
|
|
346
348
|
}
|
|
347
349
|
};
|
|
348
350
|
return createMapProxy(newMap, handlers);
|
|
@@ -351,7 +353,15 @@ class bigMap extends EventEmitter {
|
|
|
351
353
|
layerGroup(map, markers = []) {
|
|
352
354
|
const layerGroup = this.BM.layerGroup(markers);
|
|
353
355
|
layerGroup.addTo(map);
|
|
354
|
-
|
|
356
|
+
const handlers = {
|
|
357
|
+
addLayer: function(target, addItem) {
|
|
358
|
+
return target.addLayer(addItem);
|
|
359
|
+
},
|
|
360
|
+
clearLayers: function(target) {
|
|
361
|
+
return target.clearLayers();
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
return createMapProxy(layerGroup, handlers);
|
|
355
365
|
}
|
|
356
366
|
// 自定义图标
|
|
357
367
|
DivIcon(option) {
|
|
@@ -94,6 +94,7 @@ class Google extends EventEmitter {
|
|
|
94
94
|
return createMapProxy(polygon, handlers);
|
|
95
95
|
});
|
|
96
96
|
this.initParams = request;
|
|
97
|
+
this.layerSateGroup = null;
|
|
97
98
|
}
|
|
98
99
|
InitMap(domId, option) {
|
|
99
100
|
const { center } = option;
|
|
@@ -110,24 +111,33 @@ class Google extends EventEmitter {
|
|
|
110
111
|
resizeEnable: true
|
|
111
112
|
});
|
|
112
113
|
newMap.on("complete", (e) => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
newMap.plugin(
|
|
115
|
+
[
|
|
116
|
+
"AMap.MarkerClusterer",
|
|
117
|
+
"AMap.Scale",
|
|
118
|
+
"AMap.LayerGroup",
|
|
119
|
+
"AMap.Circle",
|
|
120
|
+
"AMap.TileLayer",
|
|
121
|
+
"AMap.GeometryUtil",
|
|
122
|
+
"AMap.MouseTool"
|
|
123
|
+
],
|
|
124
|
+
() => {
|
|
125
|
+
this.layerSateGroup = new window.AMap.LayerGroup([
|
|
126
|
+
new window.AMap.TileLayer.Satellite()
|
|
127
|
+
]);
|
|
128
|
+
this.layerSateGroup.setMap(newMap);
|
|
129
|
+
this.layerSateGroup.hide();
|
|
130
|
+
setTimeout(() => {
|
|
131
|
+
this.satelliteMapFn(newMap, option.satelliteMap);
|
|
132
|
+
if (option.completeCallbacks) {
|
|
133
|
+
option.completeCallbacks(e);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
);
|
|
116
138
|
});
|
|
117
|
-
newMap.plugin(
|
|
118
|
-
[
|
|
119
|
-
"AMap.MarkerClusterer",
|
|
120
|
-
"AMap.Scale",
|
|
121
|
-
"AMap.LayerGroup",
|
|
122
|
-
"AMap.Circle",
|
|
123
|
-
"AMap.TileLayer",
|
|
124
|
-
"AMap.GeometryUtil",
|
|
125
|
-
"AMap.MouseTool"
|
|
126
|
-
],
|
|
127
|
-
() => {
|
|
128
|
-
}
|
|
129
|
-
);
|
|
130
139
|
const wrappedHandlers = createWrappedHandlerStore();
|
|
140
|
+
const _this = this;
|
|
131
141
|
const handlers = {
|
|
132
142
|
// return 单位:m
|
|
133
143
|
distance: function(target, latAndlng1, latAndlng2) {
|
|
@@ -178,15 +188,48 @@ class Google extends EventEmitter {
|
|
|
178
188
|
// // 四个角
|
|
179
189
|
getBounds: function(target) {
|
|
180
190
|
return wrapBounds(target);
|
|
191
|
+
},
|
|
192
|
+
/* 判断地图颜色 */
|
|
193
|
+
satelliteMapFn: function(target, satelliteMap) {
|
|
194
|
+
if (satelliteMap === 3) {
|
|
195
|
+
_this.layerSateGroup.show();
|
|
196
|
+
} else {
|
|
197
|
+
if (satelliteMap === 1) {
|
|
198
|
+
target.setMapStyle(_this.initParams.defaultMapStyle);
|
|
199
|
+
} else {
|
|
200
|
+
target.setMapStyle(_this.initParams.currencyMapStyle);
|
|
201
|
+
}
|
|
202
|
+
_this.layerSateGroup.hide();
|
|
203
|
+
}
|
|
181
204
|
}
|
|
182
205
|
};
|
|
183
206
|
return createMapProxy(newMap, handlers);
|
|
184
207
|
}
|
|
208
|
+
satelliteMapFn(map, satelliteMap) {
|
|
209
|
+
if (satelliteMap === 3) {
|
|
210
|
+
this.layerSateGroup.show();
|
|
211
|
+
} else {
|
|
212
|
+
if (satelliteMap === 1) {
|
|
213
|
+
map.setMapStyle(this.initParams.defaultMapStyle);
|
|
214
|
+
} else {
|
|
215
|
+
map.setMapStyle(this.initParams.currencyMapStyle);
|
|
216
|
+
}
|
|
217
|
+
this.layerSateGroup.hide();
|
|
218
|
+
}
|
|
219
|
+
}
|
|
185
220
|
// 地图图层
|
|
186
221
|
layerGroup(map, markers = []) {
|
|
187
222
|
const layerGroup = new window.AMap.LayerGroup(markers);
|
|
188
223
|
layerGroup.setMap(map);
|
|
189
|
-
|
|
224
|
+
const handlers = {
|
|
225
|
+
addLayer: function(target, addItem) {
|
|
226
|
+
return target.addLayer(addItem);
|
|
227
|
+
},
|
|
228
|
+
clearLayers: function(target) {
|
|
229
|
+
return target.clearLayers();
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
return createMapProxy(layerGroup, handlers);
|
|
190
233
|
}
|
|
191
234
|
// 自定义图标
|
|
192
235
|
DivIcon(option) {
|
|
@@ -306,6 +306,7 @@ class Leafletjs extends EventEmitter {
|
|
|
306
306
|
return createMapProxy(polygon, handlers);
|
|
307
307
|
});
|
|
308
308
|
this.initParams = request;
|
|
309
|
+
this.tileLayerList = [];
|
|
309
310
|
}
|
|
310
311
|
// 初始化地图
|
|
311
312
|
InitMap(domId, option) {
|
|
@@ -325,6 +326,7 @@ class Leafletjs extends EventEmitter {
|
|
|
325
326
|
const newMap = L.map(domId, option);
|
|
326
327
|
newMap.getInitMap = () => newMap;
|
|
327
328
|
const wrappedHandlers = createWrappedHandlerStore();
|
|
329
|
+
const _this = this;
|
|
328
330
|
const handlers = {
|
|
329
331
|
// 删除地图
|
|
330
332
|
removeMap: function(target, params) {
|
|
@@ -400,6 +402,10 @@ class Leafletjs extends EventEmitter {
|
|
|
400
402
|
off: function(target, types, fn, context) {
|
|
401
403
|
const wrappedFn = wrappedHandlers.take(types, fn);
|
|
402
404
|
return target.off(types, wrappedFn || fn, context);
|
|
405
|
+
},
|
|
406
|
+
/* 判断地图颜色 */
|
|
407
|
+
satelliteMapFn: function(target, satelliteMap) {
|
|
408
|
+
_this.setLayersUrl(target, satelliteMap !== 2);
|
|
403
409
|
}
|
|
404
410
|
};
|
|
405
411
|
const map = createMapProxy(newMap, handlers);
|
|
@@ -409,7 +415,7 @@ class Leafletjs extends EventEmitter {
|
|
|
409
415
|
option.completeCallbacks();
|
|
410
416
|
}
|
|
411
417
|
});
|
|
412
|
-
this.setLayersUrl(map);
|
|
418
|
+
this.setLayersUrl(map, option.satelliteMap !== 2);
|
|
413
419
|
return map;
|
|
414
420
|
}
|
|
415
421
|
// 设置地图瓦片地址
|
|
@@ -424,12 +430,18 @@ class Leafletjs extends EventEmitter {
|
|
|
424
430
|
if (mapServerType === "WMTS" || mapServerType === "Dynamic") {
|
|
425
431
|
return this.createLayers(map, layersUrls);
|
|
426
432
|
}
|
|
433
|
+
this.tileLayerList.forEach((tileLayer) => {
|
|
434
|
+
tileLayer?.remove();
|
|
435
|
+
});
|
|
436
|
+
this.tileLayerList = [];
|
|
427
437
|
layersUrls.split(",").forEach((layersUrl) => {
|
|
438
|
+
let tileLayer = null;
|
|
428
439
|
if (changeColorType) {
|
|
429
|
-
this.createCustomLayers(map, layersUrl);
|
|
440
|
+
tileLayer = this.createCustomLayers(map, layersUrl);
|
|
430
441
|
} else {
|
|
431
|
-
this.createLayers(map, layersUrl);
|
|
442
|
+
tileLayer = this.createLayers(map, layersUrl);
|
|
432
443
|
}
|
|
444
|
+
this.tileLayerList.push(tileLayer);
|
|
433
445
|
});
|
|
434
446
|
}
|
|
435
447
|
// 超图 WMTS 图层(不适用所有的WMTS图层,目前仅支持超图WMTS,因不同的WMTS服务规范不一样,主要体现在路由访问参数)
|
|
@@ -550,7 +562,16 @@ class Leafletjs extends EventEmitter {
|
|
|
550
562
|
}
|
|
551
563
|
// 地图图层
|
|
552
564
|
layerGroup(map, markers = []) {
|
|
553
|
-
|
|
565
|
+
const layerGroup = L.layerGroup(markers).addTo(getInitMap(map));
|
|
566
|
+
const handlers = {
|
|
567
|
+
addLayer: function(target, addItem) {
|
|
568
|
+
return target.addLayer(addItem);
|
|
569
|
+
},
|
|
570
|
+
clearLayers: function(target) {
|
|
571
|
+
return target.clearLayers();
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
return createMapProxy(layerGroup, handlers);
|
|
554
575
|
}
|
|
555
576
|
// 自定义图标
|
|
556
577
|
DivIcon(option) {
|
package/es/utils/map/index.mjs
CHANGED
package/es/version.mjs
CHANGED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('../hooks/index.js');
|
|
4
|
+
var vue = require('vue');
|
|
5
|
+
var useLocale = require('../hooks/useLocale.js');
|
|
6
|
+
var useApi = require('../hooks/useApi.js');
|
|
7
|
+
|
|
8
|
+
function orgListWithDev3Api(params) {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
const { t } = useLocale.useLocale();
|
|
11
|
+
const { api } = useApi.useApi();
|
|
12
|
+
const http = vue.unref(api);
|
|
13
|
+
http.post("organization/orgTree", params).then((res) => {
|
|
14
|
+
resolve(res.data);
|
|
15
|
+
}).catch((res) => {
|
|
16
|
+
reject(new Error(t("interfaceError")));
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function orgTreeWithGroupAndDeviceApi(params) {
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
22
|
+
const { t } = useLocale.useLocale();
|
|
23
|
+
const { api } = useApi.useApi();
|
|
24
|
+
const http = vue.unref(api);
|
|
25
|
+
http.post("organization/orgTreeWithGroupAndDevice", params).then((res) => {
|
|
26
|
+
return resolve(res.data);
|
|
27
|
+
}).catch((res) => {
|
|
28
|
+
reject(new Error(t("interfaceError")));
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function orgTreeWithPlanGroupAndDeviceApi(params) {
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
const { t } = useLocale.useLocale();
|
|
35
|
+
const { api } = useApi.useApi();
|
|
36
|
+
const http = vue.unref(api);
|
|
37
|
+
http.post("organization/orgTreeWithPlanGroupAndDevice", params).then((res) => {
|
|
38
|
+
return resolve(res.data);
|
|
39
|
+
}).catch((res) => {
|
|
40
|
+
reject(new Error(t("interfaceError")));
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
exports.orgListWithDev3Api = orgListWithDev3Api;
|
|
46
|
+
exports.orgTreeWithGroupAndDeviceApi = orgTreeWithGroupAndDeviceApi;
|
|
47
|
+
exports.orgTreeWithPlanGroupAndDeviceApi = orgTreeWithPlanGroupAndDeviceApi;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
require('../../components/index.js');
|
|
7
|
+
require('../../hooks/index.js');
|
|
8
|
+
var index = require('./js/index.js');
|
|
9
|
+
var useMixins = require('../../hooks/useMixins.js');
|
|
10
|
+
var index$1 = require('../../components/hyTree/index.js');
|
|
11
|
+
|
|
12
|
+
import "./style/acquisitionStationTree.scss";
|
|
13
|
+
|
|
14
|
+
const __default__ = vue.defineComponent({
|
|
15
|
+
name: "HyAcquisitionStationTree"
|
|
16
|
+
});
|
|
17
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
18
|
+
props: {
|
|
19
|
+
// 数据获取类型 custom 自定义数据
|
|
20
|
+
type: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "default"
|
|
23
|
+
},
|
|
24
|
+
// 请求的额外参数
|
|
25
|
+
requestParams: {
|
|
26
|
+
type: Object,
|
|
27
|
+
default: () => ({})
|
|
28
|
+
},
|
|
29
|
+
/* 禁止选择 */
|
|
30
|
+
disableSelection: {
|
|
31
|
+
type: Array,
|
|
32
|
+
default: () => {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
// 是否开启按照设备在线和离线状态排序,仅支持 device 和 groupDevice 业务类型
|
|
37
|
+
deviceOrderSort: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true
|
|
40
|
+
},
|
|
41
|
+
// 设置勤务状态
|
|
42
|
+
getDutyRoster: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
// 仅展示在线数据
|
|
47
|
+
showOnlineOnly: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false
|
|
50
|
+
},
|
|
51
|
+
/* 是否开启多选框 */
|
|
52
|
+
showCheckbox: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true
|
|
55
|
+
},
|
|
56
|
+
/* 是否开启单选框 */
|
|
57
|
+
showSinglebox: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false
|
|
60
|
+
},
|
|
61
|
+
// 是否清除无数据的部门
|
|
62
|
+
clearEmptyBusiness: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false
|
|
65
|
+
},
|
|
66
|
+
// 是否显示通道节点的选择框
|
|
67
|
+
isShowChannelSelect: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false
|
|
70
|
+
},
|
|
71
|
+
// 是否显示自定义空数据显示
|
|
72
|
+
showCustomEmpty: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: false
|
|
75
|
+
},
|
|
76
|
+
placeholder: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: "\u8BF7\u8F93\u5165"
|
|
79
|
+
},
|
|
80
|
+
// 是否返回默认选择的数据
|
|
81
|
+
isBackDefaultSelected: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: false
|
|
84
|
+
},
|
|
85
|
+
/* 默认选中列表 */
|
|
86
|
+
selectedByDefault: {
|
|
87
|
+
type: Array,
|
|
88
|
+
default: () => {
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
// 默认需要选中的部门ID
|
|
93
|
+
defaultSelectedOrgID: {
|
|
94
|
+
default: null
|
|
95
|
+
},
|
|
96
|
+
// 搜索类型
|
|
97
|
+
searchType: {
|
|
98
|
+
type: Number,
|
|
99
|
+
default: 1
|
|
100
|
+
},
|
|
101
|
+
// 筛选列表
|
|
102
|
+
selectFilterList: {
|
|
103
|
+
type: Array,
|
|
104
|
+
default: () => []
|
|
105
|
+
},
|
|
106
|
+
// 是否高亮选中节点
|
|
107
|
+
highlight: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: false
|
|
110
|
+
},
|
|
111
|
+
// 是否严格的遵循父子不互相关联
|
|
112
|
+
checkStrictly: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
default: false
|
|
115
|
+
},
|
|
116
|
+
// 单选时可以取消选中
|
|
117
|
+
cancelable: {
|
|
118
|
+
type: Boolean,
|
|
119
|
+
default: true
|
|
120
|
+
},
|
|
121
|
+
// 是否显示多选框或单选框
|
|
122
|
+
showSelectBox: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: true
|
|
125
|
+
},
|
|
126
|
+
// 是否在点击节点的时候展开或者收缩节点
|
|
127
|
+
expandOnClickNode: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
default: true
|
|
130
|
+
},
|
|
131
|
+
// 是否在点击节点的时候选中节点
|
|
132
|
+
checkOnClickNode: {
|
|
133
|
+
type: Boolean,
|
|
134
|
+
default: false
|
|
135
|
+
},
|
|
136
|
+
// 点击叶节点(最后一个子节点)时是否检查或取消节点
|
|
137
|
+
checkOnClickLeaf: {
|
|
138
|
+
type: Boolean,
|
|
139
|
+
default: true
|
|
140
|
+
},
|
|
141
|
+
// 双击父节点会触发选中功能
|
|
142
|
+
checkOnDblclickParentNode: {
|
|
143
|
+
type: Boolean,
|
|
144
|
+
default: true
|
|
145
|
+
},
|
|
146
|
+
// 初始化过滤数据
|
|
147
|
+
filterConfig: {
|
|
148
|
+
type: Array,
|
|
149
|
+
default: () => []
|
|
150
|
+
},
|
|
151
|
+
// 外部自定义过滤函数
|
|
152
|
+
filterMethod: {
|
|
153
|
+
type: Function,
|
|
154
|
+
default: null
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
emits: [
|
|
158
|
+
"on-load",
|
|
159
|
+
"onRefreshData",
|
|
160
|
+
"on-click-delete",
|
|
161
|
+
"on-click",
|
|
162
|
+
"on-check-tree",
|
|
163
|
+
"on-department-click",
|
|
164
|
+
"on-click-device",
|
|
165
|
+
"on-contextmenu",
|
|
166
|
+
"on-dblclick",
|
|
167
|
+
"on-selectedDataList"
|
|
168
|
+
],
|
|
169
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
170
|
+
const props = __props;
|
|
171
|
+
const emits = __emit;
|
|
172
|
+
const slots = vue.useSlots();
|
|
173
|
+
const {
|
|
174
|
+
containerRef,
|
|
175
|
+
hyTreeRef,
|
|
176
|
+
treeHeight,
|
|
177
|
+
setData,
|
|
178
|
+
getData,
|
|
179
|
+
onClickDelete,
|
|
180
|
+
onClick,
|
|
181
|
+
onCheckTree,
|
|
182
|
+
onDepartmentClick,
|
|
183
|
+
onClickDevice,
|
|
184
|
+
onContextmenu,
|
|
185
|
+
onDblclick,
|
|
186
|
+
onSelectedDataList,
|
|
187
|
+
singleRemovalFn,
|
|
188
|
+
setCheckedKeys,
|
|
189
|
+
setChecked,
|
|
190
|
+
getSelectedDataList,
|
|
191
|
+
refreshData,
|
|
192
|
+
getNode
|
|
193
|
+
} = useMixins.useMixins({ props, emits }, [index.useAcquisitionStationTree]);
|
|
194
|
+
__expose({
|
|
195
|
+
getData,
|
|
196
|
+
singleRemovalFn,
|
|
197
|
+
setCheckedKeys,
|
|
198
|
+
setChecked,
|
|
199
|
+
getSelectedDataList,
|
|
200
|
+
refreshData,
|
|
201
|
+
getNode
|
|
202
|
+
});
|
|
203
|
+
return (_ctx, _cache) => {
|
|
204
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
205
|
+
"div",
|
|
206
|
+
{
|
|
207
|
+
ref_key: "containerRef",
|
|
208
|
+
ref: containerRef,
|
|
209
|
+
class: "w-full h-full"
|
|
210
|
+
},
|
|
211
|
+
[
|
|
212
|
+
vue.createCommentVNode(" HyAcquisitionStationTree \u91C7\u96C6\u7AD9\u6811\u5F62 "),
|
|
213
|
+
vue.createVNode(vue.unref(index$1.HyTree), vue.mergeProps({
|
|
214
|
+
ref_key: "hyTreeRef",
|
|
215
|
+
ref: hyTreeRef
|
|
216
|
+
}, { ...props }, {
|
|
217
|
+
treeType: "cs",
|
|
218
|
+
treeHeight: vue.unref(treeHeight),
|
|
219
|
+
onOnRefreshData: vue.unref(setData),
|
|
220
|
+
onOnClickDelete: vue.unref(onClickDelete),
|
|
221
|
+
onOnClick: vue.unref(onClick),
|
|
222
|
+
onOnCheckTree: vue.unref(onCheckTree),
|
|
223
|
+
onOnDepartmentClick: vue.unref(onDepartmentClick),
|
|
224
|
+
onOnClickDevice: vue.unref(onClickDevice),
|
|
225
|
+
onOnContextmenu: vue.unref(onContextmenu),
|
|
226
|
+
onOnDblclick: vue.unref(onDblclick),
|
|
227
|
+
onOnSelectedDataList: vue.unref(onSelectedDataList)
|
|
228
|
+
}), vue.createSlots({
|
|
229
|
+
_: 2
|
|
230
|
+
/* DYNAMIC */
|
|
231
|
+
}, [
|
|
232
|
+
vue.renderList(vue.unref(slots), (_, slotName) => {
|
|
233
|
+
return {
|
|
234
|
+
name: slotName,
|
|
235
|
+
fn: vue.withCtx((scope) => [
|
|
236
|
+
vue.renderSlot(_ctx.$slots, slotName, vue.normalizeProps(vue.guardReactiveProps(scope)))
|
|
237
|
+
])
|
|
238
|
+
};
|
|
239
|
+
})
|
|
240
|
+
]), 1040, ["treeHeight", "onOnRefreshData", "onOnClickDelete", "onOnClick", "onOnCheckTree", "onOnDepartmentClick", "onOnClickDevice", "onOnContextmenu", "onOnDblclick", "onOnSelectedDataList"])
|
|
241
|
+
],
|
|
242
|
+
512
|
|
243
|
+
/* NEED_PATCH */
|
|
244
|
+
);
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var acquisitionStationTree = require('./acquisitionStationTree.vue.js');
|
|
6
|
+
require('../../utils/index.js');
|
|
7
|
+
var handler = require('../../utils/handler.js');
|
|
8
|
+
|
|
9
|
+
const HyAcquisitionStationTree = handler.withInstall(acquisitionStationTree.default);
|
|
10
|
+
|
|
11
|
+
exports.HyAcquisitionStationTree = HyAcquisitionStationTree;
|
|
12
|
+
exports.default = HyAcquisitionStationTree;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var organization = require('../../../api/organization.js');
|
|
5
|
+
|
|
6
|
+
function useAcquisitionStationTree(hy) {
|
|
7
|
+
const emits = hy.emits;
|
|
8
|
+
const props = hy.props;
|
|
9
|
+
const hyTreeRef = vue.useTemplateRef("hyTreeRef");
|
|
10
|
+
const containerRef = vue.useTemplateRef("containerRef");
|
|
11
|
+
const treeHeight = vue.ref(400);
|
|
12
|
+
let resizeObserver;
|
|
13
|
+
function updateTreeHeight() {
|
|
14
|
+
const height = hy.containerRef.value?.getBoundingClientRect().height;
|
|
15
|
+
if (height > 0 && height - 12 !== hy.treeHeight.value) {
|
|
16
|
+
hy.treeHeight.value = Math.round(height) - 12;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
async function setData() {
|
|
20
|
+
if (props.type === "custom") {
|
|
21
|
+
emits("onRefreshData");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const data = await organization.orgListWithDev3Api({
|
|
25
|
+
...props.requestParams
|
|
26
|
+
});
|
|
27
|
+
hy.hyTreeRef.value.getData(data).then(() => {
|
|
28
|
+
emits("on-load");
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function getData(data) {
|
|
32
|
+
return new Promise((resolve) => {
|
|
33
|
+
hy.hyTreeRef.value.getData(data).then(() => {
|
|
34
|
+
emits("on-load");
|
|
35
|
+
resolve(200);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
vue.onMounted(() => {
|
|
40
|
+
if (props.type !== "custom") {
|
|
41
|
+
hy.setData();
|
|
42
|
+
}
|
|
43
|
+
vue.nextTick(() => {
|
|
44
|
+
hy.updateTreeHeight();
|
|
45
|
+
if (typeof ResizeObserver === "function" && hy.containerRef.value) {
|
|
46
|
+
hy.resizeObserver = new ResizeObserver(hy.updateTreeHeight);
|
|
47
|
+
hy.resizeObserver.observe(hy.containerRef.value);
|
|
48
|
+
} else if (typeof window !== "undefined") {
|
|
49
|
+
window.addEventListener("resize", hy.updateTreeHeight);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
vue.onUnmounted(() => {
|
|
54
|
+
hy.resizeObserver?.disconnect();
|
|
55
|
+
if (typeof window !== "undefined") {
|
|
56
|
+
window.removeEventListener("resize", hy.updateTreeHeight);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
function onClickDelete(data) {
|
|
60
|
+
emits("on-click-delete", data);
|
|
61
|
+
}
|
|
62
|
+
function onClick(data) {
|
|
63
|
+
emits("on-click", data);
|
|
64
|
+
}
|
|
65
|
+
function onCheckTree(list, checkObj) {
|
|
66
|
+
emits("on-check-tree", list, checkObj);
|
|
67
|
+
}
|
|
68
|
+
function onDepartmentClick(data) {
|
|
69
|
+
emits("on-department-click", data);
|
|
70
|
+
}
|
|
71
|
+
function onClickDevice(data) {
|
|
72
|
+
emits("on-click-device", data);
|
|
73
|
+
}
|
|
74
|
+
function onContextmenu(data) {
|
|
75
|
+
emits("on-contextmenu", data);
|
|
76
|
+
}
|
|
77
|
+
function onDblclick(list) {
|
|
78
|
+
emits("on-dblclick", list);
|
|
79
|
+
}
|
|
80
|
+
function onSelectedDataList(list) {
|
|
81
|
+
emits("on-selectedDataList", list);
|
|
82
|
+
}
|
|
83
|
+
function singleRemovalFn(row, isForce = false) {
|
|
84
|
+
hy.hyTreeRef.value.singleRemovalFn(row, isForce);
|
|
85
|
+
}
|
|
86
|
+
function setCheckedKeys(dataList, isForce = false) {
|
|
87
|
+
hy.hyTreeRef.value.setCheckedKeys(dataList, isForce);
|
|
88
|
+
}
|
|
89
|
+
function setChecked(data, type = true) {
|
|
90
|
+
hy.hyTreeRef.value.setChecked(data, type);
|
|
91
|
+
}
|
|
92
|
+
function getSelectedDataList(leafOnly = false) {
|
|
93
|
+
return hy.hyTreeRef.value.getSelectedDataList(leafOnly);
|
|
94
|
+
}
|
|
95
|
+
function refreshData() {
|
|
96
|
+
hy.hyTreeRef.value.refreshData();
|
|
97
|
+
}
|
|
98
|
+
function getNode(id) {
|
|
99
|
+
return hy.hyTreeRef.value.getNode(id);
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
hyTreeRef,
|
|
103
|
+
containerRef,
|
|
104
|
+
treeHeight,
|
|
105
|
+
resizeObserver,
|
|
106
|
+
updateTreeHeight,
|
|
107
|
+
setData,
|
|
108
|
+
getData,
|
|
109
|
+
onClickDelete,
|
|
110
|
+
onClick,
|
|
111
|
+
onCheckTree,
|
|
112
|
+
onDepartmentClick,
|
|
113
|
+
onClickDevice,
|
|
114
|
+
onContextmenu,
|
|
115
|
+
onDblclick,
|
|
116
|
+
onSelectedDataList,
|
|
117
|
+
singleRemovalFn,
|
|
118
|
+
setCheckedKeys,
|
|
119
|
+
setChecked,
|
|
120
|
+
getSelectedDataList,
|
|
121
|
+
refreshData,
|
|
122
|
+
getNode
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
exports.useAcquisitionStationTree = useAcquisitionStationTree;
|
|
File without changes
|