diff --git a/src/views/off-limits-manage/off-limits-main/off-limits-type/index.vue b/src/views/off-limits-manage/off-limits-main/off-limits-type/index.vue
index c45b6f0..2d5879e 100644
--- a/src/views/off-limits-manage/off-limits-main/off-limits-type/index.vue
+++ b/src/views/off-limits-manage/off-limits-main/off-limits-type/index.vue
@@ -1,7 +1,7 @@
@@ -51,17 +51,31 @@
+
+
+
+
-
-
+
+
+
+ 提交
+ 重置
+ 取 消
+
+
+
+
-
+
提交
重置
取 消
-
-
-
+
@@ -152,6 +161,9 @@ export default {
dialogVisibleM: false,
currentData:{},
currentParentData:{},
+ currentAddScenes:{
+ inputNew:"",
+ },
currentAddType:{
typeLabel:""
},
@@ -160,6 +172,18 @@ export default {
}
},
methods: {
+ submitScenesForm(formName) {
+ this.$refs[formName].validate((valid) => {
+ if (valid) {
+ //alert('submit!');
+ this.addScenes();
+
+ } else {
+ console.log('error submit!!');
+ return false;
+ }
+ });
+ },
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
@@ -192,6 +216,21 @@ export default {
this.resetForm('currentAddType');
}
+ },
+
+ addScenes(){
+ this.dialogVisible=false;
+ let no=this.data[this.data.length-1].no+1;
+ let id=this.data[this.data.length-1].id+1;
+
+ this.data.push( {
+ id: id,
+ no:no,
+ label: this.currentAddScenes.inputNew,
+ children: []
+ });
+
+
},
addType(){
@@ -202,9 +241,17 @@ export default {
if(i.id==this.currentParentData.id)
{
- //console.log(i.children[i.children.length-1]);
- let no=i.children[i.children.length-1].no+1;
- let id=i.children[i.children.length-1].id+1;
+
+ let no,id;
+ if(i.children && i.children.length>0){
+ no=i.children[i.children.length-1].no+1;
+ id=i.children[i.children.length-1].id+1;
+ }
+ else{
+ no=i.no+'001';
+ id=i.id+'001';
+ }
+
i.children.push({
id:id,