优化代码

This commit is contained in:
wuxw 2025-02-26 11:07:15 +08:00
parent 5d6da3a9a3
commit fe05f7bb57
2 changed files with 27 additions and 17 deletions

View File

@ -11,7 +11,7 @@
<view class="margin-top"> <view class="margin-top">
<radio-group class="block" @change="radioChange($event)"> <radio-group class="block" @change="radioChange($event)">
<view class="cu-form-group" v-for="(valueItem,valueIndex) in items" :key="valueIndex"> <view class="cu-form-group" v-for="(valueItem,valueIndex) in items" :key="valueIndex">
<view class="title">{{valueItem.content}}</view> <view class="title-1">{{valueItem.content}}</view>
<radio :class="itemId==valueItem.itemId?'checked':''" v-if="valueItem.state == 'C'" <radio :class="itemId==valueItem.itemId?'checked':''" v-if="valueItem.state == 'C'"
:checked="itemId==valueItem.itemId?true:false" :value="valueItem.itemId"> :checked="itemId==valueItem.itemId?true:false" :value="valueItem.itemId">
</radio> </radio>
@ -144,8 +144,12 @@
</script> </script>
<style> <style>
.title { .title-1 {
min-height: 60upx; text-align: justify;
height: auto; padding-right: 30rpx;
font-size: 30rpx;
position: relative;
line-height: 60rpx;
} }
</style> </style>

View File

@ -11,9 +11,9 @@
<view class="margin-top"> <view class="margin-top">
<radio-group class="block" @change="radioChange($event)"> <radio-group class="block" @change="radioChange($event)">
<view class="cu-form-group" v-for="(valueItem,valueIndex) in items" :key="valueIndex"> <view class="cu-form-group" v-for="(valueItem,valueIndex) in items" :key="valueIndex">
<view class="title">{{valueItem.content}}</view> <view class="title-1">{{valueItem.content}}</view>
<radio :class="itemId==valueItem.itemId?'checked':''" v-if="valueItem.state == 'W'" :checked="itemId==valueItem.itemId?true:false" <radio :class="itemId==valueItem.itemId?'checked':''" v-if="valueItem.state == 'W'"
:value="valueItem.itemId"> :checked="itemId==valueItem.itemId?true:false" :value="valueItem.itemId">
</radio> </radio>
<view v-else>已处理</view> <view v-else>已处理</view>
</view> </view>
@ -41,7 +41,8 @@
<view class="flex justify-between margin-top-xs"> <view class="flex justify-between margin-top-xs">
<view></view> <view></view>
<view class="margin-right"> <view class="margin-right">
<text class=" cuIcon-camerafill text-blue file-size" @click="_changeUploadFile('IMG')" v-if="fileType != 'IMG'"></text> <text class=" cuIcon-camerafill text-blue file-size" @click="_changeUploadFile('IMG')"
v-if="fileType != 'IMG'"></text>
<text class=" cuIcon-upload text-blue file-size" @click="_changeUploadFile('FILE')" v-else></text> <text class=" cuIcon-upload text-blue file-size" @click="_changeUploadFile('FILE')" v-else></text>
</view> </view>
</view> </view>
@ -66,7 +67,7 @@
<script> <script>
import vcUploadFile from '@/components/vc-upload/vc-upload-file.vue'; import vcUploadFile from '@/components/vc-upload/vc-upload-file.vue';
import uploadImageAsync from "@/components/vc-upload-async/vc-upload-async.vue"; import uploadImageAsync from "@/components/vc-upload-async/vc-upload-async.vue";
import selectOneStaffs from '../../components/select-staff/select-one-staffs.vue'; import selectOneStaffs from '../../components/select-staff/select-one-staffs.vue';
import { import {
finishWorkTask, finishWorkTask,
@ -165,19 +166,19 @@
staffId: this.staffId, staffId: this.staffId,
staffName: this.staffName, staffName: this.staffName,
pathUrl: this.pathUrl, pathUrl: this.pathUrl,
itemId:this.itemId itemId: this.itemId
}).then(_data => { }).then(_data => {
uni.navigateBack(); uni.navigateBack();
}) })
}, },
radioChange: function(e) { radioChange: function(e) {
this.itemId = e.detail.value; this.itemId = e.detail.value;
}, },
_changeUploadFile:function(_fileType){ _changeUploadFile: function(_fileType) {
this.fileType = _fileType; this.fileType = _fileType;
}, },
sendImagesData:function(_obj){ sendImagesData: function(_obj) {
if(_obj.length < 1){ if (_obj.length < 1) {
this.pathUrl = ""; this.pathUrl = "";
return; return;
} }
@ -191,9 +192,14 @@
.centent-btn { .centent-btn {
font-size: 22px; font-size: 22px;
} }
.title{
min-height: 60upx; .title-1 {
height: auto; text-align: justify;
padding-right: 30rpx;
font-size: 30rpx;
position: relative;
line-height: 60rpx;
} }
.file-size { .file-size {