1、增加查询艺术品关联的材料消息
2、修复档案获取封面图判断优化 3、移除无用的orgid属性 4、优化材料库字段 5、调整cellsysBase引用路径
This commit is contained in:
parent
5ecec3115f
commit
185e53f256
@ -84,6 +84,7 @@ const artApi = {
|
||||
repairRecordArchiveReviewUpdate: '/rpc/repairRecordArchiveReviewUpdate', //审核修复档案归档
|
||||
repairRecordCancelArchive: '/rpc/repairRecordCancelArchive', //取消修复档案归档
|
||||
viewStatsAuditNumberCount: '/rpc/view_stats_auditNumber_count', //查询待审核事项数量
|
||||
viewArtworkMaterial: '/rpc/viewArtworkMaterial', //查询艺术品关联的材料记录
|
||||
};
|
||||
|
||||
export { artApi };
|
||||
|
@ -12,7 +12,7 @@ import ArtSystem from './artSystem';
|
||||
|
||||
class ArtRepairFile {
|
||||
constructor(params = {}) {
|
||||
this.cellsysType = "ArtRepairFile";
|
||||
this.cellsysType = 'ArtRepairFile';
|
||||
this.id = params.id;
|
||||
this.name = params.name;
|
||||
this.description = params.description;
|
||||
@ -42,18 +42,17 @@ class ArtRepairFile {
|
||||
//发布状态有关逻辑
|
||||
this.isPublish = params.is_publish;
|
||||
this.isUnlock = params.is_unlock;
|
||||
this.publishRange=params.publish_range
|
||||
this.publishRange = params.publish_range;
|
||||
this.publishGroup = params.publish_group ? params.publish_group : []; //发布的群组
|
||||
}
|
||||
|
||||
//艺术品封面图
|
||||
get coverImageUrl() {
|
||||
if (this.artworkRecord && this.artworkRecord['artworkImages'].length > 0) {
|
||||
if (this.artworkRecord['artworkImages'] && this.artworkRecord['artworkImages'].length > 0) {
|
||||
return this.artworkRecord['artworkImages'][0].compressionUrl;
|
||||
}
|
||||
}
|
||||
|
||||
//艺术品封面图
|
||||
get oldNameFormat() {
|
||||
return `《${this.artworkRecord['oldName']}》`;
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ import EquipmentData from './equipmentData';
|
||||
|
||||
class ArtSystem {
|
||||
constructor(orgId) {}
|
||||
static orgId = window.CELLSYSORG ? window.CELLSYSORG.id : null;
|
||||
static token = null;
|
||||
|
||||
//查询艺术品材质字典
|
||||
static queryMaterials(params = {}) {
|
||||
//static queryMaterials(params = {}) {
|
||||
static queryTexture(params = {}) {
|
||||
let query = new Query();
|
||||
let { filter } = params;
|
||||
if (filter) {
|
||||
|
@ -7,6 +7,7 @@ import ConditionReport from './conditionReport';
|
||||
import ArtCategory from './artCategory';
|
||||
import { formatterMillisecond } from './utils/date';
|
||||
import ArtSystem from './artSystem';
|
||||
import Material from './material';
|
||||
|
||||
class CellsysArt {
|
||||
constructor(params = {}) {
|
||||
@ -186,6 +187,23 @@ class CellsysArt {
|
||||
});
|
||||
}
|
||||
|
||||
//查询艺术品所有修复档案
|
||||
queryRepairFiles(params = {}) {
|
||||
let { filter, pageInfo } = params;
|
||||
if (!filter) {
|
||||
filter = [];
|
||||
}
|
||||
filter.push({
|
||||
name: 'artwork_record_id',
|
||||
operator: '=',
|
||||
value: this.id,
|
||||
});
|
||||
return ArtSystem.queryRepairFiles({
|
||||
filter,
|
||||
pageInfo,
|
||||
});
|
||||
}
|
||||
|
||||
//查询修复状况检查记录
|
||||
queryConditionRecords(params = {}) {
|
||||
let query = new Query();
|
||||
@ -236,17 +254,31 @@ class CellsysArt {
|
||||
}
|
||||
|
||||
//获取艺术品关联的材料数据
|
||||
queryMaterials(params = {}) {
|
||||
let { filter, pageInfo } = params;
|
||||
if (!filter) {
|
||||
filter = [];
|
||||
queryArtMaterials(params = {}) {
|
||||
let query = new Query();
|
||||
let { filter } = params;
|
||||
|
||||
query.addFilter('artwork_record_id', '=', this.id); //病害报告模板
|
||||
|
||||
if (filter) {
|
||||
filter.forEach((item) => {
|
||||
query.addFilter(item['name'], item['operator'], item['value']);
|
||||
});
|
||||
}
|
||||
filter.push({
|
||||
name: 'equipment_id',
|
||||
operator: '=',
|
||||
value: this.id,
|
||||
let queryTask = new QueryTask(artApi.viewArtworkMaterial, false);
|
||||
return new Promise((resolve, reject) => {
|
||||
queryTask
|
||||
.execute(query)
|
||||
.then((res) => {
|
||||
let resArr = res.map((item) => {
|
||||
return new Material(item);
|
||||
});
|
||||
resolve(resArr);
|
||||
})
|
||||
.catch((err) => {
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
return ArtSystem.queryMaterials({ filter, pageInfo });
|
||||
}
|
||||
}
|
||||
|
||||
|
106
material.js
106
material.js
@ -1,58 +1,64 @@
|
||||
import { EditTask } from "./artUtil.js";
|
||||
import { artApi } from "./artApi";
|
||||
import { EditTask } from './artUtil.js';
|
||||
import { artApi } from './artApi';
|
||||
import ArtImage from './artImage';
|
||||
|
||||
class Material {
|
||||
constructor(params) {
|
||||
if (!params) {
|
||||
params = {};
|
||||
constructor(params) {
|
||||
if (!params) {
|
||||
params = {};
|
||||
}
|
||||
this.id = params.id;
|
||||
this.name = params.name;
|
||||
this.description = params.description;
|
||||
this.images = [];
|
||||
if (params.images) {
|
||||
this.images = params.images.map((url) => {
|
||||
return new ArtImage(url);
|
||||
});
|
||||
}
|
||||
this.materialTypeId = params.material_type_id; //材料类型ID
|
||||
this.materialType = params.material_type;
|
||||
this.creator = params.creator;
|
||||
this.updater = params.updater;
|
||||
this.createTime = params.create_time;
|
||||
this.updateTime = params.update_time;
|
||||
}
|
||||
this.id = params.id;
|
||||
this.name = params.name;
|
||||
this.description = params.description;
|
||||
this.images = params.images || null;
|
||||
this.materialTypeId = params.material_type_id; //材料类型ID
|
||||
this.materialType = params.material_type;
|
||||
this.creator = params.creator;
|
||||
this.updater = params.updater;
|
||||
this.createTime = params.create_time;
|
||||
this.updateTime = params.update_time;
|
||||
}
|
||||
//封面图(表格展示缩略图)
|
||||
get imageUrlPreviewPath() {
|
||||
if (this.images && this.images.length > 0) {
|
||||
return this.images[0].previewPath;
|
||||
//封面图(表格展示缩略图)
|
||||
get compressionUrl() {
|
||||
if (this.images && this.images.length > 0) {
|
||||
return this.images[0].compressionUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
get imageUrlimgPath() {
|
||||
if (this.images && this.images.length > 0) {
|
||||
return this.images[0].imgPath;
|
||||
get imageUrl() {
|
||||
if (this.images && this.images.length > 0) {
|
||||
return this.images[0].url;
|
||||
}
|
||||
}
|
||||
}
|
||||
updateMaterial(params) {
|
||||
let { name, description, images } = params;
|
||||
let editTask = new EditTask(artApi.materialUpdate);
|
||||
editTask.addParam("_id", this.id);
|
||||
editTask.addParam("_description", description);
|
||||
editTask.addParam("_name", name);
|
||||
editTask.addParam("_images", images);
|
||||
return new Promise((resolve, reject) => {
|
||||
editTask
|
||||
.execute()
|
||||
.then((res) => {
|
||||
if (res.data) {
|
||||
let material = new Material(res.data);
|
||||
resolve(material);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
reject(err);
|
||||
updateMaterial(params) {
|
||||
let { name, description, images } = params;
|
||||
let editTask = new EditTask(artApi.materialUpdate);
|
||||
editTask.addParam('_id', this.id);
|
||||
editTask.addParam('_description', description);
|
||||
editTask.addParam('_name', name);
|
||||
editTask.addParam('_images', images);
|
||||
return new Promise((resolve, reject) => {
|
||||
editTask
|
||||
.execute()
|
||||
.then((res) => {
|
||||
if (res.data) {
|
||||
let material = new Material(res.data);
|
||||
resolve(material);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
deleteMaterial(params) {
|
||||
let editTask = new EditTask(artApi.materialDelete);
|
||||
editTask.addParam("_id", this.id);
|
||||
return editTask.execute();
|
||||
}
|
||||
}
|
||||
deleteMaterial(params) {
|
||||
let editTask = new EditTask(artApi.materialDelete);
|
||||
editTask.addParam('_id', this.id);
|
||||
return editTask.execute();
|
||||
}
|
||||
}
|
||||
export default Material;
|
||||
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -9,7 +9,7 @@
|
||||
"version": "1.0.7",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@airkoon/cellsys": "git+http://ag:12345678@8.134.38.106:3000/ag/cellsys.git#v1.16.3",
|
||||
"@airkoon/cellsys": "git+http://zhangqg:12345678@airkoon.cn:8418/airkoon/cellsysBase.git#V1.16.4",
|
||||
"@amap/amap-jsapi-loader": "~1.0.1",
|
||||
"@element-plus/icons-vue": "^2.3.1",
|
||||
"axios": "^1.4.0",
|
||||
@ -21,8 +21,8 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@airkoon/cellsys": {
|
||||
"version": "1.16.3",
|
||||
"resolved": "git+http://ag:12345678@8.134.38.106:3000/ag/cellsys.git#919709e5601cd746e2c254374a66da58f6f82934",
|
||||
"version": "1.16.4",
|
||||
"resolved": "git+http://zhangqg:12345678@airkoon.cn:8418/airkoon/cellsysBase.git#ba9bfcbdcc0bc00b87e1f526cee8ce06830e611f",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"axios": "~1.4.0",
|
||||
|
@ -8,7 +8,7 @@
|
||||
"license": "ISC",
|
||||
"description": "美院相关",
|
||||
"dependencies": {
|
||||
"@airkoon/cellsys": "git+http://ag:12345678@8.134.38.106:3000/ag/cellsys.git#v1.16.3",
|
||||
"@airkoon/cellsys": "git+http://zhangqg:12345678@airkoon.cn:8418/airkoon/cellsysBase.git#V1.16.4",
|
||||
"axios": "^1.4.0",
|
||||
"dayjs": "~1.10.6",
|
||||
"element-plus": "^2.3.7",
|
||||
|
Loading…
x
Reference in New Issue
Block a user