<template>
    <a-card style="width: 100%; height:100%;">
        <a-tabs default-active-key="1">
            <a-tab-pane key="1">
                <span slot="tab">
                    <a-icon type="template" />
                    字典管理
                </span>
                <dictionary-info></dictionary-info>
            </a-tab-pane>
            <a-tab-pane key="2">
                <span slot="tab">
                    <a-icon type="template" />
                    打印模板设置
                </span>
                <print-template></print-template>
            </a-tab-pane>
            <a-tab-pane key="3">
                <span slot="tab">
                    <a-icon type="pay" />
                    支付方式
                </span>
                <pay-settings></pay-settings>
            </a-tab-pane>
            <a-tab-pane key="4">
                <span slot="tab">
                    订单铃声
                </span>
                <order-sound-list></order-sound-list>
            </a-tab-pane>
            <a-tab-pane key="5">
                <span slot="tab">
                    <a-icon type="pay" />
                    数据管理
                </span>
                <div>
                    <a-form-item>
                    <a-card title="业务数据" style="width: 300px" :headStyle="{fontWeight: 600}">
                        <a-checkbox v-model="clearBusiness">
                            清除全部业务数据
                        </a-checkbox>
                    </a-card>
                    </a-form-item>
                    <a-button type="primary" @click="toClearBusinessData()">确定清除</a-button>
<!--                    <a-popconfirm title="此操作将永久删除选中数据，是否继续?" @confirm="() => toClearBusinessData()">-->
<!--                        <a-button type="primary">确定清除</a-button>-->
<!--                    </a-popconfirm>-->

                </div>
            </a-tab-pane>
            <!-- <a-tab-pane key="6">
                <span slot="tab">
                    <a-icon type="pay" />
                    门锁管理
                </span>
                <door-lock-list></door-lock-list>
            </a-tab-pane> -->
            <a-tab-pane key="7">
                <span slot="tab">
                    <a-icon type="payinterface" />
                    支付接口配置
                </span>
                <pay-api-settings></pay-api-settings>
            </a-tab-pane>
            <a-tab-pane key="8">
                <span slot="tab">
                    <a-icon type="parameter" />
                    参数配置
                </span>
                <param-settings></param-settings>
            </a-tab-pane>
            <a-tab-pane key="9">
                <span slot="tab">
                    <a-icon type="waiter" />
                    服务员配置
                </span>
                <waiter-settings></waiter-settings>
            </a-tab-pane>
            <a-tab-pane key="10">
                <span slot="tab">
                    <a-icon type="salesperson" />
                    营销人员管理
                </span>
                <sales-person-info></sales-person-info>
            </a-tab-pane>
            <a-tab-pane key="11">
                <span slot="tab">
                    <a-icon type="salesperson" />
                    密码锁接口管理
                </span>
            </a-tab-pane>
            <a-tab-pane key="12">
                <span slot="tab">
                    <a-icon type="salesperson" />
                    云打印机设置
                </span>
            </a-tab-pane>
            <a-tab-pane key="13">
                <span slot="tab">
                    <a-icon type="salesperson" />
                    公安接口配置
                </span>
            </a-tab-pane>
        </a-tabs>
    </a-card>
</template>

<script>
    import PrintTemplate from "./components/printTemplate";
    import PaySettings from "./components/paySettings";
    import PayApiSettings from "./components/payApiSettings";
    import ParamSettings from "./components/paramSettings";
    import WaiterSettings from "./components/waiterSettings";
    import SalesPersonInfo from "./components/salesPersonInfo";
    import DictionaryInfo from "./components/dictionaryInfo";
    import OrderSoundList from "./components/orderSoundList";
    import DoorLockList from "./components/doorLockList";
    import { getAction} from '@/api/manage'
    export default {
        components:{
            DoorLockList,
            OrderSoundList,
            DictionaryInfo,
            SalesPersonInfo,
            WaiterSettings,
            ParamSettings,
            PayApiSettings,
            PaySettings,
            PrintTemplate,
        },
        data() {
            return {
                clearBusiness:false
            }
        },
        methods:{
            toClearBusinessData(){
                var _this = this;
                this.$confirm({
                    title: '提示',
                    content: '此操作将永久删除选中数据，是否继续?',
                    okText: '确认',
                    cancelText: '取消',
                    onOk() {
                        if (_this.clearBusiness){
                            getAction("/business/busRoomBookingOrders/del-bus-data").then(res=>{
                                if(res.success) {

                                    alert("清理成功")
                                } else {
                                    alert("清理失败")
                                }
                            }).catch(s=>{
                                alert("清理失败")
                            })
                        }
                    },
                    onCancel() {
                        console.log('Cancel');
                    },
                });
            }
        }
    }
</script>

<style scoped>
    .main{
        height: 70% !important;
    }
</style>
