fix: typos
This commit is contained in:
parent
493939017e
commit
e15dc64be9
@ -7,64 +7,64 @@ const prefix = '/application'
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* API_KEY列表
|
* API_KEY列表
|
||||||
* @param 参数 applicaiton_id
|
* @param 参数 application_id
|
||||||
*/
|
*/
|
||||||
const getAPIKey: (applicaiton_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
const getAPIKey: (application_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||||
applicaiton_id,
|
application_id,
|
||||||
loading
|
loading
|
||||||
) => {
|
) => {
|
||||||
return get(`${prefix}/${applicaiton_id}/api_key`, undefined, loading)
|
return get(`${prefix}/${application_id}/api_key`, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增API_KEY
|
* 新增API_KEY
|
||||||
* @param 参数 applicaiton_id
|
* @param 参数 application_id
|
||||||
*/
|
*/
|
||||||
const postAPIKey: (applicaiton_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
const postAPIKey: (application_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||||
applicaiton_id,
|
application_id,
|
||||||
loading
|
loading
|
||||||
) => {
|
) => {
|
||||||
return post(`${prefix}/${applicaiton_id}/api_key`, {}, undefined, loading)
|
return post(`${prefix}/${application_id}/api_key`, {}, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除API_KEY
|
* 删除API_KEY
|
||||||
* @param 参数 applicaiton_id api_key_id
|
* @param 参数 application_id api_key_id
|
||||||
*/
|
*/
|
||||||
const delAPIKey: (
|
const delAPIKey: (
|
||||||
applicaiton_id: String,
|
application_id: String,
|
||||||
api_key_id: String,
|
api_key_id: String,
|
||||||
loading?: Ref<boolean>
|
loading?: Ref<boolean>
|
||||||
) => Promise<Result<boolean>> = (applicaiton_id, api_key_id, loading) => {
|
) => Promise<Result<boolean>> = (application_id, api_key_id, loading) => {
|
||||||
return del(`${prefix}/${applicaiton_id}/api_key/${api_key_id}`, undefined, undefined, loading)
|
return del(`${prefix}/${application_id}/api_key/${api_key_id}`, undefined, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改API_KEY
|
* 修改API_KEY
|
||||||
* @param 参数 applicaiton_id,api_key_id
|
* @param 参数 application_id,api_key_id
|
||||||
* data {
|
* data {
|
||||||
* is_active: boolean
|
* is_active: boolean
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
const putAPIKey: (
|
const putAPIKey: (
|
||||||
applicaiton_id: string,
|
application_id: string,
|
||||||
api_key_id: String,
|
api_key_id: String,
|
||||||
data: any,
|
data: any,
|
||||||
loading?: Ref<boolean>
|
loading?: Ref<boolean>
|
||||||
) => Promise<Result<any>> = (applicaiton_id, api_key_id, data, loading) => {
|
) => Promise<Result<any>> = (application_id, api_key_id, data, loading) => {
|
||||||
return put(`${prefix}/${applicaiton_id}/api_key/${api_key_id}`, data, undefined, loading)
|
return put(`${prefix}/${application_id}/api_key/${api_key_id}`, data, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计
|
* 统计
|
||||||
* @param 参数 applicaiton_id, data
|
* @param 参数 application_id, data
|
||||||
*/
|
*/
|
||||||
const getStatistics: (
|
const getStatistics: (
|
||||||
applicaiton_id: string,
|
application_id: string,
|
||||||
data: any,
|
data: any,
|
||||||
loading?: Ref<boolean>
|
loading?: Ref<boolean>
|
||||||
) => Promise<Result<any>> = (applicaiton_id, data, loading) => {
|
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||||
return get(`${prefix}/${applicaiton_id}/statistics/chat_record_aggregate_trend`, data, loading)
|
return get(`${prefix}/${application_id}/statistics/chat_record_aggregate_trend`, data, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@ -49,70 +49,70 @@ const postApplication: (
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
const putApplication: (
|
const putApplication: (
|
||||||
applicaiton_id: String,
|
application_id: String,
|
||||||
data: ApplicationFormType,
|
data: ApplicationFormType,
|
||||||
loading?: Ref<boolean>
|
loading?: Ref<boolean>
|
||||||
) => Promise<Result<any>> = (applicaiton_id, data, loading) => {
|
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||||
return put(`${prefix}/${applicaiton_id}`, data, undefined, loading)
|
return put(`${prefix}/${application_id}`, data, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除应用
|
* 删除应用
|
||||||
* @param 参数 applicaiton_id
|
* @param 参数 application_id
|
||||||
*/
|
*/
|
||||||
const delApplication: (
|
const delApplication: (
|
||||||
applicaiton_id: String,
|
application_id: String,
|
||||||
loading?: Ref<boolean>
|
loading?: Ref<boolean>
|
||||||
) => Promise<Result<boolean>> = (applicaiton_id, loading) => {
|
) => Promise<Result<boolean>> = (application_id, loading) => {
|
||||||
return del(`${prefix}/${applicaiton_id}`, undefined, {}, loading)
|
return del(`${prefix}/${application_id}`, undefined, {}, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应用详情
|
* 应用详情
|
||||||
* @param 参数 applicaiton_id
|
* @param 参数 application_id
|
||||||
*/
|
*/
|
||||||
const getApplicationDetail: (
|
const getApplicationDetail: (
|
||||||
applicaiton_id: string,
|
application_id: string,
|
||||||
loading?: Ref<boolean>
|
loading?: Ref<boolean>
|
||||||
) => Promise<Result<any>> = (applicaiton_id, loading) => {
|
) => Promise<Result<any>> = (application_id, loading) => {
|
||||||
return get(`${prefix}/${applicaiton_id}`, undefined, loading)
|
return get(`${prefix}/${application_id}`, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得当前应用可使用的知识库
|
* 获得当前应用可使用的知识库
|
||||||
* @param 参数 applicaiton_id
|
* @param 参数 application_id
|
||||||
*/
|
*/
|
||||||
const getApplicationDataset: (
|
const getApplicationDataset: (
|
||||||
applicaiton_id: string,
|
application_id: string,
|
||||||
loading?: Ref<boolean>
|
loading?: Ref<boolean>
|
||||||
) => Promise<Result<any>> = (applicaiton_id, loading) => {
|
) => Promise<Result<any>> = (application_id, loading) => {
|
||||||
return get(`${prefix}/${applicaiton_id}/list_dataset`, undefined, loading)
|
return get(`${prefix}/${application_id}/list_dataset`, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取AccessToken
|
* 获取AccessToken
|
||||||
* @param 参数 applicaiton_id
|
* @param 参数 application_id
|
||||||
*/
|
*/
|
||||||
const getAccessToken: (applicaiton_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
const getAccessToken: (application_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||||
applicaiton_id,
|
application_id,
|
||||||
loading
|
loading
|
||||||
) => {
|
) => {
|
||||||
return get(`${prefix}/${applicaiton_id}/access_token`, undefined, loading)
|
return get(`${prefix}/${application_id}/access_token`, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改AccessToken
|
* 修改AccessToken
|
||||||
* @param 参数 applicaiton_id
|
* @param 参数 application_id
|
||||||
* data {
|
* data {
|
||||||
* "is_active": true
|
* "is_active": true
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
const putAccessToken: (
|
const putAccessToken: (
|
||||||
applicaiton_id: string,
|
application_id: string,
|
||||||
data: any,
|
data: any,
|
||||||
loading?: Ref<boolean>
|
loading?: Ref<boolean>
|
||||||
) => Promise<Result<any>> = (applicaiton_id, data, loading) => {
|
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||||
return put(`${prefix}/${applicaiton_id}/access_token`, data, undefined, loading)
|
return put(`${prefix}/${application_id}/access_token`, data, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -161,8 +161,8 @@ const postChatOpen: (data: ApplicationFormType) => Promise<Result<any>> = (data)
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
const getChatOpen: (applicaiton_id: String) => Promise<Result<any>> = (applicaiton_id) => {
|
const getChatOpen: (application_id: String) => Promise<Result<any>> = (application_id) => {
|
||||||
return get(`${prefix}/${applicaiton_id}/chat/open`)
|
return get(`${prefix}/${application_id}/chat/open`)
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 对话
|
* 对话
|
||||||
|
|||||||
@ -17,7 +17,7 @@ const prefix = '/dataset'
|
|||||||
"name": "string",
|
"name": "string",
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
const getDateset: (
|
const getDataset: (
|
||||||
page: pageRequest,
|
page: pageRequest,
|
||||||
param: any,
|
param: any,
|
||||||
loading?: Ref<boolean>
|
loading?: Ref<boolean>
|
||||||
@ -29,7 +29,7 @@ const getDateset: (
|
|||||||
* 获取全部知识库
|
* 获取全部知识库
|
||||||
* @param 参数
|
* @param 参数
|
||||||
*/
|
*/
|
||||||
const getAllDateset: (loading?: Ref<boolean>) => Promise<Result<any[]>> = (loading) => {
|
const getAllDataset: (loading?: Ref<boolean>) => Promise<Result<any[]>> = (loading) => {
|
||||||
return get(`${prefix}`, undefined, loading)
|
return get(`${prefix}`, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ const getAllDateset: (loading?: Ref<boolean>) => Promise<Result<any[]>> = (loadi
|
|||||||
* 删除知识库
|
* 删除知识库
|
||||||
* @param 参数 dataset_id
|
* @param 参数 dataset_id
|
||||||
*/
|
*/
|
||||||
const delDateset: (dataset_id: String, loading?: Ref<boolean>) => Promise<Result<boolean>> = (
|
const delDataset: (dataset_id: String, loading?: Ref<boolean>) => Promise<Result<boolean>> = (
|
||||||
dataset_id,
|
dataset_id,
|
||||||
loading
|
loading
|
||||||
) => {
|
) => {
|
||||||
@ -69,7 +69,7 @@ const delDateset: (dataset_id: String, loading?: Ref<boolean>) => Promise<Result
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
const postDateset: (data: datasetData, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
const postDataset: (data: datasetData, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||||
data,
|
data,
|
||||||
loading
|
loading
|
||||||
) => {
|
) => {
|
||||||
@ -86,7 +86,7 @@ const postDateset: (data: datasetData, loading?: Ref<boolean>) => Promise<Result
|
|||||||
"selector": "string",
|
"selector": "string",
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
const postWebDateset: (data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
const postWebDataset: (data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||||
data,
|
data,
|
||||||
loading
|
loading
|
||||||
) => {
|
) => {
|
||||||
@ -97,7 +97,7 @@ const postWebDateset: (data: any, loading?: Ref<boolean>) => Promise<Result<any>
|
|||||||
* 知识库详情
|
* 知识库详情
|
||||||
* @param 参数 dataset_id
|
* @param 参数 dataset_id
|
||||||
*/
|
*/
|
||||||
const getDatesetDetail: (dataset_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
const getDatasetDetail: (dataset_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||||
dataset_id,
|
dataset_id,
|
||||||
loading
|
loading
|
||||||
) => {
|
) => {
|
||||||
@ -113,7 +113,7 @@ const getDatesetDetail: (dataset_id: string, loading?: Ref<boolean>) => Promise<
|
|||||||
"desc": true
|
"desc": true
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
const putDateset: (dataset_id: string, data: any) => Promise<Result<any>> = (
|
const putDataset: (dataset_id: string, data: any) => Promise<Result<any>> = (
|
||||||
dataset_id,
|
dataset_id,
|
||||||
data: any
|
data: any
|
||||||
) => {
|
) => {
|
||||||
@ -152,7 +152,7 @@ const getDatasetHitTest: (
|
|||||||
* @param 参数 dataset_id
|
* @param 参数 dataset_id
|
||||||
* @query 参数 sync_type // 同步类型->replace:替换同步,complete:完整同步
|
* @query 参数 sync_type // 同步类型->replace:替换同步,complete:完整同步
|
||||||
*/
|
*/
|
||||||
const putSyncWebDateset: (
|
const putSyncWebDataset: (
|
||||||
dataset_id: string,
|
dataset_id: string,
|
||||||
sync_type: string,
|
sync_type: string,
|
||||||
loading?: Ref<boolean>
|
loading?: Ref<boolean>
|
||||||
@ -161,14 +161,14 @@ const putSyncWebDateset: (
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getDateset,
|
getDataset,
|
||||||
getAllDateset,
|
getAllDataset,
|
||||||
delDateset,
|
delDataset,
|
||||||
postDateset,
|
postDataset,
|
||||||
getDatesetDetail,
|
getDatasetDetail,
|
||||||
putDateset,
|
putDataset,
|
||||||
listUsableApplication,
|
listUsableApplication,
|
||||||
getDatasetHitTest,
|
getDatasetHitTest,
|
||||||
postWebDateset,
|
postWebDataset,
|
||||||
putSyncWebDateset
|
putSyncWebDataset
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
<template v-for="(item, index) in prologueList" :key="index">
|
<template v-for="(item, index) in prologueList" :key="index">
|
||||||
<div
|
<div
|
||||||
v-if="item.type === 'question'"
|
v-if="item.type === 'question'"
|
||||||
@click="quickProblemHandel(item.str)"
|
@click="quickProblemHandle(item.str)"
|
||||||
class="problem-button ellipsis-2 mb-8"
|
class="problem-button ellipsis-2 mb-8"
|
||||||
:class="log ? 'disabled' : 'cursor'"
|
:class="log ? 'disabled' : 'cursor'"
|
||||||
>
|
>
|
||||||
@ -266,7 +266,7 @@ function openParagraph(row: any, id?: string) {
|
|||||||
ParagraphSourceDialogRef.value.open(row, id)
|
ParagraphSourceDialogRef.value.open(row, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
function quickProblemHandel(val: string) {
|
function quickProblemHandle(val: string) {
|
||||||
if (!props.log && !loading.value) {
|
if (!props.log && !loading.value) {
|
||||||
// inputValue.value = val
|
// inputValue.value = val
|
||||||
// nextTick(() => {
|
// nextTick(() => {
|
||||||
|
|||||||
@ -34,8 +34,8 @@ function initChart() {
|
|||||||
myChart = echarts.init(document.getElementById(props.id))
|
myChart = echarts.init(document.getElementById(props.id))
|
||||||
}
|
}
|
||||||
const series: any = []
|
const series: any = []
|
||||||
if (props.option?.yDatas?.length) {
|
if (props.option?.yData?.length) {
|
||||||
props.option?.yDatas.forEach((item: any, index: number) => {
|
props.option?.yData.forEach((item: any, index: number) => {
|
||||||
series.push({
|
series.push({
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: color[index]
|
color: color[index]
|
||||||
@ -83,7 +83,7 @@ function initChart() {
|
|||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: props.option.xDatas
|
data: props.option.xData
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
|
|||||||
@ -23,7 +23,7 @@ defineProps({
|
|||||||
option: {
|
option: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
} // { title , xDatas, yDatas, formatStr }
|
} // { title , xData, yData, formatStr }
|
||||||
})
|
})
|
||||||
|
|
||||||
const typeComponentMap = { line } as any
|
const typeComponentMap = { line } as any
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
<el-button type="primary" @click="submitHandle" :disabled="loading">创建</el-button>
|
<el-button type="primary" @click="submitHandle" :disabled="loading">创建</el-button>
|
||||||
<el-button @click="showInput = false" :disabled="loading">取消</el-button>
|
<el-button @click="showInput = false" :disabled="loading">取消</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-else @click="quickCreateHandel" class="w-full">
|
<div v-else @click="quickCreateHandle" class="w-full">
|
||||||
<el-button type="primary" link class="quich-button">
|
<el-button type="primary" link class="quich-button">
|
||||||
<el-icon><Plus /></el-icon>
|
<el-icon><Plus /></el-icon>
|
||||||
<span class="ml-4">{{ quickCreatePlaceholder }}</span>
|
<span class="ml-4">{{ quickCreatePlaceholder }}</span>
|
||||||
@ -104,7 +104,7 @@ function submitHandle() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function quickCreateHandel() {
|
function quickCreateHandle() {
|
||||||
showInput.value = true
|
showInput.value = true
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
quickInputRef.value?.focus()
|
quickInputRef.value?.focus()
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
:parent_field="formField.field + '.' + index"
|
:parent_field="formField.field + '.' + index"
|
||||||
></DynamicsForm>
|
></DynamicsForm>
|
||||||
<el-tooltip effect="dark" content="删除" placement="top">
|
<el-tooltip effect="dark" content="删除" placement="top">
|
||||||
<el-button text @click.stop="deleteDateset(item)" class="delete-button">
|
<el-button text @click.stop="deleteDataset(item)" class="delete-button">
|
||||||
<el-icon><Delete /></el-icon>
|
<el-icon><Delete /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@ -46,7 +46,7 @@ const props = defineProps<{
|
|||||||
const render_data = () => {
|
const render_data = () => {
|
||||||
return Promise.resolve(Result.success(props.formField.children as Array<FormField>))
|
return Promise.resolve(Result.success(props.formField.children as Array<FormField>))
|
||||||
}
|
}
|
||||||
const deleteDateset = (item: any) => {
|
const deleteDataset = (item: any) => {
|
||||||
_data.value = _data.value.filter((row) => row !== item)
|
_data.value = _data.value.filter((row) => row !== item)
|
||||||
}
|
}
|
||||||
const emit = defineEmits(['update:modelValue', 'change'])
|
const emit = defineEmits(['update:modelValue', 'change'])
|
||||||
|
|||||||
@ -150,7 +150,7 @@ function changeMenu(id: string) {
|
|||||||
function getDataset() {
|
function getDataset() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
dataset
|
dataset
|
||||||
.asyncGetAllDateset()
|
.asyncGetAllDataset()
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
list.value = res.data
|
list.value = res.data
|
||||||
common.saveBreadcrumb(list.value)
|
common.saveBreadcrumb(list.value)
|
||||||
|
|||||||
@ -35,7 +35,7 @@ const applicationRouter = {
|
|||||||
parentPath: '/application/:id',
|
parentPath: '/application/:id',
|
||||||
parentName: 'ApplicationDetail'
|
parentName: 'ApplicationDetail'
|
||||||
},
|
},
|
||||||
component: () => import('@/views/applicaiton-overview/index.vue')
|
component: () => import('@/views/application-overview/index.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'setting',
|
path: 'setting',
|
||||||
|
|||||||
@ -27,10 +27,10 @@ const useDatasetStore = defineStore({
|
|||||||
saveDocumentsFile(file: UploadUserFile[]) {
|
saveDocumentsFile(file: UploadUserFile[]) {
|
||||||
this.documentsFiles = file
|
this.documentsFiles = file
|
||||||
},
|
},
|
||||||
async asyncGetAllDateset(loading?: Ref<boolean>) {
|
async asyncGetAllDataset(loading?: Ref<boolean>) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
datasetApi
|
datasetApi
|
||||||
.getAllDateset(loading)
|
.getAllDataset(loading)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
resolve(data)
|
resolve(data)
|
||||||
})
|
})
|
||||||
@ -39,10 +39,10 @@ const useDatasetStore = defineStore({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async asyncGetDatesetDetail(id: string, loading?: Ref<boolean>) {
|
async asyncGetDatasetDetail(id: string, loading?: Ref<boolean>) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
datasetApi
|
datasetApi
|
||||||
.getDatesetDetail(id, loading)
|
.getDatasetDetail(id, loading)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
resolve(data)
|
resolve(data)
|
||||||
})
|
})
|
||||||
@ -51,10 +51,10 @@ const useDatasetStore = defineStore({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async asyncSyncDateset(id: string, sync_type: string, loading?: Ref<boolean>) {
|
async asyncSyncDataset(id: string, sync_type: string, loading?: Ref<boolean>) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
datasetApi
|
datasetApi
|
||||||
.putSyncWebDateset(id, sync_type, loading)
|
.putSyncWebDataset(id, sync_type, loading)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
resolve(data)
|
resolve(data)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -168,7 +168,7 @@
|
|||||||
.el-checkbox {
|
.el-checkbox {
|
||||||
height: 23px;
|
height: 23px;
|
||||||
}
|
}
|
||||||
tr.hightlight {
|
tr.highlight {
|
||||||
background: var(--el-table-current-row-bg-color);
|
background: var(--el-table-current-row-bg-color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,10 +86,10 @@ class Theme {
|
|||||||
/**
|
/**
|
||||||
* 转换外推数据
|
* 转换外推数据
|
||||||
* @param setting 设置
|
* @param setting 设置
|
||||||
* @param inferDatas 外推数据
|
* @param inferData 外推数据
|
||||||
*/
|
*/
|
||||||
mapInferData = (setting: ThemeSetting, inferDatas: Array<InferData>) => {
|
mapInferData = (setting: ThemeSetting, inferData: Array<InferData>) => {
|
||||||
return inferDatas
|
return inferData
|
||||||
.map((itemData) => {
|
.map((itemData) => {
|
||||||
return this.mapInferMainStyle(setting, itemData)
|
return this.mapInferMainStyle(setting, itemData)
|
||||||
})
|
})
|
||||||
@ -173,7 +173,7 @@ class Theme {
|
|||||||
*
|
*
|
||||||
* @param setting 主题设置
|
* @param setting 主题设置
|
||||||
* @param keyValue 主题键值对数据
|
* @param keyValue 主题键值对数据
|
||||||
* @param inferDatas 外推数据
|
* @param inferData 外推数据
|
||||||
* @returns 合并后的键值对数据
|
* @returns 合并后的键值对数据
|
||||||
*/
|
*/
|
||||||
tokeyValueStyle = () => {
|
tokeyValueStyle = () => {
|
||||||
|
|||||||
@ -50,7 +50,7 @@ export function isRightType(name: string) {
|
|||||||
/*
|
/*
|
||||||
从指定数组中过滤出对应的对象
|
从指定数组中过滤出对应的对象
|
||||||
*/
|
*/
|
||||||
export function realatedObject(list: any, val: any, attr: string) {
|
export function relatedObject(list: any, val: any, attr: string) {
|
||||||
const filterData: any = list.filter((item: any) => item[attr] === val)?.[0]
|
const filterData: any = list.filter((item: any) => item[attr] === val)?.[0]
|
||||||
return filterData || null
|
return filterData || null
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,8 +76,8 @@ const statisticsType = computed(() => [
|
|||||||
],
|
],
|
||||||
option: {
|
option: {
|
||||||
title: '用户总数',
|
title: '用户总数',
|
||||||
xDatas: getAttrsArray(props.data, 'day'),
|
xData: getAttrsArray(props.data, 'day'),
|
||||||
yDatas: [
|
yData: [
|
||||||
{
|
{
|
||||||
name: '用户总数',
|
name: '用户总数',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
@ -102,8 +102,8 @@ const statisticsType = computed(() => [
|
|||||||
sum: [getSum(getAttrsArray(props.data, 'chat_record_count') || 0)],
|
sum: [getSum(getAttrsArray(props.data, 'chat_record_count') || 0)],
|
||||||
option: {
|
option: {
|
||||||
title: '提问次数',
|
title: '提问次数',
|
||||||
xDatas: getAttrsArray(props.data, 'day'),
|
xData: getAttrsArray(props.data, 'day'),
|
||||||
yDatas: [
|
yData: [
|
||||||
{
|
{
|
||||||
type: 'line',
|
type: 'line',
|
||||||
data: getAttrsArray(props.data, 'chat_record_count')
|
data: getAttrsArray(props.data, 'chat_record_count')
|
||||||
@ -120,8 +120,8 @@ const statisticsType = computed(() => [
|
|||||||
sum: [getSum(getAttrsArray(props.data, 'tokens_num') || 0)],
|
sum: [getSum(getAttrsArray(props.data, 'tokens_num') || 0)],
|
||||||
option: {
|
option: {
|
||||||
title: 'Tokens 总数',
|
title: 'Tokens 总数',
|
||||||
xDatas: getAttrsArray(props.data, 'day'),
|
xData: getAttrsArray(props.data, 'day'),
|
||||||
yDatas: [
|
yData: [
|
||||||
{
|
{
|
||||||
type: 'line',
|
type: 'line',
|
||||||
data: getAttrsArray(props.data, 'tokens_num')
|
data: getAttrsArray(props.data, 'tokens_num')
|
||||||
@ -141,8 +141,8 @@ const statisticsType = computed(() => [
|
|||||||
],
|
],
|
||||||
option: {
|
option: {
|
||||||
title: '用户满意度',
|
title: '用户满意度',
|
||||||
xDatas: getAttrsArray(props.data, 'day'),
|
xData: getAttrsArray(props.data, 'day'),
|
||||||
yDatas: [
|
yData: [
|
||||||
{
|
{
|
||||||
name: '赞同',
|
name: '赞同',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
|
|||||||
@ -60,7 +60,7 @@
|
|||||||
<el-option-group
|
<el-option-group
|
||||||
v-for="(value, label) in modelOptions"
|
v-for="(value, label) in modelOptions"
|
||||||
:key="value"
|
:key="value"
|
||||||
:label="realatedObject(providerOptions, label, 'provider')?.name"
|
:label="relatedObject(providerOptions, label, 'provider')?.name"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in value.filter((v: any) => v.status === 'SUCCESS')"
|
v-for="item in value.filter((v: any) => v.status === 'SUCCESS')"
|
||||||
@ -71,7 +71,7 @@
|
|||||||
>
|
>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<span
|
<span
|
||||||
v-html="realatedObject(providerOptions, label, 'provider')?.icon"
|
v-html="relatedObject(providerOptions, label, 'provider')?.icon"
|
||||||
class="model-icon mr-8"
|
class="model-icon mr-8"
|
||||||
></span>
|
></span>
|
||||||
<span>{{ item.name }}</span>
|
<span>{{ item.name }}</span>
|
||||||
@ -91,7 +91,7 @@
|
|||||||
>
|
>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<span
|
<span
|
||||||
v-html="realatedObject(providerOptions, label, 'provider')?.icon"
|
v-html="relatedObject(providerOptions, label, 'provider')?.icon"
|
||||||
class="model-icon mr-8"
|
class="model-icon mr-8"
|
||||||
></span>
|
></span>
|
||||||
<span>{{ item.name }}</span>
|
<span>{{ item.name }}</span>
|
||||||
@ -242,7 +242,7 @@
|
|||||||
<div class="flex-between">
|
<div class="flex-between">
|
||||||
<div class="flex align-center">
|
<div class="flex align-center">
|
||||||
<AppAvatar
|
<AppAvatar
|
||||||
v-if="realatedObject(datasetList, item, 'id')?.type === '1'"
|
v-if="relatedObject(datasetList, item, 'id')?.type === '1'"
|
||||||
class="mr-8 avatar-purple"
|
class="mr-8 avatar-purple"
|
||||||
shape="square"
|
shape="square"
|
||||||
:size="32"
|
:size="32"
|
||||||
@ -254,7 +254,7 @@
|
|||||||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
||||||
</AppAvatar>
|
</AppAvatar>
|
||||||
<div class="ellipsis">
|
<div class="ellipsis">
|
||||||
{{ realatedObject(datasetList, item, 'id')?.name }}
|
{{ relatedObject(datasetList, item, 'id')?.name }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-button text @click="removeDataset(item)">
|
<el-button text @click="removeDataset(item)">
|
||||||
@ -338,7 +338,7 @@ import applicationApi from '@/api/application'
|
|||||||
import type { FormInstance, FormRules } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import type { ApplicationFormType } from '@/api/type/application'
|
import type { ApplicationFormType } from '@/api/type/application'
|
||||||
import type { Provider } from '@/api/type/model'
|
import type { Provider } from '@/api/type/model'
|
||||||
import { realatedObject } from '@/utils/utils'
|
import { relatedObject } from '@/utils/utils'
|
||||||
import { MsgSuccess } from '@/utils/message'
|
import { MsgSuccess } from '@/utils/message'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
|
|
||||||
@ -474,7 +474,7 @@ function getDataset() {
|
|||||||
datasetList.value = res.data
|
datasetList.value = res.data
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
dataset.asyncGetAllDateset(datasetLoading).then((res: any) => {
|
dataset.asyncGetAllDataset(datasetLoading).then((res: any) => {
|
||||||
datasetList.value = res.data?.filter((v: any) => v.user_id === user.userInfo?.id)
|
datasetList.value = res.data?.filter((v: any) => v.user_id === user.userInfo?.id)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -117,7 +117,7 @@ function submit() {
|
|||||||
loading.value = false
|
loading.value = false
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
datasetApi.postDateset(obj, loading).then((res) => {
|
datasetApi.postDataset(obj, loading).then((res) => {
|
||||||
successInfo.value = res.data
|
successInfo.value = res.data
|
||||||
active.value = 2
|
active.value = 2
|
||||||
clearStore()
|
clearStore()
|
||||||
|
|||||||
@ -126,7 +126,7 @@ async function submit() {
|
|||||||
...BaseFormRef.value.form
|
...BaseFormRef.value.form
|
||||||
}
|
}
|
||||||
datasetApi
|
datasetApi
|
||||||
.putDateset(id, obj)
|
.putDataset(id, obj)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
MsgSuccess('保存成功')
|
MsgSuccess('保存成功')
|
||||||
loading.value = false
|
loading.value = false
|
||||||
@ -140,7 +140,7 @@ async function submit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getDetail() {
|
function getDetail() {
|
||||||
dataset.asyncGetDatesetDetail(id, loading).then((res: any) => {
|
dataset.asyncGetDatasetDetail(id, loading).then((res: any) => {
|
||||||
detail.value = res.data
|
detail.value = res.data
|
||||||
if (detail.value.type === '1') {
|
if (detail.value.type === '1') {
|
||||||
form.value = res.data.meta
|
form.value = res.data.meta
|
||||||
|
|||||||
@ -59,7 +59,7 @@ const open = (id: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
dataset.asyncSyncDateset(datasetId.value, method.value, loading).then((res: any) => {
|
dataset.asyncSyncDataset(datasetId.value, method.value, loading).then((res: any) => {
|
||||||
emit('refresh', res.data)
|
emit('refresh', res.data)
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
})
|
})
|
||||||
|
|||||||
@ -49,7 +49,7 @@
|
|||||||
<el-text type="info">{{ filesize(item && item?.size) || '0K' }}</el-text>
|
<el-text type="info">{{ filesize(item && item?.size) || '0K' }}</el-text>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-button text @click="deleteFlie(index)">
|
<el-button text @click="deleteFile(index)">
|
||||||
<el-icon><Delete /></el-icon>
|
<el-icon><Delete /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -78,7 +78,7 @@ const FormRef = ref()
|
|||||||
watch(form.value, (value) => {
|
watch(form.value, (value) => {
|
||||||
dataset.saveDocumentsFile(value.fileList)
|
dataset.saveDocumentsFile(value.fileList)
|
||||||
})
|
})
|
||||||
function deleteFlie(index: number) {
|
function deleteFile(index: number) {
|
||||||
form.value.fileList.splice(index, 1)
|
form.value.fileList.splice(index, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,7 @@
|
|||||||
@click.stop="router.push({ path: `/dataset/${item.id}/setting` })"
|
@click.stop="router.push({ path: `/dataset/${item.id}/setting` })"
|
||||||
>设置</el-dropdown-item
|
>设置</el-dropdown-item
|
||||||
>
|
>
|
||||||
<el-dropdown-item icon="Delete" @click.stop="deleteDateset(item)"
|
<el-dropdown-item icon="Delete" @click.stop="deleteDataset(item)"
|
||||||
>删除</el-dropdown-item
|
>删除</el-dropdown-item
|
||||||
>
|
>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
@ -131,7 +131,7 @@ function searchHandle() {
|
|||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteDateset(row: any) {
|
function deleteDataset(row: any) {
|
||||||
MsgConfirm(
|
MsgConfirm(
|
||||||
`是否删除知识库:${row.name} ?`,
|
`是否删除知识库:${row.name} ?`,
|
||||||
`此知识库关联 ${row.application_mapping_count} 个应用,删除后无法恢复,请谨慎操作。`,
|
`此知识库关联 ${row.application_mapping_count} 个应用,删除后无法恢复,请谨慎操作。`,
|
||||||
@ -141,7 +141,7 @@ function deleteDateset(row: any) {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
datasetApi.delDateset(row.id, loading).then(() => {
|
datasetApi.delDataset(row.id, loading).then(() => {
|
||||||
const index = datasetList.value.findIndex((v) => v.id === row.id)
|
const index = datasetList.value.findIndex((v) => v.id === row.id)
|
||||||
datasetList.value.splice(index, 1)
|
datasetList.value.splice(index, 1)
|
||||||
MsgSuccess('删除成功')
|
MsgSuccess('删除成功')
|
||||||
@ -152,7 +152,7 @@ function deleteDateset(row: any) {
|
|||||||
|
|
||||||
function getList() {
|
function getList() {
|
||||||
datasetApi
|
datasetApi
|
||||||
.getDateset(paginationConfig, searchValue.value && { name: searchValue.value }, loading)
|
.getDataset(paginationConfig, searchValue.value && { name: searchValue.value }, loading)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
paginationConfig.total = res.data.total
|
paginationConfig.total = res.data.total
|
||||||
datasetList.value = [...datasetList.value, ...res.data.records]
|
datasetList.value = [...datasetList.value, ...res.data.records]
|
||||||
|
|||||||
@ -137,7 +137,7 @@ const onSubmit = async () => {
|
|||||||
await webFormRef.value.validate((valid: any) => {
|
await webFormRef.value.validate((valid: any) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const obj = { ...BaseFormRef.value.form, ...form.value }
|
const obj = { ...BaseFormRef.value.form, ...form.value }
|
||||||
datasetApi.postWebDateset(obj, loading).then((res) => {
|
datasetApi.postWebDataset(obj, loading).then((res) => {
|
||||||
MsgSuccess('提交成功')
|
MsgSuccess('提交成功')
|
||||||
dataset.saveBaseInfo(null)
|
dataset.saveBaseInfo(null)
|
||||||
dataset.saveWebInfo(null)
|
dataset.saveWebInfo(null)
|
||||||
|
|||||||
@ -392,7 +392,7 @@ function getList(bool?: boolean) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getDetail() {
|
function getDetail() {
|
||||||
dataset.asyncGetDatesetDetail(id, loading).then((res: any) => {
|
dataset.asyncGetDatasetDetail(id, loading).then((res: any) => {
|
||||||
datasetDetail.value = res.data
|
datasetDetail.value = res.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-drawer v-model="visible" size="60%" @close="closeHandel" class="chat-record-drawer">
|
<el-drawer v-model="visible" size="60%" @close="closeHandle" class="chat-record-drawer">
|
||||||
<template #header>
|
<template #header>
|
||||||
<h4>{{ currentAbstract }}</h4>
|
<h4>{{ currentAbstract }}</h4>
|
||||||
</template>
|
</template>
|
||||||
@ -77,7 +77,7 @@ const paginationConfig = reactive({
|
|||||||
total: 0
|
total: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
function closeHandel() {
|
function closeHandle() {
|
||||||
recordList.value = []
|
recordList.value = []
|
||||||
paginationConfig.total = 0
|
paginationConfig.total = 0
|
||||||
paginationConfig.current_page = 1
|
paginationConfig.current_page = 1
|
||||||
|
|||||||
@ -270,7 +270,7 @@ function rowClickHandle(row: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const setRowClass = ({ row }: any) => {
|
const setRowClass = ({ row }: any) => {
|
||||||
return currentChatId.value === row?.id ? 'hightlight' : ''
|
return currentChatId.value === row?.id ? 'highlight' : ''
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteLog(row: any) {
|
function deleteLog(row: any) {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-drawer v-model="visible" size="60%" @close="closeHandel">
|
<el-drawer v-model="visible" size="60%" @close="closeHandle">
|
||||||
<template #header>
|
<template #header>
|
||||||
<h4>问题详情</h4>
|
<h4>问题详情</h4>
|
||||||
</template>
|
</template>
|
||||||
@ -148,7 +148,7 @@ function editName(val: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeHandel() {
|
function closeHandle() {
|
||||||
paragraphList.value = []
|
paragraphList.value = []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -304,7 +304,7 @@ function rowClickHandle(row: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const setRowClass = ({ row }: any) => {
|
const setRowClass = ({ row }: any) => {
|
||||||
return currentClickId.value === row?.id ? 'hightlight' : ''
|
return currentClickId.value === row?.id ? 'highlight' : ''
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSizeChange() {
|
function handleSizeChange() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user