riku
2025-07-15 c40f4c1267dae4fcf27dbbd75ea83014fba87783
新增联合执法清单
已修改16个文件
已添加1个文件
465 ■■■■■ 文件已修改
index.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fysp/problemApi.js 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fysp/userApi.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fytz/userApi.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components.d.ts 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/CompGenericWrapper.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/FYImageSelectDialog.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/list-item/ItemSubTask.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/table/FYTable.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/excel.js 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/check/ProCheck.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/check/components/ArbitraryPhoto.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/check/components/CompProRecent.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/check/components/CompProblemAddOrUpd.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/data-product/ProdLawEnforceList.vue 288 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/data-product/ProdSceneReport.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
index.html
@@ -9,15 +9,14 @@
  <body>
    <div id="app"></div>
  </body>
  <script type="text/javascript">
  <!-- <script type="text/javascript">
    window._AMapSecurityConfig = {
      serviceHost: 'http://47.100.191.150:8083/_AMapService'
      //例如 ï¼šserviceHost:'http://1.1.1.1:80/_AMapService',
    };
  </script>
  <script
    type="text/javascript"
    src="https://webapi.amap.com/maps?v=1.4.5&key=520c5e5cf44c7793104e500cbf0ed711&plugin=Map3D,ElasticMarker,AMap.ControlBar,AMap.Geocoder"
  ></script>
  ></script> -->
  <script type="module" src="/src/main.js"></script>
</html>
src/api/fysp/problemApi.js
@@ -5,12 +5,30 @@
export default {
  /**
   * èŽ·å–å­ä»»åŠ¡é—®é¢˜è¯¦æƒ…
   */
  getProBySubtask(id) {
    return $fysp
      .get('problemlist/subtask', {
        params: {
          stGuid: id
        }
      })
      .then((res) => res.data);
  },
  /**
   * é—®é¢˜å®¡æ ¸
   * @param {Number} action 0:问题通过;1:问题不通过;2:整改通过;3整改不通过
   */
  checkProblem({ pId, action, remark = '', userId = id, userName = name }) {
    const params = `?pId=${pId}&action=${action}&remark=${remark}&userId=${userId}&userName=${userName}`;
    return $fysp.post(`problemlist/check${params}`).then((res) => res.data);
    // const params = `?pId=${pId}&action=${action}&remark=${remark}&userId=${userId}&userName=${userName}`;
    return $fysp
      .post(
        `problemlist/check`,
        {},
        { params: { pId, action, remark, userId, userName } }
      )
      .then((res) => res.data);
  },
  fetchProblemType({ cityCode, districtCode, sceneTypeId }) {
@@ -40,18 +58,18 @@
  },
  // æ–°å¢žé—®é¢˜
  newProblem(data) {
    return $fysp.post(`problemlist/newProblem`, data).then((res) => res)
    return $fysp.post(`problemlist/newProblem`, data).then((res) => res);
  },
  // ä¿®æ”¹æ•´æ”¹
  updateChange(data) {
    return $fysp.post(`problemlist/updateChange`, data).then((res) => res)
    return $fysp.post(`problemlist/updateChange`, data).then((res) => res);
  },
  // æ•´æ”¹ä¸Šä¼ 
  changeProblem(data) {
    return $fysp.post(`problemlist/changeProblem`, data).then((res) => res)
    return $fysp.post(`problemlist/changeProblem`, data).then((res) => res);
  },
  // é—®é¢˜åˆ é™¤
  deleteProblem({ pid }) {
    return $fysp.post(`problemlist/${pid}`).then((res) => res.data)
    return $fysp.post(`problemlist/${pid}`, {}).then((res) => res.data);
  }
}
};
src/api/fysp/userApi.js
@@ -28,7 +28,7 @@
   * è‡ªåŠ¨åˆ›å»ºè´¦æˆ·
   */
  autoCreateAccount(sId) {
    return $fysp.post(`userinfo/create?sceneId=${sId}`).then((res) => res.data);
    return $fysp.post(`userinfo/create?sceneId=${sId}`, {}).then((res) => res.data);
  },
  /**
   * èŽ·å–åœºæ™¯å¯¹åº”çš„é£žç¾½çŽ¯å¢ƒç³»ç»Ÿç”¨æˆ·id
src/api/fytz/userApi.js
@@ -45,7 +45,7 @@
   * é‡ç½®ç”¨æˆ·å¯†ç 
   */
  resetPassword(id) {
    return $fytz.post(`userInfo/resetPw?userId=${id}`).then((res) => res.data);
    return $fytz.post(`userInfo/resetPw?userId=${id}`, {}).then((res) => res.data);
  },
