@ibiz-template/vue3-components 0.6.0-alpha.3 → 0.6.0

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 (55) hide show
  1. package/dist/index-UyccsQgR.js +4 -0
  2. package/dist/index.min.css +1 -1
  3. package/dist/index.system.min.js +1 -1
  4. package/dist/{xlsx-util-Ao2cn6nx.js → xlsx-util-G9ywpMYa.js} +1 -1
  5. package/es/common/data-import2/data-import2.css +1 -1
  6. package/es/common/data-import2/data-import2.mjs +3 -1
  7. package/es/control/drbar/drbar.controller.mjs +3 -0
  8. package/es/control/form/form-detail/form-item/form-item.mjs +1 -0
  9. package/es/control/tab-exp-panel/tab-exp-panel.mjs +9 -21
  10. package/es/control/toolbar/toolbar.mjs +1 -0
  11. package/es/control/tree/index.d.ts +1 -0
  12. package/es/control/tree/tree.css +1 -1
  13. package/es/control/tree/tree.d.ts +1 -0
  14. package/es/control/tree/tree.mjs +12 -5
  15. package/es/control/tree-grid-ex/index.d.ts +1 -0
  16. package/es/control/tree-grid-ex/tree-grid-ex.d.ts +1 -0
  17. package/es/control/tree-grid-ex/tree-grid-ex.mjs +8 -0
  18. package/es/editor/color-picker/ibiz-color-picker/ibiz-color-picker.d.ts +1 -0
  19. package/es/editor/color-picker/ibiz-color-picker/ibiz-color-picker.mjs +5 -1
  20. package/es/editor/data-picker/ibiz-picker/ibiz-picker.mjs +2 -2
  21. package/es/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.mjs +1 -1
  22. package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
  23. package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.d.ts +6 -8
  24. package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.mjs +139 -48
  25. package/es/editor/data-picker/picker-editor.controller.mjs +9 -2
  26. package/es/editor/span/span/span.css +1 -1
  27. package/es/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.provider.mjs +3 -17
  28. package/es/util/app-modal/app-modal-component.d.ts +0 -1
  29. package/es/util/app-modal/app-modal-component.mjs +3 -9
  30. package/es/view-engine/edit-view.engine.d.ts +7 -0
  31. package/es/view-engine/edit-view.engine.mjs +87 -37
  32. package/es/view-engine/pickup-tree-view.engine.d.ts +15 -0
  33. package/es/view-engine/pickup-tree-view.engine.mjs +60 -3
  34. package/lib/common/data-import2/data-import2.cjs +3 -1
  35. package/lib/common/data-import2/data-import2.css +1 -1
  36. package/lib/control/drbar/drbar.controller.cjs +3 -0
  37. package/lib/control/form/form-detail/form-item/form-item.cjs +1 -0
  38. package/lib/control/tab-exp-panel/tab-exp-panel.cjs +8 -20
  39. package/lib/control/toolbar/toolbar.cjs +1 -0
  40. package/lib/control/tree/tree.cjs +11 -4
  41. package/lib/control/tree/tree.css +1 -1
  42. package/lib/control/tree-grid-ex/tree-grid-ex.cjs +8 -0
  43. package/lib/editor/color-picker/ibiz-color-picker/ibiz-color-picker.cjs +5 -1
  44. package/lib/editor/data-picker/ibiz-picker/ibiz-picker.cjs +1 -1
  45. package/lib/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.cjs +1 -1
  46. package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.cjs +138 -47
  47. package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
  48. package/lib/editor/data-picker/picker-editor.controller.cjs +8 -1
  49. package/lib/editor/span/span/span.css +1 -1
  50. package/lib/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.provider.cjs +2 -16
  51. package/lib/util/app-modal/app-modal-component.cjs +3 -9
  52. package/lib/view-engine/edit-view.engine.cjs +87 -37
  53. package/lib/view-engine/pickup-tree-view.engine.cjs +59 -2
  54. package/package.json +6 -6
  55. package/dist/index-YUUYgkW-.js +0 -4
@@ -1,8 +1,8 @@
1
- import { isVNode, ref, computed, watch, onMounted, resolveComponent, createVNode, h, defineComponent } from 'vue';
1
+ import { isVNode, ref, watch, computed, onMounted, resolveComponent, createVNode, h, defineComponent } from 'vue';
2
2
  import { getDataPickerProps, getEditorEmits, useNamespace, useFocusAndBlur } from '@ibiz-template/vue3-util';
