zouyu
2023-09-13 27dd70096d181051200ec5febf11c99d1940f835
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() {
@@ -693,4 +734,4 @@
      height: 30px;
      border-radius: 2px;
   }
</style>
</style>