1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <template>
- <!-- @rightClick 只有有右边部分的情况下才使用,
- 右边默认为空,可以使用slot="right" 自定义右边内容
- @ok 是单选或多选最终返回的结果
- types 类型 radio或checkbox
- titleKeys 标题对应的字段名称key,默认是name
- listData 是数据
- showArrow 是否显示右边箭头
- -->
- <uni-check-list :listData="list" types="radio" @ok="chooseOk" @rightClick="viewDetail">
- <view slot="right">
- 详情
- </view>
- </uni-check-list>
- </template>
- <script>
- import {findScheme} from '@/api/assess'
- export default {
- data() {
- return {
- list: [],
- value: '',
- }
- },
- onLoad() {
- // 查询方案
- findScheme({status:1}).then(res=>{
- console.log(res.data)
- if(res.status == 200){
- this.list = res.data
- }
- })
- },
- methods: {
- // 选中方案,item 返回的是数组
- chooseOk(item) {
- console.log(item)
- if(item.length==0){
- uni.showToast({
- icon:'none',
- title:'请选择考评方案'
- })
- }else{
- //关闭当前页面,这里处理数据逻辑
- }
- },
- // 查看详情
- viewDetail(item){
- uni.navigateTo({
- url:"/pages/evaluatePlan/planDetail?id="+item.id
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page{
- height: 100%;
- }
- </style>
|