<template>
  <div class="com_cell">
    <div class="com_cell_img_box">
      <img
        src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
        class="com_cell_img"
      />
    </div>
    <div class="com_cell_message">
      <div class="com_cell_msg_title">
        {{ cellData.title }}
        <span v-if="cellData.mapService" class="tags map_service">mapService</span>
        <span v-if="cellData.state == 1" class="tags shared">共享</span>
        <span v-else-if="cellData.state ==  2" class="tags restricted">受限</span>
        <span v-else class="tags sensitive">敏感</span>
      </div>
      <div class="com_cell_item">
        <span class="com_cell_item_title">资源摘要：</span>
        <span
          class="com_cell_data"
        >{{ cellData.resourceSummary }}</span>
      </div>
      <div class="com_cell_item">
        <span class="com_cell_item_title">提供机构：</span>
        <span class="com_cell_data">{{ cellData.provider }}</span>
      </div>
      <div class="com_cell_item">
        <span class="com_cell_item_title">数据领域：</span>
        <span class="com_cell_data">{{ cellData.dataField }}</span>
      </div>
      <div class="com_cell_item">
        <span class="com_cell_item_title">服务类型：</span>
        <span class="com_cell_data">{{ cellData.serviceType }}</span>
      </div>
      <div class="com_cell_item">
        <span class="com_cell_item_title">更新时间：</span>
        <span class="com_cell_data">{{ cellData.updateTime }}</span>
      </div>
    </div>
    <div class="com_cell_right">
      <el-rate
        v-model="cellData.rate"
        disabled
        show-score
        text-color="#58617a"
        score-template="{value}"
      ></el-rate>
      <div class="com_cell_right_text">
        <span class="com_cell_right_time_tit">本月获取次数：</span>
        <span class="com_cell_right_time">{{ cellData.numberOfMonth }}次</span>
      </div>
      <el-button class="com_cell_right_btn" @click="goUrl(cellData.id)">查看详情</el-button>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  props: {
    url: { type: String, default: "" },
    cellData: { type: Object, default: {} }
  },
  data: () => ({}),
  computed: {},
  watch: {},
  methods: {
    goUrl(parame) {
      if (this.url != "") {
        this.$router.push(this.url + "/" + parame);
      }
    }
  },
  mounted() {}
};
</script>

<style scoped>
.com_cell {
  display: flex;
  justify-content: flex-start;
  padding: 20px 10px;
  border-bottom: 2px #f4f7fc solid;
}
.com_cell_img_box {
  width: 166px;
  height: 166px;
  border-radius: 12px;
  overflow: hidden;
}
.com_cell_img {
  width: 100%;
  height: 100%;
}
.com_cell_message {
  padding-left: 20px;
  width: calc(100% - 420px);
}
.com_cell_msg_title {
  color: #0d1847;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}
.com_cell_item {
  font-size: 16px;
  line-height: 26px;
  margin-top: 1px;
  color: #8890a7;
  display: flex;
  align-self: start;
}
.com_cell_item_title {
  width: 80px;
}
.com_cell_data {
  display: inline-block;
  width: calc(100% - 90px);
  color: #242c43;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.com_cell_right {
  width: 250px;
  padding: 25px 0 0 50px;
}
.com_cell_right_text {
  font-size: 14px;
  margin-top: 15px;
}
.com_cell_right_time_tit {
  color: #8890a7;
}
.com_cell_right_time {
  color: #242c43;
}
.com_cell_right_btn {
  background-color: #0f2683;
  color: #f8f9fd;
  width: 160px;
  height: 40px;
  border-radius: 20px;
  margin-top: 35px;
}
.tags {
  display: inline-block;
  margin-left: 10px;
  padding: 1px 8px 2px;
  font-size: 12px;
  font-weight: 500;
  line-height: 12px;
  border-radius: 4px;
  position: relative;
  top: -2px;
}
.map_service {
  background-color: #626DE9;
  border: solid 1px #626DE9;
  color: #fff;
}
.shared {
  background-color: #e7fdfc;
  border: solid 1px #8bd6d0;
  color: #25bdb1;
}
.restricted {
  background-color: #fffee8;
  border: solid 1px #e4c884;
  color: #ef9433;
}
.sensitive {
  background-color: #ffefef;
  border: solid 1px #d7a4a9;
  color: #e15260;
}
</style>
<style>
.com_cell_right .el-rate__text {
  display: inline-block;
  margin-left: 10px;
  font-size: 22px;
  font-weight: 700;
}
.com_cell_right .el-rate__icon {
  font-size: 20px;
}
</style>