riku
2026-04-02 3282e95db0207ee133d1e98d9771dec9d83b0fc4
2026.4.2 新增专题管理功能
已修改27个文件
已添加6个文件
732 ■■■■ 文件已修改
behaviors/picker/scene/template-scene.wxml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/enterprise-rank-result/index.wxml 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/enterprise-rank-result/index.wxss 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/filter/index.wxml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/gallery/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/gallery/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/gallery/index.wxss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/picker/location-picker/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/picker/location-picker/index.wxss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/index.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/ledger/ledgerSummary.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/enterprise/detail/components/ledger-stat/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/enterprise/detail/components/ledger-stat/index.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/enterprise/detail/index.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/enterprise/detail/index.wxml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/problems-proxy.js 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/selfpatrol/components/patrol-record/index.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/selfpatrol/components/patrol-record/index.wxml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/selfpatrol/components/patrol-record/index.wxss 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/selfpatrol/publish/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/supervision/index.js 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/supervision/index.json 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/supervision/index.wxml 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/supervision/index.wxss 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/supervision/rank-result-proxy.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/supervision/rank-result.wxml 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/supervision/rank-result.wxss 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/supervision/topic-proxy.js 241 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/supervision/topic.wxml 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/supervision/topic.wxss 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
project.config.json 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
project.private.config.json 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
services/config/fetchConfig.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
behaviors/picker/scene/template-scene.wxml
@@ -1,5 +1,8 @@
<!-- <template name="scene-picker"> -->
<import src="/behaviors/picker/template-selector.wxml" />
<block wx:if="{{sceneMode == 0}}">
  <template is="picker-selector" data="{{key: 'scene', value: sceneText}}" />
  <t-picker
    visible="{{sceneVisible}}"
    value="{{sceneValue}}"
components/enterprise-rank-result/index.wxml
@@ -1,47 +1,23 @@
<view class="enterprise-info__wrap" bind:tap="handCellClick">
<view class="enterprise-info__wrap">
  <view class="enterprise-info__top" bind:tap="handCellClick">
  <view slot="image" class="enterprise-info__img">
    <view class="enterprise-info__img__score"> {{item.score}} </view>
    <view class="enterprise-info__img__text"> è‡ªè¯„ </view>
    <t-tag
      max-width="{{130}}"
      shape="square"
      size="small"
      theme="default"
      variant="light-outline"
      >{{item.updateTime}}</t-tag
    >
      <t-tag max-width="{{130}}" shape="square" size="small" theme="default" variant="light-outline">{{item.updateTime}}
      </t-tag>
  </view>
  <view class="enterprise-info__main">
    <view slot="title" class="enterprise-info__title"> {{item.name}} </view>
    <t-divider />
    <view slot="description" class="enterprise-info__tag">
      <t-tag
        max-width="{{130}}"
        shape="square"
        size="small"
        theme="success"
        variant="light-outline"
        disabled
        >运营中</t-tag
      >
      <t-tag
        t-class="t-class-tag"
        max-width="{{130}}"
        shape="square"
        size="medium"
        theme="default"
        variant="light"
        >{{item.district}}</t-tag
      >
      <t-tag
        t-class="t-class-tag"
        max-width="{{130}}"
        shape="square"
        size="medium"
        theme="default"
        variant="light"
        >{{item.sceneType}}</t-tag
      >
        <t-tag max-width="{{130}}" shape="square" size="small" theme="success" variant="light-outline" disabled>运营中
        </t-tag>
        <t-tag t-class="t-class-tag" max-width="{{130}}" shape="square" size="medium" theme="default" variant="light">
          {{item.district}}</t-tag>
        <t-tag t-class="t-class-tag" max-width="{{130}}" shape="square" size="medium" theme="default" variant="light">
          {{item.sceneType}}</t-tag>
    </view>
  </view>
</view>
  <slot></slot>
