@ibiz-template/vue3-components 0.7.41-alpha.55 → 0.7.41-alpha.57

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 (43) hide show
  1. package/dist/{index-B7VRgnNY.js → index-CGlkTyaF.js} +1 -1
  2. package/dist/{index-DTdGRmFc.js → index-CkCK0iHH.js} +1 -1
  3. package/dist/index-QscInrTW.js +11 -0
  4. package/dist/index.min.css +1 -1
  5. package/dist/index.system.min.js +1 -1
  6. package/dist/{wang-editor-dy_UWMYO.js → wang-editor-w-EiarfV.js} +1 -1
  7. package/dist/{xlsx-util-BAhkwxNf.js → xlsx-util-B-cFlAOU.js} +1 -1
  8. package/es/control/drtab/drtab-control.util.mjs +1 -1
  9. package/es/control/form/form-detail/form-item/form-item.mjs +12 -3
  10. package/es/index.mjs +1 -0
  11. package/es/locale/en/index.mjs +3 -0
  12. package/es/locale/zh-CN/index.mjs +3 -0
  13. package/es/panel-component/user-message/internal-message/common/internal-message-container/internal-message-container.mjs +5 -1
  14. package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.mjs +7 -3
  15. package/es/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.mjs +15 -1
  16. package/es/util/ai-chat-util/ai-chat-util.mjs +42 -2
  17. package/es/util/fullscreen/fullscreen-util.mjs +1 -1
  18. package/es/util/index.mjs +1 -0
  19. package/es/util/print-preview-util/print-preview-markdown/icon/icon.mjs +46 -0
  20. package/es/util/print-preview-util/print-preview-markdown/print-preview-markdown.css +1 -0
  21. package/es/util/print-preview-util/print-preview-markdown/print-preview-markdown.mjs +75 -0
  22. package/es/util/print-preview-util/print-preview-util.mjs +57 -0
  23. package/es/web-app/main.mjs +2 -0
  24. package/lib/control/drtab/drtab-control.util.cjs +1 -1
  25. package/lib/control/form/form-detail/form-item/form-item.cjs +11 -2
  26. package/lib/index.cjs +2 -0
  27. package/lib/locale/en/index.cjs +3 -0
  28. package/lib/locale/zh-CN/index.cjs +3 -0
  29. package/lib/panel-component/user-message/internal-message/common/internal-message-container/internal-message-container.cjs +5 -1
  30. package/lib/panel-component/user-message/internal-message/internal-message-json/internal-message-json.cjs +7 -3
  31. package/lib/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.cjs +15 -1
  32. package/lib/util/ai-chat-util/ai-chat-util.cjs +42 -2
  33. package/lib/util/fullscreen/fullscreen-util.cjs +1 -1
  34. package/lib/util/index.cjs +2 -0
  35. package/lib/util/print-preview-util/print-preview-markdown/icon/icon.cjs +52 -0
  36. package/lib/util/print-preview-util/print-preview-markdown/print-preview-markdown.cjs +77 -0
  37. package/lib/util/print-preview-util/print-preview-markdown/print-preview-markdown.css +1 -0
  38. package/lib/util/print-preview-util/print-preview-util.cjs +59 -0
  39. package/lib/web-app/main.cjs +2 -0
  40. package/package.json +10 -10
  41. package/dist/index-BZxlkb5k.js +0 -11
  42. /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.53_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.60_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs +0 -0
  43. /package/lib/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.53_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.60_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs +0 -0
@@ -1,5 +1,5 @@
1
1
  import { ref, watch, watchEffect, onUnmounted } from 'vue';
2
- import { defaultNamespace } from '../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.53_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs';
2
+ import { defaultNamespace } from '../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.60_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs';
3
3
 
4
4
  "use strict";
