@simitgroup/simpleapp-generator 1.0.63 → 1.0.64
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.js +3 -3
- 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 +3 -3
- 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 +11 -16
- package/templates/basic/nuxt/{pages.crud.vue.eta → pages.new.vue.eta} +22 -9
- 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 -8
- 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 +4 -0
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +2 -1
- package/templates/nuxt/components/{SimpleAppDatatable.vue.eta → DocumentDatatable.vue.eta} +15 -63
- package/templates/nuxt/components/ListView.vue.eta +38 -26
- package/templates/nuxt/components/UserProfileListItem.vue.eta +1 -1
- package/templates/nuxt/components/{EventNotification.vue.eta → event/EventNotification.vue.eta} +1 -1
- 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/renderer/RendererForeignKey.vue.eta +11 -0
- package/templates/nuxt/components/renderer/index.ts.eta +12 -0
- package/templates/nuxt/components/{SimpleAppAutocomplete.vue.eta → simpleApp/SimpleAppAutocomplete.vue.eta} +13 -1
- package/templates/nuxt/components/{SimpleAppAutocompletemulti.vue.eta → simpleApp/SimpleAppAutocompletemulti.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppCalendar.vue.eta → simpleApp/SimpleAppCalendar.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppCheckbox.vue.eta → simpleApp/SimpleAppCheckbox.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppChip.vue.eta → simpleApp/SimpleAppChip.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppColor.vue.eta → simpleApp/SimpleAppColor.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppDocumentNo.vue.eta → simpleApp/SimpleAppDocumentNo.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppEditor.vue.eta → simpleApp/SimpleAppEditor.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppList.vue.eta → simpleApp/SimpleAppList.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppListmulti.vue.eta → simpleApp/SimpleAppListmulti.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppNumber.vue.eta → simpleApp/SimpleAppNumber.vue.eta} +12 -1
- package/templates/nuxt/components/{SimpleAppPassword.vue.eta → simpleApp/SimpleAppPassword.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppRadio.vue.eta → simpleApp/SimpleAppRadio.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppRating.vue.eta → simpleApp/SimpleAppRating.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppSelect.vue.eta → simpleApp/SimpleAppSelect.vue.eta} +12 -2
- package/templates/nuxt/components/{SimpleAppSelectmulti.vue.eta → simpleApp/SimpleAppSelectmulti.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppSlider.vue.eta → simpleApp/SimpleAppSlider.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppSwitch.vue.eta → simpleApp/SimpleAppSwitch.vue.eta} +1 -1
- package/templates/nuxt/components/{SimpleAppText.vue.eta → simpleApp/SimpleAppText.vue.eta} +13 -2
- package/templates/nuxt/components/{SimpleAppTextarea.vue.eta → simpleApp/SimpleAppTextarea.vue.eta} +13 -2
- package/templates/nuxt/composables/getMenus.generate.ts.eta +4 -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/documentlist.vue.eta +23 -7
- package/templates/nuxt/layouts/sidelist.vue.eta +68 -0
- 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 +216 -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 +145 -0
- package/templates/nuxt/pages/[xorg]/organization.vue.eta +130 -0
- package/templates/nuxt/pages/[xorg]/user/index.vue.eta +28 -33
- package/templates/nuxt/pages/[xorg]/user.vue.eta +3 -3
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +6 -0
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +1 -1
- package/templates/nuxt/types/documentlist.ts.eta +2 -2
- package/templates/project/jsonschemas/category.json._eta +2 -2
- package/templates/project/jsonschemas/customer.json._eta +2 -2
- package/templates/project/jsonschemas/invoice.json._eta +4 -4
- package/templates/project/jsonschemas/product.json._eta +2 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nuxt/components/renderers/ForeignKeyRender.vue.eta +0 -10
- package/templates/nuxt/pages/[xorg]/organization/index.vue.eta +0 -168
- /package/templates/nuxt/components/{DebugDocumentData.vue.eta → debug/DebugDocumentData.vue.eta} +0 -0
- /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/SimpleAppDynamicInput.vue.eta} +0 -0
- /package/templates/nuxt/components/{SimpleFieldContainer.vue.eta → simpleApp/SimpleAppFieldContainer.vue.eta} +0 -0
- /package/templates/nuxt/components/{SimpleAppForm.vue.eta → simpleApp/SimpleAppForm.vue.eta} +0 -0
- /package/templates/nuxt/components/{SimpleAppInputTable.vue.eta → simpleApp/SimpleAppInputTable.vue.eta} +0 -0
- /package/templates/nuxt/components/{SimpleAppValue.vue.eta → simpleApp/SimpleAppValue.vue.eta} +0 -0
- /package/templates/nuxt/components/{helper.ts.eta → simpleApp/helper.ts.eta} +0 -0
- /package/templates/nuxt/components/{type.ts.eta → simpleApp/type.ts.eta} +0 -0
package/templates/nuxt/components/{SimpleAppNumber.vue.eta → simpleApp/SimpleAppNumber.vue.eta}
RENAMED
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
v-model="modelValue"
|
|
7
7
|
:path="setting.instancepath"
|
|
8
8
|
:pt="{input:{class:'text-right w-full'}}"
|
|
9
|
+
:readonly="isReadonly"
|
|
9
10
|
></InputNumber>
|
|
10
11
|
</FieldContainer>
|
|
11
12
|
</template>
|
|
12
13
|
<script lang="ts" setup>
|
|
13
14
|
import {computed,watch,ref} from 'vue'
|
|
14
15
|
import InputNumber from 'primevue/inputnumber';
|
|
15
|
-
import FieldContainer from './
|
|
16
|
+
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
16
17
|
const props = withDefaults(defineProps<{
|
|
17
18
|
label?:string,
|
|
18
19
|
description?:string,
|
|
@@ -20,11 +21,21 @@ const props = withDefaults(defineProps<{
|
|
|
20
21
|
error?:string,
|
|
21
22
|
instancepath?:string,
|
|
22
23
|
hidelabel?:boolean
|
|
24
|
+
readonly?:boolean
|
|
23
25
|
}>(),{
|
|
24
26
|
hidelabel:false
|
|
25
27
|
})
|
|
26
28
|
const emit = defineEmits(['change'])
|
|
27
29
|
const modelValue =defineModel()
|
|
30
|
+
const isReadonly = computed(()=>{
|
|
31
|
+
if(props.readonly){
|
|
32
|
+
return props.readonly
|
|
33
|
+
}else if(props.setting.readonly){
|
|
34
|
+
return props.setting.readonly
|
|
35
|
+
}else{
|
|
36
|
+
return false
|
|
37
|
+
}
|
|
38
|
+
})
|
|
28
39
|
watch(modelValue,()=>{
|
|
29
40
|
// props.setting.document.validateFailed()
|
|
30
41
|
emit('change',modelValue)
|
package/templates/nuxt/components/{SimpleAppPassword.vue.eta → simpleApp/SimpleAppPassword.vue.eta}
RENAMED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<script lang="ts" setup>
|
|
14
14
|
import {computed,watch,ref} from 'vue'
|
|
15
15
|
import Password from 'primevue/password';
|
|
16
|
-
import FieldContainer from './
|
|
16
|
+
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
17
17
|
const modelValue = defineModel()
|
|
18
18
|
const props = defineProps<{
|
|
19
19
|
label?:string,
|
package/templates/nuxt/components/{SimpleAppRadio.vue.eta → simpleApp/SimpleAppRadio.vue.eta}
RENAMED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
<script lang="ts" setup>
|
|
23
23
|
import RadioButton from 'primevue/radiobutton';
|
|
24
|
-
import FieldContainer from './
|
|
24
|
+
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
25
25
|
import {prepareList,simpleArrayToObject} from './helper'
|
|
26
26
|
import type {ListOptionType} from './type'
|
|
27
27
|
const modelValue = defineModel()
|
package/templates/nuxt/components/{SimpleAppRating.vue.eta → simpleApp/SimpleAppRating.vue.eta}
RENAMED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import {computed,watch,ref} from 'vue'
|
|
15
15
|
import Rating from 'primevue/rating';
|
|
16
16
|
|
|
17
|
-
import FieldContainer from './
|
|
17
|
+
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
18
18
|
const modelValue = defineModel()
|
|
19
19
|
const props = defineProps<{
|
|
20
20
|
label?:string,
|
package/templates/nuxt/components/{SimpleAppSelect.vue.eta → simpleApp/SimpleAppSelect.vue.eta}
RENAMED
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
optionLabel="label"
|
|
10
10
|
:path="setting.instancepath"
|
|
11
11
|
:options="options"
|
|
12
|
+
:readonly="isReadonly"
|
|
12
13
|
/>
|
|
13
14
|
</FieldContainer>
|
|
14
15
|
</template>
|
|
15
16
|
<script lang="ts" setup>
|
|
16
17
|
import {computed,watch,ref} from 'vue'
|
|
17
18
|
import Dropdown from 'primevue/dropdown';
|
|
18
|
-
import FieldContainer from './
|
|
19
|
+
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
19
20
|
import {prepareList,simpleArrayToObject} from './helper'
|
|
20
21
|
import type {ListOptionType} from './type'
|
|
21
22
|
import type { JSONSchema7 } from 'json-schema';
|
|
@@ -29,10 +30,19 @@ const props = defineProps<{
|
|
|
29
30
|
optionValue?:string,
|
|
30
31
|
instancepath?:string,
|
|
31
32
|
options?:any[]
|
|
33
|
+
readonly?:boolean
|
|
32
34
|
}>()
|
|
33
35
|
|
|
34
36
|
const optionValue = props.optionValue ?? 'value'
|
|
35
37
|
const optionLabel = props.optionLabel ?? 'label'
|
|
36
38
|
const options = prepareList('oneOf',props.setting.fieldsetting,optionLabel,optionValue,props.options,)
|
|
37
|
-
|
|
39
|
+
const isReadonly = computed(()=>{
|
|
40
|
+
if(props.readonly){
|
|
41
|
+
return props.readonly
|
|
42
|
+
}else if(props.setting.readonly){
|
|
43
|
+
return props.setting.readonly
|
|
44
|
+
}else{
|
|
45
|
+
return false
|
|
46
|
+
}
|
|
47
|
+
})
|
|
38
48
|
</script>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<script lang="ts" setup>
|
|
17
17
|
import {computed,watch,ref} from 'vue'
|
|
18
18
|
import MultiSelect from 'primevue/multiselect';
|
|
19
|
-
import FieldContainer from './
|
|
19
|
+
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
20
20
|
import {prepareList,simpleArrayToObject} from './helper'
|
|
21
21
|
import type {SimpleAppFieldSetting} from './type'
|
|
22
22
|
import type { JSONSchema7 } from 'json-schema';
|
package/templates/nuxt/components/{SimpleAppSlider.vue.eta → simpleApp/SimpleAppSlider.vue.eta}
RENAMED
|
@@ -15,7 +15,7 @@ import {computed,watch,ref} from 'vue'
|
|
|
15
15
|
import Slider from 'primevue/slider';
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
import FieldContainer from './
|
|
18
|
+
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
19
19
|
const modelValue = defineModel()
|
|
20
20
|
const props = defineProps<{
|
|
21
21
|
label?:string,
|
package/templates/nuxt/components/{SimpleAppSwitch.vue.eta → simpleApp/SimpleAppSwitch.vue.eta}
RENAMED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<script lang="ts" setup>
|
|
16
16
|
// import {Ref} from 'vue'
|
|
17
17
|
import InputSwitch from 'primevue/inputswitch';
|
|
18
|
-
import FieldContainer from './
|
|
18
|
+
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
19
19
|
|
|
20
20
|
const modelValue = defineModel<boolean>()
|
|
21
21
|
const props = defineProps<{
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
v-model="modelValue"
|
|
10
10
|
:path="setting.instancepath"
|
|
11
11
|
:type="type"
|
|
12
|
+
:readonly="isReadonly"
|
|
12
13
|
></InputText>
|
|
13
14
|
<InputText v-else
|
|
14
15
|
class="simpleapp-inputfield"
|
|
@@ -16,13 +17,14 @@
|
|
|
16
17
|
v-model="modelValue"
|
|
17
18
|
:path="setting.instancepath"
|
|
18
19
|
:type="type"
|
|
20
|
+
:readonly="isReadonly"
|
|
19
21
|
></InputText>
|
|
20
22
|
</FieldContainer>
|
|
21
23
|
</template>
|
|
22
24
|
<script lang="ts" setup>
|
|
23
25
|
import {computed,watch,ref} from 'vue'
|
|
24
26
|
import InputText from 'primevue/inputtext';
|
|
25
|
-
import FieldContainer from './
|
|
27
|
+
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
26
28
|
const modelValue = defineModel()
|
|
27
29
|
const props = withDefaults( defineProps<{
|
|
28
30
|
label?:string,
|
|
@@ -32,11 +34,20 @@ const props = withDefaults( defineProps<{
|
|
|
32
34
|
type?:string,
|
|
33
35
|
instancepath?:string,
|
|
34
36
|
hidelabel?: boolean
|
|
37
|
+
readonly?: boolean
|
|
35
38
|
}>(),{type:'text'})
|
|
36
39
|
|
|
37
40
|
// const modelValue = defineModel<{modelValue?:string}>()
|
|
38
41
|
// console.log(modelValue.value)
|
|
39
|
-
|
|
42
|
+
const isReadonly = computed(()=>{
|
|
43
|
+
if(props.readonly){
|
|
44
|
+
return props.readonly
|
|
45
|
+
}else if(props.setting.readonly){
|
|
46
|
+
return props.setting.readonly
|
|
47
|
+
}else{
|
|
48
|
+
return false
|
|
49
|
+
}
|
|
50
|
+
})
|
|
40
51
|
const emits = defineEmits(['change'])
|
|
41
52
|
// const onchange=(e:any)=>{
|
|
42
53
|
// emits('update:modelValue',e.target.value)
|
package/templates/nuxt/components/{SimpleAppTextarea.vue.eta → simpleApp/SimpleAppTextarea.vue.eta}
RENAMED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
v-bind="$attrs"
|
|
9
9
|
:autoResize="autoResize"
|
|
10
10
|
:path="setting.instancepath"
|
|
11
|
+
:readonly="isReadonly"
|
|
11
12
|
></Textarea>
|
|
12
13
|
</FieldContainer>
|
|
13
14
|
</template>
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
import {computed,watch,ref} from 'vue'
|
|
16
17
|
import Textarea from 'primevue/textarea';
|
|
17
18
|
|
|
18
|
-
import FieldContainer from './
|
|
19
|
+
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
19
20
|
const modelValue = defineModel()
|
|
20
21
|
const props = defineProps<{
|
|
21
22
|
label?:string,
|
|
@@ -25,6 +26,16 @@ const props = defineProps<{
|
|
|
25
26
|
setting:any,
|
|
26
27
|
autoResize?:boolean,
|
|
27
28
|
instancepath?:string,
|
|
28
|
-
|
|
29
|
+
readonly?:boolean
|
|
29
30
|
|
|
31
|
+
}>()
|
|
32
|
+
const isReadonly = computed(()=>{
|
|
33
|
+
if(props.readonly){
|
|
34
|
+
return props.readonly
|
|
35
|
+
}else if(props.setting.readonly){
|
|
36
|
+
return props.setting.readonly
|
|
37
|
+
}else{
|
|
38
|
+
return false
|
|
39
|
+
}
|
|
40
|
+
})
|
|
30
41
|
</script>
|
|
@@ -10,6 +10,9 @@ import {getAllDocuments} from '../simpleapp/generate/commons/documents'
|
|
|
10
10
|
export const getDocTypes = ()=>{
|
|
11
11
|
return getAllDocuments().filter(item=>item.page!='')
|
|
12
12
|
}
|
|
13
|
+
export const getAllDocFormats = ()=>{
|
|
14
|
+
return getAllDocuments().filter(item=>item.docNumber)
|
|
15
|
+
}
|
|
13
16
|
|
|
14
17
|
export const getPublicResource = (xorg:string) : MenuData[] => {
|
|
15
18
|
// const xorg = getUserStore().getCurrentXorg()
|
|
@@ -44,7 +47,7 @@ export const getMenus =() :MenuData[]=>{
|
|
|
44
47
|
// if(m.label)
|
|
45
48
|
|
|
46
49
|
if(getUserStore().haveAccess(keyword)){
|
|
47
|
-
const m:MenuData = {label: keyword, url:`/${xorg}/${keyword}`, isolationType:allmenus[i].isolationType}
|
|
50
|
+
const m:MenuData = {label: t(keyword), url:`/${xorg}/${keyword}`, isolationType:allmenus[i].isolationType}
|
|
48
51
|
allowmenus.push(m)
|
|
49
52
|
}
|
|
50
53
|
}
|
|
@@ -13,3 +13,10 @@ export const getDocumentUrl = (document:string,id?:string,querystr?:string)=>{
|
|
|
13
13
|
export const goTo = (document:string,id?:string,querystr?:string)=>{
|
|
14
14
|
navigateTo(getDocumentUrl(document,id,querystr))
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export const goBranch = (branchRecordId: string) => {
|
|
19
|
+
const parenturl = getDocumentUrl("organization");
|
|
20
|
+
const branchUrl = `${parenturl}/${branchRecordId}`;
|
|
21
|
+
navigateTo(branchUrl);
|
|
22
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {NotificationStatus} from '~/types'
|
|
2
2
|
export const getStatusColor = (status:NotificationStatus) => {
|
|
3
|
-
console.log("get status color",status)
|
|
3
|
+
//console.log("get status color",status)
|
|
4
4
|
switch(status){
|
|
5
5
|
case NotificationStatus.error:
|
|
6
6
|
return 'bg bg-danger-600 text-white';
|
|
@@ -93,7 +93,7 @@ import {SearchBody,CellSetting} from '~/types'
|
|
|
93
93
|
tablecolumns.value= !useRoute().meta.columns ? [] : useRoute().meta.columns as CellSetting[]
|
|
94
94
|
documentName.value = String(useRoute().meta.documentName)
|
|
95
95
|
const searchbody: SearchBody = {
|
|
96
|
-
fields: tablecolumns.value
|
|
96
|
+
fields: getWantedFields(tablecolumns.value),
|
|
97
97
|
sorts: metas.sorts as string[][]
|
|
98
98
|
}
|
|
99
99
|
obj = getDocument(documentName.value)
|
|
@@ -118,6 +118,24 @@ import {SearchBody,CellSetting} from '~/types'
|
|
|
118
118
|
// }
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
const getWantedFields = (selectedCols:CellSetting[]) =>{
|
|
122
|
+
let cols:string[] = []
|
|
123
|
+
|
|
124
|
+
selectedCols.forEach((item)=>{
|
|
125
|
+
|
|
126
|
+
if(typeof item=='string'){
|
|
127
|
+
cols.push(item)
|
|
128
|
+
}else if(typeof item =='object'){
|
|
129
|
+
if(item.field !='*'){
|
|
130
|
+
cols.push(item.field)
|
|
131
|
+
}
|
|
132
|
+
if(item.moreFields && item.moreFields.length>0){
|
|
133
|
+
cols = cols.concat(item.moreFields)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
return cols
|
|
138
|
+
}
|
|
121
139
|
watch(()=> useRoute().meta ,(newvalue,oldvalue)=>{
|
|
122
140
|
refresh()
|
|
123
141
|
})
|
|
@@ -131,7 +149,7 @@ watch(()=> useRoute().meta ,(newvalue,oldvalue)=>{
|
|
|
131
149
|
|
|
132
150
|
<HeaderBar />
|
|
133
151
|
<Invitation/>
|
|
134
|
-
<
|
|
152
|
+
<DocumentDatatable :value="recordlist" :columns="tablecolumns" :title="String(useRoute().meta.name)">
|
|
135
153
|
<template #toolbar>
|
|
136
154
|
<div class="w-full text-left">
|
|
137
155
|
<slot>
|
|
@@ -143,13 +161,11 @@ watch(()=> useRoute().meta ,(newvalue,oldvalue)=>{
|
|
|
143
161
|
<Button class="bg-secondary-600 hover:bg-secondary-400 text-white" @click="refresh()" type="button" >Refresh</Button>
|
|
144
162
|
</template>
|
|
145
163
|
<Column header=" ">
|
|
146
|
-
<template #body="{index,data}">
|
|
147
|
-
|
|
148
|
-
<Button icon="pi pi-pencil" class="bg-primary-600 hover:bg-primary-400 text-white" >Edit</Button>
|
|
149
|
-
</NuxtLink>
|
|
164
|
+
<template #body="{index,data}">
|
|
165
|
+
<Button @click="goTo(String(useRoute().meta.documentName),data._id)" icon="pi pi-pencil" class="bg-primary-600 hover:bg-primary-400 text-white" >Edit</Button>
|
|
150
166
|
</template>
|
|
151
167
|
</Column>
|
|
152
|
-
</
|
|
168
|
+
</DocumentDatatable>
|
|
153
169
|
<!--
|
|
154
170
|
<DebugDocumentData v-model="data"/>
|
|
155
171
|
-->
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
4
|
+
* You may modify it
|
|
5
|
+
* last change 2023-09-09
|
|
6
|
+
* author: Ks Tan
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import Menus from '~/components/Menus.vue'
|
|
10
|
+
const {$listen,$event} = useNuxtApp()
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const documentName = ref(String(useRoute().meta.documentName))
|
|
14
|
+
let obj = getDocument(documentName.value)
|
|
15
|
+
|
|
16
|
+
const list = ref([])
|
|
17
|
+
|
|
18
|
+
$listen("RefreshDocumentList", (data) => {
|
|
19
|
+
if(data.documentName == documentName.value){
|
|
20
|
+
refresh()
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
watch(()=>useRoute().fullPath,()=>{
|
|
25
|
+
refresh()
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const refresh = async ()=>{
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
documentName.value = String(useRoute().meta.documentName)
|
|
32
|
+
obj = getDocument(documentName.value)
|
|
33
|
+
list.value = await obj?.search({})
|
|
34
|
+
console.log("refreshrefreshrefresh",documentName.value)
|
|
35
|
+
}
|
|
36
|
+
// // $listen('*',(type:any,data:any)=>{ //simple use case, use any to prevent error
|
|
37
|
+
// $listen('listloaded',(newlist)=>{
|
|
38
|
+
// primarylist.value = newlist
|
|
39
|
+
// })
|
|
40
|
+
|
|
41
|
+
const selectItem=(item:any)=>{
|
|
42
|
+
// $event('',item)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
refresh()
|
|
46
|
+
|
|
47
|
+
</script>
|
|
48
|
+
<template>
|
|
49
|
+
<div>
|
|
50
|
+
<HeaderBar />
|
|
51
|
+
<Invitation/>
|
|
52
|
+
<div class="grid grid-cols-3">
|
|
53
|
+
<div>
|
|
54
|
+
<ListView
|
|
55
|
+
:list="list" :withFilter="true"
|
|
56
|
+
:url="getDocumentUrl('organization')"
|
|
57
|
+
:titleField="String(useRoute().meta.titleField)"
|
|
58
|
+
:subTitleField="String(useRoute().meta.subTitleField)" ></ListView>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
<div class="col-span-2">
|
|
62
|
+
<slot></slot>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
@@ -20,8 +20,8 @@ const columns = [
|
|
|
20
20
|
/* skip system columns doctype*/
|
|
21
21
|
/* skip system columns created*/
|
|
22
22
|
/* skip system columns updated*/
|
|
23
|
-
/* skip system columns
|
|
24
|
-
/* skip system columns
|
|
23
|
+
/* skip system columns createdBy*/
|
|
24
|
+
/* skip system columns updatedBy*/
|
|
25
25
|
/* skip system columns tenantId*/
|
|
26
26
|
/* skip system columns orgId*/
|
|
27
27
|
];
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import ConfirmPopup from "primevue/confirmpopup";
|
|
3
|
+
import { useConfirm } from "primevue/useconfirm";
|
|
4
|
+
import moment from "moment";
|
|
5
|
+
const confirm = useConfirm();
|
|
6
|
+
const isReadOnly = ref(true)
|
|
7
|
+
const {$event,$listen, $DocnoformatDoc} = useNuxtApp()
|
|
8
|
+
const doc = $DocnoformatDoc()
|
|
9
|
+
const data = doc.getReactiveData()
|
|
10
|
+
const list = ref([])
|
|
11
|
+
const sample = ref("");
|
|
12
|
+
const refresh = async ()=>{
|
|
13
|
+
$event('RefreshDocumentList',{documentName:doc.getDocName()})
|
|
14
|
+
isReadOnly.value=true
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const updateSample = () => {
|
|
18
|
+
sample.value = "Example: " + previewDocNo();
|
|
19
|
+
};
|
|
20
|
+
const createData = async () => {
|
|
21
|
+
// disabled.value=true
|
|
22
|
+
|
|
23
|
+
doc
|
|
24
|
+
.create()
|
|
25
|
+
.then((res) => {
|
|
26
|
+
refresh()
|
|
27
|
+
newData()
|
|
28
|
+
})
|
|
29
|
+
.catch((err) => {
|
|
30
|
+
console.error(err);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
const updateData = async () => {
|
|
34
|
+
doc
|
|
35
|
+
.update()
|
|
36
|
+
.then(() => {
|
|
37
|
+
// visible.value=false
|
|
38
|
+
refresh();
|
|
39
|
+
})
|
|
40
|
+
.catch((err) => {
|
|
41
|
+
console.error(err);
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const deleteData = (el: any) => {
|
|
45
|
+
|
|
46
|
+
confirm.require({
|
|
47
|
+
target: el.currentTarget as HTMLElement,
|
|
48
|
+
message: "Delete?",
|
|
49
|
+
icon: "pi pi-exclamation-triangle",
|
|
50
|
+
acceptClass: "p-button-danger",
|
|
51
|
+
accept: () => {
|
|
52
|
+
// disabled.value=true
|
|
53
|
+
doc.delete(data.value._id ?? "").then((res) => {
|
|
54
|
+
newData()
|
|
55
|
+
refresh();
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
reject: () => {
|
|
59
|
+
console.log("Cancel delete");
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
const newData = () => {
|
|
64
|
+
doc.setNew()
|
|
65
|
+
goTo(doc.getDocName(),String(useRoute().params.doctype)+'/new');
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const id=computed(()=>String(useRoute().params.id??''))
|
|
69
|
+
|
|
70
|
+
const fetchRecord =async ()=>{
|
|
71
|
+
if(id.value){
|
|
72
|
+
isReadOnly.value=true
|
|
73
|
+
await doc.getById(id.value)
|
|
74
|
+
}else{
|
|
75
|
+
isReadOnly.value=false
|
|
76
|
+
data.value.docNoType=String(useRoute().params.doctype)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const previewDocNo = (): string => {
|
|
81
|
+
const pattern = data.value.docNoPattern;
|
|
82
|
+
if (pattern) {
|
|
83
|
+
const numberReg: RegExp = /\[(.*?)\]/g;
|
|
84
|
+
const dateReg: RegExp = /\{(.*?)\}/g;
|
|
85
|
+
let newvalue = pattern;
|
|
86
|
+
const numberpattern = pattern.match(numberReg);
|
|
87
|
+
const datepattern = pattern.match(dateReg);
|
|
88
|
+
|
|
89
|
+
if (numberpattern && numberpattern.length > 0) {
|
|
90
|
+
const numberlength = numberpattern[0]
|
|
91
|
+
.replace("[", "")
|
|
92
|
+
.replace("]", "").length;
|
|
93
|
+
|
|
94
|
+
let nextnumber = (data.value.nextNumber ?? 0).toString();
|
|
95
|
+
|
|
96
|
+
const numberdiff = numberlength - nextnumber.length;
|
|
97
|
+
|
|
98
|
+
for (let n = 0; n < numberdiff; n++) {
|
|
99
|
+
nextnumber = "0" + nextnumber;
|
|
100
|
+
}
|
|
101
|
+
newvalue = newvalue.replace(numberpattern[0], nextnumber);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (datepattern && datepattern.length > 0) {
|
|
105
|
+
for (let d = 0; d < datepattern.length; d++) {
|
|
106
|
+
const dpattern = datepattern[d];
|
|
107
|
+
const date = new Date();
|
|
108
|
+
const formatteddate = moment().format(
|
|
109
|
+
dpattern.replace("{", "").replace("}", ""),
|
|
110
|
+
);
|
|
111
|
+
newvalue = newvalue.replace(dpattern, formatteddate);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return newvalue;
|
|
115
|
+
} else {
|
|
116
|
+
return "";
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
fetchRecord()
|
|
121
|
+
</script>
|
|
122
|
+
<template>
|
|
123
|
+
<DebugDocumentData v-model="data" label="docnoformat"/>
|
|
124
|
+
<div class="p-4">
|
|
125
|
+
<div v-if="isReadOnly">
|
|
126
|
+
<Button class="bg-primary-600 hover:bg-primary-400 text-white" @click="isReadOnly=false">Edit</Button>
|
|
127
|
+
</div>
|
|
128
|
+
<div v-else class="simpleapp-tool-bar col-span-4 text-left gap-4">
|
|
129
|
+
<Button
|
|
130
|
+
class="btn-default"
|
|
131
|
+
@click="newData"
|
|
132
|
+
type="button"
|
|
133
|
+
v-if="canPerform(doc.getDocName(), 'create')">New
|
|
134
|
+
</Button>
|
|
135
|
+
<Button
|
|
136
|
+
class="bg bg-primary-600 hover:bg-primary-400 text-white"
|
|
137
|
+
@click="createData"
|
|
138
|
+
type="button"
|
|
139
|
+
v-if="canPerform(doc.getDocName(), 'create') && doc.isNew()"
|
|
140
|
+
>
|
|
141
|
+
Create
|
|
142
|
+
</Button>
|
|
143
|
+
<Button
|
|
144
|
+
class="bg bg-primary-600 hover:bg-primary-400 text-white"
|
|
145
|
+
|
|
146
|
+
@click="updateData"
|
|
147
|
+
type="button"
|
|
148
|
+
v-if="canPerform(doc.getDocName(), 'update') && !doc.isNew()"
|
|
149
|
+
>
|
|
150
|
+
Update
|
|
151
|
+
</Button>
|
|
152
|
+
<Button
|
|
153
|
+
class="bg bg-danger-600 hover:bg-danger-400 text-white"
|
|
154
|
+
|
|
155
|
+
@click="deleteData($el)"
|
|
156
|
+
type="button"
|
|
157
|
+
v-if="canPerform(doc.getDocName(), 'delete') && !doc.isNew()"
|
|
158
|
+
>
|
|
159
|
+
Delete
|
|
160
|
+
</Button>
|
|
161
|
+
<ConfirmPopup></ConfirmPopup>
|
|
162
|
+
</div>
|
|
163
|
+
<SimpleAppForm :document="doc" #default="o" :readonly="isReadOnly">
|
|
164
|
+
<div class="grid grid-cols-4 gap-4">
|
|
165
|
+
<SimpleAppText
|
|
166
|
+
autofocus
|
|
167
|
+
:setting="o.getField('#/properties/docNoFormatNo')"
|
|
168
|
+
v-model="data.docNoFormatNo"
|
|
169
|
+
/>
|
|
170
|
+
<SimpleAppText
|
|
171
|
+
autofocus
|
|
172
|
+
:setting="o.getField('#/properties/docNoFormatName')"
|
|
173
|
+
v-model="data.docNoFormatName"
|
|
174
|
+
/>
|
|
175
|
+
<SimpleAppAutocomplete
|
|
176
|
+
v-model="data.branch"
|
|
177
|
+
:setting="o.getField('#/properties/branch')"
|
|
178
|
+
:remoteSrc="getAutocomplete('branch')"
|
|
179
|
+
optionLabel="label"
|
|
180
|
+
/>
|
|
181
|
+
<SimpleAppCheckbox
|
|
182
|
+
autofocus
|
|
183
|
+
:setting="o.getField('#/properties/active')"
|
|
184
|
+
v-model="data.active"
|
|
185
|
+
/>
|
|
186
|
+
|
|
187
|
+
<SimpleAppCheckbox
|
|
188
|
+
autofocus
|
|
189
|
+
:setting="o.getField('#/properties/default')"
|
|
190
|
+
v-model="data.default"
|
|
191
|
+
/>
|
|
192
|
+
|
|
193
|
+
<SimpleAppText
|
|
194
|
+
autofocus
|
|
195
|
+
:setting="o.getField('#/properties/docNoPattern')"
|
|
196
|
+
v-model="data.docNoPattern"
|
|
197
|
+
@change="updateSample"
|
|
198
|
+
:description="sample"
|
|
199
|
+
v-tooltip="'Examples: PO-<00000>, SI{YY}/<000>, SI{YYMM}/<000>'"
|
|
200
|
+
/>
|
|
201
|
+
<SimpleAppText
|
|
202
|
+
:readonly="true"
|
|
203
|
+
:setting="o.getField('#/properties/docNoType')"
|
|
204
|
+
v-model="data.docNoType"
|
|
205
|
+
description="Document Type"
|
|
206
|
+
|
|
207
|
+
/>
|
|
208
|
+
<SimpleAppNumber
|
|
209
|
+
autofocus
|
|
210
|
+
:setting="o.getField('#/properties/nextNumber')"
|
|
211
|
+
v-model="data.nextNumber"
|
|
212
|
+
/>
|
|
213
|
+
</div>
|
|
214
|
+
</SimpleAppForm>
|
|
215
|
+
</div>
|
|
216
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
|
|
3
|
+
const {$event,$listen, $DocnoformatDoc} = useNuxtApp()
|
|
4
|
+
const doc = $DocnoformatDoc()
|
|
5
|
+
const data = doc.getReactiveData()
|
|
6
|
+
const list = ref([])
|
|
7
|
+
const refresh = async ()=>{
|
|
8
|
+
list.value = await doc.search({
|
|
9
|
+
filter:{docNoType: useRoute().params.doctype}
|
|
10
|
+
})
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
refresh()
|
|
14
|
+
|
|
15
|
+
$listen('RefreshDocumentList',(data)=>{
|
|
16
|
+
if(data.documentName=="docnoformat"){
|
|
17
|
+
refresh()
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
<template>
|
|
22
|
+
<div class="grid grid-cols-3 p-4">
|
|
23
|
+
<div>
|
|
24
|
+
<ListView :list="list"
|
|
25
|
+
titleField="docNoFormatName"
|
|
26
|
+
subTitleField="docNoFormatNo"
|
|
27
|
+
:url="`${getDocumentUrl('docnoformat')}/${useRoute().params.doctype}`"></ListView>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="col-span-2">
|
|
30
|
+
<NuxtPage></NuxtPage>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|