<template>
    <ap-container>
        <ap-main margin="1111">
            <ap-table ref="tAbapSqlRef" :options.sync="tAbapSqlOpt"></ap-table>
        </ap-main>
    </ap-container>
</template>

<script>
    export default {
        name: 'TAbapSql',
        data() {
            let columns = [
                {
                    prop: 'fdParentId',
                    label: '父节点',
                    type: 'select',
                    selectOptionsKey:{label:"fdName", value:"fdId"},
                    selectOptionsRemote: 'parentList',
                    width: 100,
                }, {
                    prop: 'fdType',
                    label: '类型',
                    type: 'select',
                    selectOptions: [{label: "分组", value: 1}, {label: "SQL", value: 2}],
                    width: 80,
                }, {
                    prop: 'fdName',
                    label: '名称',
                    type: 'input',
                    width: 120,
                }, {
                    prop: 'fdUserId',
                    label: '所属用户',
                    type: 'input',
                    width: 100,
                    showOverflowTooltip: true
                }, {
                    prop: 'fdSql',
                    label: 'SQL语句',
                    type: 'input',
                    showOverflowTooltip: true
                },{
                    prop: 'fdRemark',
                    label: '备注',
                    type: 'input',
                    width: 150,
                }, {
                    prop: 'fdSort',
                    label: '排序',
                    type: 'input',
                    width: 100,
                }
            ];
            let tableOpt = {
                title: "常用SQL列表",
                columns: columns,
                editPk: "fdId", //默认fdId
                deletePk: "fdId", // 默认fdId
                dataUrl: "/apd/abap/TAbapSql/getCommonSqlGridList",
                saveUrl: "/apd/abap/TAbapSql/saveTAbapSqlGridData",
                deleteUrl: "/apd/abap/TAbapSql/deleteTAbapSqlGridData",
                toolbarBtn: ["add", "edit", "del", "refresh", "save"],
                initData: true, // 默认false
                params: {},
                rowKey: "fdId",
                rowParentKey: "fdParentId", // 父节点id
                defaultExpandAll: true,
                indexWidth: 80,
            };
            return {
                tAbapSqlOpt: tableOpt,
            }
        },
        methods: {
        }
    }
</script>

<style scoped>
</style>
