完成预测功能

master
ynmlzdwsp 11 months ago
parent 401d492826
commit 203e6bd789

@ -540,10 +540,13 @@ import {listTable1, predictReaction} from "@/utils/table1";
/** 预测按钮操作 */ /** 预测按钮操作 */
handleQuery() { handleQuery() {
this.predictResult = ''; this.predictResult = '';
predictReaction(this.smiles1,this.smiles2).then(response => { predictReaction(this.smiles1, this.smiles2)
this.predictResult = response.data; // predictResult .then(prediction => {
this.predictResult = prediction;
})
.catch(error => {
console.error(error);
}); });
// this.predictResult = '666';
}, },
selectSort(sort) { selectSort(sort) {
this.$emit("selectSort", sort); this.$emit("selectSort", sort);

@ -39,12 +39,11 @@ export function selectDetails(drugName) {
export function predictReaction(mol1, mol2) { export function predictReaction(mol1, mol2) {
const url = 'http://127.0.0.1:5000/predict'; const url = 'http://127.0.0.1:5000/predict';
return axios.get(url, { params: { mol1, mol2 } }) return axios.get(url, { params: { mol1, mol2 } })
.then(response => response.data) .then(response => Number(response.data))
.catch(error => console.error(error)); .catch(error => console.error(error));
} }
// 查询药品作用管理详细 // 查询药品作用管理详细
// export function getTable1(id) { // export function getTable1(id) {
// return request({ // return request({

Loading…
Cancel
Save