@bit-sun/business-component 2.2.3 → 2.2.5

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/index.esm.js CHANGED
@@ -32,7 +32,8 @@ var ENUM = {
32
32
  LIMIT_MENU_DATA: 'limitedMenuData',
33
33
  USER_INFO: 'userInfo',
34
34
  DICT_CODES: 'dicData',
35
- CHILD_APP_BACK: 'child_app_back' //标记子应用goback事件
35
+ CHILD_APP_BACK: 'child_app_back',
36
+ SEARCH_FIELDS_CONDITION: 'searchFieldsCondition' //表格搜索项信息缓存
36
37
  }
37
38
  };
38
39
 
@@ -14316,12 +14317,30 @@ var TreeSearchSelect = function TreeSearchSelect(props) {
14316
14317
  };
14317
14318
  }());
14318
14319
  };
14320
+ var formatData = function formatData(value) {
14321
+ if (labelInValue) {
14322
+ var formatResult = multiple ? value.map(function (i) {
14323
+ return _objectSpread2(_objectSpread2({}, i), {}, {
14324
+ key: i.value
14325
+ });
14326
+ }) : _objectSpread2(_objectSpread2({}, value), {}, {
14327
+ key: value === null || value === void 0 ? void 0 : value.value
14328
+ });
14329
+ return formatResult;
14330
+ } else {
14331
+ var _formatResult = multiple ? value.map(function (i) {
14332
+ return (i === null || i === void 0 ? void 0 : i.value) || i;
14333
+ }) : _.get(value[0], 'value') || value;
14334
+ return _formatResult;
14335
+ }
14336
+ };
14319
14337
  var handleChange = function handleChange(data, dataName) {
14320
14338
  var _ctx$form2;
14321
- onChange(data);
14339
+ var handleData = formatData(data);
14340
+ onChange(handleData, data);
14322
14341
  onChangeName && onChangeName(dataName);
14323
14342
  getTreeData && getTreeData(treeData); // 把树节点暴露出去
14324
- ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldValue(ctx.name, data);
14343
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldValue(ctx.name, handleData);
14325
14344
  };
14326
14345
  useEffect(function () {
14327
14346
  handleSearch(initialValue);
@@ -16928,22 +16947,494 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
16928
16947
  row: this.DraggableBodyRow
16929
16948
  }
16930
16949
  }
16931
- }))))), /*#__PURE__*/React.createElement("img", {
16932
- width: 32,
16950
+ }))))), /*#__PURE__*/React.createElement("div", {
16933
16951
  onClick: this.showModal,
16934
- src: shezhi
16935
- }));
16952
+ style: {
16953
+ fontSize: 14
16954
+ }
16955
+ }, "\u5217\u8BBE\u7F6E"));
16936
16956
  }
16937
16957
  }]);
16938
16958
  return SortableTable;
16939
16959
  }(React.Component);
16940
16960
 
