hy-dispatch-ui-v3 0.2.77 → 0.2.79
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 +95 -12
- package/es/api/common.mjs +28 -0
- package/es/bussiness/hyDepartmentTypeOperation/departmentTypeOperation2.vue.mjs +5 -8
- package/es/bussiness/hyDepartmentTypeOperation/departmentTypeOperation_tiantong2.vue.mjs +108 -125
- package/es/bussiness/hyDepartmentTypeOperation/locale/en_US.mjs +7 -7
- package/es/bussiness/hyDepartmentTypeOperation/locale/zh_CN.mjs +6 -6
- package/es/bussiness/hyDisplayQueryAddress/displayQueryAddress.vue.mjs +5 -0
- package/es/bussiness/hyDisplayQueryAddress/displayQueryAddress2.install.mjs +6 -0
- package/es/bussiness/hyDisplayQueryAddress/displayQueryAddress2.vue.mjs +182 -0
- package/es/bussiness/hyDisplayQueryAddress/index.mjs +8 -0
- package/es/bussiness/hyDisplayQueryAddress/locale/en_US.mjs +7 -0
- package/es/bussiness/hyDisplayQueryAddress/locale/index.mjs +2 -0
- package/es/bussiness/hyDisplayQueryAddress/locale/zh_CN.mjs +7 -0
- package/es/bussiness/hyDisplayQueryAddress/style/dialog.scss +0 -0
- package/es/bussiness/hyFilePlayback/cpns/audioDetail.vue.mjs +5 -0
- package/es/bussiness/hyFilePlayback/cpns/audioDetail2.install.mjs +6 -0
- package/es/bussiness/hyFilePlayback/cpns/audioDetail2.vue.mjs +247 -0
- package/es/bussiness/hyFilePlayback/cpns/picDetail.vue.mjs +5 -0
- package/es/bussiness/hyFilePlayback/cpns/picDetail2.install.mjs +6 -0
- package/es/bussiness/hyFilePlayback/cpns/picDetail2.vue.mjs +206 -0
- package/es/bussiness/hyFilePlayback/cpns/videoDetail.vue.mjs +5 -0
- package/es/bussiness/hyFilePlayback/cpns/videoDetail2.install.mjs +6 -0
- package/es/bussiness/hyFilePlayback/cpns/videoDetail2.vue.mjs +238 -0
- package/es/bussiness/hyFilePlayback/filePlayback.vue.mjs +5 -0
- package/es/bussiness/hyFilePlayback/filePlayback2.install.mjs +6 -0
- package/es/bussiness/hyFilePlayback/filePlayback2.vue.mjs +166 -0
- package/es/bussiness/hyFilePlayback/index.mjs +8 -0
- package/es/bussiness/hyFilePlayback/locale/en_US.mjs +22 -0
- package/es/bussiness/hyFilePlayback/locale/index.mjs +2 -0
- package/es/bussiness/hyFilePlayback/locale/zh_CN.mjs +22 -0
- package/es/bussiness/hyFilePlayback/style/filePlayback.scss +2 -0
- package/es/bussiness/index.mjs +2 -0
- package/es/components/hyCutter/cutter.vue.mjs +2 -2
- package/es/components/hyDatePicker/datePicker.vue.mjs +34 -4
- package/es/components/hyForm/cpns/arrayItem.vue.mjs +2 -2
- package/es/components/hyForm/cpns/formItem.vue.mjs +73 -63
- package/es/components/hyForm/js/index.mjs +2 -8
- package/es/components/hyForm/js/useAppForm.mjs +2 -1
- package/es/components/hySearch/cpns/searchItem.vue.mjs +57 -67
- package/es/components/hySearch/js/index.mjs +1 -35
- package/es/components/hySearch/js/useAppSearch.mjs +2 -29
- package/es/components/hySearch/style/search.scss +1 -0
- package/es/components/hyTable/cpns/virtualTable.vue.mjs +5 -5
- package/es/components/hyTable/js/index.mjs +44 -4
- package/es/components/hyTable/js/search.mjs +1 -7
- package/es/components/hyTable/table.vue.mjs +47 -30
- package/es/components/hyTooltip/tooltip.vue.mjs +39 -21
- package/es/components/hyUserAvatar/userAvatar.vue.mjs +1 -1
- package/es/components/hyVideoPlayer/videoPlayer.vue.mjs +3 -3
- package/es/components-map.mjs +2 -0
- package/es/hooks/useBaseMainStore.mjs +16 -5
- package/es/hooks/useCurrentBus.mjs +5 -4
- package/es/hooks/useDialog.mjs +2 -2
- package/es/hooks/useGlobalConfig.mjs +19 -18
- package/es/index.mjs +5 -2
- package/es/locale/en_US.mjs +1 -0
- package/es/locale/zh_CN.mjs +1 -0
- package/es/style/index.scss +2 -2
- package/es/utils/file.mjs +1 -2
- package/es/utils/form.mjs +84 -5
- package/es/utils/index.mjs +3 -2
- package/es/utils/is.mjs +1 -1
- package/es/utils/map/hook/leafletjs.mjs +4 -0
- package/es/utils/map/index.mjs +4 -0
- package/es/utils/permission.mjs +3 -1
- package/es/utils/timeUtils.mjs +95 -0
- package/es/version.mjs +1 -1
- package/lib/api/common.js +33 -0
- package/lib/bussiness/hyDepartmentTypeOperation/departmentTypeOperation2.vue.js +3 -6
- package/lib/bussiness/hyDepartmentTypeOperation/departmentTypeOperation_tiantong2.vue.js +107 -124
- package/lib/bussiness/hyDepartmentTypeOperation/locale/en_US.js +7 -7
- package/lib/bussiness/hyDepartmentTypeOperation/locale/zh_CN.js +6 -6
- package/lib/bussiness/hyDisplayQueryAddress/displayQueryAddress.install.js +6 -0
- package/lib/bussiness/hyDisplayQueryAddress/displayQueryAddress.vue.js +9 -0
- package/lib/bussiness/hyDisplayQueryAddress/displayQueryAddress2.install.js +6 -0
- package/lib/bussiness/hyDisplayQueryAddress/displayQueryAddress2.vue.js +186 -0
- package/lib/bussiness/hyDisplayQueryAddress/index.js +13 -0
- package/lib/bussiness/hyDisplayQueryAddress/locale/en_US.js +11 -0
- package/lib/bussiness/hyDisplayQueryAddress/locale/index.js +9 -0
- package/lib/bussiness/hyDisplayQueryAddress/locale/zh_CN.js +11 -0
- package/lib/bussiness/hyDisplayQueryAddress/style/dialog.scss +0 -0
- package/lib/bussiness/hyFilePlayback/cpns/audioDetail.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/cpns/audioDetail.vue.js +9 -0
- package/lib/bussiness/hyFilePlayback/cpns/audioDetail2.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/cpns/audioDetail2.vue.js +251 -0
- package/lib/bussiness/hyFilePlayback/cpns/picDetail.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/cpns/picDetail.vue.js +9 -0
- package/lib/bussiness/hyFilePlayback/cpns/picDetail2.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/cpns/picDetail2.vue.js +210 -0
- package/lib/bussiness/hyFilePlayback/cpns/videoDetail.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/cpns/videoDetail.vue.js +9 -0
- package/lib/bussiness/hyFilePlayback/cpns/videoDetail2.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/cpns/videoDetail2.vue.js +242 -0
- package/lib/bussiness/hyFilePlayback/filePlayback.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/filePlayback.vue.js +9 -0
- package/lib/bussiness/hyFilePlayback/filePlayback2.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/filePlayback2.vue.js +170 -0
- package/lib/bussiness/hyFilePlayback/index.js +13 -0
- package/lib/bussiness/hyFilePlayback/locale/en_US.js +26 -0
- package/lib/bussiness/hyFilePlayback/locale/index.js +9 -0
- package/lib/bussiness/hyFilePlayback/locale/zh_CN.js +26 -0
- package/lib/bussiness/hyFilePlayback/style/filePlayback.scss +2 -0
- package/lib/bussiness/index.js +18 -14
- package/lib/components/hyCutter/cutter.vue.js +2 -2
- package/lib/components/hyDatePicker/datePicker.vue.js +32 -2
- package/lib/components/hyForm/cpns/arrayItem.vue.js +2 -2
- package/lib/components/hyForm/cpns/formItem.vue.js +71 -61
- package/lib/components/hyForm/js/index.js +0 -7
- package/lib/components/hyForm/js/useAppForm.js +1 -0
- package/lib/components/hySearch/cpns/searchItem.vue.js +64 -74
- package/lib/components/hySearch/js/index.js +0 -36
- package/lib/components/hySearch/js/useAppSearch.js +1 -28
- package/lib/components/hySearch/style/search.scss +1 -0
- package/lib/components/hyTable/cpns/virtualTable.vue.js +4 -4
- package/lib/components/hyTable/js/index.js +45 -3
- package/lib/components/hyTable/js/search.js +1 -7
- package/lib/components/hyTable/table.vue.js +46 -29
- package/lib/components/hyTooltip/tooltip.vue.js +38 -20
- package/lib/components/hyUserAvatar/userAvatar.vue.js +1 -1
- package/lib/components/hyVideoPlayer/videoPlayer.vue.js +3 -3
- package/lib/components-map.js +2 -0
- package/lib/hooks/useBaseMainStore.js +15 -4
- package/lib/hooks/useCurrentBus.js +4 -3
- package/lib/hooks/useDialog.js +2 -2
- package/lib/hooks/useGlobalConfig.js +18 -17
- package/lib/index.js +71 -55
- package/lib/locale/en_US.js +1 -0
- package/lib/locale/zh_CN.js +1 -0
- package/lib/style/index.scss +2 -2
- package/lib/utils/file.js +1 -2
- package/lib/utils/form.js +87 -4
- package/lib/utils/index.js +13 -1
- package/lib/utils/is.js +1 -1
- package/lib/utils/map/hook/leafletjs.js +4 -0
- package/lib/utils/map/index.js +4 -0
- package/lib/utils/permission.js +3 -1
- package/lib/utils/timeUtils.js +105 -0
- package/lib/version.js +1 -1
- package/package.json +14 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, getCurrentInstance, inject, computed,
|
|
1
|
+
import { ref, getCurrentInstance, inject, computed, unref, provide } from 'vue';
|
|
2
2
|
import * as index from '../locale/index.mjs';
|
|
3
3
|
import { localeContextKey } from './useLocale.mjs';
|
|
4
4
|
import { localApiKey } from './useApi.mjs';
|
|
@@ -14,7 +14,7 @@ import { localCurrentBusKey } from './useCurrentBus.mjs';
|
|
|
14
14
|
import { localVersionStoreKey, localComponentsMapKey } from './useVersionControl.mjs';
|
|
15
15
|
import zh_CN from '../locale/zh_CN.mjs';
|
|
16
16
|
|
|
17
|
-
const globalConfig = ref();
|
|
17
|
+
const globalConfig = ref({});
|
|
18
18
|
const mergeConfig = (a, b) => {
|
|
19
19
|
const keys = [.../* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(b)])];
|
|
20
20
|
const obj = {};
|
|
@@ -27,9 +27,9 @@ const configProviderContextKey = /* @__PURE__ */ Symbol("configProviderContextKe
|
|
|
27
27
|
function useGlobalConfig(key, defaultValue = void 0) {
|
|
28
28
|
const config = getCurrentInstance() ? inject(configProviderContextKey, globalConfig) : globalConfig;
|
|
29
29
|
if (key) {
|
|
30
|
-
return computed(() => config.value?.[key] ?? defaultValue);
|
|
30
|
+
return computed(() => unref(config.value?.[key]) ?? defaultValue);
|
|
31
31
|
} else {
|
|
32
|
-
return config;
|
|
32
|
+
return unref(config);
|
|
33
33
|
}
|
|
34
34
|
return {
|
|
35
35
|
config
|
|
@@ -51,55 +51,56 @@ const provideGlobalConfig = (props, app, global = false) => {
|
|
|
51
51
|
provideFn(configProviderContextKey, context);
|
|
52
52
|
provideFn(
|
|
53
53
|
localeContextKey,
|
|
54
|
-
computed(() => index[context.value.locale] || zh_CN)
|
|
54
|
+
computed(() => unref(index[context.value.locale]) || zh_CN)
|
|
55
55
|
);
|
|
56
56
|
provideFn(
|
|
57
57
|
localApiKey,
|
|
58
|
-
computed(() => context.value.api)
|
|
58
|
+
computed(() => unref(context.value.api))
|
|
59
59
|
);
|
|
60
60
|
provideFn(
|
|
61
61
|
localUserAvatarMapKey,
|
|
62
|
-
computed(() => context.value.userAvatarMap)
|
|
62
|
+
computed(() => unref(context.value.userAvatarMap))
|
|
63
63
|
);
|
|
64
64
|
provideFn(
|
|
65
65
|
localPermissionMapKey,
|
|
66
|
-
computed(() => context.value.permissionMap)
|
|
66
|
+
computed(() => unref(context.value.permissionMap))
|
|
67
67
|
);
|
|
68
68
|
provideFn(
|
|
69
69
|
localAudioPlayerConfigKey,
|
|
70
|
-
computed(() => context.value.audioPlayer)
|
|
70
|
+
computed(() => unref(context.value.audioPlayer))
|
|
71
71
|
);
|
|
72
72
|
provideFn(
|
|
73
73
|
localVideoPlayerConfigKey,
|
|
74
|
-
computed(() => context.value.videoPlayer)
|
|
74
|
+
computed(() => unref(context.value.videoPlayer))
|
|
75
75
|
);
|
|
76
76
|
provideFn(
|
|
77
77
|
localEnsureHyIconMapKey,
|
|
78
|
-
computed(() => context.value.ensureHyIcon)
|
|
78
|
+
computed(() => unref(context.value.ensureHyIcon))
|
|
79
79
|
);
|
|
80
80
|
provideFn(
|
|
81
81
|
localTooltipConfigKey,
|
|
82
|
-
computed(() => context.value.tooltip)
|
|
82
|
+
computed(() => unref(context.value.tooltip))
|
|
83
83
|
);
|
|
84
84
|
provideFn(
|
|
85
85
|
localMapConfigKey,
|
|
86
|
-
computed(() => context.value.mapConfig)
|
|
86
|
+
computed(() => unref(context.value.mapConfig))
|
|
87
87
|
);
|
|
88
|
-
provideFn(localBaseMainStoreKey, context.value.baseMainStore);
|
|
88
|
+
provideFn(localBaseMainStoreKey, unref(context.value.baseMainStore));
|
|
89
89
|
provideFn(
|
|
90
90
|
localCurrentBusKey,
|
|
91
|
-
computed(() => context.value.currentBus)
|
|
91
|
+
computed(() => unref(context.value.currentBus))
|
|
92
92
|
);
|
|
93
93
|
provideFn(
|
|
94
94
|
localVersionStoreKey,
|
|
95
|
-
computed(() => context.value.versionStore)
|
|
95
|
+
computed(() => unref(context.value.versionStore))
|
|
96
96
|
);
|
|
97
97
|
provideFn(
|
|
98
98
|
localComponentsMapKey,
|
|
99
|
-
computed(() => context.value.componentsMap)
|
|
99
|
+
computed(() => unref(context.value.componentsMap))
|
|
100
100
|
);
|
|
101
|
-
if (global || !globalConfig.value) {
|
|
101
|
+
if (global || !globalConfig.value.initial) {
|
|
102
102
|
globalConfig.value = context.value;
|
|
103
|
+
globalConfig.value.initial = true;
|
|
103
104
|
}
|
|
104
105
|
return context;
|
|
105
106
|
};
|
package/es/index.mjs
CHANGED
|
@@ -22,7 +22,9 @@ export { HyCutter } from './components/hyCutter/index.mjs';
|
|
|
22
22
|
export { HyDepartmentTypeOperation, HyDepartmentTypeOperationTiantong } from './bussiness/hyDepartmentTypeOperation/index.mjs';
|
|
23
23
|
export { HyDeviceTree } from './bussiness/hyDeviceTree/index.mjs';
|
|
24
24
|
export { HyDialog } from './components/hyDialog/index.mjs';
|
|
25
|
+
export { HyDisplayQueryAddress } from './bussiness/hyDisplayQueryAddress/index.mjs';
|
|
25
26
|
export { HyDrawer } from './components/hyDrawer/index.mjs';
|
|
27
|
+
export { HyFilePlayback } from './bussiness/hyFilePlayback/index.mjs';
|
|
26
28
|
export { HyForm } from './components/hyForm/index.mjs';
|
|
27
29
|
export { HyIcon } from './components/hyIcon/index.mjs';
|
|
28
30
|
export { HyIconBox } from './components/hyIconBox/index.mjs';
|
|
@@ -51,11 +53,12 @@ export { base64Decrypt, encryptToBase64, generateRandomCode } from './utils/cryp
|
|
|
51
53
|
export { blobToDataURL, fileFormUpload, fileJsonUplaod, fileUpload, presignedUrl, sizeToTextHandler } from './utils/file.mjs';
|
|
52
54
|
export { bus, usePublish, useSubscribe } from './hooks/useSubscribe.mjs';
|
|
53
55
|
export { clearResizeObserver, useResizeObserver } from './hooks/useResizeObserver.mjs';
|
|
54
|
-
export { clearSpace, columnLabelHandler, columnPlaceholderHandler, columnRuleHandler, genColumnDefaultLabel, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp } from './utils/form.mjs';
|
|
56
|
+
export { clearSpace, columnHelpHandler, columnLabelHandler, columnPlaceholderHandler, columnRuleHandler, columnTimeRangeOptionsHandler, columnnoDataTextHandler, genColumnDefaultLabel, genColumnShortcuts, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp } from './utils/form.mjs';
|
|
55
57
|
export { cloneDeep, copyText, createUniqueId, funRunHandler, mergeDeep, withInstall } from './utils/handler.mjs';
|
|
56
58
|
export { configProviderContextKey, provideGlobalConfig, useGlobalConfig } from './hooks/useGlobalConfig.mjs';
|
|
57
59
|
export { defaultAxios, localApiKey, useApi } from './hooks/useApi.mjs';
|
|
58
|
-
export { enterNumbersRrLetters, enterTheMumber, filterSpaces,
|
|
60
|
+
export { enterNumbersRrLetters, enterTheMumber, filterSpaces, formatTimeFn, getPublicFileSize, inputForbidden, keepTwoDecimalPlaces, onlyNumber } from './utils/input.mjs';
|
|
61
|
+
export { formatDay, formatHoursToHM, formatSeconds, formatTime, getBeforeDays, getCurDtm, getNextDays, getToday } from './utils/timeUtils.mjs';
|
|
59
62
|
export { formatDuration, getDefaultValueFormatByType } from './utils/date.mjs';
|
|
60
63
|
export { isArray, isBoolean, isEmpty, isFile, isFunction, isNull, isNumber, isObject, isOverflowing, isPermission, isString, isSupportH265, isSymbol, isUndefined, isVueProxy } from './utils/is.mjs';
|
|
61
64
|
export { loadingSvg } from './utils/sharedContent.mjs';
|
package/es/locale/en_US.mjs
CHANGED
package/es/locale/zh_CN.mjs
CHANGED
package/es/style/index.scss
CHANGED
|
@@ -74,8 +74,8 @@ video {
|
|
|
74
74
|
overflow: hidden;
|
|
75
75
|
text-overflow: ellipsis;
|
|
76
76
|
display: -webkit-box;
|
|
77
|
-
-webkit-line-clamp:
|
|
78
|
-
line-clamp:
|
|
77
|
+
-webkit-line-clamp: var(--line-clamp);
|
|
78
|
+
line-clamp: var(--line-clamp);
|
|
79
79
|
-webkit-box-orient: vertical;
|
|
80
80
|
word-break: break-all;
|
|
81
81
|
}
|
package/es/utils/file.mjs
CHANGED
|
@@ -38,11 +38,10 @@ async function fileFormUpload(file) {
|
|
|
38
38
|
try {
|
|
39
39
|
const formData = new FormData();
|
|
40
40
|
formData.append("file", file);
|
|
41
|
-
|
|
41
|
+
return await unref(api).post("/file/upload", formData, {
|
|
42
42
|
otherUrl: true,
|
|
43
43
|
xAmzAcl: false
|
|
44
44
|
});
|
|
45
|
-
return res;
|
|
46
45
|
} catch (err) {
|
|
47
46
|
return Promise.reject(err);
|
|
48
47
|
}
|
package/es/utils/form.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
1
2
|
import { unref } from 'vue';
|
|
2
3
|
import '../hooks/index.mjs';
|
|
3
4
|
import { isString, isArray, isBoolean, isFunction, isObject, isNumber, isEmpty } from './is.mjs';
|
|
@@ -128,14 +129,22 @@ const columnLabelHandler = (column, model) => {
|
|
|
128
129
|
}
|
|
129
130
|
return label;
|
|
130
131
|
};
|
|
132
|
+
const columnnoDataTextHandler = (column, model) => {
|
|
133
|
+
const { type, attrs = {} } = column || {};
|
|
134
|
+
const label = unref(attrs.noDataText);
|
|
135
|
+
if (isEmpty(label)) return "";
|
|
136
|
+
if (isFunction(label)) {
|
|
137
|
+
return label(column, model);
|
|
138
|
+
}
|
|
139
|
+
return label;
|
|
140
|
+
};
|
|
131
141
|
function columnPlaceholderHandler(column, model) {
|
|
132
142
|
const { type, attrs = {} } = column || {};
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return
|
|
143
|
+
let placeholder = unref(attrs.placeholder);
|
|
144
|
+
if (isFunction(placeholder)) {
|
|
145
|
+
return placeholder(column, model);
|
|
136
146
|
}
|
|
137
147
|
const label = columnLabelHandler(column, model);
|
|
138
|
-
let placeholder = attrs.placeholder;
|
|
139
148
|
switch (type) {
|
|
140
149
|
case "input":
|
|
141
150
|
case "input-number":
|
|
@@ -154,5 +163,75 @@ function columnPlaceholderHandler(column, model) {
|
|
|
154
163
|
}
|
|
155
164
|
return placeholder;
|
|
156
165
|
}
|
|
166
|
+
function columnHelpHandler(props, column) {
|
|
167
|
+
const help = unref(column.help);
|
|
168
|
+
if (isString(help)) return help;
|
|
169
|
+
if (isFunction(help)) return help(column, props.model);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
function columnTimeRangeOptionsHandler(config) {
|
|
173
|
+
const { timeRangeOptions } = config || {};
|
|
174
|
+
if (!timeRangeOptions?.length) return timeRangeOptions;
|
|
175
|
+
return timeRangeOptions.reduce((list, item) => {
|
|
176
|
+
let { value, label, unit } = item;
|
|
177
|
+
if (!value || !isNumber(value) || isNaN(value)) return list;
|
|
178
|
+
const isPlural = value > 1;
|
|
179
|
+
if (!label) {
|
|
180
|
+
switch (unit) {
|
|
181
|
+
case "year":
|
|
182
|
+
label = $t("hy.lastDate", [value + $t(isPlural ? "hy.years" : "hy.year")]);
|
|
183
|
+
break;
|
|
184
|
+
case "month":
|
|
185
|
+
label = $t("hy.lastDate", [value + $t(isPlural ? "hy.months" : "hy.month")]);
|
|
186
|
+
break;
|
|
187
|
+
case "day":
|
|
188
|
+
default:
|
|
189
|
+
unit = "day";
|
|
190
|
+
label = value === 1 ? $t("hy.today") : $t("hy.lastDate", [value + $t(isPlural ? "hy.days" : "hy.day")]);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
list.push({ ...item, label, unit });
|
|
194
|
+
return list;
|
|
195
|
+
}, []);
|
|
196
|
+
}
|
|
197
|
+
function genColumnShortcuts(column) {
|
|
198
|
+
if (!["datetimerange", "daterange", "monthrange", "yearrange"].includes(column.attrs?.type) || !isArray(column.field) || !column.timeRangeOptions?.length) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
const timeRangeFill = !!(column.attrs && column.attrs.timeRangeFill);
|
|
202
|
+
return column.timeRangeOptions.map((item) => {
|
|
203
|
+
return {
|
|
204
|
+
text: item.label,
|
|
205
|
+
options: {
|
|
206
|
+
...item,
|
|
207
|
+
type: column.attrs.type,
|
|
208
|
+
timeRangeFill
|
|
209
|
+
},
|
|
210
|
+
value: genShortcutItem
|
|
211
|
+
};
|
|
212
|
+
});
|
|
213
|
+
function genShortcutItem() {
|
|
214
|
+
const format = "YYYY-MM-DD";
|
|
215
|
+
const date = dayjs(Date.now());
|
|
216
|
+
const { value, unit, type } = this.options;
|
|
217
|
+
const timeRangeFill2 = this.options.timeRangeFill || type === "datetimerange";
|
|
218
|
+
if (unit === "day" && value === 1) {
|
|
219
|
+
return [
|
|
220
|
+
date.format(`${format}${timeRangeFill2 ? " 00:00:00" : ""}`),
|
|
221
|
+
date.format(`${format}${timeRangeFill2 ? " 23:59:59" : ""}`)
|
|
222
|
+
];
|
|
223
|
+
} else if (unit === "day") {
|
|
224
|
+
return [
|
|
225
|
+
date.subtract(value - 1, unit).format(`${format}${timeRangeFill2 ? " 00:00:00" : ""}`),
|
|
226
|
+
date.format(`${format}${timeRangeFill2 ? " 23:59:59" : ""}`)
|
|
227
|
+
];
|
|
228
|
+
} else {
|
|
229
|
+
return [
|
|
230
|
+
date.subtract(value, unit).format(`${format}${timeRangeFill2 ? " 00:00:00" : ""}`),
|
|
231
|
+
date.format(`${format}${timeRangeFill2 ? " 23:59:59" : ""}`)
|
|
232
|
+
];
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
157
236
|
|
|
158
|
-
export { clearSpace, columnLabelHandler, columnPlaceholderHandler, columnRuleHandler, genColumnDefaultLabel, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp };
|
|
237
|
+
export { clearSpace, columnHelpHandler, columnLabelHandler, columnPlaceholderHandler, columnRuleHandler, columnTimeRangeOptionsHandler, columnnoDataTextHandler, genColumnDefaultLabel, genColumnShortcuts, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp };
|
package/es/utils/index.mjs
CHANGED
|
@@ -4,10 +4,11 @@ export { isArray, isBoolean, isEmpty, isFile, isFunction, isNull, isNumber, isOb
|
|
|
4
4
|
export { cloneDeep, copyText, createUniqueId, funRunHandler, mergeDeep, withInstall } from './handler.mjs';
|
|
5
5
|
export { formatDuration, getDefaultValueFormatByType } from './date.mjs';
|
|
6
6
|
export { blobToDataURL, fileFormUpload, fileJsonUplaod, fileUpload, presignedUrl, sizeToTextHandler } from './file.mjs';
|
|
7
|
-
export { clearSpace, columnLabelHandler, columnPlaceholderHandler, columnRuleHandler, genColumnDefaultLabel, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp } from './form.mjs';
|
|
8
|
-
export { enterNumbersRrLetters, enterTheMumber, filterSpaces,
|
|
7
|
+
export { clearSpace, columnHelpHandler, columnLabelHandler, columnPlaceholderHandler, columnRuleHandler, columnTimeRangeOptionsHandler, columnnoDataTextHandler, genColumnDefaultLabel, genColumnShortcuts, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp } from './form.mjs';
|
|
8
|
+
export { enterNumbersRrLetters, enterTheMumber, filterSpaces, formatTimeFn, getPublicFileSize, inputForbidden, keepTwoDecimalPlaces, onlyNumber } from './input.mjs';
|
|
9
9
|
export { PERMISSION } from './permission.mjs';
|
|
10
10
|
export { InitMap, setMapServer, setPoiServer } from './map/index.mjs';
|
|
11
11
|
import './tree.mjs';
|
|
12
12
|
export { loadingSvg } from './sharedContent.mjs';
|
|
13
|
+
export { formatDay, formatHoursToHM, formatSeconds, formatTime, getBeforeDays, getCurDtm, getNextDays, getToday } from './timeUtils.mjs';
|
|
13
14
|
export { setGlobalTreeConfig } from 'hy-virtual-tree';
|
package/es/utils/is.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { usePermissionMap } from '../hooks/usePermissionMap.mjs';
|
|
|
5
5
|
import { PERMISSION } from './permission.mjs';
|
|
6
6
|
|
|
7
7
|
const isString = (e) => typeof e === "string";
|
|
8
|
-
const isNumber = (e) => typeof e === "number";
|
|
8
|
+
const isNumber = (e) => typeof e === "number" && !isNaN(e);
|
|
9
9
|
const isObject = (e) => Object.prototype.toString.call(e) === "[object Object]";
|
|
10
10
|
const isFunction = (e) => typeof e === "function";
|
|
11
11
|
const isArray = (e) => Array.isArray(e);
|
package/es/utils/map/index.mjs
CHANGED
|
@@ -326,6 +326,10 @@ class InitMap extends EventEmitter {
|
|
|
326
326
|
layerGroup(map, markers = []) {
|
|
327
327
|
return this.map.layerGroup(map, markers);
|
|
328
328
|
}
|
|
329
|
+
// 获取esri对象(仅leftlet地图类型)
|
|
330
|
+
esriFn() {
|
|
331
|
+
return this.map.esriFn ? this.map.esriFn() : null;
|
|
332
|
+
}
|
|
329
333
|
}
|
|
330
334
|
|
|
331
335
|
export { InitMap, setMapServer, setPoiServer };
|
package/es/utils/permission.mjs
CHANGED
|
@@ -492,7 +492,9 @@ const PERMISSION = {
|
|
|
492
492
|
// 区域管理
|
|
493
493
|
operator_areaManagement: "operator_areaManagement",
|
|
494
494
|
// 工单系统
|
|
495
|
-
headerNavigation_policeticketSyncShangrao: "headerNavigation_policeticketSyncShangrao"
|
|
495
|
+
headerNavigation_policeticketSyncShangrao: "headerNavigation_policeticketSyncShangrao",
|
|
496
|
+
// 采集站管理 - 非全链路模式 - 同步数据
|
|
497
|
+
operator_acquisitionStation_nonFullChainMode_manualDataSynchronization: "operator_acquisitionStation_nonFullChainMode_manualDataSynchronization"
|
|
496
498
|
};
|
|
497
499
|
|
|
498
500
|
export { PERMISSION };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
function formatNumber(n) {
|
|
2
|
+
n = n.toString();
|
|
3
|
+
return n[1] ? n : "0" + n;
|
|
4
|
+
}
|
|
5
|
+
function getToday(cutOff = "-") {
|
|
6
|
+
const dateObj = /* @__PURE__ */ new Date();
|
|
7
|
+
return formatDay(dateObj).join(cutOff);
|
|
8
|
+
}
|
|
9
|
+
function getNextDays({ today, daysCount, cutOff = "-" }) {
|
|
10
|
+
if (!today) {
|
|
11
|
+
today = getToday("/");
|
|
12
|
+
}
|
|
13
|
+
const dateObj = new Date(today);
|
|
14
|
+
const arr = [formatDay(dateObj).join(cutOff)];
|
|
15
|
+
for (let i = 0; i < daysCount; i++) {
|
|
16
|
+
const days = dateObj.setDate(dateObj.getDate() + 1);
|
|
17
|
+
arr.push(formatDay(new Date(days)).join(cutOff));
|
|
18
|
+
}
|
|
19
|
+
return arr;
|
|
20
|
+
}
|
|
21
|
+
function getBeforeDays({ today, daysCount, cutOff = "-" }) {
|
|
22
|
+
if (!today) {
|
|
23
|
+
today = getToday("/");
|
|
24
|
+
}
|
|
25
|
+
const dateObj = new Date(today);
|
|
26
|
+
const arr = [formatDay(dateObj).join(cutOff)];
|
|
27
|
+
for (let i = 0; i < daysCount; i++) {
|
|
28
|
+
const days = dateObj.setDate(dateObj.getDate() - 1);
|
|
29
|
+
arr.push(formatDay(new Date(days)).join(cutOff));
|
|
30
|
+
}
|
|
31
|
+
return arr;
|
|
32
|
+
}
|
|
33
|
+
function formatDay(dateObj) {
|
|
34
|
+
const year = dateObj.getFullYear();
|
|
35
|
+
const month = formatNumber(dateObj.getMonth() + 1);
|
|
36
|
+
const date = formatNumber(dateObj.getDate());
|
|
37
|
+
return [year, month, date];
|
|
38
|
+
}
|
|
39
|
+
function formatTime(dateObj) {
|
|
40
|
+
const h = dateObj.getHours();
|
|
41
|
+
let m = dateObj.getMinutes();
|
|
42
|
+
let s = dateObj.getSeconds();
|
|
43
|
+
if (m < 10) {
|
|
44
|
+
m = "0" + m;
|
|
45
|
+
}
|
|
46
|
+
if (s < 10) {
|
|
47
|
+
s = "0" + s;
|
|
48
|
+
}
|
|
49
|
+
return [h, m, s];
|
|
50
|
+
}
|
|
51
|
+
function getCurDtm(cutOff = "-") {
|
|
52
|
+
return getToday(cutOff) + " " + formatTime(/* @__PURE__ */ new Date()).join(":");
|
|
53
|
+
}
|
|
54
|
+
function formatSeconds(value) {
|
|
55
|
+
let theTime = parseInt(value);
|
|
56
|
+
let middle = 0;
|
|
57
|
+
let hour = 0;
|
|
58
|
+
if (theTime > 60) {
|
|
59
|
+
middle = parseInt(theTime / 60);
|
|
60
|
+
theTime = parseInt(theTime % 60);
|
|
61
|
+
if (middle > 60) {
|
|
62
|
+
hour = parseInt(middle / 60);
|
|
63
|
+
middle = parseInt(middle % 60);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
let result = "" + parseInt(theTime);
|
|
67
|
+
if (theTime < 10) {
|
|
68
|
+
result = `00:0${parseInt(theTime)}`;
|
|
69
|
+
} else {
|
|
70
|
+
result = `00:${parseInt(theTime)}`;
|
|
71
|
+
}
|
|
72
|
+
if (middle > 0) {
|
|
73
|
+
result = `${parseInt(theTime)}`;
|
|
74
|
+
if (middle < 10) {
|
|
75
|
+
result = "0" + parseInt(middle) + ":" + result;
|
|
76
|
+
} else {
|
|
77
|
+
result = "" + parseInt(middle) + ":" + result;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (hour > 0) {
|
|
81
|
+
result = "" + parseInt(hour) + ":" + result;
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
function formatHoursToHM(hours) {
|
|
86
|
+
hours = parseFloat(hours);
|
|
87
|
+
if (hours == null || isNaN(hours)) {
|
|
88
|
+
return { hour: 0, minute: 0 };
|
|
89
|
+
}
|
|
90
|
+
const hour = Math.floor(hours);
|
|
91
|
+
const minute = Math.floor((hours - hour) * 60);
|
|
92
|
+
return { hour, minute };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export { formatDay, formatHoursToHM, formatNumber, formatSeconds, formatTime, getBeforeDays, getCurDtm, getNextDays, getToday };
|
package/es/version.mjs
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('../hooks/index.js');
|
|
4
|
+
var vue = require('vue');
|
|
5
|
+
var useApi = require('../hooks/useApi.js');
|
|
6
|
+
|
|
7
|
+
function reverseGeocodingApi(params) {
|
|
8
|
+
const { api } = useApi.useApi();
|
|
9
|
+
const http = vue.unref(api);
|
|
10
|
+
return http.post("/common/reverseGeocoding", params, {
|
|
11
|
+
isJSON: true
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function commonReverseGeocodingApi(params) {
|
|
15
|
+
const { api } = useApi.useApi();
|
|
16
|
+
const http = vue.unref(api);
|
|
17
|
+
return http.post("/common/reverseGeocoding", params, { isJSON: true });
|
|
18
|
+
}
|
|
19
|
+
function commonWarningTypeApi(params) {
|
|
20
|
+
const { api } = useApi.useApi();
|
|
21
|
+
const http = vue.unref(api);
|
|
22
|
+
return http.post("/common/warningType", params);
|
|
23
|
+
}
|
|
24
|
+
function commonDeviceFaultCodeApi(params) {
|
|
25
|
+
const { api } = useApi.useApi();
|
|
26
|
+
const http = vue.unref(api);
|
|
27
|
+
return http.post("/common/deviceFaultCode", params);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.commonDeviceFaultCodeApi = commonDeviceFaultCodeApi;
|
|
31
|
+
exports.commonReverseGeocodingApi = commonReverseGeocodingApi;
|
|
32
|
+
exports.commonWarningTypeApi = commonWarningTypeApi;
|
|
33
|
+
exports.reverseGeocodingApi = reverseGeocodingApi;
|
|
@@ -64,7 +64,6 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
64
64
|
function beforeAvatarUpload2(file) {
|
|
65
65
|
const width = 44;
|
|
66
66
|
const height = 44;
|
|
67
|
-
const _this = this;
|
|
68
67
|
const isLt2M = file.size / 1024 / 1024 < 2;
|
|
69
68
|
if (!isLt2M) {
|
|
70
69
|
elementPlus.ElMessage.error($t("imageUploadFailedLogoSizeWithin2M"));
|
|
@@ -123,7 +122,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
123
122
|
elementPlus.ElMessage.success($t("operationSuccessful"));
|
|
124
123
|
vue.nextTick(() => {
|
|
125
124
|
emit("on-submit", hy.formModel.value.id ? null : 1);
|
|
126
|
-
currentBus.emit("departmentTypeOperation", {
|
|
125
|
+
currentBus.value.emit("departmentTypeOperation", {
|
|
127
126
|
method: "onSubmit",
|
|
128
127
|
param: hy.formModel.value.id ? null : 1
|
|
129
128
|
});
|
|
@@ -224,8 +223,6 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
224
223
|
minimizedShow
|
|
225
224
|
});
|
|
226
225
|
return (_ctx, _cache) => {
|
|
227
|
-
const _component_el_image = vue.resolveComponent("el-image");
|
|
228
|
-
const _component_el_upload = vue.resolveComponent("el-upload");
|
|
229
226
|
return vue.openBlock(), vue.createBlock(vue.unref(index$2.HyDialog), vue.mergeProps({
|
|
230
227
|
ref_key: "HyDialogRef",
|
|
231
228
|
ref: HyDialogRef,
|
|
@@ -254,7 +251,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
254
251
|
}, {
|
|
255
252
|
companyNameSlot: vue.withCtx(() => [
|
|
256
253
|
vue.createElementVNode("div", { class: "flex flex-row departmentTypeOperation" }, [
|
|
257
|
-
vue.createVNode(
|
|
254
|
+
vue.createVNode(vue.unref(elementPlus.ElUpload), {
|
|
258
255
|
class: "w-[80px] flex items-center justify-center upload_box",
|
|
259
256
|
accept: ".png,.jpg,.gif",
|
|
260
257
|
"before-upload": vue.unref(beforeAvatarUpload),
|
|
@@ -275,7 +272,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
275
272
|
[vue.vShow, vue.unref(formModel).icon]
|
|
276
273
|
]),
|
|
277
274
|
vue.createElementVNode("div", { class: "click-box emptyHead" }, [
|
|
278
|
-
vue.unref(formModel).icon ? (vue.openBlock(), vue.createBlock(
|
|
275
|
+
vue.unref(formModel).icon ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElImage), {
|
|
279
276
|
key: 0,
|
|
280
277
|
fit: "contain",
|
|
281
278
|
class: "w-[60px] h-[60px]",
|