
import request from '@/utils/request'

// 创建配置
export function createSystemDockingMaster (data) {
  return request({
    url: '/mes/system/docking/add',
    method: 'post',
    data: data
  })
}

// 更新配置
export function updateSystemDockingMaster (data) {
  return request({
    url: '/mes/system/docking/edit',
    method: 'put',
    data: data
  })
}

// 删除配置 
export function deleteSystemDockingMaster (id) {
  return request({
    url: '/mes/system/docking/delete?id=' + id,
    method: 'delete',
    // params
  })
}

// 获得配置
export function getSystemDockingMaster (id) {
  return request({
    url: '/mes/system/docking/getDetail?id=' + id,
    method: 'get'
  })
}

// 获得配置分页
export function getSystemDockingMasterPage (params) {
  return request({
    url: '/mes/system/docking/page',
    method: 'get',
    params
  })
}


// 添加子表数据 
export function dockingDetailCreate (data) {
  return request({
    url: '/mes/system-docking-detail/create',
    method: 'post',
    data: data
  })
}
// 获得配置
export function getdockingDetail (id) {
  return request({
    url: '/mes/system-docking-detail/get?id=' + id,
    method: 'get'
  })
}

// 修改子表数据
export function dockingDetailUpdate (data) {
  return request({
    url: '/mes/system-docking-detail/update',
    method: 'put',
    data: data
  })
}
// 删除子表数据 /mes/system-docking-detail/delete
export function dockingDetailDelete (id) {
  return request({
    url: '/mes/system-docking-detail/delete?id=' + id,
    method: 'delete',
  })
}

// MES-配置页面－主表－查看列表
export function dockingDetailList (data, { appname, modulename, servicename }) {
  const url = `/system/common/api/${appname}/${modulename}/${servicename}/list`;
  return request({
    url,
    method: 'post',
    data
  })
}

// 配置表－服务详情打开页面－是否异常数据返回
export function configDetailEnabled (data) {
  return request({
    url: '/system/common/coreapi/mes/po/configdetailenabled/list',
    method: 'post',
    data
  })
}