import request from '@/utils/request'

// 新增关联表
export function addGendefini(data) {
  return request({
    url: '/jflow/p/cs/task/relation/list',
    method: 'post',
    data
  })
}
// 刪除
export function addGendefinideal(data) {
  return request({
    url: '/jflow/p/cs/task/batch/deal',
    method: 'post',
    data
  })
}
// 查詢
export function addGendefiniqur(data) {
  return request({
    url: '/jflow/p/cs/task/backlog/list',
    method: 'post',
    data
  })
}

// mesetet
export function addGenmutipor(data) {
  return request({
    url: '/jflow/p/c/identity/org/treequery',
    method: 'post',
    data
  })
}
//查找用户信息
export function addGenmutiporuder(data) {
  return request({
    url: '/jflow/p/c/identity/user/list',
    method: 'post',
    data
  })
}
// 查询用户个人信息
 export function getUserProfiletoo() {
   return request({
     url: '/system/user/profile',
     method: 'get'
   })
 }
//获取树数据
export function addGenmutiportree(data) {
  return request({
    url: '/jflow/p/c/identity/org/treeload',
    method: 'post',
    data
  })
}


// 获取流程图信息  flowshow
export function addGenflowshow(data) {
  return request({
    url: '/jflow/p/c/task/backlog/detail',
    method: 'post',
    data
  })
}

//业务关系下拉数据   historicap
export function addGenhistoricap(data) {
  return request({
    url: '/jflow/p/cs/task/relation/list',
    method: 'post',
    data
  })
}
// history 查询列表
export function addGenhistorihistory(data) {
  return request({
    url: '/jflow/p/cs/task/history/list',
    method: 'post',
    data
  })
}
//提交
export function addGenhistorilisr(data) {
  return request({
    url: "/jflow/p/cs/process/manualsubmit",
    method: 'post',
    data
  })
}

// 修改关联表
export function setGenTable(data) {
  return request({
    url: '/boman-gen/genTableRelation',
    method: 'put',
    data
  })
}
// 删除关联表
export function delGenTable(tableId) {
  return request({
    url: '/boman-gen/genTableRelation/' + tableId,
    method: 'delete',
  })
}
// 查看关联表
export function qurGenTable(tableId) {
  return request({
    url: '/boman-gen/genTableRelation/' + tableId,
    method: 'get',
  })
}

// 关联表列表
export function tabList(query) {
  return request({
    url: '/boman-gen/genTableRelation/list',
    method: 'get',
    params: query
  })
}
// 查询生成表数据
export function listTable(query) {
  return request({
    url: '/code/gen/list',
    method: 'get',
    params: query
  })
}
// 查询db数据库列表
export function listDbTable(query) {
  return request({
    url: '/code/gen/db/list',
    method: 'get',
    params: query
  })
}

// 新增
export function addMenu(data) {
  return request({
    url: '/boman-gen/gen/addTable',
    method: 'post',
    data: data
  })
}

// 查询表详细信息
export function getGenTable(tableId) {
  return request({
    url: '/code/gen/' + tableId,
    method: 'get'
  })
}

// 查询表详细信息
export function listAllColumnsByTableId(data) {
  return request({
    url: '/boman-web-core/p/cs/table/listAllColumnsByTableId',
    method: 'post',
    data
  })
}
// 查询表HR详细信息
export function genTableColumnList(query) {
  return request({
    url: '/boman-gen/genTableColumn/list',
    method: 'get',
    params: query
  })
}

// 修改代码生成信息
export function updateGenTable(data) {
  return request({
    url: '/code/gen',
    method: 'put',
    data: data
  })
}

// 导入表
export function importTable(data) {
  return request({
    url: '/code/gen/importTable',
    method: 'post',
    params: data
  })
}

// 预览生成代码
export function previewTable(tableId) {
  return request({
    url: '/code/gen/preview/' + tableId,
    method: 'get'
  })
}

// 删除表数据
export function delTable(tableId) {
  return request({
    url: '/code/gen/' + tableId,
    method: 'delete'
  })
}
// 删除
export function delPost(id) {
  return request({
    url: '/genTableColumn/columnIds/' + id,
    method: 'delete'
  })
}

// 生成代码（自定义路径）
export function genCode(tableName) {
  return request({
    url: '/code/gen/genCode/' + tableName,
    method: 'get'
  })
}

// 同步数据库
export function synchDb(tableName) {
  return request({
    url: '/code/gen/synchDb/' + tableName,
    method: 'get'
  })
}

// 查询数据库sql
export function tableSql(id) {
  return request({
    url: '/boman-gen/tableSql/'+id,
    method: 'get',
  })
}
// 执行创建语句
export function zxImplement(data) {
  return request({
    url: '/boman-gen/tableSql/implement',
    method: 'post',
    data
  })
}
// 刷新创建语句
export function getReload(data) {
  return request({
    url: '/boman-gen/tableSql/reload',
    method: 'POST',
    data
  })
}
// 新增字段信息
export function addGenTableColumn(data) {
  return request({
    url: '/boman-gen/genTableColumn',
    method: 'POST',
    data
  })
}
// 删除字段信息
export function delGenTableColumn(id) {
  return request({
    url: '/boman-gen/genTableColumn/' + id,
    method: 'delete',
  })
}
// 修改字段信息
export function setGenTableColumn(data) {
  return request({
    url: '/boman-gen/genTableColumn',
    method: 'put',
    data
  })
}
// 获取字段信息
export function getGenTableColumn(tableId) {
  return request({
    url: '/boman-gen/genTableColumn/getColumnInfo/' + tableId,
    method: 'get',
  })
}
// 获取字段信息
export function getByIdWithForeignKey(tableId) {
  return request({
    url: '/boman-gen/genTableColumn/getByIdWithForeignKey/' + tableId,
    method: 'get',
  })
}
// 获取字段信息
export function getLoadTable() {
  return request({
    url: 'boman-gen/init/loadTable',
    method: 'get',
  })
}

// 获取快速查询  查询框数据/ */
export function tableQuery(data) {
  return request({
    url: '/boman-web-core/p/cs/getTableQuery',
    method: 'POST',
    data
  })
}

// 快速查询列表
export function listIndexfou(data) {
  return request({
    url: '/boman-web-core/p/cs/queryList',
    method: 'post',
    data: data
  })
}
// 通过
export function listIndexfougru(data) {
  return request({
    url: '/jflow/p/c/task/page/pass',
    method: 'post',
    data: data
  })
}

// 驳回
export function listIndexfouboh(data) {
  return request({
    url: '/jflow/p/c/task/page/deny',
    method: 'post',
    data: data
  })
}

// 配置规则
export function ruledconfig(data) {
  return request({
    url: '/jflow/p/c/meta/column/list',
    method: 'post',
    data: data
  })
}
// 配置字段
export function ruledconfigzid(data) {
  return request({
    url: '/jflow/p/c/meta/refcolumn/fuzzyquery',
    method: 'post',
    data: data
  })
}
export function ruledfrr(data) {
  return request({
    url: '/jflow/p/c/meta/refcolumn/list',
    method: 'post',
    data: data
  })
}
