|  | @@ -9,18 +9,44 @@
 | 
	
		
			
				|  |  |          <!-- 院校筛选条件 -->
 | 
	
		
			
				|  |  |          <filter-form :filter="filter_form"></filter-form>
 | 
	
		
			
				|  |  |          <!--其他筛选 -->
 | 
	
		
			
				|  |  | -        <div class="filter">
 | 
	
		
			
				|  |  | -          <div class="filter_name">推荐类型:</div>
 | 
	
		
			
				|  |  | +        <el-row class="radioInput">
 | 
	
		
			
				|  |  | +          <div>
 | 
	
		
			
				|  |  | +            <span class="radiaTitle">院校层次:</span>
 | 
	
		
			
				|  |  | +          </div>
 | 
	
		
			
				|  |  | +          <el-radio-group v-model="filter_form.pickType">
 | 
	
		
			
				|  |  | +            <el-radio-button label="">所有</el-radio-button>
 | 
	
		
			
				|  |  | +            <el-radio-button v-for="item in localFilters.picks" :key="item.value" :label="item.value" style="margin-bottom:10px"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +              {{ item.label }}
 | 
	
		
			
				|  |  | +            </el-radio-button>
 | 
	
		
			
				|  |  | +          </el-radio-group>
 | 
	
		
			
				|  |  | +        </el-row>
 | 
	
		
			
				|  |  | +        <!-- 专业 -->
 | 
	
		
			
				|  |  | +        <el-row class="radioInput">
 | 
	
		
			
				|  |  | +          <div>
 | 
	
		
			
				|  |  | +            <span class="radiaTitle">专业类别:</span>
 | 
	
		
			
				|  |  | +          </div>
 | 
	
		
			
				|  |  | +          <el-radio-group v-model="currentMajor">
 | 
	
		
			
				|  |  | +            <el-radio-button label="">所有</el-radio-button>
 | 
	
		
			
				|  |  | +            <el-radio-button v-for="item in majorList" :key="item.code" :label="item.code" style="margin-bottom:10px">
 | 
	
		
			
				|  |  | +              {{ item.name }}
 | 
	
		
			
				|  |  | +            </el-radio-button>
 | 
	
		
			
				|  |  | +          </el-radio-group>
 | 
	
		
			
				|  |  | +        </el-row>
 | 
	
		
			
				|  |  | +        <!--    专业子类    -->
 | 
	
		
			
				|  |  | +        <el-row class="radioInput filter" v-if="childrenMajors.length">
 | 
	
		
			
				|  |  | +          <div>
 | 
	
		
			
				|  |  | +            <span class="radiaTitle"></span>
 | 
	
		
			
				|  |  | +          </div>
 | 
	
		
			
				|  |  |            <div class="items fx-row">
 | 
	
		
			
				|  |  |              <div class="no_limited">
 | 
	
		
			
				|  |  | -              <el-checkbox @change="change('pick',$event)" v-model="isAll.pickType">不限</el-checkbox>
 | 
	
		
			
				|  |  | +              <el-checkbox @change="changeAll"   v-model="isAll">全部</el-checkbox>
 | 
	
		
			
				|  |  |              </div>
 | 
	
		
			
				|  |  | -            <el-radio-group v-model="filter_form.pickType">
 | 
	
		
			
				|  |  | -              <el-radio v-for="pick in localFilters.picks" :label="pick.value" :key="pick.value">{{ pick.label }}
 | 
	
		
			
				|  |  | -              </el-radio>
 | 
	
		
			
				|  |  | -            </el-radio-group>
 | 
	
		
			
				|  |  | +            <el-checkbox-group v-model="checkedList" >
 | 
	
		
			
				|  |  | +              <el-checkbox  v-for="item in childrenMajors" :label="item.code" :key="item.code">{{item.name}}</el-checkbox>
 | 
	
		
			
				|  |  | +            </el-checkbox-group>
 | 
	
		
			
				|  |  |            </div>
 | 
	
		
			
				|  |  | -        </div>
 | 
	
		
			
				|  |  | +        </el-row>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  |      <div class="zhiyuan-list">
 | 
	
	
		
			
				|  | @@ -29,8 +55,8 @@
 | 
	
		
			
				|  |  |    </div>
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  | -import { zytbFilter } from '@/api/webApi/webQue'
 | 
	
		
			
				|  |  |  import FilterForm from '@/views/career/components/FilterForm';
 | 
	
		
			
				|  |  | +import { allMajor } from '@/api/webApi/professlib'
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    props: {
 | 
	
		
			
				|  |  |      formSubject: {
 | 
	
	
		
			
				|  | @@ -47,13 +73,18 @@ export default {
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    data() {
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  | +      indeterminate:false,
 | 
	
		
			
				|  |  | +      checkedList:[],
 | 
	
		
			
				|  |  |        filter_form:{
 | 
	
		
			
				|  |  |          location:'',
 | 
	
		
			
				|  |  |          natureTypeCN:'',
 | 
	
		
			
				|  |  |          type:'',
 | 
	
		
			
				|  |  |          level:'',
 | 
	
		
			
				|  |  |          features:'',
 | 
	
		
			
				|  |  | +        pickType:'',
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | +      currentMajor:'',
 | 
	
		
			
				|  |  | +      majorList:[],
 | 
	
		
			
				|  |  |        localFilters: {
 | 
	
		
			
				|  |  |          picks: [
 | 
	
		
			
				|  |  |            { label: '冲刺型', value: '0' },
 | 
	
	
		
			
				|  | @@ -61,7 +92,6 @@ export default {
 | 
	
		
			
				|  |  |            { label: '保守型', value: '2' }
 | 
	
		
			
				|  |  |          ]
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | -      filters: {},
 | 
	
		
			
				|  |  |        rows: [{}],
 | 
	
		
			
				|  |  |        propDefines: {
 | 
	
		
			
				|  |  |          name: {
 | 
	
	
		
			
				|  | @@ -82,38 +112,79 @@ export default {
 | 
	
		
			
				|  |  |          action: {
 | 
	
		
			
				|  |  |            label: '填报'
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    created() {
 | 
	
		
			
				|  |  | -    this.$nextTick(_ => zytbFilter(this.batch.batch).then((res) => {
 | 
	
		
			
				|  |  | -      this.filters = res.data
 | 
	
		
			
				|  |  | -    }))
 | 
	
		
			
				|  |  | +    this.$nextTick(_ => {
 | 
	
		
			
				|  |  | +      this.getAllMajor()
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    computed: {
 | 
	
		
			
				|  |  | -    isAll: {
 | 
	
		
			
				|  |  | -      get() {
 | 
	
		
			
				|  |  | -        return {
 | 
	
		
			
				|  |  | -          pickType: !this.filter_form.pickType,
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +    childrenMajors() {
 | 
	
		
			
				|  |  | +      if(!this.currentMajor) return []
 | 
	
		
			
				|  |  | +      return this.majorList.find(item => {
 | 
	
		
			
				|  |  | +        return item.code == this.currentMajor
 | 
	
		
			
				|  |  | +      }).children || []
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    isAll:{
 | 
	
		
			
				|  |  | +      get(){
 | 
	
		
			
				|  |  | +        // 当前children 全选
 | 
	
		
			
				|  |  | +        let count = 0
 | 
	
		
			
				|  |  | +        const childrenMajors = this.childrenMajors
 | 
	
		
			
				|  |  | +        this.checkedList.forEach(item => {
 | 
	
		
			
				|  |  | +          if(childrenMajors.findIndex(major => {return major.code == item}) != -1){
 | 
	
		
			
				|  |  | +            count++
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +        console.log('选中数',count)
 | 
	
		
			
				|  |  | +        return count == childrenMajors.length
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | -      set() {
 | 
	
		
			
				|  |  | +      set(){
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  | -    change(val, $event) {
 | 
	
		
			
				|  |  | -      if ($event) {
 | 
	
		
			
				|  |  | -        if (val == 'pick') {
 | 
	
		
			
				|  |  | -          this.filter_form.pickType = ''
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +    changeAll(val){
 | 
	
		
			
				|  |  | +      const checkedList =  this.checkedList
 | 
	
		
			
				|  |  | +      if(val) {
 | 
	
		
			
				|  |  | +        // 添加
 | 
	
		
			
				|  |  | +        this.childrenMajors.forEach(item => {
 | 
	
		
			
				|  |  | +          if(this.checkedList.findIndex(code => code == item.code) == -1 ){
 | 
	
		
			
				|  |  | +            this.checkedList.push(item.code)
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +      }else {
 | 
	
		
			
				|  |  | +        // 移除
 | 
	
		
			
				|  |  | +        this.childrenMajors.forEach(item => {
 | 
	
		
			
				|  |  | +          for (let i = 0; i < checkedList.length; i++) {
 | 
	
		
			
				|  |  | +            if(item.code == checkedList[i]){
 | 
	
		
			
				|  |  | +              this.checkedList.remove(item.code)
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      console.log(val)
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    handleCheckAllChange(val) {
 | 
	
		
			
				|  |  | +      this.isIndeterminate = false;
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    getAllMajor(){
 | 
	
		
			
				|  |  | +      allMajor({
 | 
	
		
			
				|  |  | +        level:2,
 | 
	
		
			
				|  |  | +        batch:this.batch.batch
 | 
	
		
			
				|  |  | +      }).then(res => {
 | 
	
		
			
				|  |  | +        this.majorList = res.data
 | 
	
		
			
				|  |  | +        console.log(res)
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  </script>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -<style scoped>
 | 
	
		
			
				|  |  | +<style scoped lang="scss">
 | 
	
		
			
				|  |  |  .more span {
 | 
	
		
			
				|  |  |    margin-right: 10px;
 | 
	
		
			
				|  |  |  }
 | 
	
	
		
			
				|  | @@ -138,7 +209,7 @@ export default {
 | 
	
		
			
				|  |  |    margin-right: 10px;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -.zhiyuan-filter .filters .filter .items .no_limited >>> .el-checkbox__input {
 | 
	
		
			
				|  |  | +.zhiyuan-filter .filters .filter .items .no_limited ::v-deep .el-checkbox__input {
 | 
	
		
			
				|  |  |    display: none;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -152,7 +223,7 @@ export default {
 | 
	
		
			
				|  |  |    border-bottom: 0;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -.zhiyuan-filter .filters .filter >>> .el-checkbox, .zhiyuan-filter .filters .filter >>> .el-radio {
 | 
	
		
			
				|  |  | +.zhiyuan-filter .filters .filter ::v-deep .el-checkbox, .zhiyuan-filter .filters .filter ::v-deep .el-radio {
 | 
	
		
			
				|  |  |    -webkit-box-sizing: border-box;
 | 
	
		
			
				|  |  |    box-sizing: border-box;
 | 
	
		
			
				|  |  |    height: 32px;
 | 
	
	
		
			
				|  | @@ -165,12 +236,46 @@ em {
 | 
	
		
			
				|  |  |    font-style: normal;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | ->>> .el-input--medium .el-input__inner {
 | 
	
		
			
				|  |  | +::v-deep .el-input--medium .el-input__inner {
 | 
	
		
			
				|  |  |    height: 30px;
 | 
	
		
			
				|  |  |    line-height: 30px;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | ->>> .el-input {
 | 
	
		
			
				|  |  | +::v-deep .el-input {
 | 
	
		
			
				|  |  |    width: 260px;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +.radioInput ::v-deep {
 | 
	
		
			
				|  |  | +  background-color: #ffffff;font-size: 14px;padding:5px;
 | 
	
		
			
				|  |  | +  .el-radio {
 | 
	
		
			
				|  |  | +    .el-radio__input {
 | 
	
		
			
				|  |  | +      display: none;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +.radioInput ::v-deep {
 | 
	
		
			
				|  |  | +  display: flex;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  .el-radio-button .el-radio-button__inner {
 | 
	
		
			
				|  |  | +    border-radius: 4px !important;
 | 
	
		
			
				|  |  | +    border: none;
 | 
	
		
			
				|  |  | +    padding: 5px 10px !important;
 | 
	
		
			
				|  |  | +    font-weight: 400;
 | 
	
		
			
				|  |  | +    font-family: PingFangSC-Regular, PingFang SC;
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  .el-radio-button__orig-radio:checked + .el-radio-button__inner {
 | 
	
		
			
				|  |  | +    box-shadow: none;
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  .radiaTitle {
 | 
	
		
			
				|  |  | +    display: inline-block;
 | 
	
		
			
				|  |  | +    width: 80px;
 | 
	
		
			
				|  |  | +    font-size: 14px;
 | 
	
		
			
				|  |  | +    text-align: right;
 | 
	
		
			
				|  |  | +    margin-top: 2px;
 | 
	
		
			
				|  |  | +    margin-right: 10px;
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  |  </style>
 |