@bit-sun/business-component 2.2.0-alpha.3 → 2.2.0-alpha.4
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 +255 -921
- package/dist/index.js +254 -920
- package/dist/utils/enumConfig.d.ts +0 -1
- package/package.json +1 -1
- package/src/components/Business/BsLayouts/index.tsx +46 -50
- package/src/components/Business/BsLayouts/utils.tsx +3 -8
- package/src/components/Business/BsSulaQueryTable/index.tsx +70 -128
- package/src/components/Business/BsSulaQueryTable/setting.tsx +1 -1
- package/src/components/Business/DetailPageWrapper/index.tsx +27 -49
- package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +0 -4
- package/src/components/Business/JsonQueryTable/index.tsx +23 -152
- package/src/utils/enumConfig.ts +0 -1
- package/dist/components/Business/BsSulaQueryTable/SearchItemSetting.d.ts +0 -59
- package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +0 -538
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { message, Menu, Space, Dropdown, Tooltip, Button, Checkbox, Input, Modal, Select, Form, Divider, Spin, Table, TreeSelect, Tag, Popover, Card, Avatar, Image, InputNumber, Typography, Alert, Anchor, Breadcrumb, Drawer as Drawer$1, List, Tree, Row, Col, Tabs, Affix } from 'antd';
|
|
3
3
|
import _, { omit, debounce, cloneDeep as cloneDeep$1, isEmpty } from 'lodash';
|
|
4
|
-
import React, { useState, useEffect, forwardRef, useImperativeHandle, useRef, useMemo, Component, useLayoutEffect, createRef
|
|
4
|
+
import React, { useState, useEffect, forwardRef, useImperativeHandle, useRef, useMemo, Component, useLayoutEffect, createRef } from 'react';
|
|
5
5
|
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
|
|
6
6
|
import { UnorderedListOutlined, ProfileTwoTone, ExclamationCircleOutlined, DownOutlined, CopyOutlined, SearchOutlined, CaretLeftOutlined, CloseCircleOutlined, ArrowLeftOutlined, FolderOutlined, EllipsisOutlined, CaretDownOutlined, HomeOutlined, DoubleLeftOutlined, DoubleRightOutlined, MenuUnfoldOutlined, DashOutlined, SettingOutlined, BulbOutlined, PlayCircleOutlined, SaveOutlined, FullscreenExitOutlined } from '@ant-design/icons';
|
|
7
7
|
import { useDebounceFn, useMount } from 'ahooks';
|
|
@@ -32,8 +32,7 @@ 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'
|
|
36
|
-
SEARCH_FIELDS_CONDITION: 'searchFieldsCondition' //表格搜索项信息缓存
|
|
35
|
+
CHILD_APP_BACK: 'child_app_back' //标记子应用goback事件
|
|
37
36
|
}
|
|
38
37
|
};
|
|
39
38
|
|
|
@@ -15988,43 +15987,25 @@ var DetailWrapper = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
15988
15987
|
var pageTitle = useMemo(function () {
|
|
15989
15988
|
return getPageTitle(pathname);
|
|
15990
15989
|
}, [pathname, title]);
|
|
15991
|
-
// const breadcrumbArr = `${basePath}${pathname}`
|
|
15992
|
-
// .split('/')
|
|
15993
|
-
// .slice(1)
|
|
15994
|
-
// .map((_item, index, arr) =>
|
|
15995
|
-
// matchParamsPath(
|
|
15996
|
-
// `/${arr.slice(0, index + 1).join('/')}`,
|
|
15997
|
-
// breadcrumbNameMap,
|
|
15998
|
-
// ),
|
|
15999
|
-
// )
|
|
16000
|
-
// .filter((item) => item);
|
|
16001
15990
|
useEffect(function () {}, []);
|
|
16002
15991
|
var ShowFullScreen = function ShowFullScreen() {
|
|
16003
|
-
|
|
16004
|
-
|
|
16005
|
-
|
|
16006
|
-
|
|
16007
|
-
|
|
16008
|
-
|
|
16009
|
-
|
|
16010
|
-
|
|
16011
|
-
|
|
16012
|
-
// addTabsNavStyle(isFullScreen);
|
|
16013
|
-
if (contentEle && !_isFullScreen) {
|
|
16014
|
-
var fullScreenEle = contentEle.requestFullscreen || contentEle.mozRequestFullScreen || contentEle.webkitRequestFullScreen || contentEle.msRequestFullscreen;
|
|
16015
|
-
if (fullScreenEle) {
|
|
16016
|
-
fullScreenEle.call(contentEle);
|
|
16017
|
-
setIsFnllScreen(true);
|
|
16018
|
-
return;
|
|
16019
|
-
}
|
|
15992
|
+
var isFullScreen = window.top.document.fullScreen || window.top.document.webkitIsFullScreen || window.top.document.mozFullScreen;
|
|
15993
|
+
var contentEle = window.top.document.querySelector("body");
|
|
15994
|
+
// addTabsNavStyle(isFullScreen);
|
|
15995
|
+
if (contentEle && !isFullScreen) {
|
|
15996
|
+
var fullScreenEle = contentEle.requestFullscreen || contentEle.mozRequestFullScreen || contentEle.webkitRequestFullScreen || contentEle.msRequestFullscreen;
|
|
15997
|
+
if (fullScreenEle) {
|
|
15998
|
+
fullScreenEle.call(contentEle);
|
|
15999
|
+
setIsFnllScreen(true);
|
|
16000
|
+
return;
|
|
16020
16001
|
}
|
|
16021
|
-
|
|
16022
|
-
|
|
16023
|
-
|
|
16024
|
-
|
|
16025
|
-
|
|
16026
|
-
|
|
16027
|
-
|
|
16002
|
+
}
|
|
16003
|
+
if (window.top.document && isFullScreen) {
|
|
16004
|
+
var exitFullScreen = window.top.document.exitFullscreen || window.top.document.mozCancelFullScreen || window.top.document.webkitCancelFullScreen || window.top.document.msExitFullscreen;
|
|
16005
|
+
if (exitFullScreen) {
|
|
16006
|
+
exitFullScreen.call(window.top.document);
|
|
16007
|
+
setIsFnllScreen(false);
|
|
16008
|
+
return;
|
|
16028
16009
|
}
|
|
16029
16010
|
}
|
|
16030
16011
|
};
|
|
@@ -16537,556 +16518,11 @@ var SortableTable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
16537
16518
|
}
|
|
16538
16519
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
16539
16520
|
placement: "top",
|
|
16540
|
-
title: (record === null || record === void 0 ? void 0 : record.fixed) === 'right' ? '取消固定' : '固定列尾'
|
|
16541
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
16542
|
-
src: (record === null || record === void 0 ? void 0 : record.fixed) === 'right' ? fixedRightActive : fixedRight
|
|
16543
|
-
})));
|
|
16544
|
-
}
|
|
16545
|
-
}, {
|
|
16546
|
-
title: '删除',
|
|
16547
|
-
dataIndex: 'title1',
|
|
16548
|
-
render: function render(text, record) {
|
|
16549
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
16550
|
-
onClick: function onClick() {
|
|
16551
|
-
_this.setState({
|
|
16552
|
-
sortDataSource: _this.state.sortDataSource.filter(function (item) {
|
|
16553
|
-
return item.title !== record.title;
|
|
16554
|
-
}),
|
|
16555
|
-
isDefaultValue: false,
|
|
16556
|
-
dataSource: _toConsumableArray(_this.state.dataSource.map(function (item) {
|
|
16557
|
-
if (item.title === record.title) {
|
|
16558
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16559
|
-
hidden: true
|
|
16560
|
-
});
|
|
16561
|
-
}
|
|
16562
|
-
return item;
|
|
16563
|
-
}))
|
|
16564
|
-
});
|
|
16565
|
-
}
|
|
16566
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
16567
|
-
src: close
|
|
16568
|
-
}));
|
|
16569
|
-
}
|
|
16570
|
-
}, {
|
|
16571
|
-
title: 'Sort',
|
|
16572
|
-
dataIndex: 'sort',
|
|
16573
|
-
className: 'drag-visible',
|
|
16574
|
-
render: function render() {
|
|
16575
|
-
return /*#__PURE__*/React.createElement(DragHandle$2, null);
|
|
16576
|
-
}
|
|
16577
|
-
}];
|
|
16578
|
-
_this.showModal = function () {
|
|
16579
|
-
_this.setState({
|
|
16580
|
-
visible: true
|
|
16581
|
-
});
|
|
16582
|
-
_this.setInitValue();
|
|
16583
|
-
};
|
|
16584
|
-
_this.handleOk = function (e) {
|
|
16585
|
-
var _this$state2 = _this.state,
|
|
16586
|
-
sortDataSource = _this$state2.sortDataSource,
|
|
16587
|
-
isDefaultValue = _this$state2.isDefaultValue,
|
|
16588
|
-
defaultValue = _this$state2.defaultValue;
|
|
16589
|
-
if (!sortDataSource.length) {
|
|
16590
|
-
message.warning('至少选择一列!');
|
|
16591
|
-
return;
|
|
16592
|
-
}
|
|
16593
|
-
// if (isDefaultValue) {
|
|
16594
|
-
// this.patchUserColumnConfig('');
|
|
16595
|
-
// return;
|
|
16596
|
-
// }
|
|
16597
|
-
_this.patchUserColumnConfig(sortDataSource);
|
|
16598
|
-
};
|
|
16599
|
-
_this.handleCancel = function (e) {
|
|
16600
|
-
console.log(e);
|
|
16601
|
-
_this.setState({
|
|
16602
|
-
visible: false
|
|
16603
|
-
});
|
|
16604
|
-
};
|
|
16605
|
-
_this.handleTableHeadHidden = function (title) {
|
|
16606
|
-
var _this$state3 = _this.state,
|
|
16607
|
-
sortDataSource = _this$state3.sortDataSource,
|
|
16608
|
-
dataSource = _this$state3.dataSource;
|
|
16609
|
-
_this.setState({
|
|
16610
|
-
sortDataSource: sortDataSource.filter(function (item) {
|
|
16611
|
-
return item.title !== title;
|
|
16612
|
-
}),
|
|
16613
|
-
dataSource: _toConsumableArray(dataSource.map(function (item) {
|
|
16614
|
-
if (item.title === title) {
|
|
16615
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16616
|
-
hidden: true
|
|
16617
|
-
});
|
|
16618
|
-
}
|
|
16619
|
-
return item;
|
|
16620
|
-
}))
|
|
16621
|
-
}, function () {
|
|
16622
|
-
_this.handleOk();
|
|
16623
|
-
});
|
|
16624
|
-
};
|
|
16625
|
-
_this.onSortEnd = function (_ref) {
|
|
16626
|
-
var oldIndex = _ref.oldIndex,
|
|
16627
|
-
newIndex = _ref.newIndex;
|
|
16628
|
-
var sortDataSource = _this.state.sortDataSource;
|
|
16629
|
-
if (oldIndex !== newIndex) {
|
|
16630
|
-
var newData = arrayMoveImmutable([].concat(sortDataSource), oldIndex, newIndex).filter(function (el) {
|
|
16631
|
-
return !!el;
|
|
16632
|
-
});
|
|
16633
|
-
_this.setState({
|
|
16634
|
-
sortDataSource: [].concat(_toConsumableArray(newData.filter(function (item) {
|
|
16635
|
-
return item.fixed === 'left';
|
|
16636
|
-
})), _toConsumableArray(newData.filter(function (item) {
|
|
16637
|
-
return !item.fixed;
|
|
16638
|
-
})), _toConsumableArray(newData.filter(function (item) {
|
|
16639
|
-
return item.fixed === 'right';
|
|
16640
|
-
}))),
|
|
16641
|
-
isDefaultValue: false
|
|
16642
|
-
});
|
|
16643
|
-
}
|
|
16644
|
-
};
|
|
16645
|
-
_this.DraggableContainer = function (props) {
|
|
16646
|
-
return /*#__PURE__*/React.createElement(SortableBody$2, _objectSpread2({
|
|
16647
|
-
useDragHandle: true,
|
|
16648
|
-
disableAutoscroll: true,
|
|
16649
|
-
helperClass: "row-dragging",
|
|
16650
|
-
onSortEnd: _this.onSortEnd
|
|
16651
|
-
}, props));
|
|
16652
|
-
};
|
|
16653
|
-
_this.DraggableBodyRow = function (_ref2) {
|
|
16654
|
-
var className = _ref2.className,
|
|
16655
|
-
style = _ref2.style,
|
|
16656
|
-
restProps = _objectWithoutProperties(_ref2, _excluded$c);
|
|
16657
|
-
var sortDataSource = _this.state.sortDataSource;
|
|
16658
|
-
// function findIndex base on Table rowKey props and should always be a right array index
|
|
16659
|
-
var index = sortDataSource.findIndex(function (x) {
|
|
16660
|
-
return x.key === restProps['data-row-key'];
|
|
16661
|
-
});
|
|
16662
|
-
return /*#__PURE__*/React.createElement(SortableItem$2, _objectSpread2({
|
|
16663
|
-
index: index
|
|
16664
|
-
}, restProps));
|
|
16665
|
-
};
|
|
16666
|
-
_this.onChange = function (e, title) {
|
|
16667
|
-
var _this$state4 = _this.state,
|
|
16668
|
-
sortDataSource = _this$state4.sortDataSource,
|
|
16669
|
-
dataSource = _this$state4.dataSource;
|
|
16670
|
-
if (!e.target.checked) {
|
|
16671
|
-
_this.setState({
|
|
16672
|
-
sortDataSource: sortDataSource.filter(function (item) {
|
|
16673
|
-
return item.title !== title;
|
|
16674
|
-
}),
|
|
16675
|
-
isDefaultValue: false,
|
|
16676
|
-
dataSource: _toConsumableArray(dataSource.map(function (item) {
|
|
16677
|
-
if (item.title === title) {
|
|
16678
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16679
|
-
hidden: true
|
|
16680
|
-
});
|
|
16681
|
-
}
|
|
16682
|
-
return item;
|
|
16683
|
-
}))
|
|
16684
|
-
});
|
|
16685
|
-
} else {
|
|
16686
|
-
var _fixedLeft = [];
|
|
16687
|
-
var _fixedRight = [];
|
|
16688
|
-
var noFixedSortSource = [];
|
|
16689
|
-
var newSortData = [].concat(_toConsumableArray(sortDataSource), _toConsumableArray(dataSource.filter(function (item) {
|
|
16690
|
-
return item.title === title;
|
|
16691
|
-
}).map(function (source) {
|
|
16692
|
-
return _objectSpread2(_objectSpread2({}, source), {}, {
|
|
16693
|
-
hidden: false
|
|
16694
|
-
});
|
|
16695
|
-
})));
|
|
16696
|
-
newSortData.forEach(function (item) {
|
|
16697
|
-
if ((item === null || item === void 0 ? void 0 : item.fixed) === 'left') {
|
|
16698
|
-
_fixedLeft.push(item);
|
|
16699
|
-
} else if ((item === null || item === void 0 ? void 0 : item.fixed) === 'right') {
|
|
16700
|
-
_fixedRight.push(item);
|
|
16701
|
-
} else {
|
|
16702
|
-
noFixedSortSource.push(item);
|
|
16703
|
-
}
|
|
16704
|
-
});
|
|
16705
|
-
_this.setState({
|
|
16706
|
-
sortDataSource: [].concat(_fixedLeft, noFixedSortSource, _fixedRight),
|
|
16707
|
-
isDefaultValue: false,
|
|
16708
|
-
dataSource: _toConsumableArray(dataSource.map(function (item) {
|
|
16709
|
-
if (item.title === title) {
|
|
16710
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16711
|
-
hidden: false
|
|
16712
|
-
});
|
|
16713
|
-
}
|
|
16714
|
-
return item;
|
|
16715
|
-
}))
|
|
16716
|
-
});
|
|
16717
|
-
}
|
|
16718
|
-
};
|
|
16719
|
-
_this.handleReset = function () {
|
|
16720
|
-
_this.setInitValue(true);
|
|
16721
|
-
};
|
|
16722
|
-
_this.onSearch = function (e) {
|
|
16723
|
-
_this.setState({
|
|
16724
|
-
searchDataSource: e.target.value
|
|
16725
|
-
});
|
|
16726
|
-
};
|
|
16727
|
-
_this.onSearchSort = function (e) {
|
|
16728
|
-
_this.setState({
|
|
16729
|
-
onSearchSort: e.target.value
|
|
16730
|
-
});
|
|
16731
|
-
};
|
|
16732
|
-
return _this;
|
|
16733
|
-
}
|
|
16734
|
-
_createClass(SortableTable, [{
|
|
16735
|
-
key: "componentDidMount",
|
|
16736
|
-
value: function componentDidMount() {
|
|
16737
|
-
var _this$props2 = this.props,
|
|
16738
|
-
datasource = _this$props2.datasource,
|
|
16739
|
-
showColumn = _this$props2.showColumn,
|
|
16740
|
-
bsTableCode = _this$props2.bsTableCode;
|
|
16741
|
-
var config = this.getConfigFromlocalstorage();
|
|
16742
|
-
this.setState({
|
|
16743
|
-
dataSource: datasource.map(function (item) {
|
|
16744
|
-
var _innerItem$3;
|
|
16745
|
-
var innerItem = config.filter(function (inneritem) {
|
|
16746
|
-
var innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : inneritem.key || inneritem.dataIndex;
|
|
16747
|
-
var itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : item.key || item.dataIndex;
|
|
16748
|
-
return innerKey && innerKey === itemKey;
|
|
16749
|
-
});
|
|
16750
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16751
|
-
key: item.key || item.dataIndex,
|
|
16752
|
-
width: ((_innerItem$3 = innerItem[0]) === null || _innerItem$3 === void 0 ? void 0 : _innerItem$3.width) || item.width,
|
|
16753
|
-
hidden: config.length ? !innerItem.length : item.hidden
|
|
16754
|
-
});
|
|
16755
|
-
}),
|
|
16756
|
-
defaultValue: datasource.map(function (item) {
|
|
16757
|
-
var _innerItem$4;
|
|
16758
|
-
var innerItem = config.filter(function (inneritem) {
|
|
16759
|
-
var innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : inneritem.key || inneritem.dataIndex;
|
|
16760
|
-
var itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : item.key || item.dataIndex;
|
|
16761
|
-
return innerKey && innerKey === itemKey;
|
|
16762
|
-
});
|
|
16763
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16764
|
-
key: item.key || item.dataIndex,
|
|
16765
|
-
width: ((_innerItem$4 = innerItem[0]) === null || _innerItem$4 === void 0 ? void 0 : _innerItem$4.width) || item.width,
|
|
16766
|
-
hidden: config.length ? !innerItem.length : item.hidden
|
|
16767
|
-
});
|
|
16768
|
-
}),
|
|
16769
|
-
sortDataSource: datasource.filter(function (item) {
|
|
16770
|
-
return !item.hidden;
|
|
16771
|
-
}).map(function (item) {
|
|
16772
|
-
var _showColumn$filter$;
|
|
16773
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16774
|
-
key: item.key || item.dataIndex,
|
|
16775
|
-
width: ((_showColumn$filter$ = showColumn.filter(function (inneritem) {
|
|
16776
|
-
var innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : inneritem.key || inneritem.dataIndex;
|
|
16777
|
-
var itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : item.key || item.dataIndex;
|
|
16778
|
-
return innerKey && innerKey === itemKey;
|
|
16779
|
-
})[0]) === null || _showColumn$filter$ === void 0 ? void 0 : _showColumn$filter$.width) || item.width
|
|
16780
|
-
});
|
|
16781
|
-
}),
|
|
16782
|
-
bsTableCode: bsTableCode
|
|
16783
|
-
});
|
|
16784
|
-
}
|
|
16785
|
-
}, {
|
|
16786
|
-
key: "render",
|
|
16787
|
-
value: function render() {
|
|
16788
|
-
var _this2 = this;
|
|
16789
|
-
var _this$state5 = this.state,
|
|
16790
|
-
dataSource = _this$state5.dataSource,
|
|
16791
|
-
searchDataSource = _this$state5.searchDataSource,
|
|
16792
|
-
sortDataSource = _this$state5.sortDataSource,
|
|
16793
|
-
visible = _this$state5.visible,
|
|
16794
|
-
onSearchSort = _this$state5.onSearchSort;
|
|
16795
|
-
var seatchDataSource = dataSource.filter(function (item) {
|
|
16796
|
-
var _item$title;
|
|
16797
|
-
return (item === null || item === void 0 ? void 0 : (_item$title = item.title) === null || _item$title === void 0 ? void 0 : _item$title.indexOf(searchDataSource || '')) > -1;
|
|
16798
|
-
});
|
|
16799
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
16800
|
-
className: 'sort_table_wrapper'
|
|
16801
|
-
}, visible && /*#__PURE__*/React.createElement(Modal, {
|
|
16802
|
-
title: "\u8BBE\u7F6E\u8868\u5934\u5185\u5BB9",
|
|
16803
|
-
wrapClassName: 'sort_table_wrapper',
|
|
16804
|
-
width: 820,
|
|
16805
|
-
visible: visible,
|
|
16806
|
-
onOk: this.handleOk,
|
|
16807
|
-
onCancel: this.handleCancel,
|
|
16808
|
-
footer: [/*#__PURE__*/React.createElement(Button, {
|
|
16809
|
-
key: "back",
|
|
16810
|
-
onClick: this.handleReset
|
|
16811
|
-
}, "\u6062\u590D\u9ED8\u8BA4"), /*#__PURE__*/React.createElement(Button, {
|
|
16812
|
-
key: "submit",
|
|
16813
|
-
onClick: this.handleCancel
|
|
16814
|
-
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
16815
|
-
key: "submit",
|
|
16816
|
-
type: "primary",
|
|
16817
|
-
onClick: this.handleOk
|
|
16818
|
-
}, "\u786E\u8BA4")]
|
|
16819
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
16820
|
-
className: 'sort_table'
|
|
16821
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
16822
|
-
className: 'sort_table_column_wrapper'
|
|
16823
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
16824
|
-
className: 'sort_table_column_count'
|
|
16825
|
-
}, "\u53EF\u9009\u5B57\u6BB5 ", /*#__PURE__*/React.createElement("span", null, "\uFF08\u5171", dataSource.length, "\u4E2A\uFF09")), /*#__PURE__*/React.createElement("div", {
|
|
16826
|
-
className: 'sort_table_column'
|
|
16827
|
-
}, /*#__PURE__*/React.createElement(Input, {
|
|
16828
|
-
prefix: /*#__PURE__*/React.createElement(SearchOutlined, {
|
|
16829
|
-
className: "site-form-item-icon"
|
|
16830
|
-
}),
|
|
16831
|
-
placeholder: "\u641C\u7D22",
|
|
16832
|
-
allowClear: true,
|
|
16833
|
-
onChange: this.onSearch,
|
|
16834
|
-
style: {
|
|
16835
|
-
width: 540
|
|
16836
|
-
}
|
|
16837
|
-
}), /*#__PURE__*/React.createElement("div", null, !searchDataSource && /*#__PURE__*/React.createElement(Checkbox, {
|
|
16838
|
-
checked: !dataSource.some(function (item) {
|
|
16839
|
-
if (item.hidden) return true;
|
|
16840
|
-
return false;
|
|
16841
|
-
}),
|
|
16842
|
-
onClick: function onClick(e) {
|
|
16843
|
-
_this2.setState({
|
|
16844
|
-
isDefaultValue: false,
|
|
16845
|
-
dataSource: _toConsumableArray(dataSource.map(function (item) {
|
|
16846
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16847
|
-
hidden: !e.target.checked
|
|
16848
|
-
});
|
|
16849
|
-
})),
|
|
16850
|
-
sortDataSource: e.target.checked ? [].concat(_toConsumableArray(dataSource.filter(function (item) {
|
|
16851
|
-
return item.fixed === 'left';
|
|
16852
|
-
}).map(function (item) {
|
|
16853
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16854
|
-
hidden: false
|
|
16855
|
-
});
|
|
16856
|
-
})), _toConsumableArray(dataSource.filter(function (item) {
|
|
16857
|
-
return !item.fixed;
|
|
16858
|
-
}).map(function (item) {
|
|
16859
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16860
|
-
hidden: false
|
|
16861
|
-
});
|
|
16862
|
-
})), _toConsumableArray(dataSource.filter(function (item) {
|
|
16863
|
-
return item.fixed === 'right';
|
|
16864
|
-
}).map(function (item) {
|
|
16865
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16866
|
-
hidden: false
|
|
16867
|
-
});
|
|
16868
|
-
}))) : []
|
|
16869
|
-
});
|
|
16870
|
-
}
|
|
16871
|
-
}, "\u5168\u9009")), /*#__PURE__*/React.createElement("div", {
|
|
16872
|
-
className: 'sort_table_column_all'
|
|
16873
|
-
}, searchDataSource ? seatchDataSource.map(function (item) {
|
|
16874
|
-
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
16875
|
-
checked: !item.hidden,
|
|
16876
|
-
onChange: function onChange(e) {
|
|
16877
|
-
_this2.onChange(e, item.title);
|
|
16878
|
-
}
|
|
16879
|
-
}, item.title);
|
|
16880
|
-
}) : dataSource.filter(function (item) {
|
|
16881
|
-
var _item$title2, _item$title3;
|
|
16882
|
-
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;
|
|
16883
|
-
}).map(function (item) {
|
|
16884
|
-
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
16885
|
-
checked: !item.hidden,
|
|
16886
|
-
onChange: function onChange(e) {
|
|
16887
|
-
_this2.onChange(e, item.title);
|
|
16888
|
-
}
|
|
16889
|
-
}, item.title);
|
|
16890
|
-
}), !!seatchDataSource.length && /*#__PURE__*/React.createElement("span", {
|
|
16891
|
-
style: {
|
|
16892
|
-
width: '144px'
|
|
16893
|
-
}
|
|
16894
|
-
}), !seatchDataSource.length && /*#__PURE__*/React.createElement("div", {
|
|
16895
|
-
className: 'sort_table_column_all_empty'
|
|
16896
|
-
}, "\u672A\u67E5\u8BE2\u5230\u7ED3\u679C")), !searchDataSource && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
16897
|
-
className: 'sort_table_column_special'
|
|
16898
|
-
}, /*#__PURE__*/React.createElement("span", null, "\u4EBA\u5458\u65F6\u95F4\u5B57\u6BB5")), /*#__PURE__*/React.createElement("div", {
|
|
16899
|
-
className: 'sort_table_column_all'
|
|
16900
|
-
}, _toConsumableArray(dataSource).filter(function (item) {
|
|
16901
|
-
var _item$title4, _item$title5;
|
|
16902
|
-
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;
|
|
16903
|
-
}).map(function (item) {
|
|
16904
|
-
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
16905
|
-
checked: !item.hidden,
|
|
16906
|
-
onChange: function onChange(e) {
|
|
16907
|
-
_this2.onChange(e, item.title);
|
|
16908
|
-
}
|
|
16909
|
-
}, item.title);
|
|
16910
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
16911
|
-
style: {
|
|
16912
|
-
width: '144px'
|
|
16913
|
-
}
|
|
16914
|
-
}))))), /*#__PURE__*/React.createElement("div", {
|
|
16915
|
-
className: 'sort_table_content_wrapper'
|
|
16916
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
16917
|
-
className: 'sort_table_content_count'
|
|
16918
|
-
}, "\u5DF2\u9009\u5B57\u6BB5 ", /*#__PURE__*/React.createElement("span", null, "\uFF08\u5171", sortDataSource.length, "\u4E2A\uFF09")), /*#__PURE__*/React.createElement("div", {
|
|
16919
|
-
className: 'sort_table_content'
|
|
16920
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
16921
|
-
style: {
|
|
16922
|
-
paddingLeft: '10px'
|
|
16923
|
-
}
|
|
16924
|
-
}, /*#__PURE__*/React.createElement(Input, {
|
|
16925
|
-
prefix: /*#__PURE__*/React.createElement(SearchOutlined, {
|
|
16926
|
-
className: "site-form-item-icon"
|
|
16927
|
-
}),
|
|
16928
|
-
placeholder: "\u641C\u7D22",
|
|
16929
|
-
allowClear: true,
|
|
16930
|
-
onChange: this.onSearchSort,
|
|
16931
|
-
style: {
|
|
16932
|
-
width: 190
|
|
16933
|
-
}
|
|
16934
|
-
})), /*#__PURE__*/React.createElement(Table, {
|
|
16935
|
-
pagination: false,
|
|
16936
|
-
showHeader: false,
|
|
16937
|
-
dataSource: onSearchSort ? sortDataSource.filter(function (item) {
|
|
16938
|
-
var _item$title6;
|
|
16939
|
-
return (item === null || item === void 0 ? void 0 : (_item$title6 = item.title) === null || _item$title6 === void 0 ? void 0 : _item$title6.indexOf(onSearchSort)) > -1;
|
|
16940
|
-
}) : sortDataSource,
|
|
16941
|
-
columns: this.columns,
|
|
16942
|
-
rowKey: "key",
|
|
16943
|
-
// rowSelection={rowSelection}
|
|
16944
|
-
components: {
|
|
16945
|
-
body: {
|
|
16946
|
-
wrapper: this.DraggableContainer,
|
|
16947
|
-
row: this.DraggableBodyRow
|
|
16948
|
-
}
|
|
16949
|
-
}
|
|
16950
|
-
}))))), /*#__PURE__*/React.createElement("div", {
|
|
16951
|
-
onClick: this.showModal,
|
|
16952
|
-
style: {
|
|
16953
|
-
fontSize: 14
|
|
16954
|
-
}
|
|
16955
|
-
}, "\u5217\u8BBE\u7F6E"));
|
|
16956
|
-
}
|
|
16957
|
-
}]);
|
|
16958
|
-
return SortableTable;
|
|
16959
|
-
}(React.Component);
|
|
16960
|
-
|
|
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
|
-
});
|
|
16521
|
+
title: (record === null || record === void 0 ? void 0 : record.fixed) === 'right' ? '取消固定' : '固定列尾'
|
|
16522
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
16523
|
+
src: (record === null || record === void 0 ? void 0 : record.fixed) === 'right' ? fixedRightActive : fixedRight
|
|
16524
|
+
})));
|
|
17046
16525
|
}
|
|
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
|
-
_this$props$datasourc = _this$props.datasource,
|
|
17056
|
-
datasource = _this$props$datasourc === void 0 ? [] : _this$props$datasourc,
|
|
17057
|
-
_this$props$showSearc = _this$props.showSearchFields,
|
|
17058
|
-
showSearchFields = _this$props$showSearc === void 0 ? [] : _this$props$showSearc;
|
|
17059
|
-
var config = _this.getConfigFromlocalstorage();
|
|
17060
|
-
_this.setState({
|
|
17061
|
-
isDefaultValue: true,
|
|
17062
|
-
dataSource: datasource.map(function (item) {
|
|
17063
|
-
var innerItem = config.filter(function (inneritem) {
|
|
17064
|
-
var innerKey = Array.isArray(inneritem.name) ? JSON.stringify(inneritem.name) : inneritem.name;
|
|
17065
|
-
var itemKey = Array.isArray(item.name) ? JSON.stringify(item.name) : item.name;
|
|
17066
|
-
return innerKey && innerKey === itemKey;
|
|
17067
|
-
});
|
|
17068
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
17069
|
-
hidden: config.length && !innerItem.length
|
|
17070
|
-
});
|
|
17071
|
-
}),
|
|
17072
|
-
defaultValue: datasource.map(function (item) {
|
|
17073
|
-
var innerItem = config.filter(function (inneritem) {
|
|
17074
|
-
var innerKey = Array.isArray(inneritem.name) ? JSON.stringify(inneritem.name) : inneritem.name;
|
|
17075
|
-
var itemKey = Array.isArray(item.name) ? JSON.stringify(item.name) : item.name;
|
|
17076
|
-
return innerKey && innerKey === itemKey;
|
|
17077
|
-
});
|
|
17078
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
17079
|
-
hidden: config.length && !innerItem.length
|
|
17080
|
-
});
|
|
17081
|
-
}),
|
|
17082
|
-
sortDataSource: _toConsumableArray(showSearchFields)
|
|
17083
|
-
});
|
|
17084
|
-
};
|
|
17085
|
-
_this.columns = [{
|
|
17086
|
-
title: '搜索字段名称',
|
|
17087
|
-
dataIndex: 'label',
|
|
17088
|
-
className: 'drag-visible',
|
|
17089
|
-
width: 100
|
|
17090
16526
|
}, {
|
|
17091
16527
|
title: '删除',
|
|
17092
16528
|
dataIndex: 'title1',
|
|
@@ -17095,11 +16531,11 @@ var SearchItemTable = /*#__PURE__*/function (_React$Component) {
|
|
|
17095
16531
|
onClick: function onClick() {
|
|
17096
16532
|
_this.setState({
|
|
17097
16533
|
sortDataSource: _this.state.sortDataSource.filter(function (item) {
|
|
17098
|
-
return item.
|
|
16534
|
+
return item.title !== record.title;
|
|
17099
16535
|
}),
|
|
17100
16536
|
isDefaultValue: false,
|
|
17101
16537
|
dataSource: _toConsumableArray(_this.state.dataSource.map(function (item) {
|
|
17102
|
-
if (item.
|
|
16538
|
+
if (item.title === record.title) {
|
|
17103
16539
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
17104
16540
|
hidden: true
|
|
17105
16541
|
});
|
|
@@ -17117,7 +16553,7 @@ var SearchItemTable = /*#__PURE__*/function (_React$Component) {
|
|
|
17117
16553
|
dataIndex: 'sort',
|
|
17118
16554
|
className: 'drag-visible',
|
|
17119
16555
|
render: function render() {
|
|
17120
|
-
return /*#__PURE__*/React.createElement(DragHandle$
|
|
16556
|
+
return /*#__PURE__*/React.createElement(DragHandle$2, null);
|
|
17121
16557
|
}
|
|
17122
16558
|
}];
|
|
17123
16559
|
_this.showModal = function () {
|
|
@@ -17132,10 +16568,14 @@ var SearchItemTable = /*#__PURE__*/function (_React$Component) {
|
|
|
17132
16568
|
isDefaultValue = _this$state2.isDefaultValue,
|
|
17133
16569
|
defaultValue = _this$state2.defaultValue;
|
|
17134
16570
|
if (!sortDataSource.length) {
|
|
17135
|
-
message.warning('
|
|
16571
|
+
message.warning('至少选择一列!');
|
|
17136
16572
|
return;
|
|
17137
16573
|
}
|
|
17138
|
-
|
|
16574
|
+
// if (isDefaultValue) {
|
|
16575
|
+
// this.patchUserColumnConfig('');
|
|
16576
|
+
// return;
|
|
16577
|
+
// }
|
|
16578
|
+
_this.patchUserColumnConfig(sortDataSource);
|
|
17139
16579
|
};
|
|
17140
16580
|
_this.handleCancel = function (e) {
|
|
17141
16581
|
console.log(e);
|
|
@@ -17172,13 +16612,19 @@ var SearchItemTable = /*#__PURE__*/function (_React$Component) {
|
|
|
17172
16612
|
return !!el;
|
|
17173
16613
|
});
|
|
17174
16614
|
_this.setState({
|
|
17175
|
-
sortDataSource: _toConsumableArray(newData)
|
|
16615
|
+
sortDataSource: [].concat(_toConsumableArray(newData.filter(function (item) {
|
|
16616
|
+
return item.fixed === 'left';
|
|
16617
|
+
})), _toConsumableArray(newData.filter(function (item) {
|
|
16618
|
+
return !item.fixed;
|
|
16619
|
+
})), _toConsumableArray(newData.filter(function (item) {
|
|
16620
|
+
return item.fixed === 'right';
|
|
16621
|
+
}))),
|
|
17176
16622
|
isDefaultValue: false
|
|
17177
16623
|
});
|
|
17178
16624
|
}
|
|
17179
16625
|
};
|
|
17180
16626
|
_this.DraggableContainer = function (props) {
|
|
17181
|
-
return /*#__PURE__*/React.createElement(SortableBody$
|
|
16627
|
+
return /*#__PURE__*/React.createElement(SortableBody$2, _objectSpread2({
|
|
17182
16628
|
useDragHandle: true,
|
|
17183
16629
|
disableAutoscroll: true,
|
|
17184
16630
|
helperClass: "row-dragging",
|
|
@@ -17188,27 +16634,28 @@ var SearchItemTable = /*#__PURE__*/function (_React$Component) {
|
|
|
17188
16634
|
_this.DraggableBodyRow = function (_ref2) {
|
|
17189
16635
|
var className = _ref2.className,
|
|
17190
16636
|
style = _ref2.style,
|
|
17191
|
-
restProps = _objectWithoutProperties(_ref2, _excluded$
|
|
16637
|
+
restProps = _objectWithoutProperties(_ref2, _excluded$c);
|
|
17192
16638
|
var sortDataSource = _this.state.sortDataSource;
|
|
16639
|
+
// function findIndex base on Table rowKey props and should always be a right array index
|
|
17193
16640
|
var index = sortDataSource.findIndex(function (x) {
|
|
17194
|
-
return x.
|
|
16641
|
+
return x.key === restProps['data-row-key'];
|
|
17195
16642
|
});
|
|
17196
|
-
return /*#__PURE__*/React.createElement(SortableItem$
|
|
16643
|
+
return /*#__PURE__*/React.createElement(SortableItem$2, _objectSpread2({
|
|
17197
16644
|
index: index
|
|
17198
16645
|
}, restProps));
|
|
17199
16646
|
};
|
|
17200
|
-
_this.onChange = function (e,
|
|
16647
|
+
_this.onChange = function (e, title) {
|
|
17201
16648
|
var _this$state4 = _this.state,
|
|
17202
16649
|
sortDataSource = _this$state4.sortDataSource,
|
|
17203
16650
|
dataSource = _this$state4.dataSource;
|
|
17204
16651
|
if (!e.target.checked) {
|
|
17205
16652
|
_this.setState({
|
|
17206
16653
|
sortDataSource: sortDataSource.filter(function (item) {
|
|
17207
|
-
return item.
|
|
16654
|
+
return item.title !== title;
|
|
17208
16655
|
}),
|
|
17209
16656
|
isDefaultValue: false,
|
|
17210
16657
|
dataSource: _toConsumableArray(dataSource.map(function (item) {
|
|
17211
|
-
if (item.
|
|
16658
|
+
if (item.title === title) {
|
|
17212
16659
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
17213
16660
|
hidden: true
|
|
17214
16661
|
});
|
|
@@ -17217,18 +16664,30 @@ var SearchItemTable = /*#__PURE__*/function (_React$Component) {
|
|
|
17217
16664
|
}))
|
|
17218
16665
|
});
|
|
17219
16666
|
} else {
|
|
16667
|
+
var _fixedLeft = [];
|
|
16668
|
+
var _fixedRight = [];
|
|
16669
|
+
var noFixedSortSource = [];
|
|
17220
16670
|
var newSortData = [].concat(_toConsumableArray(sortDataSource), _toConsumableArray(dataSource.filter(function (item) {
|
|
17221
|
-
return item.
|
|
16671
|
+
return item.title === title;
|
|
17222
16672
|
}).map(function (source) {
|
|
17223
16673
|
return _objectSpread2(_objectSpread2({}, source), {}, {
|
|
17224
16674
|
hidden: false
|
|
17225
16675
|
});
|
|
17226
16676
|
})));
|
|
16677
|
+
newSortData.forEach(function (item) {
|
|
16678
|
+
if ((item === null || item === void 0 ? void 0 : item.fixed) === 'left') {
|
|
16679
|
+
_fixedLeft.push(item);
|
|
16680
|
+
} else if ((item === null || item === void 0 ? void 0 : item.fixed) === 'right') {
|
|
16681
|
+
_fixedRight.push(item);
|
|
16682
|
+
} else {
|
|
16683
|
+
noFixedSortSource.push(item);
|
|
16684
|
+
}
|
|
16685
|
+
});
|
|
17227
16686
|
_this.setState({
|
|
17228
|
-
sortDataSource:
|
|
16687
|
+
sortDataSource: [].concat(_fixedLeft, noFixedSortSource, _fixedRight),
|
|
17229
16688
|
isDefaultValue: false,
|
|
17230
16689
|
dataSource: _toConsumableArray(dataSource.map(function (item) {
|
|
17231
|
-
if (item.
|
|
16690
|
+
if (item.title === title) {
|
|
17232
16691
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
17233
16692
|
hidden: false
|
|
17234
16693
|
});
|
|
@@ -17253,39 +16712,53 @@ var SearchItemTable = /*#__PURE__*/function (_React$Component) {
|
|
|
17253
16712
|
};
|
|
17254
16713
|
return _this;
|
|
17255
16714
|
}
|
|
17256
|
-
_createClass(
|
|
16715
|
+
_createClass(SortableTable, [{
|
|
17257
16716
|
key: "componentDidMount",
|
|
17258
16717
|
value: function componentDidMount() {
|
|
17259
16718
|
var _this$props2 = this.props,
|
|
17260
16719
|
datasource = _this$props2.datasource,
|
|
17261
|
-
|
|
16720
|
+
showColumn = _this$props2.showColumn,
|
|
17262
16721
|
bsTableCode = _this$props2.bsTableCode;
|
|
17263
16722
|
var config = this.getConfigFromlocalstorage();
|
|
17264
16723
|
this.setState({
|
|
17265
16724
|
dataSource: datasource.map(function (item) {
|
|
16725
|
+
var _innerItem$3;
|
|
17266
16726
|
var innerItem = config.filter(function (inneritem) {
|
|
17267
|
-
var innerKey = Array.isArray(inneritem.
|
|
17268
|
-
var itemKey = Array.isArray(item.
|
|
16727
|
+
var innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : inneritem.key || inneritem.dataIndex;
|
|
16728
|
+
var itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : item.key || item.dataIndex;
|
|
17269
16729
|
return innerKey && innerKey === itemKey;
|
|
17270
16730
|
});
|
|
17271
16731
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
17272
|
-
|
|
16732
|
+
key: item.key || item.dataIndex,
|
|
16733
|
+
width: ((_innerItem$3 = innerItem[0]) === null || _innerItem$3 === void 0 ? void 0 : _innerItem$3.width) || item.width,
|
|
16734
|
+
hidden: config.length ? !innerItem.length : item.hidden
|
|
17273
16735
|
});
|
|
17274
16736
|
}),
|
|
17275
16737
|
defaultValue: datasource.map(function (item) {
|
|
16738
|
+
var _innerItem$4;
|
|
17276
16739
|
var innerItem = config.filter(function (inneritem) {
|
|
17277
|
-
var innerKey = Array.isArray(inneritem.
|
|
17278
|
-
var itemKey = Array.isArray(item.
|
|
16740
|
+
var innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : inneritem.key || inneritem.dataIndex;
|
|
16741
|
+
var itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : item.key || item.dataIndex;
|
|
17279
16742
|
return innerKey && innerKey === itemKey;
|
|
17280
16743
|
});
|
|
17281
16744
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
17282
|
-
|
|
16745
|
+
key: item.key || item.dataIndex,
|
|
16746
|
+
width: ((_innerItem$4 = innerItem[0]) === null || _innerItem$4 === void 0 ? void 0 : _innerItem$4.width) || item.width,
|
|
16747
|
+
hidden: config.length ? !innerItem.length : item.hidden
|
|
17283
16748
|
});
|
|
17284
16749
|
}),
|
|
17285
16750
|
sortDataSource: datasource.filter(function (item) {
|
|
17286
16751
|
return !item.hidden;
|
|
17287
16752
|
}).map(function (item) {
|
|
17288
|
-
|
|
16753
|
+
var _showColumn$filter$;
|
|
16754
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16755
|
+
key: item.key || item.dataIndex,
|
|
16756
|
+
width: ((_showColumn$filter$ = showColumn.filter(function (inneritem) {
|
|
16757
|
+
var innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : inneritem.key || inneritem.dataIndex;
|
|
16758
|
+
var itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : item.key || item.dataIndex;
|
|
16759
|
+
return innerKey && innerKey === itemKey;
|
|
16760
|
+
})[0]) === null || _showColumn$filter$ === void 0 ? void 0 : _showColumn$filter$.width) || item.width
|
|
16761
|
+
});
|
|
17289
16762
|
}),
|
|
17290
16763
|
bsTableCode: bsTableCode
|
|
17291
16764
|
});
|
|
@@ -17295,20 +16768,19 @@ var SearchItemTable = /*#__PURE__*/function (_React$Component) {
|
|
|
17295
16768
|
value: function render() {
|
|
17296
16769
|
var _this2 = this;
|
|
17297
16770
|
var _this$state5 = this.state,
|
|
17298
|
-
|
|
17299
|
-
dataSource = _this$state5$dataSour === void 0 ? [] : _this$state5$dataSour,
|
|
16771
|
+
dataSource = _this$state5.dataSource,
|
|
17300
16772
|
searchDataSource = _this$state5.searchDataSource,
|
|
17301
16773
|
sortDataSource = _this$state5.sortDataSource,
|
|
17302
16774
|
visible = _this$state5.visible,
|
|
17303
16775
|
onSearchSort = _this$state5.onSearchSort;
|
|
17304
|
-
var
|
|
17305
|
-
var _item$
|
|
17306
|
-
return (item === null || item === void 0 ? void 0 : (_item$
|
|
16776
|
+
var seatchDataSource = dataSource.filter(function (item) {
|
|
16777
|
+
var _item$title;
|
|
16778
|
+
return (item === null || item === void 0 ? void 0 : (_item$title = item.title) === null || _item$title === void 0 ? void 0 : _item$title.indexOf(searchDataSource || '')) > -1;
|
|
17307
16779
|
});
|
|
17308
16780
|
return /*#__PURE__*/React.createElement("div", {
|
|
17309
16781
|
className: 'sort_table_wrapper'
|
|
17310
16782
|
}, visible && /*#__PURE__*/React.createElement(Modal, {
|
|
17311
|
-
title: "\u8BBE\u7F6E\
|
|
16783
|
+
title: "\u8BBE\u7F6E\u8868\u5934\u5185\u5BB9",
|
|
17312
16784
|
wrapClassName: 'sort_table_wrapper',
|
|
17313
16785
|
width: 820,
|
|
17314
16786
|
visible: visible,
|
|
@@ -17356,36 +16828,71 @@ var SearchItemTable = /*#__PURE__*/function (_React$Component) {
|
|
|
17356
16828
|
hidden: !e.target.checked
|
|
17357
16829
|
});
|
|
17358
16830
|
})),
|
|
17359
|
-
sortDataSource: e.target.checked ? _toConsumableArray(dataSource.
|
|
16831
|
+
sortDataSource: e.target.checked ? [].concat(_toConsumableArray(dataSource.filter(function (item) {
|
|
16832
|
+
return item.fixed === 'left';
|
|
16833
|
+
}).map(function (item) {
|
|
17360
16834
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
17361
16835
|
hidden: false
|
|
17362
16836
|
});
|
|
17363
|
-
}))
|
|
16837
|
+
})), _toConsumableArray(dataSource.filter(function (item) {
|
|
16838
|
+
return !item.fixed;
|
|
16839
|
+
}).map(function (item) {
|
|
16840
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16841
|
+
hidden: false
|
|
16842
|
+
});
|
|
16843
|
+
})), _toConsumableArray(dataSource.filter(function (item) {
|
|
16844
|
+
return item.fixed === 'right';
|
|
16845
|
+
}).map(function (item) {
|
|
16846
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
16847
|
+
hidden: false
|
|
16848
|
+
});
|
|
16849
|
+
}))) : []
|
|
17364
16850
|
});
|
|
17365
16851
|
}
|
|
17366
16852
|
}, "\u5168\u9009")), /*#__PURE__*/React.createElement("div", {
|
|
17367
16853
|
className: 'sort_table_column_all'
|
|
17368
|
-
}, searchDataSource ?
|
|
16854
|
+
}, searchDataSource ? seatchDataSource.map(function (item) {
|
|
17369
16855
|
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
17370
16856
|
checked: !item.hidden,
|
|
17371
16857
|
onChange: function onChange(e) {
|
|
17372
|
-
_this2.onChange(e, item.
|
|
16858
|
+
_this2.onChange(e, item.title);
|
|
17373
16859
|
}
|
|
17374
|
-
}, item.
|
|
17375
|
-
}) : dataSource.
|
|
16860
|
+
}, item.title);
|
|
16861
|
+
}) : dataSource.filter(function (item) {
|
|
16862
|
+
var _item$title2, _item$title3;
|
|
16863
|
+
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;
|
|
16864
|
+
}).map(function (item) {
|
|
17376
16865
|
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
17377
16866
|
checked: !item.hidden,
|
|
17378
16867
|
onChange: function onChange(e) {
|
|
17379
|
-
_this2.onChange(e, item.
|
|
16868
|
+
_this2.onChange(e, item.title);
|
|
17380
16869
|
}
|
|
17381
|
-
}, item.
|
|
17382
|
-
}), !!
|
|
16870
|
+
}, item.title);
|
|
16871
|
+
}), !!seatchDataSource.length && /*#__PURE__*/React.createElement("span", {
|
|
17383
16872
|
style: {
|
|
17384
16873
|
width: '144px'
|
|
17385
16874
|
}
|
|
17386
|
-
}), !
|
|
16875
|
+
}), !seatchDataSource.length && /*#__PURE__*/React.createElement("div", {
|
|
17387
16876
|
className: 'sort_table_column_all_empty'
|
|
17388
|
-
}, "\u672A\u67E5\u8BE2\u5230\u7ED3\u679C"))
|
|
16877
|
+
}, "\u672A\u67E5\u8BE2\u5230\u7ED3\u679C")), !searchDataSource && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
16878
|
+
className: 'sort_table_column_special'
|
|
16879
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u4EBA\u5458\u65F6\u95F4\u5B57\u6BB5")), /*#__PURE__*/React.createElement("div", {
|
|
16880
|
+
className: 'sort_table_column_all'
|
|
16881
|
+
}, _toConsumableArray(dataSource).filter(function (item) {
|
|
16882
|
+
var _item$title4, _item$title5;
|
|
16883
|
+
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;
|
|
16884
|
+
}).map(function (item) {
|
|
16885
|
+
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
16886
|
+
checked: !item.hidden,
|
|
16887
|
+
onChange: function onChange(e) {
|
|
16888
|
+
_this2.onChange(e, item.title);
|
|
16889
|
+
}
|
|
16890
|
+
}, item.title);
|
|
16891
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
16892
|
+
style: {
|
|
16893
|
+
width: '144px'
|
|
16894
|
+
}
|
|
16895
|
+
}))))), /*#__PURE__*/React.createElement("div", {
|
|
17389
16896
|
className: 'sort_table_content_wrapper'
|
|
17390
16897
|
}, /*#__PURE__*/React.createElement("span", {
|
|
17391
16898
|
className: 'sort_table_content_count'
|
|
@@ -17409,34 +16916,34 @@ var SearchItemTable = /*#__PURE__*/function (_React$Component) {
|
|
|
17409
16916
|
pagination: false,
|
|
17410
16917
|
showHeader: false,
|
|
17411
16918
|
dataSource: onSearchSort ? sortDataSource.filter(function (item) {
|
|
17412
|
-
var _item$
|
|
17413
|
-
return (item === null || item === void 0 ? void 0 : (_item$
|
|
16919
|
+
var _item$title6;
|
|
16920
|
+
return (item === null || item === void 0 ? void 0 : (_item$title6 = item.title) === null || _item$title6 === void 0 ? void 0 : _item$title6.indexOf(onSearchSort)) > -1;
|
|
17414
16921
|
}) : sortDataSource,
|
|
17415
16922
|
columns: this.columns,
|
|
17416
|
-
rowKey: "
|
|
16923
|
+
rowKey: "key",
|
|
16924
|
+
// rowSelection={rowSelection}
|
|
17417
16925
|
components: {
|
|
17418
16926
|
body: {
|
|
17419
16927
|
wrapper: this.DraggableContainer,
|
|
17420
16928
|
row: this.DraggableBodyRow
|
|
17421
16929
|
}
|
|
17422
16930
|
}
|
|
17423
|
-
}))))), /*#__PURE__*/React.createElement("
|
|
16931
|
+
}))))), /*#__PURE__*/React.createElement("img", {
|
|
16932
|
+
width: 32,
|
|
17424
16933
|
onClick: this.showModal,
|
|
17425
|
-
|
|
17426
|
-
|
|
17427
|
-
}
|
|
17428
|
-
}, "\u641C\u7D22\u9879\u8BBE\u7F6E"));
|
|
16934
|
+
src: shezhi
|
|
16935
|
+
}));
|
|
17429
16936
|
}
|
|
17430
16937
|
}]);
|
|
17431
|
-
return
|
|
16938
|
+
return SortableTable;
|
|
17432
16939
|
}(React.Component);
|
|
17433
16940
|
|
|
17434
|
-
var _excluded$
|
|
16941
|
+
var _excluded$d = ["onResize", "width"];
|
|
17435
16942
|
var MemoQueryTable = /*#__PURE__*/React.memo(QueryTable);
|
|
17436
16943
|
var ResizeableTitle$2 = function ResizeableTitle(props) {
|
|
17437
16944
|
var onResize = props.onResize,
|
|
17438
16945
|
width = props.width,
|
|
17439
|
-
restProps = _objectWithoutProperties(props, _excluded$
|
|
16946
|
+
restProps = _objectWithoutProperties(props, _excluded$d);
|
|
17440
16947
|
if (!width) {
|
|
17441
16948
|
return /*#__PURE__*/React.createElement("th", _objectSpread2({}, restProps));
|
|
17442
16949
|
}
|
|
@@ -17481,28 +16988,26 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17481
16988
|
var _useState11 = useState([]),
|
|
17482
16989
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
17483
16990
|
showColumn = _useState12[0],
|
|
17484
|
-
setShowColumns = _useState12[1];
|
|
17485
|
-
var _useState13 = useState([]),
|
|
17486
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
17487
|
-
showSearchFields = _useState14[0],
|
|
17488
|
-
setShowSearchFields = _useState14[1]; //搜索项字段
|
|
16991
|
+
setShowColumns = _useState12[1];
|
|
17489
16992
|
var _props$isPage = props.isPage,
|
|
17490
16993
|
pagination = props.pagination,
|
|
17491
16994
|
tableCode = props.tableCode;
|
|
17492
|
-
var
|
|
17493
|
-
|
|
17494
|
-
height =
|
|
17495
|
-
setHeight =
|
|
16995
|
+
var _useState13 = useState('100vh'),
|
|
16996
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
16997
|
+
height = _useState14[0],
|
|
16998
|
+
setHeight = _useState14[1];
|
|
17496
16999
|
var sortTableRef = useRef(null);
|
|
17497
17000
|
var bsTableCode = tableCode || window.location.hash; //设置列字段的唯一标识
|
|
17498
17001
|
// 获取table高度
|
|
17499
17002
|
var getTableHeight = function getTableHeight() {
|
|
17500
|
-
|
|
17501
|
-
|
|
17502
|
-
|
|
17503
|
-
|
|
17504
|
-
|
|
17505
|
-
|
|
17003
|
+
setTimeout(function () {
|
|
17004
|
+
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
|
|
17005
|
+
var cancelHeight = window.top == window ? 303 : 223;
|
|
17006
|
+
var isFullScreen = window.top.document.fullScreen || window.top.document.webkitIsFullScreen || window.top.document.mozFullScreen;
|
|
17007
|
+
var h = document.body.clientHeight - (((_document$querySelect = document.querySelector(".ant-tabs-tabpane-active .table-bssula-summary")) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.clientHeight) || 0) - (((_document$querySelect2 = document.querySelector(".ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav")) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.clientHeight) || 0) - (((_document$querySelect3 = document.querySelector(".ant-tabs-tabpane-active .ant-form ant-form-horizontal")) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.clientHeight) || 0) - (isFullScreen ? 0 : ((_document$querySelect4 = document.querySelector(".ant-tabs-tabpane-active .ant-pro-page-container-warp")) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.clientHeight) || 0) - cancelHeight + 'px';
|
|
17008
|
+
setHeight(h);
|
|
17009
|
+
setValue(_objectSpread2({}, value));
|
|
17010
|
+
}, 0);
|
|
17506
17011
|
};
|
|
17507
17012
|
//监测是否按下esc键
|
|
17508
17013
|
function checkFull() {
|
|
@@ -17512,8 +17017,8 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17512
17017
|
if (isFull == undefined) isFull = false;
|
|
17513
17018
|
return isFull;
|
|
17514
17019
|
}
|
|
17515
|
-
var getConfigFromlocalstorage = function getConfigFromlocalstorage(
|
|
17516
|
-
var config = localStorage.getItem(
|
|
17020
|
+
var getConfigFromlocalstorage = function getConfigFromlocalstorage() {
|
|
17021
|
+
var config = localStorage.getItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION) || '[]';
|
|
17517
17022
|
var configArray = JSON.parse(config);
|
|
17518
17023
|
var configSetting = configArray.filter(function (item) {
|
|
17519
17024
|
return item.code === bsTableCode;
|
|
@@ -17569,7 +17074,7 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17569
17074
|
columns: _toConsumableArray(props.columns)
|
|
17570
17075
|
}));
|
|
17571
17076
|
var columns = props.columns;
|
|
17572
|
-
var columnConfig = getConfigFromlocalstorage(
|
|
17077
|
+
var columnConfig = getConfigFromlocalstorage();
|
|
17573
17078
|
var showColumns = columnConfig.length ? columnConfig.map(function (item) {
|
|
17574
17079
|
var inner = columns.filter(function (inneritem) {
|
|
17575
17080
|
var innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : inneritem.key || inneritem.dataIndex;
|
|
@@ -17593,26 +17098,10 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17593
17098
|
});
|
|
17594
17099
|
setShowColumns(_toConsumableArray(showColumns));
|
|
17595
17100
|
};
|
|
17596
|
-
var setInitialSearchFieldsInfo = function setInitialSearchFieldsInfo() {
|
|
17597
|
-
//获取搜索字段的缓存配置
|
|
17598
|
-
var _props$fields = props.fields,
|
|
17599
|
-
fields = _props$fields === void 0 ? [] : _props$fields;
|
|
17600
|
-
var searchFieldsConfig = getConfigFromlocalstorage(ENUM.BROWSER_CACHE.SEARCH_FIELDS_CONDITION);
|
|
17601
|
-
var showSearchFields = searchFieldsConfig.length ? searchFieldsConfig.map(function (item) {
|
|
17602
|
-
var inner = fields.filter(function (inneritem) {
|
|
17603
|
-
var innerKey = Array.isArray(inneritem.name) ? JSON.stringify(inneritem.name) : inneritem.name;
|
|
17604
|
-
var itemKey = Array.isArray(item.name) ? JSON.stringify(item.name) : item.name;
|
|
17605
|
-
return innerKey && innerKey === itemKey;
|
|
17606
|
-
})[0];
|
|
17607
|
-
return _objectSpread2(_objectSpread2({}, inner), item);
|
|
17608
|
-
}) : fields;
|
|
17609
|
-
setShowSearchFields(_toConsumableArray(showSearchFields));
|
|
17610
|
-
};
|
|
17611
17101
|
//组件初始挂载
|
|
17612
17102
|
useEffect(function () {
|
|
17613
17103
|
getTableHeight();
|
|
17614
17104
|
setInitialTableInfo();
|
|
17615
|
-
setInitialSearchFieldsInfo();
|
|
17616
17105
|
window.addEventListener('resize', function (e) {
|
|
17617
17106
|
watchWinResize();
|
|
17618
17107
|
});
|
|
@@ -17629,17 +17118,6 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17629
17118
|
JSON.stringify(newKeys) !== JSON.stringify(oldKeys) && setInitialTableInfo();
|
|
17630
17119
|
}
|
|
17631
17120
|
}, [props === null || props === void 0 ? void 0 : props.columns]);
|
|
17632
|
-
useEffect(function () {
|
|
17633
|
-
if ((props === null || props === void 0 ? void 0 : props.fields) && (value === null || value === void 0 ? void 0 : value.fields)) {
|
|
17634
|
-
var newKeys = props.fields.map(function (d) {
|
|
17635
|
-
return Array.isArray(d.name) ? JSON.stringify(d.name) : d.name;
|
|
17636
|
-
});
|
|
17637
|
-
var oldKeys = value.fields.map(function (d) {
|
|
17638
|
-
return Array.isArray(d.name) ? JSON.stringify(d.name) : d.name;
|
|
17639
|
-
});
|
|
17640
|
-
JSON.stringify(newKeys) !== JSON.stringify(oldKeys) && setInitialSearchFieldsInfo();
|
|
17641
|
-
}
|
|
17642
|
-
}, [props === null || props === void 0 ? void 0 : props.fields]);
|
|
17643
17121
|
useEffect(function () {
|
|
17644
17122
|
setInitialTableInfo();
|
|
17645
17123
|
}, [props === null || props === void 0 ? void 0 : props.refreshColumns]);
|
|
@@ -17714,34 +17192,25 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17714
17192
|
return tableProps;
|
|
17715
17193
|
};
|
|
17716
17194
|
var ShowFullScreen = function ShowFullScreen() {
|
|
17717
|
-
var
|
|
17718
|
-
|
|
17719
|
-
|
|
17720
|
-
|
|
17721
|
-
|
|
17722
|
-
|
|
17723
|
-
|
|
17724
|
-
|
|
17725
|
-
|
|
17726
|
-
|
|
17727
|
-
// addTabsNavStyle(isFullScreen);
|
|
17728
|
-
if (contentEle && !_isFullScreen) {
|
|
17729
|
-
var fullScreenEle = contentEle.requestFullscreen || contentEle.mozRequestFullScreen || contentEle.webkitRequestFullScreen || contentEle.msRequestFullscreen;
|
|
17730
|
-
if (fullScreenEle) {
|
|
17731
|
-
fullScreenEle.call(contentEle);
|
|
17732
|
-
setIsFnllScreen(true);
|
|
17733
|
-
// getTableHeight(true);
|
|
17734
|
-
return;
|
|
17735
|
-
}
|
|
17195
|
+
var isFullScreen = window.top.document.fullScreen || window.top.document.webkitIsFullScreen || window.top.document.mozFullScreen;
|
|
17196
|
+
var contentEle = window.top.document.querySelector("body");
|
|
17197
|
+
// addTabsNavStyle(isFullScreen);
|
|
17198
|
+
if (contentEle && !isFullScreen) {
|
|
17199
|
+
var fullScreenEle = contentEle.requestFullscreen || contentEle.mozRequestFullScreen || contentEle.webkitRequestFullScreen || contentEle.msRequestFullscreen;
|
|
17200
|
+
if (fullScreenEle) {
|
|
17201
|
+
fullScreenEle.call(contentEle);
|
|
17202
|
+
setIsFnllScreen(true);
|
|
17203
|
+
// getTableHeight(true);
|
|
17204
|
+
return;
|
|
17736
17205
|
}
|
|
17737
|
-
|
|
17738
|
-
|
|
17739
|
-
|
|
17740
|
-
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
|
|
17744
|
-
|
|
17206
|
+
}
|
|
17207
|
+
if (window.top.document && isFullScreen) {
|
|
17208
|
+
var exitFullScreen = window.top.document.exitFullscreen || window.top.document.mozCancelFullScreen || window.top.document.webkitCancelFullScreen || window.top.document.msExitFullscreen;
|
|
17209
|
+
if (exitFullScreen) {
|
|
17210
|
+
exitFullScreen.call(window.top.document);
|
|
17211
|
+
setIsFnllScreen(false);
|
|
17212
|
+
// getTableHeight();
|
|
17213
|
+
return;
|
|
17745
17214
|
}
|
|
17746
17215
|
}
|
|
17747
17216
|
};
|
|
@@ -17751,28 +17220,16 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17751
17220
|
actionsRender = [].concat(_toConsumableArray(actionsRender), [{
|
|
17752
17221
|
type: 'text',
|
|
17753
17222
|
props: {
|
|
17754
|
-
children: /*#__PURE__*/React.createElement(
|
|
17755
|
-
|
|
17756
|
-
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
17757
|
-
overlay: /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(Menu.Item, null, /*#__PURE__*/React.createElement(SortableTable$1, {
|
|
17758
|
-
ref: sortTableRef,
|
|
17759
|
-
setShowColumns: setShowColumns,
|
|
17760
|
-
showColumn: showColumn,
|
|
17761
|
-
datasource: (value === null || value === void 0 ? void 0 : value.columns) || [],
|
|
17762
|
-
bsTableCode: bsTableCode
|
|
17763
|
-
})), /*#__PURE__*/React.createElement(Menu.Item, null, /*#__PURE__*/React.createElement(SearchItemTable, {
|
|
17764
|
-
ref: sortTableRef,
|
|
17765
|
-
setShowSearchFields: setShowSearchFields,
|
|
17766
|
-
showSearchFields: showSearchFields,
|
|
17767
|
-
datasource: (value === null || value === void 0 ? void 0 : value.fields) || [],
|
|
17768
|
-
bsTableCode: bsTableCode
|
|
17769
|
-
}))),
|
|
17770
|
-
placement: "bottom"
|
|
17223
|
+
children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
17224
|
+
title: "\u5217\u8BBE\u7F6E"
|
|
17771
17225
|
}, /*#__PURE__*/React.createElement("span", {
|
|
17772
17226
|
className: "ant-dropdown-link"
|
|
17773
|
-
}, /*#__PURE__*/React.createElement(
|
|
17774
|
-
|
|
17775
|
-
|
|
17227
|
+
}, /*#__PURE__*/React.createElement(SortableTable$1, {
|
|
17228
|
+
ref: sortTableRef,
|
|
17229
|
+
setShowColumns: setShowColumns,
|
|
17230
|
+
showColumn: showColumn,
|
|
17231
|
+
datasource: (value === null || value === void 0 ? void 0 : value.columns) || [],
|
|
17232
|
+
bsTableCode: bsTableCode
|
|
17776
17233
|
}))))
|
|
17777
17234
|
}
|
|
17778
17235
|
}, {
|
|
@@ -17856,7 +17313,6 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17856
17313
|
}, handleTimeValue()), {}, {
|
|
17857
17314
|
tableProps: setTableProps(),
|
|
17858
17315
|
columns: _toConsumableArray(showColumn),
|
|
17859
|
-
fields: _toConsumableArray(showSearchFields),
|
|
17860
17316
|
ref: props.forwardedRef || refs,
|
|
17861
17317
|
isFullScreen: isFullScreen
|
|
17862
17318
|
});
|
|
@@ -17879,7 +17335,7 @@ var BsSulaQueryTable = (function (props) {
|
|
|
17879
17335
|
summary: props.summary,
|
|
17880
17336
|
statusMapping: props.statusMapping
|
|
17881
17337
|
});
|
|
17882
|
-
}, [value, checkedList, showColumn, props.statusMapping
|
|
17338
|
+
}, [value, checkedList, showColumn, props.statusMapping]);
|
|
17883
17339
|
return /*#__PURE__*/React.createElement(MemoQueryTable, _objectSpread2({}, memoConfig));
|
|
17884
17340
|
});
|
|
17885
17341
|
|
|
@@ -18027,14 +17483,13 @@ function handleUserPhone() {
|
|
|
18027
17483
|
return enStr;
|
|
18028
17484
|
}
|
|
18029
17485
|
var setLoginOutPath = function setLoginOutPath() {
|
|
18030
|
-
if (window.
|
|
17486
|
+
if (window.__POWERED_BY_WUJIE__) {
|
|
17487
|
+
var _window$$wujie;
|
|
17488
|
+
(_window$$wujie = window.$wujie) === null || _window$$wujie === void 0 ? void 0 : _window$$wujie.props.goToLogin();
|
|
17489
|
+
} else {
|
|
18031
17490
|
history.push({
|
|
18032
17491
|
pathname: '/user/login'
|
|
18033
17492
|
});
|
|
18034
|
-
} else {
|
|
18035
|
-
window.parent.postMessage({
|
|
18036
|
-
type: 'go2Login'
|
|
18037
|
-
}, '*');
|
|
18038
17493
|
}
|
|
18039
17494
|
};
|
|
18040
17495
|
var getBreadcrumbNameMap = function getBreadcrumbNameMap(menuData) {
|
|
@@ -19952,7 +19407,7 @@ var CustomerMenuHeader = function CustomerMenuHeader(_ref) {
|
|
|
19952
19407
|
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";
|
|
19953
19408
|
styleInject(css_248z$m);
|
|
19954
19409
|
|
|
19955
|
-
var _excluded$
|
|
19410
|
+
var _excluded$e = ["route"];
|
|
19956
19411
|
var TabPane = Tabs.TabPane;
|
|
19957
19412
|
var UN_LISTTEN_DRP;
|
|
19958
19413
|
var routerArray = [];
|
|
@@ -20566,7 +20021,8 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
20566
20021
|
_createClass(BasicLayout, [{
|
|
20567
20022
|
key: "componentDidMount",
|
|
20568
20023
|
value: function componentDidMount() {
|
|
20569
|
-
var
|
|
20024
|
+
var _window$$wujie,
|
|
20025
|
+
_this2 = this,
|
|
20570
20026
|
_localStorage$getItem;
|
|
20571
20027
|
var _this$props = this.props,
|
|
20572
20028
|
history = _this$props.history,
|
|
@@ -20575,27 +20031,42 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
20575
20031
|
pathToRegexp = _this$props.pathToRegexp;
|
|
20576
20032
|
var istParent = 0;
|
|
20577
20033
|
var self = this;
|
|
20578
|
-
window.top != window &&
|
|
20579
|
-
|
|
20580
|
-
|
|
20581
|
-
|
|
20582
|
-
|
|
20583
|
-
|
|
20584
|
-
|
|
20585
|
-
|
|
20586
|
-
|
|
20587
|
-
|
|
20588
|
-
|
|
20589
|
-
|
|
20034
|
+
// window.top != window &&
|
|
20035
|
+
// window.addEventListener('message', function (e) {
|
|
20036
|
+
// istParent = 1;
|
|
20037
|
+
// if (localStorage.getItem(ENUM.BROWSER_CACHE.CHILD_APP_BACK)) {
|
|
20038
|
+
// localStorage.removeItem(ENUM.BROWSER_CACHE.CHILD_APP_BACK);
|
|
20039
|
+
// } else {
|
|
20040
|
+
// localStorage.setItem('isTabChange', true);
|
|
20041
|
+
// }
|
|
20042
|
+
// if (typeof e.data === 'string') {
|
|
20043
|
+
// let newKey = encodeUrlQuery(e.data.replace(/^\/\w+\//, '/'));
|
|
20044
|
+
// history.push(newKey);
|
|
20045
|
+
// } else {
|
|
20046
|
+
// const info = e.data;
|
|
20047
|
+
// if (info.type === 'remove') {
|
|
20048
|
+
// self.tabActions['remove'](info.key.replace(/^\/\w+\//, '/'));
|
|
20049
|
+
// }
|
|
20050
|
+
// }
|
|
20051
|
+
// });
|
|
20052
|
+
(_window$$wujie = window.$wujie) === null || _window$$wujie === void 0 ? void 0 : _window$$wujie.bus.$on("main-route-change", function (appname, info) {
|
|
20053
|
+
console.log('$on main route change ----------------------------', appname, info);
|
|
20054
|
+
if (appname === itemPath) {
|
|
20055
|
+
istParent = 1;
|
|
20056
|
+
if (info.type === 'main') {
|
|
20057
|
+
var newPath = encodeUrlQuery(info.path);
|
|
20058
|
+
history.push(newPath);
|
|
20059
|
+
}
|
|
20590
20060
|
if (info.type === 'remove') {
|
|
20591
|
-
self.tabActions['remove'](info.
|
|
20061
|
+
self.tabActions['remove'](info.path);
|
|
20592
20062
|
}
|
|
20593
20063
|
}
|
|
20594
20064
|
});
|
|
20595
20065
|
UN_LISTTEN_DRP = history.listen(function (route) {
|
|
20596
|
-
if (window.__POWERED_BY_QIANKUN__) {
|
|
20597
|
-
|
|
20598
|
-
}
|
|
20066
|
+
// if ((window as any).__POWERED_BY_QIANKUN__) {
|
|
20067
|
+
// if (window.location.href.indexOf(`/${itemPath}`) === -1) return;
|
|
20068
|
+
// }
|
|
20069
|
+
if (route.pathname.startsWith("/".concat(itemPath, "/"))) return;
|
|
20599
20070
|
var _this2$state = _this2.state,
|
|
20600
20071
|
listenRouterState = _this2$state.listenRouterState,
|
|
20601
20072
|
listenRouterKey = _this2$state.listenRouterKey,
|
|
@@ -20614,8 +20085,10 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
20614
20085
|
currentKey = decodeURIComponent(route.pathname + _this2.parseQueryString(route.search));
|
|
20615
20086
|
}
|
|
20616
20087
|
if (!istParent) {
|
|
20088
|
+
var _window$$wujie2;
|
|
20617
20089
|
if (route.pathname === '/') return;
|
|
20618
|
-
window
|
|
20090
|
+
(_window$$wujie2 = window.$wujie) === null || _window$$wujie2 === void 0 ? void 0 : _window$$wujie2.bus.$emit('sub-route-change', itemPath, currentKey);
|
|
20091
|
+
// window.parent.postMessage(`/parent/${itemPath}${currentKey}`, '*');
|
|
20619
20092
|
}
|
|
20620
20093
|
// 防止出错
|
|
20621
20094
|
if (listenRouterKey.length !== listenRouterState.length) {
|
|
@@ -20657,28 +20130,24 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
20657
20130
|
lastTwoRouterArray.shift();
|
|
20658
20131
|
if (!localStorage.getItem('isTabChange') && !localStorage.getItem('isMenuClick')) {
|
|
20659
20132
|
if (lastTwoRouterArray[0] && typeof lastTwoRouterArray[0] === 'string') {
|
|
20133
|
+
var _route$state;
|
|
20660
20134
|
var needRemoveKeyArray = hideMenuArray.filter(function (itemRoute) {
|
|
20661
20135
|
return pathToRegexp(itemRoute.path || '').test(lastTwoRouterArray[0]);
|
|
20662
20136
|
});
|
|
20663
20137
|
// lastTwoRouterArray[0] != lastTwoRouterArray[1] 该判断条件用于判断是否是tab删除操作,如果是tab页删除操作,删除的是不是最后一个打开的tab页,执行history.push会导致错误的将最后打开的那个tab页也删除掉
|
|
20664
|
-
if (needRemoveKeyArray.length && lastTwoRouterArray[0] != lastTwoRouterArray[1]) {
|
|
20665
|
-
|
|
20666
|
-
var
|
|
20667
|
-
|
|
20668
|
-
|
|
20669
|
-
|
|
20670
|
-
|
|
20671
|
-
|
|
20672
|
-
|
|
20673
|
-
|
|
20674
|
-
|
|
20675
|
-
|
|
20676
|
-
|
|
20677
|
-
pathname = _ref6[0];
|
|
20678
|
-
return pathname && pathname !== lastTwoRouterArray[0];
|
|
20679
|
-
});
|
|
20680
|
-
}
|
|
20681
|
-
}
|
|
20138
|
+
if (needRemoveKeyArray.length && lastTwoRouterArray[0] != lastTwoRouterArray[1] && !((_route$state = route.state) === null || _route$state === void 0 ? void 0 : _route$state.thisHideInMenuDoNotClose)) {
|
|
20139
|
+
newListenRouterState = newListenRouterState.filter(function (item) {
|
|
20140
|
+
var _ref3 = item.key ? item.key.split('?') : [],
|
|
20141
|
+
_ref4 = _slicedToArray(_ref3, 1),
|
|
20142
|
+
pathname = _ref4[0];
|
|
20143
|
+
return pathname && pathname !== lastTwoRouterArray[0];
|
|
20144
|
+
});
|
|
20145
|
+
newListenRouterKey = newListenRouterKey.filter(function (item) {
|
|
20146
|
+
var _ref5 = item ? item.split('?') : [],
|
|
20147
|
+
_ref6 = _slicedToArray(_ref5, 1),
|
|
20148
|
+
pathname = _ref6[0];
|
|
20149
|
+
return pathname && pathname !== lastTwoRouterArray[0];
|
|
20150
|
+
});
|
|
20682
20151
|
}
|
|
20683
20152
|
}
|
|
20684
20153
|
// refs?.tableRef?.current?.refreshTable();
|
|
@@ -20750,7 +20219,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
20750
20219
|
}); // 添加数据大屏
|
|
20751
20220
|
var _this$props3 = this.props,
|
|
20752
20221
|
route = _this$props3.route,
|
|
20753
|
-
restPrpos = _objectWithoutProperties(_this$props3, _excluded$
|
|
20222
|
+
restPrpos = _objectWithoutProperties(_this$props3, _excluded$e);
|
|
20754
20223
|
var exist = route.routes.find(function (route) {
|
|
20755
20224
|
return route.path === '/homePage/data-show';
|
|
20756
20225
|
});
|
|
@@ -21155,6 +20624,7 @@ var WrapperComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
21155
20624
|
getDictionaryTextByValue = _this$props4.getDictionaryTextByValue,
|
|
21156
20625
|
timeFormat = _this$props4.timeFormat,
|
|
21157
20626
|
transparentProps = _this$props4.transparentProps;
|
|
20627
|
+
console.log('child wrapper conpent', this.props);
|
|
21158
20628
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(item.content, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
21159
20629
|
getDictionarySource: getDictionarySource,
|
|
21160
20630
|
getDictionaryTextByValue: getDictionaryTextByValue,
|
|
@@ -21546,10 +21016,10 @@ var index$6 = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
21546
21016
|
}))))));
|
|
21547
21017
|
});
|
|
21548
21018
|
|
|
21549
|
-
var _excluded$
|
|
21019
|
+
var _excluded$f = ["children"];
|
|
21550
21020
|
var Drawer = (function (props) {
|
|
21551
21021
|
var children = props.children,
|
|
21552
|
-
restProps = _objectWithoutProperties(props, _excluded$
|
|
21022
|
+
restProps = _objectWithoutProperties(props, _excluded$f);
|
|
21553
21023
|
return /*#__PURE__*/React.createElement(Drawer$1, _objectSpread2({
|
|
21554
21024
|
mask: true,
|
|
21555
21025
|
closable: false,
|
|
@@ -29482,9 +28952,7 @@ var FieldsSettingsTable = (function (props) {
|
|
|
29482
28952
|
_props$codeProps = props.codeProps,
|
|
29483
28953
|
codeProps = _props$codeProps === void 0 ? '' : _props$codeProps,
|
|
29484
28954
|
moduleType = props.moduleType,
|
|
29485
|
-
moduleRelationId = props.moduleRelationId
|
|
29486
|
-
_props$tableFlag = props.tableFlag,
|
|
29487
|
-
tableFlag = _props$tableFlag === void 0 ? false : _props$tableFlag;
|
|
28955
|
+
moduleRelationId = props.moduleRelationId;
|
|
29488
28956
|
var ref = useRef(null);
|
|
29489
28957
|
var _useState = useState({
|
|
29490
28958
|
visible: false,
|
|
@@ -29573,9 +29041,6 @@ var FieldsSettingsTable = (function (props) {
|
|
|
29573
29041
|
render: function render(_ref2) {
|
|
29574
29042
|
var text = _ref2.text,
|
|
29575
29043
|
record = _ref2.record;
|
|
29576
|
-
if (tableFlag) {
|
|
29577
|
-
return /*#__PURE__*/React.createElement("div", null, " \u5217\u8868\uFF1A", "{\"key\": \"extensionFields,".concat(record.code, "\",\"dataIndex\": \"extensionFields,").concat(record.code, "\",\"title\": \"").concat(record.name, "\"},"));
|
|
29578
|
-
}
|
|
29579
29044
|
if (!codeProps.columns) {
|
|
29580
29045
|
return /*#__PURE__*/React.createElement("div", null, "\u8868\u5355\uFF1A", "{\"name\": \"extensionFields,".concat(record.code, "\",\"label\": \"").concat(record.name, "\"},"));
|
|
29581
29046
|
}
|
|
@@ -29811,10 +29276,7 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
|
|
|
29811
29276
|
codeProps = props.codeProps,
|
|
29812
29277
|
customerFields = props.customerFields,
|
|
29813
29278
|
initialSetting = props.initialSetting,
|
|
29814
|
-
pageType = props.pageType
|
|
29815
|
-
_props$detailTablesSe = props.detailTablesSetting,
|
|
29816
|
-
detailTablesSetting = _props$detailTablesSe === void 0 ? [] : _props$detailTablesSe,
|
|
29817
|
-
saveTableCallBack = props.saveTableCallBack;
|
|
29279
|
+
pageType = props.pageType;
|
|
29818
29280
|
var codeFilter = {};
|
|
29819
29281
|
if (codeProps.columns) {
|
|
29820
29282
|
// table
|
|
@@ -29838,6 +29300,7 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
|
|
|
29838
29300
|
fields: codeProps.fields
|
|
29839
29301
|
}).fields;
|
|
29840
29302
|
}
|
|
29303
|
+
console.log('codeFilter', codeFilter);
|
|
29841
29304
|
var styleRef = useRef(null);
|
|
29842
29305
|
var _useState = useState(false),
|
|
29843
29306
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -29859,18 +29322,6 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
|
|
|
29859
29322
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
29860
29323
|
moduleParams = _useState10[0],
|
|
29861
29324
|
setModuleParams = _useState10[1];
|
|
29862
|
-
var _useState11 = useState('main'),
|
|
29863
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
29864
|
-
activeKey = _useState12[0],
|
|
29865
|
-
setActiveKey = _useState12[1]; //默认详情页配置
|
|
29866
|
-
var _useState13 = useState({}),
|
|
29867
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
29868
|
-
tablesConfigParams = _useState14[0],
|
|
29869
|
-
setTablesConfigParams = _useState14[1];
|
|
29870
|
-
var _useState15 = useState([]),
|
|
29871
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
29872
|
-
tableJsonEditorValsArr = _useState16[0],
|
|
29873
|
-
setTableJsonEditorValsArr = _useState16[1];
|
|
29874
29325
|
useEffect(function () {
|
|
29875
29326
|
Promise.all([axios.get("/basic/flow/businessFieldGroup/one?moduleType=2&layoutPoint=".concat(pageType))]).then(function (_ref2) {
|
|
29876
29327
|
var _ref3 = _slicedToArray(_ref2, 1),
|
|
@@ -29894,56 +29345,6 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
|
|
|
29894
29345
|
}
|
|
29895
29346
|
});
|
|
29896
29347
|
}, []);
|
|
29897
|
-
useEffect(function () {
|
|
29898
|
-
//明细表的配置数据
|
|
29899
|
-
var axiosArr = detailTablesSetting.map(function (item) {
|
|
29900
|
-
return axios.get("/basic/flow/businessFieldGroup/one?moduleType=2&layoutPoint=".concat(item.tableCode));
|
|
29901
|
-
});
|
|
29902
|
-
Promise.all(axiosArr).then(function (_ref5) {
|
|
29903
|
-
var _ref6 = _toArray(_ref5),
|
|
29904
|
-
resArr = _ref6.slice(0);
|
|
29905
|
-
detailTablesSetting.map(function (item, index) {
|
|
29906
|
-
var _resArr$index;
|
|
29907
|
-
var _ref7 = ((_resArr$index = resArr[index]) === null || _resArr$index === void 0 ? void 0 : _resArr$index.data) || {},
|
|
29908
|
-
code = _ref7.code,
|
|
29909
|
-
data = _ref7.data;
|
|
29910
|
-
if (data) {
|
|
29911
|
-
var businessType = data.businessType,
|
|
29912
|
-
fieldGroup = data.code,
|
|
29913
|
-
moduleType = data.moduleType;
|
|
29914
|
-
setTablesConfigParams(_objectSpread2(_objectSpread2({}, tablesConfigParams), {}, _defineProperty({}, item.tableCode, {
|
|
29915
|
-
businessType: businessType,
|
|
29916
|
-
fieldGroup: fieldGroup,
|
|
29917
|
-
moduleType: moduleType,
|
|
29918
|
-
tableFlag: true
|
|
29919
|
-
})));
|
|
29920
|
-
}
|
|
29921
|
-
});
|
|
29922
|
-
});
|
|
29923
|
-
var detailTableCodeFilter = detailTablesSetting.map(function (item) {
|
|
29924
|
-
if ((item === null || item === void 0 ? void 0 : item.initialSetting) && (item === null || item === void 0 ? void 0 : item.initialSetting.length)) {
|
|
29925
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
29926
|
-
columns: item === null || item === void 0 ? void 0 : item.initialSetting
|
|
29927
|
-
});
|
|
29928
|
-
}
|
|
29929
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
29930
|
-
columns: item === null || item === void 0 ? void 0 : item.columns.map(function (childItem) {
|
|
29931
|
-
return {
|
|
29932
|
-
key: childItem.key || childItem.dataIndex,
|
|
29933
|
-
dataIndex: childItem.dataIndex || childItem.key,
|
|
29934
|
-
isStaticCode: true,
|
|
29935
|
-
title: childItem.title
|
|
29936
|
-
};
|
|
29937
|
-
})
|
|
29938
|
-
});
|
|
29939
|
-
});
|
|
29940
|
-
setTableJsonEditorValsArr(_toConsumableArray(detailTableCodeFilter));
|
|
29941
|
-
detailTableCodeFilter.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
|
-
onClickRunDetailTables(item.initialSetting, false, item.tableCode, detailTableCodeFilter);
|
|
29944
|
-
}
|
|
29945
|
-
});
|
|
29946
|
-
}, [detailTablesSetting.length]);
|
|
29947
29348
|
var onClickRun = function onClickRun(value, isSave) {
|
|
29948
29349
|
setJsonEditorVal(value);
|
|
29949
29350
|
try {
|
|
@@ -29953,40 +29354,6 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
|
|
|
29953
29354
|
message.error(e);
|
|
29954
29355
|
}
|
|
29955
29356
|
};
|
|
29956
|
-
//明细表保存
|
|
29957
|
-
var onClickRunDetailTables = function onClickRunDetailTables(value, isSave, tableCode, tableSouce) {
|
|
29958
|
-
var targetCode = tableCode || activeKey;
|
|
29959
|
-
var targetTableSource = tableSouce || tableJsonEditorValsArr;
|
|
29960
|
-
var newArr = targetTableSource.map(function (item) {
|
|
29961
|
-
if (item.tableCode == targetCode) {
|
|
29962
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
29963
|
-
columns: value
|
|
29964
|
-
});
|
|
29965
|
-
}
|
|
29966
|
-
return item;
|
|
29967
|
-
});
|
|
29968
|
-
setTableJsonEditorValsArr(_toConsumableArray(newArr));
|
|
29969
|
-
try {
|
|
29970
|
-
var target = targetTableSource.find(function (item) {
|
|
29971
|
-
return item.tableCode == targetCode;
|
|
29972
|
-
});
|
|
29973
|
-
var _codeProps = {
|
|
29974
|
-
fields: [],
|
|
29975
|
-
columns: target === null || target === void 0 ? void 0 : target.columns
|
|
29976
|
-
};
|
|
29977
|
-
var newValue = {
|
|
29978
|
-
fields: [],
|
|
29979
|
-
columns: value
|
|
29980
|
-
};
|
|
29981
|
-
var result = hanleCallbackValue(_codeProps, newValue, target === null || target === void 0 ? void 0 : target.customerFields);
|
|
29982
|
-
saveTableCallBack({
|
|
29983
|
-
columns: result.columns,
|
|
29984
|
-
tableCode: targetCode
|
|
29985
|
-
}, isSave, value);
|
|
29986
|
-
} catch (e) {
|
|
29987
|
-
message.error(e);
|
|
29988
|
-
}
|
|
29989
|
-
};
|
|
29990
29357
|
React.useEffect(function () {
|
|
29991
29358
|
localStorage.setItem('jsonEditorVal', JSON.stringify(jsonEditorVal || {}));
|
|
29992
29359
|
}, [jsonEditorVal]);
|
|
@@ -30008,26 +29375,9 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
|
|
|
30008
29375
|
return setVisible(false);
|
|
30009
29376
|
},
|
|
30010
29377
|
className: 'customFieldsDrawer'
|
|
30011
|
-
},
|
|
30012
|
-
|
|
30013
|
-
|
|
30014
|
-
fontSize: "16px",
|
|
30015
|
-
fontWeight: "bolder"
|
|
30016
|
-
}
|
|
30017
|
-
}, "\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.createElement(FieldsSettingsTable, _objectSpread2({}, tableParams)), /*#__PURE__*/React.createElement(Editor, {
|
|
30018
|
-
type: "table",
|
|
30019
|
-
onRun: onClickRun,
|
|
30020
|
-
value: jsonEditorVal,
|
|
30021
|
-
shallowHeight: height
|
|
30022
|
-
})), detailTablesSetting.length > 0 && /*#__PURE__*/React.createElement(Tabs, {
|
|
30023
|
-
defaultActiveKey: activeKey,
|
|
30024
|
-
onChange: function onChange(v) {
|
|
30025
|
-
return setActiveKey(v);
|
|
30026
|
-
}
|
|
30027
|
-
}, /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
30028
|
-
tab: "\u8BE6\u60C5\u9875\u914D\u7F6E",
|
|
30029
|
-
key: "main"
|
|
30030
|
-
}, isEmpty(moduleParams) ? /*#__PURE__*/React.createElement("div", {
|
|
29378
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
29379
|
+
ref: styleRef
|
|
29380
|
+
}), isEmpty(moduleParams) ? /*#__PURE__*/React.createElement("div", {
|
|
30031
29381
|
style: {
|
|
30032
29382
|
padding: "10px 0",
|
|
30033
29383
|
fontSize: "16px",
|
|
@@ -30038,23 +29388,7 @@ var JsonQueryTable = /*#__PURE__*/React.memo(function (props) {
|
|
|
30038
29388
|
onRun: onClickRun,
|
|
30039
29389
|
value: jsonEditorVal,
|
|
30040
29390
|
shallowHeight: height
|
|
30041
|
-
})),
|
|
30042
|
-
return /*#__PURE__*/React.createElement(Tabs.TabPane, {
|
|
30043
|
-
tab: k.title,
|
|
30044
|
-
key: k.tableCode
|
|
30045
|
-
}, !tablesConfigParams[k.tableCode] ? /*#__PURE__*/React.createElement("div", {
|
|
30046
|
-
style: {
|
|
30047
|
-
padding: "10px 0",
|
|
30048
|
-
fontSize: "16px",
|
|
30049
|
-
fontWeight: "bolder"
|
|
30050
|
-
}
|
|
30051
|
-
}, "\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.createElement(FieldsSettingsTable, _objectSpread2({}, tablesConfigParams[k.tableCode])), /*#__PURE__*/React.createElement(Editor, {
|
|
30052
|
-
type: "table",
|
|
30053
|
-
onRun: onClickRunDetailTables,
|
|
30054
|
-
value: k.columns,
|
|
30055
|
-
shallowHeight: height
|
|
30056
|
-
}));
|
|
30057
|
-
}))), !visible && isAdmin() && /*#__PURE__*/React.createElement(ConfigButton, {
|
|
29391
|
+
})), !visible && isAdmin() && /*#__PURE__*/React.createElement(ConfigButton, {
|
|
30058
29392
|
type: 'primary',
|
|
30059
29393
|
onClick: function onClick() {
|
|
30060
29394
|
return setVisible(true);
|