|
|
@ -109,11 +109,55 @@ const tableData = [
|
|
|
|
|
|
|
|
|
|
|
|
const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
|
const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
|
if (!formEl) return;
|
|
|
|
if (!formEl) return;
|
|
|
|
await formEl.validate(valid => {
|
|
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
|
|
|
if (activeStep.value == 0 && customType.value == "newBuilt") {
|
|
|
|
if (activeStep.value == 0 && customType.value == "newBuilt") {
|
|
|
|
|
|
|
|
await formEl.validateField(["inputSource"], valid => {
|
|
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
|
|
|
// 校验不通过
|
|
|
|
activeStep.value++;
|
|
|
|
activeStep.value++;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else if (customType.value == "alarm") {
|
|
|
|
|
|
|
|
await formEl.validateField(
|
|
|
|
|
|
|
|
["platformWarn", "phone", "httpAddressA", "httpAddressB", "httpAddressC"],
|
|
|
|
|
|
|
|
valid => {
|
|
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
|
|
|
// 校验不通过
|
|
|
|
|
|
|
|
console.log(valid);
|
|
|
|
|
|
|
|
message("配置成功", { type: "success" });
|
|
|
|
|
|
|
|
const data = formData.value;
|
|
|
|
|
|
|
|
console.log(data);
|
|
|
|
|
|
|
|
if (customType.value == "newBuilt") {
|
|
|
|
|
|
|
|
emit("submit-form", data);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
formVisible.value = false;
|
|
|
|
|
|
|
|
formData.value = {};
|
|
|
|
|
|
|
|
activeStep.value = 0;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
} else if (customType.value == "algorithm") {
|
|
|
|
|
|
|
|
await formEl.validateField(["inputSource"], valid => {
|
|
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
|
|
|
// 校验不通过
|
|
|
|
|
|
|
|
console.log(valid);
|
|
|
|
|
|
|
|
message("配置成功", { type: "success" });
|
|
|
|
|
|
|
|
const data = formData.value;
|
|
|
|
|
|
|
|
console.log(data);
|
|
|
|
|
|
|
|
if (customType.value == "newBuilt") {
|
|
|
|
|
|
|
|
emit("submit-form", data);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
formVisible.value = false;
|
|
|
|
|
|
|
|
formData.value = {};
|
|
|
|
|
|
|
|
activeStep.value = 0;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
await formEl.validate(valid => {
|
|
|
|
|
|
|
|
console.log(valid);
|
|
|
|
|
|
|
|
if (valid) {
|
|
|
|
message("提交成功", { type: "success" });
|
|
|
|
message("提交成功", { type: "success" });
|
|
|
|
// formVisible.value = false;
|
|
|
|
// formVisible.value = false;
|
|
|
|
const data = formData.value;
|
|
|
|
const data = formData.value;
|
|
|
@ -127,8 +171,8 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
|
// closeDialog();
|
|
|
|
// closeDialog();
|
|
|
|
// resetForm(formEl);
|
|
|
|
// resetForm(formEl);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const resetForm = (formEl: FormInstance | undefined) => {
|
|
|
|
const resetForm = (formEl: FormInstance | undefined) => {
|
|
|
@ -137,6 +181,9 @@ const resetForm = (formEl: FormInstance | undefined) => {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const closeDialog = () => {
|
|
|
|
const closeDialog = () => {
|
|
|
|
|
|
|
|
if (activeStep.value == 1 && customType.value == "newBuilt") {
|
|
|
|
|
|
|
|
activeStep.value--;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
formVisible.value = false;
|
|
|
|
formVisible.value = false;
|
|
|
|
activeStep.value = 0;
|
|
|
|
activeStep.value = 0;
|
|
|
|
phoneChecked.value = false;
|
|
|
|
phoneChecked.value = false;
|
|
|
@ -145,16 +192,17 @@ const closeDialog = () => {
|
|
|
|
httpThird.value = false;
|
|
|
|
httpThird.value = false;
|
|
|
|
formData.value.inputSource = "";
|
|
|
|
formData.value.inputSource = "";
|
|
|
|
resetForm(ruleFormRef.value);
|
|
|
|
resetForm(ruleFormRef.value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const nextStep = () => {
|
|
|
|
|
|
|
|
if (activeStep.value == 1) {
|
|
|
|
|
|
|
|
activeStep.value--;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
activeStep.value++;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const nextStep = () => {
|
|
|
|
|
|
|
|
// if (activeStep.value == 1) {
|
|
|
|
|
|
|
|
// activeStep.value--;
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// activeStep.value++;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
const phoneChecked = ref(false);
|
|
|
|
const phoneChecked = ref(false);
|
|
|
|
const httpFirst = ref(false);
|
|
|
|
const httpFirst = ref(false);
|
|
|
|
const httpSecond = ref(false);
|
|
|
|
const httpSecond = ref(false);
|
|
|
@ -210,7 +258,7 @@ watch(
|
|
|
|
customWidth.value = 790;
|
|
|
|
customWidth.value = 790;
|
|
|
|
} else if (val == "alarm") {
|
|
|
|
} else if (val == "alarm") {
|
|
|
|
title.value = "告警设置";
|
|
|
|
title.value = "告警设置";
|
|
|
|
customWidth.value = 580;
|
|
|
|
customWidth.value = 620;
|
|
|
|
} else if (val == "algorithm") {
|
|
|
|
} else if (val == "algorithm") {
|
|
|
|
title.value = "算法配置";
|
|
|
|
title.value = "算法配置";
|
|
|
|
customWidth.value = 620;
|
|
|
|
customWidth.value = 620;
|
|
|
@ -278,7 +326,7 @@ const rules = {
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-row
|
|
|
|
<el-row
|
|
|
|
:gutter="30"
|
|
|
|
:gutter="30"
|
|
|
|
v-if="
|
|
|
|
v-show="
|
|
|
|
(activeStep == 0 && customType == 'newBuilt') ||
|
|
|
|
(activeStep == 0 && customType == 'newBuilt') ||
|
|
|
|
customType == 'algorithm'
|
|
|
|
customType == 'algorithm'
|
|
|
|
"
|
|
|
|
"
|
|
|
@ -319,7 +367,7 @@ const rules = {
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<el-row
|
|
|
|
<el-row
|
|
|
|
:gutter="30"
|
|
|
|
:gutter="30"
|
|
|
|
v-if="
|
|
|
|
v-show="
|
|
|
|
(activeStep == 1 && customType == 'newBuilt') || customType == 'alarm'
|
|
|
|
(activeStep == 1 && customType == 'newBuilt') || customType == 'alarm'
|
|
|
|
"
|
|
|
|
"
|
|
|
|
>
|
|
|
|
>
|
|
|
@ -551,19 +599,21 @@ const rules = {
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<template #footer v-if="customType != 'history'">
|
|
|
|
<template #footer v-if="customType != 'history'">
|
|
|
|
<div class="dialog-footer">
|
|
|
|
<div class="dialog-footer">
|
|
|
|
<el-button @click="closeDialog" class="btn-color">取消</el-button>
|
|
|
|
<el-button @click="closeDialog" class="btn-color">{{
|
|
|
|
<el-button
|
|
|
|
activeStep == 1 && customType == "newBuilt" ? "上一步" : "取消"
|
|
|
|
|
|
|
|
}}</el-button>
|
|
|
|
|
|
|
|
<!-- <el-button
|
|
|
|
@click="nextStep"
|
|
|
|
@click="nextStep"
|
|
|
|
class="btn-color"
|
|
|
|
class="btn-color"
|
|
|
|
v-if="customType == 'newBuilt'"
|
|
|
|
v-if="customType == 'newBuilt'"
|
|
|
|
>{{ activeStep == 0 ? "下一步" : "上一步" }}</el-button
|
|
|
|
>{{ activeStep == 0 ? "下一步" : "上一步" }}</el-button
|
|
|
|
>
|
|
|
|
> -->
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="primary"
|
|
|
|
type="primary"
|
|
|
|
color="#1C0D82"
|
|
|
|
color="#1C0D82"
|
|
|
|
@click="submitForm(ruleFormRef)"
|
|
|
|
@click="submitForm(ruleFormRef)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
确定
|
|
|
|
{{ activeStep == 0 && customType == "newBuilt" ? "下一步" : "完成" }}
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|