forked from github/dataease
Merge pull request #10694 from dataease/pr@dev-v2@fix_share_ticket_uuid
fix(仪表板): 分享链接ticket设置链接没有实时更新
This commit is contained in:
commit
b03a8f0441
@ -42,7 +42,7 @@
|
|||||||
:disabled="!linkCustom"
|
:disabled="!linkCustom"
|
||||||
@blur="finishEditUuid"
|
@blur="finishEditUuid"
|
||||||
>
|
>
|
||||||
<template #prefix>
|
<template v-if="!linkCustom" #prefix>
|
||||||
{{ formatLinkBase() }}
|
{{ formatLinkBase() }}
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
@ -122,7 +122,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="shareEnable && showTicket" class="share-ticket-container">
|
<div v-if="shareEnable && showTicket" class="share-ticket-container">
|
||||||
<share-ticket
|
<share-ticket
|
||||||
:link-url="linkAddr"
|
|
||||||
:uuid="state.detailInfo.uuid"
|
:uuid="state.detailInfo.uuid"
|
||||||
:resource-id="props.resourceId"
|
:resource-id="props.resourceId"
|
||||||
:ticket-require="state.detailInfo.ticketRequire"
|
:ticket-require="state.detailInfo.ticketRequire"
|
||||||
|
@ -156,11 +156,14 @@ import { useI18n } from '@/hooks/web/useI18n'
|
|||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
|
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
|
||||||
import useClipboard from 'vue-clipboard3'
|
import useClipboard from 'vue-clipboard3'
|
||||||
|
import { useEmbedded } from '@/store/modules/embedded'
|
||||||
|
import { SHARE_BASE } from './option'
|
||||||
|
|
||||||
|
const embeddedStore = useEmbedded()
|
||||||
const { toClipboard } = useClipboard()
|
const { toClipboard } = useClipboard()
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
linkUrl: propTypes.string.def(null),
|
uuid: propTypes.string.def(''),
|
||||||
uuid: propTypes.string.def(null),
|
|
||||||
resourceId: propTypes.string.def(null),
|
resourceId: propTypes.string.def(null),
|
||||||
ticketRequire: propTypes.bool
|
ticketRequire: propTypes.bool
|
||||||
})
|
})
|
||||||
@ -234,9 +237,21 @@ const addRow = () => {
|
|||||||
state.tableData.splice(0, 0, row)
|
state.tableData.splice(0, 0, row)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const formatLinkAddr = () => {
|
||||||
|
return formatLinkBase() + props.uuid
|
||||||
|
}
|
||||||
|
const formatLinkBase = () => {
|
||||||
|
let prefix = '/'
|
||||||
|
if (embeddedStore.baseUrl) {
|
||||||
|
prefix = embeddedStore.baseUrl + '#'
|
||||||
|
} else {
|
||||||
|
const href = window.location.href
|
||||||
|
prefix = href.substring(0, href.indexOf('#') + 1)
|
||||||
|
}
|
||||||
|
return prefix + SHARE_BASE
|
||||||
|
}
|
||||||
const copyTicket = async ticket => {
|
const copyTicket = async ticket => {
|
||||||
const url = `${props.linkUrl}?ticket=${ticket}`
|
const url = `${formatLinkAddr()}?ticket=${ticket}`
|
||||||
try {
|
try {
|
||||||
await toClipboard(url)
|
await toClipboard(url)
|
||||||
ElMessage.success(t('common.copy_success'))
|
ElMessage.success(t('common.copy_success'))
|
||||||
|
@ -123,7 +123,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="shareEnable && showTicket" class="share-ticket-container">
|
<div v-if="shareEnable && showTicket" class="share-ticket-container">
|
||||||
<share-ticket
|
<share-ticket
|
||||||
:link-url="linkAddr"
|
|
||||||
:uuid="state.detailInfo.uuid"
|
:uuid="state.detailInfo.uuid"
|
||||||
:resource-id="props.resourceId"
|
:resource-id="props.resourceId"
|
||||||
:ticket-require="state.detailInfo.ticketRequire"
|
:ticket-require="state.detailInfo.ticketRequire"
|
||||||
|
Loading…
Reference in New Issue
Block a user