@hostlink/nuxt-light 0.0.21 → 0.0.23
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/runtime/components/l-table.vue +37 -5
- package/dist/runtime/pages/EventLog/index.vue +1 -1
- package/dist/runtime/pages/MailLog/index.vue +1 -1
- package/dist/runtime/pages/Permission/index.vue +2 -3
- package/dist/runtime/pages/System/menu/index.vue +35 -2
- package/dist/runtime/pages/User/index.vue +1 -1
- package/dist/runtime/pages/UserLog/index.vue +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useQuasar, QTable } from 'quasar';
|
|
3
3
|
import { useRoute } from 'vue-router';
|
|
4
4
|
import { ref, computed, onMounted, useSlots, reactive } from "vue";
|
|
5
|
-
import { t, deleteObject,
|
|
5
|
+
import { t, deleteObject, q, f } from '../';
|
|
6
6
|
|
|
7
7
|
const route = useRoute();
|
|
8
8
|
const module = route.path.split("/")[1];
|
|
@@ -150,11 +150,45 @@ const validateData = () => {
|
|
|
150
150
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
const getData = async (
|
|
154
|
+
operation: string,
|
|
155
|
+
filters = {},
|
|
156
|
+
sort: String,
|
|
157
|
+
offset: number,
|
|
158
|
+
limit: number,
|
|
159
|
+
fields: Array<string> = []) => {
|
|
160
|
+
|
|
161
|
+
let offset_limit: any = {}
|
|
162
|
+
if (offset) {
|
|
163
|
+
offset_limit.offset = offset;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (limit) {
|
|
167
|
+
offset_limit.limit = limit;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
let params: any = {}
|
|
171
|
+
if (sort) {
|
|
172
|
+
params.sort = sort;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (filters) {
|
|
176
|
+
params.filters = filters
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return await q(operation, params, [f("data", offset_limit, fields), f("meta", ["total", "key", "name"])]);
|
|
180
|
+
|
|
181
|
+
}
|
|
182
|
+
|
|
153
183
|
const onRequest = async (p: any) => {
|
|
154
184
|
|
|
155
185
|
|
|
156
186
|
const callback = {
|
|
157
|
-
|
|
187
|
+
|
|
188
|
+
loadObjects(model: string, filters: any = null, fields: Array<any> = []) {
|
|
189
|
+
return this.loadData("list" + model, filters, fields);
|
|
190
|
+
},
|
|
191
|
+
async loadData(operation: string, filters: any = null, fields: Array<any> = []) {
|
|
158
192
|
|
|
159
193
|
//
|
|
160
194
|
let localFields: Array<any> = [];
|
|
@@ -206,12 +240,10 @@ const onRequest = async (p: any) => {
|
|
|
206
240
|
loading.value = true;
|
|
207
241
|
const offset = (p.pagination.page - 1) * p.pagination.rowsPerPage;
|
|
208
242
|
const limit = p.pagination.rowsPerPage;
|
|
209
|
-
const allData = await
|
|
243
|
+
const allData = await getData(operation, localFilters, sort, offset, limit, localFields);
|
|
210
244
|
|
|
211
245
|
rows.value = allData.data;
|
|
212
246
|
|
|
213
|
-
|
|
214
|
-
console.log(allData.meta)
|
|
215
247
|
//meta
|
|
216
248
|
primaryKey.value = allData.meta.key;
|
|
217
249
|
modelName.value = allData.meta.name;
|
|
@@ -42,7 +42,7 @@ const columns = [
|
|
|
42
42
|
|
|
43
43
|
<template>
|
|
44
44
|
<l-page>
|
|
45
|
-
<l-table @request="$event.
|
|
45
|
+
<l-table @request="$event.loadObjects('EventLog')" :columns="columns" sort-by="eventlog_id:desc"
|
|
46
46
|
:show-actions="['view']">
|
|
47
47
|
|
|
48
48
|
</l-table>
|
|
@@ -35,7 +35,7 @@ const columns = [
|
|
|
35
35
|
|
|
36
36
|
<template>
|
|
37
37
|
<l-page>
|
|
38
|
-
<l-table @request="$event.
|
|
38
|
+
<l-table @request="$event.loadObjects('MailLog', null, ['body'])" :columns="columns" sort-by="maillog_id:desc">
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
</l-table>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
listData("Permission", params, ["permission_id"]);
|
|
2
|
+
const onRequest = async (request) => {
|
|
3
|
+
request.loadObjects("Permission", null, ["permission_id"])
|
|
5
4
|
};
|
|
6
5
|
|
|
7
6
|
const columns = [
|
|
@@ -3,7 +3,6 @@ import { ref, computed, inject } from 'vue';
|
|
|
3
3
|
import { m, q } from '../../../'
|
|
4
4
|
import { useQuasar } from 'quasar';
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
const quasar = useQuasar();
|
|
8
7
|
const menus = ref(await q("appMenus", []));
|
|
9
8
|
|
|
@@ -180,6 +179,20 @@ const onMoveDown = (node) => {
|
|
|
180
179
|
parent.children[index] = temp;
|
|
181
180
|
}
|
|
182
181
|
}
|
|
182
|
+
|
|
183
|
+
const onAddChildMenu = (node, type) => {
|
|
184
|
+
|
|
185
|
+
//first char to upper case
|
|
186
|
+
type = type.charAt(0).toUpperCase() + type.slice(1);
|
|
187
|
+
|
|
188
|
+
node.children.push({
|
|
189
|
+
label: type,
|
|
190
|
+
uuid: getUUID(),
|
|
191
|
+
parent: node.uuid,
|
|
192
|
+
icon: 'sym_o_' + type.toLowerCase(),
|
|
193
|
+
children: [],
|
|
194
|
+
});
|
|
195
|
+
}
|
|
183
196
|
</script>
|
|
184
197
|
|
|
185
198
|
<template>
|
|
@@ -227,8 +240,28 @@ const onMoveDown = (node) => {
|
|
|
227
240
|
<q-btn outline rounded color="primary" @click="onMoveUp(selectedNode)" label="Up"
|
|
228
241
|
icon="sym_o_arrow_upward" />
|
|
229
242
|
|
|
230
|
-
<q-btn outline rounded color="primary" @click="onMoveDown(selectedNode)" label="
|
|
243
|
+
<q-btn outline rounded color="primary" @click="onMoveDown(selectedNode)" label="Down"
|
|
231
244
|
icon="sym_o_arrow_downward" />
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
<q-btn-dropdown color="primary" label="Add menus" outline rounded icon="sym_o_add">
|
|
248
|
+
<q-list>
|
|
249
|
+
<q-item clickable v-close-popup @click="onAddChildMenu(selectedNode, 'list')">
|
|
250
|
+
<q-item-section>
|
|
251
|
+
<q-item-label>List</q-item-label>
|
|
252
|
+
</q-item-section>
|
|
253
|
+
</q-item>
|
|
254
|
+
|
|
255
|
+
<q-item clickable v-close-popup @click="onAddChildMenu(selectedNode, 'add')">
|
|
256
|
+
<q-item-section>
|
|
257
|
+
<q-item-label>Add</q-item-label>
|
|
258
|
+
</q-item-section>
|
|
259
|
+
</q-item>
|
|
260
|
+
|
|
261
|
+
</q-list>
|
|
262
|
+
</q-btn-dropdown>
|
|
263
|
+
|
|
264
|
+
|
|
232
265
|
</q-card-section>
|
|
233
266
|
|
|
234
267
|
|
|
@@ -37,7 +37,7 @@ const columns = [
|
|
|
37
37
|
</script>
|
|
38
38
|
<template>
|
|
39
39
|
<l-page>
|
|
40
|
-
<l-table @request="$event.
|
|
40
|
+
<l-table @request="$event.loadObjects('UserLog')" :columns="columns" sort-by="login_dt:desc">
|
|
41
41
|
</l-table>
|
|
42
42
|
</l-page>
|
|
43
43
|
</template>
|