Commit a396c466 authored by nick zheng's avatar nick zheng

fix: 剔除应用随机生成配置按钮

parent dde5c0f3
......@@ -23,8 +23,6 @@ const emit = defineEmits<Emits>()
const autoConfigInputValue = ref('')
const autoConfigInputType = ref<'random' | 'input'>('random')
const showModal = computed({
get() {
return props.isShowModal
......@@ -38,12 +36,8 @@ const isDisabledBtn = computed(() => {
return !autoConfigInputValue.value
})
const isRandomBtnLoading = computed(() => {
return props.btnLoading && autoConfigInputType.value === 'random'
})
const isInputBtnLoading = computed(() => {
return props.btnLoading && autoConfigInputType.value === 'input'
return props.btnLoading
})
watch(
......@@ -57,14 +51,23 @@ function handleCloseModal() {
emit('update:isShowModal', false)
}
function handleConfirm(inputType: 'random' | 'input') {
autoConfigInputType.value = inputType
emit('confirm', inputType === 'random' ? '' : autoConfigInputValue.value)
function handleConfirm() {
emit('confirm', autoConfigInputValue.value)
}
</script>
<template>
<CustomModal v-model:is-show="showModal" :title="modalTitle" :width="600">
<CustomModal
v-model:is-show="showModal"
:title="modalTitle"
:width="600"
:btn-disabled="isDisabledBtn"
:btn-loading="isInputBtnLoading"
:cancel-btn-text="t('common_module.cancel_btn_text')"
:confirm-btn-text="t('common_module.ai_generate')"
@close="handleCloseModal"
@confirm="handleConfirm"
>
<template #content>
<div class="mb-3 flex h-8 w-full items-center rounded bg-[#FFF4E6] px-4">
<CustomIcon icon="ep:warning-filled" class="mr-2 h-4 w-4 text-[#FFA500]" />
......@@ -89,37 +92,5 @@ function handleConfirm(inputType: 'random' | 'input') {
class="rounded-lg!"
/>
</template>
<template #footer>
<div class="flex w-full items-center justify-end">
<NButton class="h-[32px]! rounded-md! px-6!" @click="handleCloseModal">
{{
t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.auto_config_modal_module.cancel_btn_text',
)
}}
</NButton>
<NButton
:loading="isRandomBtnLoading"
class="h-[32px]! rounded-md! px-6! ml-4!"
@click="handleConfirm('random')"
>
{{
t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.auto_config_modal_module.random_generate_btn_text',
)
}}
</NButton>
<NButton
:loading="isInputBtnLoading"
type="primary"
:disabled="isDisabledBtn"
class="h-[32px]! px-6! rounded-md! ml-4!"
@click="handleConfirm('input')"
>
{{ t('common_module.ai_generate') }}
</NButton>
</div>
</template>
</CustomModal>
</template>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment