riku
2024-11-07 5036880fc037e5d112206b93a729f60be12bf8ab
2024.11.07 bug修复

1. 优化设备管理功能中上传完成后的界面效果;
2. 修复部分bug
已修改12个文件
已添加2个文件
4577 ■■■■■ 文件已修改
common/common.rar 补丁 | 查看 | 原始文档 | blame | 历史
common/dataSceneTypes.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/index.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/sceneType.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json 4413 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/enterprise/search/index.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/info/device-info-items.js 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/info/device-info/index.js 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/info/device-status/index.wxml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/info/device-status/index.wxss 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/info/devicelist-proxy.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/info/devicelist.wxml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspection/scene/info/index.wxml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
project.private.config.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/common.rar
Binary files differ
common/dataSceneTypes.js
@@ -29,7 +29,7 @@
      return item.value == value;
    });
  }
  return r.label;
  return r ? r.label : '其他';
}
function toValue(label) {
config/index.js
@@ -1,5 +1,5 @@
// å®ˆæ³•自助小程序
// const baseUrl = 'http://192.168.0.138:8080';
// const baseUrl = 'http://192.168.0.138:8082';
const baseUrl = 'https://fyami.com.cn';
const bu = 'https://fyami.com.cn';
@@ -17,7 +17,7 @@
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 };
model/sceneType.js
@@ -20,7 +20,12 @@
 * å°†å°ç¨‹åºçš„场景类型值转换为巡查监管系统中相同类型场景的值
 */
