@ibiz-template/vue3-components 0.7.2 → 0.7.4
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/index-36xAWDJE.js +4 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-vcRxGFII.js → xlsx-util-UXWgtlzc.js} +1 -1
- package/es/common/data-import2/data-import2.d.ts +0 -1
- package/es/common/data-import2/data-import2.mjs +26 -67
- package/es/common/data-import2-select/data-import2-select.mjs +5 -3
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.d.ts +1 -0
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.mjs +4 -2
- package/es/control/grid/grid-column/grid-field-column/index.d.ts +1 -0
- package/es/control/search-bar/filter-tree/filter-tree.mjs +6 -1
- package/es/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.mjs +1 -1
- package/es/editor/data-picker/ibiz-mpicker/ibiz-mpicker.mjs +1 -1
- package/es/editor/data-picker/ibiz-picker/ibiz-picker.mjs +1 -1
- package/es/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.mjs +1 -1
- package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +1 -1
- package/es/editor/text-box/input/input.mjs +4 -1
- package/es/panel-component/user-action/user-action.mjs +6 -0
- package/es/util/modal-util/modal-util.mjs +16 -4
- package/es/web-app/router/index.mjs +44 -2
- package/lib/common/data-import2/data-import2.cjs +24 -66
- package/lib/common/data-import2-select/data-import2-select.cjs +5 -3
- package/lib/control/grid/grid-column/grid-field-column/grid-field-column.cjs +3 -1
- package/lib/control/search-bar/filter-tree/filter-tree.cjs +6 -1
- package/lib/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.cjs +1 -1
- package/lib/editor/data-picker/ibiz-mpicker/ibiz-mpicker.cjs +1 -1
- package/lib/editor/data-picker/ibiz-picker/ibiz-picker.cjs +1 -1
- package/lib/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.cjs +1 -1
- package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +1 -1
- package/lib/editor/text-box/input/input.cjs +4 -1
- package/lib/panel-component/user-action/user-action.cjs +6 -0
- package/lib/util/modal-util/modal-util.cjs +16 -4
- package/lib/web-app/router/index.cjs +44 -2
- package/package.json +5 -5
- package/dist/index-8RikZoLN.js +0 -4
|
@@ -32,7 +32,6 @@ type columnMappingListMapValueType = {
|
|
|
32
32
|
update_date: string;
|
|
33
33
|
update_man: string;
|
|
34
34
|
};
|
|
35
|
-
export declare function importMapping(method: string, id?: string, data?: IData): Promise<IData>;
|
|
36
35
|
export declare const DataImport2: import("vue").DefineComponent<{
|
|
37
36
|
dismiss: {
|
|
38
37
|
type: PropType<() => void>;
|
|
@@ -5,23 +5,12 @@ import { getCookie } from 'qx-util';
|
|
|
5
5
|
import { CoreConst } from '@ibiz-template/core';
|
|
6
6
|
import { clone } from 'ramda';
|
|
7
7
|
import './data-import2.css';
|
|
8
|
-
import {
|
|
8
|
+
import { getDefaultDataImport, getImportSchema, updateImportSchema, createImportSchema, asyncImportData2, fetchImportSchemas } from '@ibiz-template/runtime';
|
|
9
9
|
|
|
10
10
|
"use strict";
|
|
11
11
|
function _isSlot(s) {
|
|
12
12
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
13
13
|
}
|
|
14
|
-
async function importMapping(method, id, data) {
|
|
15
|
-
let url = "extension/import_schemas";
|
|
16
|
-
if (id) {
|
|
17
|
-
url = "".concat(url, "/").concat(id);
|
|
18
|
-
}
|
|
19
|
-
const res = await ibiz.net.request(url, {
|
|
20
|
-
method,
|
|
21
|
-
data
|
|
22
|
-
});
|
|
23
|
-
return res;
|
|
24
|
-
}
|
|
25
14
|
const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
26
15
|
name: "DataImport2",
|
|
27
16
|
props: {
|
|
@@ -65,6 +54,7 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
65
54
|
const columnMappingListMap = /* @__PURE__ */ new Map();
|
|
66
55
|
const options = ref([]);
|
|
67
56
|
const isNoPersonel = ref(false);
|
|
57
|
+
const dataImport = props.dataImport || getDefaultDataImport(props.appDataEntity);
|
|
68
58
|
const clearSelect = () => {
|
|
69
59
|
const keys = [...columnMap.keys()];
|
|
70
60
|
keys.forEach((item) => {
|
|
@@ -85,7 +75,7 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
85
75
|
}
|
|
86
76
|
let columnMapData = columnData.fields;
|
|
87
77
|
if (!columnData.fields) {
|
|
88
|
-
const res = await
|
|
78
|
+
const res = await getImportSchema(columnData.id);
|
|
89
79
|
if (res.status === 200 && res.data) {
|
|
90
80
|
columnMapData = res.data.fields;
|
|
91
81
|
}
|
|
@@ -127,7 +117,6 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
127
117
|
watchValue(newValue);
|
|
128
118
|
});
|
|
129
119
|
const onButtonColumnMappingImportClick = async () => {
|
|
130
|
-
var _a;
|
|
131
120
|
const string = selectValues.value.join("");
|
|
132
121
|
if (string === "") {
|
|
133
122
|
ibiz.message.warning(ibiz.i18n.t("component.dataImport2.atLastOne"));
|
|
@@ -138,32 +127,25 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
138
127
|
const columnMapArr = [...columnMap.values()];
|
|
139
128
|
const fields = columnMapArr.filter((columnitem) => columnitem.name !== "");
|
|
140
129
|
const data = {
|
|
141
|
-
// schame_tag: '', // 导入模式标记 不传
|
|
142
|
-
// id: '', // 导入模式标识 也不用传
|
|
143
130
|
name: "".concat(fileName.value.split(".")[0], "|").concat((/* @__PURE__ */ new Date()).toLocaleString()),
|
|
144
131
|
// 导入模式名称 按照导入的名称|时间来生成
|
|
145
|
-
|
|
146
|
-
fields,
|
|
132
|
+
fields
|
|
147
133
|
// 导入模式属性 {name:'',order_value:1}
|
|
148
|
-
// type: '', // 导入模式类型 暂时不用传
|
|
149
|
-
system_tag: (_a = ibiz.appData) == null ? void 0 : _a.context.srfsystemid,
|
|
150
|
-
// 系统标记
|
|
151
|
-
data_entity_tag: props.appDataEntity.codeName,
|
|
152
|
-
// 数据实体标记
|
|
153
|
-
import_tag: props.appDataEntity.defaultAppDEDataImportId,
|
|
154
|
-
// 导入标记 导入模型的代码名称
|
|
155
|
-
owner_type: "PERSONAL"
|
|
156
|
-
// 所有者类型
|
|
157
134
|
};
|
|
158
135
|
if (props.params) {
|
|
159
136
|
Object.assign(data, props.params);
|
|
160
137
|
}
|
|
161
138
|
if (listValue.value) {
|
|
162
139
|
const columnData = columnMappingListMap.get(listValue.value);
|
|
163
|
-
if (columnData
|
|
140
|
+
if (columnData) {
|
|
164
141
|
data.name = columnData.name;
|
|
142
|
+
data.id = columnData.id;
|
|
165
143
|
}
|
|
166
|
-
const resput = await
|
|
144
|
+
const resput = await updateImportSchema({
|
|
145
|
+
appDataEntity: props.appDataEntity,
|
|
146
|
+
dataImport,
|
|
147
|
+
data
|
|
148
|
+
});
|
|
167
149
|
if (resput.status === 200 && resput.ok) {
|
|
168
150
|
columnMappingListMap.set(listValue.value, resput.data);
|
|
169
151
|
}
|
|
@@ -176,7 +158,11 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
176
158
|
checkmark: false,
|
|
177
159
|
close: false
|
|
178
160
|
});
|
|
179
|
-
const res = await
|
|
161
|
+
const res = await createImportSchema({
|
|
162
|
+
appDataEntity: props.appDataEntity,
|
|
163
|
+
dataImport,
|
|
164
|
+
data
|
|
165
|
+
});
|
|
180
166
|
if (res.status === 200 && res.ok) {
|
|
181
167
|
columnMappingListMap.set(data.name, res.data);
|
|
182
168
|
}
|
|
@@ -194,33 +180,11 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
194
180
|
if (data) {
|
|
195
181
|
id = data.id;
|
|
196
182
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
let url = "".concat(path, "/asyncimportdata2");
|
|
204
|
-
const queryData = {
|
|
205
|
-
srfossfileid: fileid,
|
|
206
|
-
srfimportschemaid: id
|
|
207
|
-
};
|
|
208
|
-
if (srfimporttag) {
|
|
209
|
-
Object.assign(queryData, {
|
|
210
|
-
srfimporttag
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
if (props.params) {
|
|
214
|
-
Object.assign(queryData, props.params);
|
|
215
|
-
}
|
|
216
|
-
url += qs.stringify(queryData, {
|
|
217
|
-
addQueryPrefix: true
|
|
218
|
-
});
|
|
219
|
-
await ibiz.net.request(url, {
|
|
220
|
-
method: "get"
|
|
221
|
-
});
|
|
222
|
-
ibiz.notification.info({
|
|
223
|
-
desc: ibiz.i18n.t("component.dataImport.startImport")
|
|
183
|
+
await asyncImportData2({
|
|
184
|
+
appDataEntity: props.appDataEntity,
|
|
185
|
+
dataImport,
|
|
186
|
+
fileId: fileid,
|
|
187
|
+
schemaId: id
|
|
224
188
|
});
|
|
225
189
|
onCancelButtonClick();
|
|
226
190
|
} else {
|
|
@@ -242,13 +206,10 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
242
206
|
}
|
|
243
207
|
};
|
|
244
208
|
const columnMappingListQuery = async () => {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
n_data_entity_tag_eq: props.appDataEntity.codeName
|
|
250
|
-
};
|
|
251
|
-
const res = await importMapping("post", "fetch_cur_user", params);
|
|
209
|
+
const res = await fetchImportSchemas({
|
|
210
|
+
appDataEntity: props.appDataEntity,
|
|
211
|
+
dataImport
|
|
212
|
+
});
|
|
252
213
|
if (res.status === 200 && res.data) {
|
|
253
214
|
res.data.forEach((item) => {
|
|
254
215
|
options.value.push({
|
|
@@ -264,8 +225,6 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
264
225
|
}
|
|
265
226
|
};
|
|
266
227
|
onMounted(() => {
|
|
267
|
-
var _a;
|
|
268
|
-
const dataImport = (_a = props.appDataEntity.appDEDataImports) == null ? void 0 : _a.find((importItem) => importItem.id === props.appDataEntity.defaultAppDEDataImportId);
|
|
269
228
|
if (dataImport && dataImport.dedataImportItems) {
|
|
270
229
|
dataOption.value = dataImport.dedataImportItems;
|
|
271
230
|
} else if (props.appDataEntity.appDEFields) {
|
|
@@ -470,4 +429,4 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
470
429
|
}
|
|
471
430
|
});
|
|
472
431
|
|
|
473
|
-
export { DataImport2
|
|
432
|
+
export { DataImport2 };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isVNode, resolveComponent, createVNode, defineComponent } from 'vue';
|
|
2
2
|
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
3
|
-
import { importMapping } from '../data-import2/data-import2.mjs';
|
|
4
3
|
import './data-import2-select.css';
|
|
4
|
+
import { updateImportSchema, deleteImportSchema } from '@ibiz-template/runtime';
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
function _isSlot(s) {
|
|
@@ -54,7 +54,9 @@ const DataImport2Select = /* @__PURE__ */ defineComponent({
|
|
|
54
54
|
const data = props.columnMappingListMap.get(item.oldLabel);
|
|
55
55
|
if (data) {
|
|
56
56
|
data.name = item.label;
|
|
57
|
-
const result = await
|
|
57
|
+
const result = await updateImportSchema({
|
|
58
|
+
data
|
|
59
|
+
});
|
|
58
60
|
if (result.status === 200 && result.ok) {
|
|
59
61
|
emit("columnMappingListMapChange", item.label, result.data);
|
|
60
62
|
}
|
|
@@ -79,7 +81,7 @@ const DataImport2Select = /* @__PURE__ */ defineComponent({
|
|
|
79
81
|
e.stopPropagation();
|
|
80
82
|
const columnData = props.columnMappingListMap.get(str);
|
|
81
83
|
if (columnData) {
|
|
82
|
-
const res = await
|
|
84
|
+
const res = await deleteImportSchema(columnData.id);
|
|
83
85
|
if (res.status === 200 && res.ok) {
|
|
84
86
|
emit("optionsChange", str);
|
|
85
87
|
emit("columnMappingListMapChange", str);
|
|
@@ -19,6 +19,7 @@ export declare const GridFieldColumn: import("vue").DefineComponent<{
|
|
|
19
19
|
CustomHtml: import("vue").ComputedRef<string | undefined>;
|
|
20
20
|
fieldValue: import("vue").ComputedRef<any>;
|
|
21
21
|
formatValue: import("vue").ComputedRef<string>;
|
|
22
|
+
codeListValue: import("vue").ComputedRef<string>;
|
|
22
23
|
tooltip: import("vue").ComputedRef<string | undefined>;
|
|
23
24
|
zIndex: number | undefined;
|
|
24
25
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed, ref, resolveComponent, createVNode, defineComponent } from 'vue';
|
|
2
2
|
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
3
3
|
import './grid-field-column.css';
|
|
4
|
-
import { GridFieldColumnController, GridRowState } from '@ibiz-template/runtime';
|
|
4
|
+
import { GridFieldColumnController, GridRowState, ValueExUtil } from '@ibiz-template/runtime';
|
|
5
5
|
import { isNotNil } from 'ramda';
|
|
6
6
|
|
|
7
7
|
"use strict";
|
|
@@ -37,6 +37,7 @@ const GridFieldColumn = /* @__PURE__ */ defineComponent({
|
|
|
37
37
|
});
|
|
38
38
|
const fieldValue = computed(() => props.row.data[props.controller.fieldName]);
|
|
39
39
|
const formatValue = computed(() => props.controller.formatValue(fieldValue.value));
|
|
40
|
+
const codeListValue = computed(() => ValueExUtil.toText(props.controller.model, fieldValue.value));
|
|
40
41
|
const codeListText = ref("");
|
|
41
42
|
const onInfoTextChange = (text) => {
|
|
42
43
|
codeListText.value = text;
|
|
@@ -59,6 +60,7 @@ const GridFieldColumn = /* @__PURE__ */ defineComponent({
|
|
|
59
60
|
CustomHtml,
|
|
60
61
|
fieldValue,
|
|
61
62
|
formatValue,
|
|
63
|
+
codeListValue,
|
|
62
64
|
tooltip,
|
|
63
65
|
zIndex
|
|
64
66
|
};
|
|
@@ -85,7 +87,7 @@ const GridFieldColumn = /* @__PURE__ */ defineComponent({
|
|
|
85
87
|
"class": this.ns.e("text"),
|
|
86
88
|
"codeListItems": c.codeListItems,
|
|
87
89
|
"codeList": c.codeList,
|
|
88
|
-
"value": this.
|
|
90
|
+
"value": this.codeListValue,
|
|
89
91
|
"onClick": this.onTextClick,
|
|
90
92
|
"onInfoTextChange": this.onInfoTextChange,
|
|
91
93
|
"title": this.tooltip
|
|
@@ -16,6 +16,7 @@ export declare const IBizGridFieldColumn: import("@ibiz-template/vue3-util").Typ
|
|
|
16
16
|
CustomHtml: import("vue").ComputedRef<string | undefined>;
|
|
17
17
|
fieldValue: import("vue").ComputedRef<any>;
|
|
18
18
|
formatValue: import("vue").ComputedRef<string>;
|
|
19
|
+
codeListValue: import("vue").ComputedRef<string>;
|
|
19
20
|
tooltip: import("vue").ComputedRef<string | undefined>;
|
|
20
21
|
zIndex: number | undefined;
|
|
21
22
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -378,7 +378,12 @@ const FilterTreeControl = /* @__PURE__ */ defineComponent({
|
|
|
378
378
|
}, null);
|
|
379
379
|
})) ? _slot2 : {
|
|
380
380
|
default: () => [_slot2]
|
|
381
|
-
}),
|
|
381
|
+
}), createVNode(resolveComponent("iBizFilterModeSelect"), {
|
|
382
|
+
"disabled": true,
|
|
383
|
+
"class": ns.e("mode-select"),
|
|
384
|
+
"value": child.valueOP,
|
|
385
|
+
"modes": [child.valueOP]
|
|
386
|
+
}, null), renderEditor(child, itemsC)];
|
|
382
387
|
}
|
|
383
388
|
return createVNode("div", {
|
|
384
389
|
"class": (ns.b("group"), ns.bm("group", "items"))
|
|
@@ -155,7 +155,7 @@ const IBizAutoComplete = /* @__PURE__ */ defineComponent({
|
|
|
155
155
|
};
|
|
156
156
|
},
|
|
157
157
|
render() {
|
|
158
|
-
const overflowMode = ibiz.config.pickerEditor.overflowMode;
|
|
158
|
+
const overflowMode = this.c.editorParams.overflowMode || ibiz.config.pickerEditor.overflowMode;
|
|
159
159
|
const isEllipsis = overflowMode === "ellipsis";
|
|
160
160
|
const editContent = createVNode(resolveComponent("el-autocomplete"), mergeProps({
|
|
161
161
|
"class": this.ns.b("input"),
|
|
@@ -279,7 +279,7 @@ const IBizMPicker = /* @__PURE__ */ defineComponent({
|
|
|
279
279
|
},
|
|
280
280
|
render() {
|
|
281
281
|
let _slot;
|
|
282
|
-
const overflowMode = ibiz.config.pickerEditor.overflowMode;
|
|
282
|
+
const overflowMode = this.c.editorParams.overflowMode || ibiz.config.pickerEditor.overflowMode;
|
|
283
283
|
const isEllipsis = overflowMode === "ellipsis";
|
|
284
284
|
const editContent = [!this.readonly && createVNode(resolveComponent("el-select"), mergeProps({
|
|
285
285
|
"ref": "editorRef",
|
|
@@ -196,7 +196,7 @@ const IBizPicker = /* @__PURE__ */ defineComponent({
|
|
|
196
196
|
};
|
|
197
197
|
},
|
|
198
198
|
render() {
|
|
199
|
-
const overflowMode = ibiz.config.pickerEditor.overflowMode;
|
|
199
|
+
const overflowMode = this.c.editorParams.overflowMode || ibiz.config.pickerEditor.overflowMode;
|
|
200
200
|
const isEllipsis = overflowMode === "ellipsis";
|
|
201
201
|
const itemContent = (item) => {
|
|
202
202
|
var _a;
|
|
@@ -211,7 +211,7 @@ const IBizPickerDropDown = /* @__PURE__ */ defineComponent({
|
|
|
211
211
|
},
|
|
212
212
|
render() {
|
|
213
213
|
let _slot;
|
|
214
|
-
const overflowMode = ibiz.config.pickerEditor.overflowMode;
|
|
214
|
+
const overflowMode = this.c.editorParams.overflowMode || ibiz.config.pickerEditor.overflowMode;
|
|
215
215
|
const isEllipsis = overflowMode === "ellipsis";
|
|
216
216
|
const editContent = this.readonly ? this.value : createVNode(resolveComponent("el-select"), mergeProps({
|
|
217
217
|
"ref": "editorRef",
|
|
@@ -233,7 +233,7 @@ const IBizDropdown = /* @__PURE__ */ defineComponent({
|
|
|
233
233
|
},
|
|
234
234
|
render() {
|
|
235
235
|
let _slot;
|
|
236
|
-
const overflowMode = ibiz.config.pickerEditor.overflowMode;
|
|
236
|
+
const overflowMode = this.c.editorParams.overflowMode || ibiz.config.pickerEditor.overflowMode;
|
|
237
237
|
const isEllipsis = overflowMode === "ellipsis";
|
|
238
238
|
const editContent = this.hasChildren ? createVNode(resolveComponent("el-tree-select"), mergeProps({
|
|
239
239
|
"ref": "editorRef",
|
|
@@ -283,7 +283,10 @@ const IBizInput = /* @__PURE__ */ defineComponent({
|
|
|
283
283
|
width: editorWidth ? "".concat(editorWidth, "px") : "",
|
|
284
284
|
height: editorHeight ? "".concat(editorHeight, "px") : ""
|
|
285
285
|
}
|
|
286
|
-
}, [this.showFormDefaultContent && formDefaultContent,
|
|
286
|
+
}, [this.showFormDefaultContent && formDefaultContent, this.type === "password" && this.shouldAutoComplete === "new-password" ? createVNode("input", {
|
|
287
|
+
"type": "text",
|
|
288
|
+
"style": "opacity: 0;position:absolute;width:0;height:0;"
|
|
289
|
+
}, null) : null, content, this.c.chatCompletion ? createVNode("div", {
|
|
287
290
|
"class": this.ns.e("ai-chat"),
|
|
288
291
|
"onClick": this.onClick
|
|
289
292
|
}, [createVNode("ion-icon", {
|
|
@@ -45,6 +45,12 @@ const UserAction = /* @__PURE__ */ defineComponent({
|
|
|
45
45
|
return item.id === id;
|
|
46
46
|
});
|
|
47
47
|
if (targetMenu) {
|
|
48
|
+
if (targetMenu.accessKey) {
|
|
49
|
+
const app = await ibiz.hub.getApp(c.panel.context.srfappid);
|
|
50
|
+
const permitted = app.authority.calcByResCode(targetMenu.accessKey);
|
|
51
|
+
if (!permitted)
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
48
54
|
const tempContext = c.panel.context.clone();
|
|
49
55
|
const tempParam = c.panel.params;
|
|
50
56
|
tempContext.srfappid = targetMenu.appId || ibiz.env.appId;
|
|
@@ -3,16 +3,28 @@ import { ElMessageBox } from 'element-plus';
|
|
|
3
3
|
"use strict";
|
|
4
4
|
class ModalUtil {
|
|
5
5
|
async info(params) {
|
|
6
|
-
await ElMessageBox.alert(params.desc, params.title, {
|
|
6
|
+
await ElMessageBox.alert(params.desc, params.title, {
|
|
7
|
+
...params.options,
|
|
8
|
+
type: "info"
|
|
9
|
+
});
|
|
7
10
|
}
|
|
8
11
|
async success(params) {
|
|
9
|
-
await ElMessageBox.alert(params.desc, params.title, {
|
|
12
|
+
await ElMessageBox.alert(params.desc, params.title, {
|
|
13
|
+
...params.options,
|
|
14
|
+
type: "success"
|
|
15
|
+
});
|
|
10
16
|
}
|
|
11
17
|
async warning(params) {
|
|
12
|
-
await ElMessageBox.alert(params.desc, params.title, {
|
|
18
|
+
await ElMessageBox.alert(params.desc, params.title, {
|
|
19
|
+
...params.options,
|
|
20
|
+
type: "warning"
|
|
21
|
+
});
|
|
13
22
|
}
|
|
14
23
|
async error(params) {
|
|
15
|
-
await ElMessageBox.alert(params.desc, params.title, {
|
|
24
|
+
await ElMessageBox.alert(params.desc, params.title, {
|
|
25
|
+
...params.options,
|
|
26
|
+
type: "error"
|
|
27
|
+
});
|
|
16
28
|
}
|
|
17
29
|
async confirm(params) {
|
|
18
30
|
return new Promise((resolve) => {
|
|
@@ -146,7 +146,49 @@ class AppRouter {
|
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
path: ":view6(".concat(viewReg, ")/:params6(").concat(paramReg, ")"),
|
|
149
|
-
component: RouterShell
|
|
149
|
+
component: RouterShell,
|
|
150
|
+
children: [
|
|
151
|
+
{
|
|
152
|
+
path: "error/:code",
|
|
153
|
+
name: "errorView7",
|
|
154
|
+
component: ErrorView
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
path: "".concat(RouteConst.ROUTE_MODAL_TAG, "/:modalView(").concat(viewReg, ")/:modalParams(").concat(paramReg, ")"),
|
|
158
|
+
components: {
|
|
159
|
+
[RouteConst.ROUTE_MODAL_TAG]: ModalRouterShell
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
path: ":view7(".concat(viewReg, ")/:params7(").concat(paramReg, ")"),
|
|
164
|
+
component: RouterShell,
|
|
165
|
+
children: [
|
|
166
|
+
{
|
|
167
|
+
path: "error/:code",
|
|
168
|
+
name: "errorView8",
|
|
169
|
+
component: ErrorView
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
path: "".concat(RouteConst.ROUTE_MODAL_TAG, "/:modalView(").concat(viewReg, ")/:modalParams(").concat(paramReg, ")"),
|
|
173
|
+
components: {
|
|
174
|
+
[RouteConst.ROUTE_MODAL_TAG]: ModalRouterShell
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
path: ":view8(".concat(viewReg, ")/:params8(").concat(paramReg, ")"),
|
|
179
|
+
component: RouterShell
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
path: ":pathMatch(.*)*",
|
|
183
|
+
redirect: { name: "errorView8" }
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
path: ":pathMatch(.*)*",
|
|
189
|
+
redirect: { name: "errorView7" }
|
|
190
|
+
}
|
|
191
|
+
]
|
|
150
192
|
},
|
|
151
193
|
{
|
|
152
194
|
path: ":pathMatch(.*)*",
|
|
@@ -156,7 +198,7 @@ class AppRouter {
|
|
|
156
198
|
},
|
|
157
199
|
{
|
|
158
200
|
path: ":pathMatch(.*)*",
|
|
159
|
-
redirect: { name: "
|
|
201
|
+
redirect: { name: "errorView5" }
|
|
160
202
|
}
|
|
161
203
|
]
|
|
162
204
|
},
|
|
@@ -13,17 +13,6 @@ var runtime = require('@ibiz-template/runtime');
|
|
|
13
13
|
function _isSlot(s) {
|
|
14
14
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
|
|
15
15
|
}
|
|
16
|
-
async function importMapping(method, id, data) {
|
|
17
|
-
let url = "extension/import_schemas";
|
|
18
|
-
if (id) {
|
|
19
|
-
url = "".concat(url, "/").concat(id);
|
|
20
|
-
}
|
|
21
|
-
const res = await ibiz.net.request(url, {
|
|
22
|
-
method,
|
|
23
|
-
data
|
|
24
|
-
});
|
|
25
|
-
return res;
|
|
26
|
-
}
|
|
27
16
|
const DataImport2 = /* @__PURE__ */ vue.defineComponent({
|
|
28
17
|
name: "DataImport2",
|
|
29
18
|
props: {
|
|
@@ -67,6 +56,7 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
67
56
|
const columnMappingListMap = /* @__PURE__ */ new Map();
|
|
68
57
|
const options = vue.ref([]);
|
|
69
58
|
const isNoPersonel = vue.ref(false);
|
|
59
|
+
const dataImport = props.dataImport || runtime.getDefaultDataImport(props.appDataEntity);
|
|
70
60
|
const clearSelect = () => {
|
|
71
61
|
const keys = [...columnMap.keys()];
|
|
72
62
|
keys.forEach((item) => {
|
|
@@ -87,7 +77,7 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
87
77
|
}
|
|
88
78
|
let columnMapData = columnData.fields;
|
|
89
79
|
if (!columnData.fields) {
|
|
90
|
-
const res = await
|
|
80
|
+
const res = await runtime.getImportSchema(columnData.id);
|
|
91
81
|
if (res.status === 200 && res.data) {
|
|
92
82
|
columnMapData = res.data.fields;
|
|
93
83
|
}
|
|
@@ -129,7 +119,6 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
129
119
|
watchValue(newValue);
|
|
130
120
|
});
|
|
131
121
|
const onButtonColumnMappingImportClick = async () => {
|
|
132
|
-
var _a;
|
|
133
122
|
const string = selectValues.value.join("");
|
|
134
123
|
if (string === "") {
|
|
135
124
|
ibiz.message.warning(ibiz.i18n.t("component.dataImport2.atLastOne"));
|
|
@@ -140,32 +129,25 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
140
129
|
const columnMapArr = [...columnMap.values()];
|
|
141
130
|
const fields = columnMapArr.filter((columnitem) => columnitem.name !== "");
|
|
142
131
|
const data = {
|
|
143
|
-
// schame_tag: '', // 导入模式标记 不传
|
|
144
|
-
// id: '', // 导入模式标识 也不用传
|
|
145
132
|
name: "".concat(fileName.value.split(".")[0], "|").concat((/* @__PURE__ */ new Date()).toLocaleString()),
|
|
146
133
|
// 导入模式名称 按照导入的名称|时间来生成
|
|
147
|
-
|
|
148
|
-
fields,
|
|
134
|
+
fields
|
|
149
135
|
// 导入模式属性 {name:'',order_value:1}
|
|
150
|
-
// type: '', // 导入模式类型 暂时不用传
|
|
151
|
-
system_tag: (_a = ibiz.appData) == null ? void 0 : _a.context.srfsystemid,
|
|
152
|
-
// 系统标记
|
|
153
|
-
data_entity_tag: props.appDataEntity.codeName,
|
|
154
|
-
// 数据实体标记
|
|
155
|
-
import_tag: props.appDataEntity.defaultAppDEDataImportId,
|
|
156
|
-
// 导入标记 导入模型的代码名称
|
|
157
|
-
owner_type: "PERSONAL"
|
|
158
|
-
// 所有者类型
|
|
159
136
|
};
|
|
160
137
|
if (props.params) {
|
|
161
138
|
Object.assign(data, props.params);
|
|
162
139
|
}
|
|
163
140
|
if (listValue.value) {
|
|
164
141
|
const columnData = columnMappingListMap.get(listValue.value);
|
|
165
|
-
if (columnData
|
|
142
|
+
if (columnData) {
|
|
166
143
|
data.name = columnData.name;
|
|
144
|
+
data.id = columnData.id;
|
|
167
145
|
}
|
|
168
|
-
const resput = await
|
|
146
|
+
const resput = await runtime.updateImportSchema({
|
|
147
|
+
appDataEntity: props.appDataEntity,
|
|
148
|
+
dataImport,
|
|
149
|
+
data
|
|
150
|
+
});
|
|
169
151
|
if (resput.status === 200 && resput.ok) {
|
|
170
152
|
columnMappingListMap.set(listValue.value, resput.data);
|
|
171
153
|
}
|
|
@@ -178,7 +160,11 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
178
160
|
checkmark: false,
|
|
179
161
|
close: false
|
|
180
162
|
});
|
|
181
|
-
const res = await
|
|
163
|
+
const res = await runtime.createImportSchema({
|
|
164
|
+
appDataEntity: props.appDataEntity,
|
|
165
|
+
dataImport,
|
|
166
|
+
data
|
|
167
|
+
});
|
|
182
168
|
if (res.status === 200 && res.ok) {
|
|
183
169
|
columnMappingListMap.set(data.name, res.data);
|
|
184
170
|
}
|
|
@@ -196,33 +182,11 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
196
182
|
if (data) {
|
|
197
183
|
id = data.id;
|
|
198
184
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
let url = "".concat(path, "/asyncimportdata2");
|
|
206
|
-
const queryData = {
|
|
207
|
-
srfossfileid: fileid,
|
|
208
|
-
srfimportschemaid: id
|
|
209
|
-
};
|
|
210
|
-
if (srfimporttag) {
|
|
211
|
-
Object.assign(queryData, {
|
|
212
|
-
srfimporttag
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
if (props.params) {
|
|
216
|
-
Object.assign(queryData, props.params);
|
|
217
|
-
}
|
|
218
|
-
url += qs.stringify(queryData, {
|
|
219
|
-
addQueryPrefix: true
|
|
220
|
-
});
|
|
221
|
-
await ibiz.net.request(url, {
|
|
222
|
-
method: "get"
|
|
223
|
-
});
|
|
224
|
-
ibiz.notification.info({
|
|
225
|
-
desc: ibiz.i18n.t("component.dataImport.startImport")
|
|
185
|
+
await runtime.asyncImportData2({
|
|
186
|
+
appDataEntity: props.appDataEntity,
|
|
187
|
+
dataImport,
|
|
188
|
+
fileId: fileid,
|
|
189
|
+
schemaId: id
|
|
226
190
|
});
|
|
227
191
|
onCancelButtonClick();
|
|
228
192
|
} else {
|
|
@@ -244,13 +208,10 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
244
208
|
}
|
|
245
209
|
};
|
|
246
210
|
const columnMappingListQuery = async () => {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
n_data_entity_tag_eq: props.appDataEntity.codeName
|
|
252
|
-
};
|
|
253
|
-
const res = await importMapping("post", "fetch_cur_user", params);
|
|
211
|
+
const res = await runtime.fetchImportSchemas({
|
|
212
|
+
appDataEntity: props.appDataEntity,
|
|
213
|
+
dataImport
|
|
214
|
+
});
|
|
254
215
|
if (res.status === 200 && res.data) {
|
|
255
216
|
res.data.forEach((item) => {
|
|
256
217
|
options.value.push({
|
|
@@ -266,8 +227,6 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
266
227
|
}
|
|
267
228
|
};
|
|
268
229
|
vue.onMounted(() => {
|
|
269
|
-
var _a;
|
|
270
|
-
const dataImport = (_a = props.appDataEntity.appDEDataImports) == null ? void 0 : _a.find((importItem) => importItem.id === props.appDataEntity.defaultAppDEDataImportId);
|
|
271
230
|
if (dataImport && dataImport.dedataImportItems) {
|
|
272
231
|
dataOption.value = dataImport.dedataImportItems;
|
|
273
232
|
} else if (props.appDataEntity.appDEFields) {
|
|
@@ -473,4 +432,3 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
473
432
|
});
|
|
474
433
|
|
|
475
434
|
exports.DataImport2 = DataImport2;
|
|
476
|
-
exports.importMapping = importMapping;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
var vue3Util = require('@ibiz-template/vue3-util');
|
|
5
|
-
var dataImport2 = require('../data-import2/data-import2.cjs');
|
|
6
5
|
require('./data-import2-select.css');
|
|
6
|
+
var runtime = require('@ibiz-template/runtime');
|
|
7
7
|
|
|
8
8
|
"use strict";
|
|
9
9
|
function _isSlot(s) {
|
|
@@ -56,7 +56,9 @@ const DataImport2Select = /* @__PURE__ */ vue.defineComponent({
|
|
|
56
56
|
const data = props.columnMappingListMap.get(item.oldLabel);
|
|
57
57
|
if (data) {
|
|
58
58
|
data.name = item.label;
|
|
59
|
-
const result = await
|
|
59
|
+
const result = await runtime.updateImportSchema({
|
|
60
|
+
data
|
|
61
|
+
});
|
|
60
62
|
if (result.status === 200 && result.ok) {
|
|
61
63
|
emit("columnMappingListMapChange", item.label, result.data);
|
|
62
64
|
}
|
|
@@ -81,7 +83,7 @@ const DataImport2Select = /* @__PURE__ */ vue.defineComponent({
|
|
|
81
83
|
e.stopPropagation();
|
|
82
84
|
const columnData = props.columnMappingListMap.get(str);
|
|
83
85
|
if (columnData) {
|
|
84
|
-
const res = await
|
|
86
|
+
const res = await runtime.deleteImportSchema(columnData.id);
|
|
85
87
|
if (res.status === 200 && res.ok) {
|
|
86
88
|
emit("optionsChange", str);
|
|
87
89
|
emit("columnMappingListMapChange", str);
|