@bit-sun/business-component 4.2.1-alpha.1-aiwei → 4.2.1-alpha.11-aiwei
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.
|
@@ -317,7 +317,7 @@ export default () => {
|
|
|
317
317
|
},
|
|
318
318
|
// prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
|
|
319
319
|
selectProps,
|
|
320
|
-
selectBusinessType: '
|
|
320
|
+
selectBusinessType: 'skuCommodity',
|
|
321
321
|
};
|
|
322
322
|
|
|
323
323
|
const onTabChange = (key) => {
|
|
@@ -859,16 +859,17 @@ export default () => {
|
|
|
859
859
|
console.log(value)
|
|
860
860
|
setValue(value)
|
|
861
861
|
},
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
862
|
+
requestConfig: {
|
|
863
|
+
url: `/bop/api/store`,
|
|
864
|
+
filter: 'qp-name,code-orGroup,like',
|
|
865
|
+
mappingTextField: 'name',
|
|
866
|
+
mappingValueField: 'code',
|
|
867
|
+
otherParams: {
|
|
868
|
+
sorter: 'desc-id'
|
|
869
|
+
}, // 默认参数
|
|
870
|
+
sourceName: 'code',
|
|
871
|
+
extralHeaders: {'x-biz-code': 3}
|
|
872
|
+
},
|
|
872
873
|
// prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
|
|
873
874
|
selectProps,
|
|
874
875
|
selectBusinessType: 'shopFile',
|
|
@@ -878,6 +879,25 @@ export default () => {
|
|
|
878
879
|
...props,
|
|
879
880
|
// prefixUrl: { selectPrefix: '/channel-manage/', formSelectFix: '/channel-manage/' },
|
|
880
881
|
selectBusinessType: 'shopFile2',
|
|
882
|
+
modalTableProps: {
|
|
883
|
+
isOpen: true,
|
|
884
|
+
querySelectHeadersList: [
|
|
885
|
+
{
|
|
886
|
+
'x-biz-code': 3
|
|
887
|
+
}
|
|
888
|
+
]
|
|
889
|
+
},
|
|
890
|
+
requestConfig: {
|
|
891
|
+
url: `/bop/api/store`,
|
|
892
|
+
filter: 'qp-name,code-orGroup,like',
|
|
893
|
+
mappingTextField: 'name',
|
|
894
|
+
mappingValueField: 'code',
|
|
895
|
+
otherParams: {
|
|
896
|
+
sorter: 'desc-id'
|
|
897
|
+
}, // 默认参数
|
|
898
|
+
sourceName: 'code',
|
|
899
|
+
extralHeaders: {'x-biz-code': 3}
|
|
900
|
+
},
|
|
881
901
|
}
|
|
882
902
|
|
|
883
903
|
const onTabChange = (key) => {
|
|
@@ -55,6 +55,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
55
55
|
viewShowValueStr, // 详情展示值,不传展示组件处理的默认值
|
|
56
56
|
searchStartLength, // 默认不校验长度去搜索,如果配置了,则按照配置项长度进行处理搜索
|
|
57
57
|
isQuery = false, // 是否是查询条件
|
|
58
|
+
requireSearchCondition = false, // 是否必须选择一个值
|
|
58
59
|
} = rCTemp || {};
|
|
59
60
|
const requestConfig = {url,method,otherParams,isMap,fixedparameter,fieldValToParam,fixedparamsDisabled,mappingTextField,mappingTextShowKeyField,mappingValueField,mappingTextShowTextField,init,extralHeaders,specialBracket,noNeedSplit,noOperate,viewShowValueStr,searchStartLength,...rCTemp};
|
|
60
61
|
const resultSourceKey = handleSourceName(sourceName || requestConfig?.sourceName || ctx?.name || 'supplierCode')
|
|
@@ -479,6 +480,18 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
479
480
|
|
|
480
481
|
const onSearchTable = () => {
|
|
481
482
|
const params = form.getFieldsValue();
|
|
483
|
+
// 必须选择一个值
|
|
484
|
+
if(requireSearchCondition) {
|
|
485
|
+
const hasValidValue = Object.values(params).some(value =>
|
|
486
|
+
(Array.isArray(value) && value.length > 0) ||
|
|
487
|
+
(typeof value === 'string' && value.trim().length > 0)
|
|
488
|
+
);
|
|
489
|
+
|
|
490
|
+
if(!hasValidValue) {
|
|
491
|
+
message.warning('请至少选择一个搜索条件');
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
482
495
|
setModalSearched(true);
|
|
483
496
|
setTableFormParams(params);
|
|
484
497
|
getData({ ...params, pageSize: tableInitPageSize }, 2, null);
|
|
@@ -711,7 +724,25 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
|
|
|
711
724
|
}
|
|
712
725
|
|
|
713
726
|
const renderShowTable = (tableList, type) => {
|
|
714
|
-
const
|
|
727
|
+
const viCount = modalTableProps?.visibleFieldsCount || defaultVisibleFieldsCount;
|
|
728
|
+
const canExpand = hasMoreQueryFields(modalTableProps);
|
|
729
|
+
const collapsedList = modalTableProps?.tableSearchForm?.slice(0, viCount);
|
|
730
|
+
const baseHeight = getTableHeigth(collapsedList);
|
|
731
|
+
const rowsCollapsed = getFormRowInfo(collapsedList, modalTableProps?.tableSearchColSpan).totalRows;
|
|
732
|
+
const rowsExpandedData = getFormRowInfo(modalTableProps?.tableSearchForm, modalTableProps?.tableSearchColSpan);
|
|
733
|
+
let rowsExpanded = rowsExpandedData.totalRows;
|
|
734
|
+
let isMoreAction = false;
|
|
735
|
+
if(24 / modalTableProps?.tableSearchColSpan - rowsExpandedData.emptyArray.length === 1) {
|
|
736
|
+
rowsExpanded++;
|
|
737
|
+
isMoreAction = true;
|
|
738
|
+
}
|
|
739
|
+
const extraRows = (!collapsed && canExpand) ? Math.max(0, rowsExpanded - rowsCollapsed) : 0;
|
|
740
|
+
let tableBoxHeighth = baseHeight;
|
|
741
|
+
if(isMoreAction && extraRows > 0) {
|
|
742
|
+
tableBoxHeighth = tableBoxHeighth + ((extraRows - 1) ? (extraRows - 1) : 0) * 34 + 32
|
|
743
|
+
} else {
|
|
744
|
+
tableBoxHeighth = tableBoxHeighth + extraRows * 34
|
|
745
|
+
}
|
|
715
746
|
const x = tableList?.length ? 82 : 28; // 无数据没有分页,有数据计算减去:分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
|
|
716
747
|
const oSY = `calc(100vh - ${tableBoxHeighth}px - ${x}px)`;
|
|
717
748
|
const mTB = `calc(50vh - ${tableBoxHeighth/2}px - ${x/2}px - 40px)`
|