stellar-ui-plus 1.20.4 → 1.20.6

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.
@@ -172,7 +172,7 @@ export function stringToCode128(text: string) {
172
172
 
173
173
  codes = codes.concat(codesForChar(b1, b2, barc.currcs))
174
174
  // code C takes 2 chars each time
175
- if (barc.currcs === CODESET.C)
175
+ if (barc.currcs === CODESET.C)
176
176
  i++
177
177
  }
178
178
 
@@ -203,7 +203,7 @@ export function stringToCode128(text: string) {
203
203
  function perhapsCodeC(bytes: number[], codeset: number) {
204
204
  for (let i = 0; i < bytes.length; i++) {
205
205
  const b = bytes[i]
206
- if ((b < 48 || b > 57) && b !== CHAR_TILDE)
206
+ if ((b < 48 || b > 57) && b !== CHAR_TILDE)
207
207
  return codeset
208
208
  }
209
209
  return CODESET.C
@@ -221,13 +221,13 @@ export function stringToCode128(text: string) {
221
221
  if (chr2 === -1) {
222
222
  shifter === SET_CODEB
223
223
  currcs = CODESET.B
224
- }
224
+ }
225
225
  else if (chr2 !== -1 && !charCompatible(chr2, currcs)) {
226
226
  // need to check ahead as well
227
227
  if (charCompatible(chr2, CODESET.A)) {
228
228
  shifter = SET_CODEA
229
229
  currcs = CODESET.A
230
- }
230
+ }
231
231
  else {
232
232
  shifter = SET_CODEB
233
233
  currcs = CODESET.B
@@ -235,7 +235,7 @@ export function stringToCode128(text: string) {
235
235
  }
236
236
  }
237
237
  /* eslint-enable no-unused-expressions */
238
- }
238
+ }
239
239
  else {
240
240
  // if there is a next char AND that next char is also not compatible
241
241
 
@@ -251,11 +251,11 @@ export function stringToCode128(text: string) {
251
251
  currcs = CODESET.A
252
252
  break
253
253
  }
254
- }
254
+ }
255
255
  else {
256
256
  // no need to shift code sets, a temporary SHIFT will suffice
257
257
  shifter = SET_SHIFT
258
- }
258
+ }
259
259
  }
260
260
 
261
261
  // ok some type of shift is nessecary
@@ -263,12 +263,12 @@ export function stringToCode128(text: string) {
263
263
  result.push(shifter)
264
264
  // result.push(codeValue(chr2));-----------------------------------
265
265
  result.push(codeValue(chr1))
266
- }
266
+ }
267
267
  else {
268
268
  if (currcs === CODESET.C) {
269
269
  // include next as well
270
270
  result.push(codeValue(chr1, chr2))
271
- }
271
+ }
272
272
  else {
273
273
  result.push(codeValue(chr1))
274
274
  }
@@ -284,19 +284,19 @@ function codeValue(chr1: number, chr2: any = undefined) {
284
284
  if (typeof chr2 === 'undefined')
285
285
  return chr1 >= 32 ? chr1 - 32 : chr1 + 64
286
286
  else
287
- return Number.parseInt(String.fromCharCode(chr1) + String.fromCharCode(chr2))
287
+ return Number.parseInt(String.fromCharCode(chr1) + String.fromCharCode(chr2))
288
288
  }
289
289
 
290
290
  function charCompatible(chr: number, codeset: number) {
291
291
  const csa = codeSetAllowedFor(chr)
292
- if (csa === CODESET.ANY)
292
+ if (csa === CODESET.ANY)
293
293
  return true
294
294
  // if we need to change from current
295
- if (csa === CODESET.AB)
295
+ if (csa === CODESET.AB)
296
296
  return true
297
- if (csa === CODESET.A && codeset === CODESET.A)
297
+ if (csa === CODESET.A && codeset === CODESET.A)
298
298
  return true
299
- if (csa === CODESET.B && codeset === CODESET.B)
299
+ if (csa === CODESET.B && codeset === CODESET.B)
300
300
  return true
301
301
  return false
302
302
  }
