@hw-component/form 1.10.71 → 1.10.73
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/es/Form/index.js +1 -2
- package/es/Upload/index.js +23 -18
- package/es/Upload/modal.d.ts +1 -0
- package/es/index.css +31 -9
- package/lib/Form/index.js +1 -2
- package/lib/Upload/index.js +22 -17
- package/lib/Upload/modal.d.ts +1 -0
- package/lib/index.css +31 -9
- package/package.json +1 -1
- package/src/components/Form/index.less +14 -4
- package/src/components/Form/index.tsx +1 -1
- package/src/components/Upload/index.tsx +22 -18
- package/src/components/Upload/modal.ts +1 -0
- package/src/pages/Form/index.tsx +1 -1
- package/src/pages/Upload/index.tsx +2 -0
package/es/Form/index.js
CHANGED
|
@@ -27,8 +27,7 @@ var HForm = (function (_ref) {
|
|
|
27
27
|
formHideLabel = _ref$hideLabel === void 0 ? false : _ref$hideLabel,
|
|
28
28
|
gutter = _ref.gutter,
|
|
29
29
|
submitLoading = _ref.submitLoading,
|
|
30
|
-
|
|
31
|
-
formLabelAlign = _ref$labelAlign === void 0 ? "right" : _ref$labelAlign,
|
|
30
|
+
formLabelAlign = _ref.labelAlign,
|
|
32
31
|
formItemStyle = _ref.formItemStyle,
|
|
33
32
|
_ref$itemProps = _ref.itemProps,
|
|
34
33
|
formItemProps = _ref$itemProps === void 0 ? {} : _ref$itemProps,
|
package/es/Upload/index.js
CHANGED
|
@@ -7,11 +7,11 @@ import React, { useState, useImperativeHandle, useMemo } from 'react';
|
|
|
7
7
|
import { useProps } from './hooks/propsMaker.js';
|
|
8
8
|
import Preview from './Preview/index.js';
|
|
9
9
|
import { useChange } from './hooks/change.js';
|
|
10
|
-
import { Upload } from 'antd';
|
|
10
|
+
import { Space, Upload } from 'antd';
|
|
11
11
|
import Btn from './Btn.js';
|
|
12
12
|
import HFormConnect from '../Form/HFormConnect.js';
|
|
13
13
|
|
|
14
|
-
var _excluded = ["value", "onChange", "listType", "exFiles", "maxCount", "maxRowNum", "onPreview", "request", "maxSize", "addFormat", "thumbUrl", "hideAddBtn", "children"];
|
|
14
|
+
var _excluded = ["value", "onChange", "listType", "exFiles", "maxCount", "maxRowNum", "onPreview", "request", "maxSize", "addFormat", "thumbUrl", "hideAddBtn", "children", "addonBefore"];
|
|
15
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
16
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
17
|
var Index = function Index(_ref, ref) {
|
|
@@ -32,6 +32,7 @@ var Index = function Index(_ref, ref) {
|
|
|
32
32
|
thumbUrl = _ref.thumbUrl,
|
|
33
33
|
hideAddBtn = _ref.hideAddBtn,
|
|
34
34
|
children = _ref.children,
|
|
35
|
+
addonBefore = _ref.addonBefore,
|
|
35
36
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
36
37
|
var matchProps = useProps({
|
|
37
38
|
request: request,
|
|
@@ -118,23 +119,27 @@ var Index = function Index(_ref, ref) {
|
|
|
118
119
|
var upListType = listType === null ? undefined : listType;
|
|
119
120
|
return jsxs("div", {
|
|
120
121
|
style: contentStyle,
|
|
121
|
-
children: [
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
onPreview: preview,
|
|
126
|
-
onChange: change,
|
|
127
|
-
beforeUpload: function beforeUpload() {
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
}, props), {}, {
|
|
131
|
-
children: hideAddBtn ? null : jsx(Btn, {
|
|
132
|
-
value: relVal,
|
|
133
|
-
maxCount: maxCount,
|
|
122
|
+
children: [jsxs(Space, {
|
|
123
|
+
size: 8,
|
|
124
|
+
align: "start",
|
|
125
|
+
children: [addonBefore, jsx(Upload, _objectSpread(_objectSpread({
|
|
134
126
|
listType: upListType,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
127
|
+
maxCount: maxNum,
|
|
128
|
+
fileList: relVal,
|
|
129
|
+
onPreview: preview,
|
|
130
|
+
onChange: change,
|
|
131
|
+
beforeUpload: function beforeUpload() {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
}, props), {}, {
|
|
135
|
+
children: hideAddBtn ? null : jsx(Btn, {
|
|
136
|
+
value: relVal,
|
|
137
|
+
maxCount: maxCount,
|
|
138
|
+
listType: upListType,
|
|
139
|
+
children: children
|
|
140
|
+
})
|
|
141
|
+
}))]
|
|
142
|
+
}), jsx(Preview, {
|
|
138
143
|
visible: visible,
|
|
139
144
|
file: previewFile,
|
|
140
145
|
onCancel: function onCancel() {
|
package/es/Upload/modal.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export interface IUpLoadProps extends Omit<UploadProps, "onChange" | "listType"
|
|
|
22
22
|
hideAddBtn?: boolean;
|
|
23
23
|
listType?: UploadListType | null;
|
|
24
24
|
onPreview?: UploadProps["onPreview"] | null;
|
|
25
|
+
addonBefore?: React.ReactNode;
|
|
25
26
|
}
|
|
26
27
|
export interface IMediaTypeEleProps {
|
|
27
28
|
file?: UploadFile;
|
package/es/index.css
CHANGED
|
@@ -82,18 +82,18 @@
|
|
|
82
82
|
align-items: center;
|
|
83
83
|
min-height: 32px;
|
|
84
84
|
}
|
|
85
|
-
.ant-hw-form-base-item-top-left .ant-form-item-label > label {
|
|
85
|
+
.ant-hw-form-base-item-top-left > .ant-form-item-row .ant-form-item-label > label {
|
|
86
86
|
height: auto;
|
|
87
87
|
}
|
|
88
|
-
.ant-hw-form-base-item-top-left .ant-hw-form-item-colon {
|
|
88
|
+
.ant-hw-form-base-item-top-left > .ant-form-item-row .ant-hw-form-item-colon {
|
|
89
89
|
text-align: left;
|
|
90
90
|
}
|
|
91
|
-
.ant-hw-form-base-item-top-left .ant-hw-form-item-required {
|
|
91
|
+
.ant-hw-form-base-item-top-left > .ant-form-item-row .ant-hw-form-item-required {
|
|
92
92
|
position: absolute;
|
|
93
93
|
top: 0;
|
|
94
94
|
left: -10px;
|
|
95
95
|
}
|
|
96
|
-
.ant-hw-form-base-item-top-left .ant-hw-form-label-item {
|
|
96
|
+
.ant-hw-form-base-item-top-left > .ant-form-item-row .ant-hw-form-label-item {
|
|
97
97
|
position: relative;
|
|
98
98
|
display: -webkit-box;
|
|
99
99
|
display: -webkit-flex;
|
|
@@ -104,16 +104,38 @@
|
|
|
104
104
|
-ms-flex-align: center;
|
|
105
105
|
align-items: center;
|
|
106
106
|
}
|
|
107
|
-
.ant-hw-form-base-item-top-right .ant-form-item-label > label {
|
|
107
|
+
.ant-hw-form-base-item-top-right > .ant-form-item-row .ant-form-item-label > label {
|
|
108
108
|
height: auto;
|
|
109
109
|
}
|
|
110
|
-
.ant-hw-form-base-item-top-right .ant-hw-form-item-colon {
|
|
110
|
+
.ant-hw-form-base-item-top-right > .ant-form-item-row .ant-hw-form-item-colon {
|
|
111
111
|
text-align: right;
|
|
112
112
|
}
|
|
113
|
-
.ant-hw-form-base-item-top .ant-form-item-
|
|
113
|
+
.ant-hw-form-base-item-top-right > .ant-form-item-row .ant-hw-form-label-item {
|
|
114
|
+
position: relative;
|
|
115
|
+
display: -webkit-box;
|
|
116
|
+
display: -webkit-flex;
|
|
117
|
+
display: -ms-flexbox;
|
|
118
|
+
display: flex;
|
|
119
|
+
-webkit-box-align: center;
|
|
120
|
+
-webkit-align-items: center;
|
|
121
|
+
-ms-flex-align: center;
|
|
122
|
+
align-items: center;
|
|
123
|
+
}
|
|
124
|
+
.ant-hw-form-base-item-top > .ant-form-item-row .ant-form-item-label > label {
|
|
114
125
|
height: auto;
|
|
115
126
|
}
|
|
116
|
-
.ant-hw-form-base-item-
|
|
127
|
+
.ant-hw-form-base-item-top > .ant-form-item-row .ant-hw-form-label-item {
|
|
128
|
+
position: relative;
|
|
129
|
+
display: -webkit-box;
|
|
130
|
+
display: -webkit-flex;
|
|
131
|
+
display: -ms-flexbox;
|
|
132
|
+
display: flex;
|
|
133
|
+
-webkit-box-align: center;
|
|
134
|
+
-webkit-align-items: center;
|
|
135
|
+
-ms-flex-align: center;
|
|
136
|
+
align-items: center;
|
|
137
|
+
}
|
|
138
|
+
.ant-hw-form-base-item-right > .ant-form-item-row > .ant-form-item-label .ant-hw-form-label-item {
|
|
117
139
|
display: -webkit-box;
|
|
118
140
|
display: -webkit-flex;
|
|
119
141
|
display: -ms-flexbox;
|
|
@@ -127,7 +149,7 @@
|
|
|
127
149
|
-ms-flex-pack: end;
|
|
128
150
|
justify-content: end;
|
|
129
151
|
}
|
|
130
|
-
.ant-hw-form-base-item-right > .ant-form-item-label .ant-form-item-label > label {
|
|
152
|
+
.ant-hw-form-base-item-right > .ant-form-item-row > .ant-form-item-label .ant-form-item-label > label {
|
|
131
153
|
height: 32px;
|
|
132
154
|
}
|
|
133
155
|
.ant-hw-form-base-item-left > .ant-form-item-row > .ant-form-item-label .ant-hw-form-label-item {
|
package/lib/Form/index.js
CHANGED
|
@@ -30,8 +30,7 @@ var HForm = (function (_ref) {
|
|
|
30
30
|
formHideLabel = _ref$hideLabel === void 0 ? false : _ref$hideLabel,
|
|
31
31
|
gutter = _ref.gutter,
|
|
32
32
|
submitLoading = _ref.submitLoading,
|
|
33
|
-
|
|
34
|
-
formLabelAlign = _ref$labelAlign === void 0 ? "right" : _ref$labelAlign,
|
|
33
|
+
formLabelAlign = _ref.labelAlign,
|
|
35
34
|
formItemStyle = _ref.formItemStyle,
|
|
36
35
|
_ref$itemProps = _ref.itemProps,
|
|
37
36
|
formItemProps = _ref$itemProps === void 0 ? {} : _ref$itemProps,
|
package/lib/Upload/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var antd = require('antd');
|
|
|
14
14
|
var Btn = require('./Btn.js');
|
|
15
15
|
var HFormConnect = require('../Form/HFormConnect.js');
|
|
16
16
|
|
|
17
|
-
var _excluded = ["value", "onChange", "listType", "exFiles", "maxCount", "maxRowNum", "onPreview", "request", "maxSize", "addFormat", "thumbUrl", "hideAddBtn", "children"];
|
|
17
|
+
var _excluded = ["value", "onChange", "listType", "exFiles", "maxCount", "maxRowNum", "onPreview", "request", "maxSize", "addFormat", "thumbUrl", "hideAddBtn", "children", "addonBefore"];
|
|
18
18
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
19
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
20
|
var Index = function Index(_ref, ref) {
|
|
@@ -35,6 +35,7 @@ var Index = function Index(_ref, ref) {
|
|
|
35
35
|
thumbUrl = _ref.thumbUrl,
|
|
36
36
|
hideAddBtn = _ref.hideAddBtn,
|
|
37
37
|
children = _ref.children,
|
|
38
|
+
addonBefore = _ref.addonBefore,
|
|
38
39
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
39
40
|
var matchProps = propsMaker.useProps({
|
|
40
41
|
request: request,
|
|
@@ -121,23 +122,27 @@ var Index = function Index(_ref, ref) {
|
|
|
121
122
|
var upListType = listType === null ? undefined : listType;
|
|
122
123
|
return jsxRuntime.jsxs("div", {
|
|
123
124
|
style: contentStyle,
|
|
124
|
-
children: [jsxRuntime.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
onPreview: preview,
|
|
129
|
-
onChange: change$1,
|
|
130
|
-
beforeUpload: function beforeUpload() {
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
}, props), {}, {
|
|
134
|
-
children: hideAddBtn ? null : jsxRuntime.jsx(Btn.default, {
|
|
135
|
-
value: relVal,
|
|
136
|
-
maxCount: maxCount,
|
|
125
|
+
children: [jsxRuntime.jsxs(antd.Space, {
|
|
126
|
+
size: 8,
|
|
127
|
+
align: "start",
|
|
128
|
+
children: [addonBefore, jsxRuntime.jsx(antd.Upload, _objectSpread(_objectSpread({
|
|
137
129
|
listType: upListType,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
130
|
+
maxCount: maxNum,
|
|
131
|
+
fileList: relVal,
|
|
132
|
+
onPreview: preview,
|
|
133
|
+
onChange: change$1,
|
|
134
|
+
beforeUpload: function beforeUpload() {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
}, props), {}, {
|
|
138
|
+
children: hideAddBtn ? null : jsxRuntime.jsx(Btn.default, {
|
|
139
|
+
value: relVal,
|
|
140
|
+
maxCount: maxCount,
|
|
141
|
+
listType: upListType,
|
|
142
|
+
children: children
|
|
143
|
+
})
|
|
144
|
+
}))]
|
|
145
|
+
}), jsxRuntime.jsx(index.default, {
|
|
141
146
|
visible: visible,
|
|
142
147
|
file: previewFile,
|
|
143
148
|
onCancel: function onCancel() {
|
package/lib/Upload/modal.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export interface IUpLoadProps extends Omit<UploadProps, "onChange" | "listType"
|
|
|
22
22
|
hideAddBtn?: boolean;
|
|
23
23
|
listType?: UploadListType | null;
|
|
24
24
|
onPreview?: UploadProps["onPreview"] | null;
|
|
25
|
+
addonBefore?: React.ReactNode;
|
|
25
26
|
}
|
|
26
27
|
export interface IMediaTypeEleProps {
|
|
27
28
|
file?: UploadFile;
|
package/lib/index.css
CHANGED
|
@@ -82,18 +82,18 @@
|
|
|
82
82
|
align-items: center;
|
|
83
83
|
min-height: 32px;
|
|
84
84
|
}
|
|
85
|
-
.ant-hw-form-base-item-top-left .ant-form-item-label > label {
|
|
85
|
+
.ant-hw-form-base-item-top-left > .ant-form-item-row .ant-form-item-label > label {
|
|
86
86
|
height: auto;
|
|
87
87
|
}
|
|
88
|
-
.ant-hw-form-base-item-top-left .ant-hw-form-item-colon {
|
|
88
|
+
.ant-hw-form-base-item-top-left > .ant-form-item-row .ant-hw-form-item-colon {
|
|
89
89
|
text-align: left;
|
|
90
90
|
}
|
|
91
|
-
.ant-hw-form-base-item-top-left .ant-hw-form-item-required {
|
|
91
|
+
.ant-hw-form-base-item-top-left > .ant-form-item-row .ant-hw-form-item-required {
|
|
92
92
|
position: absolute;
|
|
93
93
|
top: 0;
|
|
94
94
|
left: -10px;
|
|
95
95
|
}
|
|
96
|
-
.ant-hw-form-base-item-top-left .ant-hw-form-label-item {
|
|
96
|
+
.ant-hw-form-base-item-top-left > .ant-form-item-row .ant-hw-form-label-item {
|
|
97
97
|
position: relative;
|
|
98
98
|
display: -webkit-box;
|
|
99
99
|
display: -webkit-flex;
|
|
@@ -104,16 +104,38 @@
|
|
|
104
104
|
-ms-flex-align: center;
|
|
105
105
|
align-items: center;
|
|
106
106
|
}
|
|
107
|
-
.ant-hw-form-base-item-top-right .ant-form-item-label > label {
|
|
107
|
+
.ant-hw-form-base-item-top-right > .ant-form-item-row .ant-form-item-label > label {
|
|
108
108
|
height: auto;
|
|
109
109
|
}
|
|
110
|
-
.ant-hw-form-base-item-top-right .ant-hw-form-item-colon {
|
|
110
|
+
.ant-hw-form-base-item-top-right > .ant-form-item-row .ant-hw-form-item-colon {
|
|
111
111
|
text-align: right;
|
|
112
112
|
}
|
|
113
|
-
.ant-hw-form-base-item-top .ant-form-item-
|
|
113
|
+
.ant-hw-form-base-item-top-right > .ant-form-item-row .ant-hw-form-label-item {
|
|
114
|
+
position: relative;
|
|
115
|
+
display: -webkit-box;
|
|
116
|
+
display: -webkit-flex;
|
|
117
|
+
display: -ms-flexbox;
|
|
118
|
+
display: flex;
|
|
119
|
+
-webkit-box-align: center;
|
|
120
|
+
-webkit-align-items: center;
|
|
121
|
+
-ms-flex-align: center;
|
|
122
|
+
align-items: center;
|
|
123
|
+
}
|
|
124
|
+
.ant-hw-form-base-item-top > .ant-form-item-row .ant-form-item-label > label {
|
|
114
125
|
height: auto;
|
|
115
126
|
}
|
|
116
|
-
.ant-hw-form-base-item-
|
|
127
|
+
.ant-hw-form-base-item-top > .ant-form-item-row .ant-hw-form-label-item {
|
|
128
|
+
position: relative;
|
|
129
|
+
display: -webkit-box;
|
|
130
|
+
display: -webkit-flex;
|
|
131
|
+
display: -ms-flexbox;
|
|
132
|
+
display: flex;
|
|
133
|
+
-webkit-box-align: center;
|
|
134
|
+
-webkit-align-items: center;
|
|
135
|
+
-ms-flex-align: center;
|
|
136
|
+
align-items: center;
|
|
137
|
+
}
|
|
138
|
+
.ant-hw-form-base-item-right > .ant-form-item-row > .ant-form-item-label .ant-hw-form-label-item {
|
|
117
139
|
display: -webkit-box;
|
|
118
140
|
display: -webkit-flex;
|
|
119
141
|
display: -ms-flexbox;
|
|
@@ -127,7 +149,7 @@
|
|
|
127
149
|
-ms-flex-pack: end;
|
|
128
150
|
justify-content: end;
|
|
129
151
|
}
|
|
130
|
-
.ant-hw-form-base-item-right > .ant-form-item-label .ant-form-item-label > label {
|
|
152
|
+
.ant-hw-form-base-item-right > .ant-form-item-row > .ant-form-item-label .ant-form-item-label > label {
|
|
131
153
|
height: 32px;
|
|
132
154
|
}
|
|
133
155
|
.ant-hw-form-base-item-left > .ant-form-item-row > .ant-form-item-label .ant-hw-form-label-item {
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
align-items: center;
|
|
16
16
|
min-height: 32px;
|
|
17
17
|
}
|
|
18
|
-
.@{ant-prefix}-hw-form-base-item-top-left {
|
|
18
|
+
.@{ant-prefix}-hw-form-base-item-top-left > .@{ant-prefix}-form-item-row {
|
|
19
19
|
.@{ant-prefix}-form-item-label > label {
|
|
20
20
|
height: auto;
|
|
21
21
|
}
|
|
@@ -33,20 +33,30 @@
|
|
|
33
33
|
align-items: center;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
.@{ant-prefix}-hw-form-base-item-top-right {
|
|
36
|
+
.@{ant-prefix}-hw-form-base-item-top-right > .@{ant-prefix}-form-item-row {
|
|
37
37
|
.@{ant-prefix}-form-item-label > label {
|
|
38
38
|
height: auto;
|
|
39
39
|
}
|
|
40
40
|
.@{ant-prefix}-hw-form-item-colon {
|
|
41
41
|
text-align: right;
|
|
42
42
|
}
|
|
43
|
+
.@{ant-prefix}-hw-form-label-item {
|
|
44
|
+
position: relative;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
}
|
|
43
48
|
}
|
|
44
|
-
.@{ant-prefix}-hw-form-base-item-top {
|
|
49
|
+
.@{ant-prefix}-hw-form-base-item-top > .@{ant-prefix}-form-item-row {
|
|
45
50
|
.@{ant-prefix}-form-item-label > label {
|
|
46
51
|
height: auto;
|
|
47
52
|
}
|
|
53
|
+
.@{ant-prefix}-hw-form-label-item {
|
|
54
|
+
position: relative;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
}
|
|
48
58
|
}
|
|
49
|
-
.@{ant-prefix}-hw-form-base-item-right > .@{ant-prefix}-form-item-label {
|
|
59
|
+
.@{ant-prefix}-hw-form-base-item-right > .@{ant-prefix}-form-item-row > .@{ant-prefix}-form-item-label {
|
|
50
60
|
.@{ant-prefix}-hw-form-label-item {
|
|
51
61
|
display: flex;
|
|
52
62
|
align-items: center;
|
|
@@ -4,7 +4,7 @@ import { useProps } from "./hooks/propsMaker";
|
|
|
4
4
|
import type { IPreviewProps } from "./Preview";
|
|
5
5
|
import Preview from "./Preview";
|
|
6
6
|
import { useChange } from "./hooks/change";
|
|
7
|
-
import { Upload
|
|
7
|
+
import {Space, Upload} from "antd";
|
|
8
8
|
import Btn from "./Btn";
|
|
9
9
|
import HFormConnect from "../Form/HFormConnect";
|
|
10
10
|
|
|
@@ -23,6 +23,7 @@ const Index: React.ForwardRefRenderFunction<IUploadRefModal, IUpLoadProps> = (
|
|
|
23
23
|
thumbUrl,
|
|
24
24
|
hideAddBtn,
|
|
25
25
|
children,
|
|
26
|
+
addonBefore,
|
|
26
27
|
...props
|
|
27
28
|
},
|
|
28
29
|
ref
|
|
@@ -104,23 +105,26 @@ const Index: React.ForwardRefRenderFunction<IUploadRefModal, IUpLoadProps> = (
|
|
|
104
105
|
const upListType = listType === null ? undefined : listType;
|
|
105
106
|
return (
|
|
106
107
|
<div style={contentStyle}>
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
108
|
+
<Space size={8} align={"start"}>
|
|
109
|
+
{addonBefore}
|
|
110
|
+
<Upload
|
|
111
|
+
listType={upListType}
|
|
112
|
+
maxCount={maxNum}
|
|
113
|
+
fileList={relVal}
|
|
114
|
+
onPreview={preview}
|
|
115
|
+
onChange={change}
|
|
116
|
+
beforeUpload={() => {
|
|
117
|
+
return false;
|
|
118
|
+
}}
|
|
119
|
+
{...props}
|
|
120
|
+
>
|
|
121
|
+
{hideAddBtn ? null : (
|
|
122
|
+
<Btn value={relVal} maxCount={maxCount} listType={upListType}>
|
|
123
|
+
{children}
|
|
124
|
+
</Btn>
|
|
125
|
+
)}
|
|
126
|
+
</Upload>
|
|
127
|
+
</Space>
|
|
124
128
|
<Preview
|
|
125
129
|
visible={visible}
|
|
126
130
|
file={previewFile}
|
package/src/pages/Form/index.tsx
CHANGED
|
@@ -11,6 +11,7 @@ export default () => {
|
|
|
11
11
|
<Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
|
|
12
12
|
<HUpload
|
|
13
13
|
value={files}
|
|
14
|
+
addonBefore={<div>32132123</div>}
|
|
14
15
|
exFiles={["MP4"]}
|
|
15
16
|
thumbUrl={
|
|
16
17
|
"https://inews.gtimg.com/om_bt/OGlQWfsaAoKkuCcMZ2o9IVEPqd-72DQy5EAN02XBHUwfYAA/641"
|
|
@@ -40,6 +41,7 @@ export default () => {
|
|
|
40
41
|
</HUpload>
|
|
41
42
|
<HUrlUpload
|
|
42
43
|
inputHelper="测试"
|
|
44
|
+
addonBefore={<div>32132123</div>}
|
|
43
45
|
mediaType={MediaTypeEnum.img}
|
|
44
46
|
value={["https://img1.baidu.com/it/u=2172818577,3783888802&fm=253&app=138&f=JPEG?w=800&h=1422"]}
|
|
45
47
|
onChange={setFiles}
|