@bit-sun/business-component 2.2.0-alpha.2 → 2.2.0-alpha.3
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/components/Business/BsSulaQueryTable/SearchItemSetting.d.ts +59 -0
- package/dist/index.esm.js +918 -282
- package/dist/index.js +917 -281
- package/dist/utils/enumConfig.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/Business/BsLayouts/index.tsx +64 -60
- package/src/components/Business/BsLayouts/utils.tsx +8 -3
- package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +538 -0
- package/src/components/Business/BsSulaQueryTable/index.tsx +109 -63
- package/src/components/Business/BsSulaQueryTable/setting.tsx +1 -1
- package/src/components/Business/DetailPageWrapper/index.tsx +49 -38
- package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +4 -0
- package/src/components/Business/JsonQueryTable/index.tsx +152 -23
- package/src/utils/enumConfig.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -50,7 +50,8 @@ var ENUM = {
|
|
|
50
50
|
LIMIT_MENU_DATA: 'limitedMenuData',
|
|
51
51
|
USER_INFO: 'userInfo',
|
|
52
52
|
DICT_CODES: 'dicData',
|
|
53
|
-
CHILD_APP_BACK: 'child_app_back'
|
|
53
|
+
CHILD_APP_BACK: 'child_app_back',
|
|
54
|
+
SEARCH_FIELDS_CONDITION: 'searchFieldsCondition' //表格搜索项信息缓存
|
|
54
55
|
}
|
|
55
56
|
};
|
|
56
57
|
|
|
@@ -16005,36 +16006,43 @@ var DetailWrapper = /*#__PURE__*/React__default['default'].memo(function (_ref)
|
|
|
16005
16006
|
var pageTitle = React.useMemo(function () {
|
|
16006
16007
|
return getPageTitle(pathname);
|
|
16007
16008
|
}, [pathname, title]);
|
|
16009
|
+
// const breadcrumbArr = `${basePath}${pathname}`
|
|
16010
|
+
// .split('/')
|
|
16011
|
+
// .slice(1)
|
|
16012
|
+
// .map((_item, index, arr) =>
|
|
16013
|
+
// matchParamsPath(
|
|
16014
|
+
// `/${arr.slice(0, index + 1).join('/')}`,
|
|
16015
|
+
// breadcrumbNameMap,
|
|
16016
|
+
// ),
|
|
16017
|
+
// )
|
|
16018
|
+
// .filter((item) => item);
|
|
16008
16019
|
React.useEffect(function () {}, []);
|
|
16009
16020
|
var ShowFullScreen = function ShowFullScreen() {
|
|
16010
|
-
|
|
16011
|
-
|
|
16012
|
-
|
|
16013
|
-
|
|
16014
|
-
|
|
16015
|
-
|
|
16016
|
-
|
|
16017
|
-
|
|
16018
|
-
|
|
16019
|
-
|
|
16020
|
-
|
|
16021
|
-
|
|
16022
|
-
|
|
16023
|
-
|
|
16024
|
-
|
|
16025
|
-
|
|
16026
|
-
|
|
16027
|
-
fullScreenEle.call(contentEle);
|
|
16028
|
-
setIsFnllScreen(true);
|
|
16029
|
-
return;
|
|
16021
|
+
if (window.top != window) {
|
|
16022
|
+
window.parent.postMessage({
|
|
16023
|
+
type: 'screenChange',
|
|
16024
|
+
id: itemPath
|
|
16025
|
+
}, '*');
|
|
16026
|
+
setIsFnllScreen(!isFullScreen);
|
|
16027
|
+
} else {
|
|
16028
|
+
var _isFullScreen = document.fullScreen || document.webkitIsFullScreen || document.mozFullScreen;
|
|
16029
|
+
var contentEle = document.querySelector("body");
|
|
16030
|
+
// addTabsNavStyle(isFullScreen);
|
|
16031
|
+
if (contentEle && !_isFullScreen) {
|
|
16032
|
+
var fullScreenEle = contentEle.requestFullscreen || contentEle.mozRequestFullScreen || contentEle.webkitRequestFullScreen || contentEle.msRequestFullscreen;
|
|
16033
|
+
if (fullScreenEle) {
|
|
16034
|
+
fullScreenEle.call(contentEle);
|
|
16035
|
+
setIsFnllScreen(true);
|
|
16036
|
+
return;
|
|
16037
|
+
}
|
|
16030
16038
|
}
|
|
16031
|
-
|
|
16032
|
-
|
|
16033
|
-
|
|
16034
|
-
|
|
16035
|
-
|
|
16036
|
-
|
|
16037
|
-
|
|
16039
|
+
if (document && _isFullScreen) {
|
|
16040
|
+
var exitFullScreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitCancelFullScreen || document.msExitFullscreen;
|
|
16041
|
+
if (exitFullScreen) {
|
|
16042
|
+
exitFullScreen.call(document);
|
|
16043
|
+
setIsFnllScreen(false);
|
|
16044
|
+
return;
|
|
16045
|
+
}
|
|
16038
16046
|
}
|
|
16039
16047
|
}
|
|
16040
16048
|
};
|
|
@@ -16560,11 +16568,556 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
16560
16568
|
onClick: function onClick() {
|
|
16561
16569
|
_this.setState({
|
|
16562
16570
|
sortDataSource: _this.state.sortDataSource.filter(function (item) {
|
|
16563
|
-
return item.title !== record.title;
|
|
16571
|
+
return item.title !== record.title;
|
|
16572
|
+
}),
|
|
16573
|
+
isDefaultValue: false,
|
|
16574
|
+
dataSource: _toConsumableArray(_this.state.dataSource.map(function (item) {
|
|
16575
|
+
if (item.title === record.title) {
|
|
16576
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16577
|
+
hidden: true
|
|
16578
|
+
});
|
|
16579
|
+
}
|
|
16580
|
+
return item;
|
|
16581
|
+
}))
|
|
16582
|
+
});
|
|
16583
|
+
}
|
|
16584
|
+
}, /*#__PURE__*/React__default['default'].createElement("img", {
|
|
16585
|
+
src: close
|
|
16586
|
+
}));
|
|
16587
|
+
}
|
|
16588
|
+
}, {
|
|
16589
|
+
title: 'Sort',
|
|
16590
|
+
dataIndex: 'sort',
|
|
16591
|
+
className: 'drag-visible',
|
|
16592
|
+
render: function render() {
|
|
16593
|
+
return /*#__PURE__*/React__default['default'].createElement(DragHandle$2, null);
|
|
16594
|
+
}
|
|
16595
|
+
}];
|
|
16596
|
+
_this.showModal = function () {
|
|
16597
|
+
_this.setState({
|
|
16598
|
+
visible: true
|
|
16599
|
+
});
|
|
16600
|
+
_this.setInitValue();
|
|
16601
|
+
};
|
|
16602
|
+
_this.handleOk = function (e) {
|
|
16603
|
+
var _this$state2 = _this.state,
|
|
16604
|
+
sortDataSource = _this$state2.sortDataSource,
|
|
16605
|
+
isDefaultValue = _this$state2.isDefaultValue,
|
|
16606
|
+
defaultValue = _this$state2.defaultValue;
|
|
16607
|
+
if (!sortDataSource.length) {
|
|
16608
|
+
antd.message.warning('至少选择一列!');
|
|
16609
|
+
return;
|
|
16610
|
+
}
|
|
16611
|
+
// if (isDefaultValue) {
|
|
16612
|
+
// this.patchUserColumnConfig('');
|
|
16613
|
+
// return;
|
|
16614
|
+
// }
|
|
16615
|
+
_this.patchUserColumnConfig(sortDataSource);
|
|
16616
|
+
};
|
|
16617
|
+
_this.handleCancel = function (e) {
|
|
16618
|
+
console.log(e);
|
|
16619
|
+
_this.setState({
|
|
16620
|
+
visible: false
|
|
16621
|
+
});
|
|
16622
|
+
};
|
|
16623
|
+
_this.handleTableHeadHidden = function (title) {
|
|
16624
|
+
var _this$state3 = _this.state,
|
|
16625
|
+
sortDataSource = _this$state3.sortDataSource,
|
|
16626
|
+
dataSource = _this$state3.dataSource;
|
|
16627
|
+
_this.setState({
|
|
16628
|
+
sortDataSource: sortDataSource.filter(function (item) {
|
|
16629
|
+
return item.title !== title;
|
|
16630
|
+
}),
|
|
16631
|
+
dataSource: _toConsumableArray(dataSource.map(function (item) {
|
|
16632
|
+
if (item.title === title) {
|
|
16633
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16634
|
+
hidden: true
|
|
16635
|
+
});
|
|
16636
|
+
}
|
|
16637
|
+
return item;
|
|
16638
|
+
}))
|
|
16639
|
+
}, function () {
|
|
16640
|
+
_this.handleOk();
|
|
16641
|
+
});
|
|
16642
|
+
};
|
|
16643
|
+
_this.onSortEnd = function (_ref) {
|
|
16644
|
+
var oldIndex = _ref.oldIndex,
|
|
16645
|
+
newIndex = _ref.newIndex;
|
|
16646
|
+
var sortDataSource = _this.state.sortDataSource;
|
|
16647
|
+
if (oldIndex !== newIndex) {
|
|
16648
|
+
var newData = arrayMove.arrayMoveImmutable([].concat(sortDataSource), oldIndex, newIndex).filter(function (el) {
|
|
16649
|
+
return !!el;
|
|
16650
|
+
});
|
|
16651
|
+
_this.setState({
|
|
16652
|
+
sortDataSource: [].concat(_toConsumableArray(newData.filter(function (item) {
|
|
16653
|
+
return item.fixed === 'left';
|
|
16654
|
+
})), _toConsumableArray(newData.filter(function (item) {
|
|
16655
|
+
return !item.fixed;
|
|
16656
|
+
})), _toConsumableArray(newData.filter(function (item) {
|
|
16657
|
+
return item.fixed === 'right';
|
|
16658
|
+
}))),
|
|
16659
|
+
isDefaultValue: false
|
|
16660
|
+
});
|
|
16661
|
+
}
|
|
16662
|
+
};
|
|
16663
|
+
_this.DraggableContainer = function (props) {
|
|
16664
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableBody$2, _objectSpread2({
|
|
16665
|
+
useDragHandle: true,
|
|
16666
|
+
disableAutoscroll: true,
|
|
16667
|
+
helperClass: "row-dragging",
|
|
16668
|
+
onSortEnd: _this.onSortEnd
|
|
16669
|
+
}, props));
|
|
16670
|
+
};
|
|
16671
|
+
_this.DraggableBodyRow = function (_ref2) {
|
|
16672
|
+
var className = _ref2.className,
|
|
16673
|
+
style = _ref2.style,
|
|
16674
|
+
restProps = _objectWithoutProperties(_ref2, _excluded$c);
|
|
16675
|
+
var sortDataSource = _this.state.sortDataSource;
|
|
16676
|
+
// function findIndex base on Table rowKey props and should always be a right array index
|
|
16677
|
+
var index = sortDataSource.findIndex(function (x) {
|
|
16678
|
+
return x.key === restProps['data-row-key'];
|
|
16679
|
+
});
|
|
16680
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableItem$2, _objectSpread2({
|
|
16681
|
+
index: index
|
|
16682
|
+
}, restProps));
|
|
16683
|
+
};
|
|
16684
|
+
_this.onChange = function (e, title) {
|
|
16685
|
+
var _this$state4 = _this.state,
|
|
16686
|
+
sortDataSource = _this$state4.sortDataSource,
|
|
16687
|
+
dataSource = _this$state4.dataSource;
|
|
16688
|
+
if (!e.target.checked) {
|
|
16689
|
+
_this.setState({
|
|
16690
|
+
sortDataSource: sortDataSource.filter(function (item) {
|
|
16691
|
+
return item.title !== title;
|
|
16692
|
+
}),
|
|
16693
|
+
isDefaultValue: false,
|
|
16694
|
+
dataSource: _toConsumableArray(dataSource.map(function (item) {
|
|
16695
|
+
if (item.title === title) {
|
|
16696
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16697
|
+
hidden: true
|
|
16698
|
+
});
|
|
16699
|
+
}
|
|
16700
|
+
return item;
|
|
16701
|
+
}))
|
|
16702
|
+
});
|
|
16703
|
+
} else {
|
|
16704
|
+
var _fixedLeft = [];
|
|
16705
|
+
var _fixedRight = [];
|
|
16706
|
+
var noFixedSortSource = [];
|
|
16707
|
+
var newSortData = [].concat(_toConsumableArray(sortDataSource), _toConsumableArray(dataSource.filter(function (item) {
|
|
16708
|
+
return item.title === title;
|
|
16709
|
+
}).map(function (source) {
|
|
16710
|
+
return _objectSpread2(_objectSpread2({}, source), {}, {
|
|
16711
|
+
hidden: false
|
|
16712
|
+
});
|
|
16713
|
+
})));
|
|
16714
|
+
newSortData.forEach(function (item) {
|
|
16715
|
+
if ((item === null || item === void 0 ? void 0 : item.fixed) === 'left') {
|
|
16716
|
+
_fixedLeft.push(item);
|
|
16717
|
+
} else if ((item === null || item === void 0 ? void 0 : item.fixed) === 'right') {
|
|
16718
|
+
_fixedRight.push(item);
|
|
16719
|
+
} else {
|
|
16720
|
+
noFixedSortSource.push(item);
|
|
16721
|
+
}
|
|
16722
|
+
});
|
|
16723
|
+
_this.setState({
|
|
16724
|
+
sortDataSource: [].concat(_fixedLeft, noFixedSortSource, _fixedRight),
|
|
16725
|
+
isDefaultValue: false,
|
|
16726
|
+
dataSource: _toConsumableArray(dataSource.map(function (item) {
|
|
16727
|
+
if (item.title === title) {
|
|
16728
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16729
|
+
hidden: false
|
|
16730
|
+
});
|
|
16731
|
+
}
|
|
16732
|
+
return item;
|
|
16733
|
+
}))
|
|
16734
|
+
});
|
|
16735
|
+
}
|
|
16736
|
+
};
|
|
16737
|
+
_this.handleReset = function () {
|
|
16738
|
+
_this.setInitValue(true);
|
|
16739
|
+
};
|
|
16740
|
+
_this.onSearch = function (e) {
|
|
16741
|
+
_this.setState({
|
|
16742
|
+
searchDataSource: e.target.value
|
|
16743
|
+
});
|
|
16744
|
+
};
|
|
16745
|
+
_this.onSearchSort = function (e) {
|
|
16746
|
+
_this.setState({
|
|
16747
|
+
onSearchSort: e.target.value
|
|
16748
|
+
});
|
|
16749
|
+
};
|
|
16750
|
+
return _this;
|
|
16751
|
+
}
|
|
16752
|
+
_createClass(SortableTable, [{
|
|
16753
|
+
key: "componentDidMount",
|
|
16754
|
+
value: function componentDidMount() {
|
|
16755
|
+
var _this$props2 = this.props,
|
|
16756
|
+
datasource = _this$props2.datasource,
|
|
16757
|
+
showColumn = _this$props2.showColumn,
|
|
16758
|
+
bsTableCode = _this$props2.bsTableCode;
|
|
16759
|
+
var config = this.getConfigFromlocalstorage();
|
|
16760
|
+
this.setState({
|
|
16761
|
+
dataSource: datasource.map(function (item) {
|
|
16762
|
+
var _innerItem$3;
|
|
16763
|
+
var innerItem = config.filter(function (inneritem) {
|
|
16764
|
+
var innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : inneritem.key || inneritem.dataIndex;
|
|
16765
|
+
var itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : item.key || item.dataIndex;
|
|
16766
|
+
return innerKey && innerKey === itemKey;
|
|
16767
|
+
});
|
|
16768
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16769
|
+
key: item.key || item.dataIndex,
|
|
16770
|
+
width: ((_innerItem$3 = innerItem[0]) === null || _innerItem$3 === void 0 ? void 0 : _innerItem$3.width) || item.width,
|
|
16771
|
+
hidden: config.length ? !innerItem.length : item.hidden
|
|
16772
|
+
});
|
|
16773
|
+
}),
|
|
16774
|
+
defaultValue: datasource.map(function (item) {
|
|
16775
|
+
var _innerItem$4;
|
|
16776
|
+
var innerItem = config.filter(function (inneritem) {
|
|
16777
|
+
var innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : inneritem.key || inneritem.dataIndex;
|
|
16778
|
+
var itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : item.key || item.dataIndex;
|
|
16779
|
+
return innerKey && innerKey === itemKey;
|
|
16780
|
+
});
|
|
16781
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16782
|
+
key: item.key || item.dataIndex,
|
|
16783
|
+
width: ((_innerItem$4 = innerItem[0]) === null || _innerItem$4 === void 0 ? void 0 : _innerItem$4.width) || item.width,
|
|
16784
|
+
hidden: config.length ? !innerItem.length : item.hidden
|
|
16785
|
+
});
|
|
16786
|
+
}),
|
|
16787
|
+
sortDataSource: datasource.filter(function (item) {
|
|
16788
|
+
return !item.hidden;
|
|
16789
|
+
}).map(function (item) {
|
|
16790
|
+
var _showColumn$filter$;
|
|
16791
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16792
|
+
key: item.key || item.dataIndex,
|
|
16793
|
+
width: ((_showColumn$filter$ = showColumn.filter(function (inneritem) {
|
|
16794
|
+
var innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : inneritem.key || inneritem.dataIndex;
|
|
16795
|
+
var itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : item.key || item.dataIndex;
|
|
16796
|
+
return innerKey && innerKey === itemKey;
|
|
16797
|
+
})[0]) === null || _showColumn$filter$ === void 0 ? void 0 : _showColumn$filter$.width) || item.width
|
|
16798
|
+
});
|
|
16799
|
+
}),
|
|
16800
|
+
bsTableCode: bsTableCode
|
|
16801
|
+
});
|
|
16802
|
+
}
|
|
16803
|
+
}, {
|
|
16804
|
+
key: "render",
|
|
16805
|
+
value: function render() {
|
|
16806
|
+
var _this2 = this;
|
|
16807
|
+
var _this$state5 = this.state,
|
|
16808
|
+
dataSource = _this$state5.dataSource,
|
|
16809
|
+
searchDataSource = _this$state5.searchDataSource,
|
|
16810
|
+
sortDataSource = _this$state5.sortDataSource,
|
|
16811
|
+
visible = _this$state5.visible,
|
|
16812
|
+
onSearchSort = _this$state5.onSearchSort;
|
|
16813
|
+
var seatchDataSource = dataSource.filter(function (item) {
|
|
16814
|
+
var _item$title;
|
|
16815
|
+
return (item === null || item === void 0 ? void 0 : (_item$title = item.title) === null || _item$title === void 0 ? void 0 : _item$title.indexOf(searchDataSource || '')) > -1;
|
|
16816
|
+
});
|
|
16817
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16818
|
+
className: 'sort_table_wrapper'
|
|
16819
|
+
}, visible && /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
|
|
16820
|
+
title: "\u8BBE\u7F6E\u8868\u5934\u5185\u5BB9",
|
|
16821
|
+
wrapClassName: 'sort_table_wrapper',
|
|
16822
|
+
width: 820,
|
|
16823
|
+
visible: visible,
|
|
16824
|
+
onOk: this.handleOk,
|
|
16825
|
+
onCancel: this.handleCancel,
|
|
16826
|
+
footer: [/*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
16827
|
+
key: "back",
|
|
16828
|
+
onClick: this.handleReset
|
|
16829
|
+
}, "\u6062\u590D\u9ED8\u8BA4"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
16830
|
+
key: "submit",
|
|
16831
|
+
onClick: this.handleCancel
|
|
16832
|
+
}, "\u53D6\u6D88"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
16833
|
+
key: "submit",
|
|
16834
|
+
type: "primary",
|
|
16835
|
+
onClick: this.handleOk
|
|
16836
|
+
}, "\u786E\u8BA4")]
|
|
16837
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16838
|
+
className: 'sort_table'
|
|
16839
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16840
|
+
className: 'sort_table_column_wrapper'
|
|
16841
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
16842
|
+
className: 'sort_table_column_count'
|
|
16843
|
+
}, "\u53EF\u9009\u5B57\u6BB5 ", /*#__PURE__*/React__default['default'].createElement("span", null, "\uFF08\u5171", dataSource.length, "\u4E2A\uFF09")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16844
|
+
className: 'sort_table_column'
|
|
16845
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
16846
|
+
prefix: /*#__PURE__*/React__default['default'].createElement(icons.SearchOutlined, {
|
|
16847
|
+
className: "site-form-item-icon"
|
|
16848
|
+
}),
|
|
16849
|
+
placeholder: "\u641C\u7D22",
|
|
16850
|
+
allowClear: true,
|
|
16851
|
+
onChange: this.onSearch,
|
|
16852
|
+
style: {
|
|
16853
|
+
width: 540
|
|
16854
|
+
}
|
|
16855
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", null, !searchDataSource && /*#__PURE__*/React__default['default'].createElement(antd.Checkbox, {
|
|
16856
|
+
checked: !dataSource.some(function (item) {
|
|
16857
|
+
if (item.hidden) return true;
|
|
16858
|
+
return false;
|
|
16859
|
+
}),
|
|
16860
|
+
onClick: function onClick(e) {
|
|
16861
|
+
_this2.setState({
|
|
16862
|
+
isDefaultValue: false,
|
|
16863
|
+
dataSource: _toConsumableArray(dataSource.map(function (item) {
|
|
16864
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16865
|
+
hidden: !e.target.checked
|
|
16866
|
+
});
|
|
16867
|
+
})),
|
|
16868
|
+
sortDataSource: e.target.checked ? [].concat(_toConsumableArray(dataSource.filter(function (item) {
|
|
16869
|
+
return item.fixed === 'left';
|
|
16870
|
+
}).map(function (item) {
|
|
16871
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16872
|
+
hidden: false
|
|
16873
|
+
});
|
|
16874
|
+
})), _toConsumableArray(dataSource.filter(function (item) {
|
|
16875
|
+
return !item.fixed;
|
|
16876
|
+
}).map(function (item) {
|
|
16877
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16878
|
+
hidden: false
|
|
16879
|
+
});
|
|
16880
|
+
})), _toConsumableArray(dataSource.filter(function (item) {
|
|
16881
|
+
return item.fixed === 'right';
|
|
16882
|
+
}).map(function (item) {
|
|
16883
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16884
|
+
hidden: false
|
|
16885
|
+
});
|
|
16886
|
+
}))) : []
|
|
16887
|
+
});
|
|
16888
|
+
}
|
|
16889
|
+
}, "\u5168\u9009")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16890
|
+
className: 'sort_table_column_all'
|
|
16891
|
+
}, searchDataSource ? seatchDataSource.map(function (item) {
|
|
16892
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Checkbox, {
|
|
16893
|
+
checked: !item.hidden,
|
|
16894
|
+
onChange: function onChange(e) {
|
|
16895
|
+
_this2.onChange(e, item.title);
|
|
16896
|
+
}
|
|
16897
|
+
}, item.title);
|
|
16898
|
+
}) : dataSource.filter(function (item) {
|
|
16899
|
+
var _item$title2, _item$title3;
|
|
16900
|
+
return (item === null || item === void 0 ? void 0 : (_item$title2 = item.title) === null || _item$title2 === void 0 ? void 0 : _item$title2.indexOf('人')) === -1 && (item === null || item === void 0 ? void 0 : (_item$title3 = item.title) === null || _item$title3 === void 0 ? void 0 : _item$title3.indexOf('日期')) === -1;
|
|
16901
|
+
}).map(function (item) {
|
|
16902
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Checkbox, {
|
|
16903
|
+
checked: !item.hidden,
|
|
16904
|
+
onChange: function onChange(e) {
|
|
16905
|
+
_this2.onChange(e, item.title);
|
|
16906
|
+
}
|
|
16907
|
+
}, item.title);
|
|
16908
|
+
}), !!seatchDataSource.length && /*#__PURE__*/React__default['default'].createElement("span", {
|
|
16909
|
+
style: {
|
|
16910
|
+
width: '144px'
|
|
16911
|
+
}
|
|
16912
|
+
}), !seatchDataSource.length && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16913
|
+
className: 'sort_table_column_all_empty'
|
|
16914
|
+
}, "\u672A\u67E5\u8BE2\u5230\u7ED3\u679C")), !searchDataSource && /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16915
|
+
className: 'sort_table_column_special'
|
|
16916
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", null, "\u4EBA\u5458\u65F6\u95F4\u5B57\u6BB5")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16917
|
+
className: 'sort_table_column_all'
|
|
16918
|
+
}, _toConsumableArray(dataSource).filter(function (item) {
|
|
16919
|
+
var _item$title4, _item$title5;
|
|
16920
|
+
return (item === null || item === void 0 ? void 0 : (_item$title4 = item.title) === null || _item$title4 === void 0 ? void 0 : _item$title4.indexOf('人')) > -1 || (item === null || item === void 0 ? void 0 : (_item$title5 = item.title) === null || _item$title5 === void 0 ? void 0 : _item$title5.indexOf('日期')) > -1;
|
|
16921
|
+
}).map(function (item) {
|
|
16922
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Checkbox, {
|
|
16923
|
+
checked: !item.hidden,
|
|
16924
|
+
onChange: function onChange(e) {
|
|
16925
|
+
_this2.onChange(e, item.title);
|
|
16926
|
+
}
|
|
16927
|
+
}, item.title);
|
|
16928
|
+
}), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
16929
|
+
style: {
|
|
16930
|
+
width: '144px'
|
|
16931
|
+
}
|
|
16932
|
+
}))))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16933
|
+
className: 'sort_table_content_wrapper'
|
|
16934
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
16935
|
+
className: 'sort_table_content_count'
|
|
16936
|
+
}, "\u5DF2\u9009\u5B57\u6BB5 ", /*#__PURE__*/React__default['default'].createElement("span", null, "\uFF08\u5171", sortDataSource.length, "\u4E2A\uFF09")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16937
|
+
className: 'sort_table_content'
|
|
16938
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
16939
|
+
style: {
|
|
16940
|
+
paddingLeft: '10px'
|
|
16941
|
+
}
|
|
16942
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
16943
|
+
prefix: /*#__PURE__*/React__default['default'].createElement(icons.SearchOutlined, {
|
|
16944
|
+
className: "site-form-item-icon"
|
|
16945
|
+
}),
|
|
16946
|
+
placeholder: "\u641C\u7D22",
|
|
16947
|
+
allowClear: true,
|
|
16948
|
+
onChange: this.onSearchSort,
|
|
16949
|
+
style: {
|
|
16950
|
+
width: 190
|
|
16951
|
+
}
|
|
16952
|
+
})), /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
16953
|
+
pagination: false,
|
|
16954
|
+
showHeader: false,
|
|
16955
|
+
dataSource: onSearchSort ? sortDataSource.filter(function (item) {
|
|
16956
|
+
var _item$title6;
|
|
16957
|
+
return (item === null || item === void 0 ? void 0 : (_item$title6 = item.title) === null || _item$title6 === void 0 ? void 0 : _item$title6.indexOf(onSearchSort)) > -1;
|
|
16958
|
+
}) : sortDataSource,
|
|
16959
|
+
columns: this.columns,
|
|
16960
|
+
rowKey: "key",
|
|
16961
|
+
// rowSelection={rowSelection}
|
|
16962
|
+
components: {
|
|
16963
|
+
body: {
|
|
16964
|
+
wrapper: this.DraggableContainer,
|
|
16965
|
+
row: this.DraggableBodyRow
|
|
16966
|
+
}
|
|
16967
|
+
}
|
|
16968
|
+
}))))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16969
|
+
onClick: this.showModal,
|
|
16970
|
+
style: {
|
|
16971
|
+
fontSize: 14
|
|
16972
|
+
}
|
|
16973
|
+
}, "\u5217\u8BBE\u7F6E"));
|
|
16974
|
+
}
|
|
16975
|
+
}]);
|
|
16976
|
+
return SortableTable;
|
|
16977
|
+
}(React__default['default'].Component);
|
|
16978
|
+
|
|
16979
|
+
var _excluded$d = ["className", "style"];
|
|
16980
|
+
var DragHandle$3 = reactSortableHoc.SortableHandle(function () {
|
|
16981
|
+
return /*#__PURE__*/React__default['default'].createElement("img", {
|
|
16982
|
+
src: drag
|
|
16983
|
+
});
|
|
16984
|
+
});
|
|
16985
|
+
var SortableItem$3 = reactSortableHoc.SortableElement(function (props) {
|
|
16986
|
+
return /*#__PURE__*/React__default['default'].createElement("tr", _objectSpread2({}, props));
|
|
16987
|
+
});
|
|
16988
|
+
var SortableBody$3 = reactSortableHoc.SortableContainer(function (props) {
|
|
16989
|
+
return /*#__PURE__*/React__default['default'].createElement("tbody", _objectSpread2({}, props));
|
|
16990
|
+
});
|
|
16991
|
+
var SearchItemTable = /*#__PURE__*/function (_React$Component) {
|
|
16992
|
+
_inherits(SearchItemTable, _React$Component);
|
|
16993
|
+
var _super = _createSuper(SearchItemTable);
|
|
16994
|
+
function SearchItemTable() {
|
|
16995
|
+
var _this;
|
|
16996
|
+
_classCallCheck(this, SearchItemTable);
|
|
16997
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
16998
|
+
args[_key] = arguments[_key];
|
|
16999
|
+
}
|
|
17000
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
17001
|
+
_this.state = {
|
|
17002
|
+
dataSource: [],
|
|
17003
|
+
columns: [],
|
|
17004
|
+
sortDataSource: [],
|
|
17005
|
+
setVisible: false,
|
|
17006
|
+
searchDataSource: false,
|
|
17007
|
+
onSearchSort: false,
|
|
17008
|
+
isDefaultValue: false,
|
|
17009
|
+
defaultValue: [],
|
|
17010
|
+
bsTableCode: '' //设置table 列的标识
|
|
17011
|
+
};
|
|
17012
|
+
_this.patchUserSearchFieldsConfig = function (config) {
|
|
17013
|
+
var that = _assertThisInitialized(_this);
|
|
17014
|
+
var configvalue = config ? config.map(function (item) {
|
|
17015
|
+
return {
|
|
17016
|
+
name: item.name,
|
|
17017
|
+
hidden: item.hidden
|
|
17018
|
+
};
|
|
17019
|
+
}) : '';
|
|
17020
|
+
axios__default['default']({
|
|
17021
|
+
url: '/user/appConfig/saveQueryCriteria',
|
|
17022
|
+
method: 'POST',
|
|
17023
|
+
data: {
|
|
17024
|
+
code: that.state.bsTableCode,
|
|
17025
|
+
detail: configvalue ? JSON.stringify(configvalue) : ''
|
|
17026
|
+
}
|
|
17027
|
+
}).then(function (res) {
|
|
17028
|
+
var _res$data;
|
|
17029
|
+
if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.status) === '0') {
|
|
17030
|
+
_this.patchConfigToLocalstorage(configvalue);
|
|
17031
|
+
} else {
|
|
17032
|
+
antd.message.error('保存搜索项自定义失败,请稍后尝试');
|
|
17033
|
+
}
|
|
17034
|
+
});
|
|
17035
|
+
};
|
|
17036
|
+
_this.getConfigFromlocalstorage = function () {
|
|
17037
|
+
var config = localStorage.getItem(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION) || '[]';
|
|
17038
|
+
var configArray = JSON.parse(config);
|
|
17039
|
+
var configSetting = configArray.filter(function (item) {
|
|
17040
|
+
return item.code === _this.state.bsTableCode;
|
|
17041
|
+
});
|
|
17042
|
+
if (configSetting.length && configSetting[0].detail) {
|
|
17043
|
+
return JSON.parse(configSetting[0].detail);
|
|
17044
|
+
}
|
|
17045
|
+
return [];
|
|
17046
|
+
};
|
|
17047
|
+
_this.patchConfigToLocalstorage = function (configvalue) {
|
|
17048
|
+
var setShowSearchFields = _this.props.setShowSearchFields;
|
|
17049
|
+
var _this$state = _this.state,
|
|
17050
|
+
sortDataSource = _this$state.sortDataSource,
|
|
17051
|
+
bsTableCode = _this$state.bsTableCode;
|
|
17052
|
+
var config = localStorage.getItem(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION) || '[]';
|
|
17053
|
+
var configArray = JSON.parse(config);
|
|
17054
|
+
var currentSetting = configArray.filter(function (item) {
|
|
17055
|
+
return item.code === bsTableCode;
|
|
17056
|
+
});
|
|
17057
|
+
if (currentSetting.length) {
|
|
17058
|
+
currentSetting[0].detail = JSON.stringify(configvalue);
|
|
17059
|
+
} else {
|
|
17060
|
+
configArray.push({
|
|
17061
|
+
"code": bsTableCode,
|
|
17062
|
+
"detail": JSON.stringify(configvalue)
|
|
17063
|
+
});
|
|
17064
|
+
}
|
|
17065
|
+
localStorage.setItem(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION, JSON.stringify(configArray));
|
|
17066
|
+
_this.setState({
|
|
17067
|
+
visible: false
|
|
17068
|
+
});
|
|
17069
|
+
setShowSearchFields(_toConsumableArray(sortDataSource));
|
|
17070
|
+
};
|
|
17071
|
+
_this.setInitValue = function () {
|
|
17072
|
+
var _this$props = _this.props,
|
|
17073
|
+
_this$props$datasourc = _this$props.datasource,
|
|
17074
|
+
datasource = _this$props$datasourc === void 0 ? [] : _this$props$datasourc,
|
|
17075
|
+
_this$props$showSearc = _this$props.showSearchFields,
|
|
17076
|
+
showSearchFields = _this$props$showSearc === void 0 ? [] : _this$props$showSearc;
|
|
17077
|
+
var config = _this.getConfigFromlocalstorage();
|
|
17078
|
+
_this.setState({
|
|
17079
|
+
isDefaultValue: true,
|
|
17080
|
+
dataSource: datasource.map(function (item) {
|
|
17081
|
+
var innerItem = config.filter(function (inneritem) {
|
|
17082
|
+
var innerKey = Array.isArray(inneritem.name) ? JSON.stringify(inneritem.name) : inneritem.name;
|
|
17083
|
+
var itemKey = Array.isArray(item.name) ? JSON.stringify(item.name) : item.name;
|
|
17084
|
+
return innerKey && innerKey === itemKey;
|
|
17085
|
+
});
|
|
17086
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
17087
|
+
hidden: config.length && !innerItem.length
|
|
17088
|
+
});
|
|
17089
|
+
}),
|
|
17090
|
+
defaultValue: datasource.map(function (item) {
|
|
17091
|
+
var innerItem = config.filter(function (inneritem) {
|
|
17092
|
+
var innerKey = Array.isArray(inneritem.name) ? JSON.stringify(inneritem.name) : inneritem.name;
|
|
17093
|
+
var itemKey = Array.isArray(item.name) ? JSON.stringify(item.name) : item.name;
|
|
17094
|
+
return innerKey && innerKey === itemKey;
|
|
17095
|
+
});
|
|
17096
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
17097
|
+
hidden: config.length && !innerItem.length
|
|
17098
|
+
});
|
|
17099
|
+
}),
|
|
17100
|
+
sortDataSource: _toConsumableArray(showSearchFields)
|
|
17101
|
+
});
|
|
17102
|
+
};
|
|
17103
|
+
_this.columns = [{
|
|
17104
|
+
title: '搜索字段名称',
|
|
17105
|
+
dataIndex: 'label',
|
|
17106
|
+
className: 'drag-visible',
|
|
17107
|
+
width: 100
|
|
17108
|
+
}, {
|
|
17109
|
+
title: '删除',
|
|
17110
|
+
dataIndex: 'title1',
|
|
17111
|
+
render: function render(text, record) {
|
|
17112
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
17113
|
+
onClick: function onClick() {
|
|
17114
|
+
_this.setState({
|
|
17115
|
+
sortDataSource: _this.state.sortDataSource.filter(function (item) {
|
|
17116
|
+
return item.label !== record.label;
|
|
16564
17117
|
}),
|
|
16565
17118
|
isDefaultValue: false,
|
|
16566
17119
|
dataSource: _toConsumableArray(_this.state.dataSource.map(function (item) {
|
|
16567
|
-
if (item.
|
|
17120
|
+
if (item.label === record.label) {
|
|
16568
17121
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16569
17122
|
hidden: true
|
|
16570
17123
|
});
|
|
@@ -16582,7 +17135,7 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
16582
17135
|
dataIndex: 'sort',
|
|
16583
17136
|
className: 'drag-visible',
|
|
16584
17137
|
render: function render() {
|
|
16585
|
-
return /*#__PURE__*/React__default['default'].createElement(DragHandle$
|
|
17138
|
+
return /*#__PURE__*/React__default['default'].createElement(DragHandle$3, null);
|
|
16586
17139
|
}
|
|
16587
17140
|
}];
|
|
16588
17141
|
_this.showModal = function () {
|
|
@@ -16597,14 +17150,10 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
16597
17150
|
isDefaultValue = _this$state2.isDefaultValue,
|
|
16598
17151
|
defaultValue = _this$state2.defaultValue;
|
|
16599
17152
|
if (!sortDataSource.length) {
|
|
16600
|
-
antd.message.warning('
|
|
17153
|
+
antd.message.warning('至少选择一个搜索项!');
|
|
16601
17154
|
return;
|
|
16602
17155
|
}
|
|
16603
|
-
|
|
16604
|
-
// this.patchUserColumnConfig('');
|
|
16605
|
-
// return;
|
|
16606
|
-
// }
|
|
16607
|
-
_this.patchUserColumnConfig(sortDataSource);
|
|
17156
|
+
_this.patchUserSearchFieldsConfig(sortDataSource);
|
|
16608
17157
|
};
|
|
16609
17158
|
_this.handleCancel = function (e) {
|
|
16610
17159
|
console.log(e);
|
|
@@ -16641,19 +17190,13 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
16641
17190
|
return !!el;
|
|
16642
17191
|
});
|
|
16643
17192
|
_this.setState({
|
|
16644
|
-
sortDataSource:
|
|
16645
|
-
return item.fixed === 'left';
|
|
16646
|
-
})), _toConsumableArray(newData.filter(function (item) {
|
|
16647
|
-
return !item.fixed;
|
|
16648
|
-
})), _toConsumableArray(newData.filter(function (item) {
|
|
16649
|
-
return item.fixed === 'right';
|
|
16650
|
-
}))),
|
|
17193
|
+
sortDataSource: _toConsumableArray(newData),
|
|
16651
17194
|
isDefaultValue: false
|
|
16652
17195
|
});
|
|
16653
17196
|
}
|
|
16654
17197
|
};
|
|
16655
17198
|
_this.DraggableContainer = function (props) {
|
|
16656
|
-
return /*#__PURE__*/React__default['default'].createElement(SortableBody$
|
|
17199
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableBody$3, _objectSpread2({
|
|
16657
17200
|
useDragHandle: true,
|
|
16658
17201
|
disableAutoscroll: true,
|
|
16659
17202
|
helperClass: "row-dragging",
|
|
@@ -16663,28 +17206,27 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
16663
17206
|
_this.DraggableBodyRow = function (_ref2) {
|
|
16664
17207
|
var className = _ref2.className,
|
|
16665
17208
|
style = _ref2.style,
|
|
16666
|
-
restProps = _objectWithoutProperties(_ref2, _excluded$
|
|
17209
|
+
restProps = _objectWithoutProperties(_ref2, _excluded$d);
|
|
16667
17210
|
var sortDataSource = _this.state.sortDataSource;
|
|
16668
|
-
// function findIndex base on Table rowKey props and should always be a right array index
|
|
16669
17211
|
var index = sortDataSource.findIndex(function (x) {
|
|
16670
|
-
return x.
|
|
17212
|
+
return x.name === restProps['data-row-key'];
|
|
16671
17213
|
});
|
|
16672
|
-
return /*#__PURE__*/React__default['default'].createElement(SortableItem$
|
|
17214
|
+
return /*#__PURE__*/React__default['default'].createElement(SortableItem$3, _objectSpread2({
|
|
16673
17215
|
index: index
|
|
16674
17216
|
}, restProps));
|
|
16675
17217
|
};
|
|
16676
|
-
_this.onChange = function (e,
|
|
17218
|
+
_this.onChange = function (e, label) {
|
|
16677
17219
|
var _this$state4 = _this.state,
|
|
16678
17220
|
sortDataSource = _this$state4.sortDataSource,
|
|
16679
17221
|
dataSource = _this$state4.dataSource;
|
|
16680
17222
|
if (!e.target.checked) {
|
|
16681
17223
|
_this.setState({
|
|
16682
17224
|
sortDataSource: sortDataSource.filter(function (item) {
|
|
16683
|
-
return item.
|
|
17225
|
+
return item.label !== label;
|
|
16684
17226
|
}),
|
|
16685
17227
|
isDefaultValue: false,
|
|
16686
17228
|
dataSource: _toConsumableArray(dataSource.map(function (item) {
|
|
16687
|
-
if (item.
|
|
17229
|
+
if (item.label === label) {
|
|
16688
17230
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16689
17231
|
hidden: true
|
|
16690
17232
|
});
|
|
@@ -16693,30 +17235,18 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
16693
17235
|
}))
|
|
16694
17236
|
});
|
|
16695
17237
|
} else {
|
|
16696
|
-
var _fixedLeft = [];
|
|
16697
|
-
var _fixedRight = [];
|
|
16698
|
-
var noFixedSortSource = [];
|
|
16699
17238
|
var newSortData = [].concat(_toConsumableArray(sortDataSource), _toConsumableArray(dataSource.filter(function (item) {
|
|
16700
|
-
return item.
|
|
17239
|
+
return item.label === label;
|
|
16701
17240
|
}).map(function (source) {
|
|
16702
17241
|
return _objectSpread2(_objectSpread2({}, source), {}, {
|
|
16703
17242
|
hidden: false
|
|
16704
17243
|
});
|
|
16705
17244
|
})));
|
|
16706
|
-
newSortData.forEach(function (item) {
|
|
16707
|
-
if ((item === null || item === void 0 ? void 0 : item.fixed) === 'left') {
|
|
16708
|
-
_fixedLeft.push(item);
|
|
16709
|
-
} else if ((item === null || item === void 0 ? void 0 : item.fixed) === 'right') {
|
|
16710
|
-
_fixedRight.push(item);
|
|
16711
|
-
} else {
|
|
16712
|
-
noFixedSortSource.push(item);
|
|
16713
|
-
}
|
|
16714
|
-
});
|
|
16715
17245
|
_this.setState({
|
|
16716
|
-
sortDataSource:
|
|
17246
|
+
sortDataSource: _toConsumableArray(newSortData),
|
|
16717
17247
|
isDefaultValue: false,
|
|
16718
17248
|
dataSource: _toConsumableArray(dataSource.map(function (item) {
|
|
16719
|
-
if (item.
|
|
17249
|
+
if (item.label === label) {
|
|
16720
17250
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16721
17251
|
hidden: false
|
|
16722
17252
|
});
|
|
@@ -16741,53 +17271,39 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
16741
17271
|
};
|
|
16742
17272
|
return _this;
|
|
16743
17273
|
}
|
|
16744
|
-
_createClass(
|
|
17274
|
+
_createClass(SearchItemTable, [{
|
|
16745
17275
|
key: "componentDidMount",
|
|
16746
17276
|
value: function componentDidMount() {
|
|
16747
17277
|
var _this$props2 = this.props,
|
|
16748
17278
|
datasource = _this$props2.datasource,
|
|
16749
|
-
|
|
17279
|
+
showSearchFields = _this$props2.showSearchFields,
|
|
16750
17280
|
bsTableCode = _this$props2.bsTableCode;
|
|
16751
17281
|
var config = this.getConfigFromlocalstorage();
|
|
16752
17282
|
this.setState({
|
|
16753
17283
|
dataSource: datasource.map(function (item) {
|
|
16754
|
-
var _innerItem$3;
|
|
16755
17284
|
var innerItem = config.filter(function (inneritem) {
|
|
16756
|
-
var innerKey = Array.isArray(inneritem.
|
|
16757
|
-
var itemKey = Array.isArray(item.
|
|
17285
|
+
var innerKey = Array.isArray(inneritem.name) ? JSON.stringify(inneritem.name) : inneritem.name;
|
|
17286
|
+
var itemKey = Array.isArray(item.name) ? JSON.stringify(item.name) : item.name;
|
|
16758
17287
|
return innerKey && innerKey === itemKey;
|
|
16759
17288
|
});
|
|
16760
17289
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16761
|
-
|
|
16762
|
-
width: ((_innerItem$3 = innerItem[0]) === null || _innerItem$3 === void 0 ? void 0 : _innerItem$3.width) || item.width,
|
|
16763
|
-
hidden: config.length ? !innerItem.length : item.hidden
|
|
17290
|
+
hidden: config.length && !innerItem.length
|
|
16764
17291
|
});
|
|
16765
17292
|
}),
|
|
16766
17293
|
defaultValue: datasource.map(function (item) {
|
|
16767
|
-
var _innerItem$4;
|
|
16768
17294
|
var innerItem = config.filter(function (inneritem) {
|
|
16769
|
-
var innerKey = Array.isArray(inneritem.
|
|
16770
|
-
var itemKey = Array.isArray(item.
|
|
17295
|
+
var innerKey = Array.isArray(inneritem.name) ? JSON.stringify(inneritem.name) : inneritem.name;
|
|
17296
|
+
var itemKey = Array.isArray(item.name) ? JSON.stringify(item.name) : item.name;
|
|
16771
17297
|
return innerKey && innerKey === itemKey;
|
|
16772
17298
|
});
|
|
16773
17299
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16774
|
-
|
|
16775
|
-
width: ((_innerItem$4 = innerItem[0]) === null || _innerItem$4 === void 0 ? void 0 : _innerItem$4.width) || item.width,
|
|
16776
|
-
hidden: config.length ? !innerItem.length : item.hidden
|
|
17300
|
+
hidden: config.length && !innerItem.length
|
|
16777
17301
|
});
|
|
16778
17302
|
}),
|
|
16779
17303
|
sortDataSource: datasource.filter(function (item) {
|
|
16780
17304
|
return !item.hidden;
|
|
16781
17305
|
}).map(function (item) {
|
|
16782
|
-
|
|
16783
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16784
|
-
key: item.key || item.dataIndex,
|
|
16785
|
-
width: ((_showColumn$filter$ = showColumn.filter(function (inneritem) {
|
|
16786
|
-
var innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : inneritem.key || inneritem.dataIndex;
|
|
16787
|
-
var itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : item.key || item.dataIndex;
|
|
16788
|
-
return innerKey && innerKey === itemKey;
|
|
16789
|
-
})[0]) === null || _showColumn$filter$ === void 0 ? void 0 : _showColumn$filter$.width) || item.width
|
|
16790
|
-
});
|
|
17306
|
+
return _objectSpread2({}, item);
|
|
16791
17307
|
}),
|
|
16792
17308
|
bsTableCode: bsTableCode
|
|
16793
17309
|
});
|
|
@@ -16797,19 +17313,20 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
16797
17313
|
value: function render() {
|
|
16798
17314
|
var _this2 = this;
|
|
16799
17315
|
var _this$state5 = this.state,
|
|
16800
|
-
|
|
17316
|
+
_this$state5$dataSour = _this$state5.dataSource,
|
|
17317
|
+
dataSource = _this$state5$dataSour === void 0 ? [] : _this$state5$dataSour,
|
|
16801
17318
|
searchDataSource = _this$state5.searchDataSource,
|
|
16802
17319
|
sortDataSource = _this$state5.sortDataSource,
|
|
16803
17320
|
visible = _this$state5.visible,
|
|
16804
17321
|
onSearchSort = _this$state5.onSearchSort;
|
|
16805
|
-
var
|
|
16806
|
-
var _item$
|
|
16807
|
-
return (item === null || item === void 0 ? void 0 : (_item$
|
|
17322
|
+
var newSearchSource = dataSource.filter(function (item) {
|
|
17323
|
+
var _item$label;
|
|
17324
|
+
return (item === null || item === void 0 ? void 0 : (_item$label = item.label) === null || _item$label === void 0 ? void 0 : _item$label.indexOf(searchDataSource || '')) > -1;
|
|
16808
17325
|
});
|
|
16809
17326
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16810
17327
|
className: 'sort_table_wrapper'
|
|
16811
17328
|
}, visible && /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
|
|
16812
|
-
title: "\u8BBE\u7F6E\
|
|
17329
|
+
title: "\u8BBE\u7F6E\u641C\u7D22\u9879\u5185\u5BB9",
|
|
16813
17330
|
wrapClassName: 'sort_table_wrapper',
|
|
16814
17331
|
width: 820,
|
|
16815
17332
|
visible: visible,
|
|
@@ -16857,71 +17374,36 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
16857
17374
|
hidden: !e.target.checked
|
|
16858
17375
|
});
|
|
16859
17376
|
})),
|
|
16860
|
-
sortDataSource: e.target.checked ?
|
|
16861
|
-
return item.fixed === 'left';
|
|
16862
|
-
}).map(function (item) {
|
|
16863
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16864
|
-
hidden: false
|
|
16865
|
-
});
|
|
16866
|
-
})), _toConsumableArray(dataSource.filter(function (item) {
|
|
16867
|
-
return !item.fixed;
|
|
16868
|
-
}).map(function (item) {
|
|
16869
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16870
|
-
hidden: false
|
|
16871
|
-
});
|
|
16872
|
-
})), _toConsumableArray(dataSource.filter(function (item) {
|
|
16873
|
-
return item.fixed === 'right';
|
|
16874
|
-
}).map(function (item) {
|
|
17377
|
+
sortDataSource: e.target.checked ? _toConsumableArray(dataSource.map(function (item) {
|
|
16875
17378
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16876
17379
|
hidden: false
|
|
16877
17380
|
});
|
|
16878
|
-
}))
|
|
17381
|
+
})) : []
|
|
16879
17382
|
});
|
|
16880
17383
|
}
|
|
16881
17384
|
}, "\u5168\u9009")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16882
17385
|
className: 'sort_table_column_all'
|
|
16883
|
-
}, searchDataSource ?
|
|
17386
|
+
}, searchDataSource ? newSearchSource.map(function (item) {
|
|
16884
17387
|
return /*#__PURE__*/React__default['default'].createElement(antd.Checkbox, {
|
|
16885
17388
|
checked: !item.hidden,
|
|
16886
17389
|
onChange: function onChange(e) {
|
|
16887
|
-
_this2.onChange(e, item.
|
|
17390
|
+
_this2.onChange(e, item.label);
|
|
16888
17391
|
}
|
|
16889
|
-
}, item.
|
|
16890
|
-
}) : dataSource.
|
|
16891
|
-
var _item$title2, _item$title3;
|
|
16892
|
-
return (item === null || item === void 0 ? void 0 : (_item$title2 = item.title) === null || _item$title2 === void 0 ? void 0 : _item$title2.indexOf('人')) === -1 && (item === null || item === void 0 ? void 0 : (_item$title3 = item.title) === null || _item$title3 === void 0 ? void 0 : _item$title3.indexOf('日期')) === -1;
|
|
16893
|
-
}).map(function (item) {
|
|
17392
|
+
}, item.label);
|
|
17393
|
+
}) : dataSource.map(function (item) {
|
|
16894
17394
|
return /*#__PURE__*/React__default['default'].createElement(antd.Checkbox, {
|
|
16895
17395
|
checked: !item.hidden,
|
|
16896
17396
|
onChange: function onChange(e) {
|
|
16897
|
-
_this2.onChange(e, item.
|
|
17397
|
+
_this2.onChange(e, item.label);
|
|
16898
17398
|
}
|
|
16899
|
-
}, item.
|
|
16900
|
-
}), !!
|
|
17399
|
+
}, item.label);
|
|
17400
|
+
}), !!newSearchSource.length && /*#__PURE__*/React__default['default'].createElement("span", {
|
|
16901
17401
|
style: {
|
|
16902
17402
|
width: '144px'
|
|
16903
17403
|
}
|
|
16904
|
-
}), !
|
|
17404
|
+
}), !newSearchSource.length && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16905
17405
|
className: 'sort_table_column_all_empty'
|
|
16906
|
-
}, "\u672A\u67E5\u8BE2\u5230\u7ED3\u679C")),
|
|
16907
|
-
className: 'sort_table_column_special'
|
|
16908
|
-
}, /*#__PURE__*/React__default['default'].createElement("span", null, "\u4EBA\u5458\u65F6\u95F4\u5B57\u6BB5")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16909
|
-
className: 'sort_table_column_all'
|
|
16910
|
-
}, _toConsumableArray(dataSource).filter(function (item) {
|
|
16911
|
-
var _item$title4, _item$title5;
|
|
16912
|
-
return (item === null || item === void 0 ? void 0 : (_item$title4 = item.title) === null || _item$title4 === void 0 ? void 0 : _item$title4.indexOf('人')) > -1 || (item === null || item === void 0 ? void 0 : (_item$title5 = item.title) === null || _item$title5 === void 0 ? void 0 : _item$title5.indexOf('日期')) > -1;
|
|
16913
|
-
}).map(function (item) {
|
|
16914
|
-
return /*#__PURE__*/React__default['default'].createElement(antd.Checkbox, {
|
|
16915
|
-
checked: !item.hidden,
|
|
16916
|
-
onChange: function onChange(e) {
|
|
16917
|
-
_this2.onChange(e, item.title);
|
|
16918
|
-
}
|
|
16919
|
-
}, item.title);
|
|
16920
|
-
}), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
16921
|
-
style: {
|
|
16922
|
-
width: '144px'
|
|
16923
|
-
}
|
|
16924
|
-
}))))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
17406
|
+
}, "\u672A\u67E5\u8BE2\u5230\u7ED3\u679C")))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16925
17407
|
className: 'sort_table_content_wrapper'
|
|
16926
17408
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
16927
17409
|
className: 'sort_table_content_count'
|
|
@@ -16945,34 +17427,34 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
16945
17427
|
pagination: false,
|
|
16946
17428
|
showHeader: false,
|
|
16947
17429
|
dataSource: onSearchSort ? sortDataSource.filter(function (item) {
|
|
16948
|
-
var _item$
|
|
16949
|
-
return (item === null || item === void 0 ? void 0 : (_item$
|
|
17430
|
+
var _item$label2;
|
|
17431
|
+
return (item === null || item === void 0 ? void 0 : (_item$label2 = item.label) === null || _item$label2 === void 0 ? void 0 : _item$label2.indexOf(onSearchSort)) > -1;
|
|
16950
17432
|
}) : sortDataSource,
|
|
16951
17433
|
columns: this.columns,
|
|
16952
|
-
rowKey: "
|
|
16953
|
-
// rowSelection={rowSelection}
|
|
17434
|
+
rowKey: "name",
|
|
16954
17435
|
components: {
|
|
16955
17436
|
body: {
|
|
16956
17437
|
wrapper: this.DraggableContainer,
|
|
16957
17438
|
row: this.DraggableBodyRow
|
|
16958
17439
|
}
|
|
16959
17440
|
}
|
|
16960
|
-
}))))), /*#__PURE__*/React__default['default'].createElement("
|
|
16961
|
-
width: 32,
|
|
17441
|
+
}))))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
16962
17442
|
onClick: this.showModal,
|
|
16963
|
-
|
|
16964
|
-
|
|
17443
|
+
style: {
|
|
17444
|
+
fontSize: 14
|
|
17445
|
+
}
|
|
17446
|
+
}, "\u641C\u7D22\u9879\u8BBE\u7F6E"));
|
|
16965
17447
|
}
|
|
16966
17448
|
}]);
|
|
16967
|
-
return
|
|
17449
|
+
return SearchItemTable;
|
|
16968
17450
|
}(React__default['default'].Component);
|
|
16969
17451
|
|
|
16970
|
-
var _excluded$
|
|
17452
|
+
var _excluded$e = ["onResize", "width"];
|
|
16971
17453
|
var MemoQueryTable = /*#__PURE__*/React__default['default'].memo(bssula.QueryTable);
|
|
16972
17454
|
var ResizeableTitle$2 = function ResizeableTitle(props) {
|
|
16973
17455
|
var onResize = props.onResize,
|
|
16974
17456
|
width = props.width,
|
|
16975
|
-
restProps = _objectWithoutProperties(props, _excluded$
|
|
17457
|
+
restProps = _objectWithoutProperties(props, _excluded$e);
|
|
16976
17458
|
if (!width) {
|
|
16977
17459
|
return /*#__PURE__*/React__default['default'].createElement("th", _objectSpread2({}, restProps));
|
|
16978
17460
|
}
|
|
@@ -17017,14 +17499,18 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17017
17499
|
var _useState11 = React.useState([]),
|
|
17018
17500
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
17019
17501
|
showColumn = _useState12[0],
|
|
17020
|
-
setShowColumns = _useState12[1];
|
|
17502
|
+
setShowColumns = _useState12[1]; // 列字段
|
|
17503
|
+
var _useState13 = React.useState([]),
|
|
17504
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
17505
|
+
showSearchFields = _useState14[0],
|
|
17506
|
+
setShowSearchFields = _useState14[1]; //搜索项字段
|
|
17021
17507
|
var _props$isPage = props.isPage,
|
|
17022
17508
|
pagination = props.pagination,
|
|
17023
17509
|
tableCode = props.tableCode;
|
|
17024
|
-
var
|
|
17025
|
-
|
|
17026
|
-
height =
|
|
17027
|
-
setHeight =
|
|
17510
|
+
var _useState15 = React.useState('100vh'),
|
|
17511
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
17512
|
+
height = _useState16[0],
|
|
17513
|
+
setHeight = _useState16[1];
|
|
17028
17514
|
var sortTableRef = React.useRef(null);
|
|
17029
17515
|
var bsTableCode = tableCode || window.location.hash; //设置列字段的唯一标识
|
|
17030
17516
|
// 获取table高度
|
|
@@ -17044,8 +17530,8 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17044
17530
|
if (isFull == undefined) isFull = false;
|
|
17045
17531
|
return isFull;
|
|
17046
17532
|
}
|
|
17047
|
-
var getConfigFromlocalstorage = function getConfigFromlocalstorage() {
|
|
17048
|
-
var config = localStorage.getItem(
|
|
17533
|
+
var getConfigFromlocalstorage = function getConfigFromlocalstorage(type) {
|
|
17534
|
+
var config = localStorage.getItem(type) || '[]';
|
|
17049
17535
|
var configArray = JSON.parse(config);
|
|
17050
17536
|
var configSetting = configArray.filter(function (item) {
|
|
17051
17537
|
return item.code === bsTableCode;
|
|
@@ -17101,7 +17587,7 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17101
17587
|
columns: _toConsumableArray(props.columns)
|
|
17102
17588
|
}));
|
|
17103
17589
|
var columns = props.columns;
|
|
17104
|
-
var columnConfig = getConfigFromlocalstorage();
|
|
17590
|
+
var columnConfig = getConfigFromlocalstorage(ENUM.BROWSER_CACHE.COLUMN_CONDITION);
|
|
17105
17591
|
var showColumns = columnConfig.length ? columnConfig.map(function (item) {
|
|
17106
17592
|
var inner = columns.filter(function (inneritem) {
|
|
17107
17593
|
var innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : inneritem.key || inneritem.dataIndex;
|
|
@@ -17125,10 +17611,26 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17125
17611
|
});
|
|
17126
17612
|
setShowColumns(_toConsumableArray(showColumns));
|
|
17127
17613
|
};
|
|
17614
|
+
var setInitialSearchFieldsInfo = function setInitialSearchFieldsInfo() {
|
|
17615
|
+
//获取搜索字段的缓存配置
|
|
17616
|
+
var _props$fields = props.fields,
|
|
17617
|
+
fields = _props$fields === void 0 ? [] : _props$fields;
|
|
17618
|
+
var searchFieldsConfig = getConfigFromlocalstorage(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION);
|
|
17619
|
+
var showSearchFields = searchFieldsConfig.length ? searchFieldsConfig.map(function (item) {
|
|
17620
|
+
var inner = fields.filter(function (inneritem) {
|
|
17621
|
+
var innerKey = Array.isArray(inneritem.name) ? JSON.stringify(inneritem.name) : inneritem.name;
|
|
17622
|
+
var itemKey = Array.isArray(item.name) ? JSON.stringify(item.name) : item.name;
|
|
17623
|
+
return innerKey && innerKey === itemKey;
|
|
17624
|
+
})[0];
|
|
17625
|
+
return _objectSpread2(_objectSpread2({}, inner), item);
|
|
17626
|
+
}) : fields;
|
|
17627
|
+
setShowSearchFields(_toConsumableArray(showSearchFields));
|
|
17628
|
+
};
|
|
17128
17629
|
//组件初始挂载
|
|
17129
17630
|
React.useEffect(function () {
|
|
17130
17631
|
getTableHeight();
|
|
17131
17632
|
setInitialTableInfo();
|
|
17633
|
+
setInitialSearchFieldsInfo();
|
|
17132
17634
|
window.addEventListener('resize', function (e) {
|
|
17133
17635
|
watchWinResize();
|
|
17134
17636
|
});
|
|
@@ -17145,6 +17647,17 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17145
17647
|
JSON.stringify(newKeys) !== JSON.stringify(oldKeys) && setInitialTableInfo();
|
|
17146
17648
|
}
|
|
17147
17649
|
}, [props === null || props === void 0 ? void 0 : props.columns]);
|
|
17650
|
+
React.useEffect(function () {
|
|
17651
|
+
if ((props === null || props === void 0 ? void 0 : props.fields) && (value === null || value === void 0 ? void 0 : value.fields)) {
|
|
17652
|
+
var newKeys = props.fields.map(function (d) {
|
|
17653
|
+
return Array.isArray(d.name) ? JSON.stringify(d.name) : d.name;
|
|
17654
|
+
});
|
|
17655
|
+
var oldKeys = value.fields.map(function (d) {
|
|
17656
|
+
return Array.isArray(d.name) ? JSON.stringify(d.name) : d.name;
|
|
17657
|
+
});
|
|
17658
|
+
JSON.stringify(newKeys) !== JSON.stringify(oldKeys) && setInitialSearchFieldsInfo();
|
|
17659
|
+
}
|
|
17660
|
+
}, [props === null || props === void 0 ? void 0 : props.fields]);
|
|
17148
17661
|
React.useEffect(function () {
|
|
17149
17662
|
setInitialTableInfo();
|
|
17150
17663
|
}, [props === null || props === void 0 ? void 0 : props.refreshColumns]);
|
|
@@ -17220,39 +17733,33 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17220
17733
|
};
|
|
17221
17734
|
var ShowFullScreen = function ShowFullScreen() {
|
|
17222
17735
|
var itemPath = props.itemPath;
|
|
17223
|
-
|
|
17224
|
-
|
|
17225
|
-
|
|
17226
|
-
|
|
17227
|
-
|
|
17228
|
-
|
|
17229
|
-
|
|
17230
|
-
|
|
17231
|
-
|
|
17232
|
-
|
|
17233
|
-
|
|
17234
|
-
|
|
17235
|
-
|
|
17236
|
-
|
|
17237
|
-
|
|
17238
|
-
|
|
17239
|
-
|
|
17240
|
-
|
|
17241
|
-
var fullScreenEle = contentEle.requestFullscreen || contentEle.mozRequestFullScreen || contentEle.webkitRequestFullScreen || contentEle.msRequestFullscreen;
|
|
17242
|
-
if (fullScreenEle) {
|
|
17243
|
-
fullScreenEle.call(contentEle);
|
|
17244
|
-
setIsFnllScreen(true);
|
|
17245
|
-
// getTableHeight(true);
|
|
17246
|
-
return;
|
|
17736
|
+
if (window.top != window) {
|
|
17737
|
+
window.parent.postMessage({
|
|
17738
|
+
type: 'screenChange',
|
|
17739
|
+
id: itemPath
|
|
17740
|
+
}, '*');
|
|
17741
|
+
setIsFnllScreen(!isFullScreen);
|
|
17742
|
+
} else {
|
|
17743
|
+
var _isFullScreen = document.fullScreen || document.webkitIsFullScreen || document.mozFullScreen;
|
|
17744
|
+
var contentEle = document.querySelector("body");
|
|
17745
|
+
// addTabsNavStyle(isFullScreen);
|
|
17746
|
+
if (contentEle && !_isFullScreen) {
|
|
17747
|
+
var fullScreenEle = contentEle.requestFullscreen || contentEle.mozRequestFullScreen || contentEle.webkitRequestFullScreen || contentEle.msRequestFullscreen;
|
|
17748
|
+
if (fullScreenEle) {
|
|
17749
|
+
fullScreenEle.call(contentEle);
|
|
17750
|
+
setIsFnllScreen(true);
|
|
17751
|
+
// getTableHeight(true);
|
|
17752
|
+
return;
|
|
17753
|
+
}
|
|
17247
17754
|
}
|
|
17248
|
-
|
|
17249
|
-
|
|
17250
|
-
|
|
17251
|
-
|
|
17252
|
-
|
|
17253
|
-
|
|
17254
|
-
|
|
17255
|
-
|
|
17755
|
+
if (document && _isFullScreen) {
|
|
17756
|
+
var exitFullScreen = document.exitFullscreen || document.mozCancelFullScreen || document.webkitCancelFullScreen || document.msExitFullscreen;
|
|
17757
|
+
if (exitFullScreen) {
|
|
17758
|
+
exitFullScreen.call(document);
|
|
17759
|
+
setIsFnllScreen(false);
|
|
17760
|
+
// getTableHeight();
|
|
17761
|
+
return;
|
|
17762
|
+
}
|
|
17256
17763
|
}
|
|
17257
17764
|
}
|
|
17258
17765
|
};
|
|
@@ -17262,16 +17769,28 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17262
17769
|
actionsRender = [].concat(_toConsumableArray(actionsRender), [{
|
|
17263
17770
|
type: 'text',
|
|
17264
17771
|
props: {
|
|
17265
|
-
children: /*#__PURE__*/React__default['default'].createElement(
|
|
17266
|
-
|
|
17772
|
+
children: /*#__PURE__*/React__default['default'].createElement("span", {
|
|
17773
|
+
className: "ant-dropdown-link"
|
|
17774
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Dropdown, {
|
|
17775
|
+
overlay: /*#__PURE__*/React__default['default'].createElement(antd.Menu, null, /*#__PURE__*/React__default['default'].createElement(antd.Menu.Item, null, /*#__PURE__*/React__default['default'].createElement(SortableTable$1, {
|
|
17776
|
+
ref: sortTableRef,
|
|
17777
|
+
setShowColumns: setShowColumns,
|
|
17778
|
+
showColumn: showColumn,
|
|
17779
|
+
datasource: (value === null || value === void 0 ? void 0 : value.columns) || [],
|
|
17780
|
+
bsTableCode: bsTableCode
|
|
17781
|
+
})), /*#__PURE__*/React__default['default'].createElement(antd.Menu.Item, null, /*#__PURE__*/React__default['default'].createElement(SearchItemTable, {
|
|
17782
|
+
ref: sortTableRef,
|
|
17783
|
+
setShowSearchFields: setShowSearchFields,
|
|
17784
|
+
showSearchFields: showSearchFields,
|
|
17785
|
+
datasource: (value === null || value === void 0 ? void 0 : value.fields) || [],
|
|
17786
|
+
bsTableCode: bsTableCode
|
|
17787
|
+
}))),
|
|
17788
|
+
placement: "bottom"
|
|
17267
17789
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
17268
17790
|
className: "ant-dropdown-link"
|
|
17269
|
-
}, /*#__PURE__*/React__default['default'].createElement(
|
|
17270
|
-
|
|
17271
|
-
|
|
17272
|
-
showColumn: showColumn,
|
|
17273
|
-
datasource: (value === null || value === void 0 ? void 0 : value.columns) || [],
|
|
17274
|
-
bsTableCode: bsTableCode
|
|
17791
|
+
}, /*#__PURE__*/React__default['default'].createElement("img", {
|
|
17792
|
+
width: 32,
|
|
17793
|
+
src: shezhi
|
|
17275
17794
|
}))))
|
|
17276
17795
|
}
|
|
17277
17796
|
}, {
|
|
@@ -17355,6 +17874,7 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17355
17874
|
}, handleTimeValue()), {}, {
|
|
17356
17875
|
tableProps: setTableProps(),
|
|
17357
17876
|
columns: _toConsumableArray(showColumn),
|
|
17877
|
+
fields: _toConsumableArray(showSearchFields),
|
|
17358
17878
|
ref: props.forwardedRef || refs,
|
|
17359
17879
|
isFullScreen: isFullScreen
|
|
17360
17880
|
});
|
|
@@ -17377,7 +17897,7 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17377
17897
|
summary: props.summary,
|
|
17378
17898
|
statusMapping: props.statusMapping
|
|
17379
17899
|
});
|
|
17380
|
-
}, [value, checkedList, showColumn, props.statusMapping]);
|
|
17900
|
+
}, [value, checkedList, showColumn, props.statusMapping, showSearchFields]);
|
|
17381
17901
|
return /*#__PURE__*/React__default['default'].createElement(MemoQueryTable, _objectSpread2({}, memoConfig));
|
|
17382
17902
|
});
|
|
17383
17903
|
|
|
@@ -17525,13 +18045,14 @@ function handleUserPhone() {
|
|
|
17525
18045
|
return enStr;
|
|
17526
18046
|
}
|
|
17527
18047
|
var setLoginOutPath = function setLoginOutPath() {
|
|
17528
|
-
if (window.
|
|
17529
|
-
var _window$$wujie;
|
|
17530
|
-
(_window$$wujie = window.$wujie) === null || _window$$wujie === void 0 ? void 0 : _window$$wujie.props.goToLogin();
|
|
17531
|
-
} else {
|
|
18048
|
+
if (window.top == window) {
|
|
17532
18049
|
umi.history.push({
|
|
17533
18050
|
pathname: '/user/login'
|
|
17534
18051
|
});
|
|
18052
|
+
} else {
|
|
18053
|
+
window.parent.postMessage({
|
|
18054
|
+
type: 'go2Login'
|
|
18055
|
+
}, '*');
|
|
17535
18056
|
}
|
|
17536
18057
|
};
|
|
17537
18058
|
var getBreadcrumbNameMap = function getBreadcrumbNameMap(menuData) {
|
|
@@ -19449,7 +19970,7 @@ var CustomerMenuHeader = function CustomerMenuHeader(_ref) {
|
|
|
19449
19970
|
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";
|
|
19450
19971
|
styleInject(css_248z$m);
|
|
19451
19972
|
|
|
19452
|
-
var _excluded$
|
|
19973
|
+
var _excluded$f = ["route"];
|
|
19453
19974
|
var TabPane = antd.Tabs.TabPane;
|
|
19454
19975
|
var UN_LISTTEN_DRP;
|
|
19455
19976
|
var routerArray = [];
|
|
@@ -20063,8 +20584,8 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
20063
20584
|
_createClass(BasicLayout, [{
|
|
20064
20585
|
key: "componentDidMount",
|
|
20065
20586
|
value: function componentDidMount() {
|
|
20066
|
-
var
|
|
20067
|
-
|
|
20587
|
+
var _this2 = this,
|
|
20588
|
+
_localStorage$getItem;
|
|
20068
20589
|
var _this$props = this.props,
|
|
20069
20590
|
history = _this$props.history,
|
|
20070
20591
|
location = _this$props.location,
|
|
@@ -20072,42 +20593,27 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
20072
20593
|
pathToRegexp = _this$props.pathToRegexp;
|
|
20073
20594
|
var istParent = 0;
|
|
20074
20595
|
var self = this;
|
|
20075
|
-
|
|
20076
|
-
|
|
20077
|
-
|
|
20078
|
-
|
|
20079
|
-
|
|
20080
|
-
|
|
20081
|
-
|
|
20082
|
-
|
|
20083
|
-
|
|
20084
|
-
|
|
20085
|
-
|
|
20086
|
-
|
|
20087
|
-
// const info = e.data;
|
|
20088
|
-
// if (info.type === 'remove') {
|
|
20089
|
-
// self.tabActions['remove'](info.key.replace(/^\/\w+\//, '/'));
|
|
20090
|
-
// }
|
|
20091
|
-
// }
|
|
20092
|
-
// });
|
|
20093
|
-
(_window$$wujie = window.$wujie) === null || _window$$wujie === void 0 ? void 0 : _window$$wujie.bus.$on("main-route-change", function (appname, info) {
|
|
20094
|
-
console.log('$on main route change ----------------------------', appname, info);
|
|
20095
|
-
if (appname === itemPath) {
|
|
20096
|
-
istParent = 1;
|
|
20097
|
-
if (info.type === 'main') {
|
|
20098
|
-
var newPath = encodeUrlQuery(info.path);
|
|
20099
|
-
history.push(newPath);
|
|
20100
|
-
}
|
|
20596
|
+
window.top != window && window.addEventListener('message', function (e) {
|
|
20597
|
+
istParent = 1;
|
|
20598
|
+
if (localStorage.getItem(ENUM.BROWSER_CACHE.CHILD_APP_BACK)) {
|
|
20599
|
+
localStorage.removeItem(ENUM.BROWSER_CACHE.CHILD_APP_BACK);
|
|
20600
|
+
} else {
|
|
20601
|
+
localStorage.setItem('isTabChange', true);
|
|
20602
|
+
}
|
|
20603
|
+
if (typeof e.data === 'string') {
|
|
20604
|
+
var newKey = encodeUrlQuery(e.data.replace(/^\/\w+\//, '/'));
|
|
20605
|
+
history.push(newKey);
|
|
20606
|
+
} else {
|
|
20607
|
+
var info = e.data;
|
|
20101
20608
|
if (info.type === 'remove') {
|
|
20102
|
-
self.tabActions['remove'](info.
|
|
20609
|
+
self.tabActions['remove'](info.key.replace(/^\/\w+\//, '/'));
|
|
20103
20610
|
}
|
|
20104
20611
|
}
|
|
20105
20612
|
});
|
|
20106
20613
|
UN_LISTTEN_DRP = history.listen(function (route) {
|
|
20107
|
-
|
|
20108
|
-
|
|
20109
|
-
|
|
20110
|
-
if (route.pathname.startsWith("/".concat(itemPath, "/"))) return;
|
|
20614
|
+
if (window.__POWERED_BY_QIANKUN__) {
|
|
20615
|
+
if (window.location.href.indexOf("/".concat(itemPath)) === -1) return;
|
|
20616
|
+
}
|
|
20111
20617
|
var _this2$state = _this2.state,
|
|
20112
20618
|
listenRouterState = _this2$state.listenRouterState,
|
|
20113
20619
|
listenRouterKey = _this2$state.listenRouterKey,
|
|
@@ -20126,10 +20632,8 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
20126
20632
|
currentKey = decodeURIComponent(route.pathname + _this2.parseQueryString(route.search));
|
|
20127
20633
|
}
|
|
20128
20634
|
if (!istParent) {
|
|
20129
|
-
var _window$$wujie2;
|
|
20130
20635
|
if (route.pathname === '/') return;
|
|
20131
|
-
(
|
|
20132
|
-
// window.parent.postMessage(`/parent/${itemPath}${currentKey}`, '*');
|
|
20636
|
+
window.parent.postMessage("/parent/".concat(itemPath).concat(currentKey), '*');
|
|
20133
20637
|
}
|
|
20134
20638
|
// 防止出错
|
|
20135
20639
|
if (listenRouterKey.length !== listenRouterState.length) {
|
|
@@ -20171,24 +20675,28 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
20171
20675
|
lastTwoRouterArray.shift();
|
|
20172
20676
|
if (!localStorage.getItem('isTabChange') && !localStorage.getItem('isMenuClick')) {
|
|
20173
20677
|
if (lastTwoRouterArray[0] && typeof lastTwoRouterArray[0] === 'string') {
|
|
20174
|
-
var _route$state;
|
|
20175
20678
|
var needRemoveKeyArray = hideMenuArray.filter(function (itemRoute) {
|
|
20176
20679
|
return pathToRegexp(itemRoute.path || '').test(lastTwoRouterArray[0]);
|
|
20177
20680
|
});
|
|
20178
20681
|
// lastTwoRouterArray[0] != lastTwoRouterArray[1] 该判断条件用于判断是否是tab删除操作,如果是tab页删除操作,删除的是不是最后一个打开的tab页,执行history.push会导致错误的将最后打开的那个tab页也删除掉
|
|
20179
|
-
if (needRemoveKeyArray.length && lastTwoRouterArray[0] != lastTwoRouterArray[1]
|
|
20180
|
-
|
|
20181
|
-
var
|
|
20182
|
-
|
|
20183
|
-
|
|
20184
|
-
|
|
20185
|
-
|
|
20186
|
-
|
|
20187
|
-
|
|
20188
|
-
|
|
20189
|
-
|
|
20190
|
-
|
|
20191
|
-
|
|
20682
|
+
if (needRemoveKeyArray.length && lastTwoRouterArray[0] != lastTwoRouterArray[1]) {
|
|
20683
|
+
if ((!(lastTwoRouterArray[0].indexOf('/order/mainOrder/supplement') >= 0) || !pathToRegexp('/order/mainOrder/:parmode/separateOrder/:id').test(lastTwoRouterArray[1])) && (!pathToRegexp('/order/mainOrder/:parmode/separateOrder/:id').test(lastTwoRouterArray[0]) || !(lastTwoRouterArray[1].indexOf('order/mainOrder/separateOrder/') >= 0))) {
|
|
20684
|
+
var _route$state;
|
|
20685
|
+
if (!((_route$state = route.state) === null || _route$state === void 0 ? void 0 : _route$state.thisHideInMenuDoNotClose)) {
|
|
20686
|
+
newListenRouterState = newListenRouterState.filter(function (item) {
|
|
20687
|
+
var _ref3 = item.key ? item.key.split('?') : [],
|
|
20688
|
+
_ref4 = _slicedToArray(_ref3, 1),
|
|
20689
|
+
pathname = _ref4[0];
|
|
20690
|
+
return pathname && pathname !== lastTwoRouterArray[0];
|
|
20691
|
+
});
|
|
20692
|
+
newListenRouterKey = newListenRouterKey.filter(function (item) {
|
|
20693
|
+
var _ref5 = item ? item.split('?') : [],
|
|
20694
|
+
_ref6 = _slicedToArray(_ref5, 1),
|
|
20695
|
+
pathname = _ref6[0];
|
|
20696
|
+
return pathname && pathname !== lastTwoRouterArray[0];
|
|
20697
|
+
});
|
|
20698
|
+
}
|
|
20699
|
+
}
|
|
20192
20700
|
}
|
|
20193
20701
|
}
|
|
20194
20702
|
// refs?.tableRef?.current?.refreshTable();
|
|
@@ -20209,20 +20717,13 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
20209
20717
|
});
|
|
20210
20718
|
istParent = 0;
|
|
20211
20719
|
});
|
|
20212
|
-
|
|
20213
|
-
|
|
20214
|
-
|
|
20215
|
-
|
|
20216
|
-
|
|
20217
|
-
|
|
20218
|
-
|
|
20219
|
-
// .getItem('firstPage')
|
|
20220
|
-
// ?.slice(1)
|
|
20221
|
-
// .replace(/^\/\w+\//, '/'),
|
|
20222
|
-
// );
|
|
20223
|
-
// } else {
|
|
20224
|
-
// }
|
|
20225
|
-
history.push(location);
|
|
20720
|
+
if (localStorage.getItem('firstPage') && ((_localStorage$getItem = localStorage.getItem('firstPage')) === null || _localStorage$getItem === void 0 ? void 0 : _localStorage$getItem.startsWith("#/".concat(itemPath, "/")))) {
|
|
20721
|
+
var _localStorage$getItem2;
|
|
20722
|
+
istParent = 1;
|
|
20723
|
+
history.push((_localStorage$getItem2 = localStorage.getItem('firstPage')) === null || _localStorage$getItem2 === void 0 ? void 0 : _localStorage$getItem2.slice(1).replace(/^\/\w+\//, '/'));
|
|
20724
|
+
} else {
|
|
20725
|
+
history.push(location);
|
|
20726
|
+
}
|
|
20226
20727
|
}
|
|
20227
20728
|
}, {
|
|
20228
20729
|
key: "componentWillUnmount",
|
|
@@ -20267,7 +20768,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
20267
20768
|
}); // 添加数据大屏
|
|
20268
20769
|
var _this$props3 = this.props,
|
|
20269
20770
|
route = _this$props3.route,
|
|
20270
|
-
restPrpos = _objectWithoutProperties(_this$props3, _excluded$
|
|
20771
|
+
restPrpos = _objectWithoutProperties(_this$props3, _excluded$f);
|
|
20271
20772
|
var exist = route.routes.find(function (route) {
|
|
20272
20773
|
return route.path === '/homePage/data-show';
|
|
20273
20774
|
});
|
|
@@ -20672,7 +21173,6 @@ var WrapperComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
20672
21173
|
getDictionaryTextByValue = _this$props4.getDictionaryTextByValue,
|
|
20673
21174
|
timeFormat = _this$props4.timeFormat,
|
|
20674
21175
|
transparentProps = _this$props4.transparentProps;
|
|
20675
|
-
console.log('child wrapper conpent', this.props);
|
|
20676
21176
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(item.content, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
20677
21177
|
getDictionarySource: getDictionarySource,
|
|
20678
21178
|
getDictionaryTextByValue: getDictionaryTextByValue,
|
|
@@ -21064,10 +21564,10 @@ var index$6 = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
21064
21564
|
}))))));
|
|
21065
21565
|
});
|
|
21066
21566
|
|
|
21067
|
-
var _excluded$
|
|
21567
|
+
var _excluded$g = ["children"];
|
|
21068
21568
|
var Drawer = (function (props) {
|
|
21069
21569
|
var children = props.children,
|
|
21070
|
-
restProps = _objectWithoutProperties(props, _excluded$
|
|
21570
|
+
restProps = _objectWithoutProperties(props, _excluded$g);
|
|
21071
21571
|
return /*#__PURE__*/React__default['default'].createElement(antd.Drawer, _objectSpread2({
|
|
21072
21572
|
mask: true,
|
|
21073
21573
|
closable: false,
|
|
@@ -29000,7 +29500,9 @@ var FieldsSettingsTable = (function (props) {
|
|
|
29000
29500
|
_props$codeProps = props.codeProps,
|
|
29001
29501
|
codeProps = _props$codeProps === void 0 ? '' : _props$codeProps,
|
|
29002
29502
|
moduleType = props.moduleType,
|
|
29003
|
-
moduleRelationId = props.moduleRelationId
|
|
29503
|
+
moduleRelationId = props.moduleRelationId,
|
|
29504
|
+
_props$tableFlag = props.tableFlag,
|
|
29505
|
+
tableFlag = _props$tableFlag === void 0 ? false : _props$tableFlag;
|
|
29004
29506
|
var ref = React.useRef(null);
|
|
29005
29507
|
var _useState = React.useState({
|
|
29006
29508
|
visible: false,
|
|
@@ -29089,6 +29591,9 @@ var FieldsSettingsTable = (function (props) {
|
|
|
29089
29591
|
render: function render(_ref2) {
|
|
29090
29592
|
var text = _ref2.text,
|
|
29091
29593
|
record = _ref2.record;
|
|
29594
|
+
if (tableFlag) {
|
|
29595
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, " \u5217\u8868\uFF1A", "{\"key\": \"extensionFields,".concat(record.code, "\",\"dataIndex\": \"extensionFields,").concat(record.code, "\",\"title\": \"").concat(record.name, "\"},"));
|
|
29596
|
+
}
|
|
29092
29597
|
if (!codeProps.columns) {
|
|
29093
29598
|
return /*#__PURE__*/React__default['default'].createElement("div", null, "\u8868\u5355\uFF1A", "{\"name\": \"extensionFields,".concat(record.code, "\",\"label\": \"").concat(record.name, "\"},"));
|
|
29094
29599
|
}
|
|
@@ -29324,7 +29829,10 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
|
|
|
29324
29829
|
codeProps = props.codeProps,
|
|
29325
29830
|
customerFields = props.customerFields,
|
|
29326
29831
|
initialSetting = props.initialSetting,
|
|
29327
|
-
pageType = props.pageType
|
|
29832
|
+
pageType = props.pageType,
|
|
29833
|
+
_props$detailTablesSe = props.detailTablesSetting,
|
|
29834
|
+
detailTablesSetting = _props$detailTablesSe === void 0 ? [] : _props$detailTablesSe,
|
|
29835
|
+
saveTableCallBack = props.saveTableCallBack;
|
|
29328
29836
|
var codeFilter = {};
|
|
29329
29837
|
if (codeProps.columns) {
|
|
29330
29838
|
// table
|
|
@@ -29348,7 +29856,6 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
|
|
|
29348
29856
|
fields: codeProps.fields
|
|
29349
29857
|
}).fields;
|
|
29350
29858
|
}
|
|
29351
|
-
console.log('codeFilter', codeFilter);
|
|
29352
29859
|
var styleRef = React.useRef(null);
|
|
29353
29860
|
var _useState = React.useState(false),
|
|
29354
29861
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -29370,6 +29877,18 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
|
|
|
29370
29877
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
29371
29878
|
moduleParams = _useState10[0],
|
|
29372
29879
|
setModuleParams = _useState10[1];
|
|
29880
|
+
var _useState11 = React.useState('main'),
|
|
29881
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
29882
|
+
activeKey = _useState12[0],
|
|
29883
|
+
setActiveKey = _useState12[1]; //默认详情页配置
|
|
29884
|
+
var _useState13 = React.useState({}),
|
|
29885
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
29886
|
+
tablesConfigParams = _useState14[0],
|
|
29887
|
+
setTablesConfigParams = _useState14[1];
|
|
29888
|
+
var _useState15 = React.useState([]),
|
|
29889
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
29890
|
+
tableJsonEditorValsArr = _useState16[0],
|
|
29891
|
+
setTableJsonEditorValsArr = _useState16[1];
|
|
29373
29892
|
React.useEffect(function () {
|
|
29374
29893
|
Promise.all([axios__default['default'].get("/basic/flow/businessFieldGroup/one?moduleType=2&layoutPoint=".concat(pageType))]).then(function (_ref2) {
|
|
29375
29894
|
var _ref3 = _slicedToArray(_ref2, 1),
|
|
@@ -29393,6 +29912,56 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
|
|
|
29393
29912
|
}
|
|
29394
29913
|
});
|
|
29395
29914
|
}, []);
|
|
29915
|
+
React.useEffect(function () {
|
|
29916
|
+
//明细表的配置数据
|
|
29917
|
+
var axiosArr = detailTablesSetting.map(function (item) {
|
|
29918
|
+
return axios__default['default'].get("/basic/flow/businessFieldGroup/one?moduleType=2&layoutPoint=".concat(item.tableCode));
|
|
29919
|
+
});
|
|
29920
|
+
Promise.all(axiosArr).then(function (_ref5) {
|
|
29921
|
+
var _ref6 = _toArray(_ref5),
|
|
29922
|
+
resArr = _ref6.slice(0);
|
|
29923
|
+
detailTablesSetting.map(function (item, index) {
|
|
29924
|
+
var _resArr$index;
|
|
29925
|
+
var _ref7 = ((_resArr$index = resArr[index]) === null || _resArr$index === void 0 ? void 0 : _resArr$index.data) || {},
|
|
29926
|
+
code = _ref7.code,
|
|
29927
|
+
data = _ref7.data;
|
|
29928
|
+
if (data) {
|
|
29929
|
+
var businessType = data.businessType,
|
|
29930
|
+
fieldGroup = data.code,
|
|
29931
|
+
moduleType = data.moduleType;
|
|
29932
|
+
setTablesConfigParams(_objectSpread2(_objectSpread2({}, tablesConfigParams), {}, _defineProperty({}, item.tableCode, {
|
|
29933
|
+
businessType: businessType,
|
|
29934
|
+
fieldGroup: fieldGroup,
|
|
29935
|
+
moduleType: moduleType,
|
|
29936
|
+
tableFlag: true
|
|
29937
|
+
})));
|
|
29938
|
+
}
|
|
29939
|
+
});
|
|
29940
|
+
});
|
|
29941
|
+
var detailTableCodeFilter = detailTablesSetting.map(function (item) {
|
|
29942
|
+
if ((item === null || item === void 0 ? void 0 : item.initialSetting) && (item === null || item === void 0 ? void 0 : item.initialSetting.length)) {
|
|
29943
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
29944
|
+
columns: item === null || item === void 0 ? void 0 : item.initialSetting
|
|
29945
|
+
});
|
|
29946
|
+
}
|
|
29947
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
29948
|
+
columns: item === null || item === void 0 ? void 0 : item.columns.map(function (childItem) {
|
|
29949
|
+
return {
|
|
29950
|
+
key: childItem.key || childItem.dataIndex,
|
|
29951
|
+
dataIndex: childItem.dataIndex || childItem.key,
|
|
29952
|
+
isStaticCode: true,
|
|
29953
|
+
title: childItem.title
|
|
29954
|
+
};
|
|
29955
|
+
})
|
|
29956
|
+
});
|
|
29957
|
+
});
|
|
29958
|
+
setTableJsonEditorValsArr(_toConsumableArray(detailTableCodeFilter));
|
|
29959
|
+
detailTableCodeFilter.map(function (item) {
|
|
29960
|
+
if ((item === null || item === void 0 ? void 0 : item.initialSetting) && (item === null || item === void 0 ? void 0 : item.initialSetting.length)) {
|
|
29961
|
+
onClickRunDetailTables(item.initialSetting, false, item.tableCode, detailTableCodeFilter);
|
|
29962
|
+
}
|
|
29963
|
+
});
|
|
29964
|
+
}, [detailTablesSetting.length]);
|
|
29396
29965
|
var onClickRun = function onClickRun(value, isSave) {
|
|
29397
29966
|
setJsonEditorVal(value);
|
|
29398
29967
|
try {
|
|
@@ -29402,6 +29971,40 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
|
|
|
29402
29971
|
antd.message.error(e);
|
|
29403
29972
|
}
|
|
29404
29973
|
};
|
|
29974
|
+
//明细表保存
|
|
29975
|
+
var onClickRunDetailTables = function onClickRunDetailTables(value, isSave, tableCode, tableSouce) {
|
|
29976
|
+
var targetCode = tableCode || activeKey;
|
|
29977
|
+
var targetTableSource = tableSouce || tableJsonEditorValsArr;
|
|
29978
|
+
var newArr = targetTableSource.map(function (item) {
|
|
29979
|
+
if (item.tableCode == targetCode) {
|
|
29980
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
29981
|
+
columns: value
|
|
29982
|
+
});
|
|
29983
|
+
}
|
|
29984
|
+
return item;
|
|
29985
|
+
});
|
|
29986
|
+
setTableJsonEditorValsArr(_toConsumableArray(newArr));
|
|
29987
|
+
try {
|
|
29988
|
+
var target = targetTableSource.find(function (item) {
|
|
29989
|
+
return item.tableCode == targetCode;
|
|
29990
|
+
});
|
|
29991
|
+
var _codeProps = {
|
|
29992
|
+
fields: [],
|
|
29993
|
+
columns: target === null || target === void 0 ? void 0 : target.columns
|
|
29994
|
+
};
|
|
29995
|
+
var newValue = {
|
|
29996
|
+
fields: [],
|
|
29997
|
+
columns: value
|
|
29998
|
+
};
|
|
29999
|
+
var result = hanleCallbackValue(_codeProps, newValue, target === null || target === void 0 ? void 0 : target.customerFields);
|
|
30000
|
+
saveTableCallBack({
|
|
30001
|
+
columns: result.columns,
|
|
30002
|
+
tableCode: targetCode
|
|
30003
|
+
}, isSave, value);
|
|
30004
|
+
} catch (e) {
|
|
30005
|
+
antd.message.error(e);
|
|
30006
|
+
}
|
|
30007
|
+
};
|
|
29405
30008
|
React__default['default'].useEffect(function () {
|
|
29406
30009
|
localStorage.setItem('jsonEditorVal', JSON.stringify(jsonEditorVal || {}));
|
|
29407
30010
|
}, [jsonEditorVal]);
|
|
@@ -29423,9 +30026,26 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
|
|
|
29423
30026
|
return setVisible(false);
|
|
29424
30027
|
},
|
|
29425
30028
|
className: 'customFieldsDrawer'
|
|
29426
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
29427
|
-
|
|
29428
|
-
|
|
30029
|
+
}, detailTablesSetting.length == 0 && /*#__PURE__*/React__default['default'].createElement(React.Fragment, null, _.isEmpty(moduleParams) ? /*#__PURE__*/React__default['default'].createElement("div", {
|
|
30030
|
+
style: {
|
|
30031
|
+
padding: "10px 0",
|
|
30032
|
+
fontSize: "16px",
|
|
30033
|
+
fontWeight: "bolder"
|
|
30034
|
+
}
|
|
30035
|
+
}, "\u63D0\u793A\uFF1A\u4E1A\u52A1\u5BF9\u8C61\u672A\u7EF4\u62A4\uFF0C\u8BF7\u5728\u901A\u7528\u5355\u636E\u5BF9\u5E94\u4E1A\u52A1\u7C7B\u578B\u4E0B\u7EF4\u62A4\u4E1A\u52A1\u5BF9\u8C61") : /*#__PURE__*/React__default['default'].createElement(FieldsSettingsTable, _objectSpread2({}, tableParams)), /*#__PURE__*/React__default['default'].createElement(Editor, {
|
|
30036
|
+
type: "table",
|
|
30037
|
+
onRun: onClickRun,
|
|
30038
|
+
value: jsonEditorVal,
|
|
30039
|
+
shallowHeight: height
|
|
30040
|
+
})), detailTablesSetting.length > 0 && /*#__PURE__*/React__default['default'].createElement(antd.Tabs, {
|
|
30041
|
+
defaultActiveKey: activeKey,
|
|
30042
|
+
onChange: function onChange(v) {
|
|
30043
|
+
return setActiveKey(v);
|
|
30044
|
+
}
|
|
30045
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Tabs.TabPane, {
|
|
30046
|
+
tab: "\u8BE6\u60C5\u9875\u914D\u7F6E",
|
|
30047
|
+
key: "main"
|
|
30048
|
+
}, _.isEmpty(moduleParams) ? /*#__PURE__*/React__default['default'].createElement("div", {
|
|
29429
30049
|
style: {
|
|
29430
30050
|
padding: "10px 0",
|
|
29431
30051
|
fontSize: "16px",
|
|
@@ -29436,7 +30056,23 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
|
|
|
29436
30056
|
onRun: onClickRun,
|
|
29437
30057
|
value: jsonEditorVal,
|
|
29438
30058
|
shallowHeight: height
|
|
29439
|
-
})),
|
|
30059
|
+
})), tableJsonEditorValsArr.map(function (k) {
|
|
30060
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tabs.TabPane, {
|
|
30061
|
+
tab: k.title,
|
|
30062
|
+
key: k.tableCode
|
|
30063
|
+
}, !tablesConfigParams[k.tableCode] ? /*#__PURE__*/React__default['default'].createElement("div", {
|
|
30064
|
+
style: {
|
|
30065
|
+
padding: "10px 0",
|
|
30066
|
+
fontSize: "16px",
|
|
30067
|
+
fontWeight: "bolder"
|
|
30068
|
+
}
|
|
30069
|
+
}, "\u63D0\u793A\uFF1A\u4E1A\u52A1\u5BF9\u8C61\u672A\u7EF4\u62A4\uFF0C\u8BF7\u5728\u901A\u7528\u5355\u636E\u5BF9\u5E94\u4E1A\u52A1\u7C7B\u578B\u4E0B\u7EF4\u62A4\u4E1A\u52A1\u5BF9\u8C61") : /*#__PURE__*/React__default['default'].createElement(FieldsSettingsTable, _objectSpread2({}, tablesConfigParams[k.tableCode])), /*#__PURE__*/React__default['default'].createElement(Editor, {
|
|
30070
|
+
type: "table",
|
|
30071
|
+
onRun: onClickRunDetailTables,
|
|
30072
|
+
value: k.columns,
|
|
30073
|
+
shallowHeight: height
|
|
30074
|
+
}));
|
|
30075
|
+
}))), !visible && isAdmin() && /*#__PURE__*/React__default['default'].createElement(ConfigButton, {
|
|
29440
30076
|
type: 'primary',
|
|
29441
30077
|
onClick: function onClick() {
|
|
29442
30078
|
return setVisible(true);
|