@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.
Files changed (108) hide show
  1. package/dist/chart-ImL2qyp9.js +0 -1
  2. package/dist/ibiz-markdown-editor-BQsiQfa2.js +0 -1
  3. package/dist/index-UNZ1dtt_.js +0 -1
  4. package/dist/index-Ul84JXar.js +0 -1
  5. package/dist/index-zzHHP33g.js +13 -0
  6. package/dist/index.min.css +1 -1
  7. package/dist/index.system.min.js +1 -2
  8. package/dist/map-chart-7nfIdU3w.js +0 -1
  9. package/dist/wang-editor-f4440Xvw.js +0 -1
  10. package/dist/{xlsx-util-Mxa6HuaG.js → xlsx-util-FO177Hj_.js} +1 -2
  11. package/es/common/col/col.mjs +0 -3
  12. package/es/common/data-import2/data-import2.css +1 -1
  13. package/es/common/data-import2/data-import2.d.ts +48 -11
  14. package/es/common/data-import2/data-import2.mjs +133 -166
  15. package/es/common/data-import2-select/data-import2-select.css +1 -0
  16. package/es/common/data-import2-select/data-import2-select.d.ts +59 -0
  17. package/es/common/data-import2-select/data-import2-select.mjs +170 -0
  18. package/es/common/data-import2-table/data-import2-table.css +1 -0
  19. package/es/common/data-import2-table/data-import2-table.d.ts +56 -0
  20. package/es/common/data-import2-table/data-import2-table.mjs +104 -0
  21. package/es/common/index.mjs +4 -0
  22. package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.mjs +2 -2
  23. package/es/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.mjs +1 -1
  24. package/es/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.provider.mjs +1 -1
  25. package/es/control/grid/row-edit-popover/row-edit-popover.css +1 -1
  26. package/es/control/tree/index.d.ts +1 -0
  27. package/es/control/tree/tree.css +1 -1
  28. package/es/control/tree/tree.d.ts +1 -0
  29. package/es/control/tree/tree.mjs +104 -54
  30. package/es/editor/index.mjs +9 -2
  31. package/es/index.mjs +0 -1
  32. package/es/panel-component/index.d.ts +0 -1
  33. package/es/panel-component/index.mjs +2 -4
  34. package/es/panel-component/panel-button/panel-button.controller.mjs +4 -1
  35. package/es/view-engine/index-view.engine.d.ts +0 -7
  36. package/es/view-engine/index-view.engine.mjs +0 -37
  37. package/lib/common/col/col.cjs +0 -3
  38. package/lib/common/data-import2/data-import2.cjs +132 -164
  39. package/lib/common/data-import2/data-import2.css +1 -1
  40. package/lib/common/data-import2-select/data-import2-select.cjs +172 -0
  41. package/lib/common/data-import2-select/data-import2-select.css +1 -0
  42. package/lib/common/data-import2-table/data-import2-table.cjs +106 -0
  43. package/lib/common/data-import2-table/data-import2-table.css +1 -0
  44. package/lib/common/index.cjs +4 -0
  45. package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.cjs +1 -1
  46. package/lib/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.cjs +1 -1
  47. package/lib/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.provider.cjs +1 -1
  48. package/lib/control/grid/row-edit-popover/row-edit-popover.css +1 -1
  49. package/lib/control/tree/tree.cjs +102 -52
  50. package/lib/control/tree/tree.css +1 -1
  51. package/lib/editor/index.cjs +9 -2
  52. package/lib/index.cjs +15 -17
  53. package/lib/panel-component/index.cjs +29 -32
  54. package/lib/panel-component/panel-button/panel-button.controller.cjs +4 -1
  55. package/lib/view-engine/index-view.engine.cjs +0 -37
  56. package/package.json +10 -9
  57. package/dist/chart-ImL2qyp9.js.map +0 -1
  58. package/dist/ibiz-markdown-editor-BQsiQfa2.js.map +0 -1
  59. package/dist/index-1dtzc9-X.js +0 -14
  60. package/dist/index-1dtzc9-X.js.map +0 -1
  61. package/dist/index-UNZ1dtt_.js.map +0 -1
  62. package/dist/index-Ul84JXar.js.map +0 -1
  63. package/dist/index.system.min.js.map +0 -1
  64. package/dist/map-chart-7nfIdU3w.js.map +0 -1
  65. package/dist/wang-editor-f4440Xvw.js.map +0 -1
  66. package/dist/xlsx-util-Mxa6HuaG.js.map +0 -1
  67. package/es/_virtual/_commonjs-dynamic-modules.mjs +0 -5
  68. package/es/_virtual/pluralize.mjs +0 -3
  69. 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
  70. 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
  71. 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
  72. 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
  73. 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
  74. package/es/node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.mjs +0 -515
  75. package/es/panel-component/panel-container-group/index.d.ts +0 -28
  76. package/es/panel-component/panel-container-group/index.mjs +0 -20
  77. package/es/panel-component/panel-container-group/panel-container-group.controller.d.ts +0 -31
  78. package/es/panel-component/panel-container-group/panel-container-group.controller.mjs +0 -35
  79. package/es/panel-component/panel-container-group/panel-container-group.css +0 -1
  80. package/es/panel-component/panel-container-group/panel-container-group.d.ts +0 -28
  81. package/es/panel-component/panel-container-group/panel-container-group.mjs +0 -107
  82. package/es/panel-component/panel-container-group/panel-container-group.provider.d.ts +0 -15
  83. package/es/panel-component/panel-container-group/panel-container-group.provider.mjs +0 -21
  84. package/es/panel-component/panel-container-group/panel-container-group.state.d.ts +0 -12
  85. package/es/panel-component/panel-container-group/panel-container-group.state.mjs +0 -7
  86. package/es/panel-component/panel-tab-page/index.d.ts +0 -23
  87. package/es/panel-component/panel-tab-page/index.mjs +0 -12
  88. package/es/panel-component/panel-tab-page/panel-tab-page.d.ts +0 -25
  89. package/es/panel-component/panel-tab-page/panel-tab-page.mjs +0 -62
  90. package/es/panel-component/panel-tab-page/panel-tab-page.provider.d.ts +0 -13
  91. package/es/panel-component/panel-tab-page/panel-tab-page.provider.mjs +0 -21
  92. package/lib/_virtual/_commonjs-dynamic-modules.cjs +0 -7
  93. package/lib/_virtual/pluralize.cjs +0 -5
  94. 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
  95. 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
  96. 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
  97. 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
  98. 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
  99. package/lib/node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.cjs +0 -519
  100. package/lib/panel-component/panel-container-group/index.cjs +0 -27
  101. package/lib/panel-component/panel-container-group/panel-container-group.cjs +0 -109
  102. package/lib/panel-component/panel-container-group/panel-container-group.controller.cjs +0 -37
  103. package/lib/panel-component/panel-container-group/panel-container-group.css +0 -1
  104. package/lib/panel-component/panel-container-group/panel-container-group.provider.cjs +0 -23
  105. package/lib/panel-component/panel-container-group/panel-container-group.state.cjs +0 -9
  106. package/lib/panel-component/panel-tab-page/index.cjs +0 -17
  107. package/lib/panel-component/panel-tab-page/panel-tab-page.cjs +0 -64
  108. package/lib/panel-component/panel-tab-page/panel-tab-page.provider.cjs +0 -23
