import { UN_REQ_NUM } from "@/constant/sys"; import { getCaseScriptSaveOrUpdateUrl, getCaseScriptInfoUrl, getVideoCover, axios, } from "@/request"; export enum FireStatus { all = UN_REQ_NUM, incomplete = 0, complete = 1, } export type Fire = { accidentDate: string; createTime: string; creatorDeptId: string; caseId: number; mapShow: boolean; creatorId: string; creatorName: string; deptId: string; editTime: string; editorId: string; editorName: string; fireReason: string; id: string; isTeached: number; organizerDeptName: string; organizerUsers: string; projectAddress: string; latAndLong: string; latlng: string; projectName: string; projectSite: string; projectSiteCode: string; projectSn: string; status: FireStatus; statusDesc: string; updateTime: string; isDelete?: number; field1: string; field2: string; field3: string; field4: string; field5: string; field6: string; field7: string; field8: string; field9: string; field10: string; }; export enum FirePaggingRoute { fire = 1, teached = 2, } export const getCaseScriptInfo = async (caseId) => { let res = await axios.get(getCaseScriptInfoUrl, { params: { caseId, ingoreRes: true } }); console.log(res); if (res && res.code === 0) { return res.data; } else { // window.location.href = '/' throw "用户未登录"; } } export const CaseScriptSaveOrUpdate = async (fire: Omit) => axios.post(getCaseScriptSaveOrUpdateUrl, fire, { params: { ingoreRes: true } }); export const CaseScriptGetCover = async (url: string, width = 200, height = 200) => (await axios.get(getVideoCover, { params: { videoPath: url, width, height } })).data;