@alicloud/console-components-search 0.2.37-alpha.7 → 0.2.37-beta.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @alicloud/console-components-search
2
+
3
+ ## 0.2.37-beta.0
4
+
5
+ ### Patch Changes
6
+
7
+ - rc-search(fix): 修复一国一云环境的多语言问题
@@ -2,19 +2,21 @@
2
2
  * @title 场景1
3
3
  */
4
4
 
5
- import React, { useState } from 'react';
6
- import { Search, SearchFilter } from '@alicloud/console-components-search';
7
- import { ConfigProvider } from '@alicloud/console-components';
8
-
9
- const options = [
5
+ import React from "react";
6
+ import { Search, SearchFilter } from "@alicloud/console-components-search";
7
+ import { ConfigProvider } from "@alicloud/console-components";
8
+ import { useState } from "react";
9
+
10
+ let options = [
10
11
  {
11
12
  label: '实例名称',
12
13
  dataIndex: 'name',
13
14
  template: 'input',
14
15
  templateProps: {
15
16
  // placeholder: '按实例名称搜索',
16
- dataSource: [],
17
+ dataSource: []
17
18
  },
19
+ groupName:"test"
18
20
  },
19
21
  {
20
22
  label: '网络类型',
@@ -23,12 +25,13 @@ const options = [
23
25
  templateProps: {
24
26
  placeholder: '请选择网络类型',
25
27
  dataSource: [
26
- { label: 'A', value: 'a' },
27
- { label: 'B', value: 'b' },
28
- { label: 'C', value: 'c' },
29
- { label: 'D', value: 'd' },
30
- ],
28
+ {label: 'A', value: 'a'},
29
+ {label: 'B', value: 'b'},
30
+ {label: 'C', value: 'c'},
31
+ {label: 'D', value: 'd'},
32
+ ]
31
33
  },
34
+ groupName:"test"
32
35
  },
33
36
  {
34
37
  label: '付费类型',
@@ -37,213 +40,88 @@ const options = [
37
40
  templateProps: {
38
41
  placeholder: '请选择付费类型',
39
42
  dataSource: [
40
- { label: 'A', value: 'a' },
41
- { label: 'B', value: 'b' },
42
- { label: 'C', value: 'c' },
43
- { label: 'D', value: 'd' },
44
- ],
43
+ {label: 'A', value: 'a'},
44
+ {label: 'B', value: 'b'},
45
+ {label: 'C', value: 'c'},
46
+ {label: 'D', value: 'd'},
47
+ ]
45
48
  },
46
- },
47
- ];
49
+ groupName:"test2"
50
+ }
51
+ ]
48
52
 
