@simitgroup/simpleapp-generator 1.3.4-alpha → 1.4.0-alpha

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 (85) hide show
  1. package/dist/buildinschemas/permission.d.ts.map +1 -1
  2. package/dist/buildinschemas/permission.js +10 -6
  3. package/dist/buildinschemas/permission.js.map +1 -1
  4. package/dist/buildinschemas/user.d.ts.map +1 -1
  5. package/dist/buildinschemas/user.js +22 -2
  6. package/dist/buildinschemas/user.js.map +1 -1
  7. package/dist/generate.js +20 -6
  8. package/dist/generate.js.map +1 -1
  9. package/dist/type.d.ts +2 -0
  10. package/dist/type.d.ts.map +1 -1
  11. package/dist/type.js.map +1 -1
  12. package/package.json +1 -1
  13. package/src/buildinschemas/permission.ts +10 -6
  14. package/src/buildinschemas/user.ts +23 -3
  15. package/src/generate.ts +19 -6
  16. package/src/type.ts +3 -1
  17. package/templates/basic/nest/controller.ts.eta +1 -1
  18. package/templates/basic/nest/service.ts.eta +7 -3
  19. package/templates/basic/nuxt/pages.[id].vue.eta +4 -4
  20. package/templates/basic/nuxt/pages.mobile.[id].vue.eta +39 -0
  21. package/templates/basic/nuxt/pages.mobile.landing.vue.eta +69 -0
  22. package/templates/nest/.gitignore.eta +6 -1
  23. package/templates/nest/src/simpleapp/apischemas/index.ts._eta +29 -0
  24. package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +22 -12
  25. package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +26 -1
  26. package/templates/nest/src/simpleapp/generate/workflow/workflow.service.ts.eta +1 -1
  27. package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +1 -1
  28. package/templates/nest/src/simpleapp/profile/profile.types.ts.eta +1 -1
  29. package/templates/nest/src/simpleapp/services/perm.service.ts.eta +5 -7
  30. package/templates/nest/src/simpleapp/services/user.service.ts.eta.old +118 -0
  31. package/templates/nest/src/simpleapp/types/index.ts._eta +8 -0
  32. package/templates/nuxt/app.vue._eta +31 -17
  33. package/templates/nuxt/assets/css/style.css._eta +4 -4
  34. package/templates/nuxt/assets/primevue/passthrough.ts._eta +10 -4
  35. package/templates/nuxt/components/calendar/CalendarByResource.vue.eta +181 -163
  36. package/templates/nuxt/components/calendar/CalendarSmall.vue.eta +8 -6
  37. package/templates/nuxt/components/form/FormDocnoformat.vue.eta +174 -0
  38. package/templates/nuxt/components/form/FormUser.vue._eta +91 -0
  39. package/templates/nuxt/components/form/user/FormUserPermission.vue.eta +83 -0
  40. package/templates/nuxt/components/header/HeaderBar.vue._eta +43 -39
  41. package/templates/nuxt/components/header/button/HeaderButtonMenuPicker.vue._eta +46 -38
  42. package/templates/nuxt/components/header/button/HeaderButtonProfile.vue.eta +9 -9
  43. package/templates/nuxt/components/mobile/MobileToolbar.vue.eta +12 -8
  44. package/templates/nuxt/components/overlay/OverlayPanelWithToolBar.vue.eta +1 -1
  45. package/templates/nuxt/components/page/PageDocList.vue.eta +6 -4
  46. package/templates/nuxt/components/renderer/RendererDateTime.vue.eta +13 -0
  47. package/templates/nuxt/components/renderer/RendererForeignKey.vue.eta +6 -3
  48. package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +3 -4
  49. package/templates/nuxt/components/simpleApp/SimpleAppFieldContainer.vue.eta +20 -7
  50. package/templates/nuxt/components/simpleApp/SimpleAppFormToolBar.vue._eta +2 -5
  51. package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +56 -12
  52. package/templates/nuxt/components/user/UserButtonCreateTenant.vue._eta +2 -6
  53. package/templates/nuxt/composables/date.generate.ts.eta +3 -1
  54. package/templates/nuxt/composables/goTo.generate.ts.eta +4 -1
  55. package/templates/nuxt/composables/refreshDocumentList.generate.ts.eta +13 -2
  56. package/templates/nuxt/layouts/mobile.vue._eta +26 -12
  57. package/templates/nuxt/nuxt.config.ts._eta +27 -20
  58. package/templates/nuxt/pages/[xorg]/{user/index.vue.eta → docnoformat/[id].vue.eta} +11 -9
  59. package/templates/nuxt/pages/[xorg]/docnoformat.vue.eta +51 -20
  60. package/templates/nuxt/pages/[xorg]/mobile/docnoformat/index.vue.eta +59 -0
  61. package/templates/nuxt/pages/[xorg]/mobile/index.vue._eta +19 -0
  62. package/templates/nuxt/pages/[xorg]/mobile/organization/index.vue.eta +138 -0
  63. package/templates/nuxt/pages/[xorg]/mobile/pickgroup.vue._eta +35 -0
  64. package/templates/nuxt/pages/[xorg]/mobile/user/index.vue.eta +231 -0
  65. package/templates/nuxt/pages/[xorg]/organization.vue.eta +80 -61
  66. package/templates/nuxt/pages/[xorg]/pickgroup.vue._eta +35 -0
  67. package/templates/nuxt/pages/[xorg]/user.vue.eta +91 -74
  68. package/templates/nuxt/pages/profile.vue.eta +7 -7
  69. package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +14 -3
  70. package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +18 -16
  71. package/templates/nuxt/simpleapp/generate/commons/documents.ts.eta +1 -1
  72. package/templates/nuxt/types/events.ts.eta +1 -0
  73. package/templates/nuxt/types/simpleappinput.ts.eta +3 -2
  74. package/templates/nuxt/types/user.ts.eta +2 -1
  75. package/templates/project/lang/default._json +150 -67
  76. package/tsconfig.tsbuildinfo +1 -1
  77. package/templates/nest/src/simpleapp/services/user.service.ts.etax +0 -66
  78. package/templates/nuxt/pages/[xorg]/docnoformat/[doctype]/[id].vue.eta +0 -13
  79. package/templates/nuxt/pages/[xorg]/docnoformat/[doctype]/new.vue.eta +0 -229
  80. package/templates/nuxt/pages/[xorg]/docnoformat/[doctype].vue.eta +0 -38
  81. package/templates/nuxt/pages/[xorg]/docnoformat/index.vue.eta +0 -11
  82. package/templates/nuxt/pages/[xorg]/user/[id].vue.eta +0 -39
  83. package/templates/nuxt/pages/[xorg]/user/form.vue.eta +0 -334
  84. package/templates/nuxt/pages/[xorg]/user/new.vue.eta +0 -18
  85. package/templates/nuxt/pages/[xorg]/user/viewer.vue.eta +0 -29
