@simitgroup/simpleapp-generator 1.3.1-alpha → 1.3.2-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generate.js +5 -1
- package/dist/generate.js.map +1 -1
- package/package.json +1 -1
- package/src/generate.ts +5 -1
- package/templates/basic/nest/apischema.ts.eta +2 -3
- package/templates/basic/nest/controller.ts.eta +3 -4
- package/templates/basic/nest/default.ts.eta +6 -0
- package/templates/basic/nest/jsonschema.ts.eta +3 -4
- package/templates/basic/nest/model.ts.eta +3 -5
- package/templates/basic/nest/processor.ts.eta +3 -4
- package/templates/basic/nest/service.ts.eta +8 -1
- package/templates/basic/nest/type.ts.eta +3 -4
- package/templates/basic/nuxt/default.ts.eta +6 -0
- package/templates/basic/nuxt/pages.form.vue.eta +2 -1
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +3 -4
- package/templates/nest/.env._eta +2 -1
- package/templates/nest/.gitignore.eta +5 -0
- package/templates/nest/src/simpleapp/.gitignore.eta +5 -0
- package/templates/nest/src/simpleapp/apischemas/index.ts._eta +6 -1
- package/templates/nest/src/simpleapp/generate/apischemas/index.ts.eta +7 -0
- package/templates/nest/src/simpleapp/generate/apischemas/simpleapp.apischema.ts.eta +1 -1
- package/templates/nest/src/simpleapp/generate/workflow/formschema/index.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/workflow/workflow.apischema.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/workflow/workflow.config.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/workflow/workflow.controller.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/workflow/workflow.delegate.ts.eta +6 -0
- package/templates/nest/src/simpleapp/generate/workflow/workflow.service.ts.eta +2 -4
- package/templates/nest/src/simpleapp/generate/workflow/workflow.type.ts.eta +4 -5
- package/templates/nest/src/simpleapp/generate/workflow/workflow.userservice.ts.eta +6 -0
- package/templates/nest/src/simpleapp/profile/profile.apischema.ts.eta +1 -1
- package/templates/nest/src/simpleapp/profile/profile.controller.ts.eta +1 -1
- package/templates/nest/src/simpleapp/profile/profile.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/profile/profile.types.ts.eta +1 -1
- package/templates/nest/src/simpleapp/services/autoinc.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/services/branch.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/services/docno.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/services/org.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/services/perm.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/services/tenant.service.ts.eta +1 -1
- package/templates/nest/src/simpleapp/services/user.service.ts.etax +1 -1
- package/templates/nest/src/simpleapp/types/index.ts._eta +6 -1
- package/templates/nest/src/simpleapp/workflows/listeners/simpleapp.listener.ts._eta +4 -5
- package/templates/nest/test/app.e2e-spec.ts.eta +6 -0
- package/templates/nest/test/setting.ts.eta +6 -0
- package/templates/nuxt/.env._eta +2 -1
- package/templates/nuxt/.gitignore.eta +5 -0
- package/templates/nuxt/{app.vue.eta → app.vue._eta} +14 -14
- package/templates/nuxt/assets/css/calendar.css._eta +6 -1
- package/templates/nuxt/assets/css/listview.css._eta +17 -0
- package/templates/nuxt/assets/css/style.css._eta +6 -4
- package/templates/nuxt/assets/css/tailwind.css._eta +6 -0
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +13 -8
- package/templates/nuxt/components/button/ButtonDanger.vue._eta +16 -4
- package/templates/nuxt/components/button/ButtonDefault.vue._eta +17 -4
- package/templates/nuxt/components/button/ButtonMultiple.vue._eta +8 -2
- package/templates/nuxt/components/button/ButtonPrimary.vue._eta +17 -5
- package/templates/nuxt/components/button/ButtonText.vue._eta +21 -0
- package/templates/nuxt/components/button/ButtonWarning.vue._eta +17 -5
- package/templates/nuxt/components/calendar/CalendarByResource.vue.eta +7 -3
- package/templates/nuxt/components/calendar/CalendarSmall.vue.eta +6 -0
- package/templates/nuxt/components/debug/DebugDocumentData.vue.eta +3 -3
- package/templates/nuxt/components/event/EventDecision.vue._eta +3 -3
- package/templates/nuxt/components/event/EventDocumentViewer.vue._eta +3 -3
- package/templates/nuxt/components/event/EventNotification.vue._eta +3 -3
- package/templates/nuxt/components/form/FormBranch.vue.eta +4 -3
- package/templates/nuxt/components/header/HeaderBar.vue._eta +7 -1
- package/templates/nuxt/components/header/HeaderBreadcrumb.vue.eta +6 -0
- package/templates/nuxt/components/header/HeaderSelectBranch.vue.eta +6 -0
- package/templates/nuxt/components/header/button/HeaderButtonHome.vue.eta +6 -1
- package/templates/nuxt/components/header/button/HeaderButtonLogout.vue.eta +9 -1
- package/templates/nuxt/components/header/button/HeaderButtonMenuPicker.vue._eta +7 -0
- package/templates/nuxt/components/header/button/HeaderButtonProfile.vue.eta +6 -0
- package/templates/nuxt/components/header/button/task/HeaderButtonTaskItem.vue.eta +7 -0
- package/templates/nuxt/components/header/button/task/HeaderButtonTaskList.vue.eta +6 -0
- package/templates/nuxt/components/list/ListDocument.vue.eta +6 -0
- package/templates/nuxt/components/list/ListDocumentTable.vue.eta +6 -0
- package/templates/nuxt/components/list/ListView.vue.eta +60 -47
- package/templates/nuxt/components/mobile/MobileToolbar.vue.eta +9 -3
- package/templates/nuxt/components/overlay/OverlayPanelWithToolBar.vue.eta +44 -0
- package/templates/nuxt/components/overlay/OverlaySideBarCrud.vue.eta +10 -1
- package/templates/nuxt/components/overlay/OverlayViewer.vue.eta +7 -1
- package/templates/nuxt/components/page/PageDocList.vue.eta +23 -14
- package/templates/nuxt/components/renderer/index.ts._eta +3 -3
- package/templates/nuxt/components/session/SessionBlock.vue.eta +6 -0
- package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +7 -1
- package/templates/nuxt/components/simpleApp/SimpleAppDocumentNo.vue.eta +6 -0
- package/templates/nuxt/components/simpleApp/SimpleAppFieldContainer.vue.eta +6 -0
- package/templates/nuxt/components/simpleApp/SimpleAppForm.vue.eta +7 -2
- package/templates/nuxt/components/simpleApp/SimpleAppFormToolBar.vue.eta +21 -17
- package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +6 -0
- package/templates/nuxt/components/simpleApp/SimpleAppInputTable.vue.eta +6 -1
- package/templates/nuxt/components/simpleApp/SimpleAppJsonSchemaForm.vue.eta +6 -0
- package/templates/nuxt/components/table/TableDocuments.vue.eta +6 -0
- package/templates/nuxt/components/text/TextDanger.vue._eta +8 -0
- package/templates/nuxt/components/text/TextSubtitle.vue._eta +8 -0
- package/templates/nuxt/components/text/TextTitle.vue._eta +8 -0
- package/templates/nuxt/components/user/UserButtonCreateTenant.vue.eta +6 -0
- package/templates/nuxt/components/user/UserButtonPermissionInfo.vue.eta +6 -0
- package/templates/nuxt/components/user/UserInvitation.vue.eta +22 -16
- package/templates/nuxt/components/user/UserProfileListItem.vue.eta +6 -1
- package/templates/nuxt/components/user/UserTenantPicker.vue.eta +6 -1
- package/templates/nuxt/components/workflow/forms/dynamicfield.vue._eta +7 -0
- package/templates/nuxt/components/workflow/forms/index.ts._eta +7 -0
- package/templates/nuxt/components/workflow/forms/simpleapprove.vue._eta +6 -0
- package/templates/nuxt/composables/date.generate.ts.eta +6 -3
- package/templates/nuxt/composables/docformat.generate.ts.eta +6 -0
- package/templates/nuxt/composables/getDocument.generate.ts.eta +6 -0
- package/templates/nuxt/composables/getTenant.generate.ts.eta +6 -0
- package/templates/nuxt/composables/getUserStore.generate.ts.eta +6 -0
- package/templates/nuxt/composables/goTo.generate.ts.eta +6 -0
- package/templates/nuxt/composables/logout.generate.ts.eta +6 -0
- package/templates/nuxt/composables/notifications.generate.ts.eta +6 -0
- package/templates/nuxt/composables/refreshDocumentList.generate.ts.eta +6 -0
- package/templates/nuxt/composables/roles.generate.ts.eta +6 -0
- package/templates/nuxt/composables/screensize.generate.ts.eta +6 -0
- package/templates/nuxt/composables/stringHelper.generate.ts.eta +6 -0
- package/templates/nuxt/composables/themes.generate.ts.eta +6 -0
- package/templates/nuxt/composables/workflow.generate.ts.eta +6 -0
- package/templates/nuxt/error.vue._eta +6 -1
- package/templates/nuxt/i18n.config.ts.eta +6 -0
- package/templates/nuxt/lang/cn.ts._eta +6 -0
- package/templates/nuxt/lang/en.ts.eta +1 -0
- package/templates/nuxt/layouts/default.vue._eta +6 -0
- package/templates/nuxt/layouts/loginlayout.vue._eta +9 -1
- package/templates/nuxt/layouts/mobile.vue._eta +6 -0
- package/templates/nuxt/middleware/30.acl.global.ts.eta +1 -1
- package/templates/nuxt/nuxt.config.ts._eta +4 -5
- package/templates/nuxt/pages/[xorg]/docnoformat/[doctype]/[id].vue.eta +4 -5
- package/templates/nuxt/pages/[xorg]/docnoformat/[doctype]/new.vue.eta +7 -0
- package/templates/nuxt/pages/[xorg]/docnoformat/[doctype].vue.eta +6 -1
- package/templates/nuxt/pages/[xorg]/docnoformat/index.vue.eta +6 -1
- package/templates/nuxt/pages/[xorg]/docnoformat.vue.eta +4 -6
- package/templates/nuxt/pages/[xorg]/index.vue._eta +4 -5
- package/templates/nuxt/pages/[xorg]/organization/viewer.vue.eta +8 -0
- package/templates/nuxt/pages/[xorg]/organization.vue.eta +6 -1
- package/templates/nuxt/pages/[xorg]/profile.vue.eta +6 -0
- package/templates/nuxt/pages/[xorg]/reports/index.vue._eta +18 -0
- package/templates/nuxt/pages/[xorg]/user/[id].vue.eta +4 -5
- package/templates/nuxt/pages/[xorg]/user/form.vue.eta +6 -1
- package/templates/nuxt/pages/[xorg]/user/index.vue.eta +4 -5
- package/templates/nuxt/pages/[xorg]/user/new.vue.eta +4 -5
- package/templates/nuxt/pages/[xorg]/user/viewer.vue.eta +4 -5
- package/templates/nuxt/pages/[xorg]/user.vue.eta +4 -4
- package/templates/nuxt/pages/index.vue._eta +4 -4
- package/templates/nuxt/pages/login.vue._eta +4 -4
- package/templates/nuxt/pages/profile.vue.eta +8 -1
- package/templates/nuxt/pages/relogin.vue.eta +6 -0
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +1 -1
- package/templates/nuxt/plugins/50.simpleapp-client.ts.eta +1 -1
- package/templates/nuxt/server/api/[xorg]/[...].ts.eta +1 -1
- package/templates/nuxt/server/api/auth/[...].ts.eta +1 -1
- package/templates/nuxt/server/api/auth/logout.ts.eta +1 -1
- package/templates/nuxt/server/api/profile/[...].ts.eta +1 -2
- package/templates/nuxt/server/api/profile/index.ts.eta +1 -1
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +2 -4
- package/templates/nuxt/simpleapp/generate/commons/documents.ts.eta +1 -1
- package/templates/nuxt/simpleapp/generate/commons/groups.ts.eta +1 -1
- package/templates/nuxt/simpleapp/generate/commons/roles.ts.eta +1 -1
- package/templates/nuxt/simpleapp/generate/defaults/index.ts.eta +7 -0
- package/templates/nuxt/simpleapp/generate/types/index.ts.eta +7 -0
- package/templates/nuxt/simpleapp/workflows/forms/index.ts._eta +6 -0
- package/templates/nuxt/simpleapp/workflows/forms/simpleapprove.jsonschema.ts._eta +6 -0
- package/templates/nuxt/tailwind.config.ts._eta +6 -0
- package/templates/nuxt/types/calendar.ts.eta +2 -3
- package/templates/nuxt/types/documentlist.ts.eta +3 -3
- package/templates/nuxt/types/events.ts.eta +2 -2
- package/templates/nuxt/types/index.ts._eta +4 -5
- package/templates/nuxt/types/listview.ts.eta +2 -2
- package/templates/nuxt/types/notifications.ts.eta +2 -2
- package/templates/nuxt/types/others.ts.eta +2 -2
- package/templates/nuxt/types/schema.ts.eta +2 -2
- package/templates/nuxt/types/simpleappinput.ts.eta +2 -2
- package/templates/nuxt/types/user.ts.eta +2 -2
- package/templates/nuxt/types/workflow.ts.eta +2 -2
- package/templates/project/lang/default._json +1 -1
- package/templates/project/sharelibs/hello.ts._eta +6 -0
- package/templates/project/sharelibs/index.ts.eta +5 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nuxt/components/simpleApp/pending/SimpleAppAutocomplete.vue +0 -135
- package/templates/nuxt/components/simpleApp/pending/SimpleAppAutocompletemulti.vue +0 -73
- package/templates/nuxt/components/simpleApp/pending/SimpleAppCalendar.vue +0 -55
- package/templates/nuxt/components/simpleApp/pending/SimpleAppCheckbox.vue +0 -29
- package/templates/nuxt/components/simpleApp/pending/SimpleAppChip.vue +0 -28
- package/templates/nuxt/components/simpleApp/pending/SimpleAppColor.vue +0 -41
- package/templates/nuxt/components/simpleApp/pending/SimpleAppDocumentNo.vue +0 -90
- package/templates/nuxt/components/simpleApp/pending/SimpleAppDynamicInput.vue +0 -29
- package/templates/nuxt/components/simpleApp/pending/SimpleAppEditor.vue +0 -31
- package/templates/nuxt/components/simpleApp/pending/SimpleAppInputTable.vue +0 -83
- package/templates/nuxt/components/simpleApp/pending/SimpleAppList.vue +0 -38
- package/templates/nuxt/components/simpleApp/pending/SimpleAppListmulti.vue +0 -41
- package/templates/nuxt/components/simpleApp/pending/SimpleAppNumber.vue +0 -43
- package/templates/nuxt/components/simpleApp/pending/SimpleAppPassword.vue +0 -41
- package/templates/nuxt/components/simpleApp/pending/SimpleAppRadio.vue +0 -42
- package/templates/nuxt/components/simpleApp/pending/SimpleAppRating.vue +0 -41
- package/templates/nuxt/components/simpleApp/pending/SimpleAppSelect.vue +0 -48
- package/templates/nuxt/components/simpleApp/pending/SimpleAppSelectmulti.vue +0 -39
- package/templates/nuxt/components/simpleApp/pending/SimpleAppSlider.vue +0 -42
- package/templates/nuxt/components/simpleApp/pending/SimpleAppSwitch.vue +0 -30
- package/templates/nuxt/components/simpleApp/pending/SimpleAppText.vue +0 -59
- package/templates/nuxt/components/simpleApp/pending/SimpleAppTextarea.vue +0 -41
- package/templates/nuxt/components/simpleApp/pending/SimpleAppValue.vue +0 -86
- package/templates/nuxt/components/simpleApp/pending/helper.ts-backup +0 -90
- package/templates/nuxt/components/simpleApp/pending/type.ts-backup +0 -32
- package/templates/nuxt/components/suspended/CrudNestedDoc.vue.eta +0 -172
- package/templates/nuxt/components/suspended/CrudSimple.vue.eta +0 -181
- package/templates/nuxt/components/suspended/Menus.vue.eta +0 -58
- package/templates/nuxt/components/suspended/Spinner.vue.eta +0 -9
- package/templates/nuxt/lang/df.ts.etaxxxx +0 -16
- package/templates/project/sharelibs/hello.ts.eta +0 -1
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<template>
|
|
4
|
-
<FieldContainer v-bind="$attrs" v-model="modelValue" :label="label" :description="description" :setting="setting" :instancepath="instancepath" :error="error" #default="slotprops">
|
|
5
|
-
<Checkbox
|
|
6
|
-
class="simpleapp-inputfield"
|
|
7
|
-
:inputId="slotprops.uuid"
|
|
8
|
-
v-model="modelValue"
|
|
9
|
-
:binary="true"
|
|
10
|
-
v-bind="$attrs"
|
|
11
|
-
:path="setting.instancepath"
|
|
12
|
-
></Checkbox>
|
|
13
|
-
</FieldContainer>
|
|
14
|
-
</template>
|
|
15
|
-
<script lang="ts" setup>
|
|
16
|
-
// import {Ref} from 'vue'
|
|
17
|
-
import Checkbox from 'primevue/checkbox';
|
|
18
|
-
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
19
|
-
|
|
20
|
-
const modelValue = defineModel<boolean>()
|
|
21
|
-
const props = defineProps<{
|
|
22
|
-
label?:string,
|
|
23
|
-
description?:string,
|
|
24
|
-
error?:string,
|
|
25
|
-
setting:any,
|
|
26
|
-
instancepath?:string,
|
|
27
|
-
}>()
|
|
28
|
-
|
|
29
|
-
</script>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<template>
|
|
3
|
-
<FieldContainer v-bind="$attrs" v-model="modelValue" :label="label" :description="description" :setting="setting" :error="error" #default="slotprops">
|
|
4
|
-
<Chips class="simpleapp-inputfield simpleapp-inputchip"
|
|
5
|
-
v-model="modelValue"
|
|
6
|
-
:inputId="slotprops.uuid"
|
|
7
|
-
v-bind="$attrs"
|
|
8
|
-
></Chips>
|
|
9
|
-
</FieldContainer>
|
|
10
|
-
</template>
|
|
11
|
-
<script lang="ts" setup>
|
|
12
|
-
import {computed,watch,ref} from 'vue'
|
|
13
|
-
import Chips from 'primevue/chips';
|
|
14
|
-
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
15
|
-
// const modelValue = defineModel()
|
|
16
|
-
|
|
17
|
-
const modelValue=defineModel()
|
|
18
|
-
const props = defineProps<{
|
|
19
|
-
label?:string,
|
|
20
|
-
description?:string,
|
|
21
|
-
setting?:any,
|
|
22
|
-
error?:string
|
|
23
|
-
}>()
|
|
24
|
-
</script>
|
|
25
|
-
<style >
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</style>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<template>
|
|
3
|
-
<FieldContainer v-bind="$attrs" v-model="modelValue" :label="label" :description="description" :setting="setting" :instancepath="instancepath" :error="error" #default="slotprops">
|
|
4
|
-
<ColorPicker
|
|
5
|
-
class="simpleapp-inputcolor"
|
|
6
|
-
:inputId="slotprops.uuid"
|
|
7
|
-
v-model="modelValue"
|
|
8
|
-
v-bind="$attrs"
|
|
9
|
-
:path="setting.instancepath"
|
|
10
|
-
></ColorPicker>
|
|
11
|
-
</FieldContainer>
|
|
12
|
-
</template>
|
|
13
|
-
<script lang="ts" setup>
|
|
14
|
-
import {computed,watch,ref} from 'vue'
|
|
15
|
-
import ColorPicker from 'primevue/colorpicker';
|
|
16
|
-
|
|
17
|
-
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
18
|
-
const modelValue = defineModel()
|
|
19
|
-
const props = defineProps<{
|
|
20
|
-
label?:string,
|
|
21
|
-
description?:string,
|
|
22
|
-
error?:string,
|
|
23
|
-
setting:any,
|
|
24
|
-
instancepath?:string,
|
|
25
|
-
}>()
|
|
26
|
-
|
|
27
|
-
// const modelValue = defineModel<{modelValue?:string}>()
|
|
28
|
-
// console.log(modelValue.value)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
// const emits = defineEmits(['update:modelValue'])
|
|
32
|
-
// const onchange=(e:any)=>{
|
|
33
|
-
// emits('update:modelValue',e.target.value)
|
|
34
|
-
// }
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// watch(props ,(after,before)=>{
|
|
38
|
-
// // console.log("B4",before,"after",after)
|
|
39
|
-
// inputvalue.value=after.modelValue
|
|
40
|
-
// })
|
|
41
|
-
</script>
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<template>
|
|
3
|
-
<FieldContainer :hidelabel="hidelabel" v-model="modelValue" :label="label" :description="description" :setting="setting" :instancepath="instancepath" :error="error" #default="slotprops">
|
|
4
|
-
<div class="p-inputgroup ">
|
|
5
|
-
<InputText class="simpleapp-inputfield"
|
|
6
|
-
:inputId="slotprops.uuid"
|
|
7
|
-
v-model="modelValue"
|
|
8
|
-
:placeholder="placeholder"
|
|
9
|
-
:path="setting.instancepath"
|
|
10
|
-
:pt="{input:{class:'text-right w-full'}}"
|
|
11
|
-
/>
|
|
12
|
-
<span class="p-inputgroup-addon p p-0">
|
|
13
|
-
<Button class="pi pi-angle-down" type="button" @click="toggle"></Button>
|
|
14
|
-
|
|
15
|
-
<OverlayPanel ref="op">
|
|
16
|
-
<ul>
|
|
17
|
-
<li v-for="docno in docFormatlist" class="hover-list-primary " >
|
|
18
|
-
<a class="flex-row p-2 mt-4" @click="chooseFormat(docno)">
|
|
19
|
-
<span class="pi pi-hashtag mr-2"></span>
|
|
20
|
-
<span class="">{{docno.docNoFormatName}}</span>
|
|
21
|
-
<span class="ml-2 text text-green-600">{{docno.sample}}</span>
|
|
22
|
-
</a>
|
|
23
|
-
</li>
|
|
24
|
-
</ul>
|
|
25
|
-
</OverlayPanel>
|
|
26
|
-
</span>
|
|
27
|
-
<!-- {{ Object.getOwnPropertyNames(setting) }} -->
|
|
28
|
-
</div>
|
|
29
|
-
</FieldContainer>
|
|
30
|
-
</template>
|
|
31
|
-
<script lang="ts" setup>
|
|
32
|
-
import {ForeignKey} from '~/types'
|
|
33
|
-
import OverlayPanel from 'primevue/overlaypanel';
|
|
34
|
-
import {computed,watch,ref} from 'vue'
|
|
35
|
-
import InputText from 'primevue/inputtext';
|
|
36
|
-
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
37
|
-
import {DocNoFormat} from "~/types"
|
|
38
|
-
const selectedformat = ref()
|
|
39
|
-
const op = ref();
|
|
40
|
-
const placeholder = ref('')
|
|
41
|
-
const docFormatlist = ref()
|
|
42
|
-
const modelValue = defineModel<string>()
|
|
43
|
-
const docNoFormat = defineModel<ForeignKey>('docNoFormat')
|
|
44
|
-
// const emit = defineEmits(['update:docNoFormat'])
|
|
45
|
-
|
|
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
|
-
const documenttype = props.setting.document.doctype
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const toggle = async (event:any) => {
|
|
63
|
-
op.value.toggle(event);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const chooseFormat = (item:any) =>{
|
|
69
|
-
placeholder.value = item.sample
|
|
70
|
-
const f = item
|
|
71
|
-
docNoFormat.value = { _id : f._id, label : f.docNoFormatName}
|
|
72
|
-
op.value.toggle();
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const loadDocFormats = async () =>{
|
|
76
|
-
docFormatlist.value= await getDocFormats(documenttype)
|
|
77
|
-
if(docFormatlist.value.length>0){
|
|
78
|
-
const f = docFormatlist.value[0]
|
|
79
|
-
docNoFormat.value = { _id : f._id, label : f.docNoFormatName}
|
|
80
|
-
placeholder.value = docFormatlist.value[0].sample
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
onMounted(()=>{
|
|
87
|
-
loadDocFormats()
|
|
88
|
-
|
|
89
|
-
})
|
|
90
|
-
</script>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type {SimpleAppFieldSetting} from './type';
|
|
3
|
-
import SimpleAppAutocomplete from './SimpleAppAutocomplete.vue';
|
|
4
|
-
import SimpleAppText from './SimpleAppText.vue';
|
|
5
|
-
import SimpleAppSelect from './SimpleAppSelect.vue';
|
|
6
|
-
import type {JSONSchema7} from 'json-schema'
|
|
7
|
-
import {watch} from 'vue'
|
|
8
|
-
import SimpleAppTextarea from './SimpleAppTextarea.vue';
|
|
9
|
-
import SimpleAppCheckbox from './SimpleAppCheckbox.vue';
|
|
10
|
-
|
|
11
|
-
const props = defineProps<{setting:SimpleAppFieldSetting, getAutocomplete:Function, hidelabel?:boolean}>()
|
|
12
|
-
interface customSchema extends JSONSchema7 {
|
|
13
|
-
'x-foreignkey'?:string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// by right use 'customSchema', but been force to use any for avoid some error
|
|
17
|
-
const f:any = props.setting.fieldsetting
|
|
18
|
-
const modelValue = defineModel()
|
|
19
|
-
</script>
|
|
20
|
-
<template>
|
|
21
|
-
<SimpleAppAutocomplete v-if="f['x-foreignkey']" v-model="modelValue" :setting="props.setting" :hidelabel="hidelabel" :remote-src="getAutocomplete(typeof f['x-foreignkey']=='string' ? f['x-foreignkey'] : f['x-foreignkey']['target'])" optionLabel="label"/>
|
|
22
|
-
<SimpleAppCheckbox v-else-if="f.type=='boolean'" v-model="modelValue" :setting="props.setting" :hidelabel="hidelabel"/>
|
|
23
|
-
<SimpleAppNumber v-else-if="f.type=='number' || f.type=='integer'" v-model="modelValue" :setting="props.setting" :hidelabel="hidelabel"></SimpleAppNumber>
|
|
24
|
-
<SimpleAppSelect v-else-if="f.enum" v-model="modelValue" :setting="props.setting" :hidelabel="hidelabel"></SimpleAppSelect>
|
|
25
|
-
<SimpleAppChip v-else-if="f.type=='array' && f.items && f.items.type=='string'" v-model="modelValue" :setting="props.setting" :hidelabel="hidelabel"></SimpleAppChip>
|
|
26
|
-
<SimpleAppTextarea v-else-if="f.type=='string' && f.format=='text'" v-model="modelValue" :setting="props.setting" :hidelabel="hidelabel"></SimpleAppTextarea>
|
|
27
|
-
<SimpleAppText v-else-if="f.type=='string' && f.format" :type="f.format" v-model="modelValue" :setting="props.setting" :hidelabel="hidelabel"></SimpleAppText>
|
|
28
|
-
<SimpleAppText v-else v-model="modelValue" :setting="props.setting" :hidelabel="hidelabel"></SimpleAppText>
|
|
29
|
-
</template>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<template>
|
|
3
|
-
<FieldContainer v-bind="$attrs" v-model="modelValue" :label="label" :description="description" :setting="setting" :instancepath="instancepath" :error="error" #default="slotprops">
|
|
4
|
-
<Editor
|
|
5
|
-
class="simpleapp-inputfield"
|
|
6
|
-
:inputId="slotprops.uuid"
|
|
7
|
-
v-model="modelValue"
|
|
8
|
-
v-bind="$attrs"
|
|
9
|
-
:autoResize="autoResize"
|
|
10
|
-
:path="setting.instancepath"
|
|
11
|
-
></Editor>
|
|
12
|
-
</FieldContainer>
|
|
13
|
-
</template>
|
|
14
|
-
<script lang="ts" setup>
|
|
15
|
-
import {computed,watch,ref} from 'vue'
|
|
16
|
-
import Editor from 'primevue/editor';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
20
|
-
const modelValue = defineModel()
|
|
21
|
-
const props = defineProps<{
|
|
22
|
-
label?:string,
|
|
23
|
-
id?:string,
|
|
24
|
-
description?:string,
|
|
25
|
-
error?:string,
|
|
26
|
-
setting:any,
|
|
27
|
-
autoResize?:boolean,
|
|
28
|
-
instancepath?:string,
|
|
29
|
-
}>()
|
|
30
|
-
|
|
31
|
-
</script>
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<DataTable v-bind="$attrs" stripedRows resizableColumns
|
|
3
|
-
class="simpleapp-datatable p-datatable-sm" :value="modelValue">
|
|
4
|
-
<template #empty> <div class="text-center">No record found.</div> </template>
|
|
5
|
-
<template #header >
|
|
6
|
-
<div>
|
|
7
|
-
<Button icon="pi pi-plus" @click="addNew()" class="simpleapp-datatable-add btn-primary" type="button">Add</Button>
|
|
8
|
-
</div>
|
|
9
|
-
</template>
|
|
10
|
-
<slot>
|
|
11
|
-
<!-- <template> -->
|
|
12
|
-
|
|
13
|
-
<Column class="text-center" header="undefine columns">
|
|
14
|
-
<template #body>
|
|
15
|
-
<div class="text-center">Missing {{ '<Column></Column>' }}</div>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
</Column>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<!-- </template> -->
|
|
22
|
-
|
|
23
|
-
</slot>
|
|
24
|
-
</DataTable>
|
|
25
|
-
</template>
|
|
26
|
-
<script setup lang="ts">
|
|
27
|
-
|
|
28
|
-
import {ref} from 'vue'
|
|
29
|
-
import DataTable from 'primevue/datatable';
|
|
30
|
-
import Column from 'primevue/column';
|
|
31
|
-
import {camelCaseToWords} from './helper'
|
|
32
|
-
import type {InputTableColumn} from './type'
|
|
33
|
-
const props = defineProps<{
|
|
34
|
-
// columns:InputTableColumn[],
|
|
35
|
-
setting:any,
|
|
36
|
-
getField:Function,
|
|
37
|
-
getAutocomplete:Function, readonly?:boolean
|
|
38
|
-
}>()
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
//{path: '#/properties/details', instancepath: '/details', fieldsetting: {…}, modelObject: Proxy(Object), apiObj: INVApi, …}
|
|
42
|
-
const modelValue = defineModel<any[]>()
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const fieldsetting = props.setting.fieldsetting
|
|
46
|
-
|
|
47
|
-
const readonly = ref(false)
|
|
48
|
-
if(props.setting.readonly!==undefined ){
|
|
49
|
-
readonly.value = props.setting.readonly
|
|
50
|
-
}
|
|
51
|
-
if(props.readonly!==undefined ){
|
|
52
|
-
readonly.value = props.readonly
|
|
53
|
-
}
|
|
54
|
-
// const columns = ref(props.columns)
|
|
55
|
-
// for(let i=0;i<props.columns.length;i++){
|
|
56
|
-
// if(columns.value[i].title ===undefined){
|
|
57
|
-
// columns.value[i].title=columns.value[i].field
|
|
58
|
-
// }
|
|
59
|
-
// }
|
|
60
|
-
const getChildFieldSetting=(field:string)=>{
|
|
61
|
-
return props.getField(`${props.setting.path}/items/properties/${field}`)
|
|
62
|
-
}
|
|
63
|
-
const getInstancePath=(index:number,field:string)=>{
|
|
64
|
-
return `${props.setting.instancepath}/${index}/${field}`
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const deleteRow=(index: number)=>{
|
|
68
|
-
if(modelValue.value){
|
|
69
|
-
modelValue.value.splice(index,1)
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
const addNew = () => {
|
|
73
|
-
const field = props.setting.path.split('/').at(-1)
|
|
74
|
-
props.setting.document[`add${field}`]()
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* 1. support array with field to label
|
|
78
|
-
* 2. auto add edit button
|
|
79
|
-
* 3. option readonly or not readonly
|
|
80
|
-
* 4.
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
</script>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<template>
|
|
3
|
-
<FieldContainer v-bind="$attrs" v-model="modelValue" :label="label" :description="description" :setting="setting" :instancepath="instancepath" :error="error" #default="slotprops">
|
|
4
|
-
<Listbox v-model="modelValue"
|
|
5
|
-
class="simpleapp-inputfield"
|
|
6
|
-
:inputId="slotprops.uuid"
|
|
7
|
-
v-bind="$attrs"
|
|
8
|
-
:optionValue="optionValue"
|
|
9
|
-
:optionLabel="optionLabel"
|
|
10
|
-
:path="setting.instancepath"
|
|
11
|
-
:options="options"
|
|
12
|
-
/>
|
|
13
|
-
</FieldContainer>
|
|
14
|
-
</template>
|
|
15
|
-
<script lang="ts" setup>
|
|
16
|
-
import {computed,watch,ref} from 'vue'
|
|
17
|
-
import Listbox from 'primevue/listbox';
|
|
18
|
-
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
19
|
-
import {prepareList,simpleArrayToObject} from './helper'
|
|
20
|
-
import type {SimpleAppFieldSetting} from './type'
|
|
21
|
-
import type { JSONSchema7 } from 'json-schema';
|
|
22
|
-
const modelValue = defineModel()
|
|
23
|
-
const props = defineProps<{
|
|
24
|
-
label?:string,
|
|
25
|
-
description?:string,
|
|
26
|
-
error?:string,
|
|
27
|
-
setting:SimpleAppFieldSetting,
|
|
28
|
-
optionLabel?:string,
|
|
29
|
-
optionValue?:string,
|
|
30
|
-
instancepath?:string,
|
|
31
|
-
options?:any[],
|
|
32
|
-
}>()
|
|
33
|
-
const optionValue = props.optionValue ?? 'label'
|
|
34
|
-
const optionLabel = props.optionLabel ?? 'value'
|
|
35
|
-
const options = prepareList('oneOf',props.setting.fieldsetting,optionLabel,optionValue,props.options,)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</script>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<template>
|
|
3
|
-
<FieldContainer v-bind="$attrs" :refto="id" v-model="modelValue" :label="label" :description="description" :setting="setting" :instancepath="instancepath" :error="error" #default="slotprops">
|
|
4
|
-
<Listbox v-model="modelValue"
|
|
5
|
-
class="simpleapp-inputfield"
|
|
6
|
-
:id="slotprops.uuid"
|
|
7
|
-
v-bind="$attrs"
|
|
8
|
-
optionValue="value"
|
|
9
|
-
optionLabel="label"
|
|
10
|
-
:path="setting.instancepath"
|
|
11
|
-
:options="options"
|
|
12
|
-
multiple
|
|
13
|
-
/>
|
|
14
|
-
</FieldContainer>
|
|
15
|
-
</template>
|
|
16
|
-
<script lang="ts" setup>
|
|
17
|
-
import {computed,watch,ref} from 'vue'
|
|
18
|
-
import Listbox from 'primevue/listbox';
|
|
19
|
-
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
20
|
-
import {prepareList,simpleArrayToObject} from './helper'
|
|
21
|
-
import type {SimpleAppFieldSetting} from './type'
|
|
22
|
-
import type { JSONSchema7 } from 'json-schema';
|
|
23
|
-
const modelValue = defineModel()
|
|
24
|
-
const props = defineProps<{
|
|
25
|
-
label?:string,
|
|
26
|
-
id?:string,
|
|
27
|
-
description?:string,
|
|
28
|
-
error?:string,
|
|
29
|
-
setting:SimpleAppFieldSetting,
|
|
30
|
-
optionLabel?:string,
|
|
31
|
-
optionValue?:string,
|
|
32
|
-
instancepath?:string,
|
|
33
|
-
options?:any[],
|
|
34
|
-
}>()
|
|
35
|
-
const optionValue = props.optionValue ?? 'label'
|
|
36
|
-
const optionLabel = props.optionLabel ?? 'value'
|
|
37
|
-
|
|
38
|
-
const options = prepareList('anyOf',props.setting.fieldsetting.items,optionLabel,optionValue,props.options,)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
</script>
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<template>
|
|
3
|
-
<FieldContainer :hidelabel="hidelabel" v-model="modelValue" :label="label" :description="description" :setting="setting" :instancepath="instancepath" :error="error" #default="slotprops">
|
|
4
|
-
<InputNumber class="simpleapp-inputfield"
|
|
5
|
-
:inputId="slotprops.uuid"
|
|
6
|
-
v-model="modelValue"
|
|
7
|
-
:path="setting.instancepath"
|
|
8
|
-
:pt="{input:{class:'text-right w-full'}}"
|
|
9
|
-
:readonly="isReadonly"
|
|
10
|
-
></InputNumber>
|
|
11
|
-
</FieldContainer>
|
|
12
|
-
</template>
|
|
13
|
-
<script lang="ts" setup>
|
|
14
|
-
import {computed,watch,ref} from 'vue'
|
|
15
|
-
import InputNumber from 'primevue/inputnumber';
|
|
16
|
-
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
17
|
-
const props = withDefaults(defineProps<{
|
|
18
|
-
label?:string,
|
|
19
|
-
description?:string,
|
|
20
|
-
setting:any
|
|
21
|
-
error?:string,
|
|
22
|
-
instancepath?:string,
|
|
23
|
-
hidelabel?:boolean
|
|
24
|
-
readonly?:boolean
|
|
25
|
-
}>(),{
|
|
26
|
-
hidelabel:false
|
|
27
|
-
})
|
|
28
|
-
const emit = defineEmits(['change'])
|
|
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
|
-
})
|
|
39
|
-
watch(modelValue,()=>{
|
|
40
|
-
// props.setting.document.validateFailed()
|
|
41
|
-
emit('change',modelValue)
|
|
42
|
-
})
|
|
43
|
-
</script>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<template>
|
|
3
|
-
<FieldContainer v-bind="$attrs" v-model="modelValue" :label="label" :description="description" :setting="setting" :instancepath="instancepath" :error="error" #default="slotprops">
|
|
4
|
-
<Password
|
|
5
|
-
class="simpleapp-inputfield"
|
|
6
|
-
:inputId="slotprops.uuid"
|
|
7
|
-
v-model="modelValue"
|
|
8
|
-
v-bind="$attrs"
|
|
9
|
-
:path="setting.instancepath"
|
|
10
|
-
></Password>
|
|
11
|
-
</FieldContainer>
|
|
12
|
-
</template>
|
|
13
|
-
<script lang="ts" setup>
|
|
14
|
-
import {computed,watch,ref} from 'vue'
|
|
15
|
-
import Password from 'primevue/password';
|
|
16
|
-
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
17
|
-
const modelValue = defineModel()
|
|
18
|
-
const props = defineProps<{
|
|
19
|
-
label?:string,
|
|
20
|
-
id?:string,
|
|
21
|
-
description?:string,
|
|
22
|
-
error?:string,
|
|
23
|
-
setting:any,
|
|
24
|
-
instancepath?:string,
|
|
25
|
-
}>()
|
|
26
|
-
|
|
27
|
-
// const modelValue = defineModel<{modelValue?:string}>()
|
|
28
|
-
// console.log(modelValue.value)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
// const emits = defineEmits(['update:modelValue'])
|
|
32
|
-
// const onchange=(e:any)=>{
|
|
33
|
-
// emits('update:modelValue',e.target.value)
|
|
34
|
-
// }
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// watch(props ,(after,before)=>{
|
|
38
|
-
// // console.log("B4",before,"after",after)
|
|
39
|
-
// inputvalue.value=after.modelValue
|
|
40
|
-
// })
|
|
41
|
-
</script>
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<template>
|
|
3
|
-
<FieldContainer v-bind="$attrs"
|
|
4
|
-
v-model="modelValue"
|
|
5
|
-
:label="label"
|
|
6
|
-
:description="description"
|
|
7
|
-
:setting="setting"
|
|
8
|
-
:instancepath="instancepath"
|
|
9
|
-
:error="error"
|
|
10
|
-
#default="slotprops">
|
|
11
|
-
<div v-for="(o, index) in options" :key="index" class="simpleapp-inputradio">
|
|
12
|
-
<RadioButton
|
|
13
|
-
v-model="modelValue"
|
|
14
|
-
:inputId="`${slotprops.uuid}_${index}`"
|
|
15
|
-
:value="o.value" />
|
|
16
|
-
<label :for="`${slotprops.uuid}_${index}`">{{ o.label }}</label>
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
</FieldContainer>
|
|
21
|
-
</template>
|
|
22
|
-
<script lang="ts" setup>
|
|
23
|
-
import RadioButton from 'primevue/radiobutton';
|
|
24
|
-
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
25
|
-
import {prepareList,simpleArrayToObject} from './helper'
|
|
26
|
-
import type {ListOptionType} from './type'
|
|
27
|
-
const modelValue = defineModel()
|
|
28
|
-
const props = defineProps<{
|
|
29
|
-
label?:string,
|
|
30
|
-
description?:string,
|
|
31
|
-
error?:string,
|
|
32
|
-
setting:any,
|
|
33
|
-
optionLabel?:string,
|
|
34
|
-
optionValue?:string,
|
|
35
|
-
instancepath?:string,
|
|
36
|
-
options?:any[],
|
|
37
|
-
}>()
|
|
38
|
-
const optionValue = props.optionValue ?? 'label'
|
|
39
|
-
const optionLabel = props.optionLabel ?? 'value'
|
|
40
|
-
const options = prepareList('oneOf',props.setting.fieldsetting,optionLabel,optionValue,props.options,)
|
|
41
|
-
|
|
42
|
-
</script>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<template>
|
|
3
|
-
<FieldContainer v-bind="$attrs" v-model="modelValue" :label="label" :description="description" :setting="setting" :instancepath="instancepath" :error="error" #default="slotprops">
|
|
4
|
-
<Rating
|
|
5
|
-
class="simpleapp-inputfield"
|
|
6
|
-
:inputId="slotprops.uuid"
|
|
7
|
-
v-model="modelValue"
|
|
8
|
-
v-bind="$attrs"
|
|
9
|
-
:path="setting.instancepath"
|
|
10
|
-
></Rating>
|
|
11
|
-
</FieldContainer>
|
|
12
|
-
</template>
|
|
13
|
-
<script lang="ts" setup>
|
|
14
|
-
import {computed,watch,ref} from 'vue'
|
|
15
|
-
import Rating from 'primevue/rating';
|
|
16
|
-
|
|
17
|
-
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
18
|
-
const modelValue = defineModel()
|
|
19
|
-
const props = defineProps<{
|
|
20
|
-
label?:string,
|
|
21
|
-
description?:string,
|
|
22
|
-
error?:string,
|
|
23
|
-
setting:any,
|
|
24
|
-
instancepath?:string,
|
|
25
|
-
}>()
|
|
26
|
-
|
|
27
|
-
// const modelValue = defineModel<{modelValue?:string}>()
|
|
28
|
-
// console.log(modelValue.value)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
// const emits = defineEmits(['update:modelValue'])
|
|
32
|
-
// const onchange=(e:any)=>{
|
|
33
|
-
// emits('update:modelValue',e.target.value)
|
|
34
|
-
// }
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// watch(props ,(after,before)=>{
|
|
38
|
-
// // console.log("B4",before,"after",after)
|
|
39
|
-
// inputvalue.value=after.modelValue
|
|
40
|
-
// })
|
|
41
|
-
</script>
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<template>
|
|
3
|
-
<FieldContainer v-bind="$attrs" v-model="modelValue" :label="label" :description="description" :setting="setting" :instancepath="instancepath" :error="error" #default="slotprops">
|
|
4
|
-
<Dropdown v-model="modelValue"
|
|
5
|
-
class="simpleapp-inputfield"
|
|
6
|
-
:inputId="slotprops.uuid"
|
|
7
|
-
v-bind="$attrs"
|
|
8
|
-
optionValue="value"
|
|
9
|
-
optionLabel="label"
|
|
10
|
-
:path="setting.instancepath"
|
|
11
|
-
:options="options"
|
|
12
|
-
:readonly="isReadonly"
|
|
13
|
-
/>
|
|
14
|
-
</FieldContainer>
|
|
15
|
-
</template>
|
|
16
|
-
<script lang="ts" setup>
|
|
17
|
-
import {computed,watch,ref} from 'vue'
|
|
18
|
-
import Dropdown from 'primevue/dropdown';
|
|
19
|
-
import FieldContainer from './SimpleAppFieldContainer.vue'
|
|
20
|
-
import {prepareList,simpleArrayToObject} from './helper'
|
|
21
|
-
import type {ListOptionType} from './type'
|
|
22
|
-
import type { JSONSchema7 } from 'json-schema';
|
|
23
|
-
const modelValue = defineModel()
|
|
24
|
-
const props = defineProps<{
|
|
25
|
-
label?:string,
|
|
26
|
-
description?:string,
|
|
27
|
-
error?:string,
|
|
28
|
-
setting:any,
|
|
29
|
-
optionLabel?:string,
|
|
30
|
-
optionValue?:string,
|
|
31
|
-
instancepath?:string,
|
|
32
|
-
options?:any[]
|
|
33
|
-
readonly?:boolean
|
|
34
|
-
}>()
|
|
35
|
-
|
|
36
|
-
const optionValue = props.optionValue ?? 'value'
|
|
37
|
-
const optionLabel = props.optionLabel ?? 'label'
|
|
38
|
-
const options = prepareList('oneOf',props.setting.fieldsetting,optionLabel,optionValue,props.options,)
|
|
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
|
-
})
|
|
48
|
-
</script>
|