16941
- var _excluded$d = ["onResize", "width"];
16961
+ var _excluded$d = ["className", "style"];
16962
+ var DragHandle$3 = SortableHandle(function () {
16963
+ return /*#__PURE__*/React.createElement("img", {
16964
+ src: drag
16965
+ });
16966
+ });
16967
+ var SortableItem$3 = SortableElement(function (props) {
16968
+ return /*#__PURE__*/React.createElement("tr", _objectSpread2({}, props));
16969
+ });
16970
+ var SortableBody$3 = SortableContainer(function (props) {
16971
+ return /*#__PURE__*/React.createElement("tbody", _objectSpread2({}, props));
16972
+ });
16973
+ var SearchItemTable = /*#__PURE__*/function (_React$Component) {
16974
+ _inherits(SearchItemTable, _React$Component);
16975
+ var _super = _createSuper(SearchItemTable);
16976
+ function SearchItemTable() {
16977
+ var _this;
16978
+ _classCallCheck(this, SearchItemTable);
16979
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
16980
+ args[_key] = arguments[_key];
16981
+ }
16982
+ _this = _super.call.apply(_super, [this].concat(args));
16983
+ _this.state = {
16984
+ dataSource: [],
16985
+ columns: [],
16986
+ sortDataSource: [],
16987
+ setVisible: false,
16988
+ searchDataSource: false,
16989
+ onSearchSort: false,
16990
+ isDefaultValue: false,
16991
+ defaultValue: [],
16992
+ bsTableCode: '' //设置table 列的标识
16993
+ };
16994
+ _this.patchUserSearchFieldsConfig = function (config) {
16995
+ var that = _assertThisInitialized(_this);
16996
+ var configvalue = config ? config.map(function (item) {
16997
+ return {
16998
+ name: item.name,
16999
+ hidden: item.hidden
17000
+ };
17001
+ }) : '';
17002
+ axios({
17003
+ url: '/user/appConfig/saveQueryCriteria',
17004
+ method: 'POST',
17005
+ data: {
17006
+ code: that.state.bsTableCode,
17007
+ detail: configvalue ? JSON.stringify(configvalue) : ''
17008
+ }
17009
+ }).then(function (res) {
17010
+ var _res$data;
17011
+ if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.status) === '0') {
17012
+ _this.patchConfigToLocalstorage(configvalue);
17013
+ } else {
17014
+ message.error('保存搜索项自定义失败,请稍后尝试');
17015
+ }
17016
+ });
17017
+ };
17018
+ _this.getConfigFromlocalstorage = function () {
17019
+ var config = localStorage.getItem(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION) || '[]';
17020
+ var configArray = JSON.parse(config);
17021
+ var configSetting = configArray.filter(function (item) {
17022
+ return item.code === _this.state.bsTableCode;
17023
+ });
17024
+ if (configSetting.length && configSetting[0].detail) {
17025
+ return JSON.parse(configSetting[0].detail);
17026
+ }
17027
+ return [];
17028
+ };
17029
+ _this.patchConfigToLocalstorage = function (configvalue) {
17030
+ var setShowSearchFields = _this.props.setShowSearchFields;
17031
+ var _this$state = _this.state,
17032
+ sortDataSource = _this$state.sortDataSource,
17033
+ bsTableCode = _this$state.bsTableCode;
17034
+ var config = localStorage.getItem(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION) || '[]';
17035
+ var configArray = JSON.parse(config);
17036
+ var currentSetting = configArray.filter(function (item) {
17037
+ return item.code === bsTableCode;
17038
+ });
17039
+ if (currentSetting.length) {
17040
+ currentSetting[0].detail = JSON.stringify(configvalue);
17041
+ } else {
17042
+ configArray.push({
17043
+ "code": bsTableCode,
17044
+ "detail": JSON.stringify(configvalue)
17045
+ });
17046
+ }
17047
+ localStorage.setItem(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION, JSON.stringify(configArray));
17048
+ _this.setState({
17049
+ visible: false
17050
+ });
17051
+ setShowSearchFields(_toConsumableArray(sortDataSource));
17052
+ };
17053
+ _this.setInitValue = function () {
17054
+ var _this$props = _this.props,
17055
+ datasource = _this$props.datasource,
17056
+ showSearchFields = _this$props.showSearchFields;
17057
+ var config = _this.getConfigFromlocalstorage();
17058
+ _this.setState({
17059
+ isDefaultValue: true,
17060
+ dataSource: datasource.map(function (item) {
17061
+ var innerItem = config.filter(function (inneritem) {
17062
+ var innerKey = Array.isArray(inneritem.name) ? JSON.stringify(inneritem.name) : inneritem.name;
17063
+ var itemKey = Array.isArray(item.name) ? JSON.stringify(item.name) : item.name;
17064
+ return innerKey && innerKey === itemKey;
17065
+ });
17066
+ return _objectSpread2(_objectSpread2({}, item), {}, {
17067
+ hidden: config.length && !innerItem.length
17068
+ });
17069
+ }),
17070
+ defaultValue: datasource.map(function (item) {
17071
+ var innerItem = config.filter(function (inneritem) {
17072
+ var innerKey = Array.isArray(inneritem.name) ? JSON.stringify(inneritem.name) : inneritem.name;
17073
+ var itemKey = Array.isArray(item.name) ? JSON.stringify(item.name) : item.name;
17074
+ return innerKey && innerKey === itemKey;
17075
+ });
17076
+ return _objectSpread2(_objectSpread2({}, item), {}, {
17077
+ hidden: config.length && !innerItem.length
17078
+ });
17079
+ }),
17080
+ sortDataSource: _toConsumableArray(showSearchFields)
17081
+ });
17082
+ };
17083
+ _this.columns = [{
17084
+ title: '搜索字段名称',
17085
+ dataIndex: 'label',
17086
+ className: 'drag-visible',
17087
+ width: 100
17088
+ }, {
17089
+ title: '删除',
17090
+ dataIndex: 'title1',
17091
+ render: function render(text, record) {
17092
+ return /*#__PURE__*/React.createElement("span", {
17093
+ onClick: function onClick() {
17094
+ _this.setState({
17095
+ sortDataSource: _this.state.sortDataSource.filter(function (item) {
17096
+ return item.label !== record.label;
17097
+ }),
17098
+ isDefaultValue: false,
17099
+ dataSource: _toConsumableArray(_this.state.dataSource.map(function (item) {
17100
+ if (item.label === record.label) {
17101
+ return _objectSpread2(_objectSpread2({}, item), {}, {
17102
+ hidden: true
17103
+ });
17104
+ }
17105
+ return item;
17106
+ }))
17107
+ });
17108
+ }
17109
+ }, /*#__PURE__*/React.createElement("img", {
17110
+ src: close
17111
+ }));
17112
+ }
17113
+ }, {
17114
+ title: 'Sort',
17115
+ dataIndex: 'sort',
17116
+ className: 'drag-visible',
17117
+ render: function render() {
17118
+ return /*#__PURE__*/React.createElement(DragHandle$3, null);
17119
+ }
17120
+ }];
17121
+ _this.showModal = function () {
17122
+ _this.setState({
17123
+ visible: true
17124
+ });
17125
+ _this.setInitValue();
17126
+ };
17127
+ _this.handleOk = function (e) {
17128
+ var _this$state2 = _this.state,
17129
+ sortDataSource = _this$state2.sortDataSource,
17130
+ isDefaultValue = _this$state2.isDefaultValue,
17131
+ defaultValue = _this$state2.defaultValue;
17132
+ if (!sortDataSource.length) {
17133
+ message.warning('至少选择一个搜索项!');
17134
+ return;
17135
+ }
17136
+ _this.patchUserSearchFieldsConfig(sortDataSource);
17137
+ };
17138
+ _this.handleCancel = function (e) {
17139
+ console.log(e);
17140
+ _this.setState({
17141
+ visible: false
17142
+ });
17143
+ };
17144
+ _this.handleTableHeadHidden = function (title) {
17145
+ var _this$state3 = _this.state,
17146
+ sortDataSource = _this$state3.sortDataSource,
17147
+ dataSource = _this$state3.dataSource;
17148
+ _this.setState({
17149
+ sortDataSource: sortDataSource.filter(function (item) {
17150
+ return item.title !== title;
17151
+ }),
17152
+ dataSource: _toConsumableArray(dataSource.map(function (item) {
17153
+ if (item.title === title) {
17154
+ return _objectSpread2(_objectSpread2({}, item), {}, {
17155
+ hidden: true
17156
+ });
17157
+ }
17158
+ return item;
17159
+ }))
17160
+ }, function () {
17161
+ _this.handleOk();
17162
+ });
17163
+ };
17164
+ _this.onSortEnd = function (_ref) {
17165
+ var oldIndex = _ref.oldIndex,
17166
+ newIndex = _ref.newIndex;
17167
+ var sortDataSource = _this.state.sortDataSource;
17168
+ if (oldIndex !== newIndex) {
17169
+ var newData = arrayMoveImmutable([].concat(sortDataSource), oldIndex, newIndex).filter(function (el) {
17170
+ return !!el;
17171
+ });
17172
+ _this.setState({
17173
+ sortDataSource: _toConsumableArray(newData),
17174
+ isDefaultValue: false
17175
+ });
17176
+ }
17177
+ };
17178
+ _this.DraggableContainer = function (props) {
17179
+ return /*#__PURE__*/React.createElement(SortableBody$3, _objectSpread2({
17180
+ useDragHandle: true,
17181
+ disableAutoscroll: true,
17182
+ helperClass: "row-dragging",
17183
+ onSortEnd: _this.onSortEnd
17184
+ }, props));
17185
+ };
17186
+ _this.DraggableBodyRow = function (_ref2) {
17187
+ var className = _ref2.className,
17188
+ style = _ref2.style,
17189
+ restProps = _objectWithoutProperties(_ref2, _excluded$d);
17190
+ var sortDataSource = _this.state.sortDataSource;
17191
+ var index = sortDataSource.findIndex(function (x) {
17192
+ return x.name === restProps['data-row-key'];
17193
+ });
17194
+ return /*#__PURE__*/React.createElement(SortableItem$3, _objectSpread2({
17195
+ index: index
17196
+ }, restProps));
17197
+ };
17198
+ _this.onChange = function (e, label) {
17199
+ var _this$state4 = _this.state,
17200
+ sortDataSource = _this$state4.sortDataSource,
17201
+ dataSource = _this$state4.dataSource;
17202
+ if (!e.target.checked) {
17203
+ _this.setState({
17204
+ sortDataSource: sortDataSource.filter(function (item) {
17205
+ return item.label !== label;
17206
+ }),
17207
+ isDefaultValue: false,
17208
+ dataSource: _toConsumableArray(dataSource.map(function (item) {
17209
+ if (item.label === label) {
17210
+ return _objectSpread2(_objectSpread2({}, item), {}, {
17211
+ hidden: true
17212
+ });
17213
+ }
17214
+ return item;
17215
+ }))
17216
+ });
17217
+ } else {
17218
+ var newSortData = [].concat(_toConsumableArray(sortDataSource), _toConsumableArray(dataSource.filter(function (item) {
17219
+ return item.label === label;
17220
+ }).map(function (source) {
17221
+ return _objectSpread2(_objectSpread2({}, source), {}, {
17222
+ hidden: false
17223
+ });
17224
+ })));
17225
+ _this.setState({
17226
+ sortDataSource: _toConsumableArray(newSortData),
17227
+ isDefaultValue: false,
17228
+ dataSource: _toConsumableArray(dataSource.map(function (item) {
17229
+ if (item.label === label) {
17230
+ return _objectSpread2(_objectSpread2({}, item), {}, {
17231
+ hidden: false
17232
+ });
17233
+ }
17234
+ return item;
17235
+ }))
17236
+ });
17237
+ }
17238
+ };
17239
+ _this.handleReset = function () {
17240
+ _this.setInitValue(true);
17241
+ };
17242
+ _this.onSearch = function (e) {
17243
+ _this.setState({
17244
+ searchDataSource: e.target.value
17245
+ });
17246
+ };
17247
+ _this.onSearchSort = function (e) {
17248
+ _this.setState({
17249
+ onSearchSort: e.target.value
17250
+ });
17251
+ };
17252
+ return _this;
17253
+ }
17254
+ _createClass(SearchItemTable, [{
17255
+ key: "componentDidMount",
17256
+ value: function componentDidMount() {
17257
+ var _this$props2 = this.props,
17258
+ datasource = _this$props2.datasource,
17259
+ showSearchFields = _this$props2.showSearchFields,
17260
+ bsTableCode = _this$props2.bsTableCode;
17261
+ var config = this.getConfigFromlocalstorage();
17262
+ this.setState({
17263
+ dataSource: datasource.map(function (item) {
17264
+ var innerItem = config.filter(function (inneritem) {
17265
+ var innerKey = Array.isArray(inneritem.name) ? JSON.stringify(inneritem.name) : inneritem.name;
17266
+ var itemKey = Array.isArray(item.name) ? JSON.stringify(item.name) : item.name;
17267
+ return innerKey && innerKey === itemKey;
17268
+ });
17269
+ return _objectSpread2(_objectSpread2({}, item), {}, {
17270
+ hidden: config.length && !innerItem.length
17271
+ });
17272
+ }),
17273
+ defaultValue: datasource.map(function (item) {
17274
+ var innerItem = config.filter(function (inneritem) {
17275
+ var innerKey = Array.isArray(inneritem.name) ? JSON.stringify(inneritem.name) : inneritem.name;
17276
+ var itemKey = Array.isArray(item.name) ? JSON.stringify(item.name) : item.name;
17277
+ return innerKey && innerKey === itemKey;
17278
+ });
17279
+ return _objectSpread2(_objectSpread2({}, item), {}, {
17280
+ hidden: config.length && !innerItem.length
17281
+ });
17282
+ }),
17283
+ sortDataSource: datasource.filter(function (item) {
17284
+ return !item.hidden;
17285
+ }).map(function (item) {
17286
+ return _objectSpread2({}, item);
17287
+ }),
17288
+ bsTableCode: bsTableCode
17289
+ });
17290
+ }
17291
+ }, {
17292
+ key: "render",
17293
+ value: function render() {
17294
+ var _this2 = this;
17295
+ var _this$state5 = this.state,
17296
+ _this$state5$dataSour = _this$state5.dataSource,
17297
+ dataSource = _this$state5$dataSour === void 0 ? [] : _this$state5$dataSour,
17298
+ searchDataSource = _this$state5.searchDataSource,
17299
+ sortDataSource = _this$state5.sortDataSource,
17300
+ visible = _this$state5.visible,
17301
+ onSearchSort = _this$state5.onSearchSort;
17302
+ var newSearchSource = dataSource.filter(function (item) {
17303
+ var _item$label;
17304
+ return (item === null || item === void 0 ? void 0 : (_item$label = item.label) === null || _item$label === void 0 ? void 0 : _item$label.indexOf(searchDataSource || '')) > -1;
17305
+ });
17306
+ return /*#__PURE__*/React.createElement("div", {
17307
+ className: 'sort_table_wrapper'
17308
+ }, visible && /*#__PURE__*/React.createElement(Modal, {
17309
+ title: "\u8BBE\u7F6E\u641C\u7D22\u9879\u5185\u5BB9",
17310
+ wrapClassName: 'sort_table_wrapper',
17311
+ width: 820,
17312
+ visible: visible,
17313
+ onOk: this.handleOk,
17314
+ onCancel: this.handleCancel,
17315
+ footer: [/*#__PURE__*/React.createElement(Button, {
17316
+ key: "back",
17317
+ onClick: this.handleReset
17318
+ }, "\u6062\u590D\u9ED8\u8BA4"), /*#__PURE__*/React.createElement(Button, {
17319
+ key: "submit",
17320
+ onClick: this.handleCancel
17321
+ }, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
17322
+ key: "submit",
17323
+ type: "primary",
17324
+ onClick: this.handleOk
17325
+ }, "\u786E\u8BA4")]
17326
+ }, /*#__PURE__*/React.createElement("div", {
17327
+ className: 'sort_table'
17328
+ }, /*#__PURE__*/React.createElement("div", {
17329
+ className: 'sort_table_column_wrapper'
17330
+ }, /*#__PURE__*/React.createElement("span", {
17331
+ className: 'sort_table_column_count'
17332
+ }, "\u53EF\u9009\u5B57\u6BB5 ", /*#__PURE__*/React.createElement("span", null, "\uFF08\u5171", dataSource.length, "\u4E2A\uFF09")), /*#__PURE__*/React.createElement("div", {
17333
+ className: 'sort_table_column'
17334
+ }, /*#__PURE__*/React.createElement(Input, {
17335
+ prefix: /*#__PURE__*/React.createElement(SearchOutlined, {
17336
+ className: "site-form-item-icon"
17337
+ }),
17338
+ placeholder: "\u641C\u7D22",
17339
+ allowClear: true,
17340
+ onChange: this.onSearch,
17341
+ style: {
17342
+ width: 540
17343
+ }
17344
+ }), /*#__PURE__*/React.createElement("div", null, !searchDataSource && /*#__PURE__*/React.createElement(Checkbox, {
17345
+ checked: !dataSource.some(function (item) {
17346
+ if (item.hidden) return true;
17347
+ return false;
17348
+ }),
17349
+ onClick: function onClick(e) {
17350
+ _this2.setState({
17351
+ isDefaultValue: false,
17352
+ dataSource: _toConsumableArray(dataSource.map(function (item) {
17353
+ return _objectSpread2(_objectSpread2({}, item), {}, {
17354
+ hidden: !e.target.checked
17355
+ });
17356
+ })),
17357
+ sortDataSource: e.target.checked ? _toConsumableArray(dataSource.map(function (item) {
17358
+ return _objectSpread2(_objectSpread2({}, item), {}, {
17359
+ hidden: false
17360
+ });
17361
+ })) : []
17362
+ });
17363
+ }
17364
+ }, "\u5168\u9009")), /*#__PURE__*/React.createElement("div", {
17365
+ className: 'sort_table_column_all'
17366
+ }, searchDataSource ? newSearchSource.map(function (item) {
17367
+ return /*#__PURE__*/React.createElement(Checkbox, {
17368
+ checked: !item.hidden,
17369
+ onChange: function onChange(e) {
17370
+ _this2.onChange(e, item.label);
17371
+ }
17372
+ }, item.label);
17373
+ }) : dataSource.map(function (item) {
17374
+ return /*#__PURE__*/React.createElement(Checkbox, {
17375
+ checked: !item.hidden,
17376
+ onChange: function onChange(e) {
17377
+ _this2.onChange(e, item.label);
17378
+ }
17379
+ }, item.label);
17380
+ }), !!newSearchSource.length && /*#__PURE__*/React.createElement("span", {
17381
+ style: {
17382
+ width: '144px'
17383
+ }
17384
+ }), !newSearchSource.length && /*#__PURE__*/React.createElement("div", {
17385
+ className: 'sort_table_column_all_empty'
17386
+ }, "\u672A\u67E5\u8BE2\u5230\u7ED3\u679C")))), /*#__PURE__*/React.createElement("div", {
17387
+ className: 'sort_table_content_wrapper'
17388
+ }, /*#__PURE__*/React.createElement("span", {
17389
+ className: 'sort_table_content_count'
17390
+ }, "\u5DF2\u9009\u5B57\u6BB5 ", /*#__PURE__*/React.createElement("span", null, "\uFF08\u5171", sortDataSource.length, "\u4E2A\uFF09")), /*#__PURE__*/React.createElement("div", {
17391
+ className: 'sort_table_content'
17392
+ }, /*#__PURE__*/React.createElement("span", {
17393
+ style: {
17394
+ paddingLeft: '10px'
17395
+ }
17396
+ }, /*#__PURE__*/React.createElement(Input, {
17397
+ prefix: /*#__PURE__*/React.createElement(SearchOutlined, {
17398
+ className: "site-form-item-icon"
17399
+ }),
17400
+ placeholder: "\u641C\u7D22",
17401
+ allowClear: true,
17402
+ onChange: this.onSearchSort,
17403
+ style: {
17404
+ width: 190
17405
+ }
17406
+ })), /*#__PURE__*/React.createElement(Table, {
17407
+ pagination: false,
17408
+ showHeader: false,
17409
+ dataSource: onSearchSort ? sortDataSource.filter(function (item) {
17410
+ var _item$label2;
17411
+ return (item === null || item === void 0 ? void 0 : (_item$label2 = item.label) === null || _item$label2 === void 0 ? void 0 : _item$label2.indexOf(onSearchSort)) > -1;
17412
+ }) : sortDataSource,
17413
+ columns: this.columns,
17414
+ rowKey: "name",
17415
+ components: {
17416
+ body: {
17417
+ wrapper: this.DraggableContainer,
17418
+ row: this.DraggableBodyRow
17419
+ }
17420
+ }
17421
+ }))))), /*#__PURE__*/React.createElement("div", {
17422
+ onClick: this.showModal,
17423
+ style: {
17424
+ fontSize: 14
17425
+ }
17426
+ }, "\u641C\u7D22\u9879\u8BBE\u7F6E"));
17427
+ }
17428
+ }]);
17429
+ return SearchItemTable;
17430
+ }(React.Component);
17431
+
17432
+ var _excluded$e = ["onResize", "width"];
16942
17433
  var MemoQueryTable = /*#__PURE__*/React.memo(QueryTable);