</view>
components/enterprise-rank-result/index.wxss
@@ -5,13 +5,16 @@
  box-shadow: var(--td-shadow-4);
  padding: var(--td-spacer-1);
  margin-top: var(--td-spacer);
  display: flex;
}
.enterprise-info__wrap:active {
.enterprise-info__top:active {
  background-color: var(--td-gray-color-1);
}
.enterprise-info__top {
  display: flex;
}
.enterprise-info__img {
  display: block;
}
components/filter/index.wxml
@@ -1,6 +1,6 @@
<import src="/behaviors/picker/template-selector.wxml" />
<t-sticky>
<!-- <t-sticky> -->
  <view class="filter-wrap">
    <view class="filter-item" bind:tap="handleSort">
      <text style="color: {{sorts !== '' ? color : '' }}">评分</text>
@@ -33,7 +33,7 @@
  <view class="filter-wrap-2">
    <include src="/behaviors/picker/scene/template-scene.wxml" />
  </view>
</t-sticky>
<!-- </t-sticky> -->
<include src="/behaviors/picker/time/template-time.wxml" />
<!-- ç­›é€‰å¼¹æ¡† -->
components/gallery/index.js
@@ -55,6 +55,11 @@
    extClass: {
      type: String,
      value: ''
    },
    // æ˜¯å¦åº•部空出安全距离
    safeBottom :{
      type: Boolean,
      value: true
    }
  },
  data: {
components/gallery/index.wxml
@@ -1,6 +1,6 @@
<!--component/mygallery/mygallery.wxml-->
<page-container show="{{show}}">
  <view class="fyui-gallery {{show ? 'fyui-gallery_show' : ''}} {{extClass}}">
  <view class="fyui-gallery {{show ? 'fyui-gallery_show' : ''}} {{extClass}} {{safeBottom ? 'safe-bottom' : ''}}">
    <t-icon wx:if="{{showRemark}}" class="fyui-gallery__close" name="close" color="white" size="26" bindtap="hideGallery"></t-icon>
    <view class="fyui-gallery__info" wx:if="{{true}}">{{current+1}} / {{currentImgs.length}}</view>
    <swiper class="fyui-gallery__img__wrp" bindtap="toggle" indicator-dots="{{false}}" bindanimationfinish="change" current="{{current}}" autoplay="{{false}}" duration="{{500}}">
components/gallery/index.wxss
@@ -18,6 +18,10 @@
  flex-wrap: nowrap
}
.safe-bottom {
  bottom: calc(env(safe-area-inset-bottom) + 96rpx);
}
.fyui-gallery_show {
  display: flex
}
components/picker/location-picker/index.wxml
@@ -46,7 +46,7 @@
      data-key="province"
      bindtap="showCascader"
    >
      <text>{{_.defaultSelectOption(provinceText)}}</text>
      <text class="picker-selector__text">{{_.defaultSelectOption(provinceText)}}</text>
      <t-icon name="caret-down-small" size="36rpx" color="{{color}}" />
    </view>
    <view
components/picker/location-picker/index.wxss
@@ -15,7 +15,7 @@
  color: rgba(51, 51, 51, 1);
}
.picker-selector>text {
.picker-selector .picker-selector__text {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
config/index.js
@@ -1,6 +1,6 @@
// å®ˆæ³•自助小程序
const baseUrl = 'http://192.168.0.103:8082';
// const baseUrl = 'https://fyami.com.cn';
// const baseUrl = 'http://192.168.0.103:8082';
const baseUrl = 'https://fyami.com.cn';
// å®ˆæ³•自助小程序图片
const bu = 'https://fyami.com.cn';
model/ledger/ledgerSummary.js
@@ -44,6 +44,7 @@
      m.upload++;
    }
    m.children.push({
      subTypeId: s.ledgerSubTypeId,
      name: s.ledgerName,
      icon: s.iconUrl,
      upload: s.upLoad,
pages/enterprise/detail/components/ledger-stat/index.js
@@ -47,8 +47,13 @@
        });
      }
    },
    // å³ä¸Šè§’按钮点击事件
    noteClick() {
      this.triggerEvent('noteClick');
    },
    // å…·ä½“某个台账点击事件
    ledgerClick(e) {
      this.triggerEvent('ledgerClick', e.currentTarget.dataset.ledger);
    }
  },
});
pages/enterprise/detail/components/ledger-stat/index.wxml
@@ -67,6 +67,8 @@
              >
                <view
                  class="enterprise-info__ledger-wrap {{(child.upload || !child.needUpdate) ? 'enterprise-info__ledger-wrap__disable' : ''}}"
                  data-ledger="{{child}}"
                  bind:tap="ledgerClick"
                >
                  <view class="enterprise-info__ledger-item__left">
                    <text
pages/enterprise/detail/index.js
@@ -126,13 +126,21 @@
    }
  },
  navToLedger(e) {
  navToLedgerHistory(e) {
    const { mode } = e.currentTarget.dataset;
    wx.navigateTo({
      url: `/pages/enterprise/ledger/history/index?userId=${this.data.enterprise.id}&sceneTypeId=${this.data.enterprise.sceneTypeId}&time=${this.data.monthValue}&mode=${mode}`,
    });
  },
  navToLedgerDetail(e) {
    const ledger = e.detail;
    console.log('navToLedgerDetail', ledger);
    wx.navigateTo({
      url: `/pages/enterprise/ledger/detail/index`,
    });
  },
  navToPromise() {
    // wx.navigateTo({
    //   url: `/pages/enterprise/promise/history/index?userId=${this.data.enterprise.id}`,
pages/enterprise/detail/index.wxml
@@ -50,7 +50,8 @@
      loading="{{loadStatus == 1}}"
      value="{{selfCheckInfo}}"
      data-mode="1"
      bind:noteClick="navToLedger"
      bind:noteClick="navToLedgerHistory"
      bind:ledgerClick="navToLedgerDetail"
    ></t-ledger-stat>
    <t-ledger-stat
      title="台账管理"
@@ -58,7 +59,8 @@
      loading="{{loadStatus == 1}}"
      value="{{ledgerInfo}}"
      data-mode="2"
      bind:noteClick="navToLedger"
      bind:noteClick="navToLedgerHistory"
      bind:ledgerClick="navToLedgerDetail"
    ></t-ledger-stat>
    <t-assessment-stat
      title="自测自评"
pages/inspection/problems-proxy.js
@@ -25,7 +25,17 @@
        label: {
          show: true,
          position: 'inside',
          formatter: '{d}%',
          // formatter: '{d}%',
          formatter: function (params) {
            let perStr = params.percent + '';
            if (perStr.indexOf('.') != -1) {
              let percent = params.percent.toFixed(1); // ä¿ç•™ä¸¤ä½å°æ•°
              return `${percent}%`;
            } else {
              let percent = params.percent.toFixed(0);
              return `${percent}%`;
            }
          },
        },
      },
    ],
