From de1bc6199f530b09cc32af4589889207c2d979fd Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Thu, 15 Feb 2024 14:53:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestRunManage/SubInspectTerm.aspx.cs | 4 +- .../TestRunManage/SubWorkInspect.aspx.cs | 2 +- .../common/mainMenu_TestRun.aspx | 112 ++++++++++++------ .../common/mainMenu_TestRun.aspx.cs | 10 ++ 4 files changed, 90 insertions(+), 38 deletions(-) diff --git a/SGGL/FineUIPro.Web/TestRun/TestRunManage/SubInspectTerm.aspx.cs b/SGGL/FineUIPro.Web/TestRun/TestRunManage/SubInspectTerm.aspx.cs index cab1cbf4..aa7e0dab 100644 --- a/SGGL/FineUIPro.Web/TestRun/TestRunManage/SubInspectTerm.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/TestRunManage/SubInspectTerm.aspx.cs @@ -433,8 +433,8 @@ namespace FineUIPro.Web.TestRun.TestRunManage List subTrems = new List(); List subTremItems = new List(); List tremItemUsers = new List(); - var subTrem = Funs.DB.TestRun_SubInspectTerm.FirstOrDefault(x => x.SystemId == systemId); - var termItems = Funs.DB.TestRun_SubInspectTermItem.Where(x => x.SystemId == systemId).ToList(); + var subTrem = Funs.DB.TestRun_SubInspectTerm.FirstOrDefault(x => x.SystemId == systemId && x.WorkPackId == workPackId); + var termItems = Funs.DB.TestRun_SubInspectTermItem.Where(x => x.SystemId == systemId && x.WorkPackId == workPackId).ToList(); if (termItems.Count > 0 && termItems.Count(x => x.AllUserInspectionPass == null) == 0) { ShowNotify("所有检查项已存在检查结果,无法保存!", MessageBoxIcon.Warning); diff --git a/SGGL/FineUIPro.Web/TestRun/TestRunManage/SubWorkInspect.aspx.cs b/SGGL/FineUIPro.Web/TestRun/TestRunManage/SubWorkInspect.aspx.cs index e4539201..0daea9e8 100644 --- a/SGGL/FineUIPro.Web/TestRun/TestRunManage/SubWorkInspect.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/TestRunManage/SubWorkInspect.aspx.cs @@ -261,7 +261,7 @@ namespace FineUIPro.Web.TestRun.TestRunManage } } //检查表 - var subModel = Funs.DB.PreRun_SubInspectTerm.FirstOrDefault(x => x.SubInspectId == subInspectId); + var subModel = Funs.DB.TestRun_SubInspectTerm.FirstOrDefault(x => x.SubInspectId == subInspectId); if (subModel != null) { if (Funs.DB.TestRun_TermItemInspectedUser.Count(x => x.SubInspectId == subInspectId && x.InspectionResults.GetValueOrDefault() != 1) == 0) diff --git a/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx b/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx index 1e99b4f2..863999f3 100644 --- a/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx +++ b/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx @@ -224,31 +224,36 @@ tooltip: { formatter: '{a}:{c}%'//a 是series中每条数据name值,c 是data数值 }, - legend: { - orient: 'vertical', // 'horizontal' - data: JSON.parse(oneDataStr), - textStyle: { // 图列内容样式 - color: '#fff', // 字体颜色 - }, - x: '70%',//图例位置,设置right发现图例和文字位置反了,设置一个数值就好了 - y: 'center'//延Y轴居中 - }, + //legend: { + // orient: 'vertical', // 'horizontal' + // data: oneData, + // textStyle: { // 图列内容样式 + // color: '#fff', // 字体颜色 + // }, + // x: '70%',//图例位置,设置right发现图例和文字位置反了,设置一个数值就好了 + // y: 'center'//延Y轴居中 + //}, grid: { left: '3%', - right: '30%', + //right: '30%', + right: '0%', top: '15%', - bottom: '3%', + bottom: '5%', containLabel: true, backgroundColor: 'rgba(0,162,233, 0.01)', }, xAxis: [ //横坐标 { type: 'category', - data: [''], + data: oneData, axisLine: { lineStyle: { color: "#fff",//横坐标线条颜色 } + }, + axisLabel: { + interval: 0, + rotate: -90, } } ], @@ -266,35 +271,72 @@ } } ], - color: ['#0287f8', '#33CCCC', '#58b1fc', '#2fb6f6', '#CC3366', '#00FF99', '#33FFFF', '#669900', '#CC0099', '#FF66FF', '#330099', '#00FFCC', '#FFFF33', '#FF9966', '#FF6633'],//柱状图的颜色 - series: oneNameData - }; - for (var i = 0; i < option.series.length; i++) { - var style = { //定义柱状图的样式 - normal: { - label: { - show: true, - position: 'top', //柱子上方显示 数值 - rotate: 25, - /*formatter: '{c}%'*/ - formatter: function (params) { - if (params.value > 0) { - return params.value + '%'; - } else { - return ' '; - } + //dataZoom: [ + // { + // type: "slider",//slider表示有滑动块的, + // show: true, + //// xAxisIndex: [0],//表示x轴折叠 + // start: 1,//数据窗口范围的起始百分比,表示1% + // end: 70,//数据窗口范围的结束百分比,表示35%坐标 + // bottom: "0", + // }, + //], + series: [{ + name: '进度率', + type: 'bar', + barWidth: 20, + data: oneArr, + label: { + show: true, + position: 'inside', + interval: 0, + rotate: -90, + formatter: function (params) { + if (params.value > 0) { + return params.value + '%'; + } else { + return ' '; + } + }, + }, + itemStyle: { + normal: { + color: function (params) { + var colorList = ['#0287f8', '#33CCCC', '#58b1fc', '#2fb6f6', '#CC3366', '#00FF99', '#33FFFF', '#669900', '#CC0099', '#FF66FF', '#330099', '#00FFCC', '#FFFF33', '#FF9966', '#FF6633']; + return colorList[params.dataIndex] }, } } - }; - option.series[i].type = 'bar'; //每条数据指定类型为'bar' - option.series[i].itemStyle = style; // series中每条数据都加的样式 - option.series[i].data = [bar_data[i]]; //series 中 data赋值 + }] + //series: oneNameData }; + //for (var i = 0; i < option.series.length; i++) { + // var style = { //定义柱状图的样式 + // type: 'bar', + // barWidth: 20, + // normal: { + // label: { + // show: true, + // position: 'inside', //柱子下显示 数值 + // interval: 0, + // rotate: -90, + // formatter: function (params) { + // if (params.value > 0) { + // return params.value + '%'; + // } else { + // return ' '; + // } + // }, + // } + // } + // }; + // option.series[i].type = 'bar'; //每条数据指定类型为'bar' + // option.series[i].itemStyle = style; // series中每条数据都加的样式 + // option.series[i].data = [bar_data[i]]; //series 中 data赋值 + //}; chart.setOption(option); - //图2 - debugger; + var twoDataStr = '<%=twoDataStr%>'; var towData = JSON.parse(twoDataStr); var data = towData.map((item, index) => item.Rate); diff --git a/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx.cs b/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx.cs index 9ee35c3a..5ce8bff4 100644 --- a/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx.cs +++ b/SGGL/FineUIPro.Web/common/mainMenu_TestRun.aspx.cs @@ -45,6 +45,10 @@ namespace FineUIPro.Web if (list.Count > 0) { var workpages = Funs.DB.PreRun_WorkPackage.OrderBy(x => x.Sort).ToList(); + var allrate = (float)Math.Round((float)list.Sum(a => a.CompleteNum) / (float)list.Sum(a => a.AllNum) * 100, 2, MidpointRounding.AwayFromZero); + if (allrate > 100) allrate = 100; + oneArr.Add(allrate); + oneData.Add("全部"); foreach (var item in workpages) { var model = list.FirstOrDefault(x => x.WorkPackId == item.WorkPackId); @@ -65,6 +69,12 @@ namespace FineUIPro.Web DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); if (tb.Rows.Count > 0) { + var allCompleteNum = float.Parse(tb.Compute("sum(CompleteNum)", "").ToString()); + var allSumNum = float.Parse(tb.Compute("sum(AllNum)", "").ToString()); + var allrate = (float)Math.Round(allCompleteNum / allSumNum * 100, 2, MidpointRounding.AwayFromZero); + if (allrate > 100) allrate = 100; + oneArr.Add(allrate); + oneData.Add("全部"); foreach (DataRow row in tb.Rows) { float allNum = float.Parse(row["AllNum"].ToString());