<!--
 * @Title: 
 * @Description: 
 * @Author: swp
 * @Date: 2022-08-24 10:49:21
 * @LastEditors: 
 * @LastEditTime: 2022-08-24 10:49:21
-->
<template>
    <div>
        <el-row>
            <el-col :span="4">
                <div class="box">
                    <el-scrollbar>
                        <basic-container>
                            <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick">
                                <span class="el-tree-node__label" slot-scope="{ node, data }">
                                    <span>
                                        <i class="el-icon-office-building"></i>
                                        {{ (node || {}).label }}
                                    </span>
                                </span>
                            </avue-tree>
                        </basic-container>
                    </el-scrollbar>
                </div>
            </el-col>
            <el-col :span="20">
                <basic-container>
                    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page"
                        :before-open="beforeOpen" ref="crud" v-model="form" :permission="permissionList" @row-del="rowDel"
                        @row-update="rowUpdate" @row-save="rowSave" @search-change="searchChange"
                        @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
                        @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"
                        @before-open="beforeOpen" @select-change="selectChange">
                        <!-- <template slot-scope="scope" slot="menuLeft">
                            <el-button v-if="permissionList.importBtn" type="primary" icon="el-icon-upload2" size="small"
                                @click="toRtuImpoartHandler">导入测站</el-button>
                            <el-button v-if="permissionList.importBtn" type="primary" icon="el-icon-finished" size="small"
                                @click="toRtuImportHistoryHandler">测站导入历史</el-button>
                            <el-button v-if="permissionList.importBtn" type="primary" icon="el-icon-download" size="small"
                                @click="downloadTemplate">测站信息模板下载</el-button> -->
                        <!-- <el-button v-if="permissionList.videoSiteAdd" type="primary" icon="el-icon-plus" size="small"
                                @click="toAddVideoSite">添加视频站</el-button> -->
                        <!-- </template> -->

                        <template slot-scope="{ row, index }" slot="menu">
                            <el-button type="text" size="small" icon="el-icon-link" @click="toBindProject(row)">项目绑定
                            </el-button>
                        </template>
                    </avue-crud>
                </basic-container>
            </el-col>
        </el-row>
        <!-- <el-drawer :visible.sync="rtuImportHistoryDialog" v-if="rtuImportHistoryDialog" title="测站导入操作记录" direction="rtl"
            size="60%" append-to-body="true">
            <rtuImportHistoryView ref="rtuImportHistoryView"></rtuImportHistoryView>
        </el-drawer>
        <el-dialog title="测站导入向导" :visible.sync="rtuImportDialog" width="60%" height="60%" :close-on-click-modal="false"
            append-to-body :v-loading="importLoading" v-if="rtuImportDialog">
            <rtuImportView :importLoading="importLoading" :visible.sync="rtuImportDialog" ref="rtuImportView">
            </rtuImportView>
        </el-dialog> -->
        <!-- <el-dialog title="添加视频站" :visible.sync="videoSiteAddDialog" width="60%" height="60%" :close-on-click-modal="false"
            append-to-body :v-loading="importLoading" v-if="videoSiteAddDialog">
            <videositeadd :importLoading="importLoading" :visible.sync="videoSiteAddDialog" ref="videositeadd"
                @fevent="update_table">
            </videositeadd>

        </el-dialog> -->

        <el-dialog title="项目配置" :visible.sync="bindProjectDialog" v-if="bindProjectDialog" width="600px"
            :before-close="handleClose" :close-on-click-modal="false" append-to-body>
            <avue-form :option="bindProjectOption" v-model="bindProjectEditForm" @submit="bindProjectSubmit"
                @reset-change="bindProjectReset"></avue-form>

            <!-- <el-form label-width="120px">
                <el-form-item label="预警总开关">
                    <el-switch v-model="warningConfig.configSw" active-color="#13ce66" inactive-color="#ff4949"
                        active-text="开" inactive-text="关">
                    </el-switch>
                </el-form-item>
                <el-form-item label="延时配置">
                    <el-input placeholder="请输入延时时长" v-model="warningConfig.delayTime">
                        <template slot="append">单位分钟</template>
                    </el-input>
                </el-form-item>
                <el-form-item label="">
                    <label>延时时长用于测站离线预警监测，当超过配置的时长时触发预警,默认2小时</label>
                </el-form-item>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="bindProjectDialog = false" size="small">取 消</el-button>
                <el-button type="primary" @click="bindProjectOkClick" size="small">确 定</el-button>
            </span> -->
        </el-dialog>
    </div>
