/* * @Description: 通用接口 * @Author: tqh * @Date: 2022-9-1 09:00 */ import { http } from '@/utils/https'; import { downLoadFile } from '../utils/utils'; /** * @description: 获取系统版本号 * @param {string} dictType */ export const getSystemVersion = () => { return http.get('/system/getSystemVersion'); }; //获取系统定制界面 export const getSysInterfaceConfig = () => { return http.get('/common-config/sysInterface/getSysInterfaceConfig'); }; /** * @description: 获取字典列表 * @param {string} dictType */ export const getDictTypeList = (data) => { return http.get('/sys/dict/list', data); }; /** * @description: 获取部门列表 */ export const getDeptList = (data) => { return http.get('/dept/list', data); }; /** * @description: 获取任务记录 */ export const getRecordList = (data) => { return http.get('/task/record', data); }; /** * @description: 获取资产记录 */ export const getRecordAssetsList = (data) => { return http.get('/asset/record', data); }; /** * @description: 获取主机资产下拉框 */ export const getPageList = (data) => { return http.get('/asset/host/page', data); }; /** * @description: 获取主机资产下拉框 */ export const getDownloadFile = (fileName) => { return http .post( `/download?fileName=${fileName}`, { fileName }, { responseType: 'blob', } ) .then((res) => { downLoadFile(res, fileName); }); }; /** * @description: 预览 */ export const postDownloadFile = (fileName) => { return http.post( `/download?fileName=${fileName}`, { fileName }, { responseType: 'blob', } ); }; /** * @description: 查询以及归属部门 * @param {string} dictType */ export const firstLevelList = (data) => { return http.get('/dept/firstLevelList', data); }; /** * @description: 根据部门id查询所有子部门树 */ export const getSubDeptTreeById = (data) => { return http.get('/dept/getSubDeptTreeById', data); };