feat: 接入 UserHome 前端业务代码(含真实 src/依赖,保留 projman 标准 CI)
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
import { DesktopAppTypeEnum, LightApp, UserSettingInfo, WidgetPositionResp } from "@/types";
|
||||
import { BaseDict, PageData, PageParams } from "@/types/Basics";
|
||||
import Abstract from "@/utils/axios/abstract";
|
||||
|
||||
const path = "/api";
|
||||
|
||||
class UserSettings extends Abstract {
|
||||
getUserWallpaperList(schId: number) {
|
||||
const url = path + "/getUserWallpaperList";
|
||||
return this.getRequest<any[]>({ url, params: { schId } });
|
||||
}
|
||||
|
||||
deleteWallById(id: number) {
|
||||
const url = path + "/deleteWallById";
|
||||
return this.postRequest({ url, params: { id } });
|
||||
}
|
||||
|
||||
checkWallpaper(schId: number, wallpaperUrl: string) {
|
||||
const url = path + "/checkWallpaper";
|
||||
return this.postRequest({ url, data: { schId, wallpaperUrl } });
|
||||
}
|
||||
|
||||
getLogoList() {
|
||||
const url = path + "/getLogoList";
|
||||
return this.getRequest<any[]>({ url });
|
||||
}
|
||||
|
||||
deleteLogoById(id: number) {
|
||||
const url = path + "/deleteLogoById";
|
||||
return this.postRequest({ url, params: { id } });
|
||||
}
|
||||
|
||||
getUserSettings() {
|
||||
const url = path + "/getUserSettings";
|
||||
return this.getRequest<UserSettingInfo>({ url });
|
||||
}
|
||||
|
||||
toggleWidgetShow(id?: number) {
|
||||
const url = path + "/toggleWidgetShow";
|
||||
return this.postRequest<any>({ url, data: { id } });
|
||||
}
|
||||
saveUserWidget(info: WidgetPositionResp) {
|
||||
const url = path + "/saveUserWidget";
|
||||
return this.postRequest<any>({ url, data: info as any });
|
||||
}
|
||||
|
||||
saveUserAppIds(id: number | undefined, appIds: string) {
|
||||
const url = path + "/saveUserAppIds";
|
||||
return this.postRequest<any>({ url, data: { id, appIds } });
|
||||
}
|
||||
|
||||
getLightAppSel() {
|
||||
const url = path + "/getLightAppGroup";
|
||||
return this.getRequest<any[]>({ url });
|
||||
}
|
||||
|
||||
getLightAppList(): Promise<any[]> {
|
||||
const url = path + "/getLightAppList";
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let result: any[] = await this.getRequest<any[]>({ url });
|
||||
result.forEach(element => {
|
||||
if (!!element.layout) element.layout = JSON.parse(element.layout);
|
||||
});
|
||||
resolve(result);
|
||||
});
|
||||
}
|
||||
saveLightApp(lightapp: LightApp) {
|
||||
const url = path + "/saveLightApp";
|
||||
lightapp.layout = JSON.stringify(lightapp.layout);
|
||||
return this.postRequest<any[]>({ url, data: lightapp as any });
|
||||
}
|
||||
deleteLightAppById(id: number) {
|
||||
const url = path + "/deleteLightAppById";
|
||||
return this.postRequest({ url, params: { id } });
|
||||
}
|
||||
|
||||
getUserDesktopAppList() {
|
||||
const url = path + "/getUserDesktopAppList";
|
||||
return this.getRequest<any[]>({ url });
|
||||
}
|
||||
|
||||
saveUserDesktopAppById(appId: number, type: DesktopAppTypeEnum) {
|
||||
const url = path + "/saveUserDesktopAppById";
|
||||
return this.postRequest<any>({ url, data: { id: appId, type } });
|
||||
}
|
||||
|
||||
deleteUserDesktopAppById(id: number, appId: number) {
|
||||
const url = path + "/deleteDesktopAppById";
|
||||
return this.postRequest<any>({ url, data: { id, appId } });
|
||||
}
|
||||
sortUserDesktopApp(ids: number[]) {
|
||||
const url = path + "/sortUserDesktopApp";
|
||||
return this.postRequest<any>({ url, data: { ids: ids.join(",") } });
|
||||
}
|
||||
}
|
||||
|
||||
export default new UserSettings();
|
||||
Reference in New Issue
Block a user