@@ -1,4 +1,4 @@
1
- import { IBizPanelContainer, IBizPanelCtrlPos, IBizScrollContainer, IBizNavPos, IBizSingleDataContainer, IBizMultiDataContainer, IBizPanelField, IBizPanelRawItem, IBizGridContainer, IBizPanelContainerImage } from '@ibiz-template/vue3-util';
1
+ import { IBizPanelContainer, IBizPanelCtrlPos, IBizScrollContainer, IBizNavPos, IBizSingleDataContainer, IBizMultiDataContainer, IBizPanelField, IBizPanelRawItem, IBizGridContainer, IBizPanelTabPage, IBizPanelContainerGroup, IBizPanelContainerImage } from '@ibiz-template/vue3-util';
2
2
  import { IBizAuthUserinfo } from './auth-userinfo/index.mjs';
3
3
  import { IBizNavPosIndex } from './nav-pos-index/index.mjs';
4
4
  import { IBizNavTabs } from './nav-tabs/index.mjs';
@@ -9,13 +9,11 @@ import { IBizPanelViewHeader } from './panel-view-header/index.mjs';
9
9
  import { IBizPanelExpHeader } from './panel-exp-header/index.mjs';
10
10
  import { IBizPanelViewContent } from './panel-view-content/index.mjs';
11
11
  import { IBizPanelTabPanel } from './panel-tab-panel/index.mjs';
12
- import { IBizPanelTabPage } from './panel-tab-page/index.mjs';
13
12
  import { IBizSplitContainer } from './split-container/index.mjs';