</template>

<script>
import { getPage, getDetail, add, update, remove, bindProject } from "@/api/baseinfo/rtu.js";
import { getTree } from "@/api/baseinfo/project.js";
// import { getTree } from "@/api/baseinfo/region.js";
// import { getStore } from '@/util/store.js';
import { mapGetters } from "vuex";
// import rtuImportHistoryView from './rtuimport.vue';
// import rtuImportView from './rtuImportProcess.vue';
// import videositeadd from './videositeadd.vue';
export default {
    components: {
        // rtuImportView,
        // rtuImportHistoryView,
        // videositeadd
    },
    data() {
        return {
            importLoading: false,
            rtuImportDialog: false,
            rtuImportHistoryDialog: false,
            videoSiteAddDialog: false,
            id: "",
            post_code: '0',
            form: {},
            selectionList: [],
            query: {},
            loading: true,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            bindProjectEditForm: {
                id: '',
                projectId: ''
            },
            bindProjectOption: {
                column: [
                    {
                        label: '所属项目',
                        prop: 'projectId',
                        type: 'select',
                        span: 24,
                        props: {
                            label: 'projectName',
                            value: 'id'
                        },
                        dicUrl: 'api/galaxy-business/base/project/org/list',
                        rules: [
                            {
                                required: true,
                                message: "请选择项目",
                                trigger: "click",
                            },
                        ],
                    }
                ]
            },
            bindProjectDialog: false,
            treeCode: '',
            treeParentCode: '',
            treeData: [],
            treeOption: {
                nodeKey: "id",
                defaultExpandedKeys: [],
                lazy: false,
                // treeLoad: function (node, resolve) {
                //     const parentCode = (node.level === 0) ? "00" : node.data.value;
                //     getLazyTree(parentCode).then(res => {
                //         resolve(res.data.data.map(item => {
                //             return {
                //                 ...item,
                //                 leaf: !item.hasChildren
                //             }
                //         }))
                //     });
                // },
                addBtn: false,
                menu: true,
                size: "small",
                props: {
                    labelText: "标题",
                    label: "title",
                    value: "value",
                    children: "children",
                },
            },
            option: {
                labelWidth: 140,
                viewLabelWidth: 140,
                searchLabelWidth: 140,
                height: "auto",
                calcHeight: 80,
                align: "center",
                headerAlign: "center",
                lazy: false,
                tip: false,
                simplePage: true,
                searchShow: true,
                searchMenuSpan: 6,
                tree: true,
                border: true,
                index: true,
                selection: false,
                viewBtn: true,
                viewTitle: "测站信息",
                editBtn: true,
                delBtn: true,
                addBtn: true,
                addBtnText: "添加测站",
                menuWidth: 220,
                dialogType: "drawer",
                dialogClickModal: false,
                columnBtn: false,
                column: [
                    {
                        label: "站点编码",
                        prop: "rtuCode",
                        search: true,
                        span: 24,
                        width: 120,
                        // tip: '*编码仅支持字母+数字的编码组合，长度为20个字符',
                        rules: [
                            {
                                required: true,
                                message: "请录入站点编码",
                                trigger: "click",
                            },
                        ],
                    },
                    {
                        label: "站点名称",
                        prop: "rtuName",
                        search: true,
                        span: 24,
                        rules: [
                            {
                                required: true,
                                message: "请录入站点名称",
                                trigger: "click",
                            },
                        ],

                    },
                    // {
                    //     label: "测站类型",
                    //     prop: "rtuKindDesc",
                    //     span: 24,
                    //     editDisplay: false,
                    //     addDisplay: false,
                    //     display: false,
                    // },
                    // {
                    //     label: '测站类型',
                    //     prop: 'rtuKind',
                    //     type: 'select',
                    //     hide: true,
                    //     editDisplay: false,
                    //     addDisplay: false,
                    //     display: false,
                    //     search: true,
                    //     props: {
                    //         label: 'name',
                    //         value: 'code'
                    //     },
                    //     span: 6,
                    //     dicData: [{
                    //         name: '雨量站',
                    //         code: 1
                    //     }, {
                    //         name: '水位站',
                    //         code: 2
                    //     }, {
                    //         name: '墒情站',
                    //         code: 3
                    //     }, {
                    //         name: '视频站',
                    //         code: 4
                    //     }],
                    // },
                    // {
                    //     label: '测站类型',
                    //     prop: 'siteKind',
                    //     type: 'checkbox',
                    //     hide: true,
                    //     props: {
                    //         label: 'name',
                    //         value: 'code'
                    //     },
                    //     span: 24,
                    //     dicData: [{
                    //         name: '雨量站',
                    //         code: "1"
                    //     }, {
                    //         name: '河道水位站',
                    //         code: "2"
                    //     }, {
                    //         name: '水库水位站',
                    //         code: "3"
                    //     }, {
                    //         name: '墒情站',
                    //         code: "4"
                    //     }, {
                    //         name: '视频站',
                    //         code: "5"
                    //     }],
                    //     rules: [
                    //         {
                    //             message: "请选择站点类型",
                    //             trigger: "click",
                    //             required: true,
                    //         },
                    //     ],
                    // },
                    // {
                    //     label: "盟市",
                    //     prop: "adCity",
                    //     span: 24,
                    //     editDisplay: false,
                    //     addDisplay: false,
                    // },
                    // {
                    //     label: "盟市",
                    //     prop: "adCityCode",
                    //     span: 24,
                    //     hide: true,
                    //     type: 'select',
                    //     props: {
                    //         label: 'adnm',
                    //         value: 'adcd'
                    //     },
                    //     cascader: ['adCode'],
                    //     dicUrl: `api/galaxy-business/baseinfo/region/children/list`,
                    //     rules: [
                    //         {
                    //             required: true,
                    //             message: "请录入盟市名称",
                    //             trigger: "click",
                    //         },
                    //     ],
                    // },
                    // {
                    //     label: "旗县区",
                    //     prop: "adDist",
                    //     span: 24,
                    //     editDisplay: false,
                    //     addDisplay: false,
                    // },
                    // {
                    //     label: "旗县区",
                    //     prop: "adCode",
                    //     span: 24,
                    //     hide: true,
                    //     type: 'select',
                    //     props: {
                    //         label: 'adnm',
                    //         value: 'adcd'
                    //     },
                    //     dicUrl: `api/galaxy-business/baseinfo/region/children/list/{{adCityCode}}`,
                    //     rules: [
                    //         {
                    //             required: true,
                    //             message: "请录入旗县区",
                    //             trigger: "click",
                    //         },
                    //     ],
                    // },
                    // {
                    //     label: "运维单位",
                    //     prop: "manageCompany",
                    //     span: 24,
                    // },
                    {
                        label: "所属项目",
                        prop: "projectName",
                        span: 24,
                        addDisplay: false,
                        editDisplay: false,
                        viewDisplay: false
                    },
                    {
                        label: '所属项目',
                        prop: 'projectId',
                        type: 'select',
                        span: 24,
                        props: {
                            label: 'projectName',
                            value: 'id'
                        },
                        dicUrl: 'api/galaxy-business/base/project/org/list',
                        rules: [
                            {
                                required: true,
                                message: "请选择项目",
                                trigger: "click",
                            },
                        ],
                        hide: true,
                    },
                    {
                        label: "经度",
                        prop: "lng",
                        span: 24,
                        hide: true,
                    },
                    {
                        label: "纬度",
                        prop: "lat",
                        span: 24,
                        hide: true,
                    },
                    {
                        label: "测站位置",
                        prop: "locationDesc",
                        span: 24,
                        hide: true,
                    },
                    {
                        label: "行政区划编码",
                        prop: "adCode",
                        span: 24,
                        tip: "请录入县级行政区划编码",
                    },
                    {
                        label: "证照编号",
                        prop: "siteCertId",
                        span: 24,
                    },
                    {
                        label: '站点建设来源类型',
                        prop: 'siteOwner',
                        type: 'select',
                        props: {
                            label: 'name',
                            value: 'code'
                        },
                        span: 24,
                        dicData: [{
                            name: '国控转计量',
                            code: '1'
                        }, {
                            name: '用户安装的计量设施',
                            code: '2'
                        }, {
                            name: '中央专项资金',
                            code: '3'
                        }],
                    }, {
                        label: '是否同步到金水',
                        prop: 'dataShareActive',

                        type: 'radio',
                        props: {
                            label: 'name',
                            value: 'code'
                        },
                        span: 24,
                        dicData: [{
                            name: '否',
                            code: 1
                        }, {
                            name: '同步',
                            code: 2
                        }],
                    },

                    // {
                    //     label: "RTU品牌",
                    //     prop: "rtuBrand",
                    //     span: 24,
                    //     hide: true,
                    // },
                    // {
                    //     label: "RTU型号",
                    //     prop: "rtuModel",
                    //     span: 24,
                    //     hide: true,
                    // },
                    // {
                    //     label: "RTU更换时间",
                    //     prop: "rtuReplaceDate",
                    //     span: 24,
                    //     hide: true,
                    //     type: "date",
                    //     valueFormat: 'yyyy-MM-dd',
                    // },
                    // {
                    //     label: "雨量传感器品牌",
                    //     prop: "rainSensorBrand",
                    //     span: 24,
                    //     hide: true,
                    // },
                    // {
                    //     label: "雨量传感器型号",
                    //     prop: "rainSensorModel",
                    //     span: 24,
                    //     hide: true,
                    // },
                    // {
                    //     label: "雨量传感器更换时间",
                    //     prop: "rainSensorReplaceDate",
                    //     span: 24,
                    //     hide: true,
                    //     type: "date",
                    //     valueFormat: 'yyyy-MM-dd',
                    // },
                    // {
                    //     label: "水位计传感器品牌",
                    //     prop: "waterSensorBrand",
                    //     span: 24,
                    //     hide: true,
                    // },
                    // {
                    //     label: "水位计传感器型号",
                    //     prop: "waterSensorModel",
                    //     span: 24,
                    //     hide: true,
                    // },
                    // {
                    //     label: "水位计传感器类型",
                    //     prop: "waterSensorType",
                    //     span: 24,
                    //     hide: true,
                    //     type: 'radio',
                    //     // dicData: [{
                    //     //     label: '雷达',
                    //     //     value: 1
                    //     // }, {
                    //     //     label: '超声波',
                    //     //     value: 2
                    //     // }],
                    //     props: {
                    //         label: 'dictValue',
                    //         value: 'id'
                    //     },
                    //     dicUrl: '/api/galaxy-system/dict-biz/dictionary?code=water_level_sensor_type',
                    // },
                    // {
                    //     label: "水位计传感器更换时间",
                    //     prop: "waterSensorReplaceDate",
                    //     span: 24,
                    //     hide: true,
                    //     type: "date",
                    //     valueFormat: 'yyyy-MM-dd',
                    // },
                    // {
                    //     label: "墒情传感器品牌",
                    //     prop: "groundSensorBrand",
                    //     span: 24,
                    //     hide: true,
                    // },
                    // {
                    //     label: "墒情传感器型号",
                    //     prop: "groundSensorModel",
                    //     span: 24,
                    //     hide: true,
                    // },
                    // {
                    //     label: "墒情传感器类型",
                    //     prop: "groundSensorType",
                    //     span: 24,
                    //     hide: true,
                    //     type: 'radio',
                    //     props: {
                    //         label: 'dictValue',
                    //         value: 'id'
                    //     },
                    //     dicUrl: '/api/galaxy-system/dict-biz/dictionary?code=ground_water_sensor_type',
                    // },
                    // {
                    //     label: "墒情传感器更换时间",
                    //     prop: "groundSensorReplaceDate",
                    //     span: 24,
                    //     hide: true,
                    //     type: "date",
                    //     valueFormat: 'yyyy-MM-dd',
                    // },
                    // {
                    //     label: "供电系统电池型号",
                    //     prop: "batteryModel",
                    //     span: 24,
                    //     hide: true,
                    // },
                    // {
                    //     label: "供电系统电池更换时间",
                    //     prop: "batteryReplaceDate",
                    //     span: 24,
                    //     hide: true,
                    //     type: "date",
                    //     valueFormat: 'yyyy-MM-dd',
                    // },
                    // {
                    //     label: "太阳能板型号",
                    //     prop: "sunPowerModel",
                    //     span: 24,
                    //     hide: true,
                    // },
                    // {
                    //     label: "太阳能控制器品牌",
                    //     prop: "sunPowerControllerBrand",
                    //     span: 24,
                    //     hide: true,
                    // },
                    // {
                    //     label: "太阳能控制器型号",
                    //     prop: "sunPowerControllerModel",
                    //     span: 24,
                    //     hide: true,
                    // },
                    // {
                    //     label: "SIN卡号",
                    //     prop: "networkSimId",
                    //     span: 24,
                    //     hide: true,
                    // },
                    // {
                    //     label: "开卡单位",
                    //     prop: "networkPayer",
                    //     span: 24,
                    //     hide: true,
                    // },
                    // {
                    //     label: "缴费截止时间",
                    //     prop: "networkPayEndDate",
                    //     span: 24,
                    //     hide: true,
                    //     type: "date",
                    //     valueFormat: 'yyyy-MM-dd',
                    // },
                    // {
                    //     label: "是否北斗通信",
                    //     prop: "isSatellite",
                    //     span: 24,
                    //     hide: true,
                    //     type: 'radio',
                    //     dicData: [{
                    //         label: '否',
                    //         value: 0
                    //     }, {
                    //         label: '是',
                    //         value: 1
                    //     }],
                    // },
                    // {
                    //     label: "北斗通讯类型",
                    //     prop: "satelliteModel",
                    //     span: 24,
                    //     hide: true,
                    //     type: 'radio',
                    //     props: {
                    //         label: 'dictValue',
                    //         value: 'id'
                    //     },
                    //     dicUrl: '/api/galaxy-system/dict-biz/dictionary?code=satellite_model',
                    // },
                    {
                        label: "备注说明",
                        prop: "remark",
                        span: 24,
                        type: "textarea",
                        hide: true
                    },
                ],
            },
            data: [],
        };
    },
    computed: {
        ...mapGetters(["userInfo", "permission"]),
        permissionList() {
            // if (this.post_code == '0') {
            //     return {
            //         addBtn: this.vaildData(this.permission.rtu_add, false),
            //         viewBtn: this.vaildData(this.permission.rtu_view, false),
            //         delBtn: this.vaildData(this.permission.rtu_del, false),
            //         editBtn: this.vaildData(this.permission.rtu_edit, false),
            //         importBtn: this.vaildData(this.permission.rtu_import, false),
            //         videoSiteAdd: this.vaildData(this.permission.video_site_add, false),
            //     };
            // } else {
            return {
                // addBtn: false,
                // viewBtn: true,
                // delBtn: false,
                // editBtn: false,
                // importBtn: false,
                // videoSiteAdd: false
            };
            // }
        },
    },
    created() {
        // let u = getStore({ name: 'userInfo' });
        // console.log(JSON.stringify(u));
        // if (u.post_id == this.website.nm_post_code_sysadmin_id) {
        //     this.post_code = this.website.nm_post_code_sysadmin_code;
        // } else if (u.post_id == this.website.nm_post_code_office_personnel_id) {
        //     this.post_code = this.website.nm_post_code_office_personnel_code;
        // }
        this.initTree();
    },
    methods: {
        initTree() {
            this.treeData = [];
            getTree().then(res => {
                this.treeData = res.data.data.map(item => {
                    return {
                        ...item,
                        leaf: !item.hasChildren
                    }
                })
                this.treeOption.defaultExpandedKeys.push(this.treeData[0].id);
                this.treeCode = this.treeData[0].id;
            });
        },
        update_table() {
            this.onLoad(this.page, this.query);
        },
        toBindProject(row) {
            this.bindProjectDialog = true;
            this.bindProjectEditForm.id = row.id;
            this.bindProjectEditForm.projectId = row.projectId;
        },
        bindProjectSubmit(form, done) {
            console.log(JSON.stringify(form))
            // this.$message({
            //     type: "success",
            //     message: JSON.stringify(form),
            // });
            bindProject(form).then(
                () => {
                    this.onLoad(this.page);
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    });
                    this.bindProjectDialog = false;
                    done();
                },
                (error) => {
                    window.console.log(error);
                }
            );

        },
        bindProjectReset() {
            this.bindProjectEditForm.id = '';
            this.bindProjectEditForm.projectId = '';
        },
        // toRtuImpoartHandler() {
        //     this.rtuImportDialog = true;
        // },
        // toRtuImportHistoryHandler() {
        //     this.rtuImportHistoryDialog = true;
        // },
        // toAddVideoSite() {
        //     this.videoSiteAddDialog = true;
        //     this.$nextTick(() => {
        //         this.$refs["videositeadd"].init();
        //     });
        // },
        // downloadTemplate() {
        //     window.open('/file/download/template/站点信息记录表模板.xlsx')
        // },
        nodeClick(data) {
            this.treeCode = data.id;
            this.treeParentCode = data.parentId;
            this.query = {};
            this.query['projectId'] = this.treeCode;
            this.page.currentPage = 1;
            var params = {};
            this.onLoad(this.page, params);
        },
        searchReset() {
            this.query = {};
            this.query['projectId'] = this.treeCode;
            this.page.currentPage = 1;
            this.onLoad(this.page);
        },
        searchChange(params, done) {
            this.query = params;
            this.query['projectId'] = this.treeCode;
            this.page.currentPage = 1;
            this.onLoad(this.page, params);
            done();
        },
        currentChange(currentPage) {
            console.log("currentPage " + currentPage);
            this.page.currentPage = currentPage;
        },
        sizeChange(pageSize) {
            this.page.pageSize = pageSize;
        },
        refreshChange() {
            var params = {};
            this.onLoad(this.page, params);
        },
        selectionChange(list) {
            this.selectionList = list;
        },
        selectChange(item) {
            console.log(JSON.stringify(item));
        },
        selectionClear() {
            this.selectionList = [];
            this.$refs.crud.toggleSelection();
        },
        rowSave(row, done, loading) {
            console.log(JSON.stringify(row))
            add(row).then(
                () => {
                    this.onLoad(this.page);
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    });
                    done();
                },
                (error) => {
                    window.console.log(error);
                    loading();
                }
            );
        },
        rowUpdate(row, index, done, loading) {
            update(row).then(
                () => {
                    this.onLoad(this.page);
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    });
                    done();
                },
                (error) => {
                    window.console.log(error);
                    loading();
                }
            );
        },
        rowDel(row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(row.id);
                })
                .then(() => {
                    this.onLoad(this.page);
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    });
                });
        },
        handleDelete() {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据");
                return;
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    return remove(this.ids);
                })
                .then(() => {
                    this.onLoad(this.page);
                    this.$message({
                        type: "success",
                        message: "操作成功!",
                    });
                    this.$refs.crud.toggleSelection();
                });
        },
        beforeOpen(done, type) {
            if (["edit", "view"].includes(type)) {
                getDetail(this.form.id).then((res) => {
                    this.form = res.data.data;
                });
            }
            done();
        },
        onLoad(page, params = {}) {
            this.loading = true;
            getPage(
                page.currentPage,
                page.pageSize,
                Object.assign(params, this.query)
            ).then((res) => {
                const data = res.data.data;
                this.page.total = data.total;
                this.data = data.records;
                this.loading = false;
                this.selectionClear();
            });
        },
    },
};
</script>
<style>
.box {
    height: 800px;
}

.el-scrollbar {
    height: 100%;
}

.box .el-scrollbar__wrap {
    overflow: scroll;
}
</style>
