<template>
    <div>
        <LHeader :text="text"></LHeader>
        <!-- 内容列表 -->
        <div class="con-list">
            <van-cell-group
                inset
                v-for="(item, index) in contentList"
                :key="index"
                @click="onClick(item.content)"
            >
                <div class="icon-wrap">
                    <span class="icon-img">
                        <van-image
                            width="35"
                            height="35"
                            style="margin: 0 10px;overflow: hidden; border-radius: 5px;"
                            :src="item.imgUrl"
                        />
                    </span>
                    {{ item.content }}
                </div>
            </van-cell-group>
        </div>
    </div>
</template>

<script>
import LHeader from "@/components/header.vue";
export default {
    name: "danger-patrol",
    components: {
        LHeader
    },
    data() {
        return {
            text: "危险作业申请",
            contentList: [
                {
                    title: "A1",
                    imgUrl: require("@/assets/dangerPatrol/patrol-icon.png"),
                    content: "执行巡查"
                },
                {
                    title: "A2",
                    imgUrl: require("@/assets/dangerPatrol/patrol-icon.png"),
                    content: "取消巡查"
                },
                {
                    title: "A1",
                    imgUrl: require("@/assets/dangerPatrol/patrol-icon.png"),
                    content: "巡查记录"
                },
                {
                    title: "A2",
                    imgUrl: require("@/assets/dangerPatrol/patrol-icon.png"),
                    content: "巡查统计"
                }
            ]
        };
    },
    mounted() {},
    methods: {
        onClick(val) {
            if (val == "执行巡查") {
                this.$router.push({
                    name: "implement"
                });
            } else if (val == "取消巡查") {
                this.$router.push({
                    name: "cancel-patrol"
                });
            } else if (val == "巡查记录") {
                this.$router.push({
                    name: "record-patrol"
                });
            } else if (val == "巡查统计") {
                this.$router.push({
                    name: "statistics"
                });
            }
        }
    }
};
</script>
<style lang="less" scoped>
/* @import url(); 引入css类 */
.van-cell-group--inset {
    height: 2.266667rem;
    line-height: 2.266667rem;
    font-size: 0.4rem;
    font-weight: bolder;
    margin: 0.266667rem;
    padding-left: 0.666667rem;
    color: #3499ff;
    .icon-wrap {
        display: flex;
        align-items: center;
        .icon-img {
            margin-right: 0.533333rem;
            display: inherit;
        }
    }
}
</style>
