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

fix:优化交互

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