@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
@@ -295,7 +295,14 @@ class PickerEditorController extends runtime.EditorController {
295
295
  }
296
296
  if (this.objectValueField) {
297
297
  Object.assign(object, {
298
- [this.objectValueField]: ramda.clone(select)
298
+ [this.objectValueField]: {
299
+ ...select
300
+ }
301
+ });
302
+ }
303
+ if (select.srfnodeid) {
304
+ Object.assign(object, {
305
+ srfnodeid: select.srfnodeid
299
306
  });
300
307
  }
301
308
  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)}
@@ -41,25 +41,11 @@ class InternalMessageDefaultProvider {
41
41
  */
42
42
  async openRedirectView(msg, redirectUrl) {
43
43
  await ibiz.hub.notice.internalMessage.markRead(msg);
44
- let viewId = "";
45
- const params = {};
46
- const url = new URL(redirectUrl);
47
- if (url.searchParams.size > 0) {
48
- url.searchParams.forEach((value, _key) => {
49
- params[_key] = value;
50
- });
51
- }
52
- const rdTagItems = url.pathname.replace("//", "").split("/");
53
- const [appOrViewTag, viewTag] = rdTagItems;
54
- if (viewTag) {
55
- viewId = viewTag;
56
- } else {
57
- viewId = appOrViewTag;
58
- }
44
+ const { viewId, context, params } = runtime.parseViewProtocol(redirectUrl);
59
45
  ibiz.commands.execute(
60
46
  runtime.OpenAppViewCommand.TAG,
61
47
  viewId,
62
- core.IBizContext.create({}),
48
+ core.IBizContext.create(context),
63
49
  params
64
50
  );
65
51
  }
@@ -18,7 +18,6 @@ const AppModalComponent = /* @__PURE__ */ vue.defineComponent({
18
18
  setup(props, ctx) {
19
19
  const ns = vue3Util.useNamespace("modal");
20
20
  const isShow = vue.ref(false);
21
- let data;
22
21
  const {
23
22
  zIndex
24
23
  } = vue3Util.useUIStore();
@@ -52,10 +51,10 @@ const AppModalComponent = /* @__PURE__ */ vue.defineComponent({
52
51
  const modal = new runtime.Modal({
53
52
  mode: runtime.ViewMode.MODAL,
54
53
  viewUsage: 2,
55
- dismiss: (_data) => {
54
+ dismiss: (data) => {
56
55
  zIndex.decrement();
57
56
  isShow.value = false;
58
- data = _data;
57
+ ctx.emit("dismiss", data);
59
58
  }
60
59
  });
61
60
  const onBeforeClose = async (done) => {
@@ -70,9 +69,6 @@ const AppModalComponent = /* @__PURE__ */ vue.defineComponent({
70
69
  const present = () => {
71
70
  isShow.value = true;
72
71
  };
73
- const onClosed = () => {
74
- ctx.emit("dismiss", data);
75
- };
76
72
  return {
77
73
  ns,
78
74
  isShow,
@@ -82,7 +78,6 @@ const AppModalComponent = /* @__PURE__ */ vue.defineComponent({
82
78
  modal,
83
79
  present,
84
80
  dismiss,
85
- onClosed,
86
81
  onBeforeClose
87
82
  };
88
83
  },
@@ -94,8 +89,7 @@ const AppModalComponent = /* @__PURE__ */ vue.defineComponent({
94
89
  class: [this.ns.b(), this.options.placement && this.ns.m(this.options.placement), this.options.modalClass],
95
90
  style: this.customStyle,
96
91
  zIndex: this.modalZIndex,
97
- onClosed: this.onClosed,
98
- onBeforeClose: this.onBeforeClose,
92
+ beforeClose: this.onBeforeClose,
99
93
  ...this.options
100
94
  }, (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a, this.modal));
101
95
  }
@@ -269,11 +269,12 @@ class EditViewEngine extends runtime.ViewEngineBase {
269
269
  * @return {*} {void}
270
270
  */
271
271
  initMarkOpenData() {
272
- if (ramda.isNil(this.view.modal.routeDepth)) {
272
+ if (ramda.isNil(this.view.modal.routeDepth) || !this.view.model.markOpenDataMode) {
273
273
  return;
274
274
  }
275
- let srfkey;
276
- const callback = (data) => {
275
+ const modes = this.view.model.markOpenDataMode.split(";");
276
+ let hasOpenConfirm = false;
277
+ const callback = async (data) => {
277
278
  if (!this.view.state.activated) {
278
279
  return;
279
280
  }
@@ -294,44 +295,93 @@ class EditViewEngine extends runtime.ViewEngineBase {
294
295
  }
295
296
  ibiz.notification.info({
296
297
  position: "bottom-right",
297
- title: data.username,
298
- desc: "".concat(actionMsg, " ").concat(this.view.state.caption, "-").concat(dataInfo)
299
- });
300
- };
301
- this.form.evt.on("onLoadSuccess", (event) => {
302
- const formData = event.data[0];
303
- srfkey = formData.srfkey;
304
- ibiz.markOpenData.action(this.deName, srfkey, "VIEW");
305
- ibiz.markOpenData.subscribe(this.deName, srfkey, callback);
306
- this.view.evt.on("onDestroyed", () => {
307
- ibiz.markOpenData.unsubscribe(this.deName, srfkey, callback);
298
+ title: "\u901A\u77E5",
299
+ desc: "".concat(modes.includes("DISPLAYOPPERSON") ? data.username : "\u6709\u4EBA", " ").concat(actionMsg, " ").concat(this.view.state.caption, "-").concat(dataInfo)
308
300
  });
309
- });
310
- let isWait = false;
311
- const actionEdit = () => {
312
- if (!srfkey || isWait) {
313
- return;
301
+ if (hasOpenConfirm === false && data.action === "UPDATE" && modes.includes("NOTICERELOAD")) {
302
+ hasOpenConfirm = true;
303
+ const isReload = await this.reloadConfirm();
304
+ if (isReload) {
305
+ this.refresh();
306
+ }
307
+ hasOpenConfirm = false;
314
308
  }
315
- isWait = true;
316
- ibiz.markOpenData.action(this.deName, srfkey, "EDIT");
317
- setTimeout(
318
- () => {
319
- isWait = false;
320
- },
321
- 1e3 * 60 * 5
322
- );
323
309
  };
324
- this.form.evt.on("onFormDataChange", actionEdit);
325
- this.form.evt.on("onSaveSuccess", () => {
326
- if (srfkey) {
327
- ibiz.markOpenData.action(this.deName, srfkey, "UPDATE");
328
- }
329
- });
330
- this.view.evt.on("onCloseView", () => {
331
- if (srfkey) {
332
- ibiz.markOpenData.action(this.deName, srfkey, "CLOSE");
333
- }
310
+ const doActions = [];
311
+ if (modes.includes("EDITDATA") || modes.includes("DISPLAYOPPERSON") || modes.includes("NOTICERELOAD")) {
312
+ doActions.push("EDIT", "VIEW", "UPDATE", "CLOSE");
313
+ } else if (modes.includes("OPENDATA")) {
314
+ doActions.push("VIEW", "CLOSE");
315
+ }
316
+ if (doActions.length === 0) {
317
+ return;
318
+ }
319
+ let srfkey;
320
+ let hasSubscribe = false;
321
+ if (doActions.includes("VIEW")) {
322
+ this.form.evt.on("onLoadSuccess", (event) => {
323
+ const formData = event.data[0];
324
+ srfkey = formData.srfkey;
325
+ ibiz.markOpenData.action(this.deName, srfkey, "VIEW");
326
+ if (!hasSubscribe) {
327
+ ibiz.markOpenData.subscribe(this.deName, srfkey, callback);
328
+ this.view.evt.on("onDestroyed", () => {
329
+ ibiz.markOpenData.unsubscribe(this.deName, srfkey, callback);
330
+ });
331
+ hasSubscribe = true;
332
+ }
333
+ });
334
+ }
335
+ if (doActions.includes("EDIT")) {
336
+ let isWait = false;
337
+ const actionEdit = () => {
338
+ if (!srfkey || isWait) {
339
+ return;
340
+ }
341
+ isWait = true;
342
+ ibiz.markOpenData.action(this.deName, srfkey, "EDIT");
343
+ setTimeout(
344
+ () => {
345
+ isWait = false;
346
+ },
347
+ 1e3 * 60 * 5
348
+ );
349
+ };
350
+ this.form.evt.on("onFormDataChange", actionEdit);
351
+ }
352
+ if (doActions.includes("UPDATE")) {
353
+ this.form.evt.on("onSaveSuccess", () => {
354
+ if (srfkey) {
355
+ ibiz.markOpenData.action(this.deName, srfkey, "UPDATE");
356
+ }
357
+ });
358
+ }
359
+ if (doActions.includes("CLOSE")) {
360
+ this.view.evt.on("onCloseView", () => {
361
+ if (srfkey) {
362
+ ibiz.markOpenData.action(this.deName, srfkey, "CLOSE");
363
+ }
364
+ });
365
+ }
366
+ }
367
+ /**
368
+ * 刷新确认
369
+ * @author lxm
370
+ * @date 2024-02-06 11:40:36
371
+ * @return {*} {Promise<boolean>}
372
+ */
373
+ async reloadConfirm() {
374
+ const result = await ibiz.confirm.info({
375
+ title: "\u662F\u5426\u5237\u65B0",
376
+ desc: "\u6570\u636E\u5DF2\u88AB\u4FEE\u6539\u662F\u5426\u5237\u65B0\u9875\u9762\uFF1F"
334
377
  });
378
+ if (result && this.form.state.modified) {
379
+ return ibiz.confirm.warning({
380
+ title: "\u5237\u65B0\u63D0\u9192",
381
+ desc: "\u8868\u5355\u6570\u636E\u5DF2\u7ECF\u4FEE\u6539\uFF0C\u786E\u5B9A\u8981\u5237\u65B0\uFF1F"
382
+ });
383
+ }
384
+ return result;
335
385
  }
336
386
  }
337
387
 
@@ -4,7 +4,23 @@ var runtime = require('@ibiz-template/runtime');
4
4
  var treeView_engine = require('./tree-view.engine.cjs');
5
5
 
6
6
  "use strict";
7
+ var __defProp = Object.defineProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __publicField = (obj, key, value) => {
10
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
11
+ return value;
12
+ };
7
13
  class PickupTreeViewEngine extends treeView_engine.TreeViewEngine {
14
+ constructor() {
15
+ super(...arguments);
16
+ /**
17
+ * 选中数据
18
+ *
19
+ * @type {IData[]}
20
+ * @memberof PickupViewEngine
21
+ */
22
+ __publicField(this, "selectData", []);
23
+ }
8
24
  /**
9
25
  * 创建完成
10
26
  *
@@ -18,6 +34,41 @@ class PickupTreeViewEngine extends treeView_engine.TreeViewEngine {
18
34
  this.view.slotProps.tree = {};
19
35
  }
20
36
  this.view.slotProps.tree.singleSelect = this.view.state.singleSelect;
37
+ if (this.view.state.selectedData) {
38
+ this.selectData = this.view.state.selectedData.map((item) => {
39
+ return {
40
+ ...item,
41
+ _id: item.srfnodeid
42
+ };
43
+ });
44
+ const set = /* @__PURE__ */ new Set();
45
+ this.selectData.forEach((item) => {
46
+ if (item.srfnodeid) {
47
+ const keys = this.calcExpandKeys(item.srfnodeid);
48
+ keys.forEach((key) => set.add(key));
49
+ }
50
+ });
51
+ this.view.slotProps.tree.defaultExpandedKeys = Array.from(set);
52
+ }
53
+ }
54
+ /**
55
+ * 根据key计算需要展开的节点标识
56
+ * @author lxm
57
+ * @date 2023-11-07 02:42:45
58
+ * @param {string} key
59
+ * @return {*} {string[]}
60
+ */
61
+ calcExpandKeys(key) {
62
+ const expandedKeys = [];
63
+ key.split(":").forEach((item, index) => {
64
+ if (index === 0) {
65
+ expandedKeys.push(item);
66
+ } else {
67
+ expandedKeys.push("".concat(expandedKeys[index - 1], ":").concat(item));
68
+ }
69
+ });
70
+ expandedKeys.pop();
71
+ return expandedKeys;
21
72
  }
22
73
  /**
23
74
  * 挂载完成
@@ -28,15 +79,21 @@ class PickupTreeViewEngine extends treeView_engine.TreeViewEngine {
28
79
  */
29
80
  async onMounted() {
30
81
  const { model } = this.view;
82
+ let forbiddenSelectionChange = false;
31
83
  this.xdataControl.evt.on("onSelectionChange", async (event) => {
32
- if (event.data[0] && event.data[0] instanceof runtime.TreeDataSetNodeData) {
33
- event.data[0] = event.data[0]._deData;
84
+ if (forbiddenSelectionChange) {
85
+ return;
34
86
  }
35
87
  this.view.evt.emit("onSelectionChange", { ...event });
36
88
  });
37
89
  this.xdataControl.evt.on("onActive", async (event) => {
38
90
  this.view.evt.emit("onDataActive", { ...event });
39
91
  });
92
+ this.xdataControl.evt.on("onLoadSuccess", () => {
93
+ forbiddenSelectionChange = true;
94
+ this.xdataControl.setSelection(this.selectData);
95
+ forbiddenSelectionChange = false;
96
+ });
40
97
  if (!this.view.state.noLoadDefault && model.loadDefault) {
41
98
  this.load();
42
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/vue3-components",
3
- "version": "0.6.0-alpha.3",
3
+ "version": "0.6.0",
4
4
  "description": "使用 rollup 编译 vue 组件或者 jsx",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.mjs",
@@ -27,12 +27,12 @@
27
27
  "@floating-ui/dom": "^1.5.3",
28
28
  "@ibiz-template-plugin/ai-chat": "^0.0.1",
29
29
  "@ibiz-template-plugin/gantt": "0.1.1",
30
- "@ibiz-template/core": "^0.5.7-alpha.10",
31
- "@ibiz-template/devtool": "0.0.1-dev.3",
32
- "@ibiz-template/model-helper": "^0.6.0-alpha.3",
33
- "@ibiz-template/runtime": "^0.6.0-alpha.3",
30
+ "@ibiz-template/core": "^0.6.0",
31
+ "@ibiz-template/devtool": "0.0.1-alpha.0",
32
+ "@ibiz-template/model-helper": "^0.6.0",
33
+ "@ibiz-template/runtime": "^0.6.0",
34
34
  "@ibiz-template/theme": "^0.5.0",
35
- "@ibiz-template/vue3-util": "^0.6.0-alpha.3",
35
+ "@ibiz-template/vue3-util": "^0.6.0",
36
36
  "@ibiz-template/web-theme": "^1.1.8",
37
37
  "@ibiz/model-core": "^0.1.11",
38
38
  "@imengyu/vue3-context-menu": "^1.3.5",