<template>
    <div>
        <search-layout>
            <template slot="searchItem1">
                <span class="label">场景名称</span>
                <el-input
                    v-model="searchParams.sceneName"
                    size="small"
                    maxlength="60"
                    clearable
                    placeholder="请输入"
                    @keyup.enter.native="doSearch"
                >
                </el-input>
            </template>
            <template slot="searchItem2">
                <span class="label">法规类型</span>
                <el-select
                    v-model="searchParams.regulationType"
                    multiple
                    clearable
                    size="small"
                >
                    <el-option
                        v-for="item in regulationTypeList"
                        :label="item.caption"
                        :value="item.code"
                        :key="item.code"
                    ></el-option>
                </el-select>
            </template>
            <template slot="searchItem3">
                <span class="label">标准类型</span>
                <el-input
                    v-model="searchParams.standardType"
                    size="small"
                    maxlength="60"
                    clearable
                    placeholder="请输入"
                    @keyup.enter.native="doSearch"
                >
                </el-input>
            </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: "standardRegulationSimulationList", // 标准法规场景
    mixins: [tool],
    data() {
        return {
            searchParams: {
                //搜索参数
                sceneName: "", //场景名称
                regulationType: [], //法规类型
                standardType: "", //标准类型
                share: "0",
            },
            columns: [
                //表格列
                {
                    label: "场景名称",
                    prop: "sceneName",
                },
                {
                    label: "法规类型",
                    prop: "regulationType",
                },
                {
                    label: "标准类型",
                    prop: "standardType",
                },
            ],
            getDataWay: {
                //加载表格数据
                dataType: "url",
                type: "post",
                // firstRequest: false,
                data: this.$api.sceneLibrary.queryStandardsRegulationsList,
                param: {
                    share: "0",
                },
            },
        };
    },

    props: {
        regulationTypeList: {
            type: Array,
            default: [],
        },
    },

    methods: {
        doReset() {
            this.searchParams = {
                sceneName: "",
                regulationType: [],
                standardType: "",
                share: "0",
            };
            this.doSearch();
        },
    },

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

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