hzerojs-plugin-yqcloud-jssdk 1.0.19 → 1.0.20
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 +16 -4
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -41,7 +41,7 @@ var import_index = require("./index.css");
|
|
|
41
41
|
var YQ_API_HOST = "https://api.test.yqcloud.com";
|
|
42
42
|
var src_default = (props) => {
|
|
43
43
|
var _a, _b;
|
|
44
|
-
const { token, entryDetail, apiHost = YQ_API_HOST, tokenPath = "/iam/v1/zknow/encrypt/quick"
|
|
44
|
+
const { token, entryDetail, apiHost = YQ_API_HOST, tokenPath = "/iam/v1/zknow/encrypt/quick" } = props;
|
|
45
45
|
const eleRef = import_react.default.useRef(null);
|
|
46
46
|
const tenantIdRef = import_react.default.useRef(null);
|
|
47
47
|
const [appConfig, setAppConfig] = import_react.default.useState(false);
|
|
@@ -130,13 +130,13 @@ var src_default = (props) => {
|
|
|
130
130
|
const modal = import_modal.default.open({
|
|
131
131
|
// title: '测试',
|
|
132
132
|
maskClosable: true,
|
|
133
|
-
bodyStyle:
|
|
133
|
+
bodyStyle: {
|
|
134
134
|
width: (openFunction == null ? void 0 : openFunction.viewSize) || 800,
|
|
135
135
|
padding: 0,
|
|
136
136
|
height: "100%",
|
|
137
137
|
overflow: "hidden"
|
|
138
138
|
},
|
|
139
|
-
style:
|
|
139
|
+
style: {
|
|
140
140
|
// top: 50,
|
|
141
141
|
},
|
|
142
142
|
contentStyle: {
|
|
@@ -158,7 +158,19 @@ var src_default = (props) => {
|
|
|
158
158
|
function defaultIcon() {
|
|
159
159
|
return /* @__PURE__ */ import_react.default.createElement("div", { type: "picture", style: { width: 18, height: 18, marginRight: 10, display: "inline-block" } });
|
|
160
160
|
}
|
|
161
|
-
const menu = /* @__PURE__ */ import_react.default.createElement(import_menu.default, null, (_a = appConfig == null ? void 0 : appConfig.openFunctions) == null ? void 0 : _a.map((openFunction) =>
|
|
161
|
+
const menu = /* @__PURE__ */ import_react.default.createElement(import_menu.default, null, (_a = appConfig == null ? void 0 : appConfig.openFunctions) == null ? void 0 : _a.map((openFunction) => {
|
|
162
|
+
if (openFunction.enabledFlag) {
|
|
163
|
+
return /* @__PURE__ */ import_react.default.createElement(import_menu.default.Item, { onClick: () => openModal(openFunction), key: openFunction.id }, openFunction.icon ? /* @__PURE__ */ import_react.default.createElement(
|
|
164
|
+
"img",
|
|
165
|
+
{
|
|
166
|
+
style: { width: 18, height: 18, marginRight: 10 },
|
|
167
|
+
src: `${apiHost}/hfle/yqc/v1/0/files/download-by-key?fileKey=${openFunction.icon}`,
|
|
168
|
+
alt: ""
|
|
169
|
+
}
|
|
170
|
+
) : defaultIcon(), openFunction.displayName);
|
|
171
|
+
}
|
|
172
|
+
return null;
|
|
173
|
+
}));
|
|
162
174
|
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));
|
|
163
175
|
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("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))));
|
|
164
176
|
};
|