@@ -305,11 +305,11 @@ function codeSetAllowedFor(chr: number) {
305
305
  if (chr >= 48 && chr <= 57) {
306
306
  // 0-9
307
307
  return CODESET.ANY
308
- }
308
+ }
309
309
  else if (chr >= 32 && chr <= 95) {
310
310
  // 0-9 A-Z
311
311
  return CODESET.AB
312
- }
312
+ }
313
313
  else {
314
314
  // if non printable
315
315
  return chr < 32 ? CODESET.A : CODESET.B
@@ -0,0 +1,33 @@
1
+ #### Props
2
+ | 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
3
+ | ----- | ----- | --- | ------- | ------ | -------- |
4
+ | `width` | 图表宽度,单位rpx | `number / string` | `750` | - | - |
5
+ | `height` | 图表高度,单位rpx | `number / string` | `200` | - | - |
6
+ | `canvas2d` | canvas2d模式,用于解决小程序层级过高及拖拽卡顿问题 | `boolean` | `true` | - | - |
7
+ | `pixelRatio` | 设备像素比,解决开启canvas2d后画布模糊的问题 | `number` | `微信小程序由具体设备决定,其余的默认为1` | - | - |
8
+ | `animation` | 是否动画展示图表 | `boolean` | `true` | - | - |
9
+ | `timing` | 图表动画效果 | `string` | `easeOut` | `easeOut`:由快到慢<br/>`easeIn`:由慢到快<br/>`easeInOut`:慢快慢<br/>`linear`:匀速 | - |
10
+ | `duration` | 动画展示时长(单位:毫秒) | `string` | `1000` | - | - |
11
+ | `rotate` | 横屏模式 | `boolean` | `false` | - | - |
12
+ | `rotateLock` | 横屏锁定模式 | `boolean` | `false` | - | - |
13
+ | `background` | 背景颜色,开启滚动条后请赋值 | `string` | `rgba(0,0,0,0)` | - | - |
14
+ | `color` | 主题颜色数组,16进制颜色格式 | `array` | `["#165DFF","#14C9C9","#F7BA1E","#3491FA","#722ED1","#9FDB1D"]` | - | - |
15
+ | `padding` | 画布填充边距(顺序为上右下左),单位px | `array` | `[5,5,5,5]` | - | - |
16
+ | `fontSize` | 全局默认字体大小,单位px | `number` | `13` | - | - |
17
+ | `fontColor` | 全局默认字体颜色 | `string` | `#666666` | - | - |
18
+ | `dataLabel` | 是否显示图表区域内数据点上方的数据文案 | `boolean` | `false` | - | - |
19
+ | `dataPointShape` | 是否显示数据点的图形标识 | `boolean` | `true` | - | - |
20
+ | `dataPointShapeType` | 图形标识点显示类型 | `string` | `solid` | `solid`:实心<br/>`hollow`:空心 | - |
21
+ | `touchMoveLimit` | 图表拖拽时每秒重新渲染的帧数 | `number` | `24` | - | - |
22
+ | `enableScroll` | 开启滚动条功能 | `boolean` | `false` | - | - |
23
+ | `enableMarkLine` | 是否启用标记线功能 | `boolean` | `false` | - | - |
24
+ | `scrollPosition` | 连续更新数据时滚动条的位置 | `string` | `current` | `current`:当前位置<br/>`left`:左对齐<br/>`right`:右对齐 | - |
25
+ | `series` | 图表数据 | `object` | `{}` | - | - |
26
+ | `xAxis` | X轴配置 | `-` | <a href="https://www.ucharts.cn/v2/#/document/index" target="_blank">文档地址</a> | - | - |
27
+ | `yAxis` | Y轴配置 | `-` | <a href="https://www.ucharts.cn/v2/#/document/index" target="_blank">文档地址</a> | - | - |
28
+ | `legend` | 图例配置 | `-` | <a href="https://www.ucharts.cn/v2/#/document/index" target="_blank">文档地址</a> | - | - |
29
+ | `title` | 标题配置(仅适用于 ring、arcbar、gauge) | `-` | <a href="https://www.ucharts.cn/v2/#/document/index" target="_blank">文档地址</a> | - | - |
30
+ | `subtitle` | 副标题配置 | `-` | <a href="https://www.ucharts.cn/v2/#/document/index" target="_blank">文档地址</a> | - | - |
31
+ | `extra` | 额外配置项 | `-` | <a href="https://www.ucharts.cn/v2/#/document/index" target="_blank">文档地址</a> | - | - |
32
+
33
+
@@ -12,6 +12,7 @@
12
12
  | `zIndex` | 弹窗层级z-index | `number` | - | - | - |
13
13
  | `type` | 下拉选项的形状 | `string` | `block` | `round`:圆形<br/>`block`:块状 | - |
14
14
  | `max` | 可选数量 | `number` | `1` | - | - |
15
+ | `showPopup` | 是否显示菜单弹窗 | `boolean` | `false` | - | `1.21.0` |
15
16
 
16
17
 
17
18
  #### Events
@@ -338,6 +338,7 @@
338
338
  | 插槽名 | 说明 | 插槽参数 | 支持版本 |
339
339
  | --------- | -------- | -------- | -------- |
340
340
  | `default` | 内容插槽 | - | - |
341
+ | `title` | 标题插槽 | - | `1.21.0` |
341
342
 
342
343
  ---$
343
344
  {{fuyuwei}}
@@ -16,6 +16,7 @@ const dropDownMenuProps = {
16
16
  type: { type: String, default: 'block' },
17
17
  max: { type: Number, default: 1 },
18
18
  dropDownIconColor: { type: String, default: '#bbbbbb' },
19
+ showPopup: { type: Boolean, default: false },
19
20
  };
20
21
 
21
22
  export type DropDownMenuProps = ExtractPropTypes<typeof dropDownMenuProps>;
@@ -28,4 +29,5 @@ export const dropDownMenuEmits = {
28
29
  change: (value: Array<any>) => Array.isArray(value),
29
30
  'item-choose': (item: any) => item,
30
31
  'update:modelValue': (value: Array<any>) => Array.isArray(value),
32
+ 'update:showPopup': (value: boolean) => typeof value === 'boolean',
31
33
  };
@@ -86,6 +86,13 @@
86
86
  "type": "number",
87
87
  "default": "1"
88
88
  },
