diff --git a/resources/assets/js/components/AIAssistant/float-button.vue b/resources/assets/js/components/AIAssistant/float-button.vue index 8394253bf..15f6cbf64 100644 --- a/resources/assets/js/components/AIAssistant/float-button.vue +++ b/resources/assets/js/components/AIAssistant/float-button.vue @@ -127,6 +127,7 @@ export default { top: `${this.wrapperTop}px`, width: `${this.wrapperWidth}px`, height: `${this.wrapperHeight}px`, + zIndex: this.$parent?.topZIndex || 2000, }; }, @@ -478,7 +479,6 @@ $collapsed-height: 48px; .ai-float-button-wrapper { position: fixed; - z-index: 1000; display: flex; align-items: center; diff --git a/resources/assets/js/components/AIAssistant/index.vue b/resources/assets/js/components/AIAssistant/index.vue index ca584e064..c00454f20 100644 --- a/resources/assets/js/components/AIAssistant/index.vue +++ b/resources/assets/js/components/AIAssistant/index.vue @@ -2,7 +2,8 @@ + :shouldCreateNewSession="shouldCreateNewSession" + :zIndex="topZIndex">
@@ -16,7 +17,8 @@ v-if="sessionEnabled && hasSessionHistory" trigger="click" placement="bottom-end" - :transfer="true"> + :transfer="true" + :z-index="topZIndex + 1">
@@ -28,12 +30,12 @@ @click.native="loadSession(session.id)">
- {{ session.title }} - {{ formatSessionTime(session.updatedAt) }} -
-
- +
{{ session.title }}
+
+ +
+ {{ formatSessionTime(session.updatedAt) }}
@@ -153,7 +155,8 @@ :loading="modelsLoading" :disabled="modelsLoading || modelGroups.length === 0" :not-found-text="$L('暂无可用模型')" - transfer> + transfer + :z-index="topZIndex + 1"> { + this.updateTopZIndex(); + }, interval); + }, + + /** + * 停止 z-index 刷新定时器 + */ + stopZIndexTimer() { + if (this.zIndexTimer) { + clearInterval(this.zIndexTimer); + this.zIndexTimer = null; + } + }, }, } @@ -1901,7 +1945,7 @@ export default { .ai-assistant-history-menu { min-width: 240px; - max-width: 300px; + max-width: 260px; max-height: 320px; overflow-y: auto; @@ -1916,17 +1960,20 @@ export default { .history-item { display: flex; - align-items: center; - gap: 8px; + flex-direction: column; + gap: 2px; .history-item-content { flex: 1; min-width: 0; display: flex; - flex-direction: column; - gap: 2px; + gap: 8px; + line-height: 20px; + align-items: center; .history-item-title { + flex: 1; + min-width: 0; font-size: 13px; color: #303133; overflow: hidden; @@ -1934,35 +1981,40 @@ export default { white-space: nowrap; } - .history-item-time { - font-size: 11px; - color: #909399; + .history-item-delete { + flex-shrink: 0; + display: none; + align-items: center; + justify-content: center; + width: 20px; + height: 20px; + border-radius: 4px; + margin-right: -2px; + transition: opacity 0.2s, background-color 0.2s; + cursor: pointer; + + &:hover { + background-color: rgba(0, 0, 0, 0.08); + } + + > i { + font-size: 12px; + color: #909399; + } } } - .history-item-delete { - display: flex; - align-items: center; - justify-content: center; - width: 20px; - height: 20px; - border-radius: 4px; - opacity: 0; - transition: opacity 0.2s, background-color 0.2s; - cursor: pointer; - - &:hover { - background-color: rgba(0, 0, 0, 0.08); - } - - > i { - font-size: 12px; - color: #909399; - } + .history-item-time { + font-size: 11px; + color: #909399; } - &:hover .history-item-delete { - opacity: 1; + &:hover { + .history-item-content { + .history-item-delete { + display: flex; + } + } } } diff --git a/resources/assets/js/components/AIAssistant/modal.vue b/resources/assets/js/components/AIAssistant/modal.vue index f1332dfd7..854bc4e14 100644 --- a/resources/assets/js/components/AIAssistant/modal.vue +++ b/resources/assets/js/components/AIAssistant/modal.vue @@ -72,6 +72,10 @@ export default { shouldCreateNewSession: { type: Boolean, default: false + }, + zIndex: { + type: Number, + default: 2000 } }, @@ -155,15 +159,19 @@ export default { if (!this.positionLoaded) { return { opacity: 0, + zIndex: this.zIndex, }; } // 全屏时不应用自定义尺寸和位置 if (this.isFullscreen) { - return {}; + return { + zIndex: this.zIndex, + }; } const style = { left: `${this.left}px`, top: `${this.top}px`, + zIndex: this.zIndex, }; // 应用自定义尺寸 if (this.customSize.width) {