@bit-sun/business-component 1.1.7 → 1.1.9

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/.gitlab-ci.yml ADDED
@@ -0,0 +1,174 @@
1
+ variables:
2
+ REGISTRY: 10.90.21.93:8000
3
+ BUILD_IMAGE: mqr/wechat-board
4
+ PROJECT_DIR: wechat-board
5
+ APP_JAR_DIR: dist.tar.gz
6
+ ALIYUN_IMAGE: registry.cn-hangzhou.aliyuncs.com/mqe-front/wechat-board
7
+ ALIYUN_HARBOR_USER: xinjiangshuzhiyun1
8
+ ALIYUN_HARBOR_PASS: xinjiangshuzhiyun@
9
+
10
+
11
+ before_script:
12
+ - echo "begin to run script"
13
+ - echo $HOME
14
+ stages:
15
+ - build
16
+ - deploy
17
+ - trigger
18
+
19
+ #构建模板
20
+ .build:template: &template
21
+ stage: build
22
+ image: node:10-alpine
23
+ script:
24
+ - yarn config set registry https://registry.npm.taobao.org
25
+ - npm install cnpm -g
26
+ - yarn config set ignore-engines true
27
+ - cnpm install
28
+ - yarn docs:build
29
+ - tar -czvf dist.tar.gz docs-dist/
30
+
31
+ #构建模板
32
+ build:dev:
33
+ <<: *template
34
+ cache:
35
+ paths:
36
+ - $APP_JAR_DIR
37
+ policy: push
38
+
39
+ # 开发分支发布镜像
40
+ deploy:dev:branch:
41
+ stage: deploy
42
+ image: docker:19.03.1
43
+ variables:
44
+ DOCKER_IMAGE: $REGISTRY/$BUILD_IMAGE
45
+ script:
46
+ - docker version
47
+ - docker login -u admin -p Harbor12345 $REGISTRY
48
+ - docker build -t $DOCKER_IMAGE:dev .
49
+ - docker push $DOCKER_IMAGE:dev
50
+ - docker rmi $DOCKER_IMAGE:dev
51
+ cache:
52
+ paths:
53
+ - $APP_JAR_DIR
54
+ policy: pull
55
+ only:
56
+ - /^202.*$/
57
+ - develop
58
+ - master
59
+ except:
60
+ - tags
61
+
62
+
63
+ # 推送tag到本地服务
64
+ deploy:dev:tag:
65
+ stage: deploy
66
+ image: docker:19.03.1
67
+ variables:
68
+ DOCKER_IMAGE: $REGISTRY/$BUILD_IMAGE
69
+ script:
70
+ - pwd
71
+ - echo "docker start"
72
+ - docker version
73
+ - echo "docker verseion end"
74
+ - docker login -u admin -p Harbor12345 $REGISTRY
75
+ - docker build -t $DOCKER_IMAGE:dev .
76
+ - docker push $DOCKER_IMAGE:dev
77
+ - docker rmi $DOCKER_IMAGE:dev
78
+ cache:
79
+ paths:
80
+ - $APP_JAR_DIR
81
+ policy: pull
82
+ except:
83
+ - branches
84
+ - /^release.*$/
85
+ - /^uat.*$/
86
+ - /^prd.*$/
87
+
88
+ # uat的branch上远程环境
89
+
90
+
91
+ # uat版本tag上远程环境
92
+ deploy:uat:tag:
93
+ stage: deploy
94
+ image: docker:19.03.1
95
+ variables:
96
+ DOCKER_IMAGE: $REGISTRY/$BUILD_IMAGE
97
+ script:
98
+ - pwd
99
+ - echo "docker start"
100
+ - docker version
101
+ - echo "docker verseion end"
102
+ - docker login -u admin -p Harbor12345 $REGISTRY
103
+ - docker build -t $DOCKER_IMAGE:dev .
104
+ - docker push $DOCKER_IMAGE:dev
105
+
106
+ - docker tag $DOCKER_IMAGE:dev $DOCKER_IMAGE:$CI_COMMIT_TAG
107
+ - docker login -u $ALIYUN_HARBOR_USER -p $ALIYUN_HARBOR_PASS registry.cn-hangzhou.aliyuncs.com
108
+ - docker tag $DOCKER_IMAGE:$CI_COMMIT_TAG $ALIYUN_IMAGE:latest
109
+ - docker push $ALIYUN_IMAGE:latest
110
+ - docker tag $DOCKER_IMAGE:$CI_COMMIT_TAG $ALIYUN_IMAGE:$CI_COMMIT_TAG
111
+ - docker push $ALIYUN_IMAGE:$CI_COMMIT_TAG
112
+
113
+ - docker rmi $DOCKER_IMAGE:dev
114
+ - docker rmi $DOCKER_IMAGE:$CI_COMMIT_TAG
115
+ - docker rmi $ALIYUN_IMAGE:latest
116
+ - docker rmi $ALIYUN_IMAGE:$CI_COMMIT_TAG
117
+ cache:
118
+ paths:
119
+ - $APP_JAR_DIR
120
+ policy: pull
121
+ only:
122
+ - /^uat.*$/
123
+ - /^prd.*$/
124
+ - /^release.*$/
125
+ except:
126
+ - branches
127
+
128
+
129
+ # branch触发本地发布
130
+ trigger:local:branch:
131
+ stage: trigger
132
+ image: $REGISTRY/bitsun-devtools/sshpass:latest
133
+ script:
134
+ sshpass -p xmx-2020 ssh -o StrictHostKeyChecking=no root@172.16.4.92 mkdir -p /$PROJECT_DIR;
135
+ sshpass -p xmx-2020 scp -o StrictHostKeyChecking=no -r deploy.sh root@172.16.4.92:/$PROJECT_DIR/deploy.sh;
136
+ sshpass -p xmx-2020 ssh -o StrictHostKeyChecking=no root@172.16.4.92 chmod +X /$PROJECT_DIR/deploy.sh;
137
+ sshpass -p xmx-2020 ssh -o StrictHostKeyChecking=no root@172.16.4.92 sh /$PROJECT_DIR/deploy.sh;
138
+ only:
139
+ - develop
140
+ - master
141
+ - /^202.*$/
142
+ except:
143
+ - tags
144
+
145
+ # tag触发本地发布
146
+ trigger:local:tag:
147
+ stage: trigger
148
+ image: $REGISTRY/bitsun-devtools/sshpass:latest
149
+ script:
150
+ sshpass -p xmx-2020 ssh -o StrictHostKeyChecking=no root@172.16.4.92 mkdir -p /$PROJECT_DIR;
151
+ sshpass -p xmx-2020 scp -o StrictHostKeyChecking=no -r deploy.sh root@172.16.4.92:/$PROJECT_DIR/deploy.sh;
152
+ sshpass -p xmx-2020 ssh -o StrictHostKeyChecking=no root@172.16.4.92 chmod +X /$PROJECT_DIR/deploy.sh;
153
+ sshpass -p xmx-2020 ssh -o StrictHostKeyChecking=no root@172.16.4.92 sh /$PROJECT_DIR/deploy.sh;
154
+ except:
155
+ - /^release.*$/
156
+ - branches
157
+
158
+
159
+ # 触发阿里云发布
160
+ trigger:remote:tag:
161
+ stage: trigger
162
+ image: $REGISTRY/bitsun-devtools/sshpass:latest
163
+ script:
164
+ - echo "trigger"
165
+ # - curl -X POST -F token=d2681aea95c9907a64a693095dc910 -F "ref=master" -F "variables[DEPLOY_COMMIT_SHA]=$CI_COMMIT_SHA" -F "variables[DEPLOY_PROJECT_NAME]=phoenix-mall-platform" -F "variables[DEPLOY_NAMESPACE]=CENTER" http://47.102.40.227/api/v4/projects/108/trigger/pipeline
166
+ only:
167
+ - /^uat.*$/
168
+ - /^prd.*$/
169
+ - /^release.*$/
170
+ except:
171
+ - branches
172
+
173
+
174
+
@@ -1,4 +1,4 @@
1
- export declare function commonFun(type?: string, prefixURL: any): {
1
+ export declare function commonFun(type?: string, prefixUrl: any): {
2
2
  modalTableProps: {
3
3
  modalTableTitle: string;
4
4
  tableSearchForm: any[];
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import axios from 'axios';
2
2
  import React, { createContext, useContext, useEffect, forwardRef, createElement, useState } from 'react';
3
- import { message, Menu, Space, Dropdown, Tooltip, Button, Checkbox, Input, Modal, Select, Form, Divider, Spin, Table } from 'antd';
3
+ import { message, Menu, Space, Dropdown, Tooltip, Button, Checkbox, Input, Modal, Select, Form, Divider, Spin, Table, TreeSelect } from 'antd';
4
4
  import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
5
5
  import classNames from 'classnames';
6
6
  import _ from 'loadsh';
@@ -2419,7 +2419,7 @@ function getStorageVale(storageKeyString) {
2419
2419
  return "";
2420
2420
  }
2421
2421
 
2422
- var css_248z$2 = ".search_select_show {\n display: flex;\n}\n.search_select_expand_button {\n position: relative;\n width: 30px;\n color: #ffffff;\n cursor: pointer;\n}\n.search_select_expand_button span {\n position: absolute;\n height: 20px;\n line-height: 14px;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.search_select_wrapper {\n position: relative;\n display: flex;\n min-height: 60vh;\n max-height: 60vh;\n overflow: hidden;\n font-size: 14px;\n}\n.search_select_wrapper_click_flag {\n position: absolute;\n z-index: 10;\n}\n.search_select_wrapper_click_flag_arrow {\n transform: rotate(0deg);\n transition: transform 0.5s;\n}\n.search_select_wrapper_click_flag_arrow_1 {\n transform: rotate(-180deg);\n transition: transform 0.5s;\n}\n.search_select_wrapper_left {\n width: 28%;\n overflow-y: hidden;\n transition: all 0.3s;\n margin-left: 20px;\n}\n.search_select_wrapper_left1 {\n width: 0;\n height: 0;\n transition: all 0.3s;\n display: none;\n}\n.search_select_wrapper_right {\n width: 70%;\n margin-left: 1%;\n}\n.search_select_wrapper_right1 {\n width: 100%;\n margin-left: 20px;\n}\n.search_select_wrapper_right,\n.search_select_wrapper _right1 {\n overflow-x: auto;\n}\n.search_select_wrapper .select_list_columns {\n width: 100%;\n height: calc(60vh - 60px);\n overflow-y: auto;\n border: 1px solid #d8d8d8;\n}\n.search_select_wrapper .select_list_columns_tips {\n background: #eee;\n padding: 6px 20px;\n margin-bottom: 10px;\n}\n.search_select_wrapper .select_list_columns_formItems {\n padding: 0 20px;\n}\n.search_select_wrapper .select_list_searchButton {\n display: flex;\n margin: 10px 0px;\n justify-content: flex-end;\n}\n.search_select_wrapper .select_list_button_space {\n margin-right: 10px;\n}\n.search_select_wrapper .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 34px;\n line-height: 32px;\n background-color: #eee;\n margin-bottom: 10px;\n padding: 0 12px;\n}\n.search_select_wrapper .select_list_selectAll {\n position: relative;\n top: -40px;\n left: 20px;\n width: 160px;\n}\n";
2422
+ var css_248z$2 = ".search_select_show {\n display: flex;\n}\n.search_select_expand_button {\n position: relative;\n width: 30px;\n color: #ffffff;\n cursor: pointer;\n}\n.search_select_expand_button span {\n position: absolute;\n height: 20px;\n line-height: 14px;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.search_select_wrapper {\n position: relative;\n display: flex;\n min-height: 60vh;\n max-height: 60vh;\n overflow: hidden;\n font-size: 14px;\n}\n.search_select_wrapper_click_flag {\n position: absolute;\n z-index: 10;\n}\n.search_select_wrapper_click_flag_arrow {\n transform: rotate(0deg);\n transition: transform 0.5s;\n}\n.search_select_wrapper_click_flag_arrow_1 {\n transform: rotate(-180deg);\n transition: transform 0.5s;\n}\n.search_select_wrapper_left {\n width: 28%;\n overflow-y: hidden;\n transition: all 0.3s;\n margin-left: 20px;\n}\n.search_select_wrapper_left1 {\n width: 0;\n height: 0;\n transition: all 0.3s;\n display: none;\n}\n.search_select_wrapper_right {\n width: 70%;\n margin-left: 1%;\n}\n.search_select_wrapper_right1 {\n width: 100%;\n margin-left: 20px;\n}\n.search_select_wrapper_right,\n.search_select_wrapper_right1 {\n overflow-x: auto;\n}\n.search_select_wrapper .select_list_columns {\n width: 100%;\n height: calc(60vh - 60px);\n overflow-y: auto;\n border: 1px solid #d8d8d8;\n}\n.search_select_wrapper .select_list_columns_tips {\n background: #eee;\n padding: 6px 20px;\n margin-bottom: 10px;\n}\n.search_select_wrapper .select_list_columns_formItems {\n padding: 0 20px;\n}\n.search_select_wrapper .select_list_searchButton {\n display: flex;\n margin: 10px 0px;\n justify-content: flex-end;\n}\n.search_select_wrapper .select_list_button_space {\n margin-right: 10px;\n}\n.search_select_wrapper .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 34px;\n line-height: 32px;\n background-color: #eee;\n margin-bottom: 10px;\n padding: 0 12px;\n}\n.search_select_wrapper .select_list_selectAll {\n position: relative;\n top: -40px;\n left: 20px;\n width: 160px;\n}\n";
2423
2423
  styleInject(css_248z$2);
2424
2424
 
2425
2425
  var Option = Select.Option;
@@ -2435,6 +2435,18 @@ var SearchSelect = function SearchSelect(props) {
2435
2435
  labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
2436
2436
  requestConfig = props.requestConfig,
2437
2437
  ctx = props.ctx;
2438
+
2439
+ var _ref = requestConfig || {},
2440
+ url = _ref.url,
2441
+ otherParams = _ref.otherParams,
2442
+ isMap = _ref.isMap,
2443
+ fixedparameter = _ref.fixedparameter,
2444
+ fieldValToParam = _ref.fieldValToParam,
2445
+ _ref$mappingTextField = _ref.mappingTextField,
2446
+ mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
2447
+ _ref$mappingValueFiel = _ref.mappingValueField,
2448
+ mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel;
2449
+
2438
2450
  var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
2439
2451
 
2440
2452
  var initVal = value || (selectMode ? [] : null);
@@ -2573,15 +2585,6 @@ var SearchSelect = function SearchSelect(props) {
2573
2585
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2574
2586
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
2575
2587
  if (!requestConfig) return;
2576
- var url = requestConfig.url,
2577
- otherParams = requestConfig.otherParams,
2578
- isMap = requestConfig.isMap,
2579
- fixedparameter = requestConfig.fixedparameter,
2580
- fieldValToParam = requestConfig.fieldValToParam,
2581
- _requestConfig$mappin = requestConfig.mappingTextField,
2582
- mappingTextField = _requestConfig$mappin === void 0 ? 'name' : _requestConfig$mappin,
2583
- _requestConfig$mappin2 = requestConfig.mappingValueField,
2584
- mappingValueField = _requestConfig$mappin2 === void 0 ? 'code' : _requestConfig$mappin2;
2585
2588
  setFetching(true); // 处理dependence参数
2586
2589
 
2587
2590
  var fixedParam = {};
@@ -2724,13 +2727,13 @@ var SearchSelect = function SearchSelect(props) {
2724
2727
  value: value.key,
2725
2728
  text: value.label
2726
2729
  }] : [{
2727
- value: value.key
2730
+ value: value
2728
2731
  }]);
2729
2732
  setPopValue(labelInValue ? [{
2730
2733
  value: value.key,
2731
2734
  text: value.label
2732
2735
  }] : [{
2733
- value: value.key
2736
+ value: value
2734
2737
  }]);
2735
2738
  }
2736
2739
  }
@@ -2793,10 +2796,11 @@ var SearchSelect = function SearchSelect(props) {
2793
2796
  };
2794
2797
 
2795
2798
  var handleTableChange = function handleTableChange(pagination) {
2796
- getData({
2799
+ var params = form.getFieldsValue();
2800
+ getData(_objectSpread2(_objectSpread2({}, params), {}, {
2797
2801
  pageSize: pagination.pageSize,
2798
2802
  currentPage: pagination.current
2799
- }, 2);
2803
+ }), 2);
2800
2804
  };
2801
2805
 
2802
2806
  var onChangeCheckAll = function onChangeCheckAll(e) {
@@ -2919,7 +2923,7 @@ var SearchSelect = function SearchSelect(props) {
2919
2923
  var formItem = function formItem(list) {
2920
2924
  if (isModalVisible && (list === null || list === void 0 ? void 0 : list.length)) {
2921
2925
  return list.map(function (i) {
2922
- var _i$field, _i$field3;
2926
+ var _i$field, _i$field3, _i$field5;
2923
2927
 
2924
2928
  if ((i === null || i === void 0 ? void 0 : i.type) === 'select' || (i === null || i === void 0 ? void 0 : (_i$field = i.field) === null || _i$field === void 0 ? void 0 : _i$field.type) === 'select') {
2925
2929
  var _i$field2, _i$initialSource;
@@ -2939,6 +2943,21 @@ var SearchSelect = function SearchSelect(props) {
2939
2943
  key: m.value
2940
2944
  }, m.text);
2941
2945
  }))));
2946
+ }
2947
+
2948
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'treeSelect' || (i === null || i === void 0 ? void 0 : (_i$field3 = i.field) === null || _i$field3 === void 0 ? void 0 : _i$field3.type) === 'treeSelect') {
2949
+ var _i$field4;
2950
+
2951
+ return /*#__PURE__*/React.createElement(Form.Item, {
2952
+ name: i.name,
2953
+ label: i.label,
2954
+ key: i.name
2955
+ }, /*#__PURE__*/React.createElement(TreeSelect, _objectSpread2({
2956
+ style: {
2957
+ width: '100%'
2958
+ },
2959
+ placeholder: "\u8BF7\u9009\u62E9"
2960
+ }, i === null || i === void 0 ? void 0 : (_i$field4 = i.field) === null || _i$field4 === void 0 ? void 0 : _i$field4.props)));
2942
2961
  } // 默认type是input
2943
2962
 
2944
2963
 
@@ -2953,7 +2972,7 @@ var SearchSelect = function SearchSelect(props) {
2953
2972
  placeholder: "\u8BF7\u8F93\u5165",
2954
2973
  allowClear: true,
2955
2974
  maxLength: 100
2956
- }, i === null || i === void 0 ? void 0 : (_i$field3 = i.field) === null || _i$field3 === void 0 ? void 0 : _i$field3.props)));
2975
+ }, i === null || i === void 0 ? void 0 : (_i$field5 = i.field) === null || _i$field5 === void 0 ? void 0 : _i$field5.props)));
2957
2976
  });
2958
2977
  } else {
2959
2978
  return null;
@@ -3045,7 +3064,7 @@ var SearchSelect = function SearchSelect(props) {
3045
3064
  key: "submit",
3046
3065
  type: "primary",
3047
3066
  onClick: handleOk,
3048
- disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
3067
+ disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
3049
3068
  }, "\u786E\u5B9A")]
3050
3069
  }, /*#__PURE__*/React.createElement("div", {
3051
3070
  className: 'search_select_wrapper'
@@ -3094,14 +3113,14 @@ var SearchSelect = function SearchSelect(props) {
3094
3113
  style: {
3095
3114
  color: 'rgba(127, 127, 127, 0.6470588235294118)'
3096
3115
  }
3097
- }, selectMode ? '勾选后点击确定按钮完成选择' : '双击数据行或单击按钮完成选择')), /*#__PURE__*/React.createElement(Table, {
3116
+ }, selectMode ? '勾选后点击确定按钮完成选择' : '双击数据行或点击单选图标完成选择')), /*#__PURE__*/React.createElement(Table, {
3098
3117
  size: 'small',
3099
3118
  rowSelection: rowSelection,
3100
3119
  columns: modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableColumns,
3101
3120
  dataSource: tableData,
3102
3121
  pagination: tablePagination,
3103
3122
  onChange: handleTableChange,
3104
- rowKey: 'code',
3123
+ rowKey: mappingValueField,
3105
3124
  scroll: {
3106
3125
  x: modalTableProps.overScrollX || 'max-content',
3107
3126
  y: modalTableProps.overScrollY || null
@@ -3184,10 +3203,10 @@ var loadSelectSource = function loadSelectSource(url, params) {
3184
3203
  });
3185
3204
  };
3186
3205
 
3187
- function commonFun(type, prefixURL) {
3206
+ function commonFun(type, prefixUrl) {
3188
3207
  // 默认type === 'supplier' 供应商选择器
3189
3208
  var requestConfig = {
3190
- url: "".concat(prefixURL.selectPrefix, "/supplier"),
3209
+ url: "".concat(prefixUrl.selectPrefix, "/supplier"),
3191
3210
  filter: 'qp-nameAndCode-like',
3192
3211
  otherParams: {
3193
3212
  sorter: 'desc-id'
@@ -3204,18 +3223,47 @@ function commonFun(type, prefixURL) {
3204
3223
  * */
3205
3224
 
3206
3225
  var formatSource = function formatSource(reData, position, changePosition, changeSearchForm) {
3207
- var _reData$position, _reData$position$data;
3226
+ var _reData$position;
3208
3227
 
3209
- var data = reData && ((_reData$position = reData[position]) === null || _reData$position === void 0 ? void 0 : (_reData$position$data = _reData$position.data) === null || _reData$position$data === void 0 ? void 0 : _reData$position$data.items) || [];
3210
- var formatData = (data === null || data === void 0 ? void 0 : data.length) ? data.map(function (v) {
3228
+ var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['code', 'name'];
3229
+ var data = reData && ((_reData$position = reData[position]) === null || _reData$position === void 0 ? void 0 : _reData$position.data);
3230
+ var list = Array.isArray(data) ? data : (data === null || data === void 0 ? void 0 : data.items) || (data === null || data === void 0 ? void 0 : data.list) || [];
3231
+ var formatData = (list === null || list === void 0 ? void 0 : list.length) ? list.map(function (v) {
3211
3232
  return {
3212
- text: v.name,
3213
- value: v.code
3233
+ text: v[resKeyValue[1]],
3234
+ value: v[resKeyValue[0]]
3214
3235
  };
3215
3236
  }) : [];
3216
3237
  changeSearchForm[changePosition] = _objectSpread2(_objectSpread2({}, changeSearchForm[changePosition]), {}, {
3217
3238
  initialSource: formatData
3218
3239
  });
3240
+ }; // 格式化树选择器数据源
3241
+
3242
+
3243
+ var mapSearchTree = function mapSearchTree(treeDataItem, resKeyValue) {
3244
+ var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
3245
+ return {
3246
+ title: treeDataItem[resKeyValue[1]],
3247
+ key: treeDataItem[resKeyValue[0]],
3248
+ parentId: treeDataItem.parent,
3249
+ data: _objectSpread2({}, treeDataItem),
3250
+ isLeaf: !haveChildren,
3251
+ disabled: haveChildren,
3252
+ children: haveChildren ? treeDataItem.children.map(function (i) {
3253
+ return mapSearchTree(i, resKeyValue);
3254
+ }) : []
3255
+ };
3256
+ };
3257
+
3258
+ var formatTreeDataSource = function formatTreeDataSource(reData, position, changePosition, changeSearchForm) {
3259
+ var _reData$position2;
3260
+
3261
+ var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['id', 'name'];
3262
+ var data = reData && ((_reData$position2 = reData[position]) === null || _reData$position2 === void 0 ? void 0 : _reData$position2.data);
3263
+ var formatData = data && Array.isArray(data) && data.length && data.map(function (ites) {
3264
+ return mapSearchTree(ites, resKeyValue);
3265
+ }) || [];
3266
+ changeSearchForm[changePosition].field.props.treeData = formatData;
3219
3267
  };
3220
3268
 
3221
3269
  var tableSearchForm = [];
@@ -3290,14 +3338,14 @@ function commonFun(type, prefixURL) {
3290
3338
  label: '共享类型',
3291
3339
  initialSource: getDictionarySource('UC000013')
3292
3340
  }];
3293
- Promise.all([loadSelectSource("".concat(prefixURL.formSelectFix, "/company"), {
3341
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
3294
3342
  pageSize: 5000,
3295
3343
  currentPage: 1,
3296
3344
  'qp-companyType-eq': '30'
3297
- }), loadSelectSource("".concat(prefixURL.formSelectFix, "/accountingSubject"), {
3345
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
3298
3346
  pageSize: 5000,
3299
3347
  currentPage: 1
3300
- }), loadSelectSource("".concat(prefixURL.formSelectFix, "/company"), {
3348
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
3301
3349
  pageSize: 5000,
3302
3350
  currentPage: 1,
3303
3351
  'qp-companyType-eq': '20'
@@ -3335,6 +3383,140 @@ function commonFun(type, prefixURL) {
3335
3383
  }]
3336
3384
  }; // 商品选择器
3337
3385
 
3386
+ if (type === 'skuCommodity') {
3387
+ requestConfig = {
3388
+ url: "".concat(prefixUrl.selectPrefix, "/sku"),
3389
+ filter: 'qp-nameAndCode-like',
3390
+ otherParams: {
3391
+ sorter: 'desc-id'
3392
+ } // 默认参数
3393
+
3394
+ };
3395
+ tableSearchForm = [{
3396
+ name: 'qp-name-like',
3397
+ label: 'SKU名称'
3398
+ }, {
3399
+ name: 'qp-skuCode-like',
3400
+ label: 'SKU编码'
3401
+ }, {
3402
+ name: 'qp-barCode-like',
3403
+ label: '条形码'
3404
+ }, {
3405
+ name: 'qp-itemName-like',
3406
+ label: '所属SPU名称'
3407
+ }, {
3408
+ name: 'qp-itemCode-like',
3409
+ label: '所属SPU编码'
3410
+ }, {
3411
+ name: 'qp-brandId-in',
3412
+ type: 'select',
3413
+ label: '品牌',
3414
+ field: {
3415
+ type: 'select',
3416
+ props: {
3417
+ mode: 'multiple',
3418
+ notFoundContent: '暂无数据',
3419
+ allowClear: true,
3420
+ showSearch: true,
3421
+ showArrow: true,
3422
+ maxTagCount: 1,
3423
+ optionFilterProp: 'children',
3424
+ filterOption: function filterOption(input, option) {
3425
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
3426
+ }
3427
+ }
3428
+ }
3429
+ }, {
3430
+ name: 'qp-categoryId-in',
3431
+ type: 'treeSelect',
3432
+ label: '类目',
3433
+ field: {
3434
+ type: 'treeSelect',
3435
+ props: {
3436
+ treeData: [],
3437
+ treeCheckable: true,
3438
+ showSearch: true,
3439
+ allowClear: true,
3440
+ showArrow: true,
3441
+ treeNodeFilterProp: 'title',
3442
+ treeDefaultExpandAll: true,
3443
+ maxTagCount: 1,
3444
+ placeholder: '请选择',
3445
+ style: {
3446
+ width: '100%'
3447
+ },
3448
+ dropdownStyle: {
3449
+ maxHeight: 400,
3450
+ maxWidth: 100,
3451
+ overflow: 'auto'
3452
+ }
3453
+ }
3454
+ }
3455
+ }, {
3456
+ name: 'qp-classId-in',
3457
+ type: 'select',
3458
+ label: '品类',
3459
+ field: {
3460
+ type: 'select',
3461
+ props: {
3462
+ mode: 'multiple',
3463
+ notFoundContent: '暂无数据',
3464
+ allowClear: true,
3465
+ showSearch: true,
3466
+ showArrow: true,
3467
+ maxTagCount: 1,
3468
+ optionFilterProp: 'children',
3469
+ filterOption: function filterOption(input, option) {
3470
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
3471
+ }
3472
+ }
3473
+ }
3474
+ }];
3475
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
3476
+ pageSize: 5000,
3477
+ currentPage: 1
3478
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
3479
+ pageSize: 5000,
3480
+ currentPage: 1
3481
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
3482
+ pageSize: 5000,
3483
+ currentPage: 1
3484
+ })]).then(function (x) {
3485
+ formatSource(x, 0, 5, tableSearchForm, ['id', 'name']);
3486
+ formatTreeDataSource(x, 1, 6, tableSearchForm);
3487
+ formatSource(x, 2, 7, tableSearchForm, ['id', 'name']);
3488
+ });
3489
+ modalTableProps = {
3490
+ modalTableTitle: '选择SKU',
3491
+ tableSearchForm: tableSearchForm,
3492
+ tableColumns: [{
3493
+ title: 'SKU编码',
3494
+ dataIndex: 'skuCode'
3495
+ }, {
3496
+ title: 'SKU名称',
3497
+ dataIndex: 'name'
3498
+ }, {
3499
+ title: '所属SPU',
3500
+ dataIndex: 'itemName'
3501
+ }, {
3502
+ title: '规格',
3503
+ dataIndex: 'skuSpec'
3504
+ }, {
3505
+ title: '类目',
3506
+ dataIndex: 'categoryName'
3507
+ }, {
3508
+ title: '品类',
3509
+ dataIndex: 'className'
3510
+ }, {
3511
+ title: '品牌',
3512
+ dataIndex: 'brandName'
3513
+ }, {
3514
+ title: '条形码',
3515
+ dataIndex: 'barCode'
3516
+ }]
3517
+ };
3518
+ } // 仓库选择器
3519
+
3338
3520
  return {
3339
3521
  modalTableProps: modalTableProps,
3340
3522
  requestConfig: requestConfig
@@ -3342,13 +3524,13 @@ function commonFun(type, prefixURL) {
3342
3524
  }
3343
3525
 
3344
3526
  var BusinessSearchSelect = function BusinessSearchSelect(props) {
3345
- var businessType = (props === null || props === void 0 ? void 0 : props.SelectBusinessType) || 'supplier';
3346
- var prefixURL = (props === null || props === void 0 ? void 0 : props.prefixUrl) || {
3527
+ var businessType = (props === null || props === void 0 ? void 0 : props.selectBusinessType) || 'supplier';
3528
+ var prefixUrl = (props === null || props === void 0 ? void 0 : props.prefixUrl) || {
3347
3529
  selectPrefix: '/bop/api',
3348
3530
  formSelectFix: '/bop/api'
3349
3531
  };
3350
3532
 
3351
- var _commonFun = commonFun(businessType, prefixURL),
3533
+ var _commonFun = commonFun(businessType, prefixUrl),
3352
3534
  requestConfig = _commonFun.requestConfig,
3353
3535
  modalTableProps = _commonFun.modalTableProps;
3354
3536
 
package/dist/index.js CHANGED
@@ -2430,7 +2430,7 @@ function getStorageVale(storageKeyString) {
2430
2430
  return "";
2431
2431
  }
2432
2432
 
2433
- var css_248z$2 = ".search_select_show {\n display: flex;\n}\n.search_select_expand_button {\n position: relative;\n width: 30px;\n color: #ffffff;\n cursor: pointer;\n}\n.search_select_expand_button span {\n position: absolute;\n height: 20px;\n line-height: 14px;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.search_select_wrapper {\n position: relative;\n display: flex;\n min-height: 60vh;\n max-height: 60vh;\n overflow: hidden;\n font-size: 14px;\n}\n.search_select_wrapper_click_flag {\n position: absolute;\n z-index: 10;\n}\n.search_select_wrapper_click_flag_arrow {\n transform: rotate(0deg);\n transition: transform 0.5s;\n}\n.search_select_wrapper_click_flag_arrow_1 {\n transform: rotate(-180deg);\n transition: transform 0.5s;\n}\n.search_select_wrapper_left {\n width: 28%;\n overflow-y: hidden;\n transition: all 0.3s;\n margin-left: 20px;\n}\n.search_select_wrapper_left1 {\n width: 0;\n height: 0;\n transition: all 0.3s;\n display: none;\n}\n.search_select_wrapper_right {\n width: 70%;\n margin-left: 1%;\n}\n.search_select_wrapper_right1 {\n width: 100%;\n margin-left: 20px;\n}\n.search_select_wrapper_right,\n.search_select_wrapper _right1 {\n overflow-x: auto;\n}\n.search_select_wrapper .select_list_columns {\n width: 100%;\n height: calc(60vh - 60px);\n overflow-y: auto;\n border: 1px solid #d8d8d8;\n}\n.search_select_wrapper .select_list_columns_tips {\n background: #eee;\n padding: 6px 20px;\n margin-bottom: 10px;\n}\n.search_select_wrapper .select_list_columns_formItems {\n padding: 0 20px;\n}\n.search_select_wrapper .select_list_searchButton {\n display: flex;\n margin: 10px 0px;\n justify-content: flex-end;\n}\n.search_select_wrapper .select_list_button_space {\n margin-right: 10px;\n}\n.search_select_wrapper .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 34px;\n line-height: 32px;\n background-color: #eee;\n margin-bottom: 10px;\n padding: 0 12px;\n}\n.search_select_wrapper .select_list_selectAll {\n position: relative;\n top: -40px;\n left: 20px;\n width: 160px;\n}\n";
2433
+ var css_248z$2 = ".search_select_show {\n display: flex;\n}\n.search_select_expand_button {\n position: relative;\n width: 30px;\n color: #ffffff;\n cursor: pointer;\n}\n.search_select_expand_button span {\n position: absolute;\n height: 20px;\n line-height: 14px;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.search_select_wrapper {\n position: relative;\n display: flex;\n min-height: 60vh;\n max-height: 60vh;\n overflow: hidden;\n font-size: 14px;\n}\n.search_select_wrapper_click_flag {\n position: absolute;\n z-index: 10;\n}\n.search_select_wrapper_click_flag_arrow {\n transform: rotate(0deg);\n transition: transform 0.5s;\n}\n.search_select_wrapper_click_flag_arrow_1 {\n transform: rotate(-180deg);\n transition: transform 0.5s;\n}\n.search_select_wrapper_left {\n width: 28%;\n overflow-y: hidden;\n transition: all 0.3s;\n margin-left: 20px;\n}\n.search_select_wrapper_left1 {\n width: 0;\n height: 0;\n transition: all 0.3s;\n display: none;\n}\n.search_select_wrapper_right {\n width: 70%;\n margin-left: 1%;\n}\n.search_select_wrapper_right1 {\n width: 100%;\n margin-left: 20px;\n}\n.search_select_wrapper_right,\n.search_select_wrapper_right1 {\n overflow-x: auto;\n}\n.search_select_wrapper .select_list_columns {\n width: 100%;\n height: calc(60vh - 60px);\n overflow-y: auto;\n border: 1px solid #d8d8d8;\n}\n.search_select_wrapper .select_list_columns_tips {\n background: #eee;\n padding: 6px 20px;\n margin-bottom: 10px;\n}\n.search_select_wrapper .select_list_columns_formItems {\n padding: 0 20px;\n}\n.search_select_wrapper .select_list_searchButton {\n display: flex;\n margin: 10px 0px;\n justify-content: flex-end;\n}\n.search_select_wrapper .select_list_button_space {\n margin-right: 10px;\n}\n.search_select_wrapper .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 34px;\n line-height: 32px;\n background-color: #eee;\n margin-bottom: 10px;\n padding: 0 12px;\n}\n.search_select_wrapper .select_list_selectAll {\n position: relative;\n top: -40px;\n left: 20px;\n width: 160px;\n}\n";
2434
2434
  styleInject(css_248z$2);
2435
2435
 
2436
2436
  var Option = antd.Select.Option;
@@ -2446,6 +2446,18 @@ var SearchSelect = function SearchSelect(props) {
2446
2446
  labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
2447
2447
  requestConfig = props.requestConfig,
2448
2448
  ctx = props.ctx;
2449
+
2450
+ var _ref = requestConfig || {},
2451
+ url = _ref.url,
2452
+ otherParams = _ref.otherParams,
2453
+ isMap = _ref.isMap,
2454
+ fixedparameter = _ref.fixedparameter,
2455
+ fieldValToParam = _ref.fieldValToParam,
2456
+ _ref$mappingTextField = _ref.mappingTextField,
2457
+ mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
2458
+ _ref$mappingValueFiel = _ref.mappingValueField,
2459
+ mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel;
2460
+
2449
2461
  var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
2450
2462
 
2451
2463
  var initVal = value || (selectMode ? [] : null);
@@ -2584,15 +2596,6 @@ var SearchSelect = function SearchSelect(props) {
2584
2596
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2585
2597
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
2586
2598
  if (!requestConfig) return;
2587
- var url = requestConfig.url,
2588
- otherParams = requestConfig.otherParams,
2589
- isMap = requestConfig.isMap,
2590
- fixedparameter = requestConfig.fixedparameter,
2591
- fieldValToParam = requestConfig.fieldValToParam,
2592
- _requestConfig$mappin = requestConfig.mappingTextField,
2593
- mappingTextField = _requestConfig$mappin === void 0 ? 'name' : _requestConfig$mappin,
2594
- _requestConfig$mappin2 = requestConfig.mappingValueField,
2595
- mappingValueField = _requestConfig$mappin2 === void 0 ? 'code' : _requestConfig$mappin2;
2596
2599
  setFetching(true); // 处理dependence参数
2597
2600
 
2598
2601
  var fixedParam = {};
@@ -2735,13 +2738,13 @@ var SearchSelect = function SearchSelect(props) {
2735
2738
  value: value.key,
2736
2739
  text: value.label
2737
2740
  }] : [{
2738
- value: value.key
2741
+ value: value
2739
2742
  }]);
2740
2743
  setPopValue(labelInValue ? [{
2741
2744
  value: value.key,
2742
2745
  text: value.label
2743
2746
  }] : [{
2744
- value: value.key
2747
+ value: value
2745
2748
  }]);
2746
2749
  }
2747
2750
  }
@@ -2804,10 +2807,11 @@ var SearchSelect = function SearchSelect(props) {
2804
2807
  };
2805
2808
 
2806
2809
  var handleTableChange = function handleTableChange(pagination) {
2807
- getData({
2810
+ var params = form.getFieldsValue();
2811
+ getData(_objectSpread2(_objectSpread2({}, params), {}, {
2808
2812
  pageSize: pagination.pageSize,
2809
2813
  currentPage: pagination.current
2810
- }, 2);
2814
+ }), 2);
2811
2815
  };
2812
2816
 
2813
2817
  var onChangeCheckAll = function onChangeCheckAll(e) {
@@ -2930,7 +2934,7 @@ var SearchSelect = function SearchSelect(props) {
2930
2934
  var formItem = function formItem(list) {
2931
2935
  if (isModalVisible && (list === null || list === void 0 ? void 0 : list.length)) {
2932
2936
  return list.map(function (i) {
2933
- var _i$field, _i$field3;
2937
+ var _i$field, _i$field3, _i$field5;
2934
2938
 
2935
2939
  if ((i === null || i === void 0 ? void 0 : i.type) === 'select' || (i === null || i === void 0 ? void 0 : (_i$field = i.field) === null || _i$field === void 0 ? void 0 : _i$field.type) === 'select') {
2936
2940
  var _i$field2, _i$initialSource;
@@ -2950,6 +2954,21 @@ var SearchSelect = function SearchSelect(props) {
2950
2954
  key: m.value
2951
2955
  }, m.text);
2952
2956
  }))));
2957
+ }
2958
+
2959
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'treeSelect' || (i === null || i === void 0 ? void 0 : (_i$field3 = i.field) === null || _i$field3 === void 0 ? void 0 : _i$field3.type) === 'treeSelect') {
2960
+ var _i$field4;
2961
+
2962
+ return /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
2963
+ name: i.name,
2964
+ label: i.label,
2965
+ key: i.name
2966
+ }, /*#__PURE__*/React__default['default'].createElement(antd.TreeSelect, _objectSpread2({
2967
+ style: {
2968
+ width: '100%'
2969
+ },
2970
+ placeholder: "\u8BF7\u9009\u62E9"
2971
+ }, i === null || i === void 0 ? void 0 : (_i$field4 = i.field) === null || _i$field4 === void 0 ? void 0 : _i$field4.props)));
2953
2972
  } // 默认type是input
2954
2973
 
2955
2974
 
@@ -2964,7 +2983,7 @@ var SearchSelect = function SearchSelect(props) {
2964
2983
  placeholder: "\u8BF7\u8F93\u5165",
2965
2984
  allowClear: true,
2966
2985
  maxLength: 100
2967
- }, i === null || i === void 0 ? void 0 : (_i$field3 = i.field) === null || _i$field3 === void 0 ? void 0 : _i$field3.props)));
2986
+ }, i === null || i === void 0 ? void 0 : (_i$field5 = i.field) === null || _i$field5 === void 0 ? void 0 : _i$field5.props)));
2968
2987
  });