3
3
  import './ibiz-picker-select-view.css';
4
- import { clone } from 'ramda';
5
4
  import { ViewMode, Modal } from '@ibiz-template/runtime';
5
+ import { clone } from 'ramda';
6
6
 
7
7
  "use strict";
8
8
  function _isSlot(s) {
@@ -30,9 +30,24 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
30
30
  const queryValue = ref("");
31
31
  const visible = ref(false);
32
32
  const pickViewWidth = ref("auto");
33
- const context = ref(clone(c.context));
34
- const params = ref(clone(c.params));
33
+ const context = ref(c.context);
34
+ const params = ref(c.params);
35
+ watch(() => props.data, (newVal) => {
36
+ const {
37
+ context: tempContext,
38
+ params: tempParams
39
+ } = c.handlePublicParams(newVal, c.context, c.params);
40
+ Object.assign(context.value, tempContext);
41
+ Object.assign(params.value, tempParams);
42
+ }, {
43
+ immediate: true,
44
+ deep: true
45
+ });
35
46
  const isEditable = ref(false);
47
+ const multipleTempValue = ref(null);
48
+ const multipleTempText = ref(null);
49
+ const multipleObjs = ref(null);
50
+ const showView = ref(false);
36
51
  const showFormDefaultContent = computed(() => {
37
52
  if (props.controlParams && props.controlParams.editmode === "hover") {
38
53
  return true;
@@ -48,12 +63,6 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
48
63
  }, 100);
49
64
  }
50
65
  };
51
- const onInputChange = () => {
52
- context.value = {
53
- query: queryValue.value,
54
- ...context.value
55
- };
56
- };
57
66
  const triggerMenu = (show) => {
58
67
  if (props.disabled) {
59
68
  return;
@@ -84,10 +93,30 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
84
93
  params.value.selectedData = selectedData.value;
85
94
  }
86
95
  } else {
87
- keySet.value = [];
88
96
  const selectItems = [];
97
+ keySet.value = [];
98
+ items.value = [];
89
99
  if (newVal) {
90
- if (!props.data || !c.valueItem || !props.data[c.valueItem]) {
100
+ if (c.model.valueType === "OBJECTS") {
101
+ newVal.forEach((item) => {
102
+ const _item = clone(item);
103
+ Object.assign(_item, {
104
+ [c.keyName]: item[c.objectIdField],
105
+ [c.textName]: item[c.objectNameField]
106
+ });
107
+ if (c.objectValueField) {
108
+ Object.assign(_item, {
109
+ ...item[c.objectValueField]
110
+ });
111
+ delete _item[c.objectValueField];
112
+ }
113
+ if (_item[c.keyName]) {
114
+ items.value.push(_item);
115
+ keySet.value.push(_item[c.keyName]);
116
+ }
117
+ });
118
+ selectItems.push(...newVal);
119
+ } else if (!props.data || !c.valueItem || !props.data[c.valueItem]) {
91
120
  ibiz.log.error("\u503C\u9879\u5F02\u5E38");
92
121
  } else {
93
122
  const tempValue = props.data[c.valueItem].split(",");
@@ -98,7 +127,6 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
98
127
  srfkey
99
128
  });
100
129
  });
101
- items.value = [];
102
130
  selectItems.forEach((item) => {
103
131
  keySet.value.push(item.srfkey);
104
132
  const index = items.value.findIndex((i) => Object.is(i.srfkey, item.srfkey));
@@ -112,10 +140,10 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
112
140
  }
113
141
  }
114
142
  selectedData.value = selectItems;
115
- params.value.selectedData = selectedData.value;
143
+ multipleObjs.value = selectItems;
116
144
  }
117
145
  }, {
118
- immediate: false,
146
+ immediate: true,
119
147
  deep: true
120
148
  });
121
149
  onMounted(() => {
@@ -135,9 +163,26 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
135
163
  }
136
164
  emit("change", null);
137
165
  };
