<template>
  <div>
    <Breadcrumb :list="breadcrumbList"/>
    <div class="table">
      <el-table v-loading="loading"
                :data="list"
                element-loading-background="rgba(0,0,0,0.5)"
                element-loading-spinner="el-icon-loading"
                element-loading-text="加载中..."
      >
        <el-table-column label="序号" type="index" width="80"/>

        <el-table-column label="所属网格" prop="key"/>
        <el-table-column label="接收时间" prop="key"/>
        <el-table-column label="问题描述" prop="key"/>
        <el-table-column label="语音" prop="key"/>
        <el-table-column label="办结时限" prop="key"/>
        <el-table-column label="联系人" prop="key"/>
        <el-table-column label="联系人电话" prop="mobile">
          <template slot-scope="scope">
            {{ $sensitive(scope.row.mobile, 3, 7) }}
          </template>
        </el-table-column>
        <el-table-column label="状态" prop="key"/>
        <el-table-column label="操作" sortable>
          <template slot-scope="{ row }">
            <CallPhone text="拨打电话"/>
            <span class="handle">处理</span>
            <span class="view" @click="handleView(scope.row)">查看</span>
          </template>
        </el-table-column>
      </el-table>
    </div>

    <Pagination v-show="total > 0" :limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNo" :total="total"
                @pagination="getList"/>
    <sjwjj :id="rowId" :showDialog="showDialog" @close="close"/>
  </div>
</template>

<script>
import Breadcrumb from "@/views/dataBoard/satisfactionEval/components/Breadcrumb";
import Pagination from "@/views/dataBoard/satisfactionEval/components/Pagination";
import Title from "@/views/dataBoard/satisfactionEval/components/Title";
import sjwjj from "@/views/dataBoard/satisfactionEval/potentialPeople/details/sjwjj.vue";
import CallPhone from '@/views/dataBoard/cpts/CallPhone.vue'

export default {
  name: "12345Hotline",
  components: {Breadcrumb, Pagination, Title, sjwjj, CallPhone},
  data() {
    return {
      queryParams: {
        reportUserId: this.$route.query.reportUserId,
        pageNo: 1,
        pageSize: 10,
      },
      total: 0,
      breadcrumbList: [
        {
          path: "/dataBoard/overview/index",
          name: "书记看板",
        },
        {
          path: "",
          name: "12345投诉列表",
        },
      ],
      list: [],
      showDialog: false,
      rowId: "",
      loading: true
    };
  },
  activated() {
    this.queryParams.reportUserId = this.$route.query.reportUserId;
    this.queryParams.pageNo = 1;
    this.getList();
  },
  methods: {
    search() {
      this.queryParams.pageNo = 1;
      this.getList();
    },
    getList() {
      this.loading = true
      this.$http.get("/?" + this.$paramsFormat(this.queryParams)).then(({data: {data}}) => {
        this.list = data.list;
        this.total = data.total;
        this.loading = false
      });
    },
    handleView({id}) {
      this.showDialog = true;
      this.rowId = id;
    },
    close() {
      this.showDialog = false;
    },
  },
};
</script>

<style lang="scss" scoped>
@import "@/assets/scss/dataBoard/table.scss";

.table {
  margin-top: 40px;
}

.handle {
  font-size: 14px;
  margin-left: 10px;
  color: #9A69EC;
}

.view {
  font-size: 14px;
  margin-left: 10px;
  color: #007FF1;
}
</style>
