doc.js 1.48 KB
Newer Older
wangdanlei's avatar
wangdanlei committed
1 2 3 4 5 6 7 8
import {
  get,
  post,
  put
  //  del
} from '../utils/http'
// 查询模型配置信息
export function getLayouts(typeKey, layoutType) {
wangdanlei's avatar
wangdanlei committed
9 10 11 12 13 14 15 16 17
  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
        })
      }
    })
  })
wangdanlei's avatar
wangdanlei committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
}
// 查询所有基本属性
export function getappLayout(params) {
  return get('/AppLayout/' + params)
}
// 查询模型配置信息
export function addDoc(params) {
  return post('/DxDocument', params)
}
export function editDoc(params) {
  return put('/DxDocument', params)
}
export function addDocWithRecursion(params) {
  return post('/DxDocument/recursion', params)
}
export function getDetail(params) {
  return get('/DxDocument/detail?', params)
}
export function getDetailWithRecursion({ id, openProps }) {
  const params = {
    'openProps': [],
    'pageFrom': 1,
    'pageSize': 10,
    'searchItems': {
      'children': [
      ],
      'items': [
        {
          'fieldName': 'id',
          'operator': 'EQ',
          'value': id
        }
      ],
      'operator': 'AND'
    }
  }
  params.openProps = openProps
  return post('/DxDocument/search', params)
}
export function approveAdd(params) {
  return post('/DxDocument/approve', params)
}
wangdanlei's avatar
wangdanlei committed
60 61
export function getSubTypeName(packageId, clsName) {
  return get('/ModelDefinition/select/children', { packageId, clsName })
wangdanlei's avatar
wangdanlei committed
62
}