<template>
    <div>
        <search-layout>
            <template slot="searchItem1">
                <span class="label">场景编号</span>
                <el-input
                    v-model="searchParams.naturalName"
                    size="small"
                    clearable
                    placeholder="请输入"
                    maxlength="60"
                    @keyup.enter.native="doSearch"
                >
                </el-input>
            </template>
            <template slot="searchItem2">
                <span class="label">道路</span>
                <el-cascader
                    v-model="searchParams.road"
                    :options="roadList"
                    :props="props"
                    clearable
                    size="small"
                ></el-cascader>
            </template>
            <template slot="searchItem3">
                <span class="label">基础设施</span>
                <el-cascader
                    v-model="searchParams.infrastructure"
                    :options="infrastructureList"
                    :props="props"
                    clearable
                    size="small"
                ></el-cascader>
            </template>
            <template slot="searchItem4">
                <span class="label">交通情况</span>
                <el-cascader
                    v-model="searchParams.trafficCondition"
                    :options="trafficConditionList"
                    :props="props"
                    clearable
                    size="small"
                ></el-cascader>
            </template>
            <template slot="searchItem5">
                <span class="label">自车行为</span>
                <el-cascader
                    v-model="searchParams.selfBehavior"
                    :options="selfBehaviorList"
                    :props="props"
                    clearable
                    size="small"
                ></el-cascader>
            </template>
            <template slot="searchItem6">
                <span class="label">目标行为</span>
                <el-cascader
                    v-model="searchParams.targetBehavior"
                    :options="targetBehaviorList"
                    :props="props"
                    clearable
                    size="small"
                ></el-cascader>
            </template>
            <template slot="searchItem7">
                <span class="label">自然环境</span>
                <el-cascader
                    v-model="searchParams.naturalEnvironment"
                    :options="naturalEnvironmentList"
                    :props="props"
                    clearable
                    size="small"
                ></el-cascader>
            </template>
            <template slot="searchItem8">
                <span class="label">临时性操纵</span>
                <el-cascader
                    v-model="searchParams.temporaryOperation"
                    :options="temporaryOperationList"
                    :props="props"
                    clearable
                    size="small"
                ></el-cascader>
            </template>
            <template slot="searchBtn1">
                <el-button type="primary" @click="doSearch">查询</el-button>
            </template>
            <template slot="searchBtn2">
                <el-button type="primary" @click="doReset">重置</el-button>
            </template>
        </search-layout>
        <div class="isSelected">
            <el-checkbox v-model="selected" @change="selectedShow"
                >已选择</el-checkbox
            >
        </div>
        <tableList
            ref="table"
            :columns="columns"
            :getDataWay="getDataWay"
            :pagination="pagination"
            :checkedData="checkedArr"
            :needLoadedCallBack="true"
            :loadedCallBack="loadedCallBack"
            :needSelectedCallBack="true"
            :selectedCallBack="selectedCallBack"
            :selectedAllCallBack="selectedAllCallBack"
            index
            selection
        >
        </tableList>
    </div>
</template>

<script>
import tool from "./common/tool.js";

export default {
    name: "naturalDrivingList", // 自然驾驶场景
    mixins: [tool],
    data() {
        return {
            searchParams: {
                //搜索参数
                naturalName: "", // 场景编号
                road: [], // 道路
                infrastructure: [], // 基础设施
                trafficCondition: [], // 交通情况
                selfBehavior: [], // 自车行为
                targetBehavior: [], // 目标行为
                naturalEnvironment: [], // 自然环境
                share: "0",
            },
            props: {
                multiple: true,
                label: "dictName",
                value: "dictCode",
            },
            columns: [
                //表格列
                {
                    label: "场景编号",
                    prop: "naturalName",
                },
                {
                    label: "天气",
                    prop: "weather",
                },
                {
                    label: "自车行为",
                    prop: "selfBehavior",
                },
                {
                    label: "目标行为",
                    prop: "targetBehavior",
                },
            ],
            getDataWay: {
                //加载表格数据
                dataType: "url",
                type: "post",
                // firstRequest: false,
                data: this.$api.sceneLibrary.querySceneNaturalList,
                param: {
                    share: "0",
                },
            },
        };
    },

    props: {
        roadList: {
            type: Array,
            default: [],
        },
        infrastructureList: {
            type: Array,
            default: [],
        },
        trafficConditionList: {
            type: Array,
            default: [],
        },
        selfBehaviorList: {
            type: Array,
            default: [],
        },
        targetBehaviorList: {
            type: Array,
            default: [],
        },
        naturalEnvironmentList: {
            type: Array,
            default: [],
        },
        temporaryOperationList: {
            type: Array,
            default: [],
        },
    },

    methods: {
        doReset() {
            this.searchParams = {
                naturalName: "",
                road: [],
                infrastructure: [],
                trafficCondition: [],
                selfBehavior: [],
                targetBehavior: [],
                naturalEnvironment: [],
                temporaryOperation: [],
                share: "0",
            };
            this.doSearch();
        },
    },

    mounted() {},
};
</script>

<style lang='less' scoped>
</style>