feat(search): 实现范围选择器功能并优化搜索逻辑
- 在 Search.vue 中添加对范围选择器(rangePicker)的支持 - 优化搜索数据处理逻辑,处理范围选择器的值 - 在 Log 组件中将日期选择器改为范围选择器 - 移除不必要的 console.log 语句 - 固定 package.json 中的 vite-plugin-monaco-editor 依赖版本防止依赖报错
This commit is contained in:
parent
7fd3dc06f3
commit
8f82cfb262
File diff suppressed because it is too large
Load Diff
|
@ -64,7 +64,7 @@
|
|||
"unplugin-auto-import": "^0.12.1",
|
||||
"unplugin-vue-components": "^0.22.12",
|
||||
"v-clipboard3": "^0.1.4",
|
||||
"vite-plugin-monaco-editor": "^1.1.0",
|
||||
"vite-plugin-monaco-editor": "1.1.0",
|
||||
"vue": "3.3.4",
|
||||
"vue-cropper": "^1.0.9",
|
||||
"vue-i18n": "^9.13.1",
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -61,7 +61,21 @@ const processedColumns = computed(() => {
|
|||
* 提交
|
||||
*/
|
||||
const searchSubmit = (data: any) => {
|
||||
console.log("搜索--------",data)
|
||||
if(data){
|
||||
processedColumns.value.forEach((column: any) => {
|
||||
if (column.search?.type === 'rangePicker') {
|
||||
data = data.flatMap(item => {
|
||||
if (item.column === column.key) {
|
||||
return [
|
||||
{ ...item, termType: "gte", value: item.value[0] },
|
||||
{ ...item, termType: "lte", value: item.value[1] }
|
||||
];
|
||||
}
|
||||
return item;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
data = {
|
||||
terms:[{
|
||||
terms:data
|
||||
|
|
|
@ -85,7 +85,8 @@ const columns = [
|
|||
scopedSlots: true,
|
||||
ellipsis: true,
|
||||
search: {
|
||||
type: 'date',
|
||||
type: 'rangePicker',
|
||||
defaultTermType:'in',
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -34,8 +34,7 @@ const change = (e: string) => {
|
|||
}
|
||||
|
||||
watch(() => props.value, () => {
|
||||
console.log(props.value);
|
||||
|
||||
|
||||
myValue.value = props.value?.valueType?.type
|
||||
}, { immediate: true, deep: true})
|
||||
|
||||
|
|
Loading…
Reference in New Issue