1.0.3版本号

This commit is contained in:
ag 2025-01-03 09:52:13 +08:00
parent be44ae8ad5
commit d820b02c25
13 changed files with 1658 additions and 431 deletions

View File

@ -1,37 +1,44 @@
const artApi = { const artApi = {
country: '/rpc/view_country_code', //查询国家数据 country: "/rpc/view_country_code", //查询国家数据
artworkRepair: '/rpc/view_art_artwork_repair_rel', artworkRepair: "/rpc/view_art_artwork_repair_rel",
artworkRecord: '/rpc/view_art_artwork_record', //查询档案 artworkRecord: "/rpc/view_art_artwork_record", //查询档案
artworkDetails: '/rpc/view_art_artwork_detail', //查看档案详情 artworkDetails: "/rpc/view_art_artwork_detail", //查看档案详情
artUploadPicture: '/rpc/artUploadPicture', //图片上传 artUploadPicture: "/rpc/artUploadPicture", //图片上传
artArtworkRecordInsert: '/rpc/artArtworkRecordInsert', //创建档案 artArtworkRecordInsert: "/rpc/artArtworkRecordInsert", //创建档案
artArtworkRecordDelete: '/rpc/artArtworkRecordDelete', //删除艺术品档案 artArtworkRecordDelete: "/rpc/artArtworkRecordDelete", //删除艺术品档案
artArtworkRecordUpdate: '/rpc/artArtworkRecordUpdate', //编辑艺术品档案 artArtworkRecordUpdate: "/rpc/artArtworkRecordUpdate", //编辑艺术品档案
viewWareHouseType: '/rpc/ViewWareHouseType', //查询仓库类型 viewWareHouseType: "/rpc/ViewWareHouseType", //查询仓库类型
wareHouseTypeInsert: '/rpc/wareHouseTypeInsert', //创建仓库类型 wareHouseTypeInsert: "/rpc/wareHouseTypeInsert", //创建仓库类型
wareHouseTypeUpdate: '/rpc/wareHouseTypeUpdate', //修改仓库类型 wareHouseTypeUpdate: "/rpc/wareHouseTypeUpdate", //修改仓库类型
wareHouseTypeDelete: '/rpc/wareHouseTypeDelete', //删除仓库类型 wareHouseTypeDelete: "/rpc/wareHouseTypeDelete", //删除仓库类型
wareHouseInsert: '/rpc/wareHouseInsert', //创建仓库 wareHouseInsert: "/rpc/wareHouseInsert", //创建仓库
wareHouseUpdate: '/rpc/wareHouseUpdate', //修改仓库 wareHouseUpdate: "/rpc/wareHouseUpdate", //修改仓库
wareHouseDelete: '/rpc/wareHouseDelete', //删除仓库 wareHouseDelete: "/rpc/wareHouseDelete", //删除仓库
viewWareHouse: '/rpc/viewWareHouse', //查询仓库 viewWareHouse: "/rpc/viewWareHouse", //查询仓库
countInWareHouse: '/rpc/countArtworkInWareHouse', //盘点数据 countInWareHouse: "/rpc/countArtworkInWareHouse", //盘点数据
wareHouseEntryInsert: '/rpc/wareHouseEntryInsert', //新增入库 wareHouseEntryInsert: "/rpc/wareHouseEntryInsert", //新增入库
wareHouseEntryUpdate: '/rpc/wareHouseEntryUpdate', //修改入库 wareHouseEntryUpdate: "/rpc/wareHouseEntryUpdate", //修改入库
wareHouseEntryDelete: '/rpc/wareHouseEntryDelete', //删除入库 wareHouseEntryDelete: "/rpc/wareHouseEntryDelete", //删除入库
viewWareHouseEntry: '/rpc/viewWareHouseEntry', //查询入库 viewWareHouseEntry: "/rpc/viewWareHouseEntry", //查询入库
wareHouseOutboundInsert: '/rpc/wareHouseOutboundInsert', //新增出库记录 wareHouseOutboundInsert: "/rpc/wareHouseOutboundInsert", //新增出库记录
wareHouseOutboundUpdate: '/rpc/wareHouseOutboundUpdate', //修改出库记录 wareHouseOutboundUpdate: "/rpc/wareHouseOutboundUpdate", //修改出库记录
wareHouseOutboundDelete: '/rpc/wareHouseOutboundDelete', //删除出库记录 wareHouseOutboundDelete: "/rpc/wareHouseOutboundDelete", //删除出库记录
viewWareHouseOutbound: '/rpc/viewWareHouseOutbound', //c查询出库记录 viewWareHouseOutbound: "/rpc/viewWareHouseOutbound", //c查询出库记录
wareHouseOutboundReviewInsert: '/rpc/wareHouseOutboundReviewInsert', //创建出库申请审核 wareHouseOutboundReviewInsert: "/rpc/wareHouseOutboundReviewInsert", //创建出库申请审核
wareHouseOutboundReviewUpdate: '/rpc/wareHouseOutboundReviewUpdate', //审核出库申请 wareHouseOutboundReviewUpdate: "/rpc/wareHouseOutboundReviewUpdate", //审核出库申请
viewWareHouseOutboundReview: '/rpc/viewWareHouseOutboundReview', //查询出库记录审核 viewWareHouseOutboundReview: "/rpc/viewWareHouseOutboundReview", //查询出库记录审核
conditionCheckInsert: "/rpc/conditionCheckInsert", //创建状况检查 conditionCheckInsert: "/rpc/conditionCheckInsert", //创建状况检查
conditionCheckUpdate: "/rpc/conditionCheckUpdate", //修改状况检查 conditionCheckUpdate: "/rpc/conditionCheckUpdate", //修改状况检查
conditionCheckDelete: "/rpc/conditionCheckDelete",//删除状况检查 conditionCheckDelete: "/rpc/conditionCheckDelete", //删除状况检查
viewConditionCheck: "/rpc/viewConditionCheck",//查询状况检查 viewConditionCheck: "/rpc/viewConditionCheck", //查询状况检查
viewRepairRecord:"/rpc/viewRepairRecord" //查询修复档案列表 viewRepairRecord: "/rpc/viewRepairRecord", //查询修复档案列表
repairRecordInsert: "/rpc/repairRecordInsert", //创建修复档案
repairRecordUpdate: "/rpc/repairRecordUpdate", //编辑修复档案
repairRecordDelete: "/rpc/repairRecordDelete", //删除修复档案
viewRepairPlan: "/rpc/viewRepairPlan", //修复档案发起归档
repairPlanInsert: "/rpc/repairPlanInsert", //创建修复方案
repairPlanUpdate: "/rpc/repairPlanUpdate", //修改修复方案
repairPlanDelete: "/rpc/repairPlanDelete", //删除修复方案
}; };
export { artApi }; export { artApi };

View File

