import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DesignPageEdgesVO, DesignPageEdgesForm, DesignPageEdgesQuery } from '@/api/system/designPageEdges/types';

/**
 * 查询大屏设计页面连接线列表
 * @param query
 * @returns {*}
 */

export const listDesignPageEdges = (query?: DesignPageEdgesQuery): AxiosPromise<DesignPageEdgesVO[]> => {
  return request({
    url: '/system/designPageEdges/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询大屏设计页面连接线详细
 * @param pageEdgesId
 */
export const getDesignPageEdges = (pageEdgesId: string | number): AxiosPromise<DesignPageEdgesVO> => {
  return request({
    url: '/system/designPageEdges/' + pageEdgesId,
    method: 'get'
  });
};

/**
 * 新增大屏设计页面连接线
 * @param data
 */
export const addDesignPageEdges = (data: DesignPageEdgesForm) => {
  return request({
    url: '/system/designPageEdges',
    method: 'post',
    data: data
  });
};

/**
 * 修改大屏设计页面连接线
 * @param data
 */
export const updateDesignPageEdges = (data: DesignPageEdgesForm) => {
  return request({
    url: '/system/designPageEdges',
    method: 'put',
    data: data
  });
};

/**
 * 删除大屏设计页面连接线
 * @param pageEdgesId
 */
export const delDesignPageEdges = (pageEdgesId: string | number | Array<string | number>) => {
  return request({
    url: '/system/designPageEdges/' + pageEdgesId,
    method: 'delete'
  });
};


/**
 * 下拉框查询大屏设计页面连接线列表
 * @param query
 * @returns {*}
 */
export function getSysDesignPageEdgesList (query) {
    return request({
        url: '/system/designPageEdges/getSysDesignPageEdgesList',
        method: 'get',
        params: query
    });
};
