Merge remote-tracking branch 'origin/v2' into v2
commit
d0f696d222
|
|
@ -583,16 +583,17 @@ function chatMessage(chat?: any, problem?: string, re_chat?: boolean, other_para
|
||||||
if (props.chatId === 'new') {
|
if (props.chatId === 'new') {
|
||||||
emit('refresh', chartOpenId.value)
|
emit('refresh', chartOpenId.value)
|
||||||
}
|
}
|
||||||
if (props.type === 'debug-ai-chat') {
|
|
||||||
getSourceDetail(chat)
|
getSourceDetail(chat)
|
||||||
} else {
|
// if (props.type === 'debug-ai-chat') {
|
||||||
if (
|
// getSourceDetail(chat)
|
||||||
props.applicationDetails &&
|
// } else {
|
||||||
(props.applicationDetails.show_exec || props.applicationDetails.show_source)
|
// if (
|
||||||
) {
|
// props.applicationDetails &&
|
||||||
getSourceDetail(chat)
|
// (props.applicationDetails.show_exec || props.applicationDetails.show_source)
|
||||||
}
|
// ) {
|
||||||
}
|
// getSourceDetail(chat)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
ChatManagement.close(chat.id)
|
ChatManagement.close(chat.id)
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ defineExpose({
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
&.active {
|
&.active {
|
||||||
background: var(--el-color-primary-light-9);
|
background: var(--el-color-primary-light-9);
|
||||||
border-radius: var();
|
border-radius: var(--app-border-radius-small);
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|
@ -87,7 +87,7 @@ defineExpose({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
border-radius: var();
|
border-radius: var(--app-border-radius-small);
|
||||||
background: var(--app-text-color-light-1);
|
background: var(--app-text-color-light-1);
|
||||||
}
|
}
|
||||||
&.is-active {
|
&.is-active {
|
||||||
|
|
|
||||||
|
|
@ -377,7 +377,7 @@ onUnmounted(() => {
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
&.active {
|
&.active {
|
||||||
background: var(--el-color-primary-light-9);
|
background: var(--el-color-primary-light-9);
|
||||||
border-radius: var();
|
border-radius: var(--app-border-radius-small);
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|
@ -385,7 +385,7 @@ onUnmounted(() => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
border-radius: var();
|
border-radius: var(--app-border-radius-small);
|
||||||
background: var(--app-text-color-light-1);
|
background: var(--app-text-color-light-1);
|
||||||
}
|
}
|
||||||
&.is-active {
|
&.is-active {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="layout-container flex h-full">
|
<div class="layout-container flex h-full">
|
||||||
<div :class="`layout-container__left border-r ${isCollapse ? 'hidden' : ''}`">
|
<div
|
||||||
|
:class="`layout-container__left border-r ${isCollapse ? 'hidden' : ''}`"
|
||||||
|
:style="{ width: isCollapse ? 0 : `${leftWidth}px` }"
|
||||||
|
>
|
||||||
<div class="layout-container__left_content">
|
<div class="layout-container__left_content">
|
||||||
<slot name="left"></slot>
|
<slot name="left"></slot>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -17,6 +20,12 @@
|
||||||
:icon="isCollapse ? 'ArrowRightBold' : 'ArrowLeftBold'"
|
:icon="isCollapse ? 'ArrowRightBold' : 'ArrowLeftBold'"
|
||||||
/>
|
/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
<div
|
||||||
|
v-if="props.resizable"
|
||||||
|
class="splitter-bar-line"
|
||||||
|
:class="isResizing ? 'hover' : ''"
|
||||||
|
@mousedown="onSplitterMouseDown"
|
||||||
|
></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layout-container__right">
|
<div class="layout-container__right">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
|
@ -25,20 +34,56 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, useSlots, ref } from 'vue'
|
import { onUnmounted, ref } from 'vue'
|
||||||
defineOptions({ name: 'LayoutContainer' })
|
defineOptions({ name: 'LayoutContainer' })
|
||||||
const slots = useSlots()
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
header: String || null,
|
|
||||||
backTo: String,
|
|
||||||
showCollapse: Boolean,
|
showCollapse: Boolean,
|
||||||
|
resizable: Boolean,
|
||||||
|
minLeftWidth: {
|
||||||
|
type: Number,
|
||||||
|
default: 240,
|
||||||
|
},
|
||||||
|
maxLeftWidth: {
|
||||||
|
type: Number,
|
||||||
|
default: 400,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const isCollapse = ref(false)
|
const isCollapse = ref(false)
|
||||||
|
const leftWidth = ref(props.minLeftWidth)
|
||||||
|
const isResizing = ref(false)
|
||||||
|
|
||||||
const showBack = computed(() => {
|
const onSplitterMouseDown = (e: MouseEvent) => {
|
||||||
const { backTo } = props
|
if (!props.resizable) return
|
||||||
return backTo
|
e.preventDefault()
|
||||||
|
isResizing.value = true
|
||||||
|
document.body.style.userSelect = 'none'
|
||||||
|
const startX = e.clientX
|
||||||
|
const startWidth = leftWidth.value
|
||||||
|
const onMouseMove = (moveEvent: MouseEvent) => {
|
||||||
|
if (!isResizing.value) return
|
||||||
|
const deltaX = moveEvent.clientX - startX
|
||||||
|
let newWidth = startWidth + deltaX
|
||||||
|
|
||||||
|
// 限制宽度在最小和最大值之间
|
||||||
|
newWidth = Math.max(props.minLeftWidth, Math.min(props.maxLeftWidth, newWidth))
|
||||||
|
leftWidth.value = newWidth
|
||||||
|
}
|
||||||
|
|
||||||
|
const onMouseUp = () => {
|
||||||
|
isResizing.value = false
|
||||||
|
document.body.style.userSelect = ''
|
||||||
|
document.removeEventListener('mousemove', onMouseMove)
|
||||||
|
document.removeEventListener('mouseup', onMouseUp)
|
||||||
|
}
|
||||||
|
document.addEventListener('mousemove', onMouseMove)
|
||||||
|
document.addEventListener('mouseup', onMouseUp)
|
||||||
|
}
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
document.removeEventListener('mousemove', () => {})
|
||||||
|
document.removeEventListener('mouseup', () => {})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -47,17 +92,34 @@ const showBack = computed(() => {
|
||||||
&__left {
|
&__left {
|
||||||
position: relative;
|
position: relative;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
transition: width 0.28s;
|
// transition: width 0.28s;
|
||||||
width: var(--sidebar-width);
|
width: var(--sidebar-width);
|
||||||
min-width: var(--sidebar-width);
|
.splitter-bar-line {
|
||||||
box-sizing: border-box;
|
z-index: 1;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
cursor: col-resize;
|
||||||
|
width: 4px;
|
||||||
|
height: 100%;
|
||||||
|
&.hover:after {
|
||||||
|
width: 1px;
|
||||||
|
height: 100%;
|
||||||
|
content: '';
|
||||||
|
z-index: 2;
|
||||||
|
position: absolute;
|
||||||
|
right: -1px;
|
||||||
|
top: 0;
|
||||||
|
background: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.collapse {
|
.collapse {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 36px;
|
top: 36px;
|
||||||
right: -12px;
|
right: -12px;
|
||||||
box-shadow: 0px 5px 10px 0px var(--app-text-color-light-1);
|
box-shadow: 0px 5px 10px 0px var(--app-text-color-light-1);
|
||||||
z-index: 1;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.layout-container__left_content {
|
.layout-container__left_content {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<LayoutContainer showCollapse class="application-manage">
|
<LayoutContainer showCollapse resizable class="application-manage">
|
||||||
<template #left>
|
<template #left>
|
||||||
<h4 class="p-12-16 pb-0 mt-12">{{ $t('views.application.title') }}</h4>
|
<h4 class="p-12-16 pb-0 mt-12">{{ $t('views.application.title') }}</h4>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<LayoutContainer showCollapse class="knowledge-manage">
|
<LayoutContainer showCollapse resizable class="knowledge-manage">
|
||||||
<template #left>
|
<template #left>
|
||||||
<h4 class="p-12-16 pb-0 mt-12">{{ $t('views.knowledge.title') }}</h4>
|
<h4 class="p-12-16 pb-0 mt-12">{{ $t('views.knowledge.title') }}</h4>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -160,12 +160,12 @@ const handleSharedNodeClick = () => {
|
||||||
padding: 10px 8px;
|
padding: 10px 8px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
&:hover {
|
&:hover {
|
||||||
border-radius: var();
|
border-radius: var(--app-border-radius-small);
|
||||||
background: var(--app-text-color-light-1);
|
background: var(--app-text-color-light-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.all-mode-active {
|
.all-mode-active {
|
||||||
border-radius: var();
|
border-radius: var(--app-border-radius-small);
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
font-weight: 500 !important;
|
font-weight: 500 !important;
|
||||||
background: var(--el-color-primary-light-9);
|
background: var(--el-color-primary-light-9);
|
||||||
|
|
@ -185,7 +185,7 @@ const handleSharedNodeClick = () => {
|
||||||
background: none;
|
background: none;
|
||||||
&:hover {
|
&:hover {
|
||||||
background: var(--app-text-color-light-1);
|
background: var(--app-text-color-light-1);
|
||||||
border-radius: var();
|
border-radius: var(--app-border-radius-small);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
:deep(.el-collapse-item) {
|
:deep(.el-collapse-item) {
|
||||||
|
|
@ -211,7 +211,7 @@ const handleSharedNodeClick = () => {
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
&.active {
|
&.active {
|
||||||
background: var(--el-color-primary-light-9);
|
background: var(--el-color-primary-light-9);
|
||||||
border-radius: var();
|
border-radius: var(--app-border-radius-small);
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|
@ -219,7 +219,7 @@ const handleSharedNodeClick = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
border-radius: var();
|
border-radius: var(--app-border-radius-small);
|
||||||
background: var(--app-text-color-light-1);
|
background: var(--app-text-color-light-1);
|
||||||
}
|
}
|
||||||
&.is-active {
|
&.is-active {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<LayoutContainer showCollapse class="tool-manage">
|
<LayoutContainer showCollapse resizable class="tool-manage">
|
||||||
<template #left>
|
<template #left>
|
||||||
<h4 class="p-12-16 pb-0 mt-12">{{ $t('views.tool.title') }}</h4>
|
<h4 class="p-12-16 pb-0 mt-12">{{ $t('views.tool.title') }}</h4>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue