|
@@ -4,51 +4,63 @@
|
|
<div>
|
|
<div>
|
|
<span class="radiaTitle">院校省份:</span>
|
|
<span class="radiaTitle">院校省份:</span>
|
|
</div>
|
|
</div>
|
|
- <el-radio-group v-model="filter.location">
|
|
|
|
- <el-radio-button label="">所有</el-radio-button>
|
|
|
|
- <el-radio-button v-for="item in filter_list.locations" :key="item" :label="item" style="margin-bottom:10px"
|
|
|
|
- ></el-radio-button>
|
|
|
|
- </el-radio-group>
|
|
|
|
|
|
+ <el-checkbox-button v-if="multiple" :value="!!!this.filter.location.length" @click.native="filter.location=[]">不限
|
|
|
|
+ </el-checkbox-button>
|
|
|
|
+ <component :is="useSelectComponent" v-model="filter.location">
|
|
|
|
+ <component v-if="!multiple" :is="useOptionComponent" label="">所有</component>
|
|
|
|
+ <component :is="useOptionComponent" v-for="item in filter_list.locations" :key="item" :label="item"
|
|
|
|
+ style="margin-bottom:10px"></component>
|
|
|
|
+ </component>
|
|
</el-row>
|
|
</el-row>
|
|
- <el-row class="radioInput" >
|
|
|
|
|
|
+ <el-row class="radioInput">
|
|
<div>
|
|
<div>
|
|
<span class="radiaTitle">院校类型:</span>
|
|
<span class="radiaTitle">院校类型:</span>
|
|
</div>
|
|
</div>
|
|
- <el-radio-group v-model="filter.type">
|
|
|
|
- <el-radio-button label="">所有</el-radio-button>
|
|
|
|
- <el-radio-button v-for="item in filter_list.types" :key="item" :label="item" style="margin-bottom:10px"
|
|
|
|
- ></el-radio-button>
|
|
|
|
- </el-radio-group>
|
|
|
|
|
|
+ <el-checkbox-button v-if="multiple" :value="!!!this.filter.type.length" @click.native="filter.type=[]">不限
|
|
|
|
+ </el-checkbox-button>
|
|
|
|
+ <component :is="useSelectComponent" v-model="filter.type">
|
|
|
|
+ <component v-if="!multiple" :is="useOptionComponent" label="">所有</component>
|
|
|
|
+ <component :is="useOptionComponent" v-for="item in filter_list.types" :key="item" :label="item"
|
|
|
|
+ style="margin-bottom:10px"></component>
|
|
|
|
+ </component>
|
|
</el-row>
|
|
</el-row>
|
|
<el-row class="radioInput">
|
|
<el-row class="radioInput">
|
|
<div>
|
|
<div>
|
|
<span class="radiaTitle">院校层次:</span>
|
|
<span class="radiaTitle">院校层次:</span>
|
|
</div>
|
|
</div>
|
|
- <el-radio-group v-model="filter.features">
|
|
|
|
- <el-radio-button label="">所有</el-radio-button>
|
|
|
|
- <el-radio-button v-for="item in filter_list.features" :key="item" :label="item" style="margin-bottom:10px"
|
|
|
|
- ></el-radio-button>
|
|
|
|
- </el-radio-group>
|
|
|
|
|
|
+ <el-checkbox-button v-if="multiple" :value="!!!this.filter.features.length" @click.native="filter.features=[]">不限
|
|
|
|
+ </el-checkbox-button>
|
|
|
|
+ <component :is="useSelectComponent" v-model="filter.features">
|
|
|
|
+ <component v-if="!multiple" :is="useOptionComponent" label="">所有</component>
|
|
|
|
+ <component :is="useOptionComponent" v-for="item in filter_list.features" :key="item" :label="item"
|
|
|
|
+ style="margin-bottom:10px"></component>
|
|
|
|
+ </component>
|
|
</el-row>
|
|
</el-row>
|
|
- <el-row class="radioInput" >
|
|
|
|
|
|
+ <el-row class="radioInput">
|
|
<div>
|
|
<div>
|
|
<span class="radiaTitle">办学类型:</span>
|
|
<span class="radiaTitle">办学类型:</span>
|
|
</div>
|
|
</div>
|
|
- <el-radio-group v-model="filter.natureTypeCN">
|
|
|
|
- <el-radio-button label="">所有</el-radio-button>
|
|
|
|
- <el-radio-button v-for="item in filter_list.natureTypes" :key="item" :label="item" style="margin-bottom:10px"
|
|
|
|
- ></el-radio-button>
|
|
|
|
- </el-radio-group>
|
|
|
|
|
|
+ <!-- NOTE:注意value传值要强制转成boolean类型,否则无法正常工作 -->
|
|
|
|
+ <el-checkbox-button v-if="multiple" :value="!!!this.filter.natureTypeCN.length"
|
|
|
|
+ @click.native="filter.natureTypeCN=[]">不限
|
|
|
|
+ </el-checkbox-button>
|
|
|
|
+ <component :is="useSelectComponent" v-model="filter.natureTypeCN">
|
|
|
|
+ <component v-if="!multiple" :is="useOptionComponent" label="">所有</component>
|
|
|
|
+ <component :is="useOptionComponent" v-for="item in filter_list.natureTypes" :key="item" :label="item"
|
|
|
|
+ style="margin-bottom:10px"></component>
|
|
|
|
+ </component>
|
|
</el-row>
|
|
</el-row>
|
|
<el-row class="radioInput" v-if="!levelHide">
|
|
<el-row class="radioInput" v-if="!levelHide">
|
|
<div>
|
|
<div>
|
|
<span class="radiaTitle">学历层次:</span>
|
|
<span class="radiaTitle">学历层次:</span>
|
|
</div>
|
|
</div>
|
|
- <el-radio-group v-model="filter.level">
|
|
|
|
- <el-radio-button label="">所有</el-radio-button>
|
|
|
|
- <el-radio-button v-for="item in filter_list.levels" :key="item" :label="item" style="margin-bottom:10px"
|
|
|
|
- ></el-radio-button>
|
|
|
|
- </el-radio-group>
|
|
|
|
|
|
+ <el-checkbox-button v-if="multiple" :value="!!!this.filter.level.length" @click.native="filter.level=[]">不限
|
|
|
|
+ </el-checkbox-button>
|
|
|
|
+ <component :is="useSelectComponent" v-model="filter.level">
|
|
|
|
+ <component v-if="!multiple" :is="useOptionComponent" label="">所有</component>
|
|
|
|
+ <component :is="useOptionComponent" v-for="item in filter_list.levels" :key="item" :label="item"
|
|
|
|
+ style="margin-bottom:10px"></component>
|
|
|
|
+ </component>
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -61,32 +73,52 @@ export default {
|
|
type: Object,
|
|
type: Object,
|
|
default: {}
|
|
default: {}
|
|
},
|
|
},
|
|
- levelHide:{
|
|
|
|
|
|
+ levelHide: {
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: false
|
|
|
|
+ },
|
|
|
|
+ multiple: {
|
|
type: Boolean,
|
|
type: Boolean,
|
|
default: false
|
|
default: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- created() {
|
|
|
|
- this.getFilter()
|
|
|
|
- },
|
|
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
filter_list: {}
|
|
filter_list: {}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- methods:{
|
|
|
|
|
|
+ computed: {
|
|
|
|
+ useSelectComponent() {
|
|
|
|
+ return this.multiple ? 'el-checkbox-group' : 'el-radio-group'
|
|
|
|
+ },
|
|
|
|
+ useOptionComponent() {
|
|
|
|
+ return this.multiple ? 'el-checkbox-button' : 'el-radio-button'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.getFilter()
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
getFilter() {
|
|
getFilter() {
|
|
universityFilters().then(res => {
|
|
universityFilters().then(res => {
|
|
this.filter_list = res.data
|
|
this.filter_list = res.data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ handleEmpty(key) {
|
|
|
|
+ this.$set(this.filter, key, this.multiple ? [] : '')
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
.radioInput ::v-deep {
|
|
.radioInput ::v-deep {
|
|
- background-color: #ffffff;font-size: 14px;padding:5px;
|
|
|
|
|
|
+ background-color: #ffffff;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ padding: 5px;
|
|
|
|
+
|
|
|
|
+ .el-checkbox,
|
|
.el-radio {
|
|
.el-radio {
|
|
|
|
+ .el-checkbox__input,
|
|
.el-radio__input {
|
|
.el-radio__input {
|
|
display: none;
|
|
display: none;
|
|
}
|
|
}
|
|
@@ -96,6 +128,7 @@ export default {
|
|
.radioInput ::v-deep {
|
|
.radioInput ::v-deep {
|
|
display: flex;
|
|
display: flex;
|
|
|
|
|
|
|
|
+ .el-checkbox-button .el-checkbox-button__inner,
|
|
.el-radio-button .el-radio-button__inner {
|
|
.el-radio-button .el-radio-button__inner {
|
|
border-radius: 4px !important;
|
|
border-radius: 4px !important;
|
|
border: none;
|
|
border: none;
|
|
@@ -104,10 +137,15 @@ export default {
|
|
font-family: PingFangSC-Regular, PingFang SC;
|
|
font-family: PingFangSC-Regular, PingFang SC;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ .el-checkbox-button__original:checked + .el-checkbox-button__inner,
|
|
.el-radio-button__orig-radio:checked + .el-radio-button__inner {
|
|
.el-radio-button__orig-radio:checked + .el-radio-button__inner {
|
|
box-shadow: none;
|
|
box-shadow: none;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ .el-checkbox-button {
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ }
|
|
|
|
+
|
|
.radiaTitle {
|
|
.radiaTitle {
|
|
display: inline-block;
|
|
display: inline-block;
|
|
width: 80px;
|
|
width: 80px;
|