Commit ea73ba1e authored by tyyin lan's avatar tyyin lan

Merge branch 'shirlyn'

parents ae77e323 473cbb27
import { request } from '@/utils/request'
export function fetchGetAgentApplicationList<T>(payload: object) {
return request.post<T>('/bizAgentApplicationMallRest/getList.json', payload)
}
export function fetchCollectOrCancelAgentApplication<T>(id: number | undefined) {
return request.post<T>(`/bizAgentApplicationMallRest/collectOrCancelAgentInMall.json?id=${id}`)
}
export function fetchGetMallCategoryList<T>() {
return request.post<T>('/bizAgentApplicationMallRest/getMallCategoryList.json')
}
import { request } from '@/utils/request'
export function fetchGetLongMemoryList<T>(agentId: string) {
return request.post<T>(`/agentApplicationInfoRest/getLongMemoryList.json?agentId=${agentId}`)
}
export function fetchDeleteLongMemoryByKey<T>(agentId: string, timestamp: string) {
return request.post<T>(
`/agentApplicationInfoRest/deleteLongMemoryByKey.json?agentId=${agentId}&timestamp=${timestamp}`,
)
}
export function fetchDeleteAllLongMemory<T>(agentId: string) {
return request.post<T>(`/agentApplicationInfoRest/deleteLongMemory.json?agentId=${agentId}`)
}
export function fetchGetMemoryVariableList<T>(agentId: string) {
return request.post<T>(`/agentApplicationInfoRest/getVariableList.json?agentId=${agentId}`)
}
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { computed, h, ref, watchEffect } from 'vue' import { computed, h, ref, watchEffect } from 'vue'
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { Plus } from '@icon-park/vue-next' import { Plus, Commodity } from '@icon-park/vue-next'
import type { MenuOption } from 'naive-ui' import type { MenuOption } from 'naive-ui'
import CustomIcon from '@/components/custom-icon/custom-icon.vue' import CustomIcon from '@/components/custom-icon/custom-icon.vue'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
...@@ -31,6 +31,18 @@ const menuOptions = computed<MenuOption[]>(() => { ...@@ -31,6 +31,18 @@ const menuOptions = computed<MenuOption[]>(() => {
key: 'PersonalSpace', key: 'PersonalSpace',
icon: () => h('i', { class: 'iconfont icon-personal' }), icon: () => h('i', { class: 'iconfont icon-personal' }),
}, },
{
type: 'group',
label: () => h('div', {}, t('router_title_module.explore')),
key: 'Dialogue',
children: [
{
label: () => h('div', {}, t('router_title_module.application_square')),
key: 'ApplicationsSquare',
icon: () => h(Commodity, { theme: 'outline', size: '18', fill: '#333' }),
},
],
},
] ]
}) })
......
...@@ -67,8 +67,12 @@ common_module: ...@@ -67,8 +67,12 @@ common_module:
removal_failed: '下架失败' removal_failed: '下架失败'
collect_successfully: '收藏成功' collect_successfully: '收藏成功'
collect_unsubscribed: '已取消收藏' collect_unsubscribed: '已取消收藏'
cancel: '取消'
preservation: '保存' preservation: '保存'
open: '开'
close: '关'
delete_tip_title: '删除提示'
wipe_data: '清空数据'
delete_all_tip_title: '清空数据提示'
dialogue_module: dialogue_module:
continue_question_message: '你可以继续提问' continue_question_message: '你可以继续提问'
...@@ -144,6 +148,8 @@ router_title_module: ...@@ -144,6 +148,8 @@ router_title_module:
knowledge_document_list: '知识库文档列表' knowledge_document_list: '知识库文档列表'
knowledge_document_detail: '知识库文档详情' knowledge_document_detail: '知识库文档详情'
multi_model_dialogue: '多模型调试' multi_model_dialogue: '多模型调试'
explore: '探索'
application_square: '应用广场'
personal_space_module: personal_space_module:
title: '个人空间' title: '个人空间'
...@@ -161,7 +167,6 @@ personal_space_module: ...@@ -161,7 +167,6 @@ personal_space_module:
channel_popover_text: '查看发布详情' channel_popover_text: '查看发布详情'
agent_copy: '的副本' agent_copy: '的副本'
empty_agent_list: '暂无应用' empty_agent_list: '暂无应用'
search_empty_agent_list: '没有搜索到相关内容'
delete_agent_dialog_title: '确定要删除选中的应用吗?' delete_agent_dialog_title: '确定要删除选中的应用吗?'
delete_agent_dialog_content: '删除后,如需再次使用,请重新创建' delete_agent_dialog_content: '删除后,如需再次使用,请重新创建'
remove_applications_dialog_title: '确定要下架应用吗?' remove_applications_dialog_title: '确定要下架应用吗?'
...@@ -244,6 +249,12 @@ personal_space_module: ...@@ -244,6 +249,12 @@ personal_space_module:
memory_variable_action_copy: '复制名称' memory_variable_action_copy: '复制名称'
variable_name: '变量名称' variable_name: '变量名称'
variable_value: '变量值' variable_value: '变量值'
memory_fragment: '记忆片段'
memory_fragment_message: '开启记忆片段功能,应用将根据对话内容存储用户提及的信息片段,并依据记忆片段答复。下面以「面试助手」为例:'
memory_fragment_content: '记录聊天对话中所有关于用户信息、用户偏好、用户计划的记忆片段。'
memory_variable_delete_tip_content: '删除后不可撤销。如应用已发布,更新发布后该应用的用户无法使用该记忆变量,是否继续?'
memory_fragment_delete_all_tip_content: '数据清空后不可撤销,确定要全部清空吗?'
memory_fragment_delete_row_tip_content: '数据删除后不可撤销,确定要删除吗?'
memory_variable_modal: memory_variable_modal:
edit_memory_variable: '编辑记忆变量' edit_memory_variable: '编辑记忆变量'
...@@ -259,6 +270,9 @@ personal_space_module: ...@@ -259,6 +270,9 @@ personal_space_module:
default_value_placeholder: '请输入' default_value_placeholder: '请输入'
name_placeholder: '请输入名称' name_placeholder: '请输入名称'
add_variable: '新增变量' add_variable: '新增变量'
memory_variable_add_now: '立即添加'
none_memory_variable: '暂无记忆变量'
add_variable_message: '添加记忆变量,更好地记录用户特征、用户信息'
memory_variable_rules: memory_variable_rules:
name_not_null: '请输入名称' name_not_null: '请输入名称'
...@@ -388,3 +402,8 @@ multi_model_dialogue_module: ...@@ -388,3 +402,8 @@ multi_model_dialogue_module:
please_select_model_first: '请先选择模型' please_select_model_first: '请先选择模型'
replace_configuration_tip: '是否将该模型的配置覆盖到原来的配置项上' replace_configuration_tip: '是否将该模型的配置覆盖到原来的配置项上'
open_new_conversation: '已开启新会话' open_new_conversation: '已开启新会话'
applications_square_module:
create_application_btn_text: '创建应用'
all_application_btn_text: '所有应用'
immediate_use_btn_text: '立即使用'
...@@ -67,8 +67,12 @@ common_module: ...@@ -67,8 +67,12 @@ common_module:
removal_failed: '下架失敗' removal_failed: '下架失敗'
collect_successfully: '收藏成功' collect_successfully: '收藏成功'
collect_unsubscribed: '已取消收藏' collect_unsubscribed: '已取消收藏'
cancel: '取消'
preservation: '保存' preservation: '保存'
open: '開'
close: '關'
delete_tip_title: '删除提示'
wipe_data: '清空數據'
delete_all_tip_title: '清空數據提示'
dialogue_module: dialogue_module:
continue_question_message: '你可以繼續提問' continue_question_message: '你可以繼續提問'
...@@ -144,6 +148,8 @@ router_title_module: ...@@ -144,6 +148,8 @@ router_title_module:
knowledge_document_list: '知識庫文檔列表' knowledge_document_list: '知識庫文檔列表'
knowledge_document_detail: '知識庫文檔詳情' knowledge_document_detail: '知識庫文檔詳情'
multi_model_dialogue: '多模型調試' multi_model_dialogue: '多模型調試'
explore: '探索'
applications-square: '應用廣場'
personal_space_module: personal_space_module:
title: '個人空間' title: '個人空間'
...@@ -161,7 +167,6 @@ personal_space_module: ...@@ -161,7 +167,6 @@ personal_space_module:
channel_popover_text: '查看發佈詳情' channel_popover_text: '查看發佈詳情'
agent_copy: '的副本' agent_copy: '的副本'
empty_agent_list: '暫無應用' empty_agent_list: '暫無應用'
search_empty_agent_list: '沒有蒐索到相關內容'
delete_agent_dialog_title: '確定要刪除選中的應用嗎?' delete_agent_dialog_title: '確定要刪除選中的應用嗎?'
delete_agent_dialog_content: '刪除後,如需再次使用,請重新創建' delete_agent_dialog_content: '刪除後,如需再次使用,請重新創建'
remove_applications_dialog_title: '確定要下架應用嗎?' remove_applications_dialog_title: '確定要下架應用嗎?'
...@@ -237,13 +242,19 @@ personal_space_module: ...@@ -237,13 +242,19 @@ personal_space_module:
add_memory_variable: '添加記憶變數' add_memory_variable: '添加記憶變數'
memory_variable: '記憶變量' memory_variable: '記憶變量'
memory_message: memory_message:
'开发者可根据应用设定记忆变量,应用用户在对话过程中可以录入变量内容,每个变量支持存储一维、单个数据 '開發者可根據應用設定記憶變數,應用用戶在對話過程中可以錄入變數內容,每個變數支持存儲一維、單個數據
对话过程中,应用将依据存储的变量值进行答复。下面以「旅游助手」为例:' 對話過程中,應用將依據存儲的變數值進行答覆。 下面以「旅遊助手」為例:'
memory_variable_message: '记录聊天对话中的一维、单个的应用信息或用户信息,能让智能体回答更加个性化。' memory_variable_message: '記錄聊天對話中的一維、單個的應用資訊或用戶資訊,能讓智慧體回答更加個性化。'
memory_variable_action_edit: '編輯' memory_variable_action_edit: '編輯'
memory_variable_action_copy: '複製名稱' memory_variable_action_copy: '複製名稱'
variable_name: '变量名稱' variable_name: '变量名稱'
variable_value: '变量值' variable_value: '变量值'
memory_fragment: '記憶片段'
memory_fragment_message: '開啟記憶片段功能,應用將根據對話內容存儲用戶提及的資訊片段,並依據記憶片段答覆。 下面以「面試助手」為例'
memory_fragment_content: '記錄聊天對話中所有關於用戶資訊、用戶偏好、用戶計畫的記憶片段。'
memory_variable_delete_tip_content: '删除後不可撤銷。 如應用已發佈,更新發佈後該應用的用戶無法使用該記憶變數,是否繼續?'
memory_fragment_delete_all_tip_content: '數據清空後不可撤銷,確定要全部清空嗎?'
memory_fragment_delete_row_tip_content: '數據删除後不可撤銷,確定要删除嗎?'
memory_variable_modal: memory_variable_modal:
edit_memory_variable: '編輯記憶變數' edit_memory_variable: '編輯記憶變數'
...@@ -259,6 +270,9 @@ personal_space_module: ...@@ -259,6 +270,9 @@ personal_space_module:
default_value_placeholder: '請輸入' default_value_placeholder: '請輸入'
name_placeholder: '請輸入名稱' name_placeholder: '請輸入名稱'
add_variable: '新增變數' add_variable: '新增變數'
memory_variable_add_now: '立即添加'
none_memory_variable: '暫無記憶變數'
add_variable_message: '添加記憶變數,更好地記錄用戶特徵、用戶資訊'
memory_variable_rules: memory_variable_rules:
name_not_null: '請求輸入名稱' name_not_null: '請求輸入名稱'
...@@ -388,3 +402,9 @@ multi_model_dialogue_module: ...@@ -388,3 +402,9 @@ multi_model_dialogue_module:
please_select_model_first: '請先選擇模型' please_select_model_first: '請先選擇模型'
replace_configuration_tip: '是否將該模型的配置覆蓋到原來的配置項上' replace_configuration_tip: '是否將該模型的配置覆蓋到原來的配置項上'
open_new_conversation: '已開啓新會話' open_new_conversation: '已開啓新會話'
applications_square_module:
title: '應用廣場'
create_application_btn_text: '創建應用'
all_application_btn_text: '所有應用'
immediate_use_btn_text: '立即使用'
import { type RouteRecordRaw } from 'vue-router'
export default [
{
path: '/explore',
name: 'Explore',
meta: {
rank: 1001,
title: 'router_title_module.explore',
icon: 'mingcute:user-2-line',
belong: 'applications-square',
},
component: () => import('@/layout/index.vue'),
redirect: '/personalSpaceLayout',
children: [
{
path: '/applications-square',
name: 'ApplicationsSquare',
meta: {
rank: 1001,
title: 'router_title_module.applications-square',
belong: 'ApplicationsSquare',
},
component: () => import('@/views/applications-square/applications-square.vue'),
},
],
},
] as RouteRecordRaw[]
...@@ -18,6 +18,7 @@ export function defaultPersonalAppConfigState(): PersonalAppConfigState { ...@@ -18,6 +18,7 @@ export function defaultPersonalAppConfigState(): PersonalAppConfigState {
continuousQuestionSystem: '', continuousQuestionSystem: '',
continuousQuestionTurn: 3, continuousQuestionTurn: 3,
variableStructure: [], variableStructure: [],
isLongMemory: 'N',
}, },
knowledgeConfig: { knowledgeConfig: {
knowledgeIds: [], knowledgeIds: [],
......
...@@ -4,6 +4,7 @@ export interface VariableStructureItem { ...@@ -4,6 +4,7 @@ export interface VariableStructureItem {
} }
export interface PersonalAppConfigState { export interface PersonalAppConfigState {
agentType?: string
baseInfo: { baseInfo: {
agentId: string //应用ID agentId: string //应用ID
agentTitle: string //应用标题 agentTitle: string //应用标题
...@@ -11,14 +12,18 @@ export interface PersonalAppConfigState { ...@@ -11,14 +12,18 @@ export interface PersonalAppConfigState {
agentDesc: string //应用描述 agentDesc: string //应用描述
agentSystem: string //角色指令 agentSystem: string //角色指令
agentPublishStatus: 'draft' | 'publish' //发布状态 draft-草稿 publish-发布 agentPublishStatus: 'draft' | 'publish' //发布状态 draft-草稿 publish-发布
memberId: number
} }
clickNumber?: number
collectNumber?: number
commConfig: { commConfig: {
preamble: string //开场白 preamble: string //开场白
featuredQuestions: string[] //推荐问 featuredQuestions: string[] //推荐问
continuousQuestionStatus: 'default' | 'close' //追问状态 continuousQuestionStatus: 'default' | 'close' //追问状态
continuousQuestionSystem: string // 追问提示词 customizable时必填 continuousQuestionSystem: string // 追问提示词 customizable时必填
continuousQuestionTurn: number // 追问轮次 1-5 customizable时必填 continuousQuestionTurn: number // 追问轮次 1-5 customizable时必填
variableStructure: VariableStructureItem[] variableStructure: VariableStructureItem[] | null
isLongMemory: string
} }
knowledgeConfig: { knowledgeConfig: {
knowledgeIds: string[] //知识库ID knowledgeIds: string[] //知识库ID
...@@ -29,8 +34,11 @@ export interface PersonalAppConfigState { ...@@ -29,8 +34,11 @@ export interface PersonalAppConfigState {
communicationTurn: number //参考对话轮次 0-100 communicationTurn: number //参考对话轮次 0-100
temperature: number //多样性 0-1.00 temperature: number //多样性 0-1.00
} }
popularity?: number
modifiedTime: Date modifiedTime: Date
id?: number
isCollect: string isCollect: string
isSale: string isSale: string
isCopy?: string
agentPublishId: number agentPublishId: number
} }
This diff is collapsed.
...@@ -25,6 +25,7 @@ const continuousQuestionStatus = ref<'default' | 'close'>(personalAppConfigStore ...@@ -25,6 +25,7 @@ const continuousQuestionStatus = ref<'default' | 'close'>(personalAppConfigStore
const continuousQuestionList = ref<string[]>([]) const continuousQuestionList = ref<string[]>([])
const isShowMemoryPreviewModal = ref(false) const isShowMemoryPreviewModal = ref(false)
const selectedMemoryTabName = ref('memoryVariable')
function handleAddMessageItem(messageItem: ConversationMessageItem) { function handleAddMessageItem(messageItem: ConversationMessageItem) {
messageList.value.push(messageItem) messageList.value.push(messageItem)
...@@ -83,7 +84,8 @@ function handleTurnMultiModelDialogue() { ...@@ -83,7 +84,8 @@ function handleTurnMultiModelDialogue() {
}) })
} }
function handleMemoryVariable() { function handleOpenMemoryPreviewModal(MemoryTabName: string) {
selectedMemoryTabName.value = MemoryTabName
isShowMemoryPreviewModal.value = true isShowMemoryPreviewModal.value = true
} }
</script> </script>
...@@ -106,10 +108,16 @@ function handleMemoryVariable() { ...@@ -106,10 +108,16 @@ function handleMemoryVariable() {
<span>{{ t('common_module.multi_model_debug') }}</span> <span>{{ t('common_module.multi_model_debug') }}</span>
</div> </div>
<div v-show="personalAppConfigStore.commConfig.variableStructure !== null" class="cursor-pointer"> <div
v-show="
personalAppConfigStore.commConfig.variableStructure !== null ||
personalAppConfigStore.commConfig.isLongMemory === 'Y'
"
class="cursor-pointer"
>
<n-popover placement="bottom" trigger="hover" class="p-[4px]!" :show-arrow="false"> <n-popover placement="bottom" trigger="hover" class="p-[4px]!" :show-arrow="false">
<template #trigger> <template #trigger>
<div class="flex items-center justify-center px-5 text-[14px]"> <div class="flex items-center justify-center pl-5 text-[14px]">
<Brain theme="outline" size="16" fill="#333" /> <Brain theme="outline" size="16" fill="#333" />
<div class="mx-[4px]"> <div class="mx-[4px]">
{{ t('personal_space_module.agent_module.agent_setting_module.agent_config_module.memory') }} {{ t('personal_space_module.agent_module.agent_setting_module.agent_config_module.memory') }}
...@@ -121,10 +129,17 @@ function handleMemoryVariable() { ...@@ -121,10 +129,17 @@ function handleMemoryVariable() {
<div <div
v-show="personalAppConfigStore.commConfig.variableStructure !== null" v-show="personalAppConfigStore.commConfig.variableStructure !== null"
class="cursor-pointer px-[8px] py-[5px] hover:bg-[#f2f5f9]" class="cursor-pointer px-[8px] py-[5px] hover:bg-[#f2f5f9]"
@click="handleMemoryVariable" @click="handleOpenMemoryPreviewModal('memoryVariable')"
> >
{{ t('personal_space_module.agent_module.agent_setting_module.agent_config_module.memory_variable') }} {{ t('personal_space_module.agent_module.agent_setting_module.agent_config_module.memory_variable') }}
</div> </div>
<div
v-show="personalAppConfigStore.commConfig.isLongMemory === 'Y'"
class="cursor-pointer px-[8px] py-[5px] hover:bg-[#f2f5f9]"
@click="handleOpenMemoryPreviewModal('memoryFragment')"
>
{{ t('personal_space_module.agent_module.agent_setting_module.agent_config_module.memory_fragment') }}
</div>
</div> </div>
</n-popover> </n-popover>
</div> </div>
...@@ -160,7 +175,7 @@ function handleMemoryVariable() { ...@@ -160,7 +175,7 @@ function handleMemoryVariable() {
@update-continuous-question-status="handleUpdateContinueQuestionStatus" @update-continuous-question-status="handleUpdateContinueQuestionStatus"
/> />
<MemoryPreviewModal v-model="isShowMemoryPreviewModal" /> <MemoryPreviewModal v-model="isShowMemoryPreviewModal" :data="selectedMemoryTabName" />
</div> </div>
</template> </template>
......
...@@ -4,6 +4,7 @@ import { nextTick, ref, shallowReadonly, watch } from 'vue' ...@@ -4,6 +4,7 @@ import { nextTick, ref, shallowReadonly, watch } from 'vue'
import { usePersonalAppConfigStore } from '@/store/modules/personal-app-config' import { usePersonalAppConfigStore } from '@/store/modules/personal-app-config'
import { FormInst, FormItemRule, FormRules } from 'naive-ui' import { FormInst, FormItemRule, FormRules } from 'naive-ui'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { cloneDeep } from 'lodash-es'
export interface MemoryVariableForm { export interface MemoryVariableForm {
key: string key: string
...@@ -66,18 +67,28 @@ watch( ...@@ -66,18 +67,28 @@ watch(
() => personalAppConfigStore.commConfig.variableStructure, () => personalAppConfigStore.commConfig.variableStructure,
(newValue) => { (newValue) => {
if (newValue !== null) { if (newValue !== null) {
memoryVariableTable.value = JSON.parse(JSON.stringify(newValue)) memoryVariableTable.value = cloneDeep(newValue)
} else {
memoryVariableTable.value = []
} }
}, },
{ immediate: true }, { immediate: true },
) )
function handlePreviewModalClose(refresh = false) { function handleMemoryPreviewModalClose(refresh = false) {
isShowMemoryVariableModal.value = false isShowMemoryVariableModal.value = false
memoryVariableTable.value = refresh memoryVariableTable.value = refresh
? memoryVariableTable.value ? memoryVariableTable.value
: JSON.parse(JSON.stringify(personalAppConfigStore.commConfig.variableStructure)) : personalAppConfigStore.commConfig.variableStructure
? cloneDeep(personalAppConfigStore.commConfig.variableStructure)
: []
if (Array.isArray(memoryVariableTable.value)) {
memoryVariableTable.value = memoryVariableTable.value.filter((item) => item.key) memoryVariableTable.value = memoryVariableTable.value.filter((item) => item.key)
} else {
memoryVariableTable.value = []
}
} }
function handleMemoryVariableFormSave() { function handleMemoryVariableFormSave() {
...@@ -99,7 +110,7 @@ function handleMemoryVariableFormSave() { ...@@ -99,7 +110,7 @@ function handleMemoryVariableFormSave() {
if (isAllValid) { if (isAllValid) {
personalAppConfigStore.commConfig.variableStructure = memoryVariableTable.value personalAppConfigStore.commConfig.variableStructure = memoryVariableTable.value
handlePreviewModalClose(true) handleMemoryPreviewModalClose(true)
window.$message.success(t('common_module.save_success_message')) window.$message.success(t('common_module.save_success_message'))
} else { } else {
window.$message.error(t('common_module.save_fail_message')) window.$message.error(t('common_module.save_fail_message'))
...@@ -113,9 +124,9 @@ function handleAddMemoryVariableItem() { ...@@ -113,9 +124,9 @@ function handleAddMemoryVariableItem() {
nextTick(() => { nextTick(() => {
const newIndex = memoryVariableTable.value.length - 1 const newIndex = memoryVariableTable.value.length - 1
const input = memoryVariableInputRefs.value[newIndex] const inputEl = memoryVariableInputRefs.value[newIndex]
if (input) { if (inputEl) {
input.focus() inputEl.focus()
} }
}) })
} }
...@@ -149,7 +160,13 @@ defineExpose({ ...@@ -149,7 +160,13 @@ defineExpose({
) )
}}</span }}</span
> >
<Close theme="outline" size="18" fill="#00000073" class="cursor-pointer" @click="handlePreviewModalClose()" /> <Close
theme="outline"
size="18"
fill="#00000073"
class="cursor-pointer"
@click="handleMemoryPreviewModalClose()"
/>
</div> </div>
<div <div
class="mb-[12px] mt-[16px] flex items-center justify-center rounded-[4px] bg-[#FFF4E6] px-[15px] pb-[3px] pt-[4px]" class="mb-[12px] mt-[16px] flex items-center justify-center rounded-[4px] bg-[#FFF4E6] px-[15px] pb-[3px] pt-[4px]"
...@@ -159,7 +176,7 @@ defineExpose({ ...@@ -159,7 +176,7 @@ defineExpose({
theme="multi-color" theme="multi-color"
size="14" size="14"
:fill="['#ff9326', '#ff9326', '#FFF', '#43CCF8']" :fill="['#ff9326', '#ff9326', '#FFF', '#43CCF8']"
:stroke-width="2" :stroke-width="3"
/> />
</div> </div>
<div class="text-[14px] text-[#151B26]"> <div class="text-[14px] text-[#151B26]">
...@@ -199,7 +216,7 @@ defineExpose({ ...@@ -199,7 +216,7 @@ defineExpose({
</div> </div>
<n-popover trigger="hover" class="p-[12px]!"> <n-popover trigger="hover" class="p-[12px]!">
<template #trigger> <template #trigger>
<Help theme="outline" size="15" fill="#333" :stroke-width="2" class="mt-[2px]" /> <Help theme="outline" size="15" fill="#333" :stroke-width="3" class="mt-[2px]" />
</template> </template>
<div class="mb-[8px] w-[226px]"> <div class="mb-[8px] w-[226px]">
{{ {{
...@@ -227,7 +244,7 @@ defineExpose({ ...@@ -227,7 +244,7 @@ defineExpose({
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody v-if="memoryVariableTable.length !== 0">
<tr v-for="(item, index) in memoryVariableTable" :key="index"> <tr v-for="(item, index) in memoryVariableTable" :key="index">
<td class="pl-[12px]"> <td class="pl-[12px]">
<n-form <n-form
...@@ -292,14 +309,14 @@ defineExpose({ ...@@ -292,14 +309,14 @@ defineExpose({
/> />
</n-form-item> </n-form-item>
</td> </td>
<td class="ml-[15px] mt-[10px] flex pl-[12px] pt-[10px]"> <td class="ml-[15px] mt-[5px] flex pl-[12px] pt-[10px]">
<n-tooltip trigger="hover"> <n-tooltip trigger="hover">
<template #trigger> <template #trigger>
<Delete <Delete
theme="outline" theme="outline"
size="15" size="15"
fill="#333" fill="#333"
:stroke-width="2" :stroke-width="3"
class="mt-[2px] cursor-pointer" class="mt-[2px] cursor-pointer"
@click="handleDeleteMemoryVariableRow(item)" @click="handleDeleteMemoryVariableRow(item)"
/> />
...@@ -309,11 +326,49 @@ defineExpose({ ...@@ -309,11 +326,49 @@ defineExpose({
</td> </td>
</tr> </tr>
</tbody> </tbody>
<tbody v-else>
<tr>
<td colspan="3">
<div class="flex h-[286px] flex-col items-center">
<img src="@/assets/images/empty.png" width="235px" height="160px" />
<div class="text-[18px]">
{{
t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.memory_variable_modal.none_memory_variable',
)
}}
</div>
<div class="mt-[12px] text-[14px] text-[#84868c]">
{{
t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.memory_variable_modal.add_variable_message',
)
}}
</div>
<div
class="text-theme-color mt-[6px] flex w-[78px] cursor-pointer"
@click="handleAddMemoryVariableItem"
>
<Plus theme="outline" size="22" :stroke-width="3" class="text-theme-color" />
<span>{{
t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.memory_variable_modal.memory_variable_add_now',
)
}}</span>
</div>
</div>
</td>
</tr>
</tbody>
</table> </table>
</div> </div>
</n-scrollbar> </n-scrollbar>
<div class="text-theme-color mt-[16px] flex w-[78px] cursor-pointer" @click="handleAddMemoryVariableItem"> <div
<Plus theme="outline" size="22" :stroke-width="2" class="text-theme-color" /> v-show="memoryVariableTable.length !== 0"
class="text-theme-color mt-[16px] flex w-[78px] cursor-pointer"
@click="handleAddMemoryVariableItem"
>
<Plus theme="outline" size="22" :stroke-width="3" class="text-theme-color" />
<span>{{ <span>{{
t( t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.memory_variable_modal.add_variable', 'personal_space_module.agent_module.agent_setting_module.agent_config_module.memory_variable_modal.add_variable',
...@@ -323,7 +378,7 @@ defineExpose({ ...@@ -323,7 +378,7 @@ defineExpose({
<div class="mt-[24px] flex justify-end"> <div class="mt-[24px] flex justify-end">
<button <button
class="hover:text-theme-color hover:border-theme-color !mr-[12px] box-content !h-[38px] !w-[74px] cursor-pointer rounded-[6px] border-[1px] border-solid border-[#dde3f0] px-[10px] outline-none transition-all duration-300 hover:border-[theme-color]" class="hover:text-theme-color hover:border-theme-color !mr-[12px] box-content !h-[38px] !w-[74px] cursor-pointer rounded-[6px] border-[1px] border-solid border-[#dde3f0] px-[10px] outline-none transition-all duration-300 hover:border-[theme-color]"
@click="handlePreviewModalClose()" @click="handleMemoryPreviewModalClose()"
> >
{{ t('common_module.cancel_btn_text') }} {{ t('common_module.cancel_btn_text') }}
</button> </button>
......
<script setup lang="ts"> <script setup lang="ts">
import { fetchSalePublishApplication } from '@/apis/agent-application' import { fetchSalePublishApplication } from '@/apis/agent-application'
import { fetchGetMallCategoryList } from '@/apis/application-square'
import { PersonalAppConfigState } from '@/store/types/personal-app-config' import { PersonalAppConfigState } from '@/store/types/personal-app-config'
import { Close, Help, Notes, CheckSmall } from '@icon-park/vue-next' import { Close, Help, Notes, CheckSmall } from '@icon-park/vue-next'
import { ref, watch } from 'vue' import { ref, watch } from 'vue'
...@@ -23,64 +24,11 @@ const saleApplicationsId = ref(props.data.agentPublishId) ...@@ -23,64 +24,11 @@ const saleApplicationsId = ref(props.data.agentPublishId)
const isClassifyError = ref(false) const isClassifyError = ref(false)
const applicationsClassify = [ const applicationsClassify = ref<string[]>([])
{
value: 'mediaEntertainment', ;(function () {
label: t( handleGetMallCategoryList()
'personal_space_module.agent_module.agent_setting_module.agent_sale_module.application_classify.media_entertainment', })()
),
},
{
value: 'educationTraining',
label: t(
'personal_space_module.agent_module.agent_setting_module.agent_sale_module.application_classify.education_training',
),
},
{
value: 'businessServices',
label: t(
'personal_space_module.agent_module.agent_setting_module.agent_sale_module.application_classify.business_services',
),
},
{
value: 'medicalHealth',
label: t(
'personal_space_module.agent_module.agent_setting_module.agent_sale_module.application_classify.medical_health',
),
},
{
value: 'efficiencyTools',
label: t(
'personal_space_module.agent_module.agent_setting_module.agent_sale_module.application_classify.efficiency_tools',
),
},
{
value: 'officePersonnel',
label: t(
'personal_space_module.agent_module.agent_setting_module.agent_sale_module.application_classify.office_personnel',
),
},
{
value: 'marketingCommerce',
label: t(
'personal_space_module.agent_module.agent_setting_module.agent_sale_module.application_classify.marketing_commerce',
),
},
{
value: 'finance',
label: t('personal_space_module.agent_module.agent_setting_module.agent_sale_module.application_classify.finance'),
},
{
value: 'law',
label: t('personal_space_module.agent_module.agent_setting_module.agent_sale_module.application_classify.law'),
},
{
value: 'cultureTourism',
label: t(
'personal_space_module.agent_module.agent_setting_module.agent_sale_module.application_classify.culture_tourism',
),
},
]
watch( watch(
() => checkedClassifyValue.value, () => checkedClassifyValue.value,
...@@ -127,6 +75,13 @@ function handleApplicationReleaseBtn() { ...@@ -127,6 +75,13 @@ function handleApplicationReleaseBtn() {
function handleIsCopySwitchUpdateValue(value: string) { function handleIsCopySwitchUpdateValue(value: string) {
isCopy.value = value isCopy.value = value
} }
function handleGetMallCategoryList() {
fetchGetMallCategoryList().then((res) => {
if (res.code !== 0) return
applicationsClassify.value = res.data as string[]
})
}
</script> </script>
<template> <template>
...@@ -163,22 +118,22 @@ function handleIsCopySwitchUpdateValue(value: string) { ...@@ -163,22 +118,22 @@ function handleIsCopySwitchUpdateValue(value: string) {
</div> </div>
<div class="text-[#f33e3e]">*</div> <div class="text-[#f33e3e]">*</div>
</div> </div>
<div class="flex flex-wrap justify-between"> <div class="flex flex-wrap">
<button <button
v-for="classify in applicationsClassify" v-for="classify in applicationsClassify"
:key="classify.value" :key="classify"
:class="['classify-radio-button', { active: checkedClassifyValue === classify.value }]" :class="['classify-radio-button', { active: checkedClassifyValue === classify }]"
class="relative mb-[8px] mr-[4px] h-[26px] cursor-pointer rounded-[6px] border-[1px] border-[#edeef7] bg-[#edeef7] px-[8px] text-[12px]" class="relative mb-[8px] mr-[8px] h-[26px] cursor-pointer rounded-[6px] border-[1px] border-[#edeef7] bg-[#edeef7] px-[8px] text-[12px]"
@click="checkedClassifyValue = classify.value" @click="checkedClassifyValue = classify"
> >
<div <div
v-show="checkedClassifyValue === classify.value" v-show="checkedClassifyValue === classify"
class="bg-theme-color absolute left-0 top-[-1px] h-[14px] w-[14px] rounded-[3px]" class="bg-theme-color absolute left-0 top-[-1px] h-[14px] w-[14px] rounded-[3px]"
style="clip-path: polygon(0 0, 100% 0, 0 100%)" style="clip-path: polygon(0 0, 100% 0, 0 100%)"
> >
<CheckSmall theme="outline" size="10" fill="#fff" /> <CheckSmall theme="outline" size="10" fill="#fff" />
</div> </div>
{{ classify.label }} {{ classify }}
</button> </button>
</div> </div>
<div class="mb-[10px] h-[16px] text-red-500"> <div class="mb-[10px] h-[16px] text-red-500">
...@@ -219,7 +174,7 @@ function handleIsCopySwitchUpdateValue(value: string) { ...@@ -219,7 +174,7 @@ function handleIsCopySwitchUpdateValue(value: string) {
class="hover:text-theme-color hover:border-theme-color !mr-[12px] box-content !h-[38px] !w-[74px] cursor-pointer rounded-[6px] border-[1px] border-solid border-[#dde3f0] px-[10px] outline-none transition-all duration-300 hover:border-[theme-color]" class="hover:text-theme-color hover:border-theme-color !mr-[12px] box-content !h-[38px] !w-[74px] cursor-pointer rounded-[6px] border-[1px] border-solid border-[#dde3f0] px-[10px] outline-none transition-all duration-300 hover:border-[theme-color]"
@click="handleApplicationsSaleSettingModalClose" @click="handleApplicationsSaleSettingModalClose"
> >
{{ t('common_module.cancel') }} {{ t('common_module.cancel_btn_text') }}
</button> </button>
<button <button
class="bg-theme-color !box-content !h-[38px] !w-[74px] cursor-pointer rounded-[6px] border-[1px] border-solid border-[#dde3f0] bg-[te] px-[10px] text-[#ffffff] transition-all duration-300 hover:bg-[#528EFF]" class="bg-theme-color !box-content !h-[38px] !w-[74px] cursor-pointer rounded-[6px] border-[1px] border-solid border-[#dde3f0] bg-[te] px-[10px] text-[#ffffff] transition-all duration-300 hover:bg-[#528EFF]"
......
...@@ -68,8 +68,12 @@ declare namespace I18n { ...@@ -68,8 +68,12 @@ declare namespace I18n {
removal_failed: string removal_failed: string
collect_successfully: string collect_successfully: string
collect_unsubscribed: string collect_unsubscribed: string
cancel: string
preservation: string preservation: string
open: string
close: string
delete_tip_title: string
wipe_data: string
delete_all_tip_title: string
dialogue_module: { dialogue_module: {
continue_question_message: string continue_question_message: string
...@@ -153,6 +157,8 @@ declare namespace I18n { ...@@ -153,6 +157,8 @@ declare namespace I18n {
knowledge_document_list: string knowledge_document_list: string
knowledge_document_detail: string knowledge_document_detail: string
multi_model_dialogue: string multi_model_dialogue: string
explore: string
applications_square: string
} }
personal_space_module: { personal_space_module: {
...@@ -173,7 +179,6 @@ declare namespace I18n { ...@@ -173,7 +179,6 @@ declare namespace I18n {
channel_popover_text: string channel_popover_text: string
agent_copy: string agent_copy: string
empty_agent_list: string empty_agent_list: string
search_empty_agent_list: string
delete_agent_dialog_title: string delete_agent_dialog_title: string
delete_agent_dialog_content: string delete_agent_dialog_content: string
} }
...@@ -244,6 +249,12 @@ declare namespace I18n { ...@@ -244,6 +249,12 @@ declare namespace I18n {
memory_variable_action_copy: string memory_variable_action_copy: string
variable_name: string variable_name: string
variable_value: string variable_value: string
memory_fragment: string
memory_fragment_message: string
memory_fragment_content: string
memory_variable_delete_tip_content: string
memory_fragment_delete_all_tip_content: string
memory_fragment_delete_row_tip_content: string
memory_variable_modal: { memory_variable_modal: {
edit_memory_variable: string edit_memory_variable: string
...@@ -259,6 +270,9 @@ declare namespace I18n { ...@@ -259,6 +270,9 @@ declare namespace I18n {
default_value_placeholder: string default_value_placeholder: string
name_placeholder: string name_placeholder: string
add_variable: string add_variable: string
memory_variable_add_now: string
none_memory_variable: string
add_variable_message: string
memory_variable_rules: { memory_variable_rules: {
name_not_null: string name_not_null: string
...@@ -403,5 +417,12 @@ declare namespace I18n { ...@@ -403,5 +417,12 @@ declare namespace I18n {
replace_configuration_tip: string replace_configuration_tip: string
open_new_conversation: string open_new_conversation: string
} }
applications_square_module: {
title: string
create_application_btn_text: string
all_application_btn_text: string
immediate_use_btn_text: string
}
} }
} }
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