feat: 选择trending report之后清除其他参数
This commit is contained in:
@@ -36,9 +36,10 @@
|
|||||||
:setting-title="$t('Input.styleTitle')"
|
:setting-title="$t('Input.styleTitle')"
|
||||||
:confirm-text="$t('Input.confirm')"
|
:confirm-text="$t('Input.confirm')"
|
||||||
:create-text="$t('Input.createProject')"
|
:create-text="$t('Input.createProject')"
|
||||||
|
:parameters-disabled="isReportSelected"
|
||||||
:translate="translate"
|
:translate="translate"
|
||||||
@file-change="handleFileChange"
|
@file-change="handleFileChange"
|
||||||
@toggle-report="toggleReportTag()"
|
@toggle-report="handleToggleReportTag"
|
||||||
@create="handleCreateProject"
|
@create="handleCreateProject"
|
||||||
@send="handleSendAgent"
|
@send="handleSendAgent"
|
||||||
/>
|
/>
|
||||||
@@ -48,7 +49,7 @@
|
|||||||
v-if="!isAgentMode"
|
v-if="!isAgentMode"
|
||||||
:is-cn="isCn"
|
:is-cn="isCn"
|
||||||
:label="$t('Input.trendingReport')"
|
:label="$t('Input.trendingReport')"
|
||||||
@click="toggleReportTag()"
|
@click="handleToggleReportTag"
|
||||||
/>
|
/>
|
||||||
<Preview v-model="showPreview" :url="previewUrl" />
|
<Preview v-model="showPreview" :url="previewUrl" />
|
||||||
</div>
|
</div>
|
||||||
@@ -156,6 +157,24 @@
|
|||||||
clearImages
|
clearImages
|
||||||
} = useInputImages(focusEditor)
|
} = useInputImages(focusEditor)
|
||||||
|
|
||||||
|
const isReportSelected = computed(() => {
|
||||||
|
return reportTags.value.some((tag) => tag.parentNode)
|
||||||
|
})
|
||||||
|
|
||||||
|
const clearParameterValues = () => {
|
||||||
|
typeValue.value = ''
|
||||||
|
areaValue.value = ''
|
||||||
|
styleValue.value = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleToggleReportTag = () => {
|
||||||
|
const shouldSelectReport = !isReportSelected.value
|
||||||
|
toggleReportTag()
|
||||||
|
if (shouldSelectReport) {
|
||||||
|
clearParameterValues()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
watch(inputValue, () => {
|
watch(inputValue, () => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
autoResizeEditor()
|
autoResizeEditor()
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
v-if="!isAgentMode"
|
v-if="!isAgentMode"
|
||||||
v-model="typeModel"
|
v-model="typeModel"
|
||||||
:placeholder="typePlaceholder"
|
:placeholder="typePlaceholder"
|
||||||
|
:disabled="parametersDisabled"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in typeOptions"
|
v-for="item in typeOptions"
|
||||||
@@ -37,6 +38,7 @@
|
|||||||
v-if="!isAgentMode"
|
v-if="!isAgentMode"
|
||||||
v-model="areaModel"
|
v-model="areaModel"
|
||||||
:placeholder="areaPlaceholder"
|
:placeholder="areaPlaceholder"
|
||||||
|
:disabled="parametersDisabled"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in areaOptions"
|
v-for="item in areaOptions"
|
||||||
@@ -54,6 +56,7 @@
|
|||||||
:placeholder="stylePlaceholder"
|
:placeholder="stylePlaceholder"
|
||||||
:title="styleTitle"
|
:title="styleTitle"
|
||||||
:confirm-text="confirmText"
|
:confirm-text="confirmText"
|
||||||
|
:disabled="parametersDisabled"
|
||||||
/>
|
/>
|
||||||
<SettingPopover
|
<SettingPopover
|
||||||
v-model:options="settingOptionsModel"
|
v-model:options="settingOptionsModel"
|
||||||
@@ -109,11 +112,13 @@
|
|||||||
settingTitle: string
|
settingTitle: string
|
||||||
confirmText: string
|
confirmText: string
|
||||||
createText: string
|
createText: string
|
||||||
|
parametersDisabled?: boolean
|
||||||
translate: (key: string) => string
|
translate: (key: string) => string
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
isAgentMode: false,
|
isAgentMode: false,
|
||||||
generating: false
|
generating: false,
|
||||||
|
parametersDisabled: false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="fida-style-select-wrapper">
|
<div class="fida-style-select-wrapper" :class="{ 'is-disabled': disabled }">
|
||||||
<el-select
|
<el-select
|
||||||
:model-value="modelValue"
|
:model-value="modelValue"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
|
:disabled="disabled"
|
||||||
@focus="openStylePopup"
|
@focus="openStylePopup"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<el-popover
|
<el-popover
|
||||||
v-model:visible="stylePopupVisible"
|
v-model:visible="stylePopupVisible"
|
||||||
|
:disabled="disabled"
|
||||||
placement="top"
|
placement="top"
|
||||||
:width="342"
|
:width="342"
|
||||||
:show-arrow="false"
|
:show-arrow="false"
|
||||||
@@ -60,6 +62,7 @@
|
|||||||
placeholder: string
|
placeholder: string
|
||||||
title: string
|
title: string
|
||||||
confirmText: string
|
confirmText: string
|
||||||
|
disabled?: boolean
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@@ -77,12 +80,23 @@
|
|||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.disabled,
|
||||||
|
(disabled) => {
|
||||||
|
if (disabled) {
|
||||||
|
stylePopupVisible.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
const openStylePopup = () => {
|
const openStylePopup = () => {
|
||||||
|
if (props.disabled) return
|
||||||
tempSelectedValue.value = props.modelValue
|
tempSelectedValue.value = props.modelValue
|
||||||
stylePopupVisible.value = true
|
stylePopupVisible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectStyle = (value: string) => {
|
const selectStyle = (value: string) => {
|
||||||
|
if (props.disabled) return
|
||||||
tempSelectedValue.value = value
|
tempSelectedValue.value = value
|
||||||
confirmStyle()
|
confirmStyle()
|
||||||
}
|
}
|
||||||
@@ -132,6 +146,12 @@
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.is-disabled {
|
||||||
|
.fida-style-select-trigger {
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
|||||||
Reference in New Issue
Block a user