14
13
  import { IBizPanelIndexViewSearch } from './panel-index-view-search/index.mjs';
15
14
  import { IBizPanelAppLoginView } from './panel-app-login-view/index.mjs';
16
15
  import { IBizPanelRememberMe } from './panel-remember-me/index.mjs';
17
16
  import { IBizIndexActions } from './index-actions/index.mjs';
18
- import { IBizPanelContainerGroup } from './panel-container-group/index.mjs';
19
17
  import { IBizUserMessage } from './user-message/index.mjs';
20
18
  import { IBizSearchFormButtons } from './searchform-buttons/index.mjs';
21
19
  export { NavPosIndexState } from './nav-pos-index/nav-pos-index.state.mjs';
@@ -59,4 +57,4 @@ const IBizPanelComponents = {
59
57
  }
60
58
  };
61
59
 
62
- export { IBizAuthUserinfo, IBizIndexActions, IBizNavPosIndex, IBizPanelAppTitle, IBizPanelButton, IBizPanelComponents, IBizPanelIndexViewSearch, IBizPanelTabPage, IBizPanelTabPanel, IBizSplitContainer, IBizPanelComponents as default };
60
+ export { IBizAuthUserinfo, IBizIndexActions, IBizNavPosIndex, IBizPanelAppTitle, IBizPanelButton, IBizPanelComponents, IBizPanelIndexViewSearch, IBizPanelTabPanel, IBizSplitContainer, IBizPanelComponents as default };
@@ -89,7 +89,10 @@ class PanelButtonController extends PanelItemController {
89
89
  * @memberof PanelButtonController
90
90
  */
91
91
  async onActionClick(event) {
92
- const { uiactionId } = this.model;
92
+ const { uiactionId, actionType } = this.model;
93
+ if (actionType === "NONE") {
94
+ return;
95
+ }
93
96
  await UIActionUtil.execAndResolved(uiactionId, {
94
97
  context: this.panel.context,
95
98
  params: this.panel.params,
@@ -22,12 +22,5 @@ export declare class IndexViewEngine extends ViewEngineBase {
22
22
  * @protected
23
23
  */
24
24
  protected toggleCollapse(): void;
25
- /**
26
- * 根据首页viewStyle设置主题(临时)
27
- * @return {*}
28
- * @author: zhujiamin
29
- * @Date: 2023-09-05 15:27:15
30
- */
31
- setTheme(): void;
32
25
  protected calcViewHeaderVisible(): boolean;
33
26
  }
@@ -1,5 +1,4 @@
1
1
  import { ViewEngineBase, ViewCallTag } from '@ibiz-template/runtime';
2
- import { isNil, isEmpty } from 'ramda';
3
2
 
4
3
  "use strict";
5
4
  class IndexViewEngine extends ViewEngineBase {
@@ -27,7 +26,6 @@ class IndexViewEngine extends ViewEngineBase {
27
26
  this.view.slotProps.appmenu = {};
28
27
  }
29
28
  this.view.slotProps.appmenu.collapse = this.view.state.isCollapse;
30
- this.setTheme();
31
29
  ibiz.util.hiddenAppLoading();
32
30
  }
33
31
  async onMounted() {
@@ -66,41 +64,6 @@ class IndexViewEngine extends ViewEngineBase {
66
64
  }
67
65
  }
68
66
  }
69
- /**
70
- * 根据首页viewStyle设置主题(临时)
71
- * @return {*}
72
- * @author: zhujiamin
73
- * @Date: 2023-09-05 15:27:15
74
- */
75
- setTheme() {
76
- const viewStyle = this.view.model.viewStyle;
77
- const htmlDom = document.querySelector("html");
78
- let themeClass = "";
79
- if (htmlDom && viewStyle) {
80
- switch (viewStyle) {
81
- case "DEFAULT":
82
- if (!isNil(ibiz.config.theme) && !isEmpty(ibiz.config.theme)) {
83
- themeClass = ibiz.config.theme;
84
- } else {
85
- themeClass = "light";
86
- }
87
- break;
88
- case "STYLE2":
89
- themeClass = "dark";
90
- break;
91
- case "STYLE3":
92
- themeClass = "omni-oa";
93
- break;
94
- default:
95
- themeClass = "light";
96
- break;
97
- }
98
- htmlDom.classList.forEach((removeClass) => {
99
- htmlDom.classList.remove(removeClass);
100
- });
101
- htmlDom.classList.add(themeClass);
102
- }
103
- }
104
67
  calcViewHeaderVisible() {
105
68
  return true;
106
69
  }
@@ -36,9 +36,6 @@ const IBizCol = /* @__PURE__ */ vue.defineComponent({
36
36
  const spacingClass = vue.computed(() => {
37
37
  const ns2 = vue3Util.useNamespace("spacing");
38
38
  const classArr = [];
39
- if (props.layoutPos.layout !== "FLEX") {
40
- return classArr;
41
- }
42
39
  const spacings = {
43
40
  top: props.layoutPos.spacingTop,
44
41
  bottom: props.layoutPos.spacingBottom,
@@ -2,17 +2,13 @@
2
2
 
3
3
  var vue = require('vue');
4
4
  var vue3Util = require('@ibiz-template/vue3-util');
5
- require('./data-import2.css');
6
5
  var qs = require('qs');
7
6
  var qxUtil = require('qx-util');
8
7
  var core = require('@ibiz-template/core');
9
- require('../../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');
10
- var plural = require('../../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');
8
+ var ramda = require('ramda');
9
+ require('./data-import2.css');
11
10
 
12
11
  "use strict";
13
- function _isSlot(s) {
14
- return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
15
- }
16
12
  async function importMapping(method, id, data) {
17
13
  let url = `extension/import_schemas`;
18
14
  if (id) {
@@ -49,20 +45,34 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
49
45
  const previewinfo = vue.ref([[]]);
50
46
  const columnMap = /* @__PURE__ */ new Map();
51
47
  const selectValues = vue.ref([]);
52
- let dataOption = [];
48
+ const dataOption = vue.ref([]);
53
49
  const dataimport2 = vue.ref();
54
50
  const select = vue.ref();
55
- let fileName = "";
51
+ const fileName = vue.ref("");
56
52
  let fileid = "";
57
- const ColumnMappingSave = vue.ref(false);
58
- const columnMappingSaveName = vue.ref("");
53
+ const ColumnMappingSave = vue.ref(true);
59
54
  const listValue = vue.ref("");
60
55
  const columnMappingListMap = /* @__PURE__ */ new Map();
61
56
  const options = vue.ref([]);
62
57
  const isNoPersonel = vue.ref(false);
58
+ const clearSelect = () => {
59
+ const keys = [...columnMap.keys()];
60
+ keys.forEach((item) => {
61
+ const data = columnMap.get(item);
62
+ const cloneData = ramda.clone(data);
63
+ if (data && cloneData) {
64
+ cloneData.name = "";
65
+ columnMap.set(item, cloneData);
66
+ selectValues.value[data.index] = "";
67
+ }
68
+ });
69
+ };
63
70
  const watchValue = async (listvalue) => {
64
71
  if (listvalue) {
65
72
  const columnData = columnMappingListMap.get(listvalue);
73
+ if (!columnData) {
74
+ return;
75
+ }
66
76
  let columnMapData = columnData.fields;
67
77
  if (!columnData.fields) {
68
78
  const res = await importMapping("get", columnData.id);
@@ -77,6 +87,7 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
77
87
  }
78
88
  const keys = [...columnMap.keys()];
79
89
  const captionMap = /* @__PURE__ */ new Map();
90
+ clearSelect();
80
91
  keys.forEach((item) => {
81
92
  const columnMapValue = columnMap.get(item);
82
93
  const lastIndex = item.lastIndexOf("-");
@@ -86,36 +97,32 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
86
97
  captionMap.set(itemName, 0);
87
98
  index = 0;
88
99
  }
89
- const filteredObjects = columnMapData.filter((columnitem) => columnitem.caption === itemName);
90
- const newColumnValue = filteredObjects[index];
100
+ const filteredObjects = columnMapData && columnMapData.filter((columnitem) => columnitem.caption === itemName);
101
+ const newColumnValue = filteredObjects && filteredObjects[index];
91
102
  if (newColumnValue) {
92
- captionMap.set(itemName, index + 1);
93
- newColumnValue.index = columnMapValue.index;
94
- columnMap.set(item, newColumnValue);
95
- selectValues.value[newColumnValue.index] = newColumnValue.name;
103
+ const dataOptionValue = dataOption.value.find((dataOptionItem) => dataOptionItem.id === newColumnValue.name);
104
+ if (dataOptionValue && columnMapValue) {
105
+ captionMap.set(itemName, index + 1);
106
+ newColumnValue.index = columnMapValue.index;
107
+ columnMap.set(item, newColumnValue);
108
+ selectValues.value[newColumnValue.index] = newColumnValue.name;
109
+ }
96
110
  }
97
111
  });
98
112
  } else {
99
- const keys = [...columnMap.keys()];
100
- keys.forEach((item) => {
101
- const data = columnMap.get(item);
102
- if (data) {
103
- data.name = "";
104
- columnMap.set(item, data);
105
- selectValues.value[data.index] = "";
106
- }
107
- });
113
+ clearSelect();
108
114
  }
109
115
  };
110
116
  vue.watch(listValue, (newValue, _oldValue) => {
111
- if (columnMappingSaveName.value !== newValue) {
112
- ColumnMappingSave.value = false;
113
- }
114
- columnMappingSaveName.value = "";
115
117
  watchValue(newValue);
116
118
  });
117
119
  const onButtonColumnMappingImportClick = async () => {
118
120
  var _a;
121
+ const string = selectValues.value.join("");
122
+ if (string === "") {
123
+ ibiz.message.warning("\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6620\u5C04\u5C5E\u6027");
124
+ return;
125
+ }
119
126
  if (previewinfo.value[0].length) {
120
127
  ColumnMappingSave.value = true;
121
128
  const columnMapArr = [...columnMap.values()];
@@ -123,7 +130,7 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
123
130
  const data = {
124
131
  // schame_tag: '', // 导入模式标记 不传
125
132
  // id: '', // 导入模式标识 也不用传
126
- name: `${fileName.split(".")[0]}|${(/* @__PURE__ */ new Date()).toLocaleString()}`,
133
+ name: `${fileName.value.split(".")[0]}|${(/* @__PURE__ */ new Date()).toLocaleString()}`,
127
134
  // 导入模式名称 按照导入的名称|时间来生成
128
135
  // order_value: '', // 排序值 也不用传
129
136
  fields,
@@ -140,20 +147,26 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
140
147
  };
141
148
  if (listValue.value) {
142
149
  const columnData = columnMappingListMap.get(listValue.value);
143
- const resput = await importMapping("put", columnData.id, data);
150
+ if (columnData && columnData.name) {
151
+ data.name = columnData.name;
152
+ }
153
+ const resput = await importMapping("put", columnData == null ? void 0 : columnData.id, data);
144
154
  if (resput.status === 200 && resput.ok) {
145
155
  columnMappingListMap.set(listValue.value, resput.data);
146
156
  }
147
157
  } else {
148
158
  options.value.push({
149
159
  value: data.name,
150
- label: data.name
160
+ label: data.name,
161
+ oldLabel: data.name,
162
+ edit: true,
163
+ checkmark: false,
164
+ close: false
151
165
  });
152
166
  const res = await importMapping("post", "", data);
153
167
  if (res.status === 200 && res.ok) {
154
168
  columnMappingListMap.set(data.name, res.data);
155
169
  }
156
- columnMappingSaveName.value = data.name;
157
170
  listValue.value = data.name;
158
171
  }
159
172
  } else {
@@ -162,13 +175,14 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
162
175
  };
163
176
  const onButtonImportClick = async () => {
164
177
  if (previewinfo.value[0].length) {
165
- if (listValue.value) {
178
+ if (listValue.value && ColumnMappingSave.value) {
166
179
  const data = columnMappingListMap.get(listValue.value);
167
- const {
168
- id
169
- } = data;
170
- const dataEntityTag = data.data_entity_tag;
171
- const url = `${plural.pluralLower(dataEntityTag)}/asyncimportdata2?srfimporttag=${props.appDataEntity.defaultAppDEDataImportId}&srfossfileid=${fileid}&srfimportschemaid=${id}`;
180
+ let id = "";
181
+ if (data) {
182
+ id = data.id;
183
+ }
184
+ const dataEntityTag = props.appDataEntity.codeName2;
185
+ const url = `${dataEntityTag}/asyncimportdata2?srfimporttag=${props.appDataEntity.defaultAppDEDataImportId}&srfossfileid=${fileid}&srfimportschemaid=${id}`;
172
186
  await ibiz.net.request(url, {
173
187
  method: "get"
174
188
  });
@@ -206,7 +220,11 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
206
220
  res.data.forEach((item) => {
207
221
  options.value.push({
208
222
  value: item.name,
209
- label: item.name
223
+ label: item.name,
224
+ oldLabel: item.name,
225
+ edit: true,
226
+ checkmark: false,
227
+ close: false
210
228
  });
211
229
  columnMappingListMap.set(item.name, item);
212
230
  });
@@ -216,71 +234,15 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
216
234
  var _a;
217
235
  const dataImport = (_a = props.appDataEntity.appDEDataImports) == null ? void 0 : _a.find((importItem) => importItem.id === props.appDataEntity.defaultAppDEDataImportId);
218
236
  if (dataImport && dataImport.dedataImportItems) {
219
- dataOption = dataImport.dedataImportItems;
237
+ dataOption.value = dataImport.dedataImportItems;
220
238
  } else if (props.appDataEntity.appDEFields) {
221
- dataOption = props.appDataEntity.appDEFields;
239
+ dataOption.value = props.appDataEntity.appDEFields;
240
+ }
241
+ if (dataimport2.value && dataimport2.value.parentElement) {
242
+ findDialog(dataimport2.value.parentElement);
222
243
  }
223
- findDialog(dataimport2.value.parentElement);
224
244
  columnMappingListQuery();
225
245
  });
226
- const renderSelect = (itemx, index) => {
227
- let _slot;
228
- const change = (item) => {
229
- selectValues.value[index] = item;
230
- const data = columnMap.get(`${itemx}-${index}`);
231
- data.name = item;
232
- columnMap.set(`${itemx}-${index}`, data);
233
- ColumnMappingSave.value = false;
234
- };
235
- return vue.createVNode(vue.resolveComponent("el-select"), {
236
- "modelValue": selectValues.value[index],
237
- "placeholder": "\u9009\u62E9\u5F53\u524D\u5217\u5BF9\u5E94\u7684\u5BFC\u5165\u5C5E\u6027",
238
- "onChange": change,
239
- "key": index,
240
- "popper-class": ns.e("dataimport-select"),
241
- "class": ns.e("select")
242
- }, _isSlot(_slot = dataOption.map((item) => {
243
- return vue.createVNode(vue.resolveComponent("el-option"), {
244
- "key": item.name,
245
- "value": item.id,
246
- "label": item.caption ? item.caption : item.logicName
247
- }, null);
248
- })) ? _slot : {
249
- default: () => [_slot]
250
- });
251
- };
252
- const renderTable = () => {
253
- const arr = previewinfo.value;
254
- const rows = arr.map((row, rowIndex) => vue.createVNode("tr", {
255
- "key": rowIndex
256
- }, [row.map((cell, cellIndex) => rowIndex === 0 ? vue.createVNode("th", {
257
- "key": cellIndex,
258
- "style": {
259
- border: "1px solid #e5e5e5",
260
- padding: "4px",
261
- "min-width": "132px"
262
- }
263
- }, [cell]) : vue.createVNode("td", {
264
- "key": cellIndex,
265
- "style": {
266
- border: "1px solid #e5e5e5",
267
- padding: "4px",
268
- "min-width": "132px"
269
- }
270
- }, [cell]))]));
271
- const newRows = [vue.createVNode("tr", {
272
- "key": "newRow"
273
- }, [arr[0].map((item, index) => vue.createVNode("td", {
274
- "key": index,
275
- "style": {
276
- border: "1px solid #e5e5e5",
277
- "min-width": "132px"
278
- }
279
- }, [renderSelect(item, index)]))]), ...rows];
280
- return vue.createVNode("table", {
281
- "style": "border-collapse:collapse;border-spacing:0"
282
- }, [vue.createVNode("tbody", null, [newRows])]);
283
- };
284
246
  const headers = vue.ref({
285
247
  Authorization: `Bearer ${qxUtil.getCookie(core.CoreConst.TOKEN)}`
286
248
  });
@@ -297,10 +259,10 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
297
259
  isLoading.value = true;
298
260
  };
299
261
  const onSuccess = (response, _file, _fileList) => {
300
- fileName = "";
262
+ fileName.value = "";
301
263
  fileid = "";
302
264
  if (response.name) {
303
- fileName = response.name;
265
+ fileName.value = response.name;
304
266
  }
305
267
  if (response.fileid) {
306
268
  fileid = response.fileid;
@@ -330,29 +292,40 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
330
292
  });
331
293
  }
332
294
  }
333
- ColumnMappingSave.value = false;
334
295
  isLoading.value = false;
335
296
  watchValue(listValue.value);
336
297
  };
337
- const renderEmpty = () => {
338
- return vue.createVNode("div", {
339
- "class": ns.e("empty")
340
- }, [vue.createTextVNode("\u6682\u65E0\u6570\u636E")]);
298
+ const columnMappingSaveChange = (data) => {
299
+ ColumnMappingSave.value = data;
300
+ };
301
+ const selectValuesChange = (index, item) => {
302
+ selectValues.value[index] = item;
303
+ };
304
+ const columnMapChange = (key, data) => {
305
+ columnMap.set(key, data);
306
+ };
307
+ const listValueChange = (data) => {
308
+ listValue.value = data;
309
+ };
310
+ const columnMappingListMapChange = (key, data) => {
311
+ if (data) {
312
+ columnMappingListMap.set(key, data);
313
+ } else {
314
+ columnMappingListMap.delete(key);
315
+ }
341
316
  };
342
- const handleDeleteOption = async (e, str) => {
343
- e.stopPropagation();
344
- const columnData = columnMappingListMap.get(str);
345
- const res = await importMapping("delete", columnData.id);
346
- if (res.status === 200 && res.ok) {
317
+ const optionsChange = (str, data) => {
318
+ if (data) {
319
+ const index = options.value.findIndex((obj) => obj.label === str);
320
+ const optionValue = options.value[index];
321
+ Object.keys(data).forEach((key) => {
322
+ optionValue[key] = data[key];
323
+ });
324
+ } else {
347
325
  const index = options.value.findIndex((obj) => obj.label === str);
348
326
  if (index !== -1) {
349
327
  options.value.splice(index, 1);
350
328
  }
351
- columnMappingListMap.delete(str);
352
- if (listValue.value === str) {
353
- listValue.value = "";
354
- }
355
- select.value.blur();
356
329
  }
357
330
  };
358
331
  return {
@@ -364,22 +337,28 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
364
337
  UploadUrl,
365
338
  headers,
366
339
  onSuccess,
367
- renderTable,
368
- renderSelect,
369
340
  previewinfo,
370
341
  selectValues,
371
- renderEmpty,
372
342
  beforeUpload,
373
343
  dataimport2,
374
344
  listValue,
375
345
  options,
376
- handleDeleteOption,
377
346
  select,
378
- isNoPersonel
347
+ isNoPersonel,
348
+ fileName,
349
+ dataOption,
350
+ ColumnMappingSave,
351
+ columnMap,
352
+ columnMappingSaveChange,
353
+ selectValuesChange,
354
+ columnMapChange,
355
+ columnMappingListMap,
356
+ listValueChange,
357
+ columnMappingListMapChange,
358
+ optionsChange
379
359
  };
380
360
  },
381
361
  render() {
382
- let _slot2;
383
362
  return vue.withDirectives(vue.createVNode("div", {
384
363
  "class": [this.ns.b(), "ibiz-view"],
385
364
  "ref": "dataimport2"
@@ -401,34 +380,22 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
401
380
  "class": "ibiz-control-toolbar"
402
381
  }, [vue.createVNode("div", {
403
382
  "class": "ibiz-control-toolbar__item"
404
- }, [vue.createVNode(vue.resolveComponent("el-select"), {
405
- "ref": "select",
406
- "modelValue": this.listValue,
407
- "onUpdate:modelValue": ($event) => this.listValue = $event,
408
- "clearable": true,
409
- "placeholder": "\u9009\u62E9\u5BFC\u5165\u6A21\u5F0F",
410
- "disabled": !(this.previewinfo[0] && this.previewinfo[0].length),
411
- "popper-class": this.ns.e("dataimport-select")
412
- }, _isSlot(_slot2 = this.options.map((item) => {
413
- return vue.createVNode(vue.resolveComponent("el-option"), {
414
- "label": item.label,
415
- "value": item.value,
416
- "class": [this.ns.e("select-option")]
417
- }, {
418
- default: () => vue.createVNode("div", {
419
- "class": [this.ns.e("select-option-item")]
420
- }, [vue.createVNode("span", null, [item.label]), vue.createVNode(vue.resolveComponent("el-button"), {
421
- "text": true,
422
- "size": "small",
423
- "onClick": (e) => this.handleDeleteOption(e, item.value),
424
- "class": this.ns.e("select-option-item-button")
425
- }, {
426
- default: () => [vue.createTextVNode("\u5220\u9664")]
427
- })])
428
- });
429
- })) ? _slot2 : {
430
- default: () => [_slot2]
431
- })]), vue.createVNode(vue.resolveComponent("el-upload"), {
383
+ }, [this.fileName ? `\u5F53\u524D\u6587\u4EF6\u540D:${this.fileName}` : ""]), this.previewinfo[0] && this.previewinfo[0].length ? vue.createVNode(vue.resolveComponent("data-import2-select"), {
384
+ "previewinfo": this.previewinfo,
385
+ "options": this.options,
386
+ "columnMappingListMap": this.columnMappingListMap,
387
+ "listValue": this.listValue,
388
+ "onListValueChange": this.listValueChange,
389
+ "onColumnMappingListMapChange": this.columnMappingListMapChange,
390
+ "onOptionsChange": this.optionsChange
391
+ }, null) : "", this.previewinfo[0] && this.previewinfo[0].length ? vue.createVNode("div", {
392
+ "class": "ibiz-control-toolbar__item"
393
+ }, [vue.createVNode(vue.resolveComponent("el-button"), {
394
+ "onClick": this.onButtonColumnMappingImportClick,
395
+ "disabled": this.isNoPersonel
396
+ }, {
397
+ default: () => [vue.createTextVNode("\u5BFC\u5165\u6A21\u5F0F\u4FDD\u5B58")]
398
+ })]) : "", vue.createVNode(vue.resolveComponent("el-upload"), {
432
399
  "class": "ibiz-control-toolbar__item",
433
400
  "action": this.UploadUrl,
434
401
  "headers": this.headers,
@@ -437,25 +404,26 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
437
404
  "before-upload": this.beforeUpload
438
405
  }, {
439
406
  default: () => [vue.createVNode(vue.resolveComponent("el-button"), null, {
440
- default: () => [vue.createTextVNode("\u6587\u4EF6\u4E0A\u4F20")]
407
+ default: () => [this.previewinfo[0] && this.previewinfo[0].length ? "\u91CD\u65B0\u4E0A\u4F20\u6587\u4EF6" : "\u6587\u4EF6\u4E0A\u4F20"]
441
408
  })]
442
- }), vue.createVNode("div", {
443
- "class": "ibiz-control-toolbar__item"
444
- }, [vue.createVNode(vue.resolveComponent("el-button"), {
445
- "onClick": this.onButtonColumnMappingImportClick,
446
- "disabled": this.isNoPersonel
447
- }, {
448
- default: () => [vue.createTextVNode("\u5BFC\u5165\u6A21\u5F0F\u4FDD\u5B58")]
449
- })]), vue.createVNode("div", {
409
+ }), this.previewinfo[0] && this.previewinfo[0].length ? vue.createVNode("div", {
450
410
  "class": "ibiz-control-toolbar__item"
451
411
  }, [vue.createVNode(vue.resolveComponent("el-button"), {
452
412
  "onClick": this.onButtonImportClick
453
413
  }, {
454
414
  default: () => [vue.createTextVNode("\u5BFC\u5165")]
455
- })])])])])]), vue.createVNode("div", {
456
- "class": [this.ns.e("template-container"), "ibiz-panel-view-content"]
457
- }, [this.previewinfo[0] && this.previewinfo[0].length ? this.renderTable() : this.renderEmpty()])]), [[vue.resolveDirective("loading"), this.isLoading]]);
415
+ })]) : ""])])])]), vue.createVNode(vue.resolveComponent("data-import2-table"), {
416
+ "previewinfo": this.previewinfo,
417
+ "selectValues": this.selectValues,
418
+ "dataOption": this.dataOption,
419
+ "columnMappingSave": this.ColumnMappingSave,
420
+ "columnMap": this.columnMap,
421
+ "onSelectValuesChange": this.selectValuesChange,
422
+ "onColumnMappingSaveChange": this.columnMappingSaveChange,
423
+ "onColumnMapChange": this.columnMapChange
424
+ }, null)]), [[vue.resolveDirective("loading"), this.isLoading]]);
458
425
  }
459
426
  });
460
427
 
461
428
  exports.DataImport2 = DataImport2;
429
+ exports.importMapping = importMapping;
@@ -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-import2__template-container{height:100%}.ibiz-data-import2__empty{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ibiz-data-import2__dataimport-select{margin-top:-5px}.ibiz-data-import2__select{width:100%}.ibiz-data-import2__select-option{padding:0 0 0 20px}.ibiz-data-import2__select-option-item{display:flex;align-items:center;justify-content:center;height:100%}.ibiz-data-import2__select-option-item-button{height:100%}
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%}