当前最新版本首次提交

This commit is contained in:
ag 2025-02-25 09:47:45 +08:00
parent 7a600728e9
commit 50ecdeae23
11 changed files with 1117 additions and 586 deletions

View File

@ -1,107 +1,128 @@
import ArtImage from "./artImage";
import { formatterMillisecond } from "./utils/date";
import { EditTask } from "./artUtil.js";
import { artApi } from "./artApi";
import { artRepairPlanStatus } from "./artEnum";
import ArtImage from './artImage';
import { formatterMillisecond } from './utils/date';
import { EditTask, Query, QueryTask } from './artUtil.js';
import { artApi } from './artApi';
import { artRepairPlanStatus } from './artEnum';
import RepairPlanAudit from './repairPlanAudit';
class ArtRepairPlan {
constructor(params = {}) {
this.id = params.id;
this.name = params.name;
this.repairRecordId = params.repair_record_id;
this.repairNodes = params.repair_nodes;
this.creatorSignatureImage = params.creator_signature_image;
this.status = params.status;
this.creator = params.creator;
this.updater = params.updater;
this.createTime = params.create_time;
this.updateTime = params.update_time;
this.artworkRecord = {
artworkRecordId: params.artwork_record_id, //关联的艺术品id
};
if (params.artwork_record) {
let { record_number, old_name, images } = params.artwork_record;
this.artworkRecord["recordNumber"] = record_number;
this.artworkRecord["oldName"] = old_name;
this.artworkRecord["artworkImages"] = images.map((url) => {
return new ArtImage(url);
});
constructor(params = {}) {
this.id = params.id;
this.name = params.name;
this.repairRecordId = params.repair_record_id;
this.repairNodes = params.repair_nodes;
this.creatorSignatureImage = params.creator_signature_image;
this.status = params.status;
this.creator = params.creator;
this.updater = params.updater;
this.createTime = params.create_time;
this.updateTime = params.update_time;
this.artworkRecord = {
artworkRecordId: params.artwork_record_id, //关联的艺术品id
};
if (params.artwork_record) {
let { record_number, old_name, images } = params.artwork_record;
this.artworkRecord['recordNumber'] = record_number;
this.artworkRecord['oldName'] = old_name;
this.artworkRecord['artworkImages'] = images.map((url) => {
return new ArtImage(url);
});
}
}
}
//艺术品封面图
get coverImageUrl() {
if (this.artworkRecord && this.artworkRecord["artworkImages"].length > 0) {
return this.artworkRecord["artworkImages"][0].compressionUrl;
//艺术品封面图
get 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 createTimeFormat() {
return formatterMillisecond(this.createTime);
}
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();
}
//变更修复方案
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);
}
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();
}
}
//创建审核
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();
}
//获取修复方案审核结果批注信息
queryRepairPlanReview(params = {}) {
let query = new Query();
query.addFilter('repair_plan_id', '=', this.id);
let queryTask = new QueryTask(artApi.viewRepairPlanReview, false);
return new Promise((resolve, reject) => {
queryTask
.execute(query)
.then((res) => {
let resArr = res.map((item) => {
return new RepairPlanAudit(item);
});
resolve(resArr);
})
.catch((err) => {
reject(err);
});
});
}
}
export default ArtRepairPlan;

View File

@ -17,11 +17,13 @@ import ArtCategory from './artCategory';
import Equipment from './equipment';
import Laboratory from './laboratory';
import ArtworkEquipmentType from './equipmentType';
import EquipmentData from "./equipmentData";
class ArtSystem {
constructor(orgId) {}
static orgId = window.CELLSYSORG ? window.CELLSYSORG.id : null;
static token = null;
//查询艺术品材质字典
static queryMaterials(params = {}) {
let query = new Query();
@ -416,12 +418,15 @@ class ArtSystem {
//查询系统修复记录列表
static queryRepairLogs(params) {
let query = new Query();
let { filter, pageInfo } = params;
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.viewRepairLog, !!pageInfo);
return new Promise((resolve, reject) => {
queryTask
@ -642,6 +647,45 @@ class ArtSystem {
});
});
}
static viewArtworkEquipmentData(params){
let query = new Query();
let { filter, pageInfo, order } = params;
// query.addFilter('equipment_id', '=', this.id);
if (filter) {
filter.forEach((item) => {
query.addFilter(item["name"], item["operator"], item["value"]);
});
}
if (order) {
query.setOrder(order);
}
let queryTask = new QueryTask(artApi.viewArtworkEquipmentData, !!pageInfo);
return new Promise((resolve, reject) => {
queryTask
.execute(query)
.then((res) => {
if (pageInfo) {
if (res.data) {
res.data = res.data.map((item) => {
return new EquipmentData(item);
});
resolve(res);
} else {
reject(new Error("数据格式异常"));
}
} else {
let resArr = res.map((item) => {
return new EquipmentData(item);
});
resolve(resArr);
}
})
.catch((err) => {
reject(err);
});
});
}
//查询实验室列表
static queryLaboratoryList(params) {
let query = new Query();
@ -713,23 +757,6 @@ class ArtSystem {
},
});
}
//查询待审核事项数量记录
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;

