@hostlink/nuxt-light 1.50.0 → 1.51.1

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.
Files changed (35) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +13 -3
  3. package/dist/runtime/components/l-add-btn.d.vue.ts +2 -2
  4. package/dist/runtime/components/l-add-btn.vue.d.ts +2 -2
  5. package/dist/runtime/components/l-app-main.d.vue.ts +3 -3
  6. package/dist/runtime/components/l-app-main.vue +14 -4
  7. package/dist/runtime/components/l-app-main.vue.d.ts +3 -3
  8. package/dist/runtime/components/l-customizer.d.vue.ts +4 -4
  9. package/dist/runtime/components/l-customizer.vue.d.ts +4 -4
  10. package/dist/runtime/components/l-date-picker.d.vue.ts +1 -1
  11. package/dist/runtime/components/l-date-picker.vue.d.ts +1 -1
  12. package/dist/runtime/components/l-editor.d.vue.ts +1 -1
  13. package/dist/runtime/components/l-editor.vue.d.ts +1 -1
  14. package/dist/runtime/components/l-form-dialog.d.vue.ts +2 -2
  15. package/dist/runtime/components/l-form-dialog.vue.d.ts +2 -2
  16. package/dist/runtime/components/l-table.vue +1 -12
  17. package/dist/runtime/components/l-time-picker.d.vue.ts +1 -1
  18. package/dist/runtime/components/l-time-picker.vue.d.ts +1 -1
  19. package/dist/runtime/composables/useLight.d.ts +8 -8
  20. package/dist/runtime/pages/System/database/check.vue +149 -0
  21. package/dist/runtime/pages/System/database/event.vue +5 -4
  22. package/dist/runtime/pages/System/database/table.vue +2 -3
  23. package/dist/runtime/pages/Translate/index.vue +5 -5
  24. package/dist/runtime/pages/User/setting/favorite.d.vue.ts +2 -0
  25. package/dist/runtime/pages/User/setting/favorite.vue +164 -0
  26. package/dist/runtime/pages/User/setting/favorite.vue.d.ts +2 -0
  27. package/dist/runtime/pages/User/setting/index.vue +0 -1
  28. package/dist/runtime/pages/User/setting/menu.d.vue.ts +2 -0
  29. package/dist/runtime/pages/User/setting/menu.vue +422 -0
  30. package/dist/runtime/pages/User/setting/menu.vue.d.ts +2 -0
  31. package/dist/runtime/pages/User/setting.vue +4 -2
  32. package/package.json +1 -1
  33. package/dist/runtime/pages/User/setting/my_favorite.vue +0 -156
  34. /package/dist/runtime/pages/{User/setting/my_favorite.d.vue.ts → System/database/check.d.vue.ts} +0 -0
  35. /package/dist/runtime/pages/{User/setting/my_favorite.vue.d.ts → System/database/check.vue.d.ts} +0 -0