166
+ const onInputChange = (e) => {
167
+ if (!e) {
168
+ onClear();
169
+ }
170
+ };
138
171
  const onViewDataChange = (event) => {
139
172
  if (event.length === 0) {
140
- onClear();
173
+ if (singleSelect.value) {
174
+ onClear();
175
+ } else {
176
+ items.value = [];
177
+ if (c.model.valueType === "OBJECTS") {
178
+ multipleObjs.value = null;
179
+ } else {
180
+ if (c.valueItem) {
181
+ multipleTempValue.value = null;
182
+ }
183
+ multipleTempText.value = null;
184
+ }
185
+ }
141
186
  return;
142
187
  }
143
188
  if (singleSelect.value) {
@@ -152,6 +197,15 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
152
197
  } else {
153
198
  emit("change", tempText);
154
199
  }
200
+ } else if (c.model.valueType === "OBJECTS") {
201
+ if (event && Array.isArray(event)) {
202
+ const objs = [];
203
+ event.forEach((item) => {
204
+ const obj = c.handleObjectParams(item);
205
+ objs.push(obj);
206
+ });
207
+ multipleObjs.value = objs;
208
+ }
155
209
  } else {
156
210
  let tempValue = "";
157
211
  let tempText = "";
@@ -174,9 +228,9 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
174
228
  tempValue = tempValue.substring(0, tempValue.length - 1);
175
229
  tempText = tempText.substring(0, tempText.length - 1);
176
230
  if (c.valueItem) {
177
- emit("change", tempValue, c.valueItem);
231
+ multipleTempValue.value = tempValue;
178
232
  }
179
- emit("change", tempText);
233
+ multipleTempText.value = tempText;
180
234
  }
181
235
  };
182
236
  const openLinkView = async (e) => {
@@ -196,20 +250,31 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
196
250
  }
197
251
  });
198
252
  }
199
- let tempValue = "";
200
- let tempText = "";
201
- val.forEach((select) => {
202
- const srfkey = select[c.keyName] ? select[c.keyName] : select.srfkey;
203
- tempValue += "".concat(srfkey, ",");
204
- const srfmajortext = select[c.textName] ? select[c.textName] : select.srfmajortext;
205
- tempText += "".concat(srfmajortext, ",");
206
- });
207
- tempValue = tempValue.substring(0, tempValue.length - 1);
208
- tempText = tempText.substring(0, tempText.length - 1);
209
- if (c.valueItem) {
210
- emit("change", tempValue, c.valueItem);
253
+ if (c.model.valueType === "OBJECTS") {
254
+ const objs = [];
255
+ val.forEach((item) => {
256
+ const obj = c.handleObjectParams(item);
257
+ objs.push(obj);
258
+ });
259
+ emit("change", objs);
260
+ } else {
261
+ let tempValue = "";
262
+ let tempText = "";
263
+ val.forEach((select) => {
264
+ const srfkey = select[c.keyName] ? select[c.keyName] : select.srfkey;
265
+ tempValue += "".concat(srfkey, ",");
266
+ const srfmajortext = select[c.textName] ? select[c.textName] : select.srfmajortext;
267
+ tempText += "".concat(srfmajortext, ",");
268
+ });
269
+ tempValue = tempValue.substring(0, tempValue.length - 1);
270
+ tempText = tempText.substring(0, tempText.length - 1);
271
+ if (c.valueItem) {
272
+ multipleTempValue.value = tempValue;
273
+ emit("change", tempValue, c.valueItem);
274
+ }
275
+ multipleTempText.value = tempText;
276
+ emit("change", tempText);
211
277
  }
212
- emit("change", tempText);
213
278
  };
214
279
  const remoteMethod = (e) => {
215
280
  queryValue.value = e;
@@ -217,6 +282,9 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
217
282
  const onSelectionChange = (event) => {
218
283
  if (event.data) {
219
284
  onViewDataChange(event.data);
285
+ if (singleSelect.value && editorRef.value) {
286
+ editorRef.value.handleClose();
287
+ }
220
288
  }
221
289
  };
222
290
  const modal = new Modal({
@@ -243,8 +311,21 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
243
311
  if (singleSelect.value) {
244
312
  return queryValue.value;
245
313
  }
246
- return selectedData.value.map((item) => item.srfmajortext).join(",");
314
+ return selectedData.value.map((item) => item[c.textName]).join(",");
247
315
  });
316
+ const onVisibleChange = (e) => {
317
+ showView.value = e;
318
+ if (!e && !singleSelect.value) {
319
+ if (c.model.valueType === "OBJECTS") {
320
+ emit("change", multipleObjs.value);
321
+ } else {
322
+ if (c.valueItem) {
323
+ emit("change", multipleTempValue.value, c.valueItem);
324
+ }
325
+ emit("change", multipleTempText.value);
326
+ }
327
+ }
328
+ };
248
329
  return {
249
330
  ns,
250
331
  c,
@@ -272,7 +353,10 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
272
353
  valueText,
273
354
  isEditable,
274
355
  setEditable,
275
- showFormDefaultContent
356
+ showFormDefaultContent,
357
+ onVisibleChange,
358
+ showView,
359
+ selectedData
276
360
  };
277
361
  },
