@bit-sun/business-component 4.0.13-alpha.5 → 4.0.13-alpha.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "4.0.13-alpha.5",
3
+ "version": "4.0.13-alpha.7",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -711,7 +711,7 @@ class SortableTable extends React.Component {
711
711
  <div className={'sort_table_wrapper'}>
712
712
  {visible && (
713
713
  <Modal
714
- title="筛选条件设置"
714
+ title="展示列设置"
715
715
  wrapClassName={'sort_table_wrapper'}
716
716
  width={810}
717
717
  visible={visible}
@@ -748,7 +748,7 @@ class SortableTable extends React.Component {
748
748
  <div className={'sort_table'}>
749
749
  <div className={'sort_table_column_wrapper'}>
750
750
  <span className={'sort_table_column_count'}>
751
- <span>勾选你想使用的筛选条件</span>
751
+ <span>勾选你想展示的表格列</span>
752
752
  </span>
753
753
  <div className={'sort_table_column'}>
754
754
  <Input
@@ -882,7 +882,7 @@ class SortableTable extends React.Component {
882
882
  </div>
883
883
  <div className={'sort_table_content_wrapper'}>
884
884
  <span className={'sort_table_content_count'}>
885
- <span>已选择的搜索条件排序</span>
885
+ <span>已选择的展示列排序</span>
886
886
  </span>
887
887
  <div className={'sort_table_content'}>
888
888
  <span style={{ paddingLeft: '10px' }}>
@@ -7,7 +7,7 @@ import request from '@/utils/request';
7
7
  import _, { escapeRegExp, isNil, values } from "lodash"
8
8
  import './index.less';
9
9
  import { BusinessSearchSelect, QueryMutipleInput, QueryMutipleSearchSelect } from '@/index';
10
- import { handleSourceName, getFormRowInfo, hasMoreQueryFields, defaultVisibleFieldsCount, getRealStr, ColSpan, getTableHeigth, getCurrentSRKs, getRenderSource, handleParams, convertUrlQueryParams, convertBodyParams, formatSelectedValue, convertResData, makeUniqueValue, handleSelectOptionsShowValue, LightHeightOption, maxTagPlaceholder, getShowStr } from './utils';
10
+ import { handleSourceName, getFormRowInfo, hasMoreQueryFields, defaultVisibleFieldsCount, getRealStr, ColSpan, getTableHeigth, getCurrentSRKs, getRenderSource, handleParams, convertUrlQueryParams, convertBodyParams, formatSelectedValue, convertResData, makeUniqueValue, handleSelectOptionsShowValue, LightHeightOption, maxTagPlaceholder, getShowStr, handleTableColumns } from './utils';
11
11
  import { judgeIsRequestError } from '@/utils/requestUtils';
12
12
  import zhankaitiaojian from '../../../assets/zhankaitiaojian-icon.svg';
13
13
  import PropertySelector from '@/components/Business/PropertyModal';
@@ -140,7 +140,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
140
140
  const [indeterminate, setIndeterminate] = useState(false)
141
141
  const [tableFormParams, setTableFormParams] = useState({});
142
142
  const [tooltipVisible, setTooltipVisible] = useState(false);
143
- const [tableShowColumns, setTabletShowColumns] = useState(modalTableProps?.tableColumns?.filter(s => typeof s.defaultSort == 'number')?.sort((a,b)=> a.defaultSort-b.defaultSort)||[]);
143
+ const [tableShowColumns, setTabletShowColumns] = useState(handleTableColumns(modalTableProps?.tableColumns)); // 默认展示表头-modalTableProps?.tableColumns
144
144
  const [confirmLoading, setConfirmLoading] = useState(false);
145
145
  const [modalSearched, setModalSearched]=useState(false);
146
146
 
@@ -322,6 +322,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
322
322
 
323
323
  useEffect(() => {
324
324
  setUniqueValue(makeUniqueValue());
325
+ setTabletShowColumns(handleTableColumns(modalTableProps?.tableColumns));
325
326
  }, [resultSourceKey])
326
327
 
327
328
  useEffect(() => {
@@ -397,6 +397,13 @@ export const maxTagPlaceholder = (selectedValues: any, { selectProps, onChange,
397
397
  )
398
398
  }
399
399
 
400
+ // 弹窗数据表头处理
401
+ export const handleTableColumns = (tableColumns: any) => {
402
+ // 按照默认设置排序 > 没有排序字段的展示所有列表头 > 没有表头列不展示
403
+ const showTableColumns = tableColumns?.filter((s: any) => typeof s.defaultSort == 'number')||tableColumns||[];
404
+ return showTableColumns?.sort((a: any,b: any)=> a.defaultSort-b.defaultSort)||[]
405
+ };
406
+
400
407
  // ------------------------------------------ 数据源展示 相关处理--结束----------------------------------------
401
408
 
402
409