Commit d4cb7dd6 authored by 李鹏 's avatar 李鹏
parents b8b5c52a c16e9637
...@@ -34,7 +34,7 @@ const SaveSubmit = async () => { ...@@ -34,7 +34,7 @@ const SaveSubmit = async () => {
}); });
}; };
const Cancle = () => { const Cancle = () => {
router.go(-1); router.push(`/forewarning/indicator-config?class_id=${class_id}`);
}; };
const getInfoData = () => { const getInfoData = () => {
axios axios
......
...@@ -107,6 +107,9 @@ import { nextTick, onBeforeMount, reactive, ref } from "vue"; ...@@ -107,6 +107,9 @@ import { nextTick, onBeforeMount, reactive, ref } from "vue";
import GapTitle from "@/components/gap-title.vue"; import GapTitle from "@/components/gap-title.vue";
import axios from "@/request/http.js"; import axios from "@/request/http.js";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { useRoute } from "vue-router";
const route = useRoute();
const { class_id } = route.query;
const props = defineProps({ const props = defineProps({
modelValue: { modelValue: {
type: Object, type: Object,
...@@ -123,9 +126,31 @@ const treeProps = { ...@@ -123,9 +126,31 @@ const treeProps = {
const treeRef = ref(null); const treeRef = ref(null);
const selectId = ref(""); const selectId = ref("");
const getSlideTree = () => { const getSlideTree = () => {
axios.get("/v1/api/alert_class/tree").then(async (res) => { axios.get("/v1/api/alert_class/tree").then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
slideTree.value = res.data.data; slideTree.value = res.data.data;
async function nodeChoose(item) {
await nextTick();
treeRef.value.setCurrentKey(item.class_id);
const node = treeRef.value.getNode(item);
if (node) {
treeNodeChoose(item, node);
}
}
if (class_id) {
let item = null;
slideTree.value.forEach((e) => {
if (e.children && e.children.length > 0) {
e.children.forEach((e) => {
if (e.class_id == class_id) {
item = e;
}
});
}
});
nodeChoose(item);
return;
}
try { try {
slideTree.value.forEach((e) => { slideTree.value.forEach((e) => {
if (e.children && e.children.length > 0) { if (e.children && e.children.length > 0) {
...@@ -133,12 +158,7 @@ const getSlideTree = () => { ...@@ -133,12 +158,7 @@ const getSlideTree = () => {
} }
}); });
} catch (item) { } catch (item) {
await nextTick(); nodeChoose(item);
treeRef.value.setCurrentKey(item.class_id);
const node = treeRef.value.getNode(item);
if (node) {
treeNodeChoose(item, node);
}
} }
} else { } else {
ElMessage.error(res.data.msg); ElMessage.error(res.data.msg);
...@@ -156,7 +176,7 @@ const Search = async () => { ...@@ -156,7 +176,7 @@ const Search = async () => {
const Add = () => { const Add = () => {
addWarnType.value = true; addWarnType.value = true;
}; };
const emits = defineEmits(["undate:modelValue"]); const emits = defineEmits(["update:modelValue"]);
const treeNodeChoose = (data, node) => { const treeNodeChoose = (data, node) => {
emits("update:modelValue", { data, node }); emits("update:modelValue", { data, node });
}; };
......
...@@ -349,7 +349,6 @@ const Submit = async () => { ...@@ -349,7 +349,6 @@ const Submit = async () => {
form_ref.value.validate((res) => resolve(res)); form_ref.value.validate((res) => resolve(res));
}); });
let isFull = true; let isFull = true;
console.log(state.form.warningScopeRows);
try { try {
state.form.warningScopeRows.forEach((e, i) => { state.form.warningScopeRows.forEach((e, i) => {
if (e.indicator_scope == "" || e.indicator_tag == "") { if (e.indicator_scope == "" || e.indicator_tag == "") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment