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