zss
2023-09-14 4c5c20a7c03539104df74072b1b8a81b51c19ab8
src/components/view/Technicalindex.vue
@@ -281,51 +281,92 @@
   export default {
      data() {
         return {
            search: {
               type: 0,
               technology: null,
            },
            //   handleClose:[],
            checkTreeNode: {
               id: '',
            },
            higherlevel: [],
            value: {},
            options: [],
            process: [],
            filterNode: [],
            list: [],
            form: {
               father: '',
               work: '',
               name: '',
               unit: '',
               project: '',
            },
            children: [],
            modifyevent: false,
            dialogVisible: false,
            tableData: [],
            typeselect: 0,
            upData: {},
            upDia: false,
            craftapi: [],
            edit: {
               techFather: '',
               techName: '',
               father: '',
               name: '',
               unit: '',
               id: ''
            }
         }
      },
      mounted() {
              search:{
                type:0,
                technology:null,
              },
            //   handleClose:[],
                checkTreeNode :{
                    id:'',
                },
                higherlevel:[],
                value:{},
                options:[],
                process:[],
                filterNode:[],
                list: [],
                form:{
                    father:'',
                    work:'',
                    name:'',
                    unit:'',
                    project:'',
                },
                children:[],
                modifyevent:false,
                dialogVisible:false,
                tableData: [],
                typeselect:0,
                upData:{},
                upDia:false,
                craftapi:[],
                edit:{
                    techFather:'',
                    techName:'',
                    father:'',
                    name:'',
                    unit:'',
                    id:'',
                },
                isAllSelect:false,
            }
        },
        mounted() {
         this.selectAllleft()
         this.selectAllright()
      },
      methods: {
         handleClose() {
        methods:{
              // 表格树全部选中配置
                // 全选/取消选操作
                selectAll(val) {
                    this.isAllSelect = !this.isAllSelect;
                    let data = this.tableData;
                    this.toggleSelect(data, this.isAllSelect, "all");
                },
             //选择某行
          selectTr(selection, row) {
                console.log(selection,row);
                this.$set(row, "isChecked", !row.isChecked);
                this.$nextTick(() => {
                    this.isAllSelect = row.isChecked;
                    this.toggleSelect(row, row.isChecked, "tr");
                });
            },
             //递归子级
            toggleSelect(data, flag, type) {
                if (type === "all") {
                    console.log('222');
                    if (data.length > 0) {
                        data.forEach((item) => {
                        this.toggleSelection(item, flag);
                        if (item.children && item.children.length > 0) {
                            this.toggleSelect(item.children, flag, type);
                        }
                        });
                    }
                } else {
                    if (data.children && data.children.length > 0) {
                        data.children.forEach((item) => {
                        item.isChecked = !item.isChecked;
                        this.$refs.multipleTable.toggleRowSelection(item, flag);
                        this.toggleSelect(item, flag, type);
                        });
                    }
                }
            },
            handleClose(){
         },
         selectDataList() {
@@ -372,7 +413,8 @@
                  "Content-Type": "application/json"
               }
            }).then(res => {
               this.selectAllright()
               /* this.selectAllright() */
                 this.$parent.removeAllTab()
            })
         },
         submitUpData() { //确定
@@ -385,8 +427,9 @@
            this.$axios.post(this.$api.url.delTechBy, {
               id: this.upData.id
            }).then(res => {
               this.selectAllright()
               /* this.selectAllright() */
               this.$message.success('删除完成')
               this.$parent.removeAllTab()
            })
         },
         deleteRow(index, rows) {
@@ -400,7 +443,8 @@
            this.$axios.post(this.$api.url.delAllTechskill, {
               ids: this.delete
            }).then(res => {
               this.selectAllright()
               /* this.selectAllright() */
               this.$parent.removeAllTab()
            })
         },
         dels() {
@@ -693,4 +737,4 @@
      height: 30px;
      border-radius: 2px;
   }
</style>
</style>