<template>
  <div class="notice_page p0-100">
    <!-- 搜索部分 -->
    <div class="search">
      <div class="search_input" style="display:flex">
        <span>通知公告检索</span>
        <el-input v-model="input" placeholder="请输入搜索关键字"></el-input>
        <el-button type="warning">搜索</el-button>
      </div>
      <div class="tags">
        <span class="txt">热门搜索：</span>
        <el-tag effect="dark">高新技术企业</el-tag>
        <el-tag effect="dark">科技型中小企业</el-tag>
        <el-tag effect="dark">科技孵化器</el-tag>
        <!-- <el-button type="primary" size="mini" round>高新技术企业</el-button> -->
        <!-- <el-button type="primary" size="mini" round>科技型中小企业</el-button> -->
        <!-- <el-button type="primary" size="mini" round>科技孵化器</el-button> -->
      </div>
    </div>
    <!-- 筛选部分 -->
    <div class="screen">
      <div class="screen_l">
        <!-- 检索条件 -->
        <div class="screen_l_t">
          <div class="screen_l_t_item">
            <span class="text_col">级别：</span>
            <el-radio-group v-model="queryParams.radio1" size="medium">
              <el-radio-button
                :label="item.label"
                v-for="item in levelList"
                :key="item.label"
              >
                {{ item.name }}
              </el-radio-button>
            </el-radio-group>
          </div>
          <div
            class="screen_l_t_item"
            v-if="queryParams.radio1 == 2 || queryParams.radio1 == 3"
          >
            <el-radio-group v-model="queryParams.radio1_1" size="medium">
              <el-radio-button
                :label="item.id"
                v-for="item in levelList_2"
                :key="item.id"
              >
                {{ item.name }}
              </el-radio-button>
            </el-radio-group>
          </div>
          <div class="screen_l_t_item">
            <span class="text_col">归口：</span>
            <el-radio-group v-model="queryParams.radio2" size="medium">
              <el-radio-button label="">不限</el-radio-button>
              <el-radio-button
                :label="item.value"
                v-for="item in attributeOptions"
                :key="item.value"
              >
                {{ item.label }}
              </el-radio-button>
            </el-radio-group>
          </div>
        </div>
        <!-- 检索列表 -->
        <div class="screen_l_b" v-for="item in 10" :key="item">
          <div class="l">
            <div class="title text_hidden_one" style="width:500px">
              安徽出台若干措施一安徽出台若干措施安徽出台若干措施一安徽出台若干措施安徽出台若干措施一安徽出台若干措施台若干措施安徽出台若干措施一安徽出台若干措施
            </div>
            <div class="info">
              <span>来源：安徽省经济和信息化厅</span>
              <span>发布：2021-06-04</span>
            </div>
          </div>
          <div class="r" style="min-width:310px">
            <el-tag type="warning" effect="dark">截至到2021-08-20</el-tag>
            <span v-if="token">
              <el-button type="primary" size="mini">
                <i class="el-icon-star-on"></i><span>收藏</span>
              </el-button>
              <el-button type="info" size="mini">
                <i class="el-icon-star-on"></i><span>取消收藏</span>
              </el-button>
            </span>
          </div>
        </div>
        <!-- 分页 -->
        <pagination
          v-show="10 > 0"
          :total="100"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        />
      </div>
      <div class="screen_r" v-if="token">
        <div class="title">政策匹配</div>
        <div class="tabs">
          <div class="tabs_row">
            <span class="span">企业画像：</span>
            <el-tabs v-model="activeName" @tab-click="handleClick">
              <el-tab-pane label="制造业" name="1"></el-tab-pane>
              <el-tab-pane label="大型企业" name="2"></el-tab-pane>
              <el-tab-pane label="生产业" name="3"></el-tab-pane>
              <el-tab-pane label="小型企业" name="4"></el-tab-pane>
            </el-tabs>
          </div>
          <div class="tabs_item" v-for="item in 4" :key="item">
            <div class="text_hidden_one">
              安徽出台若干措施一步优化营商安徽出台若干措施一步优化营商安徽出台若干措施一步优化营商
            </div>
            <div>来源：安徽省经济和信息化厅</div>
          </div>
          <div class="more">
            <el-button type="primary" size="mini">查看更多</el-button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { mapGetters } from 'vuex';