src/api/index.js
@@ -7,11 +7,13 @@
// let ip1_file = 'http://47.100.191.150:9005/';
let ip1 = 'https://fyami.com.cn:447/';
let ip1_file = 'https://fyami.com.cn:447/';
// let ip1 = 'https://fyami.com.cn:449/api/';
// let ip1_file = 'https://fyami.com.cn:449/api/';
let ip2 = 'https://fyami.com.cn/';
let ip2_file = 'https://fyami.com.cn/';
if (debug) {
  ip1 = 'http://192.168.0.110:9001/';
  ip1 = 'http://192.168.0.103:8080/';
  // ip1_file = 'http://192.168.0.138:8080/';
  // ip2 = 'http://192.168.0.138:8080/';
  // ip2_file = 'https://fyami.com.cn/';
src/components.d.ts
@@ -13,15 +13,19 @@
    CompGenericWrapper: typeof import('./components/CompGenericWrapper.vue')['default']
    CompQuickSet: typeof import('./components/search-option/CompQuickSet.vue')['default']
    Content: typeof import('./components/core/Content.vue')['default']
    ElAffix: typeof import('element-plus/es')['ElAffix']
    ElAside: typeof import('element-plus/es')['ElAside']
    ElAvatar: typeof import('element-plus/es')['ElAvatar']
    ElBadge: typeof import('element-plus/es')['ElBadge']
    ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
    ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
    ElButton: typeof import('element-plus/es')['ElButton']
    ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
    ElCalendar: typeof import('element-plus/es')['ElCalendar']
    ElCard: typeof import('element-plus/es')['ElCard']
    ElCascader: typeof import('element-plus/es')['ElCascader']
    ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
    ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
    ElCol: typeof import('element-plus/es')['ElCol']
    ElCollapse: typeof import('element-plus/es')['ElCollapse']
    ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
@@ -33,6 +37,9 @@
    ElDialog: typeof import('element-plus/es')['ElDialog']
    ElDivider: typeof import('element-plus/es')['ElDivider']
    ElDrawer: typeof import('element-plus/es')['ElDrawer']
    ElDropdown: typeof import('element-plus/es')['ElDropdown']
    ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
    ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
    ElEmpty: typeof import('element-plus/es')['ElEmpty']
    ElForm: typeof import('element-plus/es')['ElForm']
    ElFormItem: typeof import('element-plus/es')['ElFormItem']
@@ -42,13 +49,17 @@
    ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
    ElInput: typeof import('element-plus/es')['ElInput']
    ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
    ElLink: typeof import('element-plus/es')['ElLink']
    ElMain: typeof import('element-plus/es')['ElMain']
    ElMenu: typeof import('element-plus/es')['ElMenu']
    ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
    ElMenuItemGroup: typeof import('element-plus/es')['ElMenuItemGroup']
    ElOption: typeof import('element-plus/es')['ElOption']
    ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
    ElPagination: typeof import('element-plus/es')['ElPagination']
    ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
    ElPopover: typeof import('element-plus/es')['ElPopover']
    ElRadio: typeof import('element-plus/es')['ElRadio']
    ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
    ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
    ElRow: typeof import('element-plus/es')['ElRow']
@@ -67,6 +78,7 @@
    ElTag: typeof import('element-plus/es')['ElTag']
    ElText: typeof import('element-plus/es')['ElText']
    ElTooltip: typeof import('element-plus/es')['ElTooltip']
    ElTransfer: typeof import('element-plus/es')['ElTransfer']
    ElTree: typeof import('element-plus/es')['ElTree']
    ElUpload: typeof import('element-plus/es')['ElUpload']
    Footer: typeof import('./components/core/Footer.vue')['default']
src/components/CompGenericWrapper.vue
@@ -9,6 +9,7 @@
    destroy-on-close
    :draggable="draggable"
    :modal="modal"
    :append-to-body="appendToBody"
  >
    <div v-if="visible">
      <slot name="content"></slot>
@@ -45,6 +46,10 @@
  modal: {
    type: Boolean,
    default: true
  },
  appendToBody: {
    type: Boolean,
    default: true
  }
});
const typeOptions = ref([
src/components/FYImageSelectDialog.vue
@@ -39,7 +39,13 @@
    </el-row>
    <div class="center">
      <el-tabs v-if="typeList.length > 0" v-model="activeId" type="card">
      <el-scrollbar class="scrollbar-flex-content">
        <el-tabs
          v-if="typeList.length > 0"
          v-model="activeId"
          type="card"
          stretch
        >
        <el-tab-pane
          v-for="item in typeList"
          :key="item.typeId"
@@ -50,6 +56,7 @@
        >
        </el-tab-pane>
      </el-tabs>
      </el-scrollbar>
      <el-scrollbar height="70vh">
        <div
          v-if="typeImgMap.get(activeId) && typeImgMap.get(activeId).length > 0"
@@ -216,6 +223,10 @@
);
</script>
<style scoped>
.scrollbar-flex-content {
  display: flex;
  width: 100%;
}
.center {
  display: flex;
  flex-direction: column;
src/components/list-item/ItemSubTask.vue
@@ -60,7 +60,7 @@
</template>
<script setup>
import { ref, watch, computed } from 'vue';
import taskApi from '@/api/fysp/taskApi';
import problemApi from '@/api/fysp/problemApi';
import ProCheckProxy from '@/views/fysp/check/ProCheckProxy';
/**
@@ -128,7 +128,7 @@
function fetchProblems(subtask) {
  loading.value = true;
  taskApi
  problemApi
    .getProBySubtask(subtask.stguid)
    .then((res) => {
      proList.value = res;
src/components/table/FYTable.vue
@@ -28,6 +28,7 @@
    <slot name="options-expand2"></slot>
  </div>
  <el-table
    id="fyTable"
    ref="tableRef"
    :data="tableData"
    v-loading="loading"
@@ -78,6 +79,14 @@
    size: {
      type: String,
      default: 'default'
    },
    data: {
      type: Array,
      default: () => []
    },
    totalCount: {
      type: Number,
      default: 0
    }
  },
  data() {
@@ -110,13 +119,25 @@
        }
      },
      immediate: true
    },
    data(nValue, oValue) {
      if (nValue != oValue) {
        this.tableData = nValue;
      }
    },
    totalCount(nValue, oValue) {
      if (nValue != oValue) {
        this.total = nValue;
      }
    }
  },
  computed: {
    cTableHeight() {
      if (this.$refs.searchRef) {
        const h1 = this.$refs.searchRef.$el.offsetHeight;
        const h2 = this.$refs.paginationRef ? this.$refs.paginationRef.$el.offsetHeight : 0;
        const h2 = this.$refs.paginationRef
          ? this.$refs.paginationRef.$el.offsetHeight
          : 0;
        const h3 = this.$refs.expandRef.$el.offsetHeight;
        const h4 = this.$refs.expand2Ref.offsetHeight;
@@ -143,8 +164,14 @@
          pageSize: this.pageSize
        },
        (res) => {
          if (res) {
            if (res.data) {
          this.tableData = res.data;
          this.total = res.total ? res.total : 0;
            }
            if (res.total) {
              this.total = res.total;
            }
          }
          this.loading = false;
          this.doLayout();
        }
@@ -152,7 +179,9 @@
    },
    calcTableHeight() {
      const h1 = this.$refs.searchRef.$el.offsetHeight;
      const h2 = this.$refs.paginationRef ? this.$refs.paginationRef.$el.offsetHeight : 0;
      const h2 = this.$refs.paginationRef
        ? this.$refs.paginationRef.$el.offsetHeight
        : 0;
      const h3 = this.$refs.expandRef.$el.offsetHeight;
      const h4 = this.$refs.expand2Ref.offsetHeight;
src/utils/excel.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,48 @@
import * as XLSX from 'xlsx';
import FileSaver from 'file-saver';
function conversionFromTable(elementId, title) {
  // èŽ·å–è¡¨æ ¼å…ƒç´ 
  let list = document.getElementById(elementId);
  let tables = list.cloneNode(true); //克隆此元素,否则更改数据时会影响到原表格
  //如果表格中含有switch开关,放入以下代码,可转换状态会在Excel中显示,否则转换出来为空,不会在Excel中显示
  // const rows = tables.getElementsByTagName('tr');
  // for (let i = 1; i < rows.length; i++) {
  //   // ä»Ž1开始,以跳过表头
  //   const cells = rows[i].getElementsByTagName('td');
  //   for (let j = 0; j < cells.length; j++) {
  //     const cell = cells[j];
  //     // æ‰¾åˆ°å¼€å…³å…ƒç´ å¹¶èŽ·å–çŠ¶æ€
  //     const switchElement = cell.querySelector('input[type="checkbox"]');
  //     if (switchElement) {
  //       // æ ¹æ®å¼€å…³çŠ¶æ€è®¾ç½®å•å…ƒæ ¼å†…å®¹
  //       cells[j].innerText = switchElement.checked ? '关闭' : '开启';
  //     }
  //   }
  // }
  console.log(tables);
  //------放入以上拿到switch状态,以及下拉框代码,如果没克隆元素则会影响到原表格-------------//
  // å¯¼å‡ºè¡¨æ ¼
  var xlsxParam = { raw: true }; // å¯¼å‡ºçš„内容只做解析,不进行格式转换
  let table_book = XLSX.utils.table_to_book(tables, xlsxParam);
  const table_write = XLSX.write(table_book, {
    bookType: 'xlsx',
    bookSST: true,
    type: 'array'
  });
  try {
    FileSaver.saveAs(
      new Blob([table_write], { type: 'application/octet-stream' }),
      `${title}.xlsx` //修改名字
    );
    //这里可以放入你的回调函数
    alert('开始下载');
  } catch (e) {
    if (typeof console !== 'undefined') console.log(e, table_write);
  }
  return table_write;
}
export { conversionFromTable };
src/views/fysp/check/ProCheck.vue
@@ -81,6 +81,7 @@
<script>
import ArbitraryPhoto from './components/ArbitraryPhoto.vue';
import taskApi from '@/api/fysp/taskApi';
import problemApi from '@/api/fysp/problemApi';
import ProCheckProxy from './ProCheckProxy';
import CompProblemAddOrUpd from './components/CompProblemAddOrUpd.vue';
import CompProblemCard from './components/CompProblemCard.vue';
@@ -217,7 +218,7 @@
      this.sideLoading = false;
      this.mainLoading = true;
      // const controller = new AbortController();
      taskApi
      problemApi
        .getProBySubtask(s.data.stGuid)
        .then((res) => {
          this.curProList = res;
@@ -242,7 +243,7 @@
      this.sideLoading = false;
      setTimeout(() => {
        this.mainLoading = true;
        taskApi
        problemApi
          .getProBySubtask(this.curSubtask.data.stGuid)
          .then((res) => {
            if (refresh) {
src/views/fysp/check/components/ArbitraryPhoto.vue
@@ -218,7 +218,7 @@
      canvas.width = img.naturalWidth;
      canvas.height = img.naturalHeight;
      ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
      // this.copyCanvasToClipboard(canvas);
      this.copyCanvasToClipboard(canvas);
      const dataUrl = canvas.toDataURL('image/png'); // å¯ä»¥é€‰æ‹©å…¶ä»–格式如'image/jpeg'
      // åˆ›å»ºä¸€ä¸ªä¸´æ—¶çš„textarea元素来复制文本
      const tempTextArea = document.createElement('textarea');
src/views/fysp/check/components/CompProRecent.vue
@@ -57,6 +57,7 @@
<script>
import CompProblemAddOrUpd from './CompProblemAddOrUpd.vue';
import taskApi from '@/api/fysp/taskApi';
import problemApi from '@/api/fysp/problemApi';
import { useCloned } from '@vueuse/core';
import dayjs from 'dayjs';
export default {
@@ -180,7 +181,7 @@
    },
    // æ ¹æ®å­ä»»åŠ¡èŽ·å–é‡Œé¢çš„é—®é¢˜åˆ—è¡¨
    getProBySubtask(subtask) {
      return taskApi.getProBySubtask(subtask.stGuid).then((pros) => {
      return problemApi.getProBySubtask(subtask.stGuid).then((pros) => {
        if (pros) {
          pros.forEach((pro) => {
            if (pro.ptguid == this.deepCopyPro.ptguid) {
src/views/fysp/check/components/CompProblemAddOrUpd.vue
@@ -1,5 +1,5 @@
<template>
  <CompGenericWrapper type="dialog">
  <CompGenericWrapper type="dialog" append-to-body>
    <template #content>
      <div class="main-container">
        <el-form
src/views/fysp/data-product/ProdLawEnforceList.vue
@@ -1,12 +1,12 @@
<template>
  <FYTable
    @search="onSearch"
    :data="tableData"
    :pagination="false"
    ref="tableRef"
    @cell-click="cellClick"
    :cell-class-name="cellClassName"
    @table-paste="handlePaste"
    @sort-change="handleSortChange"
  >
    <template #options>
      <!-- åŒºåŽ¿ -->
@@ -34,18 +34,36 @@
      <el-form :inline="true">
        <CompQuickSet @quick-set="setOptions"></CompQuickSet>
      </el-form>
      <el-descriptions v-if="this.tableData.length > 0" title="" :column="1" direction="vertical" border>
      <el-descriptions
        v-if="this.tableData.length > 0"
        title=""
        :column="1"
        direction="vertical"
        border
      >
        <el-descriptions-item label="联合执法清单">
          {{ listSummary }}
        </el-descriptions-item>
      </el-descriptions>
    </template>
    <template #buttons>
      <el-button
        icon="Download"
        type="primary"
        plain
        @click="download"
        :loading="dlLoading"
        :disabled="downloadDisabled"
        >下载清单</el-button
      >
    </template>
    <template #table-column="{ size }">
      <el-table-column fixed="left" label="序号" width="80">
      <el-table-column fixed="left" label="序号" width="53">
        <template #default="{ row }">
          {{ row.index + 1 }}
        </template>
      </el-table-column>
      <el-table-column fixed="left" label="编号" width="53" prop="sceneIndex">
      </el-table-column>
      <el-table-column
        prop="sceneName"
@@ -53,6 +71,23 @@
        label="名称"
        width="300"
      >
      </el-table-column>
      <el-table-column prop="evaluation.scenseaddress" label="地址" />
      <el-table-column prop="_problems" label="问题" width="300">
        <template #default="{ row }">
          <el-icon class="is-loading" v-if="row._loading">
            <Loading color="#409eff" />
          </el-icon>
          <div v-else>
            <template v-if="row._problems.length > 0">
              <div v-for="(p, i) in row._problems" :key="p.guid">
                <el-text>{{ i + 1 }}、</el-text>
                <el-text>{{ p.problemname }}</el-text>
              </div>
            </template>
            <el-text v-else>/</el-text>
          </div>
        </template>
      </el-table-column>
      <!-- <el-table-column
          prop="subTaskTime"
@@ -65,8 +100,15 @@
        prop="evaluation.resultscorebef"
        label="得分"
        width="90"
        sortable="custom"
      /> -->
      <el-table-column prop="" label="监测数据" width="81">
        <template #default="{ row }">
          <el-icon class="is-loading" v-if="row._loading">
            <Loading color="#409eff" />
          </el-icon>
          <el-text v-else>/</el-text>
        </template>
      </el-table-column>
      <!-- <el-table-column
          prop="evaluation.resultscorebef"
          label="环信码"
@@ -80,14 +122,23 @@
        </el-table-column> -->
      <el-table-column prop="dname" label="区县" width="90" />
      <el-table-column
        prop="tname"
        label="街道"
        width="110"
        :filters="townFilters"
        :filter-method="filterHandler"
      />
      <el-table-column prop="evaluation.scenseaddress" label="地址" />
      <el-table-column prop="tname" label="街道" width="110" />
      <el-table-column prop="_contacts" label="联系人" width="70">
        <template #default="{ row }">
          <el-icon class="is-loading" v-if="row._loading2">
            <Loading color="#409eff" />
          </el-icon>
          <el-text v-else>{{ row._contacts }}</el-text>
        </template>
      </el-table-column>
      <el-table-column prop="_contactst" label="联系电话" width="112">
        <template #default="{ row }">
          <el-icon class="is-loading" v-if="row._loading2">
            <Loading color="#409eff" />
          </el-icon>
          <el-text v-else>{{ row._contactst }}</el-text>
        </template>
      </el-table-column>
      <!-- <el-table-column prop="biArea" label="集中区" width="110" />
        <el-table-column prop="biManagementCompany" label="物业" min-width="110"/> -->
      <!-- <el-table-column fixed="right" align="right" label="操作" width="160">
@@ -107,10 +158,15 @@
 */
import dayjs from 'dayjs';
import evaluateApi from '@/api/fysp/evaluateApi';
import problemApi from '@/api/fysp/problemApi';
import sceneApi from '@/api/fysp/sceneApi';
import { conversionFromTable } from "@/utils/excel";
import { envCreditCode } from '@/constants/index';
import { useTablePaste } from '@/composables/tablePaste';
import { useCloned } from '@vueuse/core';
import { useMessageBoxTip } from '@/composables/messageBox';
import * as XLSX from 'xlsx';
import FileSaver from 'file-saver';
export default {
  setup() {
@@ -144,20 +200,7 @@
      townFilters: [],
      // åŽŸå§‹æ•°æ®ï¼Œç”¨äºŽæŽ’åºå–æ¶ˆåŽ
      orginData: [],
      evaluationRule: undefined,
      evaluationSubRule: undefined,
      //监测数据规则名称
      ruleName: {
        score1: {
          id: undefined,
          name: '监测数据出现单日及以上有效超标'
        },
        score2: {
          id: undefined,
          name: '监测数据月均值超区域月均值20%以上或数据明显异常'
        }
      },
      updateLoading: false
      dlLoading: false
    };
  },
  computed: {
@@ -185,22 +228,20 @@
      } else {
        return ``;
      }
    },
    downloadDisabled() {
      if (this.tableData.length == 0) {
        return true;
      } else {
        let b = false;
        this.tableData.forEach((e) => {
          b = b || e._loading || e._loading2;
        });
        return b;
      }
    }
  },
  methods: {
    // _getParam() {
    //   const { locations, scenetype, time } = this.formSearch;
    //   return {
    //     provincecode: locations.pCode,
    //     provincename: locations.pName,
    //     citycode: locations.cCode,
    //     cityname: locations.cName,
    //     districtcode: locations.dCode,
    //     districtname: locations.dName,
    //     starttime: dayjs(time).format('YYYY-MM-DD HH:mm:ss'),
    //     scensetypeid: scenetype.value
    //   };
    // },
    editRow(row) {
      this.$router.push(`evalutationEdit/${row.subTaskId}`);
    },
@@ -212,78 +253,60 @@
    },
    onSearch(page, func) {
      this.$refs.tableRef.clearSort();
      this.fetchEvaluationRule(this.area).then(() => {
      // this.fetchEvaluationRule(this.area).then(() => {
        evaluateApi.fetchAutoEvaluation(this.area).then((res) => {
          if (res.data) {
            this.tableData = res.data
              .filter((d) => {
                return d.evaluation != null;
              })
              .slice(0, 10);
            this.tableData.sort((a, b) => {
              const s1 = a.evaluation
                ? parseInt(a.evaluation.resultscorebef)
                : 0;
              const s2 = b.evaluation
                ? parseInt(b.evaluation.resultscorebef)
                : 0;
          res.data.sort((a, b) => {
            const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0;
            const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0;
              return s1 - s2;
            });
            this.orginData = useCloned(this.tableData).cloned;
            this.getFilters(res.data);
          this.tableData = res.data
            .filter((d) => {
              return (
                d.evaluation != null &&
                parseInt(d.evaluation.resultscorebef) < 90
              );
            })
            .slice(0, 10);
          this.tableData.forEach((e) => {
            e._loading = true;
            problemApi
              .getProBySubtask(e.subTaskId)
              .then((res) => {
                e._problems = res;
              })
              .finally(() => {
                e._loading = false;
              });
            e._loading2 = true;
            sceneApi
              .getSceneDetail(e.sceneId)
              .then((res) => {
                //场景
                if (res.data.scense) {
                  e._contacts = res.data.scense.contacts;
                  e._contactst = res.data.scense.contactst;
                }
              })
              .finally(() => {
                e._loading2 = false;
              });
          });
          // this.orginData = useCloned(this.tableData).cloned;
            if (typeof func === 'function') {
              func({ data: this.tableData });
            func();
            }
          } else {
            this.tableData = [];
            this.orginData = [];
          // this.orginData = [];
            if (typeof func === 'function') {
              func({ data: this.tableData });
            func();
            }
          }
        });
      });
    },
    fetchEvaluationRule() {
      const param = {
        // è‡ªåŠ¨è¯„ä¼°ç±»åž‹
        taskTypeId: 99,
        ...this.area
      };
      // èŽ·å–è¯„ä¼°æ€»è§„åˆ™
      return evaluateApi.fetchEvaluationRule(param).then((res) => {
        if (res.data.length > 0) {
          this.evaluationRule = res.data[0];
          // èŽ·å–å…·ä½“å­è§„åˆ™
          return evaluateApi
            .getSubRules(this.evaluationRule.guid)
            .then((res) => {
              this.evaluationSubRule = res.data;
              // æŸ¥æ‰¾å¯å¯¼å…¥å¾—分的规则id
              for (const key in this.ruleName) {
                const value = this.ruleName[key];
                const subrule = this.evaluationSubRule.find((v) => {
                  return v.itemname == value.name;
                });
                if (subrule) {
                  value.id = subrule.guid;
                }
              }
            });
        }
      });
    },
    getFilters(data) {
      const townList = [];
      data.forEach((e) => {
        if (townList.indexOf(e.tname) == -1) {
          townList.push(e.tname);
        }
      });
      this.townFilters = townList.map((v) => {
        return { text: v, value: v };
      });
      // });
    },
    toCode(row, column) {
      if (row.evaluation) {
@@ -304,54 +327,23 @@
      const property = column['property'];
      return row[property] === value;
    },
    sortScore(a, b) {
      const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0;
      const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0;
      return s1 - s2;
    },
    handleSortChange({ column, prop, order }) {
      console.log(column, prop, order);
      if (order == null) {
        this.orginData.forEach((e, i) => {
          this.tableData[i] = e;
        });
      } else if (prop == 'evaluation.resultscorebef') {
        this.tableData.sort((a, b) => {
          const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0;
          const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0;
          if (order == 'ascending') {
            return s1 - s2;
          } else if (order == 'descending') {
            return s2 - s1;
          }
        });
      } else if (prop == 'sceneIndex') {
        this.tableData.sort((a, b) => {
          if (order == 'ascending') {
            if (a.sceneIndex === b.sceneIndex) {
              return a.subTaskTime > b.subTaskTime ? 1 : -1;
            } else {
              return a.sceneIndex - b.sceneIndex;
            }
          } else if (order == 'descending') {
            if (a.sceneIndex === b.sceneIndex) {
              return b.subTaskTime > a.subTaskTime ? 1 : -1;
            } else {
              return b.sceneIndex - a.sceneIndex;
            }
          }
        });
      } else if (prop == 'subTaskTime') {
        this.tableData.sort((a, b) => {
          if (order == 'ascending') {
            return a[prop] > b[prop] ? 1 : -1;
            // return dayjs(a).isAfter(dayjs(b)) ? 1 : -1;
          } else if (order == 'descending') {
            return b[prop] > a[prop] ? 1 : -1;
            // return dayjs(b).isAfter(dayjs(a)) ? 1 : -1;
          }
        });
      }
    download() {
      // const workbook = XLSX.utils.book_new();
      // const worksheet = XLSX.utils.json_to_sheet(this.tableData);
      // XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
      // const excelData = XLSX.write(workbook, {
      //   bookType: 'xlsx',
      //   type: 'array'
      // });
      // const blob = new Blob([excelData], {
      //   type: 'application/vnd.openxmlformats-officedocumnet.spreadsheetml.sheet'
      // });
      const { locations, scenetype, time } = this.formSearch;
      const name = `${locations.dName}${dayjs(time).format(
        'YYYYå¹´MM月'
      )}联合执法清单.xlsx`;
      // FileSaver.saveAs(blob, name);
      conversionFromTable('fyTable', name)
    }
  },
  mounted() {
src/views/fysp/data-product/ProdSceneReport.vue
@@ -107,6 +107,7 @@
import { ref, computed } from 'vue';
import { $fysp } from '@/api/index';
import problemApi from '@/api/fysp/problemApi';
import taskApi from '@/api/fysp/taskApi';
import sceneApi from '@/api/fysp/sceneApi';
import deviceApi from '@/api/fysp/deviceApi';
@@ -317,7 +318,7 @@
function fetchProblems(s) {
  curProList.value = [];
  taskApi.getProBySubtask(s.data.stGuid).then((res) => {
  problemApi.getProBySubtask(s.data.stGuid).then((res) => {
    curProList.value = res;
    // ç”Ÿæˆå·¡æŸ¥æè¿°æ–‡æœ¬