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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/index-wFXNmg_E.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-HHmyYumg.js} +1 -1
  5. package/es/common/data-import2/data-import2.mjs +3 -1
  6. package/es/control/drbar/drbar.controller.mjs +3 -0
  7. package/es/control/form/form-detail/form-item/form-item.mjs +1 -0
  8. package/es/control/tab-exp-panel/tab-exp-panel.mjs +9 -21
  9. package/es/control/toolbar/toolbar.mjs +1 -0
  10. package/es/control/tree/tree.css +1 -1
  11. package/es/control/tree/tree.mjs +5 -3
  12. package/es/control/tree-grid-ex/index.d.ts +1 -0
  13. package/es/control/tree-grid-ex/tree-grid-ex.d.ts +1 -0
  14. package/es/control/tree-grid-ex/tree-grid-ex.mjs +8 -0
  15. package/es/editor/color-picker/ibiz-color-picker/ibiz-color-picker.d.ts +1 -0
  16. package/es/editor/color-picker/ibiz-color-picker/ibiz-color-picker.mjs +5 -1
  17. package/es/editor/data-picker/ibiz-picker/ibiz-picker.mjs +2 -2
  18. package/es/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.mjs +1 -1
  19. package/es/editor/span/span/span.css +1 -1
  20. package/es/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.provider.mjs +3 -17
  21. package/es/util/app-modal/app-modal-component.d.ts +0 -1
  22. package/es/util/app-modal/app-modal-component.mjs +3 -9
  23. package/es/view-engine/edit-view.engine.d.ts +7 -0
  24. package/es/view-engine/edit-view.engine.mjs +87 -37
  25. package/lib/common/data-import2/data-import2.cjs +3 -1
  26. package/lib/control/drbar/drbar.controller.cjs +3 -0
  27. package/lib/control/form/form-detail/form-item/form-item.cjs +1 -0
  28. package/lib/control/tab-exp-panel/tab-exp-panel.cjs +8 -20
  29. package/lib/control/toolbar/toolbar.cjs +1 -0
  30. package/lib/control/tree/tree.cjs +5 -3
  31. package/lib/control/tree/tree.css +1 -1
  32. package/lib/control/tree-grid-ex/tree-grid-ex.cjs +8 -0
  33. package/lib/editor/color-picker/ibiz-color-picker/ibiz-color-picker.cjs +5 -1
  34. package/lib/editor/data-picker/ibiz-picker/ibiz-picker.cjs +1 -1
  35. package/lib/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.cjs +1 -1
  36. package/lib/editor/span/span/span.css +1 -1
  37. package/lib/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.provider.cjs +2 -16
  38. package/lib/util/app-modal/app-modal-component.cjs +3 -9
  39. package/lib/view-engine/edit-view.engine.cjs +87 -37
  40. package/package.json +5 -5
  41. package/dist/index-YUUYgkW-.js +0 -4
@@ -5,6 +5,7 @@ var vue3Util = require('@ibiz-template/vue3-util');
5
5
  var runtime = require('@ibiz-template/runtime');
6
6
  require('./tree-grid-ex.css');
7
7
  var core = require('@ibiz-template/core');
8
+ var qxUtil = require('qx-util');
8
9
  var useRowEditPopover = require('./use-row-edit-popover.cjs');
9
10
 
10
11
  "use strict";
@@ -66,6 +67,7 @@ const TreeGridExControl = /* @__PURE__ */ vue.defineComponent({
66
67
  return temp;
67
68
  });
68
69
  };
