@simitgroup/simpleapp-generator 1.0.64 → 1.1.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.
- package/dist/buildinschemas/user.d.ts.map +1 -1
- package/dist/buildinschemas/user.js +0 -1
- package/dist/buildinschemas/user.js.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/user.ts +1 -2
- package/templates/basic/nuxt/pages.landing.vue.eta +1 -1
- package/templates/basic/nuxt/pages.new.vue.eta +52 -68
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +0 -1
- package/templates/nuxt/assets/css/style.css._eta +29 -1
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +8 -2
- package/templates/nuxt/components/debug/DebugDocumentData.vue.eta +8 -4
- package/templates/nuxt/components/event/EventNotification.vue.eta +13 -9
- package/templates/nuxt/components/simpleApp/SimpleAppDocumentNo.vue.eta +31 -44
- package/templates/nuxt/components/simpleApp/SimpleAppFieldContainer.vue.eta +12 -11
- package/templates/nuxt/components/simpleApp/SimpleAppForm.vue.eta +5 -4
- package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +288 -0
- package/templates/nuxt/components/simpleApp/SimpleAppInputTable.vue.eta +4 -52
- package/templates/nuxt/components/simpleApp/{SimpleAppAutocomplete.vue.eta → pending/SimpleAppAutocomplete.vue} +1 -2
- package/templates/nuxt/components/simpleApp/pending/SimpleAppDocumentNo.vue +90 -0
- package/templates/nuxt/components/simpleApp/pending/SimpleAppInputTable.vue +83 -0
- package/templates/nuxt/components/simpleApp/{SimpleAppText.vue.eta → pending/SimpleAppText.vue} +0 -2
- package/templates/nuxt/composables/getOpenApi.generate.ts.eta +32 -1
- package/templates/nuxt/layouts/default.vue.eta +1 -1
- package/templates/nuxt/layouts/documentlist.vue.eta +4 -4
- package/templates/nuxt/layouts/sidelist.vue.eta +1 -1
- package/templates/nuxt/layouts/sidelistcrud.vue.eta +1 -1
- package/templates/nuxt/nuxt.config.ts.eta +0 -1
- package/templates/nuxt/pages/[xorg]/docnoformat/[doctype]/new.vue.eta +96 -90
- package/templates/nuxt/pages/[xorg]/organization/[id]/branches/new.vue +3 -3
- package/templates/nuxt/pages/[xorg]/organization/new.vue.eta +24 -18
- package/templates/nuxt/pages/[xorg]/organization.vue.eta +32 -17
- package/templates/nuxt/pages/[xorg]/user/index.vue.eta +40 -35
- package/templates/nuxt/pages/[xorg]/user.vue.eta +10 -8
- package/templates/nuxt/pages/index.vue._eta +3 -3
- package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +4 -0
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +4 -1
- 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 +6 -6
- package/templates/project/jsonschemas/customer.json._eta +17 -4
- package/templates/project/jsonschemas/invoice.json._eta +5 -4
- package/templates/project/jsonschemas/product.json._eta +3 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nuxt/composables/getAutocomplete.generate.ts.eta +0 -32
- /package/templates/nuxt/components/{ListView.vue.eta → list/ListView.vue.eta} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppAutocompletemulti.vue.eta → pending/SimpleAppAutocompletemulti.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppCalendar.vue.eta → pending/SimpleAppCalendar.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppCheckbox.vue.eta → pending/SimpleAppCheckbox.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppChip.vue.eta → pending/SimpleAppChip.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppColor.vue.eta → pending/SimpleAppColor.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppDynamicInput.vue.eta → pending/SimpleAppDynamicInput.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppEditor.vue.eta → pending/SimpleAppEditor.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppList.vue.eta → pending/SimpleAppList.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppListmulti.vue.eta → pending/SimpleAppListmulti.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppNumber.vue.eta → pending/SimpleAppNumber.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppPassword.vue.eta → pending/SimpleAppPassword.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppRadio.vue.eta → pending/SimpleAppRadio.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppRating.vue.eta → pending/SimpleAppRating.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppSelect.vue.eta → pending/SimpleAppSelect.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppSelectmulti.vue.eta → pending/SimpleAppSelectmulti.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppSlider.vue.eta → pending/SimpleAppSlider.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppSwitch.vue.eta → pending/SimpleAppSwitch.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppTextarea.vue.eta → pending/SimpleAppTextarea.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{SimpleAppValue.vue.eta → pending/SimpleAppValue.vue} +0 -0
- /package/templates/nuxt/components/simpleApp/{helper.ts.eta → pending/helper.ts-backup} +0 -0
- /package/templates/nuxt/components/simpleApp/{type.ts.eta → 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/{DocumentDatatable.vue.eta → table/TableDocuments.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/{UserProfileListItem.vue.eta → user/UserProfileListItem.vue.eta} +0 -0
- /package/templates/nuxt/components/{TenantPicker.vue.eta → user/UserTenantPicker.vue.eta} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/buildinschemas/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,SAAS,CAAA;AAE5D,eAAO,MAAM,IAAI,EAAC,
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/buildinschemas/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,SAAS,CAAA;AAE5D,eAAO,MAAM,IAAI,EAAC,UA4BjB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/buildinschemas/user.ts"],"names":[],"mappings":";;;AAAA,kCAA4D;AAE/C,QAAA,IAAI,GAAa;IAC1B,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAC;QACjB,YAAY,EAAC,MAAM;QACnB,YAAY,EAAC,MAAM;QACnB,QAAQ,EAAC,MAAM;QACf,aAAa,EAAC,oBAAa,CAAC,MAAM;QAClC,SAAS,EAAC,OAAO;QACjB,
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/buildinschemas/user.ts"],"names":[],"mappings":";;;AAAA,kCAA4D;AAE/C,QAAA,IAAI,GAAa;IAC1B,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAC;QACjB,YAAY,EAAC,MAAM;QACnB,YAAY,EAAC,MAAM;QACnB,QAAQ,EAAC,MAAM;QACf,aAAa,EAAC,oBAAa,CAAC,MAAM;QAClC,SAAS,EAAC,OAAO;QACjB,aAAa,EAAC,UAAU;QACxB,aAAa,EAAC,CAAC,WAAW,CAAC;QAC3B,4BAA4B,EAAC,CAAC,KAAK,CAAC;KACvC;IACD,UAAU,EAAE;QACR,GAAG,EAAC,EAAC,IAAI,EAAC,QAAQ,EAAC;QACnB,OAAO,EAAC,EAAC,IAAI,EAAC,QAAQ,EAAC;QACvB,OAAO,EAAC,EAAC,IAAI,EAAC,QAAQ,EAAC;QACvB,SAAS,EAAC,EAAC,IAAI,EAAC,QAAQ,EAAC;QACzB,SAAS,EAAC,EAAC,IAAI,EAAC,QAAQ,EAAC;QACzB,QAAQ,EAAE,EAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAC,CAAC,EAAC,OAAO,EAAC,CAAC,EAAE;QAC/C,KAAK,EAAE,EAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAC,CAAC,EAAC,OAAO,EAAC,CAAC,EAAE;QAC5C,QAAQ,EAAE,EAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAC,CAAC,EAAC,OAAO,EAAC,CAAC,EAAE;QAC/C,GAAG,EAAE,EAAC,IAAI,EAAE,QAAQ,GAAE;QACtB,QAAQ,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC,SAAS,EAAC,CAAC,EAAC;QACtC,KAAK,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC,SAAS,EAAC,EAAE,EAAC,MAAM,EAAE,OAAO,EAAC;QACpD,MAAM,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC,OAAO,EAAC,IAAI,EAAC;QACtC,WAAW,EAAE,EAAC,IAAI,EAAC,QAAQ,EAAC;QAC5B,YAAY,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC,WAAW,EAAC,+BAA+B,EAAC;KAC3E;CACN,CAAA"}
|
package/package.json
CHANGED
|
@@ -7,8 +7,7 @@ export const user:SchemaType ={
|
|
|
7
7
|
documentName:'user',
|
|
8
8
|
pageType:'crud',
|
|
9
9
|
isolationType:IsolationType.tenant,
|
|
10
|
-
uniqueKey:'email',
|
|
11
|
-
uniqueKeys:[['tenantId','uid']],
|
|
10
|
+
uniqueKey:'email',
|
|
12
11
|
documentTitle:'fullname',
|
|
13
12
|
requiredRoles:["SuperUser"],
|
|
14
13
|
additionalAutoCompleteFields:['uid']
|
|
@@ -61,7 +61,7 @@ onNuxtReady(()=>{
|
|
|
61
61
|
</script>
|
|
62
62
|
<template>
|
|
63
63
|
<div>
|
|
64
|
-
<Button class="
|
|
64
|
+
<Button class="btn btn-primary" v-if="canPerform(String(useRoute().meta.name),'create')" @click="newData">New</Button>
|
|
65
65
|
<Dialog v-model:visible="visible"
|
|
66
66
|
:pt="{ root: { class: 'w-full h-full bg-white' } , headertitle:{class:'m-2 ml-6 text-2xl font-bold'}}"
|
|
67
67
|
modal :header="t(doc.getDocName())"
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
<% const skipcolumns = ['_id','createdBy','created','updatedBy','updated','orgId','branchId','tenantId','doctype'] %>
|
|
1
|
+
<% const skipcolumns = ['_id','createdBy','created','updatedBy','updated','orgId','branchId','tenantId','doctype','docNoFormat'] %>
|
|
2
|
+
<% const getBasicElement = ( inputtype, pathStr, modelValue,subtype=undefined,hidelabel=false,instancepath='') =>
|
|
3
|
+
`<SimpleAppInput :input-type="SimpleAppInputType.${inputtype}" :setting="o.getField('${pathStr}')" v-model="${modelValue}"`+
|
|
4
|
+
(subtype? `type="${subtype}"`:'') +' ' +
|
|
5
|
+
(hidelabel? ':hidelabel="true"':'') +
|
|
6
|
+
(instancepath ? `:instancepath="\`${instancepath}\`"` : '') + '/>' %>
|
|
2
7
|
<script setup lang="ts">
|
|
3
8
|
/**
|
|
4
9
|
* This file was automatically generated by simpleapp everytime regenerate code.
|
|
@@ -7,6 +12,7 @@
|
|
|
7
12
|
* last change 2023-09-09
|
|
8
13
|
* author: Ks Tan
|
|
9
14
|
*/
|
|
15
|
+
import {SimpleAppInputType} from "~/types"
|
|
10
16
|
import ConfirmPopup from 'primevue/confirmpopup';
|
|
11
17
|
import { useConfirm } from "primevue/useconfirm";
|
|
12
18
|
const confirm = useConfirm();
|
|
@@ -15,11 +21,11 @@
|
|
|
15
21
|
const doc = $<%= it.typename %>Doc()
|
|
16
22
|
const data = doc.getReactiveData();
|
|
17
23
|
|
|
18
|
-
const fetchRecord = async (
|
|
19
|
-
await doc.getById(
|
|
24
|
+
const fetchRecord = async (recordid:string) =>{
|
|
25
|
+
await doc.getById(recordid)
|
|
20
26
|
}
|
|
21
27
|
|
|
22
|
-
const id = String(useRoute().params.id)
|
|
28
|
+
const id = computed(()=>String(useRoute().params.id??''))
|
|
23
29
|
|
|
24
30
|
|
|
25
31
|
const disabled = computed(()=>{
|
|
@@ -74,70 +80,73 @@ const refresh = ()=>{
|
|
|
74
80
|
$event('RefreshDocumentList',{documentName:doc.getDocName()})
|
|
75
81
|
}
|
|
76
82
|
|
|
77
|
-
if(id){
|
|
78
|
-
fetchRecord(id);
|
|
79
|
-
}
|
|
80
83
|
|
|
84
|
+
if (id.value) {
|
|
85
|
+
fetchRecord(id.value);
|
|
86
|
+
}else{
|
|
87
|
+
isReadOnly.value=false
|
|
88
|
+
}
|
|
81
89
|
</script>
|
|
82
90
|
<template>
|
|
83
91
|
<SimpleAppForm #default="o" :document="doc" :readonly="isReadOnly">
|
|
84
92
|
<div v-if="isReadOnly" class="w-full">
|
|
85
93
|
<Button
|
|
86
|
-
class="
|
|
94
|
+
class="btn btn-primary" @click="isReadOnly=false"
|
|
87
95
|
type="button" >Edit</Button>
|
|
96
|
+
<Button class="" :disabled="disabled" @click="newData" type="button" v-if="canPerform(doc.getDocName(),'create')">New</Button>
|
|
88
97
|
</div>
|
|
89
98
|
<div v-else class="simpleapp-tool-bar col-span-4 text-left gap-4" >
|
|
90
99
|
<Button class="" :disabled="disabled" @click="newData" type="button" v-if="canPerform(doc.getDocName(),'create')">New</Button>
|
|
91
|
-
<Button class="
|
|
92
|
-
<Button class="
|
|
93
|
-
<Button class="
|
|
100
|
+
<Button class="btn btn-primary" :disabled="disabled" @click="createData" type="button" v-if="canPerform(doc.getDocName(),'create') && doc.isNew()">Create</Button>
|
|
101
|
+
<Button class="btn btn-primary" :disabled="disabled" @click="updateData" type="button" v-if="canPerform(doc.getDocName(),'update') && !doc.isNew()">Update</Button>
|
|
102
|
+
<Button class="btn btn-danger" :disabled="disabled" @click="deleteData($event)" type="button" v-if="canPerform(doc.getDocName(),'delete') && !doc.isNew()">Delete</Button>
|
|
94
103
|
|
|
95
104
|
|
|
96
105
|
<ProgressSpinner v-if="disabled==true" style="width: 2rem; height: 2rem" ></ProgressSpinner>
|
|
97
106
|
<ConfirmPopup></ConfirmPopup>
|
|
98
107
|
</div>
|
|
99
108
|
<div class="grid grid-cols-4 gap-4">
|
|
109
|
+
<% let isautofocus='' %>
|
|
100
110
|
<%Object.keys(it.jsonschema.properties).forEach(function(key) { %>
|
|
101
111
|
|
|
102
112
|
<% let obj=it.jsonschema.properties[key] %>
|
|
103
113
|
<% if(skipcolumns.indexOf(key)>=0){ %>
|
|
104
114
|
<% } else if(obj.type=='boolean'){ %>
|
|
105
|
-
|
|
115
|
+
<%~ getBasicElement('checkbox',`#/properties/${key}`,`data.${key}`) %>
|
|
106
116
|
<% } else if(obj.type=='number' || obj.type=='integer'){ %>
|
|
107
|
-
|
|
117
|
+
<%~ getBasicElement('number',`#/properties/${key}`,`data.${key}`) %>
|
|
108
118
|
<% } else if(obj.type=='array' && obj.items && obj.items.type =='string' ){ %>
|
|
109
|
-
|
|
119
|
+
<%~ getBasicElement('chip',`#/properties/${key}`,`data.${key}`) %>
|
|
110
120
|
<% } else if(obj.type=='object' && typeof obj['x-foreignkey']!='undefined'){ %>
|
|
111
|
-
|
|
112
|
-
v-model="data.<%= key %>" optionLabel="label" :remote-src="getAutocomplete('<%=obj['x-foreignkey']%>')"/>
|
|
121
|
+
<%~ getBasicElement('autocomplete',`#/properties/${key}`,`data.${key}`) %>
|
|
113
122
|
<% } else if(obj.type=='string'){ %>
|
|
114
123
|
<% if(obj.format=='documentno'){ %>
|
|
115
|
-
|
|
124
|
+
<%~ getBasicElement('documentno',`#/properties/${key}`,`data.${key}`) %>
|
|
116
125
|
<% }else if(obj.format=='date'){ %>
|
|
117
|
-
|
|
126
|
+
<%~ getBasicElement('date',`#/properties/${key}`,`data.${key}`) %>
|
|
118
127
|
<% } else if(obj.format=='text'){ %>
|
|
119
|
-
|
|
128
|
+
<%~ getBasicElement('textarea',`#/properties/${key}`,`data.${key}`) %>
|
|
120
129
|
<% } else if(obj.format=='html'){ %>
|
|
121
|
-
|
|
130
|
+
<%~ getBasicElement('textarea',`#/properties/${key}`,`data.${key}`) %>
|
|
122
131
|
<% } else if(obj.format=='email'){ %>
|
|
123
|
-
|
|
132
|
+
<%~ getBasicElement('text',`#/properties/${key}`,`data.${key}`,'email') %>
|
|
124
133
|
<% } else if(obj.enum){ %>
|
|
125
|
-
|
|
134
|
+
<%~ getBasicElement('select',`#/properties/${key}`,`data.${key}`) %>
|
|
126
135
|
<% } else if(obj['anyOf']){ %>
|
|
127
136
|
<% for(let f = 0; f < obj['anyOf'].length; f++){ %>
|
|
128
137
|
<%if(obj['anyOf'][f]['format']){ %>
|
|
129
|
-
|
|
138
|
+
<%~ getBasicElement('text',`#/properties/${key}`,`data.${key}`,obj['anyOf'][f]['format']) %>
|
|
130
139
|
<%}%>
|
|
131
140
|
<%}%>
|
|
132
141
|
<% } else if(obj['oneOf']){ %>
|
|
133
142
|
<% for(let f = 0; f < obj['oneOf'].length; f++){ %>
|
|
134
143
|
<%if(obj['oneOf'][f]['format']){ %>
|
|
135
|
-
|
|
144
|
+
<%~ getBasicElement('text',`#/properties/${key}`,`data.${key}`,obj['oneOf'][f]['format']) %>
|
|
136
145
|
<%}%>
|
|
137
146
|
<%}%>
|
|
138
147
|
|
|
139
148
|
<% } else {%>
|
|
140
|
-
|
|
149
|
+
<%~ getBasicElement('text',`#/properties/${key}`,`data.${key}`) %>
|
|
141
150
|
<% }%>
|
|
142
151
|
<% } else if(obj.type=='object' && obj.properties){ %>
|
|
143
152
|
<SimpleAppValue :setting="o.getField('#/properties/<%= key %>')">
|
|
@@ -148,14 +157,13 @@ if(id){
|
|
|
148
157
|
<% let instancePath=`#/${key}/${skey}` %>
|
|
149
158
|
|
|
150
159
|
<% if(sobj.type=='boolean'){ %>
|
|
151
|
-
|
|
160
|
+
<%~ getBasicElement('checkbox',fieldpath,vmodel) %>
|
|
152
161
|
<% } else if(sobj.type=='number' || sobj.type=='integer'){ %>
|
|
153
|
-
|
|
154
|
-
<% } else if(sobj.type=='array' && sobj.items && sobj.items.type =='string' ){ %>
|
|
155
|
-
|
|
162
|
+
<%~ getBasicElement('number',fieldpath,vmodel) %>
|
|
163
|
+
<% } else if(sobj.type=='array' && sobj.items && sobj.items.type =='string' ){ %>
|
|
164
|
+
<%~ getBasicElement('chip',fieldpath,vmodel) %>
|
|
156
165
|
<% } else if(sobj.type=='object' && typeof sobj['x-foreignkey']!='undefined'){ %>
|
|
157
|
-
|
|
158
|
-
v-model="<%= vmodel %>" optionLabel="label" :remote-src="getAutocomplete('<%=sobj['x-foreignkey']%>')"/>
|
|
166
|
+
<%~ getBasicElement('chip',fieldpath,vmodel) %>
|
|
159
167
|
<% } else if(sobj.type=='string'){ %>
|
|
160
168
|
<% if(sobj.format=='date'){ %>
|
|
161
169
|
<SimpleAppText type="<%=sobj.format%>" instancePath="<%=instancePath%>" autofocus :setting="<%~fieldpath%>" v-model="<%= vmodel %>"/>
|
|
@@ -174,58 +182,34 @@ if(id){
|
|
|
174
182
|
<%})%>
|
|
175
183
|
</SimpleAppValue>
|
|
176
184
|
<% } else if(obj.type=='array' && obj.items.type=='object'){%>
|
|
177
|
-
<SimpleAppInputTable
|
|
185
|
+
<SimpleAppInputTable :getField="o.getField" class="col-span-4"
|
|
178
186
|
:setting="o.getField('#/properties/<%=key%>')" v-model="data.<%=key%>">
|
|
179
187
|
<%let tablefields = Object.keys(obj.items.properties) %>
|
|
180
188
|
<% for(let a=0;a<tablefields.length;a++){%>
|
|
181
189
|
<%let col= tablefields[a] %>
|
|
182
190
|
<% if(skipcolumns.includes(col)){ continue}%>
|
|
183
191
|
<%let subobj = obj.items.properties[col] %>
|
|
184
|
-
<
|
|
192
|
+
<Column field="<%=col%>" #body="{index}" :header="camelCaseToWords('<%=col%>')">
|
|
185
193
|
<%if(subobj['x-foreignkey']){%>
|
|
186
|
-
|
|
187
|
-
:setting="o.getField('#/properties/<%=key%>/items/properties/<%=col%>')"
|
|
188
|
-
:remoteSrc="getAutocomplete('<%=subobj[`x-foreignkey`]%>')"
|
|
189
|
-
optionLabel="label"
|
|
190
|
-
:hidelabel="true"
|
|
191
|
-
:instancePath="`/<%=key%>/${index}/<%=col%>`"/>
|
|
194
|
+
<%~ getBasicElement('autocomplete',`#/properties/${key}/items/properties/${col}`,`data.${key}[index].${col}`,undefined,true,`/${key}/\${index}/${col}`) %>
|
|
192
195
|
<% } else if(subobj.type=='boolean'){%>
|
|
193
|
-
|
|
194
|
-
:setting="o.getField('#/properties/<%=key%>/items/properties/<%=col%>')"
|
|
195
|
-
:hidelabel="true"
|
|
196
|
-
:instancePath="`/<%=key%>/${index}/<%=col%>`"/>
|
|
196
|
+
<%~ getBasicElement('checkbox',`#/properties/${key}/items/properties/${col}`,`data.${key}[index].${col}`,undefined,true,`/${key}/\${index}/${col}`) %>
|
|
197
197
|
<% } else if(subobj.type=='number' || subobj.type=='integer'){%>
|
|
198
|
-
|
|
199
|
-
:setting="o.getField('#/properties/<%=key%>/items/properties/<%=col%>')"
|
|
200
|
-
:hidelabel="true"
|
|
201
|
-
:instancePath="`/<%=key%>/${index}/<%=col%>`"/>
|
|
198
|
+
<%~ getBasicElement('number',`#/properties/${key}/items/properties/${col}`,`data.${key}[index].${col}`,undefined,true,`/${key}/\${index}/${col}`) %>
|
|
202
199
|
<%} else if(subobj.type=='string' && subobj.format){%>
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
:hidelabel="true"
|
|
207
|
-
:instancePath="`/<%=key%>/${index}/<%=col%>`"/>
|
|
208
|
-
<%} else if(subobj.type=='string' && subobj['enum']){%>
|
|
209
|
-
<SimpleAppSelect v-model="data.<%=key%>[index].<%=col%>"
|
|
210
|
-
:setting="o.getField('#/properties/<%=key%>/items/properties/<%=col%>')"
|
|
211
|
-
:hidelabel="true"
|
|
212
|
-
:instancePath="`/<%=key%>/${index}/<%=col%>`"/>
|
|
200
|
+
<%~ getBasicElement('number',`#/properties/${key}/items/properties/${col}`,`data.${key}[index].${col}`,subobj.format,true,`/${key}/\${index}/${col}`) %>
|
|
201
|
+
<%} else if(subobj.type=='string' && subobj['enum']){%>
|
|
202
|
+
<%~ getBasicElement('select',`#/properties/${key}/items/properties/${col}`,`data.${key}[index].${col}`,undefined,true,`/${key}/\${index}/${col}`) %>
|
|
213
203
|
<%} else if(subobj.type=='string' ){%>
|
|
214
|
-
|
|
215
|
-
:setting="o.getField('#/properties/<%=key%>/items/properties/<%=col%>')"
|
|
216
|
-
:hidelabel="true"
|
|
217
|
-
:instancePath="`/<%=key%>/${index}/<%=col%>`"/>
|
|
204
|
+
<%~ getBasicElement('text',`#/properties/${key}/items/properties/${col}`,`data.${key}[index].${col}`,undefined,true,`/${key}/\${index}/${col}`) %>
|
|
218
205
|
<%} else if(subobj.type=='number'){%>
|
|
219
|
-
|
|
220
|
-
:setting="o.getField('#/properties/<%=key%>/items/properties/<%=col%>')"
|
|
221
|
-
:hidelabel="true"
|
|
222
|
-
:instancePath="`/<%=key%>/${index}/<%=col%>`"/>
|
|
206
|
+
<%~ getBasicElement('number',`#/properties/${key}/items/properties/${col}`,`data.${key}[index].${col}`,undefined,true,`/${key}/\${index}/${col}`) %>
|
|
223
207
|
<%}%>
|
|
224
|
-
</
|
|
208
|
+
</Column>
|
|
225
209
|
<%}%>
|
|
226
|
-
<
|
|
210
|
+
<Column #body="{index}" header="Delete">
|
|
227
211
|
<Button class="btn-danger" type="button" @click="data.<%=key%>.splice(index,1)">X</Button>
|
|
228
|
-
</
|
|
212
|
+
</Column>
|
|
229
213
|
</SimpleAppInputTable>
|
|
230
214
|
<% } else{%>
|
|
231
215
|
<!-- Can auto generate <%=obj.key %> -->
|
|
@@ -166,7 +166,6 @@ export class SimpleAppService<T extends { _id?: string }> {
|
|
|
166
166
|
|
|
167
167
|
Object.assign(filterobj, this.getIsolationFilter(appuser));
|
|
168
168
|
let projections = {
|
|
169
|
-
id: `\$_id`,
|
|
170
169
|
label: `\$${this.documentIdentityLabel}`,
|
|
171
170
|
code: `\$${this.documentIdentityCode}`,
|
|
172
171
|
};
|
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
@apply bg-primary-100 block
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
[data-pc-group-section=pagebutton]{
|
|
7
|
+
@apply p-2 m-0 rounded-none border
|
|
8
|
+
}
|
|
9
|
+
[data-pc-section=pagebutton]{
|
|
10
|
+
@apply p-3 m-0 border
|
|
11
|
+
}
|
|
12
|
+
.btn {
|
|
13
|
+
@apply font-medium
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.btn-primary {
|
|
17
|
+
@apply bg-primary-600 hover:bg-primary-400 text-white
|
|
18
|
+
}
|
|
19
|
+
.btn-secondary {
|
|
20
|
+
@apply bg-secondary-600 hover:bg-secondary-400 text-white
|
|
21
|
+
}
|
|
22
|
+
.btn-danger {
|
|
23
|
+
@apply bg-danger-600 hover:bg-danger-400 text-white
|
|
24
|
+
}
|
|
25
|
+
.btn-warn {
|
|
26
|
+
@apply bg-warning-600 hover:bg-warning-400 text-white
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[disabled] ,[readonly]{
|
|
6
30
|
@apply bg-gray-300
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
[aria-selected=true]{
|
|
34
|
+
@apply bg-primary-100
|
|
7
35
|
}
|
|
@@ -5,7 +5,7 @@ import Tailwind from "primevue/passthrough/tailwind";
|
|
|
5
5
|
const CustomTailwind = usePassThrough(
|
|
6
6
|
Tailwind,
|
|
7
7
|
{
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
toast:{
|
|
10
10
|
root:{ class:'w-1/3 '},
|
|
11
11
|
message:{},
|
|
@@ -24,7 +24,13 @@ const CustomTailwind = usePassThrough(
|
|
|
24
24
|
},
|
|
25
25
|
button:{root:{class: 'focus:outline-none transition duration-150 ease-in-out rounded px-8 py-2 m-1 border'}},
|
|
26
26
|
dialog:{root:{class:['border p-2']}},
|
|
27
|
-
|
|
27
|
+
autocomplete:{
|
|
28
|
+
input:{class:'m-0 font-sans text-gray-600 dark:text-white/80 bg-white dark:bg-gray-900 border border-gray-300 dark:border-blue-900/40 rounded-lg rounded-tr-none rounded-br-none transition-colors duration-200 appearance-none hover:border-blue-500 focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[0_0_0_0.2rem_rgba(147,197,253,0.5)] p-3 text-base flex-1'},
|
|
29
|
+
loadingIcon:{class:'animate-spin mt-4 -ml-6 mr-2'},
|
|
30
|
+
dropdownbutton: {
|
|
31
|
+
root:' bg-primary-600 hover:bg-primary-400 text-white rounded flex flex-row p-3 -ml-6 rounded-tl-none rounded-bl-none '
|
|
32
|
+
}
|
|
33
|
+
},
|
|
28
34
|
sidebar:{
|
|
29
35
|
root:{class:'w-1/2 bg-white border p-2 h-full'}
|
|
30
36
|
},
|
|
@@ -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>
|
|
@@ -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,68 +1,56 @@
|
|
|
1
1
|
|
|
2
2
|
<template>
|
|
3
|
-
|
|
4
|
-
<div class="p-inputgroup ">
|
|
5
|
-
<InputText class="
|
|
6
|
-
:
|
|
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
7
|
v-model="modelValue"
|
|
8
8
|
:placeholder="placeholder"
|
|
9
|
-
:path="setting.instancepath"
|
|
10
|
-
:pt="{input:{class:'text-right w-full'}}"
|
|
11
9
|
/>
|
|
12
10
|
<span class="p-inputgroup-addon p p-0">
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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>
|
|
25
28
|
</OverlayPanel>
|
|
26
29
|
</span>
|
|
27
30
|
<!-- {{ Object.getOwnPropertyNames(setting) }} -->
|
|
28
31
|
</div>
|
|
29
|
-
|
|
32
|
+
|
|
30
33
|
</template>
|
|
31
34
|
<script lang="ts" setup>
|
|
32
35
|
import {ForeignKey} from '~/types'
|
|
33
36
|
import OverlayPanel from 'primevue/overlaypanel';
|
|
34
|
-
import {computed,watch,ref} from 'vue'
|
|
35
37
|
import InputText from 'primevue/inputtext';
|
|
36
|
-
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
37
38
|
import {DocNoFormat} from "~/types"
|
|
38
|
-
const
|
|
39
|
+
const props = defineProps<{
|
|
40
|
+
setting:any
|
|
41
|
+
readonly?:boolean
|
|
42
|
+
}>()
|
|
39
43
|
const op = ref();
|
|
40
44
|
const placeholder = ref('')
|
|
41
45
|
const docFormatlist = ref()
|
|
42
46
|
const modelValue = defineModel<string>()
|
|
43
|
-
const docNoFormat =
|
|
44
|
-
|
|
47
|
+
const docNoFormat = props.setting.document.getReactiveData().value.docNoFormat
|
|
48
|
+
const emits = defineEmits(['update:docNoFormat'])
|
|
45
49
|
|
|
46
|
-
const props = withDefaults(defineProps<{
|
|
47
|
-
// docNoFormat:object,
|
|
48
|
-
// docFormatlist?:DocNoFormat[]
|
|
49
|
-
label?:string,
|
|
50
|
-
description?:string,
|
|
51
|
-
setting:any
|
|
52
|
-
error?:string,
|
|
53
|
-
instancepath?:string,
|
|
54
|
-
hidelabel?:boolean,
|
|
55
|
-
|
|
56
|
-
}>(),{
|
|
57
|
-
hidelabel:false
|
|
58
|
-
})
|
|
59
50
|
const documenttype = props.setting.document.doctype
|
|
60
51
|
|
|
61
|
-
|
|
62
52
|
const toggle = async (event:any) => {
|
|
63
|
-
op.value.toggle(event);
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
op.value.toggle(event);
|
|
66
54
|
}
|
|
67
55
|
|
|
68
56
|
const chooseFormat = (item:any) =>{
|
|
@@ -70,6 +58,7 @@ const chooseFormat = (item:any) =>{
|
|
|
70
58
|
const f = item
|
|
71
59
|
docNoFormat.value = { _id : f._id, label : f.docNoFormatName}
|
|
72
60
|
op.value.toggle();
|
|
61
|
+
emits('update:docNoFormat',item)
|
|
73
62
|
}
|
|
74
63
|
|
|
75
64
|
const loadDocFormats = async () =>{
|
|
@@ -77,12 +66,10 @@ const loadDocFormats = async () =>{
|
|
|
77
66
|
if(docFormatlist.value.length>0){
|
|
78
67
|
const f = docFormatlist.value[0]
|
|
79
68
|
docNoFormat.value = { _id : f._id, label : f.docNoFormatName}
|
|
80
|
-
placeholder.value = docFormatlist.value[0].sample
|
|
81
|
-
|
|
69
|
+
placeholder.value = docFormatlist.value[0].sample
|
|
82
70
|
}
|
|
83
71
|
}
|
|
84
72
|
|
|
85
|
-
|
|
86
73
|
onMounted(()=>{
|
|
87
74
|
loadDocFormats()
|
|
88
75
|
|
|
@@ -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();
|