@simitgroup/simpleapp-generator 1.2.8 → 1.3.0-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/buildinschemas/organization.d.ts.map +1 -1
- package/dist/buildinschemas/organization.js +3 -1
- package/dist/buildinschemas/organization.js.map +1 -1
- package/dist/framework.d.ts.map +1 -1
- package/dist/framework.js +3 -8
- package/dist/framework.js.map +1 -1
- package/dist/generate.js +14 -14
- package/dist/generate.js.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/organization.ts +3 -1
- package/src/framework.ts +4 -8
- package/src/generate.ts +17 -16
- package/templates/basic/nest/controller.ts.eta +17 -0
- package/templates/basic/nest/default.ts.eta +6 -2
- package/templates/basic/nuxt/default.ts.eta +10 -6
- package/templates/basic/nuxt/pages.[id].vue.eta +9 -7
- package/templates/basic/nuxt/pages.form.vue.eta +16 -36
- package/templates/basic/nuxt/pages.landing.vue.eta +42 -35
- package/templates/basic/nuxt/pages.viewer.vue.eta +4 -6
- package/templates/nest/.env._eta +0 -1
- package/templates/nest/src/simpleapp/generate/commons/user.context.ts.eta +14 -2
- package/templates/nest/src/simpleapp/generate/controllers/simpleapp.controller.ts.eta +32 -18
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +76 -13
- package/templates/nuxt/assets/css/style.css._eta +19 -7
- package/templates/nuxt/assets/primevue/passthrough.ts._eta +20 -9
- package/templates/nuxt/components/button/ButtonDefault.vue._eta +1 -2
- package/templates/nuxt/components/button/ButtonMultiple.vue._eta +21 -0
- package/templates/nuxt/components/debug/DebugDocumentData.vue.eta +3 -4
- package/templates/nuxt/components/event/EventDocumentViewer.vue._eta +75 -65
- package/templates/nuxt/components/form/FormBranch.vue.eta +83 -0
- package/templates/nuxt/components/form/readme.md.eta +1 -0
- package/templates/nuxt/components/header/button/HeaderButtonMenuPicker.vue._eta +13 -11
- package/templates/nuxt/components/header/button/HeaderButtonProfile.vue.eta +11 -17
- package/templates/nuxt/components/list/ListDocument.vue.eta +25 -0
- package/templates/nuxt/components/list/ListDocumentTable.vue.eta +77 -0
- package/templates/nuxt/components/list/ListView.vue.eta +129 -60
- package/templates/nuxt/components/mobile/MobileToolbar.vue.eta +10 -0
- package/templates/nuxt/components/overlay/OverlaySideBarCrud.vue.eta +21 -0
- package/templates/nuxt/components/overlay/OverlayViewer.vue.eta +20 -0
- package/templates/nuxt/components/page/PageDocList.vue.eta +170 -0
- package/templates/nuxt/components/renderer/RendererBoolean.vue.eta +8 -4
- package/templates/nuxt/components/renderer/RendererDate.vue.eta +4 -4
- package/templates/nuxt/components/renderer/RendererLink.vue.eta +12 -20
- package/templates/nuxt/components/renderer/RendererViewer.vue.eta +27 -21
- package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +201 -174
- package/templates/nuxt/components/simpleApp/SimpleAppFieldContainer.vue.eta +115 -111
- package/templates/nuxt/components/simpleApp/SimpleAppFormToolBar.vue.eta +183 -91
- package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +383 -263
- package/templates/nuxt/components/table/TableDocuments.vue.eta +3 -3
- package/templates/nuxt/components/text/TextDanger.vue._eta +5 -0
- package/templates/nuxt/components/text/TextSubtitle.vue._eta +5 -0
- package/templates/nuxt/components/text/TextTitle.vue._eta +5 -0
- package/templates/nuxt/composables/date.generate.ts.eta +14 -9
- package/templates/nuxt/i18n.config.ts.eta +1 -1
- package/templates/nuxt/lang/en.ts.eta +16 -0
- package/templates/nuxt/layouts/default.vue._eta +32 -17
- package/templates/nuxt/layouts/mobile.vue._eta +35 -12
- package/templates/nuxt/nuxt.config.ts._eta +3 -7
- package/templates/nuxt/pages/[xorg]/organization/[id].vue.eta +39 -0
- package/templates/nuxt/pages/[xorg]/organization/new.vue.eta +30 -143
- package/templates/nuxt/pages/[xorg]/organization/viewer.vue.eta +3 -0
- package/templates/nuxt/pages/[xorg]/organization.vue.eta +81 -127
- package/templates/nuxt/pages/[xorg]/user/[id].vue.eta +38 -4
- package/templates/nuxt/pages/[xorg]/user/form.vue.eta +329 -0
- package/templates/nuxt/pages/[xorg]/user/index.vue.eta +29 -292
- package/templates/nuxt/pages/[xorg]/{organization/[id]/branches/[bid].vue → user/new.vue.eta} +10 -4
- package/templates/nuxt/pages/[xorg]/user/viewer.vue.eta +30 -0
- package/templates/nuxt/pages/[xorg]/user.vue.eta +88 -78
- package/templates/nuxt/pages/profile.vue.eta +12 -3
- package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +2 -3
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +6 -0
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +41 -2
- package/templates/nuxt/types/documentlist.ts.eta +0 -9
- package/templates/nuxt/types/events.ts.eta +1 -0
- package/templates/nuxt/types/simpleappinput.ts.eta +12 -2
- package/templates/nuxt/types/user.ts.eta +2 -0
- package/templates/project/lang/default._json +5 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/nuxt/components/docPage/DocPageList.vue.eta +0 -125
- package/templates/nuxt/lang/en.ts._eta +0 -6
- package/templates/nuxt/pages/[xorg]/organization/[bid].vue.eta +0 -14
- package/templates/nuxt/pages/[xorg]/organization/[id]/branches/new.vue +0 -149
- package/templates/nuxt/pages/[xorg]/organization/[id]/index.vue.eta +0 -1
- /package/templates/nuxt/lang/{df.ts.eta → df.ts.etaxxxx} +0 -0
|
@@ -1,68 +1,137 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
2
|
+
<div class="relative ">
|
|
3
|
+
<div v-if="withFilter" class="flex flex-row ">
|
|
4
|
+
<InputText
|
|
5
|
+
placeholder="search"
|
|
6
|
+
v-model="searchvalue"
|
|
7
|
+
class="w-full dark:text-white"
|
|
8
|
+
type="search"
|
|
9
|
+
/>
|
|
10
|
+
<ButtonPrimary v-if="withAddNew" @click="emits('add')"
|
|
11
|
+
><i class="pi pi-plus"></i
|
|
12
|
+
></ButtonPrimary>
|
|
13
|
+
</div>
|
|
14
|
+
<div v-if="showIndex" class="flex flex-col text-sm fixed left-1 top-1/5 text-primary-600 dark:text-primary-400 p-1 z-10 rounded border bg-white dark:bg-black opacity-90">
|
|
15
|
+
<A :href="'#'+l" v-for="l in allLetters">{{ l }}</A>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div v-if="filterlist && filterlist.length > 0">
|
|
19
|
+
<div >
|
|
20
|
+
<div v-for="(item, index) in filterlist" :class="isMobile() ? '' : 'overflow overflow-y-scroll overflow-auto '">
|
|
21
|
+
<div class="w-full bg-gray-400 dark:bg-gray-500 p-1 pl-2 top-0 sticky opacity-90" v-if="showIndex && titleField && showCategoryBar(item[titleField][0])">
|
|
22
|
+
<a :id="item[titleField][0]">{{ item[titleField][0] }}</a></div>
|
|
23
|
+
<div :class="getSelectedCSS(item)">
|
|
24
|
+
<NuxtLink :to="url ? `${url}/${item[idField]}` : undefined">
|
|
25
|
+
|
|
26
|
+
<slot name="default" :item="item" :index="index">
|
|
27
|
+
<div class="flex flex-row">
|
|
28
|
+
<div class="flex-1 mr-2 dark:text-white">
|
|
29
|
+
{{ item[titleField ?? ""] }}
|
|
30
|
+
</div>
|
|
31
|
+
<div class="text-right dark:text-gray-400 text-gray-600">
|
|
32
|
+
{{ item[subTitleField ?? ""] }}
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</slot>
|
|
36
|
+
</NuxtLink>
|
|
37
|
+
</div>
|
|
27
38
|
</div>
|
|
39
|
+
</div>
|
|
28
40
|
</div>
|
|
41
|
+
<div v-else>
|
|
42
|
+
<div
|
|
43
|
+
class="w-full h-20 p-2 border-l-none border-r-none hover-list-primary"
|
|
44
|
+
>
|
|
45
|
+
<slot name="nodata">
|
|
46
|
+
<div class="border-round border-1 surface-border p-4 surface-card">
|
|
47
|
+
{{ t("noDataFound") }}
|
|
48
|
+
</div>
|
|
49
|
+
</slot>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
29
53
|
</template>
|
|
30
|
-
<script setup lang="ts" generic="T extends {[key:string]:any}">
|
|
31
|
-
import {ref} from
|
|
32
|
-
import {ListItem} from
|
|
33
|
-
const props = withDefaults(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
<script setup lang="ts" generic="T extends { [key: string]: any }">
|
|
55
|
+
import { ref } from "vue";
|
|
56
|
+
import { ListItem } from "~/types/listview";
|
|
57
|
+
const props = withDefaults(
|
|
58
|
+
defineProps<{
|
|
59
|
+
list: T[];
|
|
60
|
+
url?: string;
|
|
61
|
+
titleField?: string;
|
|
62
|
+
idField?: string;
|
|
63
|
+
subTitleField?: string;
|
|
64
|
+
withFilter?: boolean;
|
|
65
|
+
withAddNew?: boolean;
|
|
66
|
+
showIndex?:boolean
|
|
67
|
+
}>(),
|
|
68
|
+
{
|
|
69
|
+
idField: "_id",
|
|
70
|
+
},
|
|
71
|
+
);
|
|
72
|
+
const letters =ref<string[]> ([])
|
|
73
|
+
let lastchar=''
|
|
74
|
+
|
|
75
|
+
const emits = defineEmits(["add"]);
|
|
76
|
+
const searchvalue = ref("");
|
|
77
|
+
const selecteditem = ref("");
|
|
78
|
+
const clickRow = (item: ListItem) => {
|
|
79
|
+
// emit('clickitem',item)
|
|
80
|
+
// selecteditem.value = item.code
|
|
81
|
+
};
|
|
82
|
+
const filterlist = computed(() => {
|
|
83
|
+
let newlist: T[] = [];
|
|
84
|
+
if (!Array.isArray(props.list)) {
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
if (props.list !== undefined) {
|
|
88
|
+
newlist = props.list.filter((item: T) => {
|
|
89
|
+
return (
|
|
90
|
+
String(item[props.titleField ?? ""])
|
|
91
|
+
.toLowerCase()
|
|
92
|
+
.includes(searchvalue.value.toLowerCase()) ||
|
|
93
|
+
String(item[props.subTitleField ?? ""])
|
|
94
|
+
.toLowerCase()
|
|
95
|
+
.includes(searchvalue.value.toLowerCase())
|
|
96
|
+
);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return newlist;
|
|
101
|
+
});
|
|
102
|
+
const getSelectedCSS = (item: T) => {
|
|
103
|
+
if (selecteditem.value == item.code) {
|
|
104
|
+
return "p-2 border-l-none border-r-none bg-sky-200 border-t-2";
|
|
105
|
+
} else {
|
|
106
|
+
return "p-2 border-l-none border-r-none hover-list-primary border-t-2 dark:border-t-gray-700";
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
const allLetters = computed(()=>{
|
|
112
|
+
console.log('props.titleFieldprops.titleField',props.titleField,props.list)
|
|
113
|
+
if(props.titleField && props.list){
|
|
114
|
+
|
|
115
|
+
return props.list.filter((item)=>{
|
|
116
|
+
const titlevalue:string = item[props.titleField as keyof typeof item]
|
|
117
|
+
if(titlevalue[0]!=lastchar){
|
|
118
|
+
lastchar = item[props.titleField as keyof typeof item][0]
|
|
119
|
+
return true
|
|
120
|
+
}
|
|
121
|
+
}).map(item=>item[props.titleField as keyof typeof item][0])
|
|
122
|
+
|
|
123
|
+
}else{
|
|
124
|
+
return []
|
|
125
|
+
}
|
|
56
126
|
|
|
57
|
-
return newlist
|
|
58
127
|
})
|
|
59
|
-
const getSelectedCSS= (item:T)=>{
|
|
60
|
-
if(selecteditem.value == item.code){
|
|
61
|
-
return "p-2 border-l-none border-r-none bg-sky-200 border-t-2"
|
|
62
|
-
}else{
|
|
63
|
-
return "p-2 border-l-none border-r-none hover-list-primary border-t-2 dark:border-t-gray-700"
|
|
64
|
-
}
|
|
65
128
|
|
|
129
|
+
const showCategoryBar=(letter:string)=>{
|
|
130
|
+
if(lastchar!=letter){
|
|
131
|
+
lastchar=letter
|
|
132
|
+
return true
|
|
133
|
+
}else{
|
|
134
|
+
return false
|
|
135
|
+
}
|
|
66
136
|
}
|
|
67
|
-
|
|
68
|
-
</script>
|
|
137
|
+
</script>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="w-full dark:bg-gray-800 z-20 bg-white justify justify-between absolute h h-14 flex flex-row place-items-center opacity-90 dark:text-white"
|
|
4
|
+
>
|
|
5
|
+
<div class="w-full text-left"><slot name="start"></slot></div>
|
|
6
|
+
<div class="w-full text-center"><slot name="center"></slot></div>
|
|
7
|
+
<div class="w-full text-right"><slot name="end"></slot></div>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="h-14"></div>
|
|
10
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Sidebar
|
|
3
|
+
position="right"
|
|
4
|
+
v-if="showDialog"
|
|
5
|
+
v-model:visible="showDialog"
|
|
6
|
+
modal
|
|
7
|
+
:show-close-icon="false"
|
|
8
|
+
#container
|
|
9
|
+
>
|
|
10
|
+
<div class="overflow-y-scroll">
|
|
11
|
+
<slot name="default"></slot>
|
|
12
|
+
</div>
|
|
13
|
+
</Sidebar>
|
|
14
|
+
</template>
|
|
15
|
+
<script lang="ts" setup>
|
|
16
|
+
const showDialog = defineModel<boolean>({ required: true });
|
|
17
|
+
const props = defineProps<{ closeEventName: string }>();
|
|
18
|
+
useNuxtApp().$listen("CloseDialog", (closeEventName: string) => {
|
|
19
|
+
if (props.closeEventName == closeEventName) showDialog.value = false;
|
|
20
|
+
});
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Sidebar
|
|
3
|
+
position="bottom"
|
|
4
|
+
v-if="showDialog"
|
|
5
|
+
v-model:visible="showDialog"
|
|
6
|
+
modal
|
|
7
|
+
:show-close-icon="false"
|
|
8
|
+
#container
|
|
9
|
+
>
|
|
10
|
+
<div class="overflow-y-scroll">
|
|
11
|
+
<slot name="default"></slot>
|
|
12
|
+
</div>
|
|
13
|
+
</Sidebar>
|
|
14
|
+
</template>
|
|
15
|
+
<script lang="ts" setup>
|
|
16
|
+
const showDialog = defineModel<boolean>({ required: true });
|
|
17
|
+
useNuxtApp().$listen("CloseDialog", (closeEventName: string) => {
|
|
18
|
+
if (closeEventName=='viewer') showDialog.value = false;
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<title v-if="!id">{{ t(doc.getDocName()) }}</title>
|
|
3
|
+
<div v-if="isMobile()" class="w-full">
|
|
4
|
+
<div class="p-2 flex flex-row justify-end place-items-center h-14">
|
|
5
|
+
<div class="flex-1">
|
|
6
|
+
<TextTitle>{{ t(doc.getDocName()) }}</TextTitle>
|
|
7
|
+
</div>
|
|
8
|
+
<div>
|
|
9
|
+
<ButtonText
|
|
10
|
+
@click="goTo(doc.getDocName(), 'new')"
|
|
11
|
+
class="pi pi-plus"
|
|
12
|
+
></ButtonText>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<ListDocument
|
|
16
|
+
v-if="recordlist"
|
|
17
|
+
@click="showDialogForm"
|
|
18
|
+
:recordlist="recordlist as T[]"
|
|
19
|
+
:unique-key="uniqueKey"
|
|
20
|
+
:document-title="documentTitle"
|
|
21
|
+
>
|
|
22
|
+
<template #default="{ index, item }">
|
|
23
|
+
<slot name="mobileList" :index="index" :item="item as T"></slot>
|
|
24
|
+
</template>
|
|
25
|
+
</ListDocument>
|
|
26
|
+
</div>
|
|
27
|
+
<div v-else class="simpleapp-crudsimple">
|
|
28
|
+
<ListDocumentTable
|
|
29
|
+
v-if="recordlist"
|
|
30
|
+
:value="recordlist as T[]"
|
|
31
|
+
:title="doc.getDocName()"
|
|
32
|
+
:unique-key="<string>uniqueKey"
|
|
33
|
+
:document-title="<string>documentTitle"
|
|
34
|
+
:columns="columns"
|
|
35
|
+
>
|
|
36
|
+
<template #toolbar>
|
|
37
|
+
<div class="w-full text-left">
|
|
38
|
+
<ButtonPrimary
|
|
39
|
+
class="pi pi-plus"
|
|
40
|
+
@click="newData"
|
|
41
|
+
v-tooltip="t('new')"
|
|
42
|
+
v-if="canPerform(resourcename, 'create')"
|
|
43
|
+
></ButtonPrimary>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
<template #default>
|
|
47
|
+
<slot name="dataTableColumns">
|
|
48
|
+
<Column v-for="col in columns.filter((item,index)=>index<6)" :header="t(col)" class="min-w-[5rem]" #body="{index,data}">
|
|
49
|
+
<RendererLink v-if="uniqueKey === col || documentTitle === col"
|
|
50
|
+
:value="data" :setting="{ path: resourcename.toLocaleLowerCase() }"
|
|
51
|
+
:fields="[col]" >
|
|
52
|
+
{{ data[col] }}
|
|
53
|
+
</RendererLink>
|
|
54
|
+
<span v-else-if="data[col]?.label !==undefined">{{ data[col].label }}</span>
|
|
55
|
+
<span v-else>{{ data[col] }}</span>
|
|
56
|
+
</Column>
|
|
57
|
+
|
|
58
|
+
</slot>
|
|
59
|
+
</template>
|
|
60
|
+
</ListDocumentTable>
|
|
61
|
+
</div>
|
|
62
|
+
<OverlaySideBarCrud
|
|
63
|
+
v-model="showDialog"
|
|
64
|
+
:closeEventName="doc.getDocName()"
|
|
65
|
+
#default
|
|
66
|
+
><slot name="default">
|
|
67
|
+
<NuxtPage :_id="id"></NuxtPage>
|
|
68
|
+
</slot>
|
|
69
|
+
</OverlaySideBarCrud>
|
|
70
|
+
</template>
|
|
71
|
+
|
|
72
|
+
<script setup lang="ts" generic="T extends { [key: string]: any }">
|
|
73
|
+
/**
|
|
74
|
+
* This file was automatically generated by simpleapp generator during initialization.
|
|
75
|
+
* DO NOT MODIFY IT BY HAND.
|
|
76
|
+
* last change 2024-02-04
|
|
77
|
+
* author: Ks Tan
|
|
78
|
+
*/
|
|
79
|
+
import { ref } from "vue";
|
|
80
|
+
import _ from "lodash";
|
|
81
|
+
import { SearchBody } from "~/types";
|
|
82
|
+
import { SimpleAppClient } from "~/simpleapp/generate/clients/SimpleAppClient";
|
|
83
|
+
const props = defineProps<{
|
|
84
|
+
document: SimpleAppClient<any, any>;
|
|
85
|
+
data: T;
|
|
86
|
+
columns: string[];
|
|
87
|
+
mobileColumns?: string[];
|
|
88
|
+
sorts?: string[][];
|
|
89
|
+
}>();
|
|
90
|
+
|
|
91
|
+
const emits = defineEmits(["selectRow"]);
|
|
92
|
+
const id = computed(() => getPathPara("id"));
|
|
93
|
+
const resourcename = ref(_.upperFirst(props.document.getDocName()));
|
|
94
|
+
const visible = ref(false);
|
|
95
|
+
const showDialog = ref(false);
|
|
96
|
+
const op = ref();
|
|
97
|
+
const doc = props.document;
|
|
98
|
+
const disabled = ref(false);
|
|
99
|
+
|
|
100
|
+
const router = useRouter();
|
|
101
|
+
const route = useRoute();
|
|
102
|
+
const filters = ref();
|
|
103
|
+
const popuptitle = ref(t(doc.getDocName()));
|
|
104
|
+
const systemwindows = ref(false);
|
|
105
|
+
const { $event, $listen } = useNuxtApp();
|
|
106
|
+
const recordlist = ref<T[]>();
|
|
107
|
+
const uniqueKey = doc.getSchema()["x-simpleapp-config"].uniqueKey;
|
|
108
|
+
const documentTitle = doc.getSchema()["x-simpleapp-config"].documentTitle;
|
|
109
|
+
|
|
110
|
+
const refresh = () => {
|
|
111
|
+
const searchbody: SearchBody = {
|
|
112
|
+
fields: props.columns,
|
|
113
|
+
sorts: props.sorts,
|
|
114
|
+
};
|
|
115
|
+
doc.search(searchbody).then((res: any) => {
|
|
116
|
+
recordlist.value = res;
|
|
117
|
+
disabled.value = false;
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
const newData = () => {
|
|
121
|
+
router.push({ path: getDocumentUrl(doc.getDocName(), "new") });
|
|
122
|
+
popuptitle.value = t(doc.getDocName());
|
|
123
|
+
doc.setNew();
|
|
124
|
+
visible.value = true;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
onMounted(() => {
|
|
128
|
+
refresh();
|
|
129
|
+
});
|
|
130
|
+
$listen("RefreshDocumentList", (data) => {
|
|
131
|
+
if (data.documentName == doc.getDocName()) {
|
|
132
|
+
refresh();
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
const showDialogForm = (item: T) => {
|
|
136
|
+
goTo(doc.getDocName(), item._id);
|
|
137
|
+
popuptitle.value = <string>item[documentTitle as keyof T];
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
watch(showDialog, () => {
|
|
141
|
+
if (!showDialog.value) {
|
|
142
|
+
goTo(props.document.getDocName());
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
watch(
|
|
146
|
+
() => useRoute().path,
|
|
147
|
+
async () => {
|
|
148
|
+
if (getPathPara("id")) {
|
|
149
|
+
showDialog.value = true;
|
|
150
|
+
} else {
|
|
151
|
+
showDialog.value = false;
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
onMounted(() => {
|
|
157
|
+
if (id.value) {
|
|
158
|
+
showDialog.value = true;
|
|
159
|
+
} else {
|
|
160
|
+
showDialog.value = false;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
useNuxtApp().$listen("CloseDialog", (documentName: string) => {
|
|
164
|
+
if (documentName == doc.getDocName()) {
|
|
165
|
+
goTo(resourcename.value);
|
|
166
|
+
showDialog.value = false;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
</script>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<span class="pi pi-check-circle text-green-500" v-if="modelValue">
|
|
3
|
+
</span>
|
|
4
|
+
<span class="pi pi-times-circle text-red-500" v-else>
|
|
5
|
+
</span>
|
|
6
|
+
|
|
3
7
|
</template>
|
|
4
8
|
<script lang="ts" setup>
|
|
5
9
|
/**
|
|
@@ -8,5 +12,5 @@
|
|
|
8
12
|
* last change 2024-02-04
|
|
9
13
|
* author: Ks Tan
|
|
10
14
|
*/
|
|
11
|
-
const modelValue = defineModel()
|
|
12
|
-
</script>
|
|
15
|
+
const modelValue = defineModel<boolean>();
|
|
16
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<template
|
|
2
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<span>{{ toLocalDate(value ?? "") }}</span>
|
|
3
3
|
</template>
|
|
4
4
|
<script lang="ts" setup>
|
|
5
5
|
/**
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* last change 2024-02-04
|
|
9
9
|
* author: Ks Tan
|
|
10
10
|
*/
|
|
11
|
-
const props = defineProps<{value?:string}>()
|
|
12
|
-
</script>
|
|
11
|
+
const props = defineProps<{ value?: string }>();
|
|
12
|
+
</script>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<a @click="go" class="text-primary-700 dark:text-primary-300 dark:hover:text-primary-200 hover:text-primary-500 cursor-pointer">
|
|
3
|
+
<slot name="default">
|
|
4
|
+
<div>{{ value[fields[0]] }}</div>
|
|
5
|
+
</slot>
|
|
6
|
+
</a>
|
|
7
7
|
</template>
|
|
8
8
|
<script setup lang="ts">
|
|
9
9
|
/**
|
|
@@ -14,20 +14,12 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
const props = defineProps<{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}>()
|
|
17
|
+
fields: any;
|
|
18
|
+
setting: any;
|
|
19
|
+
value: any;
|
|
20
|
+
}>();
|
|
21
21
|
|
|
22
|
-
const go = ()=>{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// _id: props.value._id ,
|
|
26
|
-
// documentName: props.setting.documentName,
|
|
27
|
-
// viewer: getDocument(props.setting.documentName)?.viewer,
|
|
28
|
-
// label: props.setting.documentName,
|
|
29
|
-
// document:getDocument(props.setting.documentName)?.docClass,
|
|
30
|
-
// eventId: crypto.randomUUID()
|
|
31
|
-
// })
|
|
32
|
-
}
|
|
22
|
+
const go = () => {
|
|
23
|
+
goTo(props.setting.path, props.value._id);
|
|
24
|
+
};
|
|
33
25
|
</script>
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<a
|
|
3
|
+
@click="openViewer"
|
|
4
|
+
class="text-primary-700 dark:text-primary-400 hover:text-primary-500 cursor-pointer"
|
|
5
|
+
>
|
|
6
|
+
<slot name="default">
|
|
7
|
+
<div v-if="fields">{{ value[fields[0]] }}</div>
|
|
8
|
+
</slot>
|
|
9
|
+
</a>
|
|
7
10
|
</template>
|
|
8
11
|
<script setup lang="ts">
|
|
9
12
|
/**
|
|
@@ -12,21 +15,24 @@
|
|
|
12
15
|
* last change 2024-02-04
|
|
13
16
|
* author: Ks Tan
|
|
14
17
|
*/
|
|
15
|
-
import { RendererSetting } from
|
|
18
|
+
import { RendererSetting } from "~/types";
|
|
16
19
|
const props = defineProps<{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}>()
|
|
20
|
+
fields?: string[];
|
|
21
|
+
setting: RendererSetting;
|
|
22
|
+
value: any;
|
|
23
|
+
}>();
|
|
21
24
|
|
|
22
|
-
const openViewer = ()=>{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
const openViewer = () => {
|
|
26
|
+
useNuxtApp().$event("ViewRecord", {
|
|
27
|
+
_id: props.value._id,
|
|
28
|
+
documentName: props.setting.documentName,
|
|
29
|
+
viewer: getDocument(props.setting.documentName)?.viewer,
|
|
30
|
+
label: props.fields !== undefined ? props.value[props.fields[0]] : props.setting.documentName,
|
|
31
|
+
document: getDocument(props.setting.documentName)?.docClass,
|
|
32
|
+
eventId: randomUUID(),
|
|
33
|
+
after:()=>{
|
|
34
|
+
useNuxtApp().$event('CloseDialog',props.setting.documentName)
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
</script>
|