<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>
|