riku
2023-12-18 356f54467f525f437f41271fb62f6be66f2ab1e5
src/api/fysp/sceneApi.js
@@ -7,7 +7,7 @@
   */
  searchScene(area, page = 1, perPage = 20) {
    const params = `page=${page}&per_page=${perPage}`;
    return $fysp.post(`scense/find?${params}`, area).then((res) => res.data);
    return $fysp.post(`scense/find?${params}`, area);
  },
  /**
@@ -16,13 +16,11 @@
   * @returns 场景详情
   */
  getSceneDetail(sId) {
    return $fysp
      .get(`scense/detail`, {
    return $fysp.get(`scense/detail`, {
        params: {
          sceneId: sId,
        },
      })
      .then((res) => res.data);
        sceneId: sId
      }
    });
  },
  /**
@@ -33,29 +31,23 @@
    const rb = {
      scense: scene ? scene : null,
      subScene: subScene ? JSON.stringify(subScene) : null,
      sceneDevice: sceneDevice ? sceneDevice : null,
      sceneDevice: sceneDevice ? sceneDevice : null
    };
    return $fysp
      .post(`scense/detail/update?${params}`, rb)
      .then((res) => res.data);
    return $fysp.post(`scense/detail/update?${params}`, rb);
  },
  /**
   * 更新场景额外信息
   */
  updateSubScene(typeId, subScene) {
    return this.updateSceneDetail(typeId, { subScene: subScene }).then(
      (res) => res.data
    );
    return this.updateSceneDetail(typeId, { subScene: subScene });
  },
  /**
   * 更新场景设备信息
   */
  updateSceneDevice(typeId, sceneDevice) {
    return this.updateSceneDetail(typeId, { sceneDevice: sceneDevice }).then(
      (res) => res.data
    );
    return this.updateSceneDetail(typeId, { sceneDevice: sceneDevice });
  },
  /**
@@ -63,7 +55,7 @@
   * @param {Object} scene
   */
  createScene(scene) {
    return $fysp.put('scense', scene).then((res) => res.data);
    return $fysp.put('scense', scene);
  },
  /**
@@ -71,6 +63,6 @@
   * @param {Object} scene
   */
  updateScene(scene) {
    return $fysp.post('scense', scene).then((res) => res.data);
  },
    return $fysp.post('scense', scene);
  }
};