ls-pro-common 3.0.37 → 3.0.39

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.
@@ -0,0 +1,15 @@
1
+ import { CSSProperties } from 'react';
2
+ declare const TagCheck: (props: {
3
+ value?: string | number | string[] | number[] | undefined;
4
+ onChange?: ((checkedValues: any, currentItem: any, checked: boolean) => void) | undefined;
5
+ className?: string | undefined;
6
+ tagClassName?: string | undefined;
7
+ style?: CSSProperties | undefined;
8
+ tagStyle?: CSSProperties | undefined;
9
+ options: {
10
+ value: number | string;
11
+ label: string;
12
+ }[];
13
+ multiple?: boolean | undefined;
14
+ }) => JSX.Element;
15
+ export default TagCheck;
@@ -0,0 +1,63 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import "antd/es/tag/style";
3
+ import _Tag from "antd/es/tag";
4
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
+ import React from "react"; // 平铺选择,支持单选及多选。
6
+ import { useState, useEffect } from 'react';
7
+ import classNames from 'classnames';
8
+ var toArray = function toArray(val) {
9
+ return val === undefined || val === null ? [] : Array.isArray(val) ? val : [val];
10
+ };
11
+ var TagCheck = function TagCheck(props) {
12
+ var _onChange = props.onChange,
13
+ className = props.className,
14
+ style = props.style,
15
+ tagClassName = props.tagClassName,
16
+ tagStyle = props.tagStyle,
17
+ options = props.options,
18
+ _props$multiple = props.multiple,
19
+ multiple = _props$multiple === void 0 ? true : _props$multiple;
20
+ var _useState = useState(toArray(props.value)),
21
+ _useState2 = _slicedToArray(_useState, 2),
22
+ innerValue = _useState2[0],
23
+ setInnerValue = _useState2[1];
24
+ useEffect(function () {
25
+ if (!('value' in props)) return;
26
+ setInnerValue(toArray(props.value));
27
+ }, [props.value]);
28
+ return /*#__PURE__*/React.createElement("div", {
29
+ style: style,
30
+ className: classNames('tag-check', className)
31
+ }, multiple && options.length > 0 && /*#__PURE__*/React.createElement(_Tag.CheckableTag, {
32
+ checked: innerValue.length === options.length,
33
+ onChange: function onChange(checked) {
34
+ var val = checked ? options.map(function (o) {
35
+ return o.value;
36
+ }) : [];
37
+ setInnerValue(val);
38
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(val.length ? val : undefined, 'all', checked);
39
+ }
40
+ }, "\u5168\u90E8"), options && options.map(function (item) {
41
+ return /*#__PURE__*/React.createElement(_Tag.CheckableTag, {
42
+ className: tagClassName,
43
+ style: tagStyle,
44
+ key: item.value,
45
+ checked: innerValue.filter(function (o) {
46
+ return item.value == o;
47
+ }).length > 0,
48
+ onChange: function onChange(checked) {
49
+ var val = [];
50
+ if (checked) {
51
+ val = multiple ? [].concat(_toConsumableArray(innerValue), [item.value]) : [item.value];
52
+ } else {
53
+ val = innerValue.filter(function (o) {
54
+ return o != item.value;
55
+ });
56
+ }
57
+ setInnerValue(val);
58
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(val.length ? multiple ? val : val[0] : undefined, item, checked);
59
+ }
60
+ }, item.label);
61
+ }));
62
+ };
63
+ export default TagCheck;
@@ -371,6 +371,39 @@ a:hover {
371
371
  }
372
372
  }
373
373
 
