feat: 概览
This commit is contained in:
parent
7d5d0846d9
commit
e9abfd6f45
@ -19,11 +19,7 @@
|
|||||||
<el-button text disabled v-if="buttonData?.vote_status === '1'">
|
<el-button text disabled v-if="buttonData?.vote_status === '1'">
|
||||||
<AppIcon iconName="app-oppose-color"></AppIcon>
|
<AppIcon iconName="app-oppose-color"></AppIcon>
|
||||||
</el-button>
|
</el-button>
|
||||||
<EditContentDialog
|
<EditContentDialog ref="EditContentDialogRef" />
|
||||||
ref="EditContentDialogRef"
|
|
||||||
:chartId="chartId"
|
|
||||||
@updateContent="updateContent"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -40,10 +36,6 @@ const props = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
chartId: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
log: Boolean
|
log: Boolean
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -58,8 +50,8 @@ function editContent(data: any) {
|
|||||||
EditContentDialogRef.value.open(data)
|
EditContentDialogRef.value.open(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateContent(data: any) {
|
// function updateContent(data: any) {
|
||||||
emit('update:data', data)
|
// emit('update:data', data)
|
||||||
}
|
// }
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@ -71,7 +71,7 @@
|
|||||||
<el-text type="info">
|
<el-text type="info">
|
||||||
消耗 {{ item?.message_tokens + item?.answer_tokens }} tokens
|
消耗 {{ item?.message_tokens + item?.answer_tokens }} tokens
|
||||||
</el-text>
|
</el-text>
|
||||||
<LogOperationButton :data="item" :applicationId="appId" :chartId="item.id" />
|
<LogOperationButton :data="item" :applicationId="appId" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex-between mt-8" v-else>
|
<div class="flex-between mt-8" v-else>
|
||||||
|
|||||||
@ -7,10 +7,11 @@
|
|||||||
<h3>{{ header }}</h3>
|
<h3>{{ header }}</h3>
|
||||||
<slot name="header"> </slot>
|
<slot name="header"> </slot>
|
||||||
</div>
|
</div>
|
||||||
|
<el-scrollbar>
|
||||||
<div class="content-container__main">
|
<div class="content-container__main">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -41,6 +42,7 @@ const showBack = computed(() => {
|
|||||||
background-color: var(--app-view-bg-color);
|
background-color: var(--app-view-bg-color);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
min-width: 700px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu class="avatar-dropdown">
|
<el-dropdown-menu class="avatar-dropdown">
|
||||||
<div class="userInfo">
|
<div class="userInfo">
|
||||||
<p class="bold mb-4" style="font-size: 14px;">{{ user.userInfo?.username }}</p>
|
<p class="bold mb-4" style="font-size: 14px">{{ user.userInfo?.username }}</p>
|
||||||
<p>
|
<p>
|
||||||
<el-text type="info">
|
<el-text type="info">
|
||||||
{{ user.userInfo?.email }}
|
{{ user.userInfo?.email }}
|
||||||
@ -52,6 +52,7 @@ const logout = () => {
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.avatar-dropdown {
|
.avatar-dropdown {
|
||||||
|
min-width: 210px;
|
||||||
.userInfo {
|
.userInfo {
|
||||||
padding: 12px 11px;
|
padding: 12px 11px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<LayoutContainer header="概览">
|
<LayoutContainer header="概览">
|
||||||
<div class="main-calc-height p-24">
|
<div class="main-calc-height p-24" style="min-width: 600px">
|
||||||
<h4 class="title-decoration-1 mb-16">应用信息</h4>
|
<h4 class="title-decoration-1 mb-16">应用信息</h4>
|
||||||
<el-card shadow="never" class="overview-card" v-loading="loading">
|
<el-card shadow="never" class="overview-card" v-loading="loading">
|
||||||
<div class="title flex align-center">
|
<div class="title flex align-center">
|
||||||
@ -16,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-row :gutter="12">
|
<el-row :gutter="12">
|
||||||
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" class="mt-16">
|
<el-col :span="12" class="mt-16">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<el-text type="info">公开访问链接</el-text>
|
<el-text type="info">公开访问链接</el-text>
|
||||||
<el-switch
|
<el-switch
|
||||||
@ -26,7 +26,7 @@
|
|||||||
inline-prompt
|
inline-prompt
|
||||||
active-text="开"
|
active-text="开"
|
||||||
inactive-text="关"
|
inactive-text="关"
|
||||||
@change="changeState"
|
@change="changeState($event)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -38,16 +38,20 @@
|
|||||||
<el-button type="primary" text @click="copyClick(shareUrl)">
|
<el-button type="primary" text @click="copyClick(shareUrl)">
|
||||||
<AppIcon iconName="app-copy"></AppIcon>
|
<AppIcon iconName="app-copy"></AppIcon>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="getAccessToken" type="primary" text style="margin-left: 1px">
|
<el-button @click="refreshAccessToken" type="primary" text style="margin-left: 1px">
|
||||||
<el-icon><RefreshRight /></el-icon>
|
<el-icon><RefreshRight /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button :disabled="!accessToken?.is_active" type="primary"><a :href="shareUrl" target="_blank">演示</a></el-button>
|
<el-button :disabled="!accessToken?.is_active" type="primary"
|
||||||
<el-button :disabled="!accessToken?.is_active" @click="openDialog"> 嵌入第三方 </el-button>
|
><a :href="shareUrl" target="_blank">演示</a></el-button
|
||||||
|
>
|
||||||
|
<el-button :disabled="!accessToken?.is_active" @click="openDialog">
|
||||||
|
嵌入第三方
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12" class="mt-16">
|
<el-col :span="12" class="mt-16">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<el-text type="info">API访问凭据</el-text>
|
<el-text type="info">API访问凭据</el-text>
|
||||||
</div>
|
</div>
|
||||||
@ -72,7 +76,7 @@
|
|||||||
</LayoutContainer>
|
</LayoutContainer>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref, watch, onMounted } from 'vue'
|
import { ref, computed, onMounted } from 'vue'
|
||||||
import { useRouter, useRoute } from 'vue-router'
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
import EmbedDialog from './component/EmbedDialog.vue'
|
import EmbedDialog from './component/EmbedDialog.vue'
|
||||||
import APIKeyDialog from './component/APIKeyDialog.vue'
|
import APIKeyDialog from './component/APIKeyDialog.vue'
|
||||||
@ -91,20 +95,33 @@ const apiUrl = window.location.origin + '/doc'
|
|||||||
|
|
||||||
const APIKeyDialogRef = ref()
|
const APIKeyDialogRef = ref()
|
||||||
const EmbedDialogRef = ref()
|
const EmbedDialogRef = ref()
|
||||||
const shareUrl = ref('')
|
|
||||||
const accessToken = ref<any>({})
|
const accessToken = ref<any>({})
|
||||||
const detail = ref<any>(null)
|
const detail = ref<any>(null)
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
|
const shareUrl = computed(() => application.location + accessToken.value.access_token)
|
||||||
|
|
||||||
|
function refreshAccessToken() {
|
||||||
|
const obj = {
|
||||||
|
access_token_reset: true
|
||||||
|
}
|
||||||
|
const str = '刷新成功'
|
||||||
|
updateAccessToken(obj, str)
|
||||||
|
}
|
||||||
function changeState(bool: Boolean) {
|
function changeState(bool: Boolean) {
|
||||||
const obj = {
|
const obj = {
|
||||||
is_active: bool
|
is_active: bool
|
||||||
}
|
}
|
||||||
const str = bool ? '启用成功' : '禁用成功'
|
const str = bool ? '启用成功' : '禁用成功'
|
||||||
|
updateAccessToken(obj, str)
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateAccessToken(obj: any, str: string) {
|
||||||
applicationApi.putAccessToken(id as string, obj, loading).then((res) => {
|
applicationApi.putAccessToken(id as string, obj, loading).then((res) => {
|
||||||
|
accessToken.value = res?.data
|
||||||
MsgSuccess(str)
|
MsgSuccess(str)
|
||||||
getDetail()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +134,6 @@ function openDialog() {
|
|||||||
function getAccessToken() {
|
function getAccessToken() {
|
||||||
application.asyncGetAccessToken(id, loading).then((res: any) => {
|
application.asyncGetAccessToken(id, loading).then((res: any) => {
|
||||||
accessToken.value = res?.data
|
accessToken.value = res?.data
|
||||||
shareUrl.value = application.location + res?.data?.access_token
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
<AppAvatar v-if="!node.isLeaf" class="mr-12" shape="square" :size="24">
|
<AppAvatar v-if="!node.isLeaf" class="mr-12" shape="square" :size="24">
|
||||||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
||||||
</AppAvatar>
|
</AppAvatar>
|
||||||
{{ data.name }}
|
<span class="ellipsis-1"> {{ data.name }}</span>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-cascader>
|
</el-cascader>
|
||||||
@ -42,7 +42,7 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click.prevent="dialogVisible = false"> 取消 </el-button>
|
<el-button @click.prevent="dialogVisible = false"> 取消 </el-button>
|
||||||
<el-button type="primary" @click="submitForm(formRef)"> 保存 </el-button>
|
<el-button type="primary" @click="submitForm(formRef)" :loading="loading"> 保存 </el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -53,7 +53,6 @@ import { useRoute } from 'vue-router'
|
|||||||
import type { FormInstance, FormRules } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import logApi from '@/api/log'
|
import logApi from '@/api/log'
|
||||||
import type { CascaderProps } from 'element-plus'
|
import type { CascaderProps } from 'element-plus'
|
||||||
|
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
|
|
||||||
const { application, document } = useStore()
|
const { application, document } = useStore()
|
||||||
@ -70,7 +69,6 @@ const {
|
|||||||
params: { id }
|
params: { id }
|
||||||
} = route as any
|
} = route as any
|
||||||
|
|
||||||
const emit = defineEmits(['updateContent'])
|
|
||||||
|
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
|
|
||||||
@ -78,6 +76,7 @@ const dialogVisible = ref<boolean>(false)
|
|||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
const form = ref<any>({
|
const form = ref<any>({
|
||||||
|
chat_id: '',
|
||||||
record_id: '',
|
record_id: '',
|
||||||
problem_text: '',
|
problem_text: '',
|
||||||
title: '',
|
title: '',
|
||||||
@ -95,6 +94,7 @@ const datasetList = ref([])
|
|||||||
watch(dialogVisible, (bool) => {
|
watch(dialogVisible, (bool) => {
|
||||||
if (!bool) {
|
if (!bool) {
|
||||||
form.value = {
|
form.value = {
|
||||||
|
chat_id: '',
|
||||||
record_id: '',
|
record_id: '',
|
||||||
problem_text: '',
|
problem_text: '',
|
||||||
title: '',
|
title: '',
|
||||||
@ -134,6 +134,7 @@ function getDataset(resolve: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const open = (data: any) => {
|
const open = (data: any) => {
|
||||||
|
form.value.chat_id = data.chat
|
||||||
form.value.record_id = data.id
|
form.value.record_id = data.id
|
||||||
form.value.problem_text = data.problem_text
|
form.value.problem_text = data.problem_text
|
||||||
form.value.content = data.answer_text
|
form.value.content = data.answer_text
|
||||||
@ -150,7 +151,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|||||||
logApi
|
logApi
|
||||||
.putChatRecordLog(
|
.putChatRecordLog(
|
||||||
id,
|
id,
|
||||||
props.chartId,
|
form.value.chat_id,
|
||||||
form.value.record_id,
|
form.value.record_id,
|
||||||
form.value.document[0],
|
form.value.document[0],
|
||||||
form.value.document[1],
|
form.value.document[1],
|
||||||
@ -158,7 +159,6 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|||||||
loading
|
loading
|
||||||
)
|
)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
emit('updateContent', res.data)
|
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user