diff --git a/ReportBase.js b/ReportBase.js index 79b2e4f..b75d6b4 100644 --- a/ReportBase.js +++ b/ReportBase.js @@ -18,12 +18,10 @@ class ReportBase { this.conditionTypes = []; this.conditionInfo = null; //状况类型补充说明 this.conditionImageList = []; // 局部详情图{title,description,image} - this.conditionMapping = []; + this.conditionMapping = {}; this.grids = { gridsNumber: 4, - gridsImgs: [ - - ], + gridsImgs: [], }; this.conservation = params.conservation || null; this.suggest = params.suggest || null; @@ -62,6 +60,7 @@ class ReportBase { this.consignor = reportBase.consignor; this.checkBy = reportBase.checkBy; + this.reportBy = reportBase.reportBy; if (reportBase.coverImage) { this.coverImage = reportBase.coverImage; @@ -72,12 +71,27 @@ class ReportBase { if (reportBase.suggest) { this.suggest = reportBase.suggest; } - if(reportBase.grids){//宫格图 + if (reportBase.grids) {//宫格图 this.grids = reportBase.grids; } - if(reportBase.conditionTypes){ + if (reportBase.conditionMapping) { + if (reportBase.conditionMapping.images) { + this.conditionMapping['images'] = reportBase.conditionMapping.images; + } + if (reportBase.conditionMapping.legend) { + this.conditionMapping['legend'] = reportBase.conditionMapping.legend; + } + } + + if (reportBase.conditionTypes) { this.conditionTypes = reportBase.conditionTypes; } + if (reportBase.conditionImageList) { + this.conditionImageList = reportBase.conditionImageList; + } + if (reportBase.conditionInfo) { + this.conditionInfo = reportBase.conditionInfo; + } this.checkLocationGeometry = reportBase.checkLocationGeometry || null; //geometry格式 this.environmentTemperature = reportBase.environmentTemperature || null; this.environmentHumidity = reportBase.environmentHumidity || null; @@ -104,15 +118,11 @@ class ReportBase { this.conditionImageList = fileList; } - setImagesLegend(imgSrc,legend) { + setImagesLegend(imgSrc, legend) { this.conditionMapping['images'] = imgSrc; this.conditionMapping['legend'] = legend; } - setImages(imgSrc) { - this.conditionMapping = imgSrc; - } - setConservation(val) { this.conservation = val; diff --git a/artApi.js b/artApi.js index 4d59c16..5c7acd4 100644 --- a/artApi.js +++ b/artApi.js @@ -31,6 +31,7 @@ const artApi = { conditionCheckUpdate: "/rpc/conditionCheckUpdate", //修改状况检查 conditionCheckDelete: "/rpc/conditionCheckDelete",//删除状况检查 viewConditionCheck: "/rpc/viewConditionCheck",//查询状况检查 + viewRepairRecord:"/rpc/viewRepairRecord" //查询修复档案列表 }; export { artApi }; diff --git a/artRepairFile.js b/artRepairFile.js new file mode 100644 index 0000000..d6e32e1 --- /dev/null +++ b/artRepairFile.js @@ -0,0 +1,12 @@ +class ArtRepairFile { + constructor(params={}) { + this.id = params.id; + this.name = params.name; + this.description = params.description; + this.conditionCheckId = params.condition_check_id; //关联的状况检查记录id + this.artworkRecordId = params.artwork_record_id; //关联的艺术品id + } + +} + +export default ArtRepairFile \ No newline at end of file diff --git a/artSystem.js b/artSystem.js index 18a7934..9dc5c86 100644 --- a/artSystem.js +++ b/artSystem.js @@ -5,6 +5,7 @@ import CellsysArt from './cellsysArt'; import CellsysEventType from '@airkoon/cellsys/cellsysEventType'; import ArtCounty from './artCounty'; import { EditTask } from '@airkoon/cellsys/cellsysUtil'; +import ArtRepairFile from "./artRepairFile"; class ArtSystem { constructor(orgId) { } @@ -280,6 +281,41 @@ class ArtSystem { }); }); } + //查询系统修复档案列表 + static queryRepairFiles(params){ + let query = new Query(); + let { filter,pageInfo } = params; + if (filter) { + filter.forEach((item) => { + query.addFilter(item['field'], item['operator'], item['value']); + }); + } + let queryTask = new QueryTask(artApi.viewRepairRecord, !!pageInfo); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + if (pageInfo) { + if (res.data) { + res.data = res.data.map((item) => { + return new ArtRepairFile(item); + }); + resolve(res); + }else{ + reject(new Error("修复档案数据格式异常")); + } + } else { + let resArr = res.map((item) => { + return new ArtRepairFile(item); + }); + resolve(resArr); + } + }) + .catch((err) => { + reject(err); + }); + }); + } } export default ArtSystem; diff --git a/conditionReport.js b/conditionReport.js index 9855e71..b741a14 100644 --- a/conditionReport.js +++ b/conditionReport.js @@ -35,12 +35,17 @@ class ConditionReport { // // let logo=modelOptions.logo; // modelOptions=new ReportBase() // } - // let artworkRecord = params.artwork_record; - // if (artworkRecord) { - // this.recordNumber = artworkRecord.record_number; - // this.oldName = artworkRecord.old_name - // } - // this.tagName = params.tag_name + let artworkRecord = params.artwork_record; + if (artworkRecord) { + this.recordNumber = artworkRecord.record_number; + this.oldName = artworkRecord.old_name + } + this.tags = []; + if (params.tag_name) { + this.tags = params.tag_name.map((name) => { + return { name: name }; + }); + } this.createBy = params.create_by; this.createTime = params.create_time; @@ -60,7 +65,7 @@ class ConditionReport { - static conditionCheckInsert(params) { + conditionCheckInsert(params) { let editTask = new EditTask(artApi.conditionCheckInsert) editTask.addParam('_artwork_record_id', params.artworkRecordId); editTask.addParam('_name', params.name);