hy-dispatch-ui-v3 0.2.84 → 0.2.86
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 +54 -0
- package/es/bussiness/hyDeviceTree/deviceTree.vue.mjs +5 -0
- package/es/bussiness/hyDeviceTree/js/index.mjs +15 -5
- package/es/bussiness/hySelectDeviceTree/cpns/deviceItem.install.mjs +6 -0
- package/es/bussiness/hySelectDeviceTree/cpns/deviceItem.vue.mjs +113 -0
- package/es/bussiness/hySelectDeviceTree/index.mjs +7 -0
- package/es/bussiness/hySelectDeviceTree/js/index.mjs +35 -0
- package/es/bussiness/hySelectDeviceTree/selectDeviceTree.install.mjs +6 -0
- package/es/bussiness/hySelectDeviceTree/selectDeviceTree.vue.mjs +163 -0
- package/es/bussiness/hySelectDeviceTree/style/selectDeviceTree.scss +0 -0
- package/es/bussiness/index.mjs +1 -0
- package/es/components/hyForm/cpns/formItem.vue.mjs +493 -426
- package/es/components/hyForm/form.vue.mjs +12 -0
- package/es/components/hyIcon/icon.vue.mjs +10 -4
- package/es/components-map.mjs +1 -0
- package/es/index.mjs +2 -0
- package/es/utils/device.mjs +42 -0
- package/es/utils/index.mjs +1 -0
- package/es/version.mjs +1 -1
- package/lib/bussiness/hyDeviceTree/deviceTree.vue.js +5 -0
- package/lib/bussiness/hyDeviceTree/js/index.js +15 -5
- package/lib/bussiness/hySelectDeviceTree/cpns/deviceItem.install.js +6 -0
- package/lib/bussiness/hySelectDeviceTree/cpns/deviceItem.vue.js +117 -0
- package/lib/bussiness/hySelectDeviceTree/index.js +12 -0
- package/lib/bussiness/hySelectDeviceTree/js/index.js +37 -0
- package/lib/bussiness/hySelectDeviceTree/selectDeviceTree.install.js +6 -0
- package/lib/bussiness/hySelectDeviceTree/selectDeviceTree.vue.js +167 -0
- package/lib/bussiness/hySelectDeviceTree/style/selectDeviceTree.scss +0 -0
- package/lib/bussiness/index.js +4 -2
- package/lib/components/hyForm/cpns/formItem.vue.js +492 -425
- package/lib/components/hyForm/form.vue.js +12 -0
- package/lib/components/hyIcon/icon.vue.js +10 -4
- package/lib/components-map.js +1 -0
- package/lib/index.js +24 -20
- package/lib/utils/device.js +44 -0
- package/lib/utils/index.js +2 -0
- package/lib/version.js +1 -1
- package/package.json +7 -1
|
@@ -59,6 +59,14 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
59
59
|
type: String,
|
|
60
60
|
default: "default"
|
|
61
61
|
// default-默认 tableForm-表格表单
|
|
62
|
+
},
|
|
63
|
+
labelPosition: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "top"
|
|
66
|
+
},
|
|
67
|
+
labelWidth: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: ""
|
|
62
70
|
}
|
|
63
71
|
},
|
|
64
72
|
emits: ["on-allMapSelect", "complete", "optionsStatus"],
|
|
@@ -86,6 +94,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
86
94
|
const isTableForm = computed(() => props.business === "tableForm");
|
|
87
95
|
const locationSelectRef = useTemplateRef("locationSelectRef");
|
|
88
96
|
const allMapSelect = ref(false);
|
|
97
|
+
const labelPosition = computed(() => {
|
|
98
|
+
return ["left", "right", "top"].includes(props.labelPosition) ? props.labelPosition : "top";
|
|
99
|
+
});
|
|
89
100
|
function setMapSize() {
|
|
90
101
|
allMapSelect.value = !allMapSelect.value;
|
|
91
102
|
emits("on-allMapSelect", allMapSelect.value);
|
|
@@ -131,6 +142,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
131
142
|
formContextKey,
|
|
132
143
|
reactive({
|
|
133
144
|
...toRefs(props),
|
|
145
|
+
labelPosition,
|
|
134
146
|
emits,
|
|
135
147
|
addField,
|
|
136
148
|
removeField,
|
|
@@ -21,14 +21,20 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
21
21
|
className: {
|
|
22
22
|
type: String,
|
|
23
23
|
default: ""
|
|
24
|
+
},
|
|
25
|
+
ensureHyIcon: {
|
|
26
|
+
type: Function,
|
|
27
|
+
default: () => {
|
|
28
|
+
const { ensureHyIcon } = useEnsureHyIcon();
|
|
29
|
+
return ensureHyIcon;
|
|
30
|
+
}
|
|
24
31
|
}
|
|
25
32
|
},
|
|
26
33
|
setup(__props) {
|
|
27
34
|
const props = __props;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
watch(() => props.svgName, ensureHyIcon);
|
|
35
|
+
if (props.ensureHyIcon) {
|
|
36
|
+
onMounted(() => props.ensureHyIcon(props.svgName));
|
|
37
|
+
watch(() => props.svgName, props.ensureHyIcon);
|
|
32
38
|
}
|
|
33
39
|
const iconName = computed(() => `#${props.prefix}${props.svgName}`);
|
|
34
40
|
const svgClass = computed(() => {
|
package/es/components-map.mjs
CHANGED
|
@@ -17,5 +17,6 @@ export default {
|
|
|
17
17
|
HyRuleFenceDialog: () => import('hy-dispatch-ui-v3/es/bussiness/hyRuleSetting/cpns/ruleFenceDialog/ruleFenceDialog'),
|
|
18
18
|
HyRuleSettingDialog: () => import('hy-dispatch-ui-v3/es/bussiness/hyRuleSetting/cpns/ruleSettingDialog/ruleSettingDialog'),
|
|
19
19
|
HySetRuleAggregationAlarmDialog: () => import('hy-dispatch-ui-v3/es/bussiness/hyRuleSetting/cpns/setRuleAggregationAlarmDialog/setRuleAggregationAlarmDialog'),
|
|
20
|
+
HySelectDeviceTree: () => import('hy-dispatch-ui-v3/es/bussiness/hySelectDeviceTree/selectDeviceTree'),
|
|
20
21
|
HyUserTree: () => import('hy-dispatch-ui-v3/es/bussiness/hyUserTree/userTree'),
|
|
21
22
|
}
|
package/es/index.mjs
CHANGED
|
@@ -41,6 +41,7 @@ export { HyPlanGroupDeviceTree } from './bussiness/hyPlanGroupDeviceTree/index.m
|
|
|
41
41
|
export { HyRadioGroup } from './components/hyRadioGroup/index.mjs';
|
|
42
42
|
export { HyRuleAssignDialog, HyRuleFenceDialog, HyRuleSetting, HyRuleSettingDialog, HySetRuleAggregationAlarmDialog } from './bussiness/hyRuleSetting/index.mjs';
|
|
43
43
|
export { HySearch } from './components/hySearch/index.mjs';
|
|
44
|
+
export { HySelectDeviceTree } from './bussiness/hySelectDeviceTree/index.mjs';
|
|
44
45
|
export { HyStatus } from './components/hyStatus/index.mjs';
|
|
45
46
|
export { HyTable } from './components/hyTable/index.mjs';
|
|
46
47
|
export { HyTableActionButton } from './components/hyTableActionButton/index.mjs';
|
|
@@ -62,6 +63,7 @@ export { defaultAxios, localApiKey, useApi } from './hooks/useApi.mjs';
|
|
|
62
63
|
export { enterNumbersRrLetters, enterTheMumber, filterSpaces, formatTimeFn, getPublicFileSize, inputForbidden, keepTwoDecimalPlaces, onlyNumber } from './utils/input.mjs';
|
|
63
64
|
export { formatDay, formatHoursToHM, formatSeconds, formatTime, getBeforeDays, getCurDtm, getNextDays, getToday } from './utils/timeUtils.mjs';
|
|
64
65
|
export { formatDuration, getDefaultValueFormatByType } from './utils/date.mjs';
|
|
66
|
+
export { getDeviceTypeIcon } from './utils/device.mjs';
|
|
65
67
|
export { isArray, isBoolean, isEmpty, isFile, isFunction, isNull, isNumber, isObject, isOverflowing, isPermission, isString, isSupportH265, isSymbol, isUndefined, isVueProxy } from './utils/is.mjs';
|
|
66
68
|
export { loadingSvg } from './utils/sharedContent.mjs';
|
|
67
69
|
export { localAudioPlayerConfigKey, useAudioPlayerConfig } from './hooks/useAudioPlayerConfig.mjs';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import '../hooks/index.mjs';
|
|
2
|
+
import { useBaseMainStore } from '../hooks/useBaseMainStore.mjs';
|
|
3
|
+
|
|
4
|
+
function getDeviceTypeIcon(device = {}, onlineState) {
|
|
5
|
+
const { baseMainStore } = useBaseMainStore();
|
|
6
|
+
const key = baseMainStore.value.getters.getDeviceTypeIcon(device, onlineState);
|
|
7
|
+
const deviceTypeV3Json = {
|
|
8
|
+
"tree-icon-law-enforcement-2": "dispatch-share-v3-sip-law-enforcement",
|
|
9
|
+
"tree-icon-dispatching-desk-2": "map-tree-dispatching-desk",
|
|
10
|
+
"tree-icon-duty-desk-2": "map-tree-duty-desk",
|
|
11
|
+
"tree-icon-phone-2": "map-tree-phone",
|
|
12
|
+
"tree-icon-control-the-ball-2": "map-tree-control-the-ball",
|
|
13
|
+
"tree-icon-ipc-2": "map-tree-ipc",
|
|
14
|
+
"tree-icon-safety-hat-2": "map-tree-safety-hat",
|
|
15
|
+
"tree-icon-flashlight-2": "map-tree-flashlight",
|
|
16
|
+
"tree-icon-work-card-2": "map-marker-marker-device-v2",
|
|
17
|
+
"tree-icon-vehicle-2": "map-tree-vehicle",
|
|
18
|
+
"tree-icon-uav-2": "map-tree-uav",
|
|
19
|
+
"tree-icon-obd-2": "map-tree-obd",
|
|
20
|
+
"tree-icon-walkie-talkie-2": "map-tree-walkie-talkie",
|
|
21
|
+
"tree-icon-law-enforcement-3": "map-tree-law-enforcement-v2",
|
|
22
|
+
"tree-icon-smartwatch": "map-tree-smartwatch",
|
|
23
|
+
"tree-icon-law-enforcement-off-line-2": "lawEnforcement_offLine",
|
|
24
|
+
"tree-icon-dispatching-desk-off-line-2": "dispatchingDesk_offLine",
|
|
25
|
+
"tree-icon-duty-desk-offline": "dutyDesk_offLine",
|
|
26
|
+
"tree-icon-phone-off-line-2": "phone_offLine",
|
|
27
|
+
"tree-icon-control-the-ball-off-line-2": "controlTheBall_offLine",
|
|
28
|
+
"tree-icon-safety-hat-off-line-2": "safetyHat_offLine",
|
|
29
|
+
"tree-icon-flashlight-off-line-2": "flashlight_offLine",
|
|
30
|
+
"tree-icon-work-card-off-line-2": "workCard_offLine",
|
|
31
|
+
"tree-icon-vehicle-off-line-2": "vehicle_offLine",
|
|
32
|
+
"tree-icon-uav-off-line-2": "uav_offLine",
|
|
33
|
+
"tree-icon-ipc-off-line-2": "ipc_offLine",
|
|
34
|
+
"tree-icon-obd-off-line-2": "obd_offLine",
|
|
35
|
+
"tree-icon-law-enforcement-3-off-line": "lawEnforcementV2_offLine",
|
|
36
|
+
"tree-icon-smartwatch-off-line": "smartwatch_offLine",
|
|
37
|
+
"tree-icon-walkie-talkie-off-line-2": "walkieTalkie_offLine"
|
|
38
|
+
};
|
|
39
|
+
return deviceTypeV3Json[`${key}`] || key;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { getDeviceTypeIcon };
|
package/es/utils/index.mjs
CHANGED
|
@@ -11,4 +11,5 @@ export { InitMap, setMapServer, setPoiServer } from './map/index.mjs';
|
|
|
11
11
|
import './tree.mjs';
|
|
12
12
|
export { loadingSvg } from './sharedContent.mjs';
|
|
13
13
|
export { formatDay, formatHoursToHM, formatSeconds, formatTime, getBeforeDays, getCurDtm, getNextDays, getToday } from './timeUtils.mjs';
|
|
14
|
+
export { getDeviceTypeIcon } from './device.mjs';
|
|
14
15
|
export { setGlobalTreeConfig } from 'hy-virtual-tree';
|
package/es/version.mjs
CHANGED
|
@@ -16,6 +16,11 @@ const __default__ = vue.defineComponent({
|
|
|
16
16
|
});
|
|
17
17
|
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
18
18
|
props: {
|
|
19
|
+
// 外部自定义树形数据接收 promise
|
|
20
|
+
customDataFn: {
|
|
21
|
+
type: Function,
|
|
22
|
+
default: null
|
|
23
|
+
},
|
|
19
24
|
// 数据获取类型 custom 自定义数据
|
|
20
25
|
type: {
|
|
21
26
|
type: String,
|
|
@@ -21,11 +21,20 @@ function useDeviceTree(hy) {
|
|
|
21
21
|
emits("onRefreshData");
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
let data = {};
|
|
25
|
+
if (props.customDataFn) {
|
|
26
|
+
data = await props.customDataFn({
|
|
27
|
+
showDevice: true,
|
|
28
|
+
showGroup: false,
|
|
29
|
+
...props.requestParams
|
|
30
|
+
});
|
|
31
|
+
} else {
|
|
32
|
+
data = await organization.orgListWithDev3Api({
|
|
33
|
+
showDevice: true,
|
|
34
|
+
showGroup: false,
|
|
35
|
+
...props.requestParams
|
|
36
|
+
});
|
|
37
|
+
}
|
|
29
38
|
hy.hyTreeRef.value.getData(data).then(() => {
|
|
30
39
|
emits("on-load");
|
|
31
40
|
});
|
|
@@ -80,6 +89,7 @@ function useDeviceTree(hy) {
|
|
|
80
89
|
emits("on-dblclick", list);
|
|
81
90
|
}
|
|
82
91
|
function onSelectedDataList(list) {
|
|
92
|
+
console.log("\u9009\u4E2D\u7684\u8BBE\u5907");
|
|
83
93
|
emits("on-selectedDataList", list);
|
|
84
94
|
}
|
|
85
95
|
function singleRemovalFn(row, isForce = false) {
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
require('../../../utils/index.js');
|
|
7
|
+
require('../../../components/index.js');
|
|
8
|
+
var index = require('../../../components/hyTooltip/index.js');
|
|
9
|
+
var index$1 = require('../../../components/hyIcon/index.js');
|
|
10
|
+
var device = require('../../../utils/device.js');
|
|
11
|
+
|
|
12
|
+
const _sfc_main = {
|
|
13
|
+
__name: "deviceItem",
|
|
14
|
+
props: {
|
|
15
|
+
deleteFn: {
|
|
16
|
+
type: Function
|
|
17
|
+
},
|
|
18
|
+
index: {
|
|
19
|
+
type: Number,
|
|
20
|
+
default() {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
source: {
|
|
25
|
+
type: Object,
|
|
26
|
+
default() {
|
|
27
|
+
return {};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
setup(__props) {
|
|
32
|
+
const props = __props;
|
|
33
|
+
return (_ctx, _cache) => {
|
|
34
|
+
return vue.openBlock(), vue.createBlock(vue.unref(index.HyTooltip), null, {
|
|
35
|
+
content: vue.withCtx(() => [
|
|
36
|
+
vue.createElementVNode("div", { class: "w-full flex flex-col gap-3" }, [
|
|
37
|
+
__props.source.devName ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: "flex"
|
|
40
|
+
}, [
|
|
41
|
+
vue.createElementVNode("div", {
|
|
42
|
+
class: "w-20 flex-shrink-0 text-auxiliary",
|
|
43
|
+
style: { "text-align-last": "justify" }
|
|
44
|
+
}, "\u8BBE\u5907\u540D\u79F0"),
|
|
45
|
+
vue.createElementVNode("span", { class: "text-auxiliary" }, ":"),
|
|
46
|
+
vue.createElementVNode(
|
|
47
|
+
"span",
|
|
48
|
+
{ class: "ml-1" },
|
|
49
|
+
vue.toDisplayString(__props.source.devName),
|
|
50
|
+
1
|
|
51
|
+
/* TEXT */
|
|
52
|
+
)
|
|
53
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
54
|
+
__props.source.deviceId ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
55
|
+
key: 1,
|
|
56
|
+
class: "flex"
|
|
57
|
+
}, [
|
|
58
|
+
vue.createElementVNode("div", {
|
|
59
|
+
class: "w-20 flex-shrink-0 text-auxiliary",
|
|
60
|
+
style: { "text-align-last": "justify" }
|
|
61
|
+
}, "\uFF29\uFF2D\uFF25\uFF29"),
|
|
62
|
+
vue.createElementVNode("span", { class: "text-auxiliary" }, ":"),
|
|
63
|
+
vue.createElementVNode(
|
|
64
|
+
"span",
|
|
65
|
+
{ class: "ml-1" },
|
|
66
|
+
vue.toDisplayString(__props.source.deviceId),
|
|
67
|
+
1
|
|
68
|
+
/* TEXT */
|
|
69
|
+
)
|
|
70
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
71
|
+
__props.source.name ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
72
|
+
key: 2,
|
|
73
|
+
class: "flex"
|
|
74
|
+
}, [
|
|
75
|
+
vue.createElementVNode("div", {
|
|
76
|
+
class: "w-20 flex-shrink-0 text-auxiliary",
|
|
77
|
+
style: { "text-align-last": "justify" }
|
|
78
|
+
}, "\u5F53\u524D\u7528\u6237"),
|
|
79
|
+
vue.createElementVNode("span", { class: "text-auxiliary" }, ":"),
|
|
80
|
+
vue.createElementVNode(
|
|
81
|
+
"span",
|
|
82
|
+
{ class: "ml-1" },
|
|
83
|
+
vue.toDisplayString(__props.source.name),
|
|
84
|
+
1
|
|
85
|
+
/* TEXT */
|
|
86
|
+
)
|
|
87
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
88
|
+
])
|
|
89
|
+
]),
|
|
90
|
+
default: vue.withCtx(() => [
|
|
91
|
+
vue.createElementVNode("div", { class: "w-full h-8 rounded bg-background-2 flex items-center box-border px-2 text-sm text-main mb-2 cursor-pointer group" }, [
|
|
92
|
+
vue.createVNode(vue.unref(index$1.HyIcon), {
|
|
93
|
+
svgName: vue.unref(device.getDeviceTypeIcon)(__props.source.deviceType, __props.source.onlineState),
|
|
94
|
+
class: "w-3 h-4 mr-1"
|
|
95
|
+
}, null, 8, ["svgName"]),
|
|
96
|
+
vue.createElementVNode(
|
|
97
|
+
"span",
|
|
98
|
+
{ class: "truncate" },
|
|
99
|
+
vue.toDisplayString(__props.source.devName),
|
|
100
|
+
1
|
|
101
|
+
/* TEXT */
|
|
102
|
+
),
|
|
103
|
+
vue.createVNode(vue.unref(index$1.HyIcon), {
|
|
104
|
+
onClick: ($event) => __props.deleteFn(__props.source, __props.index),
|
|
105
|
+
svgName: "ops-linear-delete-v3",
|
|
106
|
+
class: "w-4 h-4 text-danger ml-auto opacity-0 group-hover:opacity-100"
|
|
107
|
+
}, null, 8, ["onClick"])
|
|
108
|
+
])
|
|
109
|
+
]),
|
|
110
|
+
_: 1
|
|
111
|
+
/* STABLE */
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('../../utils/index.js');
|
|
6
|
+
var selectDeviceTree = require('./selectDeviceTree.vue.js');
|
|
7
|
+
var handler = require('../../utils/handler.js');
|
|
8
|
+
|
|
9
|
+
const HySelectDeviceTree = handler.withInstall(selectDeviceTree.default);
|
|
10
|
+
|
|
11
|
+
exports.HySelectDeviceTree = HySelectDeviceTree;
|
|
12
|
+
exports.default = HySelectDeviceTree;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
require('../../../api/organization.js');
|
|
5
|
+
|
|
6
|
+
function useHySelectDeviceTree(hy) {
|
|
7
|
+
const emits = hy.emits;
|
|
8
|
+
const props = hy.props;
|
|
9
|
+
const selDeviceList = vue.ref([]);
|
|
10
|
+
const hyDeviceTreeRef = vue.useTemplateRef("hyDeviceTreeRef");
|
|
11
|
+
function onCheckTreeFn(list = []) {
|
|
12
|
+
console.log("\u9009\u4E2D\u7684\u8BBE\u5907", list);
|
|
13
|
+
selDeviceList.value = list;
|
|
14
|
+
}
|
|
15
|
+
function deleteFn(device, index) {
|
|
16
|
+
selDeviceList.value.splice(index, 1);
|
|
17
|
+
hyDeviceTreeRef.value.singleRemovalFn(device);
|
|
18
|
+
}
|
|
19
|
+
function clearAllFn() {
|
|
20
|
+
selDeviceList.value = [];
|
|
21
|
+
hyDeviceTreeRef.value.setCheckedKeys([]);
|
|
22
|
+
}
|
|
23
|
+
function getData() {
|
|
24
|
+
const list = selDeviceList.value.map((item) => item);
|
|
25
|
+
return list;
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
selDeviceList,
|
|
29
|
+
hyDeviceTreeRef,
|
|
30
|
+
deleteFn,
|
|
31
|
+
onCheckTreeFn,
|
|
32
|
+
clearAllFn,
|
|
33
|
+
getData
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
exports.useHySelectDeviceTree = useHySelectDeviceTree;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
require('../../index.js');
|
|
7
|
+
var VirtualList = require('vue3-virtual-scroll-list');
|
|
8
|
+
var deviceItem = require('./cpns/deviceItem.vue.js');
|
|
9
|
+
require('../../hooks/index.js');
|
|
10
|
+
var index = require('./js/index.js');
|
|
11
|
+
var useMixins = require('../../hooks/useMixins.js');
|
|
12
|
+
var index$1 = require('../hyDeviceTree/index.js');
|
|
13
|
+
var index$2 = require('../../components/hyButton/index.js');
|
|
14
|
+
var index$3 = require('../../components/hyIcon/index.js');
|
|
15
|
+
|
|
16
|
+
import "./style/selectDeviceTree.scss";
|
|
17
|
+
|
|
18
|
+
const __default__ = vue.defineComponent({
|
|
19
|
+
name: "HySelectDeviceTree"
|
|
20
|
+
});
|
|
21
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
22
|
+
props: {
|
|
23
|
+
text: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: "\u5DF2\u9009\u62E9\u8BBE\u5907\uFF1A"
|
|
26
|
+
},
|
|
27
|
+
noDataText: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "\u6682\u672A\u9009\u62E9\u8BBE\u5907"
|
|
30
|
+
},
|
|
31
|
+
// 请求的额外参数
|
|
32
|
+
requestParams: {
|
|
33
|
+
type: Object,
|
|
34
|
+
default: () => ({})
|
|
35
|
+
},
|
|
36
|
+
/* 禁止选择 */
|
|
37
|
+
disableSelection: {
|
|
38
|
+
type: Array,
|
|
39
|
+
default: () => {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
// 是否开启按照设备在线和离线状态排序,仅支持 device 和 groupDevice 业务类型
|
|
44
|
+
deviceOrderSort: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: true
|
|
47
|
+
},
|
|
48
|
+
// 外部自定义树形数据接收 promise
|
|
49
|
+
customDataFn: {
|
|
50
|
+
type: Function,
|
|
51
|
+
default: null
|
|
52
|
+
},
|
|
53
|
+
/* 默认选中列表 */
|
|
54
|
+
selectedByDefault: {
|
|
55
|
+
type: Array,
|
|
56
|
+
default: () => {
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
// 是否清除无数据的部门
|
|
61
|
+
clearEmptyBusiness: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false
|
|
64
|
+
},
|
|
65
|
+
// 仅展示在线数据
|
|
66
|
+
showOnlineOnly: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false
|
|
69
|
+
},
|
|
70
|
+
/* 是否开启多选框 */
|
|
71
|
+
showCheckbox: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: true
|
|
74
|
+
},
|
|
75
|
+
/* 是否开启单选框 */
|
|
76
|
+
showSinglebox: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false
|
|
79
|
+
},
|
|
80
|
+
placeholder: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: "\u8BF7\u8F93\u5165"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
emits: [],
|
|
86
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
87
|
+
const props = __props;
|
|
88
|
+
const emits = __emit;
|
|
89
|
+
const {
|
|
90
|
+
selDeviceList,
|
|
91
|
+
hyDeviceTreeRef,
|
|
92
|
+
deleteFn,
|
|
93
|
+
onCheckTreeFn,
|
|
94
|
+
clearAllFn,
|
|
95
|
+
getData
|
|
96
|
+
} = useMixins.useMixins({ props, emits }, [index.useHySelectDeviceTree]);
|
|
97
|
+
__expose({
|
|
98
|
+
getData
|
|
99
|
+
});
|
|
100
|
+
return (_ctx, _cache) => {
|
|
101
|
+
return vue.openBlock(), vue.createElementBlock("div", { class: "w-full h-full flex gap-4" }, [
|
|
102
|
+
vue.createCommentVNode(" HySelectDeviceTree \u5185\u5BB9 "),
|
|
103
|
+
vue.createElementVNode("div", { class: "w-0 flex-grow h-full p-3 box-border shadow-[inset_0_0_10px_0] shadow-auxiliary rounded" }, [
|
|
104
|
+
vue.createVNode(vue.unref(index$1.HyDeviceTree), vue.mergeProps({
|
|
105
|
+
ref_key: "hyDeviceTreeRef",
|
|
106
|
+
ref: hyDeviceTreeRef,
|
|
107
|
+
onOnCheckTree: vue.unref(onCheckTreeFn),
|
|
108
|
+
isBackDefaultSelected: true
|
|
109
|
+
}, { ...props }), null, 16, ["onOnCheckTree"])
|
|
110
|
+
]),
|
|
111
|
+
vue.createElementVNode("div", { class: "w-0 flex-grow h-full flex flex-col gap-3" }, [
|
|
112
|
+
vue.createElementVNode("div", { class: "flex justify-between items-center" }, [
|
|
113
|
+
vue.createVNode(vue.unref(index$2.HyButton), {
|
|
114
|
+
onClick: vue.unref(clearAllFn),
|
|
115
|
+
type: "danger",
|
|
116
|
+
size: "small"
|
|
117
|
+
}, {
|
|
118
|
+
default: vue.withCtx(() => [
|
|
119
|
+
vue.createTextVNode("\u6E05\u7A7A")
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
/* STABLE */
|
|
123
|
+
}, 8, ["onClick"]),
|
|
124
|
+
vue.createElementVNode(
|
|
125
|
+
"span",
|
|
126
|
+
{ class: "text-sm text-theme" },
|
|
127
|
+
vue.toDisplayString(__props.text) + vue.toDisplayString(vue.unref(selDeviceList).length ? vue.unref(selDeviceList).length : ""),
|
|
128
|
+
1
|
|
129
|
+
/* TEXT */
|
|
130
|
+
)
|
|
131
|
+
]),
|
|
132
|
+
vue.createElementVNode("div", { class: "w-full h-0 flex-grow box-border py-3 flex flex-col shadow-[inset_0_0_10px_0] rounded !shadow-auxiliary" }, [
|
|
133
|
+
vue.unref(selDeviceList).length ? (vue.openBlock(), vue.createBlock(vue.unref(VirtualList), {
|
|
134
|
+
key: 0,
|
|
135
|
+
class: "w-full h-full px-3 overflow-auto box-border",
|
|
136
|
+
"data-key": "id",
|
|
137
|
+
"data-sources": vue.unref(selDeviceList),
|
|
138
|
+
"data-component": deviceItem.default,
|
|
139
|
+
keeps: 30,
|
|
140
|
+
"estimate-size": 34,
|
|
141
|
+
"extra-props": {
|
|
142
|
+
deleteFn: vue.unref(deleteFn)
|
|
143
|
+
}
|
|
144
|
+
}, null, 8, ["data-sources", "extra-props"])) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
145
|
+
key: 1,
|
|
146
|
+
class: "w-full h-full flex flex-col justify-center items-center gap-3"
|
|
147
|
+
}, [
|
|
148
|
+
vue.createVNode(vue.unref(index$3.HyIcon), {
|
|
149
|
+
svgName: "ops-list-no-data",
|
|
150
|
+
class: "w-[34px] h-[46px]"
|
|
151
|
+
}),
|
|
152
|
+
vue.createElementVNode(
|
|
153
|
+
"span",
|
|
154
|
+
{ class: "text-auxiliary text-sm" },
|
|
155
|
+
vue.toDisplayString(__props.noDataText),
|
|
156
|
+
1
|
|
157
|
+
/* TEXT */
|
|
158
|
+
)
|
|
159
|
+
]))
|
|
160
|
+
])
|
|
161
|
+
])
|
|
162
|
+
]);
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
exports.default = _sfc_main;
|
|
File without changes
|
package/lib/bussiness/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index$2 = require('./hyDepartmentTypeOperation/index.js');
|
|
4
4
|
var index$6 = require('./hyMapAearchPlace/index.js');
|
|
5
|
-
var index$
|
|
5
|
+
var index$b = require('./hyUserTree/index.js');
|
|
6
6
|
var index$3 = require('./hyDeviceTree/index.js');
|
|
7
7
|
var index$7 = require('./hyOrgGroupTree/index.js');
|
|
8
8
|
var index$8 = require('./hyPlanGroupDeviceTree/index.js');
|
|
@@ -11,13 +11,14 @@ var index$1 = require('./hyElectronicFence/index.js');
|
|
|
11
11
|
var index$9 = require('./hyRuleSetting/index.js');
|
|
12
12
|
var index$4 = require('./hyDisplayQueryAddress/index.js');
|
|
13
13
|
var index$5 = require('./hyFilePlayback/index.js');
|
|
14
|
+
var index$a = require('./hySelectDeviceTree/index.js');
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
exports.HyDepartmentTypeOperation = index$2.HyDepartmentTypeOperation;
|
|
18
19
|
exports.HyDepartmentTypeOperationTiantong = index$2.HyDepartmentTypeOperationTiantong;
|
|
19
20
|
exports.HyMapAearchPlace = index$6.HyMapAearchPlace;
|
|
20
|
-
exports.HyUserTree = index$
|
|
21
|
+
exports.HyUserTree = index$b.HyUserTree;
|
|
21
22
|
exports.HyDeviceTree = index$3.HyDeviceTree;
|
|
22
23
|
exports.HyOrgGroupTree = index$7.HyOrgGroupTree;
|
|
23
24
|
exports.HyPlanGroupDeviceTree = index$8.HyPlanGroupDeviceTree;
|
|
@@ -33,3 +34,4 @@ exports.HyRuleSettingDialog = index$9.HyRuleSettingDialog;
|
|
|
33
34
|
exports.HySetRuleAggregationAlarmDialog = index$9.HySetRuleAggregationAlarmDialog;
|
|
34
35
|
exports.HyDisplayQueryAddress = index$4.HyDisplayQueryAddress;
|
|
35
36
|
exports.HyFilePlayback = index$5.HyFilePlayback;
|
|
37
|
+
exports.HySelectDeviceTree = index$a.HySelectDeviceTree;
|