import HttpAxios from '@/utils/axios'

const base = import.meta.env.VITE_API_HOST
const baseUrl = `${base}/main_new_version.php`


/**
 * 获取subscribe数据
 */
export const getsubscribe = (params: any, config: any) => {
  return HttpAxios.get(
    `${baseUrl}`,
    {
      action: 'system_setting',
      operate: 'subscribe_notification_init',
      ...params
    },
    config
  )
}
/**
 * 提交subscribe数据
 */
export const Savesubscribe = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'system_setting',
      operate: 'subscribe_notification_event_update',
      ...params
    },
    config
  )
}
/**
 * 删除AddedRules表格数据
 */
export const DeleteAddedRules = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'system_setting',
      operate: 'subscribe_notification_rules_delete',
      ...params
    },
    config
  )
}
/**
 * 收藏
 */
export const SubscribeShipments = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'system_setting',
      operate: 'subscribe_shipment',
      ...params
    },
    config
  )
}
/**
 * 收藏表格分页切换
 */
export const SubscribePagination = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'system_setting',
      operate: 'subscribe_shipment_search',
      ...params
    },
    config
  )
}
/**
 * 初始化数据
 */
export const MonitoringInit = (params: any, config: any) => {
  return HttpAxios.get(
    `${baseUrl}`,
    {
      action: 'monitoring_setting',
      operate: 'monitoring_rules_init',
      ...params
    },
    config
  )
}
/**
 * Monitoring保存数据
 */
export const MonitoringSave = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'monitoring_setting',
      operate: 'monitoring_rules_do',
      ...params
    },
    config
  )
}
/**
 * Monitoring表格数据
 */
export const MonitoringTable = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'monitoring_setting',
      operate: 'monitoring_rules_search',
      ...params
    },
    config
  )
}
/**
 * 删除Monitoring表格数据
 */
export const deleteMonitoringTable = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'monitoring_setting',
      operate: 'monitoring_rules_delete',
      ...params
    },
    config
  )
}
/**
 * 编辑Monitoring表格数据
 */
export const EditMonitoringTable = (params: any, config: any) => {
  return HttpAxios.post(
    `${baseUrl}`,
    {
      action: 'monitoring_setting',
      operate: 'monitoring_rules_edit',
      ...params
    },
    config
  )
}