|
<template>
|
<a-button type="text" @click="handleClick" size="small">
|
<template #icon>
|
<icon-tool />
|
</template>
|
</a-button>
|
<a-modal
|
v-model:visible="visible"
|
title="解析方法"
|
@before-open="handleOpened"
|
@cancel="handleCancel"
|
:footer="false"
|
title-align="start"
|
width="700px"
|
>
|
<div style="display: flex;align-items: center;">
|
<div>
|
解析方法:
|
</div>
|
<div style="margin-left: 10px">
|
<a-select v-model="form.section" placeholder="请选择" allow-clear>
|
<a-option value="section one">Section One</a-option>
|
<a-option value="section two">Section Two</a-option>
|
<a-option value="section three">Section Three</a-option>
|
</a-select>
|
</div>
|
</div>
|
<a-form ref="formRef" :rules="rules" :model="form" auto-label-width @submit="handleSubmit" >
|
<a-divider style="margin-top: 10px" />
|
<a-form-item field="slider" label="最大token数"
|
:rules="[{type:'number', min:5,message:'slider is min than 5'}]">
|
<a-slider v-model="form.section" :max="10" />
|
<a-input-number v-model="form.section" :style="{width:'100px',marginLeft:'2rem',borderRadius:'4px'}"
|
placeholder="Please Enter" class="input-demo" :min="10" :max="1000" />
|
</a-form-item>
|
<a-divider style="margin-top: 10px" />
|
<a-form-item field="raptor" label="使用召回增强RAPTOR策略">
|
<a-space direction="vertical" size="large">
|
<a-switch v-model="form.raptor" @change="onChangeRAPTOR" />
|
</a-space>
|
</a-form-item>
|
<div v-if="form.raptor">
|
<a-form-item field="section" label="提示词">
|
<a-textarea
|
v-model="form.prompt"
|
style="height: 10rem;border: 1px solid var(--color-fill-3);border-radius: 4px" placeholder=""
|
allow-clear />
|
</a-form-item>
|
<a-form-item field="slider" label="最大token数"
|
:rules="[{type:'number', min:5,message:'slider is min than 5'}]">
|
<a-slider v-model="form.score" :max="10" />
|
<a-input-number v-model="form.score" :style="{width:'100px',marginLeft:'2rem',borderRadius:'4px'}"
|
placeholder="Please Enter" class="input-demo" :min="10" :max="1000" />
|
</a-form-item>
|
<a-form-item field="slider" label="阈值" :rules="[{type:'number', min:5,message:'slider is min than 5'}]">
|
<a-slider v-model="form.score" :max="10" />
|
<a-input-number v-model="form.score" :style="{width:'100px',marginLeft:'2rem',borderRadius:'4px'}"
|
placeholder="Please Enter" class="input-demo" :min="10" :max="1000" />
|
</a-form-item>
|
<a-form-item field="slider" label="最大聚类数"
|
:rules="[{type:'number', min:5,message:'slider is min than 5'}]">
|
<a-slider v-model="form.score" :max="10" />
|
<a-input-number v-model="form.score" :style="{width:'100px',marginLeft:'2rem',borderRadius:'4px'}"
|
placeholder="Please Enter" class="input-demo" :min="10" :max="1000" />
|
</a-form-item>
|
<a-form-item field="slider" label="随机种子"
|
:rules="[{type:'number', min:5,message:'slider is min than 5'}]">
|
<a-input-number v-model="form.score" :style="{width:'300px',marginRight:'1rem',borderRadius:'4px'}"
|
placeholder="请输入" class="input-demo" :min="10" :max="100" />
|
<a-button type="primary" @click="">
|
<icon-plus />
|
</a-button>
|
|
</a-form-item>
|
|
</div>
|
<a-form-item>
|
<div style="width: 100%;text-align: right">
|
<a-button @click="visible = false">取消</a-button>
|
<a-button style="margin-left: 10px" type="primary" html-type="submit">确定</a-button>
|
</div>
|
</a-form-item>
|
</a-form>
|
</a-modal>
|
</template>
|
|
<script lang="ts" setup>
|
import { onMounted ,onBeforeMount, reactive, ref } from "vue";
|
|
const visible = ref(false);
|
const loading = ref(false);
|
const form = reactive({
|
size: "medium",
|
name: "",
|
age: undefined,
|
section: "0",
|
province: "haidian",
|
options: [],
|
date: "",
|
time: "",
|
radio: "radio one",
|
slider: 5,
|
score: 5,
|
switch: false,
|
multiSelect: ["section one"],
|
treeSelect: "",
|
raptor: true,
|
prompt: '请总结以下段落。 小心数字,不要编造。 段落如下:\n' +
|
' {cluster_content}\n' +
|
'以上就是你需要总结的内容。',
|
});
|
const formRef = ref(null);
|
|
const rules = {
|
name: [
|
{
|
required: true,
|
message:'名称不允许为空',
|
},
|
],
|
}
|
|
|
const handleSubmit = ({values, errors}) => {
|
console.log('values:', values, '\nerrors:', errors)
|
}
|
|
const handleClick = () => {
|
visible.value = true;
|
};
|
const handleBeforeOk = (done) => {
|
formRef.value.validate().then(res => {
|
console.log('form:', form)
|
if (!form.name) {
|
done(false)
|
}else {
|
console.log('请求数据');
|
|
}
|
})
|
};
|
const handleCancel = () => {
|
visible.value = false;
|
}
|
|
const handleOpened =(el) => {
|
Object.assign(form,{
|
name: '',// 用户名
|
nameJoin: '',// 昵称
|
post: '',// 岗位
|
txt: '',// 备注
|
});
|
formRef.value.resetFields();
|
}
|
|
const onChangeRAPTOR = () => {
|
console.log(form.raptor);
|
};
|
|
onBeforeMount(()=>{
|
|
})
|
onMounted(()=>{
|
|
|
})
|
</script>
|
|
<script lang="ts">
|
export default {
|
name: 'add',
|
methods: {
|
|
}
|
};
|
</script>
|