ct-component-plus 2.2.9 → 2.2.11

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/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v2.2.11版本更新内容:
2
+
3
+ 1. 优化分页下拉组件搜索相关逻辑
4
+
1
5
  # v2.2.9版本更新内容:
2
6
 
3
7
  1. 优化select组件没有默认值报错的情况
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ct-component-plus",
3
3
  "private": false,
4
- "version": "2.2.9",
4
+ "version": "2.2.11",
5
5
  "type": "module",
6
6
  "main": "packages/components/index.js",
7
7
  "files": [
@@ -47,4 +47,8 @@ export const selectProps = {
47
47
  },
48
48
  noMatchText: String,
49
49
  noDataText: String,
50
+ keywordParam: {
51
+ type: String,
52
+ default: "keyword",
53
+ },
50
54
  };
@@ -8,6 +8,7 @@
8
8
  v-bind="rawAttr"
9
9
  :multiple="multiple"
10
10
  :filterable="filterable"
11
+ :filter-method="filterMethod"
11
12
  :clear-icon="clearIcon"
12
13
  :suffix-icon="suffixIcon"
13
14
  :fit-input-width="fitInputWidth"
@@ -200,7 +201,7 @@ watch(
200
201
  (newVal) => {
201
202
  if (!selectRef.value) return;
202
203
  selectRef.value.selectedLabel = newVal;
203
- }
204
+ },
204
205
  );
205
206
  watch(optionsByApi, () => {
206
207
  const arr = optionsByApi.value || [];
@@ -245,7 +246,7 @@ const watchServiceHandle = async (reset = false) => {
245
246
  pageNo.value = 1;
246
247
  optionsByApi.value = [];
247
248
  }
248
- params.keyword = keyword.value;
249
+ params[props.keywordParam] = keyword.value;
249
250
  params.page_no = pageNo.value;
250
251
  params.page_size = pageSize.value;
251
252
  if (isFunction(cbs.beforeSearch)) {
@@ -298,7 +299,7 @@ const watchServiceHandle = async (reset = false) => {
298
299
  try {
299
300
  const defineSearchHandle = await cbs.defineSearch(
300
301
  optionsByApi,
301
- valueModel
302
+ valueModel,
302
303
  );
303
304
  if (defineSearchHandle === false) return;
304
305
  if (defineSearchHandle) {
@@ -319,7 +320,7 @@ watch(
319
320
  },
320
321
  {
321
322
  immediate: true,
322
- }
323
+ },
323
324
  );
324
325
  // watch(
325
326
  // () => keyword.value,
@@ -384,6 +385,14 @@ useBuriedParams(props, emit, {
384
385
  },
385
386
  });
386
387
 
388
+ function filterMethod(val) {
389
+ if (props.multiple) {
390
+ return; //多选走原有搜索逻辑
391
+ }
392
+ keyword.value = val;
393
+ changeKeyword();
394
+ }
395
+
387
396
  onMounted(() => {
388
397
  if (!baseDao) {
389
398
  console.error("请先配置baseDao");