优化智能体列表布局,修复HeaderBar的搜索功能,增加确认的回车按键绑定

This commit is contained in:
Ran_Chen
2025-04-03 17:07:13 +08:00
parent 4553188739
commit 1673ad7e70
4 changed files with 89 additions and 31 deletions
@@ -1,5 +1,5 @@
<template>
<el-dialog :visible.sync="visible" width="400px" center>
<el-dialog :visible.sync="visible" width="400px" center @open="handleOpen">
<div style="margin: 0 10px 10px;display: flex;align-items: center;gap: 10px;font-weight: 700;font-size: 20px;text-align: left;color: #3d4566;">
<div style="width: 40px;height: 40px;border-radius: 50%;background: #5778ff;display: flex;align-items: center;justify-content: center;">
<img loading="lazy" src="@/assets/home/equipment.png" alt="" style="width: 18px;height: 15px;" />
@@ -12,7 +12,11 @@
<div style="color: red;display: inline-block;">*</div> 智慧体名称
</div>
<div class="input-46" style="margin-top: 12px;">
<el-input placeholder="请输入智能体名称.." v-model="wisdomBodyName" />
<el-input
ref="inputRef"
placeholder="请输入智能体名称.."
v-model="wisdomBodyName"
@keyup.enter.native="confirm" />
</div>
</div>
<div style="display: flex;margin: 15px 15px;gap: 7px;">
@@ -31,16 +35,23 @@
<script>
import userApi from '@/apis/module/agent';
export default {
name: 'AddWisdomBodyDialog',
props: {
visible: { type: Boolean, required: true }
},
data() {
return { wisdomBodyName: "" }
return {
wisdomBodyName: "",
inputRef: null
}
},
methods: {
handleOpen() {
this.$nextTick(() => {
this.$refs.inputRef.focus();
});
},
confirm() {
if (!this.wisdomBodyName.trim()) {
this.$message.error('请输入智能体名称');
@@ -65,7 +76,6 @@ export default {
</script>
<style scoped>
.input-46 {
border: 1px solid #e4e6ef;
background: #f6f8fb;