import {
  get,
  put,
  post
} from '../../utils/http'
// 查询模型配置信息
export function getLayouts(typeKey, layoutType) {
  return new Promise(async(resolve, reject) => {
    get('/DxModelComponent/findModelComponent', { modelDefName: typeKey, layoutType }).then(res => {
      if (res.items && res.items.content) {
        resolve({
          items: res.items.content
        })
      }
    })
  })
}
// 保存文档
export function editDoc(params) {
  return put('/DxDocument', params)
}
// 查询文档详情
export function getDocDetail(params) {
  return get('DxDocument/detail', params)
}
// 查询所有的应用
export function getAllApp() {
  return get('/ModelPackage/all')
}
// 根据业务密级查询用户密级
export function getUserSecretBySecret(params) {
  return get(`/SecretCodeMatrix/getUserSecretBySecret`, params)
}
// 查询所有app
export function getAllApplication(params) {
  return post('/DxApplication/search', params)
}