89
+ {
90
+ "name": "showPopup",
91
+ "description": "是否显示菜单弹窗",
92
+ "type": "boolean",
93
+ "default": "false",
94
+ "version": "1.21.0"
95
+ },
89
96
  {
90
97
  "name": "[event]change",
91
98
  "description": "选项改变时触发",
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { watch, computed, ref, type CSSProperties, getCurrentInstance, type ComponentPublicInstance } from 'vue';
2
+ import { watch, computed, ref, type CSSProperties, getCurrentInstance, onUnmounted, type ComponentPublicInstance } from 'vue';
3
3
  import { useProvide } from '../../utils/mixin';
4
4
  import { DEFAULT_DURATION, MAX_DURATION, MIN_DURATION, DEFAULT_ROOT_QUERY } from './constans';
5
5
  import propsData, { DEOP_DOWN_MENU_KEY, dropDownMenuEmits } from './props';
@@ -103,6 +103,17 @@ watch(
103
103
  { immediate: true }
104
104
  );
105
105
 
106
+ watch(
107
+ () => props.showPopup,
108
+ (val: boolean) => {
109
+ if (val) {
110
+ open();
111
+ } else {
112
+ close();
113
+ }
114
+ }
115
+ );
116
+
106
117
  let menuItems = ref<DropdownItem[]>([]);
107
118
  function updateItems() {
108
119
  let childrens = internalChildren;
@@ -122,10 +133,12 @@ function loadMenuTitle() {
122
133
  menuTitle.value = props.title;
123
134
  }
124
135
  }
136
+
125
137
  function touchmove(e: TouchEvent) {
126
138
  // TODO nvue 取消冒泡
127
139
  e.stopPropagation();
128
140
  }
141
+
129
142
  async function getContentHeight() {
130
143
  let windowHeight = System.getWindowInfo().windowHeight;
131
144
 
@@ -133,6 +146,7 @@ async function getContentHeight() {
133
146
  menuRootQuery.value = { height: res.height || 0, top: res.top || 0, bottom: res.bottom || 0, left: res.left || 0 };
134
147
  contentHeight.value = props.direction == 'down' ? windowHeight - menuRootQuery.value.bottom : menuRootQuery.value.top;
135
148
  }
149
+
136
150
  async function handleMenuClick() {
137
151
  if (!showMenu.value) {
138
152
  await getContentHeight();
@@ -141,23 +155,56 @@ async function handleMenuClick() {
141
155
  close();
142
156
  }
143
157
  }
158
+
159
+ // 防抖定时器
160
+ let openTimer: any = null;
161
+ let closeTimer: any = null;
162
+
144
163
  function open() {
145
- showMenu.value = true;
146
- hiddenContent.value = false;
147
- emits('open');
164
+ // 清除之前的定时器
165
+ if (openTimer) clearTimeout(openTimer);
166
+ if (closeTimer) clearTimeout(closeTimer);
167
+
168
+ openTimer = setTimeout(
169
+ () => {
170
+ showMenu.value = true;
171
+ hiddenContent.value = false;
172
+ emits('open');
173
+ emits('update:showPopup', showMenu.value);
174
+ },
175
+ Number(cmpDuration.value) * 1000 + 10
176
+ ); // 防抖延迟,可根据需要调整
148
177
  }
178
+
149
179
  function close() {
150
- showMenu.value = false;
151
- setTimeout(
180
+ // 清除之前的定时器
181
+ if (closeTimer) clearTimeout(closeTimer);
182
+ if (openTimer) clearTimeout(openTimer);
183
+
184
+ closeTimer = setTimeout(
152
185
  () => {
153
- hiddenContent.value = true;
154
- contentHeight.value = 0;
155
- menuRootQuery.value = DEFAULT_ROOT_QUERY;
156
- emits('close');
186
+ showMenu.value = false;
187
+ setTimeout(
188
+ () => {
189
+ hiddenContent.value = true;
190
+ contentHeight.value = 0;
191
+ menuRootQuery.value = DEFAULT_ROOT_QUERY;
192
+ emits('close');
193
+ emits('update:showPopup', showMenu.value);
194
+ },
195
+ Number(cmpDuration.value) * 1000
196
+ );
157
197
  },
158
- Number(cmpDuration.value) * 1000
159
- );
198
+ Number(cmpDuration.value) * 1000 + 10
199
+ ); // 防抖延迟
160
200
  }
201
+
202
+ // 组件卸载时清理定时器
203
+ onUnmounted(() => {
204
+ if (openTimer) clearTimeout(openTimer);
205
+ if (closeTimer) clearTimeout(closeTimer);
206
+ });
207
+
161
208
  function choose(item: DropdownItem) {
162
209
  let temp = chooseItems;
163
210
  let index = temp.findIndex(e => e == item.value);
@@ -204,11 +251,15 @@ defineExpose({ close });
204
251
  <template>
205
252
  <view class="ste-dropdown-menu-root" :class="[cmpRootClass]" :style="[cmpRootStyle]" @touchmove.stop.prevent="touchmove" @wheel.stop.prevent>
206
253
  <view class="dropdown-placeholder" :style="[cmpMenuPlaceholderStyle]" @click="close" @touchmove.stop.prevent="touchmove" @wheel.stop.prevent />
207
- <view class="menu-box" @click="handleMenuClick" @touchmove.stop.prevent="touchmove" @wheel.stop.prevent>
208
- <text class="title">{{ menuTitle || title }}</text>
209
- <view class="menu-title-icon">
210
- <ste-icon code="&#xe699;" size="16" :color="dropDownIconColor"></ste-icon>
211
- </view>
254
+ <view @click="handleMenuClick" @touchmove.stop.prevent="touchmove" @wheel.stop.prevent>
255
+ <slot name="title">
256
+ <view class="menu-box">
257
+ <text class="title">{{ menuTitle || title }}</text>
258
+ <view class="menu-title-icon">
259
+ <ste-icon code="&#xe699;" size="16" :color="dropDownIconColor"></ste-icon>
260
+ </view>
261
+ </view>
262
+ </slot>
212
263
  </view>
213
264
  <view :class="hiddenContent ? 'dropdown-content hidden' : 'dropdown-content'" :style="[cmpMenuContentStyle]" @click="handleMaskClick" @touchmove.stop.prevent="touchmove" @wheel.stop.prevent>
214
265
  <view class="menu-item-content" @click.stop="handleMenuConentClick">
@@ -10,79 +10,187 @@
10
10
  <script lang="ts" setup>
11
11
  import { reactive } from 'vue';
12
12
  // 筛选选项
13
- const filterOptions = reactive([
14
- { title: '全部', value: 'all' },
15
- { title: '已打印', value: 'printed' },
16
- { title: '未打印', value: 'unprinted' },
17
- { title: '促销调价', value: 'promotion' },
18
- { title: '促销回调', value: 'callback' },
19
- ]);
20
13
  const subFilters = reactive([
21
14
  {
22
- title: '调价类型',
15
+ title: '商品分类',
16
+ key: 'category',
17
+ children: [
18
+ { title: '电子产品123123213123213', value: 'electronics' },
19
+ { title: '服装鞋', value: 'clothing' },
20
+ { title: '家居用', value: 'home' },
21
+ { title: '运动户', value: 'sports' },
22
+ { title: '美妆护肤', value: 'beauty' },
23
+ { title: '食品饮料', value: 'food' },
24
+ { title: '母婴用品', value: 'baby' },
25
+ { title: '图书音像', value: 'books' },
26
+ ],
27
+ // rowCount: 4,
28
+ },
29
+ {
30
+ title: '商品状态',
31
+ key: 'status',
32
+ children: [
33
+ { title: '正常销售', value: 'active' },
34
+ { title: '暂时下架', value: 'inactive' },
35
+ { title: '库存不足', value: 'low_stock' },
36
+ { title: '预售中', value: 'presale' },
37
+ { title: '已售罄', value: 'sold_out' },
38
+ { title: '待审核', value: 'pending' },
39
+ ],
40
+ expandCount: 1,
41
+ },
42
+ {
43
+ title: '价格调整类型',
44
+ key: 'price_type',
23
45
  children: [
24
46
  { title: '促销调价', value: 'promotion' },
25
- { title: '促销回调', value: 'callback' },
26
- { title: '促销回', value: 'callba' },
27
- { title: '促销回调3', value: 'callback3' },
47
+ { title: '成本调价', value: 'cost_adjustment' },
48
+ { title: '市场调价', value: 'market_adjustment' },
49
+ { title: '季节调价', value: 'seasonal' },
50
+ { title: '清仓调价', value: 'clearance' },
51
+ { title: '促销回调', value: 'promotion_rollback' },
52
+ { title: '批量调价', value: 'batch_adjustment' },
53
+ ],
54
+ },
55
+ {
56
+ title: '供应商区域',
57
+ key: 'supplier_region',
58
+ children: [
59
+ { title: '华东地区', value: 'east_china' },
60
+ { title: '华北地区', value: 'north_china' },
61
+ { title: '华南地区', value: 'south_china' },
62
+ { title: '西南地区', value: 'southwest_china' },
63
+ { title: '华中地区', value: 'central_china' },
64
+ { title: '西北地区', value: 'northwest_china' },
65
+ { title: '东北地区', value: 'northeast_china' },
66
+ { title: '港澳台', value: 'hk_mo_tw' },
67
+ { title: '海外供应商', value: 'overseas' },
28
68
  ],
29
69
  },
30
70
  {
31
- title: '打印状态',
71
+ title: '订单处理状态',
72
+ key: 'order_status',
32
73
  children: [
33
- { title: '已打印', value: 'printed' },
34
- { title: '未打印', value: 'unprinted' },
74
+ { title: '待确认', value: 'pending_confirm' },
75
+ { title: '待发货', value: 'pending_shipment' },
76
+ { title: '已发货', value: 'shipped' },
77
+ { title: '已完成', value: 'completed' },
78
+ { title: '已取消', value: 'cancelled' },
79
+ { title: '退货处理中', value: 'returning' },
80
+ { title: '已退货', value: 'returned' },
81
+ { title: '异常订单', value: 'exception' },
82
+ { title: '部分发货', value: 'partial_shipped' },
83
+ ],
84
+ },
85
+ {
86
+ title: '物流方式',
87
+ key: 'shipping_method',
88
+ children: [
89
+ { title: '顺丰速运', value: 'sf_express' },
90
+ { title: '申通快递', value: 'sto_express' },
91
+ { title: '圆通速递', value: 'yt_express' },
92
+ { title: '中通快递', value: 'zto_express' },
93
+ { title: '韵达速递', value: 'yunda_express' },
94
+ { title: '京东物流', value: 'jd_logistics' },
95
+ { title: '德邦快递', value: 'deppon' },
96
+ { title: '邮政EMS', value: 'ems' },
97
+ { title: '天天快递', value: 'tiantian' },
98
+ ],
99
+ },
100
+ {
101
+ title: '支付方式',
102
+ key: 'payment_method',
103
+ children: [
104
+ { title: '微信支付', value: 'wechat_pay' },
105
+ { title: '支付宝', value: 'alipay' },
106
+ { title: '银行卡支付', value: 'bank_card' },
107
+ { title: '货到付款', value: 'cod' },
108
+ { title: '余额支付', value: 'balance' },
109
+ { title: '花呗分期', value: 'huabei' },
110
+ { title: '信用卡分期', value: 'credit_card' },
111
+ { title: '企业转账', value: 'enterprise' },
35
112
  ],
36
113
  },
37
114
  ]);
38
115
  </script>
39
116
  <template>
40
117
  <view style="width: 100%">
41
- <ste-filter-tool :filterData="filterOptions" :menu-data="subFilters" @item-click="handleFilterClick" value="all" />
118
+ <ste-filter-tool :data="subFilters" @item-click="handleFilterClick" value="all">
119
+ <view style="font-size: 24rpx">
120
+ <text>基础筛选</text>
121
+ <ste-icon code="&#xe6c7;" color="#000" size="24" />
122
+ </view>
123
+ </ste-filter-tool>
42
124
  </view>
43
125
  </template>
44
126
  ```
45
127
 
46
128
  #### 多选
47
129
 
48
- - 配置主筛选项使用`multiple` 属性
49
130
  - 配置下拉筛选是否多选需要在对象中指定`multiple` 属性
50
131
 
51
132
  ```html
52
133
  <script lang="ts" setup>
53
134
  import { reactive } from 'vue';
54
135
  // 筛选选项
55
- const filterOptions = reactive([
56
- { title: '全部', value: 'all' },
57
- { title: '已打印', value: 'printed' },
58
- { title: '未打印', value: 'unprinted' },
59
- { title: '促销调价', value: 'promotion' },
60
- { title: '促销回调', value: 'callback' },
61
- ]);
62
- const subFilters = reactive([
136
+ const checkboxFilters = reactive([
137
+ {
138
+ title: '默认排序',
139
+ key: 'category',
140
+ children: [
141
+ { title: '电子产品', value: 'electronics' },
142
+ { title: '服装鞋帽', value: 'clothing' },
143
+ { title: '家居用品', value: 'home' },
144
+ { title: '运动户外', value: 'sports' },
145
+ { title: '美妆护肤', value: 'beauty' },
146
+ { title: '余额支付', value: 'balance' },
147
+ { title: '花呗分期', value: 'huabei' },
148
+ { title: '信用卡分期', value: 'credit_card' },
149
+ { title: '企业转账', value: 'enterprise' },
150
+ ],
151
+ },
152
+ {
153
+ title: '建议量',
154
+ key: 'status',
155
+ children: [
156
+ { title: '正常销售', value: 'active' },
157
+ { title: '暂时下架', value: 'inactive' },
158
+ { title: '库存不足', value: 'low_stock' },
159
+ { title: '预售中', value: 'presale' },
160
+ ],
161
+ },
63
162
  {
64
- title: '调价类型',
163
+ title: '门店库存',
164
+ key: 'price_type',
65
165
  children: [
66
166
  { title: '促销调价', value: 'promotion' },
67
- { title: '促销回调', value: 'callback' },
68
- { title: '促销回', value: 'callba' },
69
- { title: '促销回调3', value: 'callback3' },
167
+ { title: '成本调价', value: 'cost_adjustment' },
168
+ { title: '市场调价', value: 'market_adjustment' },
169
+ { title: '季节调价', value: 'seasonal' },
70
170
  ],
71
- multiple: true,
72
171
  },
73
172
  {
74
- title: '打印状态',
173
+ title: '日均销量',
174
+ key: 'supplier_region',
75
175
  children: [
76
- { title: '已打印', value: 'printed' },
77
- { title: '未打印', value: 'unprinted' },
176
+ { title: '华东地区', value: 'east_china' },
177
+ { title: '华北地区', value: 'north_china' },
178
+ { title: '华南地区', value: 'south_china' },
179
+ { title: '西南地区', value: 'southwest_china' },
180
+ { title: '华中地区', value: 'central_china' },
181
+ { title: '西北地区', value: 'northwest_china' },
78
182
  ],
79
- multiple: true,
80
183
  },
81
184
  ]);
82
185
  </script>
83
186
  <template>
84
187
  <view style="width: 100%">
85
- <ste-filter-tool :filterData="filterOptions2" :menu-data="subFilters2" @item-click="handleFilterClick" value="all" multiple />
188
+ <ste-filter-tool :data="checkboxFilters" filter-type="checkbox">
189
+ <view style="font-size: 24rpx">
190
+ <text>点击筛选</text>
191
+ <ste-icon code="&#xe6c7;" color="#000" size="24" />
192
+ </view>
193
+ </ste-filter-tool>
86
194
  </view>
87
195
  </template>
88
196
  ```
@@ -1,31 +1,22 @@
1
1
  import type { PropType } from 'vue';
2
-
3
- export interface FilterItem {
4
- title: string;
5
- children?: FilterItem[];
6
- multiple?: boolean;
7
- [key: string]: any;
8
- }
2
+ import type { FilterItem, FilterType } from './type';
9
3
 
10
4
  const props = {
11
5
  value: { type: [String, Number, Array] as unknown as PropType<string | number | (string | number)[]>, default: '' },
12
- multiple: { type: Boolean, default: false },
13
6
  activeColor: { type: String, default: '#0275FF' },
14
7
  inactiveColor: { type: String, default: '#555A61' },
15
- filterText: { type: String, default: '筛选' },
16
- menuData: {
17
- type: Array as PropType<FilterItem[]>,
18
- default: () => [],
19
- },
20
- filterData: {
8
+ filterType: { type: String as PropType<FilterType>, default: 'button' },
9
+ data: {
21
10
  type: Array as PropType<FilterItem[]>,
22
11
  default: () => [],
23
12
  },
24
13
  };
25
14
 
26
15
  export const filterToolEmits = {
27
- itemClick: (items: FilterItem[]) => typeof items === 'object',
28
- menuChange: (_items: FilterItem[]) => true,
16
+ // itemClick: (items: FilterItem[]) => typeof items === 'object',
17
+ // menuChange: (_items: FilterItem[]) => true,
18
+ confirm: (items: FilterItem[]) => typeof items === 'object',
19
+ reset: () => true,
29
20
  };
30
21
 
31
22
  export default props;