Commit 07b499b7 authored by tyyin lan's avatar tyyin lan

Merge branch 'shirlyn' into 'master'

Merge branch 'shirlyn' into 'master'

See merge request !68
parents 754326f6 2e9d37f4
...@@ -162,3 +162,11 @@ export function fetchSalePublishApplication<T>(payload: object) { ...@@ -162,3 +162,11 @@ export function fetchSalePublishApplication<T>(payload: object) {
export function fetchRemoveSalePublishApplication<T>(agentPublishId: number) { export function fetchRemoveSalePublishApplication<T>(agentPublishId: number) {
return request.post<T>(`/bizAgentApplicationMallRest/unSaleAgentInMall.json?agentPublishId=${agentPublishId}`) return request.post<T>(`/bizAgentApplicationMallRest/unSaleAgentInMall.json?agentPublishId=${agentPublishId}`)
} }
/**
* * @param agentPublishId 发布应用表的id
* @returns 已上架应用信息
*/
export function fetchGetApplicationMallInfo<T>(agentId: string) {
return request.post<T>(`/bizAgentApplicationMallRest/getMallInfoByAgentId.json?agentId=${agentId}`)
}
...@@ -315,6 +315,12 @@ personal_space_module: ...@@ -315,6 +315,12 @@ personal_space_module:
access_page: 'Immediate access' access_page: 'Immediate access'
share_link: 'Share link' share_link: 'Share link'
copy_share_url_success_message: 'Link copy success, quick to share with your friends!' copy_share_url_success_message: 'Link copy success, quick to share with your friends!'
application_square_desc: 'The application will be displayed in the application square, and all users will be able to access and use the application you have created.'
modify_setting_btn: 'Modify Settings'
not_configured_btn: 'Not configured'
removal_prompt_title: 'Are you sure you want to remove the app from the app plaza'
removal_prompt_content: 'After removal, platform users will not be able to experience this application through the app plaza. If you need to relist it, please reconfigure it'
successfully_configured_published: 'Configuration successful, published to App Store'
agent_sale_module: agent_sale_module:
application_square_release_setting: 'The application plaza publishes the configuration' application_square_release_setting: 'The application plaza publishes the configuration'
......
...@@ -313,6 +313,12 @@ personal_space_module: ...@@ -313,6 +313,12 @@ personal_space_module:
access_page: '立即访问' access_page: '立即访问'
share_link: '分享链接' share_link: '分享链接'
copy_share_url_success_message: '链接复制成功,快分享给你的好友吧!' copy_share_url_success_message: '链接复制成功,快分享给你的好友吧!'
application_square_desc: '应用将在应用广场展示,所有用户将可以访问和使用你创建的应用'
modify_setting_btn: '修改设置'
not_configured_btn: '未配置'
removal_prompt_title: '确定要下架在应用广场的应用?'
removal_prompt_content: '下架后,平台用户将无法通过应用广场体验本应用,如需再次上架请重新配置。'
successfully_configured_published: '配置成功,已发布至应用广场'
agent_sale_module: agent_sale_module:
application_square_release_setting: '应用广场发布配置' application_square_release_setting: '应用广场发布配置'
......
...@@ -313,6 +313,12 @@ personal_space_module: ...@@ -313,6 +313,12 @@ personal_space_module:
access_page: '立即訪問' access_page: '立即訪問'
share_link: '分享鏈接' share_link: '分享鏈接'
copy_share_url_success_message: '鏈接複製成功,快分享給你的好友吧!' copy_share_url_success_message: '鏈接複製成功,快分享給你的好友吧!'
application_square_desc: '應用將在應用廣場展示,所有用戶將可以訪問和使用你創建的應用'
modify_setting_btn: '修改設置'
not_configured_btn: '未配置'
removal_prompt_title: '確定要下架在應用廣場的應用?'
removal_prompt_content: '下架後,平臺用戶將無法通過應用廣場體驗本應用,如需再次上架請重新配置。'
successfully_configured_published: '配置成功,已發布至應用廣場'
agent_sale_module: agent_sale_module:
application_square_release_setting: '應用廣場發佈配寘' application_square_release_setting: '應用廣場發佈配寘'
......
...@@ -10,6 +10,8 @@ export function defaultPersonalAppConfigState(): PersonalAppConfigState { ...@@ -10,6 +10,8 @@ export function defaultPersonalAppConfigState(): PersonalAppConfigState {
agentDesc: '', agentDesc: '',
agentSystem: '', agentSystem: '',
agentPublishStatus: 'draft', agentPublishStatus: 'draft',
memberId: 0,
publishTime: '',
}, },
commConfig: { commConfig: {
preamble: '', preamble: '',
...@@ -30,6 +32,7 @@ export function defaultPersonalAppConfigState(): PersonalAppConfigState { ...@@ -30,6 +32,7 @@ export function defaultPersonalAppConfigState(): PersonalAppConfigState {
temperature: 0.5, temperature: 0.5,
}, },
modifiedTime: new Date(), modifiedTime: new Date(),
createdTime: '',
isCollect: '', isCollect: '',
isSale: '', isSale: '',
agentPublishId: 1, agentPublishId: 1,
......
...@@ -13,6 +13,7 @@ export interface PersonalAppConfigState { ...@@ -13,6 +13,7 @@ export interface PersonalAppConfigState {
agentSystem: string //角色指令 agentSystem: string //角色指令
agentPublishStatus: 'draft' | 'publish' //发布状态 draft-草稿 publish-发布 agentPublishStatus: 'draft' | 'publish' //发布状态 draft-草稿 publish-发布
memberId: number memberId: number
publishTime: string
} }
clickNumber?: number clickNumber?: number
collectNumber?: number collectNumber?: number
...@@ -36,6 +37,7 @@ export interface PersonalAppConfigState { ...@@ -36,6 +37,7 @@ export interface PersonalAppConfigState {
} }
popularity?: number popularity?: number
modifiedTime: Date modifiedTime: Date
createdTime: string
id?: number id?: number
isCollect: string isCollect: string
isSale: string isSale: string
......
import { h } from 'vue'
import CustomIcon from '@/components/custom-icon/custom-icon.vue'
import { formatDateTime } from '@/utils/date-formatter'
import i18n from '@/locales'
const t = i18n.global.t
export function createChannelPublishColumn(handleChannelPublishTableAction: (actionType: string) => void) {
return [
{
title: () =>
h('span', {}, t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.channel')),
key: 'channel',
align: 'left',
width: 540,
render() {
return h(
'div',
{
style: {
display: 'flex',
justifyContent: 'flex-start',
alignItems: 'center',
},
},
{
default: () => [
h(CustomIcon, {
width: '24px',
icon: 'icon-park-solid:computer',
color: '#000DFF',
}),
h(
'div',
{
style: {
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'flex-start',
fontSize: '14px',
marginLeft: '12px',
},
},
{
default: () => [
h(
'span',
{},
t(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.web_channel_name',
),
),
h(
'span',
{
style: {
color: '#84868c',
},
},
t(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.web_channel_desc',
),
),
],
},
),
],
},
)
},
},
{
title: () => h('span', {}, t('common_module.status')),
key: 'agentPublishStatus',
align: 'left',
width: 220,
render() {
return h(
'div',
{
style: {
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'flex-start',
},
},
{
default: () => [
h(
'div',
{
style: {
background: '#34a853',
borderRadius: '4px',
padding: '2px 14px',
color: '#fff',
marginBottom: '4px',
},
},
t('common_module.published'),
),
h(
'span',
{
style: {
color: '#84868c',
},
},
{
default: () => formatDateTime(new Date()) + t('common_module.publish'),
},
),
],
},
)
},
},
{
title: () => h('span', {}, t('common_module.data_table_module.action')),
key: 'action',
align: 'left',
width: '460',
render() {
return h(
'div',
{
style: {
display: 'flex',
justifyContent: 'flex-start',
alignItems: 'center',
},
},
{
default: () => [
h(
'div',
{
style: {
display: 'flex',
justifyContent: 'flex-start',
alignItems: 'center',
fontSize: '14px',
padding: '4px 12px',
background: '#f7f7f9',
borderColor: '#000DFF',
color: '#000DFF',
},
className: 'cursor-pointer rounded-md border hover:opacity-80',
onClick: () => handleChannelPublishTableAction('accessPage'),
},
{
default: () => [
h(CustomIcon, { icon: 'lets-icons:view', style: { marginRight: '6px', fontSize: '16px' } }),
h(
'span',
{},
t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.access_page'),
),
],
},
),
h(
'div',
{
style: {
display: 'flex',
justifyContent: 'flex-start',
alignItems: 'center',
fontSize: '14px',
marginLeft: '16px',
padding: '4px 12px',
background: '#f7f7f9',
},
className: 'cursor-pointer hover:text-theme-color rounded-md border hover:border-theme-color',
onClick: () => handleChannelPublishTableAction('copyLink'),
},
{
default: () => [
h(CustomIcon, { icon: 'pepicons-pop:share-android-circle', style: { marginRight: '6px' } }),
h(
'span',
{},
t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.share_link'),
),
],
},
),
],
},
)
},
},
]
}
<script lang="ts" setup> <script lang="ts" setup>
import { reactive } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { createChannelPublishColumn } from '../columns' import { Computer, PreviewOpen, AllApplication, SettingOne } from '@icon-park/vue-next'
import useTableScrollY from '@/composables/useTableScrollY' import useTableScrollY from '@/composables/useTableScrollY'
import { copyToClip } from '@/utils/copy' import { copyToClip } from '@/utils/copy'
import { formatDateTime } from '@/utils/date-formatter'
import { ref, watch } from 'vue'
import { PersonalAppConfigState } from '@/store/types/personal-app-config'
import SaleApplicationsConfigurationModal from '../../personal-app/sale-applications-configuration-modal.vue'
import {
fetchGetApplicationInfo,
fetchGetApplicationMallInfo,
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
}
const { t } = useI18n() const { t } = useI18n()
const { pageContentWrapRef, tableContentY } = useTableScrollY() const { pageContentWrapRef, tableContentY } = useTableScrollY()
const router = useRouter() const router = useRouter()
const channelPublishList = reactive([ const isShowSaleApplicationsConfigurationModal = ref(false)
{ const saleApplicationsInfo = ref<PersonalAppConfigState>(defaultPersonalAppConfigState())
type: 'web', const personalAppConfigStore = usePersonalAppConfigStore()
const applicationMallInfo = ref<ApplicationMallInfo>({
agentId: '',
agentPublishId: 1,
categoryId: 1,
isCopy: '',
isSale: '',
launchTime: '',
})
watch(
() => saleApplicationsInfo.value,
(newValue) => {
saleApplicationsInfo.value = newValue
}, },
]) )
const columns = createChannelPublishColumn(handleClickChannelPublishTableAction) watch(
() => personalAppConfigStore.baseInfo,
(newValue) => {
personalAppConfigStore.baseInfo = newValue
if (personalAppConfigStore.baseInfo.agentId !== '') {
handleGetApplicationMallInfo()
handleGetApplicationInfo()
}
},
)
;(function () {
if (personalAppConfigStore.baseInfo.agentId !== '') {
handleGetApplicationMallInfo()
handleGetApplicationInfo()
}
})()
function handleClickChannelPublishTableAction(actionType: string) { function handleClickChannelPublishTableAction(actionType: string) {
switch (actionType) { switch (actionType) {
...@@ -28,6 +77,15 @@ function handleClickChannelPublishTableAction(actionType: string) { ...@@ -28,6 +77,15 @@ function handleClickChannelPublishTableAction(actionType: string) {
case 'copyLink': case 'copyLink':
handleCopyShareLink() handleCopyShareLink()
break break
case 'configuration':
handleConfigurationApplication(saleApplicationsInfo.value)
break
case 'modifySetting':
handleConfigurationApplication(saleApplicationsInfo.value, true)
break
case 'unSaleApplication':
handleUnSaleApplication()
break
} }
} }
...@@ -43,18 +101,243 @@ function handleCopyShareLink() { ...@@ -43,18 +101,243 @@ function handleCopyShareLink() {
t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.copy_share_url_success_message'), t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.copy_share_url_success_message'),
) )
} }
function handleConfigurationApplication(saleApplications: PersonalAppConfigState, isSale = false) {
if (isSale) {
saleApplicationsInfo.value.isCopy = applicationMallInfo.value.isCopy
saleApplicationsInfo.value.isSale = 'Y'
saleApplicationsInfo.value.agentPublishId = saleApplications.agentPublishId
} else {
saleApplicationsInfo.value.isCopy = 'N'
saleApplicationsInfo.value.isSale = 'N'
saleApplicationsInfo.value.agentPublishId = saleApplications.agentPublishId
}
isShowSaleApplicationsConfigurationModal.value = true
}
function handleUnSaleApplication() {
window.$message
.ctWarning(
t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.removal_prompt_content'),
t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.removal_prompt_title'),
)
.then(() => {
fetchRemoveSalePublishApplication(applicationMallInfo.value.agentPublishId)
.then(() => {
applicationMallInfo.value.isSale = 'N'
window.$message.success(t('common_module.removal_successfully'))
})
.catch(() => {
window.$message.error(t('common_module.removal_failed'))
})
})
}
function handleGetApplicationMallInfo() {
fetchGetApplicationMallInfo(personalAppConfigStore.baseInfo.agentId).then((res) => {
applicationMallInfo.value = res.data as ApplicationMallInfo
saleApplicationsInfo.value.agentPublishId = applicationMallInfo.value.agentPublishId
saleApplicationsInfo.value.isCopy = applicationMallInfo.value.isCopy
})
}
function handleGetApplicationInfo() {
fetchGetApplicationInfo(personalAppConfigStore.baseInfo.agentId).then((res) => {
saleApplicationsInfo.value = res.data as PersonalAppConfigState
})
}
function handleToApplicationSquare() {
router.push({ name: 'ApplicationsSquare' })
}
</script> </script>
<template> <template>
<div ref="pageContentWrapRef" class="h-full overflow-hidden p-5"> <div ref="pageContentWrapRef" class="h-full w-full overflow-hidden p-5">
<NDataTable <table class="w-full text-left" :max-height="tableContentY">
:bordered="true" <thead>
:bottom-bordered="true" <tr>
:single-line="false" <th class="w-[45%] border-[1px] border-[#efeff5] bg-[#f7f7fa] p-[12px] text-[14px] font-medium">
:data="channelPublishList" <span>{{ t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.channel') }}</span>
:columns="columns" </th>
:max-height="tableContentY" <th class="w-[17%] border-[1px] border-[#efeff5] bg-[#f7f7fa] p-[12px] text-[14px] font-medium">
:scroll-x="1220" <span>{{ t('common_module.status') }}</span>
</th>
<th
class="w-[38%] rounded-tr-[5px] border-[1px] border-[#efeff5] bg-[#f7f7fa] p-[12px] text-[14px] font-medium"
>
<span>{{ t('common_module.data_table_module.action') }}</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="border-[1px] border-[#efeff5]">
<div class="flex items-center justify-start p-[12px]">
<Computer
theme="multi-color"
size="24"
:fill="['#000dff', '#000dff', '#FFF', '#43CCF8']"
:stroke-width="3"
/>
<div class="ml-[12px]">
<div>
{{
t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.web_channel_name')
}}
</div>
<div class="text-[#84868c]">
{{
t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.web_channel_desc')
}}
</div>
</div>
</div>
</td>
<td class="border-[1px] border-[#efeff5] p-[12px]">
<div class="flex flex-col items-start justify-center">
<div class="mb-[4px] rounded-[4px] bg-[#34a853] px-[14px] py-[3px] text-[#fff]">
{{ t('common_module.published') }}
</div>
<div class="text-[#84868c]">
{{ formatDateTime(saleApplicationsInfo.baseInfo.publishTime) + t('common_module.publish') }}
</div>
</div>
</td>
<td class="border-[1px] border-[#efeff5] p-[12px]">
<div class="flex">
<div
class="flex cursor-pointer items-center justify-start rounded-[5px] border-[1px] border-[#000DFF] bg-[#f7f7f9] px-[12px] py-[4px] text-[14px] text-[#000DFF] hover:opacity-80"
@click="handleClickChannelPublishTableAction('accessPage')"
>
<PreviewOpen theme="outline" size="16" fill="#000DFF" :stroke-width="4" class="mr-[6px]" />
<span>{{
t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.access_page')
}}</span>
</div>
<div
class="hover:text-theme-color hover:border-theme-color ml-[16px] flex cursor-pointer items-center justify-start rounded-md border bg-[#f7f7f9] px-[12px] py-[4px] text-[14px]"
@click="handleClickChannelPublishTableAction('copyLink')"
>
<CustomIcon icon="pepicons-pop:share-android-circle" class="mr-[6px]" />
<span>{{
t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.share_link')
}}</span>
</div>
</div>
</td>
</tr>
<tr>
<td class="border-[1px] border-[#efeff5]">
<div class="flex items-center justify-start p-[12px]">
<AllApplication theme="filled" size="24" fill="#000dff" :stroke-width="3" />
<div class="ml-[12px]">
<div class="hover:text-theme-color flex cursor-pointer items-center" @click="handleToApplicationSquare">
<div class="mr-[2px]">
{{ t('router_title_module.application_square') }}
</div>
<CustomIcon icon="ep:top-right" />
</div>
<div class="text-[#84868c]">
{{
t(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.application_square_desc',
)
}}
</div>
</div>
</div>
</td>
<td class="border-[1px] border-[#efeff5] p-[12px]">
<div
v-show="applicationMallInfo?.isSale === null || applicationMallInfo?.isSale === 'N'"
class="flex flex-col items-start justify-center"
>
<div class="rounded-[4px] bg-[#BBB] px-[14px] py-[3px] text-[#fff]">
{{
t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.not_configured_btn')
}}
</div>
</div>
<div v-show="applicationMallInfo?.isSale === 'Y'" class="flex flex-col items-start justify-center">
<div class="mb-[4px] rounded-[4px] bg-[#34a853] px-[14px] py-[3px] text-[#fff]">
{{ t('common_module.published') }}
</div>
<div class="text-[#84868c]">
{{
applicationMallInfo?.launchTime
? formatDateTime(applicationMallInfo.launchTime) + t('common_module.publish')
: ''
}}
</div>
</div>
</td>
<td class="border-[1px] border-[#efeff5] p-[12px]">
<div v-show="applicationMallInfo?.isSale === null || applicationMallInfo?.isSale === 'N'" class="flex">
<div
class="flex cursor-pointer items-center justify-start rounded-[5px] border-[1px] border-[#000DFF] bg-[#f7f7f9] px-[12px] py-[4px] text-[14px] text-[#000DFF] hover:opacity-80"
@click="handleClickChannelPublishTableAction('configuration')"
>
<SettingOne theme="outline" size="16" fill="#000dff" :stroke-width="3" class="mr-[3px]" />
<span>
{{ t('common_module.config') }}
</span>
</div>
</div>
<div v-show="applicationMallInfo?.isSale === 'Y'" class="flex">
<!-- <div
class="flex cursor-pointer items-center justify-start rounded-[5px] border-[1px] border-[#000DFF] bg-[#f7f7f9] px-[12px] py-[4px] text-[14px] text-[#000DFF] hover:opacity-80"
@click="handleClickChannelPublishTableAction('accessPage')"
>
<PreviewOpen theme="outline" size="16" fill="#000DFF" :stroke-width="4" class="mr-[6px]" />
<span>{{
t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.access_page')
}}</span>
</div>
<div
class="hover:text-theme-color hover:border-theme-color ml-[16px] flex cursor-pointer items-center justify-start rounded-md border bg-[#f7f7f9] px-[12px] py-[4px] text-[14px]"
@click="handleClickChannelPublishTableAction('copyLink')"
>
<CustomIcon icon="pepicons-pop:share-android-circle" class="mr-[6px]" />
<span>{{
t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.share_link')
}}</span>
</div> -->
<div
class="hover:text-theme-color hover:border-theme-color flex cursor-pointer items-center justify-start rounded-md border bg-[#f7f7f9] px-[12px] py-[4px] text-[14px]"
@click="handleClickChannelPublishTableAction('modifySetting')"
>
<CustomIcon icon="ep:edit" class="mr-[6px]" />
<span>
{{
t('personal_space_module.agent_module.agent_setting_module.agent_publish_module.modify_setting_btn')
}}
</span>
</div>
<div
class="hover:text-theme-color hover:border-theme-color ml-[16px] flex cursor-pointer items-center justify-start rounded-md border bg-[#f7f7f9] px-[12px] py-[4px] text-[14px]"
@click="handleClickChannelPublishTableAction('unSaleApplication')"
>
<CustomIcon icon="nonicons:not-found-16" class="mr-[6px]" />
<span> {{ t('common_module.data_table_module.remove_applications') }} </span>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<SaleApplicationsConfigurationModal
v-model="isShowSaleApplicationsConfigurationModal"
:data="saleApplicationsInfo"
:category-id="applicationMallInfo.categoryId"
@update="(newValue: string) => (applicationMallInfo.isSale = newValue)"
@trigger-get-application-mall-info="handleGetApplicationMallInfo"
/> />
</div> </div>
</template> </template>
...@@ -15,18 +15,18 @@ const isShowSaleApplicationsConfigurationModal = defineModel<boolean>() ...@@ -15,18 +15,18 @@ const isShowSaleApplicationsConfigurationModal = defineModel<boolean>()
const props = defineProps<{ const props = defineProps<{
data: PersonalAppConfigState data: PersonalAppConfigState
categoryId?: number
}>() }>()
const emit = defineEmits<{ const emit = defineEmits<{
update: [value: string] update: [value: string]
'trigger-get-application-mall-info': []
}>() }>()
const { t } = useI18n() const { t } = useI18n()
const checkedClassifyValue = ref<number | null>(null) const checkedClassifyValue = ref<number | null>(props.categoryId!)
const isCopy = ref('N') const isCopy = ref(props.data.isCopy === 'Y')
const saleApplicationsId = ref(props.data.agentPublishId) const saleApplicationsId = ref(props.data.agentPublishId)
const isClassifyError = ref(false) const isClassifyError = ref(false)
const applicationsClassify = ref<MallCategory[]>([]) const applicationsClassify = ref<MallCategory[]>([])
...@@ -42,16 +42,25 @@ watch( ...@@ -42,16 +42,25 @@ watch(
}, },
) )
watch(
() => props.categoryId,
(newValue) => {
checkedClassifyValue.value = newValue!
},
)
watch( watch(
() => props.data, () => props.data,
(newVal) => { (newVal) => {
saleApplicationsId.value = newVal.agentPublishId saleApplicationsId.value = newVal.agentPublishId
isCopy.value = newVal.isCopy === 'Y'
}, },
) )
function handleApplicationsSaleSettingModalClose() { function handleApplicationsSaleSettingModalClose() {
isShowSaleApplicationsConfigurationModal.value = false isShowSaleApplicationsConfigurationModal.value = false
checkedClassifyValue.value = null checkedClassifyValue.value = null
isCopy.value = false
} }
function handleApplicationReleaseBtn() { function handleApplicationReleaseBtn() {
...@@ -59,17 +68,24 @@ function handleApplicationReleaseBtn() { ...@@ -59,17 +68,24 @@ function handleApplicationReleaseBtn() {
isClassifyError.value = true isClassifyError.value = true
return return
} }
const payload = { const payload = {
agentPublishId: saleApplicationsId.value, agentPublishId: props.data.agentPublishId,
categoryId: checkedClassifyValue.value, categoryId: checkedClassifyValue.value,
isCopy: isCopy.value, isCopy: isCopy.value ? 'Y' : 'N',
isSale: 'Y', isSale: 'Y',
} }
fetchSalePublishApplication(payload) fetchSalePublishApplication(payload)
.then(() => { .then(() => {
emit('update', 'Y') emit('update', 'Y')
handleApplicationsSaleSettingModalClose() handleApplicationsSaleSettingModalClose()
window.$message.success(t('common_module.listing_successfully')) window.$message.success(
t(
'personal_space_module.agent_module.agent_setting_module.agent_publish_module.successfully_configured_published',
),
)
emit('trigger-get-application-mall-info')
isClassifyError.value = false isClassifyError.value = false
}) })
.catch(() => { .catch(() => {
...@@ -77,7 +93,7 @@ function handleApplicationReleaseBtn() { ...@@ -77,7 +93,7 @@ function handleApplicationReleaseBtn() {
}) })
} }
function handleIsCopySwitchUpdateValue(value: string) { function handleIsCopySwitchUpdateValue(value: boolean) {
isCopy.value = value isCopy.value = value
} }
...@@ -87,10 +103,24 @@ function handleGetMallCategoryList() { ...@@ -87,10 +103,24 @@ function handleGetMallCategoryList() {
applicationsClassify.value = res.data as MallCategory[] applicationsClassify.value = res.data as MallCategory[]
}) })
} }
function handleModalOpenAfter() {
if (props.data.isCopy) isCopy.value = props.data.isCopy === 'Y'
if (props.data.isSale === 'Y') {
checkedClassifyValue.value = props.categoryId!
} else {
checkedClassifyValue.value = 0
}
}
</script> </script>
<template> <template>
<n-modal v-model:show="isShowSaleApplicationsConfigurationModal" class="h-auto max-h-[720px]" :mask-closable="false"> <n-modal
v-model:show="isShowSaleApplicationsConfigurationModal"
:on-after-enter="handleModalOpenAfter"
class="h-auto max-h-[720px]"
:mask-closable="false"
>
<div class="flex flex-col items-center justify-center"> <div class="flex flex-col items-center justify-center">
<div class="max-h-[720px] w-[720px] rounded-lg bg-white p-[24px]"> <div class="max-h-[720px] w-[720px] rounded-lg bg-white p-[24px]">
<div class="mb-[24px] flex items-center justify-between text-[20px] font-medium"> <div class="mb-[24px] flex items-center justify-between text-[20px] font-medium">
...@@ -162,7 +192,7 @@ function handleGetMallCategoryList() { ...@@ -162,7 +192,7 @@ function handleGetMallCategoryList() {
</div> </div>
</n-popover> </n-popover>
</div> </div>
<n-switch size="small" checked-value="Y" unchecked-value="N" @update:value="handleIsCopySwitchUpdateValue" <n-switch v-model:value="isCopy" size="small" @update:value="handleIsCopySwitchUpdateValue"
><template #checked ><template #checked
>{{ t('personal_space_module.agent_module.agent_setting_module.agent_sale_module.yes') }} >{{ t('personal_space_module.agent_module.agent_setting_module.agent_sale_module.yes') }}
</template> </template>
...@@ -182,7 +212,7 @@ function handleGetMallCategoryList() { ...@@ -182,7 +212,7 @@ function handleGetMallCategoryList() {
{{ t('common_module.cancel_btn_text') }} {{ 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] cursor-pointer rounded-[6px] border-[1px] border-solid border-[#dde3f0] bg-[te] px-[10px] text-[#ffffff] transition-all duration-300 hover:bg-[#528EFF]"
@click="handleApplicationReleaseBtn()" @click="handleApplicationReleaseBtn()"
> >
{{ t('personal_space_module.agent_module.agent_setting_module.agent_sale_module.confirm_release') }} {{ t('personal_space_module.agent_module.agent_setting_module.agent_sale_module.confirm_release') }}
......
...@@ -318,6 +318,12 @@ declare namespace I18n { ...@@ -318,6 +318,12 @@ declare namespace I18n {
access_page: string access_page: string
share_link: string share_link: string
copy_share_url_success_message: string copy_share_url_success_message: string
application_square_desc: string
modify_setting_btn: string
not_configured_btn: string
removal_prompt_title: string
removal_prompt_content: string
successfully_configured_published: 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