@simitgroup/simpleapp-generator 1.1.26 → 1.1.28
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/framework.d.ts.map +1 -1
- package/dist/framework.js +1 -0
- package/dist/framework.js.map +1 -1
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +9 -2
- package/dist/generate.js.map +1 -1
- package/dist/processors/jsonschemabuilder.d.ts.map +1 -1
- package/dist/processors/jsonschemabuilder.js +3 -4
- package/dist/processors/jsonschemabuilder.js.map +1 -1
- package/package.json +1 -1
- package/src/framework.ts +1 -0
- package/src/generate.ts +11 -2
- package/src/processors/jsonschemabuilder.ts +4 -4
- package/templates/basic/nest/processor.ts.eta +13 -1
- package/templates/basic/nuxt/pages.[id].vue.eta +24 -2
- package/templates/basic/nuxt/pages.form.vue.eta +44 -93
- package/templates/basic/nuxt/pages.viewer.vue.eta +17 -5
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +57 -17
- package/templates/nest/src/simpleapp/generate/commons/middlewares/tenant.middleware.ts.eta +1 -1
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +9 -3
- package/templates/nest/src/simpleapp/profile/profile.controller.ts.eta +22 -0
- package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +4 -0
- package/templates/nuxt/components/header/HeaderBreadcrumb.vue.eta +2 -1
- package/templates/nuxt/components/renderer/RendererDate.vue.eta +2 -2
- package/templates/nuxt/components/renderer/RendererForeignKey.vue.eta +13 -4
- package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +6 -4
- package/templates/nuxt/components/simpleApp/SimpleAppFieldContainer.vue.eta +1 -1
- package/templates/nuxt/components/simpleApp/SimpleAppForm.vue.eta +12 -21
- package/templates/nuxt/components/simpleApp/SimpleAppFormToolBar.vue.eta +106 -0
- package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +128 -106
- package/templates/nuxt/composables/getOpenApi.generate.ts.eta +2 -0
- package/templates/nuxt/composables/refreshDocumentList.generate.ts.eta +1 -0
- package/templates/nuxt/composables/stringHelper.generate.ts.eta +3 -1
- package/templates/nuxt/lang/df.ts.eta +17 -0
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +16 -3
- package/templates/nuxt/types/others.ts.eta +9 -4
- package/templates/nuxt/types/simpleappinput.ts.eta +11 -0
- package/templates/project/lang/default._json +37 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nuxt/lang/df.ts._eta +0 -37
- /package/templates/basic/nuxt/{pages.new.vue.eta → pages.new.vue.etaxxx} +0 -0
- /package/templates/nuxt/components/header/{HeaderBar.vue.eta → HeaderBar.vue._eta} +0 -0
- /package/templates/nuxt/components/header/button/{HeaderButtonMenuPicker.vue.eta → HeaderButtonMenuPicker.vue._eta} +0 -0
- /package/templates/nuxt/layouts/{default.vue.eta → default.vue._eta} +0 -0
|
@@ -2,45 +2,60 @@
|
|
|
2
2
|
<SimpleAppFieldContainer :hidelabel="hidelabel" v-model="modelValue"
|
|
3
3
|
:label="label" :description="description" :pt="pt"
|
|
4
4
|
:setting="setting" :instancepath="instancepath" :error="error" #default="slotprops">
|
|
5
|
-
|
|
6
|
-
<component :is="inputComponent" :readonly="isReadonly" :pt="pt"
|
|
7
|
-
v-if="[SimpleAppInputType.checkbox,SimpleAppInputType.switch ].includes(inputType)"
|
|
5
|
+
<Checkbox v-if="inputType ==SimpleAppInputType.checkbox" :readonly="isReadonly" :pt="pt"
|
|
8
6
|
:inputId="slotprops.uuid" :path="setting.instancepath"
|
|
9
7
|
v-model="modelValue" :binary="true"
|
|
10
|
-
v-bind="componentProps"/>
|
|
8
|
+
v-bind="(componentProps as CheckboxProps)"/>
|
|
9
|
+
<InputSwitch v-else-if="inputType ==SimpleAppInputType.switch" :readonly="isReadonly" :pt="pt"
|
|
10
|
+
:inputId="slotprops.uuid" :path="setting.instancepath"
|
|
11
|
+
v-model="modelValue as boolean" :binary="true"
|
|
12
|
+
v-bind="(componentProps as InputSwitchProps)"/>
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
<component :is="inputComponent" type="date" :pt="pt"
|
|
14
|
+
<InputText type="date" :pt="pt"
|
|
14
15
|
v-else-if="inputType == SimpleAppInputType.date"
|
|
15
16
|
:inputId="slotprops.uuid" :path="setting.instancepath"
|
|
16
|
-
v-model="datevalue" @update:modelValue="updateDate" :readonly="isReadonly"
|
|
17
|
-
|
|
17
|
+
v-model="(datevalue as string)" @update:modelValue="updateDate" :readonly="isReadonly"
|
|
18
|
+
:placeholder="placeholder"
|
|
19
|
+
v-bind="(componentProps as InputTextProps)"/>
|
|
18
20
|
<!-- calendar component -->
|
|
19
|
-
<
|
|
21
|
+
<Calendar type="date" :pt="pt" class="flex flex-col"
|
|
20
22
|
v-else-if="SimpleAppInputType.calendar==inputType"
|
|
21
23
|
:inputId="slotprops.uuid" :path="setting.instancepath"
|
|
22
|
-
v-model="datevalue" @update:modelValue="updateDate" :readonly="isReadonly"
|
|
23
|
-
|
|
24
|
+
v-model="(datevalue as string)" @update:modelValue="updateDate" :readonly="isReadonly"
|
|
25
|
+
:placeholder="placeholder"
|
|
26
|
+
v-bind="(componentProps as CalendarProps)"/>
|
|
24
27
|
<!-- time component -->
|
|
25
|
-
<
|
|
28
|
+
<InputText :pt="pt"
|
|
26
29
|
v-else-if="inputType == SimpleAppInputType.time"
|
|
27
30
|
:inputId="slotprops.uuid" :path="setting.instancepath"
|
|
28
|
-
v-model="modelValue" :readonly="isReadonly"
|
|
29
|
-
|
|
31
|
+
v-model="(modelValue as string)" :readonly="isReadonly"
|
|
32
|
+
:placeholder="placeholder"
|
|
33
|
+
v-bind="(componentProps as InputTextProps)"/>
|
|
30
34
|
<!-- select/list component -->
|
|
31
|
-
<
|
|
32
|
-
v-else-if="
|
|
35
|
+
<Listbox v-model="modelValue" :pt="pt"
|
|
36
|
+
v-else-if="SimpleAppInputType.list==inputType"
|
|
37
|
+
:inputId="slotprops.uuid" :path="setting.instancepath"
|
|
38
|
+
:readonly="isReadonly"
|
|
39
|
+
class="w w-full lg:w-full"
|
|
40
|
+
:disabled="isReadonly"
|
|
41
|
+
:options="getListOptions()" optionLabel="label" optionValue="value"
|
|
42
|
+
:placeholder="placeholder"
|
|
43
|
+
v-bind="(componentProps as ListboxProps)"/>
|
|
44
|
+
|
|
45
|
+
<Dropdown v-model="modelValue" :pt="pt"
|
|
46
|
+
v-else-if="SimpleAppInputType.select == inputType"
|
|
33
47
|
:inputId="slotprops.uuid" :path="setting.instancepath"
|
|
34
48
|
:readonly="isReadonly"
|
|
35
49
|
class="w w-full lg:w-full"
|
|
36
50
|
:disabled="isReadonly"
|
|
37
51
|
:options="getListOptions()" optionLabel="label" optionValue="value"
|
|
52
|
+
:placeholder="placeholder"
|
|
38
53
|
v-bind="componentProps"/>
|
|
39
54
|
|
|
40
55
|
<!-- radio component -->
|
|
41
56
|
<div v-else-if="inputType == SimpleAppInputType.radio" >
|
|
42
57
|
<div v-for="(item,index) in getListOptions()">
|
|
43
|
-
<
|
|
58
|
+
<RadioButton :pt="pt" v-model="modelValue"
|
|
44
59
|
:inputId="setting.key+'-'+index" name="smaple" :value="item.value"
|
|
45
60
|
:readonly="isReadonly"
|
|
46
61
|
/> {{ ' ' }}
|
|
@@ -50,66 +65,72 @@
|
|
|
50
65
|
|
|
51
66
|
<!-- autocomplete, need do more enterprise grade component-->
|
|
52
67
|
<SimpleAppAutocomplete v-else-if="inputType==SimpleAppInputType.autocomplete"
|
|
53
|
-
v-model="modelValue"
|
|
68
|
+
v-model="(modelValue as autocompletetype)"
|
|
54
69
|
:pt="pt"
|
|
55
70
|
:setting="setting"
|
|
56
71
|
:disabled="isReadonly"
|
|
57
72
|
:inputId="slotprops.uuid"
|
|
58
73
|
:path="setting.instancepath"
|
|
59
74
|
:readonly="isReadonly"
|
|
75
|
+
:placeholder="placeholder"
|
|
60
76
|
/>
|
|
61
77
|
<!-- v-bind:attributes="componentProps" -->
|
|
62
78
|
<!-- document no input-->
|
|
63
79
|
<SimpleAppDocumentNo v-else-if="inputType == SimpleAppInputType.documentno"
|
|
64
|
-
:setting="setting" v-model="modelValue" :inputId="slotprops.uuid"
|
|
80
|
+
:setting="setting" v-model="(modelValue as string)" :inputId="slotprops.uuid"
|
|
65
81
|
:readonly="isReadonly" @update:docNoFormat="triggerDocNoFormatChange"
|
|
66
82
|
:pt="pt"
|
|
67
83
|
:path="setting.instancepath"
|
|
68
|
-
v-bind
|
|
84
|
+
v-bind="(componentProps as any)"/>
|
|
85
|
+
<!-- use componentProps as any at the moment, no ideal yet, and for compatibility -->
|
|
69
86
|
|
|
70
87
|
|
|
71
88
|
<!-- password -->
|
|
72
|
-
<
|
|
89
|
+
<Password
|
|
73
90
|
v-else-if="inputType == SimpleAppInputType.password"
|
|
74
|
-
:type="type" v-model="modelValue" :pt="pt"
|
|
91
|
+
:type="type" v-model="(modelValue as string)" :pt="pt"
|
|
75
92
|
:readonly="isReadonly" class="flex flex-col"
|
|
76
93
|
:inputId="slotprops.uuid" :path="setting.instancepath"
|
|
77
|
-
|
|
94
|
+
:placeholder="placeholder"
|
|
95
|
+
v-bind="(componentProps as PasswordProps)"/>
|
|
78
96
|
|
|
79
97
|
<!-- rating -->
|
|
80
|
-
<
|
|
81
|
-
:type="type" v-model="modelValue" :pt="pt"
|
|
98
|
+
<Rating v-else-if="inputType == SimpleAppInputType.rating"
|
|
99
|
+
:type="type" v-model="(modelValue as number)" :pt="pt"
|
|
82
100
|
:readonly="isReadonly"
|
|
83
101
|
:inputId="slotprops.uuid" :path="setting.instancepath"
|
|
84
|
-
v-bind="componentProps"/>
|
|
102
|
+
v-bind="(componentProps as RatingProps)"/>
|
|
85
103
|
|
|
86
104
|
<!-- chip -->
|
|
87
|
-
<
|
|
88
|
-
|
|
105
|
+
<Chips v-else-if="inputType == SimpleAppInputType.chip"
|
|
106
|
+
:type="type" v-model="(modelValue as string[])"
|
|
89
107
|
:pt="pt"
|
|
90
108
|
:disabled="isReadonly"
|
|
91
109
|
:inputId="slotprops.uuid" :path="setting.instancepath"
|
|
92
|
-
|
|
110
|
+
:placeholder="placeholder"
|
|
111
|
+
v-bind="(componentProps as ChipsProps)"
|
|
93
112
|
/>
|
|
94
113
|
<!-- simple component -->
|
|
95
|
-
<InputNumber v-else-if="inputType == SimpleAppInputType.number"
|
|
96
|
-
:type="type" v-model="modelValue"
|
|
114
|
+
<InputNumber v-else-if="inputType == SimpleAppInputType.number"
|
|
115
|
+
:type="type" v-model="(modelValue as number)"
|
|
97
116
|
:readonly="isReadonly"
|
|
98
117
|
:pt="pt"
|
|
99
118
|
:class="!pt ? 'w-full flex flex-col' :''"
|
|
100
119
|
:inputId="slotprops.uuid" :path="setting.instancepath"
|
|
101
|
-
v-bind="componentProps"
|
|
120
|
+
v-bind="(componentProps as InputNumber)"
|
|
121
|
+
:placeholder="placeholder"
|
|
102
122
|
/>
|
|
103
123
|
|
|
104
|
-
<
|
|
105
|
-
v-model="modelValue"
|
|
106
|
-
:is="inputComponent"
|
|
124
|
+
<InputText v-else
|
|
125
|
+
v-model="(modelValue as string)"
|
|
107
126
|
:readonly="isReadonly"
|
|
108
127
|
:pt="pt"
|
|
109
128
|
:type="type"
|
|
110
129
|
class="w-full flex flex-col"
|
|
111
|
-
:inputId="slotprops.uuid"
|
|
112
|
-
|
|
130
|
+
:inputId="slotprops.uuid"
|
|
131
|
+
:path="setting.instancepath"
|
|
132
|
+
:placeholder="placeholder"
|
|
133
|
+
v-bind="(componentProps as InputTextProps)"
|
|
113
134
|
/>
|
|
114
135
|
|
|
115
136
|
|
|
@@ -119,6 +140,7 @@
|
|
|
119
140
|
</template>
|
|
120
141
|
|
|
121
142
|
<script lang="ts" setup>
|
|
143
|
+
import {autocompletetype} from '~/types'
|
|
122
144
|
import moment from 'moment'
|
|
123
145
|
import AutoComplete,{ AutoCompleteProps } from 'primevue/autocomplete';
|
|
124
146
|
import Calendar,{ CalendarProps } from 'primevue/calendar';
|
|
@@ -140,17 +162,9 @@ import Textarea, { TextareaProps } from 'primevue/textarea';
|
|
|
140
162
|
import {SimpleAppInputType} from '~/types'
|
|
141
163
|
|
|
142
164
|
|
|
143
|
-
let inputComponent :Component
|
|
144
|
-
|
|
145
|
-
|
|
146
165
|
const datevalue = ref('')
|
|
147
166
|
const modelValue = defineModel()
|
|
148
167
|
|
|
149
|
-
if(modelValue.value){
|
|
150
|
-
datevalue.value = moment(modelValue.value as string ).format('YYYY-MM-DD')
|
|
151
|
-
}else{
|
|
152
|
-
datevalue.value = ''
|
|
153
|
-
}
|
|
154
168
|
const props = withDefaults( defineProps<{
|
|
155
169
|
inputType:SimpleAppInputType,
|
|
156
170
|
label?:string,
|
|
@@ -162,72 +176,80 @@ const props = withDefaults( defineProps<{
|
|
|
162
176
|
hidelabel?: boolean
|
|
163
177
|
readonly?: boolean
|
|
164
178
|
pt?:any,
|
|
179
|
+
placeholder?:string
|
|
165
180
|
componentProps?: InputNumberProps | InputSwitchProps | InputTextProps | TextareaProps | DropdownProps | CalendarProps | RatingProps
|
|
166
181
|
|
|
167
182
|
}>(),{type:'text'})
|
|
168
183
|
|
|
169
184
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
case SimpleAppInputType.textarea:
|
|
175
|
-
inputComponent = Textarea
|
|
176
|
-
break;
|
|
177
|
-
case SimpleAppInputType.number:
|
|
178
|
-
inputComponent = InputNumber
|
|
179
|
-
break
|
|
180
|
-
case SimpleAppInputType.date:
|
|
181
|
-
inputComponent = InputText
|
|
182
|
-
break;
|
|
183
|
-
case SimpleAppInputType.time:
|
|
184
|
-
inputComponent = InputText
|
|
185
|
-
break;
|
|
186
|
-
case SimpleAppInputType.calendar:
|
|
187
|
-
inputComponent = Calendar
|
|
188
|
-
break;
|
|
189
|
-
case SimpleAppInputType.autocomplete:
|
|
190
|
-
inputComponent = AutoComplete
|
|
191
|
-
break;
|
|
192
|
-
case SimpleAppInputType.autocompletemultiple: //*
|
|
193
|
-
inputComponent = AutoComplete
|
|
194
|
-
break;
|
|
195
|
-
case SimpleAppInputType.selectmultiple: //*
|
|
196
|
-
inputComponent = MultiSelect
|
|
197
|
-
break;
|
|
198
|
-
case SimpleAppInputType.listmultiple: //*
|
|
199
|
-
break;
|
|
200
|
-
case SimpleAppInputType.radio: //*
|
|
201
|
-
inputComponent = RadioButton
|
|
202
|
-
break;
|
|
203
|
-
case SimpleAppInputType.select: //*
|
|
204
|
-
inputComponent = Dropdown
|
|
205
|
-
break;
|
|
206
|
-
case SimpleAppInputType.list: //*
|
|
207
|
-
inputComponent = Listbox
|
|
208
|
-
break;
|
|
209
|
-
case SimpleAppInputType.chip: //*
|
|
210
|
-
inputComponent = Chips
|
|
211
|
-
break;
|
|
212
|
-
case SimpleAppInputType.checkbox:
|
|
213
|
-
inputComponent = Checkbox
|
|
214
|
-
break;
|
|
215
|
-
case SimpleAppInputType.switch:
|
|
216
|
-
inputComponent = InputSwitch
|
|
217
|
-
break;
|
|
218
|
-
case SimpleAppInputType.documentno: //*
|
|
219
|
-
break;
|
|
220
|
-
case SimpleAppInputType.password:
|
|
221
|
-
inputComponent = Password
|
|
222
|
-
break;
|
|
223
|
-
case SimpleAppInputType.rating:
|
|
224
|
-
inputComponent = Rating
|
|
225
|
-
break;
|
|
226
|
-
case SimpleAppInputType.slider:
|
|
227
|
-
inputComponent = Slider
|
|
228
|
-
break;
|
|
229
|
-
|
|
185
|
+
if(props.inputType== SimpleAppInputType.date && modelValue.value){
|
|
186
|
+
datevalue.value = moment(modelValue.value as string ).format('YYYY-MM-DD')
|
|
187
|
+
}else{
|
|
188
|
+
datevalue.value = ''
|
|
230
189
|
}
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
// switch(props.inputType){
|
|
193
|
+
// case SimpleAppInputType.text:
|
|
194
|
+
// inputComponent = InputText
|
|
195
|
+
// break;
|
|
196
|
+
// case SimpleAppInputType.textarea:
|
|
197
|
+
// inputComponent = Textarea
|
|
198
|
+
// break;
|
|
199
|
+
// case SimpleAppInputType.number:
|
|
200
|
+
// inputComponent = InputNumber
|
|
201
|
+
// break
|
|
202
|
+
// case SimpleAppInputType.date:
|
|
203
|
+
// inputComponent = InputText
|
|
204
|
+
// break;
|
|
205
|
+
// case SimpleAppInputType.time:
|
|
206
|
+
// inputComponent = InputText
|
|
207
|
+
// break;
|
|
208
|
+
// case SimpleAppInputType.calendar:
|
|
209
|
+
// inputComponent = Calendar
|
|
210
|
+
// break;
|
|
211
|
+
// case SimpleAppInputType.autocomplete:
|
|
212
|
+
// inputComponent = AutoComplete
|
|
213
|
+
// break;
|
|
214
|
+
// case SimpleAppInputType.autocompletemultiple: //*
|
|
215
|
+
// inputComponent = AutoComplete
|
|
216
|
+
// break;
|
|
217
|
+
// case SimpleAppInputType.selectmultiple: //*
|
|
218
|
+
// inputComponent = MultiSelect
|
|
219
|
+
// break;
|
|
220
|
+
// case SimpleAppInputType.listmultiple: //*
|
|
221
|
+
// break;
|
|
222
|
+
// case SimpleAppInputType.radio: //*
|
|
223
|
+
// inputComponent = RadioButton
|
|
224
|
+
// break;
|
|
225
|
+
// case SimpleAppInputType.select: //*
|
|
226
|
+
// inputComponent = Dropdown
|
|
227
|
+
// break;
|
|
228
|
+
// case SimpleAppInputType.list: //*
|
|
229
|
+
// inputComponent = Listbox
|
|
230
|
+
// break;
|
|
231
|
+
// case SimpleAppInputType.chip: //*
|
|
232
|
+
// inputComponent = Chips
|
|
233
|
+
// break;
|
|
234
|
+
// case SimpleAppInputType.checkbox:
|
|
235
|
+
// inputComponent = Checkbox
|
|
236
|
+
// break;
|
|
237
|
+
// case SimpleAppInputType.switch:
|
|
238
|
+
// inputComponent = InputSwitch
|
|
239
|
+
// break;
|
|
240
|
+
// case SimpleAppInputType.documentno: //*
|
|
241
|
+
// break;
|
|
242
|
+
// case SimpleAppInputType.password:
|
|
243
|
+
// inputComponent = Password
|
|
244
|
+
// break;
|
|
245
|
+
// case SimpleAppInputType.rating:
|
|
246
|
+
// inputComponent = Rating
|
|
247
|
+
// break;
|
|
248
|
+
// case SimpleAppInputType.slider:
|
|
249
|
+
// inputComponent = Slider
|
|
250
|
+
// break;
|
|
251
|
+
|
|
252
|
+
// }
|
|
231
253
|
const isReadonly = computed(()=>{
|
|
232
254
|
if(props.readonly){
|
|
233
255
|
return props.readonly
|
|
@@ -267,7 +289,7 @@ const getListOptions = () =>{
|
|
|
267
289
|
const emits = defineEmits(['change','update:modelValue','update:docNoFormat'])
|
|
268
290
|
|
|
269
291
|
watch(modelValue ,(newvalue:any)=>{
|
|
270
|
-
|
|
292
|
+
|
|
271
293
|
if([SimpleAppInputType.date,SimpleAppInputType.calendar].includes(props.inputType)){
|
|
272
294
|
if(modelValue.value){
|
|
273
295
|
datevalue.value = moment(modelValue.value as string ).format('YYYY-MM-DD')
|
|
@@ -16,6 +16,8 @@ const getAxiosConfig = () => {
|
|
|
16
16
|
};
|
|
17
17
|
return config
|
|
18
18
|
}
|
|
19
|
+
export const getApiSession = async ()=> await (new o.PROFILEApi(getAxiosConfig())).getSession()
|
|
20
|
+
|
|
19
21
|
export const getDocumentApi = (documentName: string): any => {
|
|
20
22
|
//const { csrf } = useCsrf()
|
|
21
23
|
//axios.defaults.headers.common = {"CSRF-TOKEN": csrf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const refreshDocumentList = (docName:string)=>useNuxtApp().$event('RefreshDocumentList',{documentName:docName})
|
|
@@ -17,4 +17,6 @@ export const getAvatarLink = (email:string, size:number):string=>{
|
|
|
17
17
|
export const toLocalDate = (dateiso8601:string)=> new Date(String(dateiso8601)).toLocaleDateString()
|
|
18
18
|
export const t = (txt:string,options?:any):string => useNuxtApp().$i18n.t(txt,options)
|
|
19
19
|
export const today = () => moment().format('YYYY-MM-DD')
|
|
20
|
-
|
|
20
|
+
export const dateToString = (date:Date) => moment(date).format('YYYY-MM-DD')
|
|
21
|
+
export const getMoment = (startTime:string)=> moment(startTime)
|
|
22
|
+
export const lastDateOfMonth = (datestr:string) => moment(datestr).endOf('month').format('YYYY-MM-DD');
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
|
|
3
|
+
//auto generate from lang/default.ts
|
|
4
|
+
<%let langkeys = Object.keys(it.lang) %>
|
|
5
|
+
<% for(let l=0; l< langkeys.length; l++){ %>
|
|
6
|
+
<% let key = langkeys[l] %>
|
|
7
|
+
<%=key%> : '<%= it.lang[key] %>',
|
|
8
|
+
<%}%>
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
//auto generate from schema
|
|
12
|
+
<% for(let i=0; i< it.allfields.length; i++){ %>
|
|
13
|
+
<% let f = it.allfields[i] %>
|
|
14
|
+
<%=f%> : '<%= camelCaseToWords(f) %>',
|
|
15
|
+
<%}%>
|
|
16
|
+
|
|
17
|
+
}
|
|
@@ -10,7 +10,7 @@ import addErrors from 'ajv-errors';
|
|
|
10
10
|
import { ref } from 'vue';
|
|
11
11
|
import type { Ref } from 'vue';
|
|
12
12
|
import type { AxiosResponse } from 'axios';
|
|
13
|
-
import {SearchBody,Notification,NotificationStatus,SchemaType} from '~/types'
|
|
13
|
+
import {SearchBody,Notification,NotificationStatus,SchemaType,FormActions} from '~/types'
|
|
14
14
|
|
|
15
15
|
// import { useToast, } from 'primevue/usetoast';
|
|
16
16
|
// import type { ToastMessageOptions } from 'primevue/toast';
|
|
@@ -37,6 +37,7 @@ export class SimpleAppClient<
|
|
|
37
37
|
protected docname = '';
|
|
38
38
|
protected errorlist = ref({});
|
|
39
39
|
protected completeformula = true;
|
|
40
|
+
|
|
40
41
|
constructor(apiobj: TApi,doctype:string,docname:string) {
|
|
41
42
|
this.docapi = apiobj;
|
|
42
43
|
this.doctype=doctype
|
|
@@ -54,12 +55,13 @@ export class SimpleAppClient<
|
|
|
54
55
|
getApi = () =>this.docapi;
|
|
55
56
|
getReactiveData = () => this.data;
|
|
56
57
|
public reCalculateValue (){}
|
|
58
|
+
public isReadOnly():boolean{return false} //if there is readonly attribute in data, will override it at processor and client
|
|
57
59
|
setData = (data: any) => {
|
|
58
60
|
// this.data.value = data;
|
|
59
61
|
Object.assign(this.data.value, data);
|
|
60
62
|
};
|
|
61
63
|
|
|
62
|
-
async getById(id
|
|
64
|
+
async getById(id?: string) {
|
|
63
65
|
return await this.docapi.runFindOne(id,{timeout:this.defaultTimeOut})
|
|
64
66
|
.then((res: AxiosResponse) => {
|
|
65
67
|
// if(this.event){this.event('info:getById',res.data)}
|
|
@@ -152,7 +154,10 @@ export class SimpleAppClient<
|
|
|
152
154
|
});
|
|
153
155
|
}
|
|
154
156
|
}
|
|
155
|
-
async delete(id
|
|
157
|
+
async delete(id?: string) {
|
|
158
|
+
if(!id){
|
|
159
|
+
id = this.data.value._id ?? ''
|
|
160
|
+
}
|
|
156
161
|
const {$event} =useNuxtApp()
|
|
157
162
|
return await this.docapi.runDelete(id,{timeout:this.defaultTimeOut})
|
|
158
163
|
.then((res:AxiosResponse)=>{
|
|
@@ -233,4 +238,12 @@ export class SimpleAppClient<
|
|
|
233
238
|
}
|
|
234
239
|
}
|
|
235
240
|
|
|
241
|
+
public getActions():FormActions{
|
|
242
|
+
const data:FormActions = {
|
|
243
|
+
crud:['new','create','update','delete',],
|
|
244
|
+
docstatus:[],
|
|
245
|
+
api:[]
|
|
246
|
+
}
|
|
247
|
+
return data
|
|
248
|
+
}
|
|
236
249
|
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
|
|
1
2
|
import {SimpleAppClient} from '~/simpleapp/generate/clients/SimpleAppClient'
|
|
2
3
|
import {CellSetting} from './documentlist'
|
|
3
4
|
import { Component } from 'vue'
|
|
5
|
+
|
|
6
|
+
export type ForeignKey = {
|
|
7
|
+
_id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
code?: string
|
|
10
|
+
[key:string]: any
|
|
11
|
+
};
|
|
12
|
+
|
|
4
13
|
export type DocumentMetaData = {
|
|
5
14
|
docName:string
|
|
6
15
|
docType:string
|
|
@@ -28,10 +37,6 @@ import { Component } from 'vue'
|
|
|
28
37
|
sample:string
|
|
29
38
|
}
|
|
30
39
|
|
|
31
|
-
export type ForeignKey = {
|
|
32
|
-
_id : string
|
|
33
|
-
label: string
|
|
34
|
-
}
|
|
35
40
|
|
|
36
41
|
|
|
37
42
|
export type SearchBody = {
|
|
@@ -38,4 +38,15 @@ export type autocompletetype={
|
|
|
38
38
|
label:string
|
|
39
39
|
code:string
|
|
40
40
|
[key:string]:any
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type FormActions = {
|
|
44
|
+
[key:string]:string[]
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type FormMenu = {
|
|
48
|
+
type:string
|
|
49
|
+
action:string
|
|
50
|
+
label:string
|
|
51
|
+
command? : Function
|
|
41
52
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"welcome": "Welcome",
|
|
3
|
+
"create": "Create",
|
|
4
|
+
"update": "Update",
|
|
5
|
+
"delete": "Delete",
|
|
6
|
+
"modify": "Modify",
|
|
7
|
+
"confirm": "Confirm",
|
|
8
|
+
"void": "Void",
|
|
9
|
+
"draft": "Draft",
|
|
10
|
+
"profile": "Profile",
|
|
11
|
+
"logout": "logout",
|
|
12
|
+
"language": "Language",
|
|
13
|
+
"theme": "Theme",
|
|
14
|
+
"welcomeSimpleApp": "Welcome To SimpleApp",
|
|
15
|
+
"changeHomePageMsg": "{fullName}, it is product front page and by right you shall replace it with something else.",
|
|
16
|
+
"realman": "Real man code with simpleapp",
|
|
17
|
+
"new": "New",
|
|
18
|
+
"keyword": "Keyword",
|
|
19
|
+
"empty": "Empty",
|
|
20
|
+
"noDataFound": "No Data Found",
|
|
21
|
+
"userInfo": "User Information",
|
|
22
|
+
"currentBranchAccessRights": "Current Branch Access Rights",
|
|
23
|
+
"yourCompanyName": "Your Company Name",
|
|
24
|
+
"onlyAppearInDebugMode": "Only Appear In Debug Mode",
|
|
25
|
+
"pickDocument": "Pick Document",
|
|
26
|
+
"sample": "Sample",
|
|
27
|
+
"createYourContentHere": "Create your content here",
|
|
28
|
+
"setting": "Setting",
|
|
29
|
+
"mytasks": "My Tasks",
|
|
30
|
+
"suspend": "Suspend",
|
|
31
|
+
"submit": "Submit",
|
|
32
|
+
"decision": "Decision",
|
|
33
|
+
"simpleApproveMessage": "Approve or reject",
|
|
34
|
+
"suspendcustomer": "Suspend Customer",
|
|
35
|
+
"formKeyNotFound": "Formkey not found \"{formKey}\"",
|
|
36
|
+
"selectAll": "Select All"
|
|
37
|
+
}
|