function transSceneType(value) {
  const s = sceneMap[value]
  let s = sceneMap[value]
  if (s == undefined) {
    if (value != undefined) {
      s = '-1'
    }
  }
  return s
  // return s == undefined ? '-1' : s;
}
package-lock.json
¶Ô±ÈÐÂÎļþ
ÎļþÌ«´ó
pages/enterprise/search/index.js
@@ -134,7 +134,10 @@
    this.setData({ isSearch: true });
    return fetchEnterprise({
      page,
      data: { searchText: searchValue },
      data: {
        searchText: searchValue,
        userTypeId: 3
      },
    }).then(res => {
      this.setData({
        searchResult:
pages/inspection/scene/info/device-info-items.js
@@ -106,14 +106,14 @@
 */
export function productionDeviceForm(sceneType, defaultValue) {
  const items = [
    hideInputItem('id', 'piId'),
    hideInputItem('创建时间', 'piCreateTime'),
    hideInputItem('更新时间', 'piUpdateTime'),
    hideInputItem('场景id', 'piSceneGuid'),
    hideInputItem('场景类型', 'piSceneTypeId'),
    hideInputItem('id', 'wiId'),
    hideInputItem('创建时间', 'wiCreateTime'),
    hideInputItem('更新时间', 'wiUpdateTime'),
    hideInputItem('场景id', 'wiSceneGuid'),
    hideInputItem('场景类型', 'wiSceneTypeId'),
    baseInputItem('设备名称', 'piName', true),
    baseInputItem('设备编号', 'piDeviceCode'),
    baseInputItem('设备名称', 'wiName', true),
    baseInputItem('设备编号', 'wiDeviceCode'),
    // è®¾å¤‡ç±»åž‹å’Œè®¾å¤‡å­ç±»åˆå¹¶ç”¨çº§è”选择器展示
    baseInputItem(
      '设备类型',
@@ -122,22 +122,22 @@
      'cascader',
      productionDevices(sceneType),
      ['选择设备类型', '选择设备子类'],
      ['piTypeId', 'piSubtypeId'],
      ['wiTypeId', 'wiSubtypeId'],
    ),
    // baseInputItem('设备类型', 'piTypeId', true, 'picker'),
    // baseInputItem('设备子类', 'piSubtypeId', true, 'picker'),
    baseInputItem('供应商', 'piSupplier'),
    baseInputItem('服务商', 'piServicer'),
    baseInputItem('服务人员', 'piMaintainStaff'),
    baseInputItem('服务电话', 'piMaintainTel'),
    baseInputItem('运行状态', 'piRunningStatus', true, 'picker', status),
    baseInputItem('品牌型号', 'piBrandModel'),
    baseInputItem('设备参数', 'piDeviceParam'),
    baseInputItem('所有权', 'piOwnership', true, 'picker', ownership),
    baseInputItem('供应商', 'wiSupplier'),
    baseInputItem('服务商', 'wiServicer'),
    baseInputItem('服务人员', 'wiMaintainStaff'),
    baseInputItem('服务电话', 'wiMaintainTel'),
    baseInputItem('运行状态', 'wiRunningStatus', true, 'picker', status),
    baseInputItem('品牌型号', 'wiBrandModel'),
    baseInputItem('设备参数', 'wiDeviceParam'),
    baseInputItem('所有权', 'wiOwnership', true, 'picker', ownership),
    // todo 2024/8/12: åŽç»­è¦æ·»åŠ äºŒç»´ç çš„ä¿¡æ¯æ‰«æå½•å…¥
    // baseInputItem('标识二维码', 'piQRCode'),
    // baseInputItem('其他第三方或设备自带二维码', 'piOtherQRCode'),
    // baseInputItem('标识二维码', 'wiQRCode'),
    // baseInputItem('其他第三方或设备自带二维码', 'wiOtherQRCode'),
  ];
  setDefaultValue(items, defaultValue);
  return items;
pages/inspection/scene/info/device-info/index.js
@@ -18,31 +18,41 @@
    this.getOpenerEventChannel().on('acceptDeviceData', data => {
      if (data) {
        const { scene, type, mode, deviceInfo } = data;
        let barTitle = mode == 'add' ? '新增':'修改', _formArr;
        let barTitle = mode == 'add' ? '新增' : '修改',
          _formArr;
        switch (type) {
          case 1:
            barTitle += '治理设备';
            let defaultValue1 = mode == 'update' ? deviceInfo : {
            let defaultValue1 =
              mode == 'update'
                ? deviceInfo
                : {
              piSceneGuid: scene.guid,
              piSceneTypeId: scene.typeid,
            }
                  };
            _formArr = treatmentDeviceForm(scene.typeid, defaultValue1);
            break;
          case 2:
            barTitle += '生产设备';
            let defaultValue2 = mode == 'update' ? deviceInfo : {
            let defaultValue2 =
              mode == 'update'
                ? deviceInfo
                : {
              wiSceneGuid: scene.guid,
              wiSceneTypeId: scene.typeid,
            }
                  };
            _formArr = productionDeviceForm(scene.typeid, defaultValue2);
            break;
          case 0:
          default:
            barTitle += '监测设备';
            let defaultValue0 = mode == 'update' ? deviceInfo : {
            let defaultValue0 =
              mode == 'update'
                ? deviceInfo
                : {
              diSceneGuid: scene.guid,
              diSceneTypeId: scene.typeid,
            }
                  };
            _formArr = monitorDeviceForm(scene.typeid, defaultValue0);
            break;
        }
@@ -75,14 +85,32 @@
  // å–消表单
  cancel() {
    console.log('cancel');
    // console.log('cancel');
    wx.navigateBack({
      delta: 1,
      success: res => {},
      fail: res => {},
      complete: res => {},
    });
  },
  // æ–°å¢žè®¾å¤‡ä¿¡æ¯
  addDevice(formObj) {
    const { deviceType } = this.data;
    uploadDevice(formObj, deviceType).then(res => {
      console.log(res);
      // console.log(res);
      this.getOpenerEventChannel().emit('updateDeviceInfoOver');
      wx.navigateBack({
        delta: 1,
        success: () => {
          wx.showToast({
            title: '设备新增成功',
            duration: 2000,
            icon: 'success',
            mask: true,
          });
        },
      });
    });
  },
@@ -90,7 +118,19 @@
  updateDevice(formObj) {
    const { deviceType } = this.data;
    updateDevice(formObj, deviceType).then(res => {
      console.log(res);
      // console.log(res);
      this.getOpenerEventChannel().emit('updateDeviceInfoOver');
      wx.navigateBack({
        delta: 1,
        success: () => {
          wx.showToast({
            title: '设备修改成功',
            duration: 2000,
            icon: 'success',
            mask: true,
          });
        },
      });
    });
  },
});
pages/inspection/scene/info/device-status/index.wxml
@@ -1,5 +1,6 @@
<view class="page">
  <view class="page-header">
    <view class="flex-center">
    <t-button
      wx:if="{{!showNewStatus}}"
      icon="add"
@@ -8,6 +9,7 @@
      bind:tap="onAddStatus"
      >添加设备状态</t-button
    >
    </view>
    <t-form
      wx:if="{{showNewStatus}}"
      formArr="{{formArray}}"
@@ -39,6 +41,7 @@
      </t-cell>
    </t-form>
  </view>
  <t-divider />
  <view class="page-container">
    <block wx:for="{{deviceStatusList}}">
      <device-location
pages/inspection/scene/info/device-status/index.wxss
@@ -1 +1,9 @@
/* pages/inspection/scene/info/device-status/index.wxss */
.page-header {
  background-color: white;
}
.flex-center {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}
pages/inspection/scene/info/devicelist-proxy.js
@@ -54,6 +54,11 @@
            mode: 'add',
          });
        },
        events: {
          updateDeviceInfoOver: () => {
            this.fetchDeviceInfo(this.data.categories[this.data.sideBarIndex].type)
          },
        },
      });
    },
    updateDevice(e) {
@@ -72,6 +77,11 @@
            deviceInfo,
          });
        },
        events: {
          updateDeviceInfoOver: () => {
            this.fetchDeviceInfo(this.data.categories[this.data.sideBarIndex].type)
          },
        },
      });
    },
