feat: shared
This commit is contained in:
parent
65a65de03e
commit
cb60220cb8
@ -44,7 +44,7 @@ import {Codemirror} from 'vue-codemirror'
|
|||||||
import {python} from '@codemirror/lang-python'
|
import {python} from '@codemirror/lang-python'
|
||||||
import {oneDark} from '@codemirror/theme-one-dark'
|
import {oneDark} from '@codemirror/theme-one-dark'
|
||||||
import {linter, type Diagnostic} from '@codemirror/lint'
|
import {linter, type Diagnostic} from '@codemirror/lint'
|
||||||
import ToolApi from '@/api/shared/tool'
|
import ToolApi from '@/api/system-shared/tool'
|
||||||
|
|
||||||
defineOptions({name: 'CodemirrorEditor'})
|
defineOptions({name: 'CodemirrorEditor'})
|
||||||
|
|
||||||
|
|||||||
@ -77,9 +77,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref, watch } from 'vue'
|
import { reactive, ref, watch } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import documentApi from '@/api/shared/document'
|
import documentApi from '@/api/system-shared/document'
|
||||||
import paragraphApi from '@/api/shared/paragraph'
|
import paragraphApi from '@/api/system-shared/paragraph'
|
||||||
import knowledgeApi from '@/api/shared/knowledge'
|
import knowledgeApi from '@/api/system-shared/knowledge'
|
||||||
import useStoreShared from '@/stores/modules-shared-system'
|
import useStoreShared from '@/stores/modules-shared-system'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import { groupBy } from 'lodash'
|
import { groupBy } from 'lodash'
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import {PermissionConst, EditionConst, RoleConst} from '@/utils/permission/data'
|
import { PermissionConst, EditionConst, RoleConst } from '@/utils/permission/data'
|
||||||
import {ComplexPermission} from '@/utils/permission/type'
|
import { ComplexPermission } from '@/utils/permission/type'
|
||||||
|
|
||||||
const systemRouter = {
|
const systemRouter = {
|
||||||
path: '/system',
|
path: '/system',
|
||||||
name: 'system',
|
name: 'system',
|
||||||
meta: {title: 'views.system.title'},
|
meta: { title: 'views.system.title' },
|
||||||
hidden: true,
|
hidden: true,
|
||||||
component: () => import('@/layout/layout-template/SystemMainLayout.vue'),
|
component: () => import('@/layout/layout-template/SystemMainLayout.vue'),
|
||||||
children: [
|
children: [
|
||||||
@ -20,7 +20,49 @@ const systemRouter = {
|
|||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
permission: [RoleConst.ADMIN, EditionConst.IS_EE],
|
permission: [RoleConst.ADMIN, EditionConst.IS_EE],
|
||||||
},
|
},
|
||||||
component: () => import('@/views/user-manage/index.vue'),
|
component: () => import('@/views/system/user-manage/index.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/system/role',
|
||||||
|
name: 'role',
|
||||||
|
meta: {
|
||||||
|
icon: 'app-resource-authorization', // TODO
|
||||||
|
iconActive: 'app-resource-authorization-active', // TODO
|
||||||
|
title: 'views.role.title',
|
||||||
|
activeMenu: '/system',
|
||||||
|
parentPath: '/system',
|
||||||
|
parentName: 'system',
|
||||||
|
permission: [
|
||||||
|
new ComplexPermission(
|
||||||
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE.getWorkspaceRole],
|
||||||
|
[PermissionConst.ROLE_READ],
|
||||||
|
[EditionConst.IS_EE],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
component: () => import('@/views/system/role/index.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/system/workspace',
|
||||||
|
name: 'workspace',
|
||||||
|
meta: {
|
||||||
|
icon: 'app-resource-authorization', // TODO
|
||||||
|
iconActive: 'app-resource-authorization-active', // TODO
|
||||||
|
title: 'views.workspace.title',
|
||||||
|
activeMenu: '/system',
|
||||||
|
parentPath: '/system',
|
||||||
|
parentName: 'system',
|
||||||
|
permission: [
|
||||||
|
new ComplexPermission(
|
||||||
|
[RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN],
|
||||||
|
[PermissionConst.WORKSPACE_WORKSPACE_READ],
|
||||||
|
[EditionConst.IS_EE],
|
||||||
|
'OR',
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
component: () => import('@/views/system/workspace/index.vue'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/system/resource-management',
|
path: '/system/resource-management',
|
||||||
@ -69,49 +111,7 @@ const systemRouter = {
|
|||||||
parentPath: '/system',
|
parentPath: '/system',
|
||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
},
|
},
|
||||||
component: () => import('@/views/resource-authorization/index.vue'),
|
component: () => import('@/views/system/resource-authorization/index.vue'),
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/system/role',
|
|
||||||
name: 'role',
|
|
||||||
meta: {
|
|
||||||
icon: 'app-resource-authorization', // TODO
|
|
||||||
iconActive: 'app-resource-authorization-active', // TODO
|
|
||||||
title: 'views.role.title',
|
|
||||||
activeMenu: '/system',
|
|
||||||
parentPath: '/system',
|
|
||||||
parentName: 'system',
|
|
||||||
permission: [
|
|
||||||
new ComplexPermission(
|
|
||||||
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE.getWorkspaceRole],
|
|
||||||
[PermissionConst.ROLE_READ],
|
|
||||||
[EditionConst.IS_EE],
|
|
||||||
'OR',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
component: () => import('@/views/role/index.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/system/workspace',
|
|
||||||
name: 'workspace',
|
|
||||||
meta: {
|
|
||||||
icon: 'app-resource-authorization', // TODO
|
|
||||||
iconActive: 'app-resource-authorization-active', // TODO
|
|
||||||
title: 'views.workspace.title',
|
|
||||||
activeMenu: '/system',
|
|
||||||
parentPath: '/system',
|
|
||||||
parentName: 'system',
|
|
||||||
permission: [
|
|
||||||
new ComplexPermission(
|
|
||||||
[RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN],
|
|
||||||
[PermissionConst.WORKSPACE_WORKSPACE_READ],
|
|
||||||
[EditionConst.IS_EE],
|
|
||||||
'OR',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
component: () => import('@/views/workspace/index.vue'),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/system/shared',
|
path: '/system/shared',
|
||||||
@ -262,7 +262,7 @@ const systemRouter = {
|
|||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
permission: [EditionConst.IS_PE, EditionConst.IS_EE],
|
permission: [EditionConst.IS_PE, EditionConst.IS_EE],
|
||||||
},
|
},
|
||||||
component: () => import('@/views/theme/index.vue'),
|
component: () => import('@/views/system-setting/theme/index.vue'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/system/authentication',
|
path: '/system/authentication',
|
||||||
@ -274,7 +274,7 @@ const systemRouter = {
|
|||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
permission: [EditionConst.IS_PE, EditionConst.IS_EE],
|
permission: [EditionConst.IS_PE, EditionConst.IS_EE],
|
||||||
},
|
},
|
||||||
component: () => import('@/views/authentication/index.vue'),
|
component: () => import('@/views/system-setting/authentication/index.vue'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/system/email',
|
path: '/system/email',
|
||||||
@ -286,7 +286,7 @@ const systemRouter = {
|
|||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
//permission: new Role('ADMIN')
|
//permission: new Role('ADMIN')
|
||||||
},
|
},
|
||||||
component: () => import('@/views/email/index.vue'),
|
component: () => import('@/views/system-setting/email/index.vue'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -302,8 +302,8 @@ const systemRouter = {
|
|||||||
parentName: 'system',
|
parentName: 'system',
|
||||||
permission: [EditionConst.IS_PE, EditionConst.IS_EE],
|
permission: [EditionConst.IS_PE, EditionConst.IS_EE],
|
||||||
},
|
},
|
||||||
component: () => import('@/views/operate-log/index.vue')
|
component: () => import('@/views/system/operate-log/index.vue'),
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import documentApi from '@/api/shared/document'
|
import documentApi from '@/api/system-shared/document'
|
||||||
import { type Ref } from 'vue'
|
import { type Ref } from 'vue'
|
||||||
|
|
||||||
const useDocumentStore = defineStore('documen', {
|
const useDocumentStore = defineStore('documen', {
|
||||||
|
|||||||
@ -1,7 +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 knowledgeApi from '@/api/shared/knowledge'
|
import knowledgeApi from '@/api/system-shared/knowledge'
|
||||||
import { type Ref } from 'vue'
|
import { type Ref } from 'vue'
|
||||||
|
|
||||||
export interface knowledgeStateTypes {
|
export interface knowledgeStateTypes {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import {defineStore} from 'pinia'
|
import {defineStore} from 'pinia'
|
||||||
import {type Ref} from 'vue'
|
import {type Ref} from 'vue'
|
||||||
import ModelApi from '@/api/shared/model'
|
import ModelApi from '@/api/system-shared/model'
|
||||||
import ProviderApi from '@/api/shared/provider'
|
import ProviderApi from '@/api/model/provider'
|
||||||
import type {ListModelRequest} from '@/api/type/model'
|
import type {ListModelRequest} from '@/api/type/model'
|
||||||
|
|
||||||
const useModelStore = defineStore('mode', {
|
const useModelStore = defineStore('mode', {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import paragraphApi from '@/api/shared/paragraph'
|
import paragraphApi from '@/api/system-shared/paragraph'
|
||||||
import type { Ref } from 'vue'
|
import type { Ref } from 'vue'
|
||||||
|
|
||||||
const useParagraphStore = defineStore('paragrap', {
|
const useParagraphStore = defineStore('paragrap', {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { type Ref } from 'vue'
|
import { type Ref } from 'vue'
|
||||||
import problemApi from '@/api/shared/problem'
|
import problemApi from '@/api/system-shared/problem'
|
||||||
import type { pageRequest } from '@/api/type/common'
|
import type { pageRequest } from '@/api/type/common'
|
||||||
|
|
||||||
const useProblemStore = defineStore('proble', {
|
const useProblemStore = defineStore('proble', {
|
||||||
|
|||||||
@ -1,100 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="chat layout-bg" v-loading="loading">
|
|
||||||
<div class="chat__header" :class="!isDefaultTheme ? 'custom-header' : ''">
|
|
||||||
<div class="chat-width flex align-center">
|
|
||||||
<div class="mr-12 ml-24 flex">
|
|
||||||
<el-avatar
|
|
||||||
v-if="isAppIcon(applicationDetail?.icon)"
|
|
||||||
shape="square"
|
|
||||||
:size="32"
|
|
||||||
style="background: none"
|
|
||||||
>
|
|
||||||
<img :src="applicationDetail?.icon" alt="" />
|
|
||||||
</el-avatar>
|
|
||||||
<LogoIcon v-else height="28px" style="width: 28px; height: 28px; display: block" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2>{{ applicationDetail?.name }}</h2>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="chat__main chat-width">
|
|
||||||
<AiChat
|
|
||||||
v-model:applicationDetails="applicationDetail"
|
|
||||||
type="ai-chat"
|
|
||||||
:available="applicationAvailable"
|
|
||||||
:appId="applicationDetail?.id"
|
|
||||||
:record="recordList"
|
|
||||||
:chatId="currentChatId"
|
|
||||||
@refresh="refresh"
|
|
||||||
>
|
|
||||||
<template #operateBefore>
|
|
||||||
<div>
|
|
||||||
<el-button type="primary" link class="new-chat-button mb-8" @click="newChat">
|
|
||||||
<el-icon><Plus /></el-icon><span class="ml-4">{{ $t('chat.createChat') }}</span>
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</AiChat>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { ref, computed } from 'vue'
|
|
||||||
import { isAppIcon } from '@/utils/common'
|
|
||||||
import useStore from '@/stores'
|
|
||||||
|
|
||||||
const { theme } = useStore()
|
|
||||||
|
|
||||||
const isDefaultTheme = computed(() => {
|
|
||||||
return theme.isDefaultTheme()
|
|
||||||
})
|
|
||||||
|
|
||||||
const loading = ref(false)
|
|
||||||
const props = defineProps<{
|
|
||||||
application_profile: any
|
|
||||||
applicationAvailable: boolean
|
|
||||||
}>()
|
|
||||||
const applicationDetail = computed({
|
|
||||||
get: () => {
|
|
||||||
return props.application_profile
|
|
||||||
},
|
|
||||||
set: (v) => {},
|
|
||||||
})
|
|
||||||
const recordList = ref([])
|
|
||||||
const currentChatId = ref('')
|
|
||||||
|
|
||||||
function newChat() {
|
|
||||||
currentChatId.value = 'new'
|
|
||||||
recordList.value = []
|
|
||||||
}
|
|
||||||
function refresh(id: string) {
|
|
||||||
currentChatId.value = id
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss">
|
|
||||||
.chat {
|
|
||||||
overflow: hidden;
|
|
||||||
&__header {
|
|
||||||
background: var(--app-header-bg-color);
|
|
||||||
position: fixed;
|
|
||||||
width: 100%;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
z-index: 100;
|
|
||||||
height: var(--app-header-height);
|
|
||||||
line-height: var(--app-header-height);
|
|
||||||
box-sizing: border-box;
|
|
||||||
border-bottom: 1px solid var(--el-border-color);
|
|
||||||
}
|
|
||||||
&__main {
|
|
||||||
padding-top: calc(var(--app-header-height) + 24px);
|
|
||||||
height: calc(100vh - var(--app-header-height) - 24px);
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-width {
|
|
||||||
// max-width: 80%;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -50,11 +50,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 历史记录弹出层 -->
|
<!-- 历史记录弹出层 -->
|
||||||
<div
|
<div @click.prevent.stop="show = !show" class="chat-popover-button cursor color-secondary">
|
||||||
v-if="applicationDetail.show_history || !user.isEnterprise()"
|
|
||||||
@click.prevent.stop="show = !show"
|
|
||||||
class="chat-popover-button cursor color-secondary"
|
|
||||||
>
|
|
||||||
<AppIcon
|
<AppIcon
|
||||||
iconName="app-history-outlined"
|
iconName="app-history-outlined"
|
||||||
:style="{
|
:style="{
|
||||||
@ -298,9 +294,7 @@ function refresh(id: string) {
|
|||||||
*初始化历史对话记录
|
*初始化历史对话记录
|
||||||
*/
|
*/
|
||||||
const init = () => {
|
const init = () => {
|
||||||
if (applicationDetail.value.show_history || !user.isEnterprise()) {
|
getChatLog(applicationDetail.value.id)
|
||||||
getChatLog(applicationDetail.value.id)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@ -49,11 +49,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 历史记录弹出层 -->
|
<!-- 历史记录弹出层 -->
|
||||||
<div
|
<div @click.prevent.stop="show = !show" class="chat-popover-button cursor color-secondary">
|
||||||
v-if="applicationDetail.show_history || !user.isEnterprise()"
|
|
||||||
@click.prevent.stop="show = !show"
|
|
||||||
class="chat-popover-button cursor color-secondary"
|
|
||||||
>
|
|
||||||
<AppIcon
|
<AppIcon
|
||||||
iconName="app-history-outlined"
|
iconName="app-history-outlined"
|
||||||
:style="{
|
:style="{
|
||||||
@ -294,9 +290,7 @@ function refresh(id: string) {
|
|||||||
*初始化历史对话记录
|
*初始化历史对话记录
|
||||||
*/
|
*/
|
||||||
const init = () => {
|
const init = () => {
|
||||||
if (applicationDetail.value.show_history || !user.isEnterprise()) {
|
getChatLog(applicationDetail.value.id)
|
||||||
getChatLog(applicationDetail.value.id)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@ -377,12 +377,13 @@ async function exportHTML(): Promise<void> {
|
|||||||
*初始化历史对话记录
|
*初始化历史对话记录
|
||||||
*/
|
*/
|
||||||
const init = () => {
|
const init = () => {
|
||||||
if (
|
// if (
|
||||||
(applicationDetail.value.show_history || !user.isEnterprise()) &&
|
// (applicationDetail.value.show_history || !user.isEnterprise()) &&
|
||||||
props.applicationAvailable
|
// props.applicationAvailable
|
||||||
) {
|
// ) {
|
||||||
getChatLog(applicationDetail.value.id)
|
// getChatLog(applicationDetail.value.id)
|
||||||
}
|
// }
|
||||||
|
getChatLog(applicationDetail.value.id)
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
init()
|
init()
|
||||||
|
|||||||
@ -110,7 +110,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, watch } from 'vue'
|
import { ref, reactive, watch } from 'vue'
|
||||||
import ToolApi from '@/api/shared/tool'
|
import ToolApi from '@/api/system-shared/tool'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
import DynamicsForm from '@/components/dynamics-form/index.vue'
|
import DynamicsForm from '@/components/dynamics-form/index.vue'
|
||||||
|
|
||||||
|
|||||||
@ -262,7 +262,7 @@ import ToolDebugDrawer from './ToolDebugDrawer.vue'
|
|||||||
import UserFieldFormDialog from '@/views/resource-management/tool/component/UserFieldFormDialog.vue'
|
import UserFieldFormDialog from '@/views/resource-management/tool/component/UserFieldFormDialog.vue'
|
||||||
import EditAvatarDialog from '@/views/resource-management/tool/component/EditAvatarDialog.vue'
|
import EditAvatarDialog from '@/views/resource-management/tool/component/EditAvatarDialog.vue'
|
||||||
import type {toolData} from '@/api/type/tool'
|
import type {toolData} from '@/api/type/tool'
|
||||||
import ToolApi from '@/api/shared/tool'
|
import ToolApi from '@/api/system-shared/tool'
|
||||||
import type {FormInstance} from 'element-plus'
|
import type {FormInstance} from 'element-plus'
|
||||||
import {MsgSuccess, MsgConfirm} from '@/utils/message'
|
import {MsgSuccess, MsgConfirm} from '@/utils/message'
|
||||||
import {cloneDeep} from 'lodash'
|
import {cloneDeep} from 'lodash'
|
||||||
|
|||||||
@ -56,7 +56,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import ToolApi from '@/api/shared/tool'
|
import ToolApi from '@/api/system-shared/tool'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import { MsgError, MsgSuccess } from '@/utils/message'
|
import { MsgError, MsgSuccess } from '@/utils/message'
|
||||||
import { defaultIcon, isAppIcon } from '@/utils/common'
|
import { defaultIcon, isAppIcon } from '@/utils/common'
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref, watch} from 'vue'
|
import {ref, watch} from 'vue'
|
||||||
import ToolApi from '@/api/shared/tool'
|
import ToolApi from '@/api/system-shared/tool'
|
||||||
import DynamicsForm from '@/components/dynamics-form/index.vue'
|
import DynamicsForm from '@/components/dynamics-form/index.vue'
|
||||||
import {MsgSuccess} from '@/utils/message'
|
import {MsgSuccess} from '@/utils/message'
|
||||||
import {t} from '@/locales'
|
import {t} from '@/locales'
|
||||||
|
|||||||
@ -80,7 +80,7 @@ import { ref, computed } from 'vue'
|
|||||||
import type { CheckboxValueType } from 'element-plus'
|
import type { CheckboxValueType } from 'element-plus'
|
||||||
import iconMap from '@/components/app-icon/icons/common'
|
import iconMap from '@/components/app-icon/icons/common'
|
||||||
import { Search } from '@element-plus/icons-vue'
|
import { Search } from '@element-plus/icons-vue'
|
||||||
import authorizationApi from '@/api/shared/authorization'
|
import authorizationApi from '@/api/system-shared/authorization'
|
||||||
|
|
||||||
const checkAll = ref(false)
|
const checkAll = ref(false)
|
||||||
const isIndeterminate = ref(true)
|
const isIndeterminate = ref(true)
|
||||||
|
|||||||
@ -140,7 +140,7 @@ import { MsgConfirm, MsgSuccess, MsgWarning } from '@/utils/message'
|
|||||||
import { getImgUrl } from '@/utils/utils'
|
import { getImgUrl } from '@/utils/utils'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import type Node from 'element-plus/es/components/tree/src/model/node'
|
import type Node from 'element-plus/es/components/tree/src/model/node'
|
||||||
import documentApi from '@/api/shared/document'
|
import documentApi from '@/api/system-shared/document'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|||||||
@ -60,7 +60,7 @@ import { useRouter, useRoute } from 'vue-router'
|
|||||||
import SetRules from './upload/SetRules.vue'
|
import SetRules from './upload/SetRules.vue'
|
||||||
import ResultSuccess from './upload/ResultSuccess.vue'
|
import ResultSuccess from './upload/ResultSuccess.vue'
|
||||||
import UploadComponent from './upload/UploadComponent.vue'
|
import UploadComponent from './upload/UploadComponent.vue'
|
||||||
import documentApi from '@/api/shared/document'
|
import documentApi from '@/api/system-shared/document'
|
||||||
import { MsgConfirm, MsgSuccess } from '@/utils/message'
|
import { MsgConfirm, MsgSuccess } from '@/utils/message'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import useStore from '@/stores/modules-shared-system'
|
import useStore from '@/stores/modules-shared-system'
|
||||||
|
|||||||
@ -95,7 +95,7 @@
|
|||||||
import { ref, reactive, watch } from 'vue'
|
import { ref, reactive, watch } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
import documentApi from '@/api/shared/document'
|
import documentApi from '@/api/system-shared/document'
|
||||||
import { MsgSuccess } from '@/utils/message'
|
import { MsgSuccess } from '@/utils/message'
|
||||||
import { hitHandlingMethod } from '@/enums/document'
|
import { hitHandlingMethod } from '@/enums/document'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
|
|||||||
@ -60,7 +60,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import documentApi from '@/api/shared/document'
|
import documentApi from '@/api/system-shared/document'
|
||||||
|
|
||||||
import useStore from '@/stores/modules-shared-system'
|
import useStore from '@/stores/modules-shared-system'
|
||||||
const { knowledge } = useStore()
|
const { knowledge } = useStore()
|
||||||
|
|||||||
@ -539,7 +539,7 @@
|
|||||||
import { ref, onMounted, onBeforeUnmount, computed } from 'vue'
|
import { ref, onMounted, onBeforeUnmount, computed } from 'vue'
|
||||||
import { useRouter, useRoute, onBeforeRouteLeave, onBeforeRouteUpdate } from 'vue-router'
|
import { useRouter, useRoute, onBeforeRouteLeave, onBeforeRouteUpdate } from 'vue-router'
|
||||||
import { ElTable } from 'element-plus'
|
import { ElTable } from 'element-plus'
|
||||||
import documentApi from '@/api/shared/document'
|
import documentApi from '@/api/system-shared/document'
|
||||||
import ImportDocumentDialog from './component/ImportDocumentDialog.vue'
|
import ImportDocumentDialog from './component/ImportDocumentDialog.vue'
|
||||||
import SyncWebDialog from '@/views/knowledge/component/SyncWebDialog.vue'
|
import SyncWebDialog from '@/views/knowledge/component/SyncWebDialog.vue'
|
||||||
import SelectKnowledgeDialog from './component/SelectKnowledgeDialog.vue'
|
import SelectKnowledgeDialog from './component/SelectKnowledgeDialog.vue'
|
||||||
|
|||||||
@ -123,7 +123,7 @@ import { ref, computed, onMounted, reactive, watch } from 'vue'
|
|||||||
import ParagraphPreview from '@/views/knowledge/component/ParagraphPreview.vue'
|
import ParagraphPreview from '@/views/knowledge/component/ParagraphPreview.vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { cutFilename } from '@/utils/utils'
|
import { cutFilename } from '@/utils/utils'
|
||||||
import documentApi from '@/api/shared/document'
|
import documentApi from '@/api/system-shared/document'
|
||||||
import useStore from '@/stores/modules-shared-system'
|
import useStore from '@/stores/modules-shared-system'
|
||||||
import type { KeyValue } from '@/api/type/common'
|
import type { KeyValue } from '@/api/type/common'
|
||||||
const { knowledge } = useStore()
|
const { knowledge } = useStore()
|
||||||
|
|||||||
@ -199,7 +199,7 @@ import { ref, reactive, onUnmounted, onMounted, computed, watch, nextTick } from
|
|||||||
import type { UploadFiles } from 'element-plus'
|
import type { UploadFiles } from 'element-plus'
|
||||||
import { filesize, getImgUrl, isRightType } from '@/utils/utils'
|
import { filesize, getImgUrl, isRightType } from '@/utils/utils'
|
||||||
import { MsgError } from '@/utils/message'
|
import { MsgError } from '@/utils/message'
|
||||||
import documentApi from '@/api/shared/document'
|
import documentApi from '@/api/system-shared/document'
|
||||||
import useStore from '@/stores/modules-shared-system'
|
import useStore from '@/stores/modules-shared-system'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
const { knowledge } = useStore()
|
const { knowledge } = useStore()
|
||||||
|
|||||||
@ -215,7 +215,7 @@
|
|||||||
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 KnowledgeApi from '@/api/shared/knowledge'
|
import KnowledgeApi from '@/api/system-shared/knowledge'
|
||||||
// import applicationApi from '@/api/application/application'
|
// 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'
|
||||||
|
|||||||
@ -152,7 +152,7 @@
|
|||||||
import { ref, onMounted, reactive } from 'vue'
|
import { ref, onMounted, reactive } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import BaseForm from '@/views/shared/knowledge-shared/component/BaseForm.vue'
|
import BaseForm from '@/views/shared/knowledge-shared/component/BaseForm.vue'
|
||||||
import KnowledgeApi from '@/api/shared/knowledge'
|
import KnowledgeApi from '@/api/system-shared/knowledge'
|
||||||
import type { ApplicationFormType } from '@/api/type/application'
|
import type { ApplicationFormType } from '@/api/type/application'
|
||||||
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||||
import { isAppIcon } from '@/utils/common'
|
import { isAppIcon } from '@/utils/common'
|
||||||
|
|||||||
@ -133,7 +133,7 @@ import CreateKnowledgeDialog from './create-component/CreateKnowledgeDialog.vue'
|
|||||||
import CreateWebKnowledgeDialog from './create-component/CreateWebKnowledgeDialog.vue'
|
import CreateWebKnowledgeDialog from './create-component/CreateWebKnowledgeDialog.vue'
|
||||||
import CreateFolderDialog from '@/components/folder-tree/CreateFolderDialog.vue'
|
import CreateFolderDialog from '@/components/folder-tree/CreateFolderDialog.vue'
|
||||||
import GenerateRelatedDialog from '@/components/generate-related-shared-dialog/index.vue'
|
import GenerateRelatedDialog from '@/components/generate-related-shared-dialog/index.vue'
|
||||||
import KnowledgeApi from '@/api/shared/knowledge'
|
import KnowledgeApi from '@/api/system-shared/knowledge'
|
||||||
import KnowledgeWorkspaceApi from '@/api/shared-workspace'
|
import KnowledgeWorkspaceApi from '@/api/shared-workspace'
|
||||||
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||||
import useStore from '@/stores/modules-shared-system'
|
import useStore from '@/stores/modules-shared-system'
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import knowledgeApi from '@/api/shared/knowledge'
|
import knowledgeApi from '@/api/system-shared/knowledge'
|
||||||
|
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
const loading = ref<boolean>(false)
|
const loading = ref<boolean>(false)
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
import { ref, watch, reactive } from 'vue'
|
import { ref, watch, reactive } from 'vue'
|
||||||
import { useRouter, useRoute } from 'vue-router'
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
import BaseForm from '@/views/shared/knowledge-shared/component/BaseForm.vue'
|
import BaseForm from '@/views/shared/knowledge-shared/component/BaseForm.vue'
|
||||||
import KnowledgeApi from '@/api/shared/knowledge'
|
import KnowledgeApi from '@/api/system-shared/knowledge'
|
||||||
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
|
|||||||
@ -55,7 +55,7 @@
|
|||||||
import { ref, watch, reactive } from 'vue'
|
import { ref, watch, reactive } from 'vue'
|
||||||
import { useRouter, useRoute } from 'vue-router'
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
import BaseForm from '@/views/shared/knowledge-shared/component/BaseForm.vue'
|
import BaseForm from '@/views/shared/knowledge-shared/component/BaseForm.vue'
|
||||||
import KnowledgeApi from '@/api/shared/knowledge'
|
import KnowledgeApi from '@/api/system-shared/knowledge'
|
||||||
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import { ComplexPermission } from '@/utils/permission/type'
|
import { ComplexPermission } from '@/utils/permission/type'
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
import { ref, watch, reactive } from 'vue'
|
import { ref, watch, reactive } from 'vue'
|
||||||
import { useRouter, useRoute } from 'vue-router'
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
import BaseForm from '@/views/shared/knowledge-shared/component/BaseForm.vue'
|
import BaseForm from '@/views/shared/knowledge-shared/component/BaseForm.vue'
|
||||||
import KnowledgeApi from '@/api/shared/knowledge'
|
import KnowledgeApi from '@/api/system-shared/knowledge'
|
||||||
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
import { MsgSuccess, MsgAlert } from '@/utils/message'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
|
|||||||
@ -282,7 +282,7 @@ import CreateWebKnowledgeDialog from './create-component/CreateWebKnowledgeDialo
|
|||||||
import CreateLarkKnowledgeDialog from './create-component/CreateLarkKnowledgeDialog.vue'
|
import CreateLarkKnowledgeDialog from './create-component/CreateLarkKnowledgeDialog.vue'
|
||||||
import CreateFolderDialog from '@/components/folder-tree/CreateFolderDialog.vue'
|
import CreateFolderDialog from '@/components/folder-tree/CreateFolderDialog.vue'
|
||||||
import GenerateRelatedDialog from '@/components/generate-related-shared-dialog/index.vue'
|
import GenerateRelatedDialog from '@/components/generate-related-shared-dialog/index.vue'
|
||||||
import KnowledgeApi from '@/api/shared/knowledge'
|
import KnowledgeApi from '@/api/system-shared/knowledge'
|
||||||
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||||
import useStore from '@/stores/modules-shared-system'
|
import useStore from '@/stores/modules-shared-system'
|
||||||
import { numberFormat } from '@/utils/common'
|
import { numberFormat } from '@/utils/common'
|
||||||
|
|||||||
@ -103,8 +103,8 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref, computed } from 'vue'
|
import { onMounted, ref, computed } from 'vue'
|
||||||
import ProviderApi from '@/api/shared/provider'
|
import ProviderApi from '@/api/model/provider'
|
||||||
import ModelApi from '@/api/shared/model'
|
import ModelApi from '@/api/system-shared/model'
|
||||||
import ModelWorkspaceApi from '@/api/shared-workspace'
|
import ModelWorkspaceApi from '@/api/shared-workspace'
|
||||||
import type { Provider, Model } from '@/api/type/model'
|
import type { Provider, Model } from '@/api/type/model'
|
||||||
import ModelCard from '@/views/shared/model-shared/component/ModelCardSharedWorkspace.vue'
|
import ModelCard from '@/views/shared/model-shared/component/ModelCardSharedWorkspace.vue'
|
||||||
|
|||||||
@ -239,8 +239,8 @@
|
|||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import type { Provider, BaseModel } from '@/api/type/model'
|
import type { Provider, BaseModel } from '@/api/type/model'
|
||||||
import type { Dict, KeyValue } from '@/api/type/common'
|
import type { Dict, KeyValue } from '@/api/type/common'
|
||||||
import ModelApi from '@/api/shared/model'
|
import ModelApi from '@/api/system-shared/model'
|
||||||
import ProviderApi from '@/api/shared/provider'
|
import ProviderApi from '@/api/model/provider'
|
||||||
import type { FormField } from '@/components/dynamics-form/type'
|
import type { FormField } from '@/components/dynamics-form/type'
|
||||||
import DynamicsForm from '@/components/dynamics-form/index.vue'
|
import DynamicsForm from '@/components/dynamics-form/index.vue'
|
||||||
import type { FormRules } from 'element-plus'
|
import type { FormRules } from 'element-plus'
|
||||||
|
|||||||
@ -122,8 +122,8 @@
|
|||||||
import {ref, computed} from 'vue'
|
import {ref, computed} from 'vue'
|
||||||
import type {Provider, BaseModel, Model} from '@/api/type/model'
|
import type {Provider, BaseModel, Model} from '@/api/type/model'
|
||||||
import type {Dict, KeyValue} from '@/api/type/common'
|
import type {Dict, KeyValue} from '@/api/type/common'
|
||||||
import ModelApi from '@/api/shared/model'
|
import ModelApi from '@/api/system-shared/model'
|
||||||
import ProviderApi from '@/api/shared/provider'
|
import ProviderApi from '@/api/model/provider'
|
||||||
import type {FormField} from '@/components/dynamics-form/type'
|
import type {FormField} from '@/components/dynamics-form/type'
|
||||||
import DynamicsForm from '@/components/dynamics-form/index.vue'
|
import DynamicsForm from '@/components/dynamics-form/index.vue'
|
||||||
import type {FormRules} from 'element-plus'
|
import type {FormRules} from 'element-plus'
|
||||||
|
|||||||
@ -131,7 +131,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Provider, Model } from '@/api/type/model'
|
import type { Provider, Model } from '@/api/type/model'
|
||||||
import ModelApi from '@/api/shared/model'
|
import ModelApi from '@/api/system-shared/model'
|
||||||
import { computed, ref, onMounted, onBeforeUnmount } from 'vue'
|
import { computed, ref, onMounted, onBeforeUnmount } from 'vue'
|
||||||
import EditModel from '@/views/shared/model-shared/component/EditModel.vue'
|
import EditModel from '@/views/shared/model-shared/component/EditModel.vue'
|
||||||
// import DownloadLoading from '@/components/loading/DownloadLoading.vue'
|
// import DownloadLoading from '@/components/loading/DownloadLoading.vue'
|
||||||
|
|||||||
@ -67,7 +67,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Provider, Model } from '@/api/type/model'
|
import type { Provider, Model } from '@/api/type/model'
|
||||||
import ModelApi from '@/api/shared/model'
|
import ModelApi from '@/api/system-shared/model'
|
||||||
import { computed, ref, onMounted, onBeforeUnmount } from 'vue'
|
import { computed, ref, onMounted, onBeforeUnmount } from 'vue'
|
||||||
import EditModel from '@/views/shared/model-shared/component/EditModel.vue'
|
import EditModel from '@/views/shared/model-shared/component/EditModel.vue'
|
||||||
// import DownloadLoading from '@/components/loading/DownloadLoading.vue'
|
// import DownloadLoading from '@/components/loading/DownloadLoading.vue'
|
||||||
|
|||||||
@ -85,7 +85,7 @@ import type { Model } from '@/api/type/model'
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import AddParamDrawer from './AddParamDrawer.vue'
|
import AddParamDrawer from './AddParamDrawer.vue'
|
||||||
import { MsgError, MsgSuccess } from '@/utils/message'
|
import { MsgError, MsgSuccess } from '@/utils/message'
|
||||||
import ModelApi from '@/api/shared/model'
|
import ModelApi from '@/api/system-shared/model'
|
||||||
import { input_type_list } from '@/components/dynamics-form/constructor/data'
|
import { input_type_list } from '@/components/dynamics-form/constructor/data'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import ProviderApi from '@/api/shared/provider'
|
import ProviderApi from '@/api/model/provider'
|
||||||
import type { Provider } from '@/api/type/model'
|
import type { Provider } from '@/api/type/model'
|
||||||
import { modelTypeList } from './data'
|
import { modelTypeList } from './data'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
|
|||||||
@ -124,7 +124,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref, computed } from 'vue'
|
import { onMounted, ref, computed } from 'vue'
|
||||||
import ProviderApi from '@/api/shared/provider'
|
import ProviderApi from '@/api/model/provider'
|
||||||
import type { Provider, Model } from '@/api/type/model'
|
import type { Provider, Model } from '@/api/type/model'
|
||||||
import ModelCard from '@/views/shared/model-shared/component/ModelCard.vue'
|
import ModelCard from '@/views/shared/model-shared/component/ModelCard.vue'
|
||||||
import ProviderComponent from '@/views/shared/model-shared/component/Provider.vue'
|
import ProviderComponent from '@/views/shared/model-shared/component/Provider.vue'
|
||||||
|
|||||||
@ -54,7 +54,7 @@ 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/shared/paragraph'
|
import paragraphApi from '@/api/system-shared/paragraph'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@ -57,7 +57,7 @@
|
|||||||
<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/shared/paragraph'
|
import paragraphApi from '@/api/system-shared/paragraph'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@ -86,7 +86,7 @@
|
|||||||
import { ref, watch, reactive } from 'vue'
|
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 paragraphApi from '@/api/shared/paragraph'
|
import paragraphApi from '@/api/system-shared/paragraph'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
const { knowledge, document } = useStore()
|
const { knowledge, document } = useStore()
|
||||||
|
|||||||
@ -140,8 +140,8 @@
|
|||||||
import { reactive, ref, onMounted, computed } from 'vue'
|
import { reactive, ref, onMounted, computed } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import documentApi from '@/api/shared/document'
|
import documentApi from '@/api/system-shared/document'
|
||||||
import paragraphApi from '@/api/shared/paragraph'
|
import paragraphApi from '@/api/system-shared/paragraph'
|
||||||
import ParagraphDialog from './component/ParagraphDialog.vue'
|
import ParagraphDialog from './component/ParagraphDialog.vue'
|
||||||
import ParagraphCard from './component/ParagraphCard.vue'
|
import ParagraphCard from './component/ParagraphCard.vue'
|
||||||
import SelectDocumentDialog from './component/SelectDocumentDialog.vue'
|
import SelectDocumentDialog from './component/SelectDocumentDialog.vue'
|
||||||
|
|||||||
@ -83,7 +83,7 @@
|
|||||||
<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/shared/problem'
|
import problemApi from '@/api/system-shared/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'
|
||||||
|
|||||||
@ -111,8 +111,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch, reactive } from 'vue'
|
import { ref, watch, reactive } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import problemApi from '@/api/shared/problem'
|
import problemApi from '@/api/system-shared/problem'
|
||||||
import paragraphApi from '@/api/shared/paragraph'
|
import paragraphApi from '@/api/system-shared/paragraph'
|
||||||
import useStore from '@/stores/modules-shared-system'
|
import useStore from '@/stores/modules-shared-system'
|
||||||
import { MsgSuccess } from '@/utils/message'
|
import { MsgSuccess } from '@/utils/message'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
|
|||||||
@ -136,7 +136,7 @@
|
|||||||
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/shared/problem'
|
import problemApi from '@/api/system-shared/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'
|
||||||
|
|||||||
@ -118,7 +118,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref, reactive, computed } from 'vue'
|
import { onMounted, ref, reactive, computed } from 'vue'
|
||||||
import { cloneDeep, get } from 'lodash'
|
import { cloneDeep, get } from 'lodash'
|
||||||
import ToolApi from '@/api/shared/tool'
|
import ToolApi from '@/api/system-shared/tool'
|
||||||
import ToolWorkspaceApi from '@/api/shared-workspace'
|
import ToolWorkspaceApi from '@/api/shared-workspace'
|
||||||
import useStore from '@/stores/modules-shared-system'
|
import useStore from '@/stores/modules-shared-system'
|
||||||
import InitParamDrawer from '@/views/shared/tool-shared/component/InitParamDrawer.vue'
|
import InitParamDrawer from '@/views/shared/tool-shared/component/InitParamDrawer.vue'
|
||||||
|
|||||||
@ -110,7 +110,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, watch } from 'vue'
|
import { ref, reactive, watch } from 'vue'
|
||||||
import ToolApi from '@/api/shared/tool'
|
import ToolApi from '@/api/system-shared/tool'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
import DynamicsForm from '@/components/dynamics-form/index.vue'
|
import DynamicsForm from '@/components/dynamics-form/index.vue'
|
||||||
|
|
||||||
|
|||||||
@ -262,7 +262,7 @@ import ToolDebugDrawer from './ToolDebugDrawer.vue'
|
|||||||
import UserFieldFormDialog from '@/views/shared/tool-shared/component/UserFieldFormDialog.vue'
|
import UserFieldFormDialog from '@/views/shared/tool-shared/component/UserFieldFormDialog.vue'
|
||||||
import EditAvatarDialog from '@/views/shared/tool-shared/component/EditAvatarDialog.vue'
|
import EditAvatarDialog from '@/views/shared/tool-shared/component/EditAvatarDialog.vue'
|
||||||
import type {toolData} from '@/api/type/tool'
|
import type {toolData} from '@/api/type/tool'
|
||||||
import ToolApi from '@/api/shared/tool'
|
import ToolApi from '@/api/system-shared/tool'
|
||||||
import type {FormInstance} from 'element-plus'
|
import type {FormInstance} from 'element-plus'
|
||||||
import {MsgSuccess, MsgConfirm} from '@/utils/message'
|
import {MsgSuccess, MsgConfirm} from '@/utils/message'
|
||||||
import {cloneDeep} from 'lodash'
|
import {cloneDeep} from 'lodash'
|
||||||
|
|||||||
@ -56,7 +56,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import ToolApi from '@/api/shared/tool'
|
import ToolApi from '@/api/system-shared/tool'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import { MsgError, MsgSuccess } from '@/utils/message'
|
import { MsgError, MsgSuccess } from '@/utils/message'
|
||||||
import { defaultIcon, isAppIcon } from '@/utils/common'
|
import { defaultIcon, isAppIcon } from '@/utils/common'
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref, watch} from 'vue'
|
import {ref, watch} from 'vue'
|
||||||
import ToolApi from '@/api/shared/tool'
|
import ToolApi from '@/api/system-shared/tool'
|
||||||
import DynamicsForm from '@/components/dynamics-form/index.vue'
|
import DynamicsForm from '@/components/dynamics-form/index.vue'
|
||||||
import {MsgSuccess} from '@/utils/message'
|
import {MsgSuccess} from '@/utils/message'
|
||||||
import {t} from '@/locales'
|
import {t} from '@/locales'
|
||||||
|
|||||||
@ -197,7 +197,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref, reactive, computed } from 'vue'
|
import { onMounted, ref, reactive, computed } from 'vue'
|
||||||
import { cloneDeep, get } from 'lodash'
|
import { cloneDeep, get } from 'lodash'
|
||||||
import ToolApi from '@/api/shared/tool'
|
import ToolApi from '@/api/system-shared/tool'
|
||||||
import useStore from '@/stores/modules-shared-system'
|
import useStore from '@/stores/modules-shared-system'
|
||||||
import InitParamDrawer from '@/views/shared/tool-shared/component/InitParamDrawer.vue'
|
import InitParamDrawer from '@/views/shared/tool-shared/component/InitParamDrawer.vue'
|
||||||
import ToolFormDrawer from './ToolFormDrawer.vue'
|
import ToolFormDrawer from './ToolFormDrawer.vue'
|
||||||
|
|||||||
239
ui/src/views/system-shared/ModelSharedIndex.vue
Normal file
239
ui/src/views/system-shared/ModelSharedIndex.vue
Normal file
@ -0,0 +1,239 @@
|
|||||||
|
<template>
|
||||||
|
<ContentContainer>
|
||||||
|
<template #header>
|
||||||
|
<div class="shared-header">
|
||||||
|
<span class="title">{{ t('views.system.shared_resources') }}</span>
|
||||||
|
<el-icon size="12">
|
||||||
|
<rightOutlined></rightOutlined>
|
||||||
|
</el-icon>
|
||||||
|
<span class="sub-title">{{ t('views.model.title') }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-card style="--el-card-padding: 0">
|
||||||
|
<LayoutContainer class="model-manage">
|
||||||
|
<template #left>
|
||||||
|
<h4 class="p-16 mb-8 pb-0">{{ $t('views.model.provider') }}</h4>
|
||||||
|
<ProviderComponent
|
||||||
|
:data="provider_list"
|
||||||
|
@click="clickListHandle"
|
||||||
|
:loading="loading"
|
||||||
|
shareTitle="views.system.share_tool"
|
||||||
|
isShared
|
||||||
|
:active="active_provider"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<ContentContainer :header="active_provider?.name" v-loading="list_model_loading">
|
||||||
|
<template #search>
|
||||||
|
<div class="flex">
|
||||||
|
<div class="flex-between complex-search">
|
||||||
|
<el-select
|
||||||
|
class="complex-search__left"
|
||||||
|
v-model="search_type"
|
||||||
|
style="width: 120px"
|
||||||
|
@change="search_type_change"
|
||||||
|
>
|
||||||
|
<el-option :label="$t('common.creator')" value="create_user" />
|
||||||
|
<el-option
|
||||||
|
:label="$t('views.model.modelForm.model_type.label')"
|
||||||
|
value="model_type"
|
||||||
|
/>
|
||||||
|
<el-option :label="$t('views.model.modelForm.modeName.label')" value="name" />
|
||||||
|
</el-select>
|
||||||
|
<el-input
|
||||||
|
v-if="search_type === 'name'"
|
||||||
|
v-model="model_search_form.name"
|
||||||
|
@change="list_model"
|
||||||
|
:placeholder="$t('common.searchBar.placeholder')"
|
||||||
|
style="width: 220px"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
<el-select
|
||||||
|
v-else-if="search_type === 'create_user'"
|
||||||
|
v-model="model_search_form.create_user"
|
||||||
|
@change="list_model"
|
||||||
|
clearable
|
||||||
|
style="width: 220px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="u in user_options"
|
||||||
|
:key="u.id"
|
||||||
|
:value="u.id"
|
||||||
|
:label="u.username"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<el-select
|
||||||
|
v-else-if="search_type === 'model_type'"
|
||||||
|
v-model="model_search_form.model_type"
|
||||||
|
clearable
|
||||||
|
@change="list_model"
|
||||||
|
style="width: 220px"
|
||||||
|
>
|
||||||
|
<template v-for="item in modelTypeList" :key="item.value">
|
||||||
|
<el-option :label="item.text" :value="item.value" />
|
||||||
|
</template>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<el-button
|
||||||
|
v-if="!isShared"
|
||||||
|
class="ml-16"
|
||||||
|
type="primary"
|
||||||
|
@click="openCreateModel(active_provider)"
|
||||||
|
v-hasPermission="[
|
||||||
|
RoleConst.WORKSPACE_MANAGE.getWorkspaceRole,
|
||||||
|
RoleConst.USER.getWorkspaceRole,
|
||||||
|
PermissionConst.MODEL_CREATE.getWorkspacePermission,
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
{{ $t('views.model.addModel') }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<div class="model-list-height">
|
||||||
|
<el-scrollbar>
|
||||||
|
<el-row v-if="model_split_list.length > 0" :gutter="15" class="w-full">
|
||||||
|
<template v-for="(row, index) in model_split_list" :key="index">
|
||||||
|
<el-col
|
||||||
|
:xs="24"
|
||||||
|
:sm="12"
|
||||||
|
:md="12"
|
||||||
|
:lg="12"
|
||||||
|
:xl="8"
|
||||||
|
class="mb-16"
|
||||||
|
v-for="(model, i) in row"
|
||||||
|
:key="i"
|
||||||
|
>
|
||||||
|
<ModelCard
|
||||||
|
@change="list_model"
|
||||||
|
:updateModelById="updateModelById"
|
||||||
|
:model="model"
|
||||||
|
:provider_list="provider_list"
|
||||||
|
:isShared="isShared"
|
||||||
|
>
|
||||||
|
</ModelCard>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
</el-row>
|
||||||
|
<el-empty :description="$t('common.noData')" v-else />
|
||||||
|
</el-scrollbar>
|
||||||
|
</div>
|
||||||
|
</ContentContainer>
|
||||||
|
|
||||||
|
<CreateModelDialog
|
||||||
|
ref="createModelRef"
|
||||||
|
@submit="list_model"
|
||||||
|
@change="openCreateModel($event)"
|
||||||
|
v-if="!isShared"
|
||||||
|
></CreateModelDialog>
|
||||||
|
|
||||||
|
<SelectProviderDialog
|
||||||
|
ref="selectProviderRef"
|
||||||
|
@change="(provider, modelType) => openCreateModel(provider, modelType)"
|
||||||
|
v-if="!isShared"
|
||||||
|
></SelectProviderDialog>
|
||||||
|
</LayoutContainer>
|
||||||
|
</el-card>
|
||||||
|
</ContentContainer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { onMounted, ref, computed } from 'vue'
|
||||||
|
import ProviderApi from '@/api/model/provider'
|
||||||
|
import ModelApi from '@/api/system-shared/model'
|
||||||
|
import type { Provider, Model } from '@/api/type/model'
|
||||||
|
import ModelCard from '@/views/model/component/ModelCard.vue'
|
||||||
|
import ProviderComponent from '@/views/model/component/Provider.vue'
|
||||||
|
import { splitArray } from '@/utils/common'
|
||||||
|
import { modelTypeList, allObj } from '@/views/model/component/data'
|
||||||
|
import CreateModelDialog from '@/views/model/component/CreateModelDialog.vue'
|
||||||
|
import SelectProviderDialog from '@/views/model/component/SelectProviderDialog.vue'
|
||||||
|
import { t } from '@/locales'
|
||||||
|
import { PermissionConst, RoleConst } from '@/utils/permission/data'
|
||||||
|
const commonList1 = ref()
|
||||||
|
const commonList2 = ref()
|
||||||
|
const loading = ref<boolean>(false)
|
||||||
|
|
||||||
|
const active_provider = ref<Provider>()
|
||||||
|
const search_type = ref('name')
|
||||||
|
const model_search_form = ref<{
|
||||||
|
name: string
|
||||||
|
create_user: string
|
||||||
|
model_type: string
|
||||||
|
}>({
|
||||||
|
name: '',
|
||||||
|
create_user: '',
|
||||||
|
model_type: '',
|
||||||
|
})
|
||||||
|
const user_options = ref<any[]>([])
|
||||||
|
const list_model_loading = ref<boolean>(false)
|
||||||
|
const provider_list = ref<Array<Provider>>([])
|
||||||
|
|
||||||
|
const model_list = ref<Array<Model>>([])
|
||||||
|
|
||||||
|
const isShared = computed(() => {
|
||||||
|
return active_provider.value && active_provider.value.provider === 'share'
|
||||||
|
})
|
||||||
|
const updateModelById = (model_id: string, model: Model) => {
|
||||||
|
model_list.value
|
||||||
|
.filter((m) => m.id == model_id)
|
||||||
|
.forEach((m) => {
|
||||||
|
m.status = model.status
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const model_split_list = computed(() => {
|
||||||
|
return splitArray(model_list.value, 2)
|
||||||
|
})
|
||||||
|
const createModelRef = ref<InstanceType<typeof CreateModelDialog>>()
|
||||||
|
const selectProviderRef = ref<InstanceType<typeof SelectProviderDialog>>()
|
||||||
|
|
||||||
|
const clickListHandle = (item: Provider) => {
|
||||||
|
active_provider.value = item
|
||||||
|
list_model()
|
||||||
|
if (active_provider.value.provider === '') {
|
||||||
|
commonList1.value.clearCurrent()
|
||||||
|
commonList2.value.clearCurrent()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const openCreateModel = (provider?: Provider, model_type?: string) => {
|
||||||
|
if (provider && provider.provider) {
|
||||||
|
createModelRef.value?.open(provider, model_type)
|
||||||
|
} else {
|
||||||
|
selectProviderRef.value?.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const list_model = () => {
|
||||||
|
const params = active_provider.value?.provider ? { provider: active_provider.value.provider } : {}
|
||||||
|
ModelApi.getModel({ ...model_search_form.value, ...params }, list_model_loading).then(
|
||||||
|
(ok: any) => {
|
||||||
|
model_list.value = ok.data
|
||||||
|
const v = model_list.value.map((m) => ({ id: m.user_id, username: m.username }))
|
||||||
|
if (user_options.value.length === 0) {
|
||||||
|
user_options.value = Array.from(new Map(v.map((item) => [item.id, item])).values())
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const search_type_change = () => {
|
||||||
|
model_search_form.value = { name: '', create_user: '', model_type: '' }
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
ProviderApi.getProvider(loading).then((ok) => {
|
||||||
|
active_provider.value = allObj
|
||||||
|
provider_list.value = [allObj, ...ok.data]
|
||||||
|
|
||||||
|
list_model()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.model-manage {
|
||||||
|
.model-list-height {
|
||||||
|
height: calc(var(--app-main-height));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -74,7 +74,7 @@ import {MsgSuccess} from '@/utils/message'
|
|||||||
import {t} from '@/locales'
|
import {t} from '@/locales'
|
||||||
import type {FormItemModel} from '@/api/type/role'
|
import type {FormItemModel} from '@/api/type/role'
|
||||||
import WorkspaceApi from '@/api/workspace/workspace'
|
import WorkspaceApi from '@/api/workspace/workspace'
|
||||||
import MemberFormContent from '@/views/role/component/MemberFormContent.vue'
|
import MemberFormContent from '@/views/system/role/component/MemberFormContent.vue'
|
||||||
import {RoleTypeEnum} from '@/enums/system'
|
import {RoleTypeEnum} from '@/enums/system'
|
||||||
import useStore from "@/stores";
|
import useStore from "@/stores";
|
||||||
|
|
||||||
@ -22,7 +22,7 @@
|
|||||||
import { onBeforeMount, ref } from 'vue'
|
import { onBeforeMount, ref } from 'vue'
|
||||||
import UserApi from '@/api/user/user'
|
import UserApi from '@/api/user/user'
|
||||||
import WorkspaceApi from '@/api/workspace/workspace'
|
import WorkspaceApi from '@/api/workspace/workspace'
|
||||||
import MemberFormContent from '@/views/role/component/MemberFormContent.vue'
|
import MemberFormContent from '@/views/system/role/component/MemberFormContent.vue'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import { MsgSuccess } from '@/utils/message'
|
import { MsgSuccess } from '@/utils/message'
|
||||||
import type { CreateWorkspaceMemberParamsItem, WorkspaceItem } from '@/api/type/workspace'
|
import type { CreateWorkspaceMemberParamsItem, WorkspaceItem } from '@/api/type/workspace'
|
||||||
Loading…
Reference in New Issue
Block a user