|
|
@@ -0,0 +1,79 @@
|
|
|
+<template>
|
|
|
+ <div class="communication-explore">
|
|
|
+ <div class="explore-header">
|
|
|
+ <div class="explore-selector">
|
|
|
+ <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选
|
|
|
+ </el-checkbox>
|
|
|
+ <el-checkbox-group v-model="checkedTypes" @change="handleCheckedTypesChange">
|
|
|
+ <el-checkbox v-for="type in types" :label="type" :key="type">{{ type }}</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </div>
|
|
|
+ <div class="explore-search">
|
|
|
+ <el-input placeholder="请输入搜索内容" v-model="content"></el-input>
|
|
|
+ <el-button type="primary" style="margin-left: 10px">确认</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="explore-main">
|
|
|
+ <ExploreItem class="explore-item"/>
|
|
|
+ <ExploreItem class="explore-item"/>
|
|
|
+ <ExploreItem class="explore-item"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import ExploreItem from "@/views/CommunicationPage/ExplorePage/ExploreItem.vue";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "Explore",
|
|
|
+ components: {ExploreItem},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // explore-selector
|
|
|
+ checkAll: true,
|
|
|
+ checkedTypes: ["难题", "活动", "其他"],
|
|
|
+ types: ["难题", "活动", "其他"],
|
|
|
+ isIndeterminate: false,
|
|
|
+ // explore-search
|
|
|
+ content: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleCheckAllChange(val) {
|
|
|
+ this.checkedTypes = val ? this.types : [];
|
|
|
+ this.isIndeterminate = false;
|
|
|
+ },
|
|
|
+ handleCheckedTypesChange(value) {
|
|
|
+ let checkedCount = value.length;
|
|
|
+ this.checkAll = checkedCount === this.types.length;
|
|
|
+ this.isIndeterminate = checkedCount > 0 && checkedCount < this.types.length;
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.communication-explore {
|
|
|
+ flex: 1;
|
|
|
+ padding: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.explore-header{
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-bottom: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.explore-search{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.explore-main{
|
|
|
+ padding: 0 30px;
|
|
|
+}
|
|
|
+
|
|
|
+.explore-item{
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+</style>
|