Commit 1a0c546c authored by tyyin lan's avatar tyyin lan
parents ebd56386 58d00e9e
......@@ -107,7 +107,7 @@ async function handleUploadImage(event: any) {
@mouseenter="isShowImageMask = true"
@mouseleave="isShowImageMask = false"
>
<img :src="uploadImageUrl" class="h-full w-full" />
<img :src="uploadImageUrl" class="h-full w-full object-cover" />
<label
v-show="isShowImageMask"
......
......@@ -36,11 +36,18 @@ const cardContentWrapRef = useTemplateRef<HTMLDivElement>('cardContentWrapRef')
const isShowCarousel = ref(true)
const smooth = ref(false)
const agentApplicationBottomIsLoading = ref(false)
const agentApplicationClassifyIsLoading = ref(false)
const agentApplicationClassifyIsLoading = ref(true)
const emptyTableText = ref(t('personal_space_module.agent_module.agent_list_module.empty_agent_list'))
const emptyTableImage = ref(applicationEmptyImage)
const behavior = computed(() => (smooth.value ? 'smooth' : 'auto'))
const isShowAgentListBottomText = computed(
() =>
agentApplicationList.value.length > 8 &&
pagingInfo.value.pageNo === pagingInfo.value.totalPages &&
!agentApplicationClassifyIsLoading.value &&
!agentApplicationBottomIsLoading.value,
)
const { arrivedState } = useScroll(cardContentWrapRef, { behavior })
;(function () {
......@@ -74,8 +81,11 @@ watch(
},
)
function handleGetAgentApplicationList(update = false, search = false) {
function handleGetAgentApplicationList(update = false, search = false, clear = false) {
const agentTypeId = ref<number | null>(0)
if (clear && searchQuery.value.trim() === '') return
if (agentApplicationBottomIsLoading.value && agentApplicationClassifyIsLoading.value) return
if (search && searchQuery.value.length !== 0) {
......@@ -84,6 +94,8 @@ function handleGetAgentApplicationList(update = false, search = false) {
isShowCarousel.value = true
}
if (search) agentApplicationClassifyIsLoading.value = true
if (update) pagingInfo.value.pageNo = 1
checkedClassifyValue.value === 0 ? (agentTypeId.value = null) : (agentTypeId.value = checkedClassifyValue.value)
......@@ -92,20 +104,22 @@ function handleGetAgentApplicationList(update = false, search = false) {
pagingInfo: pagingInfo.value,
categoryId: agentTypeId.value,
}
fetchGetAgentApplicationList<PersonalAppConfigState[]>(payload).then((res) => {
agentApplicationList.value = update ? res.data : [...agentApplicationList.value, ...res.data]
fetchGetAgentApplicationList<PersonalAppConfigState[]>(payload)
.then((res) => {
agentApplicationList.value = update ? res.data : [...agentApplicationList.value, ...res.data]
pagingInfo.value = res.pagingInfo as PaginationInfo
pagingInfo.value = res.pagingInfo as PaginationInfo
emptyTableText.value = searchQuery.value
? t('common_module.search_empty_data')
: t('personal_space_module.agent_module.agent_list_module.empty_agent_list')
emptyTableImage.value =
searchQuery.value && agentApplicationList.value.length === 0 ? searchEmptyImage : applicationEmptyImage
agentApplicationClassifyIsLoading.value = false
agentApplicationBottomIsLoading.value = false
})
emptyTableText.value = searchQuery.value
? t('common_module.search_empty_data')
: t('personal_space_module.agent_module.agent_list_module.empty_agent_list')
emptyTableImage.value =
searchQuery.value && agentApplicationList.value.length === 0 ? searchEmptyImage : applicationEmptyImage
})
.finally(() => {
agentApplicationClassifyIsLoading.value = false
agentApplicationBottomIsLoading.value = false
})
}
function handleCollectOrCancelAgentApplication(agentApplicationItem: PersonalAppConfigState) {
......@@ -133,9 +147,26 @@ function handleGetMallCategoryList() {
function handleToUseAgentApplication(agentId: string) {
router.push({ name: 'ShareWebApplication', params: { agentId: agentId } })
}
function handleAddAgentApplications() {
router.push({ name: 'PersonalAppSetting' })
}
function handleEnterKeypress(event: KeyboardEvent) {
if (event.code === 'Enter' && !event.shiftKey) {
event.preventDefault()
handleGetAgentApplicationList(true, true, true)
}
}
function handleSearchGetApplicationList(clear = false) {
if (clear) {
searchQuery.value = ''
handleGetAgentApplicationList(true, true)
} else {
handleGetAgentApplicationList(true, true, true)
}
}
</script>
<template>
......@@ -154,10 +185,11 @@ function handleAddAgentApplications() {
:placeholder="t('common_module.search')"
class="search-input rounded-[26px]! text-[16px]! leading-[32px]! border-[#9ea3ff]! border-[1px] py-[6px] shadow-[0_4px_10px_0px_rgba(103,103,103,.1)]"
clearable
@keyup.enter="handleGetAgentApplicationList(true, true)"
:on-clear="() => handleSearchGetApplicationList(true)"
@keyup.enter="handleEnterKeypress"
>
<template #prefix>
<div @click="handleGetAgentApplicationList(true)">
<div @click="() => handleSearchGetApplicationList(false)">
<img src="@/assets/images/search.png" width="14" height="14" class="mr-[5px] cursor-pointer" />
</div>
</template>
......@@ -204,8 +236,8 @@ function handleAddAgentApplications() {
<n-scrollbar style="max-height: 920px">
<div>
<div class="mt-[14px] min-h-[800px]">
<div class="flex justify-center">
<n-spin v-show="agentApplicationClassifyIsLoading" size="large" />
<div v-show="agentApplicationClassifyIsLoading" class="flex h-[500px] items-center justify-center">
<n-spin size="large" />
</div>
<div
v-show="!agentApplicationClassifyIsLoading && agentApplicationList.length !== 0"
......@@ -243,7 +275,7 @@ function handleAddAgentApplications() {
<div class="h-[84px] w-[84px]">
<img
:src="agentApplicationItem.baseInfo.agentAvatar"
class="h-[84px] w-[84px] rounded-[10px] object-cover"
class="h-full w-full rounded-[10px] object-cover"
/>
</div>
</div>
......@@ -278,7 +310,7 @@ function handleAddAgentApplications() {
</div>
</div>
<div v-for="item in 4" :key="item" class="mr-[15px]">
<div v-show="agentApplicationBottomIsLoading && pagingInfo.pageNo !== pagingInfo.totalPages">
<div v-show="agentApplicationBottomIsLoading">
<n-skeleton text :repeat="6" /> <n-skeleton text style="width: 60%" />
</div>
</div>
......@@ -292,7 +324,7 @@ function handleAddAgentApplications() {
</div>
</div>
<div
v-show="agentApplicationList.length > 9 && pagingInfo.pageNo === pagingInfo.totalPages"
v-show="isShowAgentListBottomText"
class="mb-[50px] mt-[30px] flex justify-center text-center text-[14px] text-[#a9b4cc]"
>
<div class="relative top-[10px] h-[1px] w-[14px] bg-[#a9b4cc]"></div>
......
......@@ -28,7 +28,7 @@ const assistantAvatarUrl = computed(() => {
<div class="mb-[20px] last:mb-0">
<div class="flex">
<img
class="h-[36px] w-[36px] rounded-full"
class="h-[36px] w-[36px] flex-shrink-0 rounded-full object-cover"
:src="isAssistant ? assistantAvatarUrl : props.messageItem.avatar"
alt="Avatar"
/>
......
export interface DiversityModeItem {
label: string
value: string
topP: number
temperature: number
communicationTurn: number
}
export const diversityModeList: DiversityModeItem[] = [
{
label: 'personal_space_module.agent_module.agent_setting_module.agent_config_module.accurate_mode',
value: 'accurate',
topP: 0.1,
temperature: 0.1,
communicationTurn: 3,
},
{
label: 'personal_space_module.agent_module.agent_setting_module.agent_config_module.balance_mode',
value: 'balance',
topP: 0.7,
temperature: 0.5,
communicationTurn: 3,
},
{
label: 'personal_space_module.agent_module.agent_setting_module.agent_config_module.creative_mode',
value: 'creative',
topP: 0.7,
temperature: 0.95,
communicationTurn: 3,
},
{
label: 'common_module.custom',
value: 'custom',
topP: 0.5,
temperature: 0.8,
communicationTurn: 3,
},
]
<script setup lang="ts">
import { computed, h } from 'vue'
import { useI18n } from 'vue-i18n'
import { Help, Down, RightOne } from '@icon-park/vue-next'
import { PersonalAppConfigState } from '@/store/types/personal-app-config'
const { t } = useI18n()
const emit = defineEmits<{
generatePreamble: []
generateFeaturedQuestions: []
}>()
const commConfigExpandedNames = defineModel<string[]>('commConfigExpandedNames', { required: true })
const commConfig = defineModel<PersonalAppConfigState['commConfig']>('commConfig', { required: true })
const generatePreambleLoading = defineModel<boolean>('generatePreambleLoading', { required: true })
const generateFeaturedQuestionsLoading = defineModel<boolean>('generateFeaturedQuestionsLoading', { required: true })
const questionSettingOptions = [
{
label: () =>
h(
'span',
{},
t('personal_space_module.agent_module.agent_setting_module.agent_config_module.continuous_question_default'),
),
value: 'default',
style: { fontSize: '12px' },
},
{
label: () =>
h(
'span',
{},
t('personal_space_module.agent_module.agent_setting_module.agent_config_module.continuous_question_close'),
),
value: 'close',
style: { fontSize: '12px' },
},
]
const continuousQuestionStatusText = computed(() => {
return commConfig.value.continuousQuestionStatus === 'default'
? t('personal_space_module.agent_module.agent_setting_module.agent_config_module.continuous_question_default')
: t('personal_space_module.agent_module.agent_setting_module.agent_config_module.continuous_question_close')
})
function handleUpdateCommConfigExpandedNames(expandedNames: string[]) {
commConfigExpandedNames.value = expandedNames
}
function handleAIGeneratePreamble() {
emit('generatePreamble')
}
function handleAIGenerateFeaturedQuestions() {
emit('generateFeaturedQuestions')
}
</script>
<template>
<section class="border-b border-[#e8e9eb] px-5">
<div class="pt-4">
<h2 class="my-3 text-[#84868c]">
{{ t('personal_space_module.agent_module.agent_setting_module.agent_config_module.dialogue') }}
</h2>
<NCollapse
:expanded-names="commConfigExpandedNames"
:trigger-areas="['main', 'arrow']"
@update:expanded-names="handleUpdateCommConfigExpandedNames"
>
<template #arrow>
<RightOne theme="multi-color" size="17" :fill="['#333', '#333', '#333', '#333']" />
</template>
<NCollapseItem
:title="t('personal_space_module.agent_module.agent_setting_module.agent_config_module.preamble')"
name="preamble"
class="my-[13px]!"
>
<template #header-extra>
<NTooltip trigger="hover">
<template #trigger>
<div
class="h-4 w-4 bg-[length:100%_100%]"
:class="
generatePreambleLoading
? 'bg-[url(@/assets/images/loading.gif)]'
: 'bg-[url(@/assets/svgs/star.svg)]'
"
@click="handleAIGeneratePreamble"
/>
</template>
{{ t('common_module.ai_generate') }}
</NTooltip>
</template>
<NInput
v-model:value="commConfig.preamble"
type="textarea"
:rows="5"
:disabled="generatePreambleLoading"
class="text-xs! rounded-md!"
:placeholder="
t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.preamble_input_placeholder',
)
"
/>
</NCollapseItem>
<NCollapseItem
:title="t('personal_space_module.agent_module.agent_setting_module.agent_config_module.featured_questions')"
name="featuredQuestions"
class="my-[13px]!"
>
<template #header-extra>
<NTooltip trigger="hover">
<template #trigger>
<div
class="h-4 w-4 bg-[length:100%_100%]"
:class="
generateFeaturedQuestionsLoading
? 'bg-[url(@/assets/images/loading.gif)]'
: 'bg-[url(@/assets/svgs/star.svg)]'
"
@click="handleAIGenerateFeaturedQuestions"
/>
</template>
{{ t('common_module.ai_generate') }}
</NTooltip>
</template>
<NDynamicInput
v-model:value="commConfig.featuredQuestions"
:placeholder="
t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.featured_questions_input_placeholder',
)
"
class="rounded-md"
:min="1"
:max="3"
:disabled="generateFeaturedQuestionsLoading"
>
<template #create-button-default> {{ t('common_module.add') }} </template>
</NDynamicInput>
</NCollapseItem>
<NCollapseItem name="continuousQuestion" class="my-[13px]!">
<template #header>
<div class="flex items-center">
<span>
{{
t('personal_space_module.agent_module.agent_setting_module.agent_config_module.continuous_question')
}}
</span>
<NPopover trigger="hover">
<template #trigger>
<Help
theme="outline"
size="15"
fill="#333"
:stroke-width="3"
class="ml-1 cursor-pointer text-base text-[#999] outline-none"
/>
</template>
<span class="text-xs">
{{
t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.continuous_question_popover_message',
)
}}
</span>
</NPopover>
</div>
</template>
<template #header-extra>
<NPopselect
v-model:value="commConfig.continuousQuestionStatus"
:options="questionSettingOptions"
trigger="click"
content-class="text-xs"
>
<div class="text-theme-color flex cursor-pointer items-center justify-between text-xs">
<span> {{ continuousQuestionStatusText }}</span>
<Down theme="outline" size="16" class="text-theme-color ml-1 text-base" />
</div>
</NPopselect>
</template>
<div>
<span v-show="commConfig.continuousQuestionStatus === 'default'" class="text-xs text-[#84868c]">
{{
t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.continuous_question_default_desc',
)
}}
</span>
<span v-show="commConfig.continuousQuestionStatus === 'close'" class="text-xs text-[#84868c]">
{{
t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.continuous_question_close_desc',
)
}}
</span>
</div>
</NCollapseItem>
</NCollapse>
</div>
</section>
</template>
......@@ -16,15 +16,7 @@ import {
fetchRemoveSalePublishApplication,
} from '@/apis/agent-application'
import { defaultPersonalAppConfigState, usePersonalAppConfigStore } from '@/store/modules/personal-app-config'
interface ApplicationMallInfo {
agentId: string
agentPublishId: number
categoryId: number
isCopy: string
isSale: string
launchTime: string
}
import { ApplicationMallInfo } from '../../personal-app/types'
const { t } = useI18n()
......@@ -334,8 +326,8 @@ function handleToApplicationSquare() {
<SaleApplicationsConfigurationModal
v-model="isShowSaleApplicationsConfigurationModal"
:data="saleApplicationsInfo"
:category-id="applicationMallInfo.categoryId"
:sale-applications-data="saleApplicationsInfo"
:application-mall-info="applicationMallInfo"
@update="(newValue: string) => (applicationMallInfo.isSale = newValue)"
@trigger-get-application-mall-info="handleGetApplicationMallInfo"
/>
......
......@@ -33,6 +33,7 @@ const assistantAvatar = personalAppConfigStore.baseInfo.agentAvatar
preview-disabled
:width="32"
:height="32"
object-fit="cover"
class="mr-2 mt-1.5 h-8 w-8 rounded-full"
/>
......
......@@ -88,8 +88,8 @@ watch(
watch(
() => personalAppConfig.value.knowledgeConfig.knowledgeIds,
(newVal) => {
newVal && (isInitGetAgentAppDetail.value = true)
(newKnowledgeIds) => {
newKnowledgeIds.length && (isInitGetAgentAppDetail.value = true)
},
{ once: true },
)
......
......@@ -19,7 +19,11 @@ function handleSelectFeaturedQuestion(featuredQuestion: string) {
<template>
<div class="flex w-full flex-1 flex-col overflow-auto px-5">
<div class="mb-5 flex w-full justify-center pt-[50px]">
<img v-if="personalAppConfigStore.baseInfo.agentAvatar" :src="agentAvatar" class="h-[72px] w-[72px] rounded-xl" />
<img
v-if="personalAppConfigStore.baseInfo.agentAvatar"
:src="agentAvatar"
class="h-[72px] w-[72px] rounded-xl object-cover"
/>
<div v-else class="h-[72px] w-[72px] rounded-xl border" />
</div>
......
<script setup lang="ts">
import { ref, useTemplateRef, watch } from 'vue'
import { computed, ref, useTemplateRef, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { Search, MoreOne, Star } from '@icon-park/vue-next'
import { PaginationInfo } from '@/components/custom-pagination/custom-pagination.vue'
......@@ -56,14 +56,22 @@ const pagingInfo = ref<PaginationInfo>({
const agentAppList = ref<PersonalAppConfigState[]>([])
const agentSearchInputValue = ref('')
const agentAppListLoading = ref(false)
const agentAppListLoading = ref(true)
const agentAppListBottomLoadingMore = ref(false)
const emptyTableText = ref(t('personal_space_module.agent_module.agent_list_module.application_empty'))
const emptyTableImage = ref(applicationEmptyImage)
const isAgentAppListBottom = ref(false)
const isCollect = ref('')
const isShowAgentListBottomText = computed(
() =>
pagingInfo.value.pageNo === pagingInfo.value.totalPages &&
agentAppList.value.length !== 0 &&
pagingInfo.value.totalRows > 12 &&
!agentAppListLoading.value &&
!agentAppListBottomLoadingMore.value,
)
watch(
() => isAgentAppListBottom.value,
......@@ -78,25 +86,30 @@ watch(
},
)
;(function () {
agentAppListLoading.value = true
getApplicationList()
})()
function getApplicationList(isLoadMore = false) {
function getApplicationList(isLoadMore = false, clear = false) {
if (clear && agentSearchInputValue.value.trim() === '') {
return
} else {
if (!agentAppListBottomLoadingMore.value) agentAppListLoading.value = true
}
if (!isLoadMore) {
pagingInfo.value.pageNo = 1
pagingInfo.value.totalPages = 0
pagingInfo.value.totalRows = 0
}
const isCollect = ref('')
const publishStatus = ref(selectedPublishStatusValue.value)
let publishStatus = selectedPublishStatusValue.value
isCollect.value = ''
if (selectedPublishStatusValue.value === 'Y') {
isCollect.value = 'Y'
publishStatus.value = ''
publishStatus = ''
}
const payload = {
query: agentSearchInputValue.value,
publishStatus: publishStatus.value,
publishStatus: publishStatus,
isCollect: isCollect.value,
pagingInfo: pagingInfo.value,
}
......@@ -122,14 +135,6 @@ function handleBasePublishingStatusGetAgentList() {
getApplicationList()
}
function handleEnterKeypress(event: KeyboardEvent) {
if (event.code === 'Enter' && !event.shiftKey) {
event.preventDefault()
getApplicationList()
}
}
function handleDeletePersonalApp(agentId: string) {
window.$message
.ctWarning(t('personal_space_module.agent_module.agent_list_module.delete_agent_dialog_title'))
......@@ -184,9 +189,21 @@ function handleSelectAddType() {
router.push({ name: 'PersonalAppSetting' })
}
// function handleAnalysisPersonalApp(personalApp: PersonalAppConfigState) {
// console.log('分析', personalApp)
// }
function handleSearchGetApplicationList(clear = false) {
if (clear) {
agentSearchInputValue.value = ''
getApplicationList()
} else {
getApplicationList(false, true)
}
}
function handleEnterKeypress(event: KeyboardEvent) {
if (event.code === 'Enter' && !event.shiftKey) {
event.preventDefault()
getApplicationList(false, true)
}
}
const handleCardContentScrollDebounce = debounce(
(event: { target: { scrollTop: number; clientHeight: number; scrollHeight: number } }) => {
......@@ -198,6 +215,10 @@ const handleCardContentScrollDebounce = debounce(
},
200,
)
// function handleAnalysisPersonalApp(personalApp: PersonalAppConfigState) {
// console.log('分析', personalApp)
// }
</script>
<template>
......@@ -214,6 +235,8 @@ const handleCardContentScrollDebounce = debounce(
v-model:value="agentSearchInputValue"
:placeholder="t('common_module.search')"
class="w-[256px]! h-[32px]!"
clearable
:on-clear="() => handleSearchGetApplicationList(true)"
@keypress="handleEnterKeypress"
>
<template #suffix>
......@@ -222,16 +245,16 @@ const handleCardContentScrollDebounce = debounce(
size="16"
fill="#999"
:stroke-width="3"
class="cursor-pointer text-base"
@click="getApplicationList()"
class="ml-[10px] cursor-pointer text-base"
@click="() => handleSearchGetApplicationList(false)"
/>
</template>
</NInput>
</div>
<n-scrollbar style="max-height: 700px" @scroll="handleCardContentScrollDebounce">
<div ref="cardContentWrapRef" class="pb-[50px]">
<div class="flex justify-center">
<n-spin v-show="agentAppListLoading" size="large" />
<div v-show="agentAppListLoading" class="flex h-[700px] items-center justify-center">
<n-spin size="large" />
</div>
<div v-show="!agentAppListLoading" class="mt-[5px]">
<div v-if="agentAppList.length" class="grid-content grid grid-cols-4">
......@@ -269,7 +292,7 @@ const handleCardContentScrollDebounce = debounce(
>
</div>
<div class="h-[68px] w-[68px]">
<img :src="agentAppItem.baseInfo.agentAvatar" class="h-[68px] rounded-[10px] object-cover" />
<img :src="agentAppItem.baseInfo.agentAvatar" class="h-full w-full rounded-[10px] object-cover" />
</div>
</div>
<div>
......@@ -350,7 +373,7 @@ const handleCardContentScrollDebounce = debounce(
</div>
</div>
<div v-for="item in 4" :key="item" class="mr-[15px]">
<div v-show="agentAppListBottomLoadingMore && pagingInfo.pageNo !== pagingInfo.totalPages">
<div v-show="agentAppListBottomLoadingMore">
<n-skeleton text :repeat="6" /> <n-skeleton text style="width: 60%" />
</div>
</div>
......@@ -377,9 +400,7 @@ const handleCardContentScrollDebounce = debounce(
</div>
</div>
<div
v-show="
pagingInfo.pageNo === pagingInfo.totalPages && agentAppList.length !== 0 && pagingInfo.totalRows > 12
"
v-show="isShowAgentListBottomText"
class="mt-[30px] flex justify-center text-center text-[14px] text-[#a9b4cc]"
>
<div class="relative top-[10px] h-[1px] w-[14px] bg-[#a9b4cc]"></div>
......@@ -394,7 +415,7 @@ const handleCardContentScrollDebounce = debounce(
<SaleApplicationsConfigurationModal
v-model="isShowSaleApplicationsConfigurationModal"
:data="saleApplicationsInfo"
:sale-applications-data="saleApplicationsInfo"
@update="(newValue: string) => (saleApplicationsInfo.isSale = newValue)"
/>
</div>
......
......@@ -5,6 +5,7 @@ import { PersonalAppConfigState } from '@/store/types/personal-app-config'
import { Close, Help, Notes, CheckSmall } from '@icon-park/vue-next'
import { ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { ApplicationMallInfo } from './types'
interface MallCategory {
id: number
......@@ -14,8 +15,8 @@ interface MallCategory {
const isShowSaleApplicationsConfigurationModal = defineModel<boolean>()
const props = defineProps<{
data: PersonalAppConfigState
categoryId?: number
saleApplicationsData: PersonalAppConfigState
applicationMallInfo?: ApplicationMallInfo
}>()
const emit = defineEmits<{
update: [value: string]
......@@ -23,13 +24,12 @@ const emit = defineEmits<{
}>()
const { t } = useI18n()
const checkedClassifyValue = ref<number | null>(props.applicationMallInfo?.categoryId ?? 0)
const checkedClassifyValue = ref<number | null>(props.categoryId!)
const isCopy = ref(props.data.isCopy === 'Y')
const saleApplicationsId = ref(props.data.agentPublishId)
const isCopy = ref(props.saleApplicationsData.isCopy === 'Y')
const isClassifyError = ref(false)
const applicationsClassify = ref<MallCategory[]>([])
const agentPublishId = ref(props.saleApplicationsData.agentPublishId)
;(function () {
handleGetMallCategoryList()
......@@ -43,17 +43,9 @@ watch(
)
watch(
() => props.categoryId,
() => props.saleApplicationsData.agentPublishId,
(newValue) => {
checkedClassifyValue.value = newValue!
},
)
watch(
() => props.data,
(newVal) => {
saleApplicationsId.value = newVal.agentPublishId
isCopy.value = newVal.isCopy === 'Y'
agentPublishId.value = newValue
},
)
......@@ -69,8 +61,12 @@ function handleApplicationReleaseBtn() {
return
}
if (props.applicationMallInfo?.agentPublishId) {
agentPublishId.value = props.applicationMallInfo.agentPublishId
}
const payload = {
agentPublishId: props.data.agentPublishId,
agentPublishId: agentPublishId.value,
categoryId: checkedClassifyValue.value,
isCopy: isCopy.value ? 'Y' : 'N',
isSale: 'Y',
......@@ -105,9 +101,9 @@ function handleGetMallCategoryList() {
}
function handleModalOpenAfter() {
if (props.data.isCopy) isCopy.value = props.data.isCopy === 'Y'
if (props.data.isSale === 'Y') {
checkedClassifyValue.value = props.categoryId!
if (props.saleApplicationsData.isCopy) isCopy.value = props.saleApplicationsData.isCopy === 'Y'
if (props.saleApplicationsData.isSale === 'Y') {
checkedClassifyValue.value = props.applicationMallInfo!.categoryId
} else {
checkedClassifyValue.value = 0
}
......@@ -141,6 +137,7 @@ function handleModalOpenAfter() {
@click="handleApplicationsSaleSettingModalClose"
/>
</div>
<div class="items-center justify-center rounded-[4px]">
<div class="mb-[16px] flex items-center text-[14px] text-[#151B26]">
<div class="bg-theme-color mr-[8px] h-[20px] w-[20px] rounded-2xl text-center text-[#fff]">1</div>
......
export interface ApplicationMallInfo {
agentId: string
agentPublishId: number
categoryId: number
isCopy: string
isSale: string
launchTime: string
}
import { NSwitch } from 'naive-ui'
import { KnowledgeDocumentItem, KnowledgeItem } from './knowledge-type'
import { KnowledgeDocumentItem, KnowledgeItem } from './types.d'
import { formatDateTime } from '@/utils/date-formatter'
import i18n from '@/locales'
......
<script setup lang="ts">
import { ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { KnowledgeChunkItem } from '../knowledge-type'
import { KnowledgeChunkItem } from '../types.d'
interface Props {
chunkItem: KnowledgeChunkItem
......
......@@ -4,7 +4,7 @@ import { useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { ScrollbarInst } from 'naive-ui'
import { Left, Search } from '@icon-park/vue-next'
import { KnowledgeChunkItem, KnowledgeDocumentItem } from './knowledge-type'
import { KnowledgeChunkItem, KnowledgeDocumentItem } from './types.d'
import KnowledgeChuckItem from './components/knowledge-chuck-item.vue'
import {
fetchAddKnowledgeChunk,
......@@ -247,8 +247,8 @@ async function handleUpdateOpenKnowledgeChunk(chunkItem: KnowledgeChunkItem) {
</div>
<n-spin :show="knowledgeChunkListLoading" class="w-full flex-1 overflow-hidden" content-class="flex w-full h-full">
<div v-if="knowledgeChunkList.length" class="flex flex-1">
<n-scrollbar v-show="!knowledgeChunkListLoading" ref="scrollBarRef" class="grid w-full flex-1 overflow-hidden">
<div v-if="knowledgeChunkList.length && !knowledgeChunkListLoading" class="flex flex-1">
<n-scrollbar ref="scrollBarRef" class="grid w-full flex-1 overflow-hidden">
<div class="grid gap-5">
<KnowledgeChuckItem
v-for="chunkItem in knowledgeChunkList"
......
......@@ -5,7 +5,7 @@ import { useI18n } from 'vue-i18n'
import { Left, Search } from '@icon-park/vue-next'
import { useIntervalFn } from '@vueuse/core'
import { createKnowledgeDocumentColumn } from './columns'
import { KnowledgeDocumentItem, TrainStatus } from './knowledge-type'
import { KnowledgeDocumentItem, TrainStatus } from './types.d'
import {
fetchBatchDelKnowledgeDocument,
fetchDelKnowledgeDocument,
......
......@@ -4,7 +4,7 @@ import { useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { Search } from '@icon-park/vue-next'
import { createKnowledgeColumn } from './columns.tsx'
import { KnowledgeItem } from './knowledge-type.ts'
import { KnowledgeItem } from './types.d'
import CustomPagination from '@/components/custom-pagination/custom-pagination.vue'
import useTableScrollY from '@/composables/useTableScrollY.ts'
import { usePagination } from '@/composables/usePagination.ts'
......
......@@ -47,6 +47,7 @@ const assistantAvatar = computed(() => {
preview-disabled
:width="32"
:height="32"
object-fit="cover"
class="mr-2 mt-1.5 h-8 w-8 rounded-full"
/>
......
......@@ -28,7 +28,7 @@ function handleSelectFeaturedQuestion(featuredQuestion: string) {
<template>
<div class="flex w-full flex-1 flex-col px-5">
<div class="mb-5 mt-[60px] flex w-full justify-center sm:pt-[120px]">
<img :src="agentAvatar" class="h-[72px] w-[72px] rounded-xl" />
<img :src="agentAvatar" class="h-[72px] w-[72px] rounded-xl object-cover" />
</div>
<div class="flex flex-col items-center justify-center">
......
......@@ -49,7 +49,7 @@ function handleToLogin() {
class="hover:text-theme-color mr-5 cursor-pointer outline-none"
@click="handleBack"
/>
<img :src="agentApplicationConfig.baseInfo.agentAvatar" class="mr-5 h-10 w-10 rounded-md" />
<img :src="agentApplicationConfig.baseInfo.agentAvatar" class="mr-5 h-10 w-10 rounded-md object-cover" />
<div class="flex flex-col items-start justify-center">
<span class="mb-1 line-clamp-1 max-w-[200px] break-all">{{ agentApplicationConfig.baseInfo.agentTitle }}</span>
......
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