123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418 |
- import ajax from '../util'
- /**
- * 根据实体类id获取实体列表
- * @param id
- * @returns {*}
- */
- function getEntityListByEntityClassId(id, data) {
- return ajax({
- method: 'get',
- url: '/ent/{id}/list',
- path: {
- id: id,
- },
- data: {
- id: id,
- },
- })
- }
- /**
- * 删除实体
- * @param id
- * @returns {*}
- */
- function delEntityById(id, isModel) {
- return ajax({
- method: 'post',
- url: '/ent/del/ids',
- data: {
- ids: id,
- isModel,
- },
- })
- }
- // 原有的删除接口,没有调用成功
- // function delEntityById (id) {
- // return ajax({
- // method: 'post',
- // url: '/ent/del/{id}',
- // path: {
- // id:id
- // }
- // })
- // }
- /**
- * 批量删除实体
- * @param ids
- * @returns {*}
- */
- function delEntityByIds(ids) {
- return ajax({
- method: 'post',
- url: '/ent/del/ids',
- data: {
- ids: ids,
- },
- })
- }
- /**
- * 添加实体
- * @param entClsID
- * @param entName
- * @returns {*}
- */
- function addEntity(
- entClsID,
- entName,
- entMemo,
- entIcon,
- notNullAttrVOList,
- isModel
- ) {
- return ajax({
- method: 'post',
- url: '/ent/add',
- headers: { 'Content-Type': 'application/json;charset=UTF-8' },
- data: {
- entClsID: entClsID,
- entMemo: entMemo,
- entName: entName,
- entIcon: entIcon,
- notNullAttrVOList: notNullAttrVOList, // 必填属性列表
- isModel,
- },
- json: true,
- })
- }
- /**
- * 根据实体id获取实体详情
- * @param id
- * @returns {*}
- */
- function getEntityDetailById(id, isModel) {
- return ajax({
- method: 'get',
- url: '/ent/{id}',
- path: {
- id: id,
- },
- data: {
- isModel,
- },
- })
- }
- /**
- * 实体修改接口
- * @param entID
- * @param entName
- * @returns {*}
- */
- function updateEntityName(entID, entName, entMemo, entIcon, isModel) {
- return ajax({
- method: 'post',
- url: '/ent/update',
- data: {
- entID: entID,
- entMemo: entMemo, // 可选择传不传
- entName: entName,
- entIcon: entIcon,
- isModel,
- },
- })
- }
- /**
- * 通过实体名字查询实体类
- * @param entName
- * @returns {*}
- */
- function searchEntClsByEntName(entName) {
- return ajax({
- method: 'get',
- url: 'ent/search/entclses',
- data: {
- entName: entName,
- },
- })
- }
- /**
- *待审属性删除接口
- * @param attrClsID
- * @returns {*}
- */
- function deleteAttrClassNone(attrClsID, isModel) {
- return ajax({
- method: 'post',
- url: '/attrcls/none/del/{attrClsID}',
- path: {
- attrClsID: attrClsID,
- },
- data: {
- attrClsID: attrClsID,
- isModel,
- },
- })
- }
- /**
- *待审属性新增属性
- * @param entID
- * @param attrValue
- * @param attrClsName
- * @param valueType
- * @returns {*}
- */
- function addEntNoneAttr(data) {
- return ajax({
- method: 'post',
- url: '/attr/add/none',
- data: {
- entID: data.entID,
- attrClsMemo: data.attrClsMemo,
- attrClsName: data.attrClsName,
- attrUnit: data.attrUnit,
- attrValue: data.attrValue,
- valueType: data.valueType,
- isModel: data.isModel,
- },
- })
- }
- //
- /**
- * 实体待审属性查找接口
- * @param entID
- * @returns {*}
- */
- function getEntNoneList(entID, pagenum, pagesize, isModel) {
- return ajax({
- method: 'post',
- url: '/attr/none/list',
- data: {
- entID: entID,
- pagenum: pagenum,
- pagesize: pagesize,
- isModel,
- },
- })
- }
- /**
- * 待审属性类调整中的查询
- * @param attrClsID
- * @returns {*}
- */
- function getAttrClassAdjustSearch(attrClsID) {
- return ajax({
- method: 'post',
- url: '/attrcls/none/attrs',
- data: {
- attrClsID: attrClsID,
- },
- })
- }
- /**
- * 待审属性名称修改接口
- * @param data
- * @returns {*}
- */
- function updateAttrNoneName(data) {
- return ajax({
- method: 'post',
- url: '/attr/none/update',
- data: data,
- })
- }
- /**
- * 参照创建模板
- * @param entReferenceQuery : {
- "delEntIds": [
- "string"
- ],
- "entIcon": "string",
- "entMemo": "string",
- "entName": "string",
- "isModel": true,
- "modelId": "string",
- "suffix": "string"
- }
- * @returns {*}
- */
- function addReferenceEnt(entReferenceQuery) {
- return ajax({
- method: 'post',
- url: '/ent/reference/add',
- data: entReferenceQuery,
- })
- }
- /**
- * 根据某一实体,关联出他的一定度数的数据
- * @param id, degree, delEntIds, direction, isModel, entClsIDs, relClsIDs
- * @returns {*}
- */
- function getRelationEnt(
- id,
- degree,
- delEntIds,
- direction="BOTH",
- isModel,
- entClsIDs,
- entName,
- relClsIDs,
- limitNum=3,
- entConditionQueries=[]
- ) {
- return ajax({
- method: 'post',
- url: '/show/graph',
- data: {
- entId: id,
- degree,
- delEntIds,
- direction,
- isModel,
- entName,
- relClsIDs,
- limitNum,
- entConditionQueries: entConditionQueries
- },
- headers: { 'Content-Type': 'application/json;charset=UTF-8' },
- json: true,
- })
- }
- /*
- let data = {
- degree: this.degreeCache,
- delEntIds: this.getDelEntIdsString(),
- direction: direction,
- entId: id,
- entName: name,
- relClsIDs: this.linkClassCache,
- limitNum: 3,
- isModel: false,
- entConditionQueries: entConditionQueries
- }
- */
- function getChart(data) {
- return ajax({
- method: 'post',
- url: '/show/graph',
- data: data,
- headers: { 'Content-Type': 'application/json;charset=UTF-8' },
- json: true,
- })
- }
- /**
- * 根据实体类,获取关系类
- * @param id, degree, delEntIds, direction, isModel
- * @returns {*}
- */
- function getRelationClsByEntCls(id) {
- return ajax({
- method: 'get',
- url: '/relcls/all/list/{id}',
- path: {
- id,
- },
- })
- }
- /**
- * 根据关系类获取树形
- * @param entId, relClsId, direction, isModel, current, size
- * @returns {*}
- */
- function getRelationAttr(entId, relClsId, direction, isModel, current, size) {
- return ajax({
- method: 'get',
- url: '/entcls/{direction}/{relClsId}/{entId}',
- path: {
- entId,
- relClsId,
- direction,
- },
- data: {
- current,
- isModel,
- size,
- },
- })
- }
- /**
- * 保存基础属性/能力属性
- * @param data
- * @returns {*}
- */
- function saveEntAttr(data) {
- return ajax({
- method: 'post',
- url: '/ent/update/batch',
- data: data,
- })
- }
- /**
- * 集成服务导出接口1
- * @param data
- * @returns {*}
- */
- function exportUnionid() {
- return ajax({
- method: 'post',
- url: '/ent/batch/unionid',
- data: {
- noTimeout: true,
- },
- })
- }
- /**
- * 集成服务导出接口2
- * @returns {*}
- */
- function exportOmsUpload() {
- return ajax({
- method: 'post',
- url: '/oms/media/upload',
- data: {
- noTimeout: true,
- },
- })
- }
- export {
- updateAttrNoneName,
- getAttrClassAdjustSearch,
- addEntNoneAttr,
- getEntNoneList,
- deleteAttrClassNone,
- searchEntClsByEntName,
- getEntityListByEntityClassId,
- delEntityById,
- addEntity,
- getEntityDetailById,
- updateEntityName,
- delEntityByIds,
- addReferenceEnt,
- getRelationEnt,
- getRelationClsByEntCls,
- getRelationAttr,
- saveEntAttr,
- exportUnionid,
- exportOmsUpload,
- getChart,
- }
|