hy-dispatch-ui-v3 0.2.53 → 0.2.55
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 +53 -0
- package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +39 -10
- package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +12 -22
- package/es/components/hyDialog/dialog.vue.mjs +9 -7
- package/es/components/hyForm/cpns/arrayItem.vue.mjs +5 -5
- package/es/components/hyForm/cpns/extraItem.vue.mjs +6 -1
- package/es/components/hyForm/cpns/formItem.vue.mjs +29 -14
- package/es/components/hyForm/js/index.mjs +29 -25
- package/es/components/hyForm/js/useAppForm.mjs +15 -30
- package/es/components/hyIconBox/iconBox.vue.mjs +1 -1
- package/es/components/hyIconBox/style/iconBox.scss +1 -1
- package/es/components/hyMap/index.mjs +6 -0
- package/es/components/hyMap/js/index.mjs +59 -0
- package/es/components/hyMap/map.vue.mjs +59 -0
- package/es/components/hyOrgCascader/js/index.mjs +53 -0
- package/es/components/hyOrgCascader/orgCascader.vue.mjs +22 -25
- package/es/components/hySearch/search.vue.mjs +6 -8
- package/es/components/hyTable/cpns/columnSelect.vue.mjs +10 -18
- package/es/components/hyTable/table.vue.mjs +8 -11
- package/es/components/hyTableActionButton/tableActionButton.vue.mjs +6 -3
- package/es/components/hyTableForm/batchTableForm.vue.mjs +182 -135
- package/es/components/hyTableForm/js/index.mjs +2 -2
- package/es/components/hyTableForm/tableForm.vue.mjs +29 -20
- package/es/components/hyTooltip/tooltip.vue.mjs +1 -1
- package/es/components/hyTree/js/index.mjs +5 -4
- package/es/components/hyTree/tree.vue.mjs +5 -0
- package/es/components/index.mjs +1 -0
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/useApi.mjs +11 -5
- package/es/hooks/useAudioPlayerConfig.mjs +13 -5
- package/es/hooks/useEnsureHyIcon.mjs +11 -5
- package/es/hooks/useLocale.mjs +6 -5
- package/es/hooks/usePermissionMap.mjs +13 -5
- package/es/hooks/useSubscribe.mjs +28 -0
- package/es/hooks/useTooltipConfig.mjs +11 -5
- package/es/hooks/useUserAvatarMap.mjs +13 -5
- package/es/hooks/useVideoPlayerConfig.mjs +13 -5
- package/es/index.mjs +3 -2
- package/es/static/map/CFCASIPInput.min.js +258 -0
- package/es/static/map/MarkerCluster.css +75 -0
- package/es/static/map/bigemap.css +838 -0
- package/es/static/map/bigemap.js +5 -0
- package/es/static/map/bm.geometryutil.js +754 -0
- package/es/static/map/bmDraw.css +329 -0
- package/es/static/map/bmDraw.js +181 -0
- package/es/static/map/car.png +0 -0
- package/es/static/map/markercluster.js +2679 -0
- package/es/static/map/moveMarker.js +74 -0
- package/es/utils/form.mjs +38 -2
- package/es/utils/index.mjs +1 -2
- package/es/utils/map/hook/bigMap.mjs +1136 -0
- package/es/utils/map/hook/gaode.mjs +683 -0
- package/es/utils/map/hook/leafletjs.mjs +1336 -0
- package/es/utils/map/index.mjs +291 -0
- package/es/utils/map/js/mapProxy.mjs +38 -0
- package/es/utils/map/js/webgis.mjs +153 -0
- package/es/version.mjs +1 -1
- package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +40 -11
- package/lib/components/hyConfirmDialog/confirmDialog.vue.js +13 -23
- package/lib/components/hyDialog/dialog.vue.js +9 -7
- package/lib/components/hyForm/cpns/arrayItem.vue.js +4 -4
- package/lib/components/hyForm/cpns/extraItem.vue.js +6 -1
- package/lib/components/hyForm/cpns/formItem.vue.js +26 -11
- package/lib/components/hyForm/js/index.js +29 -23
- package/lib/components/hyForm/js/useAppForm.js +14 -29
- package/lib/components/hyIconBox/iconBox.vue.js +1 -1
- package/lib/components/hyIconBox/style/iconBox.scss +1 -1
- package/lib/components/hyMap/index.js +11 -0
- package/lib/components/hyMap/js/index.js +61 -0
- package/lib/components/hyMap/map.vue.js +63 -0
- package/lib/components/hyOrgCascader/js/index.js +56 -0
- package/lib/components/hyOrgCascader/orgCascader.vue.js +21 -24
- package/lib/components/hySearch/search.vue.js +4 -6
- package/lib/components/hyTable/cpns/columnSelect.vue.js +12 -20
- package/lib/components/hyTable/table.vue.js +17 -20
- package/lib/components/hyTableActionButton/tableActionButton.vue.js +5 -2
- package/lib/components/hyTableForm/batchTableForm.vue.js +181 -134
- package/lib/components/hyTableForm/js/index.js +1 -1
- package/lib/components/hyTableForm/tableForm.vue.js +29 -20
- package/lib/components/hyTooltip/tooltip.vue.js +1 -1
- package/lib/components/hyTree/js/index.js +5 -4
- package/lib/components/hyTree/tree.vue.js +5 -0
- package/lib/components/index.js +22 -20
- package/lib/hooks/index.js +3 -0
- package/lib/hooks/useApi.js +10 -4
- package/lib/hooks/useAudioPlayerConfig.js +12 -4
- package/lib/hooks/useEnsureHyIcon.js +10 -4
- package/lib/hooks/useLocale.js +5 -4
- package/lib/hooks/usePermissionMap.js +12 -4
- package/lib/hooks/useSubscribe.js +31 -0
- package/lib/hooks/useTooltipConfig.js +10 -4
- package/lib/hooks/useUserAvatarMap.js +12 -4
- package/lib/hooks/useVideoPlayerConfig.js +12 -4
- package/lib/index.js +27 -22
- package/lib/static/map/CFCASIPInput.min.js +258 -0
- package/lib/static/map/MarkerCluster.css +75 -0
- package/lib/static/map/bigemap.css +838 -0
- package/lib/static/map/bigemap.js +5 -0
- package/lib/static/map/bm.geometryutil.js +754 -0
- package/lib/static/map/bmDraw.css +329 -0
- package/lib/static/map/bmDraw.js +181 -0
- package/lib/static/map/car.png +0 -0
- package/lib/static/map/markercluster.js +2679 -0
- package/lib/static/map/moveMarker.js +74 -0
- package/lib/utils/form.js +38 -0
- package/lib/utils/index.js +2 -2
- package/lib/utils/map/hook/bigMap.js +1140 -0
- package/lib/utils/map/hook/gaode.js +687 -0
- package/lib/utils/map/hook/leafletjs.js +1360 -0
- package/lib/utils/map/index.js +298 -0
- package/lib/utils/map/js/mapProxy.js +44 -0
- package/lib/utils/map/js/webgis.js +162 -0
- package/lib/version.js +1 -1
- package/package.json +16 -1
- package/es/utils/bus.mjs +0 -5
- package/lib/utils/bus.js +0 -7
|
@@ -154,7 +154,15 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
154
154
|
onlyId: /* @__PURE__ */ Symbol("onlyId")
|
|
155
155
|
});
|
|
156
156
|
await initValidateHandler([data]);
|
|
157
|
-
dataSource.value.
|
|
157
|
+
if (!dataSource.value.length) {
|
|
158
|
+
dataSource.value = [data];
|
|
159
|
+
setData(dataSource.value);
|
|
160
|
+
} else {
|
|
161
|
+
dataSource.value.push(data);
|
|
162
|
+
}
|
|
163
|
+
emits("validate", {
|
|
164
|
+
...statistics.value
|
|
165
|
+
});
|
|
158
166
|
}
|
|
159
167
|
async function initValidateHandler(dataSource2) {
|
|
160
168
|
let promiseList = [];
|
|
@@ -162,13 +170,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
162
170
|
promiseList.push(
|
|
163
171
|
new Promise(async (resolve, reject) => {
|
|
164
172
|
try {
|
|
165
|
-
|
|
173
|
+
await index$3.doValidate(data, props.formColumns, props.rules);
|
|
166
174
|
data.errorMsg = data.errorMsg && !data.errorMsg.prop ? data.errorMsg : null;
|
|
167
175
|
data.errorMap = /* @__PURE__ */ new Map();
|
|
168
176
|
resolve();
|
|
169
177
|
} catch (error) {
|
|
170
178
|
const errorMap = /* @__PURE__ */ new Map();
|
|
171
|
-
error.forEach((item
|
|
179
|
+
error.forEach((item) => {
|
|
172
180
|
const errData = {
|
|
173
181
|
prop: item.field,
|
|
174
182
|
message: item.message || `${item.field} is required`
|
|
@@ -192,24 +200,25 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
192
200
|
if (!row.errorMap) {
|
|
193
201
|
row.errorMap = /* @__PURE__ */ new Map();
|
|
194
202
|
}
|
|
195
|
-
|
|
196
|
-
row.
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
row.errorMap.set(prop, message);
|
|
207
|
-
if (!row.errorMsg || !row.errorMsg.prop) {
|
|
208
|
-
row.errorMsg = {
|
|
209
|
-
prop,
|
|
210
|
-
message
|
|
203
|
+
try {
|
|
204
|
+
await index$3.doValidate(row, props.formColumns, props.rules);
|
|
205
|
+
row.errorMsg = null;
|
|
206
|
+
row.errorMap = /* @__PURE__ */ new Map();
|
|
207
|
+
} catch (error) {
|
|
208
|
+
let errMsg = null;
|
|
209
|
+
const errorMap2 = /* @__PURE__ */ new Map();
|
|
210
|
+
error.forEach((item) => {
|
|
211
|
+
const errData = {
|
|
212
|
+
prop: item.field,
|
|
213
|
+
message: item.message || `${item.field} is required`
|
|
211
214
|
};
|
|
212
|
-
|
|
215
|
+
if (!errMsg) {
|
|
216
|
+
errMsg = errData;
|
|
217
|
+
}
|
|
218
|
+
errorMap2.set(errData.prop, errData.message);
|
|
219
|
+
});
|
|
220
|
+
row.errorMap = errorMap2;
|
|
221
|
+
row.errorMsg = errMsg;
|
|
213
222
|
}
|
|
214
223
|
const { onlyId, errorMsg, errorMap, children, ...data } = row;
|
|
215
224
|
emits("validate", {
|
|
@@ -63,7 +63,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
63
63
|
}
|
|
64
64
|
return (_ctx, _cache) => {
|
|
65
65
|
return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElTooltip), vue.mergeProps({
|
|
66
|
-
"
|
|
66
|
+
"show-after": 500,
|
|
67
67
|
class: "item",
|
|
68
68
|
effect: "dark",
|
|
69
69
|
placement: "top",
|
|
@@ -115,6 +115,7 @@ const useAppTreeWrapper = (hy) => {
|
|
|
115
115
|
rowSelection: {
|
|
116
116
|
type: props.showCheckbox ? "checkbox" : "radio",
|
|
117
117
|
highlight: props.highlight,
|
|
118
|
+
checkStrictly: props.checkStrictly,
|
|
118
119
|
// 是否显示选项 showSinglebox 单选为true时部门不显示其他节点显示选择框
|
|
119
120
|
showSelect: (data) => {
|
|
120
121
|
if (data.dataType === 1) {
|
|
@@ -387,7 +388,7 @@ const useAppTreeWrapper = (hy) => {
|
|
|
387
388
|
}
|
|
388
389
|
function singleRemovalFn(row) {
|
|
389
390
|
if (props.treeType === "device") {
|
|
390
|
-
virtualTree.setChecked(row.deviceId, false, true);
|
|
391
|
+
virtualTree.setChecked(row.channelId || row.deviceId, false, true);
|
|
391
392
|
} else if (props.treeType) {
|
|
392
393
|
virtualTree.setChecked(row.id, false, true);
|
|
393
394
|
} else if (!props.treeType && props.treeProps) {
|
|
@@ -395,9 +396,9 @@ const useAppTreeWrapper = (hy) => {
|
|
|
395
396
|
}
|
|
396
397
|
}
|
|
397
398
|
function setCheckedKeys(dataList) {
|
|
398
|
-
if (props.treeType === "device") {
|
|
399
|
+
if (props.treeType === "device" || props.treeType === "channel") {
|
|
399
400
|
virtualTree?.setCheckedKeys(
|
|
400
|
-
dataList.map((v) => v.deviceId),
|
|
401
|
+
dataList.map((v) => v.channelId || v.deviceId),
|
|
401
402
|
true
|
|
402
403
|
);
|
|
403
404
|
} else if (props.treeType) {
|
|
@@ -419,7 +420,7 @@ const useAppTreeWrapper = (hy) => {
|
|
|
419
420
|
}
|
|
420
421
|
function setChecked(data, type) {
|
|
421
422
|
if (props.treeType === "device") {
|
|
422
|
-
virtualTree?.setChecked(data.deviceId, type, true);
|
|
423
|
+
virtualTree?.setChecked(data.channelId || data.deviceId, type, true);
|
|
423
424
|
} else if (props.treeType) {
|
|
424
425
|
virtualTree?.setChecked(data.id, type, true);
|
|
425
426
|
} else if (!props.treeType && props.treeProps) {
|
package/lib/components/index.js
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index$
|
|
3
|
+
var index$j = require('./hyOrgCascader/index.js');
|
|
4
4
|
var index$9 = require('./hyConfirmDialog/index.js');
|
|
5
5
|
var index = require('./hyDatePicker/index.js');
|
|
6
6
|
var index$c = require('./hyForm/index.js');
|
|
7
7
|
var index$d = require('./hyIcon/index.js');
|
|
8
8
|
var index$e = require('./hyIconBox/index.js');
|
|
9
|
-
var index$
|
|
10
|
-
var index$
|
|
9
|
+
var index$k = require('./hySearch/index.js');
|
|
10
|
+
var index$l = require('./hyTable/index.js');
|
|
11
11
|
var index$3 = require('./hyTooltip/index.js');
|
|
12
12
|
var index$8 = require('./hyConfigProvider/index.js');
|
|
13
13
|
var index$7 = require('./hyButton/index.js');
|
|
14
|
-
var index$
|
|
15
|
-
var index$
|
|
16
|
-
var index$
|
|
14
|
+
var index$o = require('./hyUserAvatar/index.js');
|
|
15
|
+
var index$h = require('./hyNoPermissions/index.js');
|
|
16
|
+
var index$i = require('./hyNoPermissionsMap/index.js');
|
|
17
17
|
var index$a = require('./hyCutter/index.js');
|
|
18
18
|
var index$b = require('./hyDialog/index.js');
|
|
19
|
-
var index$
|
|
20
|
-
var index$
|
|
21
|
-
var index$
|
|
19
|
+
var index$g = require('./hyMenu/index.js');
|
|
20
|
+
var index$n = require('./hyTree/index.js');
|
|
21
|
+
var index$p = require('./hyVideoPlayer/index.js');
|
|
22
22
|
var index$4 = require('./hyAudioPlayer/index.js');
|
|
23
23
|
var index$1 = require('./hyInput/index.js');
|
|
24
24
|
var index$2 = require('./hyTimePicker/index.js');
|
|
25
25
|
var index$5 = require('./hyTableForm/index.js');
|
|
26
|
-
var index$
|
|
26
|
+
var index$m = require('./hyTableActionButton/index.js');
|
|
27
27
|
var index$6 = require('./hyBatchUploadDialog/index.js');
|
|
28
|
+
var index$f = require('./hyMap/index.js');
|
|
28
29
|
var useAppForm = require('./hyForm/js/useAppForm.js');
|
|
29
30
|
var useAppSearch = require('./hySearch/js/useAppSearch.js');
|
|
30
31
|
var useAppTable = require('./hyTable/js/useAppTable.js');
|
|
@@ -32,27 +33,27 @@ var useAppTableForm = require('./hyTableForm/js/useAppTableForm.js');
|
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
|
|
35
|
-
exports.HyOrgCascader = index$
|
|
36
|
+
exports.HyOrgCascader = index$j.HyOrgCascader;
|
|
36
37
|
exports.HyConfirmDialog = index$9.HyConfirmDialog;
|
|
37
38
|
exports.ElDatePicker = index.ElDatePicker;
|
|
38
39
|
exports.HyDatePicker = index.HyDatePicker;
|
|
39
40
|
exports.HyForm = index$c.HyForm;
|
|
40
41
|
exports.HyIcon = index$d.HyIcon;
|
|
41
42
|
exports.HyIconBox = index$e.HyIconBox;
|
|
42
|
-
exports.HySearch = index$
|
|
43
|
-
exports.HyTable = index$
|
|
43
|
+
exports.HySearch = index$k.HySearch;
|
|
44
|
+
exports.HyTable = index$l.HyTable;
|
|
44
45
|
exports.ElTooltip = index$3.ElTooltip;
|
|
45
46
|
exports.HyTooltip = index$3.HyTooltip;
|
|
46
47
|
exports.HyConfigProvider = index$8.HyConfigProvider;
|
|
47
48
|
exports.HyButton = index$7.HyButton;
|
|
48
|
-
exports.HyUserAvatar = index$
|
|
49
|
-
exports.HyNoPermissions = index$
|
|
50
|
-
exports.HyNoPermissionsMap = index$
|
|
49
|
+
exports.HyUserAvatar = index$o.HyUserAvatar;
|
|
50
|
+
exports.HyNoPermissions = index$h.HyNoPermissions;
|
|
51
|
+
exports.HyNoPermissionsMap = index$i.HyNoPermissionsMap;
|
|
51
52
|
exports.HyCutter = index$a.HyCutter;
|
|
52
53
|
exports.HyDialog = index$b.HyDialog;
|
|
53
|
-
exports.HyMenu = index$
|
|
54
|
-
exports.HyTree = index$
|
|
55
|
-
exports.HyVideoPlayer = index$
|
|
54
|
+
exports.HyMenu = index$g.HyMenu;
|
|
55
|
+
exports.HyTree = index$n.HyTree;
|
|
56
|
+
exports.HyVideoPlayer = index$p.HyVideoPlayer;
|
|
56
57
|
exports.HyAudioPlayer = index$4.HyAudioPlayer;
|
|
57
58
|
exports.ElInput = index$1.ElInput;
|
|
58
59
|
exports.HyInput = index$1.HyInput;
|
|
@@ -61,8 +62,9 @@ exports.ElTimePicker = index$2.ElTimePicker;
|
|
|
61
62
|
exports.HyTimePicker = index$2.HyTimePicker;
|
|
62
63
|
exports.HyBatchTableForm = index$5.HyBatchTableForm;
|
|
63
64
|
exports.HyTableForm = index$5.HyTableForm;
|
|
64
|
-
exports.HyTableActionButton = index$
|
|
65
|
+
exports.HyTableActionButton = index$m.HyTableActionButton;
|
|
65
66
|
exports.HyBatchUploadDialog = index$6.HyBatchUploadDialog;
|
|
67
|
+
exports.HyMap = index$f.HyMap;
|
|
66
68
|
exports.resetAppFormValue = useAppForm.resetAppFormValue;
|
|
67
69
|
exports.useAppForm = useAppForm.useAppForm;
|
|
68
70
|
exports.resetAppSearchValue = useAppSearch.resetAppSearchValue;
|
package/lib/hooks/index.js
CHANGED
|
@@ -12,6 +12,7 @@ var useAudioPlayerConfig = require('./useAudioPlayerConfig.js');
|
|
|
12
12
|
var useVideoPlayerConfig = require('./useVideoPlayerConfig.js');
|
|
13
13
|
var useEnsureHyIcon = require('./useEnsureHyIcon.js');
|
|
14
14
|
var useTooltipConfig = require('./useTooltipConfig.js');
|
|
15
|
+
var useSubscribe = require('./useSubscribe.js');
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
|
|
@@ -43,3 +44,5 @@ exports.localEnsureHyIconMapKey = useEnsureHyIcon.localEnsureHyIconMapKey;
|
|
|
43
44
|
exports.useEnsureHyIcon = useEnsureHyIcon.useEnsureHyIcon;
|
|
44
45
|
exports.localTooltipConfigKey = useTooltipConfig.localTooltipConfigKey;
|
|
45
46
|
exports.useTooltipConfig = useTooltipConfig.useTooltipConfig;
|
|
47
|
+
exports.usePublish = useSubscribe.usePublish;
|
|
48
|
+
exports.useSubscribe = useSubscribe.useSubscribe;
|
package/lib/hooks/useApi.js
CHANGED
|
@@ -22,10 +22,16 @@ defaultAxios.value.interceptors.response.use(
|
|
|
22
22
|
}
|
|
23
23
|
);
|
|
24
24
|
const useApi = () => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
if (vue.getCurrentInstance()) {
|
|
26
|
+
const api = vue.inject(localApiKey, vue.ref());
|
|
27
|
+
return {
|
|
28
|
+
api: vue.unref(api) ? api : vue.unref(useGlobalConfig.useGlobalConfig())?.api || defaultAxios
|
|
29
|
+
};
|
|
30
|
+
} else {
|
|
31
|
+
return {
|
|
32
|
+
api: vue.unref(useGlobalConfig.useGlobalConfig())?.api || defaultAxios
|
|
33
|
+
};
|
|
34
|
+
}
|
|
29
35
|
};
|
|
30
36
|
|
|
31
37
|
exports.defaultAxios = defaultAxios;
|
|
@@ -5,10 +5,18 @@ var useGlobalConfig = require('./useGlobalConfig.js');
|
|
|
5
5
|
|
|
6
6
|
const localAudioPlayerConfigKey = /* @__PURE__ */ Symbol("useAudioPlayerConfig");
|
|
7
7
|
const useAudioPlayerConfig = () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
if (vue.getCurrentInstance()) {
|
|
9
|
+
const audioPlayerConfig = vue.inject(localAudioPlayerConfigKey, vue.ref());
|
|
10
|
+
return {
|
|
11
|
+
audioPlayerConfig: vue.unref(audioPlayerConfig) ? audioPlayerConfig : vue.computed(() => vue.unref(useGlobalConfig.useGlobalConfig()).audioPlayer || {})
|
|
12
|
+
};
|
|
13
|
+
} else {
|
|
14
|
+
return {
|
|
15
|
+
audioPlayerConfig: vue.computed(
|
|
16
|
+
() => vue.unref(useGlobalConfig.useGlobalConfig()).audioPlayer || {}
|
|
17
|
+
)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
12
20
|
};
|
|
13
21
|
|
|
14
22
|
exports.localAudioPlayerConfigKey = localAudioPlayerConfigKey;
|
|
@@ -5,10 +5,16 @@ var useGlobalConfig = require('./useGlobalConfig.js');
|
|
|
5
5
|
|
|
6
6
|
const localEnsureHyIconMapKey = /* @__PURE__ */ Symbol("ensureHyIcon");
|
|
7
7
|
const useEnsureHyIcon = () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
if (vue.getCurrentInstance()) {
|
|
9
|
+
const ensureHyIcon = vue.inject(localEnsureHyIconMapKey, vue.ref());
|
|
10
|
+
return {
|
|
11
|
+
ensureHyIcon: vue.unref(ensureHyIcon) ? vue.unref(ensureHyIcon) : vue.unref(useGlobalConfig.useGlobalConfig()).ensureHyIcon
|
|
12
|
+
};
|
|
13
|
+
} else {
|
|
14
|
+
return {
|
|
15
|
+
ensureHyIcon: vue.unref(useGlobalConfig.useGlobalConfig()).ensureHyIcon
|
|
16
|
+
};
|
|
17
|
+
}
|
|
12
18
|
};
|
|
13
19
|
|
|
14
20
|
exports.localEnsureHyIconMapKey = localEnsureHyIconMapKey;
|
package/lib/hooks/useLocale.js
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
var lodashUnified = require('lodash-unified');
|
|
5
|
-
var useGlobalConfig = require('./useGlobalConfig.js');
|
|
6
5
|
var index = require('../locale/index.js');
|
|
6
|
+
var useGlobalConfig = require('./useGlobalConfig.js');
|
|
7
|
+
var is = require('../utils/is.js');
|
|
7
8
|
var zh_CN = require('../locale/zh_CN.js');
|
|
8
9
|
|
|
9
10
|
const buildTranslator = (locale) => (path, option) => translate(path, option, vue.unref(locale));
|
|
10
11
|
const translate = (path, option, locale) => lodashUnified.get(locale, path, path).replace(
|
|
11
12
|
/\{(\w+)\}/g,
|
|
12
|
-
(_, key) => `${option?.[key]
|
|
13
|
+
(_, key) => `${!is.isEmpty(option?.[key]) ? option[key] : ""}`
|
|
13
14
|
);
|
|
14
15
|
const buildLocaleContext = (locale, conifg) => {
|
|
15
16
|
const lang = vue.computed(() => vue.unref(locale).name);
|
|
@@ -22,11 +23,11 @@ const buildLocaleContext = (locale, conifg) => {
|
|
|
22
23
|
};
|
|
23
24
|
const localeContextKey = /* @__PURE__ */ Symbol("localeContextKey");
|
|
24
25
|
const getLanguage = (localeOverrides) => {
|
|
25
|
-
const locale = localeOverrides || vue.inject(localeContextKey, vue.ref());
|
|
26
|
+
const locale = localeOverrides || (vue.getCurrentInstance() ? vue.inject(localeContextKey, vue.ref()) : void 0);
|
|
26
27
|
return vue.unref(locale)?.name || Chinese?.name;
|
|
27
28
|
};
|
|
28
29
|
const useLocale = (localeOverrides) => {
|
|
29
|
-
const locale = localeOverrides || vue.inject(localeContextKey, vue.ref());
|
|
30
|
+
const locale = localeOverrides || (vue.getCurrentInstance() ? vue.inject(localeContextKey, vue.ref()) : void 0);
|
|
30
31
|
return buildLocaleContext(
|
|
31
32
|
vue.computed(
|
|
32
33
|
() => vue.unref(locale) || index[vue.unref(useGlobalConfig.useGlobalConfig())?.locale] || zh_CN.default
|
|
@@ -5,10 +5,18 @@ var useGlobalConfig = require('./useGlobalConfig.js');
|
|
|
5
5
|
|
|
6
6
|
const localPermissionMapKey = /* @__PURE__ */ Symbol("permissionMap");
|
|
7
7
|
const usePermissionMap = () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
if (vue.getCurrentInstance()) {
|
|
9
|
+
const permissionMap = vue.inject(localPermissionMapKey, vue.ref());
|
|
10
|
+
return {
|
|
11
|
+
permissionMap: vue.unref(permissionMap) ? permissionMap : vue.computed(() => vue.unref(useGlobalConfig.useGlobalConfig()).permissionMap || /* @__PURE__ */ new Map())
|
|
12
|
+
};
|
|
13
|
+
} else {
|
|
14
|
+
return {
|
|
15
|
+
permissionMap: vue.computed(
|
|
16
|
+
() => vue.unref(useGlobalConfig.useGlobalConfig()).permissionMap || /* @__PURE__ */ new Map()
|
|
17
|
+
)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
12
20
|
};
|
|
13
21
|
|
|
14
22
|
exports.localPermissionMapKey = localPermissionMapKey;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var mitt = require('mitt');
|
|
4
|
+
|
|
5
|
+
const bus = mitt();
|
|
6
|
+
const UPDATE_ORG_CASCADER = "UPDATE_ORG_CASCADER";
|
|
7
|
+
function useSubscribe() {
|
|
8
|
+
const subOrgCascader = (callback) => {
|
|
9
|
+
bus.on(UPDATE_ORG_CASCADER, callback);
|
|
10
|
+
};
|
|
11
|
+
const unsubOrgCascader = (callback) => {
|
|
12
|
+
bus.on(UPDATE_ORG_CASCADER, callback);
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
// 部门级联组件
|
|
16
|
+
subOrgCascader,
|
|
17
|
+
unsubOrgCascader
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function usePublish() {
|
|
21
|
+
const pubOrgCascader = () => {
|
|
22
|
+
bus.emit(UPDATE_ORG_CASCADER);
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
// 部门级联组件
|
|
26
|
+
pubOrgCascader
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.usePublish = usePublish;
|
|
31
|
+
exports.useSubscribe = useSubscribe;
|
|
@@ -5,10 +5,16 @@ var useGlobalConfig = require('./useGlobalConfig.js');
|
|
|
5
5
|
|
|
6
6
|
const localTooltipConfigKey = /* @__PURE__ */ Symbol("useTooltipConfig");
|
|
7
7
|
const useTooltipConfig = () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
if (vue.getCurrentInstance()) {
|
|
9
|
+
const tooltipConfig = vue.inject(localTooltipConfigKey, vue.ref());
|
|
10
|
+
return {
|
|
11
|
+
tooltipConfig: vue.unref(tooltipConfig) ? tooltipConfig : vue.computed(() => vue.unref(useGlobalConfig.useGlobalConfig()).tooltip || {})
|
|
12
|
+
};
|
|
13
|
+
} else {
|
|
14
|
+
return {
|
|
15
|
+
tooltipConfig: vue.computed(() => vue.unref(useGlobalConfig.useGlobalConfig()).tooltip || {})
|
|
16
|
+
};
|
|
17
|
+
}
|
|
12
18
|
};
|
|
13
19
|
|
|
14
20
|
exports.localTooltipConfigKey = localTooltipConfigKey;
|
|
@@ -5,10 +5,18 @@ var useGlobalConfig = require('./useGlobalConfig.js');
|
|
|
5
5
|
|
|
6
6
|
const localUserAvatarMapKey = /* @__PURE__ */ Symbol("userAvatarMap");
|
|
7
7
|
const useUserAvatarMap = () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
if (vue.getCurrentInstance()) {
|
|
9
|
+
const userAvatarMap = vue.inject(localUserAvatarMapKey, vue.ref());
|
|
10
|
+
return {
|
|
11
|
+
userAvatarMap: vue.unref(userAvatarMap) ? userAvatarMap : vue.computed(() => vue.unref(useGlobalConfig.useGlobalConfig()).userAvatarMap || /* @__PURE__ */ new Map())
|
|
12
|
+
};
|
|
13
|
+
} else {
|
|
14
|
+
return {
|
|
15
|
+
userAvatarMap: vue.computed(
|
|
16
|
+
() => vue.unref(useGlobalConfig.useGlobalConfig()).userAvatarMap || /* @__PURE__ */ new Map()
|
|
17
|
+
)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
12
20
|
};
|
|
13
21
|
|
|
14
22
|
exports.localUserAvatarMapKey = localUserAvatarMapKey;
|
|
@@ -5,10 +5,18 @@ var useGlobalConfig = require('./useGlobalConfig.js');
|
|
|
5
5
|
|
|
6
6
|
const localVideoPlayerConfigKey = /* @__PURE__ */ Symbol("useVideoPlayerConfig");
|
|
7
7
|
const useVideoPlayerConfig = () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
if (vue.getCurrentInstance()) {
|
|
9
|
+
const videoPlayerConfig = vue.inject(localVideoPlayerConfigKey, vue.ref());
|
|
10
|
+
return {
|
|
11
|
+
videoPlayerConfig: vue.unref(videoPlayerConfig) ? videoPlayerConfig : vue.computed(() => vue.unref(useGlobalConfig.useGlobalConfig()).videoPlayer || {})
|
|
12
|
+
};
|
|
13
|
+
} else {
|
|
14
|
+
return {
|
|
15
|
+
videoPlayerConfig: vue.computed(
|
|
16
|
+
() => vue.unref(useGlobalConfig.useGlobalConfig()).videoPlayer || {}
|
|
17
|
+
)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
12
20
|
};
|
|
13
21
|
|
|
14
22
|
exports.localVideoPlayerConfigKey = localVideoPlayerConfigKey;
|
package/lib/index.js
CHANGED
|
@@ -18,21 +18,21 @@ var index$b = require('./components/hyDialog/index.js');
|
|
|
18
18
|
var index$c = require('./components/hyForm/index.js');
|
|
19
19
|
var index$d = require('./components/hyIcon/index.js');
|
|
20
20
|
var index$e = require('./components/hyIconBox/index.js');
|
|
21
|
-
var index$f = require('./components/
|
|
22
|
-
var index$g = require('./components/
|
|
23
|
-
var index$h = require('./components/
|
|
24
|
-
var index$i = require('./components/
|
|
25
|
-
var index$j = require('./components/
|
|
26
|
-
var index$k = require('./components/
|
|
27
|
-
var index$l = require('./components/
|
|
28
|
-
var index$m = require('./components/
|
|
29
|
-
var index$n = require('./components/
|
|
30
|
-
var index$o = require('./components/
|
|
21
|
+
var index$f = require('./components/hyMap/index.js');
|
|
22
|
+
var index$g = require('./components/hyMenu/index.js');
|
|
23
|
+
var index$h = require('./components/hyNoPermissions/index.js');
|
|
24
|
+
var index$i = require('./components/hyNoPermissionsMap/index.js');
|
|
25
|
+
var index$j = require('./components/hyOrgCascader/index.js');
|
|
26
|
+
var index$k = require('./components/hySearch/index.js');
|
|
27
|
+
var index$l = require('./components/hyTable/index.js');
|
|
28
|
+
var index$m = require('./components/hyTableActionButton/index.js');
|
|
29
|
+
var index$n = require('./components/hyTree/index.js');
|
|
30
|
+
var index$o = require('./components/hyUserAvatar/index.js');
|
|
31
|
+
var index$p = require('./components/hyVideoPlayer/index.js');
|
|
31
32
|
var permission = require('./utils/permission.js');
|
|
32
33
|
var crypto = require('./utils/crypto.js');
|
|
33
34
|
var file = require('./utils/file.js');
|
|
34
35
|
var useLocale = require('./hooks/useLocale.js');
|
|
35
|
-
var bus = require('./utils/bus.js');
|
|
36
36
|
var useResizeObserver = require('./hooks/useResizeObserver.js');
|
|
37
37
|
var form = require('./utils/form.js');
|
|
38
38
|
var handler = require('./utils/handler.js');
|
|
@@ -52,6 +52,7 @@ var useAppSearch = require('./components/hySearch/js/useAppSearch.js');
|
|
|
52
52
|
var useAppTable = require('./components/hyTable/js/useAppTable.js');
|
|
53
53
|
var useAppTableForm = require('./components/hyTableForm/js/useAppTableForm.js');
|
|
54
54
|
var useMixins = require('./hooks/useMixins.js');
|
|
55
|
+
var useSubscribe = require('./hooks/useSubscribe.js');
|
|
55
56
|
var useResizeHandler = require('./hooks/useResizeHandler.js');
|
|
56
57
|
|
|
57
58
|
import "./style/index.scss";
|
|
@@ -79,16 +80,17 @@ exports.HyDialog = index$b.HyDialog;
|
|
|
79
80
|
exports.HyForm = index$c.HyForm;
|
|
80
81
|
exports.HyIcon = index$d.HyIcon;
|
|
81
82
|
exports.HyIconBox = index$e.HyIconBox;
|
|
82
|
-
exports.
|
|
83
|
-
exports.
|
|
84
|
-
exports.
|
|
85
|
-
exports.
|
|
86
|
-
exports.
|
|
87
|
-
exports.
|
|
88
|
-
exports.
|
|
89
|
-
exports.
|
|
90
|
-
exports.
|
|
91
|
-
exports.
|
|
83
|
+
exports.HyMap = index$f.HyMap;
|
|
84
|
+
exports.HyMenu = index$g.HyMenu;
|
|
85
|
+
exports.HyNoPermissions = index$h.HyNoPermissions;
|
|
86
|
+
exports.HyNoPermissionsMap = index$i.HyNoPermissionsMap;
|
|
87
|
+
exports.HyOrgCascader = index$j.HyOrgCascader;
|
|
88
|
+
exports.HySearch = index$k.HySearch;
|
|
89
|
+
exports.HyTable = index$l.HyTable;
|
|
90
|
+
exports.HyTableActionButton = index$m.HyTableActionButton;
|
|
91
|
+
exports.HyTree = index$n.HyTree;
|
|
92
|
+
exports.HyUserAvatar = index$o.HyUserAvatar;
|
|
93
|
+
exports.HyVideoPlayer = index$p.HyVideoPlayer;
|
|
92
94
|
exports.PERMISSION = permission.PERMISSION;
|
|
93
95
|
exports.base64Decrypt = crypto.base64Decrypt;
|
|
94
96
|
exports.encryptToBase64 = crypto.encryptToBase64;
|
|
@@ -105,10 +107,11 @@ exports.getLanguage = useLocale.getLanguage;
|
|
|
105
107
|
exports.localeContextKey = useLocale.localeContextKey;
|
|
106
108
|
exports.translate = useLocale.translate;
|
|
107
109
|
exports.useLocale = useLocale.useLocale;
|
|
108
|
-
exports.bus = bus.bus;
|
|
109
110
|
exports.clearResizeObserver = useResizeObserver.clearResizeObserver;
|
|
110
111
|
exports.useResizeObserver = useResizeObserver.useResizeObserver;
|
|
111
112
|
exports.clearSpace = form.clearSpace;
|
|
113
|
+
exports.columnRuleHandler = form.columnRuleHandler;
|
|
114
|
+
exports.genRuleRequiredMsgHandler = form.genRuleRequiredMsgHandler;
|
|
112
115
|
exports.genValueByProp = form.genValueByProp;
|
|
113
116
|
exports.getValueByProp = form.getValueByProp;
|
|
114
117
|
exports.setValueByProp = form.setValueByProp;
|
|
@@ -164,4 +167,6 @@ exports.useAppSearch = useAppSearch.useAppSearch;
|
|
|
164
167
|
exports.useAppTable = useAppTable.useAppTable;
|
|
165
168
|
exports.useAppTableForm = useAppTableForm.useAppTableForm;
|
|
166
169
|
exports.useMixins = useMixins.useMixins;
|
|
170
|
+
exports.usePublish = useSubscribe.usePublish;
|
|
171
|
+
exports.useSubscribe = useSubscribe.useSubscribe;
|
|
167
172
|
exports.useResizeHandler = useResizeHandler.useResizeHandler;
|