@@ -1,156 +0,0 @@
1
- <script setup>
2
- import { useLight, model, q } from "#imports";
3
- import { useQuasar } from "quasar";
4
- import { ref, watch } from "vue";
5
- import { useDragAndDrop } from "@formkit/drag-and-drop/vue";
6
- import { animations } from "@formkit/drag-and-drop";
7
- const light = useLight();
8
- const $q = useQuasar();
9
- const { my } = await q({
10
- my: {
11
- myFavorites: {
12
- my_favorite_id: true,
13
- label: true,
14
- path: true,
15
- icon: true,
16
- sequence: true
17
- }
18
- }
19
- });
20
- const [dragParent, rows] = useDragAndDrop(my.myFavorites, {
21
- plugins: [animations()],
22
- dragHandle: ".drag-handle"
23
- });
24
- const isUpdating = ref(false);
25
- watch(rows, async (newRows) => {
26
- if (isUpdating.value) return;
27
- let hasChanged = false;
28
- for (let i = 0; i < newRows.length; i++) {
29
- if (newRows[i].sequence !== i + 1) {
30
- hasChanged = true;
31
- break;
32
- }
33
- }
34
- if (!hasChanged) return;
35
- isUpdating.value = true;
36
- try {
37
- for (let i = 0; i < newRows.length; i++) {
38
- const item = newRows[i];
39
- await model("MyFavorite").update(item.my_favorite_id, {
40
- sequence: i + 1
41
- });
42
- item.sequence = i + 1;
43
- }
44
- await light.reloadMyFavorites();
45
- $q.notify({
46
- message: "\u9806\u5E8F\u5DF2\u66F4\u65B0",
47
- color: "positive",
48
- icon: "check"
49
- });
50
- } catch (error) {
51
- $q.notify({
52
- message: "\u66F4\u65B0\u5931\u6557: " + error.message,
53
- color: "negative",
54
- icon: "error"
55
- });
56
- } finally {
57
- isUpdating.value = false;
58
- }
59
- }, { deep: true });
60
- const onSave = async (id, data) => {
61
- await model("MyFavorite").update(id, data);
62
- $q.notify({
63
- message: "Updated successfully",
64
- color: "positive",
65
- icon: "check"
66
- });
67
- const index = rows.value.findIndex((item) => item.my_favorite_id === id);
68
- if (index !== -1) {
69
- Object.assign(rows.value[index], data);
70
- }
71
- await light.reloadMyFavorites();
72
- };
73
- const onRemove = async (id) => {
74
- await model("MyFavorite").delete(id);
75
- const index = rows.value.findIndex((item) => item.my_favorite_id === id);
76
- if (index !== -1) {
77
- rows.value.splice(index, 1);
78
- }
79
- await light.reloadMyFavorites();
80
- };
81
- </script>
82
-
83
- <template>
84
- <div>
85
- <q-list ref="dragParent" bordered separator class="drag-list">
86
- <q-item
87
- v-for="(row, index) in rows"
88
- :key="row.my_favorite_id"
89
- class="drag-item"
90
- clickable
91
- >
92
- <!-- 拖拽手柄 -->
93
- <q-item-section avatar class="drag-handle">
94
- <q-icon name="drag_handle" class="cursor-move" color="grey-6" />
95
- </q-item-section>
96
-
97
- <!-- 主要內容 -->
98
- <q-item-section>
99
- <q-item-label>
100
- <div class="row items-center q-gutter-sm">
101
- <!-- Icon -->
102
- <l-icon-picker
103
- v-model="row.icon"
104
- flat
105
- round
106
- size="sm"
107
- @update:model-value="onSave(row.my_favorite_id, { 'icon': $event })"
108
- />
109
-
110
- <!-- Label -->
111
- <span class="text-weight-medium">
112
- {{ row.label }}
113
- <q-popup-edit v-model="row.label" #default="scope" buttons
114
- @save="onSave(row.my_favorite_id, { 'label': $event })">
115
- <q-input v-model="scope.value" dense autofocus counter @keyup.enter="scope.set" />
116
- </q-popup-edit>
117
- </span>
118
- </div>
119
- </q-item-label>
120
-
121
- <q-item-label caption class="text-grey-7">
122
- {{ row.path }}
123
- <q-popup-edit v-model="row.path" #default="scope" buttons
124
- @save="onSave(row.my_favorite_id, { 'path': $event })">
125
- <q-input v-model="scope.value" dense autofocus counter @keyup.enter="scope.set" />
126
- </q-popup-edit>
127
- </q-item-label>
128
- </q-item-section>
129
-
130
- <!-- 操作按鈕 -->
131
- <q-item-section side>
132
- <q-btn
133
- flat
134
- round
135
- icon="sym_o_delete"
136
- size="sm"
137
- color="negative"
138
- @click="onRemove(row.my_favorite_id)"
139
- >
140
- <q-tooltip>刪除</q-tooltip>
141
- </q-btn>
142
- </q-item-section>
143
- </q-item>
144
- </q-list>
145
-
146
- <!-- 狀態提示 -->
147
- <div v-if="isUpdating" class="q-mt-md">
148
- <q-linear-progress indeterminate color="primary" />
149
- <div class="text-center q-mt-sm text-grey-6">正在更新順序...</div>
150
- </div>
151
- </div>
152
- </template>
153
-
154
- <style scoped>
155
- .drag-list{border-radius:8px;overflow:hidden}.drag-item{transition:all .2s}.drag-item:hover{background-color:rgba(0,0,0,.02)}.drag-handle{cursor:move;min-width:40px;padding:0 8px}.drag-handle:hover .q-icon{color:var(--q-primary)!important}:deep(.formkit-dnd-is-dragging){background-color:rgba(25,118,210,.05);box-shadow:0 4px 12px rgba(0,0,0,.15);opacity:.7;transform:scale(1.02)}:deep(.formkit-dnd-placeholder){align-items:center;background-color:rgba(25,118,210,.1);border:2px dashed var(--q-primary);border-radius:4px;display:flex;height:72px;justify-content:center;margin:2px 0}:deep(.formkit-dnd-placeholder:before){color:var(--q-primary);content:"放置在此處";font-size:14px;font-weight:500}
156
- </style>