perf: 优化应用概览页面
This commit is contained in:
parent
af274fb545
commit
9112dd5b45
@ -42,7 +42,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-row :gutter="12">
|
<el-row :gutter="12">
|
||||||
<el-col :span="10" class="mt-16">
|
<el-col :span="12" class="mt-16">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<el-text type="info">{{
|
<el-text type="info">{{
|
||||||
$t('views.applicationOverview.appInfo.publicAccessLink')
|
$t('views.applicationOverview.appInfo.publicAccessLink')
|
||||||
@ -58,8 +58,8 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-4 mb-16 url-height">
|
<div class="mt-4 mb-16 url-height flex align-center" style="margin-bottom: 37px">
|
||||||
<span class="vertical-middle lighter break-all">
|
<span class="vertical-middle lighter break-all ellipsis-1">
|
||||||
{{ shareUrl }}
|
{{ shareUrl }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
@ -88,7 +88,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14" class="mt-16">
|
<el-col :span="12" class="mt-16">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<el-text type="info"
|
<el-text type="info"
|
||||||
>{{ $t('views.applicationOverview.appInfo.apiAccessCredentials') }}
|
>{{ $t('views.applicationOverview.appInfo.apiAccessCredentials') }}
|
||||||
@ -106,10 +106,13 @@
|
|||||||
{{ apiUrl }}
|
{{ apiUrl }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="flex align-center">
|
||||||
<el-text>Base URL:</el-text
|
<span class="flex">
|
||||||
><a target="_blank" :href="apiUrl" class="vertical-middle lighter break-all">
|
<el-text style="width: 80px">Base URL:</el-text>
|
||||||
{{ baseUrl + id }}
|
</span>
|
||||||
|
|
||||||
|
<a target="_blank" :href="apiUrl" class="vertical-middle lighter break-all">
|
||||||
|
<span class="ellipsis-1">{{ baseUrl + id }}</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<el-button type="primary" text @click="copyClick(baseUrl + id)">
|
<el-button type="primary" text @click="copyClick(baseUrl + id)">
|
||||||
@ -153,7 +156,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
<EmbedDialog ref="EmbedDialogRef" :data="detail" :api-input-params="mapToUrlParams(apiInputParams)"/>
|
<EmbedDialog
|
||||||
|
ref="EmbedDialogRef"
|
||||||
|
:data="detail"
|
||||||
|
:api-input-params="mapToUrlParams(apiInputParams)"
|
||||||
|
/>
|
||||||
<APIKeyDialog ref="APIKeyDialogRef" />
|
<APIKeyDialog ref="APIKeyDialogRef" />
|
||||||
<LimitDialog ref="LimitDialogRef" @refresh="refresh" />
|
<LimitDialog ref="LimitDialogRef" @refresh="refresh" />
|
||||||
<EditAvatarDialog ref="EditAvatarDialogRef" @refresh="refreshIcon" />
|
<EditAvatarDialog ref="EditAvatarDialogRef" @refresh="refreshIcon" />
|
||||||
@ -199,8 +206,12 @@ const detail = ref<any>(null)
|
|||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
const urlParams = computed(() => mapToUrlParams(apiInputParams.value) ? '?' + mapToUrlParams(apiInputParams.value) : '')
|
const urlParams = computed(() =>
|
||||||
const shareUrl = computed(() => application.location + accessToken.value.access_token + urlParams.value)
|
mapToUrlParams(apiInputParams.value) ? '?' + mapToUrlParams(apiInputParams.value) : ''
|
||||||
|
)
|
||||||
|
const shareUrl = computed(
|
||||||
|
() => application.location + accessToken.value.access_token + urlParams.value
|
||||||
|
)
|
||||||
|
|
||||||
const dayOptions = [
|
const dayOptions = [
|
||||||
{
|
{
|
||||||
@ -328,7 +339,8 @@ function getAccessToken() {
|
|||||||
function getDetail() {
|
function getDetail() {
|
||||||
application.asyncGetApplicationDetail(id, loading).then((res: any) => {
|
application.asyncGetApplicationDetail(id, loading).then((res: any) => {
|
||||||
detail.value = res.data
|
detail.value = res.data
|
||||||
detail.value.work_flow?.nodes?.filter((v: any) => v.id === 'base-node')
|
detail.value.work_flow?.nodes
|
||||||
|
?.filter((v: any) => v.id === 'base-node')
|
||||||
.map((v: any) => {
|
.map((v: any) => {
|
||||||
apiInputParams.value = v.properties.input_field_list
|
apiInputParams.value = v.properties.input_field_list
|
||||||
? v.properties.input_field_list
|
? v.properties.input_field_list
|
||||||
@ -352,15 +364,14 @@ function refreshIcon() {
|
|||||||
getDetail()
|
getDetail()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function mapToUrlParams(map: any[]) {
|
function mapToUrlParams(map: any[]) {
|
||||||
const params = new URLSearchParams();
|
const params = new URLSearchParams()
|
||||||
|
|
||||||
map.forEach((item: any) => {
|
map.forEach((item: any) => {
|
||||||
params.append(encodeURIComponent(item.name), encodeURIComponent(item.value));
|
params.append(encodeURIComponent(item.name), encodeURIComponent(item.value))
|
||||||
});
|
})
|
||||||
|
|
||||||
return params.toString(); // 返回 URL 查询字符串
|
return params.toString() // 返回 URL 查询字符串
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user