@ -1,12 +1,20 @@
export const artStatus = { export const artStatus = {
0: '未入库', 1: "未入库",
1: '已入库', 2: "已入库",
2: '已出库', 3: "已出库",
3: '修复中', 4: "修复中",
}; };
//入库记录状态 //入库记录状态
export const godownEntryStatus = { export const godownEntryStatus = {
0: '未签名', 0: "未签名",
1: '已入库', 1: "已入库",
}; };
//0-未审核 1-审核中 2-审核通过 3-审核不通过 4-方案变更
export const artRepairPlanStatus = {
0:'未审核',
1:'审核中',
2:'审核通过',
3:'审核不通过',
4:'方案变更'
}

16
artRepairEvent.js Normal file
View File

@ -0,0 +1,16 @@
import ArtImage from "./artImage";
class ArtRepairEvent {
constructor(params = {}) {
this.id = params.id;
this.name = params.name;
this.description = params.description;
this.creator = params.creator;
this.updater = params.updater;
this.createTime = params.create_time;
this.updateTime = params.update_time;
}
}
export default ArtRepairEvent;

View File

@ -1,12 +1,126 @@
class ArtRepairFile { import ArtImage from "./artImage";
constructor(params={}) { import { formatterMillisecond } from "./utils/date";
this.id = params.id; import { artApi } from "./artApi";
this.name = params.name; import {
this.description = params.description; EditTask,
this.conditionCheckId = params.condition_check_id; //关联的状况检查记录id Operator,
this.artworkRecordId = params.artwork_record_id; //关联的艺术品id Query,
} QueryTask,
} from "@airkoon/cellsys/cellsysUtil";
import ConditionReport from "./conditionReport";
import ArtRepairPlan from "./artRepairPlan";
class ArtRepairFile {
constructor(params = {}) {
this.id = params.id;
this.name = params.name;
this.description = params.description;
this.conditionCheckId = params.condition_check_id; //关联的状况检查记录id
this.creator = params.creator;
this.updater = params.updater;
this.createTime = params.create_time;
this.updateTime = params.update_time;
this.artworkRecord = {
artworkRecordId: params.artwork_record_id, //关联的艺术品id
};
if (params.artwork_record) {
let { record_number, old_name, images } = params.artwork_record;
this.artworkRecord["recordNumber"] = record_number;
this.artworkRecord["oldName"] = old_name;
this.artworkRecord["artworkImages"] = images.map((url) => {
return new ArtImage(url);
});
}
this.tags = [];
if (params.tag_name) {
this.tags = params.tag_name.map((name) => {
return { name: name };
});
}
}
//艺术品封面图
get coverImageUrl() {
if (this.artworkRecord && this.artworkRecord["artworkImages"].length > 0) {
return this.artworkRecord["artworkImages"][0].compressionUrl;
}
}
//艺术品封面图
get oldNameFormat() {
return `${this.artworkRecord["oldName"]}`;
}
get updateTimeFormat() {
return formatterMillisecond(this.updateTime);
}
queryConditionReport() {
if (!this.conditionCheckId) {
throw new Error("没有状况检查记录信息!");
}
let query = new Query();
query.addFilter("id", Operator.Equals, this.conditionCheckId); //病害报告模板
let queryTask = new QueryTask(artApi.viewConditionCheck, false);
return new Promise((resolve, reject) => {
queryTask
.execute(query)
.then((res) => {
let resArr = res.map((item) => {
return new ConditionReport(item);
});
resolve(resArr);
})
.catch((err) => {
reject(err);
});
});
}
//更新修复档案信息
updateRepairFile(params = {}) {
let { name, description, conditionCheckId } = params;
let editTask = new EditTask(artApi.repairRecordUpdate);
editTask.addParam("_id", this.id);
editTask.addParam("_description", description);
editTask.addParam("_name", name);
editTask.addParam("_condition_check_id", conditionCheckId);
debugger;
return new Promise((resolve, reject) => {
editTask
.execute()
.then((res) => {
if (res.data) {
let artRepairFile = new ArtRepairFile(res.data);
resolve(artRepairFile);
}
})
.catch((err) => {
reject(err);
});
});
}
//创建修复方案
createRepairPlan(params) {
let editTask = new EditTask(artApi.repairPlanInsert);
editTask.addParam('_repair_record_id', this.id);
editTask.addParam('_name', params.name);
editTask.addParam('_repair_nodes', params.repairNodes);
return new Promise((resolve, reject) => {
editTask
.execute()
.then((res) => {
if (res.data) {
let artRepairFile = new ArtRepairPlan(res.data);
resolve(artRepairFile);
}
})
.catch((err) => {
reject(err);
});
});
}
} }
export default ArtRepairFile export default ArtRepairFile;

77
artRepairPlan.js Normal file
View File

@ -0,0 +1,77 @@
import ArtImage from "./artImage";
import {formatterMillisecond} from "./utils/date";
import {EditTask} from "@airkoon/cellsys/cellsysUtil";
import {artApi} from "./artApi";
import {artRepairPlanStatus} from "./artEnum";
class ArtRepairPlan {
constructor(params = {}) {
this.id = params.id;
this.name = params.name;
this.repairRecordId = params.repair_record_id;
this.repairNodes = params.repair_nodes;
this.creatorSignatureImage = params.creator_signature_image;
this.status = params.status;
this.creator = params.creator;
this.updater = params.updater;
this.createTime = params.create_time;
this.updateTime = params.update_time;
this.artworkRecord = {
artworkRecordId: params.artwork_record_id, //关联的艺术品id
};
if (params.artwork_record) {
let { record_number, old_name, images } = params.artwork_record;
this.artworkRecord["recordNumber"] = record_number;
this.artworkRecord["oldName"] = old_name;
this.artworkRecord["artworkImages"] = images.map((url) => {
return new ArtImage(url);
});
}
}
//艺术品封面图
get coverImageUrl() {
if (this.artworkRecord && this.artworkRecord["artworkImages"].length > 0) {
return this.artworkRecord["artworkImages"][0].compressionUrl;
}
}
//艺术品封面图
get oldNameFormat() {
return `${this.artworkRecord["oldName"]}`;
}
get updateTimeFormat() {
return formatterMillisecond(this.updateTime);
}
get statusMsg() {
return artRepairPlanStatus[this.status];
}
updateRepairPlan(params={}){
let editTask = new EditTask(artApi.repairPlanUpdate);
editTask.addParam("_id", this.id);
editTask.addParam("_repair_record_id", params.repairRecordId);
editTask.addParam("_name", params.name);
editTask.addParam("_repair_nodes", params.repairNodes);
return new Promise((resolve, reject) => {
editTask
.execute()
.then((res) => {
if (res.data) {
let artRepairFile = new ArtRepairPlan(res.data);
resolve(artRepairFile);
}
})
.catch((err) => {
reject(err);
});
});
}
deleteRepairPlan(){
let editTask = new EditTask(artApi.repairPlanDelete);
editTask.addParam("_id", this.id);
return editTask.execute()
}
}
export default ArtRepairPlan;

View File

