@ibiz-template/vue3-components 0.7.41-alpha.33 → 0.7.41-alpha.35

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.
@@ -2,9 +2,13 @@
2
2
 
3
3
  var vue = require('vue');
4
4
  var vue3Util = require('@ibiz-template/vue3-util');
5
+ require('./async-action-result.css');
5
6
  var lodashEs = require('lodash-es');
6
7
 
7
8
  "use strict";
9
+ function _isSlot(s) {
10
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
11
+ }
8
12
  const AsyncActionResult = /* @__PURE__ */ vue.defineComponent({
9
13
  name: "IBizAsyncActionResult",
10
14
  props: {
@@ -18,22 +22,170 @@ const AsyncActionResult = /* @__PURE__ */ vue.defineComponent({
18
22
  }
19
23
  },
20
24
  setup(props) {
21
- const ns = vue3Util.useNamespace("async-action-preview");
22
- const message = vue.computed(() => {
23
- if (lodashEs.isObject(props.asyncAction.actionresult)) {
24
- return JSON.stringify(props.asyncAction.actionresult);
25
- }
26
- return "".concat(props.asyncAction.actionresult);
25
+ const ns = vue3Util.useNamespace("async-action-result");
26
+ const finishedStates = [30, 40];
27
+ const info = vue.reactive({
28
+ title: props.asyncAction.asyncacitonname,
29
+ beginTime: props.asyncAction.begintime,
30
+ endTime: props.asyncAction.endtime,
31
+ actionState: finishedStates.includes(props.asyncAction.actionstate),
32
+ message: ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.noMessage"),
33
+ isJSON: false
27
34
  });
35
+ const onClose = () => {
36
+ props.modal.dismiss();
37
+ };
38
+ if (lodashEs.isObject(props.asyncAction.actionresult)) {
39
+ info.message = JSON.stringify(props.asyncAction.actionresult, null, 2);
40
+ info.isJSON = true;
41
+ } else if (props.asyncAction.actionresult) {
42
+ info.message = "".concat(props.asyncAction.actionresult);
43
+ }
44
+ const renderJSONObject = (obj, depth) => {
45
+ if (obj === null) {
46
+ return vue.createVNode("span", {
47
+ "class": ns.be("content", "json-null")
48
+ }, [vue.createTextVNode("null")]);
49
+ }
50
+ if (typeof obj === "boolean") {
51
+ return vue.createVNode("span", {
52
+ "class": ns.be("content", "json-boolean")
53
+ }, [obj.toString()]);
54
+ }
55
+ if (typeof obj === "number") {
56
+ return vue.createVNode("span", {
57
+ "class": ns.be("content", "json-number")
58
+ }, [obj.toString()]);
59
+ }
60
+ if (typeof obj === "string") {
61
+ return vue.createVNode("span", {
62
+ "class": ns.be("content", "json-string")
63
+ }, [vue.createTextVNode('"'), obj, vue.createTextVNode('"')]);
64
+ }
65
+ if (Array.isArray(obj)) {
66
+ if (obj.length === 0) {
67
+ return vue.createVNode("span", null, [vue.createTextVNode("[]")]);
68
+ }
69
+ const items2 = obj.map((item, index) => vue.createVNode("div", {
70
+ "key": index,
71
+ "class": ns.be("content", "json-indent"),
72
+ "style": {
73
+ paddingLeft: "".concat((depth + 1) * 20, "px")
74
+ }
75
+ }, [renderJSONObject(item, depth + 1), index < obj.length - 1 ? "," : ""]));
76
+ return vue.createVNode("div", {
77
+ "class": ns.be("content", "json-array")
78
+ }, [vue.createVNode("span", null, [vue.createTextVNode("[")]), items2, vue.createVNode("div", {
79
+ "style": {
80
+ paddingLeft: "".concat(depth * 20, "px")
81
+ }
82
+ }, null), vue.createVNode("span", {
83
+ "style": {
84
+ paddingLeft: "".concat(depth * 20, "px")
85
+ }
86
+ }, [vue.createTextVNode("]")])]);
87
+ }
88
+ const keys = Object.keys(obj);
89
+ if (keys.length === 0) {
90
+ return vue.createVNode("span", null, ["{}"]);
91
+ }
92
+ const items = keys.map((key, index) => vue.createVNode("div", {
93
+ "key": key,
94
+ "class": ns.be("content", "json-indent"),
95
+ "style": {
96
+ paddingLeft: "".concat((depth + 1) * 20, "px")
97
+ }
98
+ }, [vue.createVNode("span", {
99
+ "class": ns.be("content", "json-key")
100
+ }, [vue.createTextVNode('"'), key, vue.createTextVNode('"')]), vue.createTextVNode(":"), " ", renderJSONObject(obj[key], depth + 1), index < keys.length - 1 ? "," : ""]));
101
+ return vue.createVNode("div", {
102
+ "class": ns.be("content", "json-object")
103
+ }, [vue.createVNode("span", null, ["{"]), items, vue.createVNode("div", {
104
+ "style": {
105
+ paddingLeft: "".concat(depth * 20, "px")
106
+ }
107
+ }, null), vue.createVNode("span", {
108
+ "style": {
109
+ paddingLeft: "".concat(depth * 20, "px")
110
+ }
111
+ }, ["}"])]);
112
+ };
113
+ const renderJSON = (jsonStr) => {
114
+ try {
115
+ const obj = JSON.parse(jsonStr);
116
+ return renderJSONObject(obj, 0);
117
+ } catch (e) {
118
+ return vue.createVNode("span", null, [jsonStr]);
119
+ }
120
+ };
28
121
  return {
29
122
  ns,
30
- message
123
+ info,
124
+ onClose,
125
+ renderJSON
31
126
  };
32
127
  },
33
128
  render() {
129
+ let _slot;
34
130
  return vue.createVNode("div", {
35
131
  "class": [this.ns.b()]
36
- }, [this.message]);
132
+ }, [vue.createVNode("div", {
133
+ "class": this.ns.b("header")
134
+ }, [vue.createVNode("div", {
135
+ "class": this.ns.e("title")
136
+ }, [this.info.title]), vue.createVNode("div", {
137
+ "class": this.ns.b("toolbar")
138
+ }, [vue.createVNode(vue.resolveComponent("el-button"), {
139
+ "onClick": this.onClose
140
+ }, _isSlot(_slot = ibiz.i18n.t("app.close")) ? _slot : {
141
+ default: () => [_slot]
142
+ })])]), vue.createVNode("div", {
143
+ "class": this.ns.b("content")
144
+ }, [vue.createVNode(vue.resolveComponent("el-row"), null, {
145
+ default: () => [vue.createVNode(vue.resolveComponent("el-col"), {
146
+ "span": 12
147
+ }, {
148
+ default: () => [vue.createVNode(vue.resolveComponent("el-form-item"), {
149
+ "label": ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.taskName")
150
+ }, {
151
+ default: () => [this.info.title]
152
+ })]
153
+ }), vue.createVNode(vue.resolveComponent("el-col"), {
154
+ "span": 12
155
+ }, {
156
+ default: () => [vue.createVNode(vue.resolveComponent("el-form-item"), {
157
+ "label": ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.taskState")
158
+ }, {
159
+ default: () => [this.info.actionState ? ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.finished") : ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.processing")]
160
+ })]
161
+ }), vue.createVNode(vue.resolveComponent("el-col"), {
162
+ "span": 12
163
+ }, {
164
+ default: () => [vue.createVNode(vue.resolveComponent("el-form-item"), {
165
+ "label": ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.beginTime")
166
+ }, {
167
+ default: () => [this.info.beginTime]
168
+ })]
169
+ }), vue.createVNode(vue.resolveComponent("el-col"), {
170
+ "span": 12
171
+ }, {
172
+ default: () => [vue.createVNode(vue.resolveComponent("el-form-item"), {
173
+ "label": ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.endTime")
174
+ }, {
175
+ default: () => [this.info.endTime]
176
+ })]
177
+ }), vue.createVNode(vue.resolveComponent("el-col"), {
178
+ "span": 24
179
+ }, {
180
+ default: () => [vue.createVNode(vue.resolveComponent("el-form-item"), {
181
+ "label": ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.exeResult")
182
+ }, {
183
+ default: () => [vue.createVNode("div", {
184
+ "class": this.ns.be("content", "json-container")
185
+ }, [this.renderJSON(this.info.message)])]
186
+ })]
187
+ })]
188
+ })])]);
37
189
  }
38
190
  });
