1.0.3版本号
This commit is contained in:
parent
be44ae8ad5
commit
d820b02c25
65
artApi.js
65
artApi.js
@ -1,37 +1,44 @@
|
||||
const artApi = {
|
||||
country: '/rpc/view_country_code', //查询国家数据
|
||||
artworkRepair: '/rpc/view_art_artwork_repair_rel',
|
||||
artworkRecord: '/rpc/view_art_artwork_record', //查询档案
|
||||
artworkDetails: '/rpc/view_art_artwork_detail', //查看档案详情
|
||||
artUploadPicture: '/rpc/artUploadPicture', //图片上传
|
||||
artArtworkRecordInsert: '/rpc/artArtworkRecordInsert', //创建档案
|
||||
artArtworkRecordDelete: '/rpc/artArtworkRecordDelete', //删除艺术品档案
|
||||
artArtworkRecordUpdate: '/rpc/artArtworkRecordUpdate', //编辑艺术品档案
|
||||
viewWareHouseType: '/rpc/ViewWareHouseType', //查询仓库类型
|
||||
wareHouseTypeInsert: '/rpc/wareHouseTypeInsert', //创建仓库类型
|
||||
wareHouseTypeUpdate: '/rpc/wareHouseTypeUpdate', //修改仓库类型
|
||||
wareHouseTypeDelete: '/rpc/wareHouseTypeDelete', //删除仓库类型
|
||||
wareHouseInsert: '/rpc/wareHouseInsert', //创建仓库
|
||||
wareHouseUpdate: '/rpc/wareHouseUpdate', //修改仓库
|
||||
wareHouseDelete: '/rpc/wareHouseDelete', //删除仓库
|
||||
viewWareHouse: '/rpc/viewWareHouse', //查询仓库
|
||||
countInWareHouse: '/rpc/countArtworkInWareHouse', //盘点数据
|
||||
wareHouseEntryInsert: '/rpc/wareHouseEntryInsert', //新增入库
|
||||
wareHouseEntryUpdate: '/rpc/wareHouseEntryUpdate', //修改入库
|
||||
wareHouseEntryDelete: '/rpc/wareHouseEntryDelete', //删除入库
|
||||
viewWareHouseEntry: '/rpc/viewWareHouseEntry', //查询入库
|
||||
wareHouseOutboundInsert: '/rpc/wareHouseOutboundInsert', //新增出库记录
|
||||
wareHouseOutboundUpdate: '/rpc/wareHouseOutboundUpdate', //修改出库记录
|
||||
wareHouseOutboundDelete: '/rpc/wareHouseOutboundDelete', //删除出库记录
|
||||
viewWareHouseOutbound: '/rpc/viewWareHouseOutbound', //c查询出库记录
|
||||
wareHouseOutboundReviewInsert: '/rpc/wareHouseOutboundReviewInsert', //创建出库申请审核
|
||||
wareHouseOutboundReviewUpdate: '/rpc/wareHouseOutboundReviewUpdate', //审核出库申请
|
||||
viewWareHouseOutboundReview: '/rpc/viewWareHouseOutboundReview', //查询出库记录审核
|
||||
country: "/rpc/view_country_code", //查询国家数据
|
||||
artworkRepair: "/rpc/view_art_artwork_repair_rel",
|
||||
artworkRecord: "/rpc/view_art_artwork_record", //查询档案
|
||||
artworkDetails: "/rpc/view_art_artwork_detail", //查看档案详情
|
||||
artUploadPicture: "/rpc/artUploadPicture", //图片上传
|
||||
artArtworkRecordInsert: "/rpc/artArtworkRecordInsert", //创建档案
|
||||
artArtworkRecordDelete: "/rpc/artArtworkRecordDelete", //删除艺术品档案
|
||||
artArtworkRecordUpdate: "/rpc/artArtworkRecordUpdate", //编辑艺术品档案
|
||||
viewWareHouseType: "/rpc/ViewWareHouseType", //查询仓库类型
|
||||
wareHouseTypeInsert: "/rpc/wareHouseTypeInsert", //创建仓库类型
|
||||
wareHouseTypeUpdate: "/rpc/wareHouseTypeUpdate", //修改仓库类型
|
||||
wareHouseTypeDelete: "/rpc/wareHouseTypeDelete", //删除仓库类型
|
||||
wareHouseInsert: "/rpc/wareHouseInsert", //创建仓库
|
||||
wareHouseUpdate: "/rpc/wareHouseUpdate", //修改仓库
|
||||
wareHouseDelete: "/rpc/wareHouseDelete", //删除仓库
|
||||
viewWareHouse: "/rpc/viewWareHouse", //查询仓库
|
||||
countInWareHouse: "/rpc/countArtworkInWareHouse", //盘点数据
|
||||
wareHouseEntryInsert: "/rpc/wareHouseEntryInsert", //新增入库
|
||||
wareHouseEntryUpdate: "/rpc/wareHouseEntryUpdate", //修改入库
|
||||
wareHouseEntryDelete: "/rpc/wareHouseEntryDelete", //删除入库
|
||||
viewWareHouseEntry: "/rpc/viewWareHouseEntry", //查询入库
|
||||
wareHouseOutboundInsert: "/rpc/wareHouseOutboundInsert", //新增出库记录
|
||||
wareHouseOutboundUpdate: "/rpc/wareHouseOutboundUpdate", //修改出库记录
|
||||
wareHouseOutboundDelete: "/rpc/wareHouseOutboundDelete", //删除出库记录
|
||||
viewWareHouseOutbound: "/rpc/viewWareHouseOutbound", //c查询出库记录
|
||||
wareHouseOutboundReviewInsert: "/rpc/wareHouseOutboundReviewInsert", //创建出库申请审核
|
||||
wareHouseOutboundReviewUpdate: "/rpc/wareHouseOutboundReviewUpdate", //审核出库申请
|
||||
viewWareHouseOutboundReview: "/rpc/viewWareHouseOutboundReview", //查询出库记录审核
|
||||
conditionCheckInsert: "/rpc/conditionCheckInsert", //创建状况检查
|
||||
conditionCheckUpdate: "/rpc/conditionCheckUpdate", //修改状况检查
|
||||
conditionCheckDelete: "/rpc/conditionCheckDelete", //删除状况检查
|
||||
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 };
|
||||
|
20
artEnum.js
20
artEnum.js
@ -1,12 +1,20 @@
|
||||
export const artStatus = {
|
||||
0: '未入库',
|
||||
1: '已入库',
|
||||
2: '已出库',
|
||||
3: '修复中',
|
||||
1: "未入库",
|
||||
2: "已入库",
|
||||
3: "已出库",
|
||||
4: "修复中",
|
||||
};
|
||||
|
||||
//入库记录状态
|
||||
export const godownEntryStatus = {
|
||||
0: '未签名',
|
||||
1: '已入库',
|
||||
0: "未签名",
|
||||
1: "已入库",
|
||||
};
|
||||
//0-未审核 1-审核中 2-审核通过 3-审核不通过 4-方案变更
|
||||
export const artRepairPlanStatus = {
|
||||
0:'未审核',
|
||||
1:'审核中',
|
||||
2:'审核通过',
|
||||
3:'审核不通过',
|
||||
4:'方案变更'
|
||||
}
|
16
artRepairEvent.js
Normal file
16
artRepairEvent.js
Normal 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;
|
118
artRepairFile.js
118
artRepairFile.js
@ -1,12 +1,126 @@
|
||||
import ArtImage from "./artImage";
|
||||
import { formatterMillisecond } from "./utils/date";
|
||||
import { artApi } from "./artApi";
|
||||
import {
|
||||
EditTask,
|
||||
Operator,
|
||||
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.artworkRecordId = params.artwork_record_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;
|
||||
}
|
||||
}
|
||||
|
||||
export default ArtRepairFile
|
||||
//艺术品封面图
|
||||
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;
|
||||
|
77
artRepairPlan.js
Normal file
77
artRepairPlan.js
Normal 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;
|
145
artSystem.js
145
artSystem.js
@ -1,11 +1,18 @@
|
||||
import { Query, QueryTask, QueryType, Operator } from '@airkoon/cellsys/cellsysUtil.js';
|
||||
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 {
|
||||
Query,
|
||||
QueryTask,
|
||||
QueryType,
|
||||
Operator,
|
||||
} from "@airkoon/cellsys/cellsysUtil.js";
|
||||
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 ArtRepairPlan from "./artRepairPlan";
|
||||
import * as http from "@airkoon/cellsys/utils/axios";
|
||||
|
||||
class ArtSystem {
|
||||
constructor(orgId) {}
|
||||
@ -16,10 +23,10 @@ class ArtSystem {
|
||||
let { filter } = params;
|
||||
if (filter) {
|
||||
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');
|
||||
query.addFilter("dict_type", Operator.Equals, "material");
|
||||
let queryTask = new QueryTask(QueryType.sysDictData, false);
|
||||
return new Promise((resolve, reject) => {
|
||||
queryTask
|
||||
@ -35,8 +42,8 @@ class ArtSystem {
|
||||
//查询艺术品一级分类
|
||||
static queryArtCategoryOne() {
|
||||
let query = new Query();
|
||||
query.addFilter('parent_id', Operator.Equals, 1);
|
||||
query.setOrder({ sort: 'asc' });
|
||||
query.addFilter("parent_id", Operator.Equals, 1);
|
||||
query.setOrder({ sort: "asc" });
|
||||
let queryTask = new QueryTask(QueryType.sysCategoryData, false);
|
||||
return new Promise((resolve, reject) => {
|
||||
queryTask
|
||||
@ -51,7 +58,7 @@ class ArtSystem {
|
||||
}
|
||||
static queryArtCategoryById(parentId) {
|
||||
let query = new Query();
|
||||
query.addFilter('parent_id', Operator.Equals, parentId);
|
||||
query.addFilter("parent_id", Operator.Equals, parentId);
|
||||
let queryTask = new QueryTask(QueryType.sysCategoryData, false);
|
||||
return new Promise((resolve, reject) => {
|
||||
queryTask
|
||||
@ -70,7 +77,7 @@ class ArtSystem {
|
||||
let { pageInfo, order, filter } = params;
|
||||
if (filter) {
|
||||
filter.forEach((item) => {
|
||||
query.addFilter(item['field'], item['operator'], item['value']);
|
||||
query.addFilter(item["name"], item["operator"], item["value"]);
|
||||
});
|
||||
}
|
||||
let queryTask = new QueryTask(artApi.country, !!pageInfo);
|
||||
@ -109,15 +116,18 @@ class ArtSystem {
|
||||
}
|
||||
if (filter) {
|
||||
filter.forEach((item) => {
|
||||
query.addFilter(item['name'], item['operator'], item['value']);
|
||||
query.addFilter(item["name"], item["operator"], item["value"]);
|
||||
});
|
||||
}
|
||||
if (order) {
|
||||
query.setOrder(order);
|
||||
} else {
|
||||
query.setOrder({ id: 'desc' });
|
||||
query.setOrder({ id: "desc" });
|
||||
}
|
||||
let queryTask = new QueryTask(artApi.artworkRecord, pageInfo ? true : false);
|
||||
let queryTask = new QueryTask(
|
||||
artApi.artworkRecord,
|
||||
pageInfo ? true : false
|
||||
);
|
||||
return new Promise((resolve, reject) => {
|
||||
queryTask
|
||||
.execute(query)
|
||||
@ -145,32 +155,35 @@ class ArtSystem {
|
||||
//创建艺术品档案
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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("_category_three", params.categoryThree.id);
|
||||
}
|
||||
editTask.addParam('_original_registration_number', params.originalRegistrationNumber);
|
||||
editTask.addParam('_remark', params.remarks);
|
||||
editTask.addParam('_images', params.images);
|
||||
editTask.addParam(
|
||||
"_original_registration_number",
|
||||
params.originalRegistrationNumber
|
||||
);
|
||||
editTask.addParam("_remark", params.remarks);
|
||||
editTask.addParam("_images", params.images);
|
||||
return new Promise((resolve, reject) => {
|
||||
editTask
|
||||
.execute()
|
||||
@ -201,16 +214,19 @@ class ArtSystem {
|
||||
if (order) {
|
||||
query.setOrder(order);
|
||||
} else {
|
||||
query.setOrder({ id: 'desc' });
|
||||
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']); //病害报告模板
|
||||
query.addFilter(item["name"], item["operator"], item["value"]); //病害报告模板
|
||||
});
|
||||
}
|
||||
let queryTask = new QueryTask(artApi.viewConditionCheck, pageInfo ? true : false);
|
||||
let queryTask = new QueryTask(
|
||||
artApi.viewConditionCheck,
|
||||
pageInfo ? true : false
|
||||
);
|
||||
return new Promise((resolve, reject) => {
|
||||
queryTask
|
||||
.execute(query)
|
||||
@ -240,10 +256,10 @@ class ArtSystem {
|
||||
let artworkId = params.artworkId;
|
||||
let eventSetId = params.eventSetId;
|
||||
if (artworkId) {
|
||||
query.addFilter('artwork.id', Operator.Equals, artworkId); //病害报告模板
|
||||
query.addFilter("artwork.id", Operator.Equals, artworkId); //病害报告模板
|
||||
}
|
||||
if (eventSetId) {
|
||||
query.addFilter('event_set.id', Operator.Equals, eventSetId); //病害报告模板
|
||||
query.addFilter("event_set.id", Operator.Equals, eventSetId); //病害报告模板
|
||||
}
|
||||
let queryTask = new QueryTask(artApi.artworkRepair, false);
|
||||
return new Promise((resolve, reject) => {
|
||||
@ -264,7 +280,7 @@ class ArtSystem {
|
||||
let query = new Query();
|
||||
let artworkId = params.artworkId;
|
||||
if (artworkId) {
|
||||
query.addFilter('artwork.id', Operator.Equals, artworkId); //病害报告模板
|
||||
query.addFilter("artwork.id", Operator.Equals, artworkId); //病害报告模板
|
||||
}
|
||||
let queryTask = new QueryTask(artApi.artworkRepair, false);
|
||||
return new Promise((resolve, reject) => {
|
||||
@ -287,7 +303,7 @@ class ArtSystem {
|
||||
let { filter, pageInfo } = params;
|
||||
if (filter) {
|
||||
filter.forEach((item) => {
|
||||
query.addFilter(item['field'], item['operator'], item['value']);
|
||||
query.addFilter(item["name"], item["operator"], item["value"]);
|
||||
});
|
||||
}
|
||||
let queryTask = new QueryTask(artApi.viewRepairRecord, !!pageInfo);
|
||||
@ -316,6 +332,53 @@ class ArtSystem {
|
||||
});
|
||||
});
|
||||
}
|
||||
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);
|
||||
return new Promise((resolve, reject) => {
|
||||
queryTask
|
||||
.execute(query)
|
||||
.then((res) => {
|
||||
if (pageInfo) {
|
||||
if (res.data) {
|
||||
res.data = res.data.map((item) => {
|
||||
return new ArtRepairPlan(item);
|
||||
});
|
||||
resolve(res);
|
||||
} else {
|
||||
reject(new Error("修复方案数据格式异常"));
|
||||
}
|
||||
} else {
|
||||
let resArr = res.map((item) => {
|
||||
return new ArtRepairPlan(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;
|
||||
|
@ -1,13 +1,15 @@
|
||||
import ArtSystem from "./artSystem";
|
||||
import ArtImage from "./artImage";
|
||||
import { artStatus } from "./artEnum";
|
||||
import {
|
||||
EditTask,
|
||||
EditType,
|
||||
Operator,
|
||||
Query,
|
||||
QueryTask,
|
||||
} from "@airkoon/cellsys/cellsysUtil";
|
||||
import { artApi } from "./artApi";
|
||||
import ArtRepairFile from "./artRepairFile";
|
||||
import ConditionReport from "./conditionReport";
|
||||
|
||||
class CellsysArt {
|
||||
constructor(params = {}) {
|
||||
@ -60,6 +62,10 @@ class CellsysArt {
|
||||
}
|
||||
}
|
||||
|
||||
get statusMsg() {
|
||||
return artStatus[this.status];
|
||||
}
|
||||
|
||||
get artworkImagesUrl() {
|
||||
if (this.artworkImages.length > 0) {
|
||||
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) => {
|
||||
ArtSystem.queryArtworkEvent({
|
||||
artworkId: this.id,
|
||||
})
|
||||
editTask
|
||||
.execute()
|
||||
.then((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) => {
|
||||
reject(err);
|
||||
|
247
components/Pagination/index.vue
Normal file
247
components/Pagination/index.vue
Normal 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>
|
103
components/Signature/index.vue
Normal file
103
components/Signature/index.vue
Normal 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>
|
190
components/Signature/write.vue
Normal file
190
components/Signature/write.vue
Normal 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: () => {
|
||||
//该签名组件有bug,在非移动端环境下需要重新渲染canvas的尺寸才能正常使用
|
||||
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>
|
338
components/chooseArtwork.vue
Normal file
338
components/chooseArtwork.vue
Normal 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>
|
@ -1,6 +1,6 @@
|
||||
|
||||
import { EditTask } from "@airkoon/cellsys/cellsysUtil";
|
||||
import { artApi } from "./artApi";
|
||||
import { formatterMillisecond } from "./utils/date";
|
||||
|
||||
class ConditionReport {
|
||||
constructor(params) {
|
||||
@ -8,9 +8,9 @@ class ConditionReport {
|
||||
params = {};
|
||||
}
|
||||
this.id = params.id;
|
||||
this.artworkRecordId = params.artwork_record_id
|
||||
this.artworkRecordId = params.artwork_record_id;
|
||||
this.name = params.name;
|
||||
this.modelOptions=params.model_options;
|
||||
this.modelOptions = params.model_options || {};
|
||||
// let modelOptions = params.model_options;
|
||||
// if (modelOptions) {
|
||||
// // this.coverImage = new ArtImage(modelOptions.coverImage);//封面图
|
||||
@ -38,7 +38,7 @@ class ConditionReport {
|
||||
let artworkRecord = params.artwork_record;
|
||||
if (artworkRecord) {
|
||||
this.recordNumber = artworkRecord.record_number;
|
||||
this.oldName = artworkRecord.old_name
|
||||
this.oldName = artworkRecord.old_name;
|
||||
}
|
||||
this.tags = [];
|
||||
if (params.tag_name) {
|
||||
@ -54,37 +54,35 @@ class ConditionReport {
|
||||
this.creator = params.creator;
|
||||
this.updater = params.updater;
|
||||
}
|
||||
|
||||
get coverImageCompress() {
|
||||
return this.coverImage.compressionUrl;
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
let editTask = new EditTask(artApi.conditionCheckDelete);
|
||||
editTask.addParam("_id", params.id);
|
||||
return editTask.execute();
|
||||
}
|
||||
}
|
||||
|
14
utils/utils.js
Normal file
14
utils/utils.js
Normal 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,
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user