@ -1,321 +1,384 @@
import { Query, QueryTask, QueryType, Operator } from '@airkoon/cellsys/cellsysUtil.js'; import {
import ConditionReport from './conditionReport'; Query,
import { artApi } from './artApi'; QueryTask,
import CellsysArt from './cellsysArt'; QueryType,
import CellsysEventType from '@airkoon/cellsys/cellsysEventType'; Operator,
import ArtCounty from './artCounty'; } from "@airkoon/cellsys/cellsysUtil.js";
import { EditTask } from '@airkoon/cellsys/cellsysUtil'; import ConditionReport from "./conditionReport";
import { artApi } from "./artApi";
import CellsysArt from "./cellsysArt";
import CellsysEventType from "@airkoon/cellsys/cellsysEventType";
import ArtCounty from "./artCounty";
import { EditTask } from "@airkoon/cellsys/cellsysUtil";
import ArtRepairFile from "./artRepairFile"; import ArtRepairFile from "./artRepairFile";
import ArtRepairPlan from "./artRepairPlan";
import * as http from "@airkoon/cellsys/utils/axios";
class ArtSystem { class ArtSystem {
constructor(orgId) { } constructor(orgId) {}
static orgId = window.CELLSYSORG ? window.CELLSYSORG.id : null; static orgId = window.CELLSYSORG ? window.CELLSYSORG.id : null;
//查询艺术品材质字典 //查询艺术品材质字典
static queryMaterials(params = {}) { static queryMaterials(params = {}) {
let query = new Query(); let query = new Query();
let { filter } = params; let { filter } = params;
if (filter) { if (filter) {
filter.forEach((item) => { filter.forEach((item) => {
query.addFilter(item['field'], item['operator'], item['value']); query.addFilter(item["name"], item["operator"], item["value"]);
});
}
query.addFilter("dict_type", Operator.Equals, "material");
let queryTask = new QueryTask(QueryType.sysDictData, false);
return new Promise((resolve, reject) => {
queryTask
.execute(query)
.then((res) => {
resolve(res);
})
.catch((err) => {
reject(err);
});
});
}
//查询艺术品一级分类
static queryArtCategoryOne() {
let query = new Query();
query.addFilter("parent_id", Operator.Equals, 1);
query.setOrder({ sort: "asc" });
let queryTask = new QueryTask(QueryType.sysCategoryData, false);
return new Promise((resolve, reject) => {
queryTask
.execute(query)
.then((res) => {
resolve(res);
})
.catch((err) => {
reject(err);
});
});
}
static queryArtCategoryById(parentId) {
let query = new Query();
query.addFilter("parent_id", Operator.Equals, parentId);
let queryTask = new QueryTask(QueryType.sysCategoryData, false);
return new Promise((resolve, reject) => {
queryTask
.execute(query)
.then((res) => {
resolve(res);
})
.catch((err) => {
reject(err);
});
});
}
//查询国家数据
static queryCountry(params = {}) {
let query = new Query();
let { pageInfo, order, filter } = params;
if (filter) {
filter.forEach((item) => {
query.addFilter(item["name"], item["operator"], item["value"]);
});
}
let queryTask = new QueryTask(artApi.country, !!pageInfo);
return new Promise((resolve, reject) => {
queryTask
.execute(query)
.then((res) => {
if (pageInfo) {
if (res.data) {
res.data = res.data.map((item) => {
return new ArtCounty(item);
});
resolve(res);
}
} else {
let resArr = res.map((item) => {
return new ArtCounty(item);
}); });
} resolve(resArr);
query.addFilter('dict_type', Operator.Equals, 'material'); }
let queryTask = new QueryTask(QueryType.sysDictData, false); })
return new Promise((resolve, reject) => { .catch((err) => {
queryTask reject(err);
.execute(query)
.then((res) => {
resolve(res);
})
.catch((err) => {
reject(err);
});
}); });
});
}
//查询艺术片档案
static queryArtworks(params = {}) {
let query = new Query();
let { pageInfo, order, filter } = params;
if (pageInfo) {
query.setCurrPage(pageInfo.currPage);
query.setPageSize(pageInfo.pageSize);
} }
//查询艺术品一级分类 if (filter) {
static queryArtCategoryOne() { filter.forEach((item) => {
let query = new Query(); query.addFilter(item["name"], item["operator"], item["value"]);
query.addFilter('parent_id', Operator.Equals, 1); });
query.setOrder({ sort: 'asc' });
let queryTask = new QueryTask(QueryType.sysCategoryData, false);
return new Promise((resolve, reject) => {
queryTask
.execute(query)
.then((res) => {
resolve(res);
})
.catch((err) => {
reject(err);
});
});
} }
static queryArtCategoryById(parentId) { if (order) {
let query = new Query(); query.setOrder(order);
query.addFilter('parent_id', Operator.Equals, parentId); } else {
let queryTask = new QueryTask(QueryType.sysCategoryData, false); query.setOrder({ id: "desc" });
return new Promise((resolve, reject) => {
queryTask
.execute(query)
.then((res) => {
resolve(res);
})
.catch((err) => {
reject(err);
});
});
} }
//查询国家数据 let queryTask = new QueryTask(
static queryCountry(params = {}) { artApi.artworkRecord,
let query = new Query(); pageInfo ? true : false
let { pageInfo, order, filter } = params; );
if (filter) { return new Promise((resolve, reject) => {
filter.forEach((item) => { queryTask
query.addFilter(item['field'], item['operator'], item['value']); .execute(query)
.then((res) => {
if (pageInfo) {
if (res.data) {
res.data = res.data.map((item) => {
return new CellsysArt(item);
});
resolve(res);
}
} else {
let resArr = res.map((item) => {
return new CellsysArt(item);
}); });
} resolve(resArr);
let queryTask = new QueryTask(artApi.country, !!pageInfo); }
return new Promise((resolve, reject) => { })
queryTask .catch((err) => {
.execute(query) reject(err);
.then((res) => {
if (pageInfo) {
if (res.data) {
res.data = res.data.map((item) => {
return new ArtCounty(item);
});
resolve(res);
}
} else {
let resArr = res.map((item) => {
return new ArtCounty(item);
});
resolve(resArr);
}
})
.catch((err) => {
reject(err);
});
}); });
});
}
//创建艺术品档案
static createArtwork(params = {}) {
let editTask = new EditTask(artApi.artArtworkRecordInsert);
editTask.addParam("_oldname", params.oldName);
editTask.addParam("_countryId", params.country.id);
editTask.addParam("_countryCode", params.country.code);
editTask.addParam("_author", params.author);
editTask.addParam("_create_period", params.createPeriod);
editTask.addParam("_actual_number", params.actualNumber);
editTask.addParam("_length", params.length);
editTask.addParam("_width", params.width);
editTask.addParam("_height", params.height);
if (params.material) {
editTask.addParam("_material", params.material.dict_code);
} }
if (params.categoryOne) {
editTask.addParam("_category_one", params.categoryOne.id);
editTask.addParam("_category_one_code", params.categoryOne.code);
}
if (params.categoryTwo) {
editTask.addParam("_category_two", params.categoryTwo.id);
editTask.addParam("_category_two_code", params.categoryTwo.code);
}
if (params.categoryThree) {
editTask.addParam("_category_three", params.categoryThree.id);
}
editTask.addParam(
"_original_registration_number",
params.originalRegistrationNumber
);
editTask.addParam("_remark", params.remarks);
editTask.addParam("_images", params.images);
return new Promise((resolve, reject) => {
editTask
.execute()
.then((res) => {
if (res.data) {
let cellsysArt = new CellsysArt(res.data);
resolve(cellsysArt);
}
})
.catch((err) => {
reject(err);
});
});
}
//查询艺术片档案 //查询报告列表(应用列表)
static queryArtworks(params = {}) { static queryConditionsReports(params) {
let query = new Query(); if (!params) {
let { pageInfo, order, filter } = params; params = {};
}
if (pageInfo) { let query = new Query();
query.setCurrPage(pageInfo.currPage); let pageInfo = params.pageInfo;
query.setPageSize(pageInfo.pageSize); let order = params.order;
} if (pageInfo) {
if (filter) { query.setCurrPage(pageInfo.currPage);
filter.forEach((item) => { query.setPageSize(pageInfo.pageSize);
query.addFilter(item['name'], item['operator'], item['value']); }
if (order) {
query.setOrder(order);
} else {
query.setOrder({ id: "desc" });
}
// query.addFilter('model_id', Operator.Equals, 23); //病害报告模板
let filter = params.filter;
if (filter) {
filter.forEach((item) => {
query.addFilter(item["name"], item["operator"], item["value"]); //病害报告模板
});
}
let queryTask = new QueryTask(
artApi.viewConditionCheck,
pageInfo ? true : false
);
return new Promise((resolve, reject) => {
queryTask
.execute(query)
.then((res) => {
if (pageInfo) {
if (res.data) {
res.data = res.data.map((item) => {
return new ConditionReport(item);
});
resolve(res);
}
} else {
let resArr = res.map((item) => {
return new ConditionReport(item);
}); });
} resolve(resArr);
if (order) { }
query.setOrder(order); })
} else { .catch((err) => {
query.setOrder({ id: 'desc' }); reject(err);
}
let queryTask = new QueryTask(artApi.artworkRecord, pageInfo ? true : false);
return new Promise((resolve, reject) => {
queryTask
.execute(query)
.then((res) => {
if (pageInfo) {
if (res.data) {
res.data = res.data.map((item) => {
return new CellsysArt(item);
});
resolve(res);
}
} else {
let resArr = res.map((item) => {
return new CellsysArt(item);
});
resolve(resArr);
}
})
.catch((err) => {
reject(err);
});
}); });
} });
}
//创建艺术品档案 static queryArtworkByRepairId(params) {
static createArtwork(params = {}) { let query = new Query();
let editTask = new EditTask(artApi.artArtworkRecordInsert); let artworkId = params.artworkId;
editTask.addParam('_oldname', params.oldName); let eventSetId = params.eventSetId;
editTask.addParam('_countryId', params.country.id); if (artworkId) {
editTask.addParam('_countryCode', params.country.code); query.addFilter("artwork.id", Operator.Equals, artworkId); //病害报告模板
editTask.addParam('_author', params.author); }
editTask.addParam('_create_period', params.createPeriod); if (eventSetId) {
editTask.addParam('_actual_number', params.actualNumber); query.addFilter("event_set.id", Operator.Equals, eventSetId); //病害报告模板
editTask.addParam('_length', params.length); }
editTask.addParam('_width', params.width); let queryTask = new QueryTask(artApi.artworkRepair, false);
editTask.addParam('_height', params.height); return new Promise((resolve, reject) => {
if (params.material) { queryTask
editTask.addParam('_material', params.material.dict_code); .execute(query)
} .then((res) => {
if (params.categoryOne) { let resArr = res.map((item) => {
editTask.addParam('_category_one', params.categoryOne.id); return new CellsysArt(item.artwork);
editTask.addParam('_category_one_code', params.categoryOne.code); });
} resolve(resArr);
if (params.categoryTwo) { })
editTask.addParam('_category_two', params.categoryTwo.id); .catch((err) => {
editTask.addParam('_category_two_code', params.categoryTwo.code); reject(err);
}
if (params.categoryThree) {
editTask.addParam('_category_three', params.categoryThree.id);
}
editTask.addParam('_original_registration_number', params.originalRegistrationNumber);
editTask.addParam('_remark', params.remarks);
editTask.addParam('_images', params.images);
return new Promise((resolve, reject) => {
editTask
.execute()
.then((res) => {
if (res.data) {
let cellsysArt = new CellsysArt(res.data);
resolve(cellsysArt);
}
})
.catch((err) => {
reject(err);
});
}); });
});
}
static queryArtworkEvent(params) {
let query = new Query();
let artworkId = params.artworkId;
if (artworkId) {
query.addFilter("artwork.id", Operator.Equals, artworkId); //病害报告模板
} }
let queryTask = new QueryTask(artApi.artworkRepair, false);
//查询报告列表(应用列表) return new Promise((resolve, reject) => {
static queryConditionsReports(params) { queryTask
if (!params) { .execute(query)
params = {}; .then((res) => {
} let resArr = res.map((item) => {
let query = new Query(); return new CellsysEventType(item.event_set);
let pageInfo = params.pageInfo; });
let order = params.order; resolve(resArr);
if (pageInfo) { })
query.setCurrPage(pageInfo.currPage); .catch((err) => {
query.setPageSize(pageInfo.pageSize); reject(err);
} });
if (order) { });
query.setOrder(order); }
} else { //查询系统修复档案列表
query.setOrder({ id: 'desc' }); static queryRepairFiles(params) {
} let query = new Query();
// query.addFilter('model_id', Operator.Equals, 23); //病害报告模板 let { filter, pageInfo } = params;
let filter = params.filter; if (filter) {
if (filter) { filter.forEach((item) => {
filter.forEach((item) => { query.addFilter(item["name"], item["operator"], item["value"]);
query.addFilter(item['name'], 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);
let queryTask = new QueryTask(artApi.viewConditionCheck, pageInfo ? true : false); }
return new Promise((resolve, reject) => { })
queryTask .catch((err) => {
.execute(query) reject(err);
.then((res) => {
if (pageInfo) {
if (res.data) {
res.data = res.data.map((item) => {
return new ConditionReport(item);
});
resolve(res);
}
} else {
let resArr = res.map((item) => {
return new ConditionReport(item);
});
resolve(resArr);
}
})
.catch((err) => {
reject(err);
});
}); });
});
}
static queryRepairPlan(params) {
let query = new Query();
let { filter, pageInfo } = params;
if (filter) {
filter.forEach((item) => {
query.addFilter(item["name"], item["operator"], item["value"]);
});
} }
let queryTask = new QueryTask(artApi.viewRepairPlan, !!pageInfo);
static queryArtworkByRepairId(params) { return new Promise((resolve, reject) => {
let query = new Query(); queryTask
let artworkId = params.artworkId; .execute(query)
let eventSetId = params.eventSetId; .then((res) => {
if (artworkId) { if (pageInfo) {
query.addFilter('artwork.id', Operator.Equals, artworkId); //病害报告模板 if (res.data) {
} res.data = res.data.map((item) => {
if (eventSetId) { return new ArtRepairPlan(item);
query.addFilter('event_set.id', Operator.Equals, eventSetId); //病害报告模板 });
} resolve(res);
let queryTask = new QueryTask(artApi.artworkRepair, false); } else {
return new Promise((resolve, reject) => { reject(new Error("修复方案数据格式异常"));
queryTask }
.execute(query) } else {
.then((res) => { let resArr = res.map((item) => {
let resArr = res.map((item) => { return new ArtRepairPlan(item);
return new CellsysArt(item.artwork);
});
resolve(resArr);
})
.catch((err) => {
reject(err);
});
});
}
static queryArtworkEvent(params) {
let query = new Query();
let artworkId = params.artworkId;
if (artworkId) {
query.addFilter('artwork.id', Operator.Equals, artworkId); //病害报告模板
}
let queryTask = new QueryTask(artApi.artworkRepair, false);
return new Promise((resolve, reject) => {
queryTask
.execute(query)
.then((res) => {
let resArr = res.map((item) => {
return new CellsysEventType(item.event_set);
});
resolve(resArr);
})
.catch((err) => {
reject(err);
});
});
}
//查询系统修复档案列表
static queryRepairFiles(params){
let query = new Query();
let { filter,pageInfo } = params;
if (filter) {
filter.forEach((item) => {
query.addFilter(item['field'], item['operator'], item['value']);
}); });
} resolve(resArr);
let queryTask = new QueryTask(artApi.viewRepairRecord, !!pageInfo); }
return new Promise((resolve, reject) => { })
queryTask .catch((err) => {
.execute(query) reject(err);
.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);
});
}); });
} });
}
//统一图片上传
static uploadImage(params = {}) {
let { files, module } = params;
let fd = new FormData();
fd.append("file", files);
fd.append("module", module);
return http.post(`/v2${artApi.artUploadPicture}`, fd, {
headers: {
"Content-Type": "multipart/form-data",
},
});
}
} }
export default ArtSystem; export default ArtSystem;

