wujingjing
2025-01-03 9b9e63bb526ec60dda3f33855759874a39a45cb4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<template>
    <el-card class="flex-column" bodyStyle="flex:1" bodyClass="overflow-y-auto">
        <template #header>
            <div class="flex justify-between items-center">
                <div>全局意图提示词</div>
                <el-button :icon="Refresh" circle @click="refreshPrompt"></el-button>
            </div>
        </template>
 
        <div class="overflow-y-auto relative">
            <template v-for="(item, index) in promptPiece" :key="index">
                <br v-if="item === ''" />
                <pre class="pre-wrap" v-else>{{ item }}</pre>
            </template>
        </div>
    </el-card>
</template>
 
<script setup lang="ts">
import { Refresh } from '@element-plus/icons-vue';
import { onMounted, ref } from 'vue';
import * as agentApi from '/@/api/agent/';
import commonFunction from '/@/utils/commonFunction';
const promptPiece = ref([]);
const getGlobalPrompt = async () => {
    const res = await agentApi.GetGlobalSupervisorPrompt();
    promptPiece.value = res?.values ?? [];
};
 
const refreshPrompt = async () => {
    const res = await agentApi.RestartSupervisorPrompt();
};
 
const { copyText } = commonFunction();
 
const copyInfo = async (item) => {
    copyText(item);
};
onMounted(() => {
    getGlobalPrompt();
});
</script>
<style scoped lang="scss">
:deep(.el-card__header) {
    flex: 0 0 auto;
}
</style>