49
- const options2 = [
53
+ let options2 = [
50
54
  {
51
55
  label: '实例名称',
52
56
  dataIndex: 'name',
53
57
  template: 'input',
54
58
  templateProps: {
55
59
  placeholder: '按实例名称搜索',
56
- dataSource: [],
57
- },
58
- },
59
- ];
60
-
61
- const intl = (a) => a;
62
-
63
- const options3 = [
64
- {
65
- dataIndex: 'SourceIp',
66
- label: intl('flow_analysis.prop.enum', { value: 'SourceIp' }),
67
- template: 'input',
68
- // groupName: intl('flow_analysis.prop.enum', { value: 'SourceIp' }),
69
- children: [
70
- {
71
- dataIndex: 'SourceIp_equal',
72
- label: intl('flow_analysis.prop.enum', { value: 'SourceIp_equal' }),
73
- template: 'input',
74
- }, {
75
- dataIndex: 'SourceIp_like',
76
- label: intl('flow_analysis.prop.enum', { value: 'SourceIp_like' }),
77
- template: 'input',
78
- },
79
- {
80
- dataIndex: 'SourceIp_notlike',
81
- label: intl('flow_analysis.prop.enum', { value: 'SourceIp_notlike' }),
82
- template: 'input',
83
- // groupName: intl('flow_analysis.prop.enum', { value: 'SourceIp' }),
84
- },
85
- ],
86
- },
87
- {
88
- dataIndex: 'DestinationIp_equal',
89
- label: intl('flow_analysis.prop.enum', { value: 'DestinationIp_equal' }),
90
- labelEx: (
91
- <div>
92
- <span>
93
- {intl('flow_analysis.prop.enum', { value: 'DestinationIp_equal' })}
94
- </span>
95
- <span>
96
- {intl('tr_flow_log.search.operator.enum', { value: 'equal' })}
97
- </span>
98
- </div>
99
- ),
100
- template: 'input',
101
- groupName: intl('flow_analysis.prop.enum', { value: 'DestinationIp' }),
102
- },
103
- {
104
- dataIndex: 'DestinationIp_like',
105
- label: intl('flow_analysis.prop.enum', { value: 'DestinationIp_like' }),
106
- labelEx: (
107
- <div>
108
- <span>
109
- {intl('flow_analysis.prop.enum', { value: 'DestinationIp_like' })}
110
- </span>
111
- <span>
112
- {intl('tr_flow_log.search.operator.enum', { value: 'like' })}
113
- </span>
114
- </div>
115
- ),
116
- template: 'input',
117
- groupName: intl('flow_analysis.prop.enum', { value: 'DestinationIp' }),
118
- },
119
- {
120
- dataIndex: 'DestinationIp_notlike',
121
- label: intl('flow_analysis.prop.enum', { value: 'DestinationIp_notlike' }),
122
- labelEx: (
123
- <div>
124
- <span>
125
- {intl('flow_analysis.prop.enum', { value: 'DestinationIp_notlike' })}
126
- </span>
127
- <span>
128
- {intl('tr_flow_log.search.operator.enum', { value: 'notlike' })}
129
- </span>
130
- </div>
131
- ),
132
- template: 'input',
133
- groupName: intl('flow_analysis.prop.enum', { value: 'DestinationIp' }),
134
- },
135
- {
136
- dataIndex: 'Dscp',
137
- label: intl('flow_analysis.prop.enum', { value: 'Dscp' }),
138
- template: 'input',
139
- groupName: intl('flow_analysis.prop.enum', { value: 'Dscp' }),
140
- },
141
- {
142
- dataIndex: 'Protocol',
143
- label: intl('flow_analysis.prop.enum', { value: 'Protocol' }),
144
- template: 'select',
145
- templateProps: {
146
- dataSource: [
147
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
148
- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
149
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 62, 64, 65, 66, 67, 69, 70, 71, 72, 73,
150
- 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
151
- 97, 98, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 115, 116, 117,
152
- 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
153
- 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 255,
154
- ].map((item) => ({
155
- label: intl('flow_analyzer.detail.protocol.enum', { value: item }),
156
- value: String(item),
157
- })),
60
+ dataSource: []
158
61
  },
159
- groupName: intl('flow_analysis.prop.enum', { value: 'Protocol' }),
160
- },
161
- {
162
- dataIndex: 'DestinationPort',
163
- label: intl('flow_analysis.prop.enum', { value: 'DestinationPort' }),
164
- template: 'input',
165
- groupName: intl('flow_analysis.prop.enum', { value: 'DestinationPort' }),
166
- },
167
- {
168
- dataIndex: 'SourcePort',
169
- label: intl('flow_analysis.prop.enum', { value: 'SourcePort' }),
170
- template: 'input',
171
- groupName: intl('flow_analysis.prop.enum', { value: 'SourcePort' }),
172
- },
173
- ];
62
+ }
63
+ ]
174
64
 
175
65
 
