<!--
 * 严肃声明：
 * 开源版本请务必保留此注释头信息，若删除我方将保留所有法律责任追究！
 * 本系统已申请软件著作权，受国家版权局知识产权以及国家计算机软件著作权保护！
 * 可正常分享和学习源码，不得用于违法犯罪活动，违者必究！
 * Copyright (c) 2020 陈尼克 all rights reserved.
 * 版权所有，侵权必究！
 *
-->

<template>
    <div>
       <LHeader v-bind:text="text"></LHeader>
       <van-search
            v-model="value"
            show-action
            placeholder="请输入关键字"
            @search="onSearch"
            >
            <template #action>
                <div @click="onSearch">搜索</div>
            </template>
        </van-search>
        <div class="card" v-for="(item,index) in checkedList"  :key="index"  @click="cardLocation(item)">
            <div>检查名称：{{item.name}}</div>
            <div>检查类型：{{item.type}}</div>
            <div>检查开始时间：{{item.planStartTime}}</div>
            <div>检查结束时间：{{item.planEndTime}}</div>
            <div>检查地点：{{item.address}}</div>
        </div>
    </div>
</template>

<script>
import LHeader from '@/components/header.vue'
import { getFun,postFun } from '@/service/table'
export default {
    name: 'checked',
    components: {
        "LHeader":LHeader
    },
    data() {
        return {
            value:'',
            checkedList:[
                 {
                    "id":17,
                    "userId":1,
                    "name":"1",
                    "type":"定期安全检查",
                    "planStartTime":"2021-10-09 06:30:42",
                    "planEndTime":"2021-10-09 15:55:42",
                    "address":"1",
                    "finish":false
                },
                {
                    "id":18,
                    "userId":1,
                    "name":"1",
                    "type":"定期安全检查",
                    "planStartTime":"2021-10-09 06:30:42",
                    "planEndTime":"2021-10-09 15:55:42",
                    "address":"11",
                    "finish":false
                }
            ],
            text:'检查执行'
        }
    },
    mounted() {
        this.list()
    },
    methods: {
        list(){
            // this.checkedList=[]
            getFun('check/carry/user/list').then((Response)=>{
                // this.checkedList=Response.data
            })
        },
        onSearch(){
            this.$toast('提示内容')
        },
        cardLocation(item){
            console.log(item)
            this.$router.push({
                name:'problem',
                query:{
                    checkitemId:item.id,
                    name:item.name,
                    type:item.type,
                    planStartTime:item.planStartTime,
                    planEndTime:item.planEndTime,
                    address:item.address,
                }
            })
        }
    }
}
</script>
<style lang="less" scoped>
    .card{
        width:90%;
        box-shadow: 0px 0px 10px 2px #F3F3F3;
        padding: 0.25rem;
        margin:0.4rem auto;
        background: white;
    }
    .card div{
        font-size: 0.4rem;
    }
</style>
