@arim-aisdc/public-components 2.2.0 → 2.2.2

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.
@@ -17,7 +17,7 @@ export declare const foramtBaseInfoField: (data: any, dataField: BaseInfoFieldTy
17
17
  value: any;
18
18
  field: string;
19
19
  label?: string;
20
- text: string | JSX.Element | Element;
20
+ text: string | Element | JSX.Element;
21
21
  units?: string;
22
22
  width?: string;
23
23
  labelWidth?: string;
@@ -399,6 +399,7 @@ var CustomForm = function CustomForm(_ref, ref) {
399
399
  case CustomFormItemType.DateTime:
400
400
  element = /*#__PURE__*/_jsx(DatePicker, {
401
401
  showTime: true,
402
+ picker: (item === null || item === void 0 ? void 0 : item.picker) || 'date',
402
403
  style: {
403
404
  width: item !== null && item !== void 0 && item.wapperWidth ? item === null || item === void 0 ? void 0 : item.wapperWidth : '100%'
404
405
  }
@@ -34,6 +34,10 @@ var UploadImg = function UploadImg(_ref) {
34
34
  _useState4 = _slicedToArray(_useState3, 2),
35
35
  imageUrl = _useState4[0],
36
36
  setImageUrl = _useState4[1];
37
+ var _useState5 = useState('上传'),
38
+ _useState6 = _slicedToArray(_useState5, 2),
39
+ operateText = _useState6[0],
40
+ setOperateText = _useState6[1];
37
41
 
38
42
  // 获取图片URL
39
43
  var getIMGUrl = /*#__PURE__*/function () {
@@ -42,43 +46,48 @@ var UploadImg = function UploadImg(_ref) {
42
46
  return _regeneratorRuntime().wrap(function _callee$(_context) {
43
47
  while (1) switch (_context.prev = _context.next) {
44
48
  case 0:
49
+ setLoading(true);
50
+ setOperateText('获取中...');
45
51
  url = "".concat(item === null || item === void 0 ? void 0 : item.baseUrl, "/api/file-management/file-descriptor/content");
46
52
  query = {
47
53
  id: id
48
54
  };
49
- _context.prev = 2;
50
- _context.next = 5;
55
+ _context.prev = 4;
56
+ _context.next = 7;
51
57
  return fetch("".concat(url, "?id=").concat(query.id), {
52
58
  method: 'GET',
53
59
  headers: {
54
60
  Authorization: "Bearer ".concat(item === null || item === void 0 ? void 0 : item.token)
55
61
  }
56
62
  });
57
- case 5:
63
+ case 7:
58
64
  response = _context.sent;
59
65
  if (!response.ok) {
60
- _context.next = 12;
66
+ _context.next = 14;
61
67
  break;
62
68
  }
63
- _context.next = 9;
69
+ _context.next = 11;
64
70
  return response.text();
65
- case 9:
71
+ case 11:
66
72
  data = _context.sent.replace(/^"|"$/g, '');
67
73
  baseIMG = "data:image/png;base64,".concat(data);
68
74
  setImageUrl(baseIMG);
69
- case 12:
70
- _context.next = 18;
71
- break;
72
75
  case 14:
73
- _context.prev = 14;
74
- _context.t0 = _context["catch"](2);
76
+ _context.next = 20;
77
+ break;
78
+ case 16:
79
+ _context.prev = 16;
80
+ _context.t0 = _context["catch"](4);
75
81
  setImageUrl('');
76
82
  message.error('获取图片失败');
77
- case 18:
83
+ case 20:
84
+ setLoading(false);
85
+ setOperateText('上传');
86
+ case 22:
78
87
  case "end":
79
88
  return _context.stop();
80
89
  }
81
- }, _callee, null, [[2, 14]]);
90
+ }, _callee, null, [[4, 16]]);
82
91
  }));
83
92
  return function getIMGUrl(_x) {
84
93
  return _ref2.apply(this, arguments);
@@ -88,13 +97,22 @@ var UploadImg = function UploadImg(_ref) {
88
97
  // 处理图片上传
89
98
  var handleChange = function handleChange(_ref3) {
90
99
  var file = _ref3.file;
91
- setLoading(true);
92
- if ((file === null || file === void 0 ? void 0 : file.status) === 'done') {
100
+ if (file.status === 'uploading') {
101
+ setLoading(true);
102
+ setOperateText('上传中...');
103
+ return;
104
+ }
105
+ if (file.status === 'done') {
93
106
  var _file$response;
107
+ setLoading(false);
94
108
  message.success('上传成功');
95
109
  onChange === null || onChange === void 0 || onChange(file === null || file === void 0 || (_file$response = file.response) === null || _file$response === void 0 ? void 0 : _file$response.id);
96
110
  }
97
- setLoading(false);
111
+ if (file.status === 'error') {
112
+ setLoading(false);
113
+ message.error('上传失败');
114
+ setOperateText('上传');
115
+ }
98
116
  };
99
117
 
100
118
  // 初始化时如果有value则获取图片
@@ -108,10 +126,11 @@ var UploadImg = function UploadImg(_ref) {
108
126
  style: {
109
127
  marginTop: 8
110
128
  },
111
- children: "Upload"
129
+ children: operateText
112
130
  })]
113
131
  });
114
132
  return /*#__PURE__*/_jsx(Upload, {
133
+ accept: ".jpg, .jpeg, .png, .gif, .bmp, .webp, .svg",
115
134
  listType: "picture-card",
116
135
  name: "file",
117
136
  showUploadList: false,
@@ -58,6 +58,8 @@ export declare enum PickerType {
58
58
  Week = "week",
59
59
  Quarter = "quarter "
60
60
  }
61
+ type PanelMode = 'time' | 'date' | 'week' | 'month' | 'quarter' | 'year' | 'decade';
62
+ export type PickerMode = Exclude<PanelMode, 'datetime' | 'decade'>;
61
63
  export type CustomSearchFieldType = {
62
64
  field: string;
63
65
  label?: ReactNode | string;
@@ -70,7 +72,7 @@ export type CustomSearchFieldType = {
70
72
  maxLength?: number;
71
73
  rows?: number;
72
74
  wapperWidth?: number;
73
- picker?: PickerType;
75
+ picker?: PickerType | PickerMode;
74
76
  defaultFormat?: any;
75
77
  showTimeFormat?: any;
76
78
  allowClear?: boolean;
@@ -121,7 +123,7 @@ export type CustomSearchFieldType = {
121
123
  labelInValue?: boolean;
122
124
  baseUrl?: string;
123
125
  token?: any;
124
- method?: "POST" | "PUT" | "PATCH";
126
+ method?: 'POST' | 'PUT' | 'PATCH';
125
127
  };
126
128
  export interface CustomFormProps {
127
129
  data: CustomSearchFieldType[];
@@ -159,3 +161,4 @@ export interface CustomFormProps {
159
161
  labelAlign?: FormLabelAlign;
160
162
  btnSpan?: number;
161
163
  }
164
+ export {};
@@ -133,6 +133,9 @@
133
133
  box-sizing: border-box;
134
134
  height: fit-content;
135
135
  flex: 1;
136
+ .cell-wapper {
137
+ line-height: @global-table-max-header-cell-wapper-line-height;
138
+ }
136
139
  }
137
140
 
138
141
  .table-header-scroll {
@@ -146,6 +149,9 @@
146
149
  overflow: auto scroll;
147
150
  font-weight: @global-table-max-body-font-weight;
148
151
  // background: @tableColor2;
152
+ .tbody-tr-td {
153
+ line-height: @global-table-body-tbody-tr-td-line-height;
154
+ }
149
155
 
150
156
  &::-webkit-scrollbar {
151
157
  width: 10px;
@@ -66,4 +66,5 @@
66
66
  @global-table-max-scrollbar-track: var(--global-table-max-scrollbar-track, #E8E8E8);
67
67
  @global-table-max-header-font-weight: var(--global-table-max-header-font-weight);
68
68
  @global-table-max-body-font-weight: var(--global-table-max-body-font-weight);
69
-
69
+ @global-table-max-header-cell-wapper-line-height: var(--global-table-max-header-cell-wapper-line-height, 16px);
70
+ @global-table-body-tbody-tr-td-line-height: var(--global-table-body-tbody-tr-td-line-height, 32px);
@@ -14,19 +14,22 @@ var tableMaxCommonStyle = {
14
14
  '--global-table-max-center-border-radius': 'unset',
15
15
  '--global-table-max-center-border-bottom': 'none',
16
16
  '--global-table-max-header-font-weight': '400',
17
- '--global-table-max-body-font-weight': '400'
17
+ '--global-table-max-body-font-weight': '400',
18
+ '--global-table-max-header-cell-wapper-line-height': '16px',
19
+ '--global-table-body-tbody-tr-td-line-height': '32px'
18
20
  };
19
21
  var tableMaxCommonStyleTwo = {
20
22
  '--global-table-max-padding-top': '8px',
21
23
  '--global-table-max-padding-left': '8px',
22
24
  '--global-table-max-padding-right': '16px',
23
25
  '--global-table-max-padding-bottom': '7px',
24
- '--global-table-max-border': '1px solid #D9D9D9',
25
26
  '--global-table-max-footer-border-radius': '0px 0px 8px 8px',
26
27
  '--global-table-max-center-border-radius': '8px 8px 0px 0px',
27
28
  '--global-table-max-center-border-bottom': 'none',
28
29
  '--global-table-max-header-font-weight': '500',
29
- '--global-table-max-body-font-weight': '400'
30
+ '--global-table-max-body-font-weight': '400',
31
+ '--global-table-max-header-cell-wapper-line-height': '32px',
32
+ '--global-table-body-tbody-tr-td-line-height': '42px'
30
33
  };
31
34
  export var PublicThemeVariablesConfig = {
32
35
  light: _objectSpread({
@@ -268,7 +271,8 @@ export var PublicThemeVariablesConfigTwo = {
268
271
  // 卡片、表格body背景色 -1
269
272
  '--global-card-effect-background-color': '#E8E8E8',
270
273
  '--global-default-text-color': '#242A30',
271
- '--global-table-max-scrollbar-track': '#E8E8E8'
274
+ '--global-table-max-scrollbar-track': '#E8E8E8',
275
+ '--global-table-max-border': '1px solid #D9D9D9'
272
276
  }, tableMaxCommonStyleTwo),
273
277
  dark: _objectSpread({
274
278
  '--global-curd-input-background-color': '#494c5dff',
@@ -349,7 +353,8 @@ export var PublicThemeVariablesConfigTwo = {
349
353
  // 卡片、表格body背景色 -1
350
354
  '--global-card-effect-background-color': '#1E345B',
351
355
  '--global-default-text-color': '#fff',
352
- '--global-table-max-scrollbar-track': '#334155'
356
+ '--global-table-max-scrollbar-track': '#334155',
357
+ '--global-table-max-border': '1px solid #475569'
353
358
  }, tableMaxCommonStyleTwo)
354
359
  };
355
360
  export var publicThemeMap = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arim-aisdc/public-components",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "前端组件库",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",