<el-table-column align="center" label="在离场状态" width="100" prop="entryExitType">
<template slot-scope="scope">
{{ scope.row.entryExitType === '1' ? '在场' : '' }}
{{ scope.row.entryExitType === '0' ? '离场' : '' }}
</template>
</el-table-column>
在有v-for的时候,可以在data中定义一个数组。
<div class="item" v-for="v in list" :key="v.backlogId">
<uni-card @click="toDetails(v.type, v.backlogId, v.state)">
<view slot="title" class="header">
<view>{{listInfo[v.type].type}}</view>
<u-tag :text="state[v.state]" type="success" mode="dark" :closeable="false" size="mini" />
</view>
</uni-card>
</div>
<script>
export default {
data() {
return {
state: ['已读', '未读'],
listInfo: {
'0': {type: '班组事项', workerPath: 'details/workerBacklog', teamPath: 'details/teamBacklog'},
'1': {type: '薪资事项'},
'2': {type: '记工记量'},
'4': {type:'更换班组长', workerPath: 'details/workerBacklog'},
'5': {type: '项目邀请', teamPath: 'details/proBacklog'}
},
}
},
methods: {
srolltolower() {
},
toDetails(type, backlogId, state) {
const app = getApp();
if(app.globalData.isWorker) {
uni.navigateTo({
url: this.listInfo[type].workerPath+`?backlogId=${backlogId}&state=${state}&type=${type}`
})
} else if(app.globalData.isTeam) {
uni.navigateTo({
url: this.listInfo[type].teamPath+`?backlogId=${backlogId}&state=${state}`
})
}
this.queryParam.backlogId = backlogId
this.handleRead()
},
}
}
</script>