// 事项api
import local from "@/utils/local"
import request from '@/utils/request'

//let baseUrl = local.getLocal('baseUrl') ? local.getLocal('baseUrl') : 'http://localhost:17002'
let baseUrl = local.getLocal('baseUrl') ? local.getLocal('baseUrl') : 'http://192.168.0.98:11078'
let siteId = local.getLocal('siteId') ? local.getLocal('siteId') : '3'
let devicenum = local.getLocal('devicenum') ? local.getLocal('devicenum') : '90-2B-34-BF-1B-48'
// 首页数据展示
export const getHomeInfo = (data) => {
    return request({
        url: `${baseUrl}/sampleform/home/info`,
        method: "post",
        data: {
            siteId,
            devicenum,
            ...data
        },
    });
};

// 获取部门列表
export const getdeptList = (data) => {
    return request({
        url: `${baseUrl}/sampleform/home/dept/list`,
        method: "post",
        data: {
            siteId,
            ...data
        },
    });
};

// 查询事项列表
export const getWriteMatterList = (data) => {
    return request({
        url: `${baseUrl}/sampleform/matter/list`,
        method: "post",
        data: {
            siteId,
            ...data
        },
    });
};

//   查询材料列表
export const getMaterialsList = (data) => {
    return request({
        url: `${baseUrl}/sampleform/matter/datum/list`,
        method: "post",
        data: {
            siteId,
            ...data
        },
    });
};

// 表单合成
export const mergeFormToDocx = (data) => {
    return request({
        url: `${baseUrl}/sampleform/home/mergeFormToDocx`,
        method: "post",
        data: {
            siteId,
            ...data
        },
    });
};