@@ -94,7 +104,7 @@
    },
    summaryAnalysis(data) {
      const {time, inspection: v} = this.data
      const { time, inspection: v } = this.data;
      // ç»„合行政区划
      let loc = '';
      loc += v.provinceName ? v.provinceName : '';
@@ -102,7 +112,7 @@
      loc += v.districtName ? `${v.districtName}` : '';
      loc += v.townName ? `${v.townName}` : '';
      // æ—¶é—´
      const timeText = dayjs(time).format('YYYYå¹´MM月')
      const timeText = dayjs(time).format('YYYYå¹´MM月');
      // æ€»ç»“
      let summaryText = '';
@@ -113,7 +123,9 @@
        totalC += p.changeCount;
      });
      const cPer = totalP == 0 ? '--' : Math.round((totalC / totalP) * 1000) / 10 + '%';
      summaryText = `${loc+timeText}共发现${data.length}种类型问题,问题总计${totalP}个,整改率${cPer}`;
      summaryText = `${loc + timeText}共发现${
        data.length
      }种类型问题,问题总计${totalP}个,整改率${cPer}`;
      this.setData({ summaryText });
    },
  },
pages/selfpatrol/components/patrol-record/index.js
@@ -13,6 +13,14 @@
    },
    item: {
      type: Object,
      observer(value) {
        if (value.path1 && value.path1.length > 0) {
          this.setData({
            picPath: value.path1[0],
            leftPic: value.path1.length - 1,
          });
        }
      },
    },
  },
