fuliqi
2025-01-17 b5c6e17f2e9cb10ed323c1adfa2e449bab307134
src/views/system/check/result/detail/index.vue
@@ -2,9 +2,10 @@
  <div style="padding: 0px 10px">
    <div>
      <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect"
        style="margin-bottom: 10px">
               style="margin-bottom: 10px">
        <el-menu-item index="0">省厅考核</el-menu-item>
        <el-menu-item index="1">区域考核</el-menu-item>
        <el-menu-item index="1">区县考核</el-menu-item>
        <el-menu-item index="2">公安部考核</el-menu-item>
      </el-menu>
    </div>
@@ -15,7 +16,7 @@
            <h1>考核成绩</h1>
            <div class="select-container">
              <el-date-picker v-model="date" format="yyyy-MM" value-format="yyyy-MM" type="month" placeholder="选择日期"
                @change="dateChange">
                              @change="dateChange">
              </el-date-picker>
            </div>
          </div>
@@ -37,12 +38,16 @@
        </el-table-column>
        <el-table-column label="标签" prop="examineTag" align="center">
          <template slot-scope="scope">
            {{ scope.row.examineTag == 0 ? '省厅考核' : '市局考核' }}
            {{
              scope.row.examineTag === 0 ? '省厅考核' :
                scope.row.examineTag === 1 ? '区县考核' :
                  scope.row.examineTag === 2 ? '公安部考核' : '未知'
            }}
          </template>
        </el-table-column>
        <el-table-column label="考核类型" prop="examineCategory" align="center">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.platform_examine_category" :value="scope.row.examineCategory" />
            <dict-tag :options="dict.type.platform_examine_category" :value="scope.row.examineCategory"/>
          </template>
        </el-table-column>
@@ -51,32 +56,38 @@
        </el-table-column>
        <el-table-column label="状态" prop="publish" align="center">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.platform_is_publish" :value="scope.row.publish" />
            <dict-tag :options="dict.type.platform_is_publish" :value="scope.row.publish"/>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center">
          <template slot-scope="scope">
            <div style="display: flex;justify-content: center;">
            <el-button v-hasPermi="['check:score:publish']" size="small" type="text" @click="handlePublish(scope.row)" v-if="scope.row.publish === 'UNPUBLISHED'" >确认发布</el-button>
            <el-button v-hasPermi="['check:score:publish']" size="small" type="text" @click="handlePublish(scope.row)" v-if="scope.row.publish === 'PUBLISHED'">取消发布</el-button>
            <el-button
              size="mini"
              type="text"
              icon="el-icon-view"
              @click="handleDetail(scope.row.id)"
            >详细</el-button>
              <el-button v-hasPermi="['check:score:publish']" size="small" type="text" @click="handlePublish(scope.row)"
                         v-if="scope.row.publish === 'UNPUBLISHED'">确认发布
              </el-button>
              <el-button v-hasPermi="['check:score:publish']" size="small" type="text" @click="handlePublish(scope.row)"
                         v-if="scope.row.publish === 'PUBLISHED'">取消发布
              </el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-view"
                @click="handleDetail(scope.row)"
              >详细
              </el-button>
            </div>
          </template>
        </el-table-column>
      </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParamsList.pageNum"
      :limit.sync="queryParamsList.pageSize"
      @pagination="getList"
    />
      <pagination
        v-show="total>0"
        :total="total"
        :auto-scroll="false"
        :page.sync="queryParamsList.pageNum"
        :limit.sync="queryParamsList.pageSize"
        @pagination="getList"
      />
    </div>
