|
@@ -290,23 +290,49 @@ const handChangeIndex = (ind, val) => {
|
|
|
watchTableData();
|
|
|
});
|
|
|
};
|
|
|
+// const postUpdateApi = async () => {
|
|
|
+// let codeList = [];
|
|
|
+// let successList = [];
|
|
|
+// indexList.value.map((item, index) => {
|
|
|
+// item.map(async (item1, index1, arr1) => {
|
|
|
+// if (item1.id) {
|
|
|
+// item1.indLimitScore = oldIndexList.indLimitScore[index];
|
|
|
+// const { code } = await postUpdate(item1);
|
|
|
+// codeList.push(item1.id);
|
|
|
+// if (code == 200) {
|
|
|
+// successList.push(code);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// });
|
|
|
+// });
|
|
|
+// if (successList.length == codeList.length) {
|
|
|
+// ElMessage({
|
|
|
+// message: "更新成功",
|
|
|
+// type: "success"
|
|
|
+// });
|
|
|
+// $emit("handClick", formLabelAlign.tpId);
|
|
|
+// drawer.value = false;
|
|
|
+// }
|
|
|
+// };
|
|
|
const postUpdateApi = async () => {
|
|
|
let codeList = [];
|
|
|
let successList = [];
|
|
|
- console.log("数据", indexList.value);
|
|
|
- indexList.value.map((item, index) => {
|
|
|
- item.map(async (item1, index1, arr1) => {
|
|
|
+
|
|
|
+ for (const [index, item] of indexList.value.entries()) {
|
|
|
+ for (const item1 of item) {
|
|
|
if (item1.id) {
|
|
|
item1.indLimitScore = oldIndexList.indLimitScore[index];
|
|
|
const { code } = await postUpdate(item1);
|
|
|
codeList.push(item1.id);
|
|
|
- if (code == 200) {
|
|
|
+ if (code === 200) {
|
|
|
successList.push(code);
|
|
|
+ console.log("更新成功codecodecode");
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
- });
|
|
|
- if (successList.length == codeList.length) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (successList.every(code => code === 200)) {
|
|
|
ElMessage({
|
|
|
message: "更新成功",
|
|
|
type: "success"
|
|
@@ -314,7 +340,6 @@ const postUpdateApi = async () => {
|
|
|
$emit("handClick", formLabelAlign.tpId);
|
|
|
drawer.value = false;
|
|
|
}
|
|
|
- console.log("indexList", indexList.value);
|
|
|
};
|
|
|
defineExpose({
|
|
|
open
|
|
@@ -418,6 +443,7 @@ const validateInput = ind => {
|
|
|
<el-input
|
|
|
v-model="int[int.length - 1].indNameIndex"
|
|
|
style="width: 140px"
|
|
|
+ placeholder="请选择指标"
|
|
|
/>
|
|
|
</span>
|
|
|
<template #dropdown>
|