Commit 6f06f9ee by liuzhanxin

fix

parent 1293daa6
<template>
<view class="content">
<uni-list v-for="(item,index) in listData" :key=index>
<view class="itemclass" hover-class="hoverclass" hover-stay-time="40" @click="itemClick(item,index)">
<view style="display: flex;flex-direction: row;align-items: center;">
<image v-if="!item.selected " class="iconsel" mod="aspectFit" src="../../static/common/unselected.png" />
<image v-if="item.selected" class="iconsel" mod="aspectFit" src="../../static/common/selected.png" />
<text style="margin-left: 15rpx;">{{item.name}}</text>
</view>
</view>
</uni-list>
</view>
</template>
<script>
import uniList from "@/components/list/uni-list/uni-list.vue"
import uniListItem from "@/components/list/uni-list-item/uni-list-item.vue"
import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
export default {
data() {
return {
title: ["实验分室"],
listData:[],
pageIndex:0,
addressSel:[],
id:"",
sel:""
}
},
onLoad(option) {
if(option.experimentCenterId){
this.getData(option.experimentCenterId);
}
},
methods: {
onNavigationBarButtonTap(){
this.saveClick();
},
goBackClick:function(){
uni.navigateBack({
})
},
saveClick:function(){
if(this.sel == ""){
return
}
uni.navigateBack({
})
console.log(this.sel)
setTimeout(()=>{
uni.$emit("labEntitySave",[this.sel]);
},200)
},
itemClick:function(item,index){
this.listData.map((opt)=>{
opt.selected = false;
})
this.listData[index].selected = true
this.sel = this.listData[index]
},
getData:function(id){
var conditions = [
{
name: 'experimentCenter.id',
relation:3,//等于
values:[id],
},
{name: "removed", relation: 5, values: []}
]
var body = {
"queryDefinitionMetaName": "com.beecode.tspp.manage.query.LabEntity",
"queryFields": ["id", "created", "code", "name", "experimentCenter.name", "college.title"],
"orders": [{
"name": "created",
"asc": false
}],
"conditions": conditions,
"pageIndex": this.pageIndex,
"pageSize": 200,
"useScene": true,
"sceneId":"",
"usePaging": true
}
uni.request({
url: this.GLOBALUTIL.url + '/query/functionQuery',
method: 'POST',
header: this.GLOBALUTIL.commonHeader,
data: JSON.stringify(body),
success: (res) => {
var data = JSON.parse(res.data.rowDatas);
data.map((opt)=>{
opt.selected = false;
return opt;
})
this.listData = data;
}
})
},
},
components: {uniList,uniListItem,uniNavBar}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
background-color: #F7F7F7;
padding:0
}
.status_bar {
height: var(--status-bar-height);
width: 100%;
}
.itemclass {
display: flex;
width:100%;
height: 90rpx;
background-color: #FFFFFF;
border: 1px solid #D8D8D8;
flex-direction: row ;
justify-content: space-between;
align-items: center;
}
.icongo {
width:40rpx;
height:30rpx;
}
.iconsel {
width:30rpx;
height:30rpx;
margin-left: 10rpx;
}
.hoverclass{
opacity: 0.5;
background-color:#F5F5F5;
}
</style>
......@@ -305,6 +305,22 @@
"bounce":"none"
}
}
},
{
"path": "components/lab-select/index",
"style": {
"navigationBarTitleText": "实验分室",
"app-plus" : {
"titleNView" : {
"buttons" : [
{
"text" : "确定",
"fontSize" : "14"
}
]
}
}
}
}
],
"tabBar": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment