@hw-component/form 1.2.9 → 1.3.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.
@@ -88,6 +88,7 @@ var DrawerForm = (function (_ref) {
88
88
  confirmLoading: loading
89
89
  });
90
90
  };
91
+ console.log(initValue, "initValue");
91
92
  var node = jsx(HForm, _objectSpread(_objectSpread({
92
93
  configData: modalFormData,
93
94
  initialValues: initValue,
@@ -86,6 +86,7 @@ var Index = function Index(_ref, ref) {
86
86
  addFormat === null || addFormat === void 0 || addFormat({
87
87
  float: {
88
88
  inputValue: function inputValue(item, initValue) {
89
+ console.log("inputValue");
89
90
  var _item$name = item.name,
90
91
  name = _item$name === void 0 ? "" : _item$name;
91
92
  var initFileList = initValue[name] || [];
@@ -115,12 +116,13 @@ var Index = function Index(_ref, ref) {
115
116
  }
116
117
  }
117
118
  });
119
+ var relVal = Array.isArray(value) ? value : [];
118
120
  return jsxs("div", {
119
121
  style: contentStyle,
120
122
  children: [jsx(Upload, _objectSpread(_objectSpread({
121
123
  listType: listType,
122
124
  maxCount: maxNum,
123
- fileList: value,
125
+ fileList: relVal,
124
126
  onPreview: preview,
125
127
  onChange: change,
126
128
  beforeUpload: function beforeUpload() {
@@ -128,7 +130,7 @@ var Index = function Index(_ref, ref) {
128
130
  }
129
131
  }, props), {}, {
130
132
  children: jsx(Btn, {
131
- value: value,
133
+ value: relVal,
132
134
  maxCount: maxCount,
133
135
  listType: listType
134
136
  })
@@ -91,6 +91,7 @@ var DrawerForm = (function (_ref) {
91
91
  confirmLoading: loading
92
92
  });
93
93
  };
94
+ console.log(initValue, "initValue");
94
95
  var node = jsxRuntime.jsx(index.default, _objectSpread(_objectSpread({
95
96
  configData: modalFormData,
96
97
  initialValues: initValue,
@@ -89,6 +89,7 @@ var Index = function Index(_ref, ref) {
89
89
  addFormat === null || addFormat === void 0 || addFormat({
90
90
  float: {
91
91
  inputValue: function inputValue(item, initValue) {
92
+ console.log("inputValue");
92
93
  var _item$name = item.name,
93
94
  name = _item$name === void 0 ? "" : _item$name;
94
95
  var initFileList = initValue[name] || [];
@@ -118,12 +119,13 @@ var Index = function Index(_ref, ref) {
118
119
  }
119
120
  }
120
121
  });
122
+ var relVal = Array.isArray(value) ? value : [];
121
123
  return jsxRuntime.jsxs("div", {
122
124
  style: contentStyle,
123
125
  children: [jsxRuntime.jsx(antd.Upload, _objectSpread(_objectSpread({
124
126
  listType: listType,
125
127
  maxCount: maxNum,
126
- fileList: value,
128
+ fileList: relVal,
127
129
  onPreview: preview,
128
130
  onChange: change$1,
129
131
  beforeUpload: function beforeUpload() {
@@ -131,7 +133,7 @@ var Index = function Index(_ref, ref) {
131
133
  }
132
134
  }, props), {}, {
133
135
  children: jsxRuntime.jsx(Btn.default, {
134
- value: value,
136
+ value: relVal,
135
137
  maxCount: maxCount,
136
138
  listType: listType
137
139
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.2.9",
3
+ "version": "1.3.2",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -73,6 +73,7 @@ export default ({
73
73
  )
74
74
  );
75
75
  };
76
+ console.log(initValue,"initValue")
76
77
  const node = (
77
78
  <HForm
78
79
  configData={modalFormData}
@@ -61,6 +61,7 @@ const Index: React.ForwardRefRenderFunction<IUploadRefModal, IUpLoadProps> = (
61
61
  addFormat?.({
62
62
  float: {
63
63
  inputValue: (item, initValue) => {
64
+ console.log("inputValue")
64
65
  const { name = "" } = item;
65
66
  const initFileList = initValue[name] || [];
66
67
  const relInitFileList =
@@ -92,12 +93,14 @@ const Index: React.ForwardRefRenderFunction<IUploadRefModal, IUpLoadProps> = (
92
93
  },
93
94
  },
94
95
  });
96
+ const relVal=Array.isArray(value)?value:[];
97
+
95
98
  return (
96
99
  <div style={contentStyle}>
97
100
  <Upload
98
101
  listType={listType}
99
102
  maxCount={maxNum}
100
- fileList={value}
103
+ fileList={relVal}
101
104
  onPreview={preview}
102
105
  onChange={change}
103
106
  beforeUpload={() => {
@@ -105,7 +108,7 @@ const Index: React.ForwardRefRenderFunction<IUploadRefModal, IUpLoadProps> = (
105
108
  }}
106
109
  {...props}
107
110
  >
108
- <Btn value={value} maxCount={maxCount} listType={listType} />
111
+ <Btn value={relVal} maxCount={maxCount} listType={listType} />
109
112
  </Upload>
110
113
  <Preview
111
114
  visible={visible}
@@ -95,6 +95,12 @@ const data = [
95
95
  name: "urlUpload",
96
96
  type: "urlUpload",
97
97
  rules: [{ required: true }],
98
+ itemProps: {
99
+ style: { width: 368 },
100
+ placeholder: '粘贴图片地址鼠标移出输入框自动保存',
101
+ maxSize: 1024 * 1024 * 10,
102
+ thumbUrl:"http://gips3.baidu.com/it/u=3886271102,3123389489&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960",
103
+ },
98
104
  },
99
105
  {
100
106
  label: "验证码",
@@ -120,6 +126,8 @@ export default () => {
120
126
  check1: 1,
121
127
  op: 1,
122
128
  opInput: num,
129
+ upload:"fff",
130
+ urlUpload:"fff"
123
131
  },
124
132
  });
125
133
  }}
@@ -134,7 +142,6 @@ export default () => {
134
142
  打开
135
143
  </Button>
136
144
  <HDrawerForm
137
- autoClear={false}
138
145
  configData={data}
139
146
  labelWidth={88}
140
147
  labelAlign={"left"}
@@ -57,6 +57,13 @@ const formData = (options) => {
57
57
  direction: "vertical",
58
58
  labelAlign: "topLeft",
59
59
  },
60
+ {
61
+ label: "file",
62
+ name: "file",
63
+ type: "upload",
64
+ direction: "vertical",
65
+ labelAlign: "topLeft",
66
+ },
60
67
  {
61
68
  label: "开关",
62
69
  name: "switch",
@@ -161,6 +168,9 @@ export default () => {
161
168
  onValuesChange={(val) => {
162
169
  console.log(val, "onValuesChange");
163
170
  }}
171
+ initialValues={{
172
+ file:"fff"
173
+ }}
164
174
  request={(params) => {
165
175
  return new Promise<any>((resolve) => {
166
176
  setTimeout(() => {