@luck-design-biz/luckda 1.0.1-11gcjs2 → 1.0.1-11gcjs4

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.
@@ -18,7 +18,7 @@ var _excluded = ["onBlur"],
18
18
  _excluded13 = ["handleValueChange", "config", "allowClear"],
19
19
  _excluded14 = ["renderInfoMode"],
20
20
  _excluded15 = ["onChange"],
21
- _excluded16 = ["handleValueChange", "config", "selectorProps", "suppressSelect"],
21
+ _excluded16 = ["handleValueChange", "config", "selectorProps", "suppressSelect", "auth", "leafOnly"],
22
22
  _excluded17 = ["onClose"],
23
23
  _excluded18 = ["handleValueChange", "config"],
24
24
  _excluded19 = ["onChange"],
@@ -235,10 +235,14 @@ export var getGroupItem = function getGroupItem(_ref19) {
235
235
  _ref19$selectorProps = _ref19.selectorProps,
236
236
  selectorProps = _ref19$selectorProps === void 0 ? {} : _ref19$selectorProps,
237
237
  suppressSelect = _ref19.suppressSelect,
238
+ _ref19$auth = _ref19.auth,
239
+ auth = _ref19$auth === void 0 ? false : _ref19$auth,
240
+ _ref19$leafOnly = _ref19.leafOnly,
241
+ leafOnly = _ref19$leafOnly === void 0 ? false : _ref19$leafOnly,
238
242
  props = _objectWithoutProperties(_ref19, _excluded16);
239
243
  return /*#__PURE__*/React.createElement(TreeSelector, _extends({}, props, {
240
244
  $attrs: _defineProperty(_defineProperty({}, LC_COMPONENT_UNIT_KEY, LC_FORMITEM_UNIT), 'data-__component', 'FieldGroup'),
241
- api: "/api/base/group/sysGroupTree/noAuthReadJurisTree?sclassKey=".concat(props.sclassKey),
245
+ api: "/api/base/group/sysGroupTree/".concat(auth ? 'noAuthReadJurisTree' : 'noAuthReadNoJurisTree', "?sclassKey=").concat(props.sclassKey, "&ex=").concat(escape(leafOnly ? 'ichildren!=0' : '')),
242
246
  selectorProps: _objectSpread(_objectSpread({}, selectorProps), {}, {
243
247
  suppressSelect: suppressSelect
244
248
  }),
@@ -0,0 +1,15 @@
1
+ {
2
+ "component": "Proxy",
3
+ "name": "页面代理",
4
+ "desc": "用于代理其他页面的内容,用于实现已有页面的服用。",
5
+ "icon": "icon-proxy",
6
+ "group": "advance",
7
+ "groupName": "高级",
8
+ "order": 6,
9
+ "css": "width: 100%; height: 100%; background-color: transparent;",
10
+ "destroyOnUnmount": false,
11
+ "proxyParams": [],
12
+ "advance": {
13
+ "events": {}
14
+ }
15
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "component": "Proxy",
3
+ "name": "页面代理",
4
+ "desc": "用于代理其他页面的内容,用于实现已有页面的服用。",
5
+ "icon": "icon-proxy",
6
+ "group": "advance",
7
+ "groupName": "高级",
8
+ "order": 6,
9
+ "props": [
10
+ {
11
+ "key": "id",
12
+ "name": "唯一标识",
13
+ "type": "string",
14
+ "disabled": true
15
+ },
16
+ {
17
+ "key": "destroyOnUnmount",
18
+ "name": "卸载时销毁",
19
+ "type": "switch",
20
+ "default": false
21
+ },
22
+ {
23
+ "key": "proxyCode",
24
+ "name": "页面编码",
25
+ "type": "_ProxyLinker"
26
+ },
27
+ {
28
+ "key": "proxyParams",
29
+ "name": "页面参数",
30
+ "type": "_ProxyParams",
31
+ "wrapper": "collapse",
32
+ "wrapperProps": {
33
+ "suppressIcon": true
34
+ },
35
+ "next": {
36
+ "name": "页面参数对象",
37
+ "autoClose": true,
38
+ "props": [
39
+ {
40
+ "key": "proxyParams",
41
+ "name": "#页面参数对象",
42
+ "type": "_ProxyParamsSetter",
43
+ "default": []
44
+ }
45
+ ]
46
+ }
47
+ }
48
+ ],
49
+ "css": "width: 100%; height: 100%; background-color: transparent;",
50
+ "advance": {
51
+ "events": [
52
+ {
53
+ "key": "onMount",
54
+ "name": "组件首次渲染完成",
55
+ "desc": "在组件首次渲染完成时,执行方法",
56
+ "func": "function onPageMount(){\n\t\n}"
57
+ },
58
+ {
59
+ "key": "onUnmount",
60
+ "name": "组件卸载时",
61
+ "desc": "在组件卸载时,执行方法。",
62
+ "func": "function onPageUnmount(){\n\t\n}"
63
+ }
64
+ ]
65
+ }
66
+ }
@@ -8,9 +8,9 @@ import React, { forwardRef, useEffect, useImperativeHandle } from 'react';
8
8
  import { Button, Checkbox, Dropdown, Icon, Modal, Upload } from 'luck-design/antd';
9
9
  import { useSetState } from 'ahooks';
10
10
  import PropTypes from 'prop-types';
11
- import { canPreview, formatMessage, patchDownload, request, showPop } from '@luck-design-biz/base/utils';
12
- import { getDvaApp } from 'umi';
13
- import { last, lowerCase, split } from 'lodash';
11
+ import { canPreview, formatMessage, patchDownload, request, showPop, string2ASCII } from '@luck-design-biz/base/utils';
12
+ import { getDvaApp, history, getCreateHistoryOptions } from 'umi';
13
+ import { last, lowerCase, split, replace } from 'lodash';
14
14
  import { Box, Permission, PermissionGroup } from 'luck-design';
15
15
  import styles from "./index.less";
16
16
 
@@ -150,12 +150,22 @@ var FilesWall = /*#__PURE__*/forwardRef(function (props, ref) {
150
150
  });
151
151
  onUploadChange && onUploadChange(e);
152
152
  };
153
+ var headers = {};
154
+ var token = window.cookie.get(window.appConfig.authSaveKey);
155
+ if (token) headers.Authorization = "Bearer ".concat(token);
156
+ var ticket = history.location.query.ticket;
157
+ if (ticket) headers.ticket = string2ASCII(ticket);
158
+ if (window.__POWERED_BY_QIANKUN__) {
159
+ var pathname = replace(window.location.pathname, getCreateHistoryOptions().basename, '');
160
+ headers['Mf-Path'] = pathname.length > 0 ? pathname : '/';
161
+ headers['Sys-Code'] = getCreateHistoryOptions().basename.split('/')[1];
162
+ if (window.routeCode) headers['Menu-Code'] = window.routeCode;
163
+ }
164
+ ;
153
165
  var formItemProps = _objectSpread(_objectSpread({}, rest), {}, {
154
166
  action: getUrl('upload'),
155
167
  // 上传地址
156
- headers: {
157
- Authorization: "Bearer ".concat(window.cookie.get(window.appConfig.authSaveKey))
158
- },
168
+ headers: headers,
159
169
  // 请求头
160
170
  name: 'files',
161
171
  multiple: true,
@@ -3,8 +3,10 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
4
  var _excluded = ["uploadUrl", "moduleCode", "bucket", "tag", "note", "config", "supportTypes", "forbiddenTypes", "children", "dataFormat", "listType"];
5
5
  import React from 'react';
6
+ import { replace } from 'lodash';
6
7
  import { BasicFormItem } from 'luck-design';
7
- import { formatMessage, beforeUpload as _beforeUpload, getSupportUploadTypes } from '@luck-design-biz/base/utils';
8
+ import { history, getCreateHistoryOptions } from 'umi';
9
+ import { formatMessage, beforeUpload as _beforeUpload, getSupportUploadTypes, string2ASCII } from '@luck-design-biz/base/utils';
8
10
 
9
11
  /**
10
12
  * 表单类型富文本上传
@@ -45,6 +47,18 @@ function buildComponent(props) {
45
47
  return "".concat(window.appConfig.OSS_HOST_V3, "?moduleCode=").concat(moduleCode, "&behaviorKey=").concat(behaviorKey, "&bucket=").concat(bucket, "&tag=").concat(tag, "&note=").concat(note);
46
48
  };
47
49
  var supportUploadTypes = getSupportUploadTypes(forbiddenTypes, supportTypes);
50
+ var headers = {};
51
+ var token = window.cookie.get(window.appConfig.authSaveKey);
52
+ if (token) headers.Authorization = "Bearer ".concat(token);
53
+ var ticket = history.location.query.ticket;
54
+ if (ticket) headers.ticket = string2ASCII(ticket);
55
+ if (window.__POWERED_BY_QIANKUN__) {
56
+ var pathname = replace(window.location.pathname, getCreateHistoryOptions().basename, '');
57
+ headers['Mf-Path'] = pathname.length > 0 ? pathname : '/';
58
+ headers['Sys-Code'] = getCreateHistoryOptions().basename.split('/')[1];
59
+ if (window.routeCode) headers['Menu-Code'] = window.routeCode;
60
+ }
61
+ ;
48
62
  return /*#__PURE__*/React.createElement(BasicFormItem, _extends({
49
63
  extra: "".concat(formatMessage({
50
64
  id: 'app.upload.supportUpload',
@@ -62,9 +76,7 @@ function buildComponent(props) {
62
76
  }),
63
77
  action: uploadUrl || getUrl('upload'),
64
78
  // 上传地址
65
- headers: {
66
- Authorization: "Bearer ".concat(window.cookie.get(window.appConfig.authSaveKey))
67
- },
79
+ headers: headers,
68
80
  // 请求头
69
81
  name: 'files',
70
82
  // 发送到后台的文件名
@@ -35,7 +35,7 @@ var _excluded = ["onBlur"],
35
35
  _excluded13 = ["handleValueChange", "config", "allowClear"],
36
36
  _excluded14 = ["renderInfoMode"],
37
37
  _excluded15 = ["onChange"],
38
- _excluded16 = ["handleValueChange", "config", "selectorProps", "suppressSelect"],
38
+ _excluded16 = ["handleValueChange", "config", "selectorProps", "suppressSelect", "auth", "leafOnly"],
39
39
  _excluded17 = ["onClose"],
40
40
  _excluded18 = ["handleValueChange", "config"],
41
41
  _excluded19 = ["onChange"],
@@ -243,10 +243,14 @@ var getGroupItem = exports.getGroupItem = function getGroupItem(_ref19) {
243
243
  _ref19$selectorProps = _ref19.selectorProps,
244
244
  selectorProps = _ref19$selectorProps === void 0 ? {} : _ref19$selectorProps,
245
245
  suppressSelect = _ref19.suppressSelect,
246
+ _ref19$auth = _ref19.auth,
247
+ auth = _ref19$auth === void 0 ? false : _ref19$auth,
248
+ _ref19$leafOnly = _ref19.leafOnly,
249
+ leafOnly = _ref19$leafOnly === void 0 ? false : _ref19$leafOnly,
246
250
  props = (0, _objectWithoutProperties2.default)(_ref19, _excluded16);
247
251
  return /*#__PURE__*/_react.default.createElement(_base.TreeSelector, (0, _extends2.default)({}, props, {
248
252
  $attrs: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants.LC_COMPONENT_UNIT_KEY, _constants.LC_FORMITEM_UNIT), 'data-__component', 'FieldGroup'),
249
- api: "/api/base/group/sysGroupTree/noAuthReadJurisTree?sclassKey=".concat(props.sclassKey),
253
+ api: "/api/base/group/sysGroupTree/".concat(auth ? 'noAuthReadJurisTree' : 'noAuthReadNoJurisTree', "?sclassKey=").concat(props.sclassKey, "&ex=").concat(escape(leafOnly ? 'ichildren!=0' : '')),
250
254
  selectorProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, selectorProps), {}, {
251
255
  suppressSelect: suppressSelect
252
256
  }),
@@ -0,0 +1,15 @@
1
+ {
2
+ "component": "Proxy",
3
+ "name": "页面代理",
4
+ "desc": "用于代理其他页面的内容,用于实现已有页面的服用。",
5
+ "icon": "icon-proxy",
6
+ "group": "advance",
7
+ "groupName": "高级",
8
+ "order": 6,
9
+ "css": "width: 100%; height: 100%; background-color: transparent;",
10
+ "destroyOnUnmount": false,
11
+ "proxyParams": [],
12
+ "advance": {
13
+ "events": {}
14
+ }
15
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "component": "Proxy",
3
+ "name": "页面代理",
4
+ "desc": "用于代理其他页面的内容,用于实现已有页面的服用。",
5
+ "icon": "icon-proxy",
6
+ "group": "advance",
7
+ "groupName": "高级",
8
+ "order": 6,
9
+ "props": [
10
+ {
11
+ "key": "id",
12
+ "name": "唯一标识",
13
+ "type": "string",
14
+ "disabled": true
15
+ },
16
+ {
17
+ "key": "destroyOnUnmount",
18
+ "name": "卸载时销毁",
19
+ "type": "switch",
20
+ "default": false
21
+ },
22
+ {
23
+ "key": "proxyCode",
24
+ "name": "页面编码",
25
+ "type": "_ProxyLinker"
26
+ },
27
+ {
28
+ "key": "proxyParams",
29
+ "name": "页面参数",
30
+ "type": "_ProxyParams",
31
+ "wrapper": "collapse",
32
+ "wrapperProps": {
33
+ "suppressIcon": true
34
+ },
35
+ "next": {
36
+ "name": "页面参数对象",
37
+ "autoClose": true,
38
+ "props": [
39
+ {
40
+ "key": "proxyParams",
41
+ "name": "#页面参数对象",
42
+ "type": "_ProxyParamsSetter",
43
+ "default": []
44
+ }
45
+ ]
46
+ }
47
+ }
48
+ ],
49
+ "css": "width: 100%; height: 100%; background-color: transparent;",
50
+ "advance": {
51
+ "events": [
52
+ {
53
+ "key": "onMount",
54
+ "name": "组件首次渲染完成",
55
+ "desc": "在组件首次渲染完成时,执行方法",
56
+ "func": "function onPageMount(){\n\t\n}"
57
+ },
58
+ {
59
+ "key": "onUnmount",
60
+ "name": "组件卸载时",
61
+ "desc": "在组件卸载时,执行方法。",
62
+ "func": "function onPageUnmount(){\n\t\n}"
63
+ }
64
+ ]
65
+ }
66
+ }
@@ -157,12 +157,22 @@ var FilesWall = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
157
157
  });
158
158
  onUploadChange && onUploadChange(e);
159
159
  };
160
+ var headers = {};
161
+ var token = window.cookie.get(window.appConfig.authSaveKey);
162
+ if (token) headers.Authorization = "Bearer ".concat(token);
163
+ var ticket = _umi.history.location.query.ticket;
164
+ if (ticket) headers.ticket = (0, _utils.string2ASCII)(ticket);
165
+ if (window.__POWERED_BY_QIANKUN__) {
166
+ var pathname = (0, _lodash.replace)(window.location.pathname, (0, _umi.getCreateHistoryOptions)().basename, '');
167
+ headers['Mf-Path'] = pathname.length > 0 ? pathname : '/';
168
+ headers['Sys-Code'] = (0, _umi.getCreateHistoryOptions)().basename.split('/')[1];
169
+ if (window.routeCode) headers['Menu-Code'] = window.routeCode;
170
+ }
171
+ ;
160
172
  var formItemProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, rest), {}, {
161
173
  action: getUrl('upload'),
162
174
  // 上传地址
163
- headers: {
164
- Authorization: "Bearer ".concat(window.cookie.get(window.appConfig.authSaveKey))
165
- },
175
+ headers: headers,
166
176
  // 请求头
167
177
  name: 'files',
168
178
  multiple: true,
@@ -9,7 +9,9 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
9
9
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
  var _react = _interopRequireDefault(require("react"));
12
+ var _lodash = require("lodash");
12
13
  var _luckDesign = require("luck-design");
14
+ var _umi = require("umi");
13
15
  var _utils = require("@luck-design-biz/base/utils");
14
16
  var _excluded = ["uploadUrl", "moduleCode", "bucket", "tag", "note", "config", "supportTypes", "forbiddenTypes", "children", "dataFormat", "listType"];
15
17
  /**
@@ -51,6 +53,18 @@ function buildComponent(props) {
51
53
  return "".concat(window.appConfig.OSS_HOST_V3, "?moduleCode=").concat(moduleCode, "&behaviorKey=").concat(behaviorKey, "&bucket=").concat(bucket, "&tag=").concat(tag, "&note=").concat(note);
52
54
  };
53
55
  var supportUploadTypes = (0, _utils.getSupportUploadTypes)(forbiddenTypes, supportTypes);
56
+ var headers = {};
57
+ var token = window.cookie.get(window.appConfig.authSaveKey);
58
+ if (token) headers.Authorization = "Bearer ".concat(token);
59
+ var ticket = _umi.history.location.query.ticket;
60
+ if (ticket) headers.ticket = (0, _utils.string2ASCII)(ticket);
61
+ if (window.__POWERED_BY_QIANKUN__) {
62
+ var pathname = (0, _lodash.replace)(window.location.pathname, (0, _umi.getCreateHistoryOptions)().basename, '');
63
+ headers['Mf-Path'] = pathname.length > 0 ? pathname : '/';
64
+ headers['Sys-Code'] = (0, _umi.getCreateHistoryOptions)().basename.split('/')[1];
65
+ if (window.routeCode) headers['Menu-Code'] = window.routeCode;
66
+ }
67
+ ;
54
68
  return /*#__PURE__*/_react.default.createElement(_luckDesign.BasicFormItem, (0, _extends2.default)({
55
69
  extra: "".concat((0, _utils.formatMessage)({
56
70
  id: 'app.upload.supportUpload',
@@ -68,9 +82,7 @@ function buildComponent(props) {
68
82
  }),
69
83
  action: uploadUrl || getUrl('upload'),
70
84
  // 上传地址
71
- headers: {
72
- Authorization: "Bearer ".concat(window.cookie.get(window.appConfig.authSaveKey))
73
- },
85
+ headers: headers,
74
86
  // 请求头
75
87
  name: 'files',
76
88
  // 发送到后台的文件名
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luck-design-biz/luckda",
3
- "version": "1.0.1-11gcjs2",
3
+ "version": "1.0.1-11gcjs4",
4
4
  "description": "前端配置管理中心业务组件库",
5
5
  "scripts": {
6
6
  "start": "cross-env NODE_OPTIONS=--max-old-space-size=10240 USER_RUNTIME=SITE RUNTIME=dev umi dev",
@@ -107,6 +107,7 @@
107
107
  "cross-var": "^1.1.0",
108
108
  "d3-selection": "^1.4.2",
109
109
  "dry-dry": "^0.4.0",
110
+ "enzyme": "^3.11.0",
110
111
  "eslint": "^7.32.0",
111
112
  "eslint-plugin-babel": "^5.3.1",
112
113
  "eslint-plugin-react": "^7.31.10",