szld-libs 0.4.39 → 0.4.40

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.
@@ -162,18 +162,21 @@ const handleSubmitForm = (originalData, allValues) => {
162
162
  }
163
163
  if (isAutoFill) {
164
164
  (_a = updatedData == null ? void 0 : updatedData.attr_list) == null ? void 0 : _a.forEach((v) => {
165
- var _a2, _b, _c, _d, _e, _f;
165
+ var _a2, _b, _c, _d, _e, _f, _g;
166
166
  const attrvalue = (v == null ? void 0 : v.attrvalue) || "";
167
167
  if (((_a2 = v == null ? void 0 : v.json) == null ? void 0 : _a2["auto-generate"]) && ((_b = v == null ? void 0 : v.json) == null ? void 0 : _b["auto-generate-type"]) && !attrvalue) {
168
168
  if (((_c = v == null ? void 0 : v.json) == null ? void 0 : _c["auto-generate-type"]) === "currenttime") {
169
169
  v.attrvalue = dayjs().format("YYYY-MM-DD HH:mm:ss");
170
170
  }
171
- if (((_d = v == null ? void 0 : v.json) == null ? void 0 : _d["auto-generate-type"]) === "guid" && !attrvalue) {
171
+ if (((_d = v == null ? void 0 : v.json) == null ? void 0 : _d["auto-generate-type"]) === "currenttimestamp") {
172
+ v.attrvalue = dayjs().unix().toString();
173
+ }
174
+ if (((_e = v == null ? void 0 : v.json) == null ? void 0 : _e["auto-generate-type"]) === "guid" && !attrvalue) {
172
175
  v.attrvalue = onlyNumber || guid || "";
173
176
  }
174
177
  }
175
- if (((_e = v == null ? void 0 : v.json) == null ? void 0 : _e["default"]) && !attrvalue) {
176
- v.attrvalue = (_f = v == null ? void 0 : v.json) == null ? void 0 : _f["default"];
178
+ if (((_f = v == null ? void 0 : v.json) == null ? void 0 : _f["default"]) && !attrvalue) {
179
+ v.attrvalue = (_g = v == null ? void 0 : v.json) == null ? void 0 : _g["default"];
177
180
  }
178
181
  });
179
182
  }
@@ -69,3 +69,4 @@ export declare const handleSetTableRowColor: (record: any, index: number | undef
69
69
  export declare const handleFormatMobileDate: (values: Record<string, any>, format?: string) => Record<string, any>;
70
70
  export declare const handleNonUniversalHeader: (nonUniversalHeader: Record<string, string>, data: Record<string, any>) => Record<string, any>;
71
71
  export declare const handleGetControlPanelConfig: (sourceNumber: string | number, commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>) => Promise<any>;
72
+ export declare const isJson: (str: string) => boolean;
@@ -100,6 +100,14 @@ const handleGetControlPanelConfig = async (sourceNumber, commonRequest) => {
100
100
  } catch (error) {
101
101
  }
102
102
  };
103
+ const isJson = (str) => {
104
+ try {
105
+ JSON.parse(str);
106
+ return true;
107
+ } catch (e) {
108
+ return false;
109
+ }
110
+ };
103
111
  exports.handleCallSupportCode = handleCallSupportCode;
104
112
  exports.handleFormatMobileDate = handleFormatMobileDate;
105
113
  exports.handleGetAttrDetail = handleGetAttrDetail;
@@ -109,3 +117,4 @@ exports.handleGetList = handleGetList;
109
117
  exports.handleNonUniversalHeader = handleNonUniversalHeader;
110
118
  exports.handleObjDetailToSignleAttrList = handleObjDetailToSignleAttrList;
111
119
  exports.handleSetTableRowColor = handleSetTableRowColor;
120
+ exports.isJson = isJson;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.4.39",
4
+ "version": "0.4.40",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",