@hostlink/nuxt-light 0.0.24 → 0.0.25

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "0.0.24"
4
+ "version": "0.0.25"
5
5
  }
@@ -33,6 +33,7 @@ const save = async () => {
33
33
 
34
34
  if (props.modelValue) {
35
35
  const [module, id_name] = route.name.split("-");
36
+
36
37
 
37
38
  if (route.params[id_name]) {//edit
38
39
 
@@ -1,8 +1,19 @@
1
1
  import { Dialog } from "quasar";
2
2
  import m from "./m.mjs";
3
+ import { VariableType } from "json-to-graphql-query";
3
4
  export default async (name, data) => {
4
5
  try {
5
- return await m(`add${name}`, { data });
6
+ const variables = {};
7
+ Object.entries(data).forEach(([key, value]) => {
8
+ if (value instanceof File) {
9
+ variables[key] = {
10
+ type: "Upload!",
11
+ value
12
+ };
13
+ data[key] = new VariableType(key);
14
+ }
15
+ });
16
+ return await m(`add${name}`, { data }, [{ __variables: variables }]);
6
17
  } catch (e) {
7
18
  Dialog.create({
8
19
  title: "Error",
@@ -1 +1 @@
1
- export default function (operation: string, args: any, fields?: never[]): Promise<any>;
1
+ export default function (operation: string, args: any, fields?: any): Promise<any>;
@@ -40,7 +40,7 @@ export default async function(operation, args, fields = []) {
40
40
  }));
41
41
  fd.append("map", JSON.stringify(map));
42
42
  for (let i = 0; i < map_values.length; i++) {
43
- fd.append(i, map_values[i]);
43
+ fd.append(i.toString(), map_values[i]);
44
44
  }
45
45
  data = (await service.post("/api/", fd)).data;
46
46
  } else {
@@ -1,8 +1,19 @@
1
+ import { VariableType } from "json-to-graphql-query";
1
2
  import m from "./m.mjs";
2
3
  import { Dialog } from "quasar";
3
4
  export default async (name, id, data) => {
4
5
  try {
5
- return await m(`update${name}`, { id, data });
6
+ const variables = {};
7
+ Object.entries(data).forEach(([key, value]) => {
8
+ if (value instanceof File) {
9
+ variables[key] = {
10
+ type: "Upload!",
11
+ value
12
+ };
13
+ data[key] = new VariableType(key);
14
+ }
15
+ });
16
+ return await m(`update${name}`, { id, data }, [{ __variables: variables }]);
6
17
  } catch (e) {
7
18
  Dialog.create({
8
19
  title: "Error",
@@ -0,0 +1,23 @@
1
+ <script setup>
2
+ import { reactive } from 'vue'
3
+ import { m } from "../../"
4
+ const obj = reactive({
5
+ input1: 'test'
6
+ })
7
+ const onSave = async () => {
8
+ console.log(obj)
9
+
10
+ await m("testSystem", {
11
+ data: obj
12
+ })
13
+
14
+ }
15
+ </script>
16
+ <template>
17
+ <l-page>
18
+ <l-form v-model="obj">
19
+ <l-input v-model="obj.input1" label="Input1" />
20
+ <q-file v-model="obj.file" label="File" accept=".txt" />
21
+ </l-form>
22
+ </l-page>
23
+ </template>
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
2
  import { useQuasar } from 'quasar';
3
- import { useRouter } from 'vue-router';
4
- import { router } from "vue-router"
3
+ //import { useRouter, router } from 'vue-router';
4
+
5
5
 
6
6
  const obj = reactive({
7
7
  old_password: "",
@@ -78,6 +78,9 @@ function System_setting() {
78
78
  /* webpackChunkName: "System-setting" */ './pages/System/setting.vue'
79
79
  )
80
80
  }
81
+ function System_test() {
82
+ return import(/* webpackChunkName: "System-test" */ './pages/System/test.vue')
83
+ }
81
84
  function System_view_as() {
82
85
  return import(
83
86
  /* webpackChunkName: "System-view_as" */ './pages/System/view_as.vue'
@@ -258,6 +261,11 @@ export default [
258
261
  path: '/System/setting',
259
262
  component: System_setting,
260
263
  },
264
+ {
265
+ name: 'System-test',
266
+ path: '/System/test',
267
+ component: System_test,
268
+ },
261
269
  {
262
270
  name: 'System-view_as',
263
271
  path: '/System/view_as',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",
@@ -30,6 +30,7 @@
30
30
  "route-gen": "node route-generate.mjs"
31
31
  },
32
32
  "dependencies": {
33
+ "@formkit/inputs": "^1.1.0",
33
34
  "@nuxt/kit": "^3.7.0",
34
35
  "@quasar/extras": "^1.16.6",
35
36
  "axios": "^1.5.0",