@bit-sun/business-component 1.0.16 → 1.1.2

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": "1.0.16",
3
+ "version": "1.1.2",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -46,4 +46,4 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  }
49
- }
49
+ }
@@ -23,7 +23,9 @@ export default () => {
23
23
  return (
24
24
  <div>
25
25
  <DataValidation
26
- columns={['skuCode', 'quantity', 'price']}
26
+ // columns={['skuCode', 'quantity', 'price']}
27
+ columns={["skuCode", "quantity", "price"]} // 需要哪些列展示,以及展示的顺序
28
+ validDataUrl="http://test.i-baby.net/wms-ops/recordDetailImport/check" // 校验的接口url
27
29
  onRef={(ref) => {
28
30
  dataValidationRef = ref;
29
31
  }}
@@ -27,6 +27,7 @@ import {
27
27
  } from '@ant-design/icons';
28
28
  import axios from 'axios';
29
29
  import './index.less';
30
+ import _ from "loadsh"
30
31
 
31
32
  const luckysheet = window.luckysheet;
32
33
 
@@ -176,6 +177,10 @@ class DataValidation extends React.Component {
176
177
  if (typeof cell.v === 'string') {
177
178
  cell.m = cell.v = cell.m.trim();
178
179
  }
180
+ if (typeof cell.v === 'number') {
181
+ cell.v = cell.v.toString()
182
+ cell.m = cell.v
183
+ }
179
184
  }
180
185
  // console.log(postion);
181
186
  },
@@ -209,7 +214,6 @@ class DataValidation extends React.Component {
209
214
  defaultRowHeight: 20, //自定义行高
210
215
  defaultColWidth: 120, //自定义列宽
211
216
  config: {},
212
- celldata: data,
213
217
  // celldata:
214
218
  // data && data.length !== 0 ? data : _.flattenDeep(Array.from({ length: 100 }).map((a, b) => Array.from({ length: 100 }).map((c, d) => ({
215
219
  // "r": b,
@@ -217,6 +221,13 @@ class DataValidation extends React.Component {
217
221
  // "v": { "ct": { "fa": "@", "t": "s" }, }
218
222
  // }))))
219
223
  // ,
224
+ celldata:
225
+ data && data.length !== 0 ? data : _.flattenDeep(Array.from({ length: 100 }).map((a, b) => Array.from({ length: 100 }).map((c, d) => ({
226
+ "r": b,
227
+ "c": d,
228
+ "v": { "ct": { "fa": "@", "t": "s" }, }
229
+ }))))
230
+ ,
220
231
  scrollLeft: 0, //左右滚动条位置
221
232
  // "scrollTop": 315, //上下滚动条位置
222
233
  luckysheet_select_save: [], //选中的区域
@@ -343,6 +354,7 @@ class DataValidation extends React.Component {
343
354
 
344
355
  getValidateData = () => {
345
356
  const { resultData } = this.state;
357
+
346
358
  return {
347
359
  successData: resultData
348
360
  .filter((item) => item.flag)
@@ -373,7 +385,9 @@ class DataValidation extends React.Component {
373
385
 
374
386
  resetData = () => {
375
387
  const { validDataUrl, updateData, columns } = this.props;
376
- const resultData = this.getData()
388
+ const resultData = this.getData().filter(d => {
389
+ return _.compact(Object.values(d)).length
390
+ })
377
391
 
378
392
  axios
379
393
  .post(validDataUrl, {
@@ -61,7 +61,7 @@ const QueryMutipleInput = ({ onValueChange }) => {
61
61
 
62
62
  return (
63
63
  <div className={'query_input'}>
64
- <div class="query_input_show">
64
+ <div className="query_input_show">
65
65
  <Input
66
66
  value={value}
67
67
  onChange={outerChange}
@@ -0,0 +1,115 @@
1
+ .search_select {
2
+ &_show {
3
+ display: flex;
4
+ }
5
+
6
+ &_expand_button {
7
+ position: relative;
8
+ width: 30px;
9
+ color: #ffffff;
10
+ cursor: pointer;
11
+
12
+ span {
13
+ position: absolute;
14
+ height: 20px;
15
+ line-height: 14px;
16
+ left: 50%;
17
+ top: 50%;
18
+ transform: translate(-50%, -50%);
19
+ }
20
+ }
21
+
22
+ &_wrapper {
23
+ position: relative;
24
+ display: flex;
25
+ min-height: 60vh;
26
+ max-height: 60vh;
27
+ overflow: hidden;
28
+ font-size: 14px;
29
+
30
+ &_click_flag {
31
+ position: absolute;
32
+ z-index: 10;
33
+ &_arrow {
34
+ transform: rotate(0deg);
35
+ transition: transform 0.5s;
36
+ }
37
+ &_arrow_1 {
38
+ transform: rotate(-180deg);
39
+ transition: transform 0.5s;
40
+ }
41
+ }
42
+
43
+ &_left {
44
+ width: 28%;
45
+ overflow-y: hidden;
46
+ //background-color: yellow;
47
+ transition: all 0.3s;
48
+ margin-left: 20px;
49
+ }
50
+
51
+ &_left1 {
52
+ width: 0;
53
+ height: 0;
54
+ transition: all 0.3s;
55
+ display: none;
56
+ }
57
+
58
+ &_right {
59
+ width: 70%;
60
+ margin-left: 1%;
61
+ //background-color: pink;
62
+ }
63
+
64
+ &_right1 {
65
+ width: 100%;
66
+ margin-left: 20px;
67
+ //background-color: green;
68
+ }
69
+
70
+ &_right, _right1 {
71
+ overflow-x: auto;
72
+ }
73
+
74
+ .select_list_columns {
75
+ width: 100%;
76
+ height: calc(60vh - 60px);
77
+ overflow-y: auto;
78
+ border: 1px solid #d8d8d8;
79
+ &_tips {
80
+ background: #eee;
81
+ padding: 6px 20px;
82
+ margin-bottom: 10px;
83
+ }
84
+ &_formItems {
85
+ padding: 0 20px;
86
+ }
87
+ }
88
+ .select_list_searchButton {
89
+ display: flex;
90
+ margin: 10px 0px;
91
+ justify-content: flex-end;
92
+ }
93
+
94
+ .select_list_button_space {
95
+ margin-right: 10px;
96
+ }
97
+
98
+ .select_list_selectTips {
99
+ display: flex;
100
+ justify-content: space-between;
101
+ height: 34px;
102
+ line-height: 32px;
103
+ background-color: #eee;
104
+ margin-bottom: 10px;
105
+ padding: 0 12px;
106
+ }
107
+
108
+ .select_list_selectAll {
109
+ position: relative;
110
+ top: -40px;
111
+ left: 20px;
112
+ width: 160px;
113
+ }
114
+ }
115
+ }
@@ -0,0 +1,130 @@
1
+ ---
2
+ nav:
3
+ title: '组件'
4
+ order: 1
5
+ group:
6
+ title: 组件
7
+ order: 0
8
+ title: 档案选择器
9
+ order: 2
10
+ ---
11
+
12
+ ## SearchSelect
13
+
14
+ Demo:
15
+
16
+ ```tsx
17
+ import React, { useRef } from 'react';
18
+ import { SearchSelect } from '@bit-sun/business-component';
19
+
20
+ export default () => {
21
+ const selectProps = {
22
+ mode: 'multiple',
23
+ maxTagCount: 1,
24
+ }
25
+
26
+ const DictionaryUC000013 = [{ text: '共享', value: '10' }, { text: '私有', value: '20' }]
27
+ const modalTableProps = {
28
+ modalTableTitle: '选择供应商',
29
+ tableSearchForm:[
30
+ { name: 'qp-name-like', label: '客户名称' }, // field: { type: 'input', props: { placeholder: '8888'}}
31
+ { name: 'qp-code-like', label: '客户编码' },
32
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
33
+ type: 'select',
34
+ props: {
35
+ mode: 'multiple',
36
+ notFoundContent: '暂无数据',
37
+ allowClear: true,
38
+ showSearch: true,
39
+ showArrow: true,
40
+ maxTagCount: 1,
41
+ optionFilterProp: 'children',
42
+ filterOption: (input: string, option: { props: { children: string } }) =>
43
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
44
+ },
45
+ },
46
+ initialSource: [{ text: '英伦宝贝儿童用品有限公司', value: 'A0001' }]
47
+ },
48
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
49
+ type: 'select',
50
+ props: {
51
+ mode: 'multiple',
52
+ notFoundContent: '暂无数据',
53
+ allowClear: true,
54
+ showSearch: true,
55
+ showArrow: true,
56
+ maxTagCount: 1,
57
+ optionFilterProp: 'children',
58
+ filterOption: (input: string, option: { props: { children: string } }) =>
59
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
60
+ },
61
+ },
62
+ initialSource: [{ text: '上海哲雄母婴用品有限公司', value: 'F002' }, { text: '上海英伦宝贝儿童用品有限公司', value: 'F001' }]
63
+ },
64
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
65
+ type: 'select',
66
+ props: {
67
+ mode: 'multiple',
68
+ notFoundContent: '暂无数据',
69
+ allowClear: true,
70
+ showSearch: true,
71
+ showArrow: true,
72
+ maxTagCount: 1,
73
+ optionFilterProp: 'children',
74
+ filterOption: (input: string, option: { props: { children: string } }) =>
75
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
76
+ },
77
+ },
78
+ initialSource: [{ text: '上海哲雄母婴用品有限公司', value: 'F002' }, { text: '上海英伦宝贝儿童用品有限公司', value: 'F001' }]
79
+ },
80
+ { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: DictionaryUC000013 }, // 页面可以直接使用getDictionarySource('UC000013')
81
+ ],
82
+ tableColumns: [
83
+ {
84
+ title: '客户编码',
85
+ dataIndex: 'code',
86
+ },
87
+ {
88
+ title: '客户名称',
89
+ dataIndex: 'name',
90
+ },
91
+ {
92
+ title: '归属集团',
93
+ dataIndex: 'conglomerateName',
94
+ },
95
+ {
96
+ title: '归属法人公司',
97
+ dataIndex: 'legalCompanyName',
98
+ },
99
+ {
100
+ title: '归属核算主体',
101
+ dataIndex: 'accountingName',
102
+ },
103
+ {
104
+ title: '共享类型',
105
+ dataIndex: 'sharingType',
106
+ render: (text) => DictionaryUC000013?.find((i) => i.value === text)?.text, // getDictionaryTextByValue('UC000013', text)
107
+ },
108
+ ]
109
+ }
110
+
111
+ const onValueChange = (value) => {
112
+ console.log(value)
113
+ }
114
+
115
+ return (
116
+ <div>
117
+ <SearchSelect
118
+ // initValue={{value: '20220105001', label: 'LH公司'}} // 单选
119
+ // initValue={[{value: '20220105001', label: 'LH公司'}]} // 多选
120
+ selectProps={selectProps}
121
+ modalTableProps={modalTableProps}
122
+ selectDataUrl='http://test.i-baby.net/bop/api/supplier'
123
+ onValueChange={onValueChange}
124
+ />
125
+ </div>
126
+ );
127
+ };
128
+ ```
129
+
130
+ More skills for writing demo: https://d.umijs.org/guide/demo-principle