176
- const Demo1: React.FC<{}> = (props) => {
177
- const [filters, setFilters] = useState<any>([
178
- { label: '实例名称', value: 'xxxxxx', dataIndex: 'name' },
179
- { value: [{ tagKey: 'test', tagValue: '' }], dataIndex: 'tag' },
180
- { value: [{ tagKey: 'test', tagValue: '' }], dataIndex: 'tag2' },
66
+ const Demo1: React.FC<{}> = (props) => {
67
+ const [filters, setFilters] = useState<any>([
68
+ {label: '实例名称', value: 'xxxxxx', dataIndex: 'name'},
69
+ {value: [{tagKey: 'test', tagValue: ''}], dataIndex: 'tag'}
181
70
  ]);
182
- return (
71
+ return (
183
72
  <ConfigProvider>
184
- <div>
185
- <div>默认固定搜索条件</div>
186
- <Search
187
- defaultDataIndex="name"
188
- defaultSelectedDataIndex="name"
189
- options={[{
190
- label: '实例名称',
191
- dataIndex: 'name',
192
- template: 'input',
193
- templateProps: {
194
- placeholder: '按实例名称搜索',
195
- },
196
- }]}
197
- onSearch={(value, dataIndex) => {
198
- console.log(value, dataIndex);
199
- }}
200
- />
201
- <br /><br />
202
- <Search
203
- defaultDataIndex="name"
204
- options={options2}
205
- onSearch={(value, dataIndex) => {
206
- console.log(value, dataIndex);
207
- }}
208
- suggestions={[{ label: '实例名称', children: ['222222'] }, '33333333']}
209
- />
210
- <br /><br />
73
+ <div>
74
+ <div>默认固定搜索条件</div>
75
+ <Search
76
+ defaultDataIndex="name"
77
+ defaultSelectedDataIndex="name"
78
+ options={[{
79
+ label: '实例名称',
80
+ dataIndex: 'name',
81
+ template: 'input',
82
+ templateProps: {
83
+ placeholder: '按实例名称搜索',
84
+ },
85
+ }]}
86
+ onSearch={(value, dataIndex) => {
87
+ console.log(value, dataIndex)
88
+ }}
89
+ />
90
+ <br/><br/>
91
+ <Search
92
+ defaultDataIndex="name"
93
+ options={options2}
94
+ onSearch={(value, dataIndex) => {
95
+ console.log(value, dataIndex)
96
+ }}
97
+ suggestions={[{label: '实例名称', children: ['222222']}, '33333333']}
98
+ />
99
+ <br/><br/>
211
100
 
212
- <div>搜索条件成组</div>
213
- <Search
214
- defaultDataIndex="name"
215
- defaultSelectedDataIndex="name"
216
- options={options}
217
- onSearch={(value, dataIndex, extra) => {
218
- // @ts-ignore
219
- setFilters([...filters, extra]);
220
- }}
221
- suggestions={[{ label: '实例名称', children: ['222222'] }, '33333333']}
222
- />
223
- <Search
224
- defaultDataIndex="name"
225
- // defaultSelectedDataIndex="name"
226
- options={options3}
227
- prefixSelectMode="cascader"
228
- onSearch={(value, dataIndex, extra) => {
229
- console.log(value, dataIndex, extra);
230
- // @ts-ignore
231
- setFilters([...filters, extra]);
101
+ <div>搜索条件成组</div>
102
+ <Search
103
+ defaultDataIndex="name"
104
+ defaultSelectedDataIndex="name"
105
+ options={options}
106
+ onSearch={(value, dataIndex, extra) => {
107
+ //@ts-ignore
108
+ setFilters([...filters, extra])
109
+ }}
110
+ suggestions={[{label: '实例名称', children: ['222222']}, '33333333']}
111
+ />
112
+
113
+ <div style={{marginTop: 8}}>
114
+ <SearchFilter
115
+ dataSource={filters}
116
+ onChange={(deletedFilter, remainFilters)=> {
117
+ setFilters(remainFilters)
232
118
  }}
233
- suggestions={[{ label: '实例名称', children: ['222222'] }, '33333333']}
234
119
  />
235
-
236
- <div style={{ marginTop: 8 }}>
237
- <SearchFilter
238
- dataSource={filters}
239
- onChange={(deletedFilter, remainFilters) => {
240
- setFilters(remainFilters);
241
- }}
242
- />
243
- </div>
244
120
  </div>
121
+ </div>
245
122
  </ConfigProvider>
246
- );
247
- };
248
-
249
- export default Demo1;
123
+ );
124
+ };
125
+
126
+ export default Demo1;
127
+