* Finish task #9000.

This commit is contained in:
tianshujie98
2021-01-14 14:39:44 +08:00
parent b1a856423f
commit 4171b7eb63
3 changed files with 9 additions and 3 deletions
+7 -1
View File
@@ -8,16 +8,22 @@ $(function()
var impact = $('#impact').val();
var probability = $('#probability').val();
var rate = parseInt(impact * probability);
var pri = '';
var pri = '';
var priColor = '';
if(0 < rate && rate <= 5) pri = 'low';
if(5 < rate && rate <= 12) pri = 'middle';
if(15 <= rate && rate <= 25) pri = 'high';
if(pri == 'low') priColor = 'text-black';
if(pri == 'middle') priColor = 'text-yellow';
if(pri == 'high') priColor = 'text-red';
$('#rate').val(rate);
$('#pri').val(pri);
$('#pri').trigger("chosen:updated")
$('#pri').chosen();
$('#pri').attr('disabled', true);
$('#priValue .chosen-container-single .chosen-single>span').attr("class", priColor);
$('input[name="pri"]').remove();
$('#pri').after("<input type='hidden' name='pri' value='" + pri + "'/>");
}
+1 -1
View File
@@ -52,7 +52,7 @@
</tr>
<tr>
<th><?php echo $lang->risk->pri;?></th>
<td><?php echo html::select('pri', $lang->risk->priList, '', "class='form-control chosen'");?></td>
<td id='priValue'><?php echo html::select('pri', $lang->risk->priList, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->risk->plannedClosedDate;?></th>
+1 -1
View File
@@ -56,7 +56,7 @@
</tr>
<tr>
<th><?php echo $lang->risk->pri;?></th>
<td><?php echo html::select('pri', $lang->risk->priList, $risk->pri, "class='form-control chosen'");?></td>
<td id='priValue'><?php echo html::select('pri', $lang->risk->priList, $risk->pri, "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->risk->identifiedDate;?></th>