hzerojs-plugin-yqcloud-jssdk 1.0.23 → 1.0.24
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/lib/index.js +9 -10
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -33,9 +33,8 @@ __export(src_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(src_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var import_popover = __toESM(require("choerodon-ui/es/popover"));
|
|
36
|
+
var import_pro = require("choerodon-ui/pro");
|
|
37
|
+
var import_choerodon_ui = require("choerodon-ui");
|
|
39
38
|
var import_axios = __toESM(require("axios"));
|
|
40
39
|
var import_index = require("./index.css");
|
|
41
40
|
var YQ_API_HOST = "https://api.test.yqcloud.com";
|
|
@@ -127,7 +126,7 @@ var src_default = (props) => {
|
|
|
127
126
|
if (fieldData) {
|
|
128
127
|
urlParam = `&fieldData=${fieldData}${authParam}`;
|
|
129
128
|
}
|
|
130
|
-
const modal =
|
|
129
|
+
const modal = import_pro.Modal.open({
|
|
131
130
|
maskClosable: true,
|
|
132
131
|
bodyStyle: {
|
|
133
132
|
width: "100%",
|
|
@@ -148,7 +147,7 @@ var src_default = (props) => {
|
|
|
148
147
|
margin: "0"
|
|
149
148
|
},
|
|
150
149
|
header: null,
|
|
151
|
-
children: /* @__PURE__ */ import_react.default.createElement("div", { style: { position: "absolute", width: "100%", height: "calc(100% - 40px)", bottom: "0" } }, /* @__PURE__ */ import_react.default.createElement("div", { style: { position: "absolute", top: "-30px", right: "10px" } }, /* @__PURE__ */ import_react.default.createElement("svg", { width: "24", height: "24", viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M8 8L40 40", stroke: "#333", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M8 40L40 8", stroke: "#333", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round" }))), /* @__PURE__ */ import_react.default.createElement("iframe", { id: "yq-sdk-frame", style: { width: "100%", height: "100%" }, src: `${openFunction.link}${urlParam}`, frameBorder: "0" })),
|
|
150
|
+
children: /* @__PURE__ */ import_react.default.createElement("div", { style: { position: "absolute", width: "100%", height: "calc(100% - 40px)", bottom: "0" } }, /* @__PURE__ */ import_react.default.createElement("div", { style: { position: "absolute", top: "-30px", right: "10px" }, onClick: () => modal.close() }, /* @__PURE__ */ import_react.default.createElement("svg", { width: "24", height: "24", viewBox: "0 0 48 48", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react.default.createElement("path", { d: "M8 8L40 40", stroke: "#333", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ import_react.default.createElement("path", { d: "M8 40L40 8", stroke: "#333", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round" }))), /* @__PURE__ */ import_react.default.createElement("iframe", { id: "yq-sdk-frame", style: { width: "100%", height: "100%" }, src: `${openFunction.link}${urlParam}`, frameBorder: "0" })),
|
|
152
151
|
footer: null
|
|
153
152
|
});
|
|
154
153
|
function closeModal(e) {
|
|
@@ -162,19 +161,19 @@ var src_default = (props) => {
|
|
|
162
161
|
function defaultIcon() {
|
|
163
162
|
return /* @__PURE__ */ import_react.default.createElement("div", { type: "picture", style: { width: 18, height: 18, marginRight: 10, display: "inline-block" } });
|
|
164
163
|
}
|
|
165
|
-
const menu = /* @__PURE__ */ import_react.default.createElement(
|
|
164
|
+
const menu = /* @__PURE__ */ import_react.default.createElement(import_pro.Menu, null, (_a = appConfig == null ? void 0 : appConfig.openFunctions) == null ? void 0 : _a.map((openFunction) => {
|
|
166
165
|
if (openFunction.enabledFlag) {
|
|
167
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
166
|
+
return /* @__PURE__ */ import_react.default.createElement(import_pro.Menu.Item, { onClick: () => openModal(openFunction), key: openFunction.id }, openFunction.icon ? /* @__PURE__ */ import_react.default.createElement(
|
|
168
167
|
"img",
|
|
169
168
|
{
|
|
170
169
|
style: { width: 18, height: 18, marginRight: 10 },
|
|
171
|
-
src: `${apiHost}/hfle/yqc/v1/0/files/download-by-key?fileKey=${openFunction.icon}`,
|
|
170
|
+
src: `${apiHost}/hfle/yqc/v1/0/files/public/download-by-key?fileKey=${openFunction.icon}`,
|
|
172
171
|
alt: ""
|
|
173
172
|
}
|
|
174
173
|
) : defaultIcon(), openFunction.displayName);
|
|
175
174
|
}
|
|
176
175
|
return null;
|
|
177
176
|
}));
|
|
178
|
-
const onlyOneButton = /* @__PURE__ */ import_react.default.createElement("div", { className: "yq-hzero-jssdk-btn", style: { padding: 0 }, onClick: () => openModal(appConfig == null ? void 0 : appConfig.openFunctions[0]) }, appConfig.icon ? /* @__PURE__ */ import_react.default.createElement("img", { style: { width: 18, height: 18, marginRight: 10 }, src: `${apiHost}/hfle/yqc/v1/0/files/download-by-key?fileKey=${appConfig.icon}`, alt: "" }) : /* @__PURE__ */ import_react.default.createElement("div", { type: "picture", style: { width: 18, height: 18, marginRight: 10, display: "inline-block" } }), (entryDetail == null ? void 0 : entryDetail.entryName) || (appConfig == null ? void 0 : appConfig.displayName) || (appConfig == null ? void 0 : appConfig.name));
|
|
179
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "yqcloud-hzero-jssdk", ref: eleRef }, ((_b = appConfig == null ? void 0 : appConfig.openFunctions) == null ? void 0 : _b.length) === 1 ? onlyOneButton : /* @__PURE__ */ import_react.default.createElement(
|
|
177
|
+
const onlyOneButton = /* @__PURE__ */ import_react.default.createElement("div", { className: "yq-hzero-jssdk-btn", style: { padding: 0 }, onClick: () => openModal(appConfig == null ? void 0 : appConfig.openFunctions[0]) }, appConfig.icon ? /* @__PURE__ */ import_react.default.createElement("img", { style: { width: 18, height: 18, marginRight: 10 }, src: `${apiHost}/hfle/yqc/v1/0/files/public/download-by-key?fileKey=${appConfig.icon}`, alt: "" }) : /* @__PURE__ */ import_react.default.createElement("div", { type: "picture", style: { width: 18, height: 18, marginRight: 10, display: "inline-block" } }), (entryDetail == null ? void 0 : entryDetail.entryName) || (appConfig == null ? void 0 : appConfig.displayName) || (appConfig == null ? void 0 : appConfig.name));
|
|
178
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "yqcloud-hzero-jssdk", ref: eleRef }, ((_b = appConfig == null ? void 0 : appConfig.openFunctions) == null ? void 0 : _b.length) === 1 ? onlyOneButton : /* @__PURE__ */ import_react.default.createElement(import_choerodon_ui.Popover, { overlayClassName: "yqcloud-hzero-jssdk-popover", overlayStyle: { padding: 0 }, openClassName: "yqcloud-hzero-jssdk-popover", content: menu, placement: "left" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "yq-hzero-jssdk-btn", style: { padding: 0 } }, appConfig.icon ? /* @__PURE__ */ import_react.default.createElement("img", { style: { width: 18, height: 18, marginRight: 10 }, src: `${apiHost}/hfle/yqc/v1/0/files/public/download-by-key?fileKey=${appConfig.icon}`, alt: "" }) : /* @__PURE__ */ import_react.default.createElement("div", { type: "picture", style: { width: 18, height: 18, marginRight: 10, display: "inline-block" } }), (entryDetail == null ? void 0 : entryDetail.entryName) || (appConfig == null ? void 0 : appConfig.displayName) || (appConfig == null ? void 0 : appConfig.name))));
|
|
180
179
|
};
|