hy-dispatch-ui-v3 0.2.64 → 0.2.66
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 +26 -12
- 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 +18 -16
- package/es/components/hyButton/button.vue.mjs +3 -2
- package/es/components/hyButton/style/button.scss +70 -0
- package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +1 -2
- package/es/components/hyForm/cpns/formItem.vue.mjs +198 -26
- package/es/components/hyForm/cpns/locationSelect.vue.mjs +8 -1
- package/es/components/hyForm/form.vue.mjs +74 -19
- package/es/components/hyForm/js/index.mjs +2 -1
- package/es/components/hyForm/js/useAppForm.mjs +2 -2
- package/es/components/hyIcon/style/icon.scss +1 -0
- 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 +69 -14
- package/es/components/hyRadioGroup/radioGroup.vue.mjs +5 -4
- package/es/components/hySearch/cpns/searchItem.vue.mjs +167 -11
- package/es/components/hySearch/js/index.mjs +2 -1
- package/es/components/hySearch/search.vue.mjs +60 -9
- package/es/components/hyTable/cpns/columnSelect.vue.mjs +21 -22
- package/es/components/hyTable/cpns/virtualTable.vue.mjs +10 -15
- package/es/components/hyTable/js/index.mjs +5 -12
- package/es/components/hyTable/js/search.mjs +3 -1
- package/es/components/hyTable/style/table.scss +13 -0
- package/es/components/hyTable/table.vue.mjs +21 -9
- package/es/components/hyTableActionButton/tableActionButton.vue.mjs +8 -10
- package/es/components/hyTableForm/batchTableForm.vue.mjs +13 -3
- package/es/components/hyTableForm/tableForm.vue.mjs +17 -11
- 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 +75 -68
- package/es/components/hyTree/tree.vue.mjs +19 -36
- 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/theme.scss +1 -0
- package/es/utils/map/hook/bigMap.mjs +9 -1
- package/es/utils/map/hook/gaode.mjs +9 -1
- package/es/utils/map/hook/leafletjs.mjs +10 -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 +18 -16
- package/lib/components/hyButton/button.vue.js +3 -2
- package/lib/components/hyButton/style/button.scss +70 -0
- package/lib/components/hyConfirmDialog/confirmDialog.vue.js +0 -1
- package/lib/components/hyForm/cpns/formItem.vue.js +195 -23
- package/lib/components/hyForm/cpns/locationSelect.vue.js +8 -1
- package/lib/components/hyForm/form.vue.js +72 -17
- package/lib/components/hyForm/js/index.js +2 -0
- package/lib/components/hyForm/js/useAppForm.js +2 -2
- package/lib/components/hyIcon/style/icon.scss +1 -0
- 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 +67 -12
- package/lib/components/hyRadioGroup/radioGroup.vue.js +5 -4
- package/lib/components/hySearch/cpns/searchItem.vue.js +164 -8
- package/lib/components/hySearch/js/index.js +2 -0
- package/lib/components/hySearch/search.vue.js +58 -7
- package/lib/components/hyTable/cpns/columnSelect.vue.js +20 -21
- package/lib/components/hyTable/cpns/virtualTable.vue.js +27 -32
- package/lib/components/hyTable/js/index.js +5 -12
- package/lib/components/hyTable/js/search.js +3 -1
- package/lib/components/hyTable/style/table.scss +13 -0
- package/lib/components/hyTable/table.vue.js +20 -8
- package/lib/components/hyTableActionButton/tableActionButton.vue.js +7 -9
- package/lib/components/hyTableForm/batchTableForm.vue.js +13 -3
- package/lib/components/hyTableForm/tableForm.vue.js +18 -12
- 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 +75 -68
- package/lib/components/hyTree/tree.vue.js +19 -36
- 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/theme.scss +1 -0
- package/lib/utils/map/hook/bigMap.js +9 -1
- package/lib/utils/map/hook/gaode.js +9 -1
- package/lib/utils/map/hook/leafletjs.js +10 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var organization = require('../../../api/organization.js');
|
|
5
|
+
|
|
6
|
+
function useDeviceTree(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
|
+
showDevice: true,
|
|
26
|
+
showGroup: false,
|
|
27
|
+
...props.requestParams
|
|
28
|
+
});
|
|
29
|
+
hy.hyTreeRef.value.getData(data).then(() => {
|
|
30
|
+
emits("on-load");
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function getData(data) {
|
|
34
|
+
return new Promise((resolve) => {
|
|
35
|
+
hy.hyTreeRef.value.getData(data).then(() => {
|
|
36
|
+
emits("on-load");
|
|
37
|
+
resolve(200);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
vue.onMounted(() => {
|
|
42
|
+
if (props.type !== "custom") {
|
|
43
|
+
hy.setData();
|
|
44
|
+
}
|
|
45
|
+
vue.nextTick(() => {
|
|
46
|
+
hy.updateTreeHeight();
|
|
47
|
+
if (typeof ResizeObserver === "function" && hy.containerRef.value) {
|
|
48
|
+
hy.resizeObserver = new ResizeObserver(hy.updateTreeHeight);
|
|
49
|
+
hy.resizeObserver.observe(hy.containerRef.value);
|
|
50
|
+
} else if (typeof window !== "undefined") {
|
|
51
|
+
window.addEventListener("resize", hy.updateTreeHeight);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
vue.onUnmounted(() => {
|
|
56
|
+
hy.resizeObserver?.disconnect();
|
|
57
|
+
if (typeof window !== "undefined") {
|
|
58
|
+
window.removeEventListener("resize", hy.updateTreeHeight);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
function onClickDelete(data) {
|
|
62
|
+
emits("on-click-delete", data);
|
|
63
|
+
}
|
|
64
|
+
function onClick(data) {
|
|
65
|
+
emits("on-click", data);
|
|
66
|
+
}
|
|
67
|
+
function onCheckTree(list, checkObj) {
|
|
68
|
+
emits("on-check-tree", list, checkObj);
|
|
69
|
+
}
|
|
70
|
+
function onDepartmentClick(data) {
|
|
71
|
+
emits("on-department-click", data);
|
|
72
|
+
}
|
|
73
|
+
function onClickDevice(data) {
|
|
74
|
+
emits("on-click-device", data);
|
|
75
|
+
}
|
|
76
|
+
function onContextmenu(data) {
|
|
77
|
+
emits("on-contextmenu", data);
|
|
78
|
+
}
|
|
79
|
+
function onDblclick(list) {
|
|
80
|
+
emits("on-dblclick", list);
|
|
81
|
+
}
|
|
82
|
+
function onSelectedDataList(list) {
|
|
83
|
+
emits("on-selectedDataList", list);
|
|
84
|
+
}
|
|
85
|
+
function singleRemovalFn(row, isForce = false) {
|
|
86
|
+
hy.hyTreeRef.value.singleRemovalFn(row, isForce);
|
|
87
|
+
}
|
|
88
|
+
function setCheckedKeys(dataList, isForce = false) {
|
|
89
|
+
hy.hyTreeRef.value.setCheckedKeys(dataList, isForce);
|
|
90
|
+
}
|
|
91
|
+
function setChecked(data, type = true) {
|
|
92
|
+
hy.hyTreeRef.value.setChecked(data, type);
|
|
93
|
+
}
|
|
94
|
+
function getSelectedDataList(leafOnly = false) {
|
|
95
|
+
return hy.hyTreeRef.value.getSelectedDataList(leafOnly);
|
|
96
|
+
}
|
|
97
|
+
function refreshData() {
|
|
98
|
+
hy.hyTreeRef.value.refreshData();
|
|
99
|
+
}
|
|
100
|
+
function getNode(id) {
|
|
101
|
+
return hy.hyTreeRef.value.getNode(id);
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
hyTreeRef,
|
|
105
|
+
containerRef,
|
|
106
|
+
treeHeight,
|
|
107
|
+
resizeObserver,
|
|
108
|
+
updateTreeHeight,
|
|
109
|
+
setData,
|
|
110
|
+
getData,
|
|
111
|
+
onClickDelete,
|
|
112
|
+
onClick,
|
|
113
|
+
onCheckTree,
|
|
114
|
+
onDepartmentClick,
|
|
115
|
+
onClickDevice,
|
|
116
|
+
onContextmenu,
|
|
117
|
+
onDblclick,
|
|
118
|
+
onSelectedDataList,
|
|
119
|
+
singleRemovalFn,
|
|
120
|
+
setCheckedKeys,
|
|
121
|
+
setChecked,
|
|
122
|
+
getSelectedDataList,
|
|
123
|
+
refreshData,
|
|
124
|
+
getNode
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
exports.useDeviceTree = useDeviceTree;
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var orgGroupTree = require('./orgGroupTree.vue.js');
|
|
6
|
+
require('../../utils/index.js');
|
|
7
|
+
var handler = require('../../utils/handler.js');
|
|
8
|
+
|
|
9
|
+
const HyOrgGroupTree = handler.withInstall(orgGroupTree.default);
|
|
10
|
+
|
|
11
|
+
exports.HyOrgGroupTree = HyOrgGroupTree;
|
|
12
|
+
exports.default = HyOrgGroupTree;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var organization = require('../../../api/organization.js');
|
|
5
|
+
|
|
6
|
+
function useOrgGroupTree(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.orgTreeWithGroupAndDeviceApi({
|
|
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.useOrgGroupTree = useOrgGroupTree;
|
|
@@ -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/orgGroupTree.scss";
|
|
13
|
+
|
|
14
|
+
const __default__ = vue.defineComponent({
|
|
15
|
+
name: "HyOrgGroupTree"
|
|
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.useOrgGroupTree]);
|
|
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(" HyOrgGroupTree \u7FA4\u7EC4\u6811\u5F62 "),
|
|
213
|
+
vue.createVNode(vue.unref(index$1.HyTree), vue.mergeProps({
|
|
214
|
+
ref_key: "hyTreeRef",
|
|
215
|
+
ref: hyTreeRef
|
|
216
|
+
}, { ...props }, {
|
|
217
|
+
treeType: "group",
|
|
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;
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var planGroupDeviceTree = require('./planGroupDeviceTree.vue.js');
|
|
6
|
+
require('../../utils/index.js');
|
|
7
|
+
var handler = require('../../utils/handler.js');
|
|
8
|
+
|
|
9
|
+
const HyPlanGroupDeviceTree = handler.withInstall(planGroupDeviceTree.default);
|
|
10
|
+
|
|
11
|
+
exports.HyPlanGroupDeviceTree = HyPlanGroupDeviceTree;
|
|
12
|
+
exports.default = HyPlanGroupDeviceTree;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var organization = require('../../../api/organization.js');
|
|
5
|
+
|
|
6
|
+
function usePlanGroupDeviceTree(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.orgTreeWithPlanGroupAndDeviceApi({
|
|
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.usePlanGroupDeviceTree = usePlanGroupDeviceTree;
|