chore: release updated anxinyan version
This commit is contained in:
@@ -56,6 +56,7 @@ const drawerVisible = ref(false);
|
||||
const inspectionDrawerVisible = ref(false);
|
||||
const inspectionSubmitting = ref(false);
|
||||
const publishingId = ref<number | null>(null);
|
||||
const traceVisibilitySavingId = ref<number | null>(null);
|
||||
const detailQrDataUrl = ref("");
|
||||
|
||||
const keyword = ref("");
|
||||
@@ -279,6 +280,7 @@ type PublishReportTarget = Pick<AdminReportListItem, "id" | "report_status" | "r
|
||||
report_type: string;
|
||||
material_tag_bound: boolean;
|
||||
};
|
||||
type ReportTraceVisibilityTarget = Pick<AdminReportListItem, "id" | "trace_info_visible">;
|
||||
|
||||
async function promptReportMaterialTagInput() {
|
||||
try {
|
||||
@@ -344,6 +346,46 @@ async function publishReport(row: PublishReportTarget) {
|
||||
}
|
||||
}
|
||||
|
||||
function switchValueToBoolean(value: unknown) {
|
||||
if (typeof value === "boolean") return value;
|
||||
if (typeof value === "number") return value === 1;
|
||||
return ["1", "true", "yes", "on"].includes(String(value).trim().toLowerCase());
|
||||
}
|
||||
|
||||
async function updateReportTraceVisibility(row: ReportTraceVisibilityTarget, value: unknown) {
|
||||
const visible = switchValueToBoolean(value);
|
||||
traceVisibilitySavingId.value = row.id;
|
||||
try {
|
||||
const response = await adminApi.updateReportTraceVisibility(row.id, visible);
|
||||
if (response.code !== 0) {
|
||||
ElMessage.error(response.message || "追溯信息开关保存失败");
|
||||
return;
|
||||
}
|
||||
|
||||
const appliedVisible = Boolean(response.data.trace_info_visible);
|
||||
row.trace_info_visible = appliedVisible;
|
||||
|
||||
const listItem = reports.value.find((item) => item.id === row.id);
|
||||
if (listItem) {
|
||||
listItem.trace_info_visible = appliedVisible;
|
||||
}
|
||||
if (detail.value?.report_header.id === row.id) {
|
||||
detail.value.report_header.trace_info_visible = appliedVisible;
|
||||
}
|
||||
|
||||
ElMessage.success(response.message || (appliedVisible ? "追溯信息已设为显示" : "追溯信息已隐藏"));
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
ElMessage.error("追溯信息开关保存失败");
|
||||
} finally {
|
||||
traceVisibilitySavingId.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
function handleTraceVisibilityChange(row: ReportTraceVisibilityTarget, value: unknown) {
|
||||
void updateReportTraceVisibility(row, value);
|
||||
}
|
||||
|
||||
function validateInspectionForm() {
|
||||
const { report_header, product_info, result_info } = inspectionForm.value;
|
||||
if (!report_header.report_title.trim()) {
|
||||
@@ -466,6 +508,18 @@ watch(
|
||||
<span v-else class="detail-label">不适用</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="追溯信息" min-width="130">
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
:model-value="row.trace_info_visible"
|
||||
:loading="traceVisibilitySavingId === row.id"
|
||||
inline-prompt
|
||||
active-text="显示"
|
||||
inactive-text="隐藏"
|
||||
@change="handleTraceVisibilityChange(row, $event)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="institution_name" label="出具机构" min-width="160" />
|
||||
<el-table-column prop="publish_time" label="发布时间" min-width="170" />
|
||||
<el-table-column label="操作" fixed="right" width="220">
|
||||
@@ -538,6 +592,20 @@ watch(
|
||||
<div class="detail-label">出具机构</div>
|
||||
<div class="detail-value">{{ detail.report_header.institution_name }}</div>
|
||||
</div>
|
||||
<div class="detail-card__desc">
|
||||
<div class="detail-label">追溯信息</div>
|
||||
<div class="detail-value report-visibility-control">
|
||||
<el-switch
|
||||
:model-value="detail.report_header.trace_info_visible"
|
||||
:loading="traceVisibilitySavingId === detail.report_header.id"
|
||||
inline-prompt
|
||||
active-text="显示"
|
||||
inactive-text="隐藏"
|
||||
@change="handleTraceVisibilityChange(detail.report_header, $event)"
|
||||
/>
|
||||
<span>{{ detail.report_header.trace_info_visible ? "用户端显示追溯信息 tab" : "用户端隐藏追溯信息 tab" }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-card">
|
||||
@@ -599,7 +667,7 @@ watch(
|
||||
<template v-if="detail.result_info.key_points?.length">
|
||||
<div v-for="(item, index) in detail.result_info.key_points" :key="`${item.point_code || item.point_name}-${index}`" class="detail-card__desc">
|
||||
<div class="detail-label">{{ item.point_name || "鉴定项" }}</div>
|
||||
<div class="detail-value">{{ [item.point_value, item.point_remark].filter(Boolean).join(";") || "-" }}</div>
|
||||
<div class="detail-value">{{ item.point_value || "-" }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<div v-if="detail.result_info.external_remark" class="detail-card__desc">
|
||||
@@ -987,4 +1055,17 @@ watch(
|
||||
.report-evidence-card__body {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.report-visibility-control {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.report-visibility-control span {
|
||||
color: var(--admin-text-subtle);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user