11<template >
22 <el-dialog
3- :title =" $t('views.tool.form. mcpConfig')"
3+ :title =" $t('views.tool.mcpConfig')"
44 width =" 600"
55 v-model =" dialogVisible"
66 :close-on-click-modal =" false"
77 :close-on-press-escape =" false"
88 :destroy-on-close =" true"
99 :before-close =" close"
1010 append-to-body
11+ class =" mcp-config-dialog"
1112 >
1213 <el-form label-width =" auto" label-position =" top" >
1314 <el-form-item >
1617 v-model =" mcp_servers"
1718 rows =" 8"
1819 disabled
20+ class =" config-textarea"
21+ @mouseenter.stop =" showIcon = true"
22+ @mouseleave.stop =" showIcon = false"
1923 ></el-input >
20- <AppIcon
21- iconName =" app-copy"
22- class =" copy-icon color-secondary"
23- @click =" copyClick(mcp_servers)"
24- />
24+ <el-button circle class =" copy-icon" v-if =" showIcon" @click =" copyClick(mcp_servers)" >
25+ <AppIcon iconName =" app-copy" class =" color-secondary" />
26+ </el-button >
2527 </el-form-item >
2628 </el-form >
2729 </el-dialog >
2830</template >
2931
3032<script setup lang="ts">
31- import {ref } from ' vue'
32- import {copyClick } from ' @/utils/clipboard'
33-
33+ import { ref } from ' vue'
34+ import { copyClick } from ' @/utils/clipboard'
3435
3536const mcp_servers = ref <string >(' ' )
3637const dialogVisible = ref <boolean >(false )
38+ const showIcon = ref <boolean >(false )
3739
3840const close = () => {
3941 dialogVisible .value = false
@@ -43,25 +45,23 @@ const open = (item: any) => {
4345 dialogVisible .value = true
4446}
4547
46- defineExpose ({open , })
48+ defineExpose ({ open })
4749 </script >
4850
4951<style scoped lang="scss">
50-
51- .copy-icon {
52- position : absolute ;
53- top : 6px ;
54- right : 8px ;
55- font-size : 16px ;
56- cursor : pointer ;
57- z-index : 2 ;
58- }
59-
60- .copy-icon :hover {
61- opacity : 0.85 ;
62- }
63-
64- :deep(.el-textarea__inner ) {
65- padding-right : 34px ; // 给右上角图标留空间
52+ .mcp-config-dialog {
53+ .copy-icon {
54+ position : absolute ;
55+ top : 12px ;
56+ right : 12px ;
57+ box-shadow : 0px 4px 8px 0px rgba (31 , 35 , 41 , 0.1 );
58+ z-index : 2 ;
59+ }
60+ .config-textarea {
61+ :deep (.el-textarea__inner ) {
62+ color : var (--el-text-color-primary );
63+ cursor : pointer ;
64+ }
65+ }
6666}
6767 </style >
0 commit comments