374
+ .tag-check {
375
+ display: flex;
376
+ flex-wrap: wrap;
377
+ gap: 5px;
378
+
379
+ .ant-tag-checkable {
380
+ background-color: #efefef;
381
+ border-color: #efefef;
382
+ margin-right: 0px;
383
+ position: relative;
384
+ }
385
+
386
+ .ant-tag-checkable-checked {
387
+ border-color: var(--ant-primary-color);
388
+ color: var(--ant-primary-color);
389
+ background-color: var(--ant-primary-1);
390
+
391
+ &::after {
392
+ content: '';
393
+ position: absolute;
394
+ width: 0;
395
+ height: 0;
396
+ right: 0;
397
+ bottom: 0;
398
+ border-width: 4px;
399
+ border-style: solid;
400
+ border-color: transparent;
401
+ border-right-color: var(--ant-primary-color);
402
+ border-bottom-color: var(--ant-primary-color);
403
+ }
404
+ }
405
+ }
406
+
374
407
  .ant-pro-table-list-toolbar-title {
375
408
  .ls-group-tip {
376
409
  padding-bottom: 0;
@@ -34,7 +34,9 @@ function useDtl(dtlParam) {
34
34
  beforeAudit = dtlParam.beforeAudit,
35
35
  afterAudit = dtlParam.afterAudit,
36
36
  _dtlParam$ifHistory = dtlParam.ifHistory,
37
- ifHistory = _dtlParam$ifHistory === void 0 ? 0 : _dtlParam$ifHistory;
37
+ ifHistory = _dtlParam$ifHistory === void 0 ? 0 : _dtlParam$ifHistory,
38
+ _dtlParam$isV = dtlParam.isV2,
39
+ isV2 = _dtlParam$isV === void 0 ? false : _dtlParam$isV;
38
40
  var _usePermission = usePermission(),
39
41
  canAdd = _usePermission.canAdd,
40
42
  canEdit = _usePermission.canEdit,
@@ -592,6 +594,27 @@ function useDtl(dtlParam) {
592
594
  return _ref7.apply(this, arguments);
593
595
  };
594
596
  }();
597
+ var toV2LoadParams = function toV2LoadParams(param) {
598
+ var page = param.page,
599
+ pageSize = param.pageSize,
600
+ where = param.where,
601
+ sort = param.sort;
602
+ delete param.page;
603
+ delete param.pageSize;
604
+ delete param.where;
605
+ delete param.sort;
606
+ param['page.pn'] = page;
607
+ param['page.size'] = pageSize;
608
+ if (where && Object.keys(where).length) {
609
+ for (var key in where) {
610
+ param['search.' + key] = where[key];
611
+ }
612
+ }
613
+ if (sort) {
614
+ var sortArr = sort.split(' ');
615
+ param['sort.' + sortArr[0].trim()] = (sortArr[1] || 'asc').trim();
616
+ }
617
+ };
595
618
  /** 加载数据方法 */
596
619
  var onLoadDtl = /*#__PURE__*/function () {
597
620
  var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(params, sort, filter) {
@@ -651,32 +674,35 @@ function useDtl(dtlParam) {
651
674
  if (ifHistory === 1) {
652
675
  param.ifHistory = 1;
653
676
  }
677
+ if (isV2) {
678
+ toV2LoadParams(param);
679
+ }
654
680
  _context8.t0 = beforeLoad;
655
681
  if (!_context8.t0) {
656
- _context8.next = 21;
682
+ _context8.next = 22;
657
683
  break;
658
684
  }
659
- _context8.next = 19;
685
+ _context8.next = 20;
660
686
  return beforeLoad(param);
661
- case 19:
687
+ case 20:
662
688
  _context8.t1 = _context8.sent;
663
689
  _context8.t0 = _context8.t1 === false;
664
- case 21:
690
+ case 22:
665
691
  if (!_context8.t0) {
666
- _context8.next = 23;
692
+ _context8.next = 24;
667
693
  break;
668
694
  }
669
695
  return _context8.abrupt("return", {
670
696
  data: [],
671
697
  success: true
672
698
  });
673
- case 23:
699
+ case 24:
674
700
  if (sumProperties && param.sort) {
675
701
  delete param.sort;
676
702
  }
677
- _context8.next = 26;
703
+ _context8.next = 27;
678
704
  return dtlService.load(param);
679
- case 26:
705
+ case 27:
680
706
  result = _context8.sent;
681
707
  result.data = result.rows;
682
708
  result.success = true;
@@ -684,7 +710,7 @@ function useDtl(dtlParam) {
684
710
  result.data = result.footer;
685
711
  }
686
712
  return _context8.abrupt("return", result);
687
- case 31:
713
+ case 32:
688
714
  case "end":
689
715
  return _context8.stop();
690
716
  }
@@ -696,8 +722,8 @@ function useDtl(dtlParam) {
696
722
  }();
697
723
  var onExportDtl = /*#__PURE__*/function () {
698
724
  var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(url, param) {
699
- var _param$exportColumns, _param$searchData;
700
- var searchArr, _result$flag6, result, _result$flag7, _result$flag8;
725
+ var _param$exportColumns;
726
+ var searchArr, arr, otherArr, whereArr, where, _result$flag6, result, _result$flag7, _result$flag8;
701
727
  return _regeneratorRuntime.wrap(function _callee9$(_context9) {
702
728
  while (1) switch (_context9.prev = _context9.next) {
703
729
  case 0:
@@ -715,11 +741,44 @@ function useDtl(dtlParam) {
715
741
  showWarn('请配置业务接口 bizApi 属性');
716
742
  return _context9.abrupt("return", false);
717
743
  case 6:
718
- // 处理导出历史数据传参
719
- if (ifHistory && !param.searchData || !((_param$searchData = param.searchData) === null || _param$searchData === void 0 ? void 0 : _param$searchData.includes('ifHistory=1'))) {
744
+ if (param.searchData) {
720
745
  searchArr = (param.searchData || '').split('&');
721
- searchArr.push('ifHistory=1');
722
- param.searchData = searchArr.join('&');
746
+ if (isV2) {
747
+ arr = searchArr.map(function (item) {
748
+ if (item.startsWith('page=')) {
749
+ // page=1 改成 page.pn=1;
750
+ return item.replace('page=', 'page.pn=');
751
+ } else if (item.startsWith('pageSize=')) {
752
+ // pageSize=25 => page.size=25
753
+ return item.replace('pageSize=', 'page.size=');
754
+ } else if (item.startsWith('sort=')) {
755
+ // sort=createTime desc => sort.createTime=desc
756
+ return item.replace('sort=', 'sort.').replace(' ', '=');
757
+ } else if (item.startsWith('ifPage=') || item.startsWith('ifHistory=')) {
758
+ return item;
759
+ } else {
760
+ //其它查询条件,添加 search.
761
+ return 'search.' + item;
762
+ }
763
+ });
764
+ param.searchData = arr.join('&');
765
+ } else {
766
+ otherArr = searchArr.filter(function (item) {
767
+ return item.startsWith('page=') || item.startsWith('pageSize=') || item.startsWith('ifPage=') || item.startsWith('ifHistory=') || item.startsWith('sort=');
768
+ });
769
+ whereArr = searchArr.filter(function (item) {
770
+ return !otherArr.includes(item);
771
+ });
772
+ where = {};
773
+ if (whereArr.length) {
774
+ whereArr.forEach(function (item) {
775
+ var itemArr = item.split('=');
776
+ where[itemArr[0]] = itemArr[1];
777
+ });
778
+ otherArr.push("where=" + JSON.stringify(where));
779
+ param.searchData = otherArr.join('&');
780
+ }
781
+ }
723
782
  }
724
783
  _context9.prev = 7;
725
784
  _context9.next = 10;
@@ -7,6 +7,7 @@ export declare type SingleParamType = {
7
7
  initItem?: any;
8
8
  statusField?: string;
9
9
  auditStatus?: number;
10
+ isV2?: boolean;
10
11
  beforeLoad?: (param: Record<string, any>) => Promise<boolean>;
11
12
  beforeRemove?: (rows: any[]) => Promise<any>;
12
13
  beforeAudit?: (rows: any[]) => Promise<any>;
@@ -45,7 +45,9 @@ function useSingle(inParam) {
45
45
  afterRemove = inParam.afterRemove,
46
46
  afterSave = inParam.afterSave,
47
47
  afterAudit = inParam.afterAudit,
48
- btnStatus = inParam.btnStatus;
48
+ btnStatus = inParam.btnStatus,
49
+ _inParam$isV = inParam.isV2,
50
+ isV2 = _inParam$isV === void 0 ? false : _inParam$isV;
49
51
  /** @name 选中行数据 */
50
52
  var _useState = useState([]),
51
53
  _useState2 = _slicedToArray(_useState, 2),
@@ -400,6 +402,27 @@ function useSingle(inParam) {
400
402
  return _ref5.apply(this, arguments);
401
403
  };
402
404
  }();
405
+ var toV2LoadParams = function toV2LoadParams(param) {
406
+ var page = param.page,
407
+ pageSize = param.pageSize,
408
+ where = param.where,
409
+ sort = param.sort;
410
+ delete param.page;
411
+ delete param.pageSize;
412
+ delete param.where;
413
+ delete param.sort;
414
+ param['page.pn'] = page;
415
+ param['page.size'] = pageSize;
416
+ if (where && Object.keys(where).length) {
417
+ for (var key in where) {
418
+ param['search.' + key] = where[key];
419
+ }
420
+ }
421
+ if (sort) {
422
+ var sortArr = sort.split(' ');
423
+ param['sort.' + sortArr[0].trim()] = (sortArr[1] || 'asc').trim();
424
+ }
425
+ };
403
426
  /** 加载数据方法 */
404
427
  var onLoad = /*#__PURE__*/function () {
405
428
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(params, sort, filter, isHistory) {
@@ -453,19 +476,22 @@ function useSingle(inParam) {
453
476
  }
454
477
  setSelectedRows([]);
455
478
  (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : (_tableRef$current$cle = _tableRef$current.clearSelected) === null || _tableRef$current$cle === void 0 ? void 0 : _tableRef$current$cle.call(_tableRef$current);
479
+ if (isV2) {
480
+ toV2LoadParams(param);
481
+ }
456
482
  _context6.t0 = beforeLoad;
457
483
  if (!_context6.t0) {
458
- _context6.next = 17;
484
+ _context6.next = 18;
459
485
  break;
460
486
  }
461
- _context6.next = 15;
487
+ _context6.next = 16;
462
488
  return beforeLoad(param);
463
- case 15:
489
+ case 16:
464
490
  _context6.t1 = _context6.sent;
465
491
  _context6.t0 = _context6.t1 === false;
466
- case 17:
492
+ case 18:
467
493
  if (!_context6.t0) {
468
- _context6.next = 19;
494
+ _context6.next = 20;
469
495
  break;
470
496
  }
471
497
  return _context6.abrupt("return", {
@@ -473,13 +499,13 @@ function useSingle(inParam) {
473
499
  success: false,
474
500
  total: 0
475
501
  });
476
- case 19:
502
+ case 20:
477
503
  if (sumProperties && param.sort) {
478
504
  delete param.sort;
479
505
  }
480
- _context6.next = 22;
506
+ _context6.next = 23;
481
507
  return service.load(param);
482
- case 22:
508
+ case 23:
483
509
  result = _context6.sent;
484
510
  result.data = result.rows || [];
485
511
  result.success = true;
@@ -487,7 +513,7 @@ function useSingle(inParam) {
487
513
  result.data = result.footer;
488
514
  }
489
515
  return _context6.abrupt("return", result);
490
- case 27:
516
+ case 28:
491
517
  case "end":
492
518
  return _context6.stop();
493
519
  }
@@ -499,8 +525,8 @@ function useSingle(inParam) {
499
525
  }();
500
526
  var onExport = /*#__PURE__*/function () {
501
527
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(url, param) {
502
- var _param$exportColumns, _param$searchData;
503
- var searchArr, _result$flag4, result, _result$flag5, _result$flag6;
528
+ var _param$exportColumns;
529
+ var searchArr, arr, otherArr, whereArr, where, _result$flag4, result, _result$flag5, _result$flag6;
504
530
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
505
531
  while (1) switch (_context7.prev = _context7.next) {
506
532
  case 0:
@@ -518,11 +544,44 @@ function useSingle(inParam) {
518
544
  showWarn('请配置业务接口 bizApi 属性');
519
545
  return _context7.abrupt("return", false);
520
546
  case 6:
521
- // 处理导出历史数据传参,如果组件里没有传入参数,hooks再处理一次
522
- if (ifHistory && !param.searchData || !((_param$searchData = param.searchData) === null || _param$searchData === void 0 ? void 0 : _param$searchData.includes('ifHistory=1'))) {
547
+ if (param.searchData) {
523
548
  searchArr = (param.searchData || '').split('&');
524
- searchArr.push('ifHistory=1');
525
- param.searchData = searchArr.join('&');
549
+ if (isV2) {
550
+ arr = searchArr.map(function (item) {
551
+ if (item.startsWith('page=')) {
552
+ // page=1 改成 page.pn=1;
553
+ return item.replace('page=', 'page.pn=');
554
+ } else if (item.startsWith('pageSize=')) {
555
+ // pageSize=25 => page.size=25
556
+ return item.replace('pageSize=', 'page.size=');
557
+ } else if (item.startsWith('sort=')) {
558
+ // sort=createTime desc => sort.createTime=desc
559
+ return item.replace('sort=', 'sort.').replace(' ', '=');
560
+ } else if (item.startsWith('ifPage=') || item.startsWith('ifHistory=')) {
561
+ return item;
562
+ } else {
563
+ //其它查询条件,添加 search.
564
+ return 'search.' + item;
565
+ }
566
+ });
567
+ param.searchData = arr.join('&');
568
+ } else {
569
+ otherArr = searchArr.filter(function (item) {
570
+ return item.startsWith('page=') || item.startsWith('pageSize=') || item.startsWith('ifPage=') || item.startsWith('ifHistory=') || item.startsWith('sort=');
571
+ });
572
+ whereArr = searchArr.filter(function (item) {
573
+ return !otherArr.includes(item);
574
+ });
575
+ where = {};
576
+ if (whereArr.length) {
577
+ whereArr.forEach(function (item) {
578
+ var itemArr = item.split('=');
579
+ where[itemArr[0]] = itemArr[1];
580
+ });
581
+ otherArr.push("where=" + JSON.stringify(where));
582
+ param.searchData = otherArr.join('&');
583
+ }
584
+ }
526
585
  }
527
586
  _context7.prev = 7;
528
587
  _context7.next = 10;
package/es/http/index.js CHANGED
@@ -42,7 +42,7 @@ request.interceptors.request.use(function (url, options) {
42
42
  }
43
43
  url = url.replace('&noToken=1', '').replace('noToken=1', '');
44
44
  var param = {
45
- resCode: getUrlQuery('resCode') || getUrlQuery('resourceId') || getResourceProps('resourceId'),
45
+ resCode: getUrlQuery('resCode', url) || getUrlQuery('resCode') || getUrlQuery('resourceId') || getResourceProps('resourceId'),
46
46
  _t1: Date.now()
47
47
  };
48
48
  if (!param.resCode) {
package/es/index.d.ts CHANGED
@@ -15,6 +15,7 @@ import IconText from './components/IconText';
15
15
  import IconQuestion from './components/IconQuestion';
16
16
  import IconBell from './components/IconBell';
17
17
  import IconSearch from './components/IconSearch';
18
+ import TagCheck from './components/TagCheck';
18
19
  import BaseService from './service/BaseService';
19
20
  import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
20
21
  import * as utils from './utils';
@@ -29,4 +30,4 @@ import type { DtlLyaoutProps } from './components/DtlLayout';
29
30
  import type { DescritionCardProps } from './components/DescritionCard';
30
31
  import type { PermissionProps } from './components/Permission';
31
32
  export type { ApiResponse, TableToolbar, BaseApiType, MethodType, DtlLyaoutProps, DescritionCardProps, PermissionProps };
32
- export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, Permission, GroupTip, IconBack, IconText, IconBell, IconQuestion, IconSearch, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission, useGetState };
33
+ export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, Permission, GroupTip, IconBack, IconText, IconBell, IconQuestion, IconSearch, TagCheck, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission, useGetState };
package/es/index.js CHANGED
@@ -15,6 +15,7 @@ import IconText from './components/IconText';
15
15
  import IconQuestion from './components/IconQuestion';
16
16
  import IconBell from './components/IconBell';
17
17
  import IconSearch from './components/IconSearch';
18
+ import TagCheck from './components/TagCheck';
18
19
  import BaseService from './service/BaseService';
19
20
  import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
20
21
  import * as utils from './utils';
@@ -23,4 +24,4 @@ import useSingle from './hooks/useSingle';
23
24
  import useDtl from './hooks/useDtl';
24
25
  import usePermission from './hooks/usePermission';
25
26
  import useGetState from './hooks/useGetState';
26
- export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, Permission, GroupTip, IconBack, IconText, IconBell, IconQuestion, IconSearch, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission, useGetState };
27
+ export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, Permission, GroupTip, IconBack, IconText, IconBell, IconQuestion, IconSearch, TagCheck, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission, useGetState };
@@ -0,0 +1,15 @@
1
+ import { CSSProperties } from 'react';
2
+ declare const TagCheck: (props: {
3
+ value?: string | number | string[] | number[] | undefined;
4
+ onChange?: ((checkedValues: any, currentItem: any, checked: boolean) => void) | undefined;
5
+ className?: string | undefined;
6
+ tagClassName?: string | undefined;
7
+ style?: CSSProperties | undefined;
8
+ tagStyle?: CSSProperties | undefined;
9
+ options: {
10
+ value: number | string;
11
+ label: string;
12
+ }[];
13
+ multiple?: boolean | undefined;
14
+ }) => JSX.Element;
15
+ export default TagCheck;
@@ -0,0 +1,63 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import "antd/es/tag/style";
3
+ import _Tag from "antd/es/tag";
4
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
+ import React from "react"; // 平铺选择,支持单选及多选。
6
+ import { useState, useEffect } from 'react';
7
+ import classNames from 'classnames';
8
+ var toArray = function toArray(val) {
9
+ return val === undefined || val === null ? [] : Array.isArray(val) ? val : [val];
10
+ };
11
+ var TagCheck = function TagCheck(props) {
12
+ var _onChange = props.onChange,
13
+ className = props.className,
14
+ style = props.style,
15
+ tagClassName = props.tagClassName,
16
+ tagStyle = props.tagStyle,
17
+ options = props.options,
18
+ _props$multiple = props.multiple,
19
+ multiple = _props$multiple === void 0 ? true : _props$multiple;
20
+ var _useState = useState(toArray(props.value)),
21
+ _useState2 = _slicedToArray(_useState, 2),
22
+ innerValue = _useState2[0],
23
+ setInnerValue = _useState2[1];
24
+ useEffect(function () {
25
+ if (!('value' in props)) return;
26
+ setInnerValue(toArray(props.value));
27
+ }, [props.value]);
28
+ return /*#__PURE__*/React.createElement("div", {
29
+ style: style,
30
+ className: classNames('tag-check', className)
31
+ }, multiple && options.length > 0 && /*#__PURE__*/React.createElement(_Tag.CheckableTag, {
32
+ checked: innerValue.length === options.length,
33
+ onChange: function onChange(checked) {
34
+ var val = checked ? options.map(function (o) {
35
+ return o.value;
36
+ }) : [];
37
+ setInnerValue(val);
38
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(val.length ? val : undefined, 'all', checked);
39
+ }
40
+ }, "\u5168\u90E8"), options && options.map(function (item) {
41
+ return /*#__PURE__*/React.createElement(_Tag.CheckableTag, {
42
+ className: tagClassName,
43
+ style: tagStyle,
44
+ key: item.value,
45
+ checked: innerValue.filter(function (o) {
46
+ return item.value == o;
47
+ }).length > 0,
48
+ onChange: function onChange(checked) {
49
+ var val = [];
50
+ if (checked) {
51
+ val = multiple ? [].concat(_toConsumableArray(innerValue), [item.value]) : [item.value];
52
+ } else {
53
+ val = innerValue.filter(function (o) {
54
+ return o != item.value;
55
+ });
56
+ }
57
+ setInnerValue(val);
58
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(val.length ? multiple ? val : val[0] : undefined, item, checked);
59
+ }
60
+ }, item.label);
61
+ }));
62
+ };
63
+ export default TagCheck;
@@ -371,6 +371,39 @@ a:hover {
371
371
  }
372
372
  }
373
373
 
374
+ .tag-check {
375
+ display: flex;
376
+ flex-wrap: wrap;
377
+ gap: 5px;
378
+
379
+ .ant-tag-checkable {
380
+ background-color: #efefef;
381
+ border-color: #efefef;
382
+ margin-right: 0px;
383
+ position: relative;
384
+ }
385
+
386
+ .ant-tag-checkable-checked {
387
+ border-color: var(--ant-primary-color);
388
+ color: var(--ant-primary-color);
389
+ background-color: var(--ant-primary-1);
390
+
391
+ &::after {
392
+ content: '';
393
+ position: absolute;
394
+ width: 0;
395
+ height: 0;
396
+ right: 0;
397
+ bottom: 0;
398
+ border-width: 4px;
399
+ border-style: solid;
400
+ border-color: transparent;
401
+ border-right-color: var(--ant-primary-color);
402
+ border-bottom-color: var(--ant-primary-color);
403
+ }
404
+ }
405
+ }
406
+
374
407
  .ant-pro-table-list-toolbar-title {
375
408
  .ls-group-tip {
376
409
  padding-bottom: 0;