2969
2988
  } else {
2970
2989
  return null;
@@ -3056,7 +3075,7 @@ var SearchSelect = function SearchSelect(props) {
3056
3075
  key: "submit",
3057
3076
  type: "primary",
3058
3077
  onClick: handleOk,
3059
- disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
3078
+ disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
3060
3079
  }, "\u786E\u5B9A")]
3061
3080
  }, /*#__PURE__*/React__default['default'].createElement("div", {
3062
3081
  className: 'search_select_wrapper'
@@ -3105,14 +3124,14 @@ var SearchSelect = function SearchSelect(props) {
3105
3124
  style: {
3106
3125
  color: 'rgba(127, 127, 127, 0.6470588235294118)'
3107
3126
  }
3108
- }, selectMode ? '勾选后点击确定按钮完成选择' : '双击数据行或单击按钮完成选择')), /*#__PURE__*/React__default['default'].createElement(antd.Table, {
3127
+ }, selectMode ? '勾选后点击确定按钮完成选择' : '双击数据行或点击单选图标完成选择')), /*#__PURE__*/React__default['default'].createElement(antd.Table, {
3109
3128
  size: 'small',
3110
3129
  rowSelection: rowSelection,
3111
3130
  columns: modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableColumns,
3112
3131
  dataSource: tableData,
3113
3132
  pagination: tablePagination,
3114
3133
  onChange: handleTableChange,
3115
- rowKey: 'code',
3134
+ rowKey: mappingValueField,
3116
3135
  scroll: {
3117
3136
  x: modalTableProps.overScrollX || 'max-content',
3118
3137
  y: modalTableProps.overScrollY || null
@@ -3195,10 +3214,10 @@ var loadSelectSource = function loadSelectSource(url, params) {
3195
3214
  });
3196
3215
  };
3197
3216
 
3198
- function commonFun(type, prefixURL) {
3217
+ function commonFun(type, prefixUrl) {
3199
3218
  // 默认type === 'supplier' 供应商选择器
3200
3219
  var requestConfig = {
3201
- url: "".concat(prefixURL.selectPrefix, "/supplier"),
3220
+ url: "".concat(prefixUrl.selectPrefix, "/supplier"),
3202
3221
  filter: 'qp-nameAndCode-like',
3203
3222
  otherParams: {
3204
3223
  sorter: 'desc-id'
@@ -3215,18 +3234,47 @@ function commonFun(type, prefixURL) {
3215
3234
  * */
3216
3235
 
3217
3236
  var formatSource = function formatSource(reData, position, changePosition, changeSearchForm) {
3218
- var _reData$position, _reData$position$data;
3237
+ var _reData$position;
3219
3238
 
3220
- var data = reData && ((_reData$position = reData[position]) === null || _reData$position === void 0 ? void 0 : (_reData$position$data = _reData$position.data) === null || _reData$position$data === void 0 ? void 0 : _reData$position$data.items) || [];
3221
- var formatData = (data === null || data === void 0 ? void 0 : data.length) ? data.map(function (v) {
3239
+ var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['code', 'name'];
3240
+ var data = reData && ((_reData$position = reData[position]) === null || _reData$position === void 0 ? void 0 : _reData$position.data);
3241
+ var list = Array.isArray(data) ? data : (data === null || data === void 0 ? void 0 : data.items) || (data === null || data === void 0 ? void 0 : data.list) || [];
3242
+ var formatData = (list === null || list === void 0 ? void 0 : list.length) ? list.map(function (v) {
3222
3243
  return {
3223
- text: v.name,
3224
- value: v.code
3244
+ text: v[resKeyValue[1]],
3245
+ value: v[resKeyValue[0]]
3225
3246
  };
3226
3247
  }) : [];
3227
3248
  changeSearchForm[changePosition] = _objectSpread2(_objectSpread2({}, changeSearchForm[changePosition]), {}, {
3228
3249
  initialSource: formatData
3229
3250
  });
3251
+ }; // 格式化树选择器数据源
3252
+
3253
+
3254
+ var mapSearchTree = function mapSearchTree(treeDataItem, resKeyValue) {
3255
+ var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
3256
+ return {
3257
+ title: treeDataItem[resKeyValue[1]],
3258
+ key: treeDataItem[resKeyValue[0]],
3259
+ parentId: treeDataItem.parent,
3260
+ data: _objectSpread2({}, treeDataItem),
3261
+ isLeaf: !haveChildren,
3262
+ disabled: haveChildren,
3263
+ children: haveChildren ? treeDataItem.children.map(function (i) {
3264
+ return mapSearchTree(i, resKeyValue);
3265
+ }) : []
3266
+ };
3267
+ };
3268
+
3269
+ var formatTreeDataSource = function formatTreeDataSource(reData, position, changePosition, changeSearchForm) {
3270
+ var _reData$position2;
3271
+
3272
+ var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['id', 'name'];
3273
+ var data = reData && ((_reData$position2 = reData[position]) === null || _reData$position2 === void 0 ? void 0 : _reData$position2.data);
3274
+ var formatData = data && Array.isArray(data) && data.length && data.map(function (ites) {
3275
+ return mapSearchTree(ites, resKeyValue);
3276
+ }) || [];
3277
+ changeSearchForm[changePosition].field.props.treeData = formatData;
3230
3278
  };
3231
3279
 
3232
3280
  var tableSearchForm = [];
@@ -3301,14 +3349,14 @@ function commonFun(type, prefixURL) {
3301
3349
  label: '共享类型',
3302
3350
  initialSource: getDictionarySource('UC000013')
3303
3351
  }];
3304
- Promise.all([loadSelectSource("".concat(prefixURL.formSelectFix, "/company"), {
3352
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
3305
3353
  pageSize: 5000,
3306
3354
  currentPage: 1,
3307
3355
  'qp-companyType-eq': '30'
3308
- }), loadSelectSource("".concat(prefixURL.formSelectFix, "/accountingSubject"), {
3356
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
3309
3357
  pageSize: 5000,
3310
3358
  currentPage: 1
3311
- }), loadSelectSource("".concat(prefixURL.formSelectFix, "/company"), {
3359
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
3312
3360
  pageSize: 5000,
3313
3361
  currentPage: 1,
3314
3362
  'qp-companyType-eq': '20'
@@ -3346,6 +3394,140 @@ function commonFun(type, prefixURL) {
3346
3394
  }]
3347
3395
  }; // 商品选择器
3348
3396
 
3397
+ if (type === 'skuCommodity') {
3398
+ requestConfig = {
3399
+ url: "".concat(prefixUrl.selectPrefix, "/sku"),
3400
+ filter: 'qp-nameAndCode-like',
3401
+ otherParams: {
3402
+ sorter: 'desc-id'
3403
+ } // 默认参数
3404
+
3405
+ };
3406
+ tableSearchForm = [{
3407
+ name: 'qp-name-like',
3408
+ label: 'SKU名称'
3409
+ }, {
3410
+ name: 'qp-skuCode-like',
3411
+ label: 'SKU编码'
3412
+ }, {
3413
+ name: 'qp-barCode-like',
3414
+ label: '条形码'
3415
+ }, {
3416
+ name: 'qp-itemName-like',
3417
+ label: '所属SPU名称'
3418
+ }, {
3419
+ name: 'qp-itemCode-like',
3420
+ label: '所属SPU编码'
3421
+ }, {
3422
+ name: 'qp-brandId-in',
3423
+ type: 'select',
3424
+ label: '品牌',
3425
+ field: {
3426
+ type: 'select',
3427
+ props: {
3428
+ mode: 'multiple',
3429
+ notFoundContent: '暂无数据',
3430
+ allowClear: true,
3431
+ showSearch: true,
3432
+ showArrow: true,
3433
+ maxTagCount: 1,
3434
+ optionFilterProp: 'children',
3435
+ filterOption: function filterOption(input, option) {
3436
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
3437
+ }
3438
+ }
3439
+ }
3440
+ }, {
3441
+ name: 'qp-categoryId-in',
3442
+ type: 'treeSelect',
3443
+ label: '类目',
3444
+ field: {
3445
+ type: 'treeSelect',
3446
+ props: {
3447
+ treeData: [],
3448
+ treeCheckable: true,
3449
+ showSearch: true,
3450
+ allowClear: true,
3451
+ showArrow: true,
3452
+ treeNodeFilterProp: 'title',
3453
+ treeDefaultExpandAll: true,
3454
+ maxTagCount: 1,
3455
+ placeholder: '请选择',
3456
+ style: {
3457
+ width: '100%'
3458
+ },
3459
+ dropdownStyle: {
3460
+ maxHeight: 400,
3461
+ maxWidth: 100,
3462
+ overflow: 'auto'
3463
+ }
3464
+ }
3465
+ }
3466
+ }, {
3467
+ name: 'qp-classId-in',
3468
+ type: 'select',
3469
+ label: '品类',
3470
+ field: {
3471
+ type: 'select',
3472
+ props: {
3473
+ mode: 'multiple',
3474
+ notFoundContent: '暂无数据',
3475
+ allowClear: true,
3476
+ showSearch: true,
3477
+ showArrow: true,
3478
+ maxTagCount: 1,
3479
+ optionFilterProp: 'children',
3480
+ filterOption: function filterOption(input, option) {
3481
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
3482
+ }
3483
+ }
3484
+ }
3485
+ }];
3486
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
3487
+ pageSize: 5000,
3488
+ currentPage: 1
3489
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
3490
+ pageSize: 5000,
3491
+ currentPage: 1
3492
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
3493
+ pageSize: 5000,
3494
+ currentPage: 1
3495
+ })]).then(function (x) {
3496
+ formatSource(x, 0, 5, tableSearchForm, ['id', 'name']);
3497
+ formatTreeDataSource(x, 1, 6, tableSearchForm);
3498
+ formatSource(x, 2, 7, tableSearchForm, ['id', 'name']);
3499
+ });
3500
+ modalTableProps = {
3501
+ modalTableTitle: '选择SKU',
3502
+ tableSearchForm: tableSearchForm,
3503
+ tableColumns: [{
3504
+ title: 'SKU编码',
3505
+ dataIndex: 'skuCode'
3506
+ }, {
3507
+ title: 'SKU名称',
3508
+ dataIndex: 'name'
3509
+ }, {
3510
+ title: '所属SPU',
3511
+ dataIndex: 'itemName'
3512
+ }, {
3513
+ title: '规格',
3514
+ dataIndex: 'skuSpec'
3515
+ }, {
3516
+ title: '类目',
3517
+ dataIndex: 'categoryName'
3518
+ }, {
3519
+ title: '品类',
3520
+ dataIndex: 'className'
3521
+ }, {
3522
+ title: '品牌',
3523
+ dataIndex: 'brandName'
3524
+ }, {
3525
+ title: '条形码',
3526
+ dataIndex: 'barCode'
3527
+ }]
3528
+ };
3529
+ } // 仓库选择器
3530
+
3349
3531
  return {
3350
3532
  modalTableProps: modalTableProps,
3351
3533
  requestConfig: requestConfig
@@ -3353,13 +3535,13 @@ function commonFun(type, prefixURL) {
3353
3535
  }
3354
3536
 
3355
3537
  var BusinessSearchSelect = function BusinessSearchSelect(props) {
3356
- var businessType = (props === null || props === void 0 ? void 0 : props.SelectBusinessType) || 'supplier';
3357
- var prefixURL = (props === null || props === void 0 ? void 0 : props.prefixUrl) || {
3538
+ var businessType = (props === null || props === void 0 ? void 0 : props.selectBusinessType) || 'supplier';
3539
+ var prefixUrl = (props === null || props === void 0 ? void 0 : props.prefixUrl) || {
3358
3540
  selectPrefix: '/bop/api',
3359
3541
  formSelectFix: '/bop/api'
3360
3542
  };
3361
3543
 
3362
- var _commonFun = commonFun(businessType, prefixURL),
3544
+ var _commonFun = commonFun(businessType, prefixUrl),
3363
3545
  requestConfig = _commonFun.requestConfig,
3364
3546
  modalTableProps = _commonFun.modalTableProps;
3365
3547
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -4,10 +4,10 @@ import SearchSelect from '../index';
4
4
 
5
5
 
6
6
  const BusinessSearchSelect = (props: any) => {
7
- const businessType = props?.SelectBusinessType || 'supplier';
8
- const prefixURL = props?.prefixUrl || { selectPrefix: '/bop/api', formSelectFix: '/bop/api' };
7
+ const businessType = props?.selectBusinessType || 'supplier';
8
+ const prefixUrl = props?.prefixUrl || { selectPrefix: '/bop/api', formSelectFix: '/bop/api' };
9
9
 
10
- const { requestConfig, modalTableProps } = commonFun(businessType, prefixURL);
10
+ const { requestConfig, modalTableProps } = commonFun(businessType, prefixUrl);
11
11
 
12
12
  const currentProps = {
13
13
  requestConfig,
@@ -70,10 +70,10 @@ const loadSelectSource = (url: string, params?: any) => {
70
70
  })
71
71
  };
72
72
 
73
- export function commonFun (type?: string, prefixURL: any) {
73
+ export function commonFun (type?: string, prefixUrl: any) {
74
74
  // 默认type === 'supplier' 供应商选择器
75
75
  let requestConfig = {
76
- url: `${prefixURL.selectPrefix}/supplier`,
76
+ url: `${prefixUrl.selectPrefix}/supplier`,
77
77
  filter: 'qp-nameAndCode-like', // 过滤参数
78
78
  otherParams: {
79
79
  sorter: 'desc-id'
@@ -88,12 +88,37 @@ export function commonFun (type?: string, prefixURL: any) {
88
88
  * changePosition 必传 为搜索表单Form中需要更改数据源的Item项的位置
89
89
  * changeSearchForm 必传 为搜索表单Form数据
90
90
  * */
91
- const formatSource = (reData: any, position: number, changePosition: number,changeSearchForm: any) => {
92
- const data = reData && reData[position]?.data?.items || [];
93
- const formatData = data?.length ? data.map((v: any) => ({ text: v.name, value: v.code })) : [];
91
+ const formatSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['code', 'name']) => {
92
+ const data = reData && reData[position]?.data;
93
+ const list = Array.isArray(data) ? data :(data?.items || data?.list || []);
94
+ const formatData = list?.length ? list.map((v: any) => ({ text: v[resKeyValue[1]], value: v[resKeyValue[0]] })) : [];
94
95
  changeSearchForm[changePosition] = {...changeSearchForm[changePosition], initialSource: formatData}
95
96
  }
96
97
 
98
+ // 格式化树选择器数据源
99
+ const mapSearchTree = (treeDataItem: any, resKeyValue: any) => {
100
+ const haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
101
+ return {
102
+ title: treeDataItem[resKeyValue[1]],
103
+ key: treeDataItem[resKeyValue[0]],
104
+ parentId: treeDataItem.parent,
105
+ data: { ...treeDataItem },
106
+ isLeaf: !haveChildren,
107
+ disabled: haveChildren,
108
+ children: haveChildren ? treeDataItem.children.map((i: any) => mapSearchTree(i, resKeyValue)) : [],
109
+ };
110
+ };
111
+ const formatTreeDataSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['id', 'name']) => {
112
+ const data = reData && reData[position]?.data;
113
+ const formatData = (data &&
114
+ Array.isArray(data) &&
115
+ data.length &&
116
+ data.map((ites: any) => mapSearchTree(ites, resKeyValue))) ||
117
+ []
118
+ changeSearchForm[changePosition].field.props.treeData = formatData;
119
+ }
120
+
121
+
97
122
  let tableSearchForm: any [] = [];
98
123
  if(type === 'supplier') {
99
124
  tableSearchForm = [
@@ -144,16 +169,16 @@ export function commonFun (type?: string, prefixURL: any) {
144
169
  { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: getDictionarySource('UC000013') },
145
170
  ]
146
171
  Promise.all([
147
- loadSelectSource(`${prefixURL.formSelectFix}/company`, {
172
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
148
173
  pageSize: 5000,
149
174
  currentPage: 1,
150
175
  'qp-companyType-eq': '30',
151
176
  }),
152
- loadSelectSource(`${prefixURL.formSelectFix}/accountingSubject`, {
177
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
153
178
  pageSize: 5000,
154
179
  currentPage: 1,
155
180
  }),
156
- loadSelectSource(`${prefixURL.formSelectFix}/company`, {
181
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
157
182
  pageSize: 5000,
158
183
  currentPage: 1,
159
184
  'qp-companyType-eq': '20',
@@ -197,8 +222,123 @@ export function commonFun (type?: string, prefixURL: any) {
197
222
  }
198
223
 
199
224
  // 商品选择器
200
- if(type === 'commodity') {
201
-
225
+ if(type === 'skuCommodity') {
226
+ requestConfig = {
227
+ url: `${prefixUrl.selectPrefix}/sku`,
228
+ filter: 'qp-nameAndCode-like', // 过滤参数
229
+ otherParams: {
230
+ sorter: 'desc-id'
231
+ }, // 默认参数
232
+ }
233
+ tableSearchForm = [
234
+ { name: 'qp-name-like', label: 'SKU名称' },
235
+ { name: 'qp-skuCode-like', label: 'SKU编码' },
236
+ { name: 'qp-barCode-like', label: '条形码' },
237
+ { name: 'qp-itemName-like', label: '所属SPU名称' },
238
+ { name: 'qp-itemCode-like', label: '所属SPU编码' },
239
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
240
+ type: 'select',
241
+ props: {
242
+ mode: 'multiple',
243
+ notFoundContent: '暂无数据',
244
+ allowClear: true,
245
+ showSearch: true,
246
+ showArrow: true,
247
+ maxTagCount: 1,
248
+ optionFilterProp: 'children',
249
+ filterOption: (input: string, option: { props: { children: string } }) =>
250
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
251
+ },
252
+ } },
253
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
254
+ type: 'treeSelect',
255
+ props: {
256
+ treeData: [],
257
+ treeCheckable: true,
258
+ showSearch: true,
259
+ allowClear: true,
260
+ showArrow: true,
261
+ treeNodeFilterProp: 'title',
262
+ treeDefaultExpandAll: true,
263
+ maxTagCount: 1,
264
+ placeholder: '请选择',
265
+ style: {
266
+ width: '100%',
267
+ },
268
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
269
+ },
270
+ } },
271
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
272
+ type: 'select',
273
+ props: {
274
+ mode: 'multiple',
275
+ notFoundContent: '暂无数据',
276
+ allowClear: true,
277
+ showSearch: true,
278
+ showArrow: true,
279
+ maxTagCount: 1,
280
+ optionFilterProp: 'children',
281
+ filterOption: (input: string, option: { props: { children: string } }) =>
282
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
283
+ },
284
+ } },
285
+ ]
286
+ Promise.all([
287
+ loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
288
+ pageSize: 5000,
289
+ currentPage: 1,
290
+ }),
291
+ loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
292
+ pageSize: 5000,
293
+ currentPage: 1,
294
+ }),
295
+ loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
296
+ pageSize: 5000,
297
+ currentPage: 1,
298
+ }),
299
+ ]).then((x: any)=>{
300
+ formatSource(x,0, 5, tableSearchForm,['id','name']);
301
+ formatTreeDataSource(x,1, 6, tableSearchForm);
302
+ formatSource(x,2, 7, tableSearchForm,['id','name']);
303
+ })
304
+ modalTableProps = {
305
+ modalTableTitle: '选择SKU',
306
+ tableSearchForm,
307
+ tableColumns: [
308
+ {
309
+ title: 'SKU编码',
310
+ dataIndex: 'skuCode',
311
+ },
312
+ {
313
+ title: 'SKU名称',
314
+ dataIndex: 'name',
315
+ },
316
+ {
317
+ title: '所属SPU',
318
+ dataIndex: 'itemName',
319
+ },
320
+ {
321
+ title: '规格',
322
+ dataIndex: 'skuSpec',
323
+ },
324
+ {
325
+ title: '类目',
326
+ dataIndex: 'categoryName',
327
+ },
328
+ {
329
+ title: '品类',
330
+ dataIndex: 'className',
331
+ },
332
+ {
333
+ title: '品牌',
334
+ dataIndex: 'brandName',
335
+ },
336
+ {
337
+ title: '条形码',
338
+ dataIndex: 'barCode',
339
+ },
340
+ ]
341
+ }
202
342
  }
203
343
 
204
344
  // 仓库选择器
@@ -5,13 +5,13 @@ nav:
5
5
  group:
6
6
  title: 业务组件
7
7
  order: 4
8
- title: 供应商选择器
8
+ title: 业务档案选择器
9
9
  order: 0
10
10
  ---
11
11
 
12
12
  ## BusinessSearchSelect
13
13
 
14
- Demo:
14
+ 供应商选择器 Select-GYS-001:
15
15
 
16
16
  ```tsx
17
17
  import React, { useState } from 'react';
@@ -36,7 +36,7 @@ export default () => {
36
36
  // mappingTextField: 'name',
37
37
  // mappingValueField: 'code',
38
38
  // }, // 非必传,业务字段已根据业务默认默认
39
- // prefixURL: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' }, // 非必传,下拉框和tableForm下拉框接口前缀,默认为bop的接口
39
+ // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' }, // 非必传,下拉框和tableForm下拉框接口前缀,默认为bop的接口
40
40
  selectProps, // 非必传
41
41
  onChange: (value: any) => {
42
42
  console.log(value)
@@ -53,4 +53,40 @@ export default () => {
53
53
  };
54
54
  ```
55
55
 
56
+
57
+ 商品选择器 Select-SKU-001:
58
+
59
+ ```tsx
60
+ import React, { useState } from 'react';
61
+ import {BusinessSearchSelect} from '../../../index.ts';
62
+
63
+ export default () => {
64
+ const selectProps = {
65
+ // mode: 'multiple',
66
+ // maxTagCount: 1,
67
+ // disabled: true
68
+ }
69
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
70
+ const props = {
71
+ value,
72
+ onChange: (value: any) => {
73
+ console.log(value)
74
+ setValue(value)
75
+ },
76
+ requestConfig: {
77
+ url: `/bop/api/sku`,
78
+ filter: 'qp-nameAndCode-like',
79
+ mappingValueField: 'skuCode'
80
+ },
81
+ selectProps,
82
+ selectBusinessType: 'skuCommodity',
83
+ };
84
+
85
+ return (
86
+ <div>
87
+ <BusinessSearchSelect {...props} />
88
+ </div>
89
+ );
90
+ };
91
+ ```
56
92
  More skills for writing demo: https://d.umijs.org/guide/demo-principle
@@ -67,7 +67,7 @@
67
67
  //background-color: green;
68
68
  }
69
69
 
70
- &_right, _right1 {
70
+ &_right, &_right1 {
71
71
  overflow-x: auto;
72
72
  }
73
73
 
@@ -1,7 +1,7 @@
1
1
  // @ts-nocheck
2
2
  import React, { useState, useEffect } from 'react';
3
3
  import { useDebounceFn } from 'ahooks';
4
- import { Input, Button, Modal, Select, Divider, message, Spin, Form, Table, Checkbox } from 'antd';
4
+ import { Input, Button, Modal, Select, Divider, message, Spin, Form, Table, Checkbox, TreeSelect } from 'antd';
5
5
  import { SearchOutlined, CopyOutlined, CaretLeftOutlined } from '@ant-design/icons';
6
6
  import axios from 'axios';
7
7
  import { stringify } from 'querystring';
@@ -20,6 +20,7 @@ const SearchSelect = (props: any) => {
20
20
  requestConfig,
21
21
  ctx,
22
22
  } = props;
23
+ const { url, otherParams, isMap, fixedparameter, fieldValToParam, mappingTextField='name', mappingValueField='code' } = requestConfig || {};
23
24
 
24
25
  const selectMode = selectProps?.mode // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
25
26
  const initVal = value || (selectMode ? [] : null);
@@ -79,7 +80,6 @@ const SearchSelect = (props: any) => {
79
80
  // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
80
81
  const getData = (params={}, type=1) => {
81
82
  if (!requestConfig) return;
82
- const { url, otherParams, isMap, fixedparameter, fieldValToParam, mappingTextField='name', mappingValueField='code' } = requestConfig;
83
83
 
84
84
  setFetching(true)
85
85
 
@@ -193,8 +193,8 @@ const SearchSelect = (props: any) => {
193
193
  setCheckedAll(value.length === itemsTotal);
194
194
  } else {
195
195
  setSelectedRowKeys(labelInValue ? [value.key] : [value])
196
- setSelectedRows(labelInValue ? [{ value: value.key, text: value.label }] : [{ value: value.key }])
197
- setPopValue(labelInValue ? [{ value: value.key, text: value.label }] : [{ value: value.key }]);
196
+ setSelectedRows(labelInValue ? [{ value: value.key, text: value.label }] : [{ value: value }])
197
+ setPopValue(labelInValue ? [{ value: value.key, text: value.label }] : [{ value: value }]);
198
198
  }
199
199
  }
200
200
  };
@@ -241,7 +241,8 @@ const SearchSelect = (props: any) => {
241
241
  }
242
242
 
243
243
  const handleTableChange = (pagination) => {
244
- getData({ pageSize: pagination.pageSize, currentPage: pagination.current }, 2)
244
+ const params = form.getFieldsValue();
245
+ getData({ ...params, pageSize: pagination.pageSize, currentPage: pagination.current }, 2)
245
246
  }
246
247
 
247
248
  const onChangeCheckAll = (e) => {
@@ -366,6 +367,14 @@ const SearchSelect = (props: any) => {
366
367
  )
367
368
  }
368
369
 
370
+ if(i?.type === 'treeSelect' || i?.field?.type === 'treeSelect') {
371
+ return (
372
+ <Form.Item name={i.name} label={i.label} key={i.name}>
373
+ <TreeSelect style={{ width: '100%' }} placeholder='请选择' {...i?.field?.props}></TreeSelect>
374
+ </Form.Item>
375
+ )
376
+ }
377
+
369
378
  // 默认type是input
370
379
  return (
371
380
  <Form.Item name={i.name} label={i.label} key={i.name}>
@@ -438,7 +447,12 @@ const SearchSelect = (props: any) => {
438
447
  <Button key="back" onClick={handleCancel}>
439
448
  取消
440
449
  </Button>,
441
- <Button key="submit" type="primary" onClick={handleOk} disabled={selectProps?.disabled || props?.disabled}>
450
+ <Button
451
+ key="submit"
452
+ type="primary"
453
+ onClick={handleOk}
454
+ disabled={!tableData.length || (selectProps?.disabled || props?.disabled)}
455
+ >
442
456
  确定
443
457
  </Button>,
444
458
  ]}
@@ -465,7 +479,7 @@ const SearchSelect = (props: any) => {
465
479
  <div>
466
480
  <div className={'select_list_selectTips'}>
467
481
  <div style={{ marginLeft: 8 }}>搜索结果共<span style={themeColor}>{tablePagination?.total || 0}</span>项{selectMode ? <span>, 本次已选<span style={themeColor}>{selectedRowKeys?.length || 0}</span>项</span> : ''}</div>
468
- <div style={{ color: 'rgba(127, 127, 127, 0.6470588235294118)' }}>{selectMode ? '勾选后点击确定按钮完成选择' : '双击数据行或单击按钮完成选择'}</div>
482
+ <div style={{ color: 'rgba(127, 127, 127, 0.6470588235294118)' }}>{selectMode ? '勾选后点击确定按钮完成选择' : '双击数据行或点击单选图标完成选择'}</div>
469
483
  </div>
470
484
  <Table
471
485
  size='small'
@@ -474,7 +488,7 @@ const SearchSelect = (props: any) => {
474
488
  dataSource={tableData}
475
489
  pagination={tablePagination}
476
490
  onChange={handleTableChange}
477
- rowKey='code'
491
+ rowKey={mappingValueField}
478
492
  scroll={{ x: modalTableProps.overScrollX || 'max-content', y: modalTableProps.overScrollY || null }}
479
493
  onRow={record => {
480
494
  return {