Commit df9d76c3 authored by nick zheng's avatar nick zheng

fix: 发布应用后状态没有更新及分享链接有误

parent 2a5514dd
......@@ -2,9 +2,7 @@ import { h } from 'vue'
import CustomIcon from '@/components/custom-icon/custom-icon.vue'
import { formatDateTime } from '@/utils/date-formatter'
export function createChannelPublishColumn(
handleChannelPublishTableAction: (actionType: string, linkUrl: string) => void,
) {
export function createChannelPublishColumn(handleChannelPublishTableAction: (actionType: string) => void) {
return [
{
title: '发布渠道',
......@@ -122,7 +120,7 @@ export function createChannelPublishColumn(
key: 'action',
align: 'left',
width: '460',
render(row: { linkUrl: string }) {
render() {
return h(
'div',
{
......@@ -148,7 +146,7 @@ export function createChannelPublishColumn(
color: '#2468f2',
},
className: 'cursor-pointer rounded-md border hover:opacity-80',
onClick: () => handleChannelPublishTableAction('accessPage', row.linkUrl),
onClick: () => handleChannelPublishTableAction('accessPage'),
},
{
default: () => [
......@@ -176,7 +174,7 @@ export function createChannelPublishColumn(
background: '#f7f7f9',
},
className: 'cursor-pointer hover:text-theme-color rounded-md border hover:border-theme-color',
onClick: () => handleChannelPublishTableAction('copyLink', row.linkUrl),
onClick: () => handleChannelPublishTableAction('copyLink'),
},
{
default: () => [
......
<script lang="ts" setup>
import { readonly } from 'vue'
import { reactive } from 'vue'
import { useRouter } from 'vue-router'
import { createChannelPublishColumn } from '../columns'
import { INDEX_URLS } from '@/config/base-url'
......@@ -10,30 +10,32 @@ const { pageContentWrapRef, tableContentY } = useTableScrollY()
const router = useRouter()
const channelPublishList = readonly([
const channelPublishList = reactive([
{
linkUrl: `${INDEX_URLS[window.ENV || 'DEV']}share/web_source/${router.currentRoute.value.params.agentId}`,
type: 'web',
},
])
const columns = createChannelPublishColumn(handleClickChannelPublishTableAction)
function handleClickChannelPublishTableAction(actionType: string, channleUrl: string) {
function handleClickChannelPublishTableAction(actionType: string) {
switch (actionType) {
case 'accessPage':
handleAccessPage(channleUrl)
handleAccessPage()
break
case 'copyLink':
handleCopyShareLink(channleUrl)
handleCopyShareLink()
break
}
}
function handleAccessPage(channleUrl: string) {
function handleAccessPage() {
const channleUrl = `${INDEX_URLS[window.ENV || 'DEV']}share/web_source/${router.currentRoute.value.params.agentId}`
location.href = channleUrl
}
function handleCopyShareLink(channleUrl: string) {
function handleCopyShareLink() {
const channleUrl = `${INDEX_URLS[window.ENV || 'DEV']}share/web_source/${router.currentRoute.value.params.agentId}`
copyToClip(channleUrl)
window.$message.success('链接复制成功,快分享给你的好友吧!')
}
......
......@@ -146,8 +146,11 @@ async function handlePublishApplication() {
router.replace({
name: router.currentRoute.value.name as string,
query: { tabKey: 'publish' },
params: { ...router.currentRoute.value.params },
params: { agentId: personalAppConfig.value.baseInfo.agentId },
})
personalAppConfig.value.baseInfo.agentPublishStatus = 'publish'
emit('changeAgentAppTabKey', 'publish')
}
}
......@@ -225,6 +228,7 @@ async function handlePublishApplication() {
v-show="isShowPublishBtn"
type="primary"
class="h-[32px]! min-w-20! rounded-md!"
:disabled="!personalAppConfig.baseInfo.agentId"
:loading="publishBtnloading"
@click="handlePublishApplication"
>
......
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