@simitgroup/simpleapp-generator 1.3.1-alpha → 1.3.3-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 +7 -3
- package/dist/generate.js.map +1 -1
- package/package.json +1 -1
- package/src/generate.ts +7 -3
- 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/viewer/readme.md.eta +1 -0
- 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/10.simpleapp-event.ts.eta +1 -1
- 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 +2 -2
- 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,172 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* This file was automatically generated by simpleapp generator during initialization.
|
|
4
|
-
* DO NOT MODIFY IT BY HAND.
|
|
5
|
-
* last change 2023-09-09
|
|
6
|
-
* author: Ks Tan
|
|
7
|
-
*/
|
|
8
|
-
import {ref} from 'vue'
|
|
9
|
-
import _ from 'lodash'
|
|
10
|
-
import {SearchBody} from '~/types'
|
|
11
|
-
import { SimpleAppClient } from '../simpleapp/generate/clients/SimpleAppClient' //'../SimpleAppClient';
|
|
12
|
-
// import SimpleAppForm from '@simitgroup/simpleapp-vue-component/src/components/SimpleAppForm.vue';
|
|
13
|
-
// import SimpleAppDatatable from '@simitgroup/simpleapp-vue-component/src/components/SimpleAppDatatable.vue';
|
|
14
|
-
import Dialog from 'primevue/dialog';
|
|
15
|
-
// import axios from 'axios'
|
|
16
|
-
import ProgressSpinner from 'primevue/progressspinner';
|
|
17
|
-
import ConfirmPopup from 'primevue/confirmpopup';
|
|
18
|
-
import { useConfirm } from "primevue/useconfirm";
|
|
19
|
-
|
|
20
|
-
const confirm = useConfirm();
|
|
21
|
-
const props = defineProps<{
|
|
22
|
-
document:SimpleAppClient<any,any>
|
|
23
|
-
listColumns:string[]
|
|
24
|
-
path:string
|
|
25
|
-
title:string
|
|
26
|
-
}>()
|
|
27
|
-
|
|
28
|
-
const visible = ref(false)
|
|
29
|
-
const obj = props.document
|
|
30
|
-
const resourcename = ref( _.upperFirst(props.document.getDocName()))
|
|
31
|
-
const data = obj.getReactiveData()
|
|
32
|
-
const disabled=ref(false)
|
|
33
|
-
const recordlist = ref();
|
|
34
|
-
const router = useRouter()
|
|
35
|
-
const route = useRoute()
|
|
36
|
-
const filters = ref()
|
|
37
|
-
const popuptitle = ref("New "+props.title)
|
|
38
|
-
const {$event} = useNuxtApp()
|
|
39
|
-
const systemwindows = ref(false)
|
|
40
|
-
const currentjsonschema:any = props.document.getSchema()
|
|
41
|
-
if(['none'].includes(currentjsonschema['x-isolation-type'])){
|
|
42
|
-
systemwindows.value=true
|
|
43
|
-
}
|
|
44
|
-
watch(visible,(newvalue )=>{
|
|
45
|
-
if(newvalue == false){
|
|
46
|
-
if(data.value.created!=''){
|
|
47
|
-
newData()
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
})
|
|
52
|
-
defineShortcuts({
|
|
53
|
-
'ctrl_enter': () => newData()
|
|
54
|
-
})
|
|
55
|
-
const refresh = () => {
|
|
56
|
-
const searchbody: SearchBody = {
|
|
57
|
-
fields: props.listColumns.concat(['created']),
|
|
58
|
-
// sorts:props.sorts
|
|
59
|
-
}
|
|
60
|
-
obj.search(searchbody).then((res:any) => {
|
|
61
|
-
recordlist.value = res;
|
|
62
|
-
disabled.value=false
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
const newData = () => {
|
|
66
|
-
router.push({ path: `${props.path}` })
|
|
67
|
-
obj.setNew()
|
|
68
|
-
visible.value=true;
|
|
69
|
-
$event("newRecord")
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const triggerEdit = (data: any) => {
|
|
73
|
-
let id = data._id.toString()
|
|
74
|
-
router.push({ path: `${props.path}/${id}` })
|
|
75
|
-
};
|
|
76
|
-
const editRecord = (id:string) => {
|
|
77
|
-
obj.getById(id).then(()=>{
|
|
78
|
-
visible.value=true
|
|
79
|
-
popuptitle.value = "Edit "+props.title
|
|
80
|
-
$event("editRecord",id)
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
};
|
|
84
|
-
const createData =()=>{
|
|
85
|
-
disabled.value=true
|
|
86
|
-
obj.create().then(()=>{
|
|
87
|
-
visible.value=false
|
|
88
|
-
refresh()
|
|
89
|
-
}).catch(err=>{
|
|
90
|
-
console.error(err)
|
|
91
|
-
}).finally(()=>disabled.value=false)
|
|
92
|
-
}
|
|
93
|
-
const updateData =()=>{
|
|
94
|
-
disabled.value=true
|
|
95
|
-
obj.update().then(()=>{
|
|
96
|
-
visible.value=false
|
|
97
|
-
refresh()
|
|
98
|
-
}).catch(err=>{
|
|
99
|
-
console.error(err)
|
|
100
|
-
}).finally(()=>disabled.value=false)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const deleteData = (event:Event) => {
|
|
104
|
-
|
|
105
|
-
confirm.require({
|
|
106
|
-
target: event.currentTarget as HTMLElement,
|
|
107
|
-
message:'Delete?',
|
|
108
|
-
icon: 'pi pi-exclamation-triangle',
|
|
109
|
-
acceptClass: 'p-button-danger',
|
|
110
|
-
accept: ()=>{
|
|
111
|
-
disabled.value=true
|
|
112
|
-
obj.delete(data.value._id ?? "").then(()=>visible.value=false).finally(() => {
|
|
113
|
-
refresh();
|
|
114
|
-
});
|
|
115
|
-
},
|
|
116
|
-
reject: () => {
|
|
117
|
-
console.log("Cancel delete")
|
|
118
|
-
}
|
|
119
|
-
})
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
onNuxtReady(()=>{
|
|
123
|
-
if (route.params.id) {
|
|
124
|
-
const recordid:string = route.params.id.toString()
|
|
125
|
-
editRecord(recordid)
|
|
126
|
-
}
|
|
127
|
-
refresh();
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
</script>
|
|
132
|
-
|
|
133
|
-
<template>
|
|
134
|
-
<div class="simpleapp-crudnesteddocument">
|
|
135
|
-
<h1 v-if="systemwindows" class="error-text text-center">* It is system administration screen</h1>
|
|
136
|
-
<Button class="btn-primary" @click="newData" v-tooltip="'Add new(ctrl+enter)'" v-if="canPerform(resourcename,'create')">New</Button>
|
|
137
|
-
<SimpleAppDatatable
|
|
138
|
-
@row-dblclick="triggerEdit"
|
|
139
|
-
v-model="recordlist"
|
|
140
|
-
:setting="{}"
|
|
141
|
-
:columns="listColumns"
|
|
142
|
-
>
|
|
143
|
-
<Column header=" ">
|
|
144
|
-
<template #body="{index,data}">
|
|
145
|
-
<Button icon="pi pi-pencil" class="btn-primary" @click="triggerEdit(data)"></Button>
|
|
146
|
-
</template></Column>
|
|
147
|
-
</SimpleAppDatatable>
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
</div>
|
|
151
|
-
|
|
152
|
-
<Dialog v-model:visible="visible" modal :header="popuptitle" class="crudsimple-dialog" :autoZIndex="false" :style="{zIndex:100, width: '80vw' }">
|
|
153
|
-
<SimpleAppForm :document="obj" #default="o">
|
|
154
|
-
<div class="simpleapp-tool-bar col-span-4 text-left gap-4" >
|
|
155
|
-
<Button class=" btn-default" :disabled="disabled" @click="newData" type="button" v-if="canPerform(resourcename,'create')">New</Button>
|
|
156
|
-
<Button class=" btn-primary" :disabled="disabled" @click="createData" type="button" v-if="canPerform(resourcename,'update') && data.created==''">Create</Button>
|
|
157
|
-
<Button class=" btn-primary" :disabled="disabled" @click="updateData" type="button" v-if="canPerform(resourcename,'update') && data.created!=''">Update</Button>
|
|
158
|
-
<Button class=" btn-danger" :disabled="disabled" @click="deleteData($event)" type="button" v-if="canPerform(resourcename,'delete') && data.created!=''">Delete</Button>
|
|
159
|
-
<ProgressSpinner v-if="disabled==true" style="width: 2rem; height: 2rem" ></ProgressSpinner>
|
|
160
|
-
<ConfirmPopup></ConfirmPopup>
|
|
161
|
-
|
|
162
|
-
</div>
|
|
163
|
-
<slot :data="o.data" :getField="o.getField" name="default"></slot>
|
|
164
|
-
</SimpleAppForm>
|
|
165
|
-
</Dialog>
|
|
166
|
-
</template>
|
|
167
|
-
|
|
168
|
-
<style scoped>
|
|
169
|
-
.crudsimple-dialog{
|
|
170
|
-
z-index: 100;
|
|
171
|
-
}
|
|
172
|
-
</style>
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* This file was automatically generated by simpleapp generator during initialization.
|
|
4
|
-
* DO NOT MODIFY IT BY HAND.
|
|
5
|
-
* last change 2023-09-09
|
|
6
|
-
* author: Ks Tan
|
|
7
|
-
*/
|
|
8
|
-
import {ref} from 'vue'
|
|
9
|
-
import _ from 'lodash'
|
|
10
|
-
import { SimpleAppClient } from '../simpleapp/generate/clients/SimpleAppClient' //'../SimpleAppClient';
|
|
11
|
-
// import SimpleAppForm from '@simitgroup/simpleapp-vue-component/src/components/SimpleAppForm.vue';
|
|
12
|
-
// import SimpleAppDatatable from '@simitgroup/simpleapp-vue-component/src/components/SimpleAppDatatable.vue';
|
|
13
|
-
import Dialog from 'primevue/dialog';
|
|
14
|
-
// import axios from 'axios'
|
|
15
|
-
import ProgressSpinner from 'primevue/progressspinner';
|
|
16
|
-
import ConfirmPopup from 'primevue/confirmpopup';
|
|
17
|
-
import { useConfirm } from "primevue/useconfirm";
|
|
18
|
-
import {SearchBody} from '~/types'
|
|
19
|
-
const confirm = useConfirm();
|
|
20
|
-
const props = defineProps<{
|
|
21
|
-
document:SimpleAppClient<any,any>
|
|
22
|
-
listColumns:string[]
|
|
23
|
-
path:string
|
|
24
|
-
title:string
|
|
25
|
-
sorts?: any
|
|
26
|
-
}>()
|
|
27
|
-
const resourcename = ref( _.upperFirst(props.document.getDocName()))
|
|
28
|
-
const visible = ref(false)
|
|
29
|
-
const obj = props.document
|
|
30
|
-
const data = obj.getReactiveData()
|
|
31
|
-
const disabled=ref(false)
|
|
32
|
-
const recordlist = ref();
|
|
33
|
-
const router = useRouter()
|
|
34
|
-
const route = useRoute()
|
|
35
|
-
const filters = ref()
|
|
36
|
-
const popuptitle = ref("New "+props.title)
|
|
37
|
-
const systemwindows = ref(false)
|
|
38
|
-
const {$event} = useNuxtApp()
|
|
39
|
-
const currentjsonschema:any = props.document.getSchema()
|
|
40
|
-
|
|
41
|
-
if(['none'].includes(currentjsonschema['x-isolation-type'])){
|
|
42
|
-
systemwindows.value=true
|
|
43
|
-
}
|
|
44
|
-
watch(visible,(newvalue )=>{
|
|
45
|
-
if(newvalue == false){
|
|
46
|
-
if(data.value.created!=''){
|
|
47
|
-
newData()
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
})
|
|
52
|
-
defineShortcuts({
|
|
53
|
-
'ctrl_enter': () => newData()
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
const refresh = () => {
|
|
57
|
-
const searchbody: SearchBody = {
|
|
58
|
-
fields: props.listColumns.concat(['created']),
|
|
59
|
-
sorts:props.sorts
|
|
60
|
-
}
|
|
61
|
-
obj.search(searchbody).then((res:any) => {
|
|
62
|
-
recordlist.value = res;
|
|
63
|
-
disabled.value=false
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
const newData = () => {
|
|
67
|
-
router.push({ path: `${props.path}` })
|
|
68
|
-
obj.setNew()
|
|
69
|
-
visible.value=true;
|
|
70
|
-
$event("newRecord")
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const triggerEdit = (data: any) => {
|
|
74
|
-
let id = data._id
|
|
75
|
-
router.push({ path: `${props.path}/${id}` })
|
|
76
|
-
};
|
|
77
|
-
const editRecord = (id:string) => {
|
|
78
|
-
|
|
79
|
-
console.log("editRecord",id)
|
|
80
|
-
|
|
81
|
-
obj.getById(id).then(()=>{
|
|
82
|
-
visible.value=true
|
|
83
|
-
popuptitle.value = "Edit "+props.title
|
|
84
|
-
$event("editRecord",id)
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
};
|
|
88
|
-
const createData = async () => {
|
|
89
|
-
disabled.value=true
|
|
90
|
-
|
|
91
|
-
obj.create().then(()=>{
|
|
92
|
-
visible.value=false
|
|
93
|
-
refresh()
|
|
94
|
-
}).catch(err=>{
|
|
95
|
-
console.error(err)
|
|
96
|
-
}).finally(()=>disabled.value=false)
|
|
97
|
-
|
|
98
|
-
};
|
|
99
|
-
const updateData = async () => {
|
|
100
|
-
disabled.value=true
|
|
101
|
-
|
|
102
|
-
obj.update().then(()=>{
|
|
103
|
-
visible.value=false
|
|
104
|
-
refresh()
|
|
105
|
-
}).catch(err=>{
|
|
106
|
-
console.error(err)
|
|
107
|
-
}).finally(()=>disabled.value=false)
|
|
108
|
-
|
|
109
|
-
};
|
|
110
|
-
const deleteData = (event:Event) => {
|
|
111
|
-
|
|
112
|
-
confirm.require({
|
|
113
|
-
target: event.currentTarget as HTMLElement,
|
|
114
|
-
message:'Delete?',
|
|
115
|
-
icon: 'pi pi-exclamation-triangle',
|
|
116
|
-
acceptClass: 'p-button-danger',
|
|
117
|
-
accept: ()=>{
|
|
118
|
-
disabled.value=true
|
|
119
|
-
obj.delete(data.value._id ?? "").then(()=>visible.value=false).finally(() => {
|
|
120
|
-
refresh();
|
|
121
|
-
});
|
|
122
|
-
},
|
|
123
|
-
reject: () => {
|
|
124
|
-
console.log("Cancel delete")
|
|
125
|
-
}
|
|
126
|
-
})
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
onNuxtReady(()=>{
|
|
130
|
-
refresh()
|
|
131
|
-
if (route.params.id) {
|
|
132
|
-
const recordid:string = route.params.id.toString()
|
|
133
|
-
editRecord(recordid)
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
</script>
|
|
140
|
-
|
|
141
|
-
<template>
|
|
142
|
-
<div class="simpleapp-crudsimple">
|
|
143
|
-
<h1 v-if="systemwindows" class="error-text text-center">* system administration screen</h1>
|
|
144
|
-
<Button class=" btn-primary" @click="newData" v-tooltip="'Add new(ctrl+enter)'" v-if="canPerform(resourcename,'create')">New</Button>
|
|
145
|
-
<SimpleAppDatatable
|
|
146
|
-
v-model="recordlist"
|
|
147
|
-
:setting="{}"
|
|
148
|
-
:columns="listColumns"
|
|
149
|
-
>
|
|
150
|
-
<Column header=" ">
|
|
151
|
-
<template #body="{index,data}">
|
|
152
|
-
<Button icon="pi pi-pencil" class="btn-primary" @click="triggerEdit(data)"></Button>
|
|
153
|
-
</template></Column>
|
|
154
|
-
</SimpleAppDatatable>
|
|
155
|
-
|
|
156
|
-
<DebugDocumentData v-model="data"/>
|
|
157
|
-
</div>
|
|
158
|
-
|
|
159
|
-
<Dialog v-model:visible="visible" modal :header="popuptitle" class="crudsimple-dialog" :autoZIndex="false" :pt="{root:{class:'h-full w-full bg-white'}}">
|
|
160
|
-
<SimpleAppForm :document="obj" #default="o">
|
|
161
|
-
<div class="simpleapp-tool-bar col-span-4 text-left gap-4" >
|
|
162
|
-
<Button class=" btn-default" :disabled="disabled" @click="newData" type="button" v-if="canPerform(resourcename,'create')">New</Button>
|
|
163
|
-
<Button class=" btn-primary" :disabled="disabled" @click="createData" type="button" v-if="canPerform(resourcename,'create') && data.created==''">Create</Button>
|
|
164
|
-
<Button class=" btn-primary" :disabled="disabled" @click="updateData" type="button" v-if="canPerform(resourcename,'update') && data.created!=''">Update</Button>
|
|
165
|
-
<Button class=" btn-danger" :disabled="disabled" @click="deleteData($event)" type="button" v-if="canPerform(resourcename,'delete') && data.created!=''">Delete</Button>
|
|
166
|
-
<ProgressSpinner v-if="disabled==true" style="width: 2rem; height: 2rem" ></ProgressSpinner>
|
|
167
|
-
<ConfirmPopup></ConfirmPopup>
|
|
168
|
-
|
|
169
|
-
</div>
|
|
170
|
-
<div class="grid grid-cols-4 gap-4 w-full">
|
|
171
|
-
<slot :data="o.data" :getField="o.getField" name="default"></slot>
|
|
172
|
-
</div>
|
|
173
|
-
</SimpleAppForm>
|
|
174
|
-
</Dialog>
|
|
175
|
-
</template>
|
|
176
|
-
|
|
177
|
-
<style scoped>
|
|
178
|
-
.crudsimple-dialog{
|
|
179
|
-
z-index: 100;
|
|
180
|
-
}
|
|
181
|
-
</style>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* This file was automatically generated by simpleapp generator during initialization.
|
|
4
|
-
* You may modify it by hand
|
|
5
|
-
* last change 2023-09-10
|
|
6
|
-
* author: Ks Tan
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
// import MegaMenu from 'primevue/megamenu';
|
|
10
|
-
// import Menubar from 'primevue/menubar';
|
|
11
|
-
// const route = useRoute()
|
|
12
|
-
// const menus = getMenus(route.params.xorg)
|
|
13
|
-
import MenuIndex from "../pages/[xorg]/index.vue"
|
|
14
|
-
// import XorgPicker from "../pages/index.vue"
|
|
15
|
-
import Dialog from 'primevue/dialog';
|
|
16
|
-
import {ref} from 'vue'
|
|
17
|
-
const visible = ref(false)
|
|
18
|
-
const visibletenant = ref(false)
|
|
19
|
-
|
|
20
|
-
</script>
|
|
21
|
-
<template>
|
|
22
|
-
<!-- <header> -->
|
|
23
|
-
<!-- <MegaMenu :model="getMenus()" orientation="horizontal" /> -->
|
|
24
|
-
<div class="bg-white border-b-2 border-b-gray-300 h-10 flex">
|
|
25
|
-
|
|
26
|
-
<Dialog v-model:visible="visible" modal header="Pick Document" :autoZIndex="false" :style="{zIndex:100, width: '80vw' }">
|
|
27
|
-
<MenuIndex></MenuIndex>
|
|
28
|
-
</Dialog>
|
|
29
|
-
<Dialog v-model:visible="visibletenant" modal header="Pick Tenant" :autoZIndex="false" :style="{zIndex:100, width: '80vw' }">
|
|
30
|
-
|
|
31
|
-
</Dialog>
|
|
32
|
-
|
|
33
|
-
<div class="flex-1">
|
|
34
|
-
<NuxtLink to="/" :external="true"><i class="pi pi-home m-2"></i>Home</NuxtLink>
|
|
35
|
-
</div>
|
|
36
|
-
<div class="flex-1 p-1">
|
|
37
|
-
<Button class="text-center border-none cursor-pointer" v-if="useRoute().params.xorg" @click="visible=true">
|
|
38
|
-
<i class="pi pi-microsoft mr-2"></i>Menu</Button>
|
|
39
|
-
<span v-else></span>
|
|
40
|
-
</div>
|
|
41
|
-
<div class="flex-1 p-1">
|
|
42
|
-
<Button class="text-center border-none cursor-pointer" v-if="useRoute().params.xorg" @click="visibletenant=true">
|
|
43
|
-
<i class="pi pi-globe mr-2"></i>
|
|
44
|
-
|
|
45
|
-
{{ getUserProfile().branchCode }} - {{ getUserProfile().branchName }}
|
|
46
|
-
</Button>
|
|
47
|
-
<span v-else></span>
|
|
48
|
-
</div>
|
|
49
|
-
<div class="flex-1 text-right p-1">
|
|
50
|
-
<Button class=" cursor-pointer border-none" @click="logout()">
|
|
51
|
-
<i class="pi pi-sign-out mr-2"></i>logout {{ getUserProfile().fullName }}
|
|
52
|
-
</Button>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
</div>
|
|
57
|
-
<!-- </header> -->
|
|
58
|
-
</template>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div role="status">
|
|
3
|
-
<svg aria-hidden="true" class="w-8 h-8 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
-
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/>
|
|
5
|
-
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/>
|
|
6
|
-
</svg>
|
|
7
|
-
<span class="sr-only">Loading...</span>
|
|
8
|
-
</div>
|
|
9
|
-
</template>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
//auto generate from lang/default.ts
|
|
3
|
-
<%let langkeys = Object.keys(it.lang) %>
|
|
4
|
-
<% for(let l=0; l< langkeys.length; l++){ %>
|
|
5
|
-
<% let key = langkeys[l] %>
|
|
6
|
-
'<%=key%>' : '<%= it.lang[key] %>',
|
|
7
|
-
<%}%>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
//auto generate from schema
|
|
11
|
-
<% for(let i=0; i< it.allfields.length; i++){ %>
|
|
12
|
-
<% let f = it.allfields[i] %>
|
|
13
|
-
'<%= f %>' : '<%= camelCaseToWords(f) %>',
|
|
14
|
-
<%}%>
|
|
15
|
-
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const hello = () => "hello"
|