hzerojs-plugin-yqcloud-jssdk 1.0.5 → 1.0.7
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 +8 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -36,7 +36,6 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_modal = __toESM(require("choerodon-ui/pro/es/modal"));
|
|
37
37
|
var import_menu = __toESM(require("choerodon-ui/pro/es/menu"));
|
|
38
38
|
var import_popover = __toESM(require("choerodon-ui/es/popover"));
|
|
39
|
-
var import_button = __toESM(require("choerodon-ui/pro/es/button"));
|
|
40
39
|
var import_axios = __toESM(require("axios"));
|
|
41
40
|
var import_index = require("./index.css");
|
|
42
41
|
var import_hzero_ui = require("hzero-ui");
|
|
@@ -74,7 +73,12 @@ var src_default = (props) => {
|
|
|
74
73
|
}, [isVisible]);
|
|
75
74
|
(0, import_react.useEffect)(() => {
|
|
76
75
|
const url = `${apiHost}/iam/yqc/open_apps/quick/${token}`;
|
|
77
|
-
(0, import_axios.default)(url
|
|
76
|
+
(0, import_axios.default)(url, {
|
|
77
|
+
headers: {
|
|
78
|
+
"H-Request-Id": null,
|
|
79
|
+
"H-Menu-Id": null
|
|
80
|
+
}
|
|
81
|
+
}).then(function(jsonData) {
|
|
78
82
|
try {
|
|
79
83
|
if (jsonData && jsonData.failed) {
|
|
80
84
|
console.log("【YQCloud】:", jsonData.message);
|
|
@@ -127,7 +131,6 @@ var src_default = (props) => {
|
|
|
127
131
|
return /* @__PURE__ */ import_react.default.createElement(import_hzero_ui.Icon, { type: "picture" });
|
|
128
132
|
}
|
|
129
133
|
const menu = /* @__PURE__ */ import_react.default.createElement(import_menu.default, null, (_a = appConfig == null ? void 0 : appConfig.openFunctions) == null ? void 0 : _a.map((openFunction) => /* @__PURE__ */ import_react.default.createElement(import_menu.default.Item, { onClick: () => openModal(openFunction) }, openFunction.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=${openFunction.icon}`, alt: "" }) : defaultIcon(), openFunction.displayName)));
|
|
130
|
-
|
|
134
|
+
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(import_hzero_ui.Icon, { type: "picture", style: { width: 18, height: 18, marginRight: 10 } }), (entryDetail == null ? void 0 : entryDetail.entryName) || (appConfig == null ? void 0 : appConfig.displayName) || (appConfig == null ? void 0 : appConfig.name));
|
|
135
|
+
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_popover.default, { 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/download-by-key?fileKey=${appConfig.icon}`, alt: "" }) : /* @__PURE__ */ import_react.default.createElement(import_hzero_ui.Icon, { type: "picture", style: { width: 18, height: 18, marginRight: 10 } }), (entryDetail == null ? void 0 : entryDetail.entryName) || (appConfig == null ? void 0 : appConfig.displayName) || (appConfig == null ? void 0 : appConfig.name))));
|
|
131
136
|
};
|
|
132
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
133
|
-
0 && (module.exports = {});
|