@hoenergy/hoenergy-template-pc 1.1.34 → 1.1.36
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/.i18n_extractor.json +8 -8
- package/docs/tailwind.css +4 -4
- package/package.json +1 -1
- package/src/components/Business/dataEntry/FormaxEleTimePicker/index.ts +55 -55
- package/src/components/Business/dataEntry/FormaxEleTimePicker/index.vue +51 -51
- package/src/components/Business/dataEntry/FormaxEleTimePicker/preview.vue +14 -14
- package/src/components/Business/dataEntry/modalSearchTable/hooks/useModalSearchTable.ts +73 -73
- package/src/components/Business/dataEntry/modalSearchTable/index.ts +184 -184
- package/src/components/Business/dataEntry/modalSearchTable/index.vue +376 -376
- package/src/components/Business/dataEntry/modalSearchTable/preview.vue +81 -81
- package/src/components/Business/dataEntry/modalTableSelect/hooks/useModalTableSelect.ts +73 -73
- package/src/components/data/form/searchForm/preview.vue +51 -51
- package/src/components/data/form/searchForm/src/hooks/helper.ts +21 -21
- package/src/components/data/form/searchForm/src/icon.ts +8 -8
- package/src/components/data/table/FormaxTable/preview.vue +13 -4
- package/src/components/data/table/FormaxTable/src/BasicTable.ts +12 -12
- package/src/components/data/table/FormaxTable/src/const.ts +11 -11
- package/src/components/data/table/FormaxTable/src/hooks/useColumns.ts +147 -147
- package/src/components/data/table/FormaxTable/src/hooks/usePagination.ts +72 -72
- package/src/components/data/table/FormaxTable/src/props.ts +77 -77
- package/src/components/data/table/FormaxTable/src/types/tableAction.ts +25 -25
- package/src/components/data/table/FormaxTable/src/utils.ts +65 -65
- package/src/components/general/icon/FormaxIcon/local-test-icon.svg +7 -7
- package/src/components/general/icon/FormaxIcon/preview.vue +19 -19
- package/src/components/general/map/MapPoint/index.ts +146 -146
- package/src/components/general/map/MapPoint/preview.vue +75 -75
- package/src/components/general/modal/FormaxModal/src/hooks/helper.ts +21 -21
- package/src/components/general/viewer/FormaxFileViewer/index.ts +92 -92
- package/src/components/general/viewer/FormaxFileViewer/preview.vue +39 -39
- package/tsup.config.ts +16 -16
package/.i18n_extractor.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
{
|
|
2
|
-
"langs": ["en", "vi"],
|
|
3
|
-
"scanPath": "src",
|
|
4
|
-
"fileType": "vue|ts|js|jsx|tsx",
|
|
5
|
-
"localePath": "src/locales",
|
|
6
|
-
"keyCount": 10,
|
|
7
|
-
"onlyExtract": false
|
|
8
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"langs": ["en", "vi"],
|
|
3
|
+
"scanPath": "src",
|
|
4
|
+
"fileType": "vue|ts|js|jsx|tsx",
|
|
5
|
+
"localePath": "src/locales",
|
|
6
|
+
"keyCount": 10,
|
|
7
|
+
"onlyExtract": false
|
|
8
|
+
}
|
package/docs/tailwind.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@tailwind base;
|
|
2
|
-
@tailwind components;
|
|
3
|
-
@tailwind utilities;
|
|
4
|
-
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
package/package.json
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import FormaxEleTimePicker from './index.vue'
|
|
2
|
-
import type { FormaxComponent, ComponentMeta } from '../../../../types'
|
|
3
|
-
|
|
4
|
-
export { FormaxEleTimePicker }
|
|
5
|
-
|
|
6
|
-
export const FormaxEleTimePickerComponent =
|
|
7
|
-
FormaxEleTimePicker as any as FormaxComponent
|
|
8
|
-
|
|
9
|
-
const meta: ComponentMeta = {
|
|
10
|
-
name: 'FormaxEleTimePicker',
|
|
11
|
-
label: '时间选择器(15 分钟步长)',
|
|
12
|
-
description:
|
|
13
|
-
'基于 Naive UI n-time-picker 的业务时间选择器,只支持时分,分钟步长为 15 分钟,23 点支持 59 分钟。',
|
|
14
|
-
props: {
|
|
15
|
-
value: {
|
|
16
|
-
type: 'string | null',
|
|
17
|
-
default: null,
|
|
18
|
-
description: '时间值,格式为 HH:mm',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
events: [
|
|
22
|
-
{
|
|
23
|
-
name: 'update:value',
|
|
24
|
-
description: '时间变化时触发',
|
|
25
|
-
payload: 'value: string | null',
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
slots: [],
|
|
29
|
-
methods: [],
|
|
30
|
-
usage: `<template>
|
|
31
|
-
<div style="padding: 16px;">
|
|
32
|
-
<FormaxEleTimePicker :value="time" @update:value="val => time = val" />
|
|
33
|
-
<div style="margin-top: 20px;">Current Time: {{ time }}</div>
|
|
34
|
-
</div>
|
|
35
|
-
</template>
|
|
36
|
-
|
|
37
|
-
<script setup lang="ts">
|
|
38
|
-
import { ref, onMounted } from 'vue'
|
|
39
|
-
import FormaxEleTimePicker from './index'
|
|
40
|
-
onMounted(() => {
|
|
41
|
-
console.log('进来了')
|
|
42
|
-
})
|
|
43
|
-
const time = ref<string | null>('23:00')
|
|
44
|
-
</script>`,
|
|
45
|
-
previewPath: 'Business/dataEntry/FormaxEleTimePicker/preview.vue',
|
|
46
|
-
package: 'business',
|
|
47
|
-
category: 'dataEntry',
|
|
48
|
-
key: 'EleTimePicker',
|
|
49
|
-
conKey: 'BDEEleTimePicker',
|
|
50
|
-
image: 'BDEEleTimePicker.png',
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
;(FormaxEleTimePickerComponent as any).__doc_meta__ = meta
|
|
54
|
-
|
|
55
|
-
export default FormaxEleTimePickerComponent
|
|
1
|
+
import FormaxEleTimePicker from './index.vue'
|
|
2
|
+
import type { FormaxComponent, ComponentMeta } from '../../../../types'
|
|
3
|
+
|
|
4
|
+
export { FormaxEleTimePicker }
|
|
5
|
+
|
|
6
|
+
export const FormaxEleTimePickerComponent =
|
|
7
|
+
FormaxEleTimePicker as any as FormaxComponent
|
|
8
|
+
|
|
9
|
+
const meta: ComponentMeta = {
|
|
10
|
+
name: 'FormaxEleTimePicker',
|
|
11
|
+
label: '时间选择器(15 分钟步长)',
|
|
12
|
+
description:
|
|
13
|
+
'基于 Naive UI n-time-picker 的业务时间选择器,只支持时分,分钟步长为 15 分钟,23 点支持 59 分钟。',
|
|
14
|
+
props: {
|
|
15
|
+
value: {
|
|
16
|
+
type: 'string | null',
|
|
17
|
+
default: null,
|
|
18
|
+
description: '时间值,格式为 HH:mm',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
events: [
|
|
22
|
+
{
|
|
23
|
+
name: 'update:value',
|
|
24
|
+
description: '时间变化时触发',
|
|
25
|
+
payload: 'value: string | null',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
slots: [],
|
|
29
|
+
methods: [],
|
|
30
|
+
usage: `<template>
|
|
31
|
+
<div style="padding: 16px;">
|
|
32
|
+
<FormaxEleTimePicker :value="time" @update:value="val => time = val" />
|
|
33
|
+
<div style="margin-top: 20px;">Current Time: {{ time }}</div>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script setup lang="ts">
|
|
38
|
+
import { ref, onMounted } from 'vue'
|
|
39
|
+
import FormaxEleTimePicker from './index'
|
|
40
|
+
onMounted(() => {
|
|
41
|
+
console.log('进来了')
|
|
42
|
+
})
|
|
43
|
+
const time = ref<string | null>('23:00')
|
|
44
|
+
</script>`,
|
|
45
|
+
previewPath: 'Business/dataEntry/FormaxEleTimePicker/preview.vue',
|
|
46
|
+
package: 'business',
|
|
47
|
+
category: 'dataEntry',
|
|
48
|
+
key: 'EleTimePicker',
|
|
49
|
+
conKey: 'BDEEleTimePicker',
|
|
50
|
+
image: 'BDEEleTimePicker.png',
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
;(FormaxEleTimePickerComponent as any).__doc_meta__ = meta
|
|
54
|
+
|
|
55
|
+
export default FormaxEleTimePickerComponent
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<n-time-picker v-bind="attrs" format="HH:mm" value-format="HH:mm" :default-formatted-value="currentValue"
|
|
3
|
-
:minutes="currentMinutes" @update:formatted-value="handleUpdateValue" :actions="null" />
|
|
4
|
-
</template>
|
|
5
|
-
|
|
6
|
-
<script setup lang="ts">
|
|
7
|
-
import { useAttrs, ref, watch } from 'vue'
|
|
8
|
-
|
|
9
|
-
const props = defineProps<{
|
|
10
|
-
value?: string | null
|
|
11
|
-
}>()
|
|
12
|
-
let currentValue = ref<any>(undefined)
|
|
13
|
-
const emit = defineEmits<{
|
|
14
|
-
(e: 'update:value', value: string | null): void
|
|
15
|
-
(e: 'confirm', value: string | null): void
|
|
16
|
-
}>()
|
|
17
|
-
|
|
18
|
-
const attrs = useAttrs()
|
|
19
|
-
|
|
20
|
-
const commonMinutes = [0, 15, 30, 45]
|
|
21
|
-
const lastHourMinutes = [0, 15, 30, 45, 59]
|
|
22
|
-
|
|
23
|
-
const currentMinutes = ref<number[]>(commonMinutes)
|
|
24
|
-
|
|
25
|
-
function updateMinutes(val?: string | null) {
|
|
26
|
-
if (!val) {
|
|
27
|
-
currentMinutes.value = commonMinutes
|
|
28
|
-
return
|
|
29
|
-
}
|
|
30
|
-
const [hour] = val.split(':').map(Number)
|
|
31
|
-
currentMinutes.value = hour === 23 ? lastHourMinutes : commonMinutes
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
watch(() => props.value, (newVal) => {
|
|
35
|
-
updateMinutes(newVal)
|
|
36
|
-
currentValue.value = newVal
|
|
37
|
-
}, { immediate: true })
|
|
38
|
-
|
|
39
|
-
function handleUpdateValue(val: string | null) {
|
|
40
|
-
// 如果传入的 val 是 Date 或其他格式,先格式化为 HH:mm 字符串
|
|
41
|
-
const timeStr = val
|
|
42
|
-
? typeof val === 'string' && /^\d{2}:\d{2}$/.test(val)
|
|
43
|
-
? val
|
|
44
|
-
: new Date(val).toTimeString().slice(0, 5)
|
|
45
|
-
: null
|
|
46
|
-
|
|
47
|
-
updateMinutes(timeStr)
|
|
48
|
-
emit('update:value', timeStr)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<n-time-picker v-bind="attrs" format="HH:mm" value-format="HH:mm" :default-formatted-value="currentValue"
|
|
3
|
+
:minutes="currentMinutes" @update:formatted-value="handleUpdateValue" :actions="null" />
|
|
4
|
+
</template>
|
|
5
|
+
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
import { useAttrs, ref, watch } from 'vue'
|
|
8
|
+
|
|
9
|
+
const props = defineProps<{
|
|
10
|
+
value?: string | null
|
|
11
|
+
}>()
|
|
12
|
+
let currentValue = ref<any>(undefined)
|
|
13
|
+
const emit = defineEmits<{
|
|
14
|
+
(e: 'update:value', value: string | null): void
|
|
15
|
+
(e: 'confirm', value: string | null): void
|
|
16
|
+
}>()
|
|
17
|
+
|
|
18
|
+
const attrs = useAttrs()
|
|
19
|
+
|
|
20
|
+
const commonMinutes = [0, 15, 30, 45]
|
|
21
|
+
const lastHourMinutes = [0, 15, 30, 45, 59]
|
|
22
|
+
|
|
23
|
+
const currentMinutes = ref<number[]>(commonMinutes)
|
|
24
|
+
|
|
25
|
+
function updateMinutes(val?: string | null) {
|
|
26
|
+
if (!val) {
|
|
27
|
+
currentMinutes.value = commonMinutes
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
const [hour] = val.split(':').map(Number)
|
|
31
|
+
currentMinutes.value = hour === 23 ? lastHourMinutes : commonMinutes
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
watch(() => props.value, (newVal) => {
|
|
35
|
+
updateMinutes(newVal)
|
|
36
|
+
currentValue.value = newVal
|
|
37
|
+
}, { immediate: true })
|
|
38
|
+
|
|
39
|
+
function handleUpdateValue(val: string | null) {
|
|
40
|
+
// 如果传入的 val 是 Date 或其他格式,先格式化为 HH:mm 字符串
|
|
41
|
+
const timeStr = val
|
|
42
|
+
? typeof val === 'string' && /^\d{2}:\d{2}$/.test(val)
|
|
43
|
+
? val
|
|
44
|
+
: new Date(val).toTimeString().slice(0, 5)
|
|
45
|
+
: null
|
|
46
|
+
|
|
47
|
+
updateMinutes(timeStr)
|
|
48
|
+
emit('update:value', timeStr)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
</script>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div style="padding: 16px;">
|
|
3
|
-
<FormaxEleTimePicker :value="time" @update:value="val => time = val" />
|
|
4
|
-
<div style="margin-top: 20px;">Current Time: {{ time }}</div>
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script setup lang="ts">
|
|
9
|
-
import { ref, onMounted } from 'vue'
|
|
10
|
-
import FormaxEleTimePicker from './index'
|
|
11
|
-
onMounted(() => {
|
|
12
|
-
})
|
|
13
|
-
const time = ref<string | null>('23:00')
|
|
14
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div style="padding: 16px;">
|
|
3
|
+
<FormaxEleTimePicker :value="time" @update:value="val => time = val" />
|
|
4
|
+
<div style="margin-top: 20px;">Current Time: {{ time }}</div>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
import { ref, onMounted } from 'vue'
|
|
10
|
+
import FormaxEleTimePicker from './index'
|
|
11
|
+
onMounted(() => {
|
|
12
|
+
})
|
|
13
|
+
const time = ref<string | null>('23:00')
|
|
14
|
+
</script>
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import { ref, unref, getCurrentInstance, watch, onUnmounted } from 'vue'
|
|
2
|
-
|
|
3
|
-
export interface ModalSearchTableMethods {
|
|
4
|
-
openModal: () => void
|
|
5
|
-
closeModal: () => void
|
|
6
|
-
setModalProps: (props: any) => void
|
|
7
|
-
setFormProps: (props: any) => void
|
|
8
|
-
setProps: (props: { modalProps?: any; formProps?: any }) => void
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type UseModalSearchTableReturnType = [
|
|
12
|
-
(instance: ModalSearchTableMethods) => void,
|
|
13
|
-
ModalSearchTableMethods,
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
export function useModalSearchTable(options?: {
|
|
17
|
-
modalProps?: any
|
|
18
|
-
formProps?: any
|
|
19
|
-
}): UseModalSearchTableReturnType {
|
|
20
|
-
const modalRef = ref<ModalSearchTableMethods | null>(null)
|
|
21
|
-
const currentInstance = getCurrentInstance()
|
|
22
|
-
|
|
23
|
-
const getInstance = () => {
|
|
24
|
-
const instance = unref(modalRef)
|
|
25
|
-
if (!instance) {
|
|
26
|
-
console.error('useModalSearchTable instance is undefined!')
|
|
27
|
-
}
|
|
28
|
-
return instance
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const register = (instance: ModalSearchTableMethods) => {
|
|
32
|
-
onUnmounted(() => {
|
|
33
|
-
modalRef.value = null
|
|
34
|
-
})
|
|
35
|
-
modalRef.value = instance
|
|
36
|
-
currentInstance?.emit('register', instance)
|
|
37
|
-
|
|
38
|
-
watch(
|
|
39
|
-
() => options,
|
|
40
|
-
() => {
|
|
41
|
-
instance.setProps({
|
|
42
|
-
modalProps: options?.modalProps,
|
|
43
|
-
formProps: options?.formProps,
|
|
44
|
-
})
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
immediate: true,
|
|
48
|
-
deep: true,
|
|
49
|
-
},
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const methods: ModalSearchTableMethods = {
|
|
54
|
-
openModal: () => {
|
|
55
|
-
getInstance()?.openModal()
|
|
56
|
-
},
|
|
57
|
-
closeModal: () => {
|
|
58
|
-
getInstance()?.closeModal()
|
|
59
|
-
},
|
|
60
|
-
setModalProps: (props: any) => {
|
|
61
|
-
getInstance()?.setModalProps(props)
|
|
62
|
-
},
|
|
63
|
-
setFormProps: (props: any) => {
|
|
64
|
-
getInstance()?.setFormProps(props)
|
|
65
|
-
},
|
|
66
|
-
setProps: (props: { modalProps?: any; formProps?: any }) => {
|
|
67
|
-
getInstance()?.setProps(props)
|
|
68
|
-
},
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return [register, methods]
|
|
72
|
-
}
|
|
73
|
-
|
|
1
|
+
import { ref, unref, getCurrentInstance, watch, onUnmounted } from 'vue'
|
|
2
|
+
|
|
3
|
+
export interface ModalSearchTableMethods {
|
|
4
|
+
openModal: () => void
|
|
5
|
+
closeModal: () => void
|
|
6
|
+
setModalProps: (props: any) => void
|
|
7
|
+
setFormProps: (props: any) => void
|
|
8
|
+
setProps: (props: { modalProps?: any; formProps?: any }) => void
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type UseModalSearchTableReturnType = [
|
|
12
|
+
(instance: ModalSearchTableMethods) => void,
|
|
13
|
+
ModalSearchTableMethods,
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
export function useModalSearchTable(options?: {
|
|
17
|
+
modalProps?: any
|
|
18
|
+
formProps?: any
|
|
19
|
+
}): UseModalSearchTableReturnType {
|
|
20
|
+
const modalRef = ref<ModalSearchTableMethods | null>(null)
|
|
21
|
+
const currentInstance = getCurrentInstance()
|
|
22
|
+
|
|
23
|
+
const getInstance = () => {
|
|
24
|
+
const instance = unref(modalRef)
|
|
25
|
+
if (!instance) {
|
|
26
|
+
console.error('useModalSearchTable instance is undefined!')
|
|
27
|
+
}
|
|
28
|
+
return instance
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const register = (instance: ModalSearchTableMethods) => {
|
|
32
|
+
onUnmounted(() => {
|
|
33
|
+
modalRef.value = null
|
|
34
|
+
})
|
|
35
|
+
modalRef.value = instance
|
|
36
|
+
currentInstance?.emit('register', instance)
|
|
37
|
+
|
|
38
|
+
watch(
|
|
39
|
+
() => options,
|
|
40
|
+
() => {
|
|
41
|
+
instance.setProps({
|
|
42
|
+
modalProps: options?.modalProps,
|
|
43
|
+
formProps: options?.formProps,
|
|
44
|
+
})
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
immediate: true,
|
|
48
|
+
deep: true,
|
|
49
|
+
},
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const methods: ModalSearchTableMethods = {
|
|
54
|
+
openModal: () => {
|
|
55
|
+
getInstance()?.openModal()
|
|
56
|
+
},
|
|
57
|
+
closeModal: () => {
|
|
58
|
+
getInstance()?.closeModal()
|
|
59
|
+
},
|
|
60
|
+
setModalProps: (props: any) => {
|
|
61
|
+
getInstance()?.setModalProps(props)
|
|
62
|
+
},
|
|
63
|
+
setFormProps: (props: any) => {
|
|
64
|
+
getInstance()?.setFormProps(props)
|
|
65
|
+
},
|
|
66
|
+
setProps: (props: { modalProps?: any; formProps?: any }) => {
|
|
67
|
+
getInstance()?.setProps(props)
|
|
68
|
+
},
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return [register, methods]
|
|
72
|
+
}
|
|
73
|
+
|