70
+ const tableRefreshKey = vue.ref(qxUtil.createUUID());
69
71
  const treeRootData = vue.computed(() => {
70
72
  if (!c.state.isLoaded) {
71
73
  return [];
@@ -78,11 +80,15 @@ const TreeGridExControl = /* @__PURE__ */ vue.defineComponent({
78
80
  }, []);
79
81
  });
80
82
  const elTableData = vue.computed(() => {
83
+ tableRefreshKey.value = qxUtil.createUUID();
81
84
  if (treeRootData.value.length === 0) {
82
85
  return [];
83
86
  }
84
87
  return toElNodes(treeRootData.value, true);
85
88
  });
89
+ c.evt.on("onAfterRefreshParent", () => {
90
+ tableRefreshKey.value = qxUtil.createUUID();
91
+ });
86
92
  const loadData = async (item, treeNode, callback) => {
87
93
  let nodes;
88
94
  const nodeData = c.getNodeData(item.id);
@@ -157,6 +163,7 @@ const TreeGridExControl = /* @__PURE__ */ vue.defineComponent({
157
163
  tableRef,
158
164
  elTableData,
159
165
  renderColumns,
166
+ tableRefreshKey,
160
167
  renderNoData,
161
168
  loadData,
162
169
  onRowClick,
@@ -209,6 +216,7 @@ const TreeGridExControl = /* @__PURE__ */ vue.defineComponent({
209
216
  }, {
210
217
  default: () => [this.c.state.isLoaded && vue.createVNode(vue.resolveComponent("el-table"), {
211
218
  "ref": "tableRef",
219
+ "key": this.tableRefreshKey,
212
220
  "class": this.ns.e("table"),
213
221
  "border": true,
214
222
  "row-key": "id",
@@ -16,6 +16,7 @@ const IBizColorPicker = /* @__PURE__ */ vue.defineComponent({
16
16
  const c = props.controller;
17
17
  const currentVal = vue.ref("");
18
18
  const colorPicker = vue.ref(null);
19
+ const predefineColors = vue.ref(["#000000", "#2C2C2C", "#50555C", "#ACB3BF", "#D0D3D9", "#C4C4C4", "#DADADA", "#E5E5E5", "#F0F0F0", "#F24E1E", "#E99C58", "#FFC700", "#FF4D00", "#FF00D6", "#D82E57", "#8E1DE8", "#0ACF83", "#18A0FB", "#A259FF", "#907CFF"]);
19
20
  const showFormDefaultContent = vue.computed(() => {
20
21
  if (props.controlParams && props.controlParams.editmode === "hover") {
21
22
  return true;
@@ -59,6 +60,7 @@ const IBizColorPicker = /* @__PURE__ */ vue.defineComponent({
59
60
  ns,
60
61
  c,
61
62
  currentVal,
63
+ predefineColors,
62
64
  contentStyle,
63
65
  colorPicker,
64
66
  handleChange,
@@ -85,7 +87,9 @@ const IBizColorPicker = /* @__PURE__ */ vue.defineComponent({
85
87
  "onChange": this.handleChange,
86
88
  "onBlur": this.onBlur,
87
89
  "onFocus": this.onFocus,
88
- "size": "small"
90
+ "size": "small",
91
+ "predefine": this.predefineColors,
92
+ "show-alpha": true
89
93
  }, null), vue.createVNode("span", {
90
94
  "class": this.ns.b("text")
91
95
  }, [this.currentVal])]);
@@ -163,7 +163,7 @@ const IBizPicker = /* @__PURE__ */ vue.defineComponent({
163
163
  vue.onMounted(() => {
164
164
  vue.watch(() => props.data[c.valueItem], async (newVal, oldVal) => {
165
165
  if (newVal !== oldVal) {
166
- if (!isLoaded.value && editorRef.value) {
166
+ if (!isLoaded.value && editorRef.value && ramda.isNil(props.value)) {
167
167
  await onSearch("");
168
168
  }
169
169
  const curItem = items.value.find((item) => Object.is(item[c.keyName], newVal));
@@ -91,7 +91,7 @@ const IBizPickerDropDown = /* @__PURE__ */ vue.defineComponent({
91
91
  vue.onMounted(() => {
92
92
  vue.watch(() => props.data[c.valueItem], async (newVal, oldVal) => {
93
93
  if (newVal !== oldVal) {
94
- if (!isLoaded.value && editorRef.value) {
94
+ if (!isLoaded.value && editorRef.value && ramda.isNil(props.value)) {
95
95
  shouldLoad.value = true;
96
96
  await onSearch("");
97
97
  }
@@ -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
 
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-alpha.4",
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",
30
+ "@ibiz-template/core": "^0.6.0-alpha.4",
31
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",
32
+ "@ibiz-template/model-helper": "^0.6.0-alpha.4",
33
+ "@ibiz-template/runtime": "^0.6.0-alpha.4",
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-alpha.4",
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",