@@ -20,7 +28,7 @@
   * ç»„件的初始数据
   */
  data: {
    indexText: '01.'
    indexText: '01.',
  },
  /**
pages/selfpatrol/components/patrol-record/index.wxml
@@ -19,7 +19,7 @@
      <text slot="error">未提交</text>
    </t-image>
    <block wx:else>
      <t-image
      <!-- <t-image
        wx:for="{{item.path1}}"
        wx:key="index"
        wx:for-item="urlItem"
@@ -30,7 +30,17 @@
        height="80rpx"
        shape="round"
        aria-label="{{item.ledgerName}}"
      /> -->
      <t-image
        t-class="t-class-image"
        src="{{picPath}}"
        mode="aspectFill"
        width="80rpx"
        height="80rpx"
        shape="round"
        aria-label="{{item.ledgerName}}"
      />
      <view wx:if="{{leftPic > 0}}" class="left-pic">+{{leftPic}}</view>
    </block>
  </view>
</view>
pages/selfpatrol/components/patrol-record/index.wxss
@@ -16,7 +16,7 @@
  position: relative;
}
.patrol-unfinished::after {
/* .patrol-unfinished::after {
  content: '';
  position: absolute;
  bottom: 0;
@@ -26,14 +26,14 @@
  border-right: var(--ei-triangle-border) solid var(--td-error-color-6);
  border-top: var(--ei-triangle-border) solid transparent;
  border-left: var(--ei-triangle-border) solid transparent;
}
} */
.patrol-finished {
  position: relative;
  opacity: 0.7;
}
.patrol-finished::after {
/* .patrol-finished::after {
  content: '';
  position: absolute;
  bottom: 0;
@@ -43,12 +43,14 @@
  border-right: var(--ei-triangle-border) solid var(--td-success-color-6);
  border-top: var(--ei-triangle-border) solid transparent;
  border-left: var(--ei-triangle-border) solid transparent;
}
} */
.patrol-record-text-wrap {
  width: 50%;
  display: flex;
  gap: 4px;
  align-items: baseline;
  flex: 1;
}
.patrol-record-img-wrap {
@@ -70,3 +72,17 @@
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: var(--td-font-size-s);
}
.left-pic {
  position: absolute;
  right: 4px;
  bottom: 4px;
  background-color: rgba(250, 250, 250, 0.705);
  border: 1px solid rgba(0, 0, 0, 0.452);
  border-radius: 6px;
  font-size: 12px;
  line-height: 12px;
  width: 14px;
  height: 14px;
  padding: 2px;
}
pages/selfpatrol/publish/index.wxml
@@ -140,7 +140,7 @@
        size="extra-small"
        bindtap="onSelfPatrolPickerChange"
      >
        <!-- {{selectedPatrolTypes[patrolPopupIndex].selectedCount > 0 ? '(' + selectedPatrolTypes[patrolPopupIndex].selectedCount + ')' : ''}} -->
        {{selectedPatrolTypes[patrolPopupIndex].selectedCount > 0 ? '(' + selectedPatrolTypes[patrolPopupIndex].selectedCount + ')' : ''}}
        ç¡®å®š
      </t-button>
    </view>
pages/supervision/index.js
@@ -1,11 +1,13 @@
// pages/supervision/index.js
import { useLoading } from '../../behaviors/loading';
import { useTopic } from './topic-proxy.js';
import { useRankResult } from './rank-result-proxy.js';
import { fetchGradeList } from '../../services/enterprise/fetchAssessment';
import { sceneTypeList } from '../../common/dataSceneTypes';
import dayjs from 'dayjs';
Page({
  behaviors: [useLoading],
  behaviors: [useLoading, useTopic, useRankResult],
  /**
   * é¡µé¢çš„初始数据
   */
@@ -49,21 +51,16 @@
  init() {
    this.optionsCount++;
    // åŒ…括时间、场景类型、区域三个选项,全部获取初始值后,执行加载
    if (this.optionsCount == 3) this._startLoad();
    if (this.optionsCount == 3) {
      // åˆå§‹åŒ–专题管理的选项
      this.initselectedTopics();
      this._startLoad();
    }
  },
  _fetchData(page) {
    let {
      province,
      city,
      district,
      town,
      area,
      management,
      sorts,
      sceneType,
      period,
    } = this.data.searchOptions;
    let { province, city, district, town, area, management, sorts, sceneType, period } =
      this.data.searchOptions;
    return fetchGradeList({
      page,
      data: {
@@ -78,10 +75,12 @@
        sceneTypes: [sceneType],
      },
    }).then(res => {
      const startIndex = page == 1 ? 0 : this.data.searchResult.length
      this.setData({
        searchResult:
          page == 1 ? res.data : this.data.searchResult.concat(res.data),
        searchResult: page == 1 ? res.data : this.data.searchResult.concat(res.data),
      });
      // èŽ·å–ä¸“é¢˜ç›¸å…³çš„å°è´¦ä¿¡æ¯
      this.fetchTopicLedgers(startIndex);
      return res.head;
    });
  },
@@ -100,8 +99,10 @@
    const { timeValue } = e.detail;
    const p = dayjs(timeValue);
    const period = `${p.year()}/${p.month() + 1}-${p.month() + 1}`;
    const time = p.format('YYYY-MM-DD');
    this.setData({
      ['searchOptions.period']: period,
      ['searchOptions.time']: time,
    });
  },
  initTime(e) {
@@ -126,6 +127,8 @@
  },
  handleScenePickerChange(e) {
    this.setSceneValue(e);
    // åˆå§‹åŒ–专题管理的选项
    this.initselectedTopics();
    this._startLoad();
  },
@@ -144,14 +147,7 @@
  setPopupValue(e) {
    const { searchOptions } = this.data;
    const {
      provinceText,
      cityText,
      districtText,
      townText,
      areaText,
      managementText,
    } = e.detail;
    const { provinceText, cityText, districtText, townText, areaText, managementText } = e.detail;
    searchOptions.province = provinceText;
    searchOptions.city = cityText;
    searchOptions.district = districtText;
pages/supervision/index.json
@@ -10,6 +10,8 @@
    "load-more": "/components/load-more/index",
    "t-empty-page": "/components/empty-page/index",
    "enterprise-rank-result": "/components/enterprise-rank-result/index",
    "scene-picker": "/components/scene-picker/index"
    "scene-picker": "/components/scene-picker/index",
    "patrol-record": "../selfpatrol/components/patrol-record/index",
    "my-gallery": "/components/gallery/index"
  }
}
pages/supervision/index.wxml
@@ -5,37 +5,22 @@
    <view class="supervision-search" bind:tap="navToSearchPage">
      <t-search placeholder="{{placeholder}}" leftIcon="search" disabled> </t-search>
    </view>
    <filter
      sceneMode="{{1}}"
      bind:sortsChange="handleSortsChange"
      bind:timeInitValue="initTime"
      bind:timePickerChange="handleTimePickerChange"
      bind:sceneInitValue="initScene"
      bind:scenePickerChange="handleScenePickerChange"
      bind:showFilterPopup="showFilterPopup"
    >
      <filter-popup-2
        slot="filterPopup"
        show="{{show}}"
        bind:showFilterPopupClose="showFilterPopupClose"
        bind:initValue="initPopup"
        bind:reset="onPopupSearch"
        bind:confirm="onPopupSearch"
      >
    <t-sticky>
      <filter sceneMode="{{1}}" bind:sortsChange="handleSortsChange" bind:timeInitValue="initTime"
        bind:timePickerChange="handleTimePickerChange" bind:sceneInitValue="initScene"
        bind:scenePickerChange="handleScenePickerChange" bind:showFilterPopup="showFilterPopup">
        <filter-popup-2 slot="filterPopup" show="{{show}}" bind:showFilterPopupClose="showFilterPopupClose"
          bind:initValue="initPopup" bind:reset="onPopupSearch" bind:confirm="onPopupSearch">
      </filter-popup-2>
    </filter>
      <include src="./topic.wxml" />
    </t-sticky>
  </view>
  <view class="page-container">
    <template is="pulldown-loading" wx:if="{{pageLoading && searchResult.length != 0}}" />
    <block wx:if="{{searchResult.length > 0}}">
      <enterprise-rank-result
        wx:for="{{searchResult}}"
        wx:key="index"
        wx:for-index="index"
        result="{{item}}"
        bind:click="handCellClick"
      ></enterprise-rank-result>
      <include src="./rank-result.wxml" />
    </block>
    <t-empty-page wx:elif="{{!pageLoading}}" description="无自评记录" />
    <load-more list-is-empty="{{!searchResult.length}}" status="{{loadStatus}}" bind:retry="_startLoad" />
pages/supervision/index.wxss
@@ -1,4 +1,7 @@
/* pages/supervision/index.wxss */
@import './topic.wxss';
@import './rank-result.wxss';
.page .page-header {
  /* background: linear-gradient(var(--td-primary-color-7), var(--td-primary-color-4));
  min-height: 380rpx;
@@ -13,6 +16,13 @@
  padding-top: 1px;
}
.supervision__loading{
  display: flex;
  justify-content: center;
  align-items: center;
  height: 50rpx;
}
.fy-loading {
  text-align: center;
  background-color: transparent;
pages/supervision/rank-result-proxy.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
/**
 * æŽ’名列表
 */
export const useRankResult = Behavior({
  data: {},
  methods: {
    ledgerClick() {},
    previewImage(e) {
      const { index1, index2 } = e.currentTarget.dataset;
      const ledger = this.data.searchResult[index1].topics[index2].detail;
      if (ledger.ledgerFinished) {
        const previewTitle = ledger.ledgerName;
        const previewRemark = ledger.remark1;
        const previewImageUrls = ledger.path1;
        this.setData({
          previewImageUrls,
          previewRemark,
          previewTitle,
          previewCurrent: 0,
          showPreview: true,
        });
      }
    },
  },
});
pages/supervision/rank-result.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,48 @@
<wxs src="../enterprise/detail/components/utils.wxs" module="_" />
<enterprise-rank-result wx:for="{{searchResult}}" wx:key="index" wx:for-index="index" result="{{item}}"
 bind:click="handCellClick">
 <view wx:if="{{item.topicLoading}}" class="supervision__loading">
  <t-loading theme="dots" size="50rpx" />
 </view>
 <block wx:elif="{{item.topics.length > 0}}">
  <t-divider />
  <!-- <view wx:for="{{item.topics}}" wx:key="index2" wx:for-item="item2" wx:for-index="index2">
   {{item2.ledgerName}}
  </view> -->
  <t-collapse default-expand-all>
   <t-collapse-panel header="台账上传情况" value="0" t-class-header="t-class-collapse-panel-header"
    t-class-content="t-class-collapse-panel-content" expandIcon
    style="--td-cell-title-color: var(--td-text-color-primary)">
    <view slot="content">
     <block wx:for="{{item.topics}}" wx:for-index="index2" wx:key="index2" wx:for-item="item2">
      <!-- <view
       class="enterprise-info__ledger-wrap {{(item2.upload || !item2.needUpdate) ? 'enterprise-info__ledger-wrap__disable' : ''}}"
       data-ledger="{{item2}}" bind:tap="ledgerClick"> -->
      <patrol-record item="{{item2.detail}}" index="{{index2}}" data-index1="{{index}}" data-index2="{{index2}}"
       bindtap="previewImage">
      </patrol-record>
      <!-- <view class="enterprise-info__ledger-item__left">
        <text style="color: {{item2.needUpdate ? ' var(--td-error-color);' : 'transparent;'}}">*</text>
        {{item2.ledgerName}}
       </view>
       <view class="enterprise-info__ledger-item__right">
        {{item2.upload ? '✓' : '✗'}}
       </view>
       <view class="enterprise-info__ledger-item__right">
        {{item2.onTime ? '准时' : (item2.upload ? '超时' : '-')}}
       </view> -->
      <!-- </view> -->
      <t-divider />
     </block>
    </view>
   </t-collapse-panel>
  </t-collapse>
 </block>
</enterprise-rank-result>
<my-gallery safeBottom="{{true}}" hide-on-click="{{true}}" show-delete="{{false}}" show="{{showPreview}}"
 img-urls="{{previewImageUrls}}" current="{{previewCurrent}}" title="{{previewTitle}}" remark="{{previewRemark}}">
</my-gallery>
pages/supervision/rank-result.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,43 @@
.enterprise-info__ledger-wrap {
 display: flex;
 /* color: var(--td-error-color); */
 font-size: var(--td-font-size-base);
}
.enterprise-info__ledger-wrap__disable {
 color: var(--td-text-color-disabled);
}
.enterprise-info__ledger-wrap__header {
 color: var(--td-text-color-secondary);
 /* border-bottom: 1rpx solid var(--td-gray-color-1); */
 margin-bottom: var(--td-spacer);
}
.enterprise-info__ledger-wrap .enterprise-info__ledger-item__left,
.enterprise-info__ledger-item__right {
 display: flex;
 align-items: center;
 margin-right: 2px;
 flex: 3;
}
.enterprise-info__ledger-item__right {
 justify-content: center;
 flex: 1;
}
.t-class-divider {
 margin: 0 !important;
}
.t-class-collapse-panel-header {
 padding: 0 !important;
 padding-top: var(--td-spacer) !important;
 padding-bottom: var(--td-spacer) !important;
 /* font-weight: 600 !important; */
}
.t-class-collapse-panel-content {
 padding: 0 !important;
}
pages/supervision/topic-proxy.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,241 @@
import { fetchLedgerType } from '../../services/enterprise/fetchLedger';
import { fetchLedgerDetail } from '../../services/enterprise/fetchLedger';
import { toLabel } from '../../common/dataSceneTypes';
/**
 * å°è´¦ä¸“题管理
 */
export const useTopic = Behavior({
  data: {
    // ä¸“题选择弹出框
    popupVisible: false,
    // æŒ‰åœºæ™¯ç±»åž‹åˆ†ç±»çš„台账选择情况
    selectedTopics: {},
    // ä¸“题对应的台账信息加载状态
    topicLoading: false,
  },
  methods: {
    /**
     * åˆå§‹åŒ–当前场景类型下的可选台账选项,
     * åˆå§‹åŒ–默认选择的专题(台账类型),
     * @param {Function} callback å¯é€‰çš„回调函数
     */
    initselectedTopics(callback) {
      const { selectedTopics } = this.data;
      const { sceneType } = this.data.searchOptions;
      if (selectedTopics[sceneType] == undefined || selectedTopics[sceneType].length == 0) {
        fetchLedgerType({ sceneType: parseInt(sceneType) }).then(res => {
          // é€‰æ‹©å‰ä¸‰ä¸ªå°è´¦ä¸ºé»˜è®¤ä¸“题
          let count = 3;
          for (let i = 0; i < 3; i++) {
            if (i >= res.length) break;
            res[i].selected = {
              color: 'green',
              count: '✓',
              shape: 'square',
            };
          }
          selectedTopics[sceneType] = {
            sceneType,
            sceneTypeText: toLabel(sceneType),
            topicText: '请选择专题',
            allLedgerTypes: res,
            selectedLedgers: [],
            checkAll: false,
            selectedCount: 0,
          };
          this.setData({ selectedTopics });
          this.refreshSelectedLedger();
          if (typeof callback === 'function') {
            callback();
          }
        });
      } else {
        if (typeof callback === 'function') {
          callback();
        }
      }
    },
    // æ˜¾ç¤ºå¼¹å‡ºæ¡†
    showPopUp() {
      this.initselectedTopics(() => this.setData({ popupVisible: true }));
    },
    // ç›‘听弹出框状态变化,例如通过点击外部遮罩层关闭弹出框时
    onPopupVisibleChange(e) {
      const { visible } = e.detail;
      this.setData({ popupVisible: visible });
      if (!visible) {
        this.closePatrolList();
      }
    },
    // å–消并关闭台账类别选择弹出框
    closePatrolList() {
      const { selectedTopics } = this.data;
      const { sceneType } = this.data.searchOptions;
      const { allLedgerTypes, selectedLedgers } = selectedTopics[sceneType];
      allLedgerTypes.forEach(p => {
        if (selectedLedgers.indexOf(p.ledgerSubTypeId) == -1) {
          p.selected = false;
        } else {
          p.selected = {
            color: 'green',
            count: '✓',
            shape: 'square',
          };
        }
      });
      this.setData({
        [`selectedTopics.${sceneType}.allLedgerTypes`]: allLedgerTypes,
        popupVisible: false,
      });
      this._isCheckAll();
    },
    // é€‰æ‹©å°è´¦ç±»åˆ«
    choseLedgerType(e) {
      const { index } = e.currentTarget.dataset;
      const { selectedTopics } = this.data;
      const { sceneType } = this.data.searchOptions;
      const { allLedgerTypes, selectedLedgers } = selectedTopics[sceneType];
      let { selected, ledgerSubTypeId } = allLedgerTypes[index];
      if (selected) {
        selected = null;
      } else {
        selected = {
          color: 'green',
          count: '✓',
          shape: 'square',
        };
      }
      this.setData({
        [`selectedTopics.${sceneType}.allLedgerTypes[${index}].selected`]: selected,
      });
      this._isCheckAll();
    },
    // å…¨é€‰
    onCheckAll(e) {
      const { checked } = e.detail;
      const { selectedTopics } = this.data;
      const { sceneType } = this.data.searchOptions;
      const { allLedgerTypes } = selectedTopics[sceneType];
      allLedgerTypes.forEach(p => {
        if (checked) {
          p.selected = {
            color: 'green',
            count: '✓',
            shape: 'square',
          };
        } else {
          p.selected = null;
        }
      });
      this.setData({ [`selectedTopics.${sceneType}.allLedgerTypes`]: allLedgerTypes });
      this._isCheckAll();
    },
    /**
     * å…¨é€‰åˆ¤æ–­
     * æ ¹æ®ç”¨æˆ·é€‰æ‹©çš„æƒ…况,判断是否已经全选,更新全选变量状态
     */
    _isCheckAll() {
      const { selectedTopics } = this.data;
      const { sceneType } = this.data.searchOptions;
      const { allLedgerTypes } = selectedTopics[sceneType];
      // åˆ¤æ–­æ˜¯å¦å…¨é€‰ä¸­
      const p = allLedgerTypes.filter(v => {
        return v.selected == undefined || v.selected == null || v.selected == false;
      });
      this.setData({
        [`selectedTopics.${sceneType}.selectedCount`]: allLedgerTypes.length - p.length,
        [`selectedTopics.${sceneType}.checkAll`]: p.length == 0,
      });
    },
    // åˆ·æ–°é€‰æ‹©ç»“æžœ
    refreshSelectedLedger() {
      const { selectedTopics } = this.data;
      const { sceneType } = this.data.searchOptions;
      const { allLedgerTypes, selectedLedgers } = selectedTopics[sceneType];
      let topicText = '';
      allLedgerTypes.forEach(p => {
        const i = selectedLedgers.indexOf(p.ledgerSubTypeId);
        if (p.selected) {
          if (i == -1) {
            selectedLedgers.push(p.ledgerSubTypeId);
          }
          if (topicText != '') {
            topicText += '、';
          }
          topicText += p.ledgerName;
        } else {
          if (i != -1) {
            selectedLedgers.splice(i, 1);
          }
        }
      });
      if (topicText == '') {
        topicText = '点击选择';
      } else if (selectedLedgers.length == allLedgerTypes.length) {
        topicText = '已选全部类别';
      } else if (topicText.length > 9) {
        topicText = topicText.substring(0, 10);
        topicText += `...等${selectedLedgers.length}个类别`;
      }
      this.setData({
        [`selectedTopics.${sceneType}.selectedLedgers`]: selectedLedgers,
        [`selectedTopics.${sceneType}.topicText`]: topicText,
      });
    },
    /**
     * å°è´¦ç±»åˆ«é€‰æ‹©äº‹ä»¶
     * åœ¨ç”¨æˆ·ç‚¹å‡»å¼¹å‡ºæ¡†çš„“确定”按钮后,将[allLedgerTypes]选中的台账更新到[selectedLedgers]列表中,
     * å…³é—­å¼¹å‡ºæ¡†ï¼Œå¹¶ä¸”触发获取台账信息的函数
     */
    onLedgerPickerChange() {
      this.refreshSelectedLedger();
      this.setData({ popupVisible: false });
      this.fetchTopicLedgers();
    },
    /**
     * èŽ·å–ä¸“é¢˜ç›¸å…³çš„å°è´¦ä¿¡æ¯
     * @param {Int} startIndex éœ€è¦èŽ·å–å°è´¦ä¿¡æ¯çš„èµ·å§‹ç´¢å¼•
     */
    fetchTopicLedgers(startIndex) {
      this.setData({ topicLoading: true });
      // ç¡®å®šæ‰€é€‰çš„台账类型
      const { selectedTopics } = this.data;
      const { sceneType, time } = this.data.searchOptions;
      const { allLedgerTypes, selectedLedgers } = selectedTopics[sceneType];
      const _selectedLedgers = allLedgerTypes.filter(v => {
        return selectedLedgers.indexOf(v.ledgerSubTypeId) != -1;
      });
      if (_selectedLedgers.length == 0) {
        searchResult.forEach(e => {
          e.topics = [];
        });
      } else {
        const { searchResult } = this.data;
        const alltask = [];
        for (let i = startIndex ? startIndex : 0; i < searchResult.length; i++) {
          const e = searchResult[i];
          this.setData({ [`searchResult[${i}].topicLoading`]: true });
          const t = fetchLedgerDetail({ userId: e.userId, sceneType, time }).then(res => {
            const topics = [];
            _selectedLedgers.forEach(l => {
              const ledger = res.data.find(r => r.ledgerSubTypeId == l.ledgerSubTypeId);
              const detail = ledger ? ledger : { ledgerName: l.ledgerName };
              topics.push({ ...l, detail });
            });
            this.setData({
              [`searchResult[${i}].topicLoading`]: false,
              [`searchResult[${i}].topics`]: topics,
            });
          });
          alltask.push(t);
        }
        Promise.all(alltask).finally(() => {
          this.setData({ topicLoading: false });
          console.log('searchResult', this.data.searchResult);
        });
      }
    },
  },
});
pages/supervision/topic.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,29 @@
<view bind:tap="showPopUp" class='topic-text'>
  <text>专题管理:{{selectedTopics[searchOptions.sceneType].topicText}}</text>
  <t-icon name="caret-down-small" size="36rpx" color="black'" />
</view>
<t-popup visible="{{popupVisible}}" bind:visible-change="onPopupVisibleChange" placement="bottom">
  <view class="popup-btn-group">
    <t-button block="{{false}}" t-class="t-class-button" theme="default" size="extra-small" bindtap="closePatrolList">取消
    </t-button>
    <view style="display: flex; align-items: center">
      <t-checkbox t-class="t-class-checkbox" t-class-border="t-class-border-checkbox"
        t-class-content="t-class-content-checkbox" t-class-label="t-class-label-checkbox" placement="right" borderless
        icon="rectangle" block="{{true}}" label="全选" checked="{{selectedTopics[searchOptions.sceneType].checkAll}}"
        bind:change="onCheckAll" />
      <t-button block="{{false}}" t-class="t-class-button" theme="primary" size="extra-small"
        bindtap="onLedgerPickerChange">
        {{selectedTopics[searchOptions.sceneType].selectedCount > 0 ? '(' + selectedTopics[searchOptions.sceneType].selectedCount + ')' : ''}}
        ç¡®å®š
      </t-button>
    </view>
  </view>
  <scroll-view style="height: 70vh" scroll-y="{{true}}">
    <t-grid column="{{4}}" theme="card">
      <t-grid-item wx:for="{{selectedTopics[searchOptions.sceneType].allLedgerTypes}}" wx:key="index"
        class="{{item.selected ? 'patrol-task-item-selected' : 'patrol-task-item'}}" badge-props="{{ item.selected }}"
        text="{{item.ledgerName}}" image="{{item.iconUrl}}" data-index="{{index}}" bindtap="choseLedgerType" />
    </t-grid>
  </scroll-view>
</t-popup>
pages/supervision/topic.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
.topic-text {
 display: flex;
 padding: 8px;
 align-items: center;
 color: rgba(51, 51, 51, 1);
 background-color: #fff;
}
.popup-btn-group {
 display: flex;
 justify-content: space-between;
 padding: 0 var(--td-spacer-2);
 /* background-color: aqua; */
 align-items: center;
}
.t-class-checkbox {
 /* background-color: tomato !important; */
 /* padding: initial !important; */
 text-align: end;
}
.t-class-button {
 margin: initial !important;
}
.patrol-task-item {
 opacity: 0.5;
}
.patrol-task-item-selected {
 opacity: 1;
}
project.config.json
@@ -33,7 +33,13 @@
      "outputPath": ""
    },
    "condition": false,
    "ignoreUploadUnusedFiles": true
    "ignoreUploadUnusedFiles": true,
    "compileWorklet": false,
    "localPlugins": false,
    "disableUseStrict": false,
    "useCompilerPlugins": false,
    "swc": false,
    "disableSWC": true
  },
  "compileType": "miniprogram",
  "condition": {},