View File

@ -1,130 +1,144 @@
import CellsysUser from "@airkoon/cellsys/cellsysUser.js";
import { QueryType } from "@airkoon/cellsys/cellsysUtil";
import { Query, QueryTask } from "./artUtil";
import { artApi } from "./artApi";
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";
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);
//查询修复档案归档申请列表
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']);
});
resolve(resArr);
}
})
.catch((err) => {
reject(err);
}
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);
//查询审核修复方案列表
queryRepairPlanAudit(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']);
});
resolve(resArr);
}
})
.catch((err) => {
reject(err);
}
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);
//查询待审核共享数据列表
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);
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);
});
});
});
}
}
//查询待审核事项数量记录
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 ArtUser;

View File

@ -1,359 +1,447 @@
<template>
<el-dialog
v-model="visible"
:title="title"
:width="width"
append-to-body
style="height: 80%"
@close="handleClose"
>
<div class="container">
<div
class="map-container"
v-if="visible"
ref="amapSearch"
:style="{ height: mapHeight }"
></div>
<div class="search-container" v-if="!isDetails">
<div style="display: flex; margin-bottom: 10px">
<el-input
v-model="address"
@input="searchAddress"
placeholder="请输入地址"
></el-input>
<el-button
style="margin-left: 8px"
plain
type="primary"
@click="searchAddress"
>
查询
</el-button>
<el-drawer
v-model="dialogVisible"
:title="title"
:size="GLOBAL.drawerSize"
append-to-body
:close-on-click-modal="false"
:destroy-on-close="true"
@open="open">
<div class="container">
<div
class="search-container"
v-if="!isReadonly">
<div class="search-input">
<el-input
v-model="searchAddress"
placeholder="请输入地址"></el-input>
<el-button
style="margin-left: 8px"
plain
type="primary"
@click="handleSearch">
查询
</el-button>
</div>
<el-card
class="search-panel"
v-if="searchPanelVisible">
<ul>
<li
v-for="item in list"
class="poibox search-item"
@click="renderMarker(item)">
<h3 class="poi-title">
<span class="poi-name amap-ellipsis">{{ item.name }}</span>
</h3>
<div
class="poi-info"
:title="item.address">
<p class="poi-addr amap-ellipsis">地址{{ item.address }}</p>
</div>
</li>
</ul>
</el-card>
</div>
<div
class="map-container"
ref="amapSearch"
:style="{ height: mapHeight }"></div>
<div class="detail-container">
<el-form
ref="form"
label-position="top"
:rules="formRules"
:model="form">
<el-form-item
label="详细地址信息"
prop="address">
<el-input
v-model="form.address"
placeholder="填写详细地址"></el-input>
</el-form-item>
</el-form>
</div>
</div>
<div id="panel" v-if="list.length > 0">
<el-radio-group v-if="list.length > 0" v-model="location">
<el-radio
class="poibox"
@click="renderMarker(item)"
v-for="item in list"
:value="item.id"
size="large"
>
<h3 class="poi-title">
<span class="poi-name amap-ellipsis">{{ item.name }}</span>
</h3>
<div class="poi-info" :title="item.address">
<p class="poi-addr amap-ellipsis">地址{{ item.address }}</p>
</div>
</el-radio>
</el-radio-group>
<el-empty v-else description="请在搜索框输入地址"></el-empty>
</div>
</div>
</div>
<template v-if="!isDetails" #footer>
<span class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleConfirm"> 确定 </el-button>
</span>
</template>
</el-dialog>
<template
v-if="!isReadonly"
#footer>
<span class="dialog-footer">
<el-button @click="close">取消</el-button>
<el-button
type="primary"
@click="handleConfirm">
确定
</el-button>
</span>
</template>
</el-drawer>
</template>
<script>
import AMapLoader from "@amap/amap-jsapi-loader";
import AMapLoader from '@amap/amap-jsapi-loader';
let amapKey = "6fb9a8497a691e98c94b3365d26e89bc";
let amapKey = '6fb9a8497a691e98c94b3365d26e89bc';
try {
amapKey = import.meta.env.VITE_APP_AMAP_KEY;
amapKey = import.meta.env.VITE_APP_AMAP_KEY;
} catch (e) {}
export default {
name: "GeocoderComponent",
props: {
title: {
type: String,
default: "详细位置",
name: 'GeocoderComponent',
props: {
modelValue: Boolean,
currentPosition: Object, //geometry
address: String,
title: {
type: String,
default: '详细位置',
},
isReadonly: {
type: Boolean,
default: false,
},
isGetCurrentPosition: {
//
type: Boolean,
default: false,
},
},
width: {
type: String,
default: "70%",
},
lnglat: {
type: Array,
default() {
return [];
},
},
isDetails: {
type: Boolean,
default: false,
},
isGetCurrentPosition: {
type: Boolean,
default: false,
},
},
data() {
return {
visible: false, //
address: "",
map: null, //
placeSearch: null, //
geocoder: null, //
list: [],
location: null,
marker: null,
// 100%
initialMapHeight: "100%",
//
geolocation: null,
};
},
computed: {
// list
mapHeight() {
// list50%100%
return this.list.length > 0 ? "100%" : this.initialMapHeight;
},
},
methods: {
open() {
this.visible = true;
this.$nextTick(() => {
this.initMap();
});
},
close() {
this.visible = false;
},
handleClose() {
this.$emit("close"); //
this.close();
},
handleConfirm() {
this.$emit("confirm", this.coordinates);
this.close();
},
initMap() {
AMapLoader.load({
key: amapKey,
version: "2.0",
plugins: ["AMap.PlaceSearch", "AMap.Geocoder"],
}).then((AMap) => {
//
this.map = new AMap.Map(this.$refs.amapSearch, {
resizeEnable: true, //
zoom: 18, //
animateEnable: false,
});
this.placeSearch = new AMap.PlaceSearch({
city: "全国",
map: this.map,
pageSize: 20, //
// panel: 'panel', //
autoFitView: true, // 使 Marker
});
this.geocoder = new AMap.Geocoder({
city: "全国",
extensions: "all",
});
if (this.lnglat && this.lnglat.length > 0) {
this.coordinateToAddress(this.lnglat);
}
//
AMap.plugin("AMap.Geolocation", () => {
this.geolocation = new AMap.Geolocation({
enableHighAccuracy: true, // 使true
timeout: 10000, //
offset: [10, 20], //
zoomToAccuracy: true, // 使false
panToLocation: true,
showMarker: true,
position: "RB", // , RB
convert: true, //
});
if (this.isGetCurrentPosition) {
this.getCurrentPosition();
}
});
});
},
searchAddress() {
if (this.address) {
this.placeSearch.search(this.address, (status, result) => {
if (status === "complete" && result.info === "OK") {
console.log(result.poiList);
if (result.poiList && result.poiList.pois.length > 0) {
this.list = result.poiList.pois;
this.location = this.list[0].id;
this.renderMarker(this.list[0]);
} else {
this.map.clearMap();
this.list = [];
this.$message.error("请输入正确的地址信息");
}
} else {
this.$message.warning("请输入正确的地址信息");
this.list = [];
this.clearMarker();
}
});
}
},
coordinateToAddress(lnglat) {
let that = this;
this.list = [];
this.geocoder.getAddress(lnglat, function (status, result) {
console.log(result.regeocode.pois);
if (status === "complete" && result.info === "OK") {
// result
that.list = result.regeocode.pois;
let details = that.list.filter((item) => {
let location = new AMap.LngLat(
Number(item.location.lng),
Number(item.location.lat)
);
if (location.lng === lnglat[0] && location.lat === lnglat[1]) {
return item;
}
});
console.log(details);
if (details.length > 0) {
that.location = details[0].id;
that.address = details[0].name;
that.renderMarker(details[0]);
} else {
that.location = that.list[0].id;
that.address = that.list[0].name;
that.renderMarker(that.list[0]);
}
}
});
},
renderMarker(marker) {
this.clearMarker(); //
let location = marker.location;
this.map.setCenter([location.lng, location.lat]);
//
// this.map.setZoomAndCenter(16, [location.lng, location.lat]);
this.coordinates = [location.lng, location.lat];
//
this.marker = new AMap.Marker({
position: [location.lng, location.lat],
map: this.map,
});
//
let infoWindowContent = `
<div style="width: 200px">
<h3>${marker.name}</h3>
<p>地址${marker.address}</p>
</div>
`;
let infoWindow = new AMap.InfoWindow({
content: infoWindowContent, // 使 HTML
offset: new AMap.Pixel(0, -10),
});
setTimeout(() => {
//
infoWindow.open(
this.map,
new AMap.LngLat(Number(location.lng), Number(location.lat))
);
});
},
clearMarker() {
if (this.marker) {
this.marker.setMap(null);
this.marker = null;
}
},
getCurrentPosition() {
if (!this.geolocation) return;
this.geolocation.getCurrentPosition((status, result) => {
if (status == "complete") {
let position = result.position;
//this.coordinateToAddress([position.lng, position.lat]);
this.renderMarker({
name: "当前定位",
location: {
lng: position.lng,
lat: position.lat,
data() {
return {
searchAddress: '',
map: null, //
placeSearch: null, //
geocoder: null, //
list: [],
location: null,
marker: null,
// 100%
initialMapHeight: '100%',
//
geolocation: null,
searchPanelVisible: false,
form: {
address: '',
},
});
this.$emit("getPosition", {
lng: position.lng,
lat: position.lat,
});
} else {
console.error(result);
this.$emit("error", result.message);
}
});
formRules: {
address: [{ required: true, message: '请输入详细地址!', trigger: 'blur' }],
},
};
},
computed: {
dialogVisible: {
get() {
return this.modelValue;
},
set(val) {
this.$emit('update:modelValue', val);
},
},
// list
mapHeight() {
// list50%100%
return this.list.length > 0 ? '100%' : this.initialMapHeight;
},
},
created() {
AMapLoader.load({
key: amapKey,
version: '2.0',
plugins: ['AMap.PlaceSearch', 'AMap.Geocoder'],
}).then((AMap) => {
this.geocoder = new AMap.Geocoder({
city: '全国',
extensions: 'all',
});
if (this.isGetCurrentPosition) {
//
AMap.plugin('AMap.Geolocation', () => {
this.geolocation = new AMap.Geolocation({
enableHighAccuracy: true, // 使true
timeout: 10000, //
offset: [10, 20], //
zoomToAccuracy: true, // 使false
panToLocation: true,
showMarker: true,
position: 'RB', // , RB
convert: true, //
});
this.getCurrentPosition()
.then((res) => {
let { address, location } = res;
this.form.address = address;
let geometry = {
type: 'Point',
coordinates: [location.lng, location.lat],
};
this.coordinates = [location.lng, location.lat];
this.$emit('getAddress', geometry, this.form.address);
})
.catch((err) => {
this.$emit('error', err);
});
});
}
});
},
methods: {
open() {
AMapLoader.load({
key: amapKey,
version: '2.0',
plugins: ['AMap.PlaceSearch', 'AMap.Geocoder'],
}).then((AMap) => {
//
this.map = new AMap.Map(this.$refs.amapSearch, {
resizeEnable: true, //
zoom: 18, //
animateEnable: false,
});
this.placeSearch = new AMap.PlaceSearch({
city: '全国',
map: this.map,
pageSize: 20, //
autoFitView: true, // 使 Marker
});
//
if (this.currentPosition && this.currentPosition.coordinates.length > 0) {
let [lng, lat] = this.currentPosition.coordinates;
this.renderMarker({
address: this.address || '未知定位',
location: {
lng: lng,
lat: lat,
},
});
this.form.address = this.address;
/*this.coordinateToAddress(this.currentPosition.coordinates);*/
}
});
},
handleConfirm() {
this.$refs.form.validate().then((valid) => {
if (valid) {
let geometry = { type: 'Point', coordinates: this.coordinates };
this.$emit('getAddress', geometry, this.form.address);
this.close();
}
});
},
handleSearch() {
if (this.searchAddress) {
this.placeSearch.search(this.searchAddress, (status, result) => {
this.searchPanelVisible = true;
if (status === 'complete' && result.info === 'OK') {
if (result.poiList && result.poiList.pois.length > 0) {
this.list = result.poiList.pois;
this.location = this.list[0].id;
/*this.renderMarker(this.list[0]);*/
} else {
this.map.clearMap();
this.list = [];
this.$message.error('无法找到该地址!');
}
} else {
this.$message.warning('无法找到该地址!');
this.list = [];
this.clearMarker();
}
});
}
},
coordinateToAddress(lnglat) {
let that = this;
this.list = [];
this.geocoder.getAddress(lnglat, function (status, result) {
console.log(result.regeocode.pois);
if (status === 'complete' && result.info === 'OK') {
// result
that.list = result.regeocode.pois;
let details = that.list.filter((item) => {
let location = new AMap.LngLat(
Number(item.location.lng),
Number(item.location.lat),
);
if (location.lng === lnglat[0] && location.lat === lnglat[1]) {
return item;
}
});
if (details.length > 0) {
that.location = details[0].id;
that.searchAddress = details[0].name;
that.renderMarker(details[0]);
} else {
that.location = that.list[0].id;
that.searchAddress = that.list[0].name;
that.renderMarker(that.list[0]);
}
}
});
},
renderMarker(marker) {
this.clearMarker(); //
let location = marker.location;
this.map.setCenter([location.lng, location.lat]);
//
// this.map.setZoomAndCenter(16, [location.lng, location.lat]);
this.coordinates = [location.lng, location.lat];
//
this.marker = new AMap.Marker({
position: [location.lng, location.lat],
map: this.map,
});
//
let infoWindowContent = `<div style="width: 200px">`;
if (marker.name) {
infoWindowContent += `<h3>${marker.name}</h3>`;
}
if (marker.address) {
infoWindowContent += `<p>地址:${marker.address}</p>`;
}
infoWindowContent += '</div>';
let infoWindow = new AMap.InfoWindow({
content: infoWindowContent, // 使 HTML
offset: new AMap.Pixel(0, -10),
});
setTimeout(() => {
//
infoWindow.open(
this.map,
new AMap.LngLat(Number(location.lng), Number(location.lat)),
);
});
this.searchPanelVisible = false;
if (marker.address) {
this.form.address = marker.address;
}
},
close() {
this.dialogVisible = false;
},
clearMarker() {
if (this.marker) {
this.marker.setMap(null);
this.marker = null;
}
},
getCurrentPosition() {
return new Promise((resolve, reject) => {
if (!this.geolocation) reject();
this.geolocation.getCurrentPosition((status, result) => {
if (status === 'complete') {
let position = result.position;
this.geocoder.getAddress([position.lng, position.lat], (status, result) => {
if (status === 'complete' && result.info === 'OK') {
let pois = result.regeocode.pois;
if (pois.length > 0) {
let { address, location } = pois[0];
resolve({
address,
location,
});
/* this.renderMarker({
name: '当前定位',
address: address,
location: {
lng: location.lng,
lat: location.lat,
},
});*/
}
} else {
resolve({
address: '',
location: position,
});
/*this.renderMarker({
name: '当前定位',
location: {
lng: position.lng,
lat: position.lat,
},
});*/
}
});
} else {
console.error(result);
reject(result);
/* this.$emit('error', '无法获取定位信息:' + result.message);*/
}
});
});
},
},
},
};
</script>
<style scoped>
.side-search {
width: 35%;
padding-left: 20px;
.search-container {
position: relative;
width: 100%;
height: 40px;
background-color: #fff;
}
#panel {
height: calc(100% - 42px);
overflow-y: scroll;
overflow-x: hidden;
.search-input {
display: flex;
}
.search-panel {
position: absolute;
width: 100%;
background-color: #fff;
z-index: 2;
max-height: 50vh;
overflow: hidden;
}
.search-item {
}
.poibox {
border-bottom: 1px solid #e8e8e8;
cursor: pointer;
padding: 10px 5px;
position: relative;
min-height: 5.5rem;
width: 100%;
.poi-title {
margin-left: 25px;
font-size: 14px;
font-weight: 700;
overflow: hidden;
}
.poi-info {
word-break: break-all;
margin: 0 0 0 25px;
overflow: hidden;
}
border-bottom: 2px solid #e8e8e8;
cursor: pointer;
padding: 10px 0;
position: relative;
min-height: 5.5rem;
width: 100%;
.poi-title {
margin-left: 10px;
font-size: 14px;
font-weight: 700;
overflow: hidden;
margin-top: 0;
}
.poi-info {
word-break: break-all;
margin-left: 10px;
overflow: hidden;
}
}
/* 默认样式适用于web端 */
.container {
display: flex;
height: 100%;
display: flex;
height: 100%;
flex-direction: column; /* 改为上下布局 */
}
.map-container {
flex: 1; /* 占据剩余空间 */
min-height: 25vh;
position: relative;
flex: 1; /* 占据剩余空间 */
min-height: 30vh;
margin-bottom: 10px;
z-index: 1;
}
.search-container {
margin-left: 10px; /* 与地图间距 */
width: 25%;
.detail-container {
margin-top: 10px;
}
/* 移动端样式 */
@media (max-width: 768px) {
.container {
flex-direction: column; /* 改为上下布局 */
}
.search-container {
margin-left: 0; /* 移除间距 */
margin-top: 10px; /* 添加上下间距 */
overflow-x: hidden;
width: 100%;
}
.search-container {
margin-left: 0; /* 移除间距 */
margin-top: 10px; /* 添加上下间距 */
width: 100%;
}
}
</style>

View File

@ -222,9 +222,10 @@ export default {
display: flex;
}
.art-wrap {
width: 100%;
display: flex;
flex-flow: row wrap;
margin: 2.1rem;
margin-top: 2.1rem;
}
.search-input {
margin: 0 auto;

102
equipment.js Normal file
View File

@ -0,0 +1,102 @@
import { artApi } from './artApi';
import { Query, QueryTask, EditTask } from './artUtil';
import EquipmentData from './equipmentData';
import ArtSystem from './artSystem';
class Equipment {
constructor(params) {
if (!params) {
params = {};
}
this.id = params.id;
this.name = params.name;
this.description = params.description;
this.equipmentTypeId = params.type_id;
this.manufacturers = params.manufacture; //厂商
this.serialNumber = params.number; //SN码--设备编号
this.equipmentModel = params.model; //设备型号
this.laboratoryId = params.laboratory_id; //实验室id
if (params.artwork_equipment_type) {
let { name, chart_option, data_type } = params.artwork_equipment_type;
this.equipmentTypeName = name;
this.chartConfiguration = chart_option;
this.dataType = data_type;
}
this.creator = params.creator;
this.updater = params.updater;
this.createTime = params.create_time;
this.updateTime = params.update_time;
}
updateEquipment(params = {}) {
let editTask = new EditTask(artApi.equipmentUpdate);
editTask.addParam('_id', this.id);
editTask.addParam('_description', params.description);
editTask.addParam('_manufacture', params.manufacturers);
editTask.addParam('_number', params.serialNumber);
editTask.addParam('_model', params.equipmentModel);
editTask.addParam('_laboratory_id', params.laboratoryAddress);
editTask.addParam('_name', params.name);
return new Promise((resolve, reject) => {
editTask
.execute()
.then((res) => {
if (res.data) {
let materialType = new Equipment(res.data);
resolve(materialType);
}
})
.catch((err) => {
reject(err);
});
});
}
deleteEquipment(params) {
let editTask = new EditTask(artApi.equipmentDelete);
editTask.addParam('_id', this.id);
return editTask.execute();
}
createEquipmentData(params) {
let editTask = new EditTask(artApi.artworkEquipmentDataInsert);
editTask.addParam('_equipment_id', this.id);
editTask.addParam('_images', params.images);
editTask.addParam('_name', params.name);
editTask.addParam('_data', params.data);
editTask.addParam('_material_id', params.materialId);
editTask.addParam('_remarks', params.remarks);
editTask.addParam('_date_time', params.dateTime);
editTask.addParam('_geometry', params.geometry);
return new Promise((resolve, reject) => {
editTask
.execute()
.then((res) => {
if (res.data) {
let materialType = new EquipmentData(res.data);
resolve(materialType);
}
})
.catch((err) => {
reject(err);
});
});
}
//获取设备所在实验室信息
queryLaboratory(params = {}) {
let { filter, pageInfo } = params;
if (!filter) {
filter = [];
}
filter.push({
name: 'id',
operator: '=',
value: this.laboratoryId,
});
return ArtSystem.queryLaboratoryList({ filter, pageInfo });
}
}
export default Equipment;

63
equipmentData.js Normal file
View File

@ -0,0 +1,63 @@
import { formatterMillisecond } from './utils/date';
import { EditTask } from './artUtil';
import { artApi } from './artApi';
import ArtSystem from './artSystem';
class EquipmentData {
constructor(params) {
if (!params) {
params = {};
}
this.id = params.id;
this.name = params.name;
this.equipmentId = params.equipment_id;
this.images = params.images;
this.geometry = params.geometry;
this.data = params.data;
this.materialId = params.material_id || null;
this.remarks = params.remarks;
this.dateTime = params.date_time;
this.tags = [];
if (params.tag_name) {
this.tags = params.tag_name.map((name) => {
return { name: name };
});
}
this.creator = params.creator;
this.updater = params.updater;
this.createTime = params.create_time;
this.updateTime = params.update_time;
}
get dateTimeFormat() {
return formatterMillisecond(this.dateTime);
}
get createTimeFormat() {
return formatterMillisecond(this.createTime);
}
get updateTimeFormat() {
return formatterMillisecond(this.updateTime);
}
deleteEquipmentData() {
let editTask = new EditTask(artApi.artworkEquipmentDataDelete);
editTask.addParam('_id', this.id);
return editTask.execute();
}
//获取关联的材料信息
queryqueryMateria(params = {}) {
let { filter, pageInfo } = params;
if (!filter) {
filter = [];
}
filter.push({
name: 'id',
operator: '=',
value: this.materialId,
});
return ArtSystem.queryMaterial({
filter,
pageInfo,
});
}
}
export default EquipmentData;

101
equipmentType.js Normal file
View File

@ -0,0 +1,101 @@
import { EditTask } from './artUtil';
import { artApi } from './artApi';
import Equipment from './equipment';
class ArtworkEquipmentType {
constructor(params) {
if (!params) {
params = {};
}
this.id = params.id;
this.name = params.name;
this.description = params.description;
this.dataType = params.data_type;
if (params.chart_option) {
this.chartConfiguration = {
type: '折线图',
xAxis: params.chart_option.xAxis,
yAxis: params.chart_option.yAxis,
};
} else {
this.chartConfiguration = {
type: '折线图',
xAxis: {
key: null,
unit: null,
},
yAxis: {
key: null,
unit: null,
},
};
}
this.equipmentCount = params.equipment_count || 0;
this.style = params.style;
this.tags = [];
if (params.tag_name) {
this.tags = params.tag_name.map((item) => {
return { name: item };
});
}
this.creator = params.creator;
this.updater = params.updater;
this.createTime = params.create_time;
this.updateTime = params.update_time;
}
updateEquipmentType(params) {
let { name, description, style, tags, dataType, chartConfiguration } = params;
let editTask = new EditTask(artApi.equipmentTypeUpdate);
editTask.addParam('_id', this.id);
editTask.addParam('_description', description);
editTask.addParam('_name', name);
editTask.addParam('_style', style);
editTask.addParam('_data_type', dataType);
editTask.addParam('_chart_option', chartConfiguration);
return new Promise((resolve, reject) => {
editTask
.execute()
.then((res) => {
if (res.data) {
let materialType = new ArtworkEquipmentType(res.data);
resolve(materialType);
}
})
.catch((err) => {
reject(err);
});
});
}
deleteEquipmentType(params) {
let editTask = new EditTask(artApi.equipmentTypeDelete);
editTask.addParam('_id', this.id);
return editTask.execute();
}
createEquipment(params) {
let editTask = new EditTask(artApi.equipmentInsert);
editTask.addParam('_type_id', this.id);
editTask.addParam('_description', params.description);
editTask.addParam('_manufacture', params.manufacturers);
editTask.addParam('_number', params.serialNumber);
editTask.addParam('_model', params.equipmentModel);
editTask.addParam('_laboratory_id', params.laboratoryAddress);
editTask.addParam('_name', params.name);
return new Promise((resolve, reject) => {
editTask
.execute()
.then((res) => {
if (res.data) {
let equipment = new Equipment(res.data);
resolve(equipment);
}
})
.catch((err) => {
reject(err);
});
});
}
}
export default ArtworkEquipmentType;

61
laboratory.js Normal file
View File

@ -0,0 +1,61 @@
import { EditTask } from "./artUtil.js";
import { artApi } from "./artApi";
class Laboratory {
constructor(params) {
if (!params) {
params = {};
}
this.id = params.id;
this.name = params.name;
this.description = params.description;
this.geometry = params.geometry;
this.creator = params.creator;
this.updater = params.updater;
this.createTime = params.create_time;
this.updateTime = params.update_time;
this.style = {
name: "坐标",
fillColor: "#1890ff",
fillOpacity: 1,
rotate: 0,
data: "M526.1121875 122.86625c-158.5603125 0.301875-286.9940625 128.9025-286.9940625 287.53125 0 148.111875 120.916875 303.909375 260.7384375 471.5015625 7.348125 8.829375 16.8534375 13.5796875 26.255625 14.1196875 9.4021875-0.54 18.9075-5.2903125 26.251875-14.1196875 139.8225-167.5921875 260.7403125-323.38875 260.7403125-471.5015625 0-158.6296875-128.4346875-287.229375-286.993125-287.53125zM526.1121875 501.6565625c-61.940625-0.335625-112.089375-50.58375-112.089375-112.5928125s50.14875-112.25625 112.089375-112.5928125c61.9396875 0.335625 112.0846875 50.58375 112.0846875 112.5928125s-50.1440625 112.25625-112.0846875 112.5928125z",
};
}
updateLaboratory(params) {
let editTask = new EditTask(artApi.laboratoryUpdate);
editTask.addParam("_id", this.id);
editTask.addParam("_description", params.description);
editTask.addParam("_name", params.name);
editTask.addParam("_geometry", params.geometry);
return new Promise((resolve, reject) => {
editTask
.execute()
.then((res) => {
if (res.data) {
let materialType = new Laboratory(res.data);
resolve(materialType);
}
})
.catch((err) => {
reject(err);
});
});
}
deleteLaboratory(params) {
let editTask = new EditTask(artApi.laboratoryDelete);
editTask.addParam("_id", this.id);
return editTask.execute();
}
LaboratoryCountEquipmentIn(params) {
let editTask = new EditTask(artApi.countArtworkEquipmentInLaboratory);
editTask.addParam("_id", this.id);
return editTask.execute();
}
}
export default Laboratory;

58
material.js Normal file
View File

@ -0,0 +1,58 @@
import { EditTask } from "./artUtil.js";
import { artApi } from "./artApi";
class Material {
constructor(params) {
if (!params) {
params = {};
}
this.id = params.id;
this.name = params.name;
this.description = params.description;
this.images = params.images || null;
this.materialTypeId = params.material_type_id; //材料类型ID
this.materialType = params.material_type;
this.creator = params.creator;
this.updater = params.updater;
this.createTime = params.create_time;
this.updateTime = params.update_time;
}
//封面图(表格展示缩略图)
get imageUrlPreviewPath() {
if (this.images && this.images.length > 0) {
return this.images[0].previewPath;
}
}
get imageUrlimgPath() {
if (this.images && this.images.length > 0) {
return this.images[0].imgPath;
}
}
updateMaterial(params) {
let { name, description, images } = params;
let editTask = new EditTask(artApi.materialUpdate);
editTask.addParam("_id", this.id);
editTask.addParam("_description", description);
editTask.addParam("_name", name);
editTask.addParam("_images", images);
return new Promise((resolve, reject) => {
editTask
.execute()
.then((res) => {
if (res.data) {
let material = new Material(res.data);
resolve(material);
}
})
.catch((err) => {
reject(err);
});
});
}
deleteMaterial(params) {
let editTask = new EditTask(artApi.materialDelete);
editTask.addParam("_id", this.id);
return editTask.execute();
}
}
export default Material;

View File

@ -1,34 +1,29 @@
import AuditRecord from "./auditRecord";
import { EditTask } from "./artUtil.js";
import { artApi } from "./artApi";
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);
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', this.repairPlanId);
editTask.addParam('_remark', params.remark);
editTask.addParam('_status', params.status);
editTask.addParam(
"_reviewer_signature_image",
params.reviewerSignatureImage
);
return editTask.execute();
}
editTask.addParam('_reviewer_signature_image', params.reviewerSignatureImage);
return editTask.execute();
}
}
export default RepairPlanAudit;