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

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.
@@ -146,7 +146,10 @@ var LCGroupTree = function LCGroupTree(_ref) {
146
146
  }, title ? /*#__PURE__*/React.createElement(Title, {
147
147
  $theme: document.body.getAttribute('luck-theme')
148
148
  }, title) : null, /*#__PURE__*/React.createElement(Spin, {
149
- spinning: loading
149
+ spinning: loading,
150
+ style: {
151
+ height: 'fit-content'
152
+ }
150
153
  }, dataSource ? /*#__PURE__*/React.createElement(GroupTree, {
151
154
  blockNode: true,
152
155
  defaultExpandAll: defaultExpandAll,
@@ -187,9 +190,9 @@ LCGroupTree.propTypes = {
187
190
  */
188
191
  onlySelectLeaf: PropTypes.bool,
189
192
  /**
190
- * @name 允许取消选中
191
- * @type switch
192
- */
193
+ * @name 允许取消选中
194
+ * @type switch
195
+ */
193
196
  cancelSelect: PropTypes.bool,
194
197
  /**
195
198
  * @name 允许取消选中
@@ -4,15 +4,15 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
5
  var _excluded = ["formId", "formRef", "showNote", "operates", "loading", "uploadUrl", "supportTypes", "forbiddenTypes", "beforeUpload", "formMode", "onUploadChange", "zipName", "resetActions", "getUrl", "wrapperRef"];
6
6
  import React, { useState, useRef, forwardRef } from 'react';
7
- import { getDvaApp } from 'umi';
7
+ import { getDvaApp, history, getCreateHistoryOptions } from 'umi';
8
8
  import { useMemoizedFn, useCreation } from 'ahooks';
9
9
  import { Button, Upload, Tooltip, Icon } from 'luck-design/antd';
10
10
  import moment from 'moment';
11
- import { last } from 'lodash';
11
+ import { last, replace } from 'lodash';
12
12
  import { BasicForm, BasicFormItem, PopWindow } from 'luck-design';
13
13
  import api from "@/services/ApiConfig";
14
14
  import { FormBtn, GridForm } from '@luck-design-biz/base/FormList';
15
- import { byteConvert, formatMessage, beforeUpload as _beforeUpload2, getSupportUploadTypes, patchDownloadZip, showPop, request, canPreview } from '@luck-design-biz/base/utils';
15
+ import { byteConvert, formatMessage, beforeUpload as _beforeUpload2, getSupportUploadTypes, patchDownloadZip, showPop, request, canPreview, string2ASCII } from '@luck-design-biz/base/utils';
16
16
  var columns = [{
17
17
  field: 'name',
18
18
  title: '附件名称'
@@ -198,12 +198,22 @@ var UploadGridForm = function UploadGridForm(_ref) {
198
198
  }
199
199
  });
200
200
  var renderUploadTopLeft = useMemoizedFn(function () {
201
+ var headers = {};
202
+ var token = window.cookie.get(window.appConfig.authSaveKey);
203
+ if (token) headers.Authorization = "Bearer ".concat(token);
204
+ var ticket = history.location.query.ticket;
205
+ if (ticket) headers.ticket = string2ASCII(ticket);
206
+ if (window.__POWERED_BY_QIANKUN__) {
207
+ var pathname = replace(window.location.pathname, getCreateHistoryOptions().basename, '');
208
+ headers['Mf-Path'] = pathname.length > 0 ? pathname : '/';
209
+ headers['Sys-Code'] = getCreateHistoryOptions().basename.split('/')[1];
210
+ if (window.routeCode) headers['Menu-Code'] = window.routeCode;
211
+ }
212
+ ;
201
213
  var formItemProps = {
202
214
  action: uploadUrl || getUrl('upload'),
203
215
  // 上传地址
204
- headers: {
205
- Authorization: "Bearer ".concat(window.cookie.get(window.appConfig.authSaveKey))
206
- },
216
+ headers: headers,
207
217
  // 请求头
208
218
  name: 'files',
209
219
  multiple: true,
package/es/utils/grid.js CHANGED
@@ -196,6 +196,7 @@ export var getGridColumn = function getGridColumn() {
196
196
  break;
197
197
  case 'select':
198
198
  case 'radio':
199
+ case 'dict':
199
200
  data.filter = 'select';
200
201
  if (_props.alias) {
201
202
  data.filterParams = {
@@ -269,6 +270,7 @@ export var getGridColumn = function getGridColumn() {
269
270
  case 'select':
270
271
  case 'group':
271
272
  case 'complex':
273
+ case 'dict':
272
274
  if (translateProps.multiple) {
273
275
  formItemProps = {
274
276
  dataFormat: function dataFormat(value) {
@@ -154,7 +154,10 @@ var LCGroupTree = function LCGroupTree(_ref) {
154
154
  }, title ? /*#__PURE__*/_react.default.createElement(Title, {
155
155
  $theme: document.body.getAttribute('luck-theme')
156
156
  }, title) : null, /*#__PURE__*/_react.default.createElement(_antd.Spin, {
157
- spinning: loading
157
+ spinning: loading,
158
+ style: {
159
+ height: 'fit-content'
160
+ }
158
161
  }, dataSource ? /*#__PURE__*/_react.default.createElement(GroupTree, {
159
162
  blockNode: true,
160
163
  defaultExpandAll: defaultExpandAll,
@@ -195,9 +198,9 @@ LCGroupTree.propTypes = {
195
198
  */
196
199
  onlySelectLeaf: _propTypes.default.bool,
197
200
  /**
198
- * @name 允许取消选中
199
- * @type switch
200
- */
201
+ * @name 允许取消选中
202
+ * @type switch
203
+ */
201
204
  cancelSelect: _propTypes.default.bool,
202
205
  /**
203
206
  * @name 允许取消选中
@@ -206,12 +206,22 @@ var UploadGridForm = function UploadGridForm(_ref) {
206
206
  }
207
207
  });
208
208
  var renderUploadTopLeft = (0, _ahooks.useMemoizedFn)(function () {
209
+ var headers = {};
210
+ var token = window.cookie.get(window.appConfig.authSaveKey);
211
+ if (token) headers.Authorization = "Bearer ".concat(token);
212
+ var ticket = _umi.history.location.query.ticket;
213
+ if (ticket) headers.ticket = (0, _utils.string2ASCII)(ticket);
214
+ if (window.__POWERED_BY_QIANKUN__) {
215
+ var pathname = (0, _lodash.replace)(window.location.pathname, (0, _umi.getCreateHistoryOptions)().basename, '');
216
+ headers['Mf-Path'] = pathname.length > 0 ? pathname : '/';
217
+ headers['Sys-Code'] = (0, _umi.getCreateHistoryOptions)().basename.split('/')[1];
218
+ if (window.routeCode) headers['Menu-Code'] = window.routeCode;
219
+ }
220
+ ;
209
221
  var formItemProps = {
210
222
  action: uploadUrl || getUrl('upload'),
211
223
  // 上传地址
212
- headers: {
213
- Authorization: "Bearer ".concat(window.cookie.get(window.appConfig.authSaveKey))
214
- },
224
+ headers: headers,
215
225
  // 请求头
216
226
  name: 'files',
217
227
  multiple: true,
package/lib/utils/grid.js CHANGED
@@ -204,6 +204,7 @@ var getGridColumn = exports.getGridColumn = function getGridColumn() {
204
204
  break;
205
205
  case 'select':
206
206
  case 'radio':
207
+ case 'dict':
207
208
  data.filter = 'select';
208
209
  if (_props.alias) {
209
210
  data.filterParams = {
@@ -277,6 +278,7 @@ var getGridColumn = exports.getGridColumn = function getGridColumn() {
277
278
  case 'select':
278
279
  case 'group':
279
280
  case 'complex':
281
+ case 'dict':
280
282
  if (translateProps.multiple) {
281
283
  formItemProps = {
282
284
  dataFormat: function dataFormat(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luck-design-biz/luckda",
3
- "version": "1.0.1-11",
3
+ "version": "1.0.1-11gcjs2",
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,7 +107,6 @@
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",
111
110
  "eslint": "^7.32.0",
112
111
  "eslint-plugin-babel": "^5.3.1",
113
112
  "eslint-plugin-react": "^7.31.10",
@@ -1,16 +0,0 @@
1
- {
2
- "component": "FieldDatadic",
3
- "name": "数据字典",
4
- "group": "field",
5
- "desc": "数据字典类型表单项",
6
- "icon": "icon-fieldstring",
7
- "groupName": "表单项",
8
- "order": 1,
9
- "display": "select",
10
- "multiple": false,
11
- "isTree": false,
12
- "allowClear": false,
13
- "advance": {
14
- "events": {}
15
- }
16
- }
@@ -1,73 +0,0 @@
1
- {
2
- "component": "FieldDatadic",
3
- "name": "数据字典",
4
- "group": "field",
5
- "desc": "数据字典类型表单项",
6
- "icon": "icon-fieldstring",
7
- "groupName": "表单项",
8
- "order": 1,
9
- "props": [
10
- {
11
- "key": "alias",
12
- "name": "字典key",
13
- "type": "string"
14
- },
15
- {
16
- "key": "valueField",
17
- "name": "实际值字段",
18
- "type": "string"
19
- },
20
- {
21
- "key": "labelField",
22
- "name": "翻译值字段",
23
- "type": "string"
24
- },
25
- {
26
- "key": "display",
27
- "name": "展现形式",
28
- "type": "segmented",
29
- "options": [
30
- {
31
- "label": "Select",
32
- "value": "select"
33
- },
34
- {
35
- "label": "Radio",
36
- "value": "radio"
37
- }
38
- ],
39
- "default": "select"
40
- },
41
- {
42
- "key": "multiple",
43
- "name": "多选",
44
- "desc": "仅在展现形式为Select时有效",
45
- "type": "switch",
46
- "default": false
47
- },
48
- {
49
- "key": "isTree",
50
- "name": "树形结构",
51
- "desc": "用于规定树形结构的数据字典,仅在展现形式为Select时有效",
52
- "type": "switch",
53
- "default": false
54
- },
55
- {
56
- "key": "allowClear",
57
- "name": "允许清除",
58
- "desc": "仅在展现形式为Select时有效",
59
- "type": "switch",
60
- "default": false
61
- }
62
- ],
63
- "advance": {
64
- "events": [
65
- {
66
- "key": "onChange",
67
- "name": "数据变化事件",
68
- "desc": "在数据变化事件时,执行方法",
69
- "func": "function onChange(data) {\n\t\n}"
70
- }
71
- ]
72
- }
73
- }
@@ -1,16 +0,0 @@
1
- {
2
- "component": "FieldDatadic",
3
- "name": "数据字典",
4
- "group": "field",
5
- "desc": "数据字典类型表单项",
6
- "icon": "icon-fieldstring",
7
- "groupName": "表单项",
8
- "order": 1,
9
- "display": "select",
10
- "multiple": false,
11
- "isTree": false,
12
- "allowClear": false,
13
- "advance": {
14
- "events": {}
15
- }
16
- }
@@ -1,73 +0,0 @@
1
- {
2
- "component": "FieldDatadic",
3
- "name": "数据字典",
4
- "group": "field",
5
- "desc": "数据字典类型表单项",
6
- "icon": "icon-fieldstring",
7
- "groupName": "表单项",
8
- "order": 1,
9
- "props": [
10
- {
11
- "key": "alias",
12
- "name": "字典key",
13
- "type": "string"
14
- },
15
- {
16
- "key": "valueField",
17
- "name": "实际值字段",
18
- "type": "string"
19
- },
20
- {
21
- "key": "labelField",
22
- "name": "翻译值字段",
23
- "type": "string"
24
- },
25
- {
26
- "key": "display",
27
- "name": "展现形式",
28
- "type": "segmented",
29
- "options": [
30
- {
31
- "label": "Select",
32
- "value": "select"
33
- },
34
- {
35
- "label": "Radio",
36
- "value": "radio"
37
- }
38
- ],
39
- "default": "select"
40
- },
41
- {
42
- "key": "multiple",
43
- "name": "多选",
44
- "desc": "仅在展现形式为Select时有效",
45
- "type": "switch",
46
- "default": false
47
- },
48
- {
49
- "key": "isTree",
50
- "name": "树形结构",
51
- "desc": "用于规定树形结构的数据字典,仅在展现形式为Select时有效",
52
- "type": "switch",
53
- "default": false
54
- },
55
- {
56
- "key": "allowClear",
57
- "name": "允许清除",
58
- "desc": "仅在展现形式为Select时有效",
59
- "type": "switch",
60
- "default": false
61
- }
62
- ],
63
- "advance": {
64
- "events": [
65
- {
66
- "key": "onChange",
67
- "name": "数据变化事件",
68
- "desc": "在数据变化事件时,执行方法",
69
- "func": "function onChange(data) {\n\t\n}"
70
- }
71
- ]
72
- }
73
- }