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.
@@ -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: "请输入", ...valueProps, allowClear: true });
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
- ...valueProps,
137
- allowClear: true
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
- ...valueProps,
157
- allowClear: true
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
- ...valueProps,
173
- allowClear: true
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
- ...valueProps,
183
- allowClear: true
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
- ...valueProps,
193
- allowClear: true
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
- ...valueProps,
202
- allowClear: true
201
+ allowClear: true,
202
+ ...valueProps
203
203
  }
204
204
  );
205
205
  break;
@@ -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: "请输入", ...valueProps, allowClear: true });
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
- ...valueProps,
139
- allowClear: true
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
- ...valueProps,
159
- allowClear: true
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
- ...valueProps,
175
- allowClear: true
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
- ...valueProps,
185
- allowClear: true
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
- ...valueProps,
195
- allowClear: true
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
- ...valueProps,
204
- allowClear: true
203
+ allowClear: true,
204
+ ...valueProps
205
205
  }
206
206
  );
207
207
  break;
@@ -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;
@@ -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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.2.2",
4
+ "version": "0.2.4",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",