Explorar el Código

禁入类别页面调整

master
甘明坤 hace 3 años
padre
commit
05073cb244
Se han modificado 1 ficheros con 64 adiciones y 17 borrados
  1. +64
    -17
      src/views/off-limits-manage/off-limits-main/off-limits-type/index.vue

+ 64
- 17
src/views/off-limits-manage/off-limits-main/off-limits-type/index.vue Ver fichero

@@ -1,7 +1,7 @@
<!-- <!--
* @Date: 2021-11-30 09:28:55 * @Date: 2021-11-30 09:28:55
* @LastEditors: JinxuChen
* @LastEditTime: 2021-11-30 09:29:14
* @LastEditors: Please set LastEditors
* @LastEditTime: 2021-12-02 11:09:15
* @FilePath: \GpsCardAdmin\src\views\off-limits-manage\off-limits-main\off-limits-type\index.vue * @FilePath: \GpsCardAdmin\src\views\off-limits-manage\off-limits-main\off-limits-type\index.vue
* @description: * @description:
--> -->
@@ -51,17 +51,31 @@
</el-row> </el-row>
<el-dialog <el-dialog
title="新增场景" title="新增场景"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="50%" width="50%"
> >
<el-form :model="currentAddScenes" ref="currentAddScenes">
<el-form-item label="场景"
prop="inputNew"
:rules="[
{ required: true, message: '场景不能为空'}
]"
>
<el-input v-model="currentAddScenes.inputNew" placeholder="请输入场景"></el-input>


<el-input v-model="inputNew" placeholder="请输入场景"></el-input>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
</span>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitScenesForm('currentAddScenes')">提交</el-button>
<el-button @click="resetForm('currentAddScenes')">重置</el-button>
<el-button @click="dialogVisible = false">取 消</el-button>
</el-form-item>

</el-form>
</el-dialog> </el-dialog>


<el-dialog <el-dialog
@@ -80,18 +94,13 @@


</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<!-- <el-button type="primary" @click="()=>addType()">提交</el-button> -->
<el-button type="primary" @click="submitForm('currentAddType')">提交</el-button> <el-button type="primary" @click="submitForm('currentAddType')">提交</el-button>
<el-button @click="resetForm('currentAddType')">重置</el-button> <el-button @click="resetForm('currentAddType')">重置</el-button>
<el-button @click="dialogVisibleType = false">取 消</el-button> <el-button @click="dialogVisibleType = false">取 消</el-button>
</el-form-item> </el-form-item>
<!-- <span slot="footer" class="dialog-footer"> -->
<!-- <el-form-item>
<el-button type="primary" @click="()=>addType()">确 定</el-button>
</el-form-item> -->
<!-- </span> -->
</el-form> </el-form>
</el-dialog> </el-dialog>
@@ -152,6 +161,9 @@ export default {
dialogVisibleM: false, dialogVisibleM: false,
currentData:{}, currentData:{},
currentParentData:{}, currentParentData:{},
currentAddScenes:{
inputNew:"",
},
currentAddType:{ currentAddType:{
typeLabel:"" typeLabel:""
}, },
@@ -160,6 +172,18 @@ export default {
} }
}, },
methods: { methods: {
submitScenesForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
//alert('submit!');
this.addScenes();
} else {
console.log('error submit!!');
return false;
}
});
},
submitForm(formName) { submitForm(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
@@ -192,6 +216,21 @@ export default {
this.resetForm('currentAddType'); 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(){ addType(){
@@ -202,9 +241,17 @@ export default {


if(i.id==this.currentParentData.id) 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({ i.children.push({
id:id, id:id,


Cargando…
Cancelar
Guardar