5
5
  function useAppDRTab(c, controlRef, counterData) {
@@ -1,5 +1,5 @@
1
1
  import { isVNode, defineComponent, createVNode, createTextVNode, resolveComponent, h } from 'vue';
2
- import { useNamespace } from '@ibiz-template/vue3-util';
2
+ import { useNamespace, computedAsync } from '@ibiz-template/vue3-util';
3
3
  import { CompositeFormItem } from './composite-form-item/composite-form-item.mjs';
4
4
  import './form-item.css';
5
5
 
@@ -29,17 +29,21 @@ const FormItem = /* @__PURE__ */ defineComponent({
29
29
  const onValueChange = (val, name, ignore = false) => {
30
30
  props.controller.setDataValue(val, name, ignore);
31
31
  };
32
+ const CustomHtml = computedAsync(async () => {
33
+ const html = await props.controller.getCustomHtml(props.controller.data);
34
+ return html;
35
+ });
32
36
  return {
33
37
  ns,
34
38
  c,
39
+ CustomHtml,
35
40
  onValueChange
36
41
  };
37
42
  },
38
43
  render() {
39
44
  var _a, _b, _c, _d, _e;
40
- if (!this.c.state.visible || ((_a = this.c.model.editor) == null ? void 0 : _a.editorType) === "HIDDEN") {
45
+ if (!this.c.state.visible || ((_a = this.c.model.editor) == null ? void 0 : _a.editorType) === "HIDDEN")
41
46
  return null;
42
- }
43
47
  let editor = null;
44
48
  const compositeItem = this.c.model.compositeItem;
45
49
  if (compositeItem) {
@@ -94,6 +98,11 @@ const FormItem = /* @__PURE__ */ defineComponent({
94
98
  }, null);
95
99
  }
96
100
  }
101
+ if (this.c.isCustomCode)
102
+ return createVNode("div", {
103
+ "class": [this.ns.b(), this.ns.e("script"), this.ns.m(this.modelData.id), this.ns.is("compositeItem", compositeItem), ...this.c.containerClass],
104
+ "innerHTML": this.CustomHtml
105
+ }, null);
97
106
  return createVNode(resolveComponent("iBizFormItemContainer"), {
98
107
  "id": "".concat(this.c.form.view.model.codeName, "_").concat(this.c.form.model.codeName, "_").concat(this.modelData.codeName),
99
108
  "class": [this.ns.b(), this.ns.m(this.modelData.id), this.ns.is("compositeItem", compositeItem), ...this.c.containerClass],
package/es/index.mjs CHANGED
@@ -183,6 +183,7 @@ export { InLineAIUtil } from './util/inline-ai-util/inline-ai-util.mjs';
183
183
  export { AIChatUtil } from './util/ai-chat-util/ai-chat-util.mjs';
184
184
  export { ScreenShotUtil } from './util/screen-shot-util/screen-shot-util.mjs';
185
185
  export { splitPathToSegments, validateRouteSegments } from './util/user-route-util/user-route-util.mjs';
186
+ export { PrintPreviewUtil } from './util/print-preview-util/print-preview-util.mjs';
186
187
  export { parseHtml } from './util/wang-editor-util/wang-editor-util.mjs';
187
188
  export { ArrowLeftBold, ArrowRightBold } from './util/icon/icon.mjs';
188
189
  export { AuthGuard } from './web-app/guard/auth-guard/auth-guard.mjs';
@@ -893,6 +893,9 @@ var index = {
893
893
  text: "Text",
894
894
  arrow: "Arrow",
895
895
  drawdown: "Drawdown"
896
+ },
897
+ printPreviewUtil: {
898
+ title: "Print Preview"
896
899
  }
897
900
  },
898
901
  // runTime
@@ -889,6 +889,9 @@ var index = {
889
889
  text: "\u6587\u672C\u6CE8\u91CA",
890
890
  arrow: "\u7BAD\u5934",
891
891
  drawdown: "\u56DE\u64A4"
892
+ },
893
+ printPreviewUtil: {
894
+ title: "\u6253\u5370\u9884\u89C8"
892
895
  }
893
896
  },
894
897
  // runTime
@@ -19,6 +19,10 @@ const InternalMessageContainer = /* @__PURE__ */ defineComponent({
19
19
  type: Boolean,
20
20
  default: void 0
21
21
  },
22
+ isUnread: {
23
+ type: Boolean,
24
+ default: true
25
+ },
22
26
  toolbarItems: {
23
27
  type: Array,
24
28
  default: () => []
@@ -34,7 +38,7 @@ const InternalMessageContainer = /* @__PURE__ */ defineComponent({
34
38
  }) {
35
39
  const ns = useNamespace("internal-message-container");
36
40
  const isUnread = computed(() => {
37
- return props.message.status === "RECEIVED";
41
+ return props.isUnread && props.message.status === "RECEIVED";
38
42
  });
39
43
  const finalToolbarItems = computed(() => {
40
44
  const toolbarItems = [...props.toolbarItems];
@@ -34,8 +34,11 @@ const InternalMessageJSON = /* @__PURE__ */ defineComponent({
34
34
  });
35
35
  const redirectUrl = computed(() => {
36
36
  var _a;
37
- const url = ibiz.env.isMob ? props.message.mobile_url : props.message.url;
38
- return url || ((_a = jsonContent.value) == null ? void 0 : _a.redirecturl);
37
+ if (props.message.enableLink) {
38
+ const url = ibiz.env.isMob ? props.message.mobile_url : props.message.url;
39
+ return url || ((_a = jsonContent.value) == null ? void 0 : _a.redirecturl);
40
+ }
41
+ return void 0;
39
42
  });
40
43
  const isWFMessage = computed(() => {
41
44
  var _a;
@@ -117,7 +120,8 @@ const InternalMessageJSON = /* @__PURE__ */ defineComponent({
117
120
  "class": [this.ns.b()],
118
121
  "message": this.message,
119
122
  "provider": this.provider,
120
- "clickable": !!this.redirectUrl || !!this.isWFMessage,
123
+ "clickable": !!this.redirectUrl || !!this.isWFMessage && !!this.message.enableLink,
124
+ "isUnread": !!this.message.enableLink,
121
125
  "toolbarItems": this.toolbarItems,
122
126
  "onToolbarClick": this.onToolbarClick,
123
127
  "onRead": () => this.$emit("read"),
@@ -99,9 +99,23 @@ const InternalMessageTab = /* @__PURE__ */ defineComponent({
99
99
  finalResult.push(parent);
100
100
  }
101
101
  });
102
- messages.value = finalResult.sort((a, b) => {
102
+ finalResult.sort((a, b) => {
103
103
  return dayjs(a.update_time).isAfter(b.update_time) ? -1 : 1;
104
104
  });
105
+ const todoNotifySeen = /* @__PURE__ */ new Set();
106
+ finalResult.filter((msg) => msg.message_type === "TodoNotify" && msg.content_type === "JSON").forEach((msg) => {
107
+ try {
108
+ const data = JSON.parse(msg.content);
109
+ const key = "".concat(data.bizkey, "_").concat(data.param02);
110
+ if (data.todoid && !todoNotifySeen.has(key)) {
111
+ msg.enableLink = true;
112
+ todoNotifySeen.add(key);
113
+ }
114
+ } catch (error) {
115
+ ibiz.log.error(error);
116
+ }
117
+ });
118
+ messages.value = finalResult;
105
119
  };
106
120
  const updateData = () => {
107
121
  state.total = c.total;
@@ -286,8 +286,28 @@ class AIChatUtil {
286
286
  }
287
287
  return null;
288
288
  };
289
+ chatOptions.chatDigest = async (ctx, param, other) => {
290
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
291
+ const tempParams = { ...param };
292
+ if (other.srfaiagent) {
293
+ tempParams.srfaiagent = other.srfaiagent;
294
+ }
295
+ const result = await deService.aiChatChatDigest(
296
+ ctx,
297
+ tempParams,
298
+ other.message
299
+ );
300
+ if (result.ok && result.data) {
301
+ const choices = result.data.choices;
302
+ if (choices && choices.length > 0) {
303
+ return choices[0];
304
+ }
305
+ return null;
306
+ }
307
+ return null;
308
+ };
289
309
  const app = ibiz.hub.getApp(context.srfappid);
290
- const folder = app.model.defaultOSSCat || ((_a = app.model.userParam) == null ? void 0 : _a.DefaultOSSCat);
310
+ const folder = ibiz.env.defaultOSSCat || app.model.defaultOSSCat || ((_a = app.model.userParam) == null ? void 0 : _a.DefaultOSSCat);
291
311
  let globalDownloadPrifix = false;
292
312
  if (editorParams.globaldownloadprifix) {
293
313
  globalDownloadPrifix = editorParams.globaldownloadprifix === "true";
@@ -712,8 +732,28 @@ class AIChatUtil {
712
732
  }
713
733
  return null;
714
734
  };
735
+ chatOptions.chatDigest = async (ctx, param, other) => {
736
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
737
+ const tempParams = { ...param };
738
+ if (other.srfaiagent) {
739
+ tempParams.srfaiagent = other.srfaiagent;
740
+ }
741
+ const result = await deService.aiChatChatDigest(
742
+ ctx,
743
+ tempParams,
744
+ other.message
745
+ );
746
+ if (result.ok && result.data) {
747
+ const choices = result.data.choices;
748
+ if (choices && choices.length > 0) {
749
+ return choices[0];
750
+ }
751
+ return null;
752
+ }
753
+ return null;
754
+ };
715
755
  const app = ibiz.hub.getApp(context.srfappid);
716
- const folder = app.model.defaultOSSCat || ((_a = app.model.userParam) == null ? void 0 : _a.DefaultOSSCat);
756
+ const folder = ibiz.env.defaultOSSCat || app.model.defaultOSSCat || ((_a = app.model.userParam) == null ? void 0 : _a.DefaultOSSCat);
717
757
  let globalDownloadPrifix = false;
718
758
  if (params.hasOwnProperty("globaldownloadprifix")) {
719
759
  globalDownloadPrifix = params.globaldownloadprifix === "true";
@@ -1,6 +1,6 @@
1
1
  import { createApp } from 'vue';
2
2
  import ElementPlus from 'element-plus';
3
- import { defaultNamespace } from '../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.53_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs';
3
+ import { defaultNamespace } from '../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.60_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs';
4
4
  import { IBizFullscreenToolbar } from '../../common/fullscreen-toolbar/fullscreen-toolbar.mjs';
5
5
 
6
6
  "use strict";
package/es/util/index.mjs CHANGED
@@ -18,5 +18,6 @@ export { InLineAIUtil } from './inline-ai-util/inline-ai-util.mjs';
18
18
  export { AIChatUtil } from './ai-chat-util/ai-chat-util.mjs';
19
19
  export { ScreenShotUtil } from './screen-shot-util/screen-shot-util.mjs';
20
20
  export { splitPathToSegments, validateRouteSegments } from './user-route-util/user-route-util.mjs';
21
+ export { PrintPreviewUtil } from './print-preview-util/print-preview-util.mjs';
21
22
 
22
23
  "use strict";
@@ -0,0 +1,46 @@
1
+ import { createVNode } from 'vue';
2
+
3
+ "use strict";
4
+ const ArrowLeftBold = () => createVNode("svg", {
5
+ "data-v-9a20e128": "",
6
+ "xmlns": "http://www.w3.org/2000/svg",
7
+ "viewBox": "0 0 1024 1024",
8
+ "width": "1em",
9
+ "height": "1em"
10
+ }, [createVNode("path", {
11
+ "fill": "currentColor",
12
+ "d": "M685.248 104.704a64 64 0 0 1 0 90.496L368.448 512l316.8 316.8a64 64 0 0 1-90.496 90.496L232.704 557.248a64 64 0 0 1 0-90.496l362.048-362.048a64 64 0 0 1 90.496 0z"
13
+ }, null)]);
14
+ const ArrowRightBold = () => createVNode("svg", {
15
+ "data-v-9a20e128": "",
16
+ "xmlns": "http://www.w3.org/2000/svg",
17
+ "viewBox": "0 0 1024 1024",
18
+ "width": "1em",
19
+ "height": "1em"
20
+ }, [createVNode("path", {
21
+ "fill": "currentColor",
22
+ "d": "M338.752 104.704a64 64 0 0 0 0 90.496l316.8 316.8-316.8 316.8a64 64 0 0 0 90.496 90.496l362.048-362.048a64 64 0 0 0 0-90.496L429.248 104.704a64 64 0 0 0-90.496 0z"
23
+ }, null)]);
24
+ const FullScreenSvg = () => createVNode("svg", {
25
+ "viewBox": "0 0 1024 1024",
26
+ "version": "1.1",
27
+ "xmlns": "http://www.w3.org/2000/svg"
28
+ }, [createVNode("path", {
29
+ "d": "M547.4 197.4v46l200.3 0.1L546.1 444l32.4 32.6 201.9-200.7v200.9h46V197.5zM471.4 584.4l-32.6-32.6L243.6 747V547.9h-46v278.7h279v-46H275z"
30
+ }, null)]);
31
+ const CloseFullScreenSvg = () => createVNode("svg", {
32
+ "viewBox": "0 0 1024 1024",
33
+ "version": "1.1",
34
+ "xmlns": "http://www.w3.org/2000/svg"
35
+ }, [createVNode("path", {
36
+ "d": "M544 480V282.944h52.224l0.064 107.968L763.072 224l36.928 36.928-166.976 166.976 108.032-0.128V480H544zM260.928 800l-36.928-36.928 166.912-166.784-107.968-0.064V544H480v197.056h-52.224l0.064-107.968L260.928 800z"
37
+ }, null)]);
38
+ const CloseSvg = () => createVNode("svg", {
39
+ "viewBox": "0 0 1024 1024",
40
+ "version": "1.1",
41
+ "xmlns": "http://www.w3.org/2000/svg"
42
+ }, [createVNode("path", {
43
+ "d": "M843.904 783.573333 783.573333 843.904 512.042667 572.373333 240.512 843.904 180.181333 783.573333 451.712 512.042667 180.181333 240.512 240.512 180.181333 512.042667 451.712 783.573333 180.181333 843.904 240.512 572.373333 512.042667 843.904 783.573333Z"
44
+ }, null)]);
45
+
46
+ export { ArrowLeftBold, ArrowRightBold, CloseFullScreenSvg, CloseSvg, FullScreenSvg };
@@ -0,0 +1 @@
1
+ .ibiz-print-preview-markdown{display:flex;flex-direction:column;width:100%;height:100%;overflow:hidden}.ibiz-print-preview-markdown__header{display:flex;flex-shrink:0;gap:var(--ibiz-spacing-base);align-items:center;justify-content:space-between;padding:var(--ibiz-spacing-base)}.ibiz-print-preview-markdown__header--action{display:flex;flex-shrink:0;gap:var(--ibiz-spacing-base)}.ibiz-print-preview-markdown__header--caption{font-size:var(--ibiz-font-size-header-5)}.ibiz-print-preview-markdown__header--full{cursor:pointer}.ibiz-print-preview-markdown__header--full svg{width:var(--ibiz-spacing-base-loose);height:var(--ibiz-spacing-base-loose)}.ibiz-print-preview-markdown__header--close{cursor:pointer}.ibiz-print-preview-markdown__header--close svg{width:var(--ibiz-spacing-base-loose);height:var(--ibiz-spacing-base-loose)}.ibiz-print-preview-markdown__content{flex:1;padding:16px;overflow:auto;border-top:1px solid var(--ibiz-color-border)}.ibiz-print-preview-markdown__content>.ibiz-markdown{height:100%}.ibiz-print-preview-markdown__content>.ibiz-markdown .ibiz-markdown-cherry .cherry{border:none}.ibiz-print-preview-markdown__content>.ibiz-markdown .ibiz-markdown-cherry .cherry .cherry-previewer{border:none}
@@ -0,0 +1,75 @@
1
+ import { defineComponent, createVNode, ref, resolveComponent, h } from 'vue';
2
+ import { useNamespace } from '@ibiz-template/vue3-util';
3
+ import { CloseFullScreenSvg, FullScreenSvg, CloseSvg } from './icon/icon.mjs';
4
+ import './print-preview-markdown.css';
5
+
6
+ "use strict";
7
+ const PrintPreviewMarkdown = /* @__PURE__ */ defineComponent({
8
+ name: "PrintPreviewMarkdown",
9
+ props: {
10
+ modal: {
11
+ type: Object,
12
+ required: true
13
+ },
14
+ value: {
15
+ type: String,
16
+ default: ""
17
+ }
18
+ },
19
+ setup(props) {
20
+ const ns = useNamespace("print-preview-markdown");
21
+ const printPreview = ref();
22
+ const isFull = ref(false);
23
+ const switchFull = () => {
24
+ if (isFull.value) {
25
+ ibiz.fullscreenUtil.closeElementFullscreen();
26
+ } else {
27
+ ibiz.fullscreenUtil.openElementFullscreen(printPreview.value);
28
+ }
29
+ isFull.value = !isFull.value;
30
+ };
31
+ const onClose = () => {
32
+ props.modal.dismiss();
33
+ };
34
+ const renderHeader = () => {
35
+ return createVNode("div", {
36
+ "class": ns.e("header")
37
+ }, [createVNode("div", {
38
+ "class": ns.em("header", "caption")
39
+ }, [ibiz.i18n.t("util.printPreviewUtil.title")]), createVNode("div", {
40
+ "class": ns.em("header", "action")
41
+ }, [createVNode("div", {
42
+ "class": ns.em("header", "full"),
43
+ "onClick": switchFull,
44
+ "title": ibiz.i18n.t(isFull.value ? "app.cancelFullscreen" : "app.fullscreen")
45
+ }, [isFull.value ? createVNode(CloseFullScreenSvg, null, null) : createVNode(FullScreenSvg, null, null)]), isFull.value && createVNode("div", {
46
+ "class": ns.em("header", "close"),
47
+ "onClick": onClose,
48
+ "title": ibiz.i18n.t("app.close")
49
+ }, [createVNode(CloseSvg, null, null)])])]);
50
+ };
51
+ const renderContent = () => {
52
+ const markdown = resolveComponent("IBizMarkDown");
53
+ return createVNode("div", {
54
+ "class": ns.e("content")
55
+ }, [h(markdown, {
56
+ value: props.value,
57
+ readonly: true
58
+ })]);
59
+ };
60
+ return {
61
+ ns,
62
+ printPreview,
63
+ renderHeader,
64
+ renderContent
65
+ };
66
+ },
67
+ render() {
68
+ return createVNode("div", {
69
+ "class": this.ns.b(),
70
+ "ref": "printPreview"
71
+ }, [this.renderHeader(), this.renderContent()]);
72
+ }
73
+ });
74
+
75
+ export { PrintPreviewMarkdown };
@@ -0,0 +1,57 @@
1
+ import { h } from 'vue';
2
+ import { PrintPreviewMarkdown } from './print-preview-markdown/print-preview-markdown.mjs';
3
+
4
+ "use strict";
5
+ class PrintPreviewUtil {
6
+ /**
7
+ * 执行打印
8
+ * @param context
9
+ * @param params
10
+ * @param data
11
+ * @returns boolean 是否成功执行打印
12
+ */
13
+ async execPrint(context, params, data) {
14
+ const srfcontenttype = params.srfcontenttype;
15
+ if (srfcontenttype === "MARKDOWN") {
16
+ return this.printMarkDown(data, params);
17
+ }
18
+ if (srfcontenttype === "HTML") {
19
+ return this.printHtml(data);
20
+ }
21
+ return false;
22
+ }
23
+ /**
24
+ * 打印MarkDown(窗口可以由视图参数srfprintheight和srfprintwidth指定,默认居中50%,绘制时为md预览模式绘制,提供全屏按钮,和关闭按钮。)
25
+ * @param data
26
+ * @returns
27
+ */
28
+ async printMarkDown(data, params) {
29
+ const text = await data.text();
30
+ const overlay = ibiz.overlay.createModal(
31
+ (modal) => h(PrintPreviewMarkdown, {
32
+ value: text,
33
+ modal
34
+ }),
35
+ void 0,
36
+ {
37
+ width: params.srfprintwidth || "50%",
38
+ height: params.srfprintheight || "50%"
39
+ }
40
+ );
41
+ overlay.present();
42
+ await overlay.onWillDismiss();
43
+ return true;
44
+ }
45
+ /**
46
+ * 打印HTML(原生浏览器预览)
47
+ * @param data
48
+ * @returns
49
+ */
50
+ async printHtml(data) {
51
+ const link = window.URL.createObjectURL(data);
52
+ window.open(link, "_blank");
53
+ return true;
54
+ }
55
+ }
56
+
57
+ export { PrintPreviewUtil };
@@ -24,6 +24,7 @@ import { OverlayController } from '../util/overlay-controller/overlay-controller
24
24
  import { InLineAIUtil } from '../util/inline-ai-util/inline-ai-util.mjs';
25
25
  import { ScreenShotUtil } from '../util/screen-shot-util/screen-shot-util.mjs';
26
26
  import { AIChatUtil } from '../util/ai-chat-util/ai-chat-util.mjs';
27
+ import { PrintPreviewUtil } from '../util/print-preview-util/print-preview-util.mjs';
27
28
  import { FullscreenUtil } from '../util/fullscreen/fullscreen-util.mjs';
28
29
 
29
30
  "use strict";
@@ -90,6 +91,7 @@ async function runApp(plugins, opts) {
90
91
  ibiz.util.text.format = (value, code) => {
91
92
  return app.config.globalProperties.$textFormat(value, code);
92
93
  };
94
+ ibiz.printPreview = new PrintPreviewUtil();
93
95
  ibiz.fullscreenUtil = new FullscreenUtil();
94
96
  await ibiz.i18n.init();
95
97
  app.mount("#app");
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var vue = require('vue');
4
- var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.53_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs');
4
+ var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.60_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs');
5
5
 
6
6
  "use strict";
7
7
  function useAppDRTab(c, controlRef, counterData) {
@@ -33,17 +33,21 @@ const FormItem = /* @__PURE__ */ vue.defineComponent({
33
33
  const onValueChange = (val, name, ignore = false) => {
34
34
  props.controller.setDataValue(val, name, ignore);
35
35
  };
36
+ const CustomHtml = vue3Util.computedAsync(async () => {
37
+ const html = await props.controller.getCustomHtml(props.controller.data);
38
+ return html;
39
+ });
36
40
  return {
37
41
  ns,
38
42
  c,
43
+ CustomHtml,
39
44
  onValueChange
40
45
  };
41
46
  },
42
47
  render() {
43
48
  var _a, _b, _c, _d, _e;
44
- if (!this.c.state.visible || ((_a = this.c.model.editor) == null ? void 0 : _a.editorType) === "HIDDEN") {
49
+ if (!this.c.state.visible || ((_a = this.c.model.editor) == null ? void 0 : _a.editorType) === "HIDDEN")
45
50
  return null;
46
- }
47
51
  let editor = null;
48
52
  const compositeItem = this.c.model.compositeItem;
49
53
  if (compositeItem) {
@@ -98,6 +102,11 @@ const FormItem = /* @__PURE__ */ vue.defineComponent({
98
102
  }, null);
99
103
  }
100
104
  }
105
+ if (this.c.isCustomCode)
106
+ return vue.createVNode("div", {
107
+ "class": [this.ns.b(), this.ns.e("script"), this.ns.m(this.modelData.id), this.ns.is("compositeItem", compositeItem), ...this.c.containerClass],
108
+ "innerHTML": this.CustomHtml
109
+ }, null);
101
110
  return vue.createVNode(vue.resolveComponent("iBizFormItemContainer"), {
102
111
  "id": "".concat(this.c.form.view.model.codeName, "_").concat(this.c.form.model.codeName, "_").concat(this.modelData.codeName),
103
112
  "class": [this.ns.b(), this.ns.m(this.modelData.id), this.ns.is("compositeItem", compositeItem), ...this.c.containerClass],
package/lib/index.cjs CHANGED
@@ -185,6 +185,7 @@ var inlineAiUtil = require('./util/inline-ai-util/inline-ai-util.cjs');
185
185
  var aiChatUtil = require('./util/ai-chat-util/ai-chat-util.cjs');
186
186
  var screenShotUtil = require('./util/screen-shot-util/screen-shot-util.cjs');
187
187
  var userRouteUtil = require('./util/user-route-util/user-route-util.cjs');
188
+ var printPreviewUtil = require('./util/print-preview-util/print-preview-util.cjs');
188
189
  var wangEditorUtil = require('./util/wang-editor-util/wang-editor-util.cjs');
189
190
  var icon = require('./util/icon/icon.cjs');
190
191
  var authGuard = require('./web-app/guard/auth-guard/auth-guard.cjs');
@@ -379,6 +380,7 @@ exports.AIChatUtil = aiChatUtil.AIChatUtil;
379
380
  exports.ScreenShotUtil = screenShotUtil.ScreenShotUtil;
380
381
  exports.splitPathToSegments = userRouteUtil.splitPathToSegments;
381
382
  exports.validateRouteSegments = userRouteUtil.validateRouteSegments;
383
+ exports.PrintPreviewUtil = printPreviewUtil.PrintPreviewUtil;
382
384
  exports.parseHtml = wangEditorUtil.parseHtml;
383
385
  exports.ArrowLeftBold = icon.ArrowLeftBold;
384
386
  exports.ArrowRightBold = icon.ArrowRightBold;
@@ -897,6 +897,9 @@ var index = {
897
897
  text: "Text",
898
898
  arrow: "Arrow",
899
899
  drawdown: "Drawdown"
900
+ },
901
+ printPreviewUtil: {
902
+ title: "Print Preview"
900
903
  }
901
904
  },
902
905
  // runTime
@@ -893,6 +893,9 @@ var index = {
893
893
  text: "\u6587\u672C\u6CE8\u91CA",
894
894
  arrow: "\u7BAD\u5934",
895
895
  drawdown: "\u56DE\u64A4"
896
+ },
897
+ printPreviewUtil: {
898
+ title: "\u6253\u5370\u9884\u89C8"
896
899
  }
897
900
  },
898
901
  // runTime
@@ -21,6 +21,10 @@ const InternalMessageContainer = /* @__PURE__ */ vue.defineComponent({
21
21
  type: Boolean,
22
22
  default: void 0
23
23
  },
24
+ isUnread: {
25
+ type: Boolean,
26
+ default: true
27
+ },
24
28
  toolbarItems: {
25
29
  type: Array,
26
30
  default: () => []
@@ -36,7 +40,7 @@ const InternalMessageContainer = /* @__PURE__ */ vue.defineComponent({
36
40
  }) {
37
41
  const ns = vue3Util.useNamespace("internal-message-container");
38
42
  const isUnread = vue.computed(() => {
39
- return props.message.status === "RECEIVED";
43
+ return props.isUnread && props.message.status === "RECEIVED";
40
44
  });
41
45
  const finalToolbarItems = vue.computed(() => {
42
46
  const toolbarItems = [...props.toolbarItems];
@@ -36,8 +36,11 @@ const InternalMessageJSON = /* @__PURE__ */ vue.defineComponent({
36
36
  });
37
37
  const redirectUrl = vue.computed(() => {
38
38
  var _a;
39
- const url = ibiz.env.isMob ? props.message.mobile_url : props.message.url;
40
- return url || ((_a = jsonContent.value) == null ? void 0 : _a.redirecturl);
39
+ if (props.message.enableLink) {
40
+ const url = ibiz.env.isMob ? props.message.mobile_url : props.message.url;
41
+ return url || ((_a = jsonContent.value) == null ? void 0 : _a.redirecturl);
42
+ }
43
+ return void 0;
41
44
  });
42
45
  const isWFMessage = vue.computed(() => {
43
46
  var _a;
@@ -119,7 +122,8 @@ const InternalMessageJSON = /* @__PURE__ */ vue.defineComponent({
119
122
  "class": [this.ns.b()],
120
123
  "message": this.message,
121
124
  "provider": this.provider,
122
- "clickable": !!this.redirectUrl || !!this.isWFMessage,
125
+ "clickable": !!this.redirectUrl || !!this.isWFMessage && !!this.message.enableLink,
126
+ "isUnread": !!this.message.enableLink,
123
127
  "toolbarItems": this.toolbarItems,
124
128
  "onToolbarClick": this.onToolbarClick,
125
129
  "onRead": () => this.$emit("read"),
@@ -101,9 +101,23 @@ const InternalMessageTab = /* @__PURE__ */ vue.defineComponent({
101
101
  finalResult.push(parent);
102
102
  }
103
103
  });
104
- messages.value = finalResult.sort((a, b) => {
104
+ finalResult.sort((a, b) => {
105
105
  return dayjs(a.update_time).isAfter(b.update_time) ? -1 : 1;
106
106
  });
107
+ const todoNotifySeen = /* @__PURE__ */ new Set();
108
+ finalResult.filter((msg) => msg.message_type === "TodoNotify" && msg.content_type === "JSON").forEach((msg) => {
109
+ try {
110
+ const data = JSON.parse(msg.content);
111
+ const key = "".concat(data.bizkey, "_").concat(data.param02);
112
+ if (data.todoid && !todoNotifySeen.has(key)) {
113
+ msg.enableLink = true;
114
+ todoNotifySeen.add(key);
115
+ }
116
+ } catch (error) {
117
+ ibiz.log.error(error);
118
+ }
119
+ });
120
+ messages.value = finalResult;
107
121
  };
108
122
  const updateData = () => {
109
123
  state.total = c.total;
@@ -288,8 +288,28 @@ class AIChatUtil {
288
288
  }
289
289
  return null;
290
290
  };
291
+ chatOptions.chatDigest = async (ctx, param, other) => {
292
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
293
+ const tempParams = { ...param };
294
+ if (other.srfaiagent) {
295
+ tempParams.srfaiagent = other.srfaiagent;
296
+ }
297
+ const result = await deService.aiChatChatDigest(
298
+ ctx,
299
+ tempParams,
300
+ other.message
301
+ );
302
+ if (result.ok && result.data) {
303
+ const choices = result.data.choices;
304
+ if (choices && choices.length > 0) {
305
+ return choices[0];
306
+ }
307
+ return null;
308
+ }
309
+ return null;
310
+ };
291
311
  const app = ibiz.hub.getApp(context.srfappid);
292
- const folder = app.model.defaultOSSCat || ((_a = app.model.userParam) == null ? void 0 : _a.DefaultOSSCat);
312
+ const folder = ibiz.env.defaultOSSCat || app.model.defaultOSSCat || ((_a = app.model.userParam) == null ? void 0 : _a.DefaultOSSCat);
293
313
  let globalDownloadPrifix = false;
294
314
  if (editorParams.globaldownloadprifix) {
295
315
  globalDownloadPrifix = editorParams.globaldownloadprifix === "true";
@@ -714,8 +734,28 @@ class AIChatUtil {
714
734
  }
715
735
  return null;
716
736
  };
737
+ chatOptions.chatDigest = async (ctx, param, other) => {
738
+ const deService = await ibiz.hub.getApp(ctx.srfappid).deService.getService(ctx, other.appDataEntityId);
739
+ const tempParams = { ...param };
740
+ if (other.srfaiagent) {
741
+ tempParams.srfaiagent = other.srfaiagent;
742
+ }
743
+ const result = await deService.aiChatChatDigest(
744
+ ctx,
745
+ tempParams,
746
+ other.message
747
+ );
748
+ if (result.ok && result.data) {
749
+ const choices = result.data.choices;
750
+ if (choices && choices.length > 0) {
751
+ return choices[0];
752
+ }
753
+ return null;
754
+ }
755
+ return null;
756
+ };
717
757
  const app = ibiz.hub.getApp(context.srfappid);
718
- const folder = app.model.defaultOSSCat || ((_a = app.model.userParam) == null ? void 0 : _a.DefaultOSSCat);
758
+ const folder = ibiz.env.defaultOSSCat || app.model.defaultOSSCat || ((_a = app.model.userParam) == null ? void 0 : _a.DefaultOSSCat);
719
759
  let globalDownloadPrifix = false;
720
760
  if (params.hasOwnProperty("globaldownloadprifix")) {
721
761
  globalDownloadPrifix = params.globaldownloadprifix === "true";