@finema/core 1.4.8 → 1.4.9
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/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Table/Base.vue +22 -1
- package/dist/runtime/components/Table/ColumnDate.vue +16 -0
- package/dist/runtime/components/Table/ColumnDateTime.vue +30 -0
- package/dist/runtime/components/Table/types.d.ts +1 -1
- package/dist/runtime/components/Table/types.mjs +0 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -13,7 +13,26 @@
|
|
|
13
13
|
:row="row"
|
|
14
14
|
/>
|
|
15
15
|
<ColumnImage
|
|
16
|
-
v-if="column.type === COLUMN_TYPES.IMAGE"
|
|
16
|
+
v-else-if="column.type === COLUMN_TYPES.IMAGE"
|
|
17
|
+
:value="row[column.key]"
|
|
18
|
+
:column="column"
|
|
19
|
+
:row="row"
|
|
20
|
+
/>
|
|
21
|
+
<ColumnDateTime
|
|
22
|
+
v-else-if="column.type === COLUMN_TYPES.DATE_TIME"
|
|
23
|
+
:value="row[column.key]"
|
|
24
|
+
:column="column"
|
|
25
|
+
:row="row"
|
|
26
|
+
/>
|
|
27
|
+
<ColumnDate
|
|
28
|
+
v-else-if="column.type === COLUMN_TYPES.DATE"
|
|
29
|
+
:value="row[column.key]"
|
|
30
|
+
:column="column"
|
|
31
|
+
:row="row"
|
|
32
|
+
/>
|
|
33
|
+
<component
|
|
34
|
+
:is="column.component"
|
|
35
|
+
v-else-if="column.type === COLUMN_TYPES.COMPONENT"
|
|
17
36
|
:value="row[column.key]"
|
|
18
37
|
:column="column"
|
|
19
38
|
:row="row"
|
|
@@ -45,6 +64,8 @@ import ColumnImage from '#core/components/Table/ColumnImage.vue'
|
|
|
45
64
|
import { computed, type PropType } from 'vue'
|
|
46
65
|
import { StringHelper } from '#core/utils/StringHelper'
|
|
47
66
|
import { ref, watch } from '#imports'
|
|
67
|
+
import ColumnDateTime from '#core/components/Table/ColumnDateTime.vue'
|
|
68
|
+
import ColumnDate from '#core/components/Table/ColumnDate.vue'
|
|
48
69
|
|
|
49
70
|
const emits = defineEmits(['pageChange'])
|
|
50
71
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
{{ getValue }}
|
|
3
|
+
</template>
|
|
4
|
+
<script lang="ts" setup>
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { type IColumn } from '#core/components/Table/types'
|
|
7
|
+
import { TimeHelper } from '#core/utils/TimeHelper'
|
|
8
|
+
|
|
9
|
+
const props = defineProps<{
|
|
10
|
+
value: any
|
|
11
|
+
row: any
|
|
12
|
+
column: IColumn
|
|
13
|
+
}>()
|
|
14
|
+
|
|
15
|
+
const getValue = computed<string>(() => TimeHelper.getDateFormTime(props.value))
|
|
16
|
+
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<p :title="`${getValue.date} ${getValue.time}`" class="flex flex-col whitespace-nowrap px-4">
|
|
3
|
+
<span>
|
|
4
|
+
{{ getValue.date }}
|
|
5
|
+
</span>
|
|
6
|
+
<span class="text-gray text-xs">
|
|
7
|
+
{{ getValue.time }}
|
|
8
|
+
</span>
|
|
9
|
+
</p>
|
|
10
|
+
</template>
|
|
11
|
+
<script lang="ts" setup>
|
|
12
|
+
import { computed } from 'vue'
|
|
13
|
+
import { type IColumn } from '#core/components/Table/types'
|
|
14
|
+
import { TimeHelper } from '#core/utils/TimeHelper'
|
|
15
|
+
|
|
16
|
+
const props = defineProps<{
|
|
17
|
+
value: any
|
|
18
|
+
row: any
|
|
19
|
+
column: IColumn
|
|
20
|
+
}>()
|
|
21
|
+
|
|
22
|
+
const getValue = computed<{ date: string; time: string }>(() => {
|
|
23
|
+
return props.value
|
|
24
|
+
? {
|
|
25
|
+
date: TimeHelper.getDateFormTime(props.value),
|
|
26
|
+
time: TimeHelper.getTimeFormTime(props.value),
|
|
27
|
+
}
|
|
28
|
+
: { date: '-', time: '-' }
|
|
29
|
+
})
|
|
30
|
+
</script>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type IPageOptions, type IStatus } from '#core/types/lib';
|
|
2
2
|
export declare const enum COLUMN_TYPES {
|
|
3
|
-
VALUE = "VALUE",
|
|
4
3
|
COMPONENT = "COMPONENT",
|
|
5
4
|
DATE = "DATE",
|
|
6
5
|
DATE_TIME = "DATE_TIME",
|
|
@@ -14,6 +13,7 @@ export interface IColumn {
|
|
|
14
13
|
sortable?: boolean;
|
|
15
14
|
direction?: 'asc' | 'desc';
|
|
16
15
|
class?: string;
|
|
16
|
+
component?: any;
|
|
17
17
|
type?: COLUMN_TYPES;
|
|
18
18
|
}
|
|
19
19
|
export interface IRowItem {
|