@hw-component/form 1.4.0 → 1.4.1

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.
@@ -184,10 +184,12 @@ var useHForm = (function () {
184
184
  },
185
185
  validateFields: function validateFields(nameList) {
186
186
  var _this = this;
187
- return new Promise(function (resolve) {
187
+ return new Promise(function (resolve, reject) {
188
188
  form.validateFields(nameList).then(function (value) {
189
189
  var result = _this.formatValues(value, "outputValue");
190
190
  return resolve(result);
191
+ }).catch(function (e) {
192
+ reject(e);
191
193
  });
192
194
  });
193
195
  },
@@ -187,10 +187,12 @@ var useHForm = (function () {
187
187
  },
188
188
  validateFields: function validateFields(nameList) {
189
189
  var _this = this;
190
- return new Promise(function (resolve) {
190
+ return new Promise(function (resolve, reject) {
191
191
  form.validateFields(nameList).then(function (value) {
192
192
  var result = _this.formatValues(value, "outputValue");
193
193
  return resolve(result);
194
+ }).catch(function (e) {
195
+ reject(e);
194
196
  });
195
197
  });
196
198
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -157,10 +157,12 @@ export default () => {
157
157
  form.setFieldsValue(newValue);
158
158
  },
159
159
  validateFields(nameList) {
160
- return new Promise((resolve) => {
160
+ return new Promise((resolve,reject) => {
161
161
  form.validateFields(nameList).then((value) => {
162
162
  const result = this.formatValues(value, "outputValue");
163
163
  return resolve(result);
164
+ }).catch((e)=>{
165
+ reject(e);
164
166
  });
165
167
  });
166
168
  },
@@ -2,10 +2,14 @@ import { Button } from "antd";
2
2
  import {
3
3
  HModalForm,
4
4
  useHDialogForm,
5
- HFormConfigProvider,
5
+ HFormConfigProvider, HUrlUpload,
6
6
  } from "../../components";
7
7
  import { useState } from "react";
8
8
  import { ShowParamsModal } from "@/components/DialogForm/modal";
9
+
10
+ const Test=(props)=>{
11
+ return <HUrlUpload {...props}/>
12
+ }
9
13
  const data = [
10
14
  {
11
15
  label: "输入框",
@@ -105,8 +109,9 @@ const data = [
105
109
  {
106
110
  label: "地址文件",
107
111
  name: "urlUpload",
108
- type: "urlUpload",
109
- rules: [{ required: true }],
112
+ render:()=>{
113
+ return <Test/>
114
+ }
110
115
  },
111
116
  {
112
117
  label: "下拉框",
@@ -149,6 +154,9 @@ export default () => {
149
154
  params: {
150
155
  name: num,
151
156
  },
157
+ initialValues:{
158
+ urlUpload:"ffff"
159
+ }
152
160
  });
153
161
  }}
154
162
  >