riku
2024-08-14 f2a0ea849099f49a3d2a9c7e5c44d033df22468f
设备管理模块

初步完成模块功能
已修改36个文件
已添加8个文件
1060 ■■■■■ 文件已修改
app.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
behaviors/loadConfig.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/dataLocation.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/dataMaintainFrequency.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/filter/index.wxml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/search/index.js 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/search/index.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/search/index.wxml 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/search/index.wxss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/index.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
custom-tab-bar/data.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
custom-tab-bar/index.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
custom-tab-bar/index.wxml 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
custom-tab-bar/index.wxss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
miniprogram_npm/tdesign-miniprogram/cascader/README.en-US.md 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
miniprogram_npm/tdesign-miniprogram/cascader/README.md 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
miniprogram_npm/tdesign-miniprogram/cascader/cascader.d.ts 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
miniprogram_npm/tdesign-miniprogram/cascader/cascader.js 158 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
miniprogram_npm/tdesign-miniprogram/cascader/cascader.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
miniprogram_npm/tdesign-miniprogram/cascader/cascader.wxml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
miniprogram_npm/tdesign-miniprogram/cascader/cascader.wxss 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
miniprogram_npm/tdesign-miniprogram/cascader/props.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
miniprogram_npm/tdesign-miniprogram/cascader/type.d.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/device.js 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/enterprise/ledger/history/index.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/index.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/index.wxml 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/info/components/device-location/index.wxml 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/info/components/device-location/index.wxss 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/info/device-info-items.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/info/devicelist.wxml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/search/components/scene-search-result/index.js 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/search/components/scene-search-result/index.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/search/components/scene-search-result/index.wxml 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/search/components/scene-search-result/index.wxss 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/search/index.js 196 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/search/index.json 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/search/index.wxml 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/search/index.wxss 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/usercenter/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/usercenter/menu.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
project.private.config.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
services/inspection/fetchDevice.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
services/inspection/fetchInspection.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.js
@@ -10,6 +10,8 @@
    });
  },
  globalData: {
    // é‡å¯æ—¶å¾…办事项
    onLaunch:[],
    userInfo: {
      district: undefined,
    },
behaviors/loadConfig.js
@@ -8,7 +8,6 @@
function loadConfig() {
  const pList = [];
  const userId = app.globalData.accessToken.userId;
  const f1 = fetchSceneTypes({ userId }).then(res => {
    wx.setStorage({
common/dataLocation.js
@@ -1,6 +1,8 @@
const app = getApp();
// èŽ·å–ç”¨æˆ·é…ç½®ä¿¡æ¯
const userConfig = app.globalData.userConfig;
// åˆ‡æ¢è´¦å·æ—¶,重置可选行政区划
app.globalData.onLaunch.push(() => {
  remoteLocations = [];
});
const _locations = [
  {
@@ -142,6 +144,8 @@
function locations() {
  if (remoteLocations.length > 0) return remoteLocations;
  // èŽ·å–ç”¨æˆ·é…ç½®ä¿¡æ¯
  const userConfig = app.globalData.userConfig;
  if (!userConfig) {
    remoteLocations = _locations;
    return remoteLocations;
common/dataMaintainFrequency.js
@@ -2,7 +2,7 @@
 * è®¾å¤‡è¿ç»´é¢‘次
 */
const freq = [
  { value: '0', label: '每周一次' },
  // { value: '0', label: '每周一次' },
  { value: '1', label: '每月一次' },
  { value: '2', label: '每季度一次' },
  { value: '3', label: '每半年一次' },
components/filter/index.wxml
@@ -5,17 +5,17 @@
    <view class="filter-item" bind:tap="handleSort">
      <text style="color: {{sorts !== '' ? color : '' }}">评分</text>
      <view class="filter-sort">
        <!-- <t-icon
        <t-icon
          prefix="wr"
          name="arrow_drop_up"
          size="18rpx"
          style="color:{{sorts === 'asc' ? color : '#bbb'}}"
        /> -->
        <t-icon
        />
        <!-- <t-icon
          name="component-grid"
          size="18rpx"
          style="color:{{sorts === 'asc' ? color : '#bbb'}}"
        />
        /> -->
        <t-icon
          prefix="wr"
          name="arrow_drop_down"
components/search/index.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,40 @@
import { useLoading } from '../../../behaviors/loading';
Component({
  behaviors: [useLoading],
  options: {
    multipleSlots: true, // åœ¨ç»„件定义时的选项中启用多slot支持
  },
  properties: {
    placeholder: '输入关键词搜索',
    // æœç´¢ç¼“存历史记录存储标签
    historyTag: 'historyWords',
    // æœç´¢ç»“æžœ
    searchResult: [],
  },
  data: {
    searchValue: '',
    isSearch: false,
    historyWords: [],
    dialog: {
      title: '确认删除当前历史记录',
      showCancelButton: true,
      message: '',
    },
    dialogShow: false,
    deleteType: 0,
    deleteIndex: '',
  },
  lifetimes: {
    attached: function () {
      // åœ¨ç»„件实例进入页面节点树时执行
      let optionList = optionListFunc;
      if (typeof optionListFunc === 'function') {
        optionList = optionListFunc();
      }
      this.setSelectOptions(keyword, optionList);
      this.onInitialValue(keyword);
    },
  },
  methods: {},
});
components/search/index.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,4 @@
{
  "component": true,
  "usingComponents": {}
}
components/search/index.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,70 @@
<view class="page">
  <view class="page-header">
    <t-search
      placeholder="{{placeholder}}"
      model:value="{{searchValue}}"
      bind:submit="handleSubmit"
      bind:clear="handleClear"
      bind:change="handleChange"
      focus
    >
    </t-search>
  </view>
  <view class="page-container">
    <enterprise-search-result
      wx:for="{{searchResult}}"
      wx:key="index"
      wx:for-index="index"
      result="{{item}}"
      bind:click="handCellClick"
    ></enterprise-search-result>
    <load-more
      list-is-empty="{{!searchResult.length}}"
      status="{{loadStatus}}"
      bind:retry="_startLoad"
    />
    <t-empty
      wx:if="{{loadStatus == 2 && isSearch && searchResult.length == 0}}"
      icon="info-circle-filled"
      description="无匹配记录"
    />
    <block wx:if="{{!isSearch}}">
      <view wx:if="{{historyWords.length > 0}}" class="history-wrap">
        <view class="search-header">
          <text class="search-title">历史搜索</text>
          <text class="search-clear" bind:tap="handleClearHistory">清除</text>
        </view>
        <view class="search-content">
          <view
            class="search-item"
            hover-class="hover-history-item"
            wx:for="{{historyWords}}"
            bind:tap="handleHistoryTap"
            bindlongpress="deleteCurr"
            data-index="{{index}}"
            wx:key="index"
          >
            {{item}}
          </view>
        </view>
      </view>
      <t-empty
        wx:else
        t-class-image="t-empty__image"
        image="/res/nodata.png"
        description="请搜索"
      />
    </block>
  </view>
  <view class="page-footer"></view>
  <t-dialog
    visible="{{dialogShow}}"
    content="{{dialog.message}}"
    bindconfirm="confirm"
    bind:close="close"
    confirm-btn="确定"
    cancel-btn="{{dialog.showCancelButton ? '取消' : null}}"
    t-class-confirm="add-notes__confirm"
  />
</view>
components/search/index.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1 @@
/* components/search/index.wxss */
config/index.js
@@ -8,14 +8,16 @@
const baseFileUrl = `${bu}/meeting/file/`;
// çº¿ä¸Šç›‘管
// const inspectUrl = 'https://fyami.com.cn:447';
const inspectUrl = 'https://fyami.com.cn:447';
// const inspectUrl = 'http://192.168.0.138:8082';
const inspectUrl = 'http://192.168.1.8:8080';
// const inspectUrl = 'http://192.168.0.138:8080';
// const inspectUrl = 'http://192.168.1.8:8080';
const iu = 'https://fyami.com.cn:447';
const inspectPicUrl = `${iu}/images/`;
// const inspectPicUrl = `${inspectUrl}/images/`;
const mode = 'debug';
// const mode = 'prod';
// const mode = 'debug';
const mode = 'prod';
export { basePicUrl, baseUrl, baseFileUrl, baseIconUrl, inspectUrl, inspectPicUrl, mode };
custom-tab-bar/data.js
@@ -1,27 +1,33 @@
import { baseIconUrl } from "../config/index";
export default [
  {
    icon: 'home',
    text: '首页',
    url: 'pages/home/index',
    level: 2,
  },
  {
    icon: 'app',
    text: '精细化监管',
    url: 'pages/supervision/index',
    level: 2,
  },
  {
    // icon: `${baseIconUrl}tab-slef-patrol.png`,
    icon: 'root-list',
    text: '应急自巡查',
    url: 'pages/selfpatrol/index',
    // url: '',
    level: 2,
  },
  // {
  //   icon: 'system-device',
  //   text: '设备管理',
  //   url: 'pages/inspection/scene/index',
  //   level: 1,
  // },
  {
    icon: 'user',
    text: '个人中心',
    url: 'pages/usercenter/index',
    // url: '',
    level: 2,
  },
];
custom-tab-bar/index.js
@@ -1,10 +1,18 @@
import TabMenu from './data';
const app = getApp();
Component({
  data: {
    active: 0,
    list: TabMenu,
  },
  attached() {
    const menu = TabMenu.map(v => {
      v.visible = app.globalData.userInfo.usertypeid <= v.level;
      return v;
    });
    this.setData({ list: menu });
  },
  methods: {
    onChange(event) {
      let index = event.detail.value;
@@ -29,9 +37,7 @@
      const page = getCurrentPages().pop();
      const route = page ? page.route.split('?')[0] : '';
      const active = this.data.list.findIndex(
        item =>
          (item.url.startsWith('/') ? item.url.substr(1) : item.url) ===
          `${route}`,
        item => (item.url.startsWith('/') ? item.url.substr(1) : item.url) === `${route}`,
      );
      this.setData({ active });
    },
custom-tab-bar/index.wxml
@@ -1,18 +1,9 @@
<view class="custom-tab-bar">
  <t-tab-bar
    value="{{active}}"
    bindchange="onChange"
    split="{{false}}"
    shape="normal"
  >
    <t-tab-bar-item
      wx:for="{{list}}"
      wx:for-item="item"
      wx:for-index="index"
      wx:key="index"
      icon="{{item.icon}}"
    >
  <t-tab-bar value="{{active}}" bindchange="onChange" split="{{false}}" shape="normal">
    <block wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index">
      <t-tab-bar-item class="{{item.visible ? '' : 'hidden'}}" icon="{{item.icon}}">
      {{ item.text }}
    </t-tab-bar-item>
    </block>
  </t-tab-bar>
</view>
custom-tab-bar/index.wxss
@@ -2,3 +2,7 @@
  --td-tab-bar-color: rgb(163, 163, 163);
  /* --td-tab-bar-active-color: #333; */
}
.hidden{
  /* display: none; */
}
miniprogram_npm/tdesign-miniprogram/cascader/README.en-US.md
@@ -5,13 +5,12 @@
name | type | default | description | required
-- | -- | -- | -- | --
close-btn | Boolean / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
close-btn | Boolean / Slot | true | \- | N
keys | Object | - | Typescript:`KeysType` | N
options | Array | [] | Typescript:`Array<CascaderOption>` | N
placeholder | String | é€‰æ‹©é€‰é¡¹ | \- | N
sub-titles | Array | [] | Typescript:`Array<string>` | N
theme | String | step | options: step/tab | N
title | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
theme | String | step | options:step/tab | N
title | String / Slot | - | \- | N
value | String / Number | null | \- | N
default-value | String / Number | undefined | uncontrolled property | N
visible | Boolean | false | \- | N
@@ -23,23 +22,3 @@
change | `(value: string \| number, selectedOptions: string[])` | `1.0.1`
close | `(trigger: TriggerSource)` | `1.0.1`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/cascader/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/>
pick | `(value: string \| number, index: number)` | `1.0.1`
### CSS Variables
The component provides the following CSS variables, which can be used to customize styles.
Name | Default Value | Description
-- | -- | --
--td-cascader-active-color | @brand-color | -
--td-cascader-bg-color | @bg-color-container | -
--td-cascader-border-color | @component-stroke | -
--td-cascader-content-height | 78vh | -
--td-cascader-disabled-color | @text-color-disabled | -
--td-cascader-options-height | calc(100% - @cascader-step-height) | -
--td-cascader-options-title-color | @text-color-placeholder | -
--td-cascader-step-arrow-color | @text-color-placeholder | -
--td-cascader-step-dot-size | 16rpx | -
--td-cascader-step-height | 88rpx | -
--td-cascader-title-color | @text-color-primary | -
--td-cascader-title-height | 26rpx | -
--td-cascader-title-padding | @spacer-2 | -
--td-cascder-title-font-size | 36rpx | -
miniprogram_npm/tdesign-miniprogram/cascader/README.md
@@ -24,12 +24,6 @@
## ä»£ç æ¼”示
<a href="https://developers.weixin.qq.com/s/i75I6imI7TSh" title="在开发者工具中预览效果" target="_blank" rel="noopener noreferrer"> åœ¨å¼€å‘者工具中预览效果 </a>
<blockquote style="background-color: #d9e1ff; font-size: 15px; line-height: 26px;margin: 16px 0 0;padding: 16px; border-radius: 6px; color: #0052d9" >
<p>Tips: è¯·ç¡®ä¿å¼€å‘者工具为打开状态。导入开发者工具后,依次执行:npm i > æž„建npm包 > å‹¾é€‰ "将JS编译成ES5"</p>
</blockquote>
### åŸºç¡€ç”¨æ³•
{{ base }}
@@ -57,13 +51,12 @@
名称 | ç±»åž‹ | é»˜è®¤å€¼ | è¯´æ˜Ž | å¿…ä¼ 
-- | -- | -- | -- | --
close-btn | Boolean / Slot | true | å…³é—­æŒ‰é’®ã€‚[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
keys | Object | - | ç”¨æ¥å®šä¹‰ value / label åœ¨ `options` ä¸­å¯¹åº”的字段别名。TS ç±»åž‹ï¼š`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
close-btn | Boolean / Slot | true | å…³é—­æŒ‰é’® | N
keys | Object | - | ç”¨æ¥å®šä¹‰ value / label åœ¨ `options` ä¸­å¯¹åº”的字段别名。TS ç±»åž‹ï¼š`KeysType` | N
options | Array | [] | å¯é€‰é¡¹æ•°æ®æºã€‚TS ç±»åž‹ï¼š`Array<CascaderOption>` | N
placeholder | String | é€‰æ‹©é€‰é¡¹ | æœªé€‰ä¸­æ—¶çš„æç¤ºæ–‡æ¡ˆ | N
sub-titles | Array | [] | æ¯çº§å±•示的次标题。TS ç±»åž‹ï¼š`Array<string>` | N
theme | String | step | å±•示风格。可选项:step/tab | N
title | String / Slot | - | æ ‡é¢˜ã€‚[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
title | String / Slot | - | æ ‡é¢˜ | N
value | String / Number | null | é€‰é¡¹å€¼ | N
default-value | String / Number | undefined | é€‰é¡¹å€¼ã€‚非受控属性 | N
visible | Boolean | false | æ˜¯å¦å±•示 | N
@@ -75,23 +68,3 @@
change | `(value: string \| number, selectedOptions: string[])` | `1.0.1`。值发生变更时触发
close | `(trigger: TriggerSource)` | `1.0.1`。关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/cascader/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/>
pick | `(value: string \| number, index: number)` | `1.0.1`。选择后触发
### CSS Variables
组件提供了下列 CSS å˜é‡ï¼Œå¯ç”¨äºŽè‡ªå®šä¹‰æ ·å¼ã€‚
名称 | é»˜è®¤å€¼ | æè¿°
-- | -- | --
--td-cascader-active-color | @brand-color | -
--td-cascader-bg-color | @bg-color-container | -
--td-cascader-border-color | @component-stroke | -
--td-cascader-content-height | 78vh | -
--td-cascader-disabled-color | @text-color-disabled | -
--td-cascader-options-height | calc(100% - @cascader-step-height) | -
--td-cascader-options-title-color | @text-color-placeholder | -
--td-cascader-step-arrow-color | @text-color-placeholder | -
--td-cascader-step-dot-size | 16rpx | -
--td-cascader-step-height | 88rpx | -
--td-cascader-title-color | @text-color-primary | -
--td-cascader-title-height | 26rpx | -
--td-cascader-title-padding | @spacer-2 | -
--td-cascder-title-font-size | 36rpx | -
miniprogram_npm/tdesign-miniprogram/cascader/cascader.d.ts
@@ -6,53 +6,35 @@
export default class Cascader extends SuperComponent {
    externalClasses: string[];
    options: WechatMiniprogram.Component.ComponentOptions;
    properties: TdCascaderProps<import("../common/common").TreeOptionData<string | number>>;
    properties: TdCascaderProps<import("../common/common").TreeOptionData>;
    controlledProps: {
        key: string;
        event: string;
    }[];
    state: {
        contentHeight: number;
        stepHeight: number;
        tabsHeight: number;
        subTitlesHeight: number;
        stepsInitHeight: number;
    };
    data: {
        prefix: string;
        name: string;
        stepIndex: number;
        selectedIndexes: any[];
        selectedValue: any[];
        defaultOptionLabel: string;
        scrollTopList: any[];
        steps: any[];
        _optionsHeight: number;
        steps: string[];
    };
    observers: {
        visible(v: any): void;
        value(): void;
        options(): void;
        selectedIndexes(): void;
        'selectedIndexes, options'(): void;
        stepIndex(): Promise<void>;
    };
    methods: {
        updateOptionsHeight(steps: number): void;
        initOptionsHeight(steps: number): Promise<void>;
        initWithValue(): void;
        getIndexesByValue(options: import("../common/common").TreeOptionData<string | number>[], value: any): any[];
        getIndexesByValue(options: import("../common/common").TreeOptionData[], value: any): any[];
        updateScrollTop(): void;
        hide(trigger: any): void;
        onVisibleChange(): void;
        onClose(): void;
        onStepClick(e: any): void;
        onTabChange(e: any): void;
        genItems(): {
            selectedValue: any[];
            steps: any[];
            items: {
                [x: string]: any;
            }[][];
        };
        handleSelect(e: any): void;
    };
}
miniprogram_npm/tdesign-miniprogram/cascader/cascader.js
@@ -19,31 +19,13 @@
import { getRect } from '../common/utils';
const { prefix } = config;
const name = `${prefix}-cascader`;
function parseOptions(options, keys) {
    var _a, _b;
    const label = (_a = keys === null || keys === void 0 ? void 0 : keys.label) !== null && _a !== void 0 ? _a : 'label';
    const value = (_b = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _b !== void 0 ? _b : 'value';
    return options.map((item) => {
        return {
            [label]: item[label],
            [value]: item[value],
        };
    });
}
const defaultState = {
    contentHeight: 0,
    stepHeight: 0,
    tabsHeight: 0,
    subTitlesHeight: 0,
    stepsInitHeight: 0,
};
const defaultOptionLabel = '选择选项';
let Cascader = class Cascader extends SuperComponent {
    constructor() {
        super(...arguments);
        this.externalClasses = [`${prefix}-class`];
        this.options = {
            multipleSlots: true,
            pureDataPattern: /^options$/,
        };
        this.properties = props;
        this.controlledProps = [
@@ -52,56 +34,51 @@
                event: 'change',
            },
        ];
        this.state = Object.assign({}, defaultState);
        this.data = {
            prefix,
            name,
            stepIndex: 0,
            selectedIndexes: [],
            selectedValue: [],
            defaultOptionLabel,
            scrollTopList: [],
            steps: [],
            _optionsHeight: 0,
            steps: [defaultOptionLabel],
        };
        this.observers = {
            visible(v) {
                if (v) {
                    const $tabs = this.selectComponent('#tabs');
                    $tabs === null || $tabs === void 0 ? void 0 : $tabs.setTrack();
                    $tabs === null || $tabs === void 0 ? void 0 : $tabs.getTabHeight().then((res) => {
                        this.state.tabsHeight = res.height;
                    });
                    this.initOptionsHeight(this.data.steps.length);
                    this.updateScrollTop();
                    this.initWithValue();
                }
                else {
                    this.state = Object.assign({}, defaultState);
            },
            'selectedIndexes, options'() {
                var _a, _b, _c, _d;
                const { options, selectedIndexes, keys } = this.data;
                const selectedValue = [];
                const steps = [];
                const items = [options];
                if (options.length > 0) {
                    for (let i = 0, size = selectedIndexes.length; i < size; i += 1) {
                        const index = selectedIndexes[i];
                        const next = items[i][index];
                        selectedValue.push(next[(_a = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _a !== void 0 ? _a : 'value']);
                        steps.push(next[(_b = keys === null || keys === void 0 ? void 0 : keys.label) !== null && _b !== void 0 ? _b : 'label']);
                        if (next[(_c = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _c !== void 0 ? _c : 'children']) {
                            items.push(next[(_d = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _d !== void 0 ? _d : 'children']);
                }
            },
            value() {
                this.initWithValue();
            },
            options() {
                const { selectedValue, steps, items } = this.genItems();
                    }
                }
                if (steps.length < items.length) {
                    steps.push(defaultOptionLabel);
                }
                this.setData({
                    steps,
                    items,
                    selectedValue,
                    stepIndex: items.length - 1,
                });
            },
            selectedIndexes() {
                const { visible, theme } = this.properties;
                const { selectedValue, steps, items } = this.genItems();
                this.setData({
                    steps,
                    selectedValue,
                    stepIndex: items.length - 1,
                });
                if (visible && theme === 'step') {
                    this.updateOptionsHeight(steps.length);
                }
            },
            stepIndex() {
                return __awaiter(this, void 0, void 0, function* () {
@@ -113,35 +90,6 @@
            },
        };
        this.methods = {
            updateOptionsHeight(steps) {
                const { contentHeight, stepsInitHeight, stepHeight, subTitlesHeight } = this.state;
                this.setData({
                    _optionsHeight: contentHeight - stepsInitHeight - subTitlesHeight - (steps - 1) * stepHeight,
                });
            },
            initOptionsHeight(steps) {
                return __awaiter(this, void 0, void 0, function* () {
                    const { theme, subTitles } = this.properties;
                    const { height } = yield getRect(this, `.${name}__content`);
                    this.state.contentHeight = height;
                    if (theme === 'step') {
                        yield Promise.all([getRect(this, `.${name}__steps`), getRect(this, `.${name}__step`)]).then(([stepsRect, stepRect]) => {
                            this.state.stepsInitHeight = stepsRect.height - (steps - 1) * stepRect.height;
                            this.state.stepHeight = stepRect.height;
                        });
                    }
                    if (subTitles.length > 0) {
                        const { height } = yield getRect(this, `.${name}__options-title`);
                        this.state.subTitlesHeight = height;
                    }
                    const optionsInitHeight = this.state.contentHeight - this.state.subTitlesHeight;
                    this.setData({
                        _optionsHeight: theme === 'step'
                            ? optionsInitHeight - this.state.stepsInitHeight - (steps - 1) * this.state.stepHeight
                            : optionsInitHeight - this.state.tabsHeight,
                    });
                });
            },
            initWithValue() {
                if (this.data.value != null && this.data.value !== '') {
                    const selectedIndexes = this.getIndexesByValue(this.data.options, this.data.value);
@@ -201,70 +149,24 @@
                    stepIndex: value,
                });
            },
            genItems() {
                var _a, _b, _c, _d, _e;
                const { options, selectedIndexes, keys, placeholder } = this.data;
                const selectedValue = [];
                const steps = [];
                const items = [parseOptions(options, keys)];
                if (options.length > 0) {
                    let current = options;
                    for (let i = 0, size = selectedIndexes.length; i < size; i += 1) {
                        const index = selectedIndexes[i];
                        const next = current[index];
                        current = next[(_a = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _a !== void 0 ? _a : 'children'];
                        selectedValue.push(next[(_b = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _b !== void 0 ? _b : 'value']);
                        steps.push(next[(_c = keys === null || keys === void 0 ? void 0 : keys.label) !== null && _c !== void 0 ? _c : 'label']);
                        if (next[(_d = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _d !== void 0 ? _d : 'children']) {
                            items.push(parseOptions(next[(_e = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _e !== void 0 ? _e : 'children'], keys));
                        }
                    }
                }
                if (steps.length < items.length) {
                    steps.push(placeholder);
                }
                return {
                    selectedValue,
                    steps,
                    items,
                };
            },
            handleSelect(e) {
                var _a, _b, _c, _d;
                var _a, _b, _c;
                const { level } = e.target.dataset;
                const { value } = e.detail;
                const { selectedIndexes, items, keys, options } = this.data;
                const { selectedIndexes, items, keys } = this.data;
                const index = items[level].findIndex((item) => { var _a; return item[(_a = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _a !== void 0 ? _a : 'value'] === value; });
                let item = selectedIndexes.slice(0, level).reduce((acc, item, index) => {
                    var _a;
                    if (index === 0) {
                        return acc[item];
                    }
                    return acc[(_a = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _a !== void 0 ? _a : 'children'][item];
                }, options);
                if (level === 0) {
                    item = item[index];
                }
                else {
                    item = item[(_a = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _a !== void 0 ? _a : 'children'][index];
                }
                const item = items[level][index];
                if (item.disabled) {
                    return;
                }
                selectedIndexes[level] = index;
                selectedIndexes.length = level + 1;
                this.triggerEvent('pick', { value: item[(_b = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _b !== void 0 ? _b : 'value'], index, level });
                const { items: newItems } = this.genItems();
                if ((_d = item === null || item === void 0 ? void 0 : item[(_c = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _c !== void 0 ? _c : 'children']) === null || _d === void 0 ? void 0 : _d.length) {
                    this.setData({
                        selectedIndexes,
                        [`items[${level + 1}]`]: newItems[level + 1],
                    });
                this.triggerEvent('pick', { value: item[(_a = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _a !== void 0 ? _a : 'value'], index, level });
                if ((_c = item === null || item === void 0 ? void 0 : item[(_b = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _b !== void 0 ? _b : 'children']) === null || _c === void 0 ? void 0 : _c.length) {
                    this.setData({ selectedIndexes });
                }
                else {
                    this.setData({
                        selectedIndexes,
                    }, () => {
                    this.setData({ selectedIndexes }, () => {
                        var _a;
                        const { items } = this.data;
                        this._trigger('change', {
miniprogram_npm/tdesign-miniprogram/cascader/cascader.json
@@ -1,6 +1,5 @@
{
  "component": true,
  "styleIsolation": "apply-shared",
  "usingComponents": {
    "t-icon": "../icon/icon",
    "t-popup": "../popup/popup",
miniprogram_npm/tdesign-miniprogram/cascader/cascader.wxml
@@ -15,7 +15,7 @@
        <view wx:if="{{theme == 'step'}}" class="{{name}}__steps">
          <view wx:for="{{steps}}" wx:key="index" class="{{name}}__step" bind:tap="onStepClick" data-index="{{index}}">
            <view
              class="{{name}}__step-dot {{name}}__step-dot--{{item !== placeholder ? 'active' : ''}} {{name}}__step-dot--{{index === steps.length - 1 ? 'last' : ''}}"
              class="{{name}}__step-dot {{name}}__step-dot--{{item !== defaultOptionLabel ? 'active' : ''}} {{name}}__step-dot--{{index === steps.length - 1 ? 'last' : ''}}"
            ></view>
            <view class="{{name}}__step-label {{name}}__step-label--{{index === stepIndex ? 'active' : ''}}">
              {{ item }}
@@ -43,8 +43,6 @@
          class="{{name}}__options"
          scroll-y
          scroll-top="{{scrollTopList[index]}}"
          type="list"
          style="height: {{_optionsHeight}}px"
        >
          <view class="cascader-radio-group-{{index}}">
            <t-radio-group
miniprogram_npm/tdesign-miniprogram/cascader/cascader.wxss
@@ -28,45 +28,49 @@
.t-cascader {
  display: flex;
  flex-direction: column;
  background-color: var(--td-cascader-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff)));
  color: var(--td-cascader-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))));
  border-radius: var(--td-radius-extra-large, 24rpx) var(--td-radius-extra-large, 24rpx) 0 0;
  background-color: #fff;
  color: var(--td-cascader-title-color, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)));
  border-radius: 24rpx 24rpx 0 0;
  --td-radio-icon-checked-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
  --td-tab-item-active-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
  --td-tab-track-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
}
.t-cascader__close-btn {
  right: 32rpx;
  top: 24rpx;
  right: 16px;
  top: 12px;
  position: absolute;
}
.t-cascader__title {
  position: relative;
  font-weight: 700;
  text-align: center;
  line-height: var(--td-cascader-title-height, 26rpx);
  padding: var(--td-cascader-title-padding, var(--td-spacer-2, 32rpx));
  line-height: 48px;
  font-size: var(--td-cascder-title-font-size, 36rpx);
}
.t-cascader__content {
  width: 100%;
  height: var(--td-cascader-content-height, 78vh);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.t-cascader__options {
  width: 100vw;
  height: var(--td-cascader-options-height, 640rpx);
}
.t-cascader__options-title {
  color: var(--td-cascader-options-title-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
  font-size: var(--td-font-size-base, 28rpx);
  margin-top: 40rpx;
  color: var(--td-cascader-options-title-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
  font-size: 28rpx;
  line-height: 44rpx;
  padding-top: 40rpx;
  padding-left: var(--td-spacer-2, 32rpx);
  box-sizing: border-box;
  padding-left: 16px;
}
.t-cascader__options-content {
  flex: 1;
  height: 100%;
  overflow: auto;
  padding-left: 16px;
}
.t-cascader__options-container {
  flex: 1;
  display: flex;
  transition: all ease 0.3s;
}
@@ -87,7 +91,7 @@
  bottom: 0;
  left: unset;
  right: unset;
  background-color: var(--td-cascader-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7)));
  background-color: var(--td-cascader-border-color, var(--td-border-color, var(--td-gray-color-3, #e7e7e7)));
}
.t-cascader__steps::after {
  height: 1px;
@@ -100,7 +104,7 @@
  width: var(--td-cascader-step-dot-size, 16rpx);
  height: var(--td-cascader-step-dot-size, 16rpx);
  border-radius: 50%;
  border: 2rpx solid var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
  border: 1px solid var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
  box-sizing: border-box;
}
.t-cascader__step-dot:not(.t-cascader__step-dot--last)::after {
@@ -110,7 +114,7 @@
  left: 50%;
  top: calc(var(--td-cascader-step-dot-size, 16rpx) + 14rpx);
  height: 36rpx;
  width: 2rpx;
  width: 1px;
  background: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
  transform: translateX(-50%);
}
@@ -119,14 +123,14 @@
  border-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
}
.t-cascader__step-label {
  padding-left: var(--td-spacer-2, 32rpx);
  font-size: var(--td-font-size-m, 32rpx);
  padding-left: 16px;
  font-size: 16px;
}
.t-cascader__step-label--active {
  color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9)));
  font-weight: 600;
}
.t-cascader__step-arrow {
  color: var(--td-cascader-step-arrow-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))));
  color: var(--td-cascader-step-arrow-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)));
  margin-left: auto;
}
miniprogram_npm/tdesign-miniprogram/cascader/props.js
@@ -10,10 +10,6 @@
        type: Array,
        value: [],
    },
    placeholder: {
        type: String,
        value: '选择选项',
    },
    subTitles: {
        type: Array,
        value: [],
miniprogram_npm/tdesign-miniprogram/cascader/type.d.ts
@@ -12,10 +12,6 @@
        type: ArrayConstructor;
        value?: Array<CascaderOption>;
    };
    placeholder?: {
        type: StringConstructor;
        value?: string;
    };
    subTitles?: {
        type: ArrayConstructor;
        value?: Array<string>;
model/device.js
@@ -5,9 +5,12 @@
import { toLabel as toLabelMonitor } from '../common/dataMonitorDeviceType';
import { toLabel as toLabelTreatment } from '../common/dataTreatmentDeviceType';
import { toLabel as toLabelProduction } from '../common/dataProductionDeviceType';
import { inspectPicUrl } from '../config/index';
// ç›‘测设备
export function getMonitorDevice(data) {
  data._name = data.diName
  data._deviceCode = data.diDeviceCode
  data._updateTime = dayjs(data.diUpdateTime).format('YYYYå¹´MM月DD日');
  data._maintainFrequency = toLabelFreq(data.diMaintainFrequency);
  data._ownership = toLabelOwner(data.diOwnership);
@@ -15,11 +18,13 @@
  const labelArr = toLabelMonitor(data.diSceneTypeId, [data.diTypeId, data.diSubtypeId]);
  data._type = labelArr[0];
  data._subType = labelArr[1];
  return data
  return data;
}
// æ²»ç†è®¾å¤‡
export function getTreatmentDevice(data) {
  data._name = data.piName
  data._deviceCode = data.piDeviceCode
  data._updateTime = dayjs(data.piUpdateTime).format('YYYYå¹´MM月DD日');
  data._maintainFrequency = toLabelFreq(data.piMaintainFrequency);
  data._ownership = toLabelOwner(data.piOwnership);
@@ -27,18 +32,20 @@
  const labelArr = toLabelTreatment(data.piSceneTypeId, [data.piTypeId, data.piSubtypeId]);
  data._type = labelArr[0];
  data._subType = labelArr[1];
  return data
  return data;
}
// ç”Ÿäº§è®¾å¤‡
export function getProductionDevice(data) {
  data._name = data.wiName
  data._deviceCode = data.wiDeviceCode
  data._updateTime = dayjs(data.wiUpdateTime).format('YYYYå¹´MM月DD日');
  data._ownership = toLabelOwner(data.wiOwnership);
  data._runningStatus = toLabelStatus(data.wiRunningStatus);
  const labelArr = toLabelProduction(data.wiSceneTypeId, [data.wiTypeId, data.wiSubtypeId]);
  data._type = labelArr[0];
  data._subType = labelArr[1];
  return data
  return data;
}
export function getDeviceList(dataList, deviceType) {
@@ -57,3 +64,15 @@
    }
  });
}
export function getDeviceStatus(data) {
  data._createTime = dayjs(data.dlCreateTime).format('YYYYå¹´MM月DD日');
  data._imgPath = data.dlPicUrl.split(';').map(p => inspectPicUrl + p);
  return data;
}
export function getDeviceStatusList(dataList) {
  return dataList.map(item => {
    return getDeviceStatus(item);
  });
}
pages/enterprise/ledger/history/index.js
@@ -115,7 +115,6 @@
  bindYearChange(e) {
    let year = `${e.detail.value}`;
    debugger
    if (this.data.year != year) {
      this.setData({
        year,
pages/inspection/scene/index.js
@@ -12,6 +12,10 @@
  onLoad(options) {},
  onShow() {
    this.getTabBar().init();
  },
  onReachBottom() {
    this._loadMore();
  },
pages/inspection/scene/index.wxml
@@ -19,10 +19,15 @@
          style-mode="picker"
          picker-class="picker-location"
          bind:onChange="onLocationChange"
          bind:locationInitValue="onLocationChange"
        ></location-picker>
      </view>
      <view class="filter-wrap-2">
        <scene-picker sceneMode="{{1}}" bind:scenePickerChange="onScenePickerConfirm" bind:sceneInitValue="onScenePickerConfirm"/>
        <scene-picker
          sceneMode="{{1}}"
          bind:scenePickerChange="onScenePickerConfirm"
          bind:sceneInitValue="onScenePickerConfirm"
        />
      </view>
    </view>
  </t-sticky>
pages/inspection/scene/info/components/device-location/index.wxml
@@ -1,28 +1,10 @@
<view wx:if="{{time}}" class="flex-h">
<view wx:if="{{_createTime}}" class="flex-h">
  <!-- <t-divider content="变更时间: {{time}}" align="left" /> -->
  <view>{{index}}. å˜æ›´æ—¶é—´: {{time}}</view>
  <view wx:if="{{readOnly}}">
  <view>{{index}}. å˜æ›´æ—¶é—´: {{_createTime}}</view>
  <!-- <view wx:if="{{readOnly}}">
    <t-button theme="primary" size="extra-small" bind:tap="changeEdit">修改</t-button>
  </view> -->
  </view>
</view>
<t-input
  label="安装位置"
  placeholder="请输入安装位置"
  model:value="{{dlLocation}}"
  disabled="{{readOnly}}"
/>
<t-input
  label="经度"
  placeholder="请输入经度"
  model:value="{{dlLongitude}}"
  disabled="{{readOnly}}"
/>
<t-input
  label="维度"
  placeholder="请输入维度"
  model:value="{{dlLatitude}}"
  disabled="{{readOnly}}"
/>
<t-cell title="是否规范">
  <t-switch
    model:value="{{dlStandard}}"
@@ -34,12 +16,51 @@
  />
</t-cell>
<t-input
  label="设备位置"
  placeholder="请输入安装位置"
  model:value="{{dlLocation}}"
  disabled="{{readOnly}}"
/>
<!-- <t-input
  label="经度"
  placeholder="请输入经度"
  model:value="{{dlLongitude}}"
  disabled="{{readOnly}}"
/>
<t-input
  label="维度"
  placeholder="请输入维度"
  model:value="{{dlLatitude}}"
  disabled="{{readOnly}}"
/> -->
<t-input
  wx:if="{{!dlStandard}}"
  label="不规范说明"
  placeholder="请输入说明"
  model:value="{{dlUnstandardReason}}"
  disabled="{{readOnly}}"
/>
<!-- <t-input
  label="更新时间"
  placeholder="请输入更新时间"
  model:value="{{_createTime}}"
  disabled="{{readOnly}}"
/> -->
<block wx:if="{{_imgPath.length > 0}}">
  <t-cell title="现场图片">
    <view class="img-group" slot="description">
      <view wx:for="{{_imgPath}}" wx:key="index" wx:for-item="m">
        <t-image
          src="{{m}}"
          t-class="img-group_img"
          shape="round"
          bindtap="previewImage"
          data-index="{{index}}"
        />
      </view>
    </view>
  </t-cell>
</block>
<view wx:if="{{!readOnly}}" style="display: flex; gap: 4">
  <t-button theme="light" block size="small" bind:tap="cancel">取消</t-button>
  <t-button wx:if="{{!isUpdate}}" theme="primary" block block size="small" bind:tap="confirm"
@@ -47,4 +68,4 @@
  >
  <t-button wx:else theme="primary" block block size="small" bind:tap="update">更新</t-button>
</view>
<!-- <t-divider /> -->
<t-divider />
pages/inspection/scene/info/components/device-location/index.wxss
@@ -7,3 +7,14 @@
  padding: 0 16px;
  margin-top: 8px;
}
.img-group {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.img-group .img-group_img {
  width: 30vw;
  height: 30vw;
}
pages/inspection/scene/info/device-info-items.js
@@ -69,7 +69,7 @@
    hideInputItem('场景id', 'piSceneGuid'),
    hideInputItem('场景类型', 'piSceneTypeId'),
    baseInputItem('站点名称', 'piName', true),
    baseInputItem('设备名称', 'piName', true),
    baseInputItem('设备编号', 'piDeviceCode'),
    // è®¾å¤‡ç±»åž‹å’Œè®¾å¤‡å­ç±»åˆå¹¶ç”¨çº§è”选择器展示
    baseInputItem(
@@ -112,7 +112,7 @@
    hideInputItem('场景id', 'piSceneGuid'),
    hideInputItem('场景类型', 'piSceneTypeId'),
    baseInputItem('站点名称', 'piName', true),
    baseInputItem('设备名称', 'piName', true),
    baseInputItem('设备编号', 'piDeviceCode'),
    // è®¾å¤‡ç±»åž‹å’Œè®¾å¤‡å­ç±»åˆå¹¶ç”¨çº§è”选择器展示
    baseInputItem(
pages/inspection/scene/info/devicelist.wxml
@@ -35,7 +35,7 @@
        <block wx:for="{{item.items}}" wx:key="index1" wx:for-item="device" wx:for-index="index1">
          <view class="scene__item" >
            <view class="flex-h" style="align-items: flex-start">
              <view class="scene__item-name">{{device.diName}} </view>
              <view class="scene__item-name">{{device._name}} </view>
              <view>
                <t-tag
                  max-width="{{130}}"
@@ -48,7 +48,7 @@
              </view>
            </view>
            <view class="flex-h">
              <view class="scene__item-abstract">编号:{{device.diDeviceCode}} </view>
              <view class="scene__item-abstract">编号:{{device._deviceCode}} </view>
              <view class="scene__item-abstract">{{device._runningStatus}} </view>
            </view>
            <view class="scene__item-abstract">更新时间:{{device._updateTime}} </view>
pages/inspection/scene/search/components/scene-search-result/index.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@
// pages/inspection/scene/search/components/scene-search-result/index.js
Component({
  options: {
    addGlobalClass: true,
  },
  /**
   * ç»„件的属性列表
   */
  properties: {
    result: {
      type: Object,
      value: {
        name: '',
        districtname: '',
        type: '',
      },
    },
  },
  /**
   * ç»„件的初始数据
   */
  data: {
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
    handCellClick(e) {
      this.triggerEvent('click', this.data.result);
    },
  }
})
pages/inspection/scene/search/components/scene-search-result/index.json
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,4 @@
{
  "component": true,
  "usingComponents": {}
}
pages/inspection/scene/search/components/scene-search-result/index.wxml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
<t-cell title="{{result.name}}" hover bind:click="handCellClick">
  <view slot="description" class="enterprise-info__tag">
    <t-tag
      max-width="{{130}}"
      shape="square"
      size="small"
      theme="{{result.extension1 == '1' ? 'success' : 'danger'}}"
      variant="light-outline"
      disabled
      >{{result.extension1 == '1' ? '上线中' : '已下线'}}</t-tag
    >
    <t-tag
      t-class="t-class-tag"
      max-width="{{130}}"
      shape="square"
      size="small"
      theme="default"
      variant="light"
      >{{result.districtname}}</t-tag
    >
    <t-tag
      t-class="t-class-tag"
      max-width="{{130}}"
      shape="square"
      size="small"
      theme="default"
      variant="light"
      >{{result.type}}</t-tag
    >
  </view>
</t-cell>
pages/inspection/scene/search/components/scene-search-result/index.wxss
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
.enterprise-info__tag {
  display: flex;
  justify-content: flex-end;
}
.t-class-tag {
  margin-left: 16rpx;
}
pages/inspection/scene/search/index.js
@@ -1,66 +1,158 @@
// pages/inspection/scene/search/index.js
import { fetchEnterprise } from '../../../../services/enterprise/fetchEnterprise';
import { searchScene } from '../../../../services/inspection/fetchScene';
import { useLoading } from '../../../../behaviors/loading';
Page({
  /**
   * é¡µé¢çš„初始数据
   */
  behaviors: [useLoading],
  data: {
    placeholder: '输入关键词搜索场景',
    searchValue: '',
    isSearch: false,
    searchResult: [],
    historyWords: [],
    dialog: {
      title: '确认删除当前历史记录',
      showCancelButton: true,
      message: '',
    },
    dialogShow: false,
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
  historyTag: 'historyScene',
  deleteType: 0,
  deleteIndex: '',
  },
  onLoad(options) {},
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面显示
   */
  onShow() {
    this.queryHistory();
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面隐藏
   */
  onHide() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面卸载
   */
  onUnload() {
  },
  /**
   * é¡µé¢ç›¸å…³äº‹ä»¶å¤„理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * é¡µé¢ä¸Šæ‹‰è§¦åº•事件的处理函数
   */
  onReachBottom() {
    this._loadMore();
  },
  /**
   * ç”¨æˆ·ç‚¹å‡»å³ä¸Šè§’分享
   */
  onShareAppMessage() {
  queryHistory() {
    wx.getStorage({
      key: this.historyTag,
      success: res => {
        this.setData({
          historyWords: res.data,
        });
      },
    });
  },
  //删除某个历史记录
  deleteCurr(e) {
    const { index } = e.currentTarget.dataset;
    const { dialog } = this.data;
    this.deleteIndex = index;
    this.setData({
      dialog: {
        ...dialog,
        message: '确认删除当前历史记录',
        deleteType: 0,
      },
      dialogShow: true,
    });
  },
  //清空历史记录
  handleClearHistory() {
    const { dialog } = this.data;
    this.deleteType = 1;
    this.setData({
      dialog: {
        ...dialog,
        message: '确认删除所有历史记录',
      },
      dialogShow: true,
    });
  },
  confirm() {
    const { historyWords } = this.data;
    const { deleteType, deleteIndex } = this;
    if (deleteType === 0) {
      historyWords.splice(deleteIndex, 1);
      this.setData({
        historyWords,
        dialogShow: false,
      });
    } else {
      this.setData({ historyWords: [], dialogShow: false });
  }
})
    wx.setStorage({
      key: this.historyTag,
      data: [],
    });
  },
  close() {
    this.setData({ dialogShow: false });
  },
  //点击历史记录
  handleHistoryTap(e) {
    const { historyWords } = this.data;
    const { dataset } = e.currentTarget;
    const _searchValue = historyWords[dataset.index || 0] || '';
    if (_searchValue) {
      this.setData({ searchValue: _searchValue });
      this._startLoad();
    }
  },
  //点击搜索
  handleSubmit() {
    const { historyWords, searchValue } = this.data;
    if (historyWords.indexOf(searchValue) == -1) {
      historyWords.push(searchValue);
      this.setData({ historyWords });
    }
    wx.setStorage({
      key: this.historyTag,
      data: historyWords,
    });
    this._startLoad();
  },
  //清除搜索
  handleClear() {
    this.setData({ searchValue: '', searchResult: [], isSearch: false });
  },
  handleChange() {
    if (this.data.searchValue == '') {
      this.setData({ searchResult: [], isSearch: false });
    }
  },
  _fetchData(page) {
    const { searchValue } = this.data;
    if (searchValue.length === 0) return;
    this.setData({ isSearch: true });
    const area = {
      sceneName: searchValue,
    };
    return searchScene(area, page).then(res => {
      this.setData({
        searchResult: page == 1 ? res.data : this.data.searchResult.concat(res.data),
      });
      return res.head;
    });
  },
  handCellClick(e) {
    const scene = e.detail;
    wx.navigateTo({
      url: '/pages/inspection/scene/info/index',
      success: result => {
        result.eventChannel.emit('acceptSceneData', {
          scene: scene,
        });
      },
    });
  },
});
pages/inspection/scene/search/index.json
@@ -1,3 +1,7 @@
{
  "usingComponents": {}
  "navigationBarTitleText": "搜索",
  "onReachBottomDistance": 10,
  "usingComponents": {
    "scene-search-result": "./components/scene-search-result/index"
  }
}
pages/inspection/scene/search/index.wxml
@@ -1,2 +1,71 @@
<!--pages/inspection/scene/search/index.wxml-->
<text>pages/inspection/scene/search/index.wxml</text>
<!--pages/search/index.wxml-->
<view class="page">
  <view class="page-header">
    <t-search
      placeholder="{{placeholder}}"
      model:value="{{searchValue}}"
      bind:submit="handleSubmit"
      bind:clear="handleClear"
      bind:change="handleChange"
      focus
    >
    </t-search>
  </view>
  <view class="page-container">
    <scene-search-result
      wx:for="{{searchResult}}"
      wx:key="index"
      wx:for-index="index"
      result="{{item}}"
      bind:click="handCellClick"
    ></scene-search-result>
    <load-more
      list-is-empty="{{!searchResult.length}}"
      status="{{loadStatus}}"
      bind:retry="_startLoad"
    />
    <t-empty
      wx:if="{{loadStatus == 2 && isSearch && searchResult.length == 0}}"
      icon="info-circle-filled"
      description="无匹配记录"
    />
    <block wx:if="{{!isSearch}}">
      <view wx:if="{{historyWords.length > 0}}" class="history-wrap">
        <view class="search-header">
          <text class="search-title">历史搜索</text>
          <text class="search-clear" bind:tap="handleClearHistory">清除</text>
        </view>
        <view class="search-content">
          <view
            class="search-item"
            hover-class="hover-history-item"
            wx:for="{{historyWords}}"
            bind:tap="handleHistoryTap"
            bindlongpress="deleteCurr"
            data-index="{{index}}"
            wx:key="index"
          >
            {{item}}
          </view>
        </view>
      </view>
      <t-empty
        wx:else
        t-class-image="t-empty__image"
        image="/res/nodata.png"
        description="请搜索"
      />
    </block>
  </view>
  <view class="page-footer"></view>
  <t-dialog
    visible="{{dialogShow}}"
    content="{{dialog.message}}"
    bindconfirm="confirm"
    bind:close="close"
    confirm-btn="确定"
    cancel-btn="{{dialog.showCancelButton ? '取消' : null}}"
    t-class-confirm="add-notes__confirm"
  />
</view>
pages/inspection/scene/search/index.wxss
@@ -1 +1,61 @@
/* pages/inspection/scene/search/index.wxss */
.page {
  background-color: var(--td-white-color1);
}
.history-wrap {
  margin-top: 44rpx;
}
.search-header {
  display: flex;
  flex-flow: row nowrap;
  justify-content: space-between;
  align-items: center;
}
.search-title {
  font-size: 30rpx;
  font-family: PingFangSC-Semibold, PingFang SC;
  font-weight: 600;
  color: rgba(51, 51, 51, 1);
  line-height: 42rpx;
}
.search-clear {
  font-size: 24rpx;
  font-family: PingFang SC;
  line-height: 32rpx;
  color: #999999;
  font-weight: normal;
}
.search-content {
  overflow: hidden;
  display: flex;
  flex-flow: row wrap;
  justify-content: flex-start;
  align-items: flex-start;
  margin-top: 24rpx;
}
.search-item {
  color: #333333;
  font-size: 24rpx;
  line-height: 32rpx;
  font-weight: normal;
  margin-right: 24rpx;
  margin-bottom: 24rpx;
  background: #f5f5f5;
  border-radius: 38rpx;
  padding: 12rpx 24rpx;
}
.add-notes__confirm {
  color: #fa4126 !important;
  /* color: #0d80a3 !important; */
}
.t-empty__image {
  width: 240rpx !important;
  height: 240rpx !important;
}
pages/usercenter/index.js
@@ -90,6 +90,11 @@
  },
  logout() {
    app.globalData.onLaunch.forEach(fun => {
      if (typeof fun === 'function') {
        fun();
      }
    });
    wx.reLaunch({
      url: '/pages/usercenter/login/login-home/index',
    });
pages/usercenter/menu.js
@@ -1,7 +1,7 @@
export const menuData = [
  [
    {
      title: '现场监管',
      title: '设备管理',
      tit: '',
      url: '',
      type: 'supervision',
project.private.config.json
@@ -2,8 +2,8 @@
  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json ä¸­çš„相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
  "projectname": "ep-law-abiding-manage-weixin",
  "setting": {
    "compileHotReLoad": true,
    "compileHotReLoad": false,
    "urlCheck": false
  },
  "libVersion": "3.4.10"
  "libVersion": "3.5.3"
}
services/inspection/fetchDevice.js
@@ -5,7 +5,7 @@
import { get, post, put } from '../baseRequset';
import { inspectUrl, inspectPicUrl } from '../../config/index';
import { transSceneType } from '../../model/sceneType';
import { getDeviceList } from '../../model/device';
import { getDeviceList, getDeviceStatusList } from '../../model/device';
/**
 * èŽ·å–åœºæ™¯è®¾å¤‡åŸºæœ¬ä¿¡æ¯
@@ -86,6 +86,7 @@
    },
    inspectUrl,
  ).then(res => {
    res.data.data = getDeviceStatusList(res.data.data)
    return res.data;
  });
}
services/inspection/fetchInspection.js
@@ -95,10 +95,10 @@
    },
    inspectUrl,
  ).then(res => {
    res.data.data = getInspectionStatisticList(res.data.data);
    return res.data;
    // res.data = getInspectionStatisticList(res.data);
    // return res;
    // res.data.data = getInspectionStatisticList(res.data.data);
    // return res.data;
    res.data = getInspectionStatisticList(res.data);
    return res;
  });
}