import { getDictListByStatus } from '@/api/home/notice';
export default {
  data() {
    return {
      activeName: '1',
      input: '',
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        radio1: '',
        radio1_1: '1417717740679987200',
        radio2: ''
      },
      levelList: [
        {
          label: '1',
          name: '安徽省'
        },
        {
          label: '2',
          name: '地级市'
        },
        {
          label: '3',
          name: '合肥区县'
        }
      ],
      levelList_2: [],
      // 归口选项
      attributeOptions: [
        {
          value: 'KJJ',
          label: '科技'
        },
        {
          value: 'JXJ',
          label: '经信'
        },
        {
          value: 'FGW',
          label: '发改'
        },
        {
          value: 'OTHER',
          label: '其他'
        }
      ]
    };
  },
  computed: {
    ...mapGetters(['token'])
  },
  watch: {
    'queryParams.radio1'(a, b) {
      console.log(a, b);
      if (a == 2) {
        getDictListByStatus({ type: 5 }).then(({ data }) => {
          this.levelList_2 = data;
          this.queryParams.radio1_1 = '1417717740679987200';
        });
      } else if (a == 3) {
        getDictListByStatus({ type: 6 }).then(({ data }) => {
          this.levelList_2 = data;
          this.queryParams.radio1_1 = '1417719159088742400';
        });
      }
    }
  },
  methods: {
    getList() {},
    handleClick() {}
  },
  created() {
    this.levelList.unshift({
      label: '',
      name: '不限'
    });
  }
};
</script>
<style lang="scss" scoped>
.notice_page {
  .search {
    padding-top: 52px;
    padding-bottom: 52px;
    text-align: center;
    .search_input {
      display: flex;
      justify-content: center;
      align-items: center;
      /deep/.el-input--medium .el-input__inner {
        height: 40px;
        line-height: 40px;
        border-radius: 6px 0 0 6px;
        border: 1px solid #ffa32c;
        border-right: 0;
      }
      span:nth-child(1) {
        color: #333;
        font-size: 24px;
        margin-right: 21px;
      }
      .el-input {
        width: 304px;
      }
      .el-button {
        border-radius: 0 6px 6px 0;
        background-color: #ffa32c;
        font-size: 18px;
      }
    }
    .tags {
      margin-top: 26px;
      .txt {
        font-size: 18px;
        color: #999;
      }
      .el-tag {
        border-radius: 20px;
        margin-right: 18px;
      }
    }
  }
  .screen {
    display: flex;
    .screen_l {
      flex: 2;
      .screen_l_t {
        border-radius: 6px;
        background-color: #f8f8f8;
        .screen_l_t_item {
          // height: 50px;
          // line-height: 50px;
          display: flex;
          align-items: center;
          padding: 0 20px;
          .text_col {
            min-width: 100px;
            color: #333;
            font-size: 18px;
          }
          .el-radio-group {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            .el-radio-button {
              margin: 10px 0;
            }
          }
        }
      }
      .screen_l_b {
        // .screen_l_b_item {
        padding: 0 20px;
        height: 110px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #e3e3e3;
        // }
        .l {
          .title {
            font-size: 18px;
            color: #333;
            margin-bottom: 16px;
          }
          .info {
            font-size: 16px;
            color: #999;
            span {
              margin-right: 30px;
            }
          }
        }
        .r {
          .el-button {
            margin-left: 10px;
          }
        }
      }
    }
    .screen_r {
      flex: 1;
      margin-left: 10px;
      max-width: 310px;
      .title {
        color: #ffffff;
        height: 60px;
        line-height: 60px;
        font-size: 20px;
        text-align: center;
        background: #3394ff;
        border-radius: 6px 6px 0px 0px;
      }
      .tabs {
        height: 551px;
        background: #f8f8f8;
        padding: 0px 14px;
        .tabs_row {
          display: flex;
          align-items: center;
          .span {
            width: 30%;
            min-width: 84px;
          }
          .el-tabs {
            // width: 240px;
            width: 70%;
            /deep/.el-tabs__nav-wrap::after {
              height: 0;
            }
            /deep/.el-tabs__item.is-active {
              font-weight: bold;
              color: #1890ff;
            }
          }
        }
        .tabs_item {
          height: 110px;
          display: flex;
          flex-direction: column;
          justify-content: center;
          border-bottom: 1px solid #e3e3e3;
          div:nth-child(1) {
            font-size: 18px;
            color: #333333;
          }
          div:nth-child(2) {
            margin-top: 16px;
            font-size: 16px;
            color: #999999;
          }
        }
        .more {
          text-align: center;
          .el-button {
            margin-top: 12px;
          }
        }
      }
    }
  }
}
</style>
