feat(bpic_eli): 添加风险筛查结果评价的输入验证和样式调整- 在评论输入框下方添加错误消息显示区域- 实现评论内容的非空和长度验证- 修改评论对话框中的按钮文本,将"发布"改为"确定","关闭"改为"取消"- 调整评论输入框和按钮的样式

This commit is contained in:
陈昱达
2025-08-06 15:33:50 +08:00
parent a018127b75
commit cf7d37ccbd

View File

@@ -38,6 +38,12 @@
position: relative;
}
#error-msg{
text-align: left;
color:Red;
margin-left: 60px;
}
.main {
width: 100%;
height: 100%;
@@ -616,9 +622,10 @@
<button class="dialog-close" onclick="DialogHandler.closeDialog()" type="button">×</button>
</div>
<textarea id="commentText" placeholder="本次风险筛查结果暂无评价"></textarea>
<div id='error-msg'></div>
<div class='dialog-action'>
<button id='saveBtn' style='background: #3498db; color: white; border: 1px solid #3498db;' onclick="DialogHandler.saveComment()" type="button">发布</button>
<button onclick="DialogHandler.closeDialog()" type="button">关闭</button>
<button id='saveBtn' style='background: #3498db; color: white; border: 1px solid #3498db;' onclick="DialogHandler.saveComment()" type="button">确定</button>
<button onclick="DialogHandler.closeDialog()" type="button">取消</button>
</div>
</div>
<!-- 全局 Toast 提示 -->
@@ -1171,12 +1178,26 @@
// 保存评论
saveComment: function() {
var error = document.getElementById('error-msg');
error.innerHTML = '';
var params = {
commentContent: document.getElementById('commentText').value,
resultId: StateManager.resultId,
taCode: StateManager.taCode,
isLike: StateManager.isLike
};
if(!params.commentContent){
error.innerHTML = '请输入评价';
return
}
if(params.commentContent.length>300){
error.innerHTML = '文字评价支持录入汉字、大写字母、小写字母、数字、符号不超过300个字请重新输入';
return
}
DOMHandler.setServiceUrl(Config.serviceUrl.updateComment, JSON.stringify(params), function(e) {
var result = JSON.parse(e);
if(result.content.result === '0'){
@@ -1214,7 +1235,10 @@
if(noNav || noPadding){
commentText.setAttribute('disabled',true)
saveBtn.style.display = 'none'
}
if(commentText.value){
// commentText.setAttribute('disabled',true)
// saveBtn.style.display = 'none'
}
};
@@ -1261,6 +1285,9 @@
if(noNav || noPadding){
return false
}
var dataParams = {
taCode: StateManager.taCode,
resultId: StateManager.resultId,