hzerojs-plugin-yqcloud-jssdk 1.0.12 → 1.0.14
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 +10 -5
- package/package.json +4 -1
package/lib/index.js
CHANGED
|
@@ -38,7 +38,6 @@ var import_menu = __toESM(require("choerodon-ui/pro/es/menu"));
|
|
|
38
38
|
var import_popover = __toESM(require("choerodon-ui/es/popover"));
|
|
39
39
|
var import_axios = __toESM(require("axios"));
|
|
40
40
|
var import_index = require("./index.css");
|
|
41
|
-
var import_hzero_ui = require("hzero-ui");
|
|
42
41
|
var YQ_API_HOST = "https://api.test.yqcloud.com";
|
|
43
42
|
var src_default = (props) => {
|
|
44
43
|
var _a, _b;
|
|
@@ -121,6 +120,12 @@ var src_default = (props) => {
|
|
|
121
120
|
secret
|
|
122
121
|
// code,
|
|
123
122
|
});
|
|
123
|
+
const authParam = `redirectFlag&access_token=${res.accessToken}&token_type=bearer&state=&expires_in=86399&scope=default`;
|
|
124
|
+
const fieldData = sessionStorage.getItem("YQ_FIELD_DATA");
|
|
125
|
+
let urlParam = authParam;
|
|
126
|
+
if (fieldData) {
|
|
127
|
+
urlParam = `&fieldData=${fieldData}&${authParam}`;
|
|
128
|
+
}
|
|
124
129
|
const modal = import_modal.default.open({
|
|
125
130
|
// title: '测试',
|
|
126
131
|
maskClosable: true,
|
|
@@ -138,7 +143,7 @@ var src_default = (props) => {
|
|
|
138
143
|
height: "calc(100vh - 100px)"
|
|
139
144
|
},
|
|
140
145
|
header: null,
|
|
141
|
-
children: /* @__PURE__ */ import_react.default.createElement("iframe", { id: "yq-sdk-frame", style: { width: "100%", height: "100%" }, src: `${openFunction.link}
|
|
146
|
+
children: /* @__PURE__ */ import_react.default.createElement("iframe", { id: "yq-sdk-frame", style: { width: "100%", height: "100%" }, src: `${openFunction.link}${urlParam}`, frameBorder: "0" }),
|
|
142
147
|
footer: null
|
|
143
148
|
});
|
|
144
149
|
function closeModal(e) {
|
|
@@ -150,9 +155,9 @@ var src_default = (props) => {
|
|
|
150
155
|
window.addEventListener("message", closeModal);
|
|
151
156
|
};
|
|
152
157
|
function defaultIcon() {
|
|
153
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
158
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { type: "picture", style: { width: 18, height: 18, marginRight: 10, display: "inline-block" } });
|
|
154
159
|
}
|
|
155
160
|
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)));
|
|
156
|
-
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(
|
|
157
|
-
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(
|
|
161
|
+
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));
|
|
162
|
+
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))));
|
|
158
163
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hzerojs-plugin-yqcloud-jssdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "npx father build"
|
|
8
8
|
},
|
|
9
|
+
"peerDependencies": {
|
|
10
|
+
"axios": "*"
|
|
11
|
+
},
|
|
9
12
|
"dependencies": {
|
|
10
13
|
"choerodon-ui": "^1.6.1-yqcloud-alpha.2",
|
|
11
14
|
"react": "^16.14.0"
|