@ibiz-template/vue3-components 0.7.41-alpha.115 → 0.7.41-alpha.117
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.
- package/dist/{index-B3O6yu1f.js → index-B_sVovOS.js} +1 -1
- package/dist/{index-B4MZRULw.js → index-CVJe8tmp.js} +4 -4
- package/dist/{index-qO4rCmKY.js → index-Qf-i9QxK.js} +1 -1
- package/dist/{index.es-D9o2oz4Y.js → index.es-wB22NieT.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{wang-editor-4yBz8Mkf.js → wang-editor-GmkBqotx.js} +1 -1
- package/dist/{xlsx-util-3sCwAhs0.js → xlsx-util-DuiNhTMj.js} +1 -1
- package/es/common/data-import/data-import.css +1 -1
- package/es/common/data-import/data-import.mjs +59 -24
- package/es/editor/ai-chat/embed-ai-chat/embed-ai-chat.mjs +44 -8
- package/es/locale/en/index.mjs +3 -1
- package/es/locale/zh-CN/index.mjs +3 -1
- package/lib/common/data-import/data-import.cjs +59 -24
- package/lib/common/data-import/data-import.css +1 -1
- package/lib/editor/ai-chat/embed-ai-chat/embed-ai-chat.cjs +44 -8
- package/lib/locale/en/index.cjs +3 -1
- package/lib/locale/zh-CN/index.cjs +3 -1
- package/package.json +5 -5
- package/src/common/data-import/data-import.scss +11 -9
- package/src/common/data-import/data-import.tsx +83 -28
- package/src/editor/ai-chat/embed-ai-chat/embed-ai-chat.tsx +58 -5
- package/src/locale/en/index.ts +2 -0
- package/src/locale/zh-CN/index.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-data-import{display:flex;flex-flow:column nowrap;width:544px;height:368px;padding:var(--ibiz-spacing-base-loose);background:var(--ibiz-color-bg-1)}.ibiz-data-import__caption{margin-bottom:var(--ibiz-spaceing-base);font-size:var(--ibiz-font-size-large);font-weight:var(--ibiz-font-weight-bold);color:var(--ibiz-text-color)}.ibiz-data-import__template-container{padding:var(--ibiz-spacing-base) var(--ibiz-spacing-base-tight) var(--ibiz-spacing-none);margin-bottom:var(--ibiz-spacing-base)}.ibiz-data-
|
|
1
|
+
.ibiz-data-import{display:flex;flex-flow:column nowrap;width:544px;height:368px;padding:var(--ibiz-spacing-base-loose);background:var(--ibiz-color-bg-1)}.ibiz-data-import__caption{margin-bottom:var(--ibiz-spaceing-base);font-size:var(--ibiz-font-size-large);font-weight:var(--ibiz-font-weight-bold);color:var(--ibiz-text-color)}.ibiz-data-import__template-container{padding:var(--ibiz-spacing-base) var(--ibiz-spacing-base-tight) var(--ibiz-spacing-none);margin-bottom:var(--ibiz-spacing-base)}.ibiz-data-import__file-link{display:flex;align-items:center;color:var(--ibiz-color-secondary);cursor:pointer}.ibiz-data-import__link-icon{margin-right:var(--ibiz-spacing-super-tight);font-size:var(--ibiz-width-icon-large)}.ibiz-data-import__button-bar{margin-right:var(--ibiz-spacing-base-loose);text-align:right}.ibiz-data-import__button-bar .ivu-btn{margin-left:var(--ibiz-spacing-tight)}.ibiz-data-import-upload{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;flex-grow:1;cursor:pointer;background:var(--ibiz-color-bg-1);border:1px dashed var(--ibiz-color-border);border-radius:var(--ibiz-border-radius-small)}.ibiz-data-import-upload__img{width:50px;height:50px;margin-bottom:var(--ibiz-spacing-base-loose)}.ibiz-data-import-message{display:flex;flex-flow:column nowrap;flex-grow:1;padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-base);overflow:auto;cursor:pointer;background:var(--ibiz-color-bg-1);border:1px dashed var(--ibiz-color-border);border-radius:var(--ibiz-border-radius-small)}.ibiz-data-import-message__title{display:flex;gap:var(--ibiz-spacing-tight);font-size:var(--ibiz-font-size-medium);font-weight:var(--ibiz-font-weight-bold)}.ibiz-data-import-message__content{padding-left:var(--ibiz-spacing-base);white-space:pre-line}.ibiz-data-import-content__error{color:var(--ibiz-color-danger)}
|
|
@@ -36,9 +36,11 @@ const DataImport = /* @__PURE__ */ defineComponent({
|
|
|
36
36
|
const ns = useNamespace("data-import");
|
|
37
37
|
const message = ref({
|
|
38
38
|
state: "ready",
|
|
39
|
-
message: ""
|
|
39
|
+
message: "",
|
|
40
|
+
errorfile: void 0,
|
|
41
|
+
messageTitle: "",
|
|
42
|
+
errorMessage: ""
|
|
40
43
|
});
|
|
41
|
-
const errorMessage = ref("");
|
|
42
44
|
const isLoading = ref(false);
|
|
43
45
|
const importTemplName = ibiz.config.common.importTemplNameMode === "custom" ? "".concat((_a = props.dataImport) == null ? void 0 : _a.name).concat(ibiz.i18n.t("component.dataImport.template")) : "".concat(props.appDataEntity.logicName).concat(ibiz.i18n.t("component.dataImport.templateFile"));
|
|
44
46
|
const onCancelButtonClick = () => {
|
|
@@ -47,11 +49,24 @@ const DataImport = /* @__PURE__ */ defineComponent({
|
|
|
47
49
|
const onLinkClick = async () => {
|
|
48
50
|
downloadImportTemplate(props.appDataEntity, props.dataImport, props.context, props.params, ibiz.config.common.importTemplNameMode === "custom" ? importTemplName : void 0);
|
|
49
51
|
};
|
|
52
|
+
const onErrorInfoClick = async () => {
|
|
53
|
+
if (!message.value.errorfile)
|
|
54
|
+
return;
|
|
55
|
+
let {
|
|
56
|
+
downloadUrl
|
|
57
|
+
} = ibiz.util.file.calcFileUpDownUrl(props.context, props.params, {}, {
|
|
58
|
+
osscat: message.value.errorfile.folder
|
|
59
|
+
});
|
|
60
|
+
downloadUrl = downloadUrl.replace("%fileId%", message.value.errorfile.fileid);
|
|
61
|
+
ibiz.util.file.fileDownload(downloadUrl, "".concat(ibiz.i18n.t("component.dataImport.importError"), ".xlsx"));
|
|
62
|
+
};
|
|
50
63
|
const selectFile = async () => {
|
|
51
64
|
isLoading.value = true;
|
|
52
|
-
errorMessage.value = "";
|
|
53
65
|
message.value.message = "";
|
|
54
66
|
message.value.state = "ready";
|
|
67
|
+
message.value.errorfile = void 0;
|
|
68
|
+
message.value.messageTitle = "";
|
|
69
|
+
message.value.errorMessage = "";
|
|
55
70
|
const result = await selectAndImport({
|
|
56
71
|
appDataEntity: props.appDataEntity,
|
|
57
72
|
dataImport: props.dataImport,
|
|
@@ -63,24 +78,34 @@ const DataImport = /* @__PURE__ */ defineComponent({
|
|
|
63
78
|
return;
|
|
64
79
|
}
|
|
65
80
|
if (!result.isAsync) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
const {
|
|
82
|
+
success,
|
|
83
|
+
total,
|
|
84
|
+
message: _message,
|
|
85
|
+
errormessage,
|
|
86
|
+
showTitle,
|
|
87
|
+
errorfile
|
|
88
|
+
} = result;
|
|
89
|
+
const totalNum = total ? Number(total) : 0;
|
|
90
|
+
const successNum = success ? Number(success) : 0;
|
|
91
|
+
const errorNum = totalNum - successNum;
|
|
92
|
+
message.value.state = errormessage ? "error" : "over";
|
|
93
|
+
if (showTitle) {
|
|
94
|
+
message.value.messageTitle = ibiz.i18n.t("component.dataImport.importSuccess", {
|
|
79
95
|
totalNum,
|
|
80
96
|
successNum,
|
|
81
97
|
errorNum
|
|
82
98
|
});
|
|
83
99
|
}
|
|
100
|
+
if (_message) {
|
|
101
|
+
message.value.message = _message;
|
|
102
|
+
}
|
|
103
|
+
if (errormessage) {
|
|
104
|
+
message.value.errorMessage = errormessage;
|
|
105
|
+
}
|
|
106
|
+
if (errorfile) {
|
|
107
|
+
message.value.errorfile = errorfile;
|
|
108
|
+
}
|
|
84
109
|
}
|
|
85
110
|
isLoading.value = false;
|
|
86
111
|
if (result.isAsync) {
|
|
@@ -91,11 +116,11 @@ const DataImport = /* @__PURE__ */ defineComponent({
|
|
|
91
116
|
ns,
|
|
92
117
|
message,
|
|
93
118
|
isLoading,
|
|
94
|
-
errorMessage,
|
|
95
119
|
importTemplName,
|
|
96
120
|
selectFile,
|
|
97
121
|
onLinkClick,
|
|
98
|
-
onCancelButtonClick
|
|
122
|
+
onCancelButtonClick,
|
|
123
|
+
onErrorInfoClick
|
|
99
124
|
};
|
|
100
125
|
},
|
|
101
126
|
render() {
|
|
@@ -116,16 +141,26 @@ const DataImport = /* @__PURE__ */ defineComponent({
|
|
|
116
141
|
"class": [this.ns.b("message")]
|
|
117
142
|
}, [createVNode("div", {
|
|
118
143
|
"class": this.ns.be("message", "title")
|
|
119
|
-
}, [ibiz.i18n.t("component.dataImport.importResults")]), createVNode("div", {
|
|
120
|
-
"class":
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
144
|
+
}, [createVNode("div", null, [ibiz.i18n.t("component.dataImport.importResults")]), this.message.errorfile && createVNode("div", {
|
|
145
|
+
"class": this.ns.e("file-link"),
|
|
146
|
+
"onClick": this.onErrorInfoClick
|
|
147
|
+
}, [createVNode("ion-icon", {
|
|
148
|
+
"class": this.ns.e("link-icon"),
|
|
149
|
+
"name": "link"
|
|
150
|
+
}, null), ibiz.i18n.t("component.dataImport.detailedLogs")])]), createVNode("div", {
|
|
151
|
+
"class": [this.ns.be("message", "content")]
|
|
152
|
+
}, [this.message.messageTitle && createVNode("div", {
|
|
153
|
+
"class": this.ns.be("content", "title")
|
|
154
|
+
}, [this.message.messageTitle]), this.message.message && createVNode("div", {
|
|
155
|
+
"class": this.ns.be("content", "message")
|
|
156
|
+
}, [this.message.message]), this.message.errorMessage && createVNode("div", {
|
|
157
|
+
"class": this.ns.be("content", "error")
|
|
158
|
+
}, [this.message.errorMessage])])]), createVNode("div", {
|
|
124
159
|
"class": this.ns.e("template-container")
|
|
125
160
|
}, [createVNode("div", {
|
|
126
161
|
"class": this.ns.e("template-description")
|
|
127
162
|
}, [ibiz.i18n.t("component.dataImport.downloadTemplate")]), createVNode("div", {
|
|
128
|
-
"class": this.ns.e("
|
|
163
|
+
"class": this.ns.e("file-link"),
|
|
129
164
|
"onClick": this.onLinkClick
|
|
130
165
|
}, [createVNode("ion-icon", {
|
|
131
166
|
"class": this.ns.e("link-icon"),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, createVNode, ref, onMounted, onUnmounted } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { convertNavData, calcDeCodeNameById } from '@ibiz-template/runtime';
|
|
3
3
|
import { useNamespace, getEditorEmits, getInputProps } from '@ibiz-template/vue3-util';
|
|
4
4
|
import './embed-ai-chat.css';
|
|
5
5
|
|
|
@@ -12,14 +12,32 @@ const IBizEmbedAIChat = /* @__PURE__ */ defineComponent({
|
|
|
12
12
|
const ns = useNamespace("embed-ai-chat");
|
|
13
13
|
const c = props.controller;
|
|
14
14
|
const aiChatElementRef = ref(null);
|
|
15
|
+
let mountedFlag = false;
|
|
15
16
|
const mountedAIChat = async () => {
|
|
16
|
-
var _a, _b;
|
|
17
|
+
var _a, _b, _c;
|
|
18
|
+
if (mountedFlag) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
ibiz.log.debug("UI\u6302\u8F7DAI\u804A\u5929\u6846");
|
|
22
|
+
mountedFlag = true;
|
|
23
|
+
if (c.editorParams && Object.keys(c.editorParams).length > 0) {
|
|
24
|
+
const addParams = convertNavData(c.editorParams, ((_a = c.ctrl) == null ? void 0 : _a.data) || {}, c.context, c.params);
|
|
25
|
+
Object.assign(c.editorParams, addParams);
|
|
26
|
+
}
|
|
17
27
|
const appDataEntityId = c.model.appDataEntityId;
|
|
18
28
|
const chatInstance = c.chatInstance;
|
|
19
|
-
if (!appDataEntityId || !c.deACMode || !chatInstance)
|
|
29
|
+
if (!appDataEntityId || !c.deACMode || !chatInstance) {
|
|
30
|
+
mountedFlag = false;
|
|
20
31
|
return;
|
|
21
|
-
|
|
22
|
-
const
|
|
32
|
+
}
|
|
33
|
+
const appDataEntityName = calcDeCodeNameById(appDataEntityId);
|
|
34
|
+
let topicId = "".concat(appDataEntityId, "@").concat(c.model.appDEACModeId, "@");
|
|
35
|
+
topicId += c.context[appDataEntityName] ? c.context[appDataEntityName] : "default";
|
|
36
|
+
if (c.editorParams.srfattachsessiontag) {
|
|
37
|
+
topicId += "__".concat(c.editorParams.srfattachsessiontag);
|
|
38
|
+
delete c.editorParams.srfattachsessiontag;
|
|
39
|
+
}
|
|
40
|
+
const sessionid = ibiz.aiChatUtil.getChatSessionId("TOPIC", topicId, c.editorParams.srfattachtimestamp !== "false");
|
|
23
41
|
const tempParams = {
|
|
24
42
|
...c.params,
|
|
25
43
|
...{
|
|
@@ -35,9 +53,9 @@ const IBizEmbedAIChat = /* @__PURE__ */ defineComponent({
|
|
|
35
53
|
ctrl: c.ctrl
|
|
36
54
|
});
|
|
37
55
|
const resourceOptions = await ibiz.aiChatUtil.getAIResourceOptions(c.context, c.params);
|
|
38
|
-
let topicCaption = "[".concat(c.deACMode.logicName, "]").concat(((
|
|
56
|
+
let topicCaption = "[".concat(c.deACMode.logicName, "]").concat(((_b = props.data) == null ? void 0 : _b.srfmajortext) || "");
|
|
39
57
|
if (c.editorParams.srfaitopiccaption) {
|
|
40
|
-
topicCaption = "[".concat(ibiz.appUtil.resolveI18nText(c.editorParams.srfaitopiccaption), "]").concat(((
|
|
58
|
+
topicCaption = "[".concat(ibiz.appUtil.resolveI18nText(c.editorParams.srfaitopiccaption), "]").concat(((_c = props.data) == null ? void 0 : _c.srfmajortext) || "");
|
|
41
59
|
}
|
|
42
60
|
let chatCaption = c.deACMode.logicName;
|
|
43
61
|
if (c.editorParams.srfaichatcaption) {
|
|
@@ -70,14 +88,32 @@ const IBizEmbedAIChat = /* @__PURE__ */ defineComponent({
|
|
|
70
88
|
}
|
|
71
89
|
});
|
|
72
90
|
};
|
|
73
|
-
|
|
91
|
+
const onLoadSuccess = () => {
|
|
74
92
|
mountedAIChat();
|
|
93
|
+
};
|
|
94
|
+
const onLoadDraftSuccess = () => {
|
|
95
|
+
mountedAIChat();
|
|
96
|
+
};
|
|
97
|
+
onMounted(() => {
|
|
98
|
+
const ctrl = c.ctrl;
|
|
99
|
+
if (ctrl) {
|
|
100
|
+
ctrl.evt.on("onLoadSuccess", onLoadSuccess);
|
|
101
|
+
ctrl.evt.on("onLoadDraftSuccess", onLoadDraftSuccess);
|
|
102
|
+
} else {
|
|
103
|
+
mountedAIChat();
|
|
104
|
+
}
|
|
75
105
|
});
|
|
76
106
|
onUnmounted(() => {
|
|
107
|
+
const ctrl = c.ctrl;
|
|
108
|
+
if (ctrl) {
|
|
109
|
+
ctrl.evt.off("onLoadSuccess", onLoadSuccess);
|
|
110
|
+
ctrl.evt.off("onLoadDraftSuccess", onLoadDraftSuccess);
|
|
111
|
+
}
|
|
77
112
|
const chatInstance = c.chatInstance;
|
|
78
113
|
if (chatInstance) {
|
|
79
114
|
chatInstance.close();
|
|
80
115
|
}
|
|
116
|
+
mountedFlag = false;
|
|
81
117
|
});
|
|
82
118
|
return {
|
|
83
119
|
c,
|
package/es/locale/en/index.mjs
CHANGED
|
@@ -545,7 +545,9 @@ var index = {
|
|
|
545
545
|
downloadTemplate: "Download the import template and fill in as required:",
|
|
546
546
|
templateFile: "Data import template file",
|
|
547
547
|
template: "Template",
|
|
548
|
-
continue: "Continue importing"
|
|
548
|
+
continue: "Continue importing",
|
|
549
|
+
detailedLogs: "Detailed logs",
|
|
550
|
+
importError: "Import Error"
|
|
549
551
|
},
|
|
550
552
|
dataImport2: {
|
|
551
553
|
atLastOne: "Select at least one mapping attribute",
|
|
@@ -541,7 +541,9 @@ var index = {
|
|
|
541
541
|
downloadTemplate: "\u4E0B\u8F7D\u5BFC\u5165\u6A21\u7248\uFF0C\u5E76\u6309\u8981\u6C42\u586B\u5199\uFF1A",
|
|
542
542
|
templateFile: "\u6570\u636E\u5BFC\u5165\u6A21\u677F\u6587\u4EF6",
|
|
543
543
|
template: "\u6A21\u677F",
|
|
544
|
-
continue: "\u7EE7\u7EED\u5BFC\u5165"
|
|
544
|
+
continue: "\u7EE7\u7EED\u5BFC\u5165",
|
|
545
|
+
detailedLogs: "\u8BE6\u7EC6\u65E5\u5FD7",
|
|
546
|
+
importError: "\u5BFC\u5165\u9519\u8BEF"
|
|
545
547
|
},
|
|
546
548
|
dataImport2: {
|
|
547
549
|
atLastOne: "\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6620\u5C04\u5C5E\u6027",
|
|
@@ -38,9 +38,11 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
38
38
|
const ns = vue3Util.useNamespace("data-import");
|
|
39
39
|
const message = vue.ref({
|
|
40
40
|
state: "ready",
|
|
41
|
-
message: ""
|
|
41
|
+
message: "",
|
|
42
|
+
errorfile: void 0,
|
|
43
|
+
messageTitle: "",
|
|
44
|
+
errorMessage: ""
|
|
42
45
|
});
|
|
43
|
-
const errorMessage = vue.ref("");
|
|
44
46
|
const isLoading = vue.ref(false);
|
|
45
47
|
const importTemplName = ibiz.config.common.importTemplNameMode === "custom" ? "".concat((_a = props.dataImport) == null ? void 0 : _a.name).concat(ibiz.i18n.t("component.dataImport.template")) : "".concat(props.appDataEntity.logicName).concat(ibiz.i18n.t("component.dataImport.templateFile"));
|
|
46
48
|
const onCancelButtonClick = () => {
|
|
@@ -49,11 +51,24 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
49
51
|
const onLinkClick = async () => {
|
|
50
52
|
runtime.downloadImportTemplate(props.appDataEntity, props.dataImport, props.context, props.params, ibiz.config.common.importTemplNameMode === "custom" ? importTemplName : void 0);
|
|
51
53
|
};
|
|
54
|
+
const onErrorInfoClick = async () => {
|
|
55
|
+
if (!message.value.errorfile)
|
|
56
|
+
return;
|
|
57
|
+
let {
|
|
58
|
+
downloadUrl
|
|
59
|
+
} = ibiz.util.file.calcFileUpDownUrl(props.context, props.params, {}, {
|
|
60
|
+
osscat: message.value.errorfile.folder
|
|
61
|
+
});
|
|
62
|
+
downloadUrl = downloadUrl.replace("%fileId%", message.value.errorfile.fileid);
|
|
63
|
+
ibiz.util.file.fileDownload(downloadUrl, "".concat(ibiz.i18n.t("component.dataImport.importError"), ".xlsx"));
|
|
64
|
+
};
|
|
52
65
|
const selectFile = async () => {
|
|
53
66
|
isLoading.value = true;
|
|
54
|
-
errorMessage.value = "";
|
|
55
67
|
message.value.message = "";
|
|
56
68
|
message.value.state = "ready";
|
|
69
|
+
message.value.errorfile = void 0;
|
|
70
|
+
message.value.messageTitle = "";
|
|
71
|
+
message.value.errorMessage = "";
|
|
57
72
|
const result = await runtime.selectAndImport({
|
|
58
73
|
appDataEntity: props.appDataEntity,
|
|
59
74
|
dataImport: props.dataImport,
|
|
@@ -65,24 +80,34 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
65
80
|
return;
|
|
66
81
|
}
|
|
67
82
|
if (!result.isAsync) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
const {
|
|
84
|
+
success,
|
|
85
|
+
total,
|
|
86
|
+
message: _message,
|
|
87
|
+
errormessage,
|
|
88
|
+
showTitle,
|
|
89
|
+
errorfile
|
|
90
|
+
} = result;
|
|
91
|
+
const totalNum = total ? Number(total) : 0;
|
|
92
|
+
const successNum = success ? Number(success) : 0;
|
|
93
|
+
const errorNum = totalNum - successNum;
|
|
94
|
+
message.value.state = errormessage ? "error" : "over";
|
|
95
|
+
if (showTitle) {
|
|
96
|
+
message.value.messageTitle = ibiz.i18n.t("component.dataImport.importSuccess", {
|
|
81
97
|
totalNum,
|
|
82
98
|
successNum,
|
|
83
99
|
errorNum
|
|
84
100
|
});
|
|
85
101
|
}
|
|
102
|
+
if (_message) {
|
|
103
|
+
message.value.message = _message;
|
|
104
|
+
}
|
|
105
|
+
if (errormessage) {
|
|
106
|
+
message.value.errorMessage = errormessage;
|
|
107
|
+
}
|
|
108
|
+
if (errorfile) {
|
|
109
|
+
message.value.errorfile = errorfile;
|
|
110
|
+
}
|
|
86
111
|
}
|
|
87
112
|
isLoading.value = false;
|
|
88
113
|
if (result.isAsync) {
|
|
@@ -93,11 +118,11 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
93
118
|
ns,
|
|
94
119
|
message,
|
|
95
120
|
isLoading,
|
|
96
|
-
errorMessage,
|
|
97
121
|
importTemplName,
|
|
98
122
|
selectFile,
|
|
99
123
|
onLinkClick,
|
|
100
|
-
onCancelButtonClick
|
|
124
|
+
onCancelButtonClick,
|
|
125
|
+
onErrorInfoClick
|
|
101
126
|
};
|
|
102
127
|
},
|
|
103
128
|
render() {
|
|
@@ -118,16 +143,26 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
118
143
|
"class": [this.ns.b("message")]
|
|
119
144
|
}, [vue.createVNode("div", {
|
|
120
145
|
"class": this.ns.be("message", "title")
|
|
121
|
-
}, [ibiz.i18n.t("component.dataImport.importResults")]), vue.createVNode("div", {
|
|
122
|
-
"class":
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
146
|
+
}, [vue.createVNode("div", null, [ibiz.i18n.t("component.dataImport.importResults")]), this.message.errorfile && vue.createVNode("div", {
|
|
147
|
+
"class": this.ns.e("file-link"),
|
|
148
|
+
"onClick": this.onErrorInfoClick
|
|
149
|
+
}, [vue.createVNode("ion-icon", {
|
|
150
|
+
"class": this.ns.e("link-icon"),
|
|
151
|
+
"name": "link"
|
|
152
|
+
}, null), ibiz.i18n.t("component.dataImport.detailedLogs")])]), vue.createVNode("div", {
|
|
153
|
+
"class": [this.ns.be("message", "content")]
|
|
154
|
+
}, [this.message.messageTitle && vue.createVNode("div", {
|
|
155
|
+
"class": this.ns.be("content", "title")
|
|
156
|
+
}, [this.message.messageTitle]), this.message.message && vue.createVNode("div", {
|
|
157
|
+
"class": this.ns.be("content", "message")
|
|
158
|
+
}, [this.message.message]), this.message.errorMessage && vue.createVNode("div", {
|
|
159
|
+
"class": this.ns.be("content", "error")
|
|
160
|
+
}, [this.message.errorMessage])])]), vue.createVNode("div", {
|
|
126
161
|
"class": this.ns.e("template-container")
|
|
127
162
|
}, [vue.createVNode("div", {
|
|
128
163
|
"class": this.ns.e("template-description")
|
|
129
164
|
}, [ibiz.i18n.t("component.dataImport.downloadTemplate")]), vue.createVNode("div", {
|
|
130
|
-
"class": this.ns.e("
|
|
165
|
+
"class": this.ns.e("file-link"),
|
|
131
166
|
"onClick": this.onLinkClick
|
|
132
167
|
}, [vue.createVNode("ion-icon", {
|
|
133
168
|
"class": this.ns.e("link-icon"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-data-import{display:flex;flex-flow:column nowrap;width:544px;height:368px;padding:var(--ibiz-spacing-base-loose);background:var(--ibiz-color-bg-1)}.ibiz-data-import__caption{margin-bottom:var(--ibiz-spaceing-base);font-size:var(--ibiz-font-size-large);font-weight:var(--ibiz-font-weight-bold);color:var(--ibiz-text-color)}.ibiz-data-import__template-container{padding:var(--ibiz-spacing-base) var(--ibiz-spacing-base-tight) var(--ibiz-spacing-none);margin-bottom:var(--ibiz-spacing-base)}.ibiz-data-
|
|
1
|
+
.ibiz-data-import{display:flex;flex-flow:column nowrap;width:544px;height:368px;padding:var(--ibiz-spacing-base-loose);background:var(--ibiz-color-bg-1)}.ibiz-data-import__caption{margin-bottom:var(--ibiz-spaceing-base);font-size:var(--ibiz-font-size-large);font-weight:var(--ibiz-font-weight-bold);color:var(--ibiz-text-color)}.ibiz-data-import__template-container{padding:var(--ibiz-spacing-base) var(--ibiz-spacing-base-tight) var(--ibiz-spacing-none);margin-bottom:var(--ibiz-spacing-base)}.ibiz-data-import__file-link{display:flex;align-items:center;color:var(--ibiz-color-secondary);cursor:pointer}.ibiz-data-import__link-icon{margin-right:var(--ibiz-spacing-super-tight);font-size:var(--ibiz-width-icon-large)}.ibiz-data-import__button-bar{margin-right:var(--ibiz-spacing-base-loose);text-align:right}.ibiz-data-import__button-bar .ivu-btn{margin-left:var(--ibiz-spacing-tight)}.ibiz-data-import-upload{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;flex-grow:1;cursor:pointer;background:var(--ibiz-color-bg-1);border:1px dashed var(--ibiz-color-border);border-radius:var(--ibiz-border-radius-small)}.ibiz-data-import-upload__img{width:50px;height:50px;margin-bottom:var(--ibiz-spacing-base-loose)}.ibiz-data-import-message{display:flex;flex-flow:column nowrap;flex-grow:1;padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-base);overflow:auto;cursor:pointer;background:var(--ibiz-color-bg-1);border:1px dashed var(--ibiz-color-border);border-radius:var(--ibiz-border-radius-small)}.ibiz-data-import-message__title{display:flex;gap:var(--ibiz-spacing-tight);font-size:var(--ibiz-font-size-medium);font-weight:var(--ibiz-font-weight-bold)}.ibiz-data-import-message__content{padding-left:var(--ibiz-spacing-base);white-space:pre-line}.ibiz-data-import-content__error{color:var(--ibiz-color-danger)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
|
-
var
|
|
4
|
+
var runtime = require('@ibiz-template/runtime');
|
|
5
5
|
var vue3Util = require('@ibiz-template/vue3-util');
|
|
6
6
|
require('./embed-ai-chat.css');
|
|
7
7
|
|
|
@@ -14,14 +14,32 @@ const IBizEmbedAIChat = /* @__PURE__ */ vue.defineComponent({
|
|
|
14
14
|
const ns = vue3Util.useNamespace("embed-ai-chat");
|
|
15
15
|
const c = props.controller;
|
|
16
16
|
const aiChatElementRef = vue.ref(null);
|
|
17
|
+
let mountedFlag = false;
|
|
17
18
|
const mountedAIChat = async () => {
|
|
18
|
-
var _a, _b;
|
|
19
|
+
var _a, _b, _c;
|
|
20
|
+
if (mountedFlag) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
ibiz.log.debug("UI\u6302\u8F7DAI\u804A\u5929\u6846");
|
|
24
|
+
mountedFlag = true;
|
|
25
|
+
if (c.editorParams && Object.keys(c.editorParams).length > 0) {
|
|
26
|
+
const addParams = runtime.convertNavData(c.editorParams, ((_a = c.ctrl) == null ? void 0 : _a.data) || {}, c.context, c.params);
|
|
27
|
+
Object.assign(c.editorParams, addParams);
|
|
28
|
+
}
|
|
19
29
|
const appDataEntityId = c.model.appDataEntityId;
|
|
20
30
|
const chatInstance = c.chatInstance;
|
|
21
|
-
if (!appDataEntityId || !c.deACMode || !chatInstance)
|
|
31
|
+
if (!appDataEntityId || !c.deACMode || !chatInstance) {
|
|
32
|
+
mountedFlag = false;
|
|
22
33
|
return;
|
|
23
|
-
|
|
24
|
-
const
|
|
34
|
+
}
|
|
35
|
+
const appDataEntityName = runtime.calcDeCodeNameById(appDataEntityId);
|
|
36
|
+
let topicId = "".concat(appDataEntityId, "@").concat(c.model.appDEACModeId, "@");
|
|
37
|
+
topicId += c.context[appDataEntityName] ? c.context[appDataEntityName] : "default";
|
|
38
|
+
if (c.editorParams.srfattachsessiontag) {
|
|
39
|
+
topicId += "__".concat(c.editorParams.srfattachsessiontag);
|
|
40
|
+
delete c.editorParams.srfattachsessiontag;
|
|
41
|
+
}
|
|
42
|
+
const sessionid = ibiz.aiChatUtil.getChatSessionId("TOPIC", topicId, c.editorParams.srfattachtimestamp !== "false");
|
|
25
43
|
const tempParams = {
|
|
26
44
|
...c.params,
|
|
27
45
|
...{
|
|
@@ -37,9 +55,9 @@ const IBizEmbedAIChat = /* @__PURE__ */ vue.defineComponent({
|
|
|
37
55
|
ctrl: c.ctrl
|
|
38
56
|
});
|
|
39
57
|
const resourceOptions = await ibiz.aiChatUtil.getAIResourceOptions(c.context, c.params);
|
|
40
|
-
let topicCaption = "[".concat(c.deACMode.logicName, "]").concat(((
|
|
58
|
+
let topicCaption = "[".concat(c.deACMode.logicName, "]").concat(((_b = props.data) == null ? void 0 : _b.srfmajortext) || "");
|
|
41
59
|
if (c.editorParams.srfaitopiccaption) {
|
|
42
|
-
topicCaption = "[".concat(ibiz.appUtil.resolveI18nText(c.editorParams.srfaitopiccaption), "]").concat(((
|
|
60
|
+
topicCaption = "[".concat(ibiz.appUtil.resolveI18nText(c.editorParams.srfaitopiccaption), "]").concat(((_c = props.data) == null ? void 0 : _c.srfmajortext) || "");
|
|
43
61
|
}
|
|
44
62
|
let chatCaption = c.deACMode.logicName;
|
|
45
63
|
if (c.editorParams.srfaichatcaption) {
|
|
@@ -72,14 +90,32 @@ const IBizEmbedAIChat = /* @__PURE__ */ vue.defineComponent({
|
|
|
72
90
|
}
|
|
73
91
|
});
|
|
74
92
|
};
|
|
75
|
-
|
|
93
|
+
const onLoadSuccess = () => {
|
|
76
94
|
mountedAIChat();
|
|
95
|
+
};
|
|
96
|
+
const onLoadDraftSuccess = () => {
|
|
97
|
+
mountedAIChat();
|
|
98
|
+
};
|
|
99
|
+
vue.onMounted(() => {
|
|
100
|
+
const ctrl = c.ctrl;
|
|
101
|
+
if (ctrl) {
|
|
102
|
+
ctrl.evt.on("onLoadSuccess", onLoadSuccess);
|
|
103
|
+
ctrl.evt.on("onLoadDraftSuccess", onLoadDraftSuccess);
|
|
104
|
+
} else {
|
|
105
|
+
mountedAIChat();
|
|
106
|
+
}
|
|
77
107
|
});
|
|
78
108
|
vue.onUnmounted(() => {
|
|
109
|
+
const ctrl = c.ctrl;
|
|
110
|
+
if (ctrl) {
|
|
111
|
+
ctrl.evt.off("onLoadSuccess", onLoadSuccess);
|
|
112
|
+
ctrl.evt.off("onLoadDraftSuccess", onLoadDraftSuccess);
|
|
113
|
+
}
|
|
79
114
|
const chatInstance = c.chatInstance;
|
|
80
115
|
if (chatInstance) {
|
|
81
116
|
chatInstance.close();
|
|
82
117
|
}
|
|
118
|
+
mountedFlag = false;
|
|
83
119
|
});
|
|
84
120
|
return {
|
|
85
121
|
c,
|
package/lib/locale/en/index.cjs
CHANGED
|
@@ -549,7 +549,9 @@ var index = {
|
|
|
549
549
|
downloadTemplate: "Download the import template and fill in as required:",
|
|
550
550
|
templateFile: "Data import template file",
|
|
551
551
|
template: "Template",
|
|
552
|
-
continue: "Continue importing"
|
|
552
|
+
continue: "Continue importing",
|
|
553
|
+
detailedLogs: "Detailed logs",
|
|
554
|
+
importError: "Import Error"
|
|
553
555
|
},
|
|
554
556
|
dataImport2: {
|
|
555
557
|
atLastOne: "Select at least one mapping attribute",
|
|
@@ -545,7 +545,9 @@ var index = {
|
|
|
545
545
|
downloadTemplate: "\u4E0B\u8F7D\u5BFC\u5165\u6A21\u7248\uFF0C\u5E76\u6309\u8981\u6C42\u586B\u5199\uFF1A",
|
|
546
546
|
templateFile: "\u6570\u636E\u5BFC\u5165\u6A21\u677F\u6587\u4EF6",
|
|
547
547
|
template: "\u6A21\u677F",
|
|
548
|
-
continue: "\u7EE7\u7EED\u5BFC\u5165"
|
|
548
|
+
continue: "\u7EE7\u7EED\u5BFC\u5165",
|
|
549
|
+
detailedLogs: "\u8BE6\u7EC6\u65E5\u5FD7",
|
|
550
|
+
importError: "\u5BFC\u5165\u9519\u8BEF"
|
|
549
551
|
},
|
|
550
552
|
dataImport2: {
|
|
551
553
|
atLastOne: "\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6620\u5C04\u5C5E\u6027",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/vue3-components",
|
|
3
|
-
"version": "0.7.41-alpha.
|
|
3
|
+
"version": "0.7.41-alpha.117",
|
|
4
4
|
"description": "web端组件库(vue3)",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
33
33
|
"@floating-ui/dom": "^1.5.3",
|
|
34
|
-
"@ibiz-template-plugin/ai-chat": "^0.0.
|
|
34
|
+
"@ibiz-template-plugin/ai-chat": "^0.0.90",
|
|
35
35
|
"@ibiz-template-plugin/gantt": "0.1.8-alpha.468",
|
|
36
36
|
"@ibiz-template-plugin/bi-report": "0.0.32",
|
|
37
37
|
"@ibiz-template-plugin/data-view": "0.0.7",
|
|
38
38
|
"@ibiz-template/core": "0.7.41-alpha.119",
|
|
39
39
|
"@ibiz-template/devtool": "0.0.16",
|
|
40
|
-
"@ibiz-template/model-helper": "0.7.41-alpha.
|
|
41
|
-
"@ibiz-template/runtime": "0.7.41-alpha.
|
|
40
|
+
"@ibiz-template/model-helper": "0.7.41-alpha.123",
|
|
41
|
+
"@ibiz-template/runtime": "0.7.41-alpha.123",
|
|
42
42
|
"@ibiz-template/theme": "0.7.39",
|
|
43
|
-
"@ibiz-template/vue3-util": "0.7.41-alpha.
|
|
43
|
+
"@ibiz-template/vue3-util": "0.7.41-alpha.123",
|
|
44
44
|
"@ibiz-template/web-theme": "3.16.0",
|
|
45
45
|
"@ibiz/model-core": "^0.1.89",
|
|
46
46
|
"@imengyu/vue3-context-menu": "^1.3.5",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
margin-bottom: getCssVar('spacing','base');
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
@include e(
|
|
21
|
+
@include e(file-link) {
|
|
22
22
|
display: flex;
|
|
23
23
|
align-items: center;
|
|
24
24
|
color: getCssVar('color','secondary');
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
font-size: getCssVar('width-icon','large');
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
@include e(button-bar) {
|
|
34
34
|
margin-right: getCssVar('spacing','base-loose');
|
|
35
35
|
text-align: right;
|
|
@@ -69,20 +69,22 @@
|
|
|
69
69
|
border-radius: getCssVar(border, radius,small);
|
|
70
70
|
|
|
71
71
|
@include e(title) {
|
|
72
|
+
display: flex;
|
|
73
|
+
gap: getCssVar('spacing','tight');
|
|
72
74
|
font-size: getCssVar('font-size', 'medium');
|
|
73
75
|
font-weight: getCssVar('font-weight', 'bold');
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
@include e(content) {
|
|
77
79
|
padding-left: getCssVar('spacing','base');
|
|
78
|
-
|
|
79
|
-
@include when(error) {
|
|
80
|
-
color: getCssVar(color, danger);
|
|
81
|
-
}
|
|
80
|
+
white-space: pre-line;
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
@include b(data-import-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
@include b(data-import-content) {
|
|
85
|
+
|
|
86
|
+
@include e(error){
|
|
87
|
+
color: getCssVar(color ,danger);
|
|
88
|
+
}
|
|
89
|
+
|
|
88
90
|
}
|