@@ -90,6 +100,11 @@
            deviceInfo,
          });
        },
        events: {
          updateDeviceStatusOver: () => {
            this.fetchDeviceInfo(this.data.categories[this.data.sideBarIndex].type)
          },
        },
      });
    }
  },
pages/inspection/scene/info/devicelist.wxml
@@ -48,8 +48,16 @@
              </view>
            </view>
            <view class="flex-h">
              <view class="scene__item-abstract">编号:{{device._deviceCode}} </view>
              <view class="scene__item-abstract">{{device._runningStatus}} </view>
              <view class="scene__item-abstract">编号:{{device._deviceCode ? device._deviceCode : '未填写'}} </view>
              <!-- <view class="scene__item-abstract">{{device._runningStatus}} </view> -->
              <t-tag
                  max-width="{{130}}"
                  shape="square"
                  size="small"
                  theme="info"
                  variant="outline"
                  >{{device._runningStatus}}</t-tag
                >
            </view>
            <view class="scene__item-abstract">更新时间:{{device._updateTime}} </view>
            <t-divider />
pages/inspection/scene/info/index.wxml
@@ -3,14 +3,14 @@
  <view class="page-container">
    <t-tabs
      theme="card"
      defaultValue="{{0}}"
      defaultValue="{{1}}"
      space-evenly="{{true}}"
      t-class="custom-tabs"
      t-class-content="custom-panel"
    >
      <t-tab-panel label="基本信息" value="{{0}}" class="custom-tab-panel">
      <!-- <t-tab-panel label="基本信息" value="{{0}}" class="custom-tab-panel">
        <view>基本信息</view>
      </t-tab-panel>
      </t-tab-panel> -->
      <t-tab-panel label="设备信息" value="{{1}}" class="custom-tab-panel">
        <include src="./devicelist.wxml" />
      </t-tab-panel>
project.private.config.json
@@ -2,7 +2,7 @@
  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json ä¸­çš„相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
  "projectname": "ep-law-abiding-manage-weixin",
  "setting": {
    "compileHotReLoad": false,
    "compileHotReLoad": true,
    "urlCheck": false
  },
  "libVersion": "3.5.3"