kts-components-document-access-point 1.1.23 → 1.1.24
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/DocumentsList/ui/PageHeader/SendHeader.d.ts +2 -0
- package/dist/DocumentsList/ui/{PageUi → PageUI}/index.d.ts +0 -0
- package/dist/index.esm.js +167 -78
- package/dist/index.js +167 -78
- package/package.json +1 -1
- package/src/DocumentsList/index.tsx +2 -2
- package/src/DocumentsList/ui/ModalComfirm/index.tsx +2 -2
- package/src/DocumentsList/ui/PageHeader/SendHeader.tsx +230 -0
- package/src/DocumentsList/ui/PageHeader/index.tsx +129 -61
- package/src/DocumentsList/ui/RuleTable/index.tsx +6 -5
- package/src/DocumentsList/ui/sendlist/index.tsx +34 -10
- package/src/DocumentsRule/ui/main/index.tsx +1 -1
package/dist/index.js
CHANGED
|
@@ -2753,7 +2753,7 @@ function modalcomfirm(props) {
|
|
|
2753
2753
|
case 0:
|
|
2754
2754
|
data = selectItems.map(function (item) {
|
|
2755
2755
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
2756
|
-
|
|
2756
|
+
senderPartitionId: targetId,
|
|
2757
2757
|
privateList: [],
|
|
2758
2758
|
sendPublic: true
|
|
2759
2759
|
});
|
|
@@ -2811,7 +2811,7 @@ function modalcomfirm(props) {
|
|
|
2811
2811
|
};
|
|
2812
2812
|
}, []);
|
|
2813
2813
|
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(ktsXui.Modal, {
|
|
2814
|
-
title: "\u8BF7\u9009\u62E9",
|
|
2814
|
+
title: "\u8BF7\u9009\u62E9\u6211\u53F8\u5BF9\u5E94DID",
|
|
2815
2815
|
visible: true,
|
|
2816
2816
|
onOk: handleOk,
|
|
2817
2817
|
onCancel: handleCancel
|
|
@@ -2997,62 +2997,129 @@ var PageHeader = (function () {
|
|
|
2997
2997
|
}())();
|
|
2998
2998
|
}, [controller]);
|
|
2999
2999
|
React.useEffect(function () {
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3000
|
+
if (type === 1) {
|
|
3001
|
+
var obj = {
|
|
3002
|
+
type: "object",
|
|
3003
|
+
properties: {
|
|
3004
|
+
configName: {
|
|
3005
|
+
type: "string",
|
|
3006
|
+
title: "配置名称"
|
|
3007
|
+
},
|
|
3008
|
+
attributionList: {
|
|
3009
|
+
type: "string",
|
|
3010
|
+
title: "发送对象",
|
|
3011
|
+
visible: false
|
|
3012
|
+
},
|
|
3013
|
+
type: {
|
|
3014
|
+
type: "string",
|
|
3015
|
+
title: "单据大类",
|
|
3016
|
+
enum: billEnum
|
|
3017
|
+
},
|
|
3018
|
+
profile: {
|
|
3019
|
+
type: "string",
|
|
3020
|
+
title: "单据子类",
|
|
3021
|
+
enum: profileEnum,
|
|
3022
|
+
visible: false
|
|
3023
|
+
},
|
|
3024
|
+
attribution: {
|
|
3025
|
+
type: "string",
|
|
3026
|
+
title: "单据类型",
|
|
3027
|
+
enum: [{
|
|
3028
|
+
"label": "发送方",
|
|
3029
|
+
"value": '1'
|
|
3030
|
+
}, {
|
|
3031
|
+
"label": "接收方",
|
|
3032
|
+
"value": '0'
|
|
3033
|
+
}],
|
|
3034
|
+
'x-props': {
|
|
3035
|
+
mode: "multiple"
|
|
3036
|
+
}
|
|
3037
|
+
},
|
|
3038
|
+
'[beginCreateTime,endCreateTime]': {
|
|
3039
|
+
key: "[beginCreateTime,endCreateTime",
|
|
3040
|
+
name: "[beginCreateTime,endCreateTime",
|
|
3041
|
+
type: "daterange",
|
|
3042
|
+
title: "创建时间"
|
|
3043
|
+
},
|
|
3044
|
+
'[beginSendTime,endSendTime]': {
|
|
3045
|
+
key: "[beginSendTime,endSendTime",
|
|
3046
|
+
name: "[beginSendTime,endSendTime",
|
|
3047
|
+
type: "daterange",
|
|
3048
|
+
title: "更新时间"
|
|
3039
3049
|
}
|
|
3040
|
-
},
|
|
3041
|
-
'[beginCreateTime,endCreateTime]': {
|
|
3042
|
-
key: "[beginCreateTime,endCreateTime",
|
|
3043
|
-
name: "[beginCreateTime,endCreateTime",
|
|
3044
|
-
type: "daterange",
|
|
3045
|
-
title: "创建时间"
|
|
3046
|
-
},
|
|
3047
|
-
'[beginSendTime,endSendTime]': {
|
|
3048
|
-
key: "[beginSendTime,endSendTime",
|
|
3049
|
-
name: "[beginSendTime,endSendTime",
|
|
3050
|
-
type: "daterange",
|
|
3051
|
-
title: "更新时间"
|
|
3052
3050
|
}
|
|
3053
|
-
}
|
|
3054
|
-
|
|
3055
|
-
|
|
3051
|
+
};
|
|
3052
|
+
setSchema(obj);
|
|
3053
|
+
} else if (type === 2) {
|
|
3054
|
+
var _obj = {
|
|
3055
|
+
type: "object",
|
|
3056
|
+
properties: {
|
|
3057
|
+
configName: {
|
|
3058
|
+
type: "string",
|
|
3059
|
+
title: "配置名称"
|
|
3060
|
+
},
|
|
3061
|
+
biaoshi: {
|
|
3062
|
+
type: "string",
|
|
3063
|
+
title: "标识"
|
|
3064
|
+
},
|
|
3065
|
+
attributionList: {
|
|
3066
|
+
type: "string",
|
|
3067
|
+
title: "发送对象",
|
|
3068
|
+
visible: true
|
|
3069
|
+
},
|
|
3070
|
+
did: {
|
|
3071
|
+
type: "string",
|
|
3072
|
+
title: "我司对应DID"
|
|
3073
|
+
},
|
|
3074
|
+
duixiang: {
|
|
3075
|
+
type: "string",
|
|
3076
|
+
title: "接受对象"
|
|
3077
|
+
},
|
|
3078
|
+
duixianggongsi: {
|
|
3079
|
+
type: "string",
|
|
3080
|
+
title: "接受对象所属公司"
|
|
3081
|
+
},
|
|
3082
|
+
type: {
|
|
3083
|
+
type: "string",
|
|
3084
|
+
title: "单据大类",
|
|
3085
|
+
enum: billEnum
|
|
3086
|
+
},
|
|
3087
|
+
profile: {
|
|
3088
|
+
type: "string",
|
|
3089
|
+
title: "单据子类",
|
|
3090
|
+
enum: profileEnum,
|
|
3091
|
+
visible: false
|
|
3092
|
+
},
|
|
3093
|
+
attribution: {
|
|
3094
|
+
type: "string",
|
|
3095
|
+
title: "单据类型",
|
|
3096
|
+
enum: [{
|
|
3097
|
+
"label": "发送方",
|
|
3098
|
+
"value": '1'
|
|
3099
|
+
}, {
|
|
3100
|
+
"label": "接收方",
|
|
3101
|
+
"value": '0'
|
|
3102
|
+
}],
|
|
3103
|
+
'x-props': {
|
|
3104
|
+
mode: "multiple"
|
|
3105
|
+
}
|
|
3106
|
+
},
|
|
3107
|
+
'[beginCreateTime,endCreateTime]': {
|
|
3108
|
+
key: "[beginCreateTime,endCreateTime",
|
|
3109
|
+
name: "[beginCreateTime,endCreateTime",
|
|
3110
|
+
type: "daterange",
|
|
3111
|
+
title: "创建时间"
|
|
3112
|
+
},
|
|
3113
|
+
'[beginSendTime,endSendTime]': {
|
|
3114
|
+
key: "[beginSendTime,endSendTime",
|
|
3115
|
+
name: "[beginSendTime,endSendTime",
|
|
3116
|
+
type: "daterange",
|
|
3117
|
+
title: "更新时间"
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
};
|
|
3121
|
+
setSchema(_obj);
|
|
3122
|
+
}
|
|
3056
3123
|
}, [billEnum, type, profileEnum]);
|
|
3057
3124
|
var onCreateType = React.useCallback(function (category, record) {
|
|
3058
3125
|
history.push({
|
|
@@ -3076,7 +3143,7 @@ var PageHeader = (function () {
|
|
|
3076
3143
|
value: 1
|
|
3077
3144
|
}, "\u5355\u636E\u6821\u9A8C\u89C4\u5219\u914D\u7F6E"), /*#__PURE__*/React__default['default'].createElement(ktsXui.Radio.Button, {
|
|
3078
3145
|
value: 2
|
|
3079
|
-
}, "\u53D1\
|
|
3146
|
+
}, "\u53D1\u5E03\u8BB0\u5F55"))), /*#__PURE__*/React__default['default'].createElement(ktsComponents.AdvancedSearch, {
|
|
3080
3147
|
width: 480,
|
|
3081
3148
|
height: 44,
|
|
3082
3149
|
compact: true,
|
|
@@ -3090,16 +3157,15 @@ var PageHeader = (function () {
|
|
|
3090
3157
|
labelAlign: 'left',
|
|
3091
3158
|
compact: true,
|
|
3092
3159
|
schema: schema,
|
|
3093
|
-
defaultValue: ___default['default'].pick(params, ['
|
|
3160
|
+
defaultValue: ___default['default'].pick(params, ['configName', 'type', 'profile', 'attributionList', 'attribution', '[beginCreateTime,endCreateTime]', '[beginSendTime,endSendTime]']),
|
|
3094
3161
|
effects: function effects($, actions) {
|
|
3095
3162
|
$(antd.LifeCycleTypes.ON_FIELD_VALUE_CHANGE, 'type').subscribe(function (fieldState) {
|
|
3096
3163
|
if (fieldState.value) {
|
|
3097
|
-
var value = fieldState.value;
|
|
3098
3164
|
var target = billEnum.find(function (item) {
|
|
3099
|
-
return item.value === value;
|
|
3165
|
+
return item.value === fieldState.value;
|
|
3100
3166
|
});
|
|
3101
3167
|
|
|
3102
|
-
if (target.profileList) {
|
|
3168
|
+
if (target && target.profileList) {
|
|
3103
3169
|
actions.setFieldState('profile', function (state) {
|
|
3104
3170
|
state.visible = true;
|
|
3105
3171
|
});
|
|
@@ -3125,7 +3191,7 @@ var PageHeader = (function () {
|
|
|
3125
3191
|
});
|
|
3126
3192
|
}
|
|
3127
3193
|
})));
|
|
3128
|
-
}, [type]);
|
|
3194
|
+
}, [type, schema]);
|
|
3129
3195
|
var menu = React.useMemo(function () {
|
|
3130
3196
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Menu, null, billEnum && billEnum.map(function (item, key) {
|
|
3131
3197
|
if (item.profileList) {
|
|
@@ -3164,7 +3230,7 @@ var PageHeader = (function () {
|
|
|
3164
3230
|
style: {
|
|
3165
3231
|
marginRight: 10
|
|
3166
3232
|
}
|
|
3167
|
-
}, "\u6279\u91CF\u53D1\
|
|
3233
|
+
}, "\u6279\u91CF\u53D1\u5E03"), /*#__PURE__*/React__default['default'].createElement(ktsXui.Dropdown, {
|
|
3168
3234
|
key: "2",
|
|
3169
3235
|
overlay: menu
|
|
3170
3236
|
}, /*#__PURE__*/React__default['default'].createElement(ktsXui.Button, {
|
|
@@ -3411,12 +3477,12 @@ function validaterule(props) {
|
|
|
3411
3477
|
onClick: function onClick() {
|
|
3412
3478
|
onSendCheck(record);
|
|
3413
3479
|
}
|
|
3414
|
-
}, "\u53D1\
|
|
3480
|
+
}, "\u53D1\u5E03"), record.publishStatus === 1 && /*#__PURE__*/React__default['default'].createElement("a", {
|
|
3415
3481
|
className: "tabel-action",
|
|
3416
3482
|
onClick: function onClick() {
|
|
3417
3483
|
onBillSendList(record);
|
|
3418
3484
|
}
|
|
3419
|
-
}, "\u53D1\
|
|
3485
|
+
}, "\u53D1\u5E03\u8BB0\u5F55"));
|
|
3420
3486
|
}
|
|
3421
3487
|
}];
|
|
3422
3488
|
var rowSelection = React.useMemo(function () {
|
|
@@ -3529,7 +3595,7 @@ function validaterule(props) {
|
|
|
3529
3595
|
};
|
|
3530
3596
|
}())();
|
|
3531
3597
|
}, []);
|
|
3532
|
-
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ktsXui.AutoTableContainer, {
|
|
3598
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(PageHeader, null), /*#__PURE__*/React__default['default'].createElement(ktsXui.AutoTableContainer, {
|
|
3533
3599
|
style: {
|
|
3534
3600
|
flex: 1,
|
|
3535
3601
|
padding: '0 20px',
|
|
@@ -3762,7 +3828,10 @@ function validaterule$1(props) {
|
|
|
3762
3828
|
title: '配置名称',
|
|
3763
3829
|
dataIndex: 'configName'
|
|
3764
3830
|
}, {
|
|
3765
|
-
title: '
|
|
3831
|
+
title: '使用标识',
|
|
3832
|
+
dataIndex: 'biaoshi'
|
|
3833
|
+
}, {
|
|
3834
|
+
title: '单据类型',
|
|
3766
3835
|
dataIndex: 'type',
|
|
3767
3836
|
render: function render(text) {
|
|
3768
3837
|
return bill[text];
|
|
@@ -3782,11 +3851,29 @@ function validaterule$1(props) {
|
|
|
3782
3851
|
}
|
|
3783
3852
|
}
|
|
3784
3853
|
}, {
|
|
3785
|
-
title: '
|
|
3854
|
+
title: '我的收发角色',
|
|
3786
3855
|
dataIndex: 'attribution',
|
|
3787
3856
|
render: function render(text) {
|
|
3788
3857
|
return attributionEnum[text];
|
|
3789
3858
|
}
|
|
3859
|
+
}, {
|
|
3860
|
+
title: '我司对应DID',
|
|
3861
|
+
dataIndex: 'did',
|
|
3862
|
+
render: function render(text) {
|
|
3863
|
+
return attributionEnum[text];
|
|
3864
|
+
}
|
|
3865
|
+
}, {
|
|
3866
|
+
title: '接受对象',
|
|
3867
|
+
dataIndex: 'object',
|
|
3868
|
+
render: function render(text) {
|
|
3869
|
+
return attributionEnum[text];
|
|
3870
|
+
}
|
|
3871
|
+
}, {
|
|
3872
|
+
title: '接受对象所属公司',
|
|
3873
|
+
dataIndex: 'objectCompany',
|
|
3874
|
+
render: function render(text) {
|
|
3875
|
+
return attributionEnum[text];
|
|
3876
|
+
}
|
|
3790
3877
|
}, // {
|
|
3791
3878
|
// title: '发送对象',
|
|
3792
3879
|
// dataIndex: 'sender',
|
|
@@ -3795,18 +3882,20 @@ function validaterule$1(props) {
|
|
|
3795
3882
|
// }
|
|
3796
3883
|
// },
|
|
3797
3884
|
{
|
|
3798
|
-
title: '
|
|
3885
|
+
title: '发布时间',
|
|
3799
3886
|
dataIndex: 'createAt',
|
|
3800
3887
|
render: function render(text) {
|
|
3801
3888
|
return moment__default['default'](text).format('YYYY-MM-DD hh:mm');
|
|
3802
3889
|
}
|
|
3803
3890
|
}, {
|
|
3804
|
-
title: '
|
|
3805
|
-
dataIndex: '
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3891
|
+
title: '详细内容',
|
|
3892
|
+
dataIndex: 'neirong'
|
|
3893
|
+
}, // {
|
|
3894
|
+
// title: '最近更新时间',
|
|
3895
|
+
// dataIndex: 'updateAt',
|
|
3896
|
+
// render: (text: any) => moment(text).format('YYYY-MM-DD hh:mm')
|
|
3897
|
+
// },
|
|
3898
|
+
{
|
|
3810
3899
|
title: '操作',
|
|
3811
3900
|
dataIndex: 'console',
|
|
3812
3901
|
render: function render(text, record) {
|
|
@@ -3819,7 +3908,7 @@ function validaterule$1(props) {
|
|
|
3819
3908
|
}
|
|
3820
3909
|
}];
|
|
3821
3910
|
}, [bill]);
|
|
3822
|
-
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ktsXui.AutoTableContainer, {
|
|
3911
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(PageHeader, null), /*#__PURE__*/React__default['default'].createElement(ktsXui.AutoTableContainer, {
|
|
3823
3912
|
style: {
|
|
3824
3913
|
flex: 1,
|
|
3825
3914
|
padding: '0 20px',
|
|
@@ -3894,7 +3983,7 @@ var Main$1 = function Main(props) {
|
|
|
3894
3983
|
display: 'flex',
|
|
3895
3984
|
flexDirection: 'column'
|
|
3896
3985
|
}
|
|
3897
|
-
},
|
|
3986
|
+
}, type === 1 && /*#__PURE__*/React__default['default'].createElement(validaterule, null), type === 2 && /*#__PURE__*/React__default['default'].createElement(validaterule$1, null)));
|
|
3898
3987
|
};
|
|
3899
3988
|
|
|
3900
3989
|
var DocumentsService = /*#__PURE__*/function () {
|
|
@@ -4366,7 +4455,7 @@ function Rule(props) {
|
|
|
4366
4455
|
switch (_context6.prev = _context6.next) {
|
|
4367
4456
|
case 0:
|
|
4368
4457
|
data = _objectSpread2(_objectSpread2({}, record), {}, {
|
|
4369
|
-
|
|
4458
|
+
senderPartitionId: targetId,
|
|
4370
4459
|
privateList: [],
|
|
4371
4460
|
sendPublic: true
|
|
4372
4461
|
});
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { createContext } from 'react';
|
|
2
|
-
import PageHeader from './ui/PageHeader'
|
|
2
|
+
// import PageHeader from './ui/PageHeader'
|
|
3
3
|
import RuleTable from './ui/RuleTable'
|
|
4
4
|
import DocumentsListController from './DocumentsListController';
|
|
5
5
|
import SendList from './ui/sendlist'
|
|
@@ -21,7 +21,7 @@ const Main = (props: any) => {
|
|
|
21
21
|
return (
|
|
22
22
|
<DocumentsListContext.Provider value={controller}>
|
|
23
23
|
<div style={{ height: '100%', display: 'flex', flexDirection: 'column' }}>
|
|
24
|
-
<PageHeader />
|
|
24
|
+
{/* <PageHeader /> */}
|
|
25
25
|
{
|
|
26
26
|
type === 1 &&
|
|
27
27
|
<RuleTable />
|
|
@@ -24,7 +24,7 @@ export default function modalcomfirm(props: any) {
|
|
|
24
24
|
const data = selectItems.map((item: any) => {
|
|
25
25
|
return {
|
|
26
26
|
...item,
|
|
27
|
-
|
|
27
|
+
senderPartitionId: targetId,
|
|
28
28
|
privateList: [],
|
|
29
29
|
sendPublic: true
|
|
30
30
|
};
|
|
@@ -51,7 +51,7 @@ export default function modalcomfirm(props: any) {
|
|
|
51
51
|
return (
|
|
52
52
|
<div>
|
|
53
53
|
<Modal
|
|
54
|
-
title="
|
|
54
|
+
title="请选择我司对应DID"
|
|
55
55
|
visible={true}
|
|
56
56
|
onOk={handleOk}
|
|
57
57
|
onCancel={handleCancel}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import React, { useRef, useState, useEffect, useMemo, useCallback } from 'react';
|
|
2
|
+
import { Radio, Button, Dropdown, PageHeaderFoot } from 'kts-xui';
|
|
3
|
+
import { Menu } from 'kts-components-antd-x4';
|
|
4
|
+
import { AdvancedSearch, KtsForm } from 'kts-components';
|
|
5
|
+
import { LifeCycleTypes } from '@formily/antd';
|
|
6
|
+
import Main from '../..';
|
|
7
|
+
import ModalComfirm from '../ModalComfirm'
|
|
8
|
+
import { DocumentsService } from "../../..";
|
|
9
|
+
import _ from 'lodash';
|
|
10
|
+
import { useHistory } from 'react-router-dom';
|
|
11
|
+
const { SubMenu } = Menu;
|
|
12
|
+
export default () => {
|
|
13
|
+
const history = useHistory();
|
|
14
|
+
const controller = Main.useController();
|
|
15
|
+
const type = controller.useMemo(s => s.type, [])
|
|
16
|
+
const [billEnum, setBill] = useState([]);
|
|
17
|
+
const selectedRowKey = controller.useMemo(s => s.selectedRowKey, [])
|
|
18
|
+
const params = controller.useMemo(s => s.params, [])
|
|
19
|
+
const visible = controller.useMemo(s => s.visible, []);
|
|
20
|
+
const [profileEnum, setProfile] = useState([]);
|
|
21
|
+
const [schema, setSchema] = useState({});
|
|
22
|
+
const ktsRef = useRef(null);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
(async () => {
|
|
25
|
+
const res = await DocumentsService.instance.service?.call({ url: '/dap/schema/config/getDefaultTypeList', data: {}, type: 'get' }) as any;
|
|
26
|
+
if (res.err) {
|
|
27
|
+
return false;
|
|
28
|
+
} else {
|
|
29
|
+
const list = res.res.map((item: any) => {
|
|
30
|
+
return { ...item, label: item.name, value: item.value }
|
|
31
|
+
})
|
|
32
|
+
setBill(list);
|
|
33
|
+
}
|
|
34
|
+
})()
|
|
35
|
+
}, []);
|
|
36
|
+
const onSearchFormSubmit = React.useCallback((value) => {
|
|
37
|
+
value = {
|
|
38
|
+
...value,
|
|
39
|
+
typeList: value['typeList'] && [value['typeList']]
|
|
40
|
+
}
|
|
41
|
+
controller.pipeline(async s => {
|
|
42
|
+
s.params = value;
|
|
43
|
+
})()
|
|
44
|
+
}, [controller])
|
|
45
|
+
|
|
46
|
+
const switchType = React.useCallback((e) => {
|
|
47
|
+
controller.pipeline(async s => {
|
|
48
|
+
s.type = e.target.value;
|
|
49
|
+
s.params = {}
|
|
50
|
+
})()
|
|
51
|
+
}, [])
|
|
52
|
+
const handleCancel = React.useCallback(() => {
|
|
53
|
+
controller.pipeline(async s => {
|
|
54
|
+
s.visible = false;
|
|
55
|
+
})()
|
|
56
|
+
}, []);
|
|
57
|
+
const batchSend = React.useCallback(() => {
|
|
58
|
+
controller.pipeline(async s => {
|
|
59
|
+
s.visible = true;
|
|
60
|
+
})()
|
|
61
|
+
}, [controller]);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
let obj: any = {
|
|
64
|
+
type: "object",
|
|
65
|
+
properties: {
|
|
66
|
+
configName: {
|
|
67
|
+
type: "string",
|
|
68
|
+
title: "配置名称",
|
|
69
|
+
},
|
|
70
|
+
attributionList: {
|
|
71
|
+
type: "string",
|
|
72
|
+
title: "发送对象",
|
|
73
|
+
visible: type === 2 ? true : false
|
|
74
|
+
},
|
|
75
|
+
type: {
|
|
76
|
+
type: "string",
|
|
77
|
+
title: "单据大类",
|
|
78
|
+
enum: billEnum,
|
|
79
|
+
},
|
|
80
|
+
profile: {
|
|
81
|
+
type: "string",
|
|
82
|
+
title: "单据子类",
|
|
83
|
+
enum: profileEnum,
|
|
84
|
+
visible: false
|
|
85
|
+
},
|
|
86
|
+
attribution: {
|
|
87
|
+
type: "string",
|
|
88
|
+
title: "单据类型",
|
|
89
|
+
enum: [{
|
|
90
|
+
"label": "发送方",
|
|
91
|
+
"value": '1'
|
|
92
|
+
}, {
|
|
93
|
+
"label": "接收方",
|
|
94
|
+
"value": '0'
|
|
95
|
+
}],
|
|
96
|
+
'x-props': {
|
|
97
|
+
mode: "multiple"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
'[beginCreateTime,endCreateTime]': {
|
|
101
|
+
key: "[beginCreateTime,endCreateTime",
|
|
102
|
+
name: "[beginCreateTime,endCreateTime",
|
|
103
|
+
type: "daterange",
|
|
104
|
+
title: "创建时间",
|
|
105
|
+
},
|
|
106
|
+
'[beginSendTime,endSendTime]': {
|
|
107
|
+
key: "[beginSendTime,endSendTime",
|
|
108
|
+
name: "[beginSendTime,endSendTime",
|
|
109
|
+
type: "daterange",
|
|
110
|
+
title: "更新时间",
|
|
111
|
+
},
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
setSchema(obj);
|
|
115
|
+
}, [billEnum, type, profileEnum])
|
|
116
|
+
const onCreateType = useCallback((category, record?) => {
|
|
117
|
+
history.push({ pathname: `/rule`, search: `?type=config&profile=${record && record.value || ''}&billtype=${category}` })
|
|
118
|
+
}, [])
|
|
119
|
+
const topExpand = useCallback(() => {
|
|
120
|
+
return (
|
|
121
|
+
<div style={{ display: 'flex' }}>
|
|
122
|
+
<div style={{ marginRight: 10 }}>
|
|
123
|
+
<Radio.Group value={type} onChange={switchType}>
|
|
124
|
+
<Radio.Button value={1}>单据校验规则配置</Radio.Button>
|
|
125
|
+
<Radio.Button value={2}>发布记录</Radio.Button>
|
|
126
|
+
</Radio.Group>
|
|
127
|
+
</div>
|
|
128
|
+
<AdvancedSearch
|
|
129
|
+
width={480}
|
|
130
|
+
height={44}
|
|
131
|
+
compact={true}
|
|
132
|
+
defaultKey="configName"
|
|
133
|
+
placeholder="输入配置名称"
|
|
134
|
+
searchFormSubmit={onSearchFormSubmit}
|
|
135
|
+
>
|
|
136
|
+
<KtsForm
|
|
137
|
+
ref={ktsRef}
|
|
138
|
+
labelCol={9}
|
|
139
|
+
wrapperCol={15}
|
|
140
|
+
labelAlign='left'
|
|
141
|
+
compact={true}
|
|
142
|
+
schema={schema}
|
|
143
|
+
defaultValue={_.pick(params, ['configName', 'type', 'profile', 'attributionList', 'attribution', '[beginCreateTime,endCreateTime]', '[beginSendTime,endSendTime]'])}
|
|
144
|
+
effects={($: any, actions: any) => {
|
|
145
|
+
$(LifeCycleTypes.ON_FIELD_VALUE_CHANGE, 'type',).subscribe((fieldState: any) => {
|
|
146
|
+
if (fieldState.value) {
|
|
147
|
+
const target: any = billEnum.find((item: any) => item.value === fieldState.value);
|
|
148
|
+
if (target && target.profileList) {
|
|
149
|
+
actions.setFieldState('profile', (state: any) => {
|
|
150
|
+
state.visible = true;
|
|
151
|
+
});
|
|
152
|
+
const list = target.profileList.map((item: any) => {
|
|
153
|
+
return {
|
|
154
|
+
label: item.name,
|
|
155
|
+
value: item.value
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
setProfile(list);
|
|
159
|
+
} else {
|
|
160
|
+
actions.setFieldState('profile', (state: any) => {
|
|
161
|
+
state.visible = false;
|
|
162
|
+
});
|
|
163
|
+
setProfile([])
|
|
164
|
+
}
|
|
165
|
+
} else {
|
|
166
|
+
actions.setFieldState('profile', (state: any) => {
|
|
167
|
+
state.visible = false;
|
|
168
|
+
});
|
|
169
|
+
setProfile([])
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}}
|
|
173
|
+
>
|
|
174
|
+
</KtsForm>
|
|
175
|
+
</AdvancedSearch>
|
|
176
|
+
|
|
177
|
+
</div>
|
|
178
|
+
);
|
|
179
|
+
}, [type,schema]);
|
|
180
|
+
const menu = useMemo(() => {
|
|
181
|
+
return (
|
|
182
|
+
<Menu>
|
|
183
|
+
{billEnum && billEnum.map((item: any, key) => {
|
|
184
|
+
if (item.profileList) {
|
|
185
|
+
return (
|
|
186
|
+
<SubMenu key={key} title={item.label}>
|
|
187
|
+
{
|
|
188
|
+
item.profileList.map((element: any) => {
|
|
189
|
+
return (
|
|
190
|
+
<Menu.Item key={element.value} onClick={() => { onCreateType(item.value, element); }}>
|
|
191
|
+
<a >
|
|
192
|
+
{element.name}
|
|
193
|
+
</a>
|
|
194
|
+
</Menu.Item>
|
|
195
|
+
)
|
|
196
|
+
})
|
|
197
|
+
}
|
|
198
|
+
</SubMenu>
|
|
199
|
+
)
|
|
200
|
+
} else {
|
|
201
|
+
return (
|
|
202
|
+
<Menu.Item key={item.value} onClick={() => { onCreateType(item.value); }}>
|
|
203
|
+
<a >
|
|
204
|
+
{item.label}
|
|
205
|
+
</a>
|
|
206
|
+
</Menu.Item>
|
|
207
|
+
)
|
|
208
|
+
}
|
|
209
|
+
})}
|
|
210
|
+
|
|
211
|
+
</Menu>);
|
|
212
|
+
}, [billEnum]);
|
|
213
|
+
return (
|
|
214
|
+
<div style={{ flex: 'none', position: 'relative', zIndex: 1 }}>
|
|
215
|
+
<PageHeaderFoot
|
|
216
|
+
expandLeft={topExpand()}
|
|
217
|
+
expandRight={[
|
|
218
|
+
type === 1 && <Button key="1" onClick={batchSend} style={{ marginRight: 10 }}>批量发布</Button>,
|
|
219
|
+
<Dropdown key="2" overlay={menu}>
|
|
220
|
+
<Button type="primary" >创建配置</Button>
|
|
221
|
+
</Dropdown>
|
|
222
|
+
]}
|
|
223
|
+
>
|
|
224
|
+
</PageHeaderFoot>
|
|
225
|
+
{
|
|
226
|
+
visible && <ModalComfirm handleCancel={handleCancel} list={selectedRowKey} />
|
|
227
|
+
}
|
|
228
|
+
</div>
|
|
229
|
+
);
|
|
230
|
+
};
|