v-nuxt-ui 0.2.25 → 0.2.27
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/README.md +6 -0
- package/dist/module.json +1 -1
- package/dist/runtime/components/AsyncSelect.vue +16 -1
- package/dist/runtime/components/AsyncTreeSelect.vue +15 -9
- package/dist/runtime/components/DeleteModal.d.vue.ts +25 -22
- package/dist/runtime/components/DeleteModal.vue +39 -4
- package/dist/runtime/components/DeleteModal.vue.d.ts +25 -22
- package/dist/runtime/components/ScrollArea.vue +20 -9
- package/dist/runtime/components/form/save-modal-template/ConfirmUpdateModal.d.vue.ts +19 -0
- package/dist/runtime/components/form/save-modal-template/ConfirmUpdateModal.vue +111 -0
- package/dist/runtime/components/form/save-modal-template/ConfirmUpdateModal.vue.d.ts +19 -0
- package/dist/runtime/components/form/{create-modal-template → save-modal-template}/WithApi.d.vue.ts +2 -2
- package/dist/runtime/components/form/{create-modal-template → save-modal-template}/WithApi.vue +4 -3
- package/dist/runtime/components/form/{create-modal-template → save-modal-template}/WithApi.vue.d.ts +2 -2
- package/dist/runtime/components/form/{create-modal-template → save-modal-template}/index.d.vue.ts +2 -2
- package/dist/runtime/components/form/{create-modal-template → save-modal-template}/index.vue +54 -7
- package/dist/runtime/components/form/{create-modal-template → save-modal-template}/index.vue.d.ts +2 -2
- package/dist/runtime/components/form/save-model-template/ConfirmUpdateModal.d.vue.ts +19 -0
- package/dist/runtime/components/form/save-model-template/ConfirmUpdateModal.vue +111 -0
- package/dist/runtime/components/form/save-model-template/ConfirmUpdateModal.vue.d.ts +19 -0
- package/dist/runtime/components/form/save-model-template/WithApi.d.vue.ts +19 -0
- package/dist/runtime/components/form/save-model-template/WithApi.vue +37 -0
- package/dist/runtime/components/form/save-model-template/WithApi.vue.d.ts +19 -0
- package/dist/runtime/components/form/save-model-template/index.d.vue.ts +21 -0
- package/dist/runtime/components/form/save-model-template/index.vue +123 -0
- package/dist/runtime/components/form/save-model-template/index.vue.d.ts +21 -0
- package/dist/runtime/components/layout/button/UserMenu.vue +1 -2
- package/dist/runtime/components/sys/company/{CreateModal.vue → SaveModal.vue} +2 -2
- package/dist/runtime/components/sys/company/Table.vue +5 -4
- package/dist/runtime/components/sys/department/{CreateModal.vue → SaveModal.vue} +3 -2
- package/dist/runtime/components/sys/department/Table.vue +6 -5
- package/dist/runtime/components/sys/flow/EditNodeModal.vue +4 -3
- package/dist/runtime/components/sys/flow/{CreateModal.vue → SaveModal.vue} +3 -2
- package/dist/runtime/components/sys/flow/Table.vue +5 -4
- package/dist/runtime/components/sys/issue-record/{CreateModal.vue → SaveModal.vue} +2 -2
- package/dist/runtime/components/sys/issue-record/Table.vue +5 -4
- package/dist/runtime/components/sys/job-title/{CreateModal.vue → SaveModal.vue} +2 -2
- package/dist/runtime/components/sys/job-title/Table.vue +5 -4
- package/dist/runtime/components/sys/menu/{CreateModal.vue → SaveModal.vue} +3 -2
- package/dist/runtime/components/sys/menu/Table.vue +6 -5
- package/dist/runtime/components/sys/role/{CreateModal.vue → SaveModal.vue} +8 -5
- package/dist/runtime/components/sys/role/Table.vue +5 -4
- package/dist/runtime/components/sys/table/{CreateModal.vue → SaveModal.vue} +4 -3
- package/dist/runtime/components/sys/table/Table.vue +4 -4
- package/dist/runtime/components/sys/table/TableColumnModal.vue +4 -3
- package/dist/runtime/components/sys/user/{CreateModal.vue → SaveModal.vue} +4 -3
- package/dist/runtime/components/sys/user/Table.vue +7 -6
- package/dist/runtime/components/table/Page.vue +2 -1
- package/dist/runtime/components/table/UpdateDiffModal.d.vue.ts +14 -0
- package/dist/runtime/components/table/UpdateDiffModal.vue +156 -0
- package/dist/runtime/components/table/UpdateDiffModal.vue.d.ts +14 -0
- package/dist/runtime/components/table/header/index.vue +181 -183
- package/dist/runtime/components/table/index.vue +2 -1
- package/dist/runtime/composables/form/index.d.ts +2 -0
- package/dist/runtime/composables/form/index.js +2 -0
- package/dist/runtime/composables/form/useForm.d.ts +21 -0
- package/dist/runtime/composables/{useForm.js → form/useForm.js} +23 -1
- package/dist/runtime/composables/form/useFormUpdate.d.ts +6 -0
- package/dist/runtime/composables/form/useFormUpdate.js +101 -0
- package/dist/runtime/composables/index.d.ts +1 -1
- package/dist/runtime/composables/index.js +1 -1
- package/dist/runtime/composables/table/useTable.js +10 -1
- package/dist/runtime/composables/table/useTableRowActions.d.ts +3 -0
- package/dist/runtime/composables/table/useTableRowActions.js +24 -0
- package/dist/runtime/composables/useDate.js +2 -0
- package/dist/runtime/types/components/form/field.d.ts +2 -0
- package/dist/runtime/types/components/form/index.d.ts +4 -3
- package/dist/runtime/types/components/table/header.d.ts +2 -0
- package/dist/runtime/types/components/table/index.d.ts +1 -0
- package/dist/runtime/types/time.d.ts +1 -1
- package/dist/runtime/utils/cron.d.ts +1 -0
- package/dist/runtime/utils/cron.js +182 -0
- package/dist/runtime/utils/index.d.ts +1 -0
- package/dist/runtime/utils/index.js +1 -0
- package/dist/runtime/utils/vueuse.d.ts +1 -1
- package/dist/runtime/utils/vueuse.js +1 -0
- package/package.json +16 -15
- package/dist/runtime/composables/useForm.d.ts +0 -9
- /package/dist/runtime/components/sys/company/{CreateModal.d.vue.ts → SaveModal.d.vue.ts} +0 -0
- /package/dist/runtime/components/sys/company/{CreateModal.vue.d.ts → SaveModal.vue.d.ts} +0 -0
- /package/dist/runtime/components/sys/department/{CreateModal.d.vue.ts → SaveModal.d.vue.ts} +0 -0
- /package/dist/runtime/components/sys/department/{CreateModal.vue.d.ts → SaveModal.vue.d.ts} +0 -0
- /package/dist/runtime/components/sys/flow/{CreateModal.d.vue.ts → SaveModal.d.vue.ts} +0 -0
- /package/dist/runtime/components/sys/flow/{CreateModal.vue.d.ts → SaveModal.vue.d.ts} +0 -0
- /package/dist/runtime/components/sys/issue-record/{CreateModal.d.vue.ts → SaveModal.d.vue.ts} +0 -0
- /package/dist/runtime/components/sys/issue-record/{CreateModal.vue.d.ts → SaveModal.vue.d.ts} +0 -0
- /package/dist/runtime/components/sys/job-title/{CreateModal.d.vue.ts → SaveModal.d.vue.ts} +0 -0
- /package/dist/runtime/components/sys/job-title/{CreateModal.vue.d.ts → SaveModal.vue.d.ts} +0 -0
- /package/dist/runtime/components/sys/menu/{CreateModal.d.vue.ts → SaveModal.d.vue.ts} +0 -0
- /package/dist/runtime/components/sys/menu/{CreateModal.vue.d.ts → SaveModal.vue.d.ts} +0 -0
- /package/dist/runtime/components/sys/role/{CreateModal.d.vue.ts → SaveModal.d.vue.ts} +0 -0
- /package/dist/runtime/components/sys/role/{CreateModal.vue.d.ts → SaveModal.vue.d.ts} +0 -0
- /package/dist/runtime/components/sys/table/{CreateModal.d.vue.ts → SaveModal.d.vue.ts} +0 -0
- /package/dist/runtime/components/sys/table/{CreateModal.vue.d.ts → SaveModal.vue.d.ts} +0 -0
- /package/dist/runtime/components/sys/user/{CreateModal.d.vue.ts → SaveModal.d.vue.ts} +0 -0
- /package/dist/runtime/components/sys/user/{CreateModal.vue.d.ts → SaveModal.vue.d.ts} +0 -0
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { ref, h } from "vue";
|
|
2
2
|
import { useOverlay } from "@nuxt/ui/composables";
|
|
3
3
|
import DeleteModal from "#v/components/DeleteModal.vue";
|
|
4
|
+
import UpdateDiffModal from "#v/components/table/UpdateDiffModal.vue";
|
|
4
5
|
import UDropdownMenu from "@nuxt/ui/components/DropdownMenu.vue";
|
|
5
6
|
import UButton from "@nuxt/ui/components/Button.vue";
|
|
6
7
|
export function useTableRowActions(props) {
|
|
7
8
|
const {
|
|
8
9
|
rowKey,
|
|
10
|
+
tableName,
|
|
11
|
+
bizColumns,
|
|
9
12
|
disableRowActions: _disableRowActions,
|
|
10
13
|
disableRowUpdate,
|
|
11
14
|
disableRowCopy,
|
|
@@ -14,10 +17,12 @@ export function useTableRowActions(props) {
|
|
|
14
17
|
extraRowActions,
|
|
15
18
|
useApiGroup,
|
|
16
19
|
customRowCopyFn,
|
|
20
|
+
displayFnInDeleteModal,
|
|
17
21
|
fetchList
|
|
18
22
|
} = props;
|
|
19
23
|
const overlay = useOverlay();
|
|
20
24
|
const deleteModal = overlay.create(DeleteModal);
|
|
25
|
+
const updateDiffModal = overlay.create(UpdateDiffModal);
|
|
21
26
|
const apiGroup = useApiGroup?.();
|
|
22
27
|
const actionLoadingRowIdxSet = ref(/* @__PURE__ */ new Set());
|
|
23
28
|
function getRowActions(row) {
|
|
@@ -89,6 +94,23 @@ export function useTableRowActions(props) {
|
|
|
89
94
|
extraRowActions?.forEach((action) => {
|
|
90
95
|
actionItems.push(buildActionItem(action));
|
|
91
96
|
});
|
|
97
|
+
if (tableName) {
|
|
98
|
+
if (actionItems.length > 0 && !disableRowDeletion) {
|
|
99
|
+
actionItems.push({ type: "separator" });
|
|
100
|
+
}
|
|
101
|
+
actionItems.push({
|
|
102
|
+
label: "\u53D8\u66F4\u8BB0\u5F55",
|
|
103
|
+
icon: "i-lucide-history",
|
|
104
|
+
onClick: () => {
|
|
105
|
+
updateDiffModal.open({
|
|
106
|
+
tableName,
|
|
107
|
+
rowId: row.original[rowKey],
|
|
108
|
+
columns: bizColumns || [],
|
|
109
|
+
title: "\u53D8\u66F4\u8BB0\u5F55"
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
92
114
|
if (!disableRowDeletion) {
|
|
93
115
|
if (actionItems.length > 0) {
|
|
94
116
|
actionItems.push({ type: "separator" });
|
|
@@ -100,6 +122,8 @@ export function useTableRowActions(props) {
|
|
|
100
122
|
onSelect: async () => {
|
|
101
123
|
const result = await deleteModal.open({
|
|
102
124
|
ids: [row.original[rowKey]],
|
|
125
|
+
models: [row.original],
|
|
126
|
+
displayFn: displayFnInDeleteModal,
|
|
103
127
|
onDelete: (ids) => apiGroup?.batchDelete({ ids })
|
|
104
128
|
}).result;
|
|
105
129
|
if (result) {
|
|
@@ -8,20 +8,21 @@ export type FormTemplateProps<T> = {
|
|
|
8
8
|
onUpdateModelValue?: (newVal: Partial<T>) => void;
|
|
9
9
|
onTriggerSubmit?: (e: Event) => void;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
11
|
+
export type SaveModalFormTemplateProps<T> = {
|
|
12
12
|
title: string;
|
|
13
13
|
description?: string;
|
|
14
14
|
onClose: (ok: boolean) => void;
|
|
15
15
|
onSubmit: () => Promise<void>;
|
|
16
16
|
fields: VFormFieldProps[];
|
|
17
|
+
oldModelValue: Partial<T>;
|
|
17
18
|
modelValue: Partial<T>;
|
|
18
19
|
onUpdateModelValue?: (newVal: Partial<T>) => void;
|
|
19
20
|
rowKey?: keyof T;
|
|
20
21
|
fullscreen?: ModalProps['fullscreen'];
|
|
21
22
|
};
|
|
22
|
-
export type
|
|
23
|
+
export type SaveModalFormTemplatePropsWithApi<T> = {
|
|
23
24
|
apiGroup: () => ApiGroup<T>;
|
|
24
25
|
valuePruneFn?: (value: T) => T;
|
|
25
26
|
defaultModelValue?: Partial<T>;
|
|
26
27
|
onSave: (model: T) => void;
|
|
27
|
-
} & Pick<
|
|
28
|
+
} & Pick<SaveModalFormTemplateProps<T>, 'title' | 'description' | 'fields' | 'onClose' | 'modelValue' | 'onUpdateModelValue'>;
|
|
@@ -13,6 +13,8 @@ export type TableHeaderProps<T> = {
|
|
|
13
13
|
fetchList: () => Promise<void>;
|
|
14
14
|
onEditRowFromModal?: (row: T) => Promise<boolean>;
|
|
15
15
|
selectedIds?: number[];
|
|
16
|
+
selectedModels?: T[];
|
|
17
|
+
displayFnInDeleteModal?: (model: T) => string | undefined;
|
|
16
18
|
disableCreation?: boolean;
|
|
17
19
|
disableWhereQuery?: boolean;
|
|
18
20
|
whereQueryProps: WhereQueryProps<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cronToCn: (val: string | undefined | null, tzOffset?: number) => string | null;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
const WEEKDAY_CN = ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
|
|
2
|
+
function pad(v) {
|
|
3
|
+
return String(v).padStart(2, "0");
|
|
4
|
+
}
|
|
5
|
+
function parseFields(cron) {
|
|
6
|
+
const parts = cron.trim().split(/\s+/);
|
|
7
|
+
if (parts.length !== 5) return null;
|
|
8
|
+
return {
|
|
9
|
+
minute: parts[0],
|
|
10
|
+
hour: parts[1],
|
|
11
|
+
dayOfMonth: parts[2],
|
|
12
|
+
month: parts[3],
|
|
13
|
+
dayOfWeek: parts[4]
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function validateField(val, min, max) {
|
|
17
|
+
if (val === "*" || val === "?") return true;
|
|
18
|
+
const segments = val.split(",");
|
|
19
|
+
for (const seg of segments) {
|
|
20
|
+
const stepIdx = seg.indexOf("/");
|
|
21
|
+
const base = stepIdx >= 0 ? seg.slice(0, stepIdx) : seg;
|
|
22
|
+
const step = stepIdx >= 0 ? Number(seg.slice(stepIdx + 1)) : 1;
|
|
23
|
+
if (step < 1) return false;
|
|
24
|
+
if (base === "*") continue;
|
|
25
|
+
const dashIdx = base.indexOf("-");
|
|
26
|
+
if (dashIdx >= 0) {
|
|
27
|
+
const lo = Number(base.slice(0, dashIdx));
|
|
28
|
+
const hi = Number(base.slice(dashIdx + 1));
|
|
29
|
+
if (isNaN(lo) || isNaN(hi)) return false;
|
|
30
|
+
if (lo < min || lo > max || hi < min || hi > max || lo > hi) return false;
|
|
31
|
+
} else {
|
|
32
|
+
const n = Number(base);
|
|
33
|
+
if (isNaN(n) || n < min || n > max) return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
function validateCron(fields) {
|
|
39
|
+
return validateField(fields.minute, 0, 59) && validateField(fields.hour, 0, 23) && validateField(fields.dayOfMonth, 1, 31) && validateField(fields.month, 1, 12) && validateField(fields.dayOfWeek, 0, 7);
|
|
40
|
+
}
|
|
41
|
+
function isSimpleNumber(val) {
|
|
42
|
+
return /^\d+$/.test(val);
|
|
43
|
+
}
|
|
44
|
+
function shiftDow(val, shift) {
|
|
45
|
+
return val.split(",").map((v) => {
|
|
46
|
+
const dashIdx = v.indexOf("-");
|
|
47
|
+
if (dashIdx >= 0) {
|
|
48
|
+
const lo = Number(v.slice(0, dashIdx));
|
|
49
|
+
const hi = Number(v.slice(dashIdx + 1));
|
|
50
|
+
const loNorm = lo === 7 ? 0 : lo;
|
|
51
|
+
const hiNorm = hi === 7 ? 0 : hi;
|
|
52
|
+
return `${(loNorm + shift) % 7}-${(hiNorm + shift) % 7}`;
|
|
53
|
+
}
|
|
54
|
+
const n = v === "7" ? 0 : Number(v);
|
|
55
|
+
return String((n + shift) % 7);
|
|
56
|
+
}).join(",");
|
|
57
|
+
}
|
|
58
|
+
function shiftDom(val, shift) {
|
|
59
|
+
return val.split(",").map((v) => {
|
|
60
|
+
const dashIdx = v.indexOf("-");
|
|
61
|
+
if (dashIdx >= 0) {
|
|
62
|
+
const lo = Number(v.slice(0, dashIdx));
|
|
63
|
+
const hi = Number(v.slice(dashIdx + 1));
|
|
64
|
+
return `${lo + shift}-${hi + shift}`;
|
|
65
|
+
}
|
|
66
|
+
return String(Number(v) + shift);
|
|
67
|
+
}).join(",");
|
|
68
|
+
}
|
|
69
|
+
function applyTzOffset(fields, offset) {
|
|
70
|
+
const result = { ...fields };
|
|
71
|
+
if (fields.hour === "*") return result;
|
|
72
|
+
if (!isSimpleNumber(fields.hour)) {
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
const hour = Number(fields.hour);
|
|
76
|
+
const newHour = (hour + offset) % 24;
|
|
77
|
+
const dayShift = hour + offset >= 24 ? 1 : hour + offset < 0 ? -1 : 0;
|
|
78
|
+
result.hour = String(newHour);
|
|
79
|
+
if (dayShift > 0) {
|
|
80
|
+
if (fields.dayOfWeek !== "*" && fields.dayOfWeek !== "?") {
|
|
81
|
+
result.dayOfWeek = shiftDow(fields.dayOfWeek, dayShift);
|
|
82
|
+
}
|
|
83
|
+
if (fields.dayOfMonth !== "*" && fields.dayOfMonth !== "?" && !fields.dayOfMonth.includes("L") && !fields.dayOfMonth.includes("W")) {
|
|
84
|
+
result.dayOfMonth = shiftDom(fields.dayOfMonth, dayShift);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
function isWildcard(v) {
|
|
90
|
+
return v === "*" || v === "?";
|
|
91
|
+
}
|
|
92
|
+
function describeMinute(minute) {
|
|
93
|
+
if (isWildcard(minute)) return "\u6BCF\u5206\u949F";
|
|
94
|
+
if (minute.startsWith("*/")) {
|
|
95
|
+
return `\u6BCF${minute.slice(2)}\u5206\u949F`;
|
|
96
|
+
}
|
|
97
|
+
return "";
|
|
98
|
+
}
|
|
99
|
+
function describeHour(hour) {
|
|
100
|
+
if (isWildcard(hour)) return "";
|
|
101
|
+
if (hour.includes(",")) {
|
|
102
|
+
return hour.split(",").map((h) => `${h}\u70B9`).join("\u3001");
|
|
103
|
+
}
|
|
104
|
+
if (hour.includes("-")) {
|
|
105
|
+
const [lo, hi] = hour.split("-");
|
|
106
|
+
return `${lo}\u70B9\u81F3${hi}\u70B9`;
|
|
107
|
+
}
|
|
108
|
+
return `${hour}\u70B9`;
|
|
109
|
+
}
|
|
110
|
+
function describeDayOfWeek(dayOfWeek) {
|
|
111
|
+
if (isWildcard(dayOfWeek) || dayOfWeek === "?") return "";
|
|
112
|
+
if (dayOfWeek.includes(",")) {
|
|
113
|
+
const days = dayOfWeek.split(",").map((d) => {
|
|
114
|
+
const n = Number(d);
|
|
115
|
+
return `\u5468${WEEKDAY_CN[n]}`;
|
|
116
|
+
}).join("\u3001");
|
|
117
|
+
return `\u6BCF${days}`;
|
|
118
|
+
}
|
|
119
|
+
if (dayOfWeek.includes("-")) {
|
|
120
|
+
const [lo, hi] = dayOfWeek.split("-");
|
|
121
|
+
return `\u6BCF\u5468${WEEKDAY_CN[Number(lo)]}\u81F3\u5468${WEEKDAY_CN[Number(hi)]}`;
|
|
122
|
+
}
|
|
123
|
+
return `\u6BCF\u5468${WEEKDAY_CN[Number(dayOfWeek)]}`;
|
|
124
|
+
}
|
|
125
|
+
function describeDayOfMonth(dayOfMonth) {
|
|
126
|
+
if (isWildcard(dayOfMonth) || dayOfMonth === "?") return "";
|
|
127
|
+
if (dayOfMonth.includes(",")) {
|
|
128
|
+
return "\u6BCF\u6708" + dayOfMonth.split(",").map((d) => `${d}\u65E5`).join("\u3001");
|
|
129
|
+
}
|
|
130
|
+
if (dayOfMonth.includes("-")) {
|
|
131
|
+
const [lo, hi] = dayOfMonth.split("-");
|
|
132
|
+
return `\u6BCF\u6708${lo}\u65E5\u81F3${hi}\u65E5`;
|
|
133
|
+
}
|
|
134
|
+
if (dayOfMonth.startsWith("*/")) {
|
|
135
|
+
return `\u6BCF${dayOfMonth.slice(2)}\u65E5`;
|
|
136
|
+
}
|
|
137
|
+
return `\u6BCF\u6708${dayOfMonth}\u65E5`;
|
|
138
|
+
}
|
|
139
|
+
function describeMonth(month) {
|
|
140
|
+
if (isWildcard(month)) return "";
|
|
141
|
+
if (month.includes(",")) {
|
|
142
|
+
return month.split(",").map((m) => `${m}\u6708`).join("\u3001");
|
|
143
|
+
}
|
|
144
|
+
return `${month}\u6708`;
|
|
145
|
+
}
|
|
146
|
+
function toChinese(fields) {
|
|
147
|
+
const minDesc = describeMinute(fields.minute);
|
|
148
|
+
const hourDesc = describeHour(fields.hour);
|
|
149
|
+
const dowDesc = describeDayOfWeek(fields.dayOfWeek);
|
|
150
|
+
const domDesc = describeDayOfMonth(fields.dayOfMonth);
|
|
151
|
+
const monthDesc = describeMonth(fields.month);
|
|
152
|
+
if (minDesc && isWildcard(fields.hour) && isWildcard(fields.dayOfMonth) && isWildcard(fields.month) && isWildcard(fields.dayOfWeek)) {
|
|
153
|
+
return minDesc;
|
|
154
|
+
}
|
|
155
|
+
if (!hourDesc) return "\u65E0\u6548\u8868\u8FBE\u5F0F";
|
|
156
|
+
const scheduleParts = [];
|
|
157
|
+
if (monthDesc) scheduleParts.push(monthDesc);
|
|
158
|
+
if (domDesc) scheduleParts.push(domDesc);
|
|
159
|
+
if (dowDesc) {
|
|
160
|
+
scheduleParts.push(dowDesc);
|
|
161
|
+
}
|
|
162
|
+
let timeStr;
|
|
163
|
+
if (fields.minute === "0") {
|
|
164
|
+
timeStr = hourDesc;
|
|
165
|
+
} else if (isWildcard(fields.minute)) {
|
|
166
|
+
timeStr = `${hourDesc}\u6BCF\u5206\u949F`;
|
|
167
|
+
} else {
|
|
168
|
+
timeStr = `${hourDesc}:${pad(Number(fields.minute))}`;
|
|
169
|
+
}
|
|
170
|
+
if (scheduleParts.length === 0) {
|
|
171
|
+
return `\u6BCF\u5929 ${timeStr}`;
|
|
172
|
+
}
|
|
173
|
+
return `${scheduleParts.join(" ")} ${timeStr}`;
|
|
174
|
+
}
|
|
175
|
+
export const cronToCn = (val, tzOffset = 8) => {
|
|
176
|
+
if (!val?.trim()) return null;
|
|
177
|
+
const fields = parseFields(val);
|
|
178
|
+
if (!fields) return null;
|
|
179
|
+
if (!validateCron(fields)) return null;
|
|
180
|
+
const localFields = applyTzOffset(fields, tzOffset);
|
|
181
|
+
return toChinese(localFields);
|
|
182
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useCnTimeAgo: (time: string | Date) => import("vue").ComputedRef<string>;
|
|
1
|
+
export declare const useCnTimeAgo: (time: string | Date | undefined) => "" | import("vue").ComputedRef<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "v-nuxt-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.27",
|
|
4
4
|
"description": "Veken UI Component Library - Reusable Nuxt UI components, composables, and utilities for enterprise applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"style": "./dist/runtime/index.css",
|
|
@@ -30,11 +30,12 @@
|
|
|
30
30
|
"typecheck": "nuxi typecheck playground"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@nuxt/kit": "^4.4.
|
|
33
|
+
"@nuxt/kit": "^4.4.5",
|
|
34
34
|
"dayjs": "^1.11.20",
|
|
35
35
|
"defu": "^6.1.7",
|
|
36
36
|
"maska": "^3.2.0",
|
|
37
|
-
"uuid": "^13.0.
|
|
37
|
+
"uuid": "^13.0.2",
|
|
38
|
+
"diff": "^9.0.0"
|
|
38
39
|
},
|
|
39
40
|
"peerDependencies": {
|
|
40
41
|
"@nuxt/ui": "^4.5.0",
|
|
@@ -59,20 +60,20 @@
|
|
|
59
60
|
"exceljs": "^4.4.0",
|
|
60
61
|
"monaco-editor": "^0.55.1",
|
|
61
62
|
"shiki": "^3.23.0",
|
|
62
|
-
"sql-formatter": "^15.7.
|
|
63
|
+
"sql-formatter": "^15.7.4",
|
|
63
64
|
"vue-draggable-plus": "^0.6.1",
|
|
64
65
|
"vue-echarts": "^8.0.1"
|
|
65
66
|
},
|
|
66
67
|
"devDependencies": {
|
|
67
|
-
"@iconify-json/lucide": "^1.2.
|
|
68
|
+
"@iconify-json/lucide": "^1.2.107",
|
|
68
69
|
"@internationalized/date": "^3.12.1",
|
|
69
70
|
"@nuxt/content": "^3.13.0",
|
|
70
71
|
"@nuxt/eslint": "^1.15.2",
|
|
71
72
|
"@nuxt/eslint-config": "^1.15.2",
|
|
72
73
|
"@nuxt/fonts": "^0.12.1",
|
|
73
74
|
"@nuxt/module-builder": "^1.0.2",
|
|
74
|
-
"@nuxt/ui": "^4.7.
|
|
75
|
-
"@nuxtjs/i18n": "^10.
|
|
75
|
+
"@nuxt/ui": "^4.7.1",
|
|
76
|
+
"@nuxtjs/i18n": "^10.3.0",
|
|
76
77
|
"@nuxtjs/mdc": "^0.20.2",
|
|
77
78
|
"@tanstack/table-core": "^8.21.3",
|
|
78
79
|
"@types/better-sqlite3": "^7.6.13",
|
|
@@ -80,9 +81,9 @@
|
|
|
80
81
|
"@types/uuid": "^11.0.0",
|
|
81
82
|
"@vue-flow/background": "^1.3.2",
|
|
82
83
|
"@vue-flow/core": "^1.48.2",
|
|
83
|
-
"@vueuse/core": "^14.
|
|
84
|
-
"@vueuse/nuxt": "^14.
|
|
85
|
-
"better-sqlite3": "^12.
|
|
84
|
+
"@vueuse/core": "^14.3.0",
|
|
85
|
+
"@vueuse/nuxt": "^14.3.0",
|
|
86
|
+
"better-sqlite3": "^12.10.0",
|
|
86
87
|
"cronstrue": "^3.12.0",
|
|
87
88
|
"echarts": "^6.0.0",
|
|
88
89
|
"eslint": "^9.39.4",
|
|
@@ -92,19 +93,19 @@
|
|
|
92
93
|
"monaco-editor": "^0.55.1",
|
|
93
94
|
"nuxt": "^4.4.2",
|
|
94
95
|
"ohash": "^2.0.11",
|
|
95
|
-
"reka-ui": "^2.9.
|
|
96
|
+
"reka-ui": "^2.9.7",
|
|
96
97
|
"scule": "^1.3.0",
|
|
97
98
|
"shiki": "^3.23.0",
|
|
98
99
|
"sortablejs": "^1.15.7",
|
|
99
100
|
"sql-formatter": "^15.7.2",
|
|
100
|
-
"tailwindcss": "^4.
|
|
101
|
+
"tailwindcss": "^4.3.0",
|
|
101
102
|
"typescript": "^5.9.3",
|
|
102
103
|
"unbuild": "^3.6.1",
|
|
103
|
-
"vue": "^3.5.
|
|
104
|
+
"vue": "^3.5.34",
|
|
104
105
|
"vue-draggable-plus": "^0.6.1",
|
|
105
106
|
"vue-echarts": "^8.0.1",
|
|
106
|
-
"vue-tsc": "^3.2.
|
|
107
|
-
"zod": "^4.3
|
|
107
|
+
"vue-tsc": "^3.2.9",
|
|
108
|
+
"zod": "^4.4.3"
|
|
108
109
|
},
|
|
109
110
|
"packageManager": "pnpm@10.29.2",
|
|
110
111
|
"pnpm": {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type Ref } from 'vue';
|
|
2
|
-
import type { ApiGroup, BaseModel } from '#v/types';
|
|
3
|
-
export declare const useFormValues: <T>(raw: Ref<T>, defaultValues?: Partial<T>) => {
|
|
4
|
-
oldValues: Ref<T>;
|
|
5
|
-
newValues: Ref<T>;
|
|
6
|
-
};
|
|
7
|
-
export declare const useFormSubmission: <T extends BaseModel>(oldValues: Ref<T>, newValues: Ref<T>, close: (ok: boolean) => void, save: (model: T) => void, apiGroup: () => ApiGroup<T>, arrayTypeFieldKeys?: (keyof T)[], rowKey?: keyof T, versionKey?: keyof T, getExtraFields?: () => Record<string, any>) => {
|
|
8
|
-
onSubmit: () => Promise<void>;
|
|
9
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/runtime/components/sys/issue-record/{CreateModal.d.vue.ts → SaveModal.d.vue.ts}
RENAMED
|
File without changes
|
/package/dist/runtime/components/sys/issue-record/{CreateModal.vue.d.ts → SaveModal.vue.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|