import { ApiClientFactory } from '../core/api.client.factory'; import { ICustomizeComponent, IScreenThemeItem, ThemeConfigResult } from '../model/theme.model'; export class ThemeService { constructor(private factory: ApiClientFactory) {} /** * 配置项目bi肤色主题 * @param projectId 项目id * @param config 配置对象 */ async saveThemeValue(projectId: string, config: any): Promise { const data = await this.factory.entity.post(`/api/web/projects/${projectId}/themeConfig`, { theme: config }); return data; } /** * 查询项目bi肤色主题配置 * @param projectId 项目id */ async loadThemeConfigData(projectId: string): Promise { const result = await this.factory.entity.get(`/api/web/projects/${projectId}/themeConfig`); return result; } /** * 查询大屏主题列表 * @param projectId 项目id */ async loadScreenThemeList(projectId: string): Promise { const result = await this.factory.entity.get(`/api/web/projects/${projectId}/largeScreenTheme`); return result; } /** * 项目信息配置详情 * @param projectId 项目id * @param params 查询参数 */ async getProjectPicture(projectId: string, params: any): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/subgroupConfig/projectPicture/list`, params ); return result; } /** * 保存项目信息图片 * @param projectId * @param params 图片列表 */ async saveProjectPicture(projectId: string, params: any): Promise { const result = await this.factory.entity.post( `/api/web/projects/${projectId}/subgroupConfig/projectPicture/save`, params ); return result; } /** * 修改图片来源 * @param projectId * @param params patch参数 */ async updateProjectInfoResourceType(projectId: string, params: any): Promise { const result = await this.factory.entity.patch(`/api/web/projects/${projectId}/subgroupConfig/updateState`, params); return result; } // 自定义组件---------------------------------------------------------------------------- /** * 获取宽屏自定义组件数据 * @param projectId 项目id */ async getCustomizeComponent(projectId: string, componentCode: string, tag: string): Promise { const url = `/api/web/projects/${projectId}/largeScreenConfig/getCustomizeComponent?componentCode=${componentCode}&tag=${tag}`; const result = await this.factory.entity.get(url); return result; } /** * 添加或更新宽屏自定义组件 * @param projectId 项目id */ async saveCustomizeComponent(projectId: string, params: any): Promise { const url = `/api/web/projects/${projectId}/largeScreenConfig/saveCustomizeComponent`; const result = await this.factory.entity.post(url, params); return result; } /** * 获取设备类型列表 * @param projectId */ async getMonitoringDeviceList(projectId: string): Promise { const url = `/api/web/projects/${projectId}/largeScreenConfig/MonitoringDeviceList`; const result = await this.factory.entity.get(url); return result; } /** * 获取项目的设备类型 * @param projectId */ async getMonitoringDeviceTypes(projectId: string): Promise { const url = `/api/web/projects/${projectId}/largeScreenConfig/MonitoringDeviceTypes`; const result = await this.factory.entity.get(url); return result; } /** * 已监测设备列表的添加/修改/改序 * @param projectId */ async saveMonitoringDevice(projectId: string, params: any): Promise { const url = `/api/web/projects/${projectId}/largeScreenConfig/saveMonitoringDevice`; const result = await this.factory.entity.post(url, params); return result; } /** * 进度信息组件保存数据 * @param projectId 项目id */ async saveCustomizeProgressInfoSave(projectId: string, params: any): Promise { const url = `/api/web/projects/${projectId}/subgroupConfig/progressInfo/save`; const result = await this.factory.entity.post(url, params); return result; } /** * 进度信息组件图片保存数据 * @param projectId 项目id */ async saveCustomizeProgressPicSave(projectId: string, params: any): Promise { const url = `/api/web/projects/${projectId}/subgroupConfig/progressPicture/save`; const result = await this.factory.entity.post(url, params); return result; } /** * 进度信息组件图片查询数据 * @param projectId 项目id */ async getCustomizeProgressPicSave(projectId: string): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/subgroupConfig/progressPicture/list` ); return result; } /** * 进度信息组件信息查询数据 * @param projectId 项目id */ async getCustomizeProgressInfoSave(projectId: string): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/subgroupConfig/progressInfo/list` ); return result; } /** * 查询里程碑列表-前台 * @param projectId */ async getMilepostList(projectId: string): Promise { const result = await this.factory.entity.get(`/api/web/projects/${projectId}/largeScreen/milepostInfo`); return result; } /** * 查询里程碑详情 * @param projectId */ async getMilepostInfo(projectId: string): Promise { const result = await this.factory.entity.get(`/api/web/projects/${projectId}/subgroupConfig/milepostInfo/list`); return result; } /** * 里程碑组件保存 * @param projectId * @param params */ async saveMilepostInfo(projectId: string, params: any): Promise { const result = await this.factory.entity.post(`/api/web/projects/${projectId}/subgroupConfig/milepostInfo/save`, params); return result; } /**    * 查询宽屏自定义模型    * @param projectId 项目id    */ async loadCustomModel(projectId: string): Promise { const result = await this.factory.entity.get(`/api/web/projects/${projectId}/largeScreen/customModel`);     return result;   } /** * 获取图片地址 * @param projectId */ async getCustomCentrePicture(projectId: string): Promise { const result = await this.factory.entity.get(`/api/web/projects/${projectId}/largeScreen/customCentrePicture`);     return result;   } }