@bit-sun/business-component 4.2.1-alpha.8-aiwei → 4.2.1-alpha.8
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/.claude/settings.local.json +8 -0
- package/.fatherrc.ts +1 -1
- package/.umirc.ts +13 -9
- package/dist/components/Business/AddSelectBusiness/index.d.ts +3 -4
- package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +1 -2
- package/dist/components/Business/BsLayouts/Components/ChooseStore/index.d.ts +1 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +1 -1
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +1 -1
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +2 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +1 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +1 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +1 -1
- package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +1 -2
- package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +1 -2
- package/dist/components/Business/BsLayouts/index.d.ts +1 -1
- package/dist/components/Business/BsSulaQueryTable/SearchItemSetting.d.ts +5 -5
- package/dist/components/Business/BsSulaQueryTable/index.d.ts +1 -2
- package/dist/components/Business/BsSulaQueryTable/setting.d.ts +6 -6
- package/dist/components/Business/BsSulaQueryTable/utils.d.ts +14 -15
- package/dist/components/Business/CommodityEntry/index.d.ts +1 -2
- package/dist/components/Business/CommonAlert/index.d.ts +1 -2
- package/dist/components/Business/CommonGuideWrapper/index.d.ts +3 -3
- package/dist/components/Business/DetailPageWrapper/index.d.ts +12 -12
- package/dist/components/Business/HomePageWrapper/index.d.ts +1 -2
- package/dist/components/Business/ImportExport/ExportButton/ModalTitle.d.ts +11 -0
- package/dist/components/Business/ImportExport/ExportButton/TemplatePicker.d.ts +13 -0
- package/dist/components/Business/ImportExport/ExportButton/index.d.ts +15 -0
- package/dist/components/Business/ImportExport/ImportWizard/Preview.d.ts +11 -0
- package/dist/components/Business/ImportExport/ImportWizard/index.d.ts +15 -0
- package/dist/components/Business/ImportExport/TaskDrawer/index.d.ts +15 -0
- package/dist/components/Business/ImportExport/TaskProgress/index.d.ts +15 -0
- package/dist/components/Business/ImportExport/businessFunction.d.ts +15 -0
- package/dist/components/Business/ImportExport/index.d.ts +14 -0
- package/dist/components/Business/ImportExport/sceneCapability.d.ts +20 -0
- package/dist/components/Business/ImportExport/services/importExport.d.ts +22 -0
- package/dist/components/Business/ImportExport/services/routing.d.ts +8 -0
- package/dist/components/Business/ImportExport/types.d.ts +134 -0
- package/dist/components/Business/ItemPropertySelector/index.d.ts +1 -2
- package/dist/components/Business/JsonQueryTable/components/FieldsModifyModal.d.ts +1 -2
- package/dist/components/Business/JsonQueryTable/components/FieldsSettingsTable.d.ts +1 -2
- package/dist/components/Business/JsonQueryTable/components/Formula.d.ts +1 -2
- package/dist/components/Business/JsonQueryTable/components/MaintainOptions.d.ts +1 -2
- package/dist/components/Business/JsonQueryTable/drawer/index.d.ts +1 -2
- package/dist/components/Business/PropertyModal/index.d.ts +1 -2
- package/dist/components/Business/PropertyModal/propertyGroup.d.ts +1 -1
- package/dist/components/Business/SearchSelect/index.d.ts +1 -1
- package/dist/components/Business/StateFlow/index.d.ts +1 -2
- package/dist/components/Business/TreeSearchSelect/index.d.ts +1 -1
- package/dist/components/Business/TrialCalculation/index.d.ts +15 -0
- package/dist/components/Business/columnSettingTable/columnSetting.d.ts +6 -6
- package/dist/components/Business/columnSettingTable/components/TableSumComponent.d.ts +1 -2
- package/dist/components/Business/columnSettingTable/index.d.ts +3 -3
- package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +7 -3
- package/dist/components/Business/columnSettingTable/utils.d.ts +1 -2
- package/dist/components/Business/moreTreeTable/FixedScrollBar.d.ts +1 -1
- package/dist/components/Common/ParagraphCopier/index.d.ts +1 -1
- package/dist/components/Common/Section/index.d.ts +1 -1
- package/dist/components/Functional/AddSelect/index.d.ts +1 -2
- package/dist/components/Functional/AuthButton/index.d.ts +1 -2
- package/dist/components/Functional/DataImport/index.d.ts +3 -3
- package/dist/components/Functional/DataValidation/index.d.ts +4 -4
- package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +1 -2
- package/dist/components/Functional/QueryMutipleInput/index.d.ts +1 -2
- package/dist/components/Functional/QueryMutipleSelect/index.d.ts +1 -2
- package/dist/components/Functional/SearchSelect/index.d.ts +1 -1
- package/dist/components/Functional/SearchSelect/pagination.d.ts +22 -0
- package/dist/components/Functional/SearchSelect/utils.d.ts +2 -3
- package/dist/components/Functional/TreeSearchSelect/index.d.ts +1 -2
- package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.d.ts +1 -1
- package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.d.ts +1 -2
- package/dist/components/Solution/RuleComponent/Formula.d.ts +1 -2
- package/dist/components/Solution/RuleComponent/InnerSelect.d.ts +1 -2
- package/dist/components/Solution/RuleComponent/RenderCompItem.d.ts +1 -2
- package/dist/components/Solution/RuleSetter/RuleInstance.d.ts +1 -2
- package/dist/components/Solution/RuleSetter/baseRule.d.ts +1 -1
- package/dist/components/Solution/RuleSetter/index.d.ts +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.js +4692 -1470
- package/dist/index.js +4710 -1463
- package/dist/plugin/TableColumnSetting/index.d.ts +5 -5
- package/dist/utils/TableUtils.d.ts +18 -19
- package/dist/utils/auth.d.ts +4 -0
- package/docs/error-record.md +52 -0
- package/docs/flow-control-readme.md +283 -0
- package/docs/task-records/2026-07-31-import-export-extraction.md +81 -0
- package/package.json +1 -1
- package/src/components/Business/AddSelectBusiness/index.tsx +3 -2
- package/src/components/Business/BsSulaQueryTable/index.md +57 -4
- package/src/components/Business/BsSulaQueryTable/index.tsx +183 -20
- package/src/components/Business/DetailPageWrapper/index.tsx +81 -1
- package/src/components/Business/DetailPageWrapper/readme.md +89 -0
- package/src/components/Business/ImportExport/ExportButton/ModalTitle.tsx +27 -0
- package/src/components/Business/ImportExport/ExportButton/TemplatePicker.tsx +424 -0
- package/src/components/Business/ImportExport/ExportButton/index.module.less +382 -0
- package/src/components/Business/ImportExport/ExportButton/index.tsx +273 -0
- package/src/components/Business/ImportExport/ImportWizard/Preview.tsx +129 -0
- package/src/components/Business/ImportExport/ImportWizard/index.module.less +360 -0
- package/src/components/Business/ImportExport/ImportWizard/index.tsx +679 -0
- package/src/components/Business/ImportExport/TaskDrawer/index.tsx +285 -0
- package/src/components/Business/ImportExport/TaskProgress/index.tsx +267 -0
- package/src/components/Business/ImportExport/businessFunction.ts +29 -0
- package/src/components/Business/ImportExport/index.md +104 -0
- package/src/components/Business/ImportExport/index.tsx +208 -0
- package/src/components/Business/ImportExport/sceneCapability.ts +28 -0
- package/src/components/Business/ImportExport/services/importExport.ts +208 -0
- package/src/components/Business/ImportExport/services/routing.ts +21 -0
- package/src/components/Business/ImportExport/types.ts +180 -0
- package/src/components/Business/SearchSelect/BusinessUtils.tsx +328 -280
- package/src/components/Business/SearchSelect/index.md +1 -1
- package/src/components/Business/TrialCalculation/PathDisplay.less +93 -0
- package/src/components/Business/TrialCalculation/PathDisplay_README.md +77 -0
- package/src/components/Business/TrialCalculation/index.tsx +322 -0
- package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +17 -1
- package/src/components/Functional/AddSelect/index.tsx +3 -1
- package/src/components/Functional/DataValidation/index.tsx +9 -6
- package/src/components/Functional/QueryMutipleSelect/index.tsx +2 -2
- package/src/components/Functional/SearchSelect/index.md +111 -0
- package/src/components/Functional/SearchSelect/index.tsx +157 -63
- package/src/components/Functional/SearchSelect/pagination.ts +57 -0
- package/src/components/Functional/SearchSelect/utils.tsx +28 -18
- package/src/components/Functional/TreeSearchSelect/index.tsx +2 -1
- package/src/components/Solution/RuleComponent/README.md +187 -0
- package/src/components/Solution/RuleComponent/RenderCompItem_README.md +189 -0
- package/src/components/Solution/RuleComponent/RuleField.md +63 -0
- package/src/components/Solution/RuleComponent/index.js +236 -8
- package/src/components/Solution/RuleComponent/ruleFiled.js +21 -5
- package/src/components/Solution/RuleSetter/README.md +97 -0
- package/src/index.ts +8 -1
- package/src/typings/umi.d.ts +9 -0
- package/src/utils/LocalstorageUtils.ts +1 -1
- package/src/utils/auth.ts +39 -2
|
@@ -35,12 +35,10 @@ import {
|
|
|
35
35
|
} from './util';
|
|
36
36
|
import { getDictionarySource, judgeIsEmpty, uuid } from '../../../utils/utils';
|
|
37
37
|
import { coverToParallel } from '../../../utils/TreeUtils';
|
|
38
|
-
import
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
BsCascader,
|
|
43
|
-
} from '../../../index';
|
|
38
|
+
import BusinessSearchSelect from '../../Business/SearchSelect';
|
|
39
|
+
import BusinessTreeSearchSelect from '../../Business/TreeSearchSelect';
|
|
40
|
+
import EllipsisTooltip from '../../Functional/EllipsisTooltip';
|
|
41
|
+
import { BsCascader } from '../../Functional/BsAntdSula/index';
|
|
44
42
|
import { request } from 'bssula';
|
|
45
43
|
import Formula from './Formula';
|
|
46
44
|
import RenderSpecificAction from './renderSpecificAction';
|
|
@@ -48,6 +46,19 @@ import RenderCompItem from './RenderCompItem';
|
|
|
48
46
|
|
|
49
47
|
const { RangePicker } = DatePicker;
|
|
50
48
|
|
|
49
|
+
const FIXED_DATA_TYPES = {
|
|
50
|
+
10: '字符串',
|
|
51
|
+
20: '短整数',
|
|
52
|
+
21: '长整数',
|
|
53
|
+
22: '小数',
|
|
54
|
+
40: '数组',
|
|
55
|
+
41: '布尔值',
|
|
56
|
+
12: '富文本',
|
|
57
|
+
30: '日期',
|
|
58
|
+
31: '时间',
|
|
59
|
+
32: '日期时间',
|
|
60
|
+
};
|
|
61
|
+
|
|
51
62
|
class RuleObjectComponent extends Component {
|
|
52
63
|
constructor(props) {
|
|
53
64
|
super(props);
|
|
@@ -151,6 +162,8 @@ class RuleObjectComponent extends Component {
|
|
|
151
162
|
value: element.id,
|
|
152
163
|
id: element.id,
|
|
153
164
|
dataTypeCode: element.valueType,
|
|
165
|
+
entityValueType: element.entityValueType,
|
|
166
|
+
entityInputType: element.entityInputType,
|
|
154
167
|
dataChoiceBusinessType: element.choiceType,
|
|
155
168
|
dataInputBusinessType: element.inputType,
|
|
156
169
|
info: element.info,
|
|
@@ -178,6 +191,8 @@ class RuleObjectComponent extends Component {
|
|
|
178
191
|
metaObjectCode: this.props.metaObjectCode || item.code,
|
|
179
192
|
...item,
|
|
180
193
|
dataTypeCode: item.valueType,
|
|
194
|
+
entityValueType: item.entityValueType,
|
|
195
|
+
entityInputType: item.entityInputType,
|
|
181
196
|
dataChoiceBusinessType: item.choiceType,
|
|
182
197
|
dataInputBusinessType: item.inputType,
|
|
183
198
|
}),
|
|
@@ -225,6 +240,8 @@ class RuleObjectComponent extends Component {
|
|
|
225
240
|
value: element.id,
|
|
226
241
|
id: element.id,
|
|
227
242
|
dataTypeCode: element.valueType,
|
|
243
|
+
entityValueType: element.entityValueType,
|
|
244
|
+
entityInputType: element.entityInputType,
|
|
228
245
|
dataChoiceBusinessType: element.choiceType,
|
|
229
246
|
dataInputBusinessType: element.inputType,
|
|
230
247
|
info: element.info,
|
|
@@ -689,6 +706,7 @@ class RuleObjectComponent extends Component {
|
|
|
689
706
|
disabled,
|
|
690
707
|
systemVariableList,
|
|
691
708
|
needShowInsertSQL,
|
|
709
|
+
needShowReqCondition,
|
|
692
710
|
} = this.props;
|
|
693
711
|
let thresholdQuery = {
|
|
694
712
|
...initialThresholdQuery,
|
|
@@ -824,6 +842,8 @@ class RuleObjectComponent extends Component {
|
|
|
824
842
|
itemDetail.elementName = nodeInfo.triggerNode.props.title;
|
|
825
843
|
itemDetail.dataTypeCode =
|
|
826
844
|
nodeInfo.triggerNode.props.dataTypeCode;
|
|
845
|
+
itemDetail.entityValueType = nodeInfo.triggerNode.props.entityValueType;
|
|
846
|
+
itemDetail.entityInputType = nodeInfo.triggerNode.props.entityInputType;
|
|
827
847
|
itemDetail.metaObjectCode =
|
|
828
848
|
nodeInfo.triggerNode.props.metaObjectCode;
|
|
829
849
|
itemDetail.isInsertParam = false;
|
|
@@ -997,6 +1017,7 @@ class RuleObjectComponent extends Component {
|
|
|
997
1017
|
itemDetail.params = [];
|
|
998
1018
|
} else {
|
|
999
1019
|
itemDetail.systemCode = null;
|
|
1020
|
+
delete itemDetail.type;
|
|
1000
1021
|
}
|
|
1001
1022
|
|
|
1002
1023
|
this.setState(
|
|
@@ -1030,6 +1051,8 @@ class RuleObjectComponent extends Component {
|
|
|
1030
1051
|
itemDetail.type = 30;
|
|
1031
1052
|
itemDetail.paramNames = [];
|
|
1032
1053
|
itemDetail.params = [];
|
|
1054
|
+
} else {
|
|
1055
|
+
delete itemDetail.type;
|
|
1033
1056
|
}
|
|
1034
1057
|
|
|
1035
1058
|
this.setState(
|
|
@@ -1049,13 +1072,21 @@ class RuleObjectComponent extends Component {
|
|
|
1049
1072
|
<div
|
|
1050
1073
|
style={{
|
|
1051
1074
|
display:
|
|
1052
|
-
itemDetail.operationType == 'logic' &&
|
|
1075
|
+
itemDetail.operationType == 'logic' &&
|
|
1076
|
+
(!disabled ||
|
|
1077
|
+
(itemDetail.reqConditionData &&
|
|
1078
|
+
itemDetail.reqConditionData.reqParamName &&
|
|
1079
|
+
itemDetail.reqConditionData.params?.length))
|
|
1053
1080
|
? 'block'
|
|
1054
1081
|
: 'none',
|
|
1055
1082
|
}}
|
|
1056
1083
|
>
|
|
1057
1084
|
<span
|
|
1058
|
-
style={{
|
|
1085
|
+
style={{
|
|
1086
|
+
color: '#008fe0',
|
|
1087
|
+
cursor: 'pointer',
|
|
1088
|
+
display: disabled ? 'none' : 'inline',
|
|
1089
|
+
}}
|
|
1059
1090
|
type="link"
|
|
1060
1091
|
onClick={() => {
|
|
1061
1092
|
this.addPeerRule(itemDetail);
|
|
@@ -1070,6 +1101,138 @@ class RuleObjectComponent extends Component {
|
|
|
1070
1101
|
/>
|
|
1071
1102
|
添加条件
|
|
1072
1103
|
</span>
|
|
1104
|
+
{needShowReqCondition && (
|
|
1105
|
+
<span
|
|
1106
|
+
style={{
|
|
1107
|
+
marginLeft: 10,
|
|
1108
|
+
display: disabled ? 'none' : 'inline',
|
|
1109
|
+
}}
|
|
1110
|
+
>
|
|
1111
|
+
<Button
|
|
1112
|
+
type="link"
|
|
1113
|
+
disabled={
|
|
1114
|
+
disabled &&
|
|
1115
|
+
(!itemDetail.reqConditionData ||
|
|
1116
|
+
!itemDetail.reqConditionData.reqParamName ||
|
|
1117
|
+
!itemDetail.reqConditionData.params?.length)
|
|
1118
|
+
}
|
|
1119
|
+
style={{ padding: 0, height: 'auto' }}
|
|
1120
|
+
onClick={() => this.handleReqConditionToggle(itemDetail)}
|
|
1121
|
+
>
|
|
1122
|
+
{itemDetail.isReqCondition
|
|
1123
|
+
? '取消参数条件控制'
|
|
1124
|
+
: '参数条件控制'}
|
|
1125
|
+
</Button>
|
|
1126
|
+
</span>
|
|
1127
|
+
)}
|
|
1128
|
+
{(itemDetail.isReqCondition ||
|
|
1129
|
+
(disabled &&
|
|
1130
|
+
itemDetail.reqConditionData &&
|
|
1131
|
+
itemDetail.reqConditionData.reqParamName &&
|
|
1132
|
+
itemDetail.reqConditionData.params?.length)) &&
|
|
1133
|
+
itemDetail.reqConditionData && (
|
|
1134
|
+
<div
|
|
1135
|
+
style={{
|
|
1136
|
+
marginTop: 10,
|
|
1137
|
+
display:
|
|
1138
|
+
disabled &&
|
|
1139
|
+
(!itemDetail.reqConditionData.reqParamName ||
|
|
1140
|
+
!itemDetail.reqConditionData.params?.length)
|
|
1141
|
+
? 'none'
|
|
1142
|
+
: 'flex',
|
|
1143
|
+
alignItems: 'center',
|
|
1144
|
+
background: '#f5f5f5',
|
|
1145
|
+
padding: '10px',
|
|
1146
|
+
borderRadius: '4px',
|
|
1147
|
+
}}
|
|
1148
|
+
>
|
|
1149
|
+
<Select
|
|
1150
|
+
disabled={disabled}
|
|
1151
|
+
style={{ width: 150, marginRight: 10 }}
|
|
1152
|
+
placeholder="请选择"
|
|
1153
|
+
value={String(
|
|
1154
|
+
itemDetail.reqConditionData.reqParamType || '10',
|
|
1155
|
+
)}
|
|
1156
|
+
onChange={(val) =>
|
|
1157
|
+
this.handleReqDataChange(itemDetail, 'reqParamType', val)
|
|
1158
|
+
}
|
|
1159
|
+
>
|
|
1160
|
+
<Select.Option value="10">请求参数名称</Select.Option>
|
|
1161
|
+
<Select.Option value="20">请求头参数名称</Select.Option>
|
|
1162
|
+
<Select.Option value="40">源请求地址</Select.Option>
|
|
1163
|
+
</Select>
|
|
1164
|
+
{String(itemDetail.reqConditionData.reqParamType || '10') !==
|
|
1165
|
+
'40' && (
|
|
1166
|
+
<Input
|
|
1167
|
+
disabled={disabled}
|
|
1168
|
+
style={{ width: 150, marginRight: 10 }}
|
|
1169
|
+
value={itemDetail.reqConditionData.reqParamName}
|
|
1170
|
+
onChange={(e) =>
|
|
1171
|
+
this.handleReqDataChange(
|
|
1172
|
+
itemDetail,
|
|
1173
|
+
'reqParamName',
|
|
1174
|
+
e.target.value,
|
|
1175
|
+
)
|
|
1176
|
+
}
|
|
1177
|
+
/>
|
|
1178
|
+
)}
|
|
1179
|
+
|
|
1180
|
+
<span style={{ marginRight: 8, flexShrink: 0 }}>类型:</span>
|
|
1181
|
+
<Select
|
|
1182
|
+
disabled={disabled}
|
|
1183
|
+
style={{ width: 120, marginRight: 10 }}
|
|
1184
|
+
value={itemDetail.reqConditionData.dataTypeCode}
|
|
1185
|
+
onChange={(val) =>
|
|
1186
|
+
this.handleReqDataChange(itemDetail, 'dataTypeCode', val)
|
|
1187
|
+
}
|
|
1188
|
+
>
|
|
1189
|
+
{Object.keys(FIXED_DATA_TYPES).map((code) => (
|
|
1190
|
+
<Select.Option key={code} value={code}>
|
|
1191
|
+
{FIXED_DATA_TYPES[code]}
|
|
1192
|
+
</Select.Option>
|
|
1193
|
+
))}
|
|
1194
|
+
</Select>
|
|
1195
|
+
|
|
1196
|
+
<Select
|
|
1197
|
+
disabled={disabled}
|
|
1198
|
+
style={{ width: 120, marginRight: 10 }}
|
|
1199
|
+
value={itemDetail.reqConditionData.operationCode}
|
|
1200
|
+
onChange={(val) =>
|
|
1201
|
+
this.handleReqDataChange(itemDetail, 'operationCode', val)
|
|
1202
|
+
}
|
|
1203
|
+
>
|
|
1204
|
+
{[
|
|
1205
|
+
{ 'code': '1', 'name': '在集合' },
|
|
1206
|
+
{ 'code': '2', 'name': '不等于' },
|
|
1207
|
+
{ code: '3', name: '小于' },
|
|
1208
|
+
{ code: '4', name: '大于' },
|
|
1209
|
+
{ code: '5', name: '等于' },
|
|
1210
|
+
].map((op) => (
|
|
1211
|
+
<Select.Option key={op.code} value={op.code}>
|
|
1212
|
+
{op.name}
|
|
1213
|
+
</Select.Option>
|
|
1214
|
+
))}
|
|
1215
|
+
</Select>
|
|
1216
|
+
|
|
1217
|
+
<RuleField
|
|
1218
|
+
customerWidth={'180px'}
|
|
1219
|
+
isQueryParams={true}
|
|
1220
|
+
selectOperation={itemDetail.reqConditionData.operationCode}
|
|
1221
|
+
dataTypeCode={itemDetail.reqConditionData.dataTypeCode}
|
|
1222
|
+
values={itemDetail.reqConditionData.params || []}
|
|
1223
|
+
valueNames={itemDetail.reqConditionData.paramNames || []}
|
|
1224
|
+
callback={(newValues, newValueNames) =>
|
|
1225
|
+
this.handleReqDataChange(
|
|
1226
|
+
itemDetail,
|
|
1227
|
+
'params',
|
|
1228
|
+
newValues,
|
|
1229
|
+
newValueNames,
|
|
1230
|
+
)
|
|
1231
|
+
}
|
|
1232
|
+
disabled={disabled}
|
|
1233
|
+
/>
|
|
1234
|
+
</div>
|
|
1235
|
+
)}
|
|
1073
1236
|
</div>
|
|
1074
1237
|
</div>
|
|
1075
1238
|
</div>
|
|
@@ -1497,6 +1660,8 @@ class RuleObjectComponent extends Component {
|
|
|
1497
1660
|
delete itemDetail.params;
|
|
1498
1661
|
delete itemDetail.paramNames;
|
|
1499
1662
|
delete itemDetail.dataTypeCode;
|
|
1663
|
+
delete itemDetail.entityValueType;
|
|
1664
|
+
delete itemDetail.entityInputType;
|
|
1500
1665
|
delete itemDetail.elementId;
|
|
1501
1666
|
delete itemDetail.elementName;
|
|
1502
1667
|
delete itemDetail.metaObjectCode;
|
|
@@ -1562,6 +1727,8 @@ class RuleObjectComponent extends Component {
|
|
|
1562
1727
|
parentDetail.elementName = parentDetail.subExpression[0].elementName;
|
|
1563
1728
|
parentDetail.dataTypeCode =
|
|
1564
1729
|
parentDetail.subExpression[0].dataTypeCode;
|
|
1730
|
+
parentDetail.entityValueType = parentDetail.subExpression[0].entityValueType;
|
|
1731
|
+
parentDetail.entityInputType = parentDetail.subExpression[0].entityInputType;
|
|
1565
1732
|
delete parentDetail.subExpression;
|
|
1566
1733
|
}
|
|
1567
1734
|
}
|
|
@@ -1647,6 +1814,67 @@ class RuleObjectComponent extends Component {
|
|
|
1647
1814
|
);
|
|
1648
1815
|
};
|
|
1649
1816
|
|
|
1817
|
+
handleReqConditionToggle = (itemDetail) => {
|
|
1818
|
+
const { ruleClassData } = this.state;
|
|
1819
|
+
const { callBack } = this.props;
|
|
1820
|
+
itemDetail.isReqCondition = !itemDetail.isReqCondition;
|
|
1821
|
+
if (itemDetail.isReqCondition && !itemDetail.reqConditionData) {
|
|
1822
|
+
itemDetail.reqConditionData = {
|
|
1823
|
+
operationType: 'relation',
|
|
1824
|
+
dataTypeCode: '10',
|
|
1825
|
+
entityInputType: '10',
|
|
1826
|
+
entityValueType: '10',
|
|
1827
|
+
operationCode: '',
|
|
1828
|
+
reqParamName: '',
|
|
1829
|
+
params: [],
|
|
1830
|
+
paramNames: [],
|
|
1831
|
+
};
|
|
1832
|
+
}
|
|
1833
|
+
this.setState(
|
|
1834
|
+
{
|
|
1835
|
+
ruleClassData,
|
|
1836
|
+
},
|
|
1837
|
+
() => {
|
|
1838
|
+
callBack(ruleClassData);
|
|
1839
|
+
},
|
|
1840
|
+
);
|
|
1841
|
+
};
|
|
1842
|
+
|
|
1843
|
+
handleReqDataChange = (itemDetail, field, value, valueNames) => {
|
|
1844
|
+
const { ruleClassData } = this.state;
|
|
1845
|
+
const { callBack } = this.props;
|
|
1846
|
+
if (!itemDetail.reqConditionData) return;
|
|
1847
|
+
|
|
1848
|
+
if (field === 'dataTypeCode') {
|
|
1849
|
+
itemDetail.reqConditionData.dataTypeCode = value;
|
|
1850
|
+
itemDetail.reqConditionData.entityInputType = value;
|
|
1851
|
+
itemDetail.reqConditionData.entityValueType = value;
|
|
1852
|
+
itemDetail.reqConditionData.operationCode = '';
|
|
1853
|
+
itemDetail.reqConditionData.params = [];
|
|
1854
|
+
itemDetail.reqConditionData.paramNames = [];
|
|
1855
|
+
} else if (field === 'operationCode') {
|
|
1856
|
+
itemDetail.reqConditionData.operationCode = value;
|
|
1857
|
+
} else if (field === 'reqParamName') {
|
|
1858
|
+
itemDetail.reqConditionData.reqParamName = value;
|
|
1859
|
+
} else if (field === 'params') {
|
|
1860
|
+
itemDetail.reqConditionData.params = value;
|
|
1861
|
+
if (valueNames) {
|
|
1862
|
+
itemDetail.reqConditionData.paramNames = valueNames;
|
|
1863
|
+
}
|
|
1864
|
+
} else if (field === 'reqParamType') {
|
|
1865
|
+
itemDetail.reqConditionData.reqParamType = value;
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
this.setState(
|
|
1869
|
+
{
|
|
1870
|
+
ruleClassData,
|
|
1871
|
+
},
|
|
1872
|
+
() => {
|
|
1873
|
+
callBack(ruleClassData);
|
|
1874
|
+
},
|
|
1875
|
+
);
|
|
1876
|
+
};
|
|
1877
|
+
|
|
1650
1878
|
render() {
|
|
1651
1879
|
const { onlyOneRule, callBack, disabled, headerButtonComponentFun } = this.props;
|
|
1652
1880
|
const { ruleClassData, modalParams } = this.state;
|
|
@@ -8,11 +8,9 @@ import { handleError } from '../../../utils/requestUtils';
|
|
|
8
8
|
import { queryIdentityInfo, findChangedThresholdQuery, setParams, dateFormat, fullDateFormat } from './util';
|
|
9
9
|
import { request as SulaRequest } from 'bssula';
|
|
10
10
|
import { stringify } from 'querystring';
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
BsCascader
|
|
15
|
-
} from '../../../index';
|
|
11
|
+
import BusinessSearchSelect from '../../Business/SearchSelect';
|
|
12
|
+
import BusinessTreeSearchSelect from '../../Business/TreeSearchSelect';
|
|
13
|
+
import { BsCascader } from '../../Functional/BsAntdSula/index';
|
|
16
14
|
import CustomSelector from './CustomPlugin/CustomSelector';
|
|
17
15
|
const { RangePicker } = DatePicker;
|
|
18
16
|
|
|
@@ -29,6 +27,7 @@ export default class RuleField extends Component {
|
|
|
29
27
|
thresholdQuery: {},
|
|
30
28
|
thresholdList: [],
|
|
31
29
|
options: [],
|
|
30
|
+
isQueryParams: false
|
|
32
31
|
};
|
|
33
32
|
}
|
|
34
33
|
|
|
@@ -45,6 +44,7 @@ export default class RuleField extends Component {
|
|
|
45
44
|
queryIdentify,
|
|
46
45
|
propertyCode,
|
|
47
46
|
queryIdentifyType,
|
|
47
|
+
isQueryParams
|
|
48
48
|
} = this.props;
|
|
49
49
|
this.setState(
|
|
50
50
|
{
|
|
@@ -57,6 +57,7 @@ export default class RuleField extends Component {
|
|
|
57
57
|
dataTypeCode,
|
|
58
58
|
dataChoiceBusinessType,
|
|
59
59
|
dataInputBusinessType,
|
|
60
|
+
isQueryParams,
|
|
60
61
|
others,
|
|
61
62
|
fieldValues: [...values],
|
|
62
63
|
options,
|
|
@@ -283,11 +284,26 @@ export default class RuleField extends Component {
|
|
|
283
284
|
itemDetail={},
|
|
284
285
|
others={},
|
|
285
286
|
propertyCode,
|
|
287
|
+
isQueryParams
|
|
286
288
|
} = this.props;
|
|
287
289
|
const { thresholdList } = this.state;
|
|
288
290
|
const styleCommon = {
|
|
289
291
|
width: customerWidth || '180px',
|
|
290
292
|
};
|
|
293
|
+
|
|
294
|
+
if(isQueryParams) {
|
|
295
|
+
return <Input
|
|
296
|
+
defaultValue={values.join(',')}
|
|
297
|
+
disabled={disabled}
|
|
298
|
+
style={styleCommon}
|
|
299
|
+
onBlur={(e) => {
|
|
300
|
+
values = e.target.value.split(',');
|
|
301
|
+
valueNames = e.target.value.split(',');
|
|
302
|
+
callback(values, valueNames);
|
|
303
|
+
}}
|
|
304
|
+
/>
|
|
305
|
+
}
|
|
306
|
+
|
|
291
307
|
if (!selectOperation) return <Input disabled style={styleCommon}></Input>;
|
|
292
308
|
const SET_TYPE = ['in', 'nin', 'cn', 'ncn','5']; //集合类型 (数字为 兼容用户管理子应用使用规则组件)
|
|
293
309
|
const INTERVAL_TYPE = ['be', 'bed', 'nbe', 'nbed', 'ber', 'bel']; //区间类型
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# RuleSetter 规则设置器组件
|
|
2
|
+
|
|
3
|
+
## 简介
|
|
4
|
+
`RuleSetter` 是一个封装了完整规则编辑逻辑的高级业务组件。它内部集成了 `RuleObjectComponent`,并内置了规则模板详情查询、规则对象树加载、操作符获取、规则实例数据回显以及规则保存等全套数据交互逻辑。
|
|
5
|
+
|
|
6
|
+
开发者只需提供规则模板 ID (`id`) 和业务标识 (`extStrField01`),即可快速在页面中引入一个功能完备的规则编辑器。
|
|
7
|
+
|
|
8
|
+
## 组件路径
|
|
9
|
+
`src/components/Solution/RuleSetter/index.tsx`
|
|
10
|
+
|
|
11
|
+
## Props 属性说明
|
|
12
|
+
|
|
13
|
+
| 属性名 | 类型 | 必填 | 说明 |
|
|
14
|
+
|Ref | --- | --- | --- |
|
|
15
|
+
| id / sceneId | `String` | 是 | 规则模板 ID,用于加载规则元数据(对象树、操作符等)。 |
|
|
16
|
+
| extStrField01 | `String` | 否 | 业务关键字段(如业务单据ID、租户ID等),用于区分同一模板下的不同业务实例。 |
|
|
17
|
+
| name | `String` | 否 | 规则实例名称。 |
|
|
18
|
+
| type | `String` | 否 | 组件模式。`instance` 表示规则实例模式(加载并保存具体的业务规则);为空则通常用于模板设计模式。 |
|
|
19
|
+
| saveUrl | `String` | 否 | 自定义保存接口地址。默认为 `/basic/ruleDetail/addAndUpdate`。 |
|
|
20
|
+
| customerValidator | `Function` | 否 | 自定义校验函数。`(ruleResultList, ruleTypeData) => boolean`。 |
|
|
21
|
+
| parseCustomParams | `Function` | 否 | 自定义保存参数处理函数。`(params) => newParams`。 |
|
|
22
|
+
| RuleObjectComponentProps | `Object` | 否 | 透传给底层 `RuleObjectComponent` 的属性对象。可用于开启特定功能(如插入SQL)。 |
|
|
23
|
+
|
|
24
|
+
## 开启“插入 SQL”功能
|
|
25
|
+
|
|
26
|
+
通过 `RuleObjectComponentProps` 属性,可以将 `needShowInsertSQL` 参数传递给底层的规则组件,从而开启“插入 SQL”功能。
|
|
27
|
+
|
|
28
|
+
开启后,在每条规则条件的右侧会新增一个“插入 SQL”按钮,允许用户直接输入 SQL 片段作为条件值。
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
<RuleSetter
|
|
32
|
+
id="template_123"
|
|
33
|
+
type="instance"
|
|
34
|
+
RuleObjectComponentProps={{
|
|
35
|
+
needShowInsertSQL: true
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 代码演示
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import React, { useRef } from 'react';
|
|
44
|
+
import { Button, message } from 'antd';
|
|
45
|
+
import { RuleSetter } from '../../../index';
|
|
46
|
+
|
|
47
|
+
export default () => {
|
|
48
|
+
const ruleSetterRef = useRef();
|
|
49
|
+
|
|
50
|
+
const handleSave = () => {
|
|
51
|
+
if (ruleSetterRef.current) {
|
|
52
|
+
// 调用组件内部的保存方法
|
|
53
|
+
ruleSetterRef.current.handleSave()
|
|
54
|
+
.then(() => {
|
|
55
|
+
message.success('规则保存成功');
|
|
56
|
+
})
|
|
57
|
+
.catch((err) => {
|
|
58
|
+
console.error('保存失败', err);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<div style={{ background: '#f5f5f5', padding: 20 }}>
|
|
65
|
+
<div style={{ marginBottom: 16, textAlign: 'right' }}>
|
|
66
|
+
<Button type="primary" onClick={handleSave}>
|
|
67
|
+
保存规则
|
|
68
|
+
</Button>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<RuleSetter
|
|
72
|
+
ref={ruleSetterRef}
|
|
73
|
+
id="100000132" // 示例模板ID,请替换为实际存在的ID
|
|
74
|
+
type="instance"
|
|
75
|
+
extStrField01="business_order_001" // 示例业务ID
|
|
76
|
+
name="订单审核规则"
|
|
77
|
+
// 开启插入SQL功能
|
|
78
|
+
RuleObjectComponentProps={{
|
|
79
|
+
needShowInsertSQL: true,
|
|
80
|
+
needShowReqCondition: true,
|
|
81
|
+
// 也可以传递其他 RuleObjectComponent 支持的属性
|
|
82
|
+
onlyCondition: false
|
|
83
|
+
}}
|
|
84
|
+
saveUrl="/api/custom/save/rule" // 可选:自定义保存接口
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 注意事项
|
|
92
|
+
|
|
93
|
+
1. **数据依赖**:该组件强依赖后端接口(如 `/basic/ruleTemplate/`等),请确保后端服务正常且接口地址匹配。
|
|
94
|
+
2. **Ref 引用**:组件暴露了 `handleSave` 方法,父组件需要通过 `ref` 来触发保存操作。
|
|
95
|
+
3. **模式区别**:
|
|
96
|
+
* `type="instance"`:会根据 `id` 和 `extStrField01` 加载已保存的规则实例数据。
|
|
97
|
+
* `type` 为空:主要用于设计规则模板本身,加载的是模板定义数据。
|
package/src/index.ts
CHANGED
|
@@ -43,10 +43,17 @@ export { default as EllipsisTooltip} from './components/Functional/EllipsisToolt
|
|
|
43
43
|
export * from './components/Functional/BsAntdSula/index';
|
|
44
44
|
export { default as RuleComponent} from './components/Solution/RuleComponent';
|
|
45
45
|
export { default as RuleSetter} from './components/Solution/RuleSetter';
|
|
46
|
+
export { default as RenderCompItem} from './components/Solution/RuleComponent/RenderCompItem';
|
|
47
|
+
export { default as TrialCalculation} from './components/Business/TrialCalculation';
|
|
48
|
+
|
|
49
|
+
export { processDetailButtonsVisible as processDetailButtonsVisible } from './components/Business/DetailPageWrapper';
|
|
50
|
+
|
|
51
|
+
|
|
46
52
|
|
|
47
53
|
// 通用组件
|
|
48
54
|
export { default as ExtendedCollapse } from './components/Common/ExtendedCollapse';
|
|
49
55
|
export { default as Section } from './components/Common/Section';
|
|
50
56
|
export { default as ParagraphCopier } from './components/Common/ParagraphCopier';
|
|
51
57
|
|
|
52
|
-
export { default as SystemLog } from './components/Business/SystemLog';
|
|
58
|
+
export { default as SystemLog } from './components/Business/SystemLog';
|
|
59
|
+
export * from './components/Business/ImportExport';
|
package/src/utils/auth.ts
CHANGED
|
@@ -1,4 +1,41 @@
|
|
|
1
|
-
import { getMenuAuthDataKey } from '
|
|
1
|
+
import { getLimitMenuDataKey, getMenuAuthDataKey } from './LocalstorageUtils';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 根据上游权限编码获取关联的导入导出业务功能编码。
|
|
5
|
+
*/
|
|
6
|
+
export const getRelationTemplateCode = (authCode: string): string => {
|
|
7
|
+
if (!authCode) return '';
|
|
8
|
+
|
|
9
|
+
let menuData: any[] = [];
|
|
10
|
+
try {
|
|
11
|
+
const storedMenuData = JSON.parse(
|
|
12
|
+
localStorage.getItem(getLimitMenuDataKey()) || '[]',
|
|
13
|
+
);
|
|
14
|
+
menuData = Array.isArray(storedMenuData) ? storedMenuData : [];
|
|
15
|
+
} catch (error) {
|
|
16
|
+
return '';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let buttonDataList: any[] = [];
|
|
20
|
+
/**
|
|
21
|
+
* 递归收集叶子菜单下的按钮配置。
|
|
22
|
+
*/
|
|
23
|
+
const collectButtons = (items: any[]) => {
|
|
24
|
+
items.forEach((item: any) => {
|
|
25
|
+
if (item?.children?.length) {
|
|
26
|
+
collectButtons(item.children);
|
|
27
|
+
} else {
|
|
28
|
+
buttonDataList = [...buttonDataList, ...(item?.buttons || [])];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
collectButtons(menuData);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
buttonDataList.find((item) => item.bizCode === authCode)
|
|
36
|
+
?.relationExcelTemplateCode || ''
|
|
37
|
+
);
|
|
38
|
+
};
|
|
2
39
|
|
|
3
40
|
// 判断某个按钮/菜单 是否有权限,返回布尔值
|
|
4
41
|
export const authFunc = (code: string) => {
|
|
@@ -36,4 +73,4 @@ export const handleJudgeAuthButtons = (buttonCodeArray: any[]) => {
|
|
|
36
73
|
export const shouldUseAuth = () => {
|
|
37
74
|
// @ts-ignore
|
|
38
75
|
return window.__POWERED_BY_WUJIE__ ? true : false;
|
|
39
|
-
};
|
|
76
|
+
};
|