|
@@ -564,6 +564,37 @@ const btnDetail = (res) => {
|
|
|
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 记录,学校到班级对应的所有id和json数据
|
|
|
+ *
|
|
|
+ */
|
|
|
+let schoolIdJson = {};
|
|
|
+
|
|
|
+/**
|
|
|
+ * 本次遍历的数组
|
|
|
+ * array
|
|
|
+ */
|
|
|
+const schoolIdJsonUpdateEvent = (array) => {
|
|
|
+
|
|
|
+ if (array == null || array == undefined) {
|
|
|
+ return array;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (let i = 0; i < array.length; i++) {
|
|
|
+
|
|
|
+ let objArray = array[i];
|
|
|
+ let id = objArray.id;
|
|
|
+
|
|
|
+
|
|
|
+ schoolIdJson[id] = objArray;
|
|
|
+ if (objArray.children != null && objArray.children != undefined) {
|
|
|
+ let children = objArray.children;
|
|
|
+ schoolIdJsonUpdateEvent(children);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
* 获取父子级的树形结构数据
|
|
@@ -626,6 +657,8 @@ const optionsChildrenUpdate = (optionsIndex, id) => {
|
|
|
// );
|
|
|
|
|
|
options[optionsIndex] = data[0];
|
|
|
+ schoolIdJsonUpdateEvent(options);
|
|
|
+ // console.log("options ===>", options, schoolIdJson);
|
|
|
|
|
|
}).catch(error => {
|
|
|
|