From 7a600728e9b84c09fbc9a6a66f4cc8169111c053 Mon Sep 17 00:00:00 2001 From: ag <2663588772@qq.com> Date: Tue, 25 Feb 2025 09:47:45 +0800 Subject: [PATCH] 1.0.4 --- .prettierrc.js | 24 + ReportArt.js | 72 +-- ReportBase.js | 304 +++++---- artApi.js | 125 ++-- artCategory.js | 118 ++++ artEnum.js | 22 +- artRepairEvent.js | 16 - artRepairFile.js | 347 ++++++---- artRepairLog.js | 89 +++ artRepairPlan.js | 170 ++--- artSystem.js | 1083 +++++++++++++++++++++----------- artUser.js | 127 +++- artUtil.js | 306 +++++++++ auditRecord.js | 34 + cellsysArt.js | 426 +++++++------ components/Signature/index.vue | 249 +++++--- components/Signature/write.vue | 386 +++++++----- components/amapSearch.vue | 359 +++++++++++ components/chooseArtwork.vue | 588 ++++++++--------- conditionReport.js | 175 +++--- disease.js | 54 ++ godownEntry.js | 22 +- materialType.js | 66 ++ outBoundReview.js | 10 +- outbound.js | 78 ++- package-lock.json | 858 ++++++++++++++++++++++++- package.json | 11 +- repairFileAudit.js | 54 ++ repairPlanAudit.js | 34 + synergyAudit.js | 29 + utils/axios.js | 39 ++ wareHouse.js | 182 +++--- wareHouseType.js | 182 +++--- 33 files changed, 4806 insertions(+), 1833 deletions(-) create mode 100644 .prettierrc.js create mode 100644 artCategory.js delete mode 100644 artRepairEvent.js create mode 100644 artRepairLog.js create mode 100644 artUtil.js create mode 100644 auditRecord.js create mode 100644 components/amapSearch.vue create mode 100644 disease.js create mode 100644 materialType.js create mode 100644 repairFileAudit.js create mode 100644 repairPlanAudit.js create mode 100644 synergyAudit.js create mode 100644 utils/axios.js diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..db85d70 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,24 @@ +// 文件配置说明 +//此处的规则供参考,其中多半其实都是默认值,可以根据个人习惯改写 +module.exports = { + printWidth: 100, //单行长度 + tabWidth: 4, //缩进长度 + useTabs: false, //使用空格代替 tab 缩进 + semi: true, //句末使用分号 + singleQuote: true, //使用单引号 + quoteProps: 'as-needed', //仅在必需时为对象的 key 添加引号 + jsxSingleQuote: true, // jsx 中使用单引号 + trailingComma: 'all', //多行时尽可能打印尾随逗号 + bracketSpacing: true, //在对象前后添加空格-eg: { foo: bar } + jsxBracketSameLine: false, //多属性 html 标签的‘>’折行放置 + bracketSameLine: true, + arrowParens: 'always', //单参数箭头函数参数周围使用圆括号-eg: (x) => x + requirePragma: false, //无需顶部注释即可格式化 + insertPragma: false, //在已被 prettier 格式化的文件顶部加上标注 + proseWrap: 'preserve', //不知道怎么翻译 + htmlWhitespaceSensitivity: 'ignore', //对 HTML 全局空白不敏感 + vueIndentScriptAndStyle: false, //不对 vue 中的 script 及 style 标签缩进 + endOfLine: 'lf', //结束行形式 + embeddedLanguageFormatting: 'auto', //对引用代码进行格式化 + singleAttributePerLine: true, //每个属性单独占一行 +}; diff --git a/ReportArt.js b/ReportArt.js index e1cf832..934140c 100644 --- a/ReportArt.js +++ b/ReportArt.js @@ -1,43 +1,43 @@ - -class ReportArt{ - constructor(params) { - if(!params){ - params = {}; - } - this.artworkId = params.id || null;//艺术品id、 - this.artworkOldName = params.oldName || "无";//艺术品原名 - this.author = params.author || "无";//作者 - this.createPeriod = params.createPeriod || "无";//创作年代 - this.materialName = params.materialName || "无";//材质 - this.artworkImages = params.artworkImages || "";//艺术品图片 - this.actualNumber=params.actualNumber || 1;//数量 - this.shippingContainerType = [];//包装类型 - this.packingMaterials = [];//填充物 - this.transportPurpose = [];//运输目的 +class ReportArt { + constructor(params) { + if (!params) { + params = {}; } - setAttribute(art){ - this.artworkId = art.artworkRecordId || null;//艺术品id、 - this.artworkOldName = art.artworkOldName || "无";//艺术品原名 - this.author = art.author || "无";//作者 - this.createPeriod = art.createPeriod || "无";//创作年代 - this.materialName = art.materialName || "无";//材质 - this.artworkImages = art.artworkImages || "";//艺术品图片 - this.actualNumber=art.actualNumber || 1;//数量 + this.artworkId = params.id || null; //艺术品id、 + this.artworkOldName = params.oldName || "无"; //艺术品原名 + this.author = params.author || "无"; //作者 + this.createPeriod = params.createPeriod || "无"; //创作年代 + this.textureName = params.textureName || "无"; //材质 + this.artworkImages = params.artworkImages || ""; //艺术品图片 + this.actualNumber = params.actualNumber || 1; //数量 + this.shippingContainerType = []; //包装类型 + this.packingMaterials = []; //填充物 + this.transportPurpose = []; //运输目的 + } - if(art.transportPurpose.length > 0){ - this.transportPurpose = art.transportPurpose; - } - if(art.shippingContainerType.length > 0){ - this.shippingContainerType =art.shippingContainerType; - } - if(art.packingMaterials.length > 0){ - this.packingMaterials = art.packingMaterials; - } + setAttribute(art) { + this.artworkId = art.artworkRecordId || null; //艺术品id、 + this.artworkOldName = art.artworkOldName || "无"; //艺术品原名 + this.author = art.author || "无"; //作者 + this.createPeriod = art.createPeriod || "无"; //创作年代 + this.textureName = art.textureName || "无"; //材质 + this.artworkImages = art.artworkImages || ""; //艺术品图片 + this.actualNumber = art.actualNumber || 1; //数量 + + if (art.transportPurpose.length > 0) { + this.transportPurpose = art.transportPurpose; } - setMaterials(val){ - this.materials = val; + if (art.shippingContainerType.length > 0) { + this.shippingContainerType = art.shippingContainerType; } + if (art.packingMaterials.length > 0) { + this.packingMaterials = art.packingMaterials; + } + } + setMaterials(val) { + this.materials = val; + } } -export default ReportArt \ No newline at end of file +export default ReportArt; diff --git a/ReportBase.js b/ReportBase.js index b75d6b4..9842d68 100644 --- a/ReportBase.js +++ b/ReportBase.js @@ -1,174 +1,160 @@ -import {formatterDate} from '@/utils/date'; +import { formatterDate } from "@/utils/date"; class ReportBase { - constructor(params) { - if (!params) { - params = {}; - } - this.documentNumber = formatterDate(new Date(), 'YYYYMMDDHHmmss'); - this.reportName = params.reportName || null; - this.checkDate = params.checkDate || new Date().getTime(); - this.checkLocation = params.checkLocation || ''; - this.checkLocationGeometry = params.checkLocationGeometry || null; //geometry格式 - this.consignor = params.consignor || ''; //托运方 - this.actualNumber = params.actualNumber || 1; - this.checkBy = params.checkBy || ''; - this.reportBy = params.reportBy || ''; - this.coverImage = params.coverImage; //报告封面图 - this.conditionTypes = []; - this.conditionInfo = null; //状况类型补充说明 - this.conditionImageList = []; // 局部详情图{title,description,image} - this.conditionMapping = {}; - this.grids = { - gridsNumber: 4, - gridsImgs: [], - }; - this.conservation = params.conservation || null; - this.suggest = params.suggest || null; - this.environmentTemperature = params.environmentTemperature || null; //不带单位 - this.environmentHumidity = params.environmentHumidity || null; //不带单位 - this.logo = null; - // this.coverLogo = `${window.GLOBAL["BASE_URL"]}/AppTemplate/conditionReport/images/reportLogo.png`; - // this.organizationName = params.organizationName; - // this.organizationEmail = 'ja.atelier@hotmail.com'; - // this.organizationPhone = '+86-13911819084 / +33 (0)7.82.15.72.97'; - // this.signatureInfo = { - // "weChatImg": `${window.GLOBAL["BASE_URL"]}/AppTemplate/conditionReport/images/erm.png`, - // "signer": "Jia Peng", - // "signerInfo":"Conservator - Restorer of the cultural heritage recognized by the Direction of the museums of France (D.M.F)\n" + - // "Professor of Conservation-Restoration & Material research of Art of Guangzhou Academy of Fine Art (GAFA)\n" + - // "Director of Guangdong Provincial Key Laboratory of Conservation-Restoration & Materials Research of Artworks" - // } + constructor(params) { + if (!params) { + params = {}; + } + this.documentNumber = formatterDate(new Date(), "YYYYMMDDHHmmss"); + this.reportName = params.reportName || null; + this.checkDate = params.checkDate || new Date().getTime(); + this.checkLocation = params.checkLocation || ""; + this.checkLocationGeometry = params.checkLocationGeometry || null; //geometry格式 + + this.checkBy = params.checkBy || ""; + this.reportBy = params.reportBy || ""; + this.coverImage = params.coverImage; //报告封面图 + this.conditionTypes = []; + + this.conditionImageList = []; // 状况分析详情图{title,description,image} + this.conditionMapping = []; //状况图对象数组 {original,graphing,superposition,legend} legend包含{key,desc,color} + this.grids = { + gridsNumber: 4, + gridsImgs: [], + }; + this.conservation = params.conservation || null; + this.suggest = params.suggest || null; + this.environmentTemperature = params.environmentTemperature || null; //不带单位 + this.environmentHumidity = params.environmentHumidity || null; //不带单位 + this.logo = null; + // this.coverLogo = `${window.GLOBAL["BASE_URL"]}/AppTemplate/conditionReport/images/reportLogo.png`; + // this.organizationName = params.organizationName; + // this.organizationEmail = 'ja.atelier@hotmail.com'; + // this.organizationPhone = '+86-13911819084 / +33 (0)7.82.15.72.97'; + // this.signatureInfo = { + // "weChatImg": `${window.GLOBAL["BASE_URL"]}/AppTemplate/conditionReport/images/erm.png`, + // "signer": "Jia Peng", + // "signerInfo":"Conservator - Restorer of the cultural heritage recognized by the Direction of the museums of France (D.M.F)\n" + + // "Professor of Conservation-Restoration & Material research of Art of Guangzhou Academy of Fine Art (GAFA)\n" + + // "Director of Guangdong Provincial Key Laboratory of Conservation-Restoration & Materials Research of Artworks" + // } + } + + setAttribute(reportBase) { + if (!reportBase) { + return; + } + if (reportBase.documentNumber) { + this.documentNumber = reportBase.documentNumber; + } + if (reportBase.checkDate) { + this.checkDate = reportBase.checkDate; } - setAttribute(reportBase) { - if (!reportBase) { - return; - } - if (reportBase.documentNumber) { - this.documentNumber = reportBase.documentNumber; - } - if (reportBase.checkDate) { - this.checkDate = reportBase.checkDate; - } - if (reportBase.actualNumber) { - this.actualNumber = reportBase.actualNumber; - } - this.reportName = reportBase.reportName; + this.reportName = reportBase.reportName; - this.checkLocation = reportBase.checkLocation; - this.consignor = reportBase.consignor; + this.checkLocation = reportBase.checkLocation; - this.checkBy = reportBase.checkBy; + this.checkBy = reportBase.checkBy; - this.reportBy = reportBase.reportBy; - if (reportBase.coverImage) { - this.coverImage = reportBase.coverImage; - } - if (reportBase.conservation) { - this.conservation = reportBase.conservation; - } - if (reportBase.suggest) { - this.suggest = reportBase.suggest; - } - if (reportBase.grids) {//宫格图 - this.grids = reportBase.grids; - } - if (reportBase.conditionMapping) { - if (reportBase.conditionMapping.images) { - this.conditionMapping['images'] = reportBase.conditionMapping.images; - } - if (reportBase.conditionMapping.legend) { - this.conditionMapping['legend'] = reportBase.conditionMapping.legend; - } - } - - if (reportBase.conditionTypes) { - this.conditionTypes = reportBase.conditionTypes; - } - if (reportBase.conditionImageList) { - this.conditionImageList = reportBase.conditionImageList; - } - if (reportBase.conditionInfo) { - this.conditionInfo = reportBase.conditionInfo; - } - this.checkLocationGeometry = reportBase.checkLocationGeometry || null; //geometry格式 - this.environmentTemperature = reportBase.environmentTemperature || null; - this.environmentHumidity = reportBase.environmentHumidity || null; + this.reportBy = reportBase.reportBy; + if (reportBase.coverImage) { + this.coverImage = reportBase.coverImage; + } + if (reportBase.conservation) { + this.conservation = reportBase.conservation; + } + if (reportBase.suggest) { + this.suggest = reportBase.suggest; + } + if (reportBase.grids) { + //宫格图 + this.grids = reportBase.grids; + } + if (reportBase.conditionMapping) { + this.conditionMapping = reportBase.conditionMapping; } - setReportBy(val) { - this.reportBy = val; + if (reportBase.conditionTypes) { + this.conditionTypes = reportBase.conditionTypes; + } + if (reportBase.conditionImageList) { + this.conditionImageList = reportBase.conditionImageList; } - setCoverImage(imageSrc) { - this.coverImage = imageSrc; - } - - setConditionTypes(val) { - this.conditionTypes = val || []; - } - - setConditionInfo(val) { - this.conditionInfo = val; - } - - - setConditionImageList(fileList) { - this.conditionImageList = fileList; - } - - setImagesLegend(imgSrc, legend) { - this.conditionMapping['images'] = imgSrc; - this.conditionMapping['legend'] = legend; - } - - - setConservation(val) { - this.conservation = val; - } - - setSuggest(val) { - this.suggest = val; - } - - setLogo(val) { - this.logo = window.GLOBAL["BASE_URL"] + val; - } - - setCoverLogo(val) { - this.coverLogo = val; - } - - setOrgName(val) { - this.organizationName = val; - } - - setOrgEmail(val) { - this.organizationEmail = val; - } - - setOrgPhone(val) { - this.organizationPhone = val; - } - - setGrids(gridNumber, girdList) { - this.grids['gridsNumber'] = gridNumber; - this.grids['gridsImgs'] = girdList; - } - - setCheckLocation(checkLocation) { - this.checkLocation = checkLocation; - } - - setCheckLocationGeometry(geometry) { - if (geometry) { - this.checkLocationGeometry = { - type: 'Point', - coordinates: geometry.coordinates, - }; - } + this.checkLocationGeometry = reportBase.checkLocationGeometry || null; //geometry格式 + this.environmentTemperature = reportBase.environmentTemperature || null; + this.environmentHumidity = reportBase.environmentHumidity || null; + } + + setReportBy(val) { + this.reportBy = val; + } + + setCoverImage(imageSrc) { + this.coverImage = imageSrc; + } + + setConditionTypes(val) { + this.conditionTypes = val || []; + } + + setConditionImageList(fileList) { + this.conditionImageList = fileList; + } + + /* setImagesLegend(imgSrc, legend) { + this.conditionMapping["images"] = imgSrc; + this.conditionMapping["legend"] = legend; + }*/ + setConditionMapping(items) { + this.conditionMapping = items; + } + setConservation(val) { + this.conservation = val; + } + + setSuggest(val) { + this.suggest = val; + } + + setLogo(val) { + this.logo = window.GLOBAL["BASE_URL"] + val; + } + + setCoverLogo(val) { + this.coverLogo = val; + } + + setOrgName(val) { + this.organizationName = val; + } + + setOrgEmail(val) { + this.organizationEmail = val; + } + + setOrgPhone(val) { + this.organizationPhone = val; + } + + setGrids(gridNumber, girdList) { + this.grids["gridsNumber"] = gridNumber; + this.grids["gridsImgs"] = girdList; + } + + setCheckLocation(checkLocation) { + this.checkLocation = checkLocation; + } + + setCheckLocationGeometry(geometry) { + if (geometry) { + this.checkLocationGeometry = { + type: "Point", + coordinates: geometry.coordinates, + }; } + } } export default ReportBase; diff --git a/artApi.js b/artApi.js index a3e4dfb..ef89284 100644 --- a/artApi.js +++ b/artApi.js @@ -1,44 +1,89 @@ 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", //查询出库记录审核 - conditionCheckInsert: "/rpc/conditionCheckInsert", //创建状况检查 - conditionCheckUpdate: "/rpc/conditionCheckUpdate", //修改状况检查 - conditionCheckDelete: "/rpc/conditionCheckDelete", //删除状况检查 - viewConditionCheck: "/rpc/viewConditionCheck", //查询状况检查 - viewRepairRecord: "/rpc/viewRepairRecord", //查询修复档案列表 - repairRecordInsert: "/rpc/repairRecordInsert", //创建修复档案 - repairRecordUpdate: "/rpc/repairRecordUpdate", //编辑修复档案 - repairRecordDelete: "/rpc/repairRecordDelete", //删除修复档案 - viewRepairPlan: "/rpc/viewRepairPlan", //修复档案发起归档 - repairPlanInsert: "/rpc/repairPlanInsert", //创建修复方案 - repairPlanUpdate: "/rpc/repairPlanUpdate", //修改修复方案 - repairPlanDelete: "/rpc/repairPlanDelete", //删除修复方案 + 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', //查询修复档案列表 + repairRecordInsert: '/rpc/repairRecordInsert', //创建修复档案 + repairRecordUpdate: '/rpc/repairRecordUpdate', //编辑修复档案 + repairRecordDelete: '/rpc/repairRecordDelete', //删除修复档案 + repairRecordArchiveReviewInsert: '/rpc/repairRecordArchiveReviewInsert', //修复档案归档 + viewRepairRecordArchiveReview: '/rpc/viewRepairRecordArchiveReview', //查询修复档案归档记录 + repairPlanInsert: '/rpc/repairPlanInsert', //创建修复方案 + repairPlanUpdate: '/rpc/repairPlanUpdate', //修改修复方案 + repairPlanDelete: '/rpc/repairPlanDelete', //删除修复方案 + viewRepairPlan: '/rpc/viewRepairPlan', //查询修复方案 + repairPlanReviewInsert: '/rpc/repairPlanReviewInsert', //创建修复方案审核 + repairPlanReviewUpdate: '/rpc/repairPlanReviewUpdate', //审核修复方案 + viewRepairPlanReview: '/rpc/viewRepairPlanReview', //查询修复方案审核列表 + viewRepairLog: '/rpc/viewRepairLog', //查询修复记录 + repairLogInsert: '/rpc/repairLogInsert', //创建修复记录 + repairLogUpdate: '/rpc/repairLogUpdate', //修改修复记录 + repairLogDelete: '/rpc/repairLogDelete', //删除修复记录 + materialTypeInsert: '/rpc/materialTypeInsert', //创建材料类型 + materialTypeUpdate: '/rpc/materialTypeUpdate', //修改材料类型 + materialTypeDelete: '/rpc/materialTypeDelete', //删除材料类型 + viewMaterialType: '/rpc/viewMaterialType', //查询材料类型 + materialInsert: '/rpc/materialInsert', //创建材料 + materialUpdate: '/rpc/materialUpdate', //修改材料 + materialDelete: '/rpc/materialDelete', //删除材料 + viewMaterial: '/rpc/viewMaterial', //查询材料 + equipmentTypeInsert: '/rpc/artworkEquipmentTypeInsert', //创建设备类型 + equipmentTypeUpdate: '/rpc/artworkEquipmentTypeUpdate', //修改设备类型 + equipmentTypeDelete: '/rpc/artworkEquipmentTypeDelete', //删除设备类型 + viewEquipmentType: '/rpc/viewArtworkEquipmentType', //查询设备类型 + equipmentInsert: '/rpc/artworkEquipmentInsert', //创建设备 + equipmentUpdate: '/rpc/artworkEquipmentUpdate', //修改设备 + equipmentDelete: '/rpc/artworkEquipmentDelete', //删除设备 + viewEquipment: '/rpc/viewArtworkEquipment', //查询设备 + artworkEquipmentDataInsert: '/rpc/artworkEquipmentDataInsert', //创建设备数据 + artworkEquipmentDataDelete: '/rpc/artworkEquipmentDataDelete', //删除设备数据 + viewArtworkEquipmentData: '/rpc/viewArtworkEquipmentData', //查询设备数据列表 + cellsysSysDictCategoryInsert: '/rpc/cellsysSysDictCategoryInsert', //创建分类字典 + cellsysSysDictCategoryUpdate: '/rpc/cellsysSysDictCategoryUpdate', //更新分类字典 + cellsysSysDictCategoryDelete: '/rpc/cellsysSysDictCategoryDelete', //删除分类字典 + laboratoryInsert: '/rpc/laboratoryInsert', //创建实验室 + laboratoryUpdate: '/rpc/laboratoryUpdate', //修改实验室 + laboratoryDelete: '/rpc/laboratoryDelete', //删除实验室 + viewLaboratory: '/rpc/viewLaboratory', //查询实验室 + countArtworkEquipmentInLaboratory: '/rpc/countArtworkEquipmentInLaboratory', //统计实验室各设备类型的设备数量 + viewDisease: '/rpc/view_disease', //查询病害记录 + diseaseInsert: '/rpc/diseaseInsert', //创建病害记录 + diseaseUpdate: '/rpc/diseaseUpdate', //更新病害记录信息 + diseaseDelete: '/rpc/diseaseDelete', //删除病害记录 + iconInsert: '/rpc/cellsysIconInsert', //创建图标 + repairRecordPublish: '/rpc/repairRecordPublish', //修复档案发布 + repairRecordArchiveReviewUpdate: '/rpc/repairRecordArchiveReviewUpdate', //审核修复档案归档 + repairRecordCancelArchive: '/rpc/repairRecordCancelArchive', //取消修复档案归档 + viewStatsAuditNumberCount: '/rpc/view_stats_auditNumber_count', //查询待审核事项数量 }; export { artApi }; diff --git a/artCategory.js b/artCategory.js new file mode 100644 index 0000000..92c5c59 --- /dev/null +++ b/artCategory.js @@ -0,0 +1,118 @@ +import { EditTask, Query, QueryTask } from "./artUtil"; +import { artApi } from "./artApi"; +import Disease from "./disease"; + +class ArtCategory { + constructor(params = {}) { + this.code = params.code; + this.createBy = params.create_by; + this.createTime = params.create_time; + this.description = params.description; + this.hasChild = params.has_child; + this.id = params.id; + this.name = params.name; + this.parentId = params.parent_id; + this.sort = params.sort; + this.updateBy = params.update_by; + this.updateTime = params.update_time; + } + //更新分类字典信息 + updateArtCategory(params = {}) { + let editTask = new EditTask(artApi.cellsysSysDictCategoryUpdate); + editTask.addParam("_parent_id", 1); //这里分类字典的parentId固定是1,为艺术品类别 + editTask.addParam("_id", this.id); + editTask.addParam("_code", params.code); + editTask.addParam("_name", params.name); + editTask.addParam("_sort", params.sort); + editTask.addParam("_description", params.description); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + if (res.data) { + let artRepairFile = new ArtCategory(res.data); + resolve(artRepairFile); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + + //删除分类字典 + removeArtCategory() { + let editTask = new EditTask(artApi.cellsysSysDictCategoryDelete); + editTask.addParam("_id", this.id); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + resolve(res); + }) + .catch((err) => { + reject(err); + }); + }); + } + + //查询病害记录 + queryDisease(params = {}) { + let query = new Query(); + let { pageInfo, order, filter } = params; + if (filter) { + filter.forEach((item) => { + query.addFilter(item["name"], item["operator"], item["value"]); + }); + } + query.addFilter("category_id", "=", this.id); //病害报告模板 + let queryTask = new QueryTask(artApi.viewDisease, !!pageInfo); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + if (pageInfo) { + if (res.data) { + res.data = res.data.map((item) => { + return new Disease(item); + }); + resolve(res); + } + } else { + let resArr = res.map((item) => { + return new Disease(item); + }); + resolve(resArr); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + + //新增病害 + createDisease(params = {}) { + let editTask = new EditTask(artApi.diseaseInsert); + editTask.addParam("_name", params.name); + editTask.addParam("_description", params.description); + editTask.addParam("_style", params.style); + editTask.addParam("_image", params.image); + editTask.addParam("_category_id", this.id); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + if (res.data) { + let disease = new Disease(res.data); + resolve(disease); + } + }) + .catch((err) => { + reject(err); + }); + }); + } +} + +export default ArtCategory; diff --git a/artEnum.js b/artEnum.js index 0ace892..e10c3d8 100644 --- a/artEnum.js +++ b/artEnum.js @@ -10,11 +10,19 @@ export const godownEntryStatus = { 0: "未签名", 1: "已入库", }; -//0-未审核 1-审核中 2-审核通过 3-审核不通过 4-方案变更 +//修复方案状态 export const artRepairPlanStatus = { - 0:'未审核', - 1:'审核中', - 2:'审核通过', - 3:'审核不通过', - 4:'方案变更' -} \ No newline at end of file + 0: "未审核", + 1: "审核中", + 2: "审核通过", + 3: "审核不通过", + 4: "方案变更", +}; + +//修复档案状态 +export const repairFileStatus = { + 0: "未归档", + 1: "归档申请中", + 2: "已归档", + 3: "归档申请不通过", +}; diff --git a/artRepairEvent.js b/artRepairEvent.js deleted file mode 100644 index ef609b9..0000000 --- a/artRepairEvent.js +++ /dev/null @@ -1,16 +0,0 @@ -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; diff --git a/artRepairFile.js b/artRepairFile.js index ac01ceb..e641a83 100644 --- a/artRepairFile.js +++ b/artRepairFile.js @@ -1,126 +1,259 @@ -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"; +import ArtImage from './artImage'; +import { formatterMillisecond } from './utils/date'; +import { artApi } from './artApi'; +import { EditTask, Query, QueryTask } from './artUtil'; +import ConditionReport from './conditionReport'; +import ArtRepairPlan from './artRepairPlan'; +import { repairFileStatus } from './artEnum'; +import ArtRepairLog from './artRepairLog'; +import { EditType } from '@airkoon/cellsys/cellsysUtil'; +import { PublishStatus, PublishTarget } from '@airkoon/cellsys/cellsysEnum'; +import ArtSystem from './artSystem'; 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); - }); + 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.status = params.status; + 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 }; + }); + } + //发布状态有关逻辑 + this.isPublish = params.is_publish; + this.isUnlock = params.is_unlock; } - 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 coverImageUrl() { - if (this.artworkRecord && this.artworkRecord["artworkImages"].length > 0) { - return this.artworkRecord["artworkImages"][0].compressionUrl; + //艺术品封面图 + get oldNameFormat() { + return `《${this.artworkRecord['oldName']}》`; + } + get createTimeFormat() { + return formatterMillisecond(this.createTime); + } + get updateTimeFormat() { + return formatterMillisecond(this.updateTime); } - } - //艺术品封面图 - get oldNameFormat() { - return `《${this.artworkRecord["oldName"]}》`; - } + //修复档案归档状态 + get statusMsg() { + return repairFileStatus[this.status]; + } - get updateTimeFormat() { - return formatterMillisecond(this.updateTime); - } + //修复档案发布状态 + get statusPublishMsg() { + return PublishStatus[this.isPublish]; + } - queryConditionReport() { - if (!this.conditionCheckId) { + //查询状况检查记录信息 + queryConditionReport() { + /*if (!this.conditionCheckId) { throw new Error("没有状况检查记录信息!"); + }*/ + let query = new Query(); + + query.addFilter('id', '=', 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); + }); + }); } - 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); + 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); + }); + }); + } - //更新修复档案信息 - 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); + //修复档案归档 + repairFileArchive(params = {}) { + let { signatureImage } = params; + let editTask = new EditTask(artApi.repairRecordArchiveReviewInsert); + editTask.addParam('_repair_record_id', this.id); + editTask.addParam('_applicant_signature_image', signatureImage); + return editTask.execute(); + } + //取消归档状态 + cancelArchive(params = {}) { + let { password } = params; + let editTask = new EditTask(artApi.repairRecordCancelArchive); + editTask.addParam('_id', this.id); + editTask.addParam('_password', password); + return editTask.execute(); + } + + //创建修复记录 + createRepairLog(params = {}) { + let editTask = new EditTask(artApi.repairLogInsert); + editTask.addParam('_repair_record_id', this.id); + editTask.addParam('_description', params.description); + editTask.addParam('_repair_node', params.repairNode); + editTask.addParam('_images', params.images); + editTask.addParam('_material_ids', params.materialIds); + editTask.addParam('_restorers', params.restorers); + editTask.addParam('_datetime', params.datetime); + editTask.addParam('_links', params.links); + editTask.addParam('_geometry', params.geometry); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + if (res.data) { + let artRepairFile = new ArtRepairLog(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); + } + + //更新标签关联 + //@params 参数tags为标签对象数组 [{name:"标签名称"}] + updateTageRel(tags) { + let editTask = new EditTask(EditType.TagsGroupModeleUpdate); + if (Array.isArray(tags)) { + let tagNames = tags.map((tag) => { + return tag.name; + }); + editTask.addParam('_tag_names', tagNames); + } + editTask.addParam('_model_code', 'repairRecord'); + editTask.addParam('_model_object_id', this.id); + return editTask.execute(); + } + + //查询修复方案列表 + queryRepairPlan(params = {}) { + let { filter, pageInfo } = params; + if (!filter) { + filter = []; + } + filter.push({ + name: 'repair_record_id', + operator: '=', + value: this.id, + }); + return ArtSystem.queryRepairPlan({ + filter, + pageInfo, + }); + } + + //发布共享 + setPublish(publishStatus, range, ids, isEditable, remark) { + let editTask = new EditTask(artApi.repairRecordPublish); + editTask.addParam('_id', this.id); + editTask.addParam('_repair_record_name', this.name); + editTask.addParam('_is_publish', PublishTarget[publishStatus]); + editTask.addParam('_remark', remark); + if (publishStatus !== 'noPublish') { + if (range === 1) { + //发布到组织 + editTask.addParam('_publish_org', ids); + } else { + editTask.addParam('_publish_group', ids); } - }) - .catch((err) => { - reject(err); - }); - }); - } + editTask.addParam('_publish_range', range); + } + if (isEditable) { + editTask.addParam('_is_update', 1); + } else { + editTask.addParam('_is_update', 0); + } + return editTask.execute(); + } + + //查询修复记录 + queryRepairLogs(params = {}) { + let { filter, pageInfo } = params; + if (!filter) { + filter = []; + } + filter.push({ + name: 'repair_record_id', + operator: '=', + value: this.id, + }); + return ArtSystem.queryRepairLogs({ + filter, + pageInfo, + }); + } } export default ArtRepairFile; diff --git a/artRepairLog.js b/artRepairLog.js new file mode 100644 index 0000000..59f6c45 --- /dev/null +++ b/artRepairLog.js @@ -0,0 +1,89 @@ +import ArtImage from './artImage'; +import { formatterMillisecond } from './utils/date'; +import { EditTask } from './artUtil'; +import { artApi } from './artApi'; +import CellsysEvent from '@airkoon/cellsys/cellsysEvent.js'; + +class ArtRepairLog extends CellsysEvent { + constructor(params = {}) { + params.type = params.repair_record_id; + super(params); + this.id = params.id; + this.repairRecordId = params.repair_record_id; + this.repairNode = params.repair_node; + this.restorers = params.restorers; + this.description = params.description; + this.datetime = params.datetime; + this.geometry = params.geometry; + this.images = params.images; + // if (params.images) { + // this.artworkImages = params.images.map((url) => { + // return new ArtImage(url); + // }); + // } + + if (params.links) { + this.linkName = params.links.linkName || null; + this.linkUrl = params.links.linkUrl || null; + } + // this.links = { + // linkName: params.links.linkName|| null, + // linkUrl: params.links.linkUrl|| null, + // } + this.materialIds = params.material_ids; + 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 dateTimeFormat() { + return formatterMillisecond(this.datetime); + } + + updateRepairLog(params = {}) { + let editTask = new EditTask(artApi.repairLogUpdate); + editTask.addParam('_id', this.id); + editTask.addParam('_description', params.description); + editTask.addParam('_repair_node', params.repairNode); + editTask.addParam('_images', params.images); + editTask.addParam('_material_ids', params.materialIds); + editTask.addParam('_restorers', params.restorers); + editTask.addParam('_datetime', params.datetime); + editTask.addParam('_links', params.links); + editTask.addParam('_geometry', params.geometry); + + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + if (res.data) { + let artRepairFile = new ArtRepairLog(res.data); + resolve(artRepairFile); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + + deleteRepairLog() { + let editTask = new EditTask(artApi.repairLogDelete); + editTask.addParam('_id', this.id); + return editTask.execute(); + } +} + +export default ArtRepairLog; diff --git a/artRepairPlan.js b/artRepairPlan.js index 181b817..21b2e59 100644 --- a/artRepairPlan.js +++ b/artRepairPlan.js @@ -1,77 +1,107 @@ import ArtImage from "./artImage"; -import {formatterMillisecond} from "./utils/date"; -import {EditTask} from "@airkoon/cellsys/cellsysUtil"; -import {artApi} from "./artApi"; -import {artRepairPlanStatus} from "./artEnum"; +import { formatterMillisecond } from "./utils/date"; +import { EditTask } from "./artUtil.js"; +import { artApi } from "./artApi"; +import { artRepairPlanStatus } from "./artEnum"; class ArtRepairPlan { - constructor(params = {}) { + 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; + } + } - 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 createTimeFormat() { + return formatterMillisecond(this.createTime); + } - //艺术品封面图 - 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); - }); + 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() - } - + }); + } + deleteRepairPlan() { + let editTask = new EditTask(artApi.repairPlanDelete); + editTask.addParam("_id", this.id); + return editTask.execute(); + } + //变更修复方案 + modificationRepairPlan(params) { + let editTask = new EditTask(artApi.repairPlanInsert); + editTask.addParam("_repair_record_id", this.id); + editTask.addParam("_id", params.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); + }); + }); + } + //创建审核 + createRepairPlanReview(params = {}) { + let { signatureImage } = params; + let editTask = new EditTask(artApi.repairPlanReviewInsert); + editTask.addParam("_repair_plan_id", this.id); + editTask.addParam("_applicant_signature_image", signatureImage); + return editTask.execute(); + } } -export default ArtRepairPlan; \ No newline at end of file +export default ArtRepairPlan; diff --git a/artSystem.js b/artSystem.js index b4e1dec..8a882eb 100644 --- a/artSystem.js +++ b/artSystem.js @@ -1,384 +1,735 @@ -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"; +import { Query, QueryTask } from './artUtil.js'; +import { QueryType } 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 './artUtil.js'; +import ArtRepairFile from './artRepairFile'; +import ArtRepairPlan from './artRepairPlan'; +import * as http from './utils/axios'; +import ArtRepairLog from './artRepairLog'; +import MaterialType from './materialType'; +import materialType from './materialType'; +import Material from './material'; +import ArtCategory from './artCategory'; +import Equipment from './equipment'; +import Laboratory from './laboratory'; +import ArtworkEquipmentType from './equipmentType'; class ArtSystem { - constructor(orgId) {} - static orgId = window.CELLSYSORG ? window.CELLSYSORG.id : null; - //查询艺术品材质字典 - static queryMaterials(params = {}) { - let query = new Query(); - let { filter } = params; - if (filter) { - filter.forEach((item) => { - 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); + constructor(orgId) {} + static orgId = window.CELLSYSORG ? window.CELLSYSORG.id : null; + static token = null; + //查询艺术品材质字典 + static queryMaterials(params = {}) { + let query = new Query(); + let { filter } = params; + if (filter) { + filter.forEach((item) => { + query.addFilter(item['name'], item['operator'], item['value']); }); - resolve(resArr); - } - }) - .catch((err) => { - reject(err); + } + query.addFilter('dict_type', '=', '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(params = {}) { + let query = new Query(); + let { filter, pageInfo } = params; + if (pageInfo) { + query.setCurrPage(pageInfo.currPage); + query.setPageSize(pageInfo.pageSize); + } + query.addFilter('parent_id', '=', 1); + query.setOrder({ sort: 'asc' }); + let queryTask = new QueryTask(QueryType.sysCategoryData, !!pageInfo); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + if (pageInfo) { + if (res.data) { + res.data = res.data.map((item) => { + return new ArtCategory(item); + }); + resolve(res); + } else { + reject(new Error('艺术品类别数据格式异常')); + } + } else { + let resArr = res.map((item) => { + return new ArtCategory(item); + }); + resolve(resArr); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + //根据父级id查询分类 + static queryArtCategoryById(parentId) { + let query = new Query(); + query.addFilter('parent_id', '=', parentId); + query.setOrder({ sort: 'asc' }); + let queryTask = new QueryTask(QueryType.sysCategoryData, false); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + let resArr = res.map((item) => { + return new ArtCategory(item); + }); + resolve(resArr); + }) + .catch((err) => { + reject(err); + }); + }); + } + //创建分类字典 + static createArtCategory(params = {}) { + let { parentId, code, name, sort, description } = params; + let editTask = new EditTask(artApi.cellsysSysDictCategoryInsert); + editTask.addParam('_parent_id', parentId ? parentId : 1); //这里分类字典的parentId固定是1,为艺术品类别 + editTask.addParam('_code', code); + editTask.addParam('_name', name); + editTask.addParam('_sort', sort); + editTask.addParam('_description', description); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + if (res.data) { + let artRepairFile = new ArtCategory(res.data); + resolve(artRepairFile); + } + }) + .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) { - filter.forEach((item) => { - query.addFilter(item["name"], item["operator"], item["value"]); - }); - } - if (order) { - query.setOrder(order); - } else { - query.setOrder({ id: "desc" }); - } - 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); + //查询国家数据 + 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']); }); - resolve(resArr); - } - }) - .catch((err) => { - reject(err); + } + 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); + } + }) + .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 = {}) { + let query = new Query(); + let { pageInfo, order, filter } = params; - //查询报告列表(应用列表) - static queryConditionsReports(params) { - if (!params) { - params = {}; - } - let query = new Query(); - let pageInfo = params.pageInfo; - let order = params.order; - if (pageInfo) { - query.setCurrPage(pageInfo.currPage); - query.setPageSize(pageInfo.pageSize); - } - 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); + if (pageInfo) { + query.setCurrPage(pageInfo.currPage); + query.setPageSize(pageInfo.pageSize); + } + if (filter) { + filter.forEach((item) => { + query.addFilter(item['name'], item['operator'], item['value']); }); - resolve(resArr); - } - }) - .catch((err) => { - reject(err); + } + if (order) { + query.setOrder(order); + } else { + query.setOrder({ id: 'desc' }); + } + 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) { - let query = new Query(); - let artworkId = params.artworkId; - let eventSetId = params.eventSetId; - if (artworkId) { - query.addFilter("artwork.id", Operator.Equals, artworkId); //病害报告模板 - } - if (eventSetId) { - query.addFilter("event_set.id", Operator.Equals, eventSetId); //病害报告模板 - } - let queryTask = new QueryTask(artApi.artworkRepair, false); - return new Promise((resolve, reject) => { - queryTask - .execute(query) - .then((res) => { - let resArr = res.map((item) => { - return new CellsysArt(item.artwork); - }); - 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.texture) { + editTask.addParam('_texture', params.texture.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 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["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); - } - }) - .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); - 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", - }, - }); - } + //查询报告列表(应用列表) + static queryConditionsReports(params) { + if (!params) { + params = {}; + } + let query = new Query(); + let pageInfo = params.pageInfo; + let order = params.order; + if (pageInfo) { + query.setCurrPage(pageInfo.currPage); + query.setPageSize(pageInfo.pageSize); + } + if (order) { + query.setOrder(order); + } else { + query.setOrder({ id: 'desc' }); + } + // query.addFilter('model_id', "=", 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); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + + static queryArtworkByRepairId(params) { + let query = new Query(); + let artworkId = params.artworkId; + let eventSetId = params.eventSetId; + if (artworkId) { + query.addFilter('artwork.id', '=', artworkId); //病害报告模板 + } + if (eventSetId) { + query.addFilter('event_set.id', '=', eventSetId); //病害报告模板 + } + let queryTask = new QueryTask(artApi.artworkRepair, false); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + let resArr = res.map((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', '=', 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['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); + } + }) + .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); + 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 queryRepairLogs(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.viewRepairLog, !!pageInfo); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + if (pageInfo) { + if (res.data) { + res.data = res.data.map((item) => { + return new ArtRepairLog(item); + }); + resolve(res); + } else { + reject(new Error('修复记录数据格式异常')); + } + } else { + let resArr = res.map((item) => { + return new ArtRepairLog(item); + }); + resolve(resArr); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + //查询材料类型列表 + static queryMaterialType(params) { + let query = new Query(); + let { filter, pageInfo, order } = params; + if (filter) { + filter.forEach((item) => { + query.addFilter(item['name'], item['operator'], item['value']); + }); + } + if (order) { + query.setOrder(order); + } + let queryTask = new QueryTask(artApi.viewMaterialType, !!pageInfo); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + if (pageInfo) { + if (res.data) { + res.data = res.data.map((item) => { + return new MaterialType(item); + }); + resolve(res); + } else { + reject(new Error('数据格式异常')); + } + } else { + let resArr = res.map((item) => { + return new MaterialType(item); + }); + resolve(resArr); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + //创建材料类型 + static createMaterialType(params) { + let editTask = new EditTask(artApi.materialTypeInsert); + editTask.addParam('_name', params.name); + editTask.addParam('_description', params.description); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + if (res.data) { + let materialType = new MaterialType(res.data); + resolve(materialType); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + //查询材料列表 + static queryMaterial(params) { + let query = new Query(); + let { filter, pageInfo, order } = params; + if (filter) { + filter.forEach((item) => { + query.addFilter(item['name'], item['operator'], item['value']); + }); + } + if (order) { + query.setOrder(order); + } + let queryTask = new QueryTask(artApi.viewMaterial, !!pageInfo); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + if (pageInfo) { + if (res.data) { + res.data = res.data.map((item) => { + return new Material(item); + }); + resolve(res); + } else { + reject(new Error('数据格式异常')); + } + } else { + let resArr = res.map((item) => { + return new Material(item); + }); + resolve(resArr); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + //查询设备类型列表 + static queryEquipmentType(params) { + let query = new Query(); + let { filter, pageInfo, order } = params; + if (filter) { + filter.forEach((item) => { + query.addFilter(item['name'], item['operator'], item['value']); + }); + } + if (order) { + query.setOrder(order); + } + let queryTask = new QueryTask(artApi.viewEquipmentType, !!pageInfo); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + if (pageInfo) { + if (res.data) { + res.data = res.data.map((item) => { + return new ArtworkEquipmentType(item); + }); + resolve(res); + } else { + reject(new Error('数据格式异常')); + } + } else { + let resArr = res.map((item) => { + return new ArtworkEquipmentType(item); + }); + resolve(resArr); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + //创建设备类型 + static createEquipmentType(params) { + let editTask = new EditTask(artApi.equipmentTypeInsert); + editTask.addParam('_name', params.name); + editTask.addParam('_data_type', params.dataType); + editTask.addParam('_style', params.style); + editTask.addParam('_chart_option', params.chartConfiguration); + editTask.addParam('_description', params.description); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + if (res.data) { + let materialType = new ArtworkEquipmentType(res.data); + resolve(materialType); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + + //查询设备列表 + static queryEquipment(params) { + let query = new Query(); + let { filter, pageInfo, order } = params; + if (filter) { + filter.forEach((item) => { + query.addFilter(item['name'], item['operator'], item['value']); + }); + } + if (order) { + query.setOrder(order); + } + let queryTask = new QueryTask(artApi.viewEquipment, !!pageInfo); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + if (pageInfo) { + if (res.data) { + res.data = res.data.map((item) => { + return new Equipment(item); + }); + resolve(res); + } else { + reject(new Error('数据格式异常')); + } + } else { + let resArr = res.map((item) => { + return new Equipment(item); + }); + resolve(resArr); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + //查询实验室列表 + static queryLaboratoryList(params) { + let query = new Query(); + let { filter, pageInfo, order } = params; + if (filter) { + filter.forEach((item) => { + query.addFilter(item['name'], item['operator'], item['value']); + }); + } + if (order) { + query.setOrder(order); + } + let queryTask = new QueryTask(artApi.viewLaboratory, !!pageInfo); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + if (pageInfo) { + if (res.data) { + res.data = res.data.map((item) => { + return new Laboratory(item); + }); + resolve(res); + } else { + reject(new Error('数据格式异常')); + } + } else { + let resArr = res.map((item) => { + return new Laboratory(item); + }); + resolve(resArr); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + //创建实验室 + static createLaboratory(params) { + let editTask = new EditTask(artApi.laboratoryInsert); + editTask.addParam('_name', params.name); + editTask.addParam('_geometry', params.geometry); + editTask.addParam('_description', params.description); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + if (res.data) { + let materialType = new Laboratory(res.data); + resolve(materialType); + } + }) + .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', + }, + }); + } + + //查询待审核事项数量记录 + static queryAuditNumberCount(params = {}) { + let query = new Query(); + let queryTask = new QueryTask(artApi.viewStatsAuditNumberCount, false); + + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + resolve(res); + }) + .catch((err) => { + reject(err); + }); + }); + } } export default ArtSystem; diff --git a/artUser.js b/artUser.js index 19e7cdf..76c05eb 100644 --- a/artUser.js +++ b/artUser.js @@ -1,9 +1,130 @@ -import CellsysUser from '@airkoon/cellsys/cellsysUser.js'; +import CellsysUser from "@airkoon/cellsys/cellsysUser.js"; +import { QueryType } from "@airkoon/cellsys/cellsysUtil"; +import { Query, QueryTask } from "./artUtil"; +import { artApi } from "./artApi"; + +import RepairFileAudit from "./repairFileAudit"; +import RepairPlanAudit from "./repairPlanAudit"; +import SynergyAudit from "./synergyAudit"; class ArtUser extends CellsysUser { - constructor(params = {}) { - super(params); + constructor(params = {}) { + super(params); + } + + //查询修复档案归档申请列表 + queryRepairFileArchive(params = {}) { + let { pageInfo, order, filters } = params; + let query = new Query(); + if (pageInfo) { + query.setCurrPage(pageInfo.currPage); + query.setPageSize(pageInfo.pageSize); } + query.addFilter("status", "=", 0); //查询审核中的记录 + if (filters && filters.length > 0) { + filters.forEach((item) => { + query.addFilter(item["name"], item["operator"], item["value"]); + }); + } + let queryTask = new QueryTask( + artApi.viewRepairRecordArchiveReview, + !!pageInfo + ); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + if (pageInfo) { + if (res.data) { + res.data = res.data.map((item) => { + return new RepairFileAudit(item); + }); + resolve(res); + } + } else { + let resArr = res.map((item) => { + return new RepairFileAudit(item); + }); + resolve(resArr); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + //查询审核修复方案列表 + queryRepairPlanArchive(params = {}) { + let { pageInfo, order, filters } = params; + let query = new Query(); + if (pageInfo) { + query.setCurrPage(pageInfo.currPage); + query.setPageSize(pageInfo.pageSize); + } + query.addFilter("status", "=", 0); //查询审核中的记录 + if (filters && filters.length > 0) { + filters.forEach((item) => { + query.addFilter(item["name"], item["operator"], item["value"]); + }); + } + let queryTask = new QueryTask(artApi.viewRepairPlanReview, !!pageInfo); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + if (pageInfo) { + if (res.data) { + res.data = res.data.map((item) => { + return new RepairPlanAudit(item); + }); + resolve(res); + } + } else { + let resArr = res.map((item) => { + return new RepairPlanAudit(item); + }); + resolve(resArr); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + //查询待审核共享数据列表 + querySyneryData(params = {}) { + let { pageInfo, filters, order } = params; + let query = new Query(); + if (pageInfo) { + query.setCurrPage(pageInfo.currPage); + query.setPageSize(pageInfo.pageSize); + } + if (filters && filters.length > 0) { + filters.forEach((item) => { + query.addFilter(item["name"], item["operator"], item["value"]); + }); + } + if (order) { + query.setOrder(order); + } else { + query.setOrder({ id: "desc" }); + } + let queryTask = new QueryTask(QueryType.syneryData, false); + + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + let resArr = res.map((item) => { + return new SynergyAudit(item); + }); + resolve(resArr); + }) + .catch((err) => { + reject(err); + }); + }); + } } export default ArtUser; diff --git a/artUtil.js b/artUtil.js new file mode 100644 index 0000000..7f476f1 --- /dev/null +++ b/artUtil.js @@ -0,0 +1,306 @@ +import * as http from "./utils/axios.js"; + +const BASE_URL = location.origin; + +class Query { + static bodyParams = true; //设置请求体里需不需要传body + constructor(params) { + if (!params) { + params = {}; + } + this.filters = params.filters || []; + this.fields = params.fields || null; + this.currPage = params.currPage >= 1 ? params.currPage : 1; + this.pageSize = params.pageSize >= 0 ? params.pageSize : 0; + this.order = params.order || null; + this.httpConfig = null; //针对需要传不同请求头的情况 + this._type = "cellsys"; //默认查询结果为cellsys + } + + setHttpConfig(httpConfig) { + this.httpConfig = httpConfig; + } + + setType(type) { + if (type) { + this._type = type; + } + } + + getType() { + return this._type; + } + + addFilter(fieldName, operator, value, type) { + let fieldObj = { + field: fieldName, + operator: operator, + value: value, + type: type, + }; + this.filters.push(fieldObj); + } + + setFields(fields) { + //数组 + this.fields = fields; + } + + setCurrPage(currPage) { + this.currPage = currPage; + } + + setPageSize(pageSize) { + this.pageSize = pageSize; + } + + setOrder(orderObj) { + this.order = orderObj; + } + + getQuery() { + let param = this._getParam(); + let content = null; + let cellsysContent = param; + if (Query.bodyParams) { + cellsysContent = { body: param }; + } + switch (this._type.toLocaleLowerCase()) { + default: + case "cellsys": + content = cellsysContent; + break; + case "mongodb": + content = param; + break; + } + return content; + } + + _getParam() { + let params = {}; + // let params = {'body': null} + if (this.filters.length > 0) { + params["filter"] = this.filters; + } + if (this.fields) { + params["fields"] = this.fields; + } + if (this.currPage || this.currPage === 0) { + params["currPage"] = this.currPage; + } else { + params["currPage"] = 1; + } + if (this.pageSize || this.pageSize === 0) { + params["pageSize"] = this.pageSize; + } else { + params["pageSize"] = 0; + } + if (this.order) { + params["order"] = this.order; + } + return params; + } +} + +class QueryTask { + static hostName = ""; + constructor(url, getPageInfo) { + //过滤java接口 + if (url.indexOf("cellsys/api") !== -1) { + this.url = url; + } else if (url.indexOf("https") !== -1) { + //过滤应用模板部分调用的完整接口地址 + this.url = url; + } else { + //接口版本改为V2版本 + this.url = "/v2" + url; + } + this.url = QueryTask.hostName + this.url; + this.getPageInfo = getPageInfo; //是否返回分页信息 + } + + execute(query) { + let params = null; + if (query) { + params = query.getQuery(); + } else { + query = new Query(); + } + // this.getPageInfo = query.pageSize !== 0; + + let httpConfig = query.httpConfig; + return this._queryByCellsys(params, httpConfig); + } + + _queryByCellsys(param, httpConfig) { + return new Promise((resolve, reject) => { + if (param) { + http + .post(this.url, param, httpConfig) + .then((res) => { + if (res) { + let result; + if (this.url.indexOf("v2/rpc") === -1) { + result = res[0]; + } else { + //兼容v2版本的api,返回的数据不是数组而是对象 + result = res; + } + if (this.getPageInfo) { + resolve({ + currPage: result.currPage, + pageSize: result.pageSize, + totalCount: result.totalCount, + totalPage: result.totalPage, + data: result.data ? result.data : [], + }); + } else { + resolve(result.data ? result.data : []); + } + } else { + console.log("返回格式有误", res); + } + }) + .catch((e) => { + reject(e); + }); + } else { + http + .post(this.url) + .then((res) => { + resolve(res || null); + }) + .catch((e) => { + reject(e); + }); + } + }); + } +} + +class EditTask { + constructor(url) { + //过滤java接口 + if (url.indexOf("cellsys/api") !== -1) { + this.url = url; + } else if (url.indexOf("https") !== -1) { + //过滤应用模板部分调用的完整接口地址 + this.url = url; + } else { + //接口版本改为V2版本 + this.url = "/v2" + url; + } + this.params = { body: {} }; + this.httpConfig = null; //针对需要传不同请求头的情况 + } + + addParam(param_name, param_value) { + if (param_name) { + this.params["body"][param_name] = param_value; + } + } + + setHttpConfig(httpConfig) { + this.httpConfig = httpConfig; + } + + execute() { + return new Promise((resolve, reject) => { + let params = this.params, + body = params["body"]; + if (!(Object.keys(body).length > 0)) { + body = null; + } + http + .post(this.url, params, this.httpConfig) + .then((res) => { + // if (res && res.length > 0 && res[0].code === 200) { + // resolve({ data: res[0].data, message: res[0].message }); + // } else { + // console.log('返回格式有误', res); + // } + if (res) { + let result; + if (this.url.indexOf("v2/rpc") === -1) { + result = res[0]; + } else { + //兼容v2版本的api,返回的数据不是数组而是对象 + result = res; + } + if (result.code === 200) { + resolve({ data: result.data, message: result.message }); + } + } else { + console.log("返回格式有误", res); + } + }) + .catch((err) => { + console.log(err); + reject(err); + }); + }); + } +} + +class SubmitTask { + constructor(url) { + //过滤java接口 + + if (url.indexOf("cellsys/api") !== -1) { + this.url = url; + } else if (url.indexOf("https") !== -1) { + //过滤应用模板部分调用的完整接口地址 + this.url = url; + } else { + //接口版本改为V2版本 + this.url = "/v2" + url; + } + this.params = { body: {} }; + } + + addParam(param_name, param_value) { + if (param_name) { + this.params["body"][param_name] = param_value; + } + } + + execute() { + return new Promise((resolve, reject) => { + let params = this.params, + body = params["body"]; + if (!(Object.keys(body).length > 0)) { + body = null; + } + http + .post(this.url, params) + .then((res) => { + // if (res.length > 0 && res[0].code === 200) { + // resolve({ data: res[0].data, message: res[0].message }); + // } else { + // console.log('返回格式有误', res); + // } + if (res) { + let result; + if (this.url.indexOf("v2/rpc") === -1) { + result = res[0]; + } else { + //兼容v2版本的api,返回的数据不是数组而是对象 + result = res; + } + if (result.code === 200) { + resolve({ data: result.data, message: result.message }); + } + } else { + console.log("返回格式有误", res); + } + }) + .catch((err) => { + console.log(err); + reject(err); + }); + }); + } +} + +export { Query, QueryTask, EditTask, SubmitTask, BASE_URL }; diff --git a/auditRecord.js b/auditRecord.js new file mode 100644 index 0000000..e1bd748 --- /dev/null +++ b/auditRecord.js @@ -0,0 +1,34 @@ +import { formatterMillisecond } from "./utils/date"; + +class AuditRecord { + constructor(params = {}) { + this.id = params.id; + this.orgId = params.org_id; + this.createBy = params.create_by; + this.createTime = params.create_time; + this.updateBy = params.update_by; + this.updateTime = params.update_time; + if (params.creator) { + this.creator = { + memberId: params.creator["member_id"], + name: params.creator["name"], + }; + } + if (params.updater) { + this.updater = { + memberId: params.updater["member_id"], + name: params.updater["name"], + }; + } + } + + get createTimeFormat() { + return formatterMillisecond(this.createTime); + } + + get updateTimeFormat() { + return formatterMillisecond(this.updateTime); + } +} + +export default AuditRecord; diff --git a/cellsysArt.js b/cellsysArt.js index cfec6d4..6ba545c 100644 --- a/cellsysArt.js +++ b/cellsysArt.js @@ -1,213 +1,227 @@ -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"; +import ArtImage from './artImage'; +import { artStatus } from './artEnum'; +import { EditTask, Query, QueryTask } from './artUtil'; +import { artApi } from './artApi'; +import ArtRepairFile from './artRepairFile'; +import ConditionReport from './conditionReport'; +import ArtCategory from './artCategory'; +import { formatterMillisecond } from './utils/date'; class CellsysArt { - constructor(params = {}) { - this.id = params.id; - this.oldName = params.old_name; //不带书名号 - this.recordNumber = params.record_number; - this.artworkName = params.artwork_name; - this.author = params.author; - this.createPeriod = params.create_period; - this.actualNumber = params.actual_number || 1; - this.materialId = params.material_id; - this.materialName = params.material_name; - this.countryId = params.country_id; - this.countryName = params.country_name; - this.length = params.length; - this.width = params.width; - this.height = params.height; - this.categoryOne = params.category_one; - this.categoryOneName = params.category_one_name; - this.categoryTwo = params.category_two; - this.categoryTwoName = params.category_two_name; - this.categoryThree = params.category_three; - this.categoryThreeName = params.category_three_name; - this.originalRegistrationNumber = params.original_registration_number; - this.remark = params.remark; - this.creator = params.creator; - this.updater = params.updater; - this.status = params.status; - this.artworkImages = []; - if (params.images) { - this.artworkImages = params.images.map((url) => { - return new ArtImage(url); - }); - } - this.tags = []; - if (params.tag_name) { - this.tags = params.tag_name.map((name) => { - return { name: name }; - }); - } - } - get oldNameFormat() { - //带书名号 - return `《${this.oldName}》`; - } - //封面图 - get coverImageUrl() { - if (this.artworkImages.length > 0) { - return this.artworkImages[0].compressionUrl; - } - } - - get statusMsg() { - return artStatus[this.status]; - } - - get artworkImagesUrl() { - if (this.artworkImages.length > 0) { - return this.artworkImages.map((artImage) => { - return artImage.url; - }); - } - } - - get statusMsg() { - return artStatus[this.status]; - } - - //查看艺术品详情 - getDetails() { - let editTask = new EditTask(artApi.artworkDetails); - editTask.addParam("_id", this.id); - return new Promise((resolve, reject) => { - editTask - .execute() - .then((res) => { - if (res.data) { - let cellsysArt = new CellsysArt(res.data); - //todo 详情字段填充 - resolve(cellsysArt); - } - }) - .catch((err) => { - reject(err); - }); - }); - } - - //编辑艺术品档案 - updateArtwork(params = {}) { - let editTask = new EditTask(artApi.artArtworkRecordUpdate); - editTask.addParam("_id", params.id); - editTask.addParam("_oldname", params.oldName); - editTask.addParam("_author", params.author); - editTask.addParam("_create_period", params.createPeriod); - 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( - "_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); - }); - }); - } - - //删除艺术品档案 - removeArtwork(params = {}) { - let editTask = new EditTask(artApi.artArtworkRecordDelete); - editTask.addParam("_id", this.id); - editTask.addParam("_password", params.password); - return new Promise((resolve, reject) => { - editTask - .execute() - .then((res) => { - resolve(res); - }) - .catch((err) => { - reject(err); - }); - }); - } - - //创建修复档案 - 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) => { - 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); + constructor(params = {}) { + this.id = params.id; + this.oldName = params.old_name; //不带书名号 + this.recordNumber = params.record_number; + this.artworkName = params.artwork_name; + this.author = params.author; + this.createPeriod = params.create_period || '未知'; + this.actualNumber = params.actual_number || 1; + this.textureId = params.texture_id; //材质id + this.textureName = params.texture_name; //材质名称 + this.countryId = params.country_id; + this.countryName = params.country_name; + this.length = params.length; + this.width = params.width; + this.height = params.height; + this.categoryOne = params.category_one; + this.categoryOneName = params.category_one_name; + this.categoryTwo = params.category_two; + this.categoryTwoName = params.category_two_name; + this.categoryThree = params.category_three; + this.categoryThreeName = params.category_three_name; + this.originalRegistrationNumber = params.original_registration_number; + this.remark = params.remark; + this.creator = params.creator; + this.createTime = params.create_time; + this.updater = params.updater; + this.updateTime = params.update_time; + this.status = params.status; + this.artworkImages = []; + if (params.images) { + this.artworkImages = params.images.map((url) => { + return new ArtImage(url); }); - resolve(resArr); - } - }) - .catch((err) => { - reject(err); + } + this.tags = []; + if (params.tag_name) { + this.tags = params.tag_name.map((name) => { + return { name: name }; + }); + } + this.materialIds = params.material_ids; //材料Id数组 + this.geometry = params.geometry; //当前位置 + } + get oldNameFormat() { + //带书名号 + return `《${this.oldName}》`; + } + //封面图 + get coverImageUrl() { + if (this.artworkImages.length > 0) { + return this.artworkImages[0].compressionUrl; + } + } + + get statusMsg() { + return artStatus[this.status]; + } + + get artworkImagesUrl() { + if (this.artworkImages.length > 0) { + return this.artworkImages.map((artImage) => { + return artImage.url; + }); + } + } + + get statusMsg() { + return artStatus[this.status]; + } + get createTimeFormat() { + return formatterMillisecond(this.createTime); + } + get updateTimeFormat() { + return formatterMillisecond(this.updateTime); + } + + //查看艺术品详情 + getDetails() { + let editTask = new EditTask(artApi.artworkDetails); + editTask.addParam('_id', this.id); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + if (res.data) { + let cellsysArt = new CellsysArt(res.data); + resolve(cellsysArt); + } + }) + .catch((err) => { + reject(err); + }); }); - }); - } + } + + //编辑艺术品档案 + updateArtwork(params = {}) { + let editTask = new EditTask(artApi.artArtworkRecordUpdate); + editTask.addParam('_id', params.id); + editTask.addParam('_oldname', params.oldName); + editTask.addParam('_author', params.author); + editTask.addParam('_create_period', params.createPeriod); + editTask.addParam('_length', params.length); + editTask.addParam('_width', params.width); + editTask.addParam('_height', params.height); + if (params.texture) { + editTask.addParam('_texture', params.texture.dict_code); + } + 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); + }); + }); + } + + //删除艺术品档案 + removeArtwork(params = {}) { + let editTask = new EditTask(artApi.artArtworkRecordDelete); + editTask.addParam('_id', this.id); + editTask.addParam('_password', params.password); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + resolve(res); + }) + .catch((err) => { + reject(err); + }); + }); + } + + //创建修复档案 + 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) => { + 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', '=', 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); + }); + }); + } + + //获取艺术品所属类别的病害信息 + queryCategoryDiseases() { + if (!this.categoryTwo) { + throw new Error('该艺术品没有二级类别,无法获取类别病害信息!'); + } + let artCategory = new ArtCategory({ + id: this.categoryTwo, + name: this.categoryTwoName, + }); + return artCategory.queryDisease(); + } } export default CellsysArt; diff --git a/components/Signature/index.vue b/components/Signature/index.vue index 3e45625..d7571c8 100644 --- a/components/Signature/index.vue +++ b/components/Signature/index.vue @@ -1,103 +1,180 @@ diff --git a/components/Signature/write.vue b/components/Signature/write.vue index 0b2ad31..5cbaeb1 100644 --- a/components/Signature/write.vue +++ b/components/Signature/write.vue @@ -1,190 +1,272 @@ diff --git a/components/amapSearch.vue b/components/amapSearch.vue new file mode 100644 index 0000000..1eb43a1 --- /dev/null +++ b/components/amapSearch.vue @@ -0,0 +1,359 @@ + + + + + diff --git a/components/chooseArtwork.vue b/components/chooseArtwork.vue index 245b2f3..c553ed9 100644 --- a/components/chooseArtwork.vue +++ b/components/chooseArtwork.vue @@ -1,338 +1,350 @@ diff --git a/conditionReport.js b/conditionReport.js index 5db4db2..9a1897d 100644 --- a/conditionReport.js +++ b/conditionReport.js @@ -1,90 +1,109 @@ -import { EditTask } from "@airkoon/cellsys/cellsysUtil"; -import { artApi } from "./artApi"; -import { formatterMillisecond } from "./utils/date"; +import { artApi } from './artApi'; +import { formatterMillisecond } from './utils/date'; +import { Query, QueryTask, EditTask } from './artUtil'; +import CellsysArt from './cellsysArt'; class ConditionReport { - constructor(params) { - if (!params) { - params = {}; + constructor(params) { + if (!params) { + params = {}; + } + this.id = params.id; + this.artworkRecordId = params.artwork_record_id; + this.name = params.name; + this.modelOptions = params.model_options || {}; + // let modelOptions = params.model_options; + // if (modelOptions) { + // // this.coverImage = new ArtImage(modelOptions.coverImage);//封面图 + // // let reportInformation = modelOptions.reportInformation;//报告信息 + // // if (reportInformation) { + // // this.checkBy = reportInformation.checkBy; + // // this.checkDate = reportInformation.checkDate; + // // this.checkLocation = reportInformation.checkLocation; + // // this.documentNumber = reportInformation.documentNumber; + // // this.conservation = reportInformation.conservation; + // // } + // // let artworkInformation = modelOptions.artworkInformation;//作品信息 + // // + // // let conditionMapping = modelOptions.conditionMapping;//概况图 + // // + // // let examination = modelOptions.examination;//查验情况 + // // let grids = modelOptions.grids;//九宫格 + // // let details = modelOptions.details;//局部图 + // // let conservation = modelOptions.conservation;//查验结果 + // // let suggest = modelOptions.suggest;//保存修复建议 + // // let coverLogo=modelOptions.coverLogo;//封面logo + // // let logo=modelOptions.logo; + // modelOptions=new ReportBase() + // } + let artworkRecord = params.artwork_record; + if (artworkRecord) { + this.recordNumber = artworkRecord.record_number; + this.oldName = artworkRecord.old_name; + } + this.tags = []; + if (params.tag_name) { + this.tags = params.tag_name.map((name) => { + return { name: name }; + }); + } + + this.createBy = params.create_by; + this.createTime = params.create_time; + this.updateBy = params.update_by; + this.updateTime = params.update_time; + this.creator = params.creator; + this.updater = params.updater; } - this.id = params.id; - this.artworkRecordId = params.artwork_record_id; - this.name = params.name; - this.modelOptions = params.model_options || {}; - // let modelOptions = params.model_options; - // if (modelOptions) { - // // this.coverImage = new ArtImage(modelOptions.coverImage);//封面图 - // // let reportInformation = modelOptions.reportInformation;//报告信息 - // // if (reportInformation) { - // // this.checkBy = reportInformation.checkBy; - // // this.checkDate = reportInformation.checkDate; - // // this.checkLocation = reportInformation.checkLocation; - // // this.documentNumber = reportInformation.documentNumber; - // // this.conservation = reportInformation.conservation; - // // } - // // let artworkInformation = modelOptions.artworkInformation;//作品信息 - // // - // // let conditionMapping = modelOptions.conditionMapping;//概况图 - // // - // // let examination = modelOptions.examination;//查验情况 - // // let grids = modelOptions.grids;//九宫格 - // // let details = modelOptions.details;//局部图 - // // let conservation = modelOptions.conservation;//查验结果 - // // let suggest = modelOptions.suggest;//保存修复建议 - // // let coverLogo=modelOptions.coverLogo;//封面logo - // // let logo=modelOptions.logo; - // modelOptions=new ReportBase() - // } - let artworkRecord = params.artwork_record; - if (artworkRecord) { - this.recordNumber = artworkRecord.record_number; - this.oldName = artworkRecord.old_name; + get createTimeFormat() { + return formatterMillisecond(this.createTime); } - this.tags = []; - if (params.tag_name) { - this.tags = params.tag_name.map((name) => { - return { name: name }; - }); + get coverImageUrl() { + if (this.modelOptions.coverImage) { + return this.modelOptions.coverImage; + } + } + //查询艺术品档案详细信息 + queryArtworkDetail() { + let editTask = new EditTask(artApi.artworkDetails); + editTask.addParam('_id', this.artworkRecordId); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + if (res.data) { + let cellsysArt = new CellsysArt(res.data); + resolve(cellsysArt); + } + }) + .catch((err) => { + reject(err); + }); + }); } - 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 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(); } - } - 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(); + } - 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(); - } + conditionCheckDelete(params) { + let editTask = new EditTask(artApi.conditionCheckDelete); + editTask.addParam('_id', params.id); + return editTask.execute(); + } } export default ConditionReport; diff --git a/disease.js b/disease.js new file mode 100644 index 0000000..146672b --- /dev/null +++ b/disease.js @@ -0,0 +1,54 @@ +import { EditTask } from "./artUtil"; +import { artApi } from "./artApi"; + +class Disease { + constructor(params = {}) { + this.id = params.id; + this.name = params.name; + this.description = params.description; + this.categoryId = params.category_id; + this.image = params.image; //病害图示 + this.style = params.style; + } + + //更新病害信息 + updateDisease(params = {}) { + let editTask = new EditTask(artApi.diseaseUpdate); + editTask.addParam("_id", this.id); + editTask.addParam("_name", params.name); + editTask.addParam("_image", params.image); + editTask.addParam("_description", params.description); + editTask.addParam("_style", params.style); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + if (res.data) { + let disease = new Disease(res.data); + resolve(disease); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + + //删除病害记录 + removeDisease() { + let editTask = new EditTask(artApi.diseaseDelete); + editTask.addParam("_id", this.id); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + resolve(res); + }) + .catch((err) => { + reject(err); + }); + }); + } +} + +export default Disease; diff --git a/godownEntry.js b/godownEntry.js index f89b8cb..0b2907b 100644 --- a/godownEntry.js +++ b/godownEntry.js @@ -1,4 +1,4 @@ -import { EditTask, Query, QueryTask } from '@airkoon/cellsys/cellsysUtil'; +import { EditTask, Query, QueryTask } from './artUtil.js'; import { artApi } from './artApi'; import { formatterMillisecond } from './utils/date'; import { godownEntryStatus } from './artEnum'; @@ -21,12 +21,12 @@ class GodownEntry { this.conditionIssues = params.condition_issues || null; //病害信息 this.conditionIssuesImages = params.condition_issues_images ? params.condition_issues_images.map((item) => { - return { - original: item.original || null, //原图 - graphing: item.graphing || null, //遮罩层 - superposition: item.superposition || null, //合并 - }; - }) + return { + original: item.original || null, //原图 + graphing: item.graphing || null, //遮罩层 + superposition: item.superposition || null, //合并 + }; + }) : []; //病害图 original graphing superposition this.wareHouseId = params.ware_house_id; //仓库id let wareHouse = params.ware_house; @@ -44,8 +44,7 @@ class GodownEntry { recordNumber: artworkRecord.record_number, author: artworkRecord.author, oldName: artworkRecord.old_name, - creationPeriodEnd: artworkRecord.creation_period_end, - creationPeriodStart: artworkRecord.creation_period_start, + createPeriod: artworkRecord.create_period || '未知', width: artworkRecord.width, height: artworkRecord.height, length: artworkRecord.length, @@ -56,8 +55,7 @@ class GodownEntry { recordNumber: null, author: null, oldName: null, - creationPeriodEnd: null, - creationPeriodStart: null, + createPeriod: null, width: null, height: null, length: null, @@ -69,7 +67,7 @@ class GodownEntry { return godownEntryStatus[this.status]; } get entryTimeFormat() { - return formatterMillisecond(this.entryTime); + return formatterMillisecond(this.entryTime, 'YYYY-MM-DD HH:mm:ss'); } static createWareHouseEntry(params) { diff --git a/materialType.js b/materialType.js new file mode 100644 index 0000000..7a81690 --- /dev/null +++ b/materialType.js @@ -0,0 +1,66 @@ +import { EditTask } from "./artUtil.js"; +import { artApi } from "./artApi"; +import Material from "./material"; + +class MaterialType { + constructor(params) { + if (!params) { + params = {}; + } + this.id = params.id; + this.name = params.name; + this.description = params.description; + this.materialCount = params.material_count || 0; + this.creator = params.creator; + this.updater = params.updater; + this.createTime = params.create_time; + this.updateTime = params.update_time; + } + updateMaterialType(params) { + let { name, description } = params; + let editTask = new EditTask(artApi.materialTypeUpdate); + editTask.addParam("_id", this.id); + editTask.addParam("_description", description); + editTask.addParam("_name", name); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + if (res.data) { + let materialType = new MaterialType(res.data); + resolve(materialType); + } + }) + .catch((err) => { + reject(err); + }); + }); + } + deleteMaterialType(params) { + let editTask = new EditTask(artApi.materialTypeDelete); + editTask.addParam("_id", this.id); + return editTask.execute(); + } + //新增材料 + createMaterial(params) { + let editTask = new EditTask(artApi.materialInsert); + editTask.addParam("_material_type_id", this.id); + editTask.addParam("_name", params.name); + editTask.addParam("_description", params.description); + editTask.addParam("_images", params.images); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + if (res.data) { + let materialType = new Material(res.data); + resolve(materialType); + } + }) + .catch((err) => { + reject(err); + }); + }); + } +} +export default MaterialType; diff --git a/outBoundReview.js b/outBoundReview.js index 0ceb93d..6c6acd5 100644 --- a/outBoundReview.js +++ b/outBoundReview.js @@ -1,13 +1,14 @@ -import { EditTask, Query, QueryTask } from '@airkoon/cellsys/cellsysUtil'; +import { EditTask, Query, QueryTask } from './artUtil.js'; import { artApi } from './artApi'; class OutBoundReview { - constructor(params) { + constructor(params = {}) { this.id = params.id; this.artworkRecordName = params.artwork_record_name; //艺术品档 this.artworkRecordNumber = params.artwork_record_number; //艺术品 this.wareHouseOutboundId = params.ware_house_outbound_id; this.reviewerSignatureImage = params.reviewer_signature_image; + this.recipientSignatureImage = params.recipient_signature_image; this.status = params.status; this.destination = params.destination; this.remark = params.remark; @@ -21,11 +22,12 @@ class OutBoundReview { static createWareHouseOutboundReview(params) { let editTask = new EditTask(artApi.wareHouseOutboundReviewInsert); editTask.addParam('_ware_house_outbound_id', params.id); + editTask.addParam('_recipient_signature_image', params.recipientSignatureImage); return editTask.execute(); } - static updateWarehouseOutboundReview(params) { + updateWarehouseOutboundReview(params = {}) { let editTask = new EditTask(artApi.wareHouseOutboundReviewUpdate); - editTask.addParam('_id', params.id); + editTask.addParam('_id', this.id); editTask.addParam('_reviewer_signature_image', params.reviewerSignatureImage); editTask.addParam('_status', params.status); editTask.addParam('_remark', params.remark); diff --git a/outbound.js b/outbound.js index 1d776d3..a7487e3 100644 --- a/outbound.js +++ b/outbound.js @@ -1,12 +1,12 @@ -import { EditTask, Query, QueryTask } from '@airkoon/cellsys/cellsysUtil'; +import { EditTask, Query, QueryTask } from './artUtil.js'; import { artApi } from './artApi'; -import CellsysArt from './cellsysArt'; +import ArtworkEquipmentType from './equipmentType'; +import ArtRepairLog from './artRepairLog'; +import outBoundReview from './outBoundReview'; +import OutBoundReview from './outBoundReview'; class Outbound { - constructor(params) { - if (!params) { - params = {}; - } + constructor(params = {}) { this.id = params.id; this.status = params.status; this.number = params.number; @@ -76,30 +76,56 @@ class Outbound { this.reviewerId = params.reviewer_id; this.reviewerSignatureimage = params.reviewer_signature_image; } - static cerateWarehouseOut(params) { + static createWarehouseOut(params = {}) { let editTask = new EditTask(artApi.wareHouseOutboundInsert); editTask.addParam('_artwork_record_id', params.artworkRecordId); editTask.addParam('_recipient', params.recipient); - editTask.addParam('_recipient_signature_image', params.recipientSignatureimage); editTask.addParam('_reason', params.reason); editTask.addParam('_images', params.images); editTask.addParam('_remark', params.remark); editTask.addParam('_destination', params.destination); editTask.addParam('_destination_geometry', params.destinationGeometry); - return editTask.execute(); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + if (res.data) { + let outbound = new Outbound(res.data); + resolve(outbound); + } else { + reject('数据异常,创建失败!'); + } + }) + .catch((err) => { + reject(err); + }); + }); } - static updateWarehouseOut(params) { + updateWarehouseOut(params = {}) { let editTask = new EditTask(artApi.wareHouseOutboundUpdate); - editTask.addParam('_id', params.id); + editTask.addParam('_id', this.id); editTask.addParam('_artwork_record_id', params.artworkRecordId); editTask.addParam('_recipient', params.recipient); - editTask.addParam('_recipient_signature_image', params.recipientSignatureimage); editTask.addParam('_reason', params.reason); editTask.addParam('_images', params.images); editTask.addParam('_remark', params.remark); editTask.addParam('_destination', params.destination); editTask.addParam('_destination_geometry', params.destinationGeometry); - return editTask.execute(); + return new Promise((resolve, reject) => { + editTask + .execute() + .then((res) => { + if (res.data) { + let outbound = new Outbound(res.data); + resolve(outbound); + } else { + reject('数据异常,创建失败!'); + } + }) + .catch((err) => { + reject(err); + }); + }); } static deteleWareHouseOut(params) { let editTask = new EditTask(artApi.wareHouseOutboundDelete); @@ -147,5 +173,31 @@ class Outbound { }); }); } + + //查看出库记录对应的出库审核记录信息 + queryoutboundReview(params = {}) { + let query = new Query(); + let { filter } = params; + if (filter) { + filter.forEach((item) => { + query.addFilter(item['name'], item['operator'], item['value']); + }); + } + query.addFilter('ware_house_outbound_id', '=', this.id); + let queryTask = new QueryTask(artApi.viewWareHouseOutboundReview, false); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + let resArr = res.map((item) => { + return new OutBoundReview(item); + }); + resolve(resArr); + }) + .catch((err) => { + reject(err); + }); + }); + } } export default Outbound; diff --git a/package-lock.json b/package-lock.json index 6ebeda0..16b6fcf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,21 +1,26 @@ { "name": "@airkoon/cellsysArt", - "version": "1.0.0", + "version": "1.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@airkoon/cellsysArt", - "version": "1.0.0", + "version": "1.0.2", "license": "ISC", "dependencies": { - "@airkoon/cellsys": "git+http://ag:12345678@8.134.38.106:3000/ag/cellsys.git", - "dayjs": "~1.10.6" + "@airkoon/cellsys": "git+http://ag:12345678@8.134.38.106:3000/ag/cellsys.git#v1.16.3", + "@amap/amap-jsapi-loader": "~1.0.1", + "axios": "^1.4.0", + "dayjs": "~1.10.6", + "element-plus": "^2.3.7", + "vue-qrcode": "^2.2.2", + "vue-signature-pad": "^3.0.2" } }, "node_modules/@airkoon/cellsys": { - "version": "1.15.6", - "resolved": "git+http://ag:12345678@8.134.38.106:3000/ag/cellsys.git#6040224f29672ea8121809bf394975bb1ab61be5", + "version": "1.16.3", + "resolved": "git+http://ag:12345678@8.134.38.106:3000/ag/cellsys.git#919709e5601cd746e2c254374a66da58f6f82934", "license": "ISC", "dependencies": { "axios": "~1.4.0", @@ -23,6 +28,44 @@ "dayjs": "~1.10.6" } }, + "node_modules/@amap/amap-jsapi-loader": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz", + "integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw==" + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.26.5", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.26.5.tgz", + "integrity": "sha512-SRJ4jYmXRqV1/Xc+TIVG84WjHBXKlxO9sHQnA2Pf12QQEAp1LOh6kDzNHXcUnbH1QI0FDoPPVOt+vyUDucxpaw==", + "peer": true, + "dependencies": { + "@babel/types": "^7.26.5" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@babel/runtime": { "version": "7.26.0", "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.26.0.tgz", @@ -39,11 +82,308 @@ "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" }, + "node_modules/@babel/types": { + "version": "7.26.5", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.26.5.tgz", + "integrity": "sha512-L6mZmwFDK6Cjh1nRCLXpa6no13ZIioJDz7mdkzHv399pThrTa/k0nUlNaenOeh2kWu/iaOQYElEpKPUswUa9Vg==", + "peer": true, + "dependencies": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@ctrl/tinycolor": { + "version": "3.6.1", + "resolved": "https://registry.npmmirror.com/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz", + "integrity": "sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/@element-plus/icons-vue": { + "version": "2.3.1", + "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz", + "integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==", + "peerDependencies": { + "vue": "^3.2.0" + } + }, + "node_modules/@floating-ui/core": { + "version": "1.6.9", + "resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.6.9.tgz", + "integrity": "sha512-uMXCuQ3BItDUbAMhIXw7UPXRfAlOAvZzdK9BWpE60MCn+Svt3aLn9jsPTi/WNGlRUu2uI0v5S7JiIUsbsvh3fw==", + "dependencies": { + "@floating-ui/utils": "^0.2.9" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.6.13", + "resolved": "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.6.13.tgz", + "integrity": "sha512-umqzocjDgNRGTuO7Q8CU32dkHkECqI8ZdMZ5Swb6QAM0t5rnlrN3lGo1hdpscRd3WS8T6DKYK4ephgIH9iRh3w==", + "dependencies": { + "@floating-ui/core": "^1.6.0", + "@floating-ui/utils": "^0.2.9" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.9", + "resolved": "https://registry.npmmirror.com/@floating-ui/utils/-/utils-0.2.9.tgz", + "integrity": "sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg==" + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "peer": true + }, + "node_modules/@popperjs/core": { + "name": "@sxzz/popperjs-es", + "version": "2.11.7", + "resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz", + "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, + "node_modules/@types/lodash": { + "version": "4.17.14", + "resolved": "https://registry.npmmirror.com/@types/lodash/-/lodash-4.17.14.tgz", + "integrity": "sha512-jsxagdikDiDBeIRaPYtArcT8my4tN1og7MtMRquFT3XNA6axxyHDRUemqDz/taRDdOUn0GnGHRCuff4q48sW9A==" + }, + "node_modules/@types/lodash-es": { + "version": "4.17.12", + "resolved": "https://registry.npmmirror.com/@types/lodash-es/-/lodash-es-4.17.12.tgz", + "integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==", + "dependencies": { + "@types/lodash": "*" + } + }, "node_modules/@types/raf": { "version": "3.4.3", "resolved": "https://registry.npmmirror.com/@types/raf/-/raf-3.4.3.tgz", "integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==" }, + "node_modules/@types/web-bluetooth": { + "version": "0.0.16", + "resolved": "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz", + "integrity": "sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==" + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.13.tgz", + "integrity": "sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==", + "peer": true, + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/shared": "3.5.13", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.5.13.tgz", + "integrity": "sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==", + "peer": true, + "dependencies": { + "@vue/compiler-core": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.5.13.tgz", + "integrity": "sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ==", + "peer": true, + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/compiler-core": "3.5.13", + "@vue/compiler-dom": "3.5.13", + "@vue/compiler-ssr": "3.5.13", + "@vue/shared": "3.5.13", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.11", + "postcss": "^8.4.48", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.5.13.tgz", + "integrity": "sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==", + "peer": true, + "dependencies": { + "@vue/compiler-dom": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.5.13.tgz", + "integrity": "sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg==", + "peer": true, + "dependencies": { + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.5.13.tgz", + "integrity": "sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw==", + "peer": true, + "dependencies": { + "@vue/reactivity": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.5.13.tgz", + "integrity": "sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog==", + "peer": true, + "dependencies": { + "@vue/reactivity": "3.5.13", + "@vue/runtime-core": "3.5.13", + "@vue/shared": "3.5.13", + "csstype": "^3.1.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.5.13.tgz", + "integrity": "sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA==", + "peer": true, + "dependencies": { + "@vue/compiler-ssr": "3.5.13", + "@vue/shared": "3.5.13" + }, + "peerDependencies": { + "vue": "3.5.13" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.13.tgz", + "integrity": "sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==", + "peer": true + }, + "node_modules/@vueuse/core": { + "version": "9.13.0", + "resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-9.13.0.tgz", + "integrity": "sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==", + "dependencies": { + "@types/web-bluetooth": "^0.0.16", + "@vueuse/metadata": "9.13.0", + "@vueuse/shared": "9.13.0", + "vue-demi": "*" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/core/node_modules/vue-demi": { + "version": "0.14.10", + "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz", + "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==", + "hasInstallScript": true, + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/@vueuse/metadata": { + "version": "9.13.0", + "resolved": "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-9.13.0.tgz", + "integrity": "sha512-gdU7TKNAUVlXXLbaF+ZCfte8BjRJQWPCa2J55+7/h+yDtzw3vOoGQDRXzI6pyKyo6bXFT5/QoPE4hAknExjRLQ==", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/shared": { + "version": "9.13.0", + "resolved": "https://registry.npmmirror.com/@vueuse/shared/-/shared-9.13.0.tgz", + "integrity": "sha512-UrnhU+Cnufu4S6JLCPZnkWh0WwZGUp72ktOF2DFptMlOs3TOdVv8xJN53zhHGARmVOsz5KqOls09+J1NR6sBKw==", + "dependencies": { + "vue-demi": "*" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/shared/node_modules/vue-demi": { + "version": "0.14.10", + "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz", + "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==", + "hasInstallScript": true, + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/async-validator": { + "version": "4.2.5", + "resolved": "https://registry.npmmirror.com/async-validator/-/async-validator-4.2.5.tgz", + "integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==" + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz", @@ -59,6 +399,15 @@ "proxy-from-env": "^1.1.0" } }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/canvg": { "version": "3.0.10", "resolved": "https://registry.npmmirror.com/canvg/-/canvg-3.0.10.tgz", @@ -77,6 +426,35 @@ "node": ">=10.0.0" } }, + "node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "peer": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "peer": true + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz", @@ -98,11 +476,26 @@ "url": "https://opencollective.com/core-js" } }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "peer": true + }, "node_modules/dayjs": { "version": "1.10.8", "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.10.8.tgz", "integrity": "sha512-wbNwDfBHHur9UOzNUjeKUOJ0fCb0a52Wx0xInmQ7Y8FstyajiV1NmK1e00cxsr9YrE9r7yAChE0VvpuY5Rnlow==" }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -111,6 +504,84 @@ "node": ">=0.4.0" } }, + "node_modules/dijkstrajs": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/dijkstrajs/-/dijkstrajs-1.0.3.tgz", + "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==", + "peer": true + }, + "node_modules/element-plus": { + "version": "2.9.3", + "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.9.3.tgz", + "integrity": "sha512-6tSLp5XytDS4TMZ0P3aGZnr7MXTagfNycepNfIDitd9IgwM9y01+Ssu6mglNi8RiXYhek6LBWNOd/cvpIO12+w==", + "dependencies": { + "@ctrl/tinycolor": "^3.4.1", + "@element-plus/icons-vue": "^2.3.1", + "@floating-ui/dom": "^1.0.1", + "@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7", + "@types/lodash": "^4.14.182", + "@types/lodash-es": "^4.17.6", + "@vueuse/core": "^9.1.0", + "async-validator": "^4.2.5", + "dayjs": "^1.11.13", + "escape-html": "^1.0.3", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", + "lodash-unified": "^1.0.2", + "memoize-one": "^6.0.0", + "normalize-wheel-es": "^1.2.0" + }, + "peerDependencies": { + "vue": "^3.2.0" + } + }, + "node_modules/element-plus/node_modules/dayjs": { + "version": "1.11.13", + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz", + "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "peer": true + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "peer": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "peer": true + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "peer": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/follow-redirects": { "version": "1.15.9", "resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.9.tgz", @@ -143,6 +614,75 @@ "node": ">= 6" } }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "peer": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "peer": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + }, + "node_modules/lodash-unified": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/lodash-unified/-/lodash-unified-1.0.3.tgz", + "integrity": "sha512-WK9qSozxXOD7ZJQlpSqOT+om2ZfcT4yO+03FuzAHD0wF6S0l0090LRPDx3vhTTLZ8cFKpBn+IOcVXK6qOcIlfQ==", + "peerDependencies": { + "@types/lodash-es": "*", + "lodash": "*", + "lodash-es": "*" + } + }, + "node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "peer": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==" + }, + "node_modules/merge-images": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/merge-images/-/merge-images-1.2.0.tgz", + "integrity": "sha512-hEGvgnTdXr08uzGvEArxRsKpy7WmozM73YaSi4s5IYF4LxrhANpqfHaz9CgBZ5+0+s2NsjPnPdStz3aCc0Yulw==" + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz", @@ -162,16 +702,144 @@ "node": ">= 0.6" } }, + "node_modules/nanoid": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "peer": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/normalize-wheel-es": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz", + "integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw==" + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "peer": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "peer": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "peer": true, + "engines": { + "node": ">=8" + } + }, "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmmirror.com/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "peer": true + }, + "node_modules/pngjs": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/pngjs/-/pngjs-5.0.0.tgz", + "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "peer": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/postcss": { + "version": "8.5.0", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.0.tgz", + "integrity": "sha512-27VKOqrYfPncKA2NrFOVhP5MGAfHKLYn/Q0mz9cNQyRAKYi3VNHwYU2qKKqPCqgBmeeJ0uAFB56NumXZ5ZReXg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "peer": true, + "dependencies": { + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, + "node_modules/qrcode": { + "version": "1.5.4", + "resolved": "https://registry.npmmirror.com/qrcode/-/qrcode-1.5.4.tgz", + "integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==", + "peer": true, + "dependencies": { + "dijkstrajs": "^1.0.1", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" + }, + "bin": { + "qrcode": "bin/qrcode" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/raf": { "version": "3.4.1", "resolved": "https://registry.npmmirror.com/raf/-/raf-3.4.1.tgz", @@ -185,6 +853,21 @@ "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "peer": true + }, "node_modules/rgbcolor": { "version": "1.0.1", "resolved": "https://registry.npmmirror.com/rgbcolor/-/rgbcolor-1.0.1.tgz", @@ -193,6 +876,26 @@ "node": ">= 0.8.15" } }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "peer": true + }, + "node_modules/signature_pad": { + "version": "3.0.0-beta.4", + "resolved": "https://registry.npmmirror.com/signature_pad/-/signature_pad-3.0.0-beta.4.tgz", + "integrity": "sha512-cOf2NhVuTiuNqe2X/ycEmizvCDXk0DoemhsEpnkcGnA4kS5iJYTCqZ9As7tFBbsch45Q1EdX61833+6sjJ8rrw==" + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/stackblur-canvas": { "version": "2.7.0", "resolved": "https://registry.npmmirror.com/stackblur-canvas/-/stackblur-canvas-2.7.0.tgz", @@ -201,6 +904,32 @@ "node": ">=0.1.14" } }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/svg-pathdata": { "version": "6.0.3", "resolved": "https://registry.npmmirror.com/svg-pathdata/-/svg-pathdata-6.0.3.tgz", @@ -208,6 +937,123 @@ "engines": { "node": ">=12.0.0" } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" + }, + "node_modules/vue": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.13.tgz", + "integrity": "sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==", + "peer": true, + "dependencies": { + "@vue/compiler-dom": "3.5.13", + "@vue/compiler-sfc": "3.5.13", + "@vue/runtime-dom": "3.5.13", + "@vue/server-renderer": "3.5.13", + "@vue/shared": "3.5.13" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vue-qrcode": { + "version": "2.2.2", + "resolved": "https://registry.npmmirror.com/vue-qrcode/-/vue-qrcode-2.2.2.tgz", + "integrity": "sha512-SbrXq/mSb1g2tbDyXPe9gy9KiMYsvxWKRErlpij1BqiFoHwQckheZV63CTw6yRLLUVG2RXAVlX+APkpdCK7SQQ==", + "dependencies": { + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/rxts" + }, + "peerDependencies": { + "qrcode": "^1.0.0", + "vue": "^2.7.0 || ^3.0.0" + } + }, + "node_modules/vue-signature-pad": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/vue-signature-pad/-/vue-signature-pad-3.0.2.tgz", + "integrity": "sha512-o25o+lROfCmzASS2+fU8ZV801kV+D4/02zkZ+ez3NKeiUmbxW7kwlUf5oKQkvA+l7Ou9xGsGLsirBLch3jyX8A==", + "dependencies": { + "merge-images": "^1.1.0", + "signature_pad": "^3.0.0-beta.3" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "vue": "^3.2.0" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "peer": true + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "peer": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "peer": true + }, + "node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmmirror.com/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "peer": true, + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "peer": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } } } } diff --git a/package.json b/package.json index 3abf48e..cf642ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@airkoon/cellsysArt", - "version": "1.0.2", + "version": "1.0.4", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, @@ -8,7 +8,12 @@ "license": "ISC", "description": "美院相关", "dependencies": { - "@airkoon/cellsys": "git+http://ag:12345678@8.134.38.106:3000/ag/cellsys.git", - "dayjs": "~1.10.6" + "@airkoon/cellsys": "git+http://ag:12345678@8.134.38.106:3000/ag/cellsys.git#v1.16.3", + "axios": "^1.4.0", + "dayjs": "~1.10.6", + "element-plus": "^2.3.7", + "@amap/amap-jsapi-loader": "~1.0.1", + "vue-signature-pad": "^3.0.2", + "vue-qrcode": "^2.2.2" } } diff --git a/repairFileAudit.js b/repairFileAudit.js new file mode 100644 index 0000000..6b8a059 --- /dev/null +++ b/repairFileAudit.js @@ -0,0 +1,54 @@ +import AuditRecord from "./auditRecord"; +import { Query, QueryTask, EditTask } from "./artUtil"; +import { artApi } from "./artApi"; +import ArtRepairFile from "./artRepairFile"; + +class RepairFileAudit extends AuditRecord { + constructor(params = {}) { + super(params); + + this.reviewerSignatureImage = params.reviewer_signature_image; //审核人签名 + this.status = params.status; + this.applicantsignatureImage = params.applicant_signature_image; //申请人签名 + this.repairFile = { + id: params.repair_record_id, + name: params.repair_record ? params.repair_record["name"] : null, + }; + } + + queryRepairFile() { + let query = new Query(); + query.addFilter("id", "=", this.repairFile.id); + let queryTask = new QueryTask(artApi.viewRepairRecord, false); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + let resArr = res.map((item) => { + return new ArtRepairFile(item); + }); + resolve(resArr); + }) + .catch((err) => { + reject(err); + }); + }); + } + + //修复档案审核 + updateRepairFileReview(params = {}) { + let editTask = new EditTask(artApi.repairRecordArchiveReviewUpdate); + editTask.addParam("_id", this.id); + editTask.addParam("_repair_record_id", this.repairFile.id); + editTask.addParam("_remark", params.remark); + editTask.addParam("_status", params.status); + + editTask.addParam( + "_reviewer_signature_image", + params.reviewerSignatureImage + ); + return editTask.execute(); + } +} + +export default RepairFileAudit; diff --git a/repairPlanAudit.js b/repairPlanAudit.js new file mode 100644 index 0000000..dd32291 --- /dev/null +++ b/repairPlanAudit.js @@ -0,0 +1,34 @@ +import AuditRecord from "./auditRecord"; +import { EditTask } from "./artUtil.js"; +import { artApi } from "./artApi"; + +class RepairPlanAudit extends AuditRecord { + constructor(params) { + super(params); + this.repairPlanId = params.repair_plan_id; + this.reviewerSignatureImage = params.reviewer_signature_image; //审核人签名 + this.status = params.status; + this.applicantsignatureImage = params.applicant_signature_image; //申请人签名 + this.remark = params.remark; + this.repairPlan = { + name: params.repair_plan ? params.repair_plan["name"] : null, + repairNodes: params.repair_plan + ? params.repair_plan["repair_nodes"] + : null, + }; + } + updateRepairPlanReview(params = {}) { + let editTask = new EditTask(artApi.repairPlanReviewUpdate); + editTask.addParam("_id", this.id); + editTask.addParam("_repair_record_id", params.repairPlanId); + editTask.addParam("_remark", params.remark); + editTask.addParam("_status", params.status); + + editTask.addParam( + "_reviewer_signature_image", + params.reviewerSignatureImage + ); + return editTask.execute(); + } +} +export default RepairPlanAudit; diff --git a/synergyAudit.js b/synergyAudit.js new file mode 100644 index 0000000..6955dde --- /dev/null +++ b/synergyAudit.js @@ -0,0 +1,29 @@ +import { Query, QueryTask } from "./artUtil"; +import { formatterMillisecond } from "./utils/date"; + +class SynergyAudit { + constructor(params = {}) { + this.id = params.id; + this.orgId = params.org_id; + this.dataType = params.data_type; + this.dataId = params.data_id; + this.dataName = params.data_name; + this.status = params.status; + this.createTime = params.create_time; + this.createBy = params.create_by; + this.updateTime = params.updata_time; + this.updateBy = params.update_by; + this.remark = params.remark; + this.createByName = params.create_by_name; + this.updateByName = params.update_by_name; + } + + get createTimeFormat() { + return formatterMillisecond(this.createTime); + } + get updateTimeFormat() { + return formatterMillisecond(this.updateTime); + } +} + +export default SynergyAudit; diff --git a/utils/axios.js b/utils/axios.js new file mode 100644 index 0000000..c9f8429 --- /dev/null +++ b/utils/axios.js @@ -0,0 +1,39 @@ +import axios from 'axios'; +import ArtSystem from '../artSystem'; + +const service = axios.create({ + baseURL: '/api', //api 的 base_url,根据开发生产环境配置文件配置 + withCredentials: true, // 跨域请求时发送 cookies + timeout: 0, + headers: { + 'Content-Type': 'application/json;charset=UTF-8', + }, + responseType: 'json', +}); +//axiios的response封装不在本库中,由各自引用CellsysArt的项目里去按需封装 +service.interceptors.request.use( + (config) => { + let url = config.url; + let token = ArtSystem.token; + if (token && !config.headers['Authorization']) { + config.headers['Authorization'] = 'Bearer ' + token; + } + return config; + }, + (error) => { + console.log(error); + return Promise.reject(error); + }, +); + +const post = (url, data, config) => { + return service.post(url, data, config); +}; + +const get = (url, data) => { + return service.get(url, { + params: data, + }); +}; + +export { post, get, service }; diff --git a/wareHouse.js b/wareHouse.js index 95a124a..5e6574b 100644 --- a/wareHouse.js +++ b/wareHouse.js @@ -1,101 +1,101 @@ -import { EditTask, Query, QueryTask } from '@airkoon/cellsys/cellsysUtil'; -import { artApi } from './artApi'; +import { EditTask, Query, QueryTask } from "./artUtil.js"; +import { artApi } from "./artApi"; class Warehouse { - constructor(params) { - if (!params) { - params = {}; - } - this.orgId = params.org_id; - this.orgName = params.org_name; - this.id = params.id; - this.name = params.name; - this.type = params.type; - this.status = params.status; - this.action = params.action || 0; - this.bufferDistance = params.buffer_distance || 0; - this.radius = params.radius || 0; - this.geometry = params.geometry; - this.typeName = params.type_name; - this.style = params.style ? params.style : {}; - this.description = params.description; + constructor(params) { + if (!params) { + params = {}; } - static createWarehouse(params) { - let editTask = new EditTask(artApi.wareHouseInsert); - editTask.addParam('_name', params.name); - editTask.addParam('_description', params.description); - editTask.addParam('_geometry', params.geometry); - editTask.addParam('_type', params.type); - editTask.addParam('_status', 1); - editTask.addParam('_action', params.action); - editTask.addParam('_buffer_distance', params.bufferDistance); - editTask.addParam('_radius', params.radius); - return editTask.execute(); + this.orgId = params.org_id; + this.orgName = params.org_name; + this.id = params.id; + this.name = params.name; + this.type = params.type; + this.status = params.status; + this.action = params.action || 0; + this.bufferDistance = params.buffer_distance || 0; + this.radius = params.radius || 0; + this.geometry = params.geometry; + this.typeName = params.type_name; + this.style = params.style ? params.style : {}; + this.description = params.description; + } + static createWarehouse(params) { + let editTask = new EditTask(artApi.wareHouseInsert); + editTask.addParam("_name", params.name); + editTask.addParam("_description", params.description); + editTask.addParam("_geometry", params.geometry); + editTask.addParam("_type", params.type); + editTask.addParam("_status", 1); + editTask.addParam("_action", params.action); + editTask.addParam("_buffer_distance", params.bufferDistance); + editTask.addParam("_radius", params.radius); + return editTask.execute(); + } + static updateWarehouse(params) { + let editTask = new EditTask(artApi.wareHouseUpdate); + editTask.addParam("_type", params.type); + editTask.addParam("_id", params.id); + editTask.addParam("_geometry", params.geometry); + editTask.addParam("_name", params.name); + editTask.addParam("_description", params.description); + editTask.addParam("_action", params.action); + editTask.addParam("_status", 1); + editTask.addParam("_buffer_distance", params.bufferDistance); + editTask.addParam("_radius", params.radius); + return editTask.execute(); + } + static deleteWarehouse(params) { + let editTask = new EditTask(artApi.wareHouseDelete); + editTask.addParam("_id", params.id); + return editTask.execute(); + } + static queryWarehouse(pageInfo, filters, order) { + let query = new Query(); + if (pageInfo) { + query.setCurrPage(pageInfo.currPage); + query.setPageSize(pageInfo.pageSize); } - static updateWarehouse(params) { - let editTask = new EditTask(artApi.wareHouseUpdate); - editTask.addParam('_type', params.type); - editTask.addParam('_id', params.id); - editTask.addParam('_geometry', params.geometry); - editTask.addParam('_name', params.name); - editTask.addParam('_description', params.description); - editTask.addParam('_action', params.action); - editTask.addParam('_status', 1); - editTask.addParam('_buffer_distance', params.bufferDistance); - editTask.addParam('_radius', params.radius); - return editTask.execute(); + if (filters && filters.length > 0) { + filters.forEach((item) => { + query.addFilter(item["name"], item["operator"], item["value"]); + }); } - static deleteWarehouse(params) { - let editTask = new EditTask(artApi.wareHouseDelete); - editTask.addParam('_id', params.id); - return editTask.execute(); + if (order) { + query.setOrder(order); + } else { + query.setOrder({ id: "desc" }); } - static queryWarehouse(pageInfo, filters, order) { - let query = new Query(); - if (pageInfo) { - query.setCurrPage(pageInfo.currPage); - query.setPageSize(pageInfo.pageSize); - } - if (filters && filters.length > 0) { - filters.forEach((item) => { - query.addFilter(item['name'], item['operator'], item['value']); + let queryTask = new QueryTask(artApi.viewWareHouse, pageInfo); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + if (pageInfo) { + if (res.data) { + res.data = res.data.map((item) => { + return new Warehouse(item); + }); + resolve(res); + } + } else { + let resArr = res.map((item) => { + return new Warehouse(item); }); - } - if (order) { - query.setOrder(order); - } else { - query.setOrder({ id: 'desc' }); - } - let queryTask = new QueryTask(artApi.viewWareHouse, pageInfo); - return new Promise((resolve, reject) => { - queryTask - .execute(query) - .then((res) => { - if (pageInfo) { - if (res.data) { - res.data = res.data.map((item) => { - return new Warehouse(item); - }); - resolve(res); - } - } else { - let resArr = res.map((item) => { - return new Warehouse(item); - }); - resolve(resArr); - } - }) - .catch((err) => { - reject(err); - }); + resolve(resArr); + } + }) + .catch((err) => { + reject(err); }); - } - static countArtworkInWareHouse(params) { - // let query = new Query(); - let editTask = new EditTask(artApi.countInWareHouse); - editTask.addParam('_id', params.id); - editTask.addParam('_type', params.type); - return editTask.execute(); - } + }); + } + static countArtworkInWareHouse(params) { + // let query = new Query(); + let editTask = new EditTask(artApi.countInWareHouse); + editTask.addParam("_id", params.id); + editTask.addParam("_type", params.type); + return editTask.execute(); + } } export default Warehouse; diff --git a/wareHouseType.js b/wareHouseType.js index 4a53a3f..6a91ecb 100644 --- a/wareHouseType.js +++ b/wareHouseType.js @@ -1,100 +1,102 @@ -import { CellsysMarkerStyle } from '@airkoon/cellsys/cellsysStyle'; -import { EditTask, Query, QueryTask } from '@airkoon/cellsys/cellsysUtil'; -import { artApi } from './artApi'; +import { CellsysMarkerStyle } from "@airkoon/cellsys/cellsysStyle"; +import { EditTask, Query, QueryTask } from "./artUtil.js"; +import { artApi } from "./artApi"; class WareHouseType { - constructor(params) { - if (!params) { - params = {}; - } - this.id = params.id; - this.orgId = params.org_id; - this.name = params.name; - this.typeCount = params.type_count; - this.description = params.description; - this.style = params.style ? params.style : CellsysMarkerStyle.getDefaultStyle(); - let creator = params.creator; - this.creator = { - memberId: null, - name: null, - }; - if (creator) { - this.creator = { - memberId: creator.member_id, - name: creator.name, - }; - } - let updater = params.updater; - this.updater = { - memberId: null, - name: null, - }; - if (updater) { - this.updater = { - memberId: updater.member_id, - name: updater.name, - }; - } + constructor(params) { + if (!params) { + params = {}; } - static createWareHouseType(params) { - let editTask = new EditTask(artApi.wareHouseTypeInsert); - editTask.addParam('_name', params.name); - editTask.addParam('_description', params.description); - editTask.addParam('_style', params.style); - return editTask.execute(); + this.id = params.id; + this.orgId = params.org_id; + this.name = params.name; + this.typeCount = params.type_count; + this.description = params.description; + this.style = params.style + ? params.style + : CellsysMarkerStyle.getDefaultStyle(); + let creator = params.creator; + this.creator = { + memberId: null, + name: null, + }; + if (creator) { + this.creator = { + memberId: creator.member_id, + name: creator.name, + }; } - static updateWareHouseType(params) { - let editTask = new EditTask(artApi.wareHouseTypeUpdate); - editTask.addParam('_id', params.id); - editTask.addParam('_name', params.name); - editTask.addParam('_description', params.description); - editTask.addParam('_style', params.style); - return editTask.execute(); + let updater = params.updater; + this.updater = { + memberId: null, + name: null, + }; + if (updater) { + this.updater = { + memberId: updater.member_id, + name: updater.name, + }; } - static deleteWareHouseType(params) { - let editTask = new EditTask(artApi.wareHouseTypeDelete); - editTask.addParam('_id', params.id); - return editTask.execute(); + } + static createWareHouseType(params) { + let editTask = new EditTask(artApi.wareHouseTypeInsert); + editTask.addParam("_name", params.name); + editTask.addParam("_description", params.description); + editTask.addParam("_style", params.style); + return editTask.execute(); + } + static updateWareHouseType(params) { + let editTask = new EditTask(artApi.wareHouseTypeUpdate); + editTask.addParam("_id", params.id); + editTask.addParam("_name", params.name); + editTask.addParam("_description", params.description); + editTask.addParam("_style", params.style); + return editTask.execute(); + } + static deleteWareHouseType(params) { + let editTask = new EditTask(artApi.wareHouseTypeDelete); + editTask.addParam("_id", params.id); + return editTask.execute(); + } + static queryWareHouseType(pageInfo, filters, order) { + let query = new Query(); + if (pageInfo) { + query.setCurrPage(pageInfo.currPage); + query.setPageSize(pageInfo.pageSize); } - static queryWareHouseType(pageInfo, filters, order) { - let query = new Query(); - if (pageInfo) { - query.setCurrPage(pageInfo.currPage); - query.setPageSize(pageInfo.pageSize); - } - if (filters && filters.length > 0) { - filters.forEach((item) => { - query.addFilter(item['name'], item['operator'], item['value']); + if (filters && filters.length > 0) { + filters.forEach((item) => { + query.addFilter(item["name"], item["operator"], item["value"]); + }); + } + if (order) { + query.setOrder(order); + } else { + query.setOrder({ id: "desc" }); + } + let queryTask = new QueryTask(artApi.viewWareHouseType, pageInfo); + return new Promise((resolve, reject) => { + queryTask + .execute(query) + .then((res) => { + if (pageInfo) { + if (res.data) { + res.data = res.data.map((item) => { + return new WareHouseType(item); + }); + resolve(res); + } + } else { + let resArr = res.map((item) => { + return new WareHouseType(item); }); - } - if (order) { - query.setOrder(order); - } else { - query.setOrder({ id: 'desc' }); - } - let queryTask = new QueryTask(artApi.viewWareHouseType, pageInfo); - return new Promise((resolve, reject) => { - queryTask - .execute(query) - .then((res) => { - if (pageInfo) { - if (res.data) { - res.data = res.data.map((item) => { - return new WareHouseType(item); - }); - resolve(res); - } - } else { - let resArr = res.map((item) => { - return new WareHouseType(item); - }); - resolve(resArr); - } - }) - .catch((err) => { - reject(err); - }); + resolve(resArr); + } + }) + .catch((err) => { + reject(err); }); - } + }); + } } export default WareHouseType;