6/9
This commit is contained in:
@@ -213,6 +213,7 @@ function preview(index) {
|
||||
}
|
||||
.image-list > .image-item:not(:last-child) {
|
||||
margin-right: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.image-item {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref, computed, watch } from 'vue'
|
||||
|
||||
// 标签项类型
|
||||
interface TabItem {
|
||||
@@ -68,9 +68,23 @@ const tabs = computed<TabItem[]>(() => {
|
||||
})
|
||||
|
||||
// ======================
|
||||
// 当前激活值(响应式)
|
||||
// 当前激活值(响应式 + 可同步父组件更新)
|
||||
// ======================
|
||||
const currentActiveValue = ref<string | number>(props.activeValue ?? tabs.value[0]?.value ?? '')
|
||||
const currentActiveValue = ref<string | number>('')
|
||||
|
||||
// 初始化 + 父组件传值变化时自动同步(核心修复)
|
||||
watch(
|
||||
() => props.activeValue,
|
||||
newVal => {
|
||||
if (newVal !== null && newVal !== undefined) {
|
||||
currentActiveValue.value = newVal
|
||||
} else {
|
||||
// 没有传默认值 → 选中第一个
|
||||
currentActiveValue.value = tabs.value[0]?.value
|
||||
}
|
||||
},
|
||||
{ immediate: true } // 一进页面就执行
|
||||
)
|
||||
|
||||
// 事件
|
||||
const emit = defineEmits<{
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<view class="page_padding">
|
||||
<view class="flex-1 flex-col flex inspection_main_box">
|
||||
<view class="info_box">
|
||||
<view class="title_box flex items-center justify-between">
|
||||
<view class="title flex items-center">
|
||||
<view class="line"> </view>
|
||||
<view class="title_box flex flex-between">
|
||||
<view class="title flex">
|
||||
<text class="line"></text>
|
||||
<text>{{ info.villageName }} - {{ info.taskName }}</text>
|
||||
</view>
|
||||
<view class="inspection_status"> <text>已巡检</text> </view>
|
||||
<view class="inspection_status" style="flex: 100rpx"> <text>已巡检</text> </view>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="item">
|
||||
@@ -180,7 +180,6 @@ onLoad(options => {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
min-height: 40rpx;
|
||||
text-wrap: wrap;
|
||||
line-height: 40rpx;
|
||||
.line {
|
||||
display: block;
|
||||
@@ -190,12 +189,11 @@ onLoad(options => {
|
||||
}
|
||||
}
|
||||
.inspection_status {
|
||||
width: 100rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
line-height: 36rpx;
|
||||
|
||||
text-align: center;
|
||||
&.todo {
|
||||
color: #4d5dfa;
|
||||
}
|
||||
|
||||
@@ -155,6 +155,11 @@ function handleChangeTime(event: string) {
|
||||
}
|
||||
|
||||
function handleTap(ite) {
|
||||
const today = parseTime(new Date(), '{m}月{d}日')
|
||||
if (today !== showDate.value) {
|
||||
return
|
||||
}
|
||||
|
||||
if (isComputed(ite.taskStatus)) {
|
||||
uni.navigateTo({
|
||||
url: '/pageSubPack/inspection/inspection_main?id=' + ite.id
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<view class="info_body" v-for="(ite, ind) in item.points" :key="ind">
|
||||
<view class="info_title" style="margin-bottom: 20rpx"> {{ ite.ponitName }} </view>
|
||||
<uni-forms :modelValue="ite" :rules="rules" label-position="left" label-width="150">
|
||||
<uni-forms-item label="巡检状态" required>
|
||||
<uni-forms-item label="巡检状态" :required="!ite.complated">
|
||||
<uni-data-checkbox
|
||||
:disabled="ite.complated"
|
||||
v-model="ite.status"
|
||||
@@ -68,7 +68,7 @@
|
||||
</view>
|
||||
<view class="items_picker_box">
|
||||
<view class="label">
|
||||
<text class="is-required">*</text>
|
||||
<text class="is-required" v-if="!ite.complated">*</text>
|
||||
<text>巡检照片</text>
|
||||
</view>
|
||||
<view class="filePickerbox" v-if="!ite.complated">
|
||||
|
||||
@@ -153,7 +153,6 @@ function init() {
|
||||
|
||||
onLoad(options => {
|
||||
activeValue.value = Number(options.type)
|
||||
console.log(activeValue.value)
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
<uni-forms-item label="房屋号">
|
||||
<view @tap="handleClick" style="width: 100%">
|
||||
<uni-easyinput
|
||||
class="easy-ellipsis-1"
|
||||
:inputBorder="false"
|
||||
disabled
|
||||
v-model="houseName"
|
||||
@@ -84,6 +85,7 @@ function handleClick() {
|
||||
/** 处理 扫码 */
|
||||
function handleScan() {
|
||||
uni.scanCode({
|
||||
scanType: ['barCode', 'qrCode', 'datamatrix', 'pdf417'],
|
||||
success: function (res) {
|
||||
formData.value.deviceCode = res.result
|
||||
},
|
||||
@@ -133,7 +135,7 @@ function handleSubmit() {
|
||||
<style lang="scss" scoped>
|
||||
.addreplacement_box {
|
||||
background: #ffffff;
|
||||
|
||||
padding-top: 0;
|
||||
&:deep(.uni-forms-item) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -166,4 +168,9 @@ function handleSubmit() {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
.easy-ellipsis-1:deep(.uni-easyinput__content-input) {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -35,13 +35,10 @@
|
||||
active: checkoutHouseid === item.houseId
|
||||
}"
|
||||
>
|
||||
<view class="flex items-center flex-1">
|
||||
<!-- checkout -->
|
||||
<view class="housepath flex items-center flex-1">
|
||||
<radio color="#4d5dfa" :value="item.houseId" />
|
||||
<!-- housename -->
|
||||
<text class="address">{{ item.addressCn ?? item.addressHyphen }}</text>
|
||||
</view>
|
||||
<!-- username -->
|
||||
<view class="username">{{ item.residentName }}</view>
|
||||
</view>
|
||||
</label>
|
||||
@@ -221,12 +218,22 @@ function handleSelecthouse() {
|
||||
&:deep(radio) {
|
||||
transform: scale(0.68);
|
||||
}
|
||||
.housepath {
|
||||
overflow: hidden;
|
||||
}
|
||||
.address {
|
||||
margin-left: 20rpx;
|
||||
font-weight: 550;
|
||||
font-size: 32rpx;
|
||||
color: #222222;
|
||||
line-height: 40rpx;
|
||||
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2; /* 控制行数,2行就写2 */
|
||||
-webkit-box-orient: vertical;
|
||||
word-break: break-all; /* 自动换行 */
|
||||
}
|
||||
|
||||
.username {
|
||||
@@ -236,6 +243,7 @@ function handleSelecthouse() {
|
||||
line-height: 40rpx;
|
||||
width: 180rpx;
|
||||
text-align: left;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
&.active {
|
||||
background: #f5faff;
|
||||
|
||||
@@ -364,6 +364,8 @@ function handleRepairCompluted() {
|
||||
margin-bottom: 30rpx;
|
||||
.label {
|
||||
margin-bottom: 32rpx;
|
||||
white-space: nowrap;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.value {
|
||||
height: 162rpx;
|
||||
@@ -401,6 +403,8 @@ function handleRepairCompluted() {
|
||||
color: #222222;
|
||||
line-height: 36rpx;
|
||||
width: 35%;
|
||||
white-space: nowrap;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
@@ -409,6 +413,7 @@ function handleRepairCompluted() {
|
||||
color: #666666;
|
||||
line-height: 36rpx;
|
||||
text-wrap: wrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user