Commit 4e94e0c3 authored by shirlyn.guo's avatar shirlyn.guo 👌🏻

feat: 应用创建模块应用上架,下架,应用发布应用市场配置

parent 87b65028
...@@ -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'),
),
],
},
),
],
},
)
},
},
]
}
...@@ -15,18 +15,17 @@ const isShowSaleApplicationsConfigurationModal = defineModel<boolean>() ...@@ -15,18 +15,17 @@ 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]
}>() }>()
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 +41,25 @@ watch( ...@@ -42,16 +41,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 +67,23 @@ function handleApplicationReleaseBtn() { ...@@ -59,17 +67,23 @@ 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',
),
)
isClassifyError.value = false isClassifyError.value = false
}) })
.catch(() => { .catch(() => {
...@@ -77,7 +91,7 @@ function handleApplicationReleaseBtn() { ...@@ -77,7 +91,7 @@ function handleApplicationReleaseBtn() {
}) })
} }
function handleIsCopySwitchUpdateValue(value: string) { function handleIsCopySwitchUpdateValue(value: boolean) {
isCopy.value = value isCopy.value = value
} }
...@@ -87,10 +101,23 @@ function handleGetMallCategoryList() { ...@@ -87,10 +101,23 @@ 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 +189,7 @@ function handleGetMallCategoryList() { ...@@ -162,7 +189,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 +209,7 @@ function handleGetMallCategoryList() { ...@@ -182,7 +209,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