@tager/admin-export 1.0.5 → 1.0.6
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/dev/App.vue.d.ts +4 -3
- package/dist/index.mjs +354 -395
- package/dist/services/requests.d.ts +2 -2
- package/dist/style.css +1 -1
- package/dist/typings/model.d.ts +3 -3
- package/dist/views/ExportForm/ExportForm.helpers.d.ts +4 -4
- package/dist/views/ExportForm/ExportForm.types.d.ts +1 -1
- package/dist/views/ExportForm/ExportForm.vue.d.ts +6117 -1026
- package/dist/views/ExportList/ExportList.helpers.d.ts +2 -2
- package/dist/views/ExportList/ExportList.vue.d.ts +4 -3
- package/dist/views/ExportList/components/CellHistory/CellHistory.vue.d.ts +6 -5
- package/package.json +20 -24
- package/src/dev/App.vue +4 -2
- package/src/dev/env.ts +11 -11
- package/src/services/requests.ts +4 -4
- package/src/typings/model.ts +4 -4
- package/src/views/ExportForm/ExportForm.helpers.ts +4 -4
- package/src/views/ExportForm/ExportForm.types.ts +1 -1
- package/src/views/ExportForm/ExportForm.vue +6 -7
- package/src/views/ExportList/ExportList.helpers.ts +2 -2
- package/src/views/ExportList/ExportList.vue +1 -1
- package/src/views/ExportList/components/CellHistory/CellHistory.vue +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { i18n, request, useI18n, useToast, useResource, navigateBack, convertRequestErrorToMap } from "@tager/admin-services";
|
|
2
|
-
import { defineComponent, openBlock, createElementBlock, Fragment, renderList, createElementVNode, toDisplayString, createTextVNode, createCommentVNode, onMounted, resolveComponent, createBlock, withCtx, createVNode, computed, ref, watch, withModifiers } from "vue";
|
|
3
|
-
import { Page } from "@tager/admin-layout";
|
|
4
|
-
import { DataTable, useDataTable,
|
|
5
|
-
import { universalFieldUtils, DynamicField } from "@tager/admin-dynamic-field";
|
|
6
|
-
import { compile } from "path-to-regexp";
|
|
7
|
-
import { useRoute, useRouter } from "vue-router";
|
|
8
|
-
const
|
|
1
|
+
import { i18n as N, request as w, useI18n as A, useToast as Q, useResource as W, navigateBack as K, convertRequestErrorToMap as Z } from "@tager/admin-services";
|
|
2
|
+
import { defineComponent as R, openBlock as c, createElementBlock as F, Fragment as z, renderList as B, createElementVNode as C, toDisplayString as U, createTextVNode as ee, createCommentVNode as H, onMounted as O, resolveComponent as d, createBlock as b, withCtx as L, createVNode as E, computed as S, ref as h, watch as k, withModifiers as te } from "vue";
|
|
3
|
+
import { Page as q } from "@tager/admin-layout";
|
|
4
|
+
import { DataTable as re, useDataTable as oe, FormFieldSelect as ae, FormField as ne, FormFooter as se } from "@tager/admin-ui";
|
|
5
|
+
import { universalFieldUtils as J, DynamicField as ie } from "@tager/admin-dynamic-field";
|
|
6
|
+
import { compile as le } from "path-to-regexp";
|
|
7
|
+
import { useRoute as ue, useRouter as pe } from "vue-router";
|
|
8
|
+
const me = {
|
|
9
9
|
home: "Home",
|
|
10
10
|
export: "Export",
|
|
11
11
|
exportList: "Export List",
|
|
@@ -32,71 +32,58 @@ const EN = {
|
|
|
32
32
|
statusInProgress: "In Progress",
|
|
33
33
|
statusCompleted: "Completed",
|
|
34
34
|
statusFailure: "Failed"
|
|
35
|
+
}, de = {
|
|
36
|
+
home: "Главная",
|
|
37
|
+
export: "Экспорт",
|
|
38
|
+
exportList: "Список экспортов",
|
|
39
|
+
exportForm: "Форма экспорта",
|
|
40
|
+
type: "Тип",
|
|
41
|
+
params: "Параметры",
|
|
42
|
+
exportType: "Тип экспорта",
|
|
43
|
+
status: "Статус",
|
|
44
|
+
message: "Сообщение",
|
|
45
|
+
log: "Лог",
|
|
46
|
+
file: "Файл",
|
|
47
|
+
newExport: "Новый экспорт",
|
|
48
|
+
exportCreation: "Создание экспорта",
|
|
49
|
+
success: "Успех",
|
|
50
|
+
error: "Ошибка",
|
|
51
|
+
createdSuccessMessage: "Экспорт была успешно создан",
|
|
52
|
+
createdErrorMessage: "Создание экспорта не удалось",
|
|
53
|
+
filename: "Имя файла",
|
|
54
|
+
format: "Формат",
|
|
55
|
+
delimiter: "Разделитель",
|
|
56
|
+
comma: "Запятая",
|
|
57
|
+
semicolon: "Точка с запятой",
|
|
58
|
+
statusCreated: "Создан",
|
|
59
|
+
statusInProgress: "В процессе",
|
|
60
|
+
statusCompleted: "Завершен",
|
|
61
|
+
statusFailure: "Ошибка"
|
|
35
62
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export: "\u042D\u043A\u0441\u043F\u043E\u0440\u0442",
|
|
39
|
-
exportList: "\u0421\u043F\u0438\u0441\u043E\u043A \u044D\u043A\u0441\u043F\u043E\u0440\u0442\u043E\u0432",
|
|
40
|
-
exportForm: "\u0424\u043E\u0440\u043C\u0430 \u044D\u043A\u0441\u043F\u043E\u0440\u0442\u0430",
|
|
41
|
-
type: "\u0422\u0438\u043F",
|
|
42
|
-
params: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B",
|
|
43
|
-
exportType: "\u0422\u0438\u043F \u044D\u043A\u0441\u043F\u043E\u0440\u0442\u0430",
|
|
44
|
-
status: "\u0421\u0442\u0430\u0442\u0443\u0441",
|
|
45
|
-
message: "\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435",
|
|
46
|
-
log: "\u041B\u043E\u0433",
|
|
47
|
-
file: "\u0424\u0430\u0439\u043B",
|
|
48
|
-
newExport: "\u041D\u043E\u0432\u044B\u0439 \u044D\u043A\u0441\u043F\u043E\u0440\u0442",
|
|
49
|
-
exportCreation: "\u0421\u043E\u0437\u0434\u0430\u043D\u0438\u0435 \u044D\u043A\u0441\u043F\u043E\u0440\u0442\u0430",
|
|
50
|
-
success: "\u0423\u0441\u043F\u0435\u0445",
|
|
51
|
-
error: "\u041E\u0448\u0438\u0431\u043A\u0430",
|
|
52
|
-
createdSuccessMessage: "\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0431\u044B\u043B\u0430 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0441\u043E\u0437\u0434\u0430\u043D",
|
|
53
|
-
createdErrorMessage: "\u0421\u043E\u0437\u0434\u0430\u043D\u0438\u0435 \u044D\u043A\u0441\u043F\u043E\u0440\u0442\u0430 \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C",
|
|
54
|
-
filename: "\u0418\u043C\u044F \u0444\u0430\u0439\u043B\u0430",
|
|
55
|
-
format: "\u0424\u043E\u0440\u043C\u0430\u0442",
|
|
56
|
-
delimiter: "\u0420\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C",
|
|
57
|
-
comma: "\u0417\u0430\u043F\u044F\u0442\u0430\u044F",
|
|
58
|
-
semicolon: "\u0422\u043E\u0447\u043A\u0430 \u0441 \u0437\u0430\u043F\u044F\u0442\u043E\u0439",
|
|
59
|
-
statusCreated: "\u0421\u043E\u0437\u0434\u0430\u043D",
|
|
60
|
-
statusInProgress: "\u0412 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u0435",
|
|
61
|
-
statusCompleted: "\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043D",
|
|
62
|
-
statusFailure: "\u041E\u0448\u0438\u0431\u043A\u0430"
|
|
63
|
-
};
|
|
64
|
-
function applyTranslations() {
|
|
65
|
-
i18n.addTranslations("en", "export", EN);
|
|
66
|
-
i18n.addTranslations("ru", "export", RU);
|
|
63
|
+
function ce() {
|
|
64
|
+
N.addTranslations("en", "export", me), N.addTranslations("ru", "export", de);
|
|
67
65
|
}
|
|
68
|
-
function
|
|
69
|
-
return
|
|
66
|
+
function fe(e) {
|
|
67
|
+
return w.get({ path: "/admin/tager/export", params: e });
|
|
70
68
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
69
|
+
function ge() {
|
|
70
|
+
return w.get({ path: "/admin/tager/export/strategies" });
|
|
73
71
|
}
|
|
74
|
-
function
|
|
75
|
-
return
|
|
72
|
+
function ve(e) {
|
|
73
|
+
return w.post({ path: "/admin/tager/export", body: e });
|
|
76
74
|
}
|
|
77
|
-
const
|
|
75
|
+
const T = {
|
|
78
76
|
EXPORT_LIST: "/export",
|
|
79
77
|
EXPORT_FORM: "/export/:exportId"
|
|
80
78
|
};
|
|
81
|
-
function
|
|
82
|
-
return
|
|
83
|
-
}
|
|
84
|
-
function getExportFormUrl(params) {
|
|
85
|
-
return compile(EXPORT_ROUTE_PATHS.EXPORT_FORM)(params);
|
|
79
|
+
function V() {
|
|
80
|
+
return T.EXPORT_LIST;
|
|
86
81
|
}
|
|
87
|
-
function
|
|
88
|
-
|
|
89
|
-
return new Intl.DateTimeFormat("ru-RU", {
|
|
90
|
-
year: "numeric",
|
|
91
|
-
month: "numeric",
|
|
92
|
-
day: "numeric",
|
|
93
|
-
hour: "numeric",
|
|
94
|
-
minute: "numeric",
|
|
95
|
-
second: "numeric"
|
|
96
|
-
}).format(date);
|
|
82
|
+
function xe(e) {
|
|
83
|
+
return le(T.EXPORT_FORM)(e);
|
|
97
84
|
}
|
|
98
|
-
function
|
|
99
|
-
switch (
|
|
85
|
+
function Y(e, t) {
|
|
86
|
+
switch (e) {
|
|
100
87
|
case "CREATED":
|
|
101
88
|
return t("export:statusCreated");
|
|
102
89
|
case "IN_PROGRESS":
|
|
@@ -109,15 +96,18 @@ function getExportStatusLabel(status, t) {
|
|
|
109
96
|
return "Unknown";
|
|
110
97
|
}
|
|
111
98
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
99
|
+
function ye(e) {
|
|
100
|
+
const t = new Date(e);
|
|
101
|
+
return new Intl.DateTimeFormat("ru-RU", {
|
|
102
|
+
year: "numeric",
|
|
103
|
+
month: "numeric",
|
|
104
|
+
day: "numeric",
|
|
105
|
+
hour: "numeric",
|
|
106
|
+
minute: "numeric",
|
|
107
|
+
second: "numeric"
|
|
108
|
+
}).format(t);
|
|
109
|
+
}
|
|
110
|
+
const Ee = R({
|
|
121
111
|
name: "CellHistory",
|
|
122
112
|
props: {
|
|
123
113
|
history: {
|
|
@@ -127,165 +117,159 @@ const _sfc_main$2 = defineComponent({
|
|
|
127
117
|
},
|
|
128
118
|
setup() {
|
|
129
119
|
return {
|
|
130
|
-
dateTimeFormat,
|
|
131
|
-
getExportStatusLabel
|
|
120
|
+
dateTimeFormat: ye,
|
|
121
|
+
getExportStatusLabel: Y
|
|
132
122
|
};
|
|
133
123
|
}
|
|
134
|
-
})
|
|
135
|
-
const
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
return
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
124
|
+
}), D = (e, t) => {
|
|
125
|
+
const o = e.__vccOpts || e;
|
|
126
|
+
for (const [a, n] of t)
|
|
127
|
+
o[a] = n;
|
|
128
|
+
return o;
|
|
129
|
+
}, he = { key: 0 }, Fe = { class: "name" };
|
|
130
|
+
function be(e, t, o, a, n, u) {
|
|
131
|
+
return e.history.length > 0 ? (c(), F("ul", he, [
|
|
132
|
+
(c(!0), F(z, null, B(e.history, (s, i) => (c(), F("li", { key: i }, [
|
|
133
|
+
C("span", Fe, U(e.getExportStatusLabel(s.status, e.$i18n.t)), 1),
|
|
134
|
+
ee(" " + U(e.dateTimeFormat(s.datetime)), 1)
|
|
135
|
+
]))), 128))
|
|
136
|
+
])) : H("", !0);
|
|
146
137
|
}
|
|
147
|
-
|
|
148
|
-
const _sfc_main$1 = defineComponent({
|
|
138
|
+
const Le = /* @__PURE__ */ D(Ee, [["render", be], ["__scopeId", "data-v-0a48f212"]]), Te = R({
|
|
149
139
|
name: "ExportList",
|
|
150
140
|
components: {
|
|
151
|
-
Page,
|
|
152
|
-
CellHistory,
|
|
153
|
-
DataTable
|
|
141
|
+
Page: q,
|
|
142
|
+
CellHistory: Le,
|
|
143
|
+
DataTable: re
|
|
154
144
|
},
|
|
155
145
|
setup() {
|
|
156
|
-
const { t } =
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
pageSize: params.pageSize
|
|
146
|
+
const { t: e } = A(), {
|
|
147
|
+
fetchEntityList: t,
|
|
148
|
+
isLoading: o,
|
|
149
|
+
rowData: a,
|
|
150
|
+
errorMessage: n,
|
|
151
|
+
searchQuery: u,
|
|
152
|
+
handleChange: s,
|
|
153
|
+
pageSize: i,
|
|
154
|
+
pageCount: m,
|
|
155
|
+
pageNumber: f
|
|
156
|
+
} = oe({
|
|
157
|
+
fetchEntityList: (r) => fe({
|
|
158
|
+
pageNumber: r.pageNumber,
|
|
159
|
+
pageSize: r.pageSize
|
|
171
160
|
}),
|
|
172
161
|
initialValue: [],
|
|
173
162
|
resourceName: "Export list",
|
|
174
163
|
pageSize: 100
|
|
175
164
|
});
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
})
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
id: 2,
|
|
188
|
-
name: t("export:status"),
|
|
189
|
-
field: "status",
|
|
190
|
-
width: "120px",
|
|
191
|
-
format: ({ row }) => getExportStatusLabel(row.status, t)
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
id: 3,
|
|
195
|
-
name: t("export:type"),
|
|
196
|
-
field: "strategy",
|
|
197
|
-
width: "200px",
|
|
198
|
-
options: {
|
|
199
|
-
maxLength: 24
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
id: 4,
|
|
204
|
-
name: t("export:params"),
|
|
205
|
-
field: "params",
|
|
206
|
-
type: "key-value",
|
|
207
|
-
format: ({ row }) => {
|
|
208
|
-
const result = [];
|
|
209
|
-
Object.keys(row.params).forEach((param) => {
|
|
210
|
-
result.push({
|
|
211
|
-
key: param,
|
|
212
|
-
value: row.params[param]
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
return result;
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
id: 5,
|
|
220
|
-
name: t("export:message"),
|
|
221
|
-
field: "message",
|
|
222
|
-
width: "200px"
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
id: 6,
|
|
226
|
-
name: t("export:log"),
|
|
227
|
-
field: "history",
|
|
228
|
-
width: "300px"
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
id: 7,
|
|
232
|
-
name: t("export:file"),
|
|
233
|
-
field: "file",
|
|
234
|
-
type: "file",
|
|
235
|
-
width: "100px",
|
|
236
|
-
style: {
|
|
237
|
-
textAlign: "center"
|
|
165
|
+
return O(() => {
|
|
166
|
+
t();
|
|
167
|
+
}), {
|
|
168
|
+
columnDefs: [
|
|
169
|
+
{
|
|
170
|
+
id: 1,
|
|
171
|
+
name: "ID",
|
|
172
|
+
field: "id",
|
|
173
|
+
width: "50px"
|
|
238
174
|
},
|
|
239
|
-
|
|
240
|
-
|
|
175
|
+
{
|
|
176
|
+
id: 2,
|
|
177
|
+
name: e("export:status"),
|
|
178
|
+
field: "status",
|
|
179
|
+
width: "120px",
|
|
180
|
+
format: ({ row: r }) => Y(r.status, e)
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
id: 3,
|
|
184
|
+
name: e("export:type"),
|
|
185
|
+
field: "strategy",
|
|
186
|
+
width: "200px",
|
|
187
|
+
options: {
|
|
188
|
+
maxLength: 24
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: 4,
|
|
193
|
+
name: e("export:params"),
|
|
194
|
+
field: "params",
|
|
195
|
+
type: "key-value",
|
|
196
|
+
format: ({ row: r }) => {
|
|
197
|
+
const v = [];
|
|
198
|
+
return Object.keys(r.params).forEach((x) => {
|
|
199
|
+
v.push({
|
|
200
|
+
key: x,
|
|
201
|
+
value: r.params[x]
|
|
202
|
+
});
|
|
203
|
+
}), v;
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
id: 5,
|
|
208
|
+
name: e("export:message"),
|
|
209
|
+
field: "message",
|
|
210
|
+
width: "200px"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: 6,
|
|
214
|
+
name: e("export:log"),
|
|
215
|
+
field: "history",
|
|
216
|
+
width: "300px"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
id: 7,
|
|
220
|
+
name: e("export:file"),
|
|
221
|
+
field: "file",
|
|
222
|
+
type: "file",
|
|
223
|
+
width: "100px",
|
|
224
|
+
style: {
|
|
225
|
+
textAlign: "center"
|
|
226
|
+
},
|
|
227
|
+
headStyle: {
|
|
228
|
+
textAlign: "center"
|
|
229
|
+
}
|
|
241
230
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
pageSize,
|
|
253
|
-
pageCount,
|
|
254
|
-
pageNumber
|
|
231
|
+
],
|
|
232
|
+
getExportFormUrl: xe,
|
|
233
|
+
rowData: a,
|
|
234
|
+
isRowDataLoading: o,
|
|
235
|
+
errorMessage: n,
|
|
236
|
+
searchQuery: u,
|
|
237
|
+
handleChange: s,
|
|
238
|
+
pageSize: i,
|
|
239
|
+
pageCount: m,
|
|
240
|
+
pageNumber: f
|
|
255
241
|
};
|
|
256
242
|
}
|
|
257
243
|
});
|
|
258
|
-
function
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
return openBlock(), createBlock(_component_Page, {
|
|
263
|
-
title: _ctx.$i18n.t("export:export"),
|
|
244
|
+
function Se(e, t, o, a, n, u) {
|
|
245
|
+
const s = d("CellHistory"), i = d("DataTable"), m = d("Page");
|
|
246
|
+
return c(), b(m, {
|
|
247
|
+
title: e.$i18n.t("export:export"),
|
|
264
248
|
"header-buttons": [
|
|
265
249
|
{
|
|
266
|
-
text:
|
|
267
|
-
href:
|
|
250
|
+
text: e.$i18n.t("export:newExport"),
|
|
251
|
+
href: e.getExportFormUrl({ exportId: "create" })
|
|
268
252
|
}
|
|
269
253
|
]
|
|
270
254
|
}, {
|
|
271
|
-
default:
|
|
272
|
-
|
|
273
|
-
"column-defs":
|
|
274
|
-
"row-data":
|
|
275
|
-
loading:
|
|
276
|
-
"error-message":
|
|
255
|
+
default: L(() => [
|
|
256
|
+
E(i, {
|
|
257
|
+
"column-defs": e.columnDefs,
|
|
258
|
+
"row-data": e.rowData,
|
|
259
|
+
loading: e.isRowDataLoading,
|
|
260
|
+
"error-message": e.errorMessage,
|
|
277
261
|
pagination: {
|
|
278
|
-
pageSize:
|
|
279
|
-
pageCount:
|
|
280
|
-
pageNumber:
|
|
281
|
-
disabled:
|
|
262
|
+
pageSize: e.pageSize,
|
|
263
|
+
pageCount: e.pageCount,
|
|
264
|
+
pageNumber: e.pageNumber,
|
|
265
|
+
disabled: e.isRowDataLoading
|
|
282
266
|
},
|
|
283
|
-
"use-search":
|
|
284
|
-
onChange:
|
|
267
|
+
"use-search": !1,
|
|
268
|
+
onChange: e.handleChange
|
|
285
269
|
}, {
|
|
286
|
-
"cell(history)":
|
|
287
|
-
|
|
288
|
-
history:
|
|
270
|
+
"cell(history)": L(({ row: f }) => [
|
|
271
|
+
E(s, {
|
|
272
|
+
history: f.history
|
|
289
273
|
}, null, 8, ["history"])
|
|
290
274
|
]),
|
|
291
275
|
_: 1
|
|
@@ -294,35 +278,31 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
294
278
|
_: 1
|
|
295
279
|
}, 8, ["title", "header-buttons"]);
|
|
296
280
|
}
|
|
297
|
-
|
|
298
|
-
function
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
if (newExtension) {
|
|
302
|
-
return `${fileNameWithoutExtension}.${newExtension}`;
|
|
303
|
-
}
|
|
304
|
-
return fileNameWithoutExtension;
|
|
281
|
+
const Ce = /* @__PURE__ */ D(Te, [["render", Se]]);
|
|
282
|
+
function Oe(e, t) {
|
|
283
|
+
const o = e.lastIndexOf("."), a = e.slice(0, o);
|
|
284
|
+
return t ? `${a}.${t}` : a;
|
|
305
285
|
}
|
|
306
|
-
function
|
|
307
|
-
var
|
|
286
|
+
function we(e, t) {
|
|
287
|
+
var o, a, n;
|
|
308
288
|
return {
|
|
309
|
-
strategy: (
|
|
310
|
-
filename:
|
|
311
|
-
format: (
|
|
312
|
-
delimiter: (
|
|
313
|
-
params:
|
|
314
|
-
name:
|
|
315
|
-
value:
|
|
289
|
+
strategy: ((o = e.strategy) == null ? void 0 : o.value) ?? "",
|
|
290
|
+
filename: e.filename,
|
|
291
|
+
format: ((a = e.format) == null ? void 0 : a.value) ?? "",
|
|
292
|
+
delimiter: ((n = e.delimiter) == null ? void 0 : n.value) ?? "",
|
|
293
|
+
params: t.map((u) => ({
|
|
294
|
+
name: u.config.name,
|
|
295
|
+
value: J.getOutgoingValue(u)
|
|
316
296
|
}))
|
|
317
297
|
};
|
|
318
298
|
}
|
|
319
|
-
function
|
|
320
|
-
return
|
|
321
|
-
label:
|
|
322
|
-
value:
|
|
299
|
+
function Re(e) {
|
|
300
|
+
return e.map((t) => ({
|
|
301
|
+
label: t.name,
|
|
302
|
+
value: t.id
|
|
323
303
|
}));
|
|
324
304
|
}
|
|
325
|
-
const
|
|
305
|
+
const X = [
|
|
326
306
|
{ value: "CSV", label: "CSV" },
|
|
327
307
|
{ value: "XLS", label: "XLS" },
|
|
328
308
|
{ value: "XML", label: "XML" },
|
|
@@ -330,230 +310,209 @@ const formatOptionList = [
|
|
|
330
310
|
{ value: "JSON", label: "JSON" },
|
|
331
311
|
{ value: "TXT", label: "TXT" }
|
|
332
312
|
];
|
|
333
|
-
function
|
|
334
|
-
return
|
|
313
|
+
function _(e) {
|
|
314
|
+
return e === "CSV";
|
|
335
315
|
}
|
|
336
|
-
|
|
337
|
-
const _sfc_main = defineComponent({
|
|
316
|
+
const De = R({
|
|
338
317
|
name: "ExportForm",
|
|
339
318
|
components: {
|
|
340
|
-
DynamicField,
|
|
341
|
-
FormFooter,
|
|
342
|
-
Page,
|
|
343
|
-
FormField,
|
|
344
|
-
FormFieldSelect
|
|
319
|
+
DynamicField: ie,
|
|
320
|
+
FormFooter: se,
|
|
321
|
+
Page: q,
|
|
322
|
+
FormField: ne,
|
|
323
|
+
FormFieldSelect: ae
|
|
345
324
|
},
|
|
346
325
|
setup() {
|
|
347
|
-
var
|
|
348
|
-
const { t } =
|
|
349
|
-
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
] = useResource({
|
|
356
|
-
fetchResource: getStrategies,
|
|
326
|
+
var M;
|
|
327
|
+
const { t: e } = A();
|
|
328
|
+
ue();
|
|
329
|
+
const t = pe(), o = Q(), [
|
|
330
|
+
a,
|
|
331
|
+
{ data: n, loading: u }
|
|
332
|
+
] = W({
|
|
333
|
+
fetchResource: ge,
|
|
357
334
|
initialValue: [],
|
|
358
335
|
resourceName: "Strategies"
|
|
359
|
-
})
|
|
360
|
-
|
|
361
|
-
() => convertStrategiesToStrategyOptionList(strategies.value)
|
|
336
|
+
}), s = S(
|
|
337
|
+
() => Re(n.value)
|
|
362
338
|
);
|
|
363
|
-
|
|
364
|
-
|
|
339
|
+
O(() => {
|
|
340
|
+
a();
|
|
365
341
|
});
|
|
366
|
-
const
|
|
367
|
-
{ value: ",", label:
|
|
368
|
-
{ value: ";", label:
|
|
369
|
-
])
|
|
370
|
-
const defaultExtension = formatOptionList[0];
|
|
371
|
-
const defaultDelimiter = delimiterOptionList.value[0];
|
|
372
|
-
const errors = ref({});
|
|
373
|
-
const values = ref({
|
|
342
|
+
const i = S(() => [
|
|
343
|
+
{ value: ",", label: e("export:comma") },
|
|
344
|
+
{ value: ";", label: e("export:semicolon") }
|
|
345
|
+
]), m = X[0], f = i.value[0], g = h({}), r = h({
|
|
374
346
|
strategy: null,
|
|
375
|
-
filename: `export.${
|
|
376
|
-
format:
|
|
377
|
-
delimiter:
|
|
378
|
-
});
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
(strategy) => {
|
|
385
|
-
var _a3;
|
|
386
|
-
return strategy.id === ((_a3 = values.value.strategy) == null ? void 0 : _a3.value);
|
|
347
|
+
filename: `export.${m.value.toLowerCase()}`,
|
|
348
|
+
format: m,
|
|
349
|
+
delimiter: f
|
|
350
|
+
}), v = h(!1), x = h([]);
|
|
351
|
+
function $() {
|
|
352
|
+
const l = n.value.find(
|
|
353
|
+
(p) => {
|
|
354
|
+
var I;
|
|
355
|
+
return p.id === ((I = r.value.strategy) == null ? void 0 : I.value);
|
|
387
356
|
}
|
|
388
|
-
);
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
(fieldConfig) => universalFieldUtils.createFormField(fieldConfig, null)
|
|
357
|
+
), y = (l == null ? void 0 : l.fields) ?? [];
|
|
358
|
+
x.value = y.map(
|
|
359
|
+
(p) => J.createFormField(p, null)
|
|
392
360
|
);
|
|
393
361
|
}
|
|
394
|
-
|
|
395
|
-
() =>
|
|
362
|
+
k(
|
|
363
|
+
() => r.value.strategy,
|
|
396
364
|
() => {
|
|
397
|
-
|
|
365
|
+
$();
|
|
398
366
|
}
|
|
399
|
-
)
|
|
400
|
-
|
|
401
|
-
updateTemplateValues();
|
|
367
|
+
), O(() => {
|
|
368
|
+
$();
|
|
402
369
|
});
|
|
403
|
-
const
|
|
404
|
-
|
|
370
|
+
const P = h(
|
|
371
|
+
_(((M = r.value.format) == null ? void 0 : M.value) ?? "")
|
|
405
372
|
);
|
|
406
|
-
|
|
407
|
-
() =>
|
|
373
|
+
k(
|
|
374
|
+
() => r.value.format,
|
|
408
375
|
() => {
|
|
409
|
-
var
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
)
|
|
415
|
-
|
|
416
|
-
(_c = (_b2 = values.value.format) == null ? void 0 : _b2.value) != null ? _c : ""
|
|
376
|
+
var y, p;
|
|
377
|
+
const l = (y = r.value.format) == null ? void 0 : y.value.toLowerCase();
|
|
378
|
+
r.value.filename = Oe(
|
|
379
|
+
r.value.filename,
|
|
380
|
+
l || ""
|
|
381
|
+
), P.value = _(
|
|
382
|
+
((p = r.value.format) == null ? void 0 : p.value) ?? ""
|
|
417
383
|
);
|
|
418
384
|
}
|
|
419
385
|
);
|
|
420
|
-
function
|
|
421
|
-
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
|
|
386
|
+
function j(l) {
|
|
387
|
+
v.value = !0;
|
|
388
|
+
const y = we(
|
|
389
|
+
r.value,
|
|
390
|
+
x.value
|
|
425
391
|
);
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
if (event.type === "create" || event.type === "save" || event.type === "create_exit" || event.type === "save_exit") {
|
|
429
|
-
navigateBack(router, getExportListUrl());
|
|
430
|
-
}
|
|
431
|
-
toast.show({
|
|
392
|
+
ve(y).then(() => {
|
|
393
|
+
g.value = {}, (l.type === "create" || l.type === "save" || l.type === "create_exit" || l.type === "save_exit") && K(t, V()), o.show({
|
|
432
394
|
variant: "success",
|
|
433
|
-
title:
|
|
434
|
-
body:
|
|
395
|
+
title: e("export:success"),
|
|
396
|
+
body: e("export:createdSuccessMessage")
|
|
435
397
|
});
|
|
436
|
-
}).catch((
|
|
437
|
-
console.error(
|
|
438
|
-
errors.value = convertRequestErrorToMap(error);
|
|
439
|
-
toast.show({
|
|
398
|
+
}).catch((p) => {
|
|
399
|
+
console.error(p), g.value = Z(p), o.show({
|
|
440
400
|
variant: "danger",
|
|
441
|
-
title:
|
|
442
|
-
body:
|
|
401
|
+
title: e("export:error"),
|
|
402
|
+
body: e("export:createdErrorMessage")
|
|
443
403
|
});
|
|
444
404
|
}).finally(() => {
|
|
445
|
-
|
|
405
|
+
v.value = !1;
|
|
446
406
|
});
|
|
447
407
|
}
|
|
448
|
-
const
|
|
408
|
+
const G = S(() => u.value);
|
|
449
409
|
return {
|
|
450
|
-
values,
|
|
451
|
-
errors,
|
|
452
|
-
isSubmitting,
|
|
453
|
-
submitForm,
|
|
454
|
-
getExportListUrl,
|
|
455
|
-
strategyOptionList,
|
|
456
|
-
formatOptionList,
|
|
457
|
-
delimiterOptionList,
|
|
458
|
-
isContentLoading,
|
|
459
|
-
shouldDisplayDelimiter,
|
|
460
|
-
templateValues
|
|
410
|
+
values: r,
|
|
411
|
+
errors: g,
|
|
412
|
+
isSubmitting: v,
|
|
413
|
+
submitForm: j,
|
|
414
|
+
getExportListUrl: V,
|
|
415
|
+
strategyOptionList: s,
|
|
416
|
+
formatOptionList: X,
|
|
417
|
+
delimiterOptionList: i,
|
|
418
|
+
isContentLoading: G,
|
|
419
|
+
shouldDisplayDelimiter: P,
|
|
420
|
+
templateValues: x
|
|
461
421
|
};
|
|
462
422
|
}
|
|
463
|
-
});
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
const _component_FormFooter = resolveComponent("FormFooter");
|
|
470
|
-
const _component_Page = resolveComponent("Page");
|
|
471
|
-
return openBlock(), createBlock(_component_Page, {
|
|
472
|
-
title: _ctx.$i18n.t("export:newExport"),
|
|
473
|
-
"is-content-loading": _ctx.isContentLoading
|
|
423
|
+
}), $e = { class: "field" };
|
|
424
|
+
function Pe(e, t, o, a, n, u) {
|
|
425
|
+
const s = d("FormFieldSelect"), i = d("FormField"), m = d("DynamicField"), f = d("FormFooter"), g = d("Page");
|
|
426
|
+
return c(), b(g, {
|
|
427
|
+
title: e.$i18n.t("export:newExport"),
|
|
428
|
+
"is-content-loading": e.isContentLoading
|
|
474
429
|
}, {
|
|
475
|
-
footer:
|
|
476
|
-
|
|
477
|
-
"back-href":
|
|
478
|
-
|
|
479
|
-
"is-
|
|
480
|
-
|
|
481
|
-
}, null, 8, ["back-href", "
|
|
430
|
+
footer: L(() => [
|
|
431
|
+
E(f, {
|
|
432
|
+
"back-href": e.getExportListUrl(),
|
|
433
|
+
"is-submitting": e.isSubmitting,
|
|
434
|
+
"is-creation": !0,
|
|
435
|
+
onSubmit: e.submitForm
|
|
436
|
+
}, null, 8, ["back-href", "is-submitting", "onSubmit"])
|
|
482
437
|
]),
|
|
483
|
-
default:
|
|
484
|
-
|
|
438
|
+
default: L(() => [
|
|
439
|
+
C("form", {
|
|
485
440
|
novalidate: "",
|
|
486
|
-
onSubmit:
|
|
441
|
+
onSubmit: t[4] || (t[4] = te(() => {
|
|
487
442
|
}, ["prevent"]))
|
|
488
443
|
}, [
|
|
489
|
-
|
|
490
|
-
value:
|
|
491
|
-
"onUpdate:value":
|
|
444
|
+
E(s, {
|
|
445
|
+
value: e.values.strategy,
|
|
446
|
+
"onUpdate:value": t[0] || (t[0] = (r) => e.values.strategy = r),
|
|
492
447
|
name: "exportType",
|
|
493
|
-
error:
|
|
494
|
-
label:
|
|
495
|
-
options:
|
|
448
|
+
error: e.errors.strategy,
|
|
449
|
+
label: e.$i18n.t("export:exportType"),
|
|
450
|
+
options: e.strategyOptionList
|
|
496
451
|
}, null, 8, ["value", "error", "label", "options"]),
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
value:
|
|
500
|
-
"onUpdate:value":
|
|
501
|
-
error:
|
|
502
|
-
label:
|
|
452
|
+
C("div", $e, [
|
|
453
|
+
E(i, {
|
|
454
|
+
value: e.values.filename,
|
|
455
|
+
"onUpdate:value": t[1] || (t[1] = (r) => e.values.filename = r),
|
|
456
|
+
error: e.errors.filename,
|
|
457
|
+
label: e.$i18n.t("export:filename"),
|
|
503
458
|
name: "filename"
|
|
504
459
|
}, null, 8, ["value", "error", "label"]),
|
|
505
|
-
|
|
506
|
-
value:
|
|
507
|
-
"onUpdate:value":
|
|
508
|
-
options:
|
|
509
|
-
error:
|
|
510
|
-
label:
|
|
460
|
+
E(s, {
|
|
461
|
+
value: e.values.format,
|
|
462
|
+
"onUpdate:value": t[2] || (t[2] = (r) => e.values.format = r),
|
|
463
|
+
options: e.formatOptionList,
|
|
464
|
+
error: e.errors.format,
|
|
465
|
+
label: e.$i18n.t("export:format"),
|
|
511
466
|
name: "format"
|
|
512
467
|
}, null, 8, ["value", "options", "error", "label"]),
|
|
513
|
-
|
|
468
|
+
e.shouldDisplayDelimiter ? (c(), b(s, {
|
|
514
469
|
key: 0,
|
|
515
|
-
value:
|
|
516
|
-
"onUpdate:value":
|
|
517
|
-
options:
|
|
518
|
-
error:
|
|
519
|
-
label:
|
|
470
|
+
value: e.values.delimiter,
|
|
471
|
+
"onUpdate:value": t[3] || (t[3] = (r) => e.values.delimiter = r),
|
|
472
|
+
options: e.delimiterOptionList,
|
|
473
|
+
error: e.errors.delimiter,
|
|
474
|
+
label: e.$i18n.t("export:delimiter"),
|
|
520
475
|
name: "delimiter"
|
|
521
|
-
}, null, 8, ["value", "options", "error", "label"])) :
|
|
476
|
+
}, null, 8, ["value", "options", "error", "label"])) : H("", !0)
|
|
522
477
|
]),
|
|
523
|
-
(
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
}, null, 8, ["field"]);
|
|
528
|
-
}), 128))
|
|
478
|
+
(c(!0), F(z, null, B(e.templateValues, (r) => (c(), b(m, {
|
|
479
|
+
key: r.config.name,
|
|
480
|
+
field: r
|
|
481
|
+
}, null, 8, ["field"]))), 128))
|
|
529
482
|
], 32)
|
|
530
483
|
]),
|
|
531
484
|
_: 1
|
|
532
485
|
}, 8, ["title", "is-content-loading"]);
|
|
533
486
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
component: ExportList,
|
|
487
|
+
const Me = /* @__PURE__ */ D(De, [["render", Pe], ["__scopeId", "data-v-5784f168"]]), Ie = {
|
|
488
|
+
path: T.EXPORT_LIST,
|
|
489
|
+
component: Ce,
|
|
538
490
|
name: "Export List",
|
|
539
491
|
meta: {
|
|
540
|
-
getBreadcrumbs: (
|
|
541
|
-
{ url: "/", text:
|
|
542
|
-
{ url:
|
|
492
|
+
getBreadcrumbs: (e, t) => [
|
|
493
|
+
{ url: "/", text: t.t("export:home") },
|
|
494
|
+
{ url: e.path, text: t.t("export:export") }
|
|
543
495
|
]
|
|
544
496
|
}
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
component: ExportForm,
|
|
497
|
+
}, ze = {
|
|
498
|
+
path: T.EXPORT_FORM,
|
|
499
|
+
component: Me,
|
|
549
500
|
name: "Export Form",
|
|
550
501
|
meta: {
|
|
551
|
-
getBreadcrumbs: (
|
|
552
|
-
{ url: "/", text:
|
|
553
|
-
{ url:
|
|
554
|
-
{ url:
|
|
502
|
+
getBreadcrumbs: (e, t) => [
|
|
503
|
+
{ url: "/", text: t.t("export:home") },
|
|
504
|
+
{ url: Ie.path, text: t.t("export:export") },
|
|
505
|
+
{ url: e.path, text: t.t("export:newExport") }
|
|
555
506
|
]
|
|
556
507
|
}
|
|
557
508
|
};
|
|
558
|
-
|
|
559
|
-
export {
|
|
509
|
+
ce();
|
|
510
|
+
export {
|
|
511
|
+
ze as EXPORT_FORM_ROUTE,
|
|
512
|
+
Ie as EXPORT_LIST_ROUTE,
|
|
513
|
+
ve as createExport,
|
|
514
|
+
xe as getExportFormUrl,
|
|
515
|
+
fe as getExportList,
|
|
516
|
+
V as getExportListUrl,
|
|
517
|
+
ge as getStrategies
|
|
518
|
+
};
|