相似度计算
parent
4052fbfdc0
commit
5f9156ff4d
@ -0,0 +1,74 @@
|
|||||||
|
<template>
|
||||||
|
<el-form :model="queryParams" :rules="rules" ref="queryForm">
|
||||||
|
<el-form-item prop="text1">
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 10, maxRows: 20}"
|
||||||
|
placeholder="请输入文本"
|
||||||
|
v-model="queryParams.text1">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<div style="margin: 20px 0;"></div>
|
||||||
|
<el-form-item prop="text2">
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 10, maxRows: 20}"
|
||||||
|
placeholder="请输入文本"
|
||||||
|
v-model="queryParams.text2">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item style="text-align: center;margin-left:-100px;margin-top:10px;">
|
||||||
|
<el-button type="primary" @click="submitForm('queryForm')">计算相似</el-button>
|
||||||
|
<el-button @click="resetForm('queryForm')">清空</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {similar} from "@/api/biemo/report"
|
||||||
|
import { Loading } from 'element-ui';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
result:null,
|
||||||
|
queryParams:{
|
||||||
|
text1: '',
|
||||||
|
text2: ''
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
text1: [
|
||||||
|
{required: true, message: '请输入文本1', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
text2: [
|
||||||
|
{required: true, message: '请输入文本2', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
submitForm(formName) {
|
||||||
|
this.$refs[formName].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.$modal.loading("正在拼命计算中,请稍候!");
|
||||||
|
similar(this.queryParams).then(response =>{
|
||||||
|
this.$modal.closeLoading();
|
||||||
|
if(response.data){
|
||||||
|
alert("相似度计算值:"+response.data);
|
||||||
|
}
|
||||||
|
}).catch(()=>{
|
||||||
|
alert("计算出错了!");
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('error submit!!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
resetForm(formName) {
|
||||||
|
this.$refs[formName].resetFields();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
Loading…
Reference in New Issue