@@ -45,5 +51,7 @@
  "packOptions": {
    "ignore": [],
    "include": []
  }
  },
  "libVersion": "3.15.0",
  "simulatorPluginLibVersion": {}
}
project.private.config.json
@@ -1,9 +1,24 @@
{
  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json ä¸­çš„相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
  "projectname": "ep-law-abiding-manage-weixin",
  "projectname": "ep-law-abiding-manage",
  "setting": {
    "compileHotReLoad": true,
    "urlCheck": true
    "urlCheck": true,
    "coverView": true,
    "lazyloadPlaceholderEnable": false,
    "skylineRenderEnable": false,
    "preloadBackgroundData": false,
    "autoAudits": false,
    "useApiHook": true,
    "showShadowRootInWxmlPanel": true,
    "useStaticServer": false,
    "useLanDebug": false,
    "showES6CompileOption": false,
    "checkInvalidKey": true,
    "ignoreDevUnusedFiles": true,
    "bigPackageSizeSupport": false,
    "useIsolateContext": true
  },
  "libVersion": "3.11.2"
  "libVersion": "3.15.0",
  "condition": {}
}
services/config/fetchConfig.js
@@ -41,4 +41,20 @@
  });
}
export { fetchSceneTypes, fetchUserConfig };
/**
 * èŽ·å–ç”¨æˆ·çš„ä¸šåŠ¡å±žæ€§é…ç½®ä¿¡æ¯ï¼ˆä¾‹å¦‚å°è´¦ä¸ŠæŠ¥æ—¥æœŸï¼Œè‡ªå·¡æŸ¥æ˜¯å¦éœ€è¦æ‰¿è¯ºç­‰ï¼‰
 */
function fetchUserSetting({ userId }) {
  return get({
    url: `/config/user/setting`,
    params: {
      userId: userId,
    },
  }).then(res => {
    if (res.data.success) {
      app.globalData.userSetting = res.data.data;
    }
  });
}
export { fetchSceneTypes, fetchUserConfig, fetchUserSetting };