Fixiaobai
2023-09-14 7e33695561c2da43fcc752894e9bd46a7059cb3f
src/components/view/equipmentmaintain.vue
@@ -263,7 +263,7 @@
                <el-table
                    :data="tableData"
                    style="width: 100%;margin-bottom: 20px;height: 600px;overflow: auto;"
                    row-key="name"
                    row-key="rowId"
                    border
                    @select="selectTr"
                    @selection-change="handleSelectionChange"
@@ -549,12 +549,21 @@
         }).then(res => {
            this.tableData = res.data;
                console.log(this.tableData);
                this.formatData(res.data)
         })
         },
            modify(){
                this.modifyevent = true
            },
            formatData(data){
                let arr = data;
                for(var i=0;i<arr.length;i++){
                        arr[i].rowId = Math.random();
                        if(arr[i].children != undefined){
                        this.formatData(arr[i].children);
                        }
                    }
                },
            //delQueById
            delQueById() {
            this.$axios.post(this.$api.url.delQueById,{
@@ -592,6 +601,11 @@
                let cc = this.selects.map(el => {
               return el.id
            })
                // cc.forEach((el,idx) =>{
                //     delete  idx[0]
                // })
                cc.splice(0,1)
                console.log(cc);
            this.delete = cc.join(',')
            console.log(this.delete);
            this.delAllQue()
@@ -608,6 +622,7 @@
            // },
            handleSelectionChange(val) {
                this.selects = val
                this.deleteList = [];
                val.forEach((v) => {
                if (v.id !== undefined) {
@@ -630,6 +645,7 @@
                    this.isAllSelect = row.isChecked;
                    this.toggleSelect(row, row.isChecked, "tr");
                });
            },
             //递归子级
            toggleSelect(data, flag, type) {