ls-pro-common 3.0.5 → 3.0.7
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/common.css +20 -13
- package/dist/common.js +1 -1
- package/dist/common.min.css +20 -13
- package/dist/common.min.js +1 -1
- package/es/components/ImageSelector.js +11 -8
- package/es/components/InputMultiLine.js +7 -7
- package/es/components/InputTable.js +23 -20
- package/es/components/antd-custom.less +240 -223
- package/es/components/common.less +5 -12
- package/lib/components/ImageSelector.js +11 -8
- package/lib/components/InputMultiLine.js +7 -7
- package/lib/components/InputTable.js +23 -20
- package/lib/components/antd-custom.less +240 -223
- package/lib/components/common.less +5 -12
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ body {
|
|
|
6
6
|
--ant-primary-color: #1869ED;
|
|
7
7
|
--ant-primary-color-hover: #418efa;
|
|
8
8
|
--ant-primary-color-active: #0a4cc7;
|
|
9
|
-
--ant-primary-color-outline: rgba(24, 105, 237, 0.
|
|
9
|
+
--ant-primary-color-outline: rgba(24, 105, 237, 0.4);
|
|
10
10
|
--ant-primary-1: #e6f4ff;
|
|
11
11
|
--ant-primary-2: #bddfff;
|
|
12
12
|
--ant-primary-3: #94c8ff;
|
|
@@ -71,7 +71,7 @@ body.theme-yellow {
|
|
|
71
71
|
--ant-primary-color : #fa8500;
|
|
72
72
|
--ant-primary-color-hover : #ffa229;
|
|
73
73
|
--ant-primary-color-active : #d46a00;
|
|
74
|
-
--ant-primary-color-outline : rgba(250, 133, 0, 0.
|
|
74
|
+
--ant-primary-color-outline : rgba(250, 133, 0, 0.4);
|
|
75
75
|
--ant-primary-bg : #fff;
|
|
76
76
|
--ant-primary-side : #fff7e6;
|
|
77
77
|
--ant-primary-0 : #ffd9ad;
|
|
@@ -164,7 +164,8 @@ body.theme-yellow {
|
|
|
164
164
|
// }
|
|
165
165
|
|
|
166
166
|
.dtl-title {
|
|
167
|
-
font-size:
|
|
167
|
+
font-size: 16px;
|
|
168
|
+
font-weight: 700;
|
|
168
169
|
}
|
|
169
170
|
|
|
170
171
|
.dtl-btns {
|
|
@@ -331,15 +332,7 @@ a:hover {
|
|
|
331
332
|
|
|
332
333
|
.ant-pro-card-header-border {
|
|
333
334
|
border-bottom: 1px solid #dbeafa;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.ant-descriptions-item-label {
|
|
337
|
-
color: #595959;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.ant-descriptions-item-content {
|
|
341
|
-
color: #262626;
|
|
342
|
-
}
|
|
335
|
+
}
|
|
343
336
|
}
|
|
344
337
|
|
|
345
338
|
.has-background {
|
|
@@ -155,10 +155,12 @@ function ImageSelector(prop) {
|
|
|
155
155
|
loadData(searchKey);
|
|
156
156
|
}, [visible, searchKey]);
|
|
157
157
|
(0, _react.useEffect)(function () {
|
|
158
|
-
var
|
|
158
|
+
var _formRef$current, _formRef$current$getF;
|
|
159
|
+
var val = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$getF = _formRef$current.getFieldsValue) === null || _formRef$current$getF === void 0 ? void 0 : _formRef$current$getF.call(_formRef$current)) || {};
|
|
159
160
|
var url = val === null || val === void 0 ? void 0 : val[name];
|
|
160
161
|
if (!url) {
|
|
161
|
-
|
|
162
|
+
var _formRef$current2, _formRef$current2$get;
|
|
163
|
+
url = formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : (_formRef$current2$get = _formRef$current2.getFieldValue) === null || _formRef$current2$get === void 0 ? void 0 : _formRef$current2$get.call(_formRef$current2, name);
|
|
162
164
|
}
|
|
163
165
|
if (url) {
|
|
164
166
|
var urls = url.toString().split(',');
|
|
@@ -184,14 +186,14 @@ function ImageSelector(prop) {
|
|
|
184
186
|
(0, _utils.showSuccess)(result.flag.retMsg);
|
|
185
187
|
// 直接上传
|
|
186
188
|
if (isDirect) {
|
|
187
|
-
var _result$rows
|
|
189
|
+
var _result$rows$, _formRef$current3, _formRef$current3$get, _formRef$current4, _formRef$current4$set;
|
|
188
190
|
var img = showImgApi + '?fileName=' + (result === null || result === void 0 ? void 0 : (_result$rows$ = result.rows[0]) === null || _result$rows$ === void 0 ? void 0 : _result$rows$.newFileId);
|
|
189
191
|
setImgUrl(img);
|
|
190
|
-
var formVal = formRef.current.getFieldsValue();
|
|
192
|
+
var formVal = formRef === null || formRef === void 0 ? void 0 : (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : (_formRef$current3$get = _formRef$current3.getFieldsValue) === null || _formRef$current3$get === void 0 ? void 0 : _formRef$current3$get.call(_formRef$current3);
|
|
191
193
|
var val = (0, _objectSpread2.default)({}, formVal);
|
|
192
194
|
//@ts-ignore
|
|
193
195
|
val[name] = img;
|
|
194
|
-
formRef.current.setFieldsValue(val);
|
|
196
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : (_formRef$current4$set = _formRef$current4.setFieldsValue) === null || _formRef$current4$set === void 0 ? void 0 : _formRef$current4$set.call(_formRef$current4, val);
|
|
195
197
|
}
|
|
196
198
|
} else {
|
|
197
199
|
var _result$flag2;
|
|
@@ -241,7 +243,8 @@ function ImageSelector(prop) {
|
|
|
241
243
|
}
|
|
242
244
|
};
|
|
243
245
|
var confirmImage = function confirmImage() {
|
|
244
|
-
var
|
|
246
|
+
var _formRef$current5, _formRef$current5$get;
|
|
247
|
+
var formVal = formRef === null || formRef === void 0 ? void 0 : (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : (_formRef$current5$get = _formRef$current5.getFieldsValue) === null || _formRef$current5$get === void 0 ? void 0 : _formRef$current5$get.call(_formRef$current5);
|
|
245
248
|
var val = (0, _objectSpread2.default)({}, formVal);
|
|
246
249
|
//@ts-ignore
|
|
247
250
|
val[name] = selectedUrl.join(',');
|
|
@@ -251,9 +254,9 @@ function ImageSelector(prop) {
|
|
|
251
254
|
};
|
|
252
255
|
var clearValue = function clearValue(e) {
|
|
253
256
|
if (!e || !e.target.value) {
|
|
254
|
-
var _formRef$
|
|
257
|
+
var _formRef$current6, _formRef$current6$get;
|
|
255
258
|
setImgUrl('');
|
|
256
|
-
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
259
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : (_formRef$current6$get = _formRef$current6.getFieldsValue) === null || _formRef$current6$get === void 0 ? void 0 : _formRef$current6$get.call(_formRef$current6)) || {};
|
|
257
260
|
formValue[name] = '';
|
|
258
261
|
formRef.current.setFieldsValue((0, _objectSpread2.default)({}, formValue));
|
|
259
262
|
}
|
|
@@ -61,10 +61,10 @@ var InputMultiLine = /*#__PURE__*/_react.default.forwardRef(function (prop, ref)
|
|
|
61
61
|
(0, _react.useEffect)(function () {
|
|
62
62
|
if (defaultValue) {
|
|
63
63
|
setText(defaultValue);
|
|
64
|
-
} else if (name) {
|
|
65
|
-
var _formRef$current;
|
|
66
|
-
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.
|
|
67
|
-
setText(formValue
|
|
64
|
+
} else if (name && (formRef === null || formRef === void 0 ? void 0 : formRef.current)) {
|
|
65
|
+
var _formRef$current, _formRef$current$getF;
|
|
66
|
+
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$getF = _formRef$current.getFieldValue) === null || _formRef$current$getF === void 0 ? void 0 : _formRef$current$getF.call(_formRef$current, name);
|
|
67
|
+
setText(formValue);
|
|
68
68
|
}
|
|
69
69
|
}, []);
|
|
70
70
|
// 显示多行输入时,赋值给多行文本框
|
|
@@ -75,10 +75,10 @@ var InputMultiLine = /*#__PURE__*/_react.default.forwardRef(function (prop, ref)
|
|
|
75
75
|
}, [visible, text]);
|
|
76
76
|
// 输入框值变化时,赋值给表单项
|
|
77
77
|
(0, _react.useEffect)(function () {
|
|
78
|
-
var _formRef$current2, _formRef$current3;
|
|
79
|
-
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.getFieldsValue();
|
|
78
|
+
var _formRef$current2, _formRef$current2$get, _formRef$current3, _formRef$current3$set;
|
|
79
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : (_formRef$current2$get = _formRef$current2.getFieldsValue) === null || _formRef$current2$get === void 0 ? void 0 : _formRef$current2$get.call(_formRef$current2)) || {};
|
|
80
80
|
formValue[name] = text;
|
|
81
|
-
(_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.setFieldsValue((0, _objectSpread2.default)({}, formValue));
|
|
81
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : (_formRef$current3$set = _formRef$current3.setFieldsValue) === null || _formRef$current3$set === void 0 ? void 0 : _formRef$current3$set.call(_formRef$current3, (0, _objectSpread2.default)({}, formValue));
|
|
82
82
|
}, [text]);
|
|
83
83
|
var lineInput = function lineInput(e) {
|
|
84
84
|
var line = (e.target.value || '').split('\n').filter(function (o, i) {
|
|
@@ -170,15 +170,15 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
170
170
|
val = '';
|
|
171
171
|
if (rowKey) {
|
|
172
172
|
try {
|
|
173
|
-
var _formRef$current, _formRef$current$getF;
|
|
174
|
-
var row = formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$getF = _formRef$current.getFieldsValue()) === null || _formRef$current$
|
|
173
|
+
var _formRef$current, _formRef$current$getF, _formRef$current$getF2;
|
|
174
|
+
var row = formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$getF = _formRef$current.getFieldsValue) === null || _formRef$current$getF === void 0 ? void 0 : (_formRef$current$getF2 = _formRef$current$getF.call(_formRef$current)) === null || _formRef$current$getF2 === void 0 ? void 0 : _formRef$current$getF2[rowKey];
|
|
175
175
|
txt = row === null || row === void 0 ? void 0 : row[textNameProp];
|
|
176
176
|
val = row === null || row === void 0 ? void 0 : row[name];
|
|
177
177
|
} catch (_unused) {}
|
|
178
178
|
} else {
|
|
179
|
-
var _formRef$current2, _formRef$current3;
|
|
180
|
-
txt = formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.getFieldValue(textNameProp);
|
|
181
|
-
val = formRef === null || formRef === void 0 ? void 0 : (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : _formRef$current3.getFieldValue(name);
|
|
179
|
+
var _formRef$current2, _formRef$current2$get, _formRef$current3, _formRef$current3$get;
|
|
180
|
+
txt = formRef === null || formRef === void 0 ? void 0 : (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : (_formRef$current2$get = _formRef$current2.getFieldValue) === null || _formRef$current2$get === void 0 ? void 0 : _formRef$current2$get.call(_formRef$current2, textNameProp);
|
|
181
|
+
val = formRef === null || formRef === void 0 ? void 0 : (_formRef$current3 = formRef.current) === null || _formRef$current3 === void 0 ? void 0 : (_formRef$current3$get = _formRef$current3.getFieldValue) === null || _formRef$current3$get === void 0 ? void 0 : _formRef$current3$get.call(_formRef$current3, name);
|
|
182
182
|
}
|
|
183
183
|
if (txt) {
|
|
184
184
|
setText(txt);
|
|
@@ -189,8 +189,8 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
189
189
|
}, [rowKey]);
|
|
190
190
|
// 处理返回数据
|
|
191
191
|
var handleValue = function handleValue(row) {
|
|
192
|
-
var _formRef$current4;
|
|
193
|
-
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : _formRef$current4.getFieldsValue();
|
|
192
|
+
var _formRef$current4, _formRef$current4$get;
|
|
193
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current4 = formRef.current) === null || _formRef$current4 === void 0 ? void 0 : (_formRef$current4$get = _formRef$current4.getFieldsValue) === null || _formRef$current4$get === void 0 ? void 0 : _formRef$current4$get.call(_formRef$current4)) || {};
|
|
194
194
|
if (rowKey) {
|
|
195
195
|
formValue = formValue[rowKey] || {};
|
|
196
196
|
}
|
|
@@ -230,10 +230,11 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
230
230
|
setText(txt);
|
|
231
231
|
setVisible(false);
|
|
232
232
|
if (rowKey) {
|
|
233
|
-
|
|
233
|
+
var _formRef$current5, _formRef$current5$set;
|
|
234
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current5 = formRef.current) === null || _formRef$current5 === void 0 ? void 0 : (_formRef$current5$set = _formRef$current5.setFieldsValue) === null || _formRef$current5$set === void 0 ? void 0 : _formRef$current5$set.call(_formRef$current5, (0, _defineProperty2.default)({}, rowKey, formValue));
|
|
234
235
|
} else {
|
|
235
|
-
var _formRef$
|
|
236
|
-
(_formRef$
|
|
236
|
+
var _formRef$current6, _formRef$current6$set;
|
|
237
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current6 = formRef.current) === null || _formRef$current6 === void 0 ? void 0 : (_formRef$current6$set = _formRef$current6.setFieldsValue) === null || _formRef$current6$set === void 0 ? void 0 : _formRef$current6$set.call(_formRef$current6, (0, _objectSpread2.default)({}, formValue));
|
|
237
238
|
}
|
|
238
239
|
onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(row, formRef);
|
|
239
240
|
};
|
|
@@ -264,8 +265,8 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
264
265
|
};
|
|
265
266
|
//直接输入不回车,value 和 text 为同一个值
|
|
266
267
|
var onInput = function onInput(e) {
|
|
267
|
-
var _formRef$
|
|
268
|
-
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
268
|
+
var _formRef$current7, _formRef$current7$get;
|
|
269
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current7 = formRef.current) === null || _formRef$current7 === void 0 ? void 0 : (_formRef$current7$get = _formRef$current7.getFieldsValue) === null || _formRef$current7$get === void 0 ? void 0 : _formRef$current7$get.call(_formRef$current7)) || {};
|
|
269
270
|
if (rowKey) {
|
|
270
271
|
formValue = formValue[rowKey] || {};
|
|
271
272
|
}
|
|
@@ -274,28 +275,30 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
274
275
|
formValue[textNameProp] = val;
|
|
275
276
|
setText(val);
|
|
276
277
|
if (rowKey) {
|
|
277
|
-
|
|
278
|
+
var _formRef$current8, _formRef$current8$set;
|
|
279
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current8 = formRef.current) === null || _formRef$current8 === void 0 ? void 0 : (_formRef$current8$set = _formRef$current8.setFieldsValue) === null || _formRef$current8$set === void 0 ? void 0 : _formRef$current8$set.call(_formRef$current8, (0, _defineProperty2.default)({}, rowKey, formValue));
|
|
278
280
|
} else {
|
|
279
|
-
var _formRef$
|
|
280
|
-
(_formRef$
|
|
281
|
+
var _formRef$current9, _formRef$current9$set;
|
|
282
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current9 = formRef.current) === null || _formRef$current9 === void 0 ? void 0 : (_formRef$current9$set = _formRef$current9.setFieldsValue) === null || _formRef$current9$set === void 0 ? void 0 : _formRef$current9$set.call(_formRef$current9, (0, _objectSpread2.default)({}, formValue));
|
|
281
283
|
}
|
|
282
284
|
};
|
|
283
285
|
// 当表单重置或点clear时,处理值
|
|
284
286
|
var clearValue = function clearValue(e) {
|
|
285
287
|
if (!e.target.value) {
|
|
286
|
-
var _formRef$
|
|
288
|
+
var _formRef$current10, _formRef$current10$ge;
|
|
287
289
|
setText('');
|
|
288
|
-
var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$
|
|
290
|
+
var formValue = (formRef === null || formRef === void 0 ? void 0 : (_formRef$current10 = formRef.current) === null || _formRef$current10 === void 0 ? void 0 : (_formRef$current10$ge = _formRef$current10.getFieldsValue) === null || _formRef$current10$ge === void 0 ? void 0 : _formRef$current10$ge.call(_formRef$current10)) || {};
|
|
289
291
|
if (rowKey) {
|
|
290
292
|
formValue = formValue[rowKey] || {};
|
|
291
293
|
}
|
|
292
294
|
formValue[name] = '';
|
|
293
295
|
formValue[textNameProp] = '';
|
|
294
296
|
if (rowKey) {
|
|
295
|
-
|
|
297
|
+
var _formRef$current11, _formRef$current11$se;
|
|
298
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current11 = formRef.current) === null || _formRef$current11 === void 0 ? void 0 : (_formRef$current11$se = _formRef$current11.setFieldsValue) === null || _formRef$current11$se === void 0 ? void 0 : _formRef$current11$se.call(_formRef$current11, (0, _defineProperty2.default)({}, rowKey, formValue));
|
|
296
299
|
} else {
|
|
297
|
-
var _formRef$
|
|
298
|
-
(_formRef$
|
|
300
|
+
var _formRef$current12, _formRef$current12$se;
|
|
301
|
+
formRef === null || formRef === void 0 ? void 0 : (_formRef$current12 = formRef.current) === null || _formRef$current12 === void 0 ? void 0 : (_formRef$current12$se = _formRef$current12.setFieldsValue) === null || _formRef$current12$se === void 0 ? void 0 : _formRef$current12$se.call(_formRef$current12, (0, _objectSpread2.default)({}, formValue));
|
|
299
302
|
}
|
|
300
303
|
}
|
|
301
304
|
};
|