feat: api
This commit is contained in:
parent
4a90127a92
commit
6724f6e9d1
@ -4,17 +4,20 @@
|
|||||||
:title="data.title || '-'"
|
:title="data.title || '-'"
|
||||||
class="paragraph-source-card cursor mb-8 paragraph-source-card-height"
|
class="paragraph-source-card cursor mb-8 paragraph-source-card-height"
|
||||||
:class="data.is_active ? '' : 'disabled'"
|
:class="data.is_active ? '' : 'disabled'"
|
||||||
:showIcon="false"
|
|
||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<el-avatar class="mr-12 avatar-light" :size="22"> {{ index + 1 + '' }}</el-avatar>
|
<el-avatar class="mr-12 avatar-light" :size="22"> {{ index + 1 + '' }}</el-avatar>
|
||||||
</template>
|
</template>
|
||||||
<div class="active-button primary">{{ score?.toFixed(3) || data.similarity?.toFixed(3) }}</div>
|
<template #tag>
|
||||||
<template #description>
|
<div class="primary">
|
||||||
<el-scrollbar height="150">
|
{{ score?.toFixed(3) || data.similarity?.toFixed(3) }}
|
||||||
<MdPreview ref="editorRef" editorId="preview-only" :modelValue="content" noImgZoomIn />
|
</div>
|
||||||
</el-scrollbar>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<el-scrollbar height="150">
|
||||||
|
<MdPreview ref="editorRef" editorId="preview-only" :modelValue="content" noImgZoomIn />
|
||||||
|
</el-scrollbar>
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="footer-content flex-between">
|
<div class="footer-content flex-between">
|
||||||
<el-text class="flex align-center item">
|
<el-text class="flex align-center item">
|
||||||
@ -56,20 +59,20 @@ import { computed } from 'vue'
|
|||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {}
|
default: () => {},
|
||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: '',
|
||||||
},
|
},
|
||||||
index: {
|
index: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0,
|
||||||
},
|
},
|
||||||
score: {
|
score: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null
|
default: null,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
const isMetaObject = computed(() => typeof props.data.meta === 'object')
|
const isMetaObject = computed(() => typeof props.data.meta === 'object')
|
||||||
const parsedMeta = computed(() => {
|
const parsedMeta = computed(() => {
|
||||||
|
|||||||
@ -206,4 +206,25 @@ export default {
|
|||||||
])
|
])
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
'app-quxiaoguanlian': {
|
||||||
|
iconReader: () => {
|
||||||
|
return h('i', [
|
||||||
|
h(
|
||||||
|
'svg',
|
||||||
|
{
|
||||||
|
style: { height: '100%', width: '100%' },
|
||||||
|
viewBox: '0 0 1024 1024',
|
||||||
|
version: '1.1',
|
||||||
|
xmlns: 'http://www.w3.org/2000/svg',
|
||||||
|
},
|
||||||
|
[
|
||||||
|
h('path', {
|
||||||
|
d: 'M544 298.688a32 32 0 0 1 32-32h320c41.216 0 74.688 33.408 74.688 74.624V640c0 41.216-33.472 74.688-74.688 74.688h-85.312a32 32 0 1 1 0-64H896a10.688 10.688 0 0 0 10.688-10.688V341.312A10.688 10.688 0 0 0 896 330.688H576a32 32 0 0 1-32-32zM53.312 341.312c0-41.216 33.472-74.624 74.688-74.624h106.688a32 32 0 1 1 0 64H128a10.688 10.688 0 0 0-10.688 10.624V640c0 5.888 4.8 10.688 10.688 10.688h320a32 32 0 1 1 0 64H128A74.688 74.688 0 0 1 53.312 640V341.312zM282.432 100.416a32 32 0 0 1 43.84 11.392l426.624 725.312a32 32 0 0 1-55.168 32.448L271.104 144.256a32 32 0 0 1 11.328-43.84zM650.688 490.688a32 32 0 0 1 32-32H768a32 32 0 1 1 0 64h-85.312a32 32 0 0 1-32-32zM224 490.688a32 32 0 0 1 32-32h85.312a32 32 0 1 1 0 64H256a32 32 0 0 1-32-32z',
|
||||||
|
fill: 'currentColor',
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
])
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,9 +6,6 @@ import useThemeStore from './modules/theme'
|
|||||||
import useKnowledgeStore from './modules/knowledge'
|
import useKnowledgeStore from './modules/knowledge'
|
||||||
import useModelStore from './modules/model'
|
import useModelStore from './modules/model'
|
||||||
import usePromptStore from './modules/prompt'
|
import usePromptStore from './modules/prompt'
|
||||||
import useProblemStore from './modules/problem'
|
|
||||||
import useParagraphStore from './modules/paragraph'
|
|
||||||
import useDocumentStore from './modules/document'
|
|
||||||
import useApplicationStore from './modules/application'
|
import useApplicationStore from './modules/application'
|
||||||
import useChatLogStore from './modules/chat-log'
|
import useChatLogStore from './modules/chat-log'
|
||||||
import useChatUserStore from './modules/chat-user'
|
import useChatUserStore from './modules/chat-user'
|
||||||
@ -22,9 +19,6 @@ const useStore = () => ({
|
|||||||
knowledge: useKnowledgeStore(),
|
knowledge: useKnowledgeStore(),
|
||||||
model: useModelStore(),
|
model: useModelStore(),
|
||||||
prompt: usePromptStore(),
|
prompt: usePromptStore(),
|
||||||
problem: useProblemStore(),
|
|
||||||
paragraph: useParagraphStore(),
|
|
||||||
document: useDocumentStore(),
|
|
||||||
application: useApplicationStore(),
|
application: useApplicationStore(),
|
||||||
chatLog: useChatLogStore(),
|
chatLog: useChatLogStore(),
|
||||||
chatUser: useChatUserStore(),
|
chatUser: useChatUserStore(),
|
||||||
|
|||||||
@ -1,27 +0,0 @@
|
|||||||
import { defineStore } from 'pinia'
|
|
||||||
import { type Ref } from 'vue'
|
|
||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
|
||||||
|
|
||||||
const useDocumentStore = defineStore('document', {
|
|
||||||
state: () => ({}),
|
|
||||||
actions: {
|
|
||||||
async asyncGetKnowledgeDocument(
|
|
||||||
id: string,
|
|
||||||
systemType: 'systemShare' | 'workspace' | 'systemManage' = 'workspace',
|
|
||||||
loading?: Ref<boolean>,
|
|
||||||
) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
loadSharedApi({ type: 'document', systemType })
|
|
||||||
.getDocumentList(id, loading)
|
|
||||||
.then((res: any) => {
|
|
||||||
resolve(res)
|
|
||||||
})
|
|
||||||
.catch((error: any) => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
export default useDocumentStore
|
|
||||||
@ -1,11 +1,7 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import type { knowledgeData } from '@/api/type/knowledge'
|
import type { knowledgeData } from '@/api/type/knowledge'
|
||||||
import type { UploadUserFile } from 'element-plus'
|
import type { UploadUserFile } from 'element-plus'
|
||||||
import type { pageRequest } from '@/api/type/common'
|
|
||||||
import { type Ref } from 'vue'
|
import { type Ref } from 'vue'
|
||||||
import useUserStore from './user'
|
|
||||||
import useFolderStore from './folder'
|
|
||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
|
||||||
import knowledgeApi from '@/api/knowledge/knowledge'
|
import knowledgeApi from '@/api/knowledge/knowledge'
|
||||||
|
|
||||||
export interface knowledgeStateTypes {
|
export interface knowledgeStateTypes {
|
||||||
@ -40,31 +36,7 @@ const useKnowledgeStore = defineStore('knowledge', {
|
|||||||
setKnowledgeList(list: any[]) {
|
setKnowledgeList(list: any[]) {
|
||||||
this.knowledgeList = list
|
this.knowledgeList = list
|
||||||
},
|
},
|
||||||
async asyncGetKnowledgeListPage(
|
|
||||||
page: pageRequest,
|
|
||||||
isShared: boolean | undefined,
|
|
||||||
systemType: 'systemShare' | 'workspace' | 'systemManage' = 'workspace',
|
|
||||||
paramsData: any,
|
|
||||||
loading?: Ref<boolean>,
|
|
||||||
) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
const folder = useFolderStore()
|
|
||||||
const user = useUserStore()
|
|
||||||
const params = {
|
|
||||||
folder_id: folder.currentFolder?.id || user.getWorkspaceId(),
|
|
||||||
scope: systemType === 'systemShare' ? 'SHARED' : 'WORKSPACE',
|
|
||||||
...paramsData,
|
|
||||||
}
|
|
||||||
loadSharedApi({ type: 'knowledge', isShared, systemType })
|
|
||||||
.getKnowledgeListPage(page, params, loading)
|
|
||||||
.then((res: any) => {
|
|
||||||
resolve(res)
|
|
||||||
})
|
|
||||||
.catch((error: any) => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async asyncGetFolderKnowledge(folder_id?: string, loading?: Ref<boolean>) {
|
async asyncGetFolderKnowledge(folder_id?: string, loading?: Ref<boolean>) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const params = {
|
const params = {
|
||||||
|
|||||||
@ -1,20 +1,16 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { type Ref } from 'vue'
|
import { type Ref } from 'vue'
|
||||||
import ProviderApi from '@/api/model/provider'
|
import ProviderApi from '@/api/model/provider'
|
||||||
|
import ModelApi from '@/api/model/model'
|
||||||
import type { ListModelRequest } from '@/api/type/model'
|
import type { ListModelRequest } from '@/api/type/model'
|
||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
|
||||||
|
|
||||||
const useModelStore = defineStore('model', {
|
const useModelStore = defineStore('model', {
|
||||||
state: () => ({}),
|
state: () => ({}),
|
||||||
actions: {
|
actions: {
|
||||||
async asyncGetSelectModel(
|
// 仅限在应用下拉列表使用,非共享资源
|
||||||
systemType: 'systemShare' | 'workspace' | 'systemManage' = 'workspace',
|
async asyncGetSelectModel(data?: ListModelRequest, loading?: Ref<boolean>) {
|
||||||
data?: ListModelRequest,
|
|
||||||
loading?: Ref<boolean>,
|
|
||||||
) {
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
loadSharedApi({ type: 'model', systemType })
|
ModelApi.getSelectModelList(data, loading)
|
||||||
.getSelectModelList(data, loading)
|
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
resolve(res)
|
resolve(res)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,91 +0,0 @@
|
|||||||
import { defineStore } from 'pinia'
|
|
||||||
import paragraphApi from '@/api/knowledge/paragraph'
|
|
||||||
import type { Ref } from 'vue'
|
|
||||||
|
|
||||||
const useParagraphStore = defineStore('paragraph', {
|
|
||||||
state: () => ({}),
|
|
||||||
actions: {
|
|
||||||
async asyncPutParagraph(
|
|
||||||
knowledgeId: string,
|
|
||||||
documentId: string,
|
|
||||||
paragraphId: string,
|
|
||||||
data: any,
|
|
||||||
loading?: Ref<boolean>,
|
|
||||||
) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
paragraphApi
|
|
||||||
.putParagraph(knowledgeId, documentId, paragraphId, data, loading)
|
|
||||||
.then((data) => {
|
|
||||||
resolve(data)
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
async asyncDelParagraph(
|
|
||||||
knowledgeId: string,
|
|
||||||
documentId: string,
|
|
||||||
paragraphId: string,
|
|
||||||
loading?: Ref<boolean>,
|
|
||||||
) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
paragraphApi
|
|
||||||
.delParagraph(knowledgeId, documentId, paragraphId, loading)
|
|
||||||
.then((data) => {
|
|
||||||
resolve(data)
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async asyncDisassociationProblem(
|
|
||||||
knowledgeId: string,
|
|
||||||
documentId: string,
|
|
||||||
paragraphId: string,
|
|
||||||
problemId: string,
|
|
||||||
loading?: Ref<boolean>,
|
|
||||||
) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
const obj = {
|
|
||||||
paragraph_id: paragraphId,
|
|
||||||
problem_id: problemId,
|
|
||||||
}
|
|
||||||
paragraphApi
|
|
||||||
.putDisassociationProblem(knowledgeId, documentId, obj, loading)
|
|
||||||
.then((data) => {
|
|
||||||
resolve(data)
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async asyncAssociationProblem(
|
|
||||||
knowledgeId: string,
|
|
||||||
documentId: string,
|
|
||||||
paragraphId: string,
|
|
||||||
problemId: string,
|
|
||||||
loading?: Ref<boolean>,
|
|
||||||
) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
const obj = {
|
|
||||||
paragraph_id: paragraphId,
|
|
||||||
problem_id: problemId,
|
|
||||||
}
|
|
||||||
paragraphApi
|
|
||||||
.putAssociationProblem(knowledgeId, documentId, obj, loading)
|
|
||||||
.then((data) => {
|
|
||||||
resolve(data)
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
export default useParagraphStore
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
import { defineStore } from 'pinia'
|
|
||||||
import { type Ref } from 'vue'
|
|
||||||
import problemApi from '@/api/knowledge/problem'
|
|
||||||
import type { pageRequest } from '@/api/type/common'
|
|
||||||
|
|
||||||
const useProblemStore = defineStore('problem', {
|
|
||||||
state: () => ({}),
|
|
||||||
actions: {
|
|
||||||
async asyncPostProblem(knowledgeId: string, data: any, loading?: Ref<boolean>) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
problemApi
|
|
||||||
.postProblems(knowledgeId, data, loading)
|
|
||||||
.then((data) => {
|
|
||||||
resolve(data)
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async asyncGetProblem(
|
|
||||||
knowledgeId: string,
|
|
||||||
page: pageRequest,
|
|
||||||
param: any,
|
|
||||||
loading?: Ref<boolean>,
|
|
||||||
) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
problemApi
|
|
||||||
.getProblemsPage(knowledgeId, page, param, loading)
|
|
||||||
.then((data) => {
|
|
||||||
resolve(data)
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
export default useProblemStore
|
|
||||||
@ -13,31 +13,6 @@ const useToolStore = defineStore('tool', {
|
|||||||
setToolList(list: any[]) {
|
setToolList(list: any[]) {
|
||||||
this.toolList = list
|
this.toolList = list
|
||||||
},
|
},
|
||||||
async asyncGetToolListPage(
|
|
||||||
page: pageRequest,
|
|
||||||
isShared: boolean | undefined,
|
|
||||||
systemType: 'systemShare' | 'workspace' | 'systemManage' = 'workspace',
|
|
||||||
paramsData: any,
|
|
||||||
loading?: Ref<boolean>,
|
|
||||||
) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
const folder = useFolderStore()
|
|
||||||
const user = useUserStore()
|
|
||||||
const params = {
|
|
||||||
folder_id: folder.currentFolder?.id || user.getWorkspaceId(),
|
|
||||||
scope: systemType === 'systemShare' ? 'SHARED' : 'WORKSPACE',
|
|
||||||
...paramsData,
|
|
||||||
}
|
|
||||||
loadSharedApi({ type: 'tool', isShared, systemType })
|
|
||||||
.getToolListPage(page, params, loading)
|
|
||||||
.then((res: any) => {
|
|
||||||
resolve(res)
|
|
||||||
})
|
|
||||||
.catch((error: any) => {
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -403,6 +403,17 @@ h5 {
|
|||||||
.color-input-placeholder {
|
.color-input-placeholder {
|
||||||
color: var(--app-input-color-placeholder);
|
color: var(--app-input-color-placeholder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
头像渐变背景
|
||||||
|
*/
|
||||||
|
.avatar-gradient {
|
||||||
|
background: var(--app-avatar-gradient-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar-light {
|
||||||
|
background: var(--el-color-primary-light-3);
|
||||||
|
}
|
||||||
.avatar-purple {
|
.avatar-purple {
|
||||||
background: #7f3bf5;
|
background: #7f3bf5;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,7 +103,7 @@ import imageApi from '@/api/image'
|
|||||||
import documentApi from '@/api/knowledge/document'
|
import documentApi from '@/api/knowledge/document'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
const { application, document, user } = useStore()
|
const { application, user } = useStore()
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
|
|||||||
@ -64,7 +64,7 @@ import { ref, watch, reactive } from 'vue'
|
|||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import type { FormInstance, FormRules } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import chatLogApi from '@/api/application/chat-log'
|
import chatLogApi from '@/api/application/chat-log'
|
||||||
import useStore from '@/stores'
|
import paragraphApi from '@/api/knowledge/paragraph'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||||
|
|
||||||
@ -73,8 +73,6 @@ const {
|
|||||||
params: { id },
|
params: { id },
|
||||||
} = route as any
|
} = route as any
|
||||||
|
|
||||||
const { paragraph } = useStore()
|
|
||||||
|
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
|
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
@ -119,14 +117,7 @@ function deleteMark() {
|
|||||||
|
|
||||||
function getMark(data: any) {
|
function getMark(data: any) {
|
||||||
chatLogApi
|
chatLogApi
|
||||||
.getMarkChatRecord(
|
.getMarkChatRecord(id as string, data.chat_id, data.id, data.knowledge, data.document, loading)
|
||||||
id as string,
|
|
||||||
data.chat_id,
|
|
||||||
data.id,
|
|
||||||
data.knowledge,
|
|
||||||
data.document,
|
|
||||||
loading,
|
|
||||||
)
|
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
if (res.data.length > 0) {
|
if (res.data.length > 0) {
|
||||||
form.value = res.data[0]
|
form.value = res.data[0]
|
||||||
@ -143,8 +134,8 @@ const submit = async (formEl: FormInstance) => {
|
|||||||
if (!formEl) return
|
if (!formEl) return
|
||||||
await formEl.validate((valid, fields) => {
|
await formEl.validate((valid, fields) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
paragraph
|
paragraphApi
|
||||||
.asyncPutParagraph(
|
.putParagraph(
|
||||||
form.value.knowledge,
|
form.value.knowledge,
|
||||||
form.value.document,
|
form.value.document,
|
||||||
form.value.id,
|
form.value.id,
|
||||||
|
|||||||
@ -305,7 +305,7 @@ import { ElTable } from 'element-plus'
|
|||||||
import { PermissionConst, RoleConst } from '@/utils/permission/data'
|
import { PermissionConst, RoleConst } from '@/utils/permission/data'
|
||||||
import { hasPermission } from '@/utils/permission/index'
|
import { hasPermission } from '@/utils/permission/index'
|
||||||
|
|
||||||
const { application, chatLog, document, user } = useStore()
|
const { application, chatLog, user } = useStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
params: { id },
|
params: { id },
|
||||||
|
|||||||
@ -64,7 +64,7 @@ import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
|||||||
import { MsgConfirm, MsgSuccess } from '@/utils/message'
|
import { MsgConfirm, MsgSuccess } from '@/utils/message'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
const { knowledge, document } = useStore()
|
const { knowledge } = useStore()
|
||||||
const documentsFiles = computed(() => knowledge.documentsFiles)
|
const documentsFiles = computed(() => knowledge.documentsFiles)
|
||||||
const documentsType = computed(() => knowledge.documentsType)
|
const documentsType = computed(() => knowledge.documentsType)
|
||||||
|
|
||||||
|
|||||||
@ -599,8 +599,6 @@ import GenerateRelatedDialog from '@/components/generate-related-dialog/index.vu
|
|||||||
import EmbeddingContentDialog from '@/views/document/component/EmbeddingContentDialog.vue'
|
import EmbeddingContentDialog from '@/views/document/component/EmbeddingContentDialog.vue'
|
||||||
import { TaskType, State } from '@/utils/status'
|
import { TaskType, State } from '@/utils/status'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import { PermissionConst, RoleConst } from '@/utils/permission/data'
|
|
||||||
import { hasPermission } from '@/utils/permission/index'
|
|
||||||
import permissionMap from '@/permission'
|
import permissionMap from '@/permission'
|
||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
|
|
||||||
@ -609,7 +607,7 @@ const router = useRouter()
|
|||||||
const {
|
const {
|
||||||
params: { id, folderId }, // id为knowledgeID
|
params: { id, folderId }, // id为knowledgeID
|
||||||
} = route as any
|
} = route as any
|
||||||
const { common, document } = useStore()
|
const { common } = useStore()
|
||||||
const storeKey = 'documents'
|
const storeKey = 'documents'
|
||||||
onBeforeRouteUpdate(() => {
|
onBeforeRouteUpdate(() => {
|
||||||
common.savePage(storeKey, null)
|
common.savePage(storeKey, null)
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
|
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
|
||||||
</el-avatar>
|
</el-avatar>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content ml-12">
|
||||||
<h4 class="text break-all">{{ questionTitle }}</h4>
|
<h4 class="text break-all">{{ questionTitle }}</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -51,13 +51,14 @@
|
|||||||
:description="item.content"
|
:description="item.content"
|
||||||
class="document-card layout-bg layout-bg cursor"
|
class="document-card layout-bg layout-bg cursor"
|
||||||
:class="item.is_active ? '' : 'disabled'"
|
:class="item.is_active ? '' : 'disabled'"
|
||||||
:showIcon="false"
|
|
||||||
@click="editParagraph(item)"
|
@click="editParagraph(item)"
|
||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<el-avatar class="mr-12 avatar-light" :size="22"> {{ index + 1 + '' }}</el-avatar>
|
<el-avatar class="avatar-light" :size="22"> {{ index + 1 + '' }}</el-avatar>
|
||||||
|
</template>
|
||||||
|
<template #tag>
|
||||||
|
<div class="primary">{{ item.similarity?.toFixed(3) }}</div>
|
||||||
</template>
|
</template>
|
||||||
<div class="active-button primary">{{ item.similarity?.toFixed(3) }}</div>
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="footer-content flex-between">
|
<div class="footer-content flex-between">
|
||||||
<el-text>
|
<el-text>
|
||||||
@ -84,7 +85,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</el-card>
|
</el-card>
|
||||||
<ParagraphDialog ref="ParagraphDialogRef" :title="title" @refresh="refresh" />
|
<ParagraphDialog
|
||||||
|
ref="ParagraphDialogRef"
|
||||||
|
:title="title"
|
||||||
|
@refresh="refresh"
|
||||||
|
:apiType="apiType"
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="hit-test__operate">
|
<div class="hit-test__operate">
|
||||||
<el-popover :visible="popoverVisible" placement="right-end" :width="500" trigger="click">
|
<el-popover :visible="popoverVisible" placement="right-end" :width="500" trigger="click">
|
||||||
@ -219,7 +225,6 @@
|
|||||||
import { nextTick, ref, onMounted, computed } from 'vue'
|
import { nextTick, ref, onMounted, computed } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
// import applicationApi from '@/api/application/application'
|
|
||||||
import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
|
import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
|
||||||
import { arraySort } from '@/utils/common'
|
import { arraySort } from '@/utils/common'
|
||||||
import emptyImg from '@/assets/hit-test-empty.png'
|
import emptyImg from '@/assets/hit-test-empty.png'
|
||||||
@ -227,7 +232,6 @@ import { t } from '@/locales'
|
|||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
meta: { activeMenu },
|
|
||||||
params: { id },
|
params: { id },
|
||||||
} = route as any
|
} = route as any
|
||||||
const apiType = computed(() => {
|
const apiType = computed(() => {
|
||||||
@ -261,13 +265,6 @@ const questionTitle = ref('')
|
|||||||
|
|
||||||
const isDisabledChart = computed(() => !inputValue.value)
|
const isDisabledChart = computed(() => !inputValue.value)
|
||||||
|
|
||||||
const isApplication = computed(() => {
|
|
||||||
return activeMenu.includes('application')
|
|
||||||
})
|
|
||||||
const isDataset = computed(() => {
|
|
||||||
return activeMenu.includes('knowledge')
|
|
||||||
})
|
|
||||||
|
|
||||||
function changeHandle(val: string) {
|
function changeHandle(val: string) {
|
||||||
if (val === 'keywords') {
|
if (val === 'keywords') {
|
||||||
cloneForm.value.similarity = 0
|
cloneForm.value.similarity = 0
|
||||||
@ -323,23 +320,14 @@ function getHitTestList() {
|
|||||||
query_text: inputValue.value,
|
query_text: inputValue.value,
|
||||||
...formInline.value,
|
...formInline.value,
|
||||||
}
|
}
|
||||||
if (isDataset.value) {
|
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
||||||
loadSharedApi({ type: 'knowledge', systemType: apiType.value })
|
.putKnowledgeHitTest(id, obj, loading)
|
||||||
.putKnowledgeHitTest(id, obj, loading)
|
.then((res: any) => {
|
||||||
.then((res: any) => {
|
paragraphDetail.value = res.data && arraySort(res.data, 'comprehensive_score', true)
|
||||||
paragraphDetail.value = res.data && arraySort(res.data, 'comprehensive_score', true)
|
questionTitle.value = inputValue.value
|
||||||
questionTitle.value = inputValue.value
|
inputValue.value = ''
|
||||||
inputValue.value = ''
|
first.value = false
|
||||||
first.value = false
|
})
|
||||||
})
|
|
||||||
} else if (isApplication.value) {
|
|
||||||
// applicationApi.getApplicationHitTest(id, obj, loading).then((res) => {
|
|
||||||
// paragraphDetail.value = res.data && arraySort(res.data, 'comprehensive_score', true)
|
|
||||||
// questionTitle.value = inputValue.value
|
|
||||||
// inputValue.value = ''
|
|
||||||
// first.value = false
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function refresh(data: any) {
|
function refresh(data: any) {
|
||||||
@ -438,11 +426,6 @@ onMounted(() => {})
|
|||||||
-webkit-line-clamp: 5 !important;
|
-webkit-line-clamp: 5 !important;
|
||||||
height: 110px;
|
height: 110px;
|
||||||
}
|
}
|
||||||
.active-button {
|
|
||||||
position: absolute;
|
|
||||||
right: 16px;
|
|
||||||
top: 16px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -44,9 +44,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted, onUnmounted, computed, watch } from 'vue'
|
import { ref, reactive, onMounted, onUnmounted, computed, watch } from 'vue'
|
||||||
import { groupBy } from 'lodash'
|
import { groupBy } from 'lodash'
|
||||||
import useStore from '@/stores'
|
|
||||||
import type { knowledgeData } from '@/api/type/knowledge'
|
import type { knowledgeData } from '@/api/type/knowledge'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
data?: {
|
data?: {
|
||||||
@ -55,7 +55,6 @@ const props = defineProps<{
|
|||||||
}
|
}
|
||||||
apiType: 'systemShare' | 'workspace' | 'systemManage'
|
apiType: 'systemShare' | 'workspace' | 'systemManage'
|
||||||
}>()
|
}>()
|
||||||
const { model } = useStore()
|
|
||||||
const form = ref<knowledgeData>({
|
const form = ref<knowledgeData>({
|
||||||
name: '',
|
name: '',
|
||||||
desc: '',
|
desc: '',
|
||||||
@ -116,11 +115,9 @@ function validate() {
|
|||||||
|
|
||||||
function getSelectModel() {
|
function getSelectModel() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
loadSharedApi({ type: 'model', systemType: props.apiType })
|
||||||
model
|
.getSelectModelList({ model_type: 'EMBEDDING' })
|
||||||
.asyncGetSelectModel(props.apiType, { model_type: 'EMBEDDING' })
|
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
|
|
||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
loading.value = false
|
loading.value = false
|
||||||
})
|
})
|
||||||
|
|||||||
@ -321,8 +321,6 @@ import { numberFormat } from '@/utils/common'
|
|||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import { useRouter, useRoute } from 'vue-router'
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
import { FolderSource } from '@/enums/common'
|
import { FolderSource } from '@/enums/common'
|
||||||
import { PermissionConst, RoleConst } from '@/utils/permission/data'
|
|
||||||
import { hasPermission } from '@/utils/permission/index'
|
|
||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
import permissionMap from '@/permission'
|
import permissionMap from '@/permission'
|
||||||
|
|
||||||
@ -481,10 +479,12 @@ watch(
|
|||||||
|
|
||||||
function getList() {
|
function getList() {
|
||||||
const params = {
|
const params = {
|
||||||
|
folder_id: folder.currentFolder?.id || user.getWorkspaceId(),
|
||||||
|
scope: apiType.value === 'systemShare' ? 'SHARED' : 'WORKSPACE',
|
||||||
[search_type.value]: search_form.value[search_type.value],
|
[search_type.value]: search_form.value[search_type.value],
|
||||||
}
|
}
|
||||||
knowledge
|
loadSharedApi({ type: 'knowledge', isShared: isShared.value, systemType: apiType.value })
|
||||||
.asyncGetKnowledgeListPage(paginationConfig, isShared.value, apiType.value, params, loading)
|
.getKnowledgeListPage(paginationConfig, params, loading)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
paginationConfig.total = res.data?.total
|
paginationConfig.total = res.data?.total
|
||||||
knowledge.setKnowledgeList([...knowledgeList.value, ...res.data.records])
|
knowledge.setKnowledgeList([...knowledgeList.value, ...res.data.records])
|
||||||
|
|||||||
@ -140,8 +140,6 @@ import QrCodeTab from '@/views/login/scanCompinents/QrCodeTab.vue'
|
|||||||
import {MsgConfirm, MsgError} from '@/utils/message.ts'
|
import {MsgConfirm, MsgError} from '@/utils/message.ts'
|
||||||
import * as dd from 'dingtalk-jsapi'
|
import * as dd from 'dingtalk-jsapi'
|
||||||
import {loadScript} from '@/utils/utils'
|
import {loadScript} from '@/utils/utils'
|
||||||
import {EditionConst} from '@/utils/permission/data'
|
|
||||||
import {hasPermission} from '@/utils/permission/index'
|
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const {login, user, theme} = useStore()
|
const {login, user, theme} = useStore()
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref, defineAsyncComponent } from 'vue'
|
import { onMounted, ref, defineAsyncComponent } from 'vue'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
|
const { login } = useStore()
|
||||||
interface Tab {
|
interface Tab {
|
||||||
key: string
|
key: string
|
||||||
value: string
|
value: string
|
||||||
@ -41,7 +41,7 @@ const activeKey = ref('')
|
|||||||
const allConfigs = ref<PlatformConfig[]>([])
|
const allConfigs = ref<PlatformConfig[]>([])
|
||||||
const config = ref<Config>({ app_key: '', app_secret: '' })
|
const config = ref<Config>({ app_key: '', app_secret: '' })
|
||||||
// const logoUrl = ref('')
|
// const logoUrl = ref('')
|
||||||
const { login } = useStore()
|
|
||||||
async function getPlatformInfo() {
|
async function getPlatformInfo() {
|
||||||
try {
|
try {
|
||||||
return await login.getQrSource()
|
return await login.getQrSource()
|
||||||
|
|||||||
@ -16,10 +16,10 @@ import { MsgError } from '@/utils/message'
|
|||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import { getBrowserLang } from '@/locales'
|
import { getBrowserLang } from '@/locales'
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const { login } = useStore()
|
||||||
const wwLogin = ref({})
|
const wwLogin = ref({})
|
||||||
const obj = ref<any>({ isWeComLogin: false })
|
const obj = ref<any>({ isWeComLogin: false })
|
||||||
const { login } = useStore()
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
config: {
|
config: {
|
||||||
|
|||||||
@ -131,12 +131,9 @@ import EditModel from '@/views/model/component/EditModel.vue'
|
|||||||
// import DownloadLoading from '@/components/loading/DownloadLoading.vue'
|
// import DownloadLoading from '@/components/loading/DownloadLoading.vue'
|
||||||
import { MsgConfirm } from '@/utils/message'
|
import { MsgConfirm } from '@/utils/message'
|
||||||
import { modelType } from '@/enums/model'
|
import { modelType } from '@/enums/model'
|
||||||
import useStore from '@/stores'
|
|
||||||
import ParamSettingDialog from './ParamSettingDialog.vue'
|
import ParamSettingDialog from './ParamSettingDialog.vue'
|
||||||
import AuthorizedWorkspace from '@/views/system-shared/AuthorizedWorkspaceDialog.vue'
|
import AuthorizedWorkspace from '@/views/system-shared/AuthorizedWorkspaceDialog.vue'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import { PermissionConst, RoleConst } from '@/utils/permission/data'
|
|
||||||
import { hasPermission } from '@/utils/permission'
|
|
||||||
import permissionMap from '@/permission'
|
import permissionMap from '@/permission'
|
||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
|
|
||||||
@ -149,7 +146,6 @@ const props = defineProps<{
|
|||||||
apiType: 'systemShare' | 'workspace' | 'systemManage'
|
apiType: 'systemShare' | 'workspace' | 'systemManage'
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const { user } = useStore()
|
|
||||||
|
|
||||||
const permissionPrecise = computed(() => {
|
const permissionPrecise = computed(() => {
|
||||||
return permissionMap['model'][props.apiType]
|
return permissionMap['model'][props.apiType]
|
||||||
|
|||||||
@ -66,7 +66,12 @@
|
|||||||
class="maxkb-md"
|
class="maxkb-md"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ParagraphDialog ref="ParagraphDialogRef" :title="title" @refresh="refresh" />
|
<ParagraphDialog
|
||||||
|
ref="ParagraphDialogRef"
|
||||||
|
:title="title"
|
||||||
|
@refresh="refresh"
|
||||||
|
:apiType="apiType"
|
||||||
|
/>
|
||||||
<SelectDocumentDialog ref="SelectDocumentDialogRef" @refresh="refreshMigrateParagraph" />
|
<SelectDocumentDialog ref="SelectDocumentDialogRef" @refresh="refreshMigrateParagraph" />
|
||||||
<GenerateRelatedDialog ref="GenerateRelatedDialogRef" @refresh="refresh" :apiType="apiType" />
|
<GenerateRelatedDialog ref="GenerateRelatedDialogRef" @refresh="refresh" :apiType="apiType" />
|
||||||
</el-card>
|
</el-card>
|
||||||
@ -74,17 +79,16 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { t } from '@/locales'
|
|
||||||
import useStore from '@/stores'
|
|
||||||
import GenerateRelatedDialog from '@/components/generate-related-dialog/index.vue'
|
import GenerateRelatedDialog from '@/components/generate-related-dialog/index.vue'
|
||||||
import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
|
import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
|
||||||
import SelectDocumentDialog from '@/views/paragraph/component/SelectDocumentDialog.vue'
|
import SelectDocumentDialog from '@/views/paragraph/component/SelectDocumentDialog.vue'
|
||||||
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||||
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
|
import { t } from '@/locales'
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
data: any
|
data: any
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
}>()
|
}>()
|
||||||
const { paragraph } = useStore()
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
@ -115,8 +119,8 @@ function changeState(row: any) {
|
|||||||
const obj = {
|
const obj = {
|
||||||
is_active: !row.is_active,
|
is_active: !row.is_active,
|
||||||
}
|
}
|
||||||
paragraph
|
loadSharedApi({ type: 'paragraph', systemType: apiType.value })
|
||||||
.asyncPutParagraph(id, documentId, row.id, obj, changeStateloading)
|
.putParagraph(id, documentId, row.id, obj, changeStateloading)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
emit('changeState', row.id)
|
emit('changeState', row.id)
|
||||||
return true
|
return true
|
||||||
@ -142,10 +146,12 @@ function deleteParagraph(row: any) {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
paragraph.asyncDelParagraph(id, documentId, row.id, loading).then(() => {
|
loadSharedApi({ type: 'paragraph', systemType: apiType.value })
|
||||||
emit('deleteParagraph', row.id)
|
.delParagraph(id, documentId, row.id, loading)
|
||||||
MsgSuccess(t('common.deleteSuccess'))
|
.then(() => {
|
||||||
})
|
emit('deleteParagraph', row.id)
|
||||||
|
MsgSuccess(t('common.deleteSuccess'))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,6 +35,7 @@
|
|||||||
:paragraphId="paragraphId"
|
:paragraphId="paragraphId"
|
||||||
:docId="document_id"
|
:docId="document_id"
|
||||||
:knowledgeId="dataset_id"
|
:knowledgeId="dataset_id"
|
||||||
|
:apiType="apiType"
|
||||||
ref="ProblemRef"
|
ref="ProblemRef"
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -55,14 +56,12 @@ import { useRoute } from 'vue-router'
|
|||||||
import { cloneDeep, debounce } from 'lodash'
|
import { cloneDeep, debounce } from 'lodash'
|
||||||
import ParagraphForm from '@/views/paragraph/component/ParagraphForm.vue'
|
import ParagraphForm from '@/views/paragraph/component/ParagraphForm.vue'
|
||||||
import ProblemComponent from '@/views/paragraph/component/ProblemComponent.vue'
|
import ProblemComponent from '@/views/paragraph/component/ProblemComponent.vue'
|
||||||
import paragraphApi from '@/api/knowledge/paragraph'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
import useStore from '@/stores'
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
title: String,
|
title: String
|
||||||
})
|
apiType: 'systemShare' | 'workspace' | 'systemManage'
|
||||||
|
}>()
|
||||||
const { paragraph } = useStore()
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
@ -121,8 +120,8 @@ const submitHandle = async () => {
|
|||||||
if (await paragraphFormRef.value?.validate()) {
|
if (await paragraphFormRef.value?.validate()) {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
if (paragraphId.value) {
|
if (paragraphId.value) {
|
||||||
paragraph
|
loadSharedApi({ type: 'paragraph', systemType: props.apiType })
|
||||||
.asyncPutParagraph(
|
.putParagraph(
|
||||||
dataset_id.value,
|
dataset_id.value,
|
||||||
documentId || document_id.value,
|
documentId || document_id.value,
|
||||||
paragraphId.value,
|
paragraphId.value,
|
||||||
@ -145,10 +144,12 @@ const submitHandle = async () => {
|
|||||||
position: String(position.value) ? position.value : null,
|
position: String(position.value) ? position.value : null,
|
||||||
...paragraphFormRef.value?.form,
|
...paragraphFormRef.value?.form,
|
||||||
}
|
}
|
||||||
paragraphApi.postParagraph(id, documentId, obj, loading).then((res) => {
|
loadSharedApi({ type: 'paragraph', systemType: props.apiType })
|
||||||
dialogVisible.value = false
|
.postParagraph(id, documentId, obj, loading)
|
||||||
emit('refresh')
|
.then(() => {
|
||||||
})
|
dialogVisible.value = false
|
||||||
|
emit('refresh')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,21 +57,20 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, nextTick, onMounted, onUnmounted, watch } from 'vue'
|
import { ref, nextTick, onMounted, onUnmounted, watch } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import paragraphApi from '@/api/knowledge/paragraph'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
import useStore from '@/stores'
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps<{
|
||||||
paragraphId: String,
|
paragraphId: String
|
||||||
docId: String,
|
docId: String
|
||||||
knowledgeId: String,
|
knowledgeId: String
|
||||||
})
|
apiType: 'systemShare' | 'workspace' | 'systemManage'
|
||||||
|
}>()
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
params: { id, documentId }, // id为knowledgeId
|
params: { id, documentId }, // id为knowledgeId
|
||||||
} = route as any
|
} = route as any
|
||||||
|
|
||||||
const { problem, paragraph } = useStore()
|
|
||||||
const inputRef = ref()
|
const inputRef = ref()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const isAddProblem = ref(false)
|
const isAddProblem = ref(false)
|
||||||
@ -96,14 +95,12 @@ watch(
|
|||||||
|
|
||||||
function delProblemHandle(item: any, index: number) {
|
function delProblemHandle(item: any, index: number) {
|
||||||
if (item.id) {
|
if (item.id) {
|
||||||
paragraph
|
const obj = {
|
||||||
.asyncDisassociationProblem(
|
paragraph_id: props.paragraphId || '',
|
||||||
props.knowledgeId || id,
|
problem_id: item.id,
|
||||||
documentId || props.docId,
|
}
|
||||||
props.paragraphId || '',
|
loadSharedApi({ type: 'paragraph', systemType: props.apiType })
|
||||||
item.id,
|
.putDisassociationProblem(props.knowledgeId || id, documentId || props.docId, obj, loading)
|
||||||
loading,
|
|
||||||
)
|
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
getProblemList()
|
getProblemList()
|
||||||
})
|
})
|
||||||
@ -114,9 +111,13 @@ function delProblemHandle(item: any, index: number) {
|
|||||||
|
|
||||||
function getProblemList() {
|
function getProblemList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
paragraphApi
|
loadSharedApi({ type: 'paragraph', systemType: props.apiType })
|
||||||
.getParagraphProblem(props.knowledgeId || id, documentId || props.docId, props.paragraphId || '')
|
.getParagraphProblem(
|
||||||
.then((res) => {
|
props.knowledgeId || id,
|
||||||
|
documentId || props.docId,
|
||||||
|
props.paragraphId || '',
|
||||||
|
)
|
||||||
|
.then((res: any) => {
|
||||||
problemList.value = res.data
|
problemList.value = res.data
|
||||||
loading.value = false
|
loading.value = false
|
||||||
})
|
})
|
||||||
@ -133,15 +134,18 @@ function addProblem() {
|
|||||||
}
|
}
|
||||||
function addProblemHandle(val: string) {
|
function addProblemHandle(val: string) {
|
||||||
if (props.paragraphId) {
|
if (props.paragraphId) {
|
||||||
|
const obj = {
|
||||||
|
paragraph_id: props.paragraphId,
|
||||||
|
problem_id: val,
|
||||||
|
}
|
||||||
const api = problemOptions.value.some((option) => option.id === val)
|
const api = problemOptions.value.some((option) => option.id === val)
|
||||||
? paragraph.asyncAssociationProblem(
|
? loadSharedApi({ type: 'paragraph', systemType: props.apiType }).putAssociationProblem(
|
||||||
props.knowledgeId || id,
|
props.knowledgeId || id,
|
||||||
documentId || props.docId,
|
documentId || props.docId,
|
||||||
props.paragraphId,
|
obj,
|
||||||
val,
|
|
||||||
loading,
|
loading,
|
||||||
)
|
)
|
||||||
: paragraphApi.postParagraphProblem(
|
: loadSharedApi({ type: 'paragraph', systemType: props.apiType }).postParagraphProblem(
|
||||||
props.knowledgeId || id,
|
props.knowledgeId || id,
|
||||||
documentId || props.docId,
|
documentId || props.docId,
|
||||||
props.paragraphId,
|
props.paragraphId,
|
||||||
@ -172,8 +176,8 @@ const remoteMethod = (query: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getProblemOption(filterText?: string) {
|
function getProblemOption(filterText?: string) {
|
||||||
return problem
|
return loadSharedApi({ type: 'problem', systemType: props.apiType })
|
||||||
.asyncGetProblem(
|
.getProblemsPage(
|
||||||
props.knowledgeId || (id as string),
|
props.knowledgeId || (id as string),
|
||||||
{ current_page: 1, page_size: 100 },
|
{ current_page: 1, page_size: 100 },
|
||||||
filterText && { content: filterText },
|
filterText && { content: filterText },
|
||||||
|
|||||||
@ -79,11 +79,8 @@
|
|||||||
import { ref, watch, reactive, computed } from 'vue'
|
import { ref, watch, reactive, computed } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import type { FormInstance, FormRules } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import paragraphApi from '@/api/knowledge/paragraph'
|
|
||||||
import useStore from '@/stores'
|
|
||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
const { knowledge, document } = useStore()
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
@ -160,9 +157,11 @@ function changeKnowledge(id: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getDocument(id: string) {
|
function getDocument(id: string) {
|
||||||
document.asyncGetKnowledgeDocument(id, apiType.value, optionLoading).then((res: any) => {
|
loadSharedApi({ type: 'document', systemType: apiType.value })
|
||||||
documentList.value = res.data?.filter((v: any) => v.id !== documentId)
|
.getDocumentList(id, optionLoading)
|
||||||
})
|
.then((res: any) => {
|
||||||
|
documentList.value = res.data?.filter((v: any) => v.id !== documentId)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const open = (list: any) => {
|
const open = (list: any) => {
|
||||||
@ -177,7 +176,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|||||||
const obj = {
|
const obj = {
|
||||||
id_list: paragraphList.value,
|
id_list: paragraphList.value,
|
||||||
}
|
}
|
||||||
paragraphApi
|
loadSharedApi({ type: 'paragraph', systemType: apiType.value })
|
||||||
.putMigrateMulParagraph(
|
.putMigrateMulParagraph(
|
||||||
id,
|
id,
|
||||||
documentId,
|
documentId,
|
||||||
|
|||||||
@ -136,7 +136,12 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<ParagraphDialog ref="ParagraphDialogRef" :title="title" @refresh="refresh" />
|
<ParagraphDialog
|
||||||
|
ref="ParagraphDialogRef"
|
||||||
|
:title="title"
|
||||||
|
:apiType="apiType"
|
||||||
|
@refresh="refresh"
|
||||||
|
/>
|
||||||
<SelectDocumentDialog ref="SelectDocumentDialogRef" @refresh="refreshMigrateParagraph" />
|
<SelectDocumentDialog ref="SelectDocumentDialogRef" @refresh="refreshMigrateParagraph" />
|
||||||
<GenerateRelatedDialog ref="GenerateRelatedDialogRef" @refresh="refresh" :apiType="apiType" />
|
<GenerateRelatedDialog ref="GenerateRelatedDialogRef" @refresh="refresh" :apiType="apiType" />
|
||||||
</div>
|
</div>
|
||||||
@ -151,7 +156,6 @@ import GenerateRelatedDialog from '@/components/generate-related-dialog/index.vu
|
|||||||
import { VueDraggable } from 'vue-draggable-plus'
|
import { VueDraggable } from 'vue-draggable-plus'
|
||||||
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||||
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
import useStore from '@/stores'
|
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
|
|||||||
@ -33,28 +33,37 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, watch } from 'vue'
|
import { ref, reactive, watch, computed } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import type { FormInstance, FormRules } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import { MsgSuccess } from '@/utils/message'
|
import { MsgSuccess } from '@/utils/message'
|
||||||
import useStore from '@/stores'
|
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
params: { id }
|
params: { id },
|
||||||
} = route as any
|
} = route as any
|
||||||
const { problem } = useStore()
|
|
||||||
|
const apiType = computed(() => {
|
||||||
|
if (route.path.includes('shared')) {
|
||||||
|
return 'systemShare'
|
||||||
|
} else if (route.path.includes('resource-management')) {
|
||||||
|
return 'systemManage'
|
||||||
|
} else {
|
||||||
|
return 'workspace'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
const problemFormRef = ref()
|
const problemFormRef = ref()
|
||||||
const loading = ref<boolean>(false)
|
const loading = ref<boolean>(false)
|
||||||
|
|
||||||
const form = ref<any>({
|
const form = ref<any>({
|
||||||
data: ''
|
data: '',
|
||||||
})
|
})
|
||||||
|
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
data: [{ required: true, message: t('views.problem.tip.requiredMessage'), trigger: 'blur' }]
|
data: [{ required: true, message: t('views.problem.tip.requiredMessage'), trigger: 'blur' }],
|
||||||
})
|
})
|
||||||
|
|
||||||
const dialogVisible = ref<boolean>(false)
|
const dialogVisible = ref<boolean>(false)
|
||||||
@ -62,7 +71,7 @@ const dialogVisible = ref<boolean>(false)
|
|||||||
watch(dialogVisible, (bool) => {
|
watch(dialogVisible, (bool) => {
|
||||||
if (!bool) {
|
if (!bool) {
|
||||||
form.value = {
|
form.value = {
|
||||||
data: ''
|
data: '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -78,11 +87,13 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||||||
const arr = form.value.data.split('\n').filter(function (item: string) {
|
const arr = form.value.data.split('\n').filter(function (item: string) {
|
||||||
return item !== ''
|
return item !== ''
|
||||||
})
|
})
|
||||||
problem.asyncPostProblem(id, arr, loading).then((res: any) => {
|
loadSharedApi({ type: 'problem', systemType: apiType.value })
|
||||||
MsgSuccess(t('common.createSuccess'))
|
.postProblems(id, arr, loading)
|
||||||
emit('refresh')
|
.then((res: any) => {
|
||||||
dialogVisible.value = false
|
MsgSuccess(t('common.createSuccess'))
|
||||||
})
|
emit('refresh')
|
||||||
|
dialogVisible.value = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,28 +19,26 @@
|
|||||||
<template v-for="(item, index) in paragraphList" :key="index">
|
<template v-for="(item, index) in paragraphList" :key="index">
|
||||||
<CardBox
|
<CardBox
|
||||||
:title="item.title || '-'"
|
:title="item.title || '-'"
|
||||||
class="paragraph-source-card cursor mb-8"
|
class="cursor mb-8"
|
||||||
:showIcon="false"
|
:showIcon="false"
|
||||||
@click.stop="editParagraph(item)"
|
@click.stop="editParagraph(item)"
|
||||||
|
style="height: 210px"
|
||||||
>
|
>
|
||||||
<div class="active-button">
|
<template #tag>
|
||||||
<span class="mr-4">
|
<el-tooltip
|
||||||
<el-tooltip
|
effect="dark"
|
||||||
effect="dark"
|
:content="$t('views.problem.setting.cancelRelated')"
|
||||||
:content="$t('views.problem.setting.cancelRelated')"
|
placement="top"
|
||||||
placement="top"
|
>
|
||||||
>
|
<el-button type="primary" text @click.stop="disassociation(item)">
|
||||||
<el-button type="primary" text @click.stop="disassociation(item)">
|
<AppIcon iconName="app-quxiaoguanlian"></AppIcon>
|
||||||
<AppIcon iconName="app-quxiaoguanlian"></AppIcon>
|
</el-button>
|
||||||
</el-button>
|
</el-tooltip>
|
||||||
</el-tooltip>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<template #description>
|
|
||||||
<el-scrollbar height="80">
|
|
||||||
{{ item.content }}
|
|
||||||
</el-scrollbar>
|
|
||||||
</template>
|
</template>
|
||||||
|
<el-scrollbar height="110">
|
||||||
|
{{ item.content }}
|
||||||
|
</el-scrollbar>
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="footer-content flex-between">
|
<div class="footer-content flex-between">
|
||||||
<el-text>
|
<el-text>
|
||||||
@ -60,6 +58,7 @@
|
|||||||
<ParagraphDialog
|
<ParagraphDialog
|
||||||
ref="ParagraphDialogRef"
|
ref="ParagraphDialogRef"
|
||||||
:title="$t('views.paragraph.editParagraph')"
|
:title="$t('views.paragraph.editParagraph')"
|
||||||
|
:apiType="apiType"
|
||||||
@refresh="refresh"
|
@refresh="refresh"
|
||||||
/>
|
/>
|
||||||
<RelateProblemDialog ref="RelateProblemDialogRef" @refresh="refresh" />
|
<RelateProblemDialog ref="RelateProblemDialogRef" @refresh="refresh" />
|
||||||
@ -83,11 +82,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, computed, watch } from 'vue'
|
import { ref, reactive, computed, watch } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import problemApi from '@/api/knowledge/problem'
|
|
||||||
import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
|
import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
|
||||||
import RelateProblemDialog from './RelateProblemDialog.vue'
|
import RelateProblemDialog from './RelateProblemDialog.vue'
|
||||||
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
|
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
|
||||||
import useStore from '@/stores'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
@ -119,7 +117,16 @@ const {
|
|||||||
params: { id },
|
params: { id },
|
||||||
} = route
|
} = route
|
||||||
|
|
||||||
const { paragraph } = useStore()
|
const apiType = computed(() => {
|
||||||
|
if (route.path.includes('shared')) {
|
||||||
|
return 'systemShare'
|
||||||
|
} else if (route.path.includes('resource-management')) {
|
||||||
|
return 'systemManage'
|
||||||
|
} else {
|
||||||
|
return 'workspace'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const RelateProblemDialogRef = ref()
|
const RelateProblemDialogRef = ref()
|
||||||
const ParagraphDialogRef = ref()
|
const ParagraphDialogRef = ref()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
@ -127,14 +134,12 @@ const visible = ref(false)
|
|||||||
const paragraphList = ref<any[]>([])
|
const paragraphList = ref<any[]>([])
|
||||||
|
|
||||||
function disassociation(item: any) {
|
function disassociation(item: any) {
|
||||||
paragraph
|
const obj = {
|
||||||
.asyncDisassociationProblem(
|
paragraph_id: item.id,
|
||||||
item.knowledge_id,
|
problem_id: props.currentId,
|
||||||
item.document_id,
|
}
|
||||||
item.id,
|
loadSharedApi({ type: 'paragraph', systemType: apiType.value })
|
||||||
props.currentId,
|
.putDisassociationProblem(item.knowledge_id, item.document_id, obj, loading)
|
||||||
loading,
|
|
||||||
)
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getRecord()
|
getRecord()
|
||||||
})
|
})
|
||||||
@ -153,10 +158,12 @@ function editName(val: string) {
|
|||||||
const obj = {
|
const obj = {
|
||||||
content: val,
|
content: val,
|
||||||
}
|
}
|
||||||
problemApi.putProblems(id as string, props.currentId, obj, loading).then(() => {
|
loadSharedApi({ type: 'problem', systemType: apiType.value })
|
||||||
emit('update:currentContent', val)
|
.putProblems(id as string, props.currentId, obj, loading)
|
||||||
MsgSuccess(t('common.modifySuccess'))
|
.then(() => {
|
||||||
})
|
emit('update:currentContent', val)
|
||||||
|
MsgSuccess(t('common.modifySuccess'))
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
MsgError(t('views.problem.tip.errorMessage'))
|
MsgError(t('views.problem.tip.errorMessage'))
|
||||||
}
|
}
|
||||||
@ -168,9 +175,11 @@ function closeHandle() {
|
|||||||
|
|
||||||
function getRecord() {
|
function getRecord() {
|
||||||
if (props.currentId && visible.value) {
|
if (props.currentId && visible.value) {
|
||||||
problemApi.getDetailProblems(id as string, props.currentId, loading).then((res) => {
|
loadSharedApi({ type: 'problem', systemType: apiType.value })
|
||||||
paragraphList.value = res.data
|
.getDetailProblems(id as string, props.currentId, loading)
|
||||||
})
|
.then((res: any) => {
|
||||||
|
paragraphList.value = res.data
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -111,12 +111,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch, reactive, computed } from 'vue'
|
import { ref, watch, reactive, computed } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import problemApi from '@/api/knowledge/problem'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
import paragraphApi from '@/api/knowledge/paragraph'
|
|
||||||
import useStore from '@/stores'
|
|
||||||
import { MsgSuccess } from '@/utils/message'
|
import { MsgSuccess } from '@/utils/message'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
const { problem, document, paragraph } = useStore()
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
@ -168,10 +165,12 @@ function mulAssociation() {
|
|||||||
document_id: item.document_id,
|
document_id: item.document_id,
|
||||||
})),
|
})),
|
||||||
}
|
}
|
||||||
problemApi.putMulAssociationProblem(id, data, loading).then(() => {
|
loadSharedApi({ type: 'problem', systemType: apiType.value })
|
||||||
MsgSuccess(t('views.problem.tip.relatedSuccess'))
|
.putMulAssociationProblem(id, data, loading)
|
||||||
dialogVisible.value = false
|
.then(() => {
|
||||||
})
|
MsgSuccess(t('views.problem.tip.relatedSuccess'))
|
||||||
|
dialogVisible.value = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function associationClick(item: any) {
|
function associationClick(item: any) {
|
||||||
@ -182,27 +181,19 @@ function associationClick(item: any) {
|
|||||||
associationParagraph.value.push(item)
|
associationParagraph.value.push(item)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
const obj = {
|
||||||
|
paragraph_id: item.id,
|
||||||
|
problem_id: currentProblemId.value as string,
|
||||||
|
}
|
||||||
if (isAssociation(item.id)) {
|
if (isAssociation(item.id)) {
|
||||||
paragraph
|
loadSharedApi({ type: 'paragraph', systemType: apiType.value })
|
||||||
.asyncDisassociationProblem(
|
.putDisassociationProblem(id, item.document_id, obj, loading)
|
||||||
id,
|
|
||||||
item.document_id,
|
|
||||||
item.id,
|
|
||||||
currentProblemId.value as string,
|
|
||||||
loading,
|
|
||||||
)
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getRecord(currentProblemId.value)
|
getRecord(currentProblemId.value)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
paragraph
|
loadSharedApi({ type: 'paragraph', systemType: apiType.value })
|
||||||
.asyncAssociationProblem(
|
.putAssociationProblem(id, item.document_id, obj, loading)
|
||||||
id,
|
|
||||||
item.document_id,
|
|
||||||
item.id,
|
|
||||||
currentProblemId.value as string,
|
|
||||||
loading,
|
|
||||||
)
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getRecord(currentProblemId.value)
|
getRecord(currentProblemId.value)
|
||||||
})
|
})
|
||||||
@ -224,16 +215,19 @@ function clickDocumentHandle(item: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getDocument() {
|
function getDocument() {
|
||||||
document.asyncGetKnowledgeDocument(id, apiType.value, loading).then((res: any) => {
|
loadSharedApi({ type: 'document', systemType: apiType.value })
|
||||||
cloneDocumentList.value = res.data
|
.getDocumentList(id, loading)
|
||||||
documentList.value = res.data
|
.then((res: any) => {
|
||||||
currentDocument.value = cloneDocumentList.value?.length > 0 ? cloneDocumentList.value[0].id : ''
|
cloneDocumentList.value = res.data
|
||||||
currentDocument.value && getParagraphList(currentDocument.value)
|
documentList.value = res.data
|
||||||
})
|
currentDocument.value =
|
||||||
|
cloneDocumentList.value?.length > 0 ? cloneDocumentList.value[0].id : ''
|
||||||
|
currentDocument.value && getParagraphList(currentDocument.value)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function getParagraphList(documentId: string) {
|
function getParagraphList(documentId: string) {
|
||||||
paragraphApi
|
loadSharedApi({ type: 'paragraph', systemType: apiType.value })
|
||||||
.getParagraphPage(
|
.getParagraphPage(
|
||||||
id,
|
id,
|
||||||
(documentId || currentDocument.value) as string,
|
(documentId || currentDocument.value) as string,
|
||||||
@ -241,7 +235,7 @@ function getParagraphList(documentId: string) {
|
|||||||
search.value && { [searchType.value]: search.value },
|
search.value && { [searchType.value]: search.value },
|
||||||
loading,
|
loading,
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res: any) => {
|
||||||
paragraphList.value = [...paragraphList.value, ...res.data.records]
|
paragraphList.value = [...paragraphList.value, ...res.data.records]
|
||||||
paginationConfig.total = res.data.total
|
paginationConfig.total = res.data.total
|
||||||
})
|
})
|
||||||
@ -249,9 +243,11 @@ function getParagraphList(documentId: string) {
|
|||||||
|
|
||||||
// 已关联分段
|
// 已关联分段
|
||||||
function getRecord(problemId: string) {
|
function getRecord(problemId: string) {
|
||||||
problemApi.getDetailProblems(id as string, problemId as string, loading).then((res) => {
|
loadSharedApi({ type: 'problem', systemType: apiType.value })
|
||||||
associationParagraph.value = res.data
|
.getDetailProblems(id as string, problemId as string, loading)
|
||||||
})
|
.then((res: any) => {
|
||||||
|
associationParagraph.value = res.data
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function associationCount(documentId: string) {
|
function associationCount(documentId: string) {
|
||||||
|
|||||||
@ -6,17 +6,23 @@
|
|||||||
<div class="p-24">
|
<div class="p-24">
|
||||||
<div class="flex-between">
|
<div class="flex-between">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" @click="createProblem"
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="createProblem"
|
||||||
v-if="permissionPrecise.problem_create(id)"
|
v-if="permissionPrecise.problem_create(id)"
|
||||||
>
|
>
|
||||||
{{ $t('views.problem.createProblem') }}
|
{{ $t('views.problem.createProblem') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="relateProblem()" :disabled="multipleSelection.length === 0"
|
<el-button
|
||||||
|
@click="relateProblem()"
|
||||||
|
:disabled="multipleSelection.length === 0"
|
||||||
v-if="permissionPrecise.problem_relate(id)"
|
v-if="permissionPrecise.problem_relate(id)"
|
||||||
>
|
>
|
||||||
{{ $t('views.problem.relateParagraph.title') }}
|
{{ $t('views.problem.relateParagraph.title') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="deleteMulDocument" :disabled="multipleSelection.length === 0"
|
<el-button
|
||||||
|
@click="deleteMulDocument"
|
||||||
|
:disabled="multipleSelection.length === 0"
|
||||||
v-if="permissionPrecise.problem_delete(id)"
|
v-if="permissionPrecise.problem_delete(id)"
|
||||||
>
|
>
|
||||||
{{ $t('views.problem.setting.batchDelete') }}
|
{{ $t('views.problem.setting.batchDelete') }}
|
||||||
@ -41,7 +47,6 @@
|
|||||||
:quickCreateName="$t('views.problem.quickCreateName')"
|
:quickCreateName="$t('views.problem.quickCreateName')"
|
||||||
:quickCreatePlaceholder="$t('views.problem.quickCreateProblem')"
|
:quickCreatePlaceholder="$t('views.problem.quickCreateProblem')"
|
||||||
:quickCreateMaxlength="256"
|
:quickCreateMaxlength="256"
|
||||||
|
|
||||||
@sizeChange="handleSizeChange"
|
@sizeChange="handleSizeChange"
|
||||||
@changePage="getList"
|
@changePage="getList"
|
||||||
@cell-mouse-enter="cellMouseEnter"
|
@cell-mouse-enter="cellMouseEnter"
|
||||||
@ -106,16 +111,24 @@
|
|||||||
:content="$t('views.problem.relateParagraph.title')"
|
:content="$t('views.problem.relateParagraph.title')"
|
||||||
placement="top"
|
placement="top"
|
||||||
>
|
>
|
||||||
<el-button type="primary" text @click.stop="relateProblem(row)"
|
<el-button
|
||||||
v-if="permissionPrecise.problem_relate(id)" >
|
type="primary"
|
||||||
|
text
|
||||||
|
@click.stop="relateProblem(row)"
|
||||||
|
v-if="permissionPrecise.problem_relate(id)"
|
||||||
|
>
|
||||||
<el-icon><Connection /></el-icon>
|
<el-icon><Connection /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<el-tooltip effect="dark" :content="$t('common.delete')" placement="top">
|
<el-tooltip effect="dark" :content="$t('common.delete')" placement="top">
|
||||||
<el-button type="primary" text @click.stop="deleteProblem(row)"
|
<el-button
|
||||||
v-if="permissionPrecise.problem_delete(id)" >
|
type="primary"
|
||||||
|
text
|
||||||
|
@click.stop="deleteProblem(row)"
|
||||||
|
v-if="permissionPrecise.problem_delete(id)"
|
||||||
|
>
|
||||||
<el-icon><Delete /></el-icon>
|
<el-icon><Delete /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@ -145,25 +158,20 @@
|
|||||||
import { ref, onMounted, reactive, onBeforeUnmount, computed } from 'vue'
|
import { ref, onMounted, reactive, onBeforeUnmount, computed } from 'vue'
|
||||||
import { useRouter, useRoute } from 'vue-router'
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
import { ElTable } from 'element-plus'
|
import { ElTable } from 'element-plus'
|
||||||
import problemApi from '@/api/knowledge/problem'
|
|
||||||
import CreateProblemDialog from './component/CreateProblemDialog.vue'
|
import CreateProblemDialog from './component/CreateProblemDialog.vue'
|
||||||
import DetailProblemDrawer from './component/DetailProblemDrawer.vue'
|
import DetailProblemDrawer from './component/DetailProblemDrawer.vue'
|
||||||
import RelateProblemDialog from './component/RelateProblemDialog.vue'
|
import RelateProblemDialog from './component/RelateProblemDialog.vue'
|
||||||
import { datetimeFormat } from '@/utils/time'
|
import { datetimeFormat } from '@/utils/time'
|
||||||
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
|
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
|
||||||
import type { Dict } from '@/api/type/common'
|
import type { Dict } from '@/api/type/common'
|
||||||
import useStore from '@/stores'
|
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import { PermissionConst, RoleConst } from '@/utils/permission/data'
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
||||||
import { hasPermission } from '@/utils/permission/index'
|
|
||||||
import permissionMap from '@/permission'
|
import permissionMap from '@/permission'
|
||||||
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
params: { id }, // 知识库id
|
params: { id }, // 知识库id
|
||||||
} = route as any
|
} = route as any
|
||||||
const { folder, user } = useStore()
|
|
||||||
|
|
||||||
const apiType = computed(() => {
|
const apiType = computed(() => {
|
||||||
if (route.path.includes('shared')) {
|
if (route.path.includes('shared')) {
|
||||||
@ -178,9 +186,6 @@ const permissionPrecise = computed(() => {
|
|||||||
return permissionMap['knowledge'][apiType.value]
|
return permissionMap['knowledge'][apiType.value]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const { problem } = useStore()
|
|
||||||
|
|
||||||
const RelateProblemDialogRef = ref()
|
const RelateProblemDialogRef = ref()
|
||||||
const DetailProblemRef = ref()
|
const DetailProblemRef = ref()
|
||||||
const CreateProblemDialogRef = ref()
|
const CreateProblemDialogRef = ref()
|
||||||
@ -240,9 +245,9 @@ const handleSelectionChange = (val: any[]) => {
|
|||||||
function creatQuickHandle(val: string) {
|
function creatQuickHandle(val: string) {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
const obj = [val]
|
const obj = [val]
|
||||||
problem
|
loadSharedApi({ type: 'problem', systemType: apiType.value })
|
||||||
.asyncPostProblem(id, obj)
|
.postProblems(id, obj)
|
||||||
.then((res) => {
|
.then(() => {
|
||||||
getList()
|
getList()
|
||||||
MsgSuccess(t('common.createSuccess'))
|
MsgSuccess(t('common.createSuccess'))
|
||||||
})
|
})
|
||||||
@ -258,11 +263,13 @@ function deleteMulDocument() {
|
|||||||
arr.push(v.id)
|
arr.push(v.id)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
problemApi.putMulProblem(id, arr, loading).then(() => {
|
loadSharedApi({ type: 'problem', systemType: apiType.value })
|
||||||
MsgSuccess(t('views.document.delete.successMessage'))
|
.putMulProblem(id, arr, loading)
|
||||||
multipleTableRef.value?.clearSelection()
|
.then(() => {
|
||||||
getList()
|
MsgSuccess(t('views.document.delete.successMessage'))
|
||||||
})
|
multipleTableRef.value?.clearSelection()
|
||||||
|
getList()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteProblem(row: any) {
|
function deleteProblem(row: any) {
|
||||||
@ -275,10 +282,12 @@ function deleteProblem(row: any) {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
problemApi.delProblems(id, row.id, loading).then(() => {
|
loadSharedApi({ type: 'problem', systemType: apiType.value })
|
||||||
MsgSuccess(t('common.deleteSuccess'))
|
.delProblems(id, row.id, loading)
|
||||||
getList()
|
.then(() => {
|
||||||
})
|
MsgSuccess(t('common.deleteSuccess'))
|
||||||
|
getList()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
}
|
}
|
||||||
@ -288,10 +297,12 @@ function editName(val: string, problemId: string) {
|
|||||||
const obj = {
|
const obj = {
|
||||||
content: val,
|
content: val,
|
||||||
}
|
}
|
||||||
problemApi.putProblems(id, problemId, obj, loading).then(() => {
|
loadSharedApi({ type: 'problem', systemType: apiType.value })
|
||||||
getList()
|
.putProblems(id, problemId, obj, loading)
|
||||||
MsgSuccess(t('common.modifySuccess'))
|
.then(() => {
|
||||||
})
|
getList()
|
||||||
|
MsgSuccess(t('common.modifySuccess'))
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
MsgError(t('views.problem.tip.errorMessage'))
|
MsgError(t('views.problem.tip.errorMessage'))
|
||||||
}
|
}
|
||||||
@ -352,7 +363,7 @@ const preChatRecord = () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
paginationConfig.current_page = paginationConfig.current_page - 1
|
paginationConfig.current_page = paginationConfig.current_page - 1
|
||||||
getList().then((ok) => {
|
getList().then(() => {
|
||||||
index = paginationConfig.page_size - 1
|
index = paginationConfig.page_size - 1
|
||||||
currentClickId.value = problemData.value[index].id
|
currentClickId.value = problemData.value[index].id
|
||||||
currentContent.value = problemData.value[index].content
|
currentContent.value = problemData.value[index].content
|
||||||
@ -384,8 +395,8 @@ function handleSizeChange() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getList() {
|
function getList() {
|
||||||
return problem
|
return loadSharedApi({ type: 'problem', systemType: apiType.value })
|
||||||
.asyncGetProblem(
|
.getProblemsPage(
|
||||||
id as string,
|
id as string,
|
||||||
paginationConfig,
|
paginationConfig,
|
||||||
filterText.value && { content: filterText.value },
|
filterText.value && { content: filterText.value },
|
||||||
|
|||||||
@ -20,10 +20,6 @@ import OIDC from './component/OIDC.vue'
|
|||||||
//import SCAN from './component/SCAN.vue'
|
//import SCAN from './component/SCAN.vue'
|
||||||
import OAuth2 from './component/OAuth2.vue'
|
import OAuth2 from './component/OAuth2.vue'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import useStore from '@/stores'
|
|
||||||
|
|
||||||
const { user } = useStore()
|
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
const activeName = ref('LDAP')
|
const activeName = ref('LDAP')
|
||||||
const tabList = [
|
const tabList = [
|
||||||
|
|||||||
@ -98,7 +98,7 @@ import { EditionConst } from '@/utils/permission/data'
|
|||||||
import { hasPermission } from '@/utils/permission/index'
|
import { hasPermission } from '@/utils/permission/index'
|
||||||
import WorkspaceApi from '@/api/workspace/workspace.ts'
|
import WorkspaceApi from '@/api/workspace/workspace.ts'
|
||||||
import type { WorkspaceItem } from '@/api/type/workspace'
|
import type { WorkspaceItem } from '@/api/type/workspace'
|
||||||
|
const { user } = useStore()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const rLoading = ref(false)
|
const rLoading = ref(false)
|
||||||
const memberList = ref<any[]>([]) // 全部成员
|
const memberList = ref<any[]>([]) // 全部成员
|
||||||
@ -109,7 +109,7 @@ const filterText = ref('')
|
|||||||
|
|
||||||
const activeName = ref(AuthorizationEnum.KNOWLEDGE)
|
const activeName = ref(AuthorizationEnum.KNOWLEDGE)
|
||||||
const tableHeight = ref(0)
|
const tableHeight = ref(0)
|
||||||
const { user } = useStore()
|
|
||||||
|
|
||||||
const settingTags = reactive([
|
const settingTags = reactive([
|
||||||
{
|
{
|
||||||
|
|||||||
@ -301,8 +301,6 @@ import CreateFolderDialog from '@/components/folder-tree/CreateFolderDialog.vue'
|
|||||||
import AuthorizedWorkspace from '@/views/system-shared/AuthorizedWorkspaceDialog.vue'
|
import AuthorizedWorkspace from '@/views/system-shared/AuthorizedWorkspaceDialog.vue'
|
||||||
import { isAppIcon } from '@/utils/common'
|
import { isAppIcon } from '@/utils/common'
|
||||||
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
|
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
|
||||||
import { EditionConst, PermissionConst, RoleConst } from '@/utils/permission/data'
|
|
||||||
import { hasPermission } from '@/utils/permission/index'
|
|
||||||
import { FolderSource } from '@/enums/common'
|
import { FolderSource } from '@/enums/common'
|
||||||
import ToolStoreDialog from '@/views/tool/toolStore/ToolStoreDialog.vue'
|
import ToolStoreDialog from '@/views/tool/toolStore/ToolStoreDialog.vue'
|
||||||
import AddInternalFunctionDialog from '@/views/tool/toolStore/AddInternalFunctionDialog.vue'
|
import AddInternalFunctionDialog from '@/views/tool/toolStore/AddInternalFunctionDialog.vue'
|
||||||
@ -574,9 +572,11 @@ watch(
|
|||||||
function getList() {
|
function getList() {
|
||||||
const params = {
|
const params = {
|
||||||
[search_type.value]: search_form.value[search_type.value],
|
[search_type.value]: search_form.value[search_type.value],
|
||||||
|
folder_id: folder.currentFolder?.id || user.getWorkspaceId(),
|
||||||
|
scope: systemType === 'systemShare' ? 'SHARED' : 'WORKSPACE',
|
||||||
}
|
}
|
||||||
tool
|
loadSharedApi({ type: 'tool', isShared: isShared.value, systemType: apiType.value })
|
||||||
.asyncGetToolListPage(paginationConfig, isShared.value, apiType.value, params, loading)
|
.getToolListPage(paginationConfig, params, loading)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
paginationConfig.total = res.data?.total
|
paginationConfig.total = res.data?.total
|
||||||
tool.setToolList([...tool.toolList, ...res.data?.records])
|
tool.setToolList([...tool.toolList, ...res.data?.records])
|
||||||
|
|||||||
@ -173,8 +173,6 @@ import { cloneDeep, set, groupBy } from 'lodash'
|
|||||||
import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
import { ref, computed, onMounted } from 'vue'
|
import { ref, computed, onMounted } from 'vue'
|
||||||
import applicationApi from '@/api/application/application'
|
|
||||||
import modelAPI from '@/api/model/model.ts'
|
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import { isLastNode } from '@/workflow/common/data'
|
import { isLastNode } from '@/workflow/common/data'
|
||||||
import AIModeParamSettingDialog from '@/views/application/component/AIModeParamSettingDialog.vue'
|
import AIModeParamSettingDialog from '@/views/application/component/AIModeParamSettingDialog.vue'
|
||||||
@ -272,11 +270,11 @@ const validate = () => {
|
|||||||
|
|
||||||
function getSelectModel() {
|
function getSelectModel() {
|
||||||
if (id) {
|
if (id) {
|
||||||
modelAPI.getSelectModelList({ model_type: 'LLM' }).then((res: any) => {
|
model.asyncGetSelectModel({ model_type: 'LLM' }).then((res: any) => {
|
||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
model.asyncGetSelectModel('workspace').then((res: any) => {
|
model.asyncGetSelectModel().then((res: any) => {
|
||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -171,8 +171,6 @@ import { groupBy, set } from 'lodash'
|
|||||||
import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
import { ref, computed, onMounted } from 'vue'
|
import { ref, computed, onMounted } from 'vue'
|
||||||
import applicationApi from '@/api/application/application'
|
|
||||||
import modelAPI from '@/api/model/model.ts'
|
|
||||||
import { MsgError, MsgSuccess, MsgWarning } from '@/utils/message'
|
import { MsgError, MsgSuccess, MsgWarning } from '@/utils/message'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import TTSModeParamSettingDialog from '@/views/application/component/TTSModeParamSettingDialog.vue'
|
import TTSModeParamSettingDialog from '@/views/application/component/TTSModeParamSettingDialog.vue'
|
||||||
@ -180,11 +178,13 @@ import ApiInputFieldTable from './component/ApiInputFieldTable.vue'
|
|||||||
import UserInputFieldTable from './component/UserInputFieldTable.vue'
|
import UserInputFieldTable from './component/UserInputFieldTable.vue'
|
||||||
import FileUploadSettingDialog from '@/workflow/nodes/base-node/component/FileUploadSettingDialog.vue'
|
import FileUploadSettingDialog from '@/workflow/nodes/base-node/component/FileUploadSettingDialog.vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
|
import useStore from '@/stores'
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
const {
|
const {
|
||||||
params: { id },
|
params: { id },
|
||||||
} = route as any
|
} = route as any
|
||||||
|
const { model } = useStore()
|
||||||
const props = defineProps<{ nodeModel: any }>()
|
const props = defineProps<{ nodeModel: any }>()
|
||||||
|
|
||||||
const sttModelOptions = ref<any>(null)
|
const sttModelOptions = ref<any>(null)
|
||||||
@ -253,13 +253,13 @@ const validate = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getSTTModel() {
|
function getSTTModel() {
|
||||||
modelAPI.getSelectModelList({ model_type: 'STT' }).then((res: any) => {
|
model.asyncGetSelectModel({ model_type: 'STT' }).then((res: any) => {
|
||||||
sttModelOptions.value = groupBy(res?.data, 'provider')
|
sttModelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTTSModel() {
|
function getTTSModel() {
|
||||||
modelAPI.getSelectModelList({ model_type: 'TTS' }).then((res: any) => {
|
model.asyncGetSelectModel({ model_type: 'TTS' }).then((res: any) => {
|
||||||
ttsModelOptions.value = groupBy(res?.data, 'provider')
|
ttsModelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -156,7 +156,6 @@ import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
|||||||
import { computed, onMounted, ref } from 'vue'
|
import { computed, onMounted, ref } from 'vue'
|
||||||
import { groupBy, set } from 'lodash'
|
import { groupBy, set } from 'lodash'
|
||||||
import applicationApi from '@/api/application/application'
|
import applicationApi from '@/api/application/application'
|
||||||
|
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
import AIModeParamSettingDialog from '@/views/application/component/AIModeParamSettingDialog.vue'
|
import AIModeParamSettingDialog from '@/views/application/component/AIModeParamSettingDialog.vue'
|
||||||
@ -226,7 +225,7 @@ function getSelectModel() {
|
|||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
model.asyncGetSelectModel('workspace').then((res: any) => {
|
model.asyncGetSelectModel().then((res: any) => {
|
||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -172,7 +172,6 @@ import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
|||||||
import { computed, onMounted, ref } from 'vue'
|
import { computed, onMounted, ref } from 'vue'
|
||||||
import { groupBy, set } from 'lodash'
|
import { groupBy, set } from 'lodash'
|
||||||
import applicationApi from '@/api/application/application'
|
import applicationApi from '@/api/application/application'
|
||||||
|
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import NodeCascader from '@/workflow/common/NodeCascader.vue'
|
import NodeCascader from '@/workflow/common/NodeCascader.vue'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
@ -246,7 +245,7 @@ function getSelectModel() {
|
|||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
model.asyncGetSelectModel('workspace').then((res: any) => {
|
model.asyncGetSelectModel().then((res: any) => {
|
||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -227,7 +227,7 @@ function getSelectModel() {
|
|||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
model.asyncGetSelectModel('workspace').then((res: any) => {
|
model.asyncGetSelectModel().then((res: any) => {
|
||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -176,10 +176,8 @@ import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
|||||||
import NodeCascader from '@/workflow/common/NodeCascader.vue'
|
import NodeCascader from '@/workflow/common/NodeCascader.vue'
|
||||||
import ParamSettingDialog from './ParamSettingDialog.vue'
|
import ParamSettingDialog from './ParamSettingDialog.vue'
|
||||||
import { ref, computed, onMounted } from 'vue'
|
import { ref, computed, onMounted } from 'vue'
|
||||||
|
|
||||||
import applicationApi from '@/api/application/application'
|
import applicationApi from '@/api/application/application'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
|
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
@ -242,7 +240,7 @@ function getSelectModel() {
|
|||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
model.asyncGetSelectModel('workspace', { model_type: 'RERANKER' }).then((res: any) => {
|
model.asyncGetSelectModel({ model_type: 'RERANKER' }).then((res: any) => {
|
||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,7 +99,6 @@ import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
|||||||
import { computed, onMounted, ref } from 'vue'
|
import { computed, onMounted, ref } from 'vue'
|
||||||
import { groupBy, set } from 'lodash'
|
import { groupBy, set } from 'lodash'
|
||||||
import applicationApi from '@/api/application/application'
|
import applicationApi from '@/api/application/application'
|
||||||
|
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import NodeCascader from '@/workflow/common/NodeCascader.vue'
|
import NodeCascader from '@/workflow/common/NodeCascader.vue'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
@ -161,7 +160,7 @@ function getSelectModel() {
|
|||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
model.asyncGetSelectModel('workspace').then((res: any) => {
|
model.asyncGetSelectModel().then((res: any) => {
|
||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -105,9 +105,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
|
||||||
import { computed, onMounted, ref } from 'vue'
|
import { computed, onMounted, ref } from 'vue'
|
||||||
import { groupBy, set } from 'lodash'
|
import { groupBy, set } from 'lodash'
|
||||||
|
import NodeContainer from '@/workflow/common/NodeContainer.vue'
|
||||||
|
import TTSModeParamSettingDialog from '@/views/application/component/TTSModeParamSettingDialog.vue'
|
||||||
import applicationApi from '@/api/application/application'
|
import applicationApi from '@/api/application/application'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import NodeCascader from '@/workflow/common/NodeCascader.vue'
|
import NodeCascader from '@/workflow/common/NodeCascader.vue'
|
||||||
@ -119,7 +120,6 @@ const route = useRoute()
|
|||||||
const {
|
const {
|
||||||
params: { id },
|
params: { id },
|
||||||
} = route as any
|
} = route as any
|
||||||
import TTSModeParamSettingDialog from '@/views/application/component/TTSModeParamSettingDialog.vue'
|
|
||||||
|
|
||||||
const TTSModeParamSettingDialogRef = ref<InstanceType<typeof TTSModeParamSettingDialog>>()
|
const TTSModeParamSettingDialogRef = ref<InstanceType<typeof TTSModeParamSettingDialog>>()
|
||||||
const { model } = useStore()
|
const { model } = useStore()
|
||||||
@ -176,7 +176,7 @@ function getSelectModel() {
|
|||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
model.asyncGetSelectModel('workspace').then((res: any) => {
|
model.asyncGetSelectModel().then((res: any) => {
|
||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user