diff --git a/src/components/Search/index.vue b/src/components/Search/index.vue index 280e211..9275f82 100644 --- a/src/components/Search/index.vue +++ b/src/components/Search/index.vue @@ -49,7 +49,20 @@ export default { default: true } }, + created() { + this.setDefaultValue(); + }, methods: { + setDefaultValue() { + this.searchFields.forEach(field => { + if (field.type === 'select') { + const defaultOption = field.options.find(option => option.default); + if (defaultOption) { + this.queryParams[field.prop] = defaultOption.value; + } + } + }); + }, getComponentType(type) { switch (type) { case 'input': diff --git a/src/components/TabComponent/index.vue b/src/components/TabComponent/index.vue index 53967ef..3204825 100644 --- a/src/components/TabComponent/index.vue +++ b/src/components/TabComponent/index.vue @@ -4,12 +4,12 @@
- 新建标签页 + 导航
- - diff --git a/src/views/gather/pool/index.vue b/src/views/gather/pool/index.vue index 1c54ba9..e3bc7d0 100644 --- a/src/views/gather/pool/index.vue +++ b/src/views/gather/pool/index.vue @@ -62,7 +62,8 @@ export default { placeholder: '请选择', gutter: 2, options: [ - {label: '是', value: '1'}, + {label: '全部', value: ' '}, + {label: '是', value: '1', default: true}, {label: '否', value: '0'}, ], }, @@ -133,7 +134,6 @@ export default { // 查询 handleQuery() { this.getRows(); - }, // 重置 handleReset() { @@ -167,19 +167,22 @@ export default { }, // 处理操作列点击事件 handleOperationClick(operation, row) { - // 根据操作类型执行相应逻辑 - switch (operation) { - case 'edit': - this.handleEdit(row); - break; - case 'delete': - this.handleDelete(row); - break; - case 'sync': - this.handleSync(row); - break; - default: - console.log('未知操作'); + try { + switch (operation) { + case 'edit': + this.handleEdit(row); + break; + case 'delete': + this.handleDelete(row); + break; + case 'sync': + this.handleSync(row); + break; + default: + console.log('未知操作'); + } + } catch (error) { + console.error('操作处理失败:', error); } }, // 编辑操作 @@ -192,11 +195,15 @@ export default { console.log('删除行:', row); // 实现删除逻辑 }, - // 删除操作 + // 同步操作 handleSync(row) { console.log('同步操作:', row); - // 实现删除逻辑 + // 实现同步逻辑 }, } }; + +