@@ -10,6 +10,7 @@
10
10
  :instancepath="instancepath"
11
11
  :error="error"
12
12
  #default="slotprops"
13
+ :resetcount="resetcount"
13
14
  >
14
15
  <Checkbox
15
16
  v-if="inputType == SimpleAppInputType.checkbox"
@@ -82,6 +83,22 @@
82
83
  v-bind="componentProps as CalendarProps"
83
84
  />
84
85
 
86
+ <Calendar
87
+ :pt="pt"
88
+ v-else-if="inputType == SimpleAppInputType.datetime"
89
+ :inputId="slotprops.uuid"
90
+ :path="setting.instancepath"
91
+ v-model="datetimevalue"
92
+ @update:modelValue="updateDateTime"
93
+ :touchUI="isMobile()"
94
+ showButtonBar
95
+ :readonly="isReadonly"
96
+ :placeholder="placeholder"
97
+ :date-format="getDateFormat()"
98
+ showTime
99
+ hourFormat="12"
100
+ v-bind="componentProps as CalendarProps"
101
+ />
85
102
  <!-- select/list component -->
86
103
  <Listbox
87
104
  v-model="modelValue"
@@ -299,13 +316,14 @@ import Rating, { RatingProps } from "primevue/rating";
299
316
  import Slider, { SliderProps } from "primevue/slider";
