123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- import ajax from '../util'
- /**
- * 获得指定实体类为起点的所有关系类列表
- * @param id
- * @returns {*}
- */
- function getAllRelationClassList (id, entClsType) {
- return ajax({
- method: 'get',
- url: '/relcls/{id}/list',
- path: {
- id: id
- },
- data: {
- entClsType: entClsType,
- }
- })
- }
- /**
- * 删除关系类
- * @param id
- * @returns {*}
- */
- function deleteRelationClass (id) {
- return ajax({
- method: 'post',
- url: '/relcls/del/{id}',
- path: {
- id: id
- }
- })
- }
- /**
- * 通过名称获取所有关系类列表
- * @param name
- * @returns {*}
- */
- function getAllRelationClassListByName (name, isModel, current, size) {
- return ajax({
- method: 'get',
- url: '/relcls/list',
- data: {
- name: name,
- current,
- size,
- isModel
- }
- })
- }
- /**
- * 修改一个关系类名
- * @param data
- * @returns {*}
- */
- function editRelationClass (data) {
- return ajax({
- method: 'post',
- url: '/relcls/update',
- data: data
- })
- }
- /**
- * 添加一个关系类
- * @param data
- * @returns {*}
- */
- function addRelationClass (data) {
- return ajax({
- method: 'post',
- url: '/relcls/add',
- data: data
- })
- }
- /**
- * 新建实体关系
- * @param data
- * @returns {*}
- */
- function addEntityRelation (data) {
- return ajax({
- method: 'post',
- url: '/rel/add',
- data: data
- })
- }
- /**
- * 删除实体关系
- * @param relID, isModel
- * @returns {*}
- */
- function deleteEntityRelation (relID, isModel) {
- return ajax({
- method: 'post',
- url: '/rel/del/{id}',
- path: {
- id: relID
- },
- data: {
- id: relID,
- isModel
- }
- })
- }
- /**
- * 查找所有关系类
- * */
- function getAllRelationClass () {
- return ajax({
- method: 'post',
- url: '/relcls/getall'
- })
- }
- /**
- * 批量新增实体关系
- * */
- function addRelBatch (data) {
- return ajax({
- method: 'post',
- url: '/rel/add/batch',
- data: data
- })
- }
- /**
- * 查询此关系类所指向实体类还未有关联的实体列表
- * @param relClsId direction isModel current size
- * @returns {*}
- */
- function getRelclsUnpoint(relClsId, direction, entId, isModel, current, size) {
- return ajax({
- method: 'get',
- url: '/relcls/{direction}/{relClsId}/unpoint/{entId}',
- data: {
- current,
- size,
- isModel
- },
- path: {
- direction,
- relClsId,
- entId
- }
- })
- }
- /**
- * 查询此关系类所指向实体类还未有关联的实体列表(带属性类)
- * @param relClsId direction isModel current size
- * @returns {*}
- */
- function getRelclsEnt(relClsId, direction, entId, isModel, entName, current, size) {
- return ajax({
- method: 'get',
- url: '/relcls/{direction}/{relClsId}/ent/{entId}',
- data: {
- entName,
- current,
- size,
- isModel
- },
- path: {
- direction,
- relClsId,
- entId
- }
- })
- }
- /**
- * 批量编辑实体关系
- * */
- function editRelBatch (data) {
- return ajax({
- method: 'post',
- url: '/relattr/update/batch',
- data: data
- })
- }
- export {
- addRelationClass,
- getAllRelationClassList,
- deleteRelationClass,
- getAllRelationClassListByName,
- editRelationClass,
- deleteEntityRelation,
- addEntityRelation,
- getAllRelationClass,
- addRelBatch,
- getRelclsUnpoint,
- editRelBatch,
- getRelclsEnt
- }
|