16943
17434
  var ResizeableTitle$2 = function ResizeableTitle(props) {
16944
17435
  var onResize = props.onResize,
16945
17436
  width = props.width,
16946
- restProps = _objectWithoutProperties(props, _excluded$d);
17437
+ restProps = _objectWithoutProperties(props, _excluded$e);
16947
17438
  if (!width) {
16948
17439
  return /*#__PURE__*/React.createElement("th", _objectSpread2({}, restProps));
16949
17440
  }
@@ -16988,14 +17479,18 @@ var BsSulaQueryTable = (function (props) {
16988
17479
  var _useState11 = useState([]),
16989
17480
  _useState12 = _slicedToArray(_useState11, 2),
16990
17481
  showColumn = _useState12[0],
16991
- setShowColumns = _useState12[1];
17482
+ setShowColumns = _useState12[1]; // 列字段
17483
+ var _useState13 = useState([]),
17484
+ _useState14 = _slicedToArray(_useState13, 2),
17485
+ showSearchFields = _useState14[0],
17486
+ setShowSearchFields = _useState14[1]; //搜索项字段
16992
17487
  var _props$isPage = props.isPage,
16993
17488
  pagination = props.pagination,
16994
17489
  tableCode = props.tableCode;
16995
- var _useState13 = useState('100vh'),
16996
- _useState14 = _slicedToArray(_useState13, 2),
16997
- height = _useState14[0],
16998
- setHeight = _useState14[1];
17490
+ var _useState15 = useState('100vh'),
17491
+ _useState16 = _slicedToArray(_useState15, 2),
17492
+ height = _useState16[0],
17493
+ setHeight = _useState16[1];
16999
17494
  var sortTableRef = useRef(null);
17000
17495
  var bsTableCode = tableCode || window.location.hash; //设置列字段的唯一标识
17001
17496
  // 获取table高度
@@ -17015,8 +17510,8 @@ var BsSulaQueryTable = (function (props) {
17015
17510
  if (isFull == undefined) isFull = false;
17016
17511
  return isFull;
17017
17512
  }
17018
- var getConfigFromlocalstorage = function getConfigFromlocalstorage() {
17019
- var config = localStorage.getItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION) || '[]';
17513
+ var getConfigFromlocalstorage = function getConfigFromlocalstorage(type) {
17514
+ var config = localStorage.getItem(type) || '[]';
17020
17515
  var configArray = JSON.parse(config);
17021
17516
  var configSetting = configArray.filter(function (item) {
17022
17517
  return item.code === bsTableCode;
@@ -17072,7 +17567,7 @@ var BsSulaQueryTable = (function (props) {
17072
17567
  columns: _toConsumableArray(props.columns)
17073
17568
  }));
17074
17569
  var columns = props.columns;
17075
- var columnConfig = getConfigFromlocalstorage();
17570
+ var columnConfig = getConfigFromlocalstorage(ENUM.BROWSER_CACHE.COLUMN_CONDITION);
17076
17571
  var showColumns = columnConfig.length ? columnConfig.map(function (item) {
17077
17572
  var inner = columns.filter(function (inneritem) {
17078
17573
  var innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : inneritem.key || inneritem.dataIndex;
@@ -17096,10 +17591,25 @@ var BsSulaQueryTable = (function (props) {
17096
17591
  });
17097
17592
  setShowColumns(_toConsumableArray(showColumns));
17098
17593
  };
17594
+ var setInitialSearchFieldsInfo = function setInitialSearchFieldsInfo() {
17595
+ //获取搜索字段的缓存配置
17596
+ var fields = props.fields;
17597
+ var searchFieldsConfig = getConfigFromlocalstorage(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION);
17598
+ var showSearchFields = searchFieldsConfig.length ? searchFieldsConfig.map(function (item) {
17599
+ var inner = fields.filter(function (inneritem) {
17600
+ var innerKey = Array.isArray(inneritem.name) ? JSON.stringify(inneritem.name) : inneritem.name;
17601
+ var itemKey = Array.isArray(item.name) ? JSON.stringify(item.name) : item.name;
17602
+ return innerKey && innerKey === itemKey;
17603
+ })[0];
17604
+ return _objectSpread2(_objectSpread2({}, inner), item);
17605
+ }) : fields;
17606
+ setShowSearchFields(_toConsumableArray(showSearchFields));
17607
+ };
17099
17608
  //组件初始挂载
17100
17609
  useEffect(function () {
17101
17610
  getTableHeight();
17102
17611
  setInitialTableInfo();
17612
+ setInitialSearchFieldsInfo();
17103
17613
  window.addEventListener('resize', function (e) {
17104
17614
  watchWinResize();
17105
17615
  });
@@ -17116,6 +17626,17 @@ var BsSulaQueryTable = (function (props) {
17116
17626
  JSON.stringify(newKeys) !== JSON.stringify(oldKeys) && setInitialTableInfo();
17117
17627
  }
17118
17628
  }, [props === null || props === void 0 ? void 0 : props.columns]);
17629
+ useEffect(function () {
17630
+ if ((props === null || props === void 0 ? void 0 : props.fields) && (value === null || value === void 0 ? void 0 : value.fields)) {
17631
+ var newKeys = props.fields.map(function (d) {
17632
+ return Array.isArray(d.name) ? JSON.stringify(d.name) : d.name;
17633
+ });
17634
+ var oldKeys = value.fields.map(function (d) {
17635
+ return Array.isArray(d.name) ? JSON.stringify(d.name) : d.name;
17636
+ });
17637
+ JSON.stringify(newKeys) !== JSON.stringify(oldKeys) && setInitialSearchFieldsInfo();
17638
+ }
17639
+ }, [props === null || props === void 0 ? void 0 : props.fields]);
17119
17640
  useEffect(function () {
17120
17641
  setInitialTableInfo();
17121
17642
  }, [props === null || props === void 0 ? void 0 : props.refreshColumns]);
@@ -17227,16 +17748,28 @@ var BsSulaQueryTable = (function (props) {
17227
17748
  actionsRender = [].concat(_toConsumableArray(actionsRender), [{
17228
17749
  type: 'text',
17229
17750
  props: {
17230
- children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
17231
- title: "\u5217\u8BBE\u7F6E"
17751
+ children: /*#__PURE__*/React.createElement("span", {
17752
+ className: "ant-dropdown-link"
17753
+ }, /*#__PURE__*/React.createElement(Dropdown, {
17754
+ overlay: /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(Menu.Item, null, /*#__PURE__*/React.createElement(SortableTable$1, {
17755
+ ref: sortTableRef,
17756
+ setShowColumns: setShowColumns,
17757
+ showColumn: showColumn,
17758
+ datasource: (value === null || value === void 0 ? void 0 : value.columns) || [],
17759
+ bsTableCode: bsTableCode
17760
+ })), /*#__PURE__*/React.createElement(Menu.Item, null, /*#__PURE__*/React.createElement(SearchItemTable, {
17761
+ ref: sortTableRef,
17762
+ setShowSearchFields: setShowSearchFields,
17763
+ showSearchFields: showSearchFields,
17764
+ datasource: (value === null || value === void 0 ? void 0 : value.fields) || [],
17765
+ bsTableCode: bsTableCode
17766
+ }))),
17767
+ placement: "bottom"
17232
17768
  }, /*#__PURE__*/React.createElement("span", {
17233
17769
  className: "ant-dropdown-link"
17234
- }, /*#__PURE__*/React.createElement(SortableTable$1, {
17235
- ref: sortTableRef,
17236
- setShowColumns: setShowColumns,
17237
- showColumn: showColumn,
17238
- datasource: (value === null || value === void 0 ? void 0 : value.columns) || [],
17239
- bsTableCode: bsTableCode
17770
+ }, /*#__PURE__*/React.createElement("img", {
17771
+ width: 32,
17772
+ src: shezhi
17240
17773
  }))))
17241
17774
  }
17242
17775
  }, {
@@ -17320,6 +17853,7 @@ var BsSulaQueryTable = (function (props) {
17320
17853
  }, handleTimeValue()), {}, {
17321
17854
  tableProps: setTableProps(),
17322
17855
  columns: _toConsumableArray(showColumn),
17856
+ fields: _toConsumableArray(showSearchFields),
17323
17857
  ref: props.forwardedRef || refs,
17324
17858
  isFullScreen: isFullScreen
17325
17859
  });
@@ -17342,7 +17876,7 @@ var BsSulaQueryTable = (function (props) {
17342
17876
  summary: props.summary,
17343
17877
  statusMapping: props.statusMapping
17344
17878
  });
17345
- }, [value, checkedList, showColumn, props.statusMapping]);
17879
+ }, [value, checkedList, showColumn, props.statusMapping, showSearchFields]);
17346
17880
  return /*#__PURE__*/React.createElement(MemoQueryTable, _objectSpread2({}, memoConfig));
17347
17881
  });
17348
17882
 
@@ -19415,7 +19949,7 @@ var CustomerMenuHeader = function CustomerMenuHeader(_ref) {
19415
19949
  var css_248z$m = ".customer_menu_content {\n color: #b1bad4;\n background: #141620;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 18px;\n height: 40px;\n border-bottom: 1px solid #3d4047;\n}\n.customer_menu_content .ant-btn-link {\n color: #b1bad4 !important;\n font-size: 16px;\n height: 36px;\n}\n.menu_item {\n line-height: 30px;\n height: 30px;\n color: rgba(44, 47, 46);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.link_style:hover {\n background-color: #e4e7ed;\n cursor: pointer;\n color: #1890ff;\n}\n.sub_menu_content {\n box-shadow: 2px 0px 4px 0px rgba(185, 185, 185, 0.5);\n position: fixed;\n top: 50px;\n left: 140px;\n width: 200px;\n height: 100%;\n background-color: #fff;\n padding-top: 10px;\n z-index: 9999;\n}\n.tab_left_operate {\n display: flex;\n height: 28px;\n align-items: center;\n}\n.tab_left_operate > div {\n width: 28px;\n font-size: 12px;\n color: #2C2F2ECC;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n border-right: 1px solid #E4E4E4;\n background-color: #fff;\n cursor: pointer;\n}\n.tab_left_operate > div:last-child {\n box-shadow: 2px -2px 4px 0px rgba(185, 185, 185, 0.9);\n z-index: 99;\n}\n.tab_right_operate {\n height: 28px;\n width: 28px;\n font-size: 12px;\n color: #2C2F2ECC;\n display: flex;\n align-items: center;\n justify-content: center;\n border-right: 1px solid #E4E4E4;\n background-color: #fff;\n box-shadow: -2px -2px 4px 0px rgba(185, 185, 185, 0.9);\n z-index: 99;\n cursor: pointer;\n position: relative;\n}\n";
19416
19950
  styleInject(css_248z$m);
19417
19951
 
19418
- var _excluded$e = ["route"];
19952
+ var _excluded$f = ["route"];
19419
19953
  var TabPane = Tabs.TabPane;
19420
19954
  var UN_LISTTEN_DRP;
19421
19955
  var routerArray = [];
@@ -20213,7 +20747,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
20213
20747
  }); // 添加数据大屏
20214
20748
  var _this$props3 = this.props,
20215
20749
  route = _this$props3.route,
20216
- restPrpos = _objectWithoutProperties(_this$props3, _excluded$e);
20750
+ restPrpos = _objectWithoutProperties(_this$props3, _excluded$f);
20217
20751
  var exist = route.routes.find(function (route) {
20218
20752
  return route.path === '/homePage/data-show';
20219
20753
  });
@@ -21009,10 +21543,10 @@ var index$6 = /*#__PURE__*/forwardRef(function (props, ref) {
21009
21543
  }))))));
21010
21544
  });
21011
21545
 
21012
- var _excluded$f = ["children"];
21546
+ var _excluded$g = ["children"];
21013
21547
  var Drawer = (function (props) {
21014
21548
  var children = props.children,
21015
- restProps = _objectWithoutProperties(props, _excluded$f);
21549
+ restProps = _objectWithoutProperties(props, _excluded$g);
21016
21550
  return /*#__PURE__*/React.createElement(Drawer$1, _objectSpread2({
21017
21551
  mask: true,
21018
21552
  closable: false,