@simitgroup/simpleapp-generator 1.0.45 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -5
- package/dist/buildinschemas/autoincreament.js +3 -3
- package/dist/buildinschemas/organization.js +1 -1
- package/dist/buildinschemas/permission.js +3 -3
- package/dist/buildinschemas/permission.js.map +1 -1
- package/dist/buildinschemas/tenant.js +3 -3
- package/dist/buildinschemas/user.js +3 -3
- package/dist/framework.js +2 -2
- package/dist/framework.js.map +1 -1
- package/dist/generate.js +9 -9
- package/dist/generate.js.map +1 -1
- package/dist/processors/jsonschemabuilder.d.ts.map +1 -1
- package/dist/processors/jsonschemabuilder.js +10 -0
- package/dist/processors/jsonschemabuilder.js.map +1 -1
- package/dist/type.d.ts +114 -22
- package/dist/type.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/autoincreament.ts +3 -3
- package/src/buildinschemas/organization.ts +1 -1
- package/src/buildinschemas/permission.ts +3 -3
- package/src/buildinschemas/tenant.ts +3 -3
- package/src/buildinschemas/user.ts +3 -3
- package/src/framework.ts +2 -2
- package/src/generate.ts +9 -9
- package/src/processors/jsonschemabuilder.ts +14 -1
- package/src/type.ts +136 -22
- package/templates/basic/nest/processor.ts.eta +3 -1
- package/templates/basic/nuxt/pages.crud.vue.eta +2 -1
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +18 -2
- package/templates/nest/src/simpleapp/generate/processors/simpleapp.processor.ts.eta +14 -16
- package/templates/nest/src/simpleapp/services/docno.service.ts.eta +5 -4
- package/templates/nuxt/components/CrudNestedDoc.vue.eta +5 -1
- package/templates/nuxt/components/ListView.vue.eta +52 -0
- package/templates/nuxt/components/SimpleAppDocumentNo.vue.eta +1 -1
- package/templates/nuxt/layouts/sidelistcrud.vue.eta +43 -0
- package/templates/nuxt/pages/[xorg]/docnoformat/index.vue.eta +290 -233
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +2 -14
- package/templates/project/schemas/category.ts.eta +40 -27
- package/templates/project/schemas/customer.ts.eta +35 -0
- package/templates/project/schemas/index.ts.eta +4 -4
- package/templates/project/schemas/invoice.ts.eta +55 -0
- package/templates/project/schemas/product.ts.eta +41 -57
- package/templates/project/sharelibs/index.ts.eta +2 -0
- package/templates/project/sharelibs/money.ts.eta +17 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/templates/project/shares/index.ts.eta +0 -2
- /package/templates/project/{shares → sharelibs}/hello.ts.eta +0 -0
|
@@ -1,269 +1,326 @@
|
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
2
|
+
<button class="btn-primary" @click="newRecord">New</button>
|
|
3
|
+
<ConfirmPopup></ConfirmPopup>
|
|
4
|
+
<DebugDocumentData v-model="data"></DebugDocumentData>
|
|
5
|
+
<SimpleAppDatatable
|
|
6
|
+
v-model="recordlist"
|
|
7
|
+
:setting="{}"
|
|
8
|
+
:columns="[
|
|
9
|
+
'docNoFormatNo',
|
|
10
|
+
'docNoFormatName',
|
|
11
|
+
'active',
|
|
12
|
+
'docNoPattern',
|
|
13
|
+
'nextNumber',
|
|
14
|
+
'isMonthly',
|
|
15
|
+
]"
|
|
16
|
+
>
|
|
17
|
+
<Column header="action">
|
|
18
|
+
<template #body="{ data, index }">
|
|
19
|
+
<button
|
|
20
|
+
class="pi pi-pencil btn-primary"
|
|
21
|
+
@click="triggerEdit(data)"
|
|
22
|
+
></button>
|
|
23
|
+
<button
|
|
24
|
+
class="pi pi-times btn-danger"
|
|
25
|
+
@click="triggerDelete(data)"
|
|
26
|
+
></button>
|
|
27
|
+
</template>
|
|
28
|
+
</Column>
|
|
29
|
+
</SimpleAppDatatable>
|
|
30
|
+
<Dialog
|
|
31
|
+
v-model:visible="visible"
|
|
32
|
+
modal
|
|
33
|
+
:header="popuptitle"
|
|
34
|
+
class="crudsimple-dialog"
|
|
35
|
+
:autoZIndex="false"
|
|
36
|
+
:style="{ zIndex: 100, width: '80vw' }"
|
|
37
|
+
>
|
|
38
|
+
<div class="simpleapp-tool-bar col-span-4 text-left gap-4">
|
|
39
|
+
<button
|
|
40
|
+
class="btn-default"
|
|
41
|
+
:disabled="disabled"
|
|
42
|
+
@click="newRecord"
|
|
43
|
+
type="button"
|
|
44
|
+
v-if="canPerform(resourcename, 'create')"
|
|
45
|
+
>
|
|
46
|
+
New
|
|
47
|
+
</button>
|
|
48
|
+
<button
|
|
49
|
+
class="btn-primary"
|
|
50
|
+
:disabled="disabled"
|
|
51
|
+
@click="createData"
|
|
52
|
+
type="button"
|
|
53
|
+
v-if="canPerform(resourcename, 'create') && data.created == ''"
|
|
54
|
+
>
|
|
55
|
+
Create
|
|
56
|
+
</button>
|
|
57
|
+
<button
|
|
58
|
+
class="btn-primary"
|
|
59
|
+
:disabled="disabled"
|
|
60
|
+
@click="updateData"
|
|
61
|
+
type="button"
|
|
62
|
+
v-if="canPerform(resourcename, 'update') && data.created != ''"
|
|
63
|
+
>
|
|
64
|
+
Update
|
|
65
|
+
</button>
|
|
66
|
+
<button
|
|
67
|
+
class="btn-danger"
|
|
68
|
+
:disabled="disabled"
|
|
69
|
+
@click="deleteData($event)"
|
|
70
|
+
type="button"
|
|
71
|
+
v-if="canPerform(resourcename, 'delete') && data.created != ''"
|
|
72
|
+
>
|
|
73
|
+
Delete
|
|
74
|
+
</button>
|
|
75
|
+
<ProgressSpinner
|
|
76
|
+
v-if="disabled == true"
|
|
77
|
+
style="width: 2rem; height: 2rem"
|
|
78
|
+
></ProgressSpinner>
|
|
79
|
+
<ConfirmPopup></ConfirmPopup>
|
|
80
|
+
</div>
|
|
81
|
+
<SimpleAppForm :document="doc" #default="o" title="Document No">
|
|
82
|
+
<div class="grid grid-cols-4">
|
|
83
|
+
<SimpleAppText
|
|
84
|
+
autofocus
|
|
85
|
+
:setting="o.getField('#/properties/docNoFormatNo')"
|
|
86
|
+
v-model="data.docNoFormatNo"
|
|
87
|
+
/>
|
|
88
|
+
<SimpleAppText
|
|
89
|
+
autofocus
|
|
90
|
+
:setting="o.getField('#/properties/docNoFormatName')"
|
|
91
|
+
v-model="data.docNoFormatName"
|
|
92
|
+
/>
|
|
93
|
+
<SimpleAppCheckbox
|
|
94
|
+
autofocus
|
|
95
|
+
:setting="o.getField('#/properties/active')"
|
|
96
|
+
v-model="data.active"
|
|
97
|
+
/>
|
|
51
98
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
99
|
+
<SimpleAppCheckbox
|
|
100
|
+
autofocus
|
|
101
|
+
:setting="o.getField('#/properties/default')"
|
|
102
|
+
v-model="data.default"
|
|
103
|
+
/>
|
|
57
104
|
|
|
58
|
-
|
|
105
|
+
<SimpleAppText
|
|
106
|
+
autofocus
|
|
107
|
+
:setting="o.getField('#/properties/docNoPattern')"
|
|
108
|
+
v-model="data.docNoPattern"
|
|
109
|
+
/>
|
|
59
110
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
111
|
+
<SimpleAppCheckbox
|
|
112
|
+
autofocus
|
|
113
|
+
:setting="o.getField('#/properties/isMonthly')"
|
|
114
|
+
v-model="data.isMonthly"
|
|
115
|
+
/>
|
|
65
116
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
117
|
+
<SimpleAppNumber
|
|
118
|
+
autofocus
|
|
119
|
+
:setting="o.getField('#/properties/nextNumber')"
|
|
120
|
+
v-model="data.nextNumber"
|
|
121
|
+
/>
|
|
71
122
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
123
|
+
<SimpleAppValue :setting="o.getField('#/properties/monthlySetting')">
|
|
124
|
+
<SimpleAppNumber
|
|
125
|
+
autofocus
|
|
126
|
+
:setting="o.getField('#/properties/monthlySetting/properties/jan')"
|
|
127
|
+
instancePath="#/monthlySetting/jan"
|
|
128
|
+
v-model="data.monthlySetting.jan"
|
|
129
|
+
/>
|
|
77
130
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
/>
|
|
131
|
+
<SimpleAppNumber
|
|
132
|
+
autofocus
|
|
133
|
+
:setting="o.getField('#/properties/monthlySetting/properties/feb')"
|
|
134
|
+
instancePath="#/monthlySetting/feb"
|
|
135
|
+
v-model="data.monthlySetting.feb"
|
|
136
|
+
/>
|
|
85
137
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
138
|
+
<SimpleAppNumber
|
|
139
|
+
autofocus
|
|
140
|
+
:setting="o.getField('#/properties/monthlySetting/properties/mar')"
|
|
141
|
+
instancePath="#/monthlySetting/mar"
|
|
142
|
+
v-model="data.monthlySetting.mar"
|
|
143
|
+
/>
|
|
92
144
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
145
|
+
<SimpleAppNumber
|
|
146
|
+
autofocus
|
|
147
|
+
:setting="o.getField('#/properties/monthlySetting/properties/apr')"
|
|
148
|
+
instancePath="#/monthlySetting/apr"
|
|
149
|
+
v-model="data.monthlySetting.apr"
|
|
150
|
+
/>
|
|
99
151
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
152
|
+
<SimpleAppNumber
|
|
153
|
+
autofocus
|
|
154
|
+
:setting="o.getField('#/properties/monthlySetting/properties/may')"
|
|
155
|
+
instancePath="#/monthlySetting/may"
|
|
156
|
+
v-model="data.monthlySetting.may"
|
|
157
|
+
/>
|
|
106
158
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
159
|
+
<SimpleAppNumber
|
|
160
|
+
autofocus
|
|
161
|
+
:setting="o.getField('#/properties/monthlySetting/properties/jun')"
|
|
162
|
+
instancePath="#/monthlySetting/jun"
|
|
163
|
+
v-model="data.monthlySetting.jun"
|
|
164
|
+
/>
|
|
113
165
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
166
|
+
<SimpleAppNumber
|
|
167
|
+
autofocus
|
|
168
|
+
:setting="o.getField('#/properties/monthlySetting/properties/jul')"
|
|
169
|
+
instancePath="#/monthlySetting/jul"
|
|
170
|
+
v-model="data.monthlySetting.jul"
|
|
171
|
+
/>
|
|
120
172
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
173
|
+
<SimpleAppNumber
|
|
174
|
+
autofocus
|
|
175
|
+
:setting="o.getField('#/properties/monthlySetting/properties/aug')"
|
|
176
|
+
instancePath="#/monthlySetting/aug"
|
|
177
|
+
v-model="data.monthlySetting.aug"
|
|
178
|
+
/>
|
|
127
179
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
180
|
+
<SimpleAppNumber
|
|
181
|
+
autofocus
|
|
182
|
+
:setting="o.getField('#/properties/monthlySetting/properties/sep')"
|
|
183
|
+
instancePath="#/monthlySetting/sep"
|
|
184
|
+
v-model="data.monthlySetting.sep"
|
|
185
|
+
/>
|
|
134
186
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
187
|
+
<SimpleAppNumber
|
|
188
|
+
autofocus
|
|
189
|
+
:setting="o.getField('#/properties/monthlySetting/properties/oct')"
|
|
190
|
+
instancePath="#/monthlySetting/oct"
|
|
191
|
+
v-model="data.monthlySetting.oct"
|
|
192
|
+
/>
|
|
141
193
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
194
|
+
<SimpleAppNumber
|
|
195
|
+
autofocus
|
|
196
|
+
:setting="o.getField('#/properties/monthlySetting/properties/nov')"
|
|
197
|
+
instancePath="#/monthlySetting/nov"
|
|
198
|
+
v-model="data.monthlySetting.nov"
|
|
199
|
+
/>
|
|
148
200
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
instancePath="#/monthlySetting/dec"
|
|
160
|
-
v-model="data.monthlySetting.dec"
|
|
161
|
-
/>
|
|
162
|
-
</SimpleAppValue>
|
|
163
|
-
</div>
|
|
164
|
-
</SimpleAppForm>
|
|
165
|
-
</Dialog>
|
|
201
|
+
<SimpleAppNumber
|
|
202
|
+
autofocus
|
|
203
|
+
:setting="o.getField('#/properties/monthlySetting/properties/dec')"
|
|
204
|
+
instancePath="#/monthlySetting/dec"
|
|
205
|
+
v-model="data.monthlySetting.dec"
|
|
206
|
+
/>
|
|
207
|
+
</SimpleAppValue>
|
|
208
|
+
</div>
|
|
209
|
+
</SimpleAppForm>
|
|
210
|
+
</Dialog>
|
|
166
211
|
</template>
|
|
167
212
|
<script setup lang="ts">
|
|
168
|
-
import _ from
|
|
169
|
-
import Dialog from
|
|
170
|
-
import Column from
|
|
171
|
-
import {ListItem} from
|
|
172
|
-
import ConfirmPopup from
|
|
213
|
+
import _ from "lodash";
|
|
214
|
+
import Dialog from "primevue/dialog";
|
|
215
|
+
import Column from "primevue/column";
|
|
216
|
+
import { ListItem } from "@/types/listview";
|
|
217
|
+
import ConfirmPopup from "primevue/confirmpopup";
|
|
173
218
|
import { useConfirm } from "primevue/useconfirm";
|
|
174
|
-
const {$event
|
|
175
|
-
const doc = $DocnoformatDoc()
|
|
176
|
-
const data = doc.getReactiveData()
|
|
219
|
+
const { $event, $listen, $DocnoformatDoc } = useNuxtApp();
|
|
220
|
+
const doc = $DocnoformatDoc();
|
|
221
|
+
const data = doc.getReactiveData();
|
|
177
222
|
|
|
178
|
-
const visible = ref(false)
|
|
179
|
-
const disabled = ref(false)
|
|
180
|
-
const popuptitle = ref(
|
|
181
|
-
const recordlist = ref()
|
|
182
|
-
const selectedDoctype = ref(
|
|
223
|
+
const visible = ref(false);
|
|
224
|
+
const disabled = ref(false);
|
|
225
|
+
const popuptitle = ref("edit");
|
|
226
|
+
const recordlist = ref();
|
|
227
|
+
const selectedDoctype = ref("");
|
|
183
228
|
const confirm = useConfirm();
|
|
184
229
|
// This will work in both `<script setup>` and `<script>`
|
|
185
230
|
definePageMeta({
|
|
186
|
-
layout:
|
|
231
|
+
layout: "sidelistcrud",
|
|
187
232
|
});
|
|
188
233
|
|
|
189
|
-
const resourcename = ref(
|
|
234
|
+
const resourcename = ref(_.upperFirst(doc.getDocName()));
|
|
235
|
+
|
|
236
|
+
const refresh = async () => {
|
|
237
|
+
const filter = { docNoType: selectedDoctype.value };
|
|
238
|
+
|
|
239
|
+
console.log("selectedDoctype", selectedDoctype.value);
|
|
190
240
|
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
$listen('itemselected', (item:ListItem)=>{
|
|
200
|
-
selectedDoctype.value = item.code
|
|
201
|
-
refresh()
|
|
202
|
-
|
|
203
|
-
})
|
|
241
|
+
const results = await doc.search(filter);
|
|
242
|
+
recordlist.value = results;
|
|
243
|
+
};
|
|
244
|
+
$listen("itemselected", (item: ListItem) => {
|
|
245
|
+
selectedDoctype.value = item.code;
|
|
246
|
+
refresh();
|
|
247
|
+
});
|
|
204
248
|
|
|
205
|
-
onMounted(()=>{
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
249
|
+
onMounted(() => {
|
|
250
|
+
const doclist = getDocTypes();
|
|
251
|
+
console.log(doclist);
|
|
252
|
+
const listdata: ListItem[] = getDocTypes().map(
|
|
253
|
+
(item) => ({ name: item.docName, code: item.docType }) as ListItem,
|
|
254
|
+
);
|
|
255
|
+
$event("listloaded", listdata);
|
|
256
|
+
});
|
|
211
257
|
const newRecord = () => {
|
|
212
|
-
// useRouter().push({ path: `${props.path}` })
|
|
213
|
-
doc.setNew()
|
|
214
|
-
data.value.docNoType=selectedDoctype.value
|
|
258
|
+
// useRouter().push({ path: `${props.path}` })
|
|
259
|
+
doc.setNew();
|
|
260
|
+
data.value.docNoType = selectedDoctype.value;
|
|
215
261
|
|
|
216
|
-
visible.value=true;
|
|
217
|
-
$event("newRecord")
|
|
262
|
+
visible.value = true;
|
|
263
|
+
$event("newRecord");
|
|
264
|
+
};
|
|
265
|
+
const createData = () => {
|
|
266
|
+
disabled.value = true;
|
|
267
|
+
|
|
268
|
+
doc
|
|
269
|
+
.create()
|
|
270
|
+
.then(() => {
|
|
271
|
+
visible.value = false;
|
|
272
|
+
refresh();
|
|
273
|
+
})
|
|
274
|
+
.catch((err) => {
|
|
275
|
+
console.error(err);
|
|
276
|
+
})
|
|
277
|
+
.finally(() => (disabled.value = false));
|
|
278
|
+
};
|
|
279
|
+
const updateData = () => {
|
|
280
|
+
disabled.value = true;
|
|
281
|
+
|
|
282
|
+
doc
|
|
283
|
+
.update()
|
|
284
|
+
.then(() => {
|
|
285
|
+
visible.value = false;
|
|
286
|
+
refresh();
|
|
287
|
+
})
|
|
288
|
+
.catch((err) => {
|
|
289
|
+
console.error(err);
|
|
290
|
+
})
|
|
291
|
+
.finally(() => (disabled.value = false));
|
|
292
|
+
};
|
|
293
|
+
const deleteData = (e: any) => {
|
|
294
|
+
confirm.require({
|
|
295
|
+
target: e.currentTarget as HTMLElement,
|
|
296
|
+
message: "Delete?",
|
|
297
|
+
icon: "pi pi-exclamation-triangle",
|
|
298
|
+
acceptClass: "p-button-danger",
|
|
299
|
+
accept: () => {
|
|
300
|
+
disabled.value = true;
|
|
301
|
+
doc
|
|
302
|
+
.delete(data.value._id ?? "")
|
|
303
|
+
.then(() => (visible.value = false))
|
|
304
|
+
.finally(() => {
|
|
305
|
+
refresh();
|
|
306
|
+
});
|
|
307
|
+
},
|
|
308
|
+
reject: () => {
|
|
309
|
+
console.log("Cancel delete");
|
|
310
|
+
},
|
|
311
|
+
});
|
|
218
312
|
};
|
|
219
|
-
const createData= ()=>{
|
|
220
|
-
disabled.value=true
|
|
221
|
-
|
|
222
|
-
doc.create().then(()=>{
|
|
223
|
-
visible.value=false
|
|
224
|
-
refresh()
|
|
225
|
-
}).catch(err=>{
|
|
226
|
-
console.error(err)
|
|
227
|
-
}).finally(()=>disabled.value=false)
|
|
228
|
-
}
|
|
229
|
-
const updateData= ()=>{
|
|
230
|
-
disabled.value=true
|
|
231
|
-
|
|
232
|
-
doc.update().then(()=>{
|
|
233
|
-
visible.value=false
|
|
234
|
-
refresh()
|
|
235
|
-
}).catch(err=>{
|
|
236
|
-
console.error(err)
|
|
237
|
-
}).finally(()=>disabled.value=false)
|
|
238
|
-
}
|
|
239
|
-
const deleteData= (e:any)=>{
|
|
240
|
-
confirm.require({
|
|
241
|
-
target: e.currentTarget as HTMLElement,
|
|
242
|
-
message:'Delete?',
|
|
243
|
-
icon: 'pi pi-exclamation-triangle',
|
|
244
|
-
acceptClass: 'p-button-danger',
|
|
245
|
-
accept: ()=>{
|
|
246
|
-
disabled.value=true
|
|
247
|
-
doc.delete(data.value._id ?? "").then(()=>visible.value=false).finally(() => {
|
|
248
|
-
refresh();
|
|
249
|
-
});
|
|
250
|
-
},
|
|
251
|
-
reject: () => {
|
|
252
|
-
console.log("Cancel delete")
|
|
253
|
-
}
|
|
254
|
-
})
|
|
255
|
-
}
|
|
256
313
|
|
|
257
314
|
const triggerDelete = async (event: any) => {
|
|
258
|
-
let id = event._id.toString()
|
|
259
|
-
await doc.delete(id)
|
|
260
|
-
refresh()
|
|
315
|
+
let id = event._id.toString();
|
|
316
|
+
await doc.delete(id);
|
|
317
|
+
refresh();
|
|
261
318
|
};
|
|
262
319
|
const triggerEdit = async (event: any) => {
|
|
263
|
-
let id = event._id.toString()
|
|
264
|
-
await doc.getById(id)
|
|
265
|
-
console.log(id)
|
|
266
|
-
visible.value=true
|
|
267
|
-
useRouter().push({ path
|
|
320
|
+
let id = event._id.toString();
|
|
321
|
+
await doc.getById(id);
|
|
322
|
+
console.log(id);
|
|
323
|
+
visible.value = true;
|
|
324
|
+
useRouter().push({ path: `/${useRoute().params.xorg}/docnoformat/${id}` });
|
|
268
325
|
};
|
|
269
|
-
</script>
|
|
326
|
+
</script>
|
|
@@ -140,22 +140,10 @@ export class SimpleAppClient<
|
|
|
140
140
|
ajv.addFormat('html',/.*$/)
|
|
141
141
|
ajv.addFormat('documentno',/.*$/)
|
|
142
142
|
|
|
143
|
-
ajv.addKeyword({ keyword: 'x-document-no', schemaType:'boolean' });
|
|
144
|
-
ajv.addKeyword({ keyword: 'x-document-label',schemaType: 'boolean' });
|
|
145
|
-
ajv.addKeyword({ keyword: 'x-document-status', schemaType: 'array' });
|
|
146
|
-
ajv.addKeyword({ keyword: 'x-document-api',schemaType: 'array' });
|
|
147
|
-
ajv.addKeyword({ keyword: 'x-page-type',schemaType:'string' }); // undefine mean no generate page
|
|
148
|
-
ajv.addKeyword({ keyword: 'x-ignore-autocomplete',schemaType: 'boolean' });
|
|
149
|
-
ajv.addKeyword({ keyword: 'x-isolation-type', schemaType: 'string' });
|
|
150
|
-
ajv.addKeyword({ keyword: 'x-document-type', schemaType: 'string' });
|
|
151
|
-
ajv.addKeyword({ keyword: 'x-document-name', schemaType: 'string' });
|
|
152
|
-
ajv.addKeyword({ keyword: 'x-collection-name',schemaType: 'string' });
|
|
153
|
-
ajv.addKeyword({ keyword: 'x-autocomplete-field', schemaType: 'boolean' });
|
|
154
143
|
ajv.addKeyword({ keyword: 'x-foreignkey', schemaType: 'string' });
|
|
155
|
-
ajv.addKeyword({ keyword: 'x-
|
|
156
|
-
ajv.addKeyword({ keyword: 'x-compute', schemaType: 'object' });
|
|
157
|
-
ajv.addKeyword({ keyword: 'x-required-role', schemaType: 'array' });
|
|
144
|
+
ajv.addKeyword({ keyword: 'x-simpleapp-config', schemaType: 'object' });
|
|
158
145
|
|
|
146
|
+
|
|
159
147
|
this.errorlist.value = {};
|
|
160
148
|
this.hook('pre-validation', this.data.value);
|
|
161
149
|
const validate = ajv.compile(this.schema);
|
|
@@ -1,27 +1,40 @@
|
|
|
1
|
-
|
|
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
|
-
}
|
|
27
|
-
|
|
1
|
+
import {
|
|
2
|
+
SchemaType,
|
|
3
|
+
RESTMethods,
|
|
4
|
+
IsolationType,
|
|
5
|
+
} from '/usr/local/lib/node_modules/@simitgroup/simpleapp-generator/src/type'
|
|
6
|
+
//"/Users/kstan/dev/lowcode/simpleapp-generator/src/type";
|
|
7
|
+
export const category: SchemaType = {
|
|
8
|
+
type: "object",
|
|
9
|
+
"x-simpleapp-config": {
|
|
10
|
+
documentType: "cat",
|
|
11
|
+
documentName: "category",
|
|
12
|
+
isolationType: IsolationType.org,
|
|
13
|
+
uniqueKey:'categoryCode',
|
|
14
|
+
documentTitle:'categoryName',
|
|
15
|
+
pageType: "crud",
|
|
16
|
+
},
|
|
17
|
+
properties: {
|
|
18
|
+
_id: { type: "string" },
|
|
19
|
+
created: { type: "string" },
|
|
20
|
+
updated: { type: "string" },
|
|
21
|
+
createdby: { type: "string" },
|
|
22
|
+
updatedby: { type: "string" },
|
|
23
|
+
tenantId: { type: "integer", default: 1, minimum: 1 },
|
|
24
|
+
orgId: { type: "integer", default: 1, minimum: 1 },
|
|
25
|
+
branchId: { type: "integer", default: 1, minimum: 1 },
|
|
26
|
+
categoryCode: { type: "string", examples: ["TUITION"] },
|
|
27
|
+
categoryName: { type: "string", examples: ["Tuition Service"] },
|
|
28
|
+
active: { type: "boolean", default: true, examples: [true] },
|
|
29
|
+
categoryType: {
|
|
30
|
+
type: "string",
|
|
31
|
+
enum: ["class", "charge"],
|
|
32
|
+
examples: ["class"],
|
|
33
|
+
},
|
|
34
|
+
description: {
|
|
35
|
+
type: "string",
|
|
36
|
+
format: "text",
|
|
37
|
+
examples: ["Maths Tuition primary 1"],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|