提交 4b6b0b75 authored 作者: caodi\cd's avatar caodi\cd

fix:优化交互

上级 e668fcc7
......@@ -66,7 +66,10 @@
:key="cardIndex"
@click="toShaftInspection(card.name, card.jfType, card.value)"
>
<view class="card">
<view
class="card"
:class="{ status1: card.status == 1, status2: card.status == 2 }"
>
<view class="card-content">
<view class="first-row">
<image
......@@ -80,17 +83,43 @@
</view>
</view>
<view class="spacer-image right" v-if="cardIndex < row.length - 1">
<!-- <image src="@/static/img/arr2.svg" mode="aspectFit"></image> -->
<image
v-if="inspectionNumber == 11"
class="img"
src="@/static/img/arr2.svg"
mode="aspectFit"
></image>
<image
v-else
class="img"
src="@/static/img/arr1.svg"
mode="aspectFit"
></image>
</view>
<view class="spacer-image bottom" v-if="rowIndex < rows.length - 1">
<view v-if="cardIndex == 0 || cardIndex == 4">
<!-- <image src="@/static/img/arr2.svg" mode="aspectFit"></image> -->
<view
v-if="
(rowIndex == 1 && cardIndex == 0) ||
(rowIndex == 0 && cardIndex == 4)
"
>
<image
v-if="inspectionNumber == 11"
class="img"
src="@/static/img/arr2.svg"
mode="aspectFit"
></image>
<image
v-else
class="img"
src="@/static/img/arr1.svg"
mode="aspectFit"
></image>
</view>
</view>
</view>
</view>
</view></view
>
</view> </view
></view>
<view v-else class="card-box detail">
<view
class="card-row"
......@@ -529,20 +558,6 @@ export default {
align-items: center;
position: relative;
width: 100%;
&.right {
.card-wrapper {
.spacer-image.right {
position: absolute;
left: -43.2px;
top: 50%;
transform: translateY(-50%) rotate(180deg);
image {
width: 43.2px;
height: 43.2px;
}
}
}
}
.card-wrapper {
width: calc((100% - 4 * 43.2px) / 5); /* 严格五等分宽度 */
.card {
......@@ -552,6 +567,18 @@ export default {
background-color: rgba(242, 242, 242, 0.6);
box-shadow: 0 1.6px 3.2px rgba(0, 0, 0, 0.1);
position: relative;
&.status1 {
background: #f3f7ff;
.status {
color: #3774f6;
}
}
&.status2 {
background: #fff5f4;
.status {
color: #f55a42;
}
}
.card-content {
padding: 6.4px;
.first-row {
......@@ -582,20 +609,38 @@ export default {
right: -43.2px;
top: 50%;
transform: translateY(-50%);
image {
width: 43.2px;
height: 43.2px;
.img {
width: 30.4px;
height: 6.4px;
margin: 0 6.4px;
}
}
}
.spacer-image.bottom {
position: absolute;
bottom: -43.2px;
bottom: -33.6px;
left: 50%;
transform: translateX(-50%);
image {
width: 43.2px;
height: 43.2px;
transform: translateX(-50%) rotate(90deg);
.img {
width: 30.4px;
height: 6.4px;
margin: 6.4px 0;
}
}
&.right {
.card-wrapper {
.spacer-image.right {
position: absolute;
left: -43.2px;
top: 50%;
transform: translateY(-50%) rotate(180deg);
.img {
width: 30.4px;
height: 6.4px;
margin: 0 6.4px;
}
}
}
}
}
......
......@@ -417,21 +417,24 @@ export default {
}, 0);
},
// 判断数据是否有异常
checkInspectionResult(obj) {
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
const arr = obj[key];
for (let i = 0; i < arr.length; i++) {
if (
arr[i].hasOwnProperty("inspectionResult") &&
arr[i].inspectionResult === 0
) {
return true; // 存在异常
checkInspectionResult(data) {
// 遍历每个检查项类别(如 wlhj, afxt 等)
for (const category in data) {
const categoryData = data[category];
// 检查该类别下的 detail 数组
if (categoryData.detail && Array.isArray(categoryData.detail)) {
for (const item of categoryData.detail) {
// 如果发现任意一个 inspectionResult 为 1,立即返回 true(异常)
if (item.inspectionResult === 1) {
return true;
}
}
}
}
return false; // 不存在异常
// 所有 inspectionResult 都为 0,返回 false(正常)
return false;
},
// 提交
submit(isSubmit = 1) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论