vsyswin-ui 0.2.70 → 0.2.73
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/lib/vsyswin-ui.common.js +72 -56
- package/lib/vsyswin-ui.common.js.map +1 -1
- package/lib/vsyswin-ui.umd.js +72 -56
- package/lib/vsyswin-ui.umd.js.map +1 -1
- package/lib/vsyswin-ui.umd.min.js +8 -8
- package/lib/vsyswin-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/packages/search-bar/src/search-bar.scss +4 -0
- package/packages/search-bar/src/search-bar.vue +18 -5
package/package.json
CHANGED
|
@@ -226,6 +226,9 @@
|
|
|
226
226
|
<el-option v-for="opt in item.options" :key="opt.id" :label="opt.label" :value="opt.value"></el-option>
|
|
227
227
|
</el-select>
|
|
228
228
|
</template>
|
|
229
|
+
<template v-else-if="item.type === 'slot'">
|
|
230
|
+
<slot :name="item.slot" :item="item">内容为空</slot>
|
|
231
|
+
</template>
|
|
229
232
|
</li>
|
|
230
233
|
</ul>
|
|
231
234
|
</div>
|
|
@@ -391,7 +394,10 @@ export default {
|
|
|
391
394
|
function clickHandler(e) {
|
|
392
395
|
// 这里判断点击的元素是否是本身,是本身,则返回
|
|
393
396
|
if (el.contains(e.target)) {
|
|
394
|
-
|
|
397
|
+
const btnsBox = el.querySelector('.syswin-searchbar-container__listBtns') // 点击右侧的按钮时也要隐藏所有条件面板
|
|
398
|
+
if (!btnsBox.contains(e.target)) {
|
|
399
|
+
return false
|
|
400
|
+
}
|
|
395
401
|
}
|
|
396
402
|
// 判断指令中是否绑定了函数
|
|
397
403
|
if (binding.expression) {
|
|
@@ -415,7 +421,7 @@ export default {
|
|
|
415
421
|
saveToLocal: {
|
|
416
422
|
// 搜索条件保存到本地
|
|
417
423
|
type: Boolean,
|
|
418
|
-
default:
|
|
424
|
+
default: false
|
|
419
425
|
},
|
|
420
426
|
searchList: {
|
|
421
427
|
type: Array,
|
|
@@ -454,6 +460,10 @@ export default {
|
|
|
454
460
|
// 自定义条件标签的显示
|
|
455
461
|
type: Boolean,
|
|
456
462
|
default: false
|
|
463
|
+
},
|
|
464
|
+
maxConditionLength: {
|
|
465
|
+
type: Number,
|
|
466
|
+
default: 4
|
|
457
467
|
}
|
|
458
468
|
},
|
|
459
469
|
data() {
|
|
@@ -461,7 +471,6 @@ export default {
|
|
|
461
471
|
keyword: '',
|
|
462
472
|
currentSearchList: [],
|
|
463
473
|
shrinkFilterList: false,
|
|
464
|
-
maxConditionLength: 4,
|
|
465
474
|
conditionList: [],
|
|
466
475
|
conditionValue: '',
|
|
467
476
|
currentData: {},
|
|
@@ -837,7 +846,7 @@ export default {
|
|
|
837
846
|
// 先清空所有标签
|
|
838
847
|
currentSearchList.forEach((ele) => {
|
|
839
848
|
ele.itemList.forEach((item) => {
|
|
840
|
-
item.isActive =
|
|
849
|
+
item.isActive = ['daterange', 'monthrange'].includes(item.type) && (item.value = null)
|
|
841
850
|
})
|
|
842
851
|
})
|
|
843
852
|
|
|
@@ -854,7 +863,8 @@ export default {
|
|
|
854
863
|
v.id === ele.id && ['daterange', 'monthrange'].includes(v.type) && (v.value = ele.value)
|
|
855
864
|
} else {
|
|
856
865
|
// 单选
|
|
857
|
-
v.isActive = v.id === ele.id
|
|
866
|
+
v.isActive = v.id === ele.id
|
|
867
|
+
v.id === ele.id && [('daterange', 'monthrange')].includes(v.type) && (v.value = v.id === ele.id ? ele.value : null)
|
|
858
868
|
}
|
|
859
869
|
} else if (v.type === 'slot') {
|
|
860
870
|
v.setValue && v.setValue({ value: ele.value, name: ele.name, ...ele })
|
|
@@ -864,10 +874,13 @@ export default {
|
|
|
864
874
|
} else {
|
|
865
875
|
v.value = ele.value
|
|
866
876
|
}
|
|
877
|
+
if (ele.value) v.isActive = true
|
|
867
878
|
} else if (v.type === 'month' || v.type === 'year') {
|
|
868
879
|
v.value = ele.value
|
|
880
|
+
if (ele.value) v.isActive = true
|
|
869
881
|
} else if (v.type === 'daterange' || v.type === 'monthrange' || v.type === 'datetimerange') {
|
|
870
882
|
v.value = ele.value
|
|
883
|
+
if (ele.value.length && ele.value[0]) v.isActive = true
|
|
871
884
|
}
|
|
872
885
|
})
|
|
873
886
|
}
|