/*
 * @Author: your name
 * @Date: 2022-01-12 15:29:56
 * @LastEditTime: 2022-01-14 11:34:27
 * @LastEditors: Please set LastEditors
 * @Description: CAD图纸核查管理
 * @FilePath: \adm-frontend\src\controller\cadDarwingController.ts
 */
import { baseHttpUtils } from "@/utils/http/baseHttpUtils";
import { customHttpUtils } from '@/utils/http/customHttpUtils'
import { logicConfig } from "@/logicConfig";
export default class cadDarwingController {
    static baseUril = (window as any).__systemConf.baseServiceUrl;
    static http = new baseHttpUtils();
    static customHttp = new customHttpUtils()

    /**
     * @description: 查询文件列表接口
     * @param {*}
     * @return {*}
     */    
    static async queryFileList (params={}) {
        const headers = {
            'Content-Type': 'application/json',
            'token': '16:31eyJhbGciOiJIUzI1NiJ9.eyJkZXZpY2VUeXBlIjoxLCJhdWQiOiJ5dXNodS1zYWFzLWNsaWVudCIsInN1YiI6Inl1c2h1LXVzZXIiLCJhY2NvdW50SWQiOiIxNDc4MjcyMTQwNjU4MjAwNTc4IiwiYWNjb3VudE5hbWUiOiLmnY7mnbAiLCJpc3MiOiJ5dXNodSIsImp0aSI6ImEyYzgwYWQxLTRkZTgtNDVjMy04ODMyLTE5MzUxNWU3OWFmMCJ9.HYLA4Tc2c4TEDRXdi9dJ39zWuVmBoGoj5VrGRJk_9Ec'
        }
        try {
            const res = await this.customHttp.customRequest(`${this.baseUril}/adm-server/adm/adm-file/queryCadFiles?projectId=Pj5001120003&groupCode=XG&userId=adm`, headers, params, 'post');
            if(res?.result != logicConfig.resultObj.success) {
                console.log('error');
                return []
            }
            return res.data
        } catch (error) {
            
        } 
    }
    /**
     * @description: 删除文件接口
     * @param {*}
     * @return {*}
     */    
    static async delFile(params) {
        const headers = {
            'Content-Type': 'application/x-www-form-urlencoded',
            'token': '16:31eyJhbGciOiJIUzI1NiJ9.eyJkZXZpY2VUeXBlIjoxLCJhdWQiOiJ5dXNodS1zYWFzLWNsaWVudCIsInN1YiI6Inl1c2h1LXVzZXIiLCJhY2NvdW50SWQiOiIxNDc4MjcyMTQwNjU4MjAwNTc4IiwiYWNjb3VudE5hbWUiOiLmnY7mnbAiLCJpc3MiOiJ5dXNodSIsImp0aSI6ImEyYzgwYWQxLTRkZTgtNDVjMy04ODMyLTE5MzUxNWU3OWFmMCJ9.HYLA4Tc2c4TEDRXdi9dJ39zWuVmBoGoj5VrGRJk_9Ec'
        }
        try {
            const res = await this.customHttp.customRequest(`${this.baseUril}/adm-server/adm/adm-file/delete?projectId=Pj5001120003&groupCode=XG&userId=adm&id=${params.id}`, headers, {}, 'post');
            if(res?.result != logicConfig.resultObj.success) {
                console.log('error');
                return []
            }
            return res.data
        } catch (error) {
            
        }
    }
}