|
@@ -19,8 +19,8 @@
|
|
|
justify-content: center;
|
|
|
}
|
|
|
.container {
|
|
|
- width: 100vw;
|
|
|
- height: 100vh;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
margin-top: 20px;
|
|
|
display: flex;
|
|
|
overflow: hidden;
|
|
@@ -135,18 +135,18 @@
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
|
-<div class="container">
|
|
|
+<div class="container" >
|
|
|
<div class="container-left">
|
|
|
<p>信息输入</p>
|
|
|
<form action="#" method="GET">
|
|
|
type:
|
|
|
<input type="text" name="type" id="type"/>
|
|
|
- orderNo:
|
|
|
- <input type="text" name="orderNo" id="orderNo"/>
|
|
|
formula:
|
|
|
<input type="text" name="formula" id="formula"/>
|
|
|
provinceEnum:
|
|
|
<input type="text" name="provinceEnum" id="provinceEnum"/>
|
|
|
+ electricType:
|
|
|
+ <input type="text" name="electricType" id="electricType"/>
|
|
|
ruleFormula:
|
|
|
<input type="text" name="ruleFormula" id="ruleFormula"/>
|
|
|
<button type="button" class="btn">添加</button>
|
|
@@ -159,15 +159,14 @@
|
|
|
<thead>
|
|
|
<td>ID</td>
|
|
|
<td>TYPE</td>
|
|
|
- <td>ORDERNO</td>
|
|
|
<td>FORMULA</td>
|
|
|
<td>PROVINCE_ENUM</td>
|
|
|
- <td>RULE_ORMULA</td>
|
|
|
+ <td>ELECTRIC_TYPE</td>
|
|
|
+ <td>RULE_FORMULA</td>
|
|
|
<td>移除</td>
|
|
|
<td>修改</td>
|
|
|
</thead>
|
|
|
<tbody id="main">
|
|
|
-
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</div>
|
|
@@ -197,9 +196,9 @@
|
|
|
{
|
|
|
id: 23,
|
|
|
type: "POINT_S",
|
|
|
- orderNo: 1,
|
|
|
formula: "(1-math.abs((sj-yc)/yc))*100",
|
|
|
- provinceEnum: "E21Old;E61;E62;E63;E64;",
|
|
|
+ provinceEnum: "E61",
|
|
|
+ electricType: "E2",
|
|
|
ruleFormula: null
|
|
|
}
|
|
|
];
|
|
@@ -231,9 +230,9 @@
|
|
|
"number": number,
|
|
|
"id": data.id,
|
|
|
"type": inputs[0].value,
|
|
|
- "orderNo": inputs[1].value,
|
|
|
- 'formula': inputs[2].value,
|
|
|
- 'provinceEnum': inputs[3].value,
|
|
|
+ 'formula': inputs[1].value,
|
|
|
+ 'provinceEnum': inputs[2].value,
|
|
|
+ 'electricType': inputs[3].value,
|
|
|
'ruleFormula': inputs[4].value
|
|
|
};
|
|
|
alert('新增成功')
|
|
@@ -253,7 +252,6 @@
|
|
|
data: JSON.stringify(data),
|
|
|
type: "POST",
|
|
|
async: false,
|
|
|
-
|
|
|
dataType: "json",
|
|
|
contentType: 'application/json',
|
|
|
success: function (res) {
|
|
@@ -286,15 +284,15 @@
|
|
|
"number": i + 1,
|
|
|
"id": list[i].id,
|
|
|
"type": list[i].type,
|
|
|
- "orderNo": list[i].orderNo,
|
|
|
'formula': list[i].formula,
|
|
|
'provinceEnum': list[i].provinceEnum,
|
|
|
+ "electricType": list[i].electricType,
|
|
|
'ruleFormula': list[i].ruleFormula
|
|
|
};
|
|
|
inputs[0].value = list[i].type;
|
|
|
- inputs[1].value = list[i].orderNo;
|
|
|
- inputs[2].value = list[i].formula;
|
|
|
- inputs[3].value = list[i].provinceEnum;
|
|
|
+ inputs[1].value = list[i].formula;
|
|
|
+ inputs[2].value = list[i].provinceEnum;
|
|
|
+ inputs[3].value = list[i].electricType;
|
|
|
inputs[4].value = list[i].ruleFormula;
|
|
|
// 调用去重函数
|
|
|
clearMess();
|
|
@@ -305,12 +303,12 @@
|
|
|
btn.addEventListener('click', function () {
|
|
|
// 输入框非空判断
|
|
|
if (inputs[0].value != '' && inputs[0].value != null && inputs[1].value != '' && inputs[1].value !=
|
|
|
- null && inputs[2].value != '' && inputs[2].value != null && inputs[3].value != '' && inputs[3].value != null) {
|
|
|
+ null && inputs[2].value != '' && inputs[2].value != null && inputs[3].value != '' && inputs[3].value != null&& inputs[4].value != '' && inputs[4].value != null) {
|
|
|
postAdd({
|
|
|
type: inputs[0].value,
|
|
|
- orderNo: inputs[1].value,
|
|
|
- formula: inputs[2].value,
|
|
|
- provinceEnum: inputs[3].value,
|
|
|
+ formula: inputs[1].value,
|
|
|
+ provinceEnum: inputs[2].value,
|
|
|
+ electricType: inputs[3].value,
|
|
|
ruleFormula: inputs[4].value
|
|
|
});
|
|
|
} else {
|
|
@@ -414,7 +412,9 @@
|
|
|
var firstNumber = parseInt(element.parentNode.parentNode.firstElementChild.innerHTML);
|
|
|
var tds3 = element.parentNode.parentNode.children;
|
|
|
for (var i = 0; i < students.length; i++) {
|
|
|
- if (students[i].number == tds3[0].innerHTML) {
|
|
|
+ var a= students[i].number;
|
|
|
+ var b = tds3[0].innerHTML;
|
|
|
+ if (students[i].id == tds3[0].innerHTML) {
|
|
|
id = students[i].id;
|
|
|
}
|
|
|
;
|
|
@@ -425,17 +425,17 @@
|
|
|
"number": firstNumber - 1,
|
|
|
"id": id,
|
|
|
"type": tdsInp[0].value,
|
|
|
- "orderNo": tdsInp[1].value,
|
|
|
- 'formula': tdsInp[2].value,
|
|
|
- 'provinceEnum': tdsInp[3].value,
|
|
|
+ 'formula': tdsInp[1].value,
|
|
|
+ 'provinceEnum': tdsInp[2].value,
|
|
|
+ "electricType": tdsInp[3].value,
|
|
|
'ruleFormula': tdsInp[4].value
|
|
|
};
|
|
|
postEdit({
|
|
|
id: id,
|
|
|
type: tdsInp[0].value,
|
|
|
- orderNo: tdsInp[1].value,
|
|
|
- formula: tdsInp[2].value,
|
|
|
- provinceEnum: tdsInp[3].value,
|
|
|
+ formula: tdsInp[1].value,
|
|
|
+ provinceEnum: tdsInp[2].value,
|
|
|
+ electricType: tdsInp[3].value,
|
|
|
ruleFormula: tdsInp[4].value,
|
|
|
})
|
|
|
students.push(message2);
|