当前位置: 首页 > news >正文

nginx网站301重定向怎么做台州做微网站

nginx网站301重定向怎么做,台州做微网站,白菜博主的返利网站怎么做,百度手机应用商店SpringBootVue2Echarts实现图表的统计 一、需求 该功能是为了实现在对学生分班的人数统计下#xff0c;所作出的相应调整。Echarts图表在实际项目中也有使用。 二、具体实现 1、数据库设计 班级表#xff1a;classes 字段名类型长度小数点是否允许为空是否为主键说明ci…SpringBootVue2Echarts实现图表的统计 一、需求 该功能是为了实现在对学生分班的人数统计下所作出的相应调整。Echarts图表在实际项目中也有使用。 二、具体实现 1、数据库设计 班级表classes 字段名类型长度小数点是否允许为空是否为主键说明cidint00否是主键自增cnamevarchar2550是否班级名称 学生表student 字段名类型长度小数点是否允许为空是否为主键说明sidint00否是主键自增namevarchar2550是否姓名sexint00是否性别ageint00是否年龄addressvarchar2550是否地址cidint00是否所属班级 2、后端项目 框架SpringBoot数据库MySQL 2.1、添加依赖 parentartifactIdspring-boot-starter-parent/artifactIdgroupIdorg.springframework.boot/groupIdversion2.5.12/version /parentdependenciesdependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId/dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-test/artifactId/dependencydependencygroupIdorg.junit.platform/groupIdartifactIdjunit-platform-launcher/artifactIdscopetest/scope/dependencydependencygroupIdmysql/groupIdartifactIdmysql-connector-java/artifactId/dependencydependencygroupIdcom.baomidou/groupIdartifactIdmybatis-plus-boot-starter/artifactIdversion3.5.3.1/version/dependencydependencygroupIdcom.alibaba/groupIdartifactIdfastjson/artifactIdversion2.0.3/version/dependency /dependencies2.2、实体类 package org.example.entity;public class StudentVO {private Integer total;private String cId;private String cName;public Integer getTotal() {return total;}public void setTotal(Integer total) {this.total total;}public String getcId() {return cId;}public void setcId(String cId) {this.cId cId;}public String getcName() {return cName;}public void setcName(String cName) {this.cName cName;} }2.3、Mapper StudentDao package org.example.mapper;import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hanscnc.entity.CountVO; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository;import java.util.List;Repository Mapper public interface StudentDao extends BaseMapperStudent {ListStudent selectCountStudent();}StudentMapper.xml ?xml version1.0 encodingUTF-8? !DOCTYPE mapper PUBLIC -//mybatis.org//DTD Mapper 3.0//ENhttp://mybatis.org/dtd/mybatis-3-mapper.dtd mapper namespaceorg.example.mapper.StudentDaoselect idselectCountStudent resultTypeorg.example.entity.StudentVOselect count(*) as total, s.cid as cId, c.cname as cNamefrom student s join classes c on s.cid c.cidgroup by c.cname;/select /mapper2.4、Service package org.example.service;import org.example.entity.StudentVO; import java.util.List;public interface StudentService {ListStudentVO countStudent();}package org.example.service.impl;import org.example.entity.StudentVO; import org.example.mapper.StudentDao; import org.example.service.StudentService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service;import java.util.List;Service public class StudentServiceImpl implements StudentService {private final Logger logger LoggerFactory.getLogger(StudentService.class);private final StudentDao studentDao;public StudentServiceImpl(StudentDao studentDao) {this.studentDao studentDao;}Overridepublic ListStudentVO countStudent() {try {return studentDao.selectCountStudent();} catch (Exception e) {logger.error(StudentService----countStudent(...)error. e.getMessage());return null;}}}2.5、Controller package org.example.controller;import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import org.example.entity.MsgResponse; import org.example.entity.StudentVO; import org.example.service.StudentService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;import java.util.List;RestController RequestMapping(/count) public class StudentController {private final StudentService studentService;public StudentController(StudentService studentService) {this.studentService studentService;}GetMapping(/student)public String countStudent() {MsgResponse response new MsgResponse();ListStudentVO studentVOList studentService.countStudent();JSONArray jsonArray new JSONArray();JSONObject jsonObject;for (StudentVO studentVO : studentVOList) {jsonObject new JSONObject(true);jsonObject.put(total, studentVO.getTotal());jsonObject.put(cId, studentVO.getcId());jsonObject.put(cName, studentVO.getcName());jsonArray.add(jsonObject);}response.setData(jsonArray.toString());return response.toString();}} 3、前端项目 Vue2AxiosVue RouterEcharts 添加依赖 npm install echarts --save在main.js中配置 import * as echarts from echarts;Vue.prototype.$echarts echarts;在项目中使用 templateel-containerel-header stylefont-size: 12px; border-bottom: 1px solid #dcdfe6;el-rowel-col :span2 styletext-align:left;span stylefont-size:18px;font-weight:bolder;color:#409EFF;学生统计/span/el-colel-col :span1 :offset21el-dropdown classheader-settingi classel-icon-setting stylemargin: auto 5px auto 25px;font-size:20px;cursor: pointer;/iel-dropdown-menu slotdropdownel-dropdown-itemel-link :underlinefalse href/系统主页/el-link/el-dropdown-itemel-dropdown-itemel-link :underlinefalse href target_blank帮助中心/el-link/el-dropdown-itemel-dropdown-itemel-link :underlinefalse退出登录/el-link/el-dropdown-item/el-dropdown-menu/el-dropdown/el-col/el-row/el-headerel-main :stylewindowInfoel-carddiv idmain1 stylewidth:100%;height:600px/div/el-card/el-main/el-container /template script import { countStudent } from ../../api/countStudent; export default {data() {return {windowInfo: {height: ,overflow: scroll},categoryList: [],seriesDataList: [],}},mounted() {window.onresize () {window.removeEventListener(resize, this.getWindowInit())};this.getInfo();},destroyed() {window.removeEventListener(resize, this.getWindowInit());},methods: {//初始化窗口大小getWindowInit() {this.windowInfo.height window.innerHeight - 60 px;},//获取数据getInfo() {countStudent().then(res {if (res.errcode 0) {let data res.data;data.forEach(item {this.categoryList.splice(this.categoryList.length, 0, item.parentName);this.seriesDataList.splice(this.seriesDataList.length, 0, item.total);})this.drawEcharts();}})},//画图表drawEcharts() {let myChart this.$echarts.init(document.getElementById(main1));let option {title: {text: 统计班级的学生数量,},tooltip: {},legend: {data: [学生数量],},xAxis: {name: 所属班级,data: this.categoryList,axisLabel: {interval: 0}},yAxis: {type: value},series: [{name: 班级学生的数量,type: bar,barWidth: 60%,data: this.seriesDataList,label: {normal: {show: true,position: top}}},],};// 使用刚指定的配置项和数据显示图表。myChart.setOption(option);// 点击事件myChart.on(click, function (param) {console.log(param, param);});},} } /script style .el-container {width: 100%;height: 100%; }.el-container.el-header {background-color: #fff;color: #000;line-height: 60px;height: 60px; }.el-container.el-main {height: calc(100vh-60px);overflow: auto; } /style
http://www.zqtcl.cn/news/111442/

