@tager/admin-import 1.0.0 → 1.0.1
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 +277 -311
- package/dist/services/requests.d.ts +2 -2
- package/dist/style.css +1 -1
- package/dist/typings/model.d.ts +2 -2
- package/dist/views/ImportForm/ImportForm.helpers.d.ts +4 -4
- package/dist/views/ImportForm/ImportForm.vue.d.ts +1845 -370
- package/dist/views/ImportList/ImportList.vue.d.ts +5 -4
- package/dist/views/ImportList/components/CellHistory/CellHistory.vue.d.ts +5 -4
- 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/ImportForm/ImportForm.helpers.ts +3 -3
- package/src/views/ImportForm/ImportForm.vue +8 -8
- package/src/views/ImportList/ImportList.vue +2 -3
- package/src/views/ImportList/components/CellHistory/CellHistory.vue +4 -2
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
|
|
3
|
-
import { DataTable, useDataTable,
|
|
4
|
-
import { Page } from "@tager/admin-layout";
|
|
5
|
-
import { universalFieldUtils, DynamicField } from "@tager/admin-dynamic-field";
|
|
6
|
-
import { compile } from "path-to-regexp";
|
|
7
|
-
import { useRouter } from "vue-router";
|
|
8
|
-
const
|
|
1
|
+
import { i18n as O, request as M, useI18n as P, useToast as B, useResource as H, navigateBack as q, convertRequestErrorToMap as Q } from "@tager/admin-services";
|
|
2
|
+
import { defineComponent as R, openBlock as c, createElementBlock as F, Fragment as E, renderList as N, createElementVNode as k, toDisplayString as $, createTextVNode as j, createCommentVNode as G, onMounted as L, resolveComponent as u, createBlock as w, withCtx as v, createVNode as h, computed as S, ref as I, watch as J, withModifiers as K } from "vue";
|
|
3
|
+
import { DataTable as W, useDataTable as X, FormFieldSelect as Y, FormFooter as Z, FormFieldFileInput as x } from "@tager/admin-ui";
|
|
4
|
+
import { Page as U } from "@tager/admin-layout";
|
|
5
|
+
import { universalFieldUtils as V, DynamicField as ee } from "@tager/admin-dynamic-field";
|
|
6
|
+
import { compile as te } from "path-to-regexp";
|
|
7
|
+
import { useRouter as oe } from "vue-router";
|
|
8
|
+
const re = {
|
|
9
9
|
home: "Home",
|
|
10
10
|
import: "Import",
|
|
11
11
|
importList: "Import List",
|
|
@@ -23,69 +23,59 @@ const EN = {
|
|
|
23
23
|
error: "Error",
|
|
24
24
|
createdSuccessMessage: "Import has been successfully created",
|
|
25
25
|
createdErrorMessage: "Import creation has been failed"
|
|
26
|
+
}, ae = {
|
|
27
|
+
home: "Главная",
|
|
28
|
+
import: "Импорт",
|
|
29
|
+
importList: "Список импортов",
|
|
30
|
+
importForm: "Форма импорта",
|
|
31
|
+
type: "Тип",
|
|
32
|
+
importType: "Тип импорта",
|
|
33
|
+
status: "Статус",
|
|
34
|
+
message: "Сообщение",
|
|
35
|
+
log: "Лог",
|
|
36
|
+
params: "Параметры",
|
|
37
|
+
file: "Файл",
|
|
38
|
+
newImport: "Новый импорт",
|
|
39
|
+
importCreation: "Создание импорта",
|
|
40
|
+
success: "Успех",
|
|
41
|
+
error: "Ошибка",
|
|
42
|
+
createdSuccessMessage: "Импорт была успешно создан",
|
|
43
|
+
createdErrorMessage: "Создание импорта не удалось"
|
|
26
44
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
import: "\u0418\u043C\u043F\u043E\u0440\u0442",
|
|
30
|
-
importList: "\u0421\u043F\u0438\u0441\u043E\u043A \u0438\u043C\u043F\u043E\u0440\u0442\u043E\u0432",
|
|
31
|
-
importForm: "\u0424\u043E\u0440\u043C\u0430 \u0438\u043C\u043F\u043E\u0440\u0442\u0430",
|
|
32
|
-
type: "\u0422\u0438\u043F",
|
|
33
|
-
importType: "\u0422\u0438\u043F \u0438\u043C\u043F\u043E\u0440\u0442\u0430",
|
|
34
|
-
status: "\u0421\u0442\u0430\u0442\u0443\u0441",
|
|
35
|
-
message: "\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435",
|
|
36
|
-
log: "\u041B\u043E\u0433",
|
|
37
|
-
params: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B",
|
|
38
|
-
file: "\u0424\u0430\u0439\u043B",
|
|
39
|
-
newImport: "\u041D\u043E\u0432\u044B\u0439 \u0438\u043C\u043F\u043E\u0440\u0442",
|
|
40
|
-
importCreation: "\u0421\u043E\u0437\u0434\u0430\u043D\u0438\u0435 \u0438\u043C\u043F\u043E\u0440\u0442\u0430",
|
|
41
|
-
success: "\u0423\u0441\u043F\u0435\u0445",
|
|
42
|
-
error: "\u041E\u0448\u0438\u0431\u043A\u0430",
|
|
43
|
-
createdSuccessMessage: "\u0418\u043C\u043F\u043E\u0440\u0442 \u0431\u044B\u043B\u0430 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0441\u043E\u0437\u0434\u0430\u043D",
|
|
44
|
-
createdErrorMessage: "\u0421\u043E\u0437\u0434\u0430\u043D\u0438\u0435 \u0438\u043C\u043F\u043E\u0440\u0442\u0430 \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C"
|
|
45
|
-
};
|
|
46
|
-
function applyTranslations() {
|
|
47
|
-
i18n.addTranslations("en", "import", EN);
|
|
48
|
-
i18n.addTranslations("ru", "import", RU);
|
|
45
|
+
function ie() {
|
|
46
|
+
O.addTranslations("en", "import", re), O.addTranslations("ru", "import", ae);
|
|
49
47
|
}
|
|
50
|
-
function
|
|
51
|
-
return
|
|
48
|
+
function ne(e) {
|
|
49
|
+
return M.get({ path: "/admin/tager/import", params: e });
|
|
52
50
|
}
|
|
53
|
-
function
|
|
54
|
-
return
|
|
51
|
+
function se() {
|
|
52
|
+
return M.get({ path: "/admin/tager/import/info" });
|
|
55
53
|
}
|
|
56
|
-
function
|
|
57
|
-
return
|
|
54
|
+
function me(e) {
|
|
55
|
+
return M.post({ path: "/admin/tager/import", body: e });
|
|
58
56
|
}
|
|
59
|
-
const
|
|
57
|
+
const T = {
|
|
60
58
|
IMPORT_LIST: "/import",
|
|
61
59
|
IMPORT_FORM: "/import/:importId"
|
|
62
60
|
};
|
|
63
|
-
function
|
|
64
|
-
return
|
|
61
|
+
function D() {
|
|
62
|
+
return T.IMPORT_LIST;
|
|
65
63
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
64
|
+
function le(e) {
|
|
65
|
+
return te(T.IMPORT_FORM)(e);
|
|
68
66
|
}
|
|
69
|
-
function
|
|
70
|
-
const
|
|
67
|
+
function pe(e) {
|
|
68
|
+
const t = new Date(e);
|
|
71
69
|
return new Intl.DateTimeFormat("ru-RU", {
|
|
72
|
-
|
|
70
|
+
year: "numeric",
|
|
73
71
|
month: "numeric",
|
|
74
72
|
day: "numeric",
|
|
75
73
|
hour: "numeric",
|
|
76
74
|
minute: "numeric",
|
|
77
75
|
second: "numeric"
|
|
78
|
-
}).format(
|
|
76
|
+
}).format(t);
|
|
79
77
|
}
|
|
80
|
-
|
|
81
|
-
var _export_sfc = (sfc, props) => {
|
|
82
|
-
const target = sfc.__vccOpts || sfc;
|
|
83
|
-
for (const [key, val] of props) {
|
|
84
|
-
target[key] = val;
|
|
85
|
-
}
|
|
86
|
-
return target;
|
|
87
|
-
};
|
|
88
|
-
const _sfc_main$2 = defineComponent({
|
|
78
|
+
const ue = R({
|
|
89
79
|
name: "CellHistory",
|
|
90
80
|
props: {
|
|
91
81
|
history: {
|
|
@@ -95,150 +85,143 @@ const _sfc_main$2 = defineComponent({
|
|
|
95
85
|
},
|
|
96
86
|
setup() {
|
|
97
87
|
return {
|
|
98
|
-
dateTimeFormat
|
|
88
|
+
dateTimeFormat: pe
|
|
99
89
|
};
|
|
100
90
|
}
|
|
101
|
-
})
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
return
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
91
|
+
}), _ = (e, t) => {
|
|
92
|
+
const a = e.__vccOpts || e;
|
|
93
|
+
for (const [i, r] of t)
|
|
94
|
+
a[i] = r;
|
|
95
|
+
return a;
|
|
96
|
+
}, ce = { key: 0 }, de = { class: "name" };
|
|
97
|
+
function ge(e, t, a, i, r, d) {
|
|
98
|
+
return e.history.length > 0 ? (c(), F("ul", ce, [
|
|
99
|
+
(c(!0), F(E, null, N(e.history, (n, m) => (c(), F("li", { key: m }, [
|
|
100
|
+
k("span", de, $(n.status), 1),
|
|
101
|
+
j(" " + $(e.dateTimeFormat(n.datetime)), 1)
|
|
102
|
+
]))), 128))
|
|
103
|
+
])) : G("", !0);
|
|
113
104
|
}
|
|
114
|
-
|
|
115
|
-
const _sfc_main$1 = defineComponent({
|
|
105
|
+
const fe = /* @__PURE__ */ _(ue, [["render", ge], ["__scopeId", "data-v-ebee5edd"]]), ye = R({
|
|
116
106
|
name: "ImportList",
|
|
117
|
-
components: { CellHistory, DataTable, Page },
|
|
107
|
+
components: { CellHistory: fe, DataTable: W, Page: U },
|
|
118
108
|
setup() {
|
|
119
|
-
const { t } =
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
pageSize: params.pageSize
|
|
109
|
+
const { t: e } = P(), {
|
|
110
|
+
fetchEntityList: t,
|
|
111
|
+
isLoading: a,
|
|
112
|
+
rowData: i,
|
|
113
|
+
errorMessage: r,
|
|
114
|
+
searchQuery: d,
|
|
115
|
+
handleChange: n,
|
|
116
|
+
pageSize: m,
|
|
117
|
+
pageCount: l,
|
|
118
|
+
pageNumber: s
|
|
119
|
+
} = X({
|
|
120
|
+
fetchEntityList: (o) => ne({
|
|
121
|
+
pageNumber: o.pageNumber,
|
|
122
|
+
pageSize: o.pageSize
|
|
134
123
|
}),
|
|
135
124
|
initialValue: [],
|
|
136
125
|
resourceName: "Import list",
|
|
137
126
|
pageSize: 100
|
|
138
127
|
});
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
handleChange,
|
|
205
|
-
pageSize,
|
|
206
|
-
pageCount,
|
|
207
|
-
pageNumber
|
|
128
|
+
return L(() => {
|
|
129
|
+
t();
|
|
130
|
+
}), {
|
|
131
|
+
columnDefs: [
|
|
132
|
+
{
|
|
133
|
+
id: 1,
|
|
134
|
+
name: "ID",
|
|
135
|
+
field: "id",
|
|
136
|
+
style: { width: "50px", textAlign: "center" },
|
|
137
|
+
headStyle: { width: "50px", textAlign: "center" }
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: 2,
|
|
141
|
+
name: e("import:type"),
|
|
142
|
+
field: "strategy",
|
|
143
|
+
style: { width: "150px" },
|
|
144
|
+
headStyle: { width: "150px" }
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: 3,
|
|
148
|
+
name: e("import:params"),
|
|
149
|
+
field: "params",
|
|
150
|
+
type: "key-value",
|
|
151
|
+
format: ({ row: o }) => o.params ? o.params.map((y) => ({
|
|
152
|
+
key: y.label,
|
|
153
|
+
value: y.value
|
|
154
|
+
})) : null
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: 4,
|
|
158
|
+
name: e("import:status"),
|
|
159
|
+
field: "status",
|
|
160
|
+
style: { width: "120px" },
|
|
161
|
+
headStyle: { width: "120px" }
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: 5,
|
|
165
|
+
name: e("import:message"),
|
|
166
|
+
field: "message"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: 6,
|
|
170
|
+
name: e("import:log"),
|
|
171
|
+
field: "history",
|
|
172
|
+
style: { width: "270px", whiteSpace: "nowrap" },
|
|
173
|
+
headStyle: { width: "270px" }
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
id: 7,
|
|
177
|
+
name: e("import:file"),
|
|
178
|
+
field: "file",
|
|
179
|
+
type: "file",
|
|
180
|
+
style: { width: "150px", textAlign: "center" },
|
|
181
|
+
headStyle: { width: "150px", textAlign: "center" }
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
getImportFormUrl: le,
|
|
185
|
+
rowData: i,
|
|
186
|
+
isRowDataLoading: a,
|
|
187
|
+
errorMessage: r,
|
|
188
|
+
searchQuery: d,
|
|
189
|
+
handleChange: n,
|
|
190
|
+
pageSize: m,
|
|
191
|
+
pageCount: l,
|
|
192
|
+
pageNumber: s
|
|
208
193
|
};
|
|
209
194
|
}
|
|
210
195
|
});
|
|
211
|
-
function
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
return openBlock(), createBlock(_component_Page, {
|
|
216
|
-
title: _ctx.$i18n.t("import:import"),
|
|
196
|
+
function he(e, t, a, i, r, d) {
|
|
197
|
+
const n = u("CellHistory"), m = u("DataTable"), l = u("Page");
|
|
198
|
+
return c(), w(l, {
|
|
199
|
+
title: e.$i18n.t("import:import"),
|
|
217
200
|
"header-buttons": [
|
|
218
201
|
{
|
|
219
|
-
text:
|
|
220
|
-
href:
|
|
202
|
+
text: e.$i18n.t("import:newImport"),
|
|
203
|
+
href: e.getImportFormUrl({ importId: "create" })
|
|
221
204
|
}
|
|
222
205
|
]
|
|
223
206
|
}, {
|
|
224
|
-
default:
|
|
225
|
-
|
|
226
|
-
"column-defs":
|
|
227
|
-
"row-data":
|
|
228
|
-
loading:
|
|
229
|
-
"error-message":
|
|
207
|
+
default: v(() => [
|
|
208
|
+
h(m, {
|
|
209
|
+
"column-defs": e.columnDefs,
|
|
210
|
+
"row-data": e.rowData,
|
|
211
|
+
loading: e.isRowDataLoading,
|
|
212
|
+
"error-message": e.errorMessage,
|
|
230
213
|
pagination: {
|
|
231
|
-
pageSize:
|
|
232
|
-
pageCount:
|
|
233
|
-
pageNumber:
|
|
234
|
-
disabled:
|
|
214
|
+
pageSize: e.pageSize,
|
|
215
|
+
pageCount: e.pageCount,
|
|
216
|
+
pageNumber: e.pageNumber,
|
|
217
|
+
disabled: e.isRowDataLoading
|
|
235
218
|
},
|
|
236
|
-
"use-search":
|
|
237
|
-
onChange:
|
|
219
|
+
"use-search": !1,
|
|
220
|
+
onChange: e.handleChange
|
|
238
221
|
}, {
|
|
239
|
-
"cell(history)":
|
|
240
|
-
|
|
241
|
-
history:
|
|
222
|
+
"cell(history)": v(({ row: s }) => [
|
|
223
|
+
h(n, {
|
|
224
|
+
history: s.history
|
|
242
225
|
}, null, 8, ["history"])
|
|
243
226
|
]),
|
|
244
227
|
_: 1
|
|
@@ -247,193 +230,176 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
247
230
|
_: 1
|
|
248
231
|
}, 8, ["title", "header-buttons"]);
|
|
249
232
|
}
|
|
250
|
-
|
|
251
|
-
function
|
|
252
|
-
var
|
|
233
|
+
const Ie = /* @__PURE__ */ _(ye, [["render", he]]);
|
|
234
|
+
function Fe(e, t) {
|
|
235
|
+
var a, i;
|
|
253
236
|
return {
|
|
254
|
-
strategy: (
|
|
255
|
-
file: (
|
|
256
|
-
params:
|
|
257
|
-
name:
|
|
258
|
-
value:
|
|
237
|
+
strategy: ((a = e.strategy) == null ? void 0 : a.value) ?? "",
|
|
238
|
+
file: ((i = e.file) == null ? void 0 : i.file.id) ?? "",
|
|
239
|
+
params: t.map((r) => ({
|
|
240
|
+
name: r.config.name,
|
|
241
|
+
value: V.getOutgoingValue(r)
|
|
259
242
|
}))
|
|
260
243
|
};
|
|
261
244
|
}
|
|
262
|
-
function
|
|
263
|
-
return
|
|
264
|
-
value:
|
|
265
|
-
label:
|
|
245
|
+
function ve(e) {
|
|
246
|
+
return e.map((t) => ({
|
|
247
|
+
value: t.id,
|
|
248
|
+
label: t.name
|
|
266
249
|
}));
|
|
267
250
|
}
|
|
268
|
-
const
|
|
251
|
+
const Te = R({
|
|
269
252
|
name: "ImportForm",
|
|
270
|
-
components: { Page, FormFieldFileInput, DynamicField, FormFooter, FormFieldSelect },
|
|
253
|
+
components: { Page: U, FormFieldFileInput: x, DynamicField: ee, FormFooter: Z, FormFieldSelect: Y },
|
|
271
254
|
setup() {
|
|
272
|
-
const { t } =
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
{ data: moduleInfo, loading: isModuleInfoLoading }
|
|
278
|
-
] = useResource({
|
|
279
|
-
fetchResource: getModuleInfo,
|
|
255
|
+
const { t: e } = P(), t = B(), a = oe(), [
|
|
256
|
+
i,
|
|
257
|
+
{ data: r, loading: d }
|
|
258
|
+
] = H({
|
|
259
|
+
fetchResource: se,
|
|
280
260
|
initialValue: {
|
|
281
261
|
fileScenario: "",
|
|
282
262
|
strategies: []
|
|
283
263
|
},
|
|
284
264
|
resourceName: "Module info"
|
|
285
|
-
})
|
|
286
|
-
|
|
287
|
-
|
|
265
|
+
}), n = S(
|
|
266
|
+
() => r.value.fileScenario
|
|
267
|
+
), m = S(
|
|
268
|
+
() => ve(r.value.strategies)
|
|
288
269
|
);
|
|
289
|
-
|
|
290
|
-
()
|
|
291
|
-
);
|
|
292
|
-
onMounted(() => {
|
|
293
|
-
fetchModuleInfo();
|
|
270
|
+
L(() => {
|
|
271
|
+
i();
|
|
294
272
|
});
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
const selectedStrategy = moduleInfo.value.strategies.find(
|
|
302
|
-
(strategy) => {
|
|
303
|
-
var _a2;
|
|
304
|
-
return strategy.id === ((_a2 = values.value.strategy) == null ? void 0 : _a2.value);
|
|
273
|
+
const l = I({}), s = I({ strategy: null, file: null }), g = I(!1), o = I([]);
|
|
274
|
+
function y() {
|
|
275
|
+
const p = r.value.strategies.find(
|
|
276
|
+
(f) => {
|
|
277
|
+
var C;
|
|
278
|
+
return f.id === ((C = s.value.strategy) == null ? void 0 : C.value);
|
|
305
279
|
}
|
|
306
|
-
);
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
(fieldConfig) => universalFieldUtils.createFormField(fieldConfig, null)
|
|
280
|
+
), b = (p == null ? void 0 : p.fields) ?? [];
|
|
281
|
+
o.value = b.map(
|
|
282
|
+
(f) => V.createFormField(f, null)
|
|
310
283
|
);
|
|
311
284
|
}
|
|
312
|
-
|
|
313
|
-
() =>
|
|
285
|
+
J(
|
|
286
|
+
() => s.value.strategy,
|
|
314
287
|
() => {
|
|
315
|
-
|
|
288
|
+
y();
|
|
316
289
|
}
|
|
317
|
-
)
|
|
318
|
-
|
|
319
|
-
updateTemplateValues();
|
|
290
|
+
), L(() => {
|
|
291
|
+
y();
|
|
320
292
|
});
|
|
321
|
-
function
|
|
322
|
-
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
|
|
293
|
+
function z(p) {
|
|
294
|
+
g.value = !0;
|
|
295
|
+
const b = Fe(
|
|
296
|
+
s.value,
|
|
297
|
+
o.value
|
|
326
298
|
);
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
if (event.type === "create" || event.type === "save" || event.type === "create_exit" || event.type === "save_exit") {
|
|
330
|
-
navigateBack(router, getImportListUrl());
|
|
331
|
-
}
|
|
332
|
-
toast.show({
|
|
299
|
+
me(b).then(() => {
|
|
300
|
+
l.value = {}, (p.type === "create" || p.type === "save" || p.type === "create_exit" || p.type === "save_exit") && q(a, D()), t.show({
|
|
333
301
|
variant: "success",
|
|
334
|
-
title:
|
|
335
|
-
body:
|
|
302
|
+
title: e("import:success"),
|
|
303
|
+
body: e("import:createdSuccessMessage")
|
|
336
304
|
});
|
|
337
|
-
}).catch((
|
|
338
|
-
console.error(
|
|
339
|
-
errors.value = convertRequestErrorToMap(error);
|
|
340
|
-
toast.show({
|
|
305
|
+
}).catch((f) => {
|
|
306
|
+
console.error(f), l.value = Q(f), t.show({
|
|
341
307
|
variant: "danger",
|
|
342
|
-
title:
|
|
343
|
-
body:
|
|
308
|
+
title: e("import:error"),
|
|
309
|
+
body: e("import:createdErrorMessage")
|
|
344
310
|
});
|
|
345
311
|
}).finally(() => {
|
|
346
|
-
|
|
312
|
+
g.value = !1;
|
|
347
313
|
});
|
|
348
314
|
}
|
|
349
|
-
const
|
|
315
|
+
const A = S(() => d.value);
|
|
350
316
|
return {
|
|
351
|
-
values,
|
|
352
|
-
errors,
|
|
353
|
-
isSubmitting,
|
|
354
|
-
submitForm,
|
|
355
|
-
getImportListUrl,
|
|
356
|
-
strategyOptionList,
|
|
357
|
-
strategyFileScenario,
|
|
358
|
-
isContentLoading,
|
|
359
|
-
templateValues
|
|
317
|
+
values: s,
|
|
318
|
+
errors: l,
|
|
319
|
+
isSubmitting: g,
|
|
320
|
+
submitForm: z,
|
|
321
|
+
getImportListUrl: D,
|
|
322
|
+
strategyOptionList: m,
|
|
323
|
+
strategyFileScenario: n,
|
|
324
|
+
isContentLoading: A,
|
|
325
|
+
templateValues: o
|
|
360
326
|
};
|
|
361
327
|
}
|
|
362
328
|
});
|
|
363
|
-
function
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
const _component_Page = resolveComponent("Page");
|
|
369
|
-
return openBlock(), createBlock(_component_Page, {
|
|
370
|
-
title: _ctx.$i18n.t("import:importCreation"),
|
|
371
|
-
"is-content-loading": _ctx.isContentLoading
|
|
329
|
+
function be(e, t, a, i, r, d) {
|
|
330
|
+
const n = u("FormFieldSelect"), m = u("FormFieldFileInput"), l = u("DynamicField"), s = u("FormFooter"), g = u("Page");
|
|
331
|
+
return c(), w(g, {
|
|
332
|
+
title: e.$i18n.t("import:importCreation"),
|
|
333
|
+
"is-content-loading": e.isContentLoading
|
|
372
334
|
}, {
|
|
373
|
-
footer:
|
|
374
|
-
|
|
375
|
-
"back-href":
|
|
376
|
-
|
|
377
|
-
"is-
|
|
378
|
-
|
|
379
|
-
}, null, 8, ["back-href", "
|
|
335
|
+
footer: v(() => [
|
|
336
|
+
h(s, {
|
|
337
|
+
"back-href": e.getImportListUrl(),
|
|
338
|
+
"is-submitting": e.isSubmitting,
|
|
339
|
+
"is-creation": !0,
|
|
340
|
+
onSubmit: e.submitForm
|
|
341
|
+
}, null, 8, ["back-href", "is-submitting", "onSubmit"])
|
|
380
342
|
]),
|
|
381
|
-
default:
|
|
382
|
-
|
|
343
|
+
default: v(() => [
|
|
344
|
+
k("form", {
|
|
383
345
|
novalidate: "",
|
|
384
|
-
onSubmit:
|
|
346
|
+
onSubmit: t[2] || (t[2] = K(() => {
|
|
385
347
|
}, ["prevent"]))
|
|
386
348
|
}, [
|
|
387
|
-
|
|
388
|
-
value:
|
|
389
|
-
"onUpdate:value":
|
|
390
|
-
options:
|
|
391
|
-
error:
|
|
349
|
+
h(n, {
|
|
350
|
+
value: e.values.strategy,
|
|
351
|
+
"onUpdate:value": t[0] || (t[0] = (o) => e.values.strategy = o),
|
|
352
|
+
options: e.strategyOptionList,
|
|
353
|
+
error: e.errors.strategy,
|
|
392
354
|
name: "importType",
|
|
393
|
-
label:
|
|
355
|
+
label: e.$i18n.t("import:importType")
|
|
394
356
|
}, null, 8, ["value", "options", "error", "label"]),
|
|
395
|
-
|
|
396
|
-
value:
|
|
397
|
-
"onUpdate:value":
|
|
398
|
-
error:
|
|
399
|
-
label:
|
|
357
|
+
h(m, {
|
|
358
|
+
value: e.values.file,
|
|
359
|
+
"onUpdate:value": t[1] || (t[1] = (o) => e.values.file = o),
|
|
360
|
+
error: e.errors.file,
|
|
361
|
+
label: e.$i18n.t("import:file"),
|
|
400
362
|
name: "file",
|
|
401
|
-
scenario:
|
|
363
|
+
scenario: e.strategyFileScenario
|
|
402
364
|
}, null, 8, ["value", "error", "label", "scenario"]),
|
|
403
|
-
(
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}, null, 8, ["field"]);
|
|
408
|
-
}), 128))
|
|
365
|
+
(c(!0), F(E, null, N(e.templateValues, (o) => (c(), w(l, {
|
|
366
|
+
key: o.config.name,
|
|
367
|
+
field: o
|
|
368
|
+
}, null, 8, ["field"]))), 128))
|
|
409
369
|
], 32)
|
|
410
370
|
]),
|
|
411
371
|
_: 1
|
|
412
372
|
}, 8, ["title", "is-content-loading"]);
|
|
413
373
|
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
component: ImportList,
|
|
374
|
+
const Se = /* @__PURE__ */ _(Te, [["render", be]]), Le = {
|
|
375
|
+
path: T.IMPORT_LIST,
|
|
376
|
+
component: Ie,
|
|
418
377
|
name: "Import List",
|
|
419
378
|
meta: {
|
|
420
|
-
getBreadcrumbs: (
|
|
421
|
-
{ url: "/", text:
|
|
422
|
-
{ url:
|
|
379
|
+
getBreadcrumbs: (e, t) => [
|
|
380
|
+
{ url: "/", text: t.t("import:home") },
|
|
381
|
+
{ url: e.path, text: t.t("import:importList") }
|
|
423
382
|
]
|
|
424
383
|
}
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
component: ImportForm,
|
|
384
|
+
}, De = {
|
|
385
|
+
path: T.IMPORT_FORM,
|
|
386
|
+
component: Se,
|
|
429
387
|
name: "Import Form",
|
|
430
388
|
meta: {
|
|
431
|
-
getBreadcrumbs: (
|
|
432
|
-
{ url: "/", text:
|
|
433
|
-
{ url:
|
|
434
|
-
{ url:
|
|
389
|
+
getBreadcrumbs: (e, t) => [
|
|
390
|
+
{ url: "/", text: t.t("import:home") },
|
|
391
|
+
{ url: Le.path, text: t.t("import:importList") },
|
|
392
|
+
{ url: e.path, text: t.t("import:importForm") }
|
|
435
393
|
]
|
|
436
394
|
}
|
|
437
395
|
};
|
|
438
|
-
|
|
439
|
-
export {
|
|
396
|
+
ie();
|
|
397
|
+
export {
|
|
398
|
+
De as IMPORT_FORM_ROUTE,
|
|
399
|
+
Le as IMPORT_LIST_ROUTE,
|
|
400
|
+
me as createImport,
|
|
401
|
+
le as getImportFormUrl,
|
|
402
|
+
ne as getImportList,
|
|
403
|
+
D as getImportListUrl,
|
|
404
|
+
se as getModuleInfo
|
|
405
|
+
};
|