riku
2025-09-17 4aa86b1ec441c4e358e1cc488d8f021fb80f1355
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);
    return $fysp.post(`scense/find?${params}`, area).then((res) => res.data);
  },
  /**
@@ -16,11 +16,13 @@
   * @returns 场景详情
   */
  getSceneDetail(sId) {
    return $fysp.get(`scense/detail`, {
      params: {
        sceneId: sId
      }
    });
    return $fysp
      .get(`scense/detail`, {
        params: {
          sceneId: sId
        }
      })
      .then((res) => res.data);
  },
  /**
@@ -33,21 +35,27 @@
      subScene: subScene ? JSON.stringify(subScene) : null,
      sceneDevice: sceneDevice ? sceneDevice : null
    };
    return $fysp.post(`scense/detail/update?${params}`, rb);
    return $fysp
      .post(`scense/detail/update?${params}`, rb)
      .then((res) => res.data);
  },
  /**
   * 更新场景额外信息
   */
  updateSubScene(typeId, subScene) {
    return this.updateSceneDetail(typeId, { subScene: subScene });
    return this.updateSceneDetail(typeId, { subScene: subScene }).then(
      (res) => res.data
    );
  },
  /**
   * 更新场景设备信息
   */
  updateSceneDevice(typeId, sceneDevice) {
    return this.updateSceneDetail(typeId, { sceneDevice: sceneDevice });
    return this.updateSceneDetail(typeId, { sceneDevice: sceneDevice }).then(
      (res) => res.data
    );
  },
  /**
@@ -55,7 +63,7 @@
   * @param {Object} scene
   */
  createScene(scene) {
    return $fysp.put('scense', scene);
    return $fysp.put('scense', scene).then((res) => res.data);
  },
  /**
@@ -63,6 +71,32 @@
   * @param {Object} scene
   */
  updateScene(scene) {
    return $fysp.post('scense', scene);
    return $fysp.post('scense', scene).then((res) => res.data);
  },
  /**
   * 批量更新场景
   */
  updateSceneList(sceneList) {
    return $fysp.post('scense/update/list', sceneList).then((res) => res.data);
  },
  /**
   * 获取所有场景类型
   */
  getAllScene() {
    return $fysp.get('scense/alltype').then((res) => res.data);
  },
  /**
   * 查找场景
   */
  findScene(scene) {
    return $fysp.post('scense/search', scene).then((res) => res.data);
  },
  importScene(file) {
    return $fysp.post('scense/import', file).then((res) => res.data);
  }
};