@quansitech/antd-admin 1.1.13 → 1.1.15
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.
|
@@ -91,15 +91,22 @@ export default function (props) {
|
|
|
91
91
|
};
|
|
92
92
|
}();
|
|
93
93
|
var onChange = function onChange(values) {
|
|
94
|
-
var _props$
|
|
94
|
+
var _props$fieldProps3;
|
|
95
95
|
setValues(values);
|
|
96
96
|
if (!(values !== null && values !== void 0 && values.length)) {
|
|
97
97
|
var _props$fieldProps;
|
|
98
98
|
(_props$fieldProps = props.fieldProps) === null || _props$fieldProps === void 0 || _props$fieldProps.onChange(props.dataIndex, undefined);
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
+
if (props.fieldProps.multiple) {
|
|
102
|
+
var _props$fieldProps2;
|
|
103
|
+
(_props$fieldProps2 = props.fieldProps) === null || _props$fieldProps2 === void 0 || _props$fieldProps2.onChange(values.map(function (v) {
|
|
104
|
+
return v[v.length - 1];
|
|
105
|
+
}));
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
101
108
|
var value = values[values.length - 1];
|
|
102
|
-
(_props$
|
|
109
|
+
(_props$fieldProps3 = props.fieldProps) === null || _props$fieldProps3 === void 0 || _props$fieldProps3.onChange(value);
|
|
103
110
|
};
|
|
104
111
|
return /*#__PURE__*/React.createElement("div", {
|
|
105
112
|
className: props.className
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { replaceUrl } from "../../../lib/helpers";
|
|
3
|
+
export default function (props) {
|
|
4
|
+
var url = replaceUrl(props.fieldProps.url || props.fieldProps.href || '', props.record);
|
|
5
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
6
|
+
href: url
|
|
7
|
+
}, props.text);
|
|
8
|
+
}
|