ztxkui 1.9.9 → 2.0.0

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.
@@ -75,6 +75,10 @@ export interface IProps<T> extends Omit<SelectProps<T>, 'onChange'> {
75
75
  * 远程搜索Key值
76
76
  */
77
77
  remoteSearchKey?: string;
78
+ /**
79
+ * 远程搜索主键Key值
80
+ */
81
+ remoteSearchDataKey?: string;
78
82
  /**
79
83
  * 接口数据格式转换
80
84
  */
@@ -95,6 +99,6 @@ export interface IProps<T> extends Omit<SelectProps<T>, 'onChange'> {
95
99
  * { code: 200, data: { records: [] } } || { status: 200, data: { code: 200, data: { records: [] } } }
96
100
  * 如果数据不能在接口层面满足以上形式,那么组件提供transformData属性,转换接口数据格式
97
101
  */
98
- declare function EnhanceSelect<VT extends SelectValue = SelectValue>({ list, defaultList, params, url, method, dataKey, componentKey, titleKey, showAll, isCatch, onCompleted, onChange, request, remoteSearch, remoteSearchKey, transformData, joinKey, joinStr, ...restProps }: IProps<VT>): JSX.Element;
102
+ declare function EnhanceSelect<VT extends SelectValue = SelectValue>({ list, defaultList, params, url, method, dataKey, componentKey, titleKey, showAll, isCatch, onCompleted, onChange, request, remoteSearch, remoteSearchKey, remoteSearchDataKey, transformData, joinKey, joinStr, ...restProps }: IProps<VT>): JSX.Element;
99
103
  declare const _default: React.MemoExoticComponent<typeof EnhanceSelect>;
100
104
  export default _default;
@@ -71,7 +71,7 @@ function getData(request, options) {
71
71
  * 如果数据不能在接口层面满足以上形式,那么组件提供transformData属性,转换接口数据格式
72
72
  */
73
73
  function EnhanceSelect(_a) {
74
- var list = _a.list, defaultList = _a.defaultList, params = _a.params, url = _a.url, _b = _a.method, method = _b === void 0 ? 'GET' : _b, _c = _a.dataKey, dataKey = _c === void 0 ? 'id' : _c, componentKey = _a.componentKey, _d = _a.titleKey, titleKey = _d === void 0 ? 'name' : _d, showAll = _a.showAll, isCatch = _a.isCatch, onCompleted = _a.onCompleted, onChange = _a.onChange, request = _a.request, remoteSearch = _a.remoteSearch, remoteSearchKey = _a.remoteSearchKey, transformData = _a.transformData, joinKey = _a.joinKey, _e = _a.joinStr, joinStr = _e === void 0 ? '-' : _e, restProps = __rest(_a, ["list", "defaultList", "params", "url", "method", "dataKey", "componentKey", "titleKey", "showAll", "isCatch", "onCompleted", "onChange", "request", "remoteSearch", "remoteSearchKey", "transformData", "joinKey", "joinStr"]);
74
+ var list = _a.list, defaultList = _a.defaultList, params = _a.params, url = _a.url, _b = _a.method, method = _b === void 0 ? 'GET' : _b, _c = _a.dataKey, dataKey = _c === void 0 ? 'id' : _c, componentKey = _a.componentKey, _d = _a.titleKey, titleKey = _d === void 0 ? 'name' : _d, showAll = _a.showAll, isCatch = _a.isCatch, onCompleted = _a.onCompleted, onChange = _a.onChange, request = _a.request, remoteSearch = _a.remoteSearch, remoteSearchKey = _a.remoteSearchKey, remoteSearchDataKey = _a.remoteSearchDataKey, transformData = _a.transformData, joinKey = _a.joinKey, _e = _a.joinStr, joinStr = _e === void 0 ? '-' : _e, restProps = __rest(_a, ["list", "defaultList", "params", "url", "method", "dataKey", "componentKey", "titleKey", "showAll", "isCatch", "onCompleted", "onChange", "request", "remoteSearch", "remoteSearchKey", "remoteSearchDataKey", "transformData", "joinKey", "joinStr"]);
75
75
  // 下拉数据源
76
76
  var _f = useFetchState([]), selectList = _f[0], setSelectList = _f[1];
77
77
  var _g = useFetchState(false), loading = _g[0], setLoading = _g[1];
@@ -119,7 +119,7 @@ function EnhanceSelect(_a) {
119
119
  // 远程搜索
120
120
  var getRemoteDataHandle = useCallback(function (value, dataKeyValue) {
121
121
  var searchKey = remoteSearchKey ? remoteSearchKey : titleKey;
122
- var searchDataKey = dataKey;
122
+ var searchDataKey = remoteSearchDataKey ? remoteSearchDataKey : dataKey;
123
123
  var outParams = params;
124
124
  try {
125
125
  outParams = JSON.parse(params);
@@ -172,6 +172,7 @@ function EnhanceSelect(_a) {
172
172
  method,
173
173
  request,
174
174
  remoteSearchKey,
175
+ remoteSearchDataKey,
175
176
  titleKey,
176
177
  dataKey,
177
178
  setSelectList,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "1.9.9",
3
+ "version": "2.0.0",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",