From 26bb3f4ab610ef6f177c6c00b8d7862fe939887d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E8=BE=89?= <814457906@qq.com> Date: Wed, 24 Aug 2022 17:38:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/api/system/testItemCityScore.js | 9 + src/api/system/testItemCountryScore.js | 11 +- src/api/system/testItemScore.js | 8 + src/views/system/classconstitution/index.vue | 55 +- src/views/system/quality/index.vue | 6 +- src/views/system/shape/index.vue | 21 +- src/views/system/survey/index.vue | 626 ++++++++++-------- src/views/system/testItemCityScore/index.vue | 152 ++++- .../system/testItemCountryScore/index.vue | 132 +++- src/views/system/testItemScore/index.vue | 92 ++- 11 files changed, 690 insertions(+), 424 deletions(-) diff --git a/.env.development b/.env.development index 9cd36f7..dd5ac82 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ VUE_APP_TITLE = 幼儿园体质检测管理系统 ENV = 'development' # 若依管理系统/开发环境 -VUE_APP_BASE_API = 'http://192.168.16.62:8089' +VUE_APP_BASE_API = 'http://192.168.16.81:8080' #'/dev-api' # 路由懒加载 diff --git a/src/api/system/testItemCityScore.js b/src/api/system/testItemCityScore.js index b98d2ee..a139272 100644 --- a/src/api/system/testItemCityScore.js +++ b/src/api/system/testItemCityScore.js @@ -9,6 +9,15 @@ export function listTestItemCityScore(query) { }) } +// 回显 +export function getItemCityScoreInfo(query) { + return request({ + url: '/system/testItemCityScore/getItemCityScoreInfo', + method: 'get', + params: query + }) +} + // 查询全市平均成绩详细 export function getTestItemCityScore(id) { return request({ diff --git a/src/api/system/testItemCountryScore.js b/src/api/system/testItemCountryScore.js index aefbc16..849120c 100644 --- a/src/api/system/testItemCountryScore.js +++ b/src/api/system/testItemCountryScore.js @@ -11,6 +11,15 @@ export function listTestItemCountryScore(query) { +// 回显 +export function getItemCountryScoreInfo(query) { + return request({ + url: '/system/testItemCountryScore/getItemCountryScoreInfo', + method: 'get', + params: query + }) +} + // 查询项目列表 export function testItemslist(query) { return request({ @@ -51,4 +60,4 @@ export function delTestItemCountryScore(id) { url: '/system/testItemCountryScore/' + id, method: 'delete' }) -} +} \ No newline at end of file diff --git a/src/api/system/testItemScore.js b/src/api/system/testItemScore.js index 385a22e..e9be007 100644 --- a/src/api/system/testItemScore.js +++ b/src/api/system/testItemScore.js @@ -77,3 +77,11 @@ export function delTestItemScore(id) { method: 'delete' }) } +// 反显 +export function getAllTestItemScoreInfo(query) { + return request({ + url: '/system/testItemScore/getAllTestItemScoreInfo', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/src/views/system/classconstitution/index.vue b/src/views/system/classconstitution/index.vue index 9f40d0d..31ac081 100644 --- a/src/views/system/classconstitution/index.vue +++ b/src/views/system/classconstitution/index.vue @@ -489,11 +489,17 @@ export default { ClassListinfo() { ClassList(this.ClassListlist).then((res) => { console.log(res); + var yseries = []; + var name = ""; + var names = []; + var ydata = []; if (res.data == [] || !res.data) { this.itemshow2 = true; this.itemshow = false; } else { + + this.listname = []; this.totalAvgFraction = res.data.totalAvgFraction; this.categoryTableNameList = res.data.categoryTableNameList; this.categoryAgeFractionList = res.data.categoryAgeFractionList; @@ -505,7 +511,6 @@ export default { }); }); let yname = []; - this.categoryScoreList.forEach((el) => { yname.push(el.className); var listname = list.map((e) => { @@ -533,6 +538,28 @@ export default { el.list = list1; }); console.log(this.categoryScoreList); + console.log(this.listname); + for (var i = 0; i < this.listname.length; i++) { + name = this.categoryScoreList[0].categoryScoreList[i].categoryName; + ydata = [ + this.categoryScoreList[0].list[i], + this.categoryScoreList[1].list[i], + this.categoryScoreList[2].list[i], + ]; + var obj = { + name: name, + type: "bar", + label: labelOption, + emphasis: { + focus: "series", + }, + data: ydata, + }; + console.log(ydata); + yseries.push(obj); + names.push(name); + } + console.log(yseries); var myChart = echarts.init(document.getElementById("chart")); @@ -628,30 +655,6 @@ export default { name: {}, }, }; - var yseries = []; - var name = ""; - var names = []; - - for (var i = 0; i < this.listname.length; i++) { - name = this.categoryScoreList[0].categoryScoreList[i].categoryName; - var ydata = [ - this.categoryScoreList[0].list[i], - this.categoryScoreList[1].list[i], - this.categoryScoreList[2].list[i], - ]; - var obj = { - name: name, - type: "bar", - label: labelOption, - emphasis: { - focus: "series", - }, - data: ydata, - }; - yseries.push(obj); - names.push(name); - } - console.log(yseries); option = { tooltip: { @@ -678,7 +681,7 @@ export default { series: yseries, }; - option && myChart.setOption(option); + option && myChart.setOption(option,true); this.itemshow2 = false; this.itemshow = true; } diff --git a/src/views/system/quality/index.vue b/src/views/system/quality/index.vue index d56830d..8912f29 100644 --- a/src/views/system/quality/index.vue +++ b/src/views/system/quality/index.vue @@ -758,8 +758,8 @@ export default { pageSize: 10, studentId: "", batchCode: "", - studentId: "27", - batchCode: "PC202208230011", + // studentId: "27", + // batchCode: "PC202208230011", // studentId: "14", // batchCode: "PC202208030005", // studentId: "9", @@ -776,7 +776,7 @@ export default { created() { this.getList(); this.class(); - this.studenttext(); + // this.studenttext(); }, methods: { //学生身体素质 diff --git a/src/views/system/shape/index.vue b/src/views/system/shape/index.vue index c6be1f4..937fb47 100644 --- a/src/views/system/shape/index.vue +++ b/src/views/system/shape/index.vue @@ -790,7 +790,12 @@ - +
BMI @@ -956,6 +961,7 @@ export default { return { itemshow: false, itemshow2: false, + itemshow3: false, showyey: true, showbj: true, total1: 0, @@ -963,7 +969,7 @@ export default { total3: 0, total4: 0, itemweight: "", - weightMax: 50, + weightMax: 70, weightMin: 10, itemheight: "", heightMax: 150, @@ -1069,8 +1075,14 @@ export default { studentanalysis() { analysis(this.analysisstudent).then((res) => { if (!res.data || res.data == "") { - this.itemshow2 = true; - this.itemshow = false; + } else if (res.data.bmiItemLevel == null) { + this.analysislist = res.data; + this.itemheight = res.data.heightScore; + this.bmiItemLevel = res.data.bmiItemLevel; + this.itemweight = res.data.weightScore; + this.itemshow2 = false; + this.itemshow3 = false; + this.itemshow = true; } else { this.analysislist = res.data; this.itemheight = res.data.heightScore; @@ -1131,6 +1143,7 @@ export default { option && myChart.setOption(option); this.itemshow2 = false; this.itemshow = true; + this.itemshow3 = true; } }); }, diff --git a/src/views/system/survey/index.vue b/src/views/system/survey/index.vue index 2c73a53..e0c7109 100644 --- a/src/views/system/survey/index.vue +++ b/src/views/system/survey/index.vue @@ -167,58 +167,60 @@ -
-
-
-
-
-
- - - - - +
+
+
+
+
+
+ - - - - - - - + + + + + + + + + +
+
- @@ -316,6 +318,9 @@ export default { yclassname1: [], yclassname2: [], yclassname3: [], + classscore1: [], + classscore2: [], + classscore3: [], }; }, mounted() {}, @@ -327,251 +332,290 @@ export default { methods: { ClassListinfo() { ClassList(this.classqueryParams).then((res) => { - if (res.rows == [] || !res.rows) { + console.log(res.rows.length); + if (res.rows.length == 0) { this.itemshow2 = true; this.itemshow = false; + console.log( + this.yclassname1, + this.yclassname2, + this.yclassname3, + this.classscore1, + this.classscore2, + this.classscore3 + ); + console.log(this.itemshow2); } else { - var classscore1 = []; - var classscore2 = []; - var classscore3 = []; - res.rows.forEach((e) => { - if (e.classType == this.LARGECLASS) { - this.yclassname1.push(e.className); - if ( - e.itemScoreAll == "" || - !e.itemScoreAll || - e.itemScoreAll == null - ) { - classscore1.push(0); - } else { - classscore1.push(e.itemScoreAll); - } - } else if (e.classType == this.MIDDLECLASS) { - this.yclassname2.push(e.className); - if ( - e.itemScoreAll == "" || - !e.itemScoreAll || - e.itemScoreAll == null - ) { - classscore2.push(0); - } else { - classscore2.push(e.itemScoreAll); - } - } else if (e.classType == this.SMALLCLASS) { - this.yclassname3.push(e.className); - if ( - e.itemScoreAll == "" || - !e.itemScoreAll || - e.itemScoreAll == null - ) { - classscore3.push(0); - } else { - classscore3.push(e.itemScoreAll); - } - } - }); - var app = {}; - var myChart = echarts.init(document.getElementById("main")); - var myChart2 = echarts.init(document.getElementById("main2")); - var myChart3 = echarts.init(document.getElementById("main3")); - var option; - var option2; - var option3; - const posList = [ - "left", - "right", - "top", - "bottom", - "inside", - "insideTop", - "insideLeft", - "insideRight", - "insideBottom", - "insideTopLeft", - "insideTopRight", - "insideBottomLeft", - "insideBottomRight", - ]; - app.configParameters = { - rotate: { - min: 0, - max: 90, - }, - align: { - options: { - left: "left", - center: "center", - right: "right", - }, - }, - verticalAlign: { - options: { - top: "top", - middle: "middle", - bottom: "bottom", - }, - }, - position: { - options: posList.reduce(function (map, pos) { - map[pos] = pos; - return map; - }, {}), - }, - distance: { - min: 0, - max: 100, - }, - }; - app.config = { - rotate: 0, - align: "center", - verticalAlign: "middle", - position: "top", - distance: 15, - onChange: function () { - const labelOption = { - rotate: app.config.rotate, - align: app.config.align, - verticalAlign: app.config.verticalAlign, - position: app.config.position, - distance: app.config.distance, - }; - myChart.setOption({ - series: [ - { - label: labelOption, - }, - { - label: labelOption, - }, - { - label: labelOption, - }, - { - label: labelOption, - }, - ], - }); - }, - }; - const labelOption = { - show: true, - position: app.config.position, - distance: app.config.distance, - align: app.config.align, - verticalAlign: app.config.verticalAlign, - rotate: app.config.rotate, - formatter: "{c}", - fontSize: 16, - rich: { - name: {}, - }, - }; - option = { - tooltip: { - trigger: "axis", - axisPointer: { - type: "shadow", - }, - }, - legend: {}, - xAxis: [ - { - type: "category", - axisTick: { show: false }, - data: this.yclassname1, - }, - ], - yAxis: [ - { - type: "value", - }, - ], - series: [ - { - type: "bar", - barGap: 0, - color: "#00B050", - label: labelOption, - emphasis: { - focus: "series", - }, - data: classscore1, - }, - ], - }; - option2 = { - tooltip: { - trigger: "axis", - axisPointer: { - type: "shadow", - }, - }, - legend: {}, - xAxis: [ - { - type: "category", - axisTick: { show: false }, - data: this.yclassname2, - }, - ], - yAxis: [ - { - type: "value", - }, - ], - series: [ - { - type: "bar", - barGap: 0, - color: "#00B050", - label: labelOption, - emphasis: { - focus: "series", - }, - data: classscore2, - }, - ], - }; - option3 = { - tooltip: { - trigger: "axis", - axisPointer: { - type: "shadow", - }, - }, - legend: {}, - xAxis: [ - { - type: "category", - axisTick: { show: false }, - data: this.yclassname3, - }, - ], - yAxis: [ - { - type: "value", - }, - ], - series: [ - { - type: "bar", - barGap: 0, - color: "#00B050", - label: labelOption, - emphasis: { - focus: "series", - }, - data: classscore3, - }, - ], - }; + this.$nextTick((e) => { + this.yclassname1 = []; + this.yclassname2 = []; + this.yclassname3 = []; + this.classscore1 = []; + this.classscore2 = []; + this.classscore3 = []; - option && myChart.setOption(option); - option2 && myChart2.setOption(option2); - option3 && myChart3.setOption(option3); - this.itemshow = true; - this.itemshow2 = false; + console.log(2); + res.rows.forEach((e) => { + if (e.classType == this.LARGECLASS) { + this.yclassname1.push(e.className); + if ( + e.itemScoreAll == "" || + !e.itemScoreAll || + e.itemScoreAll == null + ) { + this.classscore1.push(0); + } else { + this.classscore1.push(e.itemScoreAll); + } + } else if (e.classType == this.MIDDLECLASS) { + this.yclassname2.push(e.className); + if ( + e.itemScoreAll == "" || + !e.itemScoreAll || + e.itemScoreAll == null + ) { + this.classscore2.push(0); + } else { + this.classscore2.push(e.itemScoreAll); + } + } else if (e.classType == this.SMALLCLASS) { + s; + this.yclassname3.push(e.className); + if ( + e.itemScoreAll == "" || + !e.itemScoreAll || + e.itemScoreAll == null + ) { + this.classscore3.push(0); + } else { + this.classscore3.push(e.itemScoreAll); + } + } + }); + console.log(this.yclassname3, this.yclassname2); + if (this.yclassname1.length != 0) { + var myChart = echarts.init(document.getElementById("main")); + } + if (this.yclassname2.length != 0) { + var myChart2 = echarts.init(document.getElementById("main2")); + } + if (this.yclassname3.length != 0) { + var myChart3 = echarts.init(document.getElementById("main3")); + } + var myChart = echarts.init(document.getElementById("main")); + var myChart2 = echarts.init(document.getElementById("main2")); + var myChart3 = echarts.init(document.getElementById("main3")); + var app = {}; + + var option; + var option2; + var option3; + const posList = [ + "left", + "right", + "top", + "bottom", + "inside", + "insideTop", + "insideLeft", + "insideRight", + "insideBottom", + "insideTopLeft", + "insideTopRight", + "insideBottomLeft", + "insideBottomRight", + ]; + app.configParameters = { + rotate: { + min: 0, + max: 90, + }, + align: { + options: { + left: "left", + center: "center", + right: "right", + }, + }, + verticalAlign: { + options: { + top: "top", + middle: "middle", + bottom: "bottom", + }, + }, + position: { + options: posList.reduce(function (map, pos) { + map[pos] = pos; + return map; + }, {}), + }, + distance: { + min: 0, + max: 100, + }, + }; + app.config = { + rotate: 0, + align: "center", + verticalAlign: "middle", + position: "top", + distance: 15, + onChange: function () { + const labelOption = { + rotate: app.config.rotate, + align: app.config.align, + verticalAlign: app.config.verticalAlign, + position: app.config.position, + distance: app.config.distance, + }; + myChart.setOption({ + series: [ + { + label: labelOption, + }, + { + label: labelOption, + }, + { + label: labelOption, + }, + { + label: labelOption, + }, + ], + }); + }, + }; + const labelOption = { + show: true, + position: app.config.position, + distance: app.config.distance, + align: app.config.align, + verticalAlign: app.config.verticalAlign, + rotate: app.config.rotate, + formatter: "{c}", + fontSize: 16, + rich: { + name: {}, + }, + }; + option = { + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow", + }, + }, + legend: {}, + xAxis: [ + { + type: "category", + axisTick: { show: false }, + data: this.yclassname1, + }, + ], + yAxis: [ + { + type: "value", + }, + ], + series: [ + { + type: "bar", + barGap: 0, + color: "#00B050", + label: labelOption, + emphasis: { + focus: "series", + }, + data: this.classscore1, + }, + ], + }; + option2 = { + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow", + }, + }, + legend: {}, + xAxis: [ + { + type: "category", + axisTick: { show: false }, + data: this.yclassname2, + }, + ], + yAxis: [ + { + type: "value", + }, + ], + series: [ + { + type: "bar", + barGap: 0, + color: "#00B050", + label: labelOption, + emphasis: { + focus: "series", + }, + data: this.classscore2, + }, + ], + }; + option3 = { + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow", + }, + }, + legend: {}, + xAxis: [ + { + type: "category", + axisTick: { show: false }, + data: this.yclassname3, + }, + ], + yAxis: [ + { + type: "value", + }, + ], + series: [ + { + type: "bar", + barGap: 0, + color: "#00B050", + label: labelOption, + emphasis: { + focus: "series", + }, + data: this.classscore3, + }, + ], + }; + + if (this.yclassname1.length != 0) { + option && myChart.setOption(option); + } + if (this.yclassname2.length != 0) { + option2 && myChart2.setOption(option2); + } + if (this.yclassname3.length != 0) { + option3 && myChart3.setOption(option3); + } + + // option && myChart.setOption(option); + // option2 && myChart2.setOption(option2); + // option3 && myChart3.setOption(option3); + this.itemshow = true; + this.itemshow2 = false; + }); } }); }, diff --git a/src/views/system/testItemCityScore/index.vue b/src/views/system/testItemCityScore/index.vue index 30ca91b..3e3ed16 100644 --- a/src/views/system/testItemCityScore/index.vue +++ b/src/views/system/testItemCityScore/index.vue @@ -171,25 +171,42 @@ :options="areaList" placeholder="请选择所属区域" v-model="form.areaId" + @input="inputChange" /> {{ xmname }} {{ xmname }} - + + + + + + - - - - - - - - -