feat: improve comparison readiness and business time visibility
This commit is contained in:
parent
0363103f3b
commit
204d6220ad
@ -142,8 +142,8 @@ public class DimensionService {
|
||||
for(var unit:list){
|
||||
var state=cases.getOrDefault(num(unit.get("id")),Map.of());String result="PREPARING";
|
||||
var model=catalog.get(num(state.get("model_id")));var drawing=catalog.get(num(state.get("drawing_id")));var cloud=catalog.get(num(state.get("cloud_id")));
|
||||
if(model!=null&&drawing!=null&&cloud!=null){
|
||||
String signature=DigestUtil.sha256Hex(JSON.toJSONString(map("model",fileInfo(model),"drawing",fileInfo(drawing),"cloud",fileInfo(cloud))));
|
||||
if(model!=null&&cloud!=null){
|
||||
String signature=DigestUtil.sha256Hex(JSON.toJSONString(map("model",fileInfo(model),"drawing",drawing==null?Map.of():fileInfo(drawing),"cloud",fileInfo(cloud))));
|
||||
boolean changed=num(unit.get("current_execution_id"))>0&&(Set.of("RUNNING","PAUSED","QUEUED","STOP_PENDING").contains(unit.get("status"))||num(cloud.get("source_execution_id"))>0&&num(cloud.get("source_execution_id"))!=num(unit.get("current_execution_id"))||num(cloud.get("source_execution_id"))==0&&(unit.get("execution_created")==null||time(cloud.get("create_time")).isBefore(time(unit.get("execution_created")))));
|
||||
result=changed?"SCAN_CHANGED":state.get("prepared_json")!=null&&signature.equals(JSON.parseObject(state.get("prepared_json").toString()).getString("signature"))?"WAITING_COMPARISON":"READY";
|
||||
if(!changed)for(var delivery:deliveries.getOrDefault(num(state.get("id")),List.of()))if(signature.equals(JSON.parseObject(delivery.get("input_json").toString()).getString("signature"))&&comparisonDeliveryCurrent(delivery)){result="DELIVERED".equals(delivery.get("status"))?"DELIVERED":"PENDING_CONFIRM";break;}
|
||||
@ -170,6 +170,7 @@ public class DimensionService {
|
||||
}
|
||||
private Map<String,Object> file(long id){var found=rows("SELECT * FROM lab_dimension_file WHERE id=? AND tenant_id=? AND deleted=0",id,tenant());if(found.isEmpty())throw invalidParamException("文件不存在");return found.get(0);}
|
||||
private Map<String,Object> inputFile(Map<String,Object> state,String column,String role,boolean verify){
|
||||
if("DRAWING".equals(role)&&num(state.get(column))==0)return Map.of();
|
||||
long id=num(state.get(column));if(id==0)throw invalidParamException("请选择"+switch(role){case "MODEL"->"数模";case "DRAWING"->"图纸";default->"PLY点云";}+"版本");
|
||||
var file=file(id);if(num(file.get("task_id"))!=num(state.get("task_id"))||!role.equals(file.get("file_role"))||(num(file.get("unit_id"))!=0&&num(file.get("unit_id"))!=num(state.get("unit_id"))))throw invalidParamException("选用文件不属于此任务或样件,或用途不符");
|
||||
if(verify)verified(file);return fileInfo(file);
|
||||
@ -328,6 +329,7 @@ public class DimensionService {
|
||||
var snapshot=snapshot(row,true);String signature=snapshot.get("signature").toString();
|
||||
var sources=new LinkedHashMap<String,cn.iocoder.yudao.module.lab.service.inspection.LabInspectionGateway.StoredFile>();
|
||||
for(var pair:Map.of("model_id","target","drawing_id","drawing","cloud_id","source").entrySet()) {
|
||||
if("drawing_id".equals(pair.getKey())&&num(row.get(pair.getKey()))==0)continue;
|
||||
var f=file(num(row.get(pair.getKey())));
|
||||
sources.put(pair.getValue(),new cn.iocoder.yudao.module.lab.service.inspection.LabInspectionGateway.StoredFile(f.get("file_name").toString(),Path.of(f.get("storage_path").toString())));
|
||||
}
|
||||
|
||||
@ -43,9 +43,9 @@ public class LabDimensionComparisonService {
|
||||
private final ReentrantLock[] locks=java.util.stream.IntStream.range(0,64).mapToObj(i->new ReentrantLock()).toArray(ReentrantLock[]::new);
|
||||
@Data @EqualsAndHashCode(callSuper=true)
|
||||
public static class Start extends DimensionService.Action {
|
||||
@NotBlank @Size(max=100) private String planTemplateId="auto";
|
||||
@NotBlank(message="请选择检测计划") @Size(max=100) private String planTemplateId;
|
||||
@NotNull @DecimalMin("0.000001") @DecimalMax("1000000") private Double sourceScale=1.0,targetScale=1.0;
|
||||
@NotNull @DecimalMin("0.001") @DecimalMax("100") private Double tolerance=0.2;
|
||||
@NotNull @DecimalMin("0.001") @DecimalMax("100") private Double tolerance=1.0;
|
||||
private boolean autoReport=true,sourceClean=false,reviewCleanup=false;
|
||||
private Map<String,Object> cleanupOptions=Map.of("selection_mode","cad","strength","normal","keep_components",1);
|
||||
}
|
||||
@ -88,15 +88,19 @@ public class LabDimensionComparisonService {
|
||||
options.put("tolerance",req.getTolerance().toString());options.put("auto_report",req.isAutoReport()?"1":"0");
|
||||
options.put("source_clean",req.isSourceClean()?"1":"0");options.put("review_cleanup",!req.isSourceClean()&&req.isReviewCleanup()?"1":"0");
|
||||
options.put("cleanup_options",mapper.writeValueAsString(req.getCleanupOptions()));
|
||||
var snapshot=templates.resolveUpload(tenant(),req.getPlanTemplateId(),input.files().get("target").name(),input.files().get("drawing").name());
|
||||
var drawing=input.files().get("drawing");
|
||||
var snapshot=templates.resolveUpload(tenant(),req.getPlanTemplateId(),input.files().get("target").name(),drawing==null?"":drawing.name());
|
||||
if(snapshot==null)throw bad("请选择已维护且启用的检测计划");
|
||||
options.put("selected_template_id",req.getPlanTemplateId());
|
||||
options.put("plan_template_id",snapshot!=null||req.getPlanTemplateId().equals("auto")?"cad-geometry":req.getPlanTemplateId());
|
||||
if(snapshot!=null)options.put("plan_template_snapshot",mapper.writeValueAsString(snapshot));
|
||||
options.put("plan_template_id","cad-geometry");
|
||||
options.put("plan_template_snapshot",mapper.writeValueAsString(snapshot));
|
||||
return options;
|
||||
}
|
||||
private record Intent(Map<String,Object> job,DimensionService.ComparisonInput input,Map<String,String> options,boolean created) {}
|
||||
public Map<String,Object> start(Start req) {
|
||||
tenant();dimensions.checkComparisonAccess(req.getTaskId(),req.getUnitId(),"",false);
|
||||
if(req.getPlanTemplateId()==null||!req.getPlanTemplateId().startsWith("managed-")||req.getPlanTemplateId().length()<=8)
|
||||
throw bad("请选择已维护且启用的检测计划,不能使用默认自动匹配或空计划");
|
||||
if(!Boolean.TRUE.equals(gateway.health().get("available")))throw new ResponseStatusException(HttpStatus.SERVICE_UNAVAILABLE,"本机计算服务未就绪,请启动检测EXE后重试");
|
||||
if(!submissions.tryAcquire())throw new ResponseStatusException(HttpStatus.TOO_MANY_REQUESTS,"当前比对提交较多,请稍后重试");
|
||||
try {
|
||||
|
||||
@ -37,6 +37,7 @@ export interface LabFixtureVO {
|
||||
applicables?: LabFixtureApplicableVO[]
|
||||
attachments?: LabMasterAttachmentVO[]
|
||||
updateTime?: Date
|
||||
createTime?: Date
|
||||
trajectoryStatus?: string
|
||||
trajectoryFileName?: string
|
||||
trajectoryVersion?: number
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
</span>
|
||||
<span class="meta-item">
|
||||
<el-icon><Clock /></el-icon>
|
||||
<span>{{ detail.createTime || '—' }}</span>
|
||||
<span>{{ formatNullableDate(detail.createTime) }}</span>
|
||||
</span>
|
||||
<span class="meta-item">
|
||||
<span :class="['status-dot', isStatusNormal ? 'status-ok' : 'status-off']"></span>
|
||||
@ -53,6 +53,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import { getNotice } from '@/cmvr/aima/api/system/notice'
|
||||
|
||||
const visible = ref(false)
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
{{ item.noticeType === '1' ? '通知' : '公告' }}
|
||||
</el-tag>
|
||||
<span class="notice-item-title">{{ item.noticeTitle }}</span>
|
||||
<span class="notice-item-date">{{ item.createTime }}</span>
|
||||
<span class="notice-item-date">{{ formatNullableDate(item.createTime) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import NoticeDetailView from './DetailView'
|
||||
import { listNoticeTop, markNoticeRead, markNoticeReadAll } from '@/cmvr/aima/api/system/notice'
|
||||
|
||||
|
||||
@ -1,18 +1,11 @@
|
||||
import { parseTime } from './ruoyi'
|
||||
import { formatDisplayDateTime } from '../../../utils/dateTime.mjs'
|
||||
|
||||
/**
|
||||
* 表格时间格式化
|
||||
*/
|
||||
export function formatDate(cellValue) {
|
||||
if (cellValue == null || cellValue == "") return ""
|
||||
const date = new Date(cellValue)
|
||||
const year = date.getFullYear()
|
||||
const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
|
||||
const day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
|
||||
const hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
|
||||
const minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
|
||||
const seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
|
||||
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
|
||||
return formatDisplayDateTime(cellValue, undefined, '')
|
||||
}
|
||||
|
||||
/**
|
||||
@ -21,41 +14,7 @@ export function formatDate(cellValue) {
|
||||
* @returns {string}
|
||||
*/
|
||||
export function formatTime(time, option) {
|
||||
if (('' + time).length === 10) {
|
||||
time = parseInt(time) * 1000
|
||||
} else {
|
||||
time = +time
|
||||
}
|
||||
const d = new Date(time)
|
||||
const now = Date.now()
|
||||
|
||||
const diff = (now - d) / 1000
|
||||
|
||||
if (diff < 30) {
|
||||
return '刚刚'
|
||||
} else if (diff < 3600) {
|
||||
// less 1 hour
|
||||
return Math.ceil(diff / 60) + '分钟前'
|
||||
} else if (diff < 3600 * 24) {
|
||||
return Math.ceil(diff / 3600) + '小时前'
|
||||
} else if (diff < 3600 * 24 * 2) {
|
||||
return '1天前'
|
||||
}
|
||||
if (option) {
|
||||
return parseTime(time, option)
|
||||
} else {
|
||||
return (
|
||||
d.getMonth() +
|
||||
1 +
|
||||
'月' +
|
||||
d.getDate() +
|
||||
'日' +
|
||||
d.getHours() +
|
||||
'时' +
|
||||
d.getMinutes() +
|
||||
'分'
|
||||
)
|
||||
}
|
||||
return option ? parseTime(time, option) : formatDisplayDateTime(time)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -3,26 +3,17 @@
|
||||
* Copyright (c) 2019 ruoyi
|
||||
*/
|
||||
|
||||
import { displayDate } from '../../../utils/dateTime.mjs'
|
||||
|
||||
// 日期格式化
|
||||
export function parseTime(time, pattern) {
|
||||
if (arguments.length === 0 || !time) {
|
||||
return null
|
||||
}
|
||||
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
|
||||
let date
|
||||
if (typeof time === 'object') {
|
||||
date = time
|
||||
} else {
|
||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||
time = parseInt(time)
|
||||
} else if (typeof time === 'string') {
|
||||
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), '')
|
||||
}
|
||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||
time = time * 1000
|
||||
}
|
||||
date = new Date(time)
|
||||
}
|
||||
const parsed = displayDate(time)
|
||||
if (!parsed) return null
|
||||
const date = parsed.toDate()
|
||||
const formatObj = {
|
||||
y: date.getFullYear(),
|
||||
m: date.getMonth() + 1,
|
||||
|
||||
@ -164,6 +164,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Index">
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import {
|
||||
ArrowRight,
|
||||
CircleCheck,
|
||||
@ -386,16 +387,7 @@ function testStatus(status) {
|
||||
}
|
||||
|
||||
function formatTime(value) {
|
||||
if (!value) return '尚未开始'
|
||||
const date = new Date(String(value).replace(/-/g, '/'))
|
||||
if (Number.isNaN(date.getTime())) return String(value)
|
||||
return new Intl.DateTimeFormat('zh-CN', {
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
hour12: false,
|
||||
}).format(date)
|
||||
return formatNullableDate(value, undefined, '尚未开始')
|
||||
}
|
||||
|
||||
function joinPath(parentPath, routePath) {
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="创建人" prop="createBy" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="创建时间" prop="createTime" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="创建时间" prop="createTime" show-overflow-tooltip :formatter="dateFormatter" />
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="320">
|
||||
<template #default="scope">
|
||||
<el-button icon="Edit" link type="primary" @click="handleUpdate(scope.row)">
|
||||
@ -154,6 +154,7 @@
|
||||
</template>
|
||||
|
||||
<script name="Detect" setup>
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { addTask, copyTask, updateTask, getTaskList, deleteTask, getTestCaseByTaskId, bindTastCase} from "../../../api/intelligenceTest/taskManage";
|
||||
import { getTestCaseList } from "../../../api/intelligenceTest/testCase.js";
|
||||
import TableSearch from "@/cmvr/aima/components/TableSearch/index.vue";
|
||||
|
||||
@ -119,6 +119,7 @@
|
||||
></TableTags>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="信息更新时间" prop="updateTime" width="185" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" align="center" class-name="case-actions" width="248" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
@ -181,6 +182,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Role">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import TableSearch from "@/cmvr/aima/components/TableSearch/index.vue";
|
||||
import { useContainerHeight } from "@/cmvr/aima/hooks/tableHeight";
|
||||
import { addTestCase, copyTestCase, getTestCaseList, updateTestCase, deleteTestCase } from "@/cmvr/aima/api/intelligenceTest/testCase.js"
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
</span>
|
||||
<span class="meta-item">
|
||||
<el-icon><Clock /></el-icon>
|
||||
<span>{{ detail.createTime || '—' }}</span>
|
||||
<span>{{ formatNullableDate(detail.createTime) }}</span>
|
||||
</span>
|
||||
<span class="meta-item">
|
||||
<span :class="['status-dot', isStatusNormal ? 'status-ok' : 'status-off']"></span>
|
||||
@ -53,6 +53,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import { getNotice } from '@/cmvr/common/api/system/notice'
|
||||
|
||||
const visible = ref(false)
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
{{ item.noticeType === '1' ? '通知' : '公告' }}
|
||||
</el-tag>
|
||||
<span class="notice-item-title">{{ item.noticeTitle }}</span>
|
||||
<span class="notice-item-date">{{ item.createTime }}</span>
|
||||
<span class="notice-item-date">{{ formatNullableDate(item.createTime) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import NoticeDetailView from './DetailView'
|
||||
import { listNoticeTop, markNoticeRead, markNoticeReadAll } from '@/cmvr/common/api/system/notice'
|
||||
|
||||
|
||||
@ -1,18 +1,11 @@
|
||||
import { parseTime } from './ruoyi'
|
||||
import { formatDisplayDateTime } from '../../../utils/dateTime.mjs'
|
||||
|
||||
/**
|
||||
* 表格时间格式化
|
||||
*/
|
||||
export function formatDate(cellValue) {
|
||||
if (cellValue == null || cellValue == "") return ""
|
||||
const date = new Date(cellValue)
|
||||
const year = date.getFullYear()
|
||||
const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
|
||||
const day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
|
||||
const hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
|
||||
const minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
|
||||
const seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
|
||||
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
|
||||
return formatDisplayDateTime(cellValue, undefined, '')
|
||||
}
|
||||
|
||||
/**
|
||||
@ -21,41 +14,7 @@ export function formatDate(cellValue) {
|
||||
* @returns {string}
|
||||
*/
|
||||
export function formatTime(time, option) {
|
||||
if (('' + time).length === 10) {
|
||||
time = parseInt(time) * 1000
|
||||
} else {
|
||||
time = +time
|
||||
}
|
||||
const d = new Date(time)
|
||||
const now = Date.now()
|
||||
|
||||
const diff = (now - d) / 1000
|
||||
|
||||
if (diff < 30) {
|
||||
return '刚刚'
|
||||
} else if (diff < 3600) {
|
||||
// less 1 hour
|
||||
return Math.ceil(diff / 60) + '分钟前'
|
||||
} else if (diff < 3600 * 24) {
|
||||
return Math.ceil(diff / 3600) + '小时前'
|
||||
} else if (diff < 3600 * 24 * 2) {
|
||||
return '1天前'
|
||||
}
|
||||
if (option) {
|
||||
return parseTime(time, option)
|
||||
} else {
|
||||
return (
|
||||
d.getMonth() +
|
||||
1 +
|
||||
'月' +
|
||||
d.getDate() +
|
||||
'日' +
|
||||
d.getHours() +
|
||||
'时' +
|
||||
d.getMinutes() +
|
||||
'分'
|
||||
)
|
||||
}
|
||||
return option ? parseTime(time, option) : formatDisplayDateTime(time)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -3,26 +3,17 @@
|
||||
* Copyright (c) 2019 ruoyi
|
||||
*/
|
||||
|
||||
import { displayDate } from '../../../utils/dateTime.mjs'
|
||||
|
||||
// 日期格式化
|
||||
export function parseTime(time, pattern) {
|
||||
if (arguments.length === 0 || !time) {
|
||||
return null
|
||||
}
|
||||
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
|
||||
let date
|
||||
if (typeof time === 'object') {
|
||||
date = time
|
||||
} else {
|
||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||
time = parseInt(time)
|
||||
} else if (typeof time === 'string') {
|
||||
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), '')
|
||||
}
|
||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||
time = time * 1000
|
||||
}
|
||||
date = new Date(time)
|
||||
}
|
||||
const parsed = displayDate(time)
|
||||
if (!parsed) return null
|
||||
const date = parsed.toDate()
|
||||
const formatObj = {
|
||||
y: date.getFullYear(),
|
||||
m: date.getMonth() + 1,
|
||||
|
||||
@ -354,7 +354,7 @@
|
||||
<el-tag v-if="version.sourceVersionId" size="small" type="warning">回退版本</el-tag>
|
||||
</div>
|
||||
<div class="version-history__meta">
|
||||
{{ version.createBy || '未知用户' }} · {{ version.createTime || '-' }}
|
||||
{{ version.createBy || '未知用户' }} · {{ formatNullableDate(version.createTime) }}
|
||||
</div>
|
||||
<div v-if="version.publishNote" class="version-history__note">{{ version.publishNote }}</div>
|
||||
</div>
|
||||
@ -371,6 +371,7 @@
|
||||
|
||||
</template>
|
||||
<script setup>
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import { computed, reactive, ref, watch, onMounted, onUnmounted, nextTick, defineAsyncComponent, provide } from "vue";
|
||||
import { MarkerType, VueFlow, useVueFlow } from "@vue-flow/core";
|
||||
import { v4 as uuid } from "uuid";
|
||||
|
||||
@ -21,15 +21,15 @@
|
||||
</el-row>
|
||||
<el-row class="detail-row">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item"><span class="detail-label">开始时间</span><span class="detail-value">{{ form.startTime }}</span></div>
|
||||
<div class="detail-item"><span class="detail-label">开始时间</span><span class="detail-value">{{ formatNullableDate(form.startTime) }}</span></div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item"><span class="detail-label">结束时间</span><span class="detail-value">{{ form.endTime }}</span></div>
|
||||
<div class="detail-item"><span class="detail-label">结束时间</span><span class="detail-value">{{ formatNullableDate(form.endTime) }}</span></div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="detail-row">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item"><span class="detail-label">记录时间</span><span class="detail-value">{{ form.createTime }}</span></div>
|
||||
<div class="detail-item"><span class="detail-label">记录时间</span><span class="detail-value">{{ formatNullableDate(form.createTime) }}</span></div>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.status == 0 && form.startTime && form.endTime">
|
||||
<div class="detail-item"><span class="detail-label">执行耗时</span><span class="detail-value">{{ costTime }} 毫秒</span></div>
|
||||
@ -157,7 +157,7 @@
|
||||
<div class="detail-item"><span class="detail-label">创建人</span><span class="detail-value">{{ form.createBy || '-' }}</span></div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item"><span class="detail-label">创建时间</span><span class="detail-value">{{ form.createTime }}</span></div>
|
||||
<div class="detail-item"><span class="detail-label">创建时间</span><span class="detail-value">{{ formatNullableDate(form.createTime) }}</span></div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="detail-row">
|
||||
@ -165,7 +165,7 @@
|
||||
<div class="detail-item"><span class="detail-label">更新人</span><span class="detail-value">{{ form.updateBy || '-' }}</span></div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item"><span class="detail-label">更新时间</span><span class="detail-value">{{ form.updateTime || '-' }}</span></div>
|
||||
<div class="detail-item"><span class="detail-label">更新时间</span><span class="detail-value">{{ formatNullableDate(form.updateTime) }}</span></div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="detail-row" v-if="form.remark">
|
||||
@ -185,6 +185,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="JobDetail">
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
const props = defineProps({
|
||||
visible: { type: Boolean, default: false },
|
||||
row: { type: Object, default: () => ({}) },
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
</el-row>
|
||||
<el-row class="detail-row">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item"><span class="detail-label">操作时间</span><span class="detail-value">{{ form.operTime }}</span></div>
|
||||
<div class="detail-item"><span class="detail-label">操作时间</span><span class="detail-value">{{ formatNullableDate(form.operTime) }}</span></div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
@ -112,6 +112,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
const props = defineProps({
|
||||
visible: { type: Boolean, default: false },
|
||||
row: { type: Object, default: () => ({}) }
|
||||
|
||||
@ -112,7 +112,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="el-table__cell is-leaf"><div class="cell">启动时间</div></td>
|
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.startTime }}</div></td>
|
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ formatNullableDate(server.jvm.startTime) }}</div></td>
|
||||
<td class="el-table__cell is-leaf"><div class="cell">运行时长</div></td>
|
||||
<td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.runTime }}</div></td>
|
||||
</tr>
|
||||
@ -170,6 +170,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import { getServer } from '@/cmvr/common/api/monitor/server'
|
||||
|
||||
const server = ref([])
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
<el-table-column label="状态" width="100"><template #default="{ row }"><el-tag :type="row.onlineStatus === '1' ? 'success' : 'info'">{{ row.onlineStatus === '1' ? '在线' : '离线' }}</el-tag></template></el-table-column>
|
||||
<el-table-column label="启用" width="90"><template #default="{ row }">{{ row.enabled === '0' ? '否' : '是' }}</template></el-table-column>
|
||||
<el-table-column label="健康" width="100"><template #default="{ row }"><el-tag :type="row.hasError === '1' ? 'danger' : 'success'">{{ row.hasError === '1' ? '故障' : '正常' }}</el-tag></template></el-table-column>
|
||||
<el-table-column label="最后发现" prop="lastSeenTime" width="175" />
|
||||
<el-table-column label="最后发现" prop="lastSeenTime" width="175" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" width="170" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="controlPath(row)" link type="primary" icon="VideoPlay" :disabled="row.onlineStatus !== '1'" @click="openTeach(row)">示教</el-button>
|
||||
@ -74,7 +74,7 @@
|
||||
<el-button class="mt-16px" v-if="dossierRows[0]" type="primary" v-hasPermi="['lab:device:update']" @click="deviceForm.open('update',dossierRows[0].id)">完善这台设备的档案</el-button>
|
||||
<p class="secondary">在线状态由设备反馈决定;业务停用由台账管理,两者分别展示。</p>
|
||||
</template>
|
||||
<el-table v-else :data="usageRows"><el-table-column label="执行编号" prop="execution_no"/><el-table-column label="任务" prop="task_id"/><el-table-column label="状态" prop="status"/><el-table-column label="时间" prop="create_time"/></el-table>
|
||||
<el-table v-else :data="usageRows"><el-table-column label="执行编号" prop="execution_no"/><el-table-column label="任务" prop="task_id"/><el-table-column label="状态" prop="status"/><el-table-column label="时间" prop="create_time" :formatter="dateFormatter" /></el-table>
|
||||
<template #footer><el-button @click="configOpen = false">关闭</el-button><el-button v-if="drawerTab==='runtime'" type="primary" :loading="saving" @click="saveConfig">保存运行配置</el-button></template>
|
||||
</el-drawer>
|
||||
<DeviceForm ref="deviceForm" @success="loadDossier" />
|
||||
@ -82,6 +82,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="ResourceDevice">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { onActivated, onMounted, reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
@ -42,6 +42,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="描述" prop="mapDesc" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column label="更新时间" prop="updateTime" width="185" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" icon="Edit" @click="openMapEdit(row)">编辑</el-button>
|
||||
@ -96,6 +97,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="ResourceMap">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { onActivated, onMounted, reactive, ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { listResourceRobots } from '@/cmvr/common/api/resource/robot'
|
||||
|
||||
@ -88,7 +88,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最后心跳" prop="lastHeartbeatTime" width="175">
|
||||
<template #default="{ row }">{{ row.lastHeartbeatTime || '-' }}</template>
|
||||
<template #default="{ row }">{{ formatNullableDate(row.lastHeartbeatTime) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型" prop="robotType" width="120">
|
||||
<template #default="{ row }">{{ robotTypeLabel(row.robotType) }}</template>
|
||||
@ -177,7 +177,7 @@
|
||||
<el-table-column label="运行状态" width="110"><template #default="{ row }">{{ managerStateLabel(row.managerState) }}</template></el-table-column>
|
||||
<el-table-column label="健康" width="100"><template #default="{ row }"><el-tag :type="healthTag(row)">{{ healthLabel(row) }}</el-tag></template></el-table-column>
|
||||
<el-table-column label="在线" width="90"><template #default="{ row }"><el-tag :type="row.onlineStatus === '1' ? 'success' : 'info'">{{ row.onlineStatus === '1' ? '在线' : '离线' }}</el-tag></template></el-table-column>
|
||||
<el-table-column label="最后发现" prop="lastSeenTime" width="175" />
|
||||
<el-table-column label="最后发现" prop="lastSeenTime" width="175" :formatter="dateFormatter" />
|
||||
<el-table-column label="错误" prop="errorMessage" min-width="180" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</el-drawer>
|
||||
@ -186,6 +186,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="ResourceRobot">
|
||||
import { formatNullableDate, dateFormatter } from '@/utils/formatTime'
|
||||
import { computed, getCurrentInstance, onActivated, onDeactivated, onBeforeUnmount, onMounted, reactive, ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { addRobot, deleteRobot, getRobotDevices, getRobotList, getRobotStatus, updateRobot } from '@/cmvr/common/api/resource/robot'
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<el-table-column label="连接" width="95"><template #default="{ row }"><el-tag :type="row.connectStatus === '1' ? 'success' : 'info'">{{ row.connectStatus === '1' ? '在线' : '离线' }}</el-tag></template></el-table-column>
|
||||
<el-table-column label="软件版本" prop="softwareVersion" min-width="130" />
|
||||
<el-table-column label="绑定机器人" min-width="220"><template #default="{ row }"><span v-if="row.robotCount">{{ row.robotIdsCsv }}</span><span v-else class="secondary">未绑定</span></template></el-table-column>
|
||||
<el-table-column label="最后心跳" prop="lastHeartbeatTime" width="180" />
|
||||
<el-table-column label="最后心跳" prop="lastHeartbeatTime" width="180" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" width="190" fixed="right"><template #default="{ row }"><el-button link type="primary" icon="Link" @click="openBindings(row)">绑定</el-button><el-button link type="primary" icon="Edit" @click="openEdit(row)">编辑</el-button><el-button link type="danger" icon="Delete" :disabled="row.connectStatus === '1'" @click="remove(row)">删除</el-button></template></el-table-column>
|
||||
</el-table>
|
||||
<CmvrPagination v-show="total > 0" :total="total" v-model:page="query.pageNum" v-model:limit="query.pageSize" @pagination="load" />
|
||||
@ -39,6 +39,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="ResourceTerminal">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { onActivated, onMounted, reactive, ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { listResourceTerminals, addResourceTerminal, updateResourceTerminal, deleteResourceTerminals, listTerminalRobots, updateTerminalRobots } from '@/cmvr/common/api/resource/terminal'
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
<div v-if="row.forcedEnabled" class="forced-label">人工启用</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="验证时间" prop="verifiedTime" width="170"><template #default="{ row }">{{ row.verifiedTime || '-' }}</template></el-table-column>
|
||||
<el-table-column label="验证时间" prop="verifiedTime" width="170"><template #default="{ row }">{{ formatNullableDate(row.verifiedTime) }}</template></el-table-column>
|
||||
<el-table-column label="操作" width="285" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" @click="openCorrection(row)">微调</el-button>
|
||||
@ -160,6 +160,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="VisionCalibration">
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import { computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue'
|
||||
import { Aim, Camera, Refresh, Search } from '@element-plus/icons-vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
|
||||
@ -87,9 +87,9 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建者" align="center" prop="createBy" width="100" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="185">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<CmvrSvgIcon icon-class="date" />创建日期
|
||||
<div class="pull-right">{{ state.user.createTime }}</div>
|
||||
<div class="pull-right">{{ formatNullableDate(state.user.createTime) }}</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -63,6 +63,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Profile">
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import userAvatar from "./userAvatar"
|
||||
import userInfo from "./userInfo"
|
||||
import resetPwd from "./resetPwd"
|
||||
|
||||
@ -81,7 +81,7 @@
|
||||
<el-col :span="12">
|
||||
<div class="info-item">
|
||||
<label class="info-label">创建时间:</label>
|
||||
<span class="info-value plaintext">{{ info.createTime }}</span>
|
||||
<span class="info-value plaintext">{{ formatNullableDate(info.createTime) }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -95,7 +95,7 @@
|
||||
<el-col :span="12">
|
||||
<div class="info-item">
|
||||
<label class="info-label">更新时间:</label>
|
||||
<span class="info-value plaintext">{{ info.updateTime }}</span>
|
||||
<span class="info-value plaintext">{{ formatNullableDate(info.updateTime) }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -109,7 +109,7 @@
|
||||
<el-col :span="12">
|
||||
<div class="info-item">
|
||||
<label class="info-label">最后登录时间:</label>
|
||||
<span class="info-value plaintext">{{ info.loginDate }}</span>
|
||||
<span class="info-value plaintext">{{ formatNullableDate(info.loginDate) }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -126,6 +126,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import { getUser } from '@/cmvr/common/api/system/user'
|
||||
|
||||
const visible = ref(false)
|
||||
|
||||
@ -30,8 +30,8 @@
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column prop="tableName" label="表名称" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column prop="tableComment" label="表描述" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间"></el-table-column>
|
||||
<el-table-column prop="updateTime" label="更新时间"></el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" :formatter="dateFormatter"></el-table-column>
|
||||
<el-table-column prop="updateTime" label="更新时间" :formatter="dateFormatter"></el-table-column>
|
||||
</el-table>
|
||||
<CmvrPagination
|
||||
v-show="total>0"
|
||||
@ -51,6 +51,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { listDbTable, importTable } from "@/cmvr/common/api/tool/gen"
|
||||
|
||||
const total = ref(0)
|
||||
|
||||
@ -97,8 +97,8 @@
|
||||
<el-table-column label="表名称" align="center" prop="tableName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="表描述" align="center" prop="tableComment" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="实体" align="center" prop="className" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160" sortable="custom" :sort-orders="['descending', 'ascending']" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" width="160" sortable="custom" :sort-orders="['descending', 'ascending']" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160" sortable="custom" :sort-orders="['descending', 'ascending']" :formatter="dateFormatter" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" width="160" sortable="custom" :sort-orders="['descending', 'ascending']" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" align="center" width="330" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="预览" placement="top">
|
||||
@ -146,6 +146,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Gen">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { listTable, previewTable, delTable, genCode, synchDb } from "@/cmvr/common/api/tool/gen"
|
||||
import router from "@/cmvr/common/router"
|
||||
import importTable from "./importTable"
|
||||
|
||||
53
am-web/src/utils/dateTime.mjs
Normal file
53
am-web/src/utils/dateTime.mjs
Normal file
@ -0,0 +1,53 @@
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
export const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'
|
||||
|
||||
/** Normalize display values only; keep timestamps in requests and stored records unchanged. */
|
||||
export function displayDate(value) {
|
||||
if (value == null || value === '' || typeof value === 'boolean') return null
|
||||
if (!['string', 'number', 'object'].includes(typeof value)) return null
|
||||
if (typeof value === 'string') {
|
||||
value = value.trim()
|
||||
if (!value) return null
|
||||
// Java long timestamps may be serialized as strings. Do not parse them as calendar years.
|
||||
if (/^-?\d{9,}(?:\.\d+)?$/.test(value) || value === '0') value = Number(value)
|
||||
}
|
||||
if (typeof value === 'number') {
|
||||
if (!Number.isFinite(value) || value === 0) return null
|
||||
value = Math.abs(value) < 1e11 ? value * 1000 : value
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
// Jackson LocalDateTime arrays use a one-based month.
|
||||
if (value.length < 3 || value.length > 7 || value.some((part) => !Number.isInteger(part)))
|
||||
return null
|
||||
const [year, month, day, hour = 0, minute = 0, second = 0, nano = 0] = value
|
||||
if (
|
||||
month < 1 ||
|
||||
month > 12 ||
|
||||
day < 1 ||
|
||||
day > 31 ||
|
||||
hour < 0 ||
|
||||
hour > 23 ||
|
||||
minute < 0 ||
|
||||
minute > 59 ||
|
||||
second < 0 ||
|
||||
second > 59 ||
|
||||
nano < 0 ||
|
||||
nano >= 1e9
|
||||
)
|
||||
return null
|
||||
const date = new Date(year, month - 1, day, hour, minute, second, Math.floor(nano / 1e6))
|
||||
if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day)
|
||||
return null
|
||||
value = date
|
||||
}
|
||||
if (value && typeof value === 'object' && !(value instanceof Date) && !dayjs.isDayjs(value))
|
||||
return null
|
||||
// Keep ISO timezone suffixes: replacing '-' or stripping 'Z' changes the instant.
|
||||
const date = dayjs(value)
|
||||
return date.isValid() ? date : null
|
||||
}
|
||||
|
||||
export function formatDisplayDateTime(value, format = DATE_TIME_FORMAT, emptyText = '-') {
|
||||
return displayDate(value)?.format(format) ?? emptyText
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
import dayjs from 'dayjs'
|
||||
import { formatDisplayDateTime } from './dateTime.mjs'
|
||||
import type { TableColumnCtx } from 'element-plus'
|
||||
|
||||
/**
|
||||
@ -63,12 +64,7 @@ export const defaultShortcuts = [
|
||||
* @returns 返回拼接后的时间字符串
|
||||
*/
|
||||
export function formatDate(date: dayjs.ConfigType, format?: string): string {
|
||||
// 日期不存在,则返回空
|
||||
if (!date) {
|
||||
return ''
|
||||
}
|
||||
// 日期存在,则进行格式化
|
||||
return date ? dayjs(date).format(format ?? 'YYYY-MM-DD HH:mm:ss') : ''
|
||||
return formatDisplayDateTime(date, format, '')
|
||||
}
|
||||
|
||||
/**
|
||||
@ -230,7 +226,7 @@ export function formatSeconds(seconds: number): string {
|
||||
* @param cellValue 字段值
|
||||
*/
|
||||
export function dateFormatter(_row: any, _column: TableColumnCtx<any>, cellValue: any): string {
|
||||
return cellValue ? formatDate(cellValue) : ''
|
||||
return formatNullableDate(cellValue)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -151,7 +151,7 @@
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="finishTime" :label="t('workplace.finishTime')" min-width="160" />
|
||||
<el-table-column prop="finishTime" :label="t('workplace.finishTime')" min-width="160" :formatter="dateFormatter" />
|
||||
<el-table-column :label="t('workplace.status')" width="90">
|
||||
<template #default="{ row }">
|
||||
<el-tag type="success" effect="plain" size="small">{{ row.status }}</el-tag>
|
||||
@ -168,6 +168,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import type { EChartsOption } from 'echarts'
|
||||
import { homeShortcuts } from '../home-data'
|
||||
import { getHomeOverview, type LabHomeOverviewVO } from '@/api/lab/home'
|
||||
|
||||
@ -116,7 +116,7 @@
|
||||
><el-table :data="versions" border
|
||||
><el-table-column label="版本" width="100"
|
||||
><template #default="{ row }">v{{ row.versionNo }}</template></el-table-column
|
||||
><el-table-column label="发布时间" prop="createTime" min-width="180" /><el-table-column
|
||||
><el-table-column label="发布时间" prop="createTime" min-width="180" :formatter="dateFormatter" /><el-table-column
|
||||
label="操作"
|
||||
width="150"
|
||||
><template #default="{ row }"
|
||||
@ -130,6 +130,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { markRaw, nextTick, onBeforeUnmount, ref, computed, reactive, watch } from 'vue'
|
||||
import { VueFlow, MarkerType, useVueFlow } from '@vue-flow/core'
|
||||
import type { Node, Edge, Connection } from '@vue-flow/core'
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<section class="comparison-panel">
|
||||
<div class="comparison-heading">
|
||||
<div><h3>尺寸比对</h3><span class="secondary">自动使用本任务选定的数模、PDF和扫描PLY。</span></div>
|
||||
<div><h3>尺寸比对</h3><span class="secondary">使用选定的三维数模、扫描PLY和检测计划;二维PDF图纸选填。</span></div>
|
||||
<div class="comparison-buttons">
|
||||
<el-tag :type="health.available ? 'success' : 'info'">{{ health.available ? '计算服务就绪' : '计算服务未就绪' }}</el-tag>
|
||||
<el-button :loading="loading" @click="refresh(true)">刷新状态</el-button>
|
||||
@ -9,59 +9,73 @@
|
||||
</div>
|
||||
</div>
|
||||
<el-alert v-if="error" :title="error" type="error" :closable="false" />
|
||||
<el-alert v-else-if="!health.available" :title="health.message || '请先启动本机检测EXE,再刷新状态。'" type="info" :closable="false" />
|
||||
<el-form label-position="top" class="comparison-options" :disabled="busy">
|
||||
<el-form-item label="检测计划">
|
||||
<el-select v-model="options.planTemplateId" filterable class="plan-select">
|
||||
<el-option label="按图纸及完整零件号自动匹配" value="auto" />
|
||||
<el-form label-position="top" class="comparison-options" :disabled="busy || savingInputs">
|
||||
<el-form-item label="检测计划" required :error="options.planTemplateId && !selectedPlan ? '该计划已不可用,请重新选择' : ''">
|
||||
<el-select ref="planSelect" v-model="options.planTemplateId" filterable clearable placeholder="请选择检测计划(必填)" class="plan-select">
|
||||
<el-option v-for="item in catalog" :key="item.id" :value="item.id" :label="`${item.label} · V${item.version}`" />
|
||||
<el-option label="CAD几何检测(无图纸计划)" value="cad-geometry" />
|
||||
</el-select>
|
||||
<span v-if="!catalog.length && !loading" class="secondary">暂无可用计划,请先点击“维护检测计划”录入并启用,再刷新状态。</span>
|
||||
</el-form-item>
|
||||
<el-collapse><el-collapse-item title="单位与处理设置" name="options">
|
||||
<div class="comparison-fields">
|
||||
<div class="comparison-fields">
|
||||
<el-form-item label="扫描数据单位"><el-select v-model="options.sourceScale"><el-option v-for="item in units" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
||||
<el-form-item label="标准数模单位"><el-select v-model="options.targetScale"><el-option v-for="item in units" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
||||
<el-form-item label="表面偏差阈值(mm)"><el-input-number v-model="options.tolerance" :min="0.001" :max="100" :precision="3" /></el-form-item>
|
||||
</div>
|
||||
<el-checkbox v-model="options.autoReport">计算后自动生成报告</el-checkbox>
|
||||
</div>
|
||||
<div class="comparison-report"><el-checkbox v-model="options.autoReport">计算后自动生成报告</el-checkbox></div>
|
||||
<section class="comparison-preprocessing" aria-label="点云预处理设置">
|
||||
<h4>点云预处理设置</h4>
|
||||
<el-checkbox v-model="options.sourceClean">扫描数据已清理,仅含被测零件</el-checkbox>
|
||||
<el-checkbox v-model="options.reviewCleanup" :disabled="options.sourceClean">对齐前先人工确认点云清理</el-checkbox>
|
||||
</el-collapse-item></el-collapse>
|
||||
</section>
|
||||
</el-form>
|
||||
<el-alert v-if="blockers.length" class="comparison-checklist gap" title="暂不能开始尺寸比对,请完成以下事项" type="warning" :closable="false" show-icon>
|
||||
<ul class="comparison-blockers">
|
||||
<li v-for="issue in blockers" :key="issue.key">
|
||||
<span>{{ issue.text }}</span>
|
||||
<el-button v-if="canResolveIssue(issue.action)" type="primary" link :disabled="busy || savingInputs || syncing" @click="resolveIssue(issue.action)">{{ issue.label }}</el-button>
|
||||
</li>
|
||||
</ul>
|
||||
</el-alert>
|
||||
<div class="comparison-buttons gap">
|
||||
<el-button type="primary" :loading="busy" :disabled="!ready || dirty || sourceChanged || !health.available || pendingSameInput" v-hasPermi="['lab:data:upload']" @click="start">{{ busy ? '正在提交文件' : '开始尺寸比对' }}</el-button>
|
||||
<el-button type="primary" :loading="busy" :disabled="savingInputs || !ready || blockers.length > 0" v-hasPermi="['lab:data:upload']" @click="start">{{ busy ? '正在提交文件' : '开始尺寸比对' }}</el-button>
|
||||
<el-button v-if="job.engine_id" type="primary" plain @click="expanded = true">打开比对工作区</el-button>
|
||||
<el-button v-if="job.engine_id && ['ARCHIVE_ERROR', 'ARCHIVE_PENDING'].includes(job.status)" :loading="syncing" v-hasPermi="['lab:data:upload']" @click="sync">重试成果归档</el-button>
|
||||
<span v-if="dirty" class="secondary">请先保存选用的资料版本。</span>
|
||||
<span v-else-if="sourceChanged" class="secondary">扫描记录已更新,请先关联本次PLY。</span>
|
||||
<span v-if="!blockers.length" class="comparison-ready">资料版本已保存,检测计划已选择,可以开始比对。</span>
|
||||
</div>
|
||||
<div v-if="job.id" class="comparison-status">
|
||||
<div class="comparison-heading"><strong>{{ labels[job.status] || job.status }}</strong><span class="secondary">{{ sameInput ? '对应当前输入' : '历史比对,输入版本已更新' }}</span></div>
|
||||
<p class="secondary">创建时间:{{ formatNullableDate(job.create_time) }} · 状态同步时间:{{ formatNullableDate(job.update_time) }}</p>
|
||||
<el-progress v-if="['SUBMITTING','PROCESSING'].includes(job.status)" :percentage="50" :indeterminate="true" :show-text="false" />
|
||||
<p v-if="job.last_error" class="comparison-error">{{ job.last_error }}</p>
|
||||
<p v-else-if="job.status === 'ARCHIVED'">STL与PDF已成套归档,可在下方核对、查看并确认交付。</p>
|
||||
<p v-else-if="job.status === 'REVIEW'">打开工作区确认清理、测量项或生成新版报告。</p>
|
||||
<p v-else-if="job.status === 'UNKNOWN'">提交回执未确认,请核对计算服务记录。系统不会自动重复提交。</p>
|
||||
<p v-if="calculationActive" class="comparison-error">当前计算服务未提供取消计算接口。关闭工作区或离开页面不会停止计算,请等待结果,避免重复提交。</p>
|
||||
<p class="secondary">比对作业 {{ job.id }}<span v-if="job.source_execution_id"> · 来源扫描 {{ job.source_execution_id }}</span><span v-if="job.engine_revision"> · 成果版本 {{ job.engine_revision }}</span></p>
|
||||
</div>
|
||||
<el-dialog v-model="expanded" title="尺寸比对工作区" width="min(1600px, 97vw)" top="2vh" destroy-on-close append-to-body :before-close="closeWorkspace">
|
||||
<el-alert v-if="calculationActive" title="计算仍在进行。关闭本窗口不会取消计算;当前计算服务未提供停止接口。" type="info" :closable="false" show-icon />
|
||||
<InspectionWorkbench v-if="job.engine_id" ref="workspace" :key="job.engine_id" :record-id="job.engine_id" @changed="workspaceChanged" @history="closeWorkspace(() => expanded = false)" />
|
||||
</el-dialog>
|
||||
</section>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import * as Api from '@/api/lab/inspection'
|
||||
import { onBeforeUnmount, watch, ref, reactive, computed, defineAsyncComponent } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useRouter } from 'vue-router'
|
||||
import '@/views/lab/inspection/inspection.scss'
|
||||
import { comparisonPollInterval } from '@/views/lab/scan-task/workbenchPolling.mjs'
|
||||
import { comparisonBlockers } from './comparisonReadiness.mjs'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
const InspectionWorkbench = defineAsyncComponent(() => import('@/views/lab/inspection/InspectionWorkbench.vue'))
|
||||
const props = defineProps<{ taskId: string; unitId: string; revision: number; ready: boolean; dirty: boolean; sourceChanged: boolean; active: boolean; inputs: { modelId: any; drawingId: any; cloudId: any } }>()
|
||||
const emit = defineEmits<{ changed: [] }>()
|
||||
const props = defineProps<{ taskId: string; unitId: string; revision: number; ready: boolean; dirty: boolean; sourceChanged: boolean; active: boolean; inputs: { modelId: any; drawingId: any; cloudId: any }; selectedInputs?: { modelId: any; drawingId: any; cloudId: any }; savingInputs?: boolean; cloudFileCount?: number }>()
|
||||
const emit = defineEmits<{ changed: []; 'open-materials': []; 'save-inputs': []; 'archive-cloud': [] }>()
|
||||
const router = useRouter(), job = ref<any>({}), health = ref<any>({}), catalog = ref<any[]>([]), error = ref(''), loading = ref(false), busy = ref(false), syncing = ref(false), expanded = ref(false), workspace = ref<any>()
|
||||
const options = reactive({ planTemplateId: 'auto', sourceScale: 1, targetScale: 1, tolerance: 0.2, autoReport: true, sourceClean: false, reviewCleanup: false })
|
||||
const options = reactive({ planTemplateId: '', sourceScale: 1, targetScale: 1, tolerance: 1, autoReport: true, sourceClean: false, reviewCleanup: false })
|
||||
const planSelect = ref<any>()
|
||||
const selectedPlan = computed(() => catalog.value.find(plan => plan.id === options.planTemplateId))
|
||||
const units = [{value: 1,label:'毫米 mm'},{value:1000,label:'米 m'},{value:0.001,label:'微米 μm'}]
|
||||
const labels: Record<string,string> = {SUBMITTING:'正在提交资料',UNKNOWN:'提交结果待核对',PROCESSING:'计算处理中',REVIEW:'待人工核对',ARCHIVE_PENDING:'计算完成,正在归档',ARCHIVE_ERROR:'计算完成,成果归档待处理',ARCHIVED:'成果已成套归档',FAILED:'比对失败'}
|
||||
const sameInput = computed(() => {
|
||||
@ -70,6 +84,20 @@ const sameInput = computed(() => {
|
||||
catch { return false }
|
||||
})
|
||||
const pendingSameInput = computed(() => sameInput.value && ['SUBMITTING','UNKNOWN','PROCESSING','REVIEW','ARCHIVE_PENDING','ARCHIVE_ERROR'].includes(job.value.status))
|
||||
const calculationActive = computed(() => ['SUBMITTING','UNKNOWN','PROCESSING'].includes(job.value.status))
|
||||
const blockers = computed(() => comparisonBlockers({ unitId: props.unitId, inputs: props.selectedInputs || props.inputs, dirty: props.dirty, sourceChanged: props.sourceChanged, planId: options.planTemplateId, plans: catalog.value, healthAvailable: health.value.available, pending: pendingSameInput.value, cloudFileCount: props.cloudFileCount }))
|
||||
function canResolveIssue(action: string) {
|
||||
if (['save', 'archive'].includes(action)) return checkPermi(['lab:data:upload'])
|
||||
return action !== 'workspace' || !!job.value.engine_id
|
||||
}
|
||||
function resolveIssue(action: string) {
|
||||
if (action === 'save') emit('save-inputs')
|
||||
else if (action === 'archive') emit('archive-cloud')
|
||||
else if (action === 'materials') emit('open-materials')
|
||||
else if (action === 'plan') { planSelect.value?.$el?.scrollIntoView({ block: 'center', behavior: 'smooth' }); planSelect.value?.focus() }
|
||||
else if (action === 'refresh') void refresh(true)
|
||||
else if (action === 'workspace' && job.value.engine_id) expanded.value = true
|
||||
}
|
||||
let timer: ReturnType<typeof setTimeout> | undefined, generation = 0, abort: AbortController | undefined
|
||||
let lastDelivery = ''
|
||||
let suspended=false
|
||||
@ -97,7 +125,8 @@ watch(() => [props.taskId,props.unitId,props.active], async () => {
|
||||
if (props.active && props.unitId && props.unitId !== '0') await refresh(true)
|
||||
},{immediate:true})
|
||||
async function start() {
|
||||
if (busy.value) return
|
||||
if (busy.value || props.savingInputs || !props.ready) return
|
||||
if (blockers.value.length) { ElMessage.warning(blockers.value[0].text); return }
|
||||
const token = generation
|
||||
busy.value = true; error.value = ''
|
||||
try {
|
||||
@ -107,7 +136,7 @@ async function start() {
|
||||
schedulePoll(token)
|
||||
emit('changed')
|
||||
if (job.value.engine_id) expanded.value = true
|
||||
} catch(e:any) { if(token === generation) { error.value = e?.message || '提交失败,请刷新状态后核对'; await refresh() } }
|
||||
} catch(e:any) { if(token === generation) { const failure = e?.message || '提交失败,请刷新状态后核对'; await refresh(); if(token === generation) error.value = failure } }
|
||||
finally { busy.value = false }
|
||||
}
|
||||
async function sync() {
|
||||
@ -135,9 +164,18 @@ onBeforeUnmount(() => { generation++; clearTimeout(timer); abort?.abort();docume
|
||||
.comparison-options { margin-top:18px; }
|
||||
.plan-select { max-width:620px; }
|
||||
.comparison-fields { display:grid;grid-template-columns:repeat(3,minmax(140px,1fr));gap:16px; }
|
||||
.comparison-fields :deep(.el-select), .comparison-fields :deep(.el-input-number) { width:100%; }
|
||||
.comparison-report { margin:0 0 12px; }
|
||||
.comparison-preprocessing { padding-top:12px; border-top:1px solid var(--el-border-color-lighter); }
|
||||
.comparison-preprocessing h4 { margin:0 0 8px; font-size:14px; font-weight:500; }
|
||||
.comparison-preprocessing .el-checkbox { display:flex; margin-right:0; }
|
||||
.comparison-status { padding:14px 0;border-top:1px solid var(--el-border-color-lighter); }
|
||||
.comparison-status p { margin:10px 0; }
|
||||
.comparison-error { color:var(--el-color-warning);white-space:pre-wrap; }
|
||||
.comparison-blockers { margin: 8px 0 0; padding-left: 18px; }
|
||||
.comparison-blockers li { margin: 7px 0; line-height: 1.6; }
|
||||
.comparison-blockers .el-button { margin-left: 12px; white-space: normal; height: auto; }
|
||||
.comparison-ready { color: var(--el-color-success); font-size: 13px; }
|
||||
.secondary { color:var(--el-text-color-secondary);font-size:12px;overflow-wrap:anywhere; }
|
||||
.gap { margin-top:16px; }
|
||||
@media(max-width:700px) { .comparison-fields { grid-template-columns:1fr; } }
|
||||
|
||||
@ -34,6 +34,12 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="归档与交付时间" min-width="230">
|
||||
<template #default="{ row }">
|
||||
<div>归档:{{ formatNullableDate(row.create_time) }}</div>
|
||||
<div class="secondary">交付:{{ formatNullableDate(row.confirmed_at) }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="下载" min-width="270">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
@ -73,6 +79,7 @@
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import * as Api from '@/api/lab/dimension'
|
||||
const router = useRouter(),
|
||||
message = useMessage()
|
||||
|
||||
13
am-web/src/views/lab/dimension/comparisonReadiness.mjs
Normal file
13
am-web/src/views/lab/dimension/comparisonReadiness.mjs
Normal file
@ -0,0 +1,13 @@
|
||||
/** Explain each start requirement with an actionable next step. PDF is optional. */
|
||||
export function comparisonBlockers({ unitId, inputs = {}, dirty, sourceChanged, planId, plans = [], healthAvailable, pending, cloudFileCount = 0 }) {
|
||||
const issues = []
|
||||
if (!unitId || String(unitId) === '0') issues.push({ key: 'unit', text: '请先选择需要比对的样件。', action: 'materials', label: '选择样件' })
|
||||
if (dirty) issues.push({ key: 'save', text: '比对资料版本尚未保存,当前选择还未生效。', action: 'save', label: '保存比对资料版本' })
|
||||
if (!inputs.modelId) issues.push({ key: 'model', text: '尚未选用三维数模,请上传或选择 X_T / STP 版本。', action: 'materials', label: '选择三维数模' })
|
||||
if (!inputs.cloudId) issues.push({ key: 'cloud', text: cloudFileCount ? '扫描已导出 PLY,但尚未归档并选用于当前样件。' : '尚未关联扫描 PLY,请先完成扫描并导出 PLY。', action: cloudFileCount === 1 ? 'archive' : 'materials', label: cloudFileCount === 1 ? '归档并选用扫描PLY' : '查看扫描导出文件' })
|
||||
if (sourceChanged) issues.push({ key: 'scan', text: '扫描执行已更新或仍在执行,请结束扫描后关联对应的 PLY。', action: 'materials', label: '检查扫描PLY' })
|
||||
if (!planId || !plans.some(plan => plan.id === planId)) issues.push({ key: 'plan', text: '检测计划为必填项,请明确选择一个已维护且启用的计划。', action: 'plan', label: '选择检测计划' })
|
||||
if (!healthAvailable) issues.push({ key: 'health', text: '计算服务尚未就绪,请启动本机检测 EXE 后刷新状态。', action: 'refresh', label: '刷新计算服务状态' })
|
||||
if (pending) issues.push({ key: 'pending', text: '当前输入已有未完成的比对,请查看现有作业,避免重复提交。', action: 'workspace', label: '查看当前比对' })
|
||||
return issues
|
||||
}
|
||||
@ -52,6 +52,7 @@
|
||||
><span v-else>历史任务,进入查看原有记录</span></template
|
||||
></el-table-column
|
||||
>
|
||||
<el-table-column label="任务创建时间" prop="create_time" width="185" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" width="120"
|
||||
><template #default="{ row }"
|
||||
><el-button type="primary" link @click="open(row)">{{
|
||||
@ -109,6 +110,7 @@
|
||||
<ResultFilesDialog v-if="resultMode" ref="resultFiles" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import * as Api from '@/api/lab/dimension'
|
||||
import { deliveryStages, taskStates } from './presentation.mjs'
|
||||
import ResultFilesDialog from './ResultFilesDialog.vue'
|
||||
|
||||
@ -41,7 +41,7 @@ export function formatScannerCalibrationDate(utc) {
|
||||
hourCycle: 'h23'
|
||||
}).formatToParts(date)
|
||||
const part = (type) => parts.find((item) => item.type === type)?.value
|
||||
return `${part('year')}年${part('month')}月${part('day')}日${part('hour')}时${part('minute')}分${part('second')}秒`
|
||||
return `${part('year')}-${part('month')}-${part('day')} ${part('hour')}:${part('minute')}:${part('second')}`
|
||||
}
|
||||
|
||||
/** Load the current published contract. Opening this form never dispatches a workflow. */
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
}}<span v-if="data.task.projectName"> · {{ data.task.projectName }}</span>
|
||||
<span v-if="scanSummary">
|
||||
· 已扫描 {{ scanSummary.completed }} / {{ scanSummary.total }} 件</span
|
||||
></p
|
||||
><span> · 创建于 {{ formatNullableDate(data.task.createTime) }}</span></p
|
||||
></div
|
||||
><div class="heading-actions">
|
||||
<el-tag
|
||||
@ -23,9 +23,9 @@
|
||||
:type="data.task.status === 'COMPLETED' ? 'success' : 'info'"
|
||||
>{{ taskStates[scanSummary?.status || data.task.status] || data.task.status }}</el-tag
|
||||
>
|
||||
<el-tag v-else :type="data.stage === 'DELIVERED' ? 'success' : 'info'">{{
|
||||
<el-button v-else :type="data.stage === 'DELIVERED' ? 'success' : 'warning'" plain @click="switchSection('delivery')">{{
|
||||
deliveryStages[data.stage] || data.stage
|
||||
}}</el-tag>
|
||||
}} · {{ ['DELIVERED', 'PENDING_CONFIRM'].includes(data.stage) ? '查看成果' : '查看待办' }}</el-button>
|
||||
<el-button :loading="loading" @click="refresh">刷新</el-button>
|
||||
<el-button
|
||||
v-if="!data.task.ownerId && data.task.processType === 'SCAN_ONLY'"
|
||||
@ -87,14 +87,14 @@
|
||||
<el-tab-pane v-if="data.task.processType === 'SCAN_ONLY'" label="扫描执行" name="scan" />
|
||||
<el-tab-pane label="比对资料" name="materials">
|
||||
<el-alert
|
||||
title="三维数模和PDF图纸只在尺寸比对前要求齐全,不影响扫描。扫描生成的PLY自动带入,不需要手动上传。"
|
||||
title="尺寸比对需要三维数模、扫描PLY和检测计划;二维PDF图纸选填。资料不影响扫描执行,扫描生成的PLY自动关联。"
|
||||
:closable="false"
|
||||
class="gap"
|
||||
/>
|
||||
<el-checkbox v-model="shared">新上传的数模和图纸供本任务所有样件复用</el-checkbox>
|
||||
<div class="materials">
|
||||
<section v-for="r in inputs" :key="r.role"
|
||||
><h3>{{ fileRoles[r.role] }}</h3
|
||||
><h3>{{ fileRoles[r.role] }} <el-tag size="small" :type="r.required ? 'danger' : 'info'">{{ r.required ? '必填' : '选填' }}</el-tag></h3
|
||||
><p>{{ r.hint }}</p>
|
||||
<el-upload
|
||||
v-if="r.role !== 'SCAN_CLOUD'"
|
||||
@ -131,6 +131,7 @@
|
||||
}}</p>
|
||||
</section>
|
||||
</div>
|
||||
<el-alert v-if="dirty" title="比对资料版本尚未保存:当前文件选择未生效,请点击下方“保存比对资料版本”。" type="warning" :closable="false" show-icon class="gap" />
|
||||
<div class="actions"
|
||||
><el-button
|
||||
type="primary"
|
||||
@ -208,13 +209,13 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="比对与成果" name="delivery">
|
||||
<el-alert
|
||||
title="使用本任务的数模、PDF和扫描PLY进行尺寸比对,生成的STL与报告自动成套归档。扫描执行不依赖比对服务。"
|
||||
title="使用三维数模、扫描PLY和所选检测计划进行尺寸比对;二维PDF图纸选填。处理后的点云与报告自动成套归档。"
|
||||
:closable="false"
|
||||
class="gap"
|
||||
/>
|
||||
<el-descriptions title="本次选用输入" :column="1" border
|
||||
><el-descriptions-item v-for="r in inputs" :key="r.role" :label="fileRoles[r.role]">{{
|
||||
selectedName(r.key) || '尚未选用'
|
||||
selectedName(r.key) || (r.required ? '尚未选用(必填)' : '未提供(选填)')
|
||||
}}</el-descriptions-item></el-descriptions
|
||||
>
|
||||
<ComparisonPanel
|
||||
@ -224,6 +225,9 @@
|
||||
:revision="data.case.revision"
|
||||
:ready="allSelected"
|
||||
:dirty="dirty"
|
||||
:selected-inputs="selection"
|
||||
:saving-inputs="busy"
|
||||
:cloud-file-count="currentCloudFiles.length"
|
||||
:source-changed="data.stage === 'SCAN_CHANGED'"
|
||||
:active="tab === 'delivery'"
|
||||
:inputs="{
|
||||
@ -232,6 +236,9 @@
|
||||
cloudId: data.case.cloud_id
|
||||
}"
|
||||
@changed="load()"
|
||||
@open-materials="switchSection('materials')"
|
||||
@save-inputs="saveSelection"
|
||||
@archive-cloud="archiveCurrentCloud"
|
||||
/>
|
||||
<div class="actions"
|
||||
><el-button
|
||||
@ -278,7 +285,12 @@
|
||||
: '人工登记外部结果'
|
||||
}}<div class="secondary">{{ row.reason }}</div></template
|
||||
></el-table-column
|
||||
><el-table-column label="成果" min-width="190"
|
||||
><el-table-column label="归档与交付时间" min-width="230">
|
||||
<template #default="{ row }">
|
||||
<div>归档:{{ formatNullableDate(row.create_time) }}</div>
|
||||
<div class="secondary">交付:{{ formatNullableDate(row.confirmed_at) }}</div>
|
||||
</template>
|
||||
</el-table-column><el-table-column label="成果" min-width="190"
|
||||
><template #default="{ row }"
|
||||
><el-button
|
||||
link
|
||||
@ -320,7 +332,7 @@
|
||||
><p class="secondary"
|
||||
>资料、比对和交付操作记录在此;设备步骤、参数及日志继续在扫描执行记录中查看。</p
|
||||
><el-table :data="data.events"
|
||||
><el-table-column label="时间" prop="create_time" width="185" /><el-table-column
|
||||
><el-table-column label="时间" prop="create_time" width="185" :formatter="dateFormatter" /><el-table-column
|
||||
label="操作"
|
||||
min-width="180"
|
||||
><template #default="{ row }">{{
|
||||
@ -413,7 +425,7 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as Api from '@/api/lab/dimension'
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import { formatNullableDate, dateFormatter } from '@/utils/formatTime'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { onBeforeRouteLeave, onBeforeRouteUpdate } from 'vue-router'
|
||||
@ -490,12 +502,13 @@ watch(scanView, (value) => {
|
||||
if (isScanSection.value) tab.value = value === 'prepare' ? 'prepare' : 'scan'
|
||||
})
|
||||
const inputs = [
|
||||
{ role: 'MODEL', key: 'modelId', column: 'model_id', hint: 'X_T或STP,选定一个版本' },
|
||||
{ role: 'DRAWING', key: 'drawingId', column: 'drawing_id', hint: 'PDF图纸,保留原始文件' },
|
||||
{ role: 'MODEL', key: 'modelId', column: 'model_id', required: true, hint: 'X_T或STP,选定一个版本' },
|
||||
{ role: 'DRAWING', key: 'drawingId', column: 'drawing_id', required: false, hint: '选填,可不提供;PDF图纸保留原始文件' },
|
||||
{
|
||||
role: 'SCAN_CLOUD',
|
||||
key: 'cloudId',
|
||||
column: 'cloud_id',
|
||||
required: true,
|
||||
hint: '本样件成功扫描生成的PLY,自动关联并保留来源执行'
|
||||
}
|
||||
]
|
||||
@ -508,7 +521,11 @@ const unitOptions = computed(() =>
|
||||
const dirty = computed(() =>
|
||||
inputs.some((r) => String(selection[r.key] || '') !== String(data.value?.case?.[r.column] || ''))
|
||||
)
|
||||
const allSelected = computed(() => inputs.every((r) => selection[r.key]))
|
||||
const allSelected = computed(() => inputs.filter((r) => r.required).every((r) => selection[r.key]))
|
||||
const currentCloudFiles = computed(() => {
|
||||
const execution = data.value?.units?.find(unit => String(unit.id) === unitId.value)?.current_execution_id
|
||||
return (data.value?.scanFiles || []).filter(file => /\.ply$/i.test(file.file_name) && String(file.execution_id) === String(execution))
|
||||
})
|
||||
const inputFiles = computed(
|
||||
() => data.value?.files.filter((f) => !f.file_role.startsWith('RESULT_')) || []
|
||||
)
|
||||
@ -519,6 +536,8 @@ let generation = 0,
|
||||
loadedUnitId = ''
|
||||
async function load(preserve = false) {
|
||||
const current = ++generation
|
||||
const baseRevision = data.value?.case?.revision
|
||||
let linkedCloud = false
|
||||
loading.value = true
|
||||
try {
|
||||
let response = await Api.detail(taskId.value, unitId.value || 0)
|
||||
@ -531,7 +550,7 @@ async function load(preserve = false) {
|
||||
cloudNotice.value = ''
|
||||
if (
|
||||
!isScanSection.value &&
|
||||
!dirty.value &&
|
||||
(!dirty.value || (preserve && String(selection.cloudId || '') === String(data.value?.case?.cloud_id || ''))) &&
|
||||
response.task.status !== 'CANCELLED' &&
|
||||
response.task.processType === 'SCAN_ONLY' &&
|
||||
unit?.status === 'SUCCEEDED' &&
|
||||
@ -540,12 +559,12 @@ async function load(preserve = false) {
|
||||
try {
|
||||
const sync = await Api.syncScan(taskId.value, unitId.value)
|
||||
if (current !== generation) return
|
||||
if (sync.changed) response = await Api.detail(taskId.value, unitId.value)
|
||||
if (sync.changed) { response = await Api.detail(taskId.value, unitId.value); linkedCloud = true }
|
||||
if (current !== generation) return
|
||||
if (sync.status === 'MULTIPLE_PLY')
|
||||
cloudNotice.value = '本次执行生成多个PLY,请从下方扫描成果中明确选择要比对的文件'
|
||||
if (sync.status === 'NO_PLY')
|
||||
cloudNotice.value = '本次扫描未导出PLY,请检查工作流导出节点;三维数模和PDF不会阻止扫描'
|
||||
cloudNotice.value = '本次扫描未导出PLY,请检查工作流导出节点;比对资料不会阻止扫描'
|
||||
} catch (e: any) {
|
||||
if (current !== generation) return
|
||||
cloudNotice.value = 'PLY关联暂未完成:' + (e.message || '请刷新重试,不影响扫描执行')
|
||||
@ -555,7 +574,8 @@ async function load(preserve = false) {
|
||||
preserve &&
|
||||
dirty.value &&
|
||||
data.value &&
|
||||
data.value.case.revision !== response.case.revision
|
||||
data.value.case.revision !== response.case.revision &&
|
||||
!(linkedCloud && Number(response.case.revision) === Number(baseRevision ?? 0) + 1)
|
||||
) {
|
||||
preserve = false
|
||||
message.warning('选用版本已由他人更新,已刷新,请重新确认本次选择')
|
||||
@ -569,6 +589,7 @@ async function load(preserve = false) {
|
||||
return
|
||||
}
|
||||
if (!preserve) for (const r of inputs) selection[r.key] = String(response.case[r.column] || '')
|
||||
else if (linkedCloud) selection.cloudId = String(response.case.cloud_id || '')
|
||||
} finally {
|
||||
if (current === generation) loading.value = false
|
||||
}
|
||||
@ -663,6 +684,10 @@ async function archive(row: any) {
|
||||
message.success('已归档原始扫描文件,请确认选用版本')
|
||||
})
|
||||
}
|
||||
async function archiveCurrentCloud() {
|
||||
if (currentCloudFiles.value.length !== 1) { await switchSection('materials'); return }
|
||||
await archive(currentCloudFiles.value[0])
|
||||
}
|
||||
async function prepare() {
|
||||
await run(async () => {
|
||||
await Api.prepare({
|
||||
|
||||
@ -79,6 +79,8 @@
|
||||
><span class="task-state" :data-state="row.status"><i />{{ statusLabel(row.status) }}</span></template
|
||||
></el-table-column
|
||||
>
|
||||
<el-table-column label="任务创建时间" prop="createTime" width="185" :formatter="dateFormatter" />
|
||||
<el-table-column label="扫描完成时间" prop="completedAt" width="185" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" width="110" fixed="right"
|
||||
><template #default="{ row }"
|
||||
><el-button
|
||||
@ -107,6 +109,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import * as ScanApi from '@/api/lab/scan-task'
|
||||
import { statusLabel } from '@/views/lab/scan-task/scanForm.mjs'
|
||||
defineOptions({ name: 'LabExecution' })
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import { formatDisplayDateTime } from '../../../utils/dateTime.mjs'
|
||||
|
||||
export const statusText = (s: string) =>
|
||||
({
|
||||
processing: '计算中',
|
||||
@ -9,12 +11,7 @@ export const statusText = (s: string) =>
|
||||
})[s] ||
|
||||
s ||
|
||||
'—'
|
||||
export const dateText = (value: any) =>
|
||||
value == null
|
||||
? '—'
|
||||
: typeof value === 'number'
|
||||
? new Date(value).toLocaleString()
|
||||
: String(value).replace('T', ' ').slice(0, 19)
|
||||
export const dateText = (value: any) => formatDisplayDateTime(value, undefined, '—')
|
||||
export const inputName = (row: any, role: string) => {
|
||||
try {
|
||||
return JSON.parse(row.inputsJson || '{}')[role]?.name || '—'
|
||||
|
||||
@ -14,6 +14,8 @@
|
||||
<el-descriptions-item label="状态">
|
||||
<dict-tag :type="DICT_TYPE.LAB_MASTER_STATUS" :value="detail.status ?? ''" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{ formatNullableDate(detail.createTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="更新时间" :span="2">{{ formatNullableDate(detail.updateTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="安装说明" :span="3">{{ detail.installDesc || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div class="mb-8px mt-20px font-bold">适用对象</div>
|
||||
@ -27,6 +29,7 @@
|
||||
</el-table>
|
||||
<div class="mb-8px mt-20px font-bold">夹具框架点</div>
|
||||
<div class="flex items-center gap-12px"><el-tag :type="framework.current?.id ? 'success' : 'warning'">{{ framework.current?.id ? '可复用' : '未配置' }}</el-tag><el-button link type="primary" @click="frameworkRef.open(detail)">查看 / 下载 / 复制</el-button></div>
|
||||
<p v-if="framework.current?.id" class="text-13px text-[var(--el-text-color-secondary)]">框架点保存时间:{{ formatNullableDate(framework.current.updatedAt) }}</p>
|
||||
<div class="mb-8px mt-20px font-bold">扫描轨迹</div>
|
||||
<div class="flex items-center gap-12px">
|
||||
<el-tag :type="detail.trajectoryStatus === 'LINKED' ? 'success' : 'info'">{{ detail.trajectoryStatus === 'LINKED' ? '已关联 · V' + detail.trajectoryVersion : '未关联' }}</el-tag>
|
||||
@ -40,6 +43,7 @@
|
||||
<FixtureFramework ref="frameworkRef" @updated="load" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
import * as FixtureApi from '@/api/lab/master/fixture'
|
||||
import MasterAttachmentPanel from '../components/MasterAttachmentPanel.vue'
|
||||
|
||||
@ -47,6 +47,7 @@
|
||||
<dict-tag :type="DICT_TYPE.LAB_MASTER_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="夹具更新时间" prop="updateTime" width="185" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" align="center" width="390" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="goDetail(scope.row.id)">详情</el-button>
|
||||
@ -73,6 +74,7 @@
|
||||
<FixtureTrajectory ref="trajectoryRef" @updated="getList" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
||||
import * as FixtureApi from '@/api/lab/master/fixture'
|
||||
import FixtureForm from './FixtureForm.vue'
|
||||
|
||||
@ -45,6 +45,7 @@
|
||||
<dict-tag :type="DICT_TYPE.LAB_MASTER_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" prop="updateTime" width="185" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" align="center" width="180" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" v-hasPermi="['lab:material:update']" @click="openForm('update', scope.row.id)">编辑</el-button>
|
||||
@ -66,6 +67,7 @@
|
||||
<MaterialForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
||||
import * as MaterialApi from '@/api/lab/master/material'
|
||||
import MaterialForm from './MaterialForm.vue'
|
||||
|
||||
@ -21,6 +21,8 @@
|
||||
}}</el-tag></template
|
||||
></el-table-column
|
||||
>
|
||||
<el-table-column label="占用开始时间" prop="create_time" width="185" :formatter="dateFormatter" />
|
||||
<el-table-column label="状态更新时间" prop="update_time" width="185" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" width="170"
|
||||
><template #default="{ row }">
|
||||
<el-button
|
||||
@ -45,6 +47,7 @@
|
||||
</ContentWrap>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import * as ScanApi from '@/api/lab/scan-task'
|
||||
const router = useRouter()
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
</section>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import { agvTargets, agvState, agvMap } from '@/api/lab/scan-task/agvView'
|
||||
import { finitePoint, assignmentRobots, mapCorners, viewTransform, navigationTargets, mergeAgvPoints } from './agvMap.mjs'
|
||||
import { agvPollingPolicy } from './workbenchPolling.mjs'
|
||||
@ -30,7 +31,7 @@ const targets=ref<any[]>([]), selected=ref(''),data=ref<any>({}),map=shallowRef<
|
||||
const surface=ref<HTMLElement>(),canvas=ref<HTMLCanvasElement>(),state=computed(()=>data.value.state),targetKey=(t:any)=>`${t.robotId}\n${t.deviceId}`,target=computed(()=>targets.value.find(t=>targetKey(t)===selected.value))
|
||||
const history=computed(()=>data.value.history || !!props.executionId && ['SUCCEEDED','FAILED','CANCELLED'].includes(props.status || ''))
|
||||
const healthy=computed(()=>!history.value && !error.value && !data.value.message && state.value?.connected && state.value?.localized && Date.now()-(state.value?.receivedAt || 0)<8000)
|
||||
const pose=computed(()=>finitePoint(state.value?.pose)?state.value.pose:undefined),updatedAt=computed(()=>state.value?.receivedAt?new Date(state.value.receivedAt).toLocaleTimeString():''),plan=computed(()=>navigationTargets(props.flowData,map.value?.stations || [],props.assignments,target.value))
|
||||
const pose=computed(()=>finitePoint(state.value?.pose)?state.value.pose:undefined),updatedAt=computed(()=>state.value?.receivedAt?formatNullableDate(state.value.receivedAt):''),plan=computed(()=>navigationTargets(props.flowData,map.value?.stations || [],props.assignments,target.value))
|
||||
let generation=0,controller:AbortController|undefined,timer:any,observer:ResizeObserver|undefined,image:HTMLImageElement|undefined,frame=0,pan:any,view:any,manual=false,lastMapAt=0,suspended=false,nextPollAt=0,failures=0,snapshotRead=false,targetsLoaded=false,targetsLoading=false
|
||||
const polling=computed(()=>agvPollingPolicy(props.executionId,props.status))
|
||||
const robotIds=computed(()=>assignmentRobots(props.assignments).join(',')),scopeKey=computed(()=>String(props.executionId || '')+'|'+robotIds.value)
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
>方法号 / 扫描方案 ID:<code>{{ identity.testCaseId || '-' }}</code></div
|
||||
>
|
||||
<p class="case-reference">执行编号:{{ execution?.executionNo || '尚未开始' }}</p>
|
||||
<p class="case-reference">记录创建时间:{{ formatNullableDate(execution?.createTime) }}</p>
|
||||
<p v-if="execution?.executionType === 'SUPPLEMENT'" class="case-reference"
|
||||
>补扫来源:{{
|
||||
execution.runParams?.supplementSourceExecutionNo || execution.parentExecutionId
|
||||
@ -38,6 +39,10 @@
|
||||
>
|
||||
</div>
|
||||
</header>
|
||||
<p v-if="execution?.id" class="execution-times monitor-caption">
|
||||
<span>开始时间:{{ formatNullableDate(execution.startedAt) }}</span>
|
||||
<span>结束时间:{{ formatNullableDate(execution.finishedAt) }}</span>
|
||||
</p>
|
||||
<section v-if="caseSteps.length" class="case-progress" aria-label="组合执行进度">
|
||||
<div class="case-progress-header"><strong>{{ binding?.executionPlan?.name }} · 已完成 {{ caseSteps.filter(s => s.state === 'SUCCEEDED').length }} / {{ caseSteps.length }} 个扫描方案</strong><el-switch v-model="followCurrent" active-text="跟随当前步骤" /></div>
|
||||
<el-progress :percentage="overallPercent" :status="progressStatus" :stroke-width="7" />
|
||||
@ -118,6 +123,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import * as ScanApi from '@/api/lab/scan-task'
|
||||
import type { LabExecutionVO } from '@/api/lab/execution'
|
||||
import { getInst } from '@/cmvr/common/api/test/log'
|
||||
@ -307,6 +313,7 @@ onBeforeUnmount(() => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.execution-times { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 12px; }
|
||||
.case-progress { padding:14px; background:var(--el-fill-color-light); border-radius:8px; margin-bottom:16px; }
|
||||
.case-progress-header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
|
||||
.case-step-list { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0; }
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import { streamScannerExecution, getScannerExecutionView, type ScannerExecutionView } from '@/api/lab/scan-task/scannerView'
|
||||
import { acceptsScannerFrame, isLiveScannerExecution, scannerViewCaption } from './scannerView.mjs'
|
||||
import { createScannerFramePump } from './scannerFramePump.mjs'
|
||||
@ -80,7 +81,7 @@ function startStream(id: string | number, token: number, signal: AbortSignal) {
|
||||
if (!acceptsScannerFrame({ generation: token, executionId: id }, current()) || source.signal.aborted) { URL.revokeObjectURL(url); return }
|
||||
const previous = imageUrl.value; imageUrl.value = url
|
||||
if (previous) URL.revokeObjectURL(previous)
|
||||
receivedAt.value = new Date().toLocaleTimeString('zh-CN', { hour12: false })
|
||||
receivedAt.value = formatNullableDate(new Date())
|
||||
loading.value = false; error.value = ''
|
||||
const now = performance.now(); if (!fpsStarted) fpsStarted = now
|
||||
frames++
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<el-button link type="primary" :loading="downloading" @click="download">下载文件</el-button>
|
||||
<el-popover v-if="selected" trigger="click" :width="360" placement="bottom-start">
|
||||
<template #reference><el-button text size="small">文件信息</el-button></template>
|
||||
<div class="model-hint file-info">{{ selected.name }}<br />工程:{{ selected.projectId || '-' }}<template v-if="selected.capturedAt"><br />生成时间:{{ new Date(selected.capturedAt).toLocaleString('zh-CN', { hour12: false }) }}</template></div>
|
||||
<div class="model-hint file-info">{{ selected.name }}<br />工程:{{ selected.projectId || '-' }}<template v-if="selected.capturedAt"><br />生成时间:{{ formatNullableDate(selected.capturedAt) }}</template></div>
|
||||
</el-popover>
|
||||
</div>
|
||||
<div class="model-actions">
|
||||
@ -32,6 +32,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { formatNullableDate } from '@/utils/formatTime'
|
||||
import { saveAs } from 'file-saver'
|
||||
import { generateUUID } from '@/utils'
|
||||
import { createScannerSnapshot, getScannerAssets, getScannerAsset, getScannerExecutionView, getScannerSnapshotCommand, type ScannerAsset, type ScannerSnapshotCommand, type ScannerExecutionView } from '@/api/lab/scan-task/scannerView'
|
||||
|
||||
@ -313,13 +313,22 @@
|
||||
</template>
|
||||
<el-form-item v-if="caseChanged && executionMode === 'plan'" label="更换原因" required><el-input v-model="form.changeReason" placeholder="说明本次选择执行方案的原因" /></el-form-item>
|
||||
</el-form>
|
||||
<el-alert
|
||||
v-if="!form.versionId"
|
||||
type="warning"
|
||||
:closable="false"
|
||||
title="请选择已发布版本后再进行准备与执行。"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<section class="preparation-resources" aria-label="本任务机器人、设备与地图">
|
||||
<h3>本任务机器人与设备</h3>
|
||||
<template v-if="locked">
|
||||
<div v-if="locked" class="resource-snapshots">
|
||||
<div
|
||||
v-for="assignment in form.runtimeAssignments"
|
||||
v-for="(assignment, index) in form.runtimeAssignments"
|
||||
:key="assignment.roleKey"
|
||||
class="resource-snapshot"
|
||||
><strong>{{ assignment.roleKey }}</strong
|
||||
><strong :title="assignment.roleKey">{{ roles.find(role => role.roleKey === assignment.roleKey)?.displayName || `执行角色 ${index + 1}` }}</strong
|
||||
><div v-for="member in assignment.members" :key="member.memberKey"
|
||||
>机器人:{{ member.robotId || '-'
|
||||
}}<div v-for="(device, slot) in member.devices" :key="slot"
|
||||
@ -332,7 +341,7 @@
|
||||
:image-size="42"
|
||||
description="此任务没有分配机器人"
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
<RuntimeAssignmentsEditor
|
||||
v-else-if="!versionLoading"
|
||||
:key="`${form.testCaseId}:${form.versionId}:${resourceRevision}`"
|
||||
@ -342,14 +351,7 @@
|
||||
@update:model-value="resourcesChanged"
|
||||
/>
|
||||
<AgvLiveMap :assignments="form.runtimeAssignments" :flow-data="detail.flowData" :active="props.active && activeTab === 'prepare'" hide-empty />
|
||||
<el-alert
|
||||
v-if="!form.versionId"
|
||||
type="warning"
|
||||
:closable="false"
|
||||
title="请选择已发布版本后再进行准备与执行。"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<ResourceSchedule
|
||||
:model-value="schedule"
|
||||
@update:model-value="Object.assign(schedule, $event)"
|
||||
@ -516,7 +518,9 @@
|
||||
><template #default="{ row: attempt }">{{
|
||||
statusLabel(attempt.status)
|
||||
}}</template></el-table-column
|
||||
><el-table-column
|
||||
><el-table-column label="开始时间" prop="startedAt" min-width="185" :formatter="dateFormatter" />
|
||||
<el-table-column label="结束时间" prop="finishedAt" min-width="185" :formatter="dateFormatter" />
|
||||
<el-table-column
|
||||
label="失败原因"
|
||||
prop="failureReason"
|
||||
min-width="180"
|
||||
@ -663,6 +667,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import { generateUUID } from '@/utils'
|
||||
import { scannerTaskParameters, validateScannerParameters, SCANNER_PARAMETER_RUN_KEY } from '@/cmvr/common/utils/scannerParameters.mjs'
|
||||
@ -1403,6 +1408,9 @@ onUnmounted(() => {
|
||||
.scan-task-embedded :deep(.el-card__body) { overflow: visible; }
|
||||
.preparation-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
|
||||
.preparation-column { min-width: 0; }
|
||||
.preparation-resources { margin-top: 18px; padding-top: 2px; border-top: 1px solid var(--el-border-color-lighter); }
|
||||
.resource-snapshots { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
|
||||
.resource-snapshots .resource-snapshot { margin-bottom: 0; min-width: 0; overflow-wrap: anywhere; }
|
||||
.scan-preparation :deep(.el-row) { margin-left: 0 !important; margin-right: 0 !important; }
|
||||
@media (max-width: 991px) { .preparation-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
|
||||
.scan-task-embedded .task-summary { width: 100%; margin: 0; }
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import { formatDisplayDateTime } from '../../../utils/dateTime.mjs'
|
||||
|
||||
const object = (value) => {
|
||||
if (value && typeof value === 'object' && !Array.isArray(value)) return value
|
||||
try {
|
||||
@ -21,9 +23,7 @@ export function logStatus(value) {
|
||||
const timestamp = (value) =>
|
||||
new Date(typeof value === 'string' && /^\d{10,16}$/.test(value) ? Number(value) : value).getTime()
|
||||
export function logTime(value) {
|
||||
if (value == null || value === '') return '—'
|
||||
const date = new Date(timestamp(value))
|
||||
return Number.isFinite(date.getTime()) ? date.toLocaleString('zh-CN', { hour12: false }) : '—'
|
||||
return formatDisplayDateTime(value, undefined, '—')
|
||||
}
|
||||
export function logDuration(start, end) {
|
||||
if (start == null || end == null || start === '' || end === '') return '—'
|
||||
|
||||
@ -125,6 +125,8 @@
|
||||
<el-descriptions-item label="来源批次">{{ detail.sourceBatchNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="计划完成">{{ formatDate(detail.plannedFinishAt) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{ formatDate(detail.createTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="更新时间">{{ formatDate(detail.updateTime) || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="扫描完成时间">{{ formatDate(detail.completedAt) || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="试验要求" :span="3">{{ detail.requirement }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="3">{{ detail.remark || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item v-if="detail.cancelReason" label="取消原因" :span="3">{{ detail.cancelReason }}</el-descriptions-item>
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
<el-descriptions-item label="警告">{{ batch.warningRows }}</el-descriptions-item>
|
||||
<el-descriptions-item label="错误">{{ batch.errorRows }}</el-descriptions-item>
|
||||
<el-descriptions-item label="重复">{{ batch.duplicateRows }}</el-descriptions-item>
|
||||
<el-descriptions-item label="上传时间">{{ formatDate(batch.createTime) || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="提交时间">{{
|
||||
batch.committedAt ? formatDate(batch.committedAt) : '-'
|
||||
}}</el-descriptions-item>
|
||||
|
||||
@ -124,6 +124,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上传时间" prop="createTime" width="180" :formatter="dateFormatter" />
|
||||
<el-table-column label="导入提交时间" prop="committedAt" width="185" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" width="170" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="goBatch(scope.row.id)">详情</el-button>
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
width="180"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
<span>{{ formatNullableDate(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right">
|
||||
@ -40,7 +40,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import WxVideoPlayer from '@/views/mp/components/wx-video-play'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { dateFormatter, formatNullableDate } from '@/utils/formatTime'
|
||||
|
||||
const props = defineProps<{
|
||||
list: any[]
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
width="180"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
<span>{{ formatNullableDate(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import WxVoicePlayer from '@/views/mp/components/wx-voice-play'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { dateFormatter, formatNullableDate } from '@/utils/formatTime'
|
||||
|
||||
const props = defineProps<{
|
||||
list: any[]
|
||||
|
||||
53
deploy/windows11/RELEASE-20261113-comparison-time.md
Normal file
53
deploy/windows11/RELEASE-20261113-comparison-time.md
Normal file
@ -0,0 +1,53 @@
|
||||
# 2026-11-13 尺寸比对与时间显示更新
|
||||
|
||||
本批代码基于 `0363103f3bd4bf26d61135146d8a7e1de9caf86d`,经用户本次“发布到正式环境”授权提交推送。正式电脑仍由其 AI 通过原更新脚本部署;开发电脑不操作正式服务或现场设备。
|
||||
|
||||
## 更新内容
|
||||
|
||||
- 扫描准备中的机器人、设备与地图独立排列,避免右侧地图把左侧表单撑出大块空白。
|
||||
- 尺寸比对的二维 PDF 图纸选填;三维数模、扫描 PLY 与明确选择的已启用检测计划必填。前后端校验一致。
|
||||
- 开始比对前集中列出阻止原因,并提供保存资料版本、归档扫描 PLY、选择资料和检测计划等对应操作。任务状态入口可直接查看待办。
|
||||
- 扫描 PLY 自动关联兼容尚未保存的数模、图纸选择;外部修改引起版本冲突时仍重新核对,不覆盖用户明确选择的 PLY。
|
||||
- 单位、阈值、自动生成报告与点云处理选项全部直接展示,不使用折叠。新比对默认扫描单位、数模单位均为毫米,表面偏差阈值为 **1 mm**,前后端一致,仍可修改。
|
||||
- 机器人、设备、日志、文件、流程版本和操作追溯等日期时间统一显示为 `yyyy-MM-dd HH:mm:ss`,兼容秒、毫秒、数字字符串和带时区日期;空值不显示为时间戳或 Invalid Date。
|
||||
- 在任务、执行及补扫历史、夹具、物料、扫描方案、地图、资源占用、批量导入与成果列表补充已有的创建、更新、开始、结束、归档和交付时间。
|
||||
- 当前计算 EXE 尚未提供取消计算接口。页面明确说明关闭工作区、离开页面不会停止计算,不提供虚假的取消操作。
|
||||
|
||||
## 升级要求
|
||||
|
||||
本批无新依赖、无新增配置、无新增表结构或数据迁移。沿用原 `standalone` 环境、检测 EXE 和边端程序。
|
||||
|
||||
保留正式电脑 `.local/standalone/application-private.yaml`、中间件连接、设备地址、Bearer、QUIC 设置及证书。开发环境的设备隔离配置不复制到正式环境。不重新导入全量数据,不执行 Init、Restore 或 Bootstrap。
|
||||
|
||||
默认阈值用于新提交;不改写已有扫描、比对作业、检测计划或成果版本的历史快照。
|
||||
|
||||
## 正式 AI 执行
|
||||
|
||||
1. 在原仓库根目录使用 PowerShell 7,先执行:
|
||||
|
||||
```powershell
|
||||
pwsh -NoProfile -File deploy/windows11/update.ps1 -CheckOnly
|
||||
```
|
||||
|
||||
2. 用户确认现场采集、标定与运动均停止,活动执行正常结束并释放资源后,执行:
|
||||
|
||||
```powershell
|
||||
pwsh -NoProfile -File deploy/windows11/update.ps1 -ConfirmStopped
|
||||
pwsh -NoProfile -File deploy/windows11/manage.ps1 -Action Status
|
||||
```
|
||||
|
||||
3. 核对 `.local/standalone/deployment.json` 与 `.local/standalone/deployed-commit.txt` 的提交号等于开发端本次通知的完整提交号。脚本会拉取执行时 main 的最新版本;若出现本次通知以外的新提交,先核对发布范围。
|
||||
|
||||
4. 验收登录与刷新;检查扫描准备布局、开始比对待办、PDF 选填、检测计划必填、默认毫米与 1.000 mm、全部展开的设置,以及已有任务/夹具/文件/操作记录的时间显示。只读验收不自动开始计算或设备动作。
|
||||
|
||||
5. 报告实际部署提交号、前后端与代理健康检查、私有连接配置和历史数据保留情况。仅推送或构建成功不代表正式部署成功。
|
||||
|
||||
## 开发验证
|
||||
|
||||
- 尺寸比对界面前一轮 34 项前后端检查通过,覆盖 PDF 选填、检测计划必填、资料保存与 PLY 关联。
|
||||
- 时间显示及新增时间字段 51 项回归检查通过,42 个修改页面编译通过;实际页面核对机器人、设备、任务、初次扫描、补扫、文件历史和夹具时间。
|
||||
- 最新后端完整打包及原有 14 项 DimensionServiceTest 通过;编译后的参数对象确认默认阈值 1.0,显式自定义值仍保留。
|
||||
- 最终前端 standalone 完整构建通过;页面确认三个基本设置直接可见、阈值 1.000 mm、全部比对选项不再折叠。
|
||||
- 更新脚本及公共启动/健康检查流程已复核,三个相关 PowerShell 脚本语法检查通过。本批未在正式电脑执行更新,也未运行真实扫描、运动或计算。
|
||||
|
||||
完整发布与故障处理约定参见 [PRODUCTION-RELEASE.md](PRODUCTION-RELEASE.md)。
|
||||
Loading…
Reference in New Issue
Block a user