import axios from '@/common/services/axios-instance'
class AuditTreeService {
  // 获取根节点
  getSelectCaseNode(deptId) {
    return axios({
      url: `api/framework/v1/law-case-action/findLawCaseActionTree?parentCode=${deptId}`,
      method: 'post',
    }).then((res) => {
      res.data.forEach((item) => (item.isLeaf = item.leaf))
      return res
    })
  }

  // 获取根节点
  searchCaseNode(key) {
    return axios({
      url: `api/framework/v1/law-case-action/findActionTreeByKeyWord?keyWord=${key}`,
      method: 'get',
    }).then((res) => {
      res.data.forEach((item) => (item.isLeaf = item.leaf))
      return res
    })
  }
}
export default new AuditTreeService()