278
362
  render() {
@@ -281,7 +365,8 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
281
365
  "trigger": "click",
282
366
  "teleported": false,
283
367
  "class": this.ns.b("select"),
284
- "popper-class": this.ns.b("popper")
368
+ "popper-class": this.ns.b("popper"),
369
+ "onVisibleChange": this.onVisibleChange
285
370
  }, {
286
371
  default: () => {
287
372
  let _slot;
@@ -292,6 +377,7 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
292
377
  "disabled": this.disabled,
293
378
  "readonly": this.readonly,
294
379
  "onChange": this.onInputChange,
380
+ "clearable": true,
295
381
  "onFocus": (e) => {
296
382
  this.onFocus(e);
297
383
  },
@@ -302,13 +388,13 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
302
388
  return [this.queryValue && !this.disabled && !this.readonly && createVNode("ion-icon", {
303
389
  "onClick": this.onClear,
304
390
  "name": "clear"
305
- }, null), this.c.model.linkAppViewId && this.queryValue && createVNode("ion-icon", {
391
+ }, null), this.c.model.linkAppViewId && createVNode("ion-icon", {
306
392
  "onClick": this.openLinkView,
307
393
  "name": "link-arrow"
308
394
  }, null)];
309
395
  }
310
396
  }) : createVNode(resolveComponent("el-select"), {
311
- "popper-class": "select",
397
+ "popper-class": this.ns.b("select-popover"),
312
398
  "model-value": this.keySet,
313
399
  "placeholder": this.c.placeHolder ? this.c.placeHolder : " ",
314
400
  "multiple": true,
@@ -333,19 +419,24 @@ const IBizPickerSelectView = /* @__PURE__ */ defineComponent({
333
419
  });
334
420
  },
335
421
  dropdown: () => {
422
+ if (!this.showView) {
423
+ return;
424
+ }
336
425
  const viewShell = resolveComponent("IBizViewShell");
337
- return createVNode(resolveComponent("el-dropdown-menu"), null, {
338
- default: () => [this.c.pickupView && h(viewShell, {
339
- context: this.context,
340
- params: this.params,
341
- viewId: this.c.pickupView.id,
342
- style: {
343
- height: "100%",
344
- width: this.pickViewWidth
345
- },
346
- onSelectionChange: this.onSelectionChange,
347
- modal: this.modal
348
- })]
426
+ return this.c.pickupView && h(viewShell, {
427
+ context: this.context,
428
+ params: this.params,
429
+ viewId: this.c.pickupView.id,
430
+ style: {
431
+ height: "100%",
432
+ width: this.pickViewWidth
433
+ },
434
+ state: {
435
+ singleSelect: this.singleSelect,
436
+ selectedData: this.selectedData
437
+ },
438
+ onSelectionChange: this.onSelectionChange,
439
+ modal: this.modal
349
440
  });
350
441
  }
351
442
  });
@@ -1,6 +1,6 @@
1
1
  import { RuntimeModelError } from '@ibiz-template/core';
2
2
  import { EditorController, getDeACMode, OpenAppViewCommand } from '@ibiz-template/runtime';
3
- import { mergeDeepLeft, clone } from 'ramda';
3
+ import { mergeDeepLeft } from 'ramda';
4
4
 
5
5
  "use strict";
6
6
  var __defProp = Object.defineProperty;
@@ -293,7 +293,14 @@ class PickerEditorController extends EditorController {
293
293
  }
294
294
  if (this.objectValueField) {
295
295
  Object.assign(object, {
296
- [this.objectValueField]: clone(select)
296
+ [this.objectValueField]: {
297
+ ...select
298
+ }
299
+ });
300
+ }
301
+ if (select.srfnodeid) {
302
+ Object.assign(object, {
303
+ srfnodeid: select.srfnodeid
297
304
  });
298
305
  }
299
306
  return object;
@@ -1 +1 @@
1
- .ibiz-span{display:inline-block;font-size:var(--ibiz-form-item-font-size);line-height:var(--ibiz-form-item-line-height);color:var(--ibiz-form-item-text-color);white-space:pre-line}.ibiz-span--readonly{color:var(--ibiz-form-item-readonly-color)}.ibiz-span__code-list{display:inline-block;height:100%}.ibiz-form-item .ibiz-span.is-show-default{padding:var(--ibiz-form-item-hover-edit-padding)}
1
+ .ibiz-span{display:inline-block;font-size:var(--ibiz-form-item-font-size);line-height:var(--ibiz-form-item-line-height);color:var(--ibiz-form-item-text-color);white-space:pre-line}.ibiz-span--readonly{color:var(--ibiz-form-item-readonly-color)}.ibiz-span__code-list{height:100%}.ibiz-form-item .ibiz-span.is-show-default{padding:var(--ibiz-form-item-hover-edit-padding)}
@@ -1,5 +1,5 @@
1
1
  import { IBizContext } from '@ibiz-template/core';
2
- import { OpenAppViewCommand } from '@ibiz-template/runtime';
2
+ import { parseViewProtocol, OpenAppViewCommand } from '@ibiz-template/runtime';
3
3
  import { h } from 'vue';
4
4
  import { InternalMessageDefault } from './internal-message-default.mjs';
5
5
 
@@ -39,25 +39,11 @@ class InternalMessageDefaultProvider {
39
39
  */
40
40
  async openRedirectView(msg, redirectUrl) {
41
41
  await ibiz.hub.notice.internalMessage.markRead(msg);
42
- let viewId = "";
43
- const params = {};
44
- const url = new URL(redirectUrl);
45
- if (url.searchParams.size > 0) {
46
- url.searchParams.forEach((value, _key) => {
47
- params[_key] = value;
48
- });
49
- }
50
- const rdTagItems = url.pathname.replace("//", "").split("/");
51
- const [appOrViewTag, viewTag] = rdTagItems;
52
- if (viewTag) {
53
- viewId = viewTag;
54
- } else {
55
- viewId = appOrViewTag;
56
- }
42
+ const { viewId, context, params } = parseViewProtocol(redirectUrl);
57
43
  ibiz.commands.execute(
58
44
  OpenAppViewCommand.TAG,
59
45
  viewId,
60
- IBizContext.create({}),
46
+ IBizContext.create(context),
61
47
  params
62
48
  );
63
49
  }
@@ -21,7 +21,6 @@ export declare const AppModalComponent: import("vue").DefineComponent<{
21
21
  modal: Modal;
22
22
  present: () => void;
23
23
  dismiss: (_data?: IModalData) => void;
24
- onClosed: () => void;
25
24
  onBeforeClose: (done: () => void) => Promise<void>;
26
25
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
27
26
  opts: {
@@ -16,7 +16,6 @@ const AppModalComponent = /* @__PURE__ */ defineComponent({
16
16
  setup(props, ctx) {
17
17
  const ns = useNamespace("modal");
18
18
  const isShow = ref(false);
19
- let data;
20
19
  const {
21
20
  zIndex
22
21
  } = useUIStore();
@@ -50,10 +49,10 @@ const AppModalComponent = /* @__PURE__ */ defineComponent({
50
49
  const modal = new Modal({
51
50
  mode: ViewMode.MODAL,
52
51
  viewUsage: 2,
53
- dismiss: (_data) => {
52
+ dismiss: (data) => {
54
53
  zIndex.decrement();
55
54
  isShow.value = false;
56
- data = _data;
55
+ ctx.emit("dismiss", data);
57
56
  }
58
57
  });
59
58
  const onBeforeClose = async (done) => {
@@ -68,9 +67,6 @@ const AppModalComponent = /* @__PURE__ */ defineComponent({
68
67
  const present = () => {
69
68
  isShow.value = true;
70
69
  };
71
- const onClosed = () => {
72
- ctx.emit("dismiss", data);
73
- };
74
70
  return {
75
71
  ns,
76
72
  isShow,
@@ -80,7 +76,6 @@ const AppModalComponent = /* @__PURE__ */ defineComponent({
80
76
  modal,
81
77
  present,
82
78
  dismiss,
83
- onClosed,
84
79
  onBeforeClose
85
80
  };
86
81
  },
@@ -92,8 +87,7 @@ const AppModalComponent = /* @__PURE__ */ defineComponent({
92
87
  class: [this.ns.b(), this.options.placement && this.ns.m(this.options.placement), this.options.modalClass],
93
88
  style: this.customStyle,
94
89
  zIndex: this.modalZIndex,
95
- onClosed: this.onClosed,
96
- onBeforeClose: this.onBeforeClose,
90
+ beforeClose: this.onBeforeClose,
97
91
  ...this.options
98
92
  }, (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a, this.modal));
99
93
  }
@@ -70,4 +70,11 @@ export declare class EditViewEngine extends ViewEngineBase {
70
70
  * @return {*} {void}
71
71
  */
72
72
  initMarkOpenData(): void;
73
+ /**
74
+ * 刷新确认
75
+ * @author lxm
76
+ * @date 2024-02-06 11:40:36
77
+ * @return {*} {Promise<boolean>}
78
+ */
79
+ reloadConfirm(): Promise<boolean>;
73
80
  }
@@ -267,11 +267,12 @@ class EditViewEngine extends ViewEngineBase {
267
267
  * @return {*} {void}
268
268
  */
269
269
  initMarkOpenData() {
270
- if (isNil(this.view.modal.routeDepth)) {
270
+ if (isNil(this.view.modal.routeDepth) || !this.view.model.markOpenDataMode) {
271
271
  return;
272
272
  }
273
- let srfkey;
274
- const callback = (data) => {
273
+ const modes = this.view.model.markOpenDataMode.split(";");
274
+ let hasOpenConfirm = false;
275
+ const callback = async (data) => {
275
276
  if (!this.view.state.activated) {
276
277
  return;
277
278
  }
@@ -292,44 +293,93 @@ class EditViewEngine extends ViewEngineBase {
292
293
  }
293
294
  ibiz.notification.info({
294
295
  position: "bottom-right",
295
- title: data.username,
296
- desc: "".concat(actionMsg, " ").concat(this.view.state.caption, "-").concat(dataInfo)
297
- });
298
- };
299
- this.form.evt.on("onLoadSuccess", (event) => {
300
- const formData = event.data[0];
301
- srfkey = formData.srfkey;
302
- ibiz.markOpenData.action(this.deName, srfkey, "VIEW");
303
- ibiz.markOpenData.subscribe(this.deName, srfkey, callback);
304
- this.view.evt.on("onDestroyed", () => {
305
- ibiz.markOpenData.unsubscribe(this.deName, srfkey, callback);
296
+ title: "\u901A\u77E5",
297
+ desc: "".concat(modes.includes("DISPLAYOPPERSON") ? data.username : "\u6709\u4EBA", " ").concat(actionMsg, " ").concat(this.view.state.caption, "-").concat(dataInfo)
306
298
  });
307
- });
308
- let isWait = false;
309
- const actionEdit = () => {
310
- if (!srfkey || isWait) {
311
- return;
299
+ if (hasOpenConfirm === false && data.action === "UPDATE" && modes.includes("NOTICERELOAD")) {
300
+ hasOpenConfirm = true;
301
+ const isReload = await this.reloadConfirm();
302
+ if (isReload) {
303
+ this.refresh();
304
+ }
305
+ hasOpenConfirm = false;
312
306
  }
313
- isWait = true;
314
- ibiz.markOpenData.action(this.deName, srfkey, "EDIT");
315
- setTimeout(
316
- () => {
317
- isWait = false;
318
- },
319
- 1e3 * 60 * 5
320
- );
321
307
  };
322
- this.form.evt.on("onFormDataChange", actionEdit);
323
- this.form.evt.on("onSaveSuccess", () => {
324
- if (srfkey) {
325
- ibiz.markOpenData.action(this.deName, srfkey, "UPDATE");
326
- }
327
- });
328
- this.view.evt.on("onCloseView", () => {
329
- if (srfkey) {
330
- ibiz.markOpenData.action(this.deName, srfkey, "CLOSE");
331
- }
308
+ const doActions = [];
309
+ if (modes.includes("EDITDATA") || modes.includes("DISPLAYOPPERSON") || modes.includes("NOTICERELOAD")) {
310
+ doActions.push("EDIT", "VIEW", "UPDATE", "CLOSE");
311
+ } else if (modes.includes("OPENDATA")) {
312
+ doActions.push("VIEW", "CLOSE");
313
+ }
314
+ if (doActions.length === 0) {
315
+ return;
316
+ }
317
+ let srfkey;
318
+ let hasSubscribe = false;
319
+ if (doActions.includes("VIEW")) {
320
+ this.form.evt.on("onLoadSuccess", (event) => {
321
+ const formData = event.data[0];
322
+ srfkey = formData.srfkey;
323
+ ibiz.markOpenData.action(this.deName, srfkey, "VIEW");
324
+ if (!hasSubscribe) {
325
+ ibiz.markOpenData.subscribe(this.deName, srfkey, callback);
326
+ this.view.evt.on("onDestroyed", () => {
327
+ ibiz.markOpenData.unsubscribe(this.deName, srfkey, callback);
328
+ });
329
+ hasSubscribe = true;
330
+ }
331
+ });
332
+ }
333
+ if (doActions.includes("EDIT")) {
334
+ let isWait = false;
335
+ const actionEdit = () => {
336
+ if (!srfkey || isWait) {
337
+ return;
338
+ }
339
+ isWait = true;
340
+ ibiz.markOpenData.action(this.deName, srfkey, "EDIT");
341
+ setTimeout(
342
+ () => {
343
+ isWait = false;
344
+ },
345
+ 1e3 * 60 * 5
346
+ );
347
+ };
348
+ this.form.evt.on("onFormDataChange", actionEdit);
349
+ }
350
+ if (doActions.includes("UPDATE")) {
351
+ this.form.evt.on("onSaveSuccess", () => {
352
+ if (srfkey) {
353
+ ibiz.markOpenData.action(this.deName, srfkey, "UPDATE");
354
+ }
355
+ });
356
+ }
357
+ if (doActions.includes("CLOSE")) {
358
+ this.view.evt.on("onCloseView", () => {
359
+ if (srfkey) {
360
+ ibiz.markOpenData.action(this.deName, srfkey, "CLOSE");
361
+ }
362
+ });
363
+ }
364
+ }
365
+ /**
366
+ * 刷新确认
367
+ * @author lxm
368
+ * @date 2024-02-06 11:40:36
369
+ * @return {*} {Promise<boolean>}
370
+ */
371
+ async reloadConfirm() {
372
+ const result = await ibiz.confirm.info({
373
+ title: "\u662F\u5426\u5237\u65B0",
374
+ desc: "\u6570\u636E\u5DF2\u88AB\u4FEE\u6539\u662F\u5426\u5237\u65B0\u9875\u9762\uFF1F"
332
375
  });
376
+ if (result && this.form.state.modified) {
377
+ return ibiz.confirm.warning({
378
+ title: "\u5237\u65B0\u63D0\u9192",
379
+ desc: "\u8868\u5355\u6570\u636E\u5DF2\u7ECF\u4FEE\u6539\uFF0C\u786E\u5B9A\u8981\u5237\u65B0\uFF1F"
380
+ });
381
+ }
382
+ return result;
333
383
  }
334
384
  }
335
385
 
@@ -3,6 +3,13 @@ import { IAppDETreeView } from '@ibiz/model-core';
3
3
  import { TreeViewEngine } from './tree-view.engine';
4
4
  export declare class PickupTreeViewEngine extends TreeViewEngine {
5
5
  protected view: ViewController<IAppDETreeView, IPickupTreeViewState, IPickupTreeViewEvent>;
6
+ /**
7
+ * 选中数据
8
+ *
9
+ * @type {IData[]}
10
+ * @memberof PickupViewEngine
11
+ */
12
+ selectData: IData[];
6
13
  /**
7
14
  * 创建完成
8
15
  *
@@ -11,6 +18,14 @@ export declare class PickupTreeViewEngine extends TreeViewEngine {
11
18
  * @memberof PickupGridViewEngine
12
19
  */
13
20
  onCreated(): Promise<void>;
21
+ /**
22
+ * 根据key计算需要展开的节点标识
23
+ * @author lxm
24
+ * @date 2023-11-07 02:42:45
25
+ * @param {string} key
26
+ * @return {*} {string[]}
27
+ */
28
+ calcExpandKeys(key: string): string[];
14
29
  /**
15
30
  * 挂载完成
16
31
  *