相关文章:

  • 网站维护界面设计做的网站一直刷新
  • 国外网站 国内访问速度土木工程毕业设计网站
  • 宿迁网站建设制作中国广告设计网
  • 上门做美容的有什么网站微信网页版本
  • 专门做餐饮运营的网站网站开发相关知识
  • 石家庄门户网站建设免费简历模板的网站
  • 微网站建设市场如何做好平台推广
  • 网站不备案做优化小程序开发前景怎么样
  • 美丽说网站优化百度关键词优化
  • 同性男做的视频网站赶集网招聘最新招聘附近找工作
  • 做挖机配件销售的网站oa办公系统软件哪家好
  • 聊城设计网站商务网站的特点
  • 厦门做个网站多少钱工程建设范围
  • 百度推广官方网站在哪里制作网页
  • 济南集团网站建设方案沈阳手机网站制作
  • 网站备案号注销的结果做网站的外包能学到什么
  • 在线购物网站开发项目网站建设电话推广话术
  • 网站主体信息太原站扩建
  • 西平县住房和城乡建设局网站空间商网站
  • p2p网站建设cms一键生成图片
  • 甘肃省第八建设集团公司网站能够做物理题的网站
  • 团购网站建设方案建筑工程网校官网
  • 佛山建站网站模板小公司管理方法
  • 常德住房和城乡建设局网站做风险代理案源的网站
  • 手机网站开发人员选项wordpress加载媒体库
  • 做钓鱼网站用哪种编程语言张家界有实力seo优化费用
  • 如何做一个主题网站做网站必须有框架么
  • 建设网站需要什么知识上海高端网页设计
  • 电子商务网站建设基本流程公司网站建设平台
  • 域名没过期 网站打不开怎么办素马设计顾问讲解价格