@simitgroup/simpleapp-generator 1.0.63 → 1.1.0
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 copy.md +9 -9
- package/buildinschemas copy/autoincreament.autoinc.jsonschema.json +1 -1
- package/buildinschemas copy/docnoformat.docno.jsonschema.json +2 -2
- package/dist/buildinschemas/autoincreament.js +6 -6
- package/dist/buildinschemas/branch.js +3 -3
- package/dist/buildinschemas/branch.js.map +1 -1
- package/dist/buildinschemas/docnoformat.js +5 -5
- package/dist/buildinschemas/docnoformat.js.map +1 -1
- package/dist/buildinschemas/organization.js +3 -3
- package/dist/buildinschemas/permission.js +5 -5
- package/dist/buildinschemas/permission.js.map +1 -1
- package/dist/buildinschemas/tenant.js +2 -2
- package/dist/buildinschemas/user.d.ts.map +1 -1
- package/dist/buildinschemas/user.js +3 -4
- package/dist/buildinschemas/user.js.map +1 -1
- package/dist/generate.js +2 -2
- package/dist/generate.js.map +1 -1
- package/dist/processors/jsonschemabuilder.d.ts.map +1 -1
- package/dist/processors/jsonschemabuilder.js +6 -6
- package/dist/processors/jsonschemabuilder.js.map +1 -1
- package/dist/type.d.ts +7 -19
- package/dist/type.d.ts.map +1 -1
- package/docs/backend.md +2 -2
- package/docs/jsonschema.md +6 -6
- package/package.json +1 -1
- package/src/buildinschemas/autoincreament.ts +6 -6
- package/src/buildinschemas/branch.ts +3 -3
- package/src/buildinschemas/docnoformat.ts +5 -5
- package/src/buildinschemas/organization.ts +3 -3
- package/src/buildinschemas/permission.ts +5 -5
- package/src/buildinschemas/tenant.ts +2 -2
- package/src/buildinschemas/user.ts +4 -5
- package/src/generate.ts +2 -2
- package/src/processors/jsonschemabuilder.ts +7 -9
- package/src/processors/jsonschemabuilder.ts-old +5 -5
- package/src/type.ts +20 -20
- package/templates/basic/nest/controller.ts.eta +18 -18
- package/templates/basic/nest/processor.ts.eta +1 -1
- package/templates/basic/nuxt/pages.[id].vue.eta +1 -1
- package/templates/basic/nuxt/pages.landing.vue.eta +12 -17
- package/templates/basic/nuxt/{pages.crud.vue.eta → pages.new.vue.eta} +68 -71
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +6 -6
- package/templates/nest/src/simpleapp/generate/commons/interceptors/response.interceptor.ts.eta +1 -1
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +20 -10
- package/templates/nest/src/simpleapp/generate/models/apievent.model.ts.eta +1 -1
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +8 -9
- package/templates/nest/src/simpleapp/generate/types/apievent.type.ts.eta +1 -1
- package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +16 -7
- package/templates/nest/src/simpleapp/services/autoinc.service.ts.eta +10 -7
- package/templates/nest/src/simpleapp/services/branch.service.ts.eta +2 -2
- package/templates/nuxt/assets/css/style.css._eta +32 -0
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +9 -2
- package/templates/nuxt/components/{DebugDocumentData.vue.eta → debug/DebugDocumentData.vue.eta} +8 -4
- package/templates/nuxt/components/{EventNotification.vue.eta → event/EventNotification.vue.eta} +13 -9
- package/templates/nuxt/components/{HeaderBar.vue.eta → header/HeaderBar.vue.eta} +6 -6
- package/templates/nuxt/components/{SelectBranch.vue.eta → header/HeaderSelectBranch.vue.eta} +2 -2
- package/templates/nuxt/components/{ButtonMenuPicker.vue.eta → header/button/HeaderButtonMenuPicker.vue.eta} +3 -3
- package/templates/nuxt/components/list/ListView.vue.eta +64 -0
- package/templates/nuxt/components/renderer/RendererForeignKey.vue.eta +11 -0
- package/templates/nuxt/components/renderer/index.ts.eta +12 -0
- package/templates/nuxt/components/simpleApp/SimpleAppDocumentNo.vue.eta +77 -0
- package/templates/nuxt/components/{SimpleFieldContainer.vue.eta → simpleApp/SimpleAppFieldContainer.vue.eta} +12 -11
- package/templates/nuxt/components/{SimpleAppForm.vue.eta → simpleApp/SimpleAppForm.vue.eta} +5 -4
- package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +288 -0
- package/templates/nuxt/components/simpleApp/SimpleAppInputTable.vue.eta +56 -0
- package/templates/nuxt/components/{SimpleAppAutocomplete.vue.eta → simpleApp/pending/SimpleAppAutocomplete.vue} +14 -3
- package/templates/nuxt/components/{SimpleAppAutocompletemulti.vue.eta → simpleApp/pending/SimpleAppAutocompletemulti.vue} +1 -1
- package/templates/nuxt/components/{SimpleAppCalendar.vue.eta → simpleApp/pending/SimpleAppCalendar.vue} +1 -1
- package/templates/nuxt/components/{SimpleAppCheckbox.vue.eta → simpleApp/pending/SimpleAppCheckbox.vue} +1 -1
- package/templates/nuxt/components/{SimpleAppChip.vue.eta → simpleApp/pending/SimpleAppChip.vue} +1 -1
- package/templates/nuxt/components/{SimpleAppColor.vue.eta → simpleApp/pending/SimpleAppColor.vue} +1 -1
- package/templates/nuxt/components/{SimpleAppDocumentNo.vue.eta → simpleApp/pending/SimpleAppDocumentNo.vue} +1 -1
- package/templates/nuxt/components/{SimpleAppEditor.vue.eta → simpleApp/pending/SimpleAppEditor.vue} +1 -1
- package/templates/nuxt/components/{SimpleAppInputTable.vue.eta → simpleApp/pending/SimpleAppInputTable.vue} +1 -22
- package/templates/nuxt/components/{SimpleAppList.vue.eta → simpleApp/pending/SimpleAppList.vue} +1 -1
- package/templates/nuxt/components/{SimpleAppListmulti.vue.eta → simpleApp/pending/SimpleAppListmulti.vue} +1 -1
- package/templates/nuxt/components/{SimpleAppNumber.vue.eta → simpleApp/pending/SimpleAppNumber.vue} +12 -1
- package/templates/nuxt/components/{SimpleAppPassword.vue.eta → simpleApp/pending/SimpleAppPassword.vue} +1 -1
- package/templates/nuxt/components/{SimpleAppRadio.vue.eta → simpleApp/pending/SimpleAppRadio.vue} +1 -1
- package/templates/nuxt/components/{SimpleAppRating.vue.eta → simpleApp/pending/SimpleAppRating.vue} +1 -1
- package/templates/nuxt/components/{SimpleAppSelect.vue.eta → simpleApp/pending/SimpleAppSelect.vue} +12 -2
- package/templates/nuxt/components/{SimpleAppSelectmulti.vue.eta → simpleApp/pending/SimpleAppSelectmulti.vue} +1 -1
- package/templates/nuxt/components/{SimpleAppSlider.vue.eta → simpleApp/pending/SimpleAppSlider.vue} +1 -1
- package/templates/nuxt/components/{SimpleAppSwitch.vue.eta → simpleApp/pending/SimpleAppSwitch.vue} +1 -1
- package/templates/nuxt/components/{SimpleAppText.vue.eta → simpleApp/pending/SimpleAppText.vue} +13 -4
- package/templates/nuxt/components/{SimpleAppTextarea.vue.eta → simpleApp/pending/SimpleAppTextarea.vue} +13 -2
- package/templates/nuxt/components/{SimpleAppDatatable.vue.eta → table/TableDocuments.vue.eta} +15 -63
- package/templates/nuxt/components/{UserProfileListItem.vue.eta → user/UserProfileListItem.vue.eta} +1 -1
- package/templates/nuxt/composables/getMenus.generate.ts.eta +4 -1
- package/templates/nuxt/composables/getOpenApi.generate.ts.eta +32 -1
- package/templates/nuxt/composables/goTo.generate.ts.eta +7 -0
- package/templates/nuxt/composables/notifications.generate.ts.eta +1 -1
- package/templates/nuxt/composables/stringHelper.generate.ts.eta +1 -0
- package/templates/nuxt/layouts/default.vue.eta +1 -1
- package/templates/nuxt/layouts/documentlist.vue.eta +24 -8
- package/templates/nuxt/layouts/sidelist.vue.eta +68 -0
- package/templates/nuxt/layouts/sidelistcrud.vue.eta +1 -1
- package/templates/nuxt/nuxt.config.ts.eta +0 -1
- package/templates/nuxt/pages/[xorg]/branch/index.vue.etax +2 -2
- package/templates/nuxt/pages/[xorg]/docnoformat/{[id].vue.eta → [doctype]/[id].vue.eta} +2 -5
- package/templates/nuxt/pages/[xorg]/docnoformat/[doctype]/new.vue.eta +222 -0
- package/templates/nuxt/pages/[xorg]/docnoformat/[doctype].vue.eta +33 -0
- package/templates/nuxt/pages/[xorg]/docnoformat/index.vue.eta +4 -294
- package/templates/nuxt/pages/[xorg]/docnoformat.vue.eta +100 -0
- package/templates/nuxt/pages/[xorg]/organization/[bid].vue.eta +14 -0
- package/templates/nuxt/pages/[xorg]/organization/[id]/branches/[bid].vue +13 -0
- package/templates/nuxt/pages/[xorg]/organization/[id]/branches/new.vue +149 -0
- package/templates/nuxt/pages/[xorg]/organization/[id]/index.vue.eta +1 -0
- package/templates/nuxt/pages/[xorg]/organization/new.vue.eta +151 -0
- package/templates/nuxt/pages/[xorg]/organization.vue.eta +145 -0
- package/templates/nuxt/pages/[xorg]/user/index.vue.eta +23 -23
- package/templates/nuxt/pages/[xorg]/user.vue.eta +13 -11
- package/templates/nuxt/pages/index.vue._eta +2 -2
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +10 -1
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +1 -1
- package/templates/nuxt/types/documentlist.ts.eta +2 -2
- package/templates/nuxt/types/index.ts.eta +2 -1
- package/templates/nuxt/types/simpleappinput.ts.eta +39 -0
- package/templates/project/jsonschemas/category.json._eta +5 -5
- package/templates/project/jsonschemas/customer.json._eta +5 -5
- package/templates/project/jsonschemas/invoice.json._eta +7 -7
- package/templates/project/jsonschemas/product.json._eta +5 -5
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nuxt/components/ListView.vue.eta +0 -52
- package/templates/nuxt/components/renderers/ForeignKeyRender.vue.eta +0 -10
- package/templates/nuxt/composables/getAutocomplete.generate.ts.eta +0 -32
- package/templates/nuxt/pages/[xorg]/organization/index.vue.eta +0 -168
- /package/templates/nuxt/components/{EventDecision.vue.eta → event/EventDecision.vue.eta} +0 -0
- /package/templates/nuxt/components/{ButtonHome.vue.eta → header/button/HeaderButtonHome.vue.eta} +0 -0
- /package/templates/nuxt/components/{ButtonLogout.vue.eta → header/button/HeaderButtonLogout.vue.eta} +0 -0
- /package/templates/nuxt/components/{ButtonProfile.vue.eta → header/button/HeaderButtonProfile.vue.eta} +0 -0
- /package/templates/nuxt/components/{renderers/BooleanRender.vue.eta → renderer/RendererBoolean.vue.eta} +0 -0
- /package/templates/nuxt/components/{renderers/DateRender.vue.eta → renderer/RendererDate.vue.eta} +0 -0
- /package/templates/nuxt/components/{renderers/MoneyRender.vue.eta → renderer/RendererMoney.vue.eta} +0 -0
- /package/templates/nuxt/components/{renderers/MultiTextRender.vue.eta → renderer/RendererMultiText.vue.eta} +0 -0
- /package/templates/nuxt/components/{SimpleAppDynamicInput.vue.eta → simpleApp/pending/SimpleAppDynamicInput.vue} +0 -0
- /package/templates/nuxt/components/{SimpleAppValue.vue.eta → simpleApp/pending/SimpleAppValue.vue} +0 -0
- /package/templates/nuxt/components/{helper.ts.eta → simpleApp/pending/helper.ts-backup} +0 -0
- /package/templates/nuxt/components/{type.ts.eta → simpleApp/pending/type.ts-backup} +0 -0
- /package/templates/nuxt/components/{CrudNestedDoc.vue.eta → suspended/CrudNestedDoc.vue.eta} +0 -0
- /package/templates/nuxt/components/{CrudSimple.vue.eta → suspended/CrudSimple.vue.eta} +0 -0
- /package/templates/nuxt/components/{Menus.vue.eta → suspended/Menus.vue.eta} +0 -0
- /package/templates/nuxt/components/{Spinner.vue.eta → suspended/Spinner.vue.eta} +0 -0
- /package/templates/nuxt/components/{ButtonCreateTenant.vue.eta → user/UserButtonCreateTenant.vue.eta} +0 -0
- /package/templates/nuxt/components/{ButtonPermissionInfo.vue.eta → user/UserButtonPermissionInfo.vue.eta} +0 -0
- /package/templates/nuxt/components/{Invitation.vue.eta → user/UserInvitation.vue.eta} +0 -0
- /package/templates/nuxt/components/{TenantPicker.vue.eta → user/UserTenantPicker.vue.eta} +0 -0
package/templates/nuxt/components/{DebugDocumentData.vue.eta → debug/DebugDocumentData.vue.eta}
RENAMED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
// import Panel from 'primevue/panel';
|
|
9
9
|
// import ScrollPanel from 'primevue/scrollpanel';
|
|
10
10
|
import Dialog from 'primevue/dialog';
|
|
11
|
+
import Sidebar from 'primevue/sidebar';
|
|
11
12
|
|
|
12
13
|
import {ref} from 'vue'
|
|
13
14
|
const modelValue = defineModel()
|
|
@@ -15,13 +16,16 @@ const isdebug = ref(useRuntimeConfig().public.DEBUGDATA)
|
|
|
15
16
|
const visible = ref(false)
|
|
16
17
|
const props = defineProps<{label?:string}>()
|
|
17
18
|
const label = ref(props.label??'Debug')
|
|
19
|
+
const op = ref();
|
|
20
|
+
|
|
18
21
|
</script>
|
|
19
22
|
<template>
|
|
20
23
|
<div class="floatright" v-if="isdebug=='1'">
|
|
21
|
-
<Button @click="visible=true">{{ label }}</Button>
|
|
22
|
-
<
|
|
23
|
-
<pre>{{ modelValue }}</pre>
|
|
24
|
-
</
|
|
24
|
+
<Button @click="visible=true" >{{ label }}</Button>
|
|
25
|
+
<Sidebar v-model:visible="visible">
|
|
26
|
+
<pre class="pb-2">{{ modelValue }}</pre>
|
|
27
|
+
</Sidebar>
|
|
28
|
+
|
|
25
29
|
</div>
|
|
26
30
|
|
|
27
31
|
</template>
|
package/templates/nuxt/components/{EventNotification.vue.eta → event/EventNotification.vue.eta}
RENAMED
|
@@ -17,10 +17,10 @@ const toast = useToast();
|
|
|
17
17
|
const { $event,$listen } = useNuxtApp()
|
|
18
18
|
// WildcardHandler<Record<EventType, unknown>>
|
|
19
19
|
let resmsg:ToastMessageOptions = {} as ToastMessageOptions
|
|
20
|
-
|
|
20
|
+
const eventdata=ref()
|
|
21
21
|
$listen("Notification",(data:Notification)=>{
|
|
22
22
|
// $listen('*',(type:key of EventType,data:any)=>{
|
|
23
|
-
|
|
23
|
+
eventdata.value= data
|
|
24
24
|
const type:NotificationStatus = data.status
|
|
25
25
|
// let arrupdate = type.split(':')
|
|
26
26
|
// let eventdata = data
|
|
@@ -35,10 +35,10 @@ $listen("Notification",(data:Notification)=>{
|
|
|
35
35
|
case NotificationStatus.success:
|
|
36
36
|
duration = 3000
|
|
37
37
|
break;
|
|
38
|
-
case NotificationStatus.
|
|
38
|
+
case NotificationStatus.error:
|
|
39
39
|
duration = 0
|
|
40
40
|
break;
|
|
41
|
-
case NotificationStatus.
|
|
41
|
+
case NotificationStatus.warn:
|
|
42
42
|
duration = 5000
|
|
43
43
|
break;
|
|
44
44
|
case NotificationStatus.info:
|
|
@@ -95,6 +95,7 @@ const getFieldName = (path:string)=>{
|
|
|
95
95
|
<template>
|
|
96
96
|
<Toast group="default" :pt="{}">
|
|
97
97
|
<template #message="p">
|
|
98
|
+
|
|
98
99
|
<div class="bg-gray-200 dark:bg-gray-900 h-full w-full border">
|
|
99
100
|
<div class=" flex content content-end w-full">
|
|
100
101
|
<div role="alert" class="w-full bg-white dark:bg-gray-800 shadow-lg rounded flex flex-row transition duration-150 ease-in-out" id="notification">
|
|
@@ -104,17 +105,20 @@ const getFieldName = (path:string)=>{
|
|
|
104
105
|
</svg>
|
|
105
106
|
</div>
|
|
106
107
|
<div class="flex flex-col justify-center pl-4 xl:pl-1 w-96 pt-4 sm:pb-4 pb-2">
|
|
107
|
-
<p class="text-lg text-gray-800 dark:text-gray-100 font-semibold pb-1">{{ p.message.summary }}</p>
|
|
108
|
-
|
|
108
|
+
<p class="text-lg text-gray-800 dark:text-gray-100 font-semibold pb-1">{{ p.message.summary }}</p>
|
|
109
109
|
<div v-if="p.message.detail">
|
|
110
|
-
<p v-if="Array.isArray(p.message.detail)"
|
|
111
|
-
v-for="item in p.message.detail"
|
|
110
|
+
<p v-if="Array.isArray(p.message.detail)" v-for="item in p.message.detail"
|
|
112
111
|
class="text-sm text-gray-600 dark:text-gray-400 font-normal">
|
|
113
112
|
<span v-if="item.instancePath">{{ item.instancePath }} </span>
|
|
114
113
|
<span v-if="item.message"> {{ item.message }} </span>
|
|
115
114
|
|
|
116
115
|
</p>
|
|
117
|
-
<p v-else-if="typeof p.message.detail == 'string'" class="text-sm text-gray-600 dark:text-gray-400 font-normal">
|
|
116
|
+
<p v-else-if="typeof p.message.detail == 'string'" class="text-sm text-gray-600 dark:text-gray-400 font-normal">
|
|
117
|
+
{{ p.message.detail }}
|
|
118
|
+
</p>
|
|
119
|
+
<p v-else-if="typeof p.message.detail == 'object'" class="text-sm text-gray-600 dark:text-gray-400 font-normal">
|
|
120
|
+
{{ p.message.detail.message }}
|
|
121
|
+
</p>
|
|
118
122
|
<p v-else></p>
|
|
119
123
|
</div>
|
|
120
124
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import ButtonMenuPicker from "./ButtonMenuPicker.vue"
|
|
2
|
+
//import ButtonMenuPicker from "./ButtonMenuPicker.vue"
|
|
3
3
|
|
|
4
|
-
import ButtonProfile from './ButtonProfile.vue';
|
|
4
|
+
//import ButtonProfile from './ButtonProfile.vue';
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
</script>
|
|
@@ -13,22 +13,22 @@ import ButtonProfile from './ButtonProfile.vue';
|
|
|
13
13
|
|
|
14
14
|
<div class="flex-1 flex flex-row gap-2 p-2">
|
|
15
15
|
<div class="">
|
|
16
|
-
<
|
|
16
|
+
<HeaderButtonMenuPicker/>
|
|
17
17
|
|
|
18
18
|
</div>
|
|
19
19
|
<div class="">
|
|
20
|
-
<
|
|
20
|
+
<HeaderButtonHome/>
|
|
21
21
|
</div>
|
|
22
22
|
|
|
23
23
|
</div>
|
|
24
24
|
<div class="flex-1 flex flex-row-reverse gap-2 p-2">
|
|
25
25
|
|
|
26
26
|
<div class=" text-right">
|
|
27
|
-
<
|
|
27
|
+
<HeaderButtonProfile/>
|
|
28
28
|
</div>
|
|
29
29
|
|
|
30
30
|
<div class="">
|
|
31
|
-
<
|
|
31
|
+
<HeaderSelectBranch/>
|
|
32
32
|
</div>
|
|
33
33
|
</div>
|
|
34
34
|
|
package/templates/nuxt/components/{SelectBranch.vue.eta → header/HeaderSelectBranch.vue.eta}
RENAMED
|
@@ -4,7 +4,7 @@ import {ref} from 'vue'
|
|
|
4
4
|
|
|
5
5
|
const selectedbranch = ref(getCurrentXorg())
|
|
6
6
|
const currentTenant=ref(getUserProfile().tenantId)
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
type Org = {orgId:number, label:string,_id:string}
|
|
9
9
|
const branches = getUserProfile().branches.filter((item:any)=>{return item.branch.tenantId == currentTenant.value})
|
|
10
10
|
const orgList:Org[] = _.uniqBy(branches,'branch.orgId').map((item)=>({
|
|
@@ -24,7 +24,7 @@ const switchXorg = ()=>{
|
|
|
24
24
|
navigateTo(`/${selectedbranch.value}`,{external:true})
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
</script>
|
|
29
29
|
<template>
|
|
30
30
|
<div>
|
|
@@ -20,10 +20,10 @@ const selectMenu = (menu:MenuData) =>{
|
|
|
20
20
|
</svg>
|
|
21
21
|
</button>
|
|
22
22
|
|
|
23
|
-
<Dialog v-model:visible="visible" modal header="Pick Document" >
|
|
23
|
+
<Dialog v-model:visible="visible" modal header="Pick Document" :pt="{dialog:{ class:' bg-primary-800 ' }}">
|
|
24
24
|
<div class="">
|
|
25
|
-
<Button v-for="menu in menus" @click="selectMenu(menu)">
|
|
26
|
-
<div v-if="menu.isolationType == 'none'" class="">
|
|
25
|
+
<Button v-for="menu in menus" @click="selectMenu(menu)" >
|
|
26
|
+
<div v-if="menu.isolationType == 'none'" class="text-warning-600 hover:text-warning-500">
|
|
27
27
|
* {{ camelCaseToWords(menu.label) }}
|
|
28
28
|
</div>
|
|
29
29
|
<div v-else class="">{{ camelCaseToWords(menu.label) }}</div>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div v-if="withFilter">
|
|
4
|
+
<input
|
|
5
|
+
autofocus
|
|
6
|
+
placeholder="search"
|
|
7
|
+
v-model="searchvalue"
|
|
8
|
+
class="w-full border p-2"
|
|
9
|
+
type="search" />
|
|
10
|
+
</div>
|
|
11
|
+
<div class="max-h-screen overflow-auto">
|
|
12
|
+
<ul >
|
|
13
|
+
<li v-for="item in filterlist">
|
|
14
|
+
<div :class="getSelectedCSS(item)">
|
|
15
|
+
<NuxtLink :to="`${url}/${item[idField]}`">
|
|
16
|
+
<div class="mr-2">{{item[titleField] }}</div>
|
|
17
|
+
<div class="font font-bold text-right">{{item[subTitleField]}}</div>
|
|
18
|
+
</NuxtLink>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
</li>
|
|
22
|
+
</ul>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
<script setup lang="ts">
|
|
27
|
+
import {ref} from 'vue'
|
|
28
|
+
import {ListItem} from '~/types/listview'
|
|
29
|
+
const props = withDefaults(defineProps<{
|
|
30
|
+
list:any[],
|
|
31
|
+
url:string,
|
|
32
|
+
titleField:string
|
|
33
|
+
idField?:string
|
|
34
|
+
subTitleField:string
|
|
35
|
+
withFilter?:boolean
|
|
36
|
+
}>(),{
|
|
37
|
+
idField:'_id'
|
|
38
|
+
})
|
|
39
|
+
const emit = defineEmits(['clickitem'])
|
|
40
|
+
const searchvalue = ref('')
|
|
41
|
+
const selecteditem =ref('')
|
|
42
|
+
const clickRow=(item:ListItem)=>{
|
|
43
|
+
// emit('clickitem',item)
|
|
44
|
+
// selecteditem.value = item.code
|
|
45
|
+
}
|
|
46
|
+
const filterlist = computed(()=>{
|
|
47
|
+
const newlist =props.list.filter((item:any)=>
|
|
48
|
+
{
|
|
49
|
+
return String(item[props.titleField]).toLowerCase().includes(searchvalue.value.toLowerCase()) ||
|
|
50
|
+
String(item[props.subTitleField]).toLowerCase().includes(searchvalue.value.toLowerCase())
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
return newlist
|
|
54
|
+
})
|
|
55
|
+
const getSelectedCSS= (item:ListItem)=>{
|
|
56
|
+
if(selecteditem.value == item.code){
|
|
57
|
+
return "p-2 border bg-sky-200"
|
|
58
|
+
}else{
|
|
59
|
+
return "p-2 border hover-list-primary"
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
</script>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<NuxtLink v-if="setting?.collection" :to="getDocumentUrl(setting.collection,modelValue ? modelValue['_id']:'')" class="text-primary-700 hover:text-primary-500 cursor-pointer">
|
|
3
|
+
{{modelValue?.label}}
|
|
4
|
+
</NuxtLink>
|
|
5
|
+
<span v-else>{{modelValue?.label || modelValue}}</span>
|
|
6
|
+
</template>
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
const modelValue = defineModel()
|
|
9
|
+
|
|
10
|
+
const props = defineProps<{setting:any}>()
|
|
11
|
+
</script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import RendererBoolean from './RendererBoolean.vue'
|
|
2
|
+
import RendererDate from './RendererDate.vue'
|
|
3
|
+
import RendererForeignKey from './RendererForeignKey.vue'
|
|
4
|
+
import RendererMoney from './RendererMoney.vue'
|
|
5
|
+
import RendererMultiText from './RendererMultiText.vue'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
|
|
10
|
+
RendererBoolean,RendererDate,RendererForeignKey,RendererMoney,RendererMultiText
|
|
11
|
+
|
|
12
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
|
|
4
|
+
<div class="p-inputgroup w-full flex flex-row">
|
|
5
|
+
<InputText class="flex-1 rounded-tr-none rounded-br-none"
|
|
6
|
+
:readonly="readonly"
|
|
7
|
+
v-model="modelValue"
|
|
8
|
+
:placeholder="placeholder"
|
|
9
|
+
/>
|
|
10
|
+
<span class="p-inputgroup-addon p p-0">
|
|
11
|
+
<button type="button" @click="toggle"
|
|
12
|
+
:disabled="readonly"
|
|
13
|
+
class="border rounded-tl-none rounded-bl-none btn btn-primary -ml-1 h-full p-3 rounded-r-md">
|
|
14
|
+
<i class="pi pi-angle-down"></i>
|
|
15
|
+
</button>
|
|
16
|
+
<OverlayPanel ref="op" class="p-4">
|
|
17
|
+
<div class="m-4">
|
|
18
|
+
<ul>
|
|
19
|
+
<li v-for="docno in docFormatlist" class="hover-list-primary p-2" >
|
|
20
|
+
<a class="flex-row p-2 mt-4" @click="chooseFormat(docno)">
|
|
21
|
+
<span class="pi pi-hashtag mr-2"></span>
|
|
22
|
+
<span class="">{{docno.docNoFormatName}}</span>
|
|
23
|
+
<span class="ml-2 text text-green-600">{{docno.sample}}</span>
|
|
24
|
+
</a>
|
|
25
|
+
</li>
|
|
26
|
+
</ul>
|
|
27
|
+
</div>
|
|
28
|
+
</OverlayPanel>
|
|
29
|
+
</span>
|
|
30
|
+
<!-- {{ Object.getOwnPropertyNames(setting) }} -->
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
</template>
|
|
34
|
+
<script lang="ts" setup>
|
|
35
|
+
import {ForeignKey} from '~/types'
|
|
36
|
+
import OverlayPanel from 'primevue/overlaypanel';
|
|
37
|
+
import InputText from 'primevue/inputtext';
|
|
38
|
+
import {DocNoFormat} from "~/types"
|
|
39
|
+
const props = defineProps<{
|
|
40
|
+
setting:any
|
|
41
|
+
readonly?:boolean
|
|
42
|
+
}>()
|
|
43
|
+
const op = ref();
|
|
44
|
+
const placeholder = ref('')
|
|
45
|
+
const docFormatlist = ref()
|
|
46
|
+
const modelValue = defineModel<string>()
|
|
47
|
+
const docNoFormat = props.setting.document.getReactiveData().value.docNoFormat
|
|
48
|
+
const emits = defineEmits(['update:docNoFormat'])
|
|
49
|
+
|
|
50
|
+
const documenttype = props.setting.document.doctype
|
|
51
|
+
|
|
52
|
+
const toggle = async (event:any) => {
|
|
53
|
+
op.value.toggle(event);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const chooseFormat = (item:any) =>{
|
|
57
|
+
placeholder.value = item.sample
|
|
58
|
+
const f = item
|
|
59
|
+
docNoFormat.value = { _id : f._id, label : f.docNoFormatName}
|
|
60
|
+
op.value.toggle();
|
|
61
|
+
emits('update:docNoFormat',item)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const loadDocFormats = async () =>{
|
|
65
|
+
docFormatlist.value= await getDocFormats(documenttype)
|
|
66
|
+
if(docFormatlist.value.length>0){
|
|
67
|
+
const f = docFormatlist.value[0]
|
|
68
|
+
docNoFormat.value = { _id : f._id, label : f.docNoFormatName}
|
|
69
|
+
placeholder.value = docFormatlist.value[0].sample
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
onMounted(()=>{
|
|
74
|
+
loadDocFormats()
|
|
75
|
+
|
|
76
|
+
})
|
|
77
|
+
</script>
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="schema" :class="fieldcontainerclass">
|
|
3
3
|
<div v-if="hidelabel"></div>
|
|
4
|
-
<label v-else-if="error" class="
|
|
5
|
-
<label v-else :for="uuid">{{ fieldlabel }} <span v-if="props.setting.isrequired && fieldlabel" class="
|
|
4
|
+
<label v-else-if="error" class="text-danger-600" :for="uuid">{{ fieldlabel }} <span v-if="props.setting.isrequired && fieldlabel" class="text-danger-600">*</span></label>
|
|
5
|
+
<label v-else :for="uuid">{{ fieldlabel }} <span v-if="props.setting.isrequired && fieldlabel" class="text-danger-600">*</span></label>
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
<div v-if="typeof modelValue =='object' && typeof modelValue['_id']!='undefined' && typeof modelValue['label']!='undefined' && readonly ==true " :uuid="uuid" class="simpleapp-value-readonly">{{ modelValue['label'] }}</div>
|
|
9
|
-
<div v-else-if="readonly==true" :uuid="uuid" class="simpleapp-value-readonly">{{ modelValue }}</div>
|
|
10
|
-
<slot v-else name="default" :uuid="uuid" :error="error"></slot>
|
|
7
|
+
<!-- <div :uuid="uuid" >{{ modelValue }}</div> -->
|
|
8
|
+
<!-- <div v-if="typeof modelValue =='object' && typeof modelValue['_id']!='undefined' && typeof modelValue['label']!='undefined' && readonly ==true " :uuid="uuid" class="simpleapp-value-readonly">{{ modelValue['label'] }}</div> -->
|
|
9
|
+
<!-- <div v-else-if="readonly==true" :uuid="uuid" class="simpleapp-value-readonly">{{ modelValue }}</div> -->
|
|
10
|
+
<!-- <slot v-else name="default" :uuid="uuid" :error="error"></slot> -->
|
|
11
|
+
<slot name="default" :uuid="uuid" :error="error"></slot>
|
|
11
12
|
|
|
12
|
-
<small v-if="error" class="
|
|
13
|
+
<small v-if="error" class="text-danger-600">{{ error }}</small>
|
|
13
14
|
<small v-else class="input-desc">{{ fielddesc }}</small>
|
|
14
15
|
</div>
|
|
15
16
|
<div v-else :class="defaultcssclass">
|
|
16
|
-
<label class="
|
|
17
|
-
<div class="
|
|
17
|
+
<label class="etext-danger-600">wrong path in getField()</label>
|
|
18
|
+
<div class="text-danger-600">{{ props.setting.path }}</div>
|
|
18
19
|
</div>
|
|
19
20
|
</template>
|
|
20
21
|
<script setup lang="ts">
|
|
21
22
|
import SimpleAppValue from './SimpleAppValue.vue'
|
|
22
|
-
import {camelCaseToWords} from './helper'
|
|
23
|
-
import {computed,setBlockTracking,watch} from 'vue'
|
|
23
|
+
// import {camelCaseToWords} from './helper'
|
|
24
|
+
// import {computed,setBlockTracking,watch} from 'vue'
|
|
24
25
|
|
|
25
26
|
import {ref} from 'vue'
|
|
26
27
|
const uuid = crypto.randomUUID();
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
</form>
|
|
6
6
|
</template>
|
|
7
7
|
<script setup lang="ts" >
|
|
8
|
-
import type {SimpleAppFieldSetting} from '
|
|
9
|
-
import { SimpleAppClient } from '
|
|
8
|
+
// import type {SimpleAppFieldSetting} from '/types'
|
|
9
|
+
import { SimpleAppClient } from '~/simpleapp/generate/clients/SimpleAppClient'
|
|
10
10
|
import type { JSONSchema7,JSONSchema7Definition } from 'json-schema';
|
|
11
|
-
|
|
11
|
+
import _ from 'lodash'
|
|
12
12
|
const props = defineProps<{
|
|
13
13
|
title?:string,
|
|
14
14
|
document: SimpleAppClient<any,any>
|
|
@@ -28,6 +28,7 @@ import type { JSONSchema7,JSONSchema7Definition } from 'json-schema';
|
|
|
28
28
|
|
|
29
29
|
return {
|
|
30
30
|
path: path,
|
|
31
|
+
key: _.last(path.split('/')),
|
|
31
32
|
instancepath: getInstancePath(schema,path),
|
|
32
33
|
fieldsetting: fieldsetting,
|
|
33
34
|
modelObject: data,
|
|
@@ -37,7 +38,7 @@ import type { JSONSchema7,JSONSchema7Definition } from 'json-schema';
|
|
|
37
38
|
isrequired: getIsRequired(schema,path),
|
|
38
39
|
errors: props.document.getErrors(),
|
|
39
40
|
readonly: props.readonly
|
|
40
|
-
} as SimpleAppFieldSetting
|
|
41
|
+
} //as SimpleAppFieldSetting
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
// "schemaPath": "#/properties/email/format",
|