Merge remote-tracking branch 'origin/feature/v1.3_主agent_rxd' into test
This commit is contained in:
@ -30,7 +30,8 @@ export default {
|
|||||||
const senderRef = ref(null);
|
const senderRef = ref(null);
|
||||||
const localSearchValue = ref(props.modelValue);
|
const localSearchValue = ref(props.modelValue);
|
||||||
|
|
||||||
// 监听外部value变化
|
const isEmptyValue = computed(() => !localSearchValue.value.trim());
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.modelValue,
|
() => props.modelValue,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
@ -39,6 +40,10 @@ export default {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
|
if (isEmptyValue.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
emit('submit', localSearchValue.value);
|
emit('submit', localSearchValue.value);
|
||||||
// localSearchValue.value = ''
|
// localSearchValue.value = ''
|
||||||
};
|
};
|
||||||
@ -65,7 +70,7 @@ export default {
|
|||||||
<div
|
<div
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
class={`submit-btn w-32px h-32px p-6px flex justify-center items-center rounded-50% cursor-pointer ${
|
class={`submit-btn w-32px h-32px p-6px flex justify-center items-center rounded-50% cursor-pointer ${
|
||||||
!localSearchValue.value ? 'opacity-50' : ''
|
isEmptyValue.value ? 'opacity-50' : ''
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<icon-arrow-right size={20} class="color-#FFFFFF" />
|
<icon-arrow-right size={20} class="color-#FFFFFF" />
|
||||||
@ -83,7 +88,7 @@ export default {
|
|||||||
<Sender
|
<Sender
|
||||||
v-model:value={localSearchValue.value}
|
v-model:value={localSearchValue.value}
|
||||||
ref={senderRef}
|
ref={senderRef}
|
||||||
onChange={(value: string) => emit('update:modelValue', value)}
|
onChange={(value: string) => emit('update:modelValue', value.trim())}
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
class="h-full w-full mb-24px"
|
class="h-full w-full mb-24px"
|
||||||
placeholder={props.placeholder}
|
placeholder={props.placeholder}
|
||||||
|
|||||||
@ -84,7 +84,6 @@ export default {
|
|||||||
agent_id: chatStore.agentInfo.agent_id,
|
agent_id: chatStore.agentInfo.agent_id,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to initialize SSE:', error);
|
console.error('Failed to initialize SSE:', error);
|
||||||
antdMessage.error('初始化连接失败');
|
antdMessage.error('初始化连接失败');
|
||||||
|
|||||||
@ -30,15 +30,20 @@ export default {
|
|||||||
const senderRef = ref(null);
|
const senderRef = ref(null);
|
||||||
const localSearchValue = ref(props.modelValue);
|
const localSearchValue = ref(props.modelValue);
|
||||||
|
|
||||||
// 监听外部value变化
|
const isEmptyValue = computed(() => !localSearchValue.value.trim());
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.modelValue,
|
() => props.modelValue,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
|
console.log(newValue);
|
||||||
localSearchValue.value = newValue || '';
|
localSearchValue.value = newValue || '';
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
|
if (isEmptyValue.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
emit('submit', localSearchValue.value);
|
emit('submit', localSearchValue.value);
|
||||||
};
|
};
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
@ -64,7 +69,7 @@ export default {
|
|||||||
<div
|
<div
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
class={`submit-btn w-32px h-32px p-6px flex justify-center items-center rounded-50% cursor-pointer ${
|
class={`submit-btn w-32px h-32px p-6px flex justify-center items-center rounded-50% cursor-pointer ${
|
||||||
!localSearchValue.value ? 'opacity-50' : ''
|
isEmptyValue.value ? 'opacity-50' : ''
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<icon-arrow-right size={20} class="color-#FFFFFF" />
|
<icon-arrow-right size={20} class="color-#FFFFFF" />
|
||||||
@ -81,7 +86,7 @@ export default {
|
|||||||
<Sender
|
<Sender
|
||||||
v-model:value={localSearchValue.value}
|
v-model:value={localSearchValue.value}
|
||||||
ref={senderRef}
|
ref={senderRef}
|
||||||
onChange={(value: string) => emit('update:modelValue', value)}
|
onChange={(value: string) => emit('update:modelValue', value.trim())}
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
class="h-full w-full mb-24px"
|
class="h-full w-full mb-24px"
|
||||||
placeholder={props.placeholder}
|
placeholder={props.placeholder}
|
||||||
|
|||||||
Reference in New Issue
Block a user