szld-libs 0.2.2 → 0.2.4
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/dist/szld-components.es.js +117 -107
- package/dist/szld-components.umd.js +28 -28
- package/es/components/CreateForm/index.js +13 -13
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.js +19 -1
- package/lib/components/CreateForm/index.js +13 -13
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +18 -0
- package/package.json +1 -1
|
@@ -114,7 +114,7 @@ const CreateForm = (props) => {
|
|
|
114
114
|
const FormFields = (props) => {
|
|
115
115
|
const { valueType, valueProps, value, onChange, onBtnClick, inputRef } = props;
|
|
116
116
|
const children = useMemo(() => {
|
|
117
|
-
let result = /* @__PURE__ */ jsx(Input, { placeholder: "请输入",
|
|
117
|
+
let result = /* @__PURE__ */ jsx(Input, { placeholder: "请输入", allowClear: true, ...valueProps });
|
|
118
118
|
switch (valueType) {
|
|
119
119
|
case "rate":
|
|
120
120
|
result = /* @__PURE__ */ jsx(Rate, { ...valueProps });
|
|
@@ -133,8 +133,8 @@ const FormFields = (props) => {
|
|
|
133
133
|
Select,
|
|
134
134
|
{
|
|
135
135
|
placeholder: "请选择",
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
allowClear: true,
|
|
137
|
+
...valueProps
|
|
138
138
|
}
|
|
139
139
|
);
|
|
140
140
|
break;
|
|
@@ -153,8 +153,8 @@ const FormFields = (props) => {
|
|
|
153
153
|
Input.TextArea,
|
|
154
154
|
{
|
|
155
155
|
placeholder: "请输入",
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
allowClear: true,
|
|
157
|
+
...valueProps
|
|
158
158
|
}
|
|
159
159
|
);
|
|
160
160
|
break;
|
|
@@ -169,8 +169,8 @@ const FormFields = (props) => {
|
|
|
169
169
|
DatePicker,
|
|
170
170
|
{
|
|
171
171
|
style: { width: "100%" },
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
allowClear: true,
|
|
173
|
+
...valueProps
|
|
174
174
|
}
|
|
175
175
|
);
|
|
176
176
|
break;
|
|
@@ -179,8 +179,8 @@ const FormFields = (props) => {
|
|
|
179
179
|
DatePicker.RangePicker,
|
|
180
180
|
{
|
|
181
181
|
style: { width: "100%" },
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
allowClear: true,
|
|
183
|
+
...valueProps
|
|
184
184
|
}
|
|
185
185
|
);
|
|
186
186
|
break;
|
|
@@ -189,8 +189,8 @@ const FormFields = (props) => {
|
|
|
189
189
|
TimePicker,
|
|
190
190
|
{
|
|
191
191
|
style: { width: "100%" },
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
allowClear: true,
|
|
193
|
+
...valueProps
|
|
194
194
|
}
|
|
195
195
|
);
|
|
196
196
|
break;
|
|
@@ -198,8 +198,8 @@ const FormFields = (props) => {
|
|
|
198
198
|
result = /* @__PURE__ */ jsx(
|
|
199
199
|
Cascader,
|
|
200
200
|
{
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
allowClear: true,
|
|
202
|
+
...valueProps
|
|
203
203
|
}
|
|
204
204
|
);
|
|
205
205
|
break;
|
package/es/utils/index.d.ts
CHANGED
|
@@ -10,3 +10,5 @@ export declare const getSessionStorage: (key: string) => any;
|
|
|
10
10
|
export declare const removeSessionStorage: (key: string) => void;
|
|
11
11
|
export declare const arrayDeduplication: (key: string, arr: any[]) => any[];
|
|
12
12
|
export declare const JSONParse: (value: string) => any;
|
|
13
|
+
export declare function uuid(): string;
|
|
14
|
+
export declare const forceReload: () => void;
|
package/es/utils/index.js
CHANGED
|
@@ -97,10 +97,27 @@ const JSONParse = (value) => {
|
|
|
97
97
|
return result;
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
+
function uuid() {
|
|
101
|
+
var temp_url = URL.createObjectURL(new Blob());
|
|
102
|
+
var uuid2 = temp_url.toString();
|
|
103
|
+
URL.revokeObjectURL(temp_url);
|
|
104
|
+
return uuid2.substr(uuid2.lastIndexOf("/") + 1);
|
|
105
|
+
}
|
|
106
|
+
const forceReload = () => {
|
|
107
|
+
const key = "FORCERELOAD";
|
|
108
|
+
const refresh = sessionStorage.getItem(key);
|
|
109
|
+
if (refresh !== "1") {
|
|
110
|
+
sessionStorage.setItem(key, "1");
|
|
111
|
+
window.location.reload();
|
|
112
|
+
} else {
|
|
113
|
+
sessionStorage.removeItem(key);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
100
116
|
export {
|
|
101
117
|
JSONParse,
|
|
102
118
|
arrayDeduplication,
|
|
103
119
|
filterObject,
|
|
120
|
+
forceReload,
|
|
104
121
|
getBase64,
|
|
105
122
|
getFileSuffix,
|
|
106
123
|
getFileType,
|
|
@@ -109,5 +126,6 @@ export {
|
|
|
109
126
|
removeLocalStorage,
|
|
110
127
|
removeSessionStorage,
|
|
111
128
|
setLocalStorage,
|
|
112
|
-
setSessionStorage
|
|
129
|
+
setSessionStorage,
|
|
130
|
+
uuid
|
|
113
131
|
};
|
|
@@ -116,7 +116,7 @@ const CreateForm = (props) => {
|
|
|
116
116
|
const FormFields = (props) => {
|
|
117
117
|
const { valueType, valueProps, value, onChange, onBtnClick, inputRef } = props;
|
|
118
118
|
const children = React.useMemo(() => {
|
|
119
|
-
let result = /* @__PURE__ */ jsxRuntime.jsx(antd.Input, { placeholder: "请输入",
|
|
119
|
+
let result = /* @__PURE__ */ jsxRuntime.jsx(antd.Input, { placeholder: "请输入", allowClear: true, ...valueProps });
|
|
120
120
|
switch (valueType) {
|
|
121
121
|
case "rate":
|
|
122
122
|
result = /* @__PURE__ */ jsxRuntime.jsx(antd.Rate, { ...valueProps });
|
|
@@ -135,8 +135,8 @@ const FormFields = (props) => {
|
|
|
135
135
|
antd.Select,
|
|
136
136
|
{
|
|
137
137
|
placeholder: "请选择",
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
allowClear: true,
|
|
139
|
+
...valueProps
|
|
140
140
|
}
|
|
141
141
|
);
|
|
142
142
|
break;
|
|
@@ -155,8 +155,8 @@ const FormFields = (props) => {
|
|
|
155
155
|
antd.Input.TextArea,
|
|
156
156
|
{
|
|
157
157
|
placeholder: "请输入",
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
allowClear: true,
|
|
159
|
+
...valueProps
|
|
160
160
|
}
|
|
161
161
|
);
|
|
162
162
|
break;
|
|
@@ -171,8 +171,8 @@ const FormFields = (props) => {
|
|
|
171
171
|
antd.DatePicker,
|
|
172
172
|
{
|
|
173
173
|
style: { width: "100%" },
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
allowClear: true,
|
|
175
|
+
...valueProps
|
|
176
176
|
}
|
|
177
177
|
);
|
|
178
178
|
break;
|
|
@@ -181,8 +181,8 @@ const FormFields = (props) => {
|
|
|
181
181
|
antd.DatePicker.RangePicker,
|
|
182
182
|
{
|
|
183
183
|
style: { width: "100%" },
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
allowClear: true,
|
|
185
|
+
...valueProps
|
|
186
186
|
}
|
|
187
187
|
);
|
|
188
188
|
break;
|
|
@@ -191,8 +191,8 @@ const FormFields = (props) => {
|
|
|
191
191
|
antd.TimePicker,
|
|
192
192
|
{
|
|
193
193
|
style: { width: "100%" },
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
allowClear: true,
|
|
195
|
+
...valueProps
|
|
196
196
|
}
|
|
197
197
|
);
|
|
198
198
|
break;
|
|
@@ -200,8 +200,8 @@ const FormFields = (props) => {
|
|
|
200
200
|
result = /* @__PURE__ */ jsxRuntime.jsx(
|
|
201
201
|
antd.Cascader,
|
|
202
202
|
{
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
allowClear: true,
|
|
204
|
+
...valueProps
|
|
205
205
|
}
|
|
206
206
|
);
|
|
207
207
|
break;
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -10,3 +10,5 @@ export declare const getSessionStorage: (key: string) => any;
|
|
|
10
10
|
export declare const removeSessionStorage: (key: string) => void;
|
|
11
11
|
export declare const arrayDeduplication: (key: string, arr: any[]) => any[];
|
|
12
12
|
export declare const JSONParse: (value: string) => any;
|
|
13
|
+
export declare function uuid(): string;
|
|
14
|
+
export declare const forceReload: () => void;
|
package/lib/utils/index.js
CHANGED
|
@@ -99,9 +99,26 @@ const JSONParse = (value) => {
|
|
|
99
99
|
return result;
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
|
+
function uuid() {
|
|
103
|
+
var temp_url = URL.createObjectURL(new Blob());
|
|
104
|
+
var uuid2 = temp_url.toString();
|
|
105
|
+
URL.revokeObjectURL(temp_url);
|
|
106
|
+
return uuid2.substr(uuid2.lastIndexOf("/") + 1);
|
|
107
|
+
}
|
|
108
|
+
const forceReload = () => {
|
|
109
|
+
const key = "FORCERELOAD";
|
|
110
|
+
const refresh = sessionStorage.getItem(key);
|
|
111
|
+
if (refresh !== "1") {
|
|
112
|
+
sessionStorage.setItem(key, "1");
|
|
113
|
+
window.location.reload();
|
|
114
|
+
} else {
|
|
115
|
+
sessionStorage.removeItem(key);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
102
118
|
exports.JSONParse = JSONParse;
|
|
103
119
|
exports.arrayDeduplication = arrayDeduplication;
|
|
104
120
|
exports.filterObject = filterObject;
|
|
121
|
+
exports.forceReload = forceReload;
|
|
105
122
|
exports.getBase64 = getBase64;
|
|
106
123
|
exports.getFileSuffix = getFileSuffix;
|
|
107
124
|
exports.getFileType = getFileType;
|
|
@@ -111,3 +128,4 @@ exports.removeLocalStorage = removeLocalStorage;
|
|
|
111
128
|
exports.removeSessionStorage = removeSessionStorage;
|
|
112
129
|
exports.setLocalStorage = setLocalStorage;
|
|
113
130
|
exports.setSessionStorage = setSessionStorage;
|
|
131
|
+
exports.uuid = uuid;
|