|
@@ -2,7 +2,7 @@
|
|
|
<view class="uni-column container" >
|
|
|
<scroll-view class="scroll-container" scroll-y>
|
|
|
<view v-for="(item, index) in listData" :key="index"
|
|
|
- class="list-item" >
|
|
|
+ :class="{'list-item':true,'selected':selectedItem === item}" @click="handleSelection(item)">
|
|
|
<view class="title-container uni-row">
|
|
|
<view class="title uni-row">
|
|
|
<text class="label">批次号:</text>
|
|
@@ -66,6 +66,7 @@
|
|
|
|
|
|
const listData = ref([])
|
|
|
const curSubDetails = ref({})
|
|
|
+ const selectedItem = ref({})
|
|
|
const endWorkDialog = ref(null)
|
|
|
const selectEquipment = ref(null)
|
|
|
const equipmentList = ref([])
|
|
@@ -82,6 +83,14 @@
|
|
|
console.log(listData)
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ function handleSelection(item){
|
|
|
+ if (selectedItem.value === item) {
|
|
|
+ selectedItem.value = null;
|
|
|
+ } else {
|
|
|
+ selectedItem.value = item;
|
|
|
+ }
|
|
|
+ }
|
|
|
function handleShowEndWorkDialog(data){
|
|
|
// 调用子组件中的方法
|
|
|
endWorkDialog.value.open(data)
|
|
@@ -136,6 +145,10 @@
|
|
|
left: 0;
|
|
|
}
|
|
|
|
|
|
+ .selected {
|
|
|
+ border: 1px solid #1684fc;
|
|
|
+ }
|
|
|
+
|
|
|
.list-item {
|
|
|
background-color: #fff;
|
|
|
position: relative;
|