@@ -84,14 +95,23 @@
</template>
<script>
import { listScore, getScore, delScore, addScore, updateScore, publishScore, detailScore } from "@/api/platform/check-score";
import { areaSelect } from '@/api/system/dept';
import {
  chartScore,
  getScore,
  delScore,
  addScore,
  updateScore,
  publishScore,
  detailScore
} from "@/api/platform/check-score";
import {areaSelect} from '@/api/system/dept';
import * as echarts from 'echarts';
let lineChart = null;
let observer = null;
export default {
  name: 'index',
  dicts: ['platform_examine_category','platform_is_publish'],
  dicts: ['platform_examine_category', 'platform_is_publish'],
  data() {
    return {
      activeIndex: '0',
@@ -114,7 +134,7 @@
        pageNum: 1,
        pageSize: 10,
        deptId: null,
        examineTag:0
        examineTag: 0
      },
      tableData: [],
      tableLoading: false,
@@ -126,7 +146,6 @@
  },
  created() {
    //考核成绩详情跳转参数接收
    console.log(this.$route.query.index)
    if (this.$route.query.index) {
      this.queryParams.deptId = this.$route.query.index
      this.queryParamsList.deptId = this.$route.query.index
@@ -136,24 +155,33 @@
    const month = (date.getMonth() + 1) >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1);
    this.date = year + '-' + month;
    this.queryParams.date = this.date;
    this.queryParams.examineTag =this.$route.query.examineTag;
    this.queryParamsList.examineTag =this.$route.query.examineTag;
    this.activeIndex = this.$route.query.examineTag;
    let examineTag = this.$route.query.examineTag;
    // if (examineTag === '2' || examineTag === '3') {
    //   examineTag = '1'
    // }
    // if (examineTag === '4' || examineTag === '5') {
    //   examineTag = '2'
    // }
    this.queryParams.examineTag = examineTag;
    this.queryParamsList.examineTag = examineTag;
    this.activeIndex = examineTag;
    this.areaSelect();
    this.getList(this.$route.query.index);
  },
  computed: {
  },
  computed: {},
  methods: {
    //发布
    handlePublish(row) {
      const getExamineCategoryText = category => {
        switch (category) {
          case 1: return '视频考核';
          case 2: return '车辆考核';
          case 3: return '人脸考核';
          default: return '未知';
          case 1:
            return '视频考核';
          case 2:
            return '车辆考核';
          case 3:
            return '人脸考核';
          default:
            return '未知';
        }
      };
@@ -199,7 +227,7 @@
    getChart(deptId) {
      this.loading = true;
      lineChart.showLoading();
      listScore(this.queryParams).then(response => {
      chartScore(this.queryParams).then(response => {
        this.initChart(response.data[deptId]);
        this.loading = false;
      });
@@ -219,12 +247,13 @@
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
    handleDetail(id) {
    handleDetail(row) {
      this.$router.push({
        path: '/check/detail/detail',
        query: {
          id: id,
          id: row.id,
          examineTag: this.activeIndex,
          examineCategory: row.examineCategory,
          deptId: this.queryParamsList.deptId
        }
      })
@@ -291,7 +320,7 @@
      if (!data) return this.getAllDay().map((item) => [item, []]);
      const tempGroup = {};
      data.forEach((item) => {
        let { createTime } = item;
        let {createTime} = item;
        let tempTime = createTime.split('-');
        createTime = tempTime[1] + '-' + tempTime[2];
        if (!tempGroup[createTime]) {
@@ -315,11 +344,14 @@
    },
    getAllDay() {
      // const date = new Date();
      // const year = date.getFullYear();
      // const month = (date.getMonth() + 1) >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1);
      // this.date = year + '-' + month;
      const currentDate = this.date.split('-');
      let date = this.date
      if(!this.date) {
        date = new Date();
        const year = date.getFullYear();
        const month = (date.getMonth() + 1) >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1);
        date = year + '-' + month;
      }
      const currentDate = date.split('-');
      const currentYear = currentDate[0];
      const currentMonth = currentDate[1];
      const daysInMonth = new Date(currentYear, currentMonth, 0).getDate();
@@ -349,7 +381,6 @@
    dateChange() {
      this.queryParams.date = this.date;
      console.log(this.queryParams);
      this.getChart(this.queryParams.deptId);
    }
@@ -365,10 +396,6 @@
      observer.unobserve(this.$refs.chartContent);
    }
  },
  handleSelect(key, keyPath) {
    console.log(key, keyPath);
  },
}
</script>