View File

@ -1,13 +1,15 @@
import ArtSystem from "./artSystem";
import ArtImage from "./artImage"; import ArtImage from "./artImage";
import { artStatus } from "./artEnum"; import { artStatus } from "./artEnum";
import { import {
EditTask, EditTask,
EditType, EditType,
Operator,
Query, Query,
QueryTask, QueryTask,
} from "@airkoon/cellsys/cellsysUtil"; } from "@airkoon/cellsys/cellsysUtil";
import { artApi } from "./artApi"; import { artApi } from "./artApi";
import ArtRepairFile from "./artRepairFile";
import ConditionReport from "./conditionReport";
class CellsysArt { class CellsysArt {
constructor(params = {}) { constructor(params = {}) {
@ -60,6 +62,10 @@ class CellsysArt {
} }
} }
get statusMsg() {
return artStatus[this.status];
}
get artworkImagesUrl() { get artworkImagesUrl() {
if (this.artworkImages.length > 0) { if (this.artworkImages.length > 0) {
return this.artworkImages.map((artImage) => { return this.artworkImages.map((artImage) => {
@ -143,13 +149,59 @@ class CellsysArt {
}); });
} }
queryEventlist() { //创建修复档案
createRepairFile(params = {}) {
let { name, description, conditionCheckId } = params;
let editTask = new EditTask(artApi.repairRecordInsert);
editTask.addParam("_artwork_record_id", this.id);
editTask.addParam("_description", description);
editTask.addParam("_name", name);
editTask.addParam("_condition_check_id", conditionCheckId);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
ArtSystem.queryArtworkEvent({ editTask
artworkId: this.id, .execute()
})
.then((res) => { .then((res) => {
resolve(res); if (res.data) {
let artRepairFile = new ArtRepairFile(res.data);
resolve(artRepairFile);
}
})
.catch((err) => {
reject(err);
});
});
}
//查询修复状况检查记录
queryConditionRecords(params = {}) {
let query = new Query();
query.addFilter("artwork_record_id", Operator.Equals, this.id); //病害报告模板
let { filter, pageInfo } = params;
if (filter) {
filter.forEach((item) => {
query.addFilter(item["name"], item["operator"], item["value"]);
});
}
let queryTask = new QueryTask(artApi.viewConditionCheck, !!pageInfo);
return new Promise((resolve, reject) => {
queryTask
.execute(query)
.then((res) => {
if (pageInfo) {
if (res.data) {
res.data = res.data.map((item) => {
return new ConditionReport(item);
});
resolve(res);
} else {
reject(new Error("状况检查记录数据格式异常!"));
}
} else {
let resArr = res.map((item) => {
return new ConditionReport(item);
});
resolve(resArr);
}
}) })
.catch((err) => { .catch((err) => {
reject(err); reject(err);

View File

@ -0,0 +1,247 @@
<template>
<div
:class="{ hidden: hidden }"
class="pagination-container">
<el-pagination
v-if="!GLOBAL.isMobile"
class="pagination"
:background="background"
:current-page.sync="currentPage"
:page-size.sync="pageSize"
:layout="layout"
:page-sizes="pageSizes"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:small="small"
:pager-count="pagerCount" />
<div
class="mobile-pagination"
v-if="GLOBAL.isMobile">
<button
type="button"
class="mobile-button"
@click="handlePre">
<i class="button-pre"></i>
</button>
<div class="page-number">{{ currentPage }}/{{ totalPage }}</div>
<button
type="button"
class="mobile-button"
@click="handleNext">
<i class="button-next"></i>
</button>
<label class="page-input-wrap">
<input
class="Input"
v-model="currentPage" />
</label>
<button
type="button"
class="mobile-button"
@click="handleMobilePageChange">
跳转
</button>
</div>
</div>
</template>
<script>
export default {
name: 'Pagination',
props: {
small: {
type: Boolean,
default: false,
},
total: {
required: true,
type: Number,
},
page: {
//currentPage
type: Number,
default: 1,
},
limit: {
//pageSize
type: Number,
default: 20,
},
pageSizes: {
type: Array,
default() {
return [10, 20, 30, 50];
},
},
layout: {
type: String,
default: 'total, sizes, prev, pager, next, jumper',
},
background: {
type: Boolean,
default: true,
},
autoScroll: {
type: Boolean,
default: true,
},
hidden: {
type: Boolean,
default: false,
},
pagerCount: {
type: Number,
default: 7,
},
/**yrd 删除el-pagination 中:page-count="pageCount" 总页数total 和 page-count 设置任意一个就可以达到显示页码的功能;如果要支持 page-sizes 的更改,则需要使用 total 属性*/
// pageCount: Number,
},
computed: {
currentPage: {
get() {
return this.page;
},
set(val) {
if (!val) {
val = 1;
}
this.$emit('update:page', parseInt(val, 10));
},
},
pageSize: {
get() {
return this.limit;
},
set(val) {
this.$emit('update:limit', val);
},
},
totalPage() {
return Math.ceil(this.total / this.pageSize);
},
},
methods: {
handleSizeChange(val) {
this.$emit('pageChange', { currentPage: this.currentPage, pageSize: val });
if (this.autoScroll) {
//scrollTo(0, 800)
}
},
handleCurrentChange(val) {
this.$emit('pageChange', { currentPage: val, pageSize: this.pageSize });
if (this.autoScroll) {
//scrollTo(0, 800)
}
},
handleMobilePageChange() {
this.$emit('pageChange', {
currentPage: parseInt(this.currentPage, 10),
pageSize: this.pageSize,
});
},
handlePre: function () {
let currentPage = this.currentPage;
if (currentPage > 1) {
currentPage = currentPage - 1;
this.$emit('pageChange', { currentPage: currentPage, pageSize: this.pageSize });
}
},
handleNext: function () {
let currentPage = this.currentPage;
if (currentPage < this.totalPage) {
currentPage = currentPage + 1;
this.$emit('pageChange', { currentPage: currentPage, pageSize: this.pageSize });
}
},
},
};
</script>
<style scoped>
.pagination-container {
background: #fff;
& .pagination {
padding: 10px 0;
}
& .mobile-pagination {
}
}
.hidden {
display: none;
}
@media screen and (max-width: 1025px) {
.mobile-pagination {
position: absolute;
z-index: 2;
width: 100%;
bottom: 0;
left: 0;
display: flex;
padding: 10px 0;
justify-content: center;
border-top: 1px solid #d3d3d3;
background-color: #fff;
}
.mobile-button {
display: inline-block;
padding: 0 16px;
font-size: 14px;
line-height: 32px;
color: #8590a6;
text-align: center;
cursor: pointer;
background: none;
border: 1px solid;
border-radius: 3px;
& .button-pre {
display: inline-block;
width: 0px;
height: 0px;
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
border-right: 8px solid #8590a6;
border-left: none;
}
& .button-next {
display: inline-block;
width: 0px;
height: 0px;
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
border-left: 8px solid #8590a6;
border-right: none;
}
}
.page-number {
align-items: center;
display: flex;
padding: 0 10px;
}
.page-input-wrap {
position: relative;
display: flex;
align-items: center;
width: 60px;
padding: 2px 6px;
margin: 0 10px;
font-size: 14px;
background: #fff;
border: 1px solid #ebebeb;
border-radius: 3px;
box-sizing: border-box;
transition: background 0.2s, border 0.2s;
}
}
</style>

View File

@ -0,0 +1,103 @@
<template>
<el-drawer
:size="size"
append-to-body
:close-on-click-modal="false"
:title="title"
v-model="dialogVisible"
>
<div class="signature-panel">
<div v-if="false">
<vue-qrcode
correctLevel="3"
style="padding: 2rem"
:color="{ dark: '#000000ff', light: '#ffffffff' }"
type="image/jpeg"
:value="qrCodeValue"
:width="300"
></vue-qrcode>
<p>请使用移动端设备扫描二维码进行电子签名</p>
</div>
<Write v-else @close="closeWrite" @save="uploadSignatureImage"></Write>
</div>
</el-drawer>
</template>
<script>
import Write from "./write.vue";
import ArtSystem from "../../artSystem.js";
import { base64toFile } from "../../utils/utils.js";
export default {
name: "signature",
components: { Write },
emits: ["update:modelValue", "uploadSignatureImage"],
props: {
modelValue: Boolean,
title: String,
size: {
type: String,
default: "100%",
},
module: {
type: String, //
},
qrCodeValue: {
//
type: String,
},
},
computed: {
dialogVisible: {
get() {
return this.modelValue;
},
set(val) {
this.$emit("update:modelValue", val);
},
},
},
methods: {
uploadSignatureImage(signatureData) {
let base64Url = signatureData.data;
let files = base64toFile(base64Url);
ArtSystem.uploadImage({
files: files,
module: this.module,
})
.then((res) => {
let { code, data, message } = res;
if (code !== 200) {
this.$message({
message: "签名图片提交失败!原因:" + message,
type: "error",
});
return;
}
const imageUrl = data.img_path;
this.$emit("uploadSignatureImage", imageUrl);
})
.catch((error) => {
console.error(error);
this.$emit("error", error);
this.$message({
message: error,
type: "error",
});
})
.finally(() => {
this.close();
});
},
closeWrite() {
this.dialogVisible = false;
},
},
};
</script>
<style scoped>
.signature-panel {
width: 100%;
height: 100%;
}
</style>

View File

@ -0,0 +1,190 @@
<template>
<div class="signature-pad">
<div class="container">
<vue-signature-pad
ref="signaturePadRef"
:scaleToDevicePixelRatio="false"
:options="options"
></vue-signature-pad>
</div>
<div class="dialog-footer">
<el-button style="margin-left: 20px" @click="close"> 取消 </el-button>
<el-button type="danger" style="margin-left: 20px" @click="clear">
清除
</el-button>
<el-button plain type="primary" style="margin-left: 20px" @click="save">
保存
</el-button>
</div>
</div>
</template>
<script>
import { artApi } from "../../artApi.js";
import { ElMessageBox } from "element-plus";
export default {
name: "write",
props: {
role: String,
id: Number,
},
data() {
return {
signaturePadKey: 0,
dialogVisible: false,
options: {
penColor: "#000",
onBegin: () => {
//bugcanvas使
this.$refs.signaturePadRef.resizeCanvas();
},
},
uploadApi: `/v2${artApi.artUploadPicture}`, //api
};
},
mounted() {
//
if (window.innerWidth < window.innerHeight) {
this.lockOrientation();
}
},
methods: {
// 退
exitFullscreenAndRestoreOrientation() {
//
if (screen.orientation && screen.orientation.unlock) {
// screen.orientation.unlock();
screen.orientation.lock("portrait");
} // 退
if (document.exitFullscreen && document.fullscreenElement !== null) {
document.exitFullscreen();
}
},
lockOrientation() {
if (document.documentElement.requestFullscreen) {
document.documentElement
.requestFullscreen()
.then(() => {
//
screen.orientation.lock("landscape").catch((err) => {
console.error("无法锁定横屏:", err);
});
})
.catch((err) => {
console.error("全屏失败:", err);
ElMessageBox.alert("请使用横屏进行签名", "提示", {
confirmButtonText: "确定",
callback: () => {
this.lockOrientation();
},
});
});
} else {
console.error("当前浏览器不支持全屏API");
}
},
close() {
this.exitFullscreenAndRestoreOrientation();
this.$emit("close");
},
clear() {
this.$refs.signaturePadRef.clearSignature();
},
save() {
const signatureData = this.$refs.signaturePadRef.saveSignature();
this.$emit("save", signatureData);
},
},
};
</script>
<style scoped>
.signature-pad {
width: 100%;
height: 100%;
display: flex;
padding: 5px;
}
.container {
width: 100%;
height: 100%;
padding: 8px;
border: 1px solid;
}
.dialog-footer {
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
.otherSet {
width: 40%;
display: flex;
align-items: center;
.b1 {
width: 4px;
height: 4px;
}
.b2 {
width: 6px;
height: 6px;
}
.b3 {
width: 8px;
height: 8px;
}
.b1,
.b2,
.b3 {
display: inline-block;
background: #000;
border-radius: 50%;
}
.active {
border: 1px dashed #0074d9;
}
.circleWrap {
display: flex;
justify-content: center;
align-items: center;
width: 18px;
height: 18px;
cursor: pointer;
margin-right: 20px;
}
.penTxt {
width: 70px;
font-size: 12px;
color: #000;
}
}
}
:deep(.el-card) {
height: 25%;
width: 50%;
}
:deep(.el-card__body) {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.svgClass {
width: 5rem;
height: 5rem;
margin-bottom: 2rem;
}
</style>

View File

@ -0,0 +1,338 @@
<!--选择艺术品-->
<template>
<div class="portal-panel">
<div class="body-container panel-shadow">
<div class="search" style="text-align: center; margin-top: 10px">
<el-input
@change="changeSearch"
@keyup.enter.native="changeSearch"
v-model="input"
clearable
class="search-input"
placeholder="请输入检索内容"
>
<template #prepend>
<el-select
v-model="selectdata"
slot="prepend"
placeholder="检索条件"
style="width: 140px"
>
<el-option label="艺术品编号" value="record_number"></el-option>
<el-option
label="登录号"
value="original_registration_number"
></el-option>
<el-option label="作者" value="author"></el-option>
<el-option label="国家" value="country_id"></el-option>
<el-option label="原名" value="old_name"></el-option>
</el-select>
</template>
<template #append>
<el-button
slot="append"
icon="Search"
@click="handleClick"
></el-button>
</template>
</el-input>
</div>
<div class="art-wrap" v-if="archivesDatas.length > 0">
<el-card
@click="handleChecked(art)"
:class="GLOBAL.isMobile ? 'isMobileArtCard' : 'artCard'"
v-for="(art, index) in archivesDatas"
>
<div class="art-image-wrap">
<el-image
class="artwork-image"
:src="art.coverImageUrl"
fit="cover"
>
<template #error>暂无图片</template>
</el-image>
</div>
<div class="art-info">
<span class="art-name">{{ art.oldNameFormat }}</span>
<p class="art-other">艺术家{{ art.author || "未知" }}</p>
<p class="art-other">状态{{ art.statusMsg }}</p>
</div>
</el-card>
</div>
<el-empty style="margin: 10%" v-else description="空空如也"></el-empty>
</div>
<div class="footer-container horizontal-shadow">
<Pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.currPage"
:limit.sync="listQuery.pageSize"
@pageChange="handlePageChange"
></Pagination>
</div>
</div>
</template>
<script>
import ArtSystem from "../artSystem.js";
import { ElMessage } from "element-plus";
import Pagination from "./Pagination/index.vue";
export default {
name: "chooseArtwork",
emits: ["checked"],
props: {
type: String,
},
data() {
return {
listQuery: {
filters: [],
total: 0,
currPage: 1,
pageSize: 10,
listLoading: false,
},
form: {},
input: "",
selectdata: "record_number",
archivesDatas: [],
};
},
components: { Pagination },
mounted() {
this.queryTableData();
},
methods: {
handlePageChange() {},
queryTableData() {
this.listQuery.listLoading = true;
//
let pageInfo = {
currPage: this.listQuery.currPage,
pageSize: this.listQuery.pageSize,
};
ArtSystem.queryArtworks({ pageInfo, filter: this.listQuery.filters })
.then((res) => {
this.archivesDatas = res.data;
this.listQuery.total = res.totalCount;
})
.catch((error) => {
console.error(error);
ElMessage({
message: error,
type: "error",
});
})
.finally(() => {
this.listQuery.listLoading = false;
});
},
removeSearch() {
this.queryTableData();
},
changeSearch() {
console.log(this.input, this.selectdata);
if (this.input) {
let operator;
if (this.selectdata !== "record_number") {
operator = "like";
} else {
operator = "=";
}
this.listQuery.filters = [
{
name: this.selectdata,
operator: operator,
value: this.input,
},
];
} else {
this.listQuery.filters = [];
}
this.queryTableData();
},
handleClick() {
this.changeSearch();
},
handleChecked(art) {
if (this.type === "inStorage") {
if (art.status === 2) {
ElMessage({
message: "该艺术品已经处于入库状态!",
type: "error",
});
return;
}
} else if (this.type === "outStorage") {
if (art.status !== 2) {
ElMessage({
message: "该艺术品目前不在仓库中,无法进行出库!",
type: "error",
});
return;
}
} else if (this.type === "repairFile") {
if (art.status === 2) {
ElMessage({
message: "该艺术品目前处于入库保存状态,请先出库!",
type: "error",
});
return;
}
if (art.status === 4) {
ElMessage({
message: "该艺术品目前已经处于修复中状态!",
type: "error",
});
return;
}
}
this.$emit("checked", art);
},
},
};
</script>
<style scoped>
.portal-panel {
position: relative;
height: 100%;
overflow: hidden;
}
.footer-container {
width: 100%;
position: absolute;
bottom: 0;
justify-content: center;
display: flex;
}
.art-wrap {
display: flex;
flex-flow: row wrap;
margin: 2.1rem;
}
.search-input {
margin: 0 auto;
width: 80%;
}
.isMobileArtCard {
position: relative;
box-sizing: border-box;
border-radius: 2px;
width: 80%;
margin-bottom: 16px;
margin-left: 15px;
margin-right: 15px;
&:hover {
cursor: pointer;
box-shadow: 0 2px 12px 0 rgb(0 0 0 / 20%);
}
& .art-image-wrap {
width: 100%;
height: 200px;
margin: 0 auto;
display: flex;
justify-content: center;
}
& .artwork-image {
width: 100%;
height: 100%;
}
& .art-info {
padding: 10px 0;
text-align: center;
}
& .art-name {
font-size: 16px;
text-align: center;
}
& .art-other {
font-size: 14px;
color: #999999;
margin-top: 10px;
}
}
.artCard {
position: relative;
box-sizing: border-box;
border-radius: 2px;
width: calc(20% - 30px);
margin-bottom: 16px;
margin-left: 15px;
margin-right: 15px;
&:hover {
cursor: pointer;
box-shadow: 0 2px 12px 0 rgb(0 0 0 / 20%);
}
& .art-image-wrap {
width: 100%;
height: 200px;
margin: 0 auto;
display: flex;
justify-content: center;
}
& .artwork-image {
width: 100%;
height: 100%;
}
& .art-info {
padding: 10px 0;
}
& .art-name {
font-size: 16px;
text-align: center;
}
& .art-other {
font-size: 12px;
color: #999999;
margin-top: 10px;
}
}
:deep(.el-card__body) {
display: flex;
flex-direction: column;
align-items: center;
}
@media screen and (max-width: 750px) {
.art-wrap {
display: flex;
overflow-y: scroll;
flex-flow: row wrap;
margin-top: 20px;
justify-content: center;
}
:deep(.el-select) {
width: 7rem !important;
}
.search-input {
width: 100%;
}
.art-wrap::-webkit-scrollbar {
display: none; /* 对于基于Webkit的浏览器如Chrome和Safari */
}
.art-wrap {
-ms-overflow-style: none; /* 对于IE和Edge */
scrollbar-width: none; /* 对于Firefox */
}
}
</style>

View File

@ -1,92 +1,90 @@
import { EditTask } from "@airkoon/cellsys/cellsysUtil";
import {EditTask} from "@airkoon/cellsys/cellsysUtil"; import { artApi } from "./artApi";
import {artApi} from "./artApi"; import { formatterMillisecond } from "./utils/date";
class ConditionReport { class ConditionReport {
constructor(params) { constructor(params) {
if (!params) { if (!params) {
params = {}; params = {};
} }
this.id = params.id; this.id = params.id;
this.artworkRecordId = params.artwork_record_id this.artworkRecordId = params.artwork_record_id;
this.name = params.name; this.name = params.name;
this.modelOptions=params.model_options; this.modelOptions = params.model_options || {};
// let modelOptions = params.model_options; // let modelOptions = params.model_options;
// if (modelOptions) { // if (modelOptions) {
// // this.coverImage = new ArtImage(modelOptions.coverImage);//封面图 // // this.coverImage = new ArtImage(modelOptions.coverImage);//封面图
// // let reportInformation = modelOptions.reportInformation;//报告信息 // // let reportInformation = modelOptions.reportInformation;//报告信息
// // if (reportInformation) { // // if (reportInformation) {
// // this.checkBy = reportInformation.checkBy; // // this.checkBy = reportInformation.checkBy;
// // this.checkDate = reportInformation.checkDate; // // this.checkDate = reportInformation.checkDate;
// // this.checkLocation = reportInformation.checkLocation; // // this.checkLocation = reportInformation.checkLocation;
// // this.documentNumber = reportInformation.documentNumber; // // this.documentNumber = reportInformation.documentNumber;
// // this.conservation = reportInformation.conservation; // // this.conservation = reportInformation.conservation;
// // } // // }
// // let artworkInformation = modelOptions.artworkInformation;//作品信息 // // let artworkInformation = modelOptions.artworkInformation;//作品信息
// // // //
// // let conditionMapping = modelOptions.conditionMapping;//概况图 // // let conditionMapping = modelOptions.conditionMapping;//概况图
// // // //
// // let examination = modelOptions.examination;//查验情况 // // let examination = modelOptions.examination;//查验情况
// // let grids = modelOptions.grids;//九宫格 // // let grids = modelOptions.grids;//九宫格
// // let details = modelOptions.details;//局部图 // // let details = modelOptions.details;//局部图
// // let conservation = modelOptions.conservation;//查验结果 // // let conservation = modelOptions.conservation;//查验结果
// // let suggest = modelOptions.suggest;//保存修复建议 // // let suggest = modelOptions.suggest;//保存修复建议
// // let coverLogo=modelOptions.coverLogo;//封面logo // // let coverLogo=modelOptions.coverLogo;//封面logo
// // let logo=modelOptions.logo; // // let logo=modelOptions.logo;
// modelOptions=new ReportBase() // modelOptions=new ReportBase()
// } // }
let artworkRecord = params.artwork_record; let artworkRecord = params.artwork_record;
if (artworkRecord) { if (artworkRecord) {
this.recordNumber = artworkRecord.record_number; this.recordNumber = artworkRecord.record_number;
this.oldName = artworkRecord.old_name this.oldName = artworkRecord.old_name;
} }
this.tags = []; this.tags = [];
if (params.tag_name) { if (params.tag_name) {
this.tags = params.tag_name.map((name) => { this.tags = params.tag_name.map((name) => {
return { name: name }; return { name: name };
}); });
}
this.createBy = params.create_by;
this.createTime = params.create_time;
this.updateBy = params.update_by;
this.updateTime = params.update_time;
this.creator = params.creator;
this.updater = params.updater;
} }
get coverImageCompress() { this.createBy = params.create_by;
return this.coverImage.compressionUrl; this.createTime = params.create_time;
this.updateBy = params.update_by;
this.updateTime = params.update_time;
this.creator = params.creator;
this.updater = params.updater;
}
get createTimeFormat() {
return formatterMillisecond(this.createTime);
}
get coverImageUrl() {
if (this.modelOptions.coverImage) {
return this.modelOptions.coverImage;
} }
}
conditionCheckInsert(params) {
let editTask = new EditTask(artApi.conditionCheckInsert);
editTask.addParam("_artwork_record_id", params.artworkRecordId);
editTask.addParam("_name", params.name);
editTask.addParam("_model_options", params.modelOptions);
return editTask.execute();
}
conditionCheckUpdate(params) {
let editTask = new EditTask(artApi.conditionCheckUpdate);
editTask.addParam("_id", params.id);
editTask.addParam("_artwork_record_id", params.artworkRecordId);
editTask.addParam("_name", params.name);
editTask.addParam("_model_options", params.modelOptions);
return editTask.execute();
}
conditionCheckDelete(params) {
let editTask = new EditTask(artApi.conditionCheckDelete);
editTask.addParam("_id", params.id);
return editTask.execute();
conditionCheckInsert(params) { }
let editTask = new EditTask(artApi.conditionCheckInsert)
editTask.addParam('_artwork_record_id', params.artworkRecordId);
editTask.addParam('_name', params.name);
editTask.addParam('_model_options', params.modelOptions);
return editTask.execute();
}
conditionCheckUpdate(params) {
let editTask = new EditTask(artApi.conditionCheckUpdate)
editTask.addParam('_id', params.id);
editTask.addParam('_artwork_record_id', params.artworkRecordId);
editTask.addParam('_name', params.name);
editTask.addParam('_model_options', params.modelOptions);
return editTask.execute();
}
conditionCheckDelete(params) {
let editTask = new EditTask(artApi.conditionCheckDelete)
editTask.addParam('_id', params.id);
return editTask.execute();
}
} }
export default ConditionReport; export default ConditionReport;

14
utils/utils.js Normal file
View File

@ -0,0 +1,14 @@
export function base64toFile(dataurl, filename = "file") {
let arr = dataurl.split(",");
let mime = arr[0].match(/:(.*?);/)[1];
let suffix = mime.split("/")[1];
let bstr = window.atob(arr[1]);
let n = bstr.length;
let u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new File([u8arr], `${filename}.${suffix}`, {
type: mime,
});
}