Commit a396c466 authored by nick zheng's avatar nick zheng

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

parent dde5c0f3
...@@ -23,8 +23,6 @@ const emit = defineEmits<Emits>() ...@@ -23,8 +23,6 @@ const emit = defineEmits<Emits>()
const autoConfigInputValue = ref('') const autoConfigInputValue = ref('')
const autoConfigInputType = ref<'random' | 'input'>('random')
const showModal = computed({ const showModal = computed({
get() { get() {
return props.isShowModal return props.isShowModal
...@@ -38,12 +36,8 @@ const isDisabledBtn = computed(() => { ...@@ -38,12 +36,8 @@ const isDisabledBtn = computed(() => {
return !autoConfigInputValue.value return !autoConfigInputValue.value
}) })
const isRandomBtnLoading = computed(() => {
return props.btnLoading && autoConfigInputType.value === 'random'
})
const isInputBtnLoading = computed(() => { const isInputBtnLoading = computed(() => {
return props.btnLoading && autoConfigInputType.value === 'input' return props.btnLoading
}) })
watch( watch(
...@@ -57,14 +51,23 @@ function handleCloseModal() { ...@@ -57,14 +51,23 @@ function handleCloseModal() {
emit('update:isShowModal', false) emit('update:isShowModal', false)
} }
function handleConfirm(inputType: 'random' | 'input') { function handleConfirm() {
autoConfigInputType.value = inputType emit('confirm', autoConfigInputValue.value)
emit('confirm', inputType === 'random' ? '' : autoConfigInputValue.value)
} }
</script> </script>
<template> <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> <template #content>
<div class="mb-3 flex h-8 w-full items-center rounded bg-[#FFF4E6] px-4"> <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]" /> <CustomIcon icon="ep:warning-filled" class="mr-2 h-4 w-4 text-[#FFA500]" />
...@@ -89,37 +92,5 @@ function handleConfirm(inputType: 'random' | 'input') { ...@@ -89,37 +92,5 @@ function handleConfirm(inputType: 'random' | 'input') {
class="rounded-lg!" class="rounded-lg!"
/> />
</template> </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> </CustomModal>
</template> </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