nodejs

// 接口:查询检测结果 req.query接收
router.get('/getDetectionResult', (req, res) => {
console.log(req.query.id);
const conn = mysql.createConnection(models.mysql)
const sql = ` select ci.Name,pc.Result from product p
left join productcheckresult pc on pc.ProductId= p.Id
left join configurationplan plan on plan.Id=pc.ConfigurationPlanId
left join checkitem ci on ci.Id=plan.CheckItemId
where p.Id='${req.query.id}'`
conn.query(sql, function (err, result) {
if(err){
console.log(err)
}
if(result){
jsonWrite(res, result)
}
})
conn.end()
})

前端js

// 接口:查询返回结果  {params:{id:this.imagesDataList.id}} 传参
getDetectionResult() {
this.$http
.get("http://localhost:3000/api/sysuser/getDetectionResult",{params:{id:this.imagesDataList.id}},{
emulateJSON:true
})
.then((response) => { if (response.status == 200) { this.detectionResult = response.data;
// console.log(this.detectionResult);
} else {
console.log(response);
}
})
.catch((error) => {
console.log(error);
});
},

最新文章

  1. 排序之----插入排序(C#实现)
  2. Mono自定义图片按钮
  3. 后端码农谈前端(CSS篇)第六课:盒子模型
  4. 浩瀚技术助力批发零售商户实现PDA移动POS打印扫描进销存信息化管理
  5. math方法
  6. 共享内存shared pool (3):Library cache
  7. plsql programming 16 动态SQL和动态PLSQL
  8. Activiti源码浅析:Activiti的活动授权机制
  9. WPF拖动绘制
  10. 控制用户的访问之权限、角色【weber出品必属精品】
  11. paip.oracle query export to insert sql
  12. python 标准模块shlex
  13. ODM、JDM、OEM概念
  14. 环境部署(七):linux下Jenkins+Git+JDK持续集成
  15. 一个linux bbr存在的调用顺序bug
  16. java 大数处理
  17. css3实现漂亮的倒影效果
  18. NetCore+Dapper WebApi架构搭建(四):仓储的依赖注入
  19. Java之对象构造过程
  20. 通过pd.to_sql()将DataFrame写入Mysql

热门文章

  1. Scanner例题讲解
  2. 线上服务异常的定位、处理与优化的探索 - 第三章 Java虚拟机
  3. MongoDB安全加固,防止数据库攻击删除勒索威胁
  4. Jgit的使用笔记
  5. 数据库MySQL(完结)
  6. python 定时发送邮件
  7. 前后端开发必会的 HTTP 协议“十全大补丸”(万字长文)
  8. Python简单api实现
  9. [cocos2d-x]关于3.x的触摸机制
  10. PV系统 Argus 8.4