<!--参数管理-->
<template>
    <div>
        <search-layout :needBox="true">
            <template slot="searchItem1">
                <span class="label">账户名</span>
                <el-input
                    v-model="searchParams.algorithmCode"
                    size="small"
                    clearable
                    placeholder="请输入"
                    maxlength="60"
                >
                </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="myTabsBox myTabsBoxThreeTabs">
            <el-button
                v-bind:class="{ addBtn: true}"
                icon="el-icon-circle-plus-outline"
                @click="addOne"
                type="primary"
                >新增参数配置</el-button
            >
        </div>

        <tableList
            ref="table"
            style="margin: 0 30px"
            :columns="columns"
            :getDataWay="getDataWay"
            :pagination="pagination"
            index
        >
            <el-table-column label="操作" slot="cgInfos" align="center">
                <template v-slot="scope">
                    <i
                        @click="editRow(scope.row)"
                        class="el-icon-edit-outline elIcon"
                        title="编辑"
                    ></i>
                    <i
                        @click="delOne(scope.row)"
                        class="el-icon-delete elIcon"
                        title="删除"
                    ></i>
                </template>
            </el-table-column>
        </tableList>
    </div>
</template>

<script>
import searchLayout from "@/components/grid/searchLayout";
import tableList from "@/components/grid/TableList";

export default{
    name: "parameterManagement",
    components: { searchLayout, tableList },
    data() {
        return {
            searchParams: {
                //搜索参数
                
            },
            validationStatusList: [],
            getDataWay:{
                //dataType: "url",
                dataType: "data",
                type: "post",
                // firstRequest: false,
                // data: this.$api.algorithmsLibrary.selectSharedAlgorithmList,
                data:[{a1:'1',a2:'2',a3:'3',a4:'4'}],
                param: {},
            },
            columns: [
                //表格列
                {
                    label: "账户名",
                    prop: "a1",
                },
                {
                    label: "可创建子账户数量",
                    prop: "a2",
                },
                {
                    label: "最多可创建场景测试包数量",
                    prop: "a3",
                },
                {
                    label: "场景数量包的最大场景数",
                    prop: "a4",
                },
                {
                    label: "操作",
                    prop: "cgInfos",
                    template: true
                }
            ],
            pagination: {
                //分页使用
                currentPage: 1,
                pageSize: 10,
                position: "right",
                pageSizes: [10, 30, 50, 100, 200],
                layout: "sizes, total, prev, pager, next, jumper",
            },
        };
    },
    methods: {
        doSearch() {
            this.$nextTick(() => {
                this.refreshList(this.searchParams);
            });
        },
        refreshList(param) {
            param
                ? this.$refs["table"].loadData(param)
                : this.$refs["table"].loadData();
        },
        doReset() {
            this.searchParams = {
                
            };
            this.doSearch();
        },
        addOne() {
            this.$router.push("/parameterDetail")
        },
        editRow(row) {
            
        },
        delOne(row) {
            this.$confirm("确认是否删除？", "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            }).then(() => {
                
            });
        },
    },
}
</script>

<style scoped lang="less">
.tabsBox {
    position: relative;
    overflow: hidden;

    .el-button {
        position: absolute;
        right: 40px;
        top: 45px;
    }
}
.myTabsBox{
    min-height:99px;
}
</style>