300
317
  import Textarea, { TextareaProps } from "primevue/textarea";
301
318
  import { SimpleAppInputType } from "~/types";
302
-
319
+ const resetcount = ref(0);
303
320
  const instancepath = ref("");
304
321
  const modelValue = defineModel({ required: true });
305
322
 
306
323
  const datevalue = ref<Date>();
324
+ const datetimevalue = ref<Date>();
307
325
  const timevalue = ref<Date>();
308
- let watchOnChange=0
326
+ let watchOnChange = 0;
309
327
  const props = withDefaults(
310
328
  defineProps<{
311
329
  inputType: SimpleAppInputType;
@@ -340,6 +358,11 @@ if (props.inputType == SimpleAppInputType.date && modelValue.value) {
340
358
  } else {
341
359
  datevalue.value = undefined;
342
360
  }
361
+ if (props.inputType == SimpleAppInputType.datetime && modelValue.value) {
362
+ datetimevalue.value = stringToDate(<string>modelValue.value);
363
+ } else {
364
+ datetimevalue.value = undefined;
365
+ }
343
366
 
344
367
  if (props.inputType == SimpleAppInputType.time) {
345
368
  if (modelValue.value) {
@@ -367,7 +390,7 @@ watch(props.setting.errors, (newvalue, oldvalue) => {
367
390
  errmsg = "";
368
391
  }
369
392
  if (errmsg != "") {
370
- const errorstyle = { style: "border-color: lightcoral; color:white " };
393
+ const errorstyle = { style: "border-color: lightcoral; color:lightcoral " };
371
394
  if (!pt.value) pt.value = {};
372
395
 
373
396
  if (props.inputType == SimpleAppInputType.text)
@@ -394,7 +417,7 @@ const isReadonly = computed(() => {
394
417
  const updateTime = (value: Date) => {
395
418
  value.setSeconds(0);
396
419
  modelValue.value = dateToTimeString(value);
397
- onChange()
420
+ onChange();
398
421
  };
399
422
  const updateDate = (value: any) => {
400
423
  if (value) {
@@ -402,8 +425,16 @@ const updateDate = (value: any) => {
402
425
  } else {
403
426
  modelValue.value = "";
404
427
  }
405
- onChange()
428
+ onChange();
406
429
  };
430
+ const updateDateTime = (value:any)=>{
431
+ if (value) {
432
+ modelValue.value = dateToISOString(value);
433
+ } else {
434
+ modelValue.value = "";
435
+ }
436
+ onChange();
437
+ }
407
438
 
408
439
  const setFocus = (ev: any) => {
409
440
  if (!isMobile()) ev.target.select();
@@ -445,7 +476,15 @@ watch(modelValue, (newvalue: any) => {
445
476
  } else {
446
477
  timevalue.value = undefined;
447
478
  }
448
- } else if (props.inputType == SimpleAppInputType.time) {
479
+
480
+ } else if (props.inputType == SimpleAppInputType.datetime) {
481
+ if (modelValue.value) {
482
+ datetimevalue.value = stringToDate(modelValue.value as string);
483
+ } else {
484
+ timevalue.value = undefined;
485
+ }
486
+ }
487
+ else if (props.inputType == SimpleAppInputType.time) {
449
488
  if (modelValue.value) {
450
489
  timevalue.value = stringToDate(
451
490
  (today() + "T" + modelValue.value) as string,
@@ -454,8 +493,6 @@ watch(modelValue, (newvalue: any) => {
454
493
  timevalue.value = undefined;
455
494
  }
456
495
  }
457
-
458
-
459
496
  });
460
497
  onMounted(() => {
461
498
  if (
@@ -468,6 +505,12 @@ onMounted(() => {
468
505
  } else {
469
506
  datevalue.value = undefined;
470
507
  }
508
+ } else if (props.inputType == SimpleAppInputType.datetime) {
509
+ if (modelValue.value) {
510
+ datetimevalue.value = stringToDate(modelValue.value as string);
511
+ } else {
512
+ datetimevalue.value = undefined;
513
+ }
471
514
  } else if (props.inputType == SimpleAppInputType.time) {
472
515
  if (modelValue.value) {
473
516
  timevalue.value = stringToDate(
@@ -477,12 +520,13 @@ onMounted(() => {
477
520
  timevalue.value = undefined;
478
521
  }
479
522
  }
480
-
481
523
  });
482
524
 
483
- const onChange=()=>{
484
- emits("change", modelValue.value);
485
- }
525
+ const onChange = () => {
526
+ pt.value = undefined;
527
+ resetcount.value++;
528
+ emits("change", modelValue.value);
529
+ };
486
530
 
487
531
  /************ start autocomplete only ***************/
488
532
 
@@ -2,11 +2,11 @@
2
2
  <div>
3
3
  <div class="mt-8 md:flex justify-start md:gap-4">
4
4
  <form @submit.prevent="true" class="w-full">
5
- <div>{{ t('createNewCompany') }}</div>
5
+ <div>{{ t("createNewCompany") }}</div>
6
6
  <div class="p-inputgroup flex flex-row">
7
7
  <InputText
8
8
  class="flex-1"
9
- :placeholder="t('yourCompanyName')"
9
+ :placeholder="t('enterYourCompanyName')"
10
10
  v-model:model-value="data.tenantName"
11
11
  />
12
12
  <div class="p-inputgroup-addon p p-0">
@@ -21,10 +21,7 @@
21
21
  </div>
22
22
  </div>
23
23
  </form>
24
-
25
24
  </div>
26
-
27
-
28
25
  </div>
29
26
  </template>
30
27
  <script setup lang="ts">
@@ -46,7 +43,6 @@ const onhold = ref(false);
46
43
  const createTenant = async () => {
47
44
  onhold.value = true;
48
45
 
49
-
50
46
  getPorfileApi()
51
47
  .createTenant(data.value)
52
48
  .then((res: AxiosResponse) => {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was automatically generated by simpleapp generator. Every
3
3
  * MODIFICATION OVERRIDE BY GENERATEOR
4
- * last change 2023-10-28
4
+ * last change 2024-03-08
5
5
  * Author: Ks Tan
6
6
  */
7
7
  export const setDateLocale = (localename:string) => useDayjs().locale(localename)
@@ -15,11 +15,13 @@ export const getDayJs = ()=>useDayjs()
15
15
  export const lastDateOfMonth = (datestr:string) => useDayjs()(datestr).endOf('month').format('YYYY-MM-DD');
16
16
  export const today = () => useDayjs()().format('YYYY-MM-DD')
17
17
  export const dateToString = (date:Date) => useDayjs()(date).format('YYYY-MM-DD')
18
+ export const dateToISOString = (date:Date) => useDayjs()(date).toISOString()
18
19
  export const dateToTimeString = (date:Date) => useDayjs()(date).format('HH:mm:ss')
19
20
  export const stringToDate = (datestr:string) => new Date(datestr)
20
21
  export const dateToDateTimeString = (date:Date)=> useDayjs()(date).format('YYYY-MM-DD HH:mm:ss')
21
22
  export const toLocalDate = (date:string | Date)=> useDayjs()(date).format(getDateFormat())
22
23
  export const getDateFormat = ():string=> 'DD-MM-YYYY'
24
+ export const calculateHourDifferent = (date1:Date, date2:Date) => (date1.getTime() - date2.getTime())/60/60/1000
23
25
  export const getPrimevueCalendarDateFormat = () => {
24
26
  const country = <string>getUserProfile()?.country
25
27
  return 'dd/mm/yy'
@@ -5,7 +5,10 @@
5
5
  * Author: Ks Tan
6
6
  */
7
7
  export const getDocumentUrl = (document:string,id?:string,querystr?:string)=>{
8
- let path = `/${getCurrentXorg()}/${document}`
8
+
9
+ let path = useRoute().path.includes('/mobile/') || isMobile() ?
10
+ `/${getCurrentXorg()}/mobile/${document}`
11
+ : `/${getCurrentXorg()}/${document}`
9
12
  if(id){
10
13
  path = path + '/'+id
11
14
  }
@@ -1,8 +1,19 @@
1
1
  /**
2
2
  * This file was automatically generated by simpleapp generator. Every
3
3
  * MODIFICATION OVERRIDE BY GENERATEOR
4
- * last change 2023-10-28
4
+ * last change 2024-03-07
5
5
  * Author: Ks Tan
6
6
  */
7
7
  export const refreshDocumentList = (docName:string)=>useNuxtApp().$event('RefreshDocumentList',{documentName:docName})
8
- export const refreshDocument = (docName:string)=>useNuxtApp().$event('RefreshDocument',docName)
8
+ export const refreshDocument = (docName:string)=>useNuxtApp().$event('RefreshDocument',docName)
9
+
10
+ export const listenDocument = (docName:string,callback:Function) =>{
11
+ useNuxtApp().$listen('RefreshDocument',async (eventdocname:string)=>{
12
+ if(eventdocname==docName) await callback()
13
+ })
14
+ }
15
+ export const listenDocumentList = (docName:string,callback:Function) =>{
16
+ useNuxtApp().$listen('RefreshDocumentList',async (eventdata)=>{
17
+ if(eventdata.documentName == docName) await callback()
18
+ })
19
+ }
@@ -9,7 +9,7 @@
9
9
 
10
10
  </div>
11
11
  <!-- fixed -->
12
- <div v-if="getCurrentXorg()" class="flex h-16 border-t-2 dark:border-t-gray-700 text-3xl flex-row left-0 w-full justify justify-between bottom-0 fixed z-50 bg-white dark:bg-slate-800 opacity opacity-95 " >
12
+ <div v-if="getCurrentXorg()" class="flex h-16 border-t-2 dark:border-t-gray-700 text-3xl flex-row left-0 w-full justify justify-between bottom-0 fixed z-50 bg-white dark:bg-slate-900 opacity opacity-95 " >
13
13
  <div v-for="item in menus">
14
14
  <NuxtLink v-if="item.path !== undefined"
15
15
  :class="`pi ${item.iconClass} p-4 cursor-pointer inline-block align-middle`"
@@ -33,7 +33,6 @@
33
33
  <script setup lang="ts">
34
34
  /**
35
35
  * This file was automatically generated by simpleapp generator during initialization. It is changable.
36
- * --remove-this-line-to-prevent-override--
37
36
  * last change 2024-02-22
38
37
  * author: Ks Tan
39
38
  */
@@ -42,17 +41,32 @@ const showProfile =ref(false)
42
41
 
43
42
  const openMenu = ()=>showMenu.value=true
44
43
  const openProfile = ()=>showProfile.value=true
45
- const menus=[
44
+ type MenuType = {iconClass:string,path?:string,command?:Function}
45
+ type AllMenus = {[key:string]:MenuType[]}
46
+ const menus=ref<MenuType[]>([])
46
47
  // {iconClass:'pi-bars',path:'managestudents/profile'},
47
- {iconClass:'pi-home dark:text-white',path:''},
48
- //{iconClass:'pi-users dark:text-white',path:'managestudents'},
49
- //{iconClass:'pi-calendar dark:text-white',path:`manageclasses`},
50
- {iconClass:'pi-chart-pie dark:text-white',path:'reports'},
51
- {iconClass:'pi-bars dark:text-white',command: openMenu},
52
- {iconClass:'pi-user dark:text-white',command: openProfile},
53
- // {iconClass:'pi-database',path:'managedata'},
54
-
55
- ]
48
+ const allmenus:AllMenus = {
49
+ admin:[
50
+ {iconClass:'pi-home dark:text-white',path:''},
51
+ //{iconClass:'pi-users dark:text-white',path:'managestudents'},
52
+ //{iconClass:'pi-calendar dark:text-white',path:`manageclasses`},
53
+ {iconClass:'pi-bars dark:text-white',command: openMenu},
54
+ {iconClass:'pi-user dark:text-white',command: openProfile},
55
+ ],
56
+ teacher: [{iconClass:'pi-home dark:text-white',path:''},
57
+ {iconClass:'pi-user dark:text-white',command: openProfile},],
58
+ unknown:[]
59
+ }
56
60
 
61
+ const readGroup=()=>{
62
+ if(getUserProfile()?.currentGroup) {
63
+ menus.value = allmenus[getUserProfile()?.currentGroup ?? 'unknown']
64
+ }
65
+ }
66
+
67
+ onMounted(()=>{
68
+ readGroup()
69
+ useNuxtApp().$listen('pickGroup',()=>readGroup())
70
+ })
57
71
 
58
72
  </script>
@@ -1,8 +1,8 @@
1
1
  /**
2
- * This file was automatically generated by simpleapp generator during initialization. It is changable.
3
- * --remove-this-line-to-prevent-override--
4
- * last change 2024-02-22
5
- * author: Ks Tan
2
+ * This file was automatically generated by simpleapp generator. Every
3
+ * MODIFICATION OVERRIDE BY GENERATEOR
4
+ * last change 2023-10-28
5
+ * Author: Ks Tan
6
6
  */
7
7
  import path from 'path'
8
8
  export default defineNuxtConfig({
@@ -27,6 +27,15 @@ export default defineNuxtConfig({
27
27
  }
28
28
  }
29
29
  },
30
+ app: {
31
+ // pageTransition: {
32
+ // name: 'slide-fade',
33
+ // mode: 'out-in',
34
+ // css: false,
35
+
36
+ // },
37
+ // layoutTransition: { name: 'layout', mode: 'default' }
38
+ },
30
39
  tailwindcss: {
31
40
  // Options
32
41
  },
@@ -36,7 +45,7 @@ devServer: {
36
45
  modules: [
37
46
  // "@hebilicious/authjs-nuxt",
38
47
  '@nuxtjs/color-mode',
39
- '@nuxtjs/device',
48
+ '@nuxtjs/device',
40
49
  '@nuxtjs/i18n',
41
50
  'dayjs-nuxt',
42
51
  '@sidebase/nuxt-auth',
@@ -52,19 +61,18 @@ devServer: {
52
61
  ['defineStore', 'definePiniaStore'], // import { defineStore as definePiniaStore } from 'pinia'
53
62
  ],
54
63
  }],
55
-
56
-
57
-
58
- ],
64
+ ],
65
+ dayjs:{
66
+ plugins: [ 'utc', 'duration']
67
+ },
59
68
  device: {
60
69
  refreshOnResize: true
61
- },
70
+ },
62
71
  i18n: {
63
72
  lazy: true,
64
73
  langDir: "lang/",
65
74
  strategy: "no_prefix",
66
- locales: [
67
-
75
+ locales: [
68
76
  {
69
77
  code: "en",
70
78
  iso: "en",
@@ -82,17 +90,18 @@ devServer: {
82
90
  defaultLocale: "en",
83
91
  },
84
92
  primevue: {
93
+
85
94
  options: {
86
- //unstyled: true,
87
95
  ripple: true,
88
- inputStyle: 'filled'
96
+ inputStyle: 'filled',
97
+
89
98
  },
90
99
  components: {
91
100
  include: '*',
92
- exclude: ['chart']
101
+ // exclude: ['chart']
93
102
  },
94
103
  directives: {
95
- include: ['Ripple', 'Tooltip','BadgeDirective','FocusTrap']
104
+ include: ['Ripple', 'Tooltip','Badge','FocusTrap']
96
105
  },
97
106
  cssLayerOrder: 'tailwind-base, primevue, tailwind-utilities',
98
107
  importPT: { as: 'SimpleAppPT', from: path.resolve(__dirname,'./assets/primevue/passthrough.ts') },
@@ -105,9 +114,6 @@ devServer: {
105
114
  auth: {
106
115
  globalAppMiddleware: false
107
116
  },
108
- dayjs:{
109
- plugins: [ 'utc', 'duration']
110
- },
111
117
  // security: {
112
118
  // corsHandler:{
113
119
  // origin: '*' //| 'null' | (string | RegExp)[] | ((origin: string) => boolean);
@@ -136,10 +142,11 @@ devServer: {
136
142
  css: [
137
143
  'primeicons/primeicons.css',
138
144
  path.resolve(__dirname,'./assets/css/style.css'),
145
+ path.resolve(__dirname,'./assets/css/listview.css'),
139
146
  path.resolve(__dirname,'./assets/css/calendar.css'),
140
147
  ],
141
148
  },
142
-
149
+
143
150
  // devtools: { enabled: true },
144
151
  // build: {
145
152
  // // transpile: ["primevue"]
@@ -1,21 +1,20 @@
1
1
  <template>
2
- <Crud _id="" @after="after" />
2
+ <LazyFormDocnoformat :_id="_id" @after="after" />
3
3
  </template>
4
4
 
5
5
  <script setup lang="ts">
6
6
  /**
7
- * This file was automatically generated by simpleapp generator. Every
8
- * MODIFICATION OVERRIDE BY GENERATEOR
9
- * last change 2023-10-28
10
- * Author: Ks Tan
7
+ * This file was automatically generated by simpleapp generator.
8
+ * last change 2023-09-09
9
+ * author: Ks Tan
11
10
  */
12
- import Crud from "./form.vue";
13
- import { User } from "~/simpleapp/generate/types";
14
11
 
15
- const doc = useNuxtApp().$UserDoc();
12
+ import { Docnoformat } from "~/simpleapp/generate/types";
13
+ const doc = useNuxtApp().$DocnoformatDoc();
16
14
 
17
15
  const props = defineProps<{ _id: string }>();
18
- const after = (actionName: string, data: User, result: any) => {
16
+ const after = (actionName: string, data: Docnoformat) => {
17
+ console.log("Docnoformat capture after emits ", actionName);
19
18
  switch (actionName) {
20
19
  case "new":
21
20
  goTo(doc.getDocName(), "new");
@@ -23,13 +22,16 @@ const after = (actionName: string, data: User, result: any) => {
23
22
  case "create":
24
23
  goTo(doc.getDocName(), data._id);
25
24
  refreshDocumentList(doc.getDocName());
25
+ useNuxtApp().$event("CloseDialog", doc.getDocName().toLowerCase());
26
26
  break;
27
27
  case "update":
28
28
  refreshDocumentList(doc.getDocName());
29
+ useNuxtApp().$event("CloseDialog", doc.getDocName().toLowerCase());
29
30
  break;
30
31
  case "delete":
31
32
  goTo(doc.getDocName(), "new");
32
33
  refreshDocumentList(doc.getDocName());
34
+ useNuxtApp().$event("CloseDialog", doc.getDocName().toLowerCase());
33
35
  break;
34
36
  }
35
37
  };
@@ -1,28 +1,59 @@
1
1
  <template>
2
- <div class="grid grid-cols-5 p-4">
3
- <title>{{ t('docnoformat')}} </title>
4
- <ListView
5
- :list="getAllDocFormats()"
6
- idField="docType"
7
- titleField="docName"
8
- subTitleField="docType"
9
- :withFilter="true"
10
- :url="getDocumentUrl('docnoformat')"
11
- ></ListView>
12
- <div class="col-span-4">
13
- <NuxtPage></NuxtPage>
14
- </div>
15
- </div>
2
+ <PageDocList
3
+ :document="doc"
4
+ :columns="columns"
5
+ :data="docdata"
6
+ :sorts="sorts"
7
+ >
8
+ <template #mobileList="{ item }">
9
+ <!-- <div class="flex flex-row justify justify-end"> -->
10
+ <div class="flex flex-col flex-1">
11
+ <text-primary>{{ item.docNoFormatName }}</text-primary>
12
+ <div class="flex flex-row gap-2">
13
+ <text-subtitle>{{ item.docNoPattern }}</text-subtitle>
14
+ <renderer-boolean v-model="item.active"/>
15
+
16
+ </div>
17
+ </div>
18
+ <div class="flex flex-col text-right">
19
+ <text-subtitle>{{ item.docNoType }}</text-subtitle>
20
+ <text-subtitle>{{ item.nextNumber }}</text-subtitle>
21
+
22
+ </div>
23
+ <!-- </div> -->
24
+ </template>
25
+ <template #dataTableColumns>
26
+ </template>
27
+ <template #default
28
+ ><div><NuxtPage :_id="id ?? 'new'" /></div
29
+ ></template>
30
+ </PageDocList>
16
31
  </template>
17
32
  <script setup lang="ts">
18
33
  /**
19
- * This file was automatically generated by simpleapp generator. Every
20
- * MODIFICATION OVERRIDE BY GENERATEOR
21
- * last change 2023-10-28
22
- * Author: Ks Tan
34
+ * This file was automatically generated by simpleapp generator.
35
+ * last change 2023-09-09
36
+ * author: Ks Tan
23
37
  */
38
+
39
+
40
+ const doc = useNuxtApp().$DocnoformatDoc()
41
+ const docdata = doc.getReactiveData();
42
+
24
43
  definePageMeta({
25
44
  menuPath: "setting/docnoformat",
26
- })
27
- </script>
45
+ });
28
46
 
47
+ const columns = [
48
+ "docNoFormatNo",
49
+ "docNoFormatName",
50
+ "active",
51
+ "docNoType",
52
+ "docNoPattern",
53
+ "nextNumber",
54
+ ];
55
+
56
+ const sorts: string[][] = [["docNoType", "asc"],["docNoFormatNo","asc"]];
57
+
58
+ const id = computed(() => useRoute().params.id);
59
+ </script>
@@ -0,0 +1,59 @@
1
+ <template>
2
+ <PageDocList
3
+ :document="doc"
4
+ :columns="columns"
5
+ :data="docdata"
6
+ :sorts="sorts"
7
+ >
8
+ <template #mobileList="{ item }">
9
+ <!-- <div class="flex flex-row justify justify-end"> -->
10
+ <div class="flex flex-col flex-1">
11
+ <text-primary>{{ item.docNoFormatName }}</text-primary>
12
+ <div class="flex flex-row gap-2">
13
+ <text-subtitle>{{ item.docNoPattern }}</text-subtitle>
14
+ <renderer-boolean v-model="item.active"/>
15
+
16
+ </div>
17
+ </div>
18
+ <div class="flex flex-col text-right">
19
+ <text-subtitle>{{ item.docNoType }}</text-subtitle>
20
+ <text-subtitle>{{ item.nextNumber }}</text-subtitle>
21
+
22
+ </div>
23
+ <!-- </div> -->
24
+ </template>
25
+ <template #dataTableColumns>
26
+ </template>
27
+ <template #default
28
+ ><div><NuxtPage :_id="id ?? 'new'" /></div
29
+ ></template>
30
+ </PageDocList>
31
+ </template>
32
+ <script setup lang="ts">
33
+ /**
34
+ * This file was automatically generated by simpleapp generator.
35
+ * last change 2023-09-09
36
+ * author: Ks Tan
37
+ */
38
+
39
+
40
+ const doc = useNuxtApp().$DocnoformatDoc()
41
+ const docdata = doc.getReactiveData();
42
+
43
+ definePageMeta({
44
+ menuPath: "setting/docnoformat",
45
+ });
46
+
47
+ const columns = [
48
+ "docNoFormatNo",
49
+ "docNoFormatName",
50
+ "active",
51
+ "docNoType",
52
+ "docNoPattern",
53
+ "nextNumber",
54
+ ];
55
+
56
+ const sorts: string[][] = [["docNoType", "asc"],["docNoFormatNo","asc"]];
57
+
58
+ const id = computed(() => useRoute().params.id);
59
+ </script>
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <div class="frontpage-container">
3
+ <client-only>
4
+ <title>{{ getUserProfile()?.branchName }}</title>
5
+ </client-only>
6
+ <h1 class="border text-3xl text-center m-20 p-20">
7
+ {{ t("createYourContentHere") }}
8
+ </h1>
9
+ </div>
10
+ </template>
11
+ <script lang="ts" setup>
12
+ /**
13
+ * This file was automatically generated by simpleapp generator during initialization. It is changable.
14
+ * --remove-this-line-to-prevent-override--
15
+ * last change 2024-02-22
16
+ * author: Ks Tan
17
+ */
18
+ useNuxtApp().$event('SetTitle',t('home'))
19
+ </script>