@ibiz-template/vue3-components 0.4.3 → 0.4.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-ErDi07y2.js +14 -0
- package/dist/index-ErDi07y2.js.map +1 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-Mxa6HuaG.js → xlsx-util-5UOUTynl.js} +2 -2
- package/dist/{xlsx-util-Mxa6HuaG.js.map → xlsx-util-5UOUTynl.js.map} +1 -1
- package/es/common/col/col.mjs +0 -3
- package/es/common/data-import2/data-import2.css +1 -1
- package/es/common/data-import2/data-import2.d.ts +23 -9
- package/es/common/data-import2/data-import2.mjs +120 -159
- package/es/common/data-import2-select/data-import2-select.css +1 -0
- package/es/common/data-import2-select/data-import2-select.d.ts +59 -0
- package/es/common/data-import2-select/data-import2-select.mjs +170 -0
- package/es/common/data-import2-table/data-import2-table.css +1 -0
- package/es/common/data-import2-table/data-import2-table.d.ts +56 -0
- package/es/common/data-import2-table/data-import2-table.mjs +104 -0
- package/es/common/index.mjs +4 -0
- package/es/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.mjs +1 -1
- package/es/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.provider.mjs +1 -1
- package/es/control/grid/row-edit-popover/row-edit-popover.css +1 -1
- package/es/control/tree/index.d.ts +1 -0
- package/es/control/tree/tree.css +1 -1
- package/es/control/tree/tree.d.ts +1 -0
- package/es/control/tree/tree.mjs +91 -53
- package/es/editor/index.mjs +9 -2
- package/es/panel-component/panel-button/panel-button.controller.mjs +4 -1
- package/es/view-engine/index-view.engine.d.ts +0 -7
- package/es/view-engine/index-view.engine.mjs +0 -37
- package/lib/common/col/col.cjs +0 -3
- package/lib/common/data-import2/data-import2.cjs +119 -157
- package/lib/common/data-import2/data-import2.css +1 -1
- package/lib/common/data-import2-select/data-import2-select.cjs +172 -0
- package/lib/common/data-import2-select/data-import2-select.css +1 -0
- package/lib/common/data-import2-table/data-import2-table.cjs +106 -0
- package/lib/common/data-import2-table/data-import2-table.css +1 -0
- package/lib/common/index.cjs +4 -0
- package/lib/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.cjs +1 -1
- package/lib/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.provider.cjs +1 -1
- package/lib/control/grid/row-edit-popover/row-edit-popover.css +1 -1
- package/lib/control/tree/tree.cjs +90 -52
- package/lib/control/tree/tree.css +1 -1
- package/lib/editor/index.cjs +9 -2
- package/lib/panel-component/panel-button/panel-button.controller.cjs +4 -1
- package/lib/view-engine/index-view.engine.cjs +0 -37
- package/package.json +9 -8
- package/dist/index-1dtzc9-X.js +0 -14
- package/dist/index-1dtzc9-X.js.map +0 -1
- package/es/_virtual/_commonjs-dynamic-modules.mjs +0 -5
- package/es/_virtual/pluralize.mjs +0 -3
- package/es/node_modules/.pnpm/@ibiz-template_model-helper@0.4.3_@ibiz-template_runtime@0.4.3_ramda@0.29.1/node_modules/@ibiz-template/model-helper/out/utils/format-path/format-path.mjs +0 -11
- package/es/node_modules/.pnpm/@ibiz-template_model-helper@0.4.3_@ibiz-template_runtime@0.4.3_ramda@0.29.1/node_modules/@ibiz-template/model-helper/out/utils/index.mjs +0 -4
- package/es/node_modules/.pnpm/@ibiz-template_model-helper@0.4.3_@ibiz-template_runtime@0.4.3_ramda@0.29.1/node_modules/@ibiz-template/model-helper/out/utils/merge-model/merge-model.mjs +0 -22
- package/es/node_modules/.pnpm/@ibiz-template_model-helper@0.4.3_@ibiz-template_runtime@0.4.3_ramda@0.29.1/node_modules/@ibiz-template/model-helper/out/utils/plural/plural.mjs +0 -30
- package/es/node_modules/.pnpm/@ibiz-template_model-helper@0.4.3_@ibiz-template_runtime@0.4.3_ramda@0.29.1/node_modules/@ibiz-template/model-helper/out/utils/service-path-util/service-path-util.mjs +0 -187
- package/es/node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.mjs +0 -515
- package/lib/_virtual/_commonjs-dynamic-modules.cjs +0 -7
- package/lib/_virtual/pluralize.cjs +0 -5
- package/lib/node_modules/.pnpm/@ibiz-template_model-helper@0.4.3_@ibiz-template_runtime@0.4.3_ramda@0.29.1/node_modules/@ibiz-template/model-helper/out/utils/format-path/format-path.cjs +0 -13
- package/lib/node_modules/.pnpm/@ibiz-template_model-helper@0.4.3_@ibiz-template_runtime@0.4.3_ramda@0.29.1/node_modules/@ibiz-template/model-helper/out/utils/index.cjs +0 -14
- package/lib/node_modules/.pnpm/@ibiz-template_model-helper@0.4.3_@ibiz-template_runtime@0.4.3_ramda@0.29.1/node_modules/@ibiz-template/model-helper/out/utils/merge-model/merge-model.cjs +0 -24
- package/lib/node_modules/.pnpm/@ibiz-template_model-helper@0.4.3_@ibiz-template_runtime@0.4.3_ramda@0.29.1/node_modules/@ibiz-template/model-helper/out/utils/plural/plural.cjs +0 -33
- package/lib/node_modules/.pnpm/@ibiz-template_model-helper@0.4.3_@ibiz-template_runtime@0.4.3_ramda@0.29.1/node_modules/@ibiz-template/model-helper/out/utils/service-path-util/service-path-util.cjs +0 -189
- package/lib/node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.cjs +0 -519
package/es/common/col/col.mjs
CHANGED
|
@@ -34,9 +34,6 @@ const IBizCol = /* @__PURE__ */ defineComponent({
|
|
|
34
34
|
const spacingClass = computed(() => {
|
|
35
35
|
const ns2 = useNamespace("spacing");
|
|
36
36
|
const classArr = [];
|
|
37
|
-
if (props.layoutPos.layout !== "FLEX") {
|
|
38
|
-
return classArr;
|
|
39
|
-
}
|
|
40
37
|
const spacings = {
|
|
41
38
|
top: props.layoutPos.spacingTop,
|
|
42
39
|
bottom: props.layoutPos.spacingBottom,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-data-import2{display:flex;flex-flow:column nowrap;min-width:644px;height:568px;background:var(--ibiz-color-bg-1)}.ibiz-data-import2__data-import2-toolbar{display:flex;align-items:center;justify-content:space-between}.ibiz-data-import2__data-import2-toolbar-container{display:flex;align-items:center;justify-content:space-between}.ibiz-data-
|
|
1
|
+
.ibiz-data-import2{display:flex;flex-flow:column nowrap;min-width:644px;height:568px;background:var(--ibiz-color-bg-1)}.ibiz-data-import2__data-import2-toolbar{display:flex;align-items:center;justify-content:space-between}.ibiz-data-import2__data-import2-toolbar-container{display:flex;align-items:center;justify-content:space-between}.ibiz-data-import2__select-option-item-button{height:100%}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import { IAppDataEntity, IAppDEDataImport } from '@ibiz/model-core';
|
|
1
|
+
import { IAppDataEntity, IAppDEDataImport, IAppDEField, IDEDataImportItem } from '@ibiz/model-core';
|
|
2
2
|
import { PropType, Ref } from 'vue';
|
|
3
3
|
import './data-import2.scss';
|
|
4
|
+
interface ISharedProperties {
|
|
5
|
+
logicName?: string;
|
|
6
|
+
caption?: string;
|
|
7
|
+
}
|
|
8
|
+
type DataOption = (IAppDEField & ISharedProperties) | (IDEDataImportItem & ISharedProperties);
|
|
9
|
+
type Options = {
|
|
10
|
+
[key: string]: string | boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function importMapping(method: string, id?: string, data?: IData): Promise<IData>;
|
|
4
13
|
export declare const DataImport2: import("vue").DefineComponent<{
|
|
5
14
|
dismiss: {
|
|
6
15
|
type: PropType<() => void>;
|
|
@@ -23,21 +32,25 @@ export declare const DataImport2: import("vue").DefineComponent<{
|
|
|
23
32
|
UploadUrl: import("vue").ComputedRef<string>;
|
|
24
33
|
headers: Ref<IData>;
|
|
25
34
|
onSuccess: (response: IData, _file: IData, _fileList: []) => void;
|
|
26
|
-
renderTable: () => JSX.Element;
|
|
27
|
-
renderSelect: (itemx: string, index: number) => JSX.Element;
|
|
28
35
|
previewinfo: Ref<[string[]]>;
|
|
29
36
|
selectValues: Ref<string[]>;
|
|
30
|
-
renderEmpty: () => JSX.Element;
|
|
31
37
|
beforeUpload: () => void;
|
|
32
38
|
dataimport2: Ref<any>;
|
|
33
39
|
listValue: Ref<string>;
|
|
34
|
-
options: Ref<
|
|
35
|
-
value: string;
|
|
36
|
-
label: string;
|
|
37
|
-
}[]>;
|
|
38
|
-
handleDeleteOption: (e: Event, str: string) => Promise<void>;
|
|
40
|
+
options: Ref<Options[]>;
|
|
39
41
|
select: Ref<any>;
|
|
40
42
|
isNoPersonel: Ref<boolean>;
|
|
43
|
+
fileName: Ref<string>;
|
|
44
|
+
dataOption: Ref<DataOption[]>;
|
|
45
|
+
ColumnMappingSave: Ref<boolean>;
|
|
46
|
+
columnMap: Map<any, any>;
|
|
47
|
+
columnMappingSaveChange: (data: boolean) => void;
|
|
48
|
+
selectValuesChange: (index: number, item: string) => void;
|
|
49
|
+
columnMapChange: (key: string, data: IData) => void;
|
|
50
|
+
columnMappingListMap: Map<any, any>;
|
|
51
|
+
listValueChange: (data: string) => void;
|
|
52
|
+
columnMappingListMapChange: (key: string, data?: IData) => void;
|
|
53
|
+
optionsChange: (str: string, data?: Options) => void;
|
|
41
54
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
42
55
|
dismiss: {
|
|
43
56
|
type: PropType<() => void>;
|
|
@@ -52,3 +65,4 @@ export declare const DataImport2: import("vue").DefineComponent<{
|
|
|
52
65
|
required: false;
|
|
53
66
|
};
|
|
54
67
|
}>>, {}, {}>;
|
|
68
|
+
export {};
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ref, watch, onMounted, computed, createTextVNode, createVNode, resolveComponent, resolveDirective, withDirectives, defineComponent } from 'vue';
|
|
2
2
|
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
3
|
-
import './data-import2.css';
|
|
4
3
|
import qs from 'qs';
|
|
5
4
|
import { getCookie } from 'qx-util';
|
|
6
5
|
import { CoreConst } from '@ibiz-template/core';
|
|
7
|
-
import '
|
|
8
|
-
import
|
|
6
|
+
import { clone } from 'ramda';
|
|
7
|
+
import './data-import2.css';
|
|
9
8
|
|
|
10
9
|
"use strict";
|
|
11
|
-
function _isSlot(s) {
|
|
12
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
13
|
-
}
|
|
14
10
|
async function importMapping(method, id, data) {
|
|
15
11
|
let url = `extension/import_schemas`;
|
|
16
12
|
if (id) {
|
|
@@ -47,17 +43,28 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
47
43
|
const previewinfo = ref([[]]);
|
|
48
44
|
const columnMap = /* @__PURE__ */ new Map();
|
|
49
45
|
const selectValues = ref([]);
|
|
50
|
-
|
|
46
|
+
const dataOption = ref([]);
|
|
51
47
|
const dataimport2 = ref();
|
|
52
48
|
const select = ref();
|
|
53
|
-
|
|
49
|
+
const fileName = ref("");
|
|
54
50
|
let fileid = "";
|
|
55
|
-
const ColumnMappingSave = ref(
|
|
56
|
-
const columnMappingSaveName = ref("");
|
|
51
|
+
const ColumnMappingSave = ref(true);
|
|
57
52
|
const listValue = ref("");
|
|
58
53
|
const columnMappingListMap = /* @__PURE__ */ new Map();
|
|
59
54
|
const options = ref([]);
|
|
60
55
|
const isNoPersonel = ref(false);
|
|
56
|
+
const clearSelect = () => {
|
|
57
|
+
const keys = [...columnMap.keys()];
|
|
58
|
+
keys.forEach((item) => {
|
|
59
|
+
const data = columnMap.get(item);
|
|
60
|
+
const cloneData = clone(data);
|
|
61
|
+
if (data) {
|
|
62
|
+
cloneData.name = "";
|
|
63
|
+
columnMap.set(item, cloneData);
|
|
64
|
+
selectValues.value[data.index] = "";
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
};
|
|
61
68
|
const watchValue = async (listvalue) => {
|
|
62
69
|
if (listvalue) {
|
|
63
70
|
const columnData = columnMappingListMap.get(listvalue);
|
|
@@ -75,6 +82,7 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
75
82
|
}
|
|
76
83
|
const keys = [...columnMap.keys()];
|
|
77
84
|
const captionMap = /* @__PURE__ */ new Map();
|
|
85
|
+
clearSelect();
|
|
78
86
|
keys.forEach((item) => {
|
|
79
87
|
const columnMapValue = columnMap.get(item);
|
|
80
88
|
const lastIndex = item.lastIndexOf("-");
|
|
@@ -87,33 +95,29 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
87
95
|
const filteredObjects = columnMapData.filter((columnitem) => columnitem.caption === itemName);
|
|
88
96
|
const newColumnValue = filteredObjects[index];
|
|
89
97
|
if (newColumnValue) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
98
|
+
const dataOptionValue = dataOption.value.find((dataOptionItem) => dataOptionItem.id === newColumnValue.name);
|
|
99
|
+
if (dataOptionValue) {
|
|
100
|
+
captionMap.set(itemName, index + 1);
|
|
101
|
+
newColumnValue.index = columnMapValue.index;
|
|
102
|
+
columnMap.set(item, newColumnValue);
|
|
103
|
+
selectValues.value[newColumnValue.index] = newColumnValue.name;
|
|
104
|
+
}
|
|
94
105
|
}
|
|
95
106
|
});
|
|
96
107
|
} else {
|
|
97
|
-
|
|
98
|
-
keys.forEach((item) => {
|
|
99
|
-
const data = columnMap.get(item);
|
|
100
|
-
if (data) {
|
|
101
|
-
data.name = "";
|
|
102
|
-
columnMap.set(item, data);
|
|
103
|
-
selectValues.value[data.index] = "";
|
|
104
|
-
}
|
|
105
|
-
});
|
|
108
|
+
clearSelect();
|
|
106
109
|
}
|
|
107
110
|
};
|
|
108
111
|
watch(listValue, (newValue, _oldValue) => {
|
|
109
|
-
if (columnMappingSaveName.value !== newValue) {
|
|
110
|
-
ColumnMappingSave.value = false;
|
|
111
|
-
}
|
|
112
|
-
columnMappingSaveName.value = "";
|
|
113
112
|
watchValue(newValue);
|
|
114
113
|
});
|
|
115
114
|
const onButtonColumnMappingImportClick = async () => {
|
|
116
115
|
var _a;
|
|
116
|
+
const string = selectValues.value.join("");
|
|
117
|
+
if (string === "") {
|
|
118
|
+
ibiz.message.warning("\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6620\u5C04\u5C5E\u6027");
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
117
121
|
if (previewinfo.value[0].length) {
|
|
118
122
|
ColumnMappingSave.value = true;
|
|
119
123
|
const columnMapArr = [...columnMap.values()];
|
|
@@ -121,7 +125,7 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
121
125
|
const data = {
|
|
122
126
|
// schame_tag: '', // 导入模式标记 不传
|
|
123
127
|
// id: '', // 导入模式标识 也不用传
|
|
124
|
-
name: `${fileName.split(".")[0]}|${(/* @__PURE__ */ new Date()).toLocaleString()}`,
|
|
128
|
+
name: `${fileName.value.split(".")[0]}|${(/* @__PURE__ */ new Date()).toLocaleString()}`,
|
|
125
129
|
// 导入模式名称 按照导入的名称|时间来生成
|
|
126
130
|
// order_value: '', // 排序值 也不用传
|
|
127
131
|
fields,
|
|
@@ -131,6 +135,8 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
131
135
|
// 系统标记
|
|
132
136
|
data_entity_tag: props.appDataEntity.codeName,
|
|
133
137
|
// 数据实体标记
|
|
138
|
+
data_entity_tag2: props.appDataEntity.codeName2,
|
|
139
|
+
// 数据实体标记
|
|
134
140
|
import_tag: props.appDataEntity.defaultAppDEDataImportId,
|
|
135
141
|
// 导入标记 导入模型的代码名称
|
|
136
142
|
owner_type: "PERSONAL"
|
|
@@ -138,6 +144,7 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
138
144
|
};
|
|
139
145
|
if (listValue.value) {
|
|
140
146
|
const columnData = columnMappingListMap.get(listValue.value);
|
|
147
|
+
data.name = columnData.name;
|
|
141
148
|
const resput = await importMapping("put", columnData.id, data);
|
|
142
149
|
if (resput.status === 200 && resput.ok) {
|
|
143
150
|
columnMappingListMap.set(listValue.value, resput.data);
|
|
@@ -145,13 +152,16 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
145
152
|
} else {
|
|
146
153
|
options.value.push({
|
|
147
154
|
value: data.name,
|
|
148
|
-
label: data.name
|
|
155
|
+
label: data.name,
|
|
156
|
+
oldLabel: data.name,
|
|
157
|
+
edit: true,
|
|
158
|
+
checkmark: false,
|
|
159
|
+
close: false
|
|
149
160
|
});
|
|
150
161
|
const res = await importMapping("post", "", data);
|
|
151
162
|
if (res.status === 200 && res.ok) {
|
|
152
163
|
columnMappingListMap.set(data.name, res.data);
|
|
153
164
|
}
|
|
154
|
-
columnMappingSaveName.value = data.name;
|
|
155
165
|
listValue.value = data.name;
|
|
156
166
|
}
|
|
157
167
|
} else {
|
|
@@ -160,13 +170,13 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
160
170
|
};
|
|
161
171
|
const onButtonImportClick = async () => {
|
|
162
172
|
if (previewinfo.value[0].length) {
|
|
163
|
-
if (listValue.value) {
|
|
173
|
+
if (listValue.value && ColumnMappingSave.value) {
|
|
164
174
|
const data = columnMappingListMap.get(listValue.value);
|
|
165
175
|
const {
|
|
166
176
|
id
|
|
167
177
|
} = data;
|
|
168
|
-
const dataEntityTag = data.
|
|
169
|
-
const url = `${
|
|
178
|
+
const dataEntityTag = data.data_entity_tag2;
|
|
179
|
+
const url = `${dataEntityTag}/asyncimportdata2?srfimporttag=${props.appDataEntity.defaultAppDEDataImportId}&srfossfileid=${fileid}&srfimportschemaid=${id}`;
|
|
170
180
|
await ibiz.net.request(url, {
|
|
171
181
|
method: "get"
|
|
172
182
|
});
|
|
@@ -204,7 +214,11 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
204
214
|
res.data.forEach((item) => {
|
|
205
215
|
options.value.push({
|
|
206
216
|
value: item.name,
|
|
207
|
-
label: item.name
|
|
217
|
+
label: item.name,
|
|
218
|
+
oldLabel: item.name,
|
|
219
|
+
edit: true,
|
|
220
|
+
checkmark: false,
|
|
221
|
+
close: false
|
|
208
222
|
});
|
|
209
223
|
columnMappingListMap.set(item.name, item);
|
|
210
224
|
});
|
|
@@ -214,71 +228,13 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
214
228
|
var _a;
|
|
215
229
|
const dataImport = (_a = props.appDataEntity.appDEDataImports) == null ? void 0 : _a.find((importItem) => importItem.id === props.appDataEntity.defaultAppDEDataImportId);
|
|
216
230
|
if (dataImport && dataImport.dedataImportItems) {
|
|
217
|
-
dataOption = dataImport.dedataImportItems;
|
|
231
|
+
dataOption.value = dataImport.dedataImportItems;
|
|
218
232
|
} else if (props.appDataEntity.appDEFields) {
|
|
219
|
-
dataOption = props.appDataEntity.appDEFields;
|
|
233
|
+
dataOption.value = props.appDataEntity.appDEFields;
|
|
220
234
|
}
|
|
221
235
|
findDialog(dataimport2.value.parentElement);
|
|
222
236
|
columnMappingListQuery();
|
|
223
237
|
});
|
|
224
|
-
const renderSelect = (itemx, index) => {
|
|
225
|
-
let _slot;
|
|
226
|
-
const change = (item) => {
|
|
227
|
-
selectValues.value[index] = item;
|
|
228
|
-
const data = columnMap.get(`${itemx}-${index}`);
|
|
229
|
-
data.name = item;
|
|
230
|
-
columnMap.set(`${itemx}-${index}`, data);
|
|
231
|
-
ColumnMappingSave.value = false;
|
|
232
|
-
};
|
|
233
|
-
return createVNode(resolveComponent("el-select"), {
|
|
234
|
-
"modelValue": selectValues.value[index],
|
|
235
|
-
"placeholder": "\u9009\u62E9\u5F53\u524D\u5217\u5BF9\u5E94\u7684\u5BFC\u5165\u5C5E\u6027",
|
|
236
|
-
"onChange": change,
|
|
237
|
-
"key": index,
|
|
238
|
-
"popper-class": ns.e("dataimport-select"),
|
|
239
|
-
"class": ns.e("select")
|
|
240
|
-
}, _isSlot(_slot = dataOption.map((item) => {
|
|
241
|
-
return createVNode(resolveComponent("el-option"), {
|
|
242
|
-
"key": item.name,
|
|
243
|
-
"value": item.id,
|
|
244
|
-
"label": item.caption ? item.caption : item.logicName
|
|
245
|
-
}, null);
|
|
246
|
-
})) ? _slot : {
|
|
247
|
-
default: () => [_slot]
|
|
248
|
-
});
|
|
249
|
-
};
|
|
250
|
-
const renderTable = () => {
|
|
251
|
-
const arr = previewinfo.value;
|
|
252
|
-
const rows = arr.map((row, rowIndex) => createVNode("tr", {
|
|
253
|
-
"key": rowIndex
|
|
254
|
-
}, [row.map((cell, cellIndex) => rowIndex === 0 ? createVNode("th", {
|
|
255
|
-
"key": cellIndex,
|
|
256
|
-
"style": {
|
|
257
|
-
border: "1px solid #e5e5e5",
|
|
258
|
-
padding: "4px",
|
|
259
|
-
"min-width": "132px"
|
|
260
|
-
}
|
|
261
|
-
}, [cell]) : createVNode("td", {
|
|
262
|
-
"key": cellIndex,
|
|
263
|
-
"style": {
|
|
264
|
-
border: "1px solid #e5e5e5",
|
|
265
|
-
padding: "4px",
|
|
266
|
-
"min-width": "132px"
|
|
267
|
-
}
|
|
268
|
-
}, [cell]))]));
|
|
269
|
-
const newRows = [createVNode("tr", {
|
|
270
|
-
"key": "newRow"
|
|
271
|
-
}, [arr[0].map((item, index) => createVNode("td", {
|
|
272
|
-
"key": index,
|
|
273
|
-
"style": {
|
|
274
|
-
border: "1px solid #e5e5e5",
|
|
275
|
-
"min-width": "132px"
|
|
276
|
-
}
|
|
277
|
-
}, [renderSelect(item, index)]))]), ...rows];
|
|
278
|
-
return createVNode("table", {
|
|
279
|
-
"style": "border-collapse:collapse;border-spacing:0"
|
|
280
|
-
}, [createVNode("tbody", null, [newRows])]);
|
|
281
|
-
};
|
|
282
238
|
const headers = ref({
|
|
283
239
|
Authorization: `Bearer ${getCookie(CoreConst.TOKEN)}`
|
|
284
240
|
});
|
|
@@ -295,10 +251,10 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
295
251
|
isLoading.value = true;
|
|
296
252
|
};
|
|
297
253
|
const onSuccess = (response, _file, _fileList) => {
|
|
298
|
-
fileName = "";
|
|
254
|
+
fileName.value = "";
|
|
299
255
|
fileid = "";
|
|
300
256
|
if (response.name) {
|
|
301
|
-
fileName = response.name;
|
|
257
|
+
fileName.value = response.name;
|
|
302
258
|
}
|
|
303
259
|
if (response.fileid) {
|
|
304
260
|
fileid = response.fileid;
|
|
@@ -328,29 +284,40 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
328
284
|
});
|
|
329
285
|
}
|
|
330
286
|
}
|
|
331
|
-
ColumnMappingSave.value = false;
|
|
332
287
|
isLoading.value = false;
|
|
333
288
|
watchValue(listValue.value);
|
|
334
289
|
};
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
290
|
+
const columnMappingSaveChange = (data) => {
|
|
291
|
+
ColumnMappingSave.value = data;
|
|
292
|
+
};
|
|
293
|
+
const selectValuesChange = (index, item) => {
|
|
294
|
+
selectValues.value[index] = item;
|
|
339
295
|
};
|
|
340
|
-
const
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
296
|
+
const columnMapChange = (key, data) => {
|
|
297
|
+
columnMap.set(key, data);
|
|
298
|
+
};
|
|
299
|
+
const listValueChange = (data) => {
|
|
300
|
+
listValue.value = data;
|
|
301
|
+
};
|
|
302
|
+
const columnMappingListMapChange = (key, data) => {
|
|
303
|
+
if (data) {
|
|
304
|
+
columnMappingListMap.set(key, data);
|
|
305
|
+
} else {
|
|
306
|
+
columnMappingListMap.delete(key);
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
const optionsChange = (str, data) => {
|
|
310
|
+
if (data) {
|
|
311
|
+
const index = options.value.findIndex((obj) => obj.label === str);
|
|
312
|
+
const optionValue = options.value[index];
|
|
313
|
+
Object.keys(data).forEach((key) => {
|
|
314
|
+
optionValue[key] = data[key];
|
|
315
|
+
});
|
|
316
|
+
} else {
|
|
345
317
|
const index = options.value.findIndex((obj) => obj.label === str);
|
|
346
318
|
if (index !== -1) {
|
|
347
319
|
options.value.splice(index, 1);
|
|
348
320
|
}
|
|
349
|
-
columnMappingListMap.delete(str);
|
|
350
|
-
if (listValue.value === str) {
|
|
351
|
-
listValue.value = "";
|
|
352
|
-
}
|
|
353
|
-
select.value.blur();
|
|
354
321
|
}
|
|
355
322
|
};
|
|
356
323
|
return {
|
|
@@ -362,22 +329,28 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
362
329
|
UploadUrl,
|
|
363
330
|
headers,
|
|
364
331
|
onSuccess,
|
|
365
|
-
renderTable,
|
|
366
|
-
renderSelect,
|
|
367
332
|
previewinfo,
|
|
368
333
|
selectValues,
|
|
369
|
-
renderEmpty,
|
|
370
334
|
beforeUpload,
|
|
371
335
|
dataimport2,
|
|
372
336
|
listValue,
|
|
373
337
|
options,
|
|
374
|
-
handleDeleteOption,
|
|
375
338
|
select,
|
|
376
|
-
isNoPersonel
|
|
339
|
+
isNoPersonel,
|
|
340
|
+
fileName,
|
|
341
|
+
dataOption,
|
|
342
|
+
ColumnMappingSave,
|
|
343
|
+
columnMap,
|
|
344
|
+
columnMappingSaveChange,
|
|
345
|
+
selectValuesChange,
|
|
346
|
+
columnMapChange,
|
|
347
|
+
columnMappingListMap,
|
|
348
|
+
listValueChange,
|
|
349
|
+
columnMappingListMapChange,
|
|
350
|
+
optionsChange
|
|
377
351
|
};
|
|
378
352
|
},
|
|
379
353
|
render() {
|
|
380
|
-
let _slot2;
|
|
381
354
|
return withDirectives(createVNode("div", {
|
|
382
355
|
"class": [this.ns.b(), "ibiz-view"],
|
|
383
356
|
"ref": "dataimport2"
|
|
@@ -399,34 +372,22 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
399
372
|
"class": "ibiz-control-toolbar"
|
|
400
373
|
}, [createVNode("div", {
|
|
401
374
|
"class": "ibiz-control-toolbar__item"
|
|
402
|
-
}, [createVNode(resolveComponent("
|
|
403
|
-
"
|
|
404
|
-
"
|
|
405
|
-
"
|
|
406
|
-
"
|
|
407
|
-
"
|
|
408
|
-
"
|
|
409
|
-
"
|
|
410
|
-
},
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
}, [createVNode("span", null, [item.label]), createVNode(resolveComponent("el-button"), {
|
|
419
|
-
"text": true,
|
|
420
|
-
"size": "small",
|
|
421
|
-
"onClick": (e) => this.handleDeleteOption(e, item.value),
|
|
422
|
-
"class": this.ns.e("select-option-item-button")
|
|
423
|
-
}, {
|
|
424
|
-
default: () => [createTextVNode("\u5220\u9664")]
|
|
425
|
-
})])
|
|
426
|
-
});
|
|
427
|
-
})) ? _slot2 : {
|
|
428
|
-
default: () => [_slot2]
|
|
429
|
-
})]), createVNode(resolveComponent("el-upload"), {
|
|
375
|
+
}, [this.fileName ? `\u5F53\u524D\u6587\u4EF6\u540D:${this.fileName}` : ""]), this.previewinfo[0] && this.previewinfo[0].length ? createVNode(resolveComponent("data-import2-select"), {
|
|
376
|
+
"previewinfo": this.previewinfo,
|
|
377
|
+
"options": this.options,
|
|
378
|
+
"columnMappingListMap": this.columnMappingListMap,
|
|
379
|
+
"listValue": this.listValue,
|
|
380
|
+
"onListValueChange": this.listValueChange,
|
|
381
|
+
"onColumnMappingListMapChange": this.columnMappingListMapChange,
|
|
382
|
+
"onOptionsChange": this.optionsChange
|
|
383
|
+
}, null) : "", this.previewinfo[0] && this.previewinfo[0].length ? createVNode("div", {
|
|
384
|
+
"class": "ibiz-control-toolbar__item"
|
|
385
|
+
}, [createVNode(resolveComponent("el-button"), {
|
|
386
|
+
"onClick": this.onButtonColumnMappingImportClick,
|
|
387
|
+
"disabled": this.isNoPersonel
|
|
388
|
+
}, {
|
|
389
|
+
default: () => [createTextVNode("\u5BFC\u5165\u6A21\u5F0F\u4FDD\u5B58")]
|
|
390
|
+
})]) : "", createVNode(resolveComponent("el-upload"), {
|
|
430
391
|
"class": "ibiz-control-toolbar__item",
|
|
431
392
|
"action": this.UploadUrl,
|
|
432
393
|
"headers": this.headers,
|
|
@@ -435,25 +396,25 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
435
396
|
"before-upload": this.beforeUpload
|
|
436
397
|
}, {
|
|
437
398
|
default: () => [createVNode(resolveComponent("el-button"), null, {
|
|
438
|
-
default: () => [
|
|
399
|
+
default: () => [this.previewinfo[0] && this.previewinfo[0].length ? "\u91CD\u65B0\u4E0A\u4F20\u6587\u4EF6" : "\u6587\u4EF6\u4E0A\u4F20"]
|
|
439
400
|
})]
|
|
440
|
-
}), createVNode("div", {
|
|
441
|
-
"class": "ibiz-control-toolbar__item"
|
|
442
|
-
}, [createVNode(resolveComponent("el-button"), {
|
|
443
|
-
"onClick": this.onButtonColumnMappingImportClick,
|
|
444
|
-
"disabled": this.isNoPersonel
|
|
445
|
-
}, {
|
|
446
|
-
default: () => [createTextVNode("\u5BFC\u5165\u6A21\u5F0F\u4FDD\u5B58")]
|
|
447
|
-
})]), createVNode("div", {
|
|
401
|
+
}), this.previewinfo[0] && this.previewinfo[0].length ? createVNode("div", {
|
|
448
402
|
"class": "ibiz-control-toolbar__item"
|
|
449
403
|
}, [createVNode(resolveComponent("el-button"), {
|
|
450
404
|
"onClick": this.onButtonImportClick
|
|
451
405
|
}, {
|
|
452
406
|
default: () => [createTextVNode("\u5BFC\u5165")]
|
|
453
|
-
})])])])])]), createVNode("
|
|
454
|
-
"
|
|
455
|
-
|
|
407
|
+
})]) : ""])])])]), createVNode(resolveComponent("data-import2-table"), {
|
|
408
|
+
"previewinfo": this.previewinfo,
|
|
409
|
+
"selectValues": this.selectValues,
|
|
410
|
+
"dataOption": this.dataOption,
|
|
411
|
+
"columnMappingSave": this.ColumnMappingSave,
|
|
412
|
+
"columnMap": this.columnMap,
|
|
413
|
+
"onSelectValuesChange": this.selectValuesChange,
|
|
414
|
+
"onColumnMappingSaveChange": this.columnMappingSaveChange,
|
|
415
|
+
"onColumnMapChange": this.columnMapChange
|
|
416
|
+
}, null)]), [[resolveDirective("loading"), this.isLoading]]);
|
|
456
417
|
}
|
|
457
418
|
});
|
|
458
419
|
|
|
459
|
-
export { DataImport2 };
|
|
420
|
+
export { DataImport2, importMapping };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-data-import2-select__select-option{padding:var(--ibiz-spacing-none)}.ibiz-data-import2-select__select-option-item{padding:var(--ibiz-spacing-none) 30px var(--ibiz-spacing-none) 10px;display:flex;align-items:center;justify-content:space-between;height:100%}.ibiz-data-import2-select__select-option-item:hover .ibiz-data-import2-select__select-option-item-button-delete{display:block}.ibiz-data-import2-select__select-option-item-button-delete{position:absolute;right:var(--ibiz-spacing-none);display:none}.ibiz-data-import2-select__dataimport-select{margin-top:-5px}.ibiz-data-import2-select__select-option-item-button-delete-icon{color:red}.ibiz-data-import2-select__select-option-item-input{width:100%}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import './data-import2-select.scss';
|
|
3
|
+
export declare const DataImport2Select: import("vue").DefineComponent<{
|
|
4
|
+
previewinfo: {
|
|
5
|
+
type: PropType<[string[]]>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
options: {
|
|
9
|
+
type: PropType<{
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
oldLabel: string;
|
|
13
|
+
edit: boolean;
|
|
14
|
+
checkmark: boolean;
|
|
15
|
+
close: boolean;
|
|
16
|
+
}[]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
columnMappingListMap: {
|
|
20
|
+
type: PropType<Map<string, IData>>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
listValue: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
}, {
|
|
28
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
29
|
+
inputClick: (e: Event) => void;
|
|
30
|
+
editLabel: (e: Event, item: IData) => void;
|
|
31
|
+
saveLabel: (e: Event, item: IData) => Promise<void>;
|
|
32
|
+
notSaveLabel: (e: Event, item: IData) => void;
|
|
33
|
+
handleDeleteOption: (e: Event, str: string) => Promise<void>;
|
|
34
|
+
valueChange: (data: string) => void;
|
|
35
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
|
+
previewinfo: {
|
|
37
|
+
type: PropType<[string[]]>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
options: {
|
|
41
|
+
type: PropType<{
|
|
42
|
+
value: string;
|
|
43
|
+
label: string;
|
|
44
|
+
oldLabel: string;
|
|
45
|
+
edit: boolean;
|
|
46
|
+
checkmark: boolean;
|
|
47
|
+
close: boolean;
|
|
48
|
+
}[]>;
|
|
49
|
+
required: true;
|
|
50
|
+
};
|
|
51
|
+
columnMappingListMap: {
|
|
52
|
+
type: PropType<Map<string, IData>>;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
listValue: {
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
required: true;
|
|
58
|
+
};
|
|
59
|
+
}>>, {}, {}>;
|