39
191
 
@@ -0,0 +1 @@
1
+ .ibiz-async-action-result{height:100%;display:flex;flex-flow:column nowrap;padding:var(--ibiz-spacing-tight)}.ibiz-async-action-result__title{font-size:var(--ibiz-font-size-header-5);font-weight:var(--ibiz-font-weight-bold)}.ibiz-async-action-result-header{display:flex;align-items:center;justify-content:space-between;height:48px;padding:var(--ibiz-spacing-tight);border-bottom:1px solid var(--ibiz-color-border)}.ibiz-async-action-result-content{padding:var(--ibiz-spacing-tight)}.ibiz-async-action-result-content .el-form-item__content,.ibiz-async-action-result-content .el-form-item__label{font-weight:var(--ibiz-font-weight-bold)}.ibiz-async-action-result-content__json-container{width:100%;max-height:400px;padding:12px;overflow-y:auto;font-family:Monaco,Menlo,"Ubuntu Mono",monospace;font-size:13px;line-height:1.5;word-break:break-word;white-space:pre-wrap;background-color:var(--ibiz-color-bg-0);border:1px solid var(--ibiz-color-border);border-radius:4px}.ibiz-async-action-result-content__json-container::-webkit-scrollbar{width:6px;height:6px}.ibiz-async-action-result-content__json-container::-webkit-scrollbar-track{background:#f1f1f1;border-radius:3px}.ibiz-async-action-result-content__json-container::-webkit-scrollbar-thumb{background:#c1c1c1;border-radius:3px}.ibiz-async-action-result-content__json-container::-webkit-scrollbar-thumb:hover{background:#a8a8a8}.ibiz-async-action-result-content__json-key{font-weight:700;color:#d73a49}.ibiz-async-action-result-content__json-string{color:#032f62}.ibiz-async-action-result-content__json-number{color:#005cc5}.ibiz-async-action-result-content__json-boolean{color:#d73a49}.ibiz-async-action-result-content__json-null{color:#d73a49}.ibiz-async-action-result-content__json-array{display:inline-block}.ibiz-async-action-result-content__json-object{display:inline-block}.ibiz-async-action-result-content__json-indent{display:block}
@@ -6,10 +6,11 @@ function calcAiToolbarItemsByAc(deACMode) {
6
6
  const contentToolbarItems = [];
7
7
  const footerToolbarItems = [];
8
8
  const questionToolbarItems = [];
9
+ const functionToolbarItems = [];
9
10
  const otherToolbarItems = [];
10
11
  (_b = (_a = deACMode.deuiactionGroup) == null ? void 0 : _a.uiactionGroupDetails) == null ? void 0 : _b.forEach(
11
12
  (item) => {
12
- var _a2, _b2, _c, _d, _e;
13
+ var _a2, _b2, _c, _d, _e, _f;
13
14
  const toolbarItem = {
14
15
  appId: item.appId,
15
16
  id: item.uiactionId,
@@ -30,6 +31,8 @@ function calcAiToolbarItemsByAc(deACMode) {
30
31
  footerToolbarItems.push(toolbarItem);
31
32
  } else if ((_e = item.uiactionId) == null ? void 0 : _e.startsWith("question_")) {
32
33
  questionToolbarItems.push(toolbarItem);
34
+ } else if ((_f = item.uiactionId) == null ? void 0 : _f.startsWith("function_")) {
35
+ functionToolbarItems.push(toolbarItem);
33
36
  } else {
34
37
  otherToolbarItems.push(toolbarItem);
35
38
  }
@@ -39,7 +42,8 @@ function calcAiToolbarItemsByAc(deACMode) {
39
42
  contentToolbarItems,
40
43
  footerToolbarItems,
41
44
  questionToolbarItems,
42
- otherToolbarItems
45
+ otherToolbarItems,
46
+ functionToolbarItems
43
47
  };
44
48
  }
45
49
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/vue3-components",
3
- "version": "0.7.41-alpha.33",
3
+ "version": "0.7.41-alpha.35",
4
4
  "description": "web端组件库(vue3)",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.mjs",
@@ -32,14 +32,14 @@
32
32
  "@floating-ui/dom": "^1.5.3",
33
33
  "@ibiz-template-plugin/ai-chat": "^0.0.32",
34
34
  "@ibiz-template-plugin/gantt": "0.1.8-alpha.316",
35
- "@ibiz-template-plugin/bi-report": "0.0.28",
35
+ "@ibiz-template-plugin/bi-report": "0.0.29",
36
36
  "@ibiz-template-plugin/data-view": "0.0.6",
37
37
  "@ibiz-template/core": "0.7.41-alpha.33",
38
38
  "@ibiz-template/devtool": "0.0.13",
39
- "@ibiz-template/model-helper": "0.7.41-alpha.33",
40
- "@ibiz-template/runtime": "0.7.41-alpha.33",
39
+ "@ibiz-template/model-helper": "0.7.41-alpha.34",
40
+ "@ibiz-template/runtime": "0.7.41-alpha.34",
41
41
  "@ibiz-template/theme": "0.7.39",
42
- "@ibiz-template/vue3-util": "0.7.41-alpha.33",
42
+ "@ibiz-template/vue3-util": "0.7.41-alpha.34",
43
43
  "@ibiz-template/web-theme": "3.9.0",
44
44
  "@ibiz/model-core": "^0.1.83",
45
45
  "@imengyu/vue3-context-menu": "^1.3.5",