6/9
This commit is contained in:
@@ -213,6 +213,7 @@ function preview(index) {
|
|||||||
}
|
}
|
||||||
.image-list > .image-item:not(:last-child) {
|
.image-list > .image-item:not(:last-child) {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-item {
|
.image-item {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed, watch } from 'vue'
|
||||||
|
|
||||||
// 标签项类型
|
// 标签项类型
|
||||||
interface TabItem {
|
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<{
|
const emit = defineEmits<{
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
<view class="page_padding">
|
<view class="page_padding">
|
||||||
<view class="flex-1 flex-col flex inspection_main_box">
|
<view class="flex-1 flex-col flex inspection_main_box">
|
||||||
<view class="info_box">
|
<view class="info_box">
|
||||||
<view class="title_box flex items-center justify-between">
|
<view class="title_box flex flex-between">
|
||||||
<view class="title flex items-center">
|
<view class="title flex">
|
||||||
<view class="line"> </view>
|
<text class="line"></text>
|
||||||
<text>{{ info.villageName }} - {{ info.taskName }}</text>
|
<text>{{ info.villageName }} - {{ info.taskName }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="inspection_status"> <text>已巡检</text> </view>
|
<view class="inspection_status" style="flex: 100rpx"> <text>已巡检</text> </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
@@ -180,7 +180,6 @@ onLoad(options => {
|
|||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
min-height: 40rpx;
|
min-height: 40rpx;
|
||||||
text-wrap: wrap;
|
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
.line {
|
.line {
|
||||||
display: block;
|
display: block;
|
||||||
@@ -190,12 +189,11 @@ onLoad(options => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.inspection_status {
|
.inspection_status {
|
||||||
width: 100rpx;
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
line-height: 36rpx;
|
line-height: 36rpx;
|
||||||
|
text-align: center;
|
||||||
&.todo {
|
&.todo {
|
||||||
color: #4d5dfa;
|
color: #4d5dfa;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,6 +155,11 @@ function handleChangeTime(event: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleTap(ite) {
|
function handleTap(ite) {
|
||||||
|
const today = parseTime(new Date(), '{m}月{d}日')
|
||||||
|
if (today !== showDate.value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (isComputed(ite.taskStatus)) {
|
if (isComputed(ite.taskStatus)) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pageSubPack/inspection/inspection_main?id=' + ite.id
|
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_body" v-for="(ite, ind) in item.points" :key="ind">
|
||||||
<view class="info_title" style="margin-bottom: 20rpx"> {{ ite.ponitName }} </view>
|
<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 :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
|
<uni-data-checkbox
|
||||||
:disabled="ite.complated"
|
:disabled="ite.complated"
|
||||||
v-model="ite.status"
|
v-model="ite.status"
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="items_picker_box">
|
<view class="items_picker_box">
|
||||||
<view class="label">
|
<view class="label">
|
||||||
<text class="is-required">*</text>
|
<text class="is-required" v-if="!ite.complated">*</text>
|
||||||
<text>巡检照片</text>
|
<text>巡检照片</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="filePickerbox" v-if="!ite.complated">
|
<view class="filePickerbox" v-if="!ite.complated">
|
||||||
|
|||||||
@@ -153,7 +153,6 @@ function init() {
|
|||||||
|
|
||||||
onLoad(options => {
|
onLoad(options => {
|
||||||
activeValue.value = Number(options.type)
|
activeValue.value = Number(options.type)
|
||||||
console.log(activeValue.value)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
<uni-forms-item label="房屋号">
|
<uni-forms-item label="房屋号">
|
||||||
<view @tap="handleClick" style="width: 100%">
|
<view @tap="handleClick" style="width: 100%">
|
||||||
<uni-easyinput
|
<uni-easyinput
|
||||||
|
class="easy-ellipsis-1"
|
||||||
:inputBorder="false"
|
:inputBorder="false"
|
||||||
disabled
|
disabled
|
||||||
v-model="houseName"
|
v-model="houseName"
|
||||||
@@ -84,6 +85,7 @@ function handleClick() {
|
|||||||
/** 处理 扫码 */
|
/** 处理 扫码 */
|
||||||
function handleScan() {
|
function handleScan() {
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
|
scanType: ['barCode', 'qrCode', 'datamatrix', 'pdf417'],
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
formData.value.deviceCode = res.result
|
formData.value.deviceCode = res.result
|
||||||
},
|
},
|
||||||
@@ -133,7 +135,7 @@ function handleSubmit() {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.addreplacement_box {
|
.addreplacement_box {
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
|
padding-top: 0;
|
||||||
&:deep(.uni-forms-item) {
|
&:deep(.uni-forms-item) {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -166,4 +168,9 @@ function handleSubmit() {
|
|||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.easy-ellipsis-1:deep(.uni-easyinput__content-input) {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -35,13 +35,10 @@
|
|||||||
active: checkoutHouseid === item.houseId
|
active: checkoutHouseid === item.houseId
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<view class="flex items-center flex-1">
|
<view class="housepath flex items-center flex-1">
|
||||||
<!-- checkout -->
|
|
||||||
<radio color="#4d5dfa" :value="item.houseId" />
|
<radio color="#4d5dfa" :value="item.houseId" />
|
||||||
<!-- housename -->
|
|
||||||
<text class="address">{{ item.addressCn ?? item.addressHyphen }}</text>
|
<text class="address">{{ item.addressCn ?? item.addressHyphen }}</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- username -->
|
|
||||||
<view class="username">{{ item.residentName }}</view>
|
<view class="username">{{ item.residentName }}</view>
|
||||||
</view>
|
</view>
|
||||||
</label>
|
</label>
|
||||||
@@ -221,12 +218,22 @@ function handleSelecthouse() {
|
|||||||
&:deep(radio) {
|
&:deep(radio) {
|
||||||
transform: scale(0.68);
|
transform: scale(0.68);
|
||||||
}
|
}
|
||||||
|
.housepath {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
.address {
|
.address {
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
font-weight: 550;
|
font-weight: 550;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #222222;
|
color: #222222;
|
||||||
line-height: 40rpx;
|
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 {
|
.username {
|
||||||
@@ -236,6 +243,7 @@ function handleSelecthouse() {
|
|||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
width: 180rpx;
|
width: 180rpx;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
margin-left: 10rpx;
|
||||||
}
|
}
|
||||||
&.active {
|
&.active {
|
||||||
background: #f5faff;
|
background: #f5faff;
|
||||||
|
|||||||
@@ -364,6 +364,8 @@ function handleRepairCompluted() {
|
|||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
.label {
|
.label {
|
||||||
margin-bottom: 32rpx;
|
margin-bottom: 32rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
.value {
|
.value {
|
||||||
height: 162rpx;
|
height: 162rpx;
|
||||||
@@ -401,6 +403,8 @@ function handleRepairCompluted() {
|
|||||||
color: #222222;
|
color: #222222;
|
||||||
line-height: 36rpx;
|
line-height: 36rpx;
|
||||||
width: 35%;
|
width: 35%;
|
||||||
|
white-space: nowrap;
|
||||||
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
.value {
|
.value {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@@ -409,6 +413,7 @@ function handleRepairCompluted() {
|
|||||||
color: #666666;
|
color: #666666;
|
||||||
line-height: 36rpx;
|
line-height: 36rpx;
|
||||||
text-wrap: wrap;
|
text-wrap: wrap;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user