@ibiz-template/vue3-components 0.4.3 → 0.4.5
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/chart-ImL2qyp9.js +0 -1
- package/dist/ibiz-markdown-editor-BQsiQfa2.js +0 -1
- package/dist/index-UNZ1dtt_.js +0 -1
- package/dist/index-Ul84JXar.js +0 -1
- package/dist/index-zzHHP33g.js +13 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -2
- package/dist/map-chart-7nfIdU3w.js +0 -1
- package/dist/wang-editor-f4440Xvw.js +0 -1
- package/dist/{xlsx-util-Mxa6HuaG.js → xlsx-util-FO177Hj_.js} +1 -2
- 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 +48 -11
- package/es/common/data-import2/data-import2.mjs +133 -166
- 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/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.mjs +2 -2
- 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 +104 -54
- package/es/editor/index.mjs +9 -2
- package/es/index.mjs +0 -1
- package/es/panel-component/index.d.ts +0 -1
- package/es/panel-component/index.mjs +2 -4
- 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 +132 -164
- 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/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.cjs +1 -1
- 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 +102 -52
- package/lib/control/tree/tree.css +1 -1
- package/lib/editor/index.cjs +9 -2
- package/lib/index.cjs +15 -17
- package/lib/panel-component/index.cjs +29 -32
- 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 +10 -9
- package/dist/chart-ImL2qyp9.js.map +0 -1
- package/dist/ibiz-markdown-editor-BQsiQfa2.js.map +0 -1
- package/dist/index-1dtzc9-X.js +0 -14
- package/dist/index-1dtzc9-X.js.map +0 -1
- package/dist/index-UNZ1dtt_.js.map +0 -1
- package/dist/index-Ul84JXar.js.map +0 -1
- package/dist/index.system.min.js.map +0 -1
- package/dist/map-chart-7nfIdU3w.js.map +0 -1
- package/dist/wang-editor-f4440Xvw.js.map +0 -1
- package/dist/xlsx-util-Mxa6HuaG.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/es/panel-component/panel-container-group/index.d.ts +0 -28
- package/es/panel-component/panel-container-group/index.mjs +0 -20
- package/es/panel-component/panel-container-group/panel-container-group.controller.d.ts +0 -31
- package/es/panel-component/panel-container-group/panel-container-group.controller.mjs +0 -35
- package/es/panel-component/panel-container-group/panel-container-group.css +0 -1
- package/es/panel-component/panel-container-group/panel-container-group.d.ts +0 -28
- package/es/panel-component/panel-container-group/panel-container-group.mjs +0 -107
- package/es/panel-component/panel-container-group/panel-container-group.provider.d.ts +0 -15
- package/es/panel-component/panel-container-group/panel-container-group.provider.mjs +0 -21
- package/es/panel-component/panel-container-group/panel-container-group.state.d.ts +0 -12
- package/es/panel-component/panel-container-group/panel-container-group.state.mjs +0 -7
- package/es/panel-component/panel-tab-page/index.d.ts +0 -23
- package/es/panel-component/panel-tab-page/index.mjs +0 -12
- package/es/panel-component/panel-tab-page/panel-tab-page.d.ts +0 -25
- package/es/panel-component/panel-tab-page/panel-tab-page.mjs +0 -62
- package/es/panel-component/panel-tab-page/panel-tab-page.provider.d.ts +0 -13
- package/es/panel-component/panel-tab-page/panel-tab-page.provider.mjs +0 -21
- 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/lib/panel-component/panel-container-group/index.cjs +0 -27
- package/lib/panel-component/panel-container-group/panel-container-group.cjs +0 -109
- package/lib/panel-component/panel-container-group/panel-container-group.controller.cjs +0 -37
- package/lib/panel-component/panel-container-group/panel-container-group.css +0 -1
- package/lib/panel-component/panel-container-group/panel-container-group.provider.cjs +0 -23
- package/lib/panel-component/panel-container-group/panel-container-group.state.cjs +0 -9
- package/lib/panel-component/panel-tab-page/index.cjs +0 -17
- package/lib/panel-component/panel-tab-page/panel-tab-page.cjs +0 -64
- package/lib/panel-component/panel-tab-page/panel-tab-page.provider.cjs +0 -23
|
@@ -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,20 +43,34 @@ 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 && cloneData) {
|
|
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);
|
|
71
|
+
if (!columnData) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
64
74
|
let columnMapData = columnData.fields;
|
|
65
75
|
if (!columnData.fields) {
|
|
66
76
|
const res = await importMapping("get", columnData.id);
|
|
@@ -75,6 +85,7 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
75
85
|
}
|
|
76
86
|
const keys = [...columnMap.keys()];
|
|
77
87
|
const captionMap = /* @__PURE__ */ new Map();
|
|
88
|
+
clearSelect();
|
|
78
89
|
keys.forEach((item) => {
|
|
79
90
|
const columnMapValue = columnMap.get(item);
|
|
80
91
|
const lastIndex = item.lastIndexOf("-");
|
|
@@ -84,36 +95,32 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
84
95
|
captionMap.set(itemName, 0);
|
|
85
96
|
index = 0;
|
|
86
97
|
}
|
|
87
|
-
const filteredObjects = columnMapData.filter((columnitem) => columnitem.caption === itemName);
|
|
88
|
-
const newColumnValue = filteredObjects[index];
|
|
98
|
+
const filteredObjects = columnMapData && columnMapData.filter((columnitem) => columnitem.caption === itemName);
|
|
99
|
+
const newColumnValue = filteredObjects && filteredObjects[index];
|
|
89
100
|
if (newColumnValue) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
101
|
+
const dataOptionValue = dataOption.value.find((dataOptionItem) => dataOptionItem.id === newColumnValue.name);
|
|
102
|
+
if (dataOptionValue && columnMapValue) {
|
|
103
|
+
captionMap.set(itemName, index + 1);
|
|
104
|
+
newColumnValue.index = columnMapValue.index;
|
|
105
|
+
columnMap.set(item, newColumnValue);
|
|
106
|
+
selectValues.value[newColumnValue.index] = newColumnValue.name;
|
|
107
|
+
}
|
|
94
108
|
}
|
|
95
109
|
});
|
|
96
110
|
} 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
|
-
});
|
|
111
|
+
clearSelect();
|
|
106
112
|
}
|
|
107
113
|
};
|
|
108
114
|
watch(listValue, (newValue, _oldValue) => {
|
|
109
|
-
if (columnMappingSaveName.value !== newValue) {
|
|
110
|
-
ColumnMappingSave.value = false;
|
|
111
|
-
}
|
|
112
|
-
columnMappingSaveName.value = "";
|
|
113
115
|
watchValue(newValue);
|
|
114
116
|
});
|
|
115
117
|
const onButtonColumnMappingImportClick = async () => {
|
|
116
118
|
var _a;
|
|
119
|
+
const string = selectValues.value.join("");
|
|
120
|
+
if (string === "") {
|
|
121
|
+
ibiz.message.warning("\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6620\u5C04\u5C5E\u6027");
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
117
124
|
if (previewinfo.value[0].length) {
|
|
118
125
|
ColumnMappingSave.value = true;
|
|
119
126
|
const columnMapArr = [...columnMap.values()];
|
|
@@ -121,7 +128,7 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
121
128
|
const data = {
|
|
122
129
|
// schame_tag: '', // 导入模式标记 不传
|
|
123
130
|
// id: '', // 导入模式标识 也不用传
|
|
124
|
-
name: `${fileName.split(".")[0]}|${(/* @__PURE__ */ new Date()).toLocaleString()}`,
|
|
131
|
+
name: `${fileName.value.split(".")[0]}|${(/* @__PURE__ */ new Date()).toLocaleString()}`,
|
|
125
132
|
// 导入模式名称 按照导入的名称|时间来生成
|
|
126
133
|
// order_value: '', // 排序值 也不用传
|
|
127
134
|
fields,
|
|
@@ -138,20 +145,26 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
138
145
|
};
|
|
139
146
|
if (listValue.value) {
|
|
140
147
|
const columnData = columnMappingListMap.get(listValue.value);
|
|
141
|
-
|
|
148
|
+
if (columnData && columnData.name) {
|
|
149
|
+
data.name = columnData.name;
|
|
150
|
+
}
|
|
151
|
+
const resput = await importMapping("put", columnData == null ? void 0 : columnData.id, data);
|
|
142
152
|
if (resput.status === 200 && resput.ok) {
|
|
143
153
|
columnMappingListMap.set(listValue.value, resput.data);
|
|
144
154
|
}
|
|
145
155
|
} else {
|
|
146
156
|
options.value.push({
|
|
147
157
|
value: data.name,
|
|
148
|
-
label: data.name
|
|
158
|
+
label: data.name,
|
|
159
|
+
oldLabel: data.name,
|
|
160
|
+
edit: true,
|
|
161
|
+
checkmark: false,
|
|
162
|
+
close: false
|
|
149
163
|
});
|
|
150
164
|
const res = await importMapping("post", "", data);
|
|
151
165
|
if (res.status === 200 && res.ok) {
|
|
152
166
|
columnMappingListMap.set(data.name, res.data);
|
|
153
167
|
}
|
|
154
|
-
columnMappingSaveName.value = data.name;
|
|
155
168
|
listValue.value = data.name;
|
|
156
169
|
}
|
|
157
170
|
} else {
|
|
@@ -160,13 +173,14 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
160
173
|
};
|
|
161
174
|
const onButtonImportClick = async () => {
|
|
162
175
|
if (previewinfo.value[0].length) {
|
|
163
|
-
if (listValue.value) {
|
|
176
|
+
if (listValue.value && ColumnMappingSave.value) {
|
|
164
177
|
const data = columnMappingListMap.get(listValue.value);
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const
|
|
178
|
+
let id = "";
|
|
179
|
+
if (data) {
|
|
180
|
+
id = data.id;
|
|
181
|
+
}
|
|
182
|
+
const dataEntityTag = props.appDataEntity.codeName2;
|
|
183
|
+
const url = `${dataEntityTag}/asyncimportdata2?srfimporttag=${props.appDataEntity.defaultAppDEDataImportId}&srfossfileid=${fileid}&srfimportschemaid=${id}`;
|
|
170
184
|
await ibiz.net.request(url, {
|
|
171
185
|
method: "get"
|
|
172
186
|
});
|
|
@@ -204,7 +218,11 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
204
218
|
res.data.forEach((item) => {
|
|
205
219
|
options.value.push({
|
|
206
220
|
value: item.name,
|
|
207
|
-
label: item.name
|
|
221
|
+
label: item.name,
|
|
222
|
+
oldLabel: item.name,
|
|
223
|
+
edit: true,
|
|
224
|
+
checkmark: false,
|
|
225
|
+
close: false
|
|
208
226
|
});
|
|
209
227
|
columnMappingListMap.set(item.name, item);
|
|
210
228
|
});
|
|
@@ -214,71 +232,15 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
214
232
|
var _a;
|
|
215
233
|
const dataImport = (_a = props.appDataEntity.appDEDataImports) == null ? void 0 : _a.find((importItem) => importItem.id === props.appDataEntity.defaultAppDEDataImportId);
|
|
216
234
|
if (dataImport && dataImport.dedataImportItems) {
|
|
217
|
-
dataOption = dataImport.dedataImportItems;
|
|
235
|
+
dataOption.value = dataImport.dedataImportItems;
|
|
218
236
|
} else if (props.appDataEntity.appDEFields) {
|
|
219
|
-
dataOption = props.appDataEntity.appDEFields;
|
|
237
|
+
dataOption.value = props.appDataEntity.appDEFields;
|
|
238
|
+
}
|
|
239
|
+
if (dataimport2.value && dataimport2.value.parentElement) {
|
|
240
|
+
findDialog(dataimport2.value.parentElement);
|
|
220
241
|
}
|
|
221
|
-
findDialog(dataimport2.value.parentElement);
|
|
222
242
|
columnMappingListQuery();
|
|
223
243
|
});
|
|
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
244
|
const headers = ref({
|
|
283
245
|
Authorization: `Bearer ${getCookie(CoreConst.TOKEN)}`
|
|
284
246
|
});
|
|
@@ -295,10 +257,10 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
295
257
|
isLoading.value = true;
|
|
296
258
|
};
|
|
297
259
|
const onSuccess = (response, _file, _fileList) => {
|
|
298
|
-
fileName = "";
|
|
260
|
+
fileName.value = "";
|
|
299
261
|
fileid = "";
|
|
300
262
|
if (response.name) {
|
|
301
|
-
fileName = response.name;
|
|
263
|
+
fileName.value = response.name;
|
|
302
264
|
}
|
|
303
265
|
if (response.fileid) {
|
|
304
266
|
fileid = response.fileid;
|
|
@@ -328,29 +290,40 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
328
290
|
});
|
|
329
291
|
}
|
|
330
292
|
}
|
|
331
|
-
ColumnMappingSave.value = false;
|
|
332
293
|
isLoading.value = false;
|
|
333
294
|
watchValue(listValue.value);
|
|
334
295
|
};
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
296
|
+
const columnMappingSaveChange = (data) => {
|
|
297
|
+
ColumnMappingSave.value = data;
|
|
298
|
+
};
|
|
299
|
+
const selectValuesChange = (index, item) => {
|
|
300
|
+
selectValues.value[index] = item;
|
|
301
|
+
};
|
|
302
|
+
const columnMapChange = (key, data) => {
|
|
303
|
+
columnMap.set(key, data);
|
|
304
|
+
};
|
|
305
|
+
const listValueChange = (data) => {
|
|
306
|
+
listValue.value = data;
|
|
307
|
+
};
|
|
308
|
+
const columnMappingListMapChange = (key, data) => {
|
|
309
|
+
if (data) {
|
|
310
|
+
columnMappingListMap.set(key, data);
|
|
311
|
+
} else {
|
|
312
|
+
columnMappingListMap.delete(key);
|
|
313
|
+
}
|
|
339
314
|
};
|
|
340
|
-
const
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
315
|
+
const optionsChange = (str, data) => {
|
|
316
|
+
if (data) {
|
|
317
|
+
const index = options.value.findIndex((obj) => obj.label === str);
|
|
318
|
+
const optionValue = options.value[index];
|
|
319
|
+
Object.keys(data).forEach((key) => {
|
|
320
|
+
optionValue[key] = data[key];
|
|
321
|
+
});
|
|
322
|
+
} else {
|
|
345
323
|
const index = options.value.findIndex((obj) => obj.label === str);
|
|
346
324
|
if (index !== -1) {
|
|
347
325
|
options.value.splice(index, 1);
|
|
348
326
|
}
|
|
349
|
-
columnMappingListMap.delete(str);
|
|
350
|
-
if (listValue.value === str) {
|
|
351
|
-
listValue.value = "";
|
|
352
|
-
}
|
|
353
|
-
select.value.blur();
|
|
354
327
|
}
|
|
355
328
|
};
|
|
356
329
|
return {
|
|
@@ -362,22 +335,28 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
362
335
|
UploadUrl,
|
|
363
336
|
headers,
|
|
364
337
|
onSuccess,
|
|
365
|
-
renderTable,
|
|
366
|
-
renderSelect,
|
|
367
338
|
previewinfo,
|
|
368
339
|
selectValues,
|
|
369
|
-
renderEmpty,
|
|
370
340
|
beforeUpload,
|
|
371
341
|
dataimport2,
|
|
372
342
|
listValue,
|
|
373
343
|
options,
|
|
374
|
-
handleDeleteOption,
|
|
375
344
|
select,
|
|
376
|
-
isNoPersonel
|
|
345
|
+
isNoPersonel,
|
|
346
|
+
fileName,
|
|
347
|
+
dataOption,
|
|
348
|
+
ColumnMappingSave,
|
|
349
|
+
columnMap,
|
|
350
|
+
columnMappingSaveChange,
|
|
351
|
+
selectValuesChange,
|
|
352
|
+
columnMapChange,
|
|
353
|
+
columnMappingListMap,
|
|
354
|
+
listValueChange,
|
|
355
|
+
columnMappingListMapChange,
|
|
356
|
+
optionsChange
|
|
377
357
|
};
|
|
378
358
|
},
|
|
379
359
|
render() {
|
|
380
|
-
let _slot2;
|
|
381
360
|
return withDirectives(createVNode("div", {
|
|
382
361
|
"class": [this.ns.b(), "ibiz-view"],
|
|
383
362
|
"ref": "dataimport2"
|
|
@@ -399,34 +378,22 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
399
378
|
"class": "ibiz-control-toolbar"
|
|
400
379
|
}, [createVNode("div", {
|
|
401
380
|
"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"), {
|
|
381
|
+
}, [this.fileName ? `\u5F53\u524D\u6587\u4EF6\u540D:${this.fileName}` : ""]), this.previewinfo[0] && this.previewinfo[0].length ? createVNode(resolveComponent("data-import2-select"), {
|
|
382
|
+
"previewinfo": this.previewinfo,
|
|
383
|
+
"options": this.options,
|
|
384
|
+
"columnMappingListMap": this.columnMappingListMap,
|
|
385
|
+
"listValue": this.listValue,
|
|
386
|
+
"onListValueChange": this.listValueChange,
|
|
387
|
+
"onColumnMappingListMapChange": this.columnMappingListMapChange,
|
|
388
|
+
"onOptionsChange": this.optionsChange
|
|
389
|
+
}, null) : "", this.previewinfo[0] && this.previewinfo[0].length ? createVNode("div", {
|
|
390
|
+
"class": "ibiz-control-toolbar__item"
|
|
391
|
+
}, [createVNode(resolveComponent("el-button"), {
|
|
392
|
+
"onClick": this.onButtonColumnMappingImportClick,
|
|
393
|
+
"disabled": this.isNoPersonel
|
|
394
|
+
}, {
|
|
395
|
+
default: () => [createTextVNode("\u5BFC\u5165\u6A21\u5F0F\u4FDD\u5B58")]
|
|
396
|
+
})]) : "", createVNode(resolveComponent("el-upload"), {
|
|
430
397
|
"class": "ibiz-control-toolbar__item",
|
|
431
398
|
"action": this.UploadUrl,
|
|
432
399
|
"headers": this.headers,
|
|
@@ -435,25 +402,25 @@ const DataImport2 = /* @__PURE__ */ defineComponent({
|
|
|
435
402
|
"before-upload": this.beforeUpload
|
|
436
403
|
}, {
|
|
437
404
|
default: () => [createVNode(resolveComponent("el-button"), null, {
|
|
438
|
-
default: () => [
|
|
405
|
+
default: () => [this.previewinfo[0] && this.previewinfo[0].length ? "\u91CD\u65B0\u4E0A\u4F20\u6587\u4EF6" : "\u6587\u4EF6\u4E0A\u4F20"]
|
|
439
406
|
})]
|
|
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", {
|
|
407
|
+
}), this.previewinfo[0] && this.previewinfo[0].length ? createVNode("div", {
|
|
448
408
|
"class": "ibiz-control-toolbar__item"
|
|
449
409
|
}, [createVNode(resolveComponent("el-button"), {
|
|
450
410
|
"onClick": this.onButtonImportClick
|
|
451
411
|
}, {
|
|
452
412
|
default: () => [createTextVNode("\u5BFC\u5165")]
|
|
453
|
-
})])])])])]), createVNode("
|
|
454
|
-
"
|
|
455
|
-
|
|
413
|
+
})]) : ""])])])]), createVNode(resolveComponent("data-import2-table"), {
|
|
414
|
+
"previewinfo": this.previewinfo,
|
|
415
|
+
"selectValues": this.selectValues,
|
|
416
|
+
"dataOption": this.dataOption,
|
|
417
|
+
"columnMappingSave": this.ColumnMappingSave,
|
|
418
|
+
"columnMap": this.columnMap,
|
|
419
|
+
"onSelectValuesChange": this.selectValuesChange,
|
|
420
|
+
"onColumnMappingSaveChange": this.columnMappingSaveChange,
|
|
421
|
+
"onColumnMapChange": this.columnMapChange
|
|
422
|
+
}, null)]), [[resolveDirective("loading"), this.isLoading]]);
|
|
456
423
|
}
|
|
457
424
|
});
|
|
458
425
|
|
|
459
|
-
export { DataImport2 };
|
|
426
|
+
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
|
+
}>>, {}, {}>;
|