From 42d2d79ec98eed4ba7c73a453b2450274517efa4 Mon Sep 17 00:00:00 2001 From: jackchenyang <874821510@qq.com> Date: Mon, 3 Jun 2024 18:43:21 +0800 Subject: [PATCH] 1212 --- .../Evaluation/EvaluationNew.aspx | 40 +++++++++++++++++-- .../Evaluation/EvaluationNew.aspx.designer.cs | 18 +++++++++ 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx index c9da7d5..6128036 100644 --- a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx +++ b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx @@ -67,6 +67,9 @@ + + + @@ -182,26 +185,55 @@ //用户评分事件 function renderRateUser(value, row) { var evaltype = row.rowValue["IsEvaluateType"]; - return F.rateHtml(value, { + var html= F.rateHtml(value, { + allowClear:true, readonly: evaltype == 1 ? true : false, allowHalf: true, textVisible: false }); + return html; } F.ready(function () { var grid1 = F(grid1ClientID); + var control1 = '<%=this.hidMaxScore1.ClientID%>'; + var control2 = '<%=this.hidMaxScore2.ClientID%>'; // 注册评分事件 F.rateEvents(grid1.el, function (event, value) { var target = $(event.target); var cellEl = target.closest('.f-grid-cell'); - var rowId = grid1.getRowId(cellEl); var columnId = grid1.getColumnId(cellEl); + var columnName = grid1.getColumn(columnId).columnId; + //获取控件值1() + var maxScore1 = grid1.getItem(control1).value; + //获取控件值2() + var maxScore2 = grid1.getItem(control2).value; - //更新单元格的值 - grid1.updateCellValue(rowId, columnId, value); + if (columnName = "Score1" && value >= parseFloat(maxScore1)) { + F.alert("最大只能评" + maxScore1 + "分"); + var html = F.rateHtml(0, { + allowClear: true, + allowHalf: true, + textVisible: false + }); + grid1.getCellEl(rowId, columnId).html(html) + } + else if (columnName == "Score2" && value >= parseFloat(maxScore2)) { + F.alert("最大只能评" + maxScore2 + "分"); + var html = F.rateHtml(0, { + allowClear: true, + allowHalf: true, + textVisible: false + }); + grid1.getCellEl(rowId, columnId).html(html) + } + else { + //更新单元格的值 + grid1.updateCellValue(rowId, columnId, value); + } }); }); + diff --git a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.designer.cs b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.designer.cs index 747268a..8a31f41 100644 --- a/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.designer.cs +++ b/FCL/FineUIPro.Web/Evaluation/EvaluationNew.aspx.designer.cs @@ -203,6 +203,24 @@ namespace FineUIPro.Web.Evaluation /// protected global::FineUIPro.HiddenField hidisDepScore6; + /// + /// hidMaxScore1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hidMaxScore1; + + /// + /// hidMaxScore2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hidMaxScore2; + /// /// lblContractor 控件。 ///