@bit-sun/business-component 2.3.22 → 2.3.23-beta01
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/common/ENUM.d.ts +40 -0
- package/dist/components/Business/AddSelectBusiness/index.d.ts +4 -0
- package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +5 -0
- package/dist/components/Business/BsLayouts/Components/AllFunc/index.d.ts +4 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +4 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +17 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +30 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +4 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +3 -0
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +4 -0
- package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +5 -0
- package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +3 -0
- package/dist/components/Business/BsLayouts/Components/RightContent/index.d.ts +8 -0
- package/dist/components/Business/BsLayouts/Components/SearchFunc/index.d.ts +8 -0
- package/dist/components/Business/BsLayouts/index.d.ts +18 -0
- package/dist/components/Business/BsLayouts/service.d.ts +1 -0
- package/dist/components/Business/BsLayouts/utils.d.ts +10 -0
- package/dist/components/Business/BsSulaQueryTable/SearchItemSetting.d.ts +60 -0
- package/dist/components/Business/BsSulaQueryTable/index.d.ts +3 -0
- package/dist/components/Business/BsSulaQueryTable/setting.d.ts +60 -0
- package/dist/components/Business/BsSulaQueryTable/utils.d.ts +99 -0
- package/dist/components/Business/CommodityEntry/index.d.ts +3 -0
- package/dist/components/Business/CommonAlert/index.d.ts +4 -0
- package/dist/components/Business/CommonGuideWrapper/index.d.ts +6 -0
- package/dist/components/Business/DetailPageWrapper/index.d.ts +10 -0
- package/dist/components/Business/DetailPageWrapper/utils.d.ts +8 -0
- package/dist/components/Business/HomePageWrapper/index.d.ts +4 -0
- package/dist/components/Business/JsonQueryTable/components/FieldsModifyModal.d.ts +3 -0
- package/dist/components/Business/JsonQueryTable/components/FieldsSettingsTable.d.ts +3 -0
- package/dist/components/Business/JsonQueryTable/components/Formula.d.ts +7 -0
- package/dist/components/Business/JsonQueryTable/components/MaintainOptions.d.ts +3 -0
- package/dist/components/Business/JsonQueryTable/drawer/index.d.ts +3 -0
- package/dist/components/Business/JsonQueryTable/function.d.ts +37 -0
- package/dist/components/Business/JsonQueryTable/index.d.ts +4 -0
- package/dist/components/Business/JsonQueryTable/static.d.ts +43 -0
- package/dist/components/Business/SearchSelect/BusinessUtils.d.ts +5 -0
- package/dist/components/Business/SearchSelect/common.d.ts +25 -0
- package/dist/components/Business/SearchSelect/index.d.ts +3 -0
- package/dist/components/Business/SearchSelect/utils.d.ts +5 -0
- package/dist/components/Business/StateFlow/index.d.ts +4 -0
- package/dist/components/Business/TreeSearchSelect/index.d.ts +3 -0
- package/dist/components/Business/TreeSearchSelect/utils.d.ts +4 -0
- package/dist/components/Business/columnSettingTable/columnSetting.d.ts +54 -0
- package/dist/components/Business/columnSettingTable/index.d.ts +16 -0
- package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +17 -0
- package/dist/components/Business/columnSettingTable/utils.d.ts +9 -0
- package/dist/components/Business/moreTreeTable/FixedScrollBar.d.ts +3 -0
- package/dist/components/Business/moreTreeTable/hooks/useSticky.d.ts +8 -0
- package/dist/components/Business/moreTreeTable/index.d.ts +4 -0
- package/dist/components/Business/moreTreeTable/utils.d.ts +9 -0
- package/dist/components/Functional/AddSelect/helps.d.ts +14 -0
- package/dist/components/Functional/AddSelect/index.d.ts +4 -0
- package/dist/components/Functional/BillEntry/index.d.ts +4 -0
- package/dist/components/Functional/BsAntdSula/BsCascader/index.d.ts +18 -0
- package/dist/components/Functional/BsAntdSula/index.d.ts +1 -0
- package/dist/components/Functional/DataImport/index.d.ts +144 -0
- package/dist/components/Functional/DataValidation/index.d.ts +144 -0
- package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +13 -0
- package/dist/components/Functional/QueryMutipleInput/index.d.ts +6 -0
- package/dist/components/Functional/SearchSelect/index.d.ts +4 -0
- package/dist/components/Functional/SearchSelect/utils.d.ts +1 -0
- package/dist/components/Functional/TreeSearchSelect/index.d.ts +3 -0
- package/dist/components/Solution/RuleComponent/Formula.d.ts +9 -0
- package/dist/components/Solution/RuleComponent/InnerSelect.d.ts +12 -0
- package/dist/components/Solution/RuleComponent/services.d.ts +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.esm.js +31339 -0
- package/dist/index.js +31387 -0
- package/dist/plugin/TableColumnSetting/index.d.ts +64 -0
- package/dist/plugin/TableColumnSetting/utils.d.ts +1 -0
- package/dist/utils/CheckOneUser/index.d.ts +2 -0
- package/dist/utils/CustomLoginInfo.d.ts +11 -0
- package/dist/utils/LocalstorageUtils.d.ts +17 -0
- package/dist/utils/TableUtils.d.ts +11 -0
- package/dist/utils/checkUtils.d.ts +3 -0
- package/dist/utils/enumConfig.d.ts +12 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/requestUtils.d.ts +29 -0
- package/dist/utils/utils.d.ts +17 -0
- package/dist 2/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +4 -0
- package/dist 2/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +4 -0
- package/dist 2/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +3 -0
- package/package.json +3 -2
- package/src/components/Business/AddSelectBusiness/index.tsx +3 -2
- package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +9 -7
- package/src/components/Business/BsSulaQueryTable/index.tsx +11 -8
- package/src/components/Business/BsSulaQueryTable/setting.tsx +7 -5
- package/src/components/Business/JsonQueryTable/components/Formula.tsx +3 -2
- package/src/components/Business/JsonQueryTable/index.tsx +8 -6
- package/src/components/Business/JsonQueryTable/static.ts +36 -0
- package/src/components/Business/SearchSelect/BusinessUtils.ts +74 -0
- package/src/components/Business/SearchSelect/index.md +58 -0
- package/src/components/Business/SearchSelect/utils.ts +3 -2
- package/src/components/Business/TreeSearchSelect/index.md +29 -0
- package/src/components/Business/TreeSearchSelect/utils.ts +29 -0
- package/src/components/Business/columnSettingTable/columnSetting.tsx +5 -4
- package/src/components/Business/columnSettingTable/index.tsx +3 -2
- package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +3 -2
- package/src/components/Functional/AddSelect/helps.ts +2 -1
- package/src/components/Functional/AddSelect/index.tsx +3 -2
- package/src/components/Functional/BillEntry/index.tsx +3 -2
- package/src/components/Functional/DataImport/index.tsx +2 -1
- package/src/components/Functional/DataValidation/index.tsx +2 -1
- package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +2 -1
- package/src/components/Functional/SearchSelect/index.tsx +18 -12
- package/src/components/Functional/TreeSearchSelect/index.tsx +7 -5
- package/src/components/Solution/RuleComponent/InnerSelect.tsx +62 -0
- package/src/components/Solution/RuleComponent/index.js +59 -18
- package/src/components/Solution/RuleComponent/ruleFiled.js +202 -28
- package/src/components/Solution/RuleComponent/util.js +4 -0
- package/src/plugin/TableColumnSetting/index.tsx +4 -3
- package/src/utils/CustomLoginInfo.ts +55 -0
- package/src/utils/requestUtils.ts +139 -7
- package/src/utils/utils.ts +0 -21
|
@@ -31,6 +31,8 @@ import {
|
|
|
31
31
|
getSpecialPropertyCode,
|
|
32
32
|
getPropertyCode,
|
|
33
33
|
isObj,
|
|
34
|
+
dateFormat,
|
|
35
|
+
fullDateFormat
|
|
34
36
|
} from './util';
|
|
35
37
|
import { getDictionarySource, uuid } from '../../../utils/utils';
|
|
36
38
|
import {
|
|
@@ -42,6 +44,7 @@ import {
|
|
|
42
44
|
import { request } from 'bssula';
|
|
43
45
|
import Formula from './Formula';
|
|
44
46
|
import RenderSpecificAction from './renderSpecificAction';
|
|
47
|
+
import InnerSelect from './InnerSelect';
|
|
45
48
|
|
|
46
49
|
const { RangePicker } = DatePicker;
|
|
47
50
|
|
|
@@ -655,7 +658,7 @@ class RuleObjectComponent extends Component {
|
|
|
655
658
|
this.handleLogicalTypeChange(itemDetail, 'or');
|
|
656
659
|
}}
|
|
657
660
|
>
|
|
658
|
-
|
|
661
|
+
或者
|
|
659
662
|
</p>
|
|
660
663
|
<p
|
|
661
664
|
className={'choose_logical_type'}
|
|
@@ -663,7 +666,7 @@ class RuleObjectComponent extends Component {
|
|
|
663
666
|
this.handleLogicalTypeChange(itemDetail, 'and');
|
|
664
667
|
}}
|
|
665
668
|
>
|
|
666
|
-
|
|
669
|
+
并且
|
|
667
670
|
</p>
|
|
668
671
|
</div>
|
|
669
672
|
}
|
|
@@ -674,7 +677,7 @@ class RuleObjectComponent extends Component {
|
|
|
674
677
|
type="link"
|
|
675
678
|
className={'logical_item_btn'}
|
|
676
679
|
>
|
|
677
|
-
{itemDetail?.operationCode == 'or' ? '
|
|
680
|
+
{itemDetail?.operationCode == 'or' ? '或者' : '并且'}
|
|
678
681
|
<DownOutlined style={{ marginLeft: '6px' }} />
|
|
679
682
|
</Button>
|
|
680
683
|
</Popover>
|
|
@@ -1046,8 +1049,10 @@ class RuleObjectComponent extends Component {
|
|
|
1046
1049
|
)) ||
|
|
1047
1050
|
null}
|
|
1048
1051
|
{/* 输入/日期 */}
|
|
1049
|
-
{(ites?.inputType === 10 && ites?.valueType === 41 && (
|
|
1052
|
+
{(ites?.inputType === 10 && (ites?.valueType === 41 || ites?.valueType === 32) && (
|
|
1050
1053
|
<DatePicker
|
|
1054
|
+
showTime={dataTypeCode == 32}
|
|
1055
|
+
format={dataTypeCode == 41 ? dateFormat : fullDateFormat}
|
|
1051
1056
|
disabled={disabled}
|
|
1052
1057
|
defaultValue={ites.defaultValue}
|
|
1053
1058
|
style={style2}
|
|
@@ -1115,26 +1120,17 @@ class RuleObjectComponent extends Component {
|
|
|
1115
1120
|
{/* 单选/多选 数据字典 */}
|
|
1116
1121
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
1117
1122
|
ites?.choiceType === 20 && (
|
|
1118
|
-
<
|
|
1123
|
+
<InnerSelect
|
|
1119
1124
|
disabled={disabled}
|
|
1120
|
-
{
|
|
1121
|
-
? {
|
|
1122
|
-
mode: 'multiple',
|
|
1123
|
-
}
|
|
1124
|
-
: {})}
|
|
1125
|
+
inputType={ites?.inputType}
|
|
1125
1126
|
defaultValue={ites.defaultValue}
|
|
1126
|
-
|
|
1127
|
+
styleCommon={styleCommon}
|
|
1127
1128
|
value={showValue(ites.code)}
|
|
1128
1129
|
onChange={(value) => {
|
|
1129
1130
|
handleEdit(ites.code, value);
|
|
1130
1131
|
}}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
<Select.Option key={it.value} value={it.value}>
|
|
1134
|
-
{it.text}
|
|
1135
|
-
</Select.Option>
|
|
1136
|
-
))}
|
|
1137
|
-
</Select>
|
|
1132
|
+
dictionaryCode={ites.dictionaryCode}
|
|
1133
|
+
/>
|
|
1138
1134
|
)) ||
|
|
1139
1135
|
null}
|
|
1140
1136
|
{/* 单选/多选 仓库选择器(物理仓) */}
|
|
@@ -1525,6 +1521,23 @@ class RuleObjectComponent extends Component {
|
|
|
1525
1521
|
/>
|
|
1526
1522
|
)) ||
|
|
1527
1523
|
null}
|
|
1524
|
+
{/* 单选/多选 结算组织选择器 */}
|
|
1525
|
+
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
1526
|
+
ites?.choiceType === 290 && (
|
|
1527
|
+
<BusinessTreeSearchSelect
|
|
1528
|
+
disabled={disabled}
|
|
1529
|
+
treeCheckable={ites?.inputType === 30}
|
|
1530
|
+
businessType="settle-organization"
|
|
1531
|
+
labelInValue={true}
|
|
1532
|
+
value={showValue(ites.code)}
|
|
1533
|
+
style={styleCommon}
|
|
1534
|
+
onChange={(value) => {
|
|
1535
|
+
handleEdit(ites.code, value);
|
|
1536
|
+
}}
|
|
1537
|
+
getPopupContainer={() => document.body}
|
|
1538
|
+
/>
|
|
1539
|
+
)) ||
|
|
1540
|
+
null}
|
|
1528
1541
|
{/* 单选/多选 配送方式选择器 */}
|
|
1529
1542
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
1530
1543
|
ites?.choiceType === 310 && (
|
|
@@ -1553,6 +1566,34 @@ class RuleObjectComponent extends Component {
|
|
|
1553
1566
|
/>
|
|
1554
1567
|
)) ||
|
|
1555
1568
|
null}
|
|
1569
|
+
{/* 单选/多选 角色选择器 */}
|
|
1570
|
+
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
1571
|
+
ites?.choiceType === 360 && (
|
|
1572
|
+
<BusinessSearchSelect
|
|
1573
|
+
selectBusinessType="role"
|
|
1574
|
+
selectProps={{
|
|
1575
|
+
style: styleCommon,
|
|
1576
|
+
placeholder: '请选择角色',
|
|
1577
|
+
...(ites?.inputType === 30
|
|
1578
|
+
? {
|
|
1579
|
+
mode: 'multiple',
|
|
1580
|
+
maxTagCount: 1,
|
|
1581
|
+
}
|
|
1582
|
+
: {}),
|
|
1583
|
+
}}
|
|
1584
|
+
disabled={disabled}
|
|
1585
|
+
labelInValue={true}
|
|
1586
|
+
value={showValue(ites.code)}
|
|
1587
|
+
requestConfig={{
|
|
1588
|
+
filterInit: 'qp-code-in',
|
|
1589
|
+
}}
|
|
1590
|
+
onChange={(value) => {
|
|
1591
|
+
handleEdit(ites.code, value);
|
|
1592
|
+
}}
|
|
1593
|
+
getPopupContainer={() => document.body}
|
|
1594
|
+
/>
|
|
1595
|
+
)) ||
|
|
1596
|
+
null}
|
|
1556
1597
|
{/* 表达式 */}
|
|
1557
1598
|
{ites?.inputType === 40 && (
|
|
1558
1599
|
<div style={{ display: 'flex' }}>
|
|
@@ -3,8 +3,9 @@ import { Select, Input, InputNumber, DatePicker, TimePicker } from 'antd';
|
|
|
3
3
|
import styles from './index.less';
|
|
4
4
|
import { getRegularThresholdRange } from './services';
|
|
5
5
|
import moment from 'moment';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { judgeIsEmpty } from '../../../utils/utils';
|
|
7
|
+
import { handleError } from '../../../utils/requestUtils';
|
|
8
|
+
import { queryIdentityInfo, findChangedThresholdQuery, setParams, dateFormat, fullDateFormat } from './util';
|
|
8
9
|
import { request as SulaRequest } from 'bssula';
|
|
9
10
|
import { stringify } from 'querystring';
|
|
10
11
|
import {
|
|
@@ -212,28 +213,26 @@ export default class RuleField extends Component {
|
|
|
212
213
|
url: extraRequestUrl,
|
|
213
214
|
method: 'get',
|
|
214
215
|
converter: (res) => {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
handleData
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
handleData
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
: [];
|
|
232
|
-
}
|
|
233
|
-
this.setState({
|
|
234
|
-
thresholdList: handleData,
|
|
235
|
-
});
|
|
216
|
+
let handleData = res?.data || [];
|
|
217
|
+
if (queryIdentifyType === 'dictCodeIdentify') {
|
|
218
|
+
handleData = handleData?.length
|
|
219
|
+
? handleData.map((i) => ({
|
|
220
|
+
code: i.dictItemCode,
|
|
221
|
+
name: i.dictItemName,
|
|
222
|
+
}))
|
|
223
|
+
: [];
|
|
224
|
+
}
|
|
225
|
+
if (queryIdentifyType === 'dynamicDictCodeIdentify') {
|
|
226
|
+
handleData = handleData?.length
|
|
227
|
+
? handleData.map((i) => ({
|
|
228
|
+
code: i.code.toString(),
|
|
229
|
+
name: i.name,
|
|
230
|
+
}))
|
|
231
|
+
: [];
|
|
236
232
|
}
|
|
233
|
+
this.setState({
|
|
234
|
+
thresholdList: handleData,
|
|
235
|
+
});
|
|
237
236
|
return handleData;
|
|
238
237
|
},
|
|
239
238
|
});
|
|
@@ -274,8 +273,6 @@ export default class RuleField extends Component {
|
|
|
274
273
|
customerWidth,
|
|
275
274
|
} = this.props;
|
|
276
275
|
const { thresholdList } = this.state;
|
|
277
|
-
const dateFormat = 'YYYY-MM-DD';
|
|
278
|
-
const fullDateFormat = 'YYYY-MM-DD HH:mm:ss';
|
|
279
276
|
const styleCommon = {
|
|
280
277
|
width: customerWidth || '150px',
|
|
281
278
|
};
|
|
@@ -1840,6 +1837,76 @@ export default class RuleField extends Component {
|
|
|
1840
1837
|
);
|
|
1841
1838
|
}
|
|
1842
1839
|
}
|
|
1840
|
+
// 结算组织选择器
|
|
1841
|
+
if (dataChoiceBusinessType == 290) {
|
|
1842
|
+
if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
|
|
1843
|
+
return (
|
|
1844
|
+
<>
|
|
1845
|
+
<BusinessTreeSearchSelect
|
|
1846
|
+
disabled={disabled}
|
|
1847
|
+
treeCheckable={dataInputBusinessType === 12}
|
|
1848
|
+
businessType="settle-organization"
|
|
1849
|
+
labelInValue={true}
|
|
1850
|
+
value={values[0]}
|
|
1851
|
+
style={styleCommon}
|
|
1852
|
+
onChange={(value) => {
|
|
1853
|
+
if (dataInputBusinessType === 12) {
|
|
1854
|
+
values[0] = value.map((i) => i.key);
|
|
1855
|
+
valueNames[0] = value.map((i) => i.label || '');
|
|
1856
|
+
} else {
|
|
1857
|
+
values[0] = [value.key];
|
|
1858
|
+
valueNames[0] = [value.label || ''];
|
|
1859
|
+
}
|
|
1860
|
+
callback(values, valueNames);
|
|
1861
|
+
}}
|
|
1862
|
+
getPopupContainer={() => document.body}
|
|
1863
|
+
/>
|
|
1864
|
+
<span>~</span>
|
|
1865
|
+
<BusinessTreeSearchSelect
|
|
1866
|
+
disabled={disabled}
|
|
1867
|
+
treeCheckable={dataInputBusinessType === 12}
|
|
1868
|
+
businessType="settle-organization"
|
|
1869
|
+
labelInValue={true}
|
|
1870
|
+
value={values[0]}
|
|
1871
|
+
style={styleCommon}
|
|
1872
|
+
onChange={(value) => {
|
|
1873
|
+
if (dataInputBusinessType === 12) {
|
|
1874
|
+
values[1] = value.map((i) => i.key);
|
|
1875
|
+
valueNames[1] = value.map((i) => i.label || '');
|
|
1876
|
+
} else {
|
|
1877
|
+
values[1] = [value.key];
|
|
1878
|
+
valueNames[1] = [value.label || ''];
|
|
1879
|
+
}
|
|
1880
|
+
callback(values, valueNames);
|
|
1881
|
+
}}
|
|
1882
|
+
getPopupContainer={() => document.body}
|
|
1883
|
+
/>
|
|
1884
|
+
</>
|
|
1885
|
+
);
|
|
1886
|
+
} else {
|
|
1887
|
+
return (
|
|
1888
|
+
<BusinessTreeSearchSelect
|
|
1889
|
+
disabled={disabled}
|
|
1890
|
+
treeCheckable={dataInputBusinessType === 12}
|
|
1891
|
+
businessType="settle-organization"
|
|
1892
|
+
labelInValue={true}
|
|
1893
|
+
value={values[0]}
|
|
1894
|
+
style={styleCommon}
|
|
1895
|
+
onChange={(value) => {
|
|
1896
|
+
if (dataInputBusinessType === 12) {
|
|
1897
|
+
values = value.map((i) => i.key)||[];
|
|
1898
|
+
valueNames = value.map((i) => i.label || '')||[];
|
|
1899
|
+
} else {
|
|
1900
|
+
values = value?.key?[value.key]:[];
|
|
1901
|
+
valueNames = value?.label?[value.label]:[];
|
|
1902
|
+
}
|
|
1903
|
+
callback(values, valueNames);
|
|
1904
|
+
}}
|
|
1905
|
+
getPopupContainer={() => document.body}
|
|
1906
|
+
/>
|
|
1907
|
+
);
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1843
1910
|
// 配送方式选择器
|
|
1844
1911
|
if (dataChoiceBusinessType == 310) {
|
|
1845
1912
|
if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
|
|
@@ -1946,6 +2013,112 @@ export default class RuleField extends Component {
|
|
|
1946
2013
|
);
|
|
1947
2014
|
}
|
|
1948
2015
|
}
|
|
2016
|
+
// 角色选择器
|
|
2017
|
+
if (dataChoiceBusinessType == 360) {
|
|
2018
|
+
if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
|
|
2019
|
+
return (
|
|
2020
|
+
<>
|
|
2021
|
+
<BusinessSearchSelect
|
|
2022
|
+
selectBusinessType="role"
|
|
2023
|
+
selectProps={{
|
|
2024
|
+
style: styleCommon,
|
|
2025
|
+
placeholder: '请选择角色',
|
|
2026
|
+
...(dataInputBusinessType === 12
|
|
2027
|
+
? {
|
|
2028
|
+
mode: 'multiple',
|
|
2029
|
+
maxTagCount: 1,
|
|
2030
|
+
}
|
|
2031
|
+
: {}),
|
|
2032
|
+
}}
|
|
2033
|
+
disabled={disabled}
|
|
2034
|
+
labelInValue={true}
|
|
2035
|
+
value={values[0]}
|
|
2036
|
+
requestConfig={{
|
|
2037
|
+
filterInit: 'qp-code-in',
|
|
2038
|
+
}}
|
|
2039
|
+
onChange={(value) => {
|
|
2040
|
+
if (dataInputBusinessType === 12) {
|
|
2041
|
+
values[0] = value.map((i) => i.key);
|
|
2042
|
+
valueNames[0] = value.map((i) => i.label || '');
|
|
2043
|
+
} else {
|
|
2044
|
+
values[0] = [value.key];
|
|
2045
|
+
valueNames[0] = [value.label || ''];
|
|
2046
|
+
}
|
|
2047
|
+
callback(values, valueNames);
|
|
2048
|
+
}}
|
|
2049
|
+
getPopupContainer={() => document.body}
|
|
2050
|
+
/>
|
|
2051
|
+
<span>~</span>
|
|
2052
|
+
<BusinessSearchSelect
|
|
2053
|
+
selectBusinessType="role"
|
|
2054
|
+
selectProps={{
|
|
2055
|
+
style: styleCommon,
|
|
2056
|
+
placeholder: '请选择角色',
|
|
2057
|
+
...(dataInputBusinessType === 12
|
|
2058
|
+
? {
|
|
2059
|
+
mode: 'multiple',
|
|
2060
|
+
maxTagCount: 1,
|
|
2061
|
+
}
|
|
2062
|
+
: {}),
|
|
2063
|
+
}}
|
|
2064
|
+
disabled={disabled}
|
|
2065
|
+
labelInValue={true}
|
|
2066
|
+
value={values[1]}
|
|
2067
|
+
requestConfig={{
|
|
2068
|
+
filterInit: 'qp-code-in',
|
|
2069
|
+
}}
|
|
2070
|
+
onChange={(value) => {
|
|
2071
|
+
if (dataInputBusinessType === 12) {
|
|
2072
|
+
values[1] = value.map((i) => i.key);
|
|
2073
|
+
valueNames[1] = value.map((i) => i.label || '');
|
|
2074
|
+
} else {
|
|
2075
|
+
values[1] = [value.key];
|
|
2076
|
+
valueNames[1] = [value.label || ''];
|
|
2077
|
+
}
|
|
2078
|
+
callback(values, valueNames);
|
|
2079
|
+
}}
|
|
2080
|
+
getPopupContainer={() => document.body}
|
|
2081
|
+
/>
|
|
2082
|
+
</>
|
|
2083
|
+
);
|
|
2084
|
+
} else {
|
|
2085
|
+
const currentValue = dataInputBusinessType === 12 ?
|
|
2086
|
+
values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
|
|
2087
|
+
: values[0]&&{key:values[0],label:valueNames[0]}||{}
|
|
2088
|
+
return (
|
|
2089
|
+
<BusinessSearchSelect
|
|
2090
|
+
selectBusinessType="role"
|
|
2091
|
+
selectProps={{
|
|
2092
|
+
style: styleCommon,
|
|
2093
|
+
placeholder: '请选择角色',
|
|
2094
|
+
...(dataInputBusinessType === 12
|
|
2095
|
+
? {
|
|
2096
|
+
mode: 'multiple',
|
|
2097
|
+
maxTagCount: 1,
|
|
2098
|
+
}
|
|
2099
|
+
: {}),
|
|
2100
|
+
}}
|
|
2101
|
+
disabled={disabled}
|
|
2102
|
+
labelInValue={true}
|
|
2103
|
+
value={currentValue}
|
|
2104
|
+
requestConfig={{
|
|
2105
|
+
filterInit: 'qp-code-in',
|
|
2106
|
+
}}
|
|
2107
|
+
onChange={(value) => {
|
|
2108
|
+
if (dataInputBusinessType === 12) {
|
|
2109
|
+
values = value.map((i) => i.key)||[];
|
|
2110
|
+
valueNames = value.map((i) => i.label || '')||[];
|
|
2111
|
+
} else {
|
|
2112
|
+
values = value?.key?[value.key]:[];
|
|
2113
|
+
valueNames = value?.label?[value.label]:[];
|
|
2114
|
+
}
|
|
2115
|
+
callback(values, valueNames);
|
|
2116
|
+
}}
|
|
2117
|
+
getPopupContainer={() => document.body}
|
|
2118
|
+
/>
|
|
2119
|
+
);
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
1949
2122
|
} else {
|
|
1950
2123
|
if (
|
|
1951
2124
|
dataTypeCode == 22 ||
|
|
@@ -1994,12 +2167,12 @@ export default class RuleField extends Component {
|
|
|
1994
2167
|
/>
|
|
1995
2168
|
);
|
|
1996
2169
|
}
|
|
1997
|
-
} else if (dataTypeCode == 41) {
|
|
1998
|
-
// 日期41
|
|
2170
|
+
} else if (dataTypeCode == 41 || dataTypeCode == 32) {
|
|
2171
|
+
// 日期41 日期时间32
|
|
1999
2172
|
if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
|
|
2000
2173
|
return (
|
|
2001
2174
|
<RangePicker
|
|
2002
|
-
|
|
2175
|
+
showTime={dataTypeCode == 32}
|
|
2003
2176
|
disabled={disabled}
|
|
2004
2177
|
style={{ width: customerWidth || '300px' }}
|
|
2005
2178
|
format={dataTypeCode == 41 ? dateFormat : fullDateFormat}
|
|
@@ -2035,6 +2208,7 @@ export default class RuleField extends Component {
|
|
|
2035
2208
|
return (
|
|
2036
2209
|
<>
|
|
2037
2210
|
<DatePicker
|
|
2211
|
+
showTime={dataTypeCode == 32}
|
|
2038
2212
|
format={dataTypeCode == 41 ? dateFormat : fullDateFormat}
|
|
2039
2213
|
disabled={disabled}
|
|
2040
2214
|
style={{ width: customerWidth || '300px' }}
|
|
@@ -19,6 +19,7 @@ import fixedLeftActive from '../../assets/fixed-left-active.svg';
|
|
|
19
19
|
import fixedRight from '../../assets/fixed-right.svg';
|
|
20
20
|
import fixedRightActive from '../../assets/fixed-right-active.svg';
|
|
21
21
|
import './index.less';
|
|
22
|
+
import { handleRequestUrl, judgeIsRequestSuccess } from '@/utils/requestUtils';
|
|
22
23
|
|
|
23
24
|
interface TableColumnSettingProps {
|
|
24
25
|
/** tableCode必填,做用户存储关键key,*/
|
|
@@ -54,7 +55,7 @@ class TableColumnSetting extends React.Component<TableColumnSettingProps> {
|
|
|
54
55
|
};
|
|
55
56
|
|
|
56
57
|
patchUserColumnConfig = (config: any) => {
|
|
57
|
-
const { tableCode }: any = this.props;
|
|
58
|
+
const { tableCode, appRequestConfig }: any = this.props;
|
|
58
59
|
if (!tableCode) return;
|
|
59
60
|
let configvalue = config.map((item:any) => ({
|
|
60
61
|
key: item.key,
|
|
@@ -65,14 +66,14 @@ class TableColumnSetting extends React.Component<TableColumnSettingProps> {
|
|
|
65
66
|
}))
|
|
66
67
|
|
|
67
68
|
axios({
|
|
68
|
-
url: '/user/appConfig/saveUserOrder',
|
|
69
|
+
url: handleRequestUrl('/user','/appConfig/saveUserOrder',appRequestConfig),
|
|
69
70
|
method:'POST',
|
|
70
71
|
data: {
|
|
71
72
|
"code": tableCode,
|
|
72
73
|
"detail": JSON.stringify(configvalue)
|
|
73
74
|
},
|
|
74
75
|
}).then((res:any) => {
|
|
75
|
-
if (res?.data
|
|
76
|
+
if (judgeIsRequestSuccess(res?.data)) {
|
|
76
77
|
setConfigTableColumns(configvalue, tableCode)
|
|
77
78
|
} else {
|
|
78
79
|
message.error('保存表头列自定义失败,请稍后尝试');
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import ENUM from '@/utils/enumConfig';
|
|
2
|
+
import cookie from 'js-cookie'
|
|
3
|
+
|
|
4
|
+
const resposne = JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}');
|
|
5
|
+
//--------赢家项目登录信息---------
|
|
6
|
+
export function getEekaSessionId() {
|
|
7
|
+
return resposne?.sessionId || '';
|
|
8
|
+
}
|
|
9
|
+
export function getEekaAccountId() {
|
|
10
|
+
return resposne?.personDetailResDto?.accountId || -1;
|
|
11
|
+
}
|
|
12
|
+
export function getEekaEmployeeId() {
|
|
13
|
+
return resposne?.personDetailResDto?.employeeId || 2;
|
|
14
|
+
}
|
|
15
|
+
export function getEekaTenantId() {
|
|
16
|
+
return resposne?.personDetailResDto?.tenantId || 1;
|
|
17
|
+
}
|
|
18
|
+
export function getEekaToken() {
|
|
19
|
+
return resposne?.token;
|
|
20
|
+
}
|
|
21
|
+
//--------赢家项目登录信息---------
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
//--------国药项目登录信息---------
|
|
25
|
+
export function getLoginHeaderInfo(headerkey: string,storage='cookie') {
|
|
26
|
+
if (storage) {
|
|
27
|
+
if ('localStorage' === storage) {
|
|
28
|
+
return localStorage.getItem(headerkey)
|
|
29
|
+
} else if ('sessionStorage' === storage) {
|
|
30
|
+
return sessionStorage.getItem(headerkey)
|
|
31
|
+
} else if ('cookie' === storage) {
|
|
32
|
+
return cookie.get(headerkey)
|
|
33
|
+
} else {
|
|
34
|
+
return localStorage.getItem(headerkey)
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
return localStorage.getItem(headerkey)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export function getGuoyaoshukeCompanyId() {
|
|
41
|
+
return getLoginHeaderInfo('gksk-company-id');
|
|
42
|
+
}
|
|
43
|
+
export function getGuoyaoshukeTenantCode() {
|
|
44
|
+
return getLoginHeaderInfo('gksk-tenant-code');
|
|
45
|
+
}
|
|
46
|
+
export function getGuoyaoshukeTenantId() {
|
|
47
|
+
return getLoginHeaderInfo('gksk-tenant-id') || 1;
|
|
48
|
+
}
|
|
49
|
+
export function getGuoyaoshukeToken() {
|
|
50
|
+
return getLoginHeaderInfo('gksk-access-token');
|
|
51
|
+
}
|
|
52
|
+
export function getGuoyaoshukeUscCode() {
|
|
53
|
+
return getLoginHeaderInfo('gksk-usc-code');
|
|
54
|
+
}
|
|
55
|
+
//--------国药项目登录信息---------
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import ENUM from './enumConfig';
|
|
3
3
|
import { getCurrentTenantId, getEmployeeId, getSessionId, getAccountId } from './LocalstorageUtils';
|
|
4
|
+
import { getEekaSessionId, getEekaAccountId, getEekaEmployeeId, getEekaTenantId, getEekaToken,
|
|
5
|
+
getGuoyaoshukeCompanyId, getGuoyaoshukeTenantId, getGuoyaoshukeTenantCode, getGuoyaoshukeToken, getGuoyaoshukeUscCode
|
|
6
|
+
} from './CustomLoginInfo';
|
|
4
7
|
|
|
5
8
|
export function handleRequestAuthHeader(config?: any) {
|
|
6
9
|
// https://www.kdocs.cn/l/coNbPpjamr5v这个表格里面涉及的接口,接口请求头里需要添加参数:x-biz-code 值就是列表里的code
|
|
@@ -15,20 +18,149 @@ export function handleRequestAuthHeader(config?: any) {
|
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
|
|
22
|
+
/*
|
|
23
|
+
* 获取当前组件服务项目
|
|
24
|
+
* */
|
|
25
|
+
const getCurrentUseProject = () => {
|
|
26
|
+
let project = 'BitSun';
|
|
27
|
+
const hostname = window.location.hostname;
|
|
28
|
+
if(hostname?.indexOf('omni')>-1 || hostname?.indexOf('eeka')>-1 || hostname?.indexOf('koradior')>-1) {
|
|
29
|
+
project = 'YingJia'
|
|
30
|
+
}
|
|
31
|
+
if(hostname?.indexOf('guoyaoshuke')>-1 || hostname?.indexOf('10.31.249.136')>-1) {
|
|
32
|
+
project = 'GuoYao'
|
|
33
|
+
}
|
|
34
|
+
return project
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
* 处理一般请求头
|
|
39
|
+
* @param {*} config 请求参数配置
|
|
40
|
+
* */
|
|
41
|
+
const handleCommonHeader = () => {
|
|
42
|
+
let commonHeaders = {};
|
|
43
|
+
const defaultHeaders = {
|
|
44
|
+
'sso-sessionid': getSessionId(),
|
|
45
|
+
'x-account-id': getAccountId(),
|
|
46
|
+
'x-employee-id': getEmployeeId(),
|
|
47
|
+
'x-tenant-id': getCurrentTenantId()
|
|
48
|
+
};
|
|
49
|
+
const type = getCurrentUseProject()
|
|
50
|
+
switch (type) {
|
|
51
|
+
case 'YingJia':
|
|
52
|
+
commonHeaders = {
|
|
53
|
+
'x-sso-sessionid': getEekaSessionId(),
|
|
54
|
+
'x-account-id': getEekaAccountId(),
|
|
55
|
+
'x-employee-id': getEekaEmployeeId(),
|
|
56
|
+
'x-tenant-id': getEekaTenantId(),
|
|
57
|
+
'x-user-token': getEekaToken()
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
case 'GuoYao':
|
|
61
|
+
commonHeaders = {
|
|
62
|
+
'gksk-company-id': getGuoyaoshukeCompanyId(),
|
|
63
|
+
'gksk-tenant-id': getGuoyaoshukeTenantId(),
|
|
64
|
+
'gksk-tenant-code': getGuoyaoshukeTenantCode(),
|
|
65
|
+
'gksk-access-token': getGuoyaoshukeToken(),
|
|
66
|
+
'gksk-usc-code': getGuoyaoshukeUscCode(),
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
commonHeaders = defaultHeaders
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
return commonHeaders
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/*
|
|
78
|
+
* 处理请求头方法-包含一般请求头、权限请求头。组件默认统一处理一遍,若组件使用处需要可以单独在组件处传参进来处理
|
|
79
|
+
* @param {*} config 请求参数配置
|
|
80
|
+
* */
|
|
19
81
|
const handleRequestHeader = (config: any) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
config.headers['x-tenant-id'] = getCurrentTenantId()
|
|
82
|
+
|
|
83
|
+
let commonHeaders = handleCommonHeader();
|
|
84
|
+
|
|
24
85
|
if (localStorage.getItem('x-user-auth-context')) {
|
|
25
|
-
|
|
86
|
+
// @ts-ignore
|
|
87
|
+
commonHeaders['x-user-auth-context'] = localStorage.getItem('x-user-auth-context');
|
|
88
|
+
}
|
|
89
|
+
!!!config.headers['x-biz-code'] && handleRequestAuthHeader(config)
|
|
90
|
+
|
|
91
|
+
config.headers = {
|
|
92
|
+
...commonHeaders,
|
|
93
|
+
...config.headers
|
|
26
94
|
}
|
|
27
|
-
handleRequestAuthHeader(config)
|
|
28
95
|
}
|
|
29
96
|
|
|
97
|
+
|
|
30
98
|
// 拦截器
|
|
31
99
|
axios.interceptors.request.use((config: any) => {
|
|
32
100
|
handleRequestHeader(config)
|
|
33
101
|
return config
|
|
34
102
|
})
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 处理请求路径前缀/请求路径等使用不一的问题
|
|
109
|
+
* @param {*} defaultUrl 默认请求路径
|
|
110
|
+
* @param {*} defaultPreFix 默认请求路径的前缀
|
|
111
|
+
* @param {*} config 更改请求前缀/路径集合
|
|
112
|
+
* 示例:
|
|
113
|
+
* appRequestConfig: {
|
|
114
|
+
* '/appConfig/saveUserOrder': ['/api/user-manage'],
|
|
115
|
+
* '/appConfig/saveQueryCriteria': ['/api/user-manage']
|
|
116
|
+
* }
|
|
117
|
+
*/
|
|
118
|
+
export const handleRequestUrl = (defaultPreFix: string,defaultUrl: string, config: any) => {
|
|
119
|
+
let rUrl = `${defaultPreFix}${defaultUrl}`;
|
|
120
|
+
if(config && Object.keys((config||{}))?.length) {
|
|
121
|
+
const value = config[defaultUrl] || []
|
|
122
|
+
const newPreFix = value[0] || defaultPreFix;
|
|
123
|
+
const newUrl = value[1] || defaultUrl;
|
|
124
|
+
rUrl = `${newPreFix}${newUrl}`;
|
|
125
|
+
}
|
|
126
|
+
return rUrl
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 处理错误请求
|
|
132
|
+
* @param {*} response 返回结果
|
|
133
|
+
* @param {*} needBackError 是否需要将错误回传到页面单独处理
|
|
134
|
+
*/
|
|
135
|
+
export function handleError(response: object, needBackError?: boolean) {
|
|
136
|
+
if (judgeIsRequestError(response)) {
|
|
137
|
+
if (response && !needBackError) {
|
|
138
|
+
// @ts-ignore
|
|
139
|
+
response.msg && message.error(response.msg);
|
|
140
|
+
}
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* 判断为请求错误
|
|
149
|
+
* @param {*} res 响应体
|
|
150
|
+
* */
|
|
151
|
+
export const judgeIsRequestError = (res: any) => {
|
|
152
|
+
if (!res || (res?.status && res.status !== '0') || (res?.code && (res.code !== '000000' && res.code !== '0'))) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
return false;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* 判断为请求成功
|
|
159
|
+
* @param {*} res 响应体
|
|
160
|
+
* */
|
|
161
|
+
export const judgeIsRequestSuccess = (res: any) => {
|
|
162
|
+
if (res?.status === '0' || res?.code === '000000'|| res?.code === '0') {
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
return false;
|
|
166
|
+
};
|