<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="icon" href="favicon.ico">
    <title>青河县萨尔托海智慧水务系统</title>

    <link rel="stylesheet" href="css/main.css" />

    <link rel="stylesheet" href="js/lib/element-plus/index.css" />
    <script src="js/lib/vue.global.js"></script>
    <script src="js/lib/element-plus/element-plus.js"></script>
    <script src="js/lib/element-plus/icons-vue.js"></script>

    <script src="js/lib/axios.min.js"></script>
    <script src="js/lib/httpVueLoader.js"></script>
</head>
<body>
    <div id="app">
        <div id="loader-wrapper" v-if="loading">
            <div id="loader"></div>
            <div class="loader-section section-left"></div>
            <div class="loader-section section-right"></div>
            <div class="load_title">正在加载系统资源,请耐心等待</div>
        </div>


    </div>
<script>
    const { createApp, ref, onMounted, h } = Vue
    const loading = ref(true)

    const Http = axios.create({
        baseURL: location.pathname.substr(0, location.pathname.lastIndexOf('/')),
        timeout: 1000,
        headers: {'X-Custom-Header': 'foobar'}
    });
    const $message = ElementPlus.ElMessage;
    const $confirm = ElementPlus.ElMessageBox;

    var app = Vue.createApp({
        el: '#app',
        data() {
            return {
                ddd: true
            }
        },
        methods: {
            funcA() {
                console.log(this.ddd);
                $message('这是一条普通info消息');
                $message.success('恭喜你,这是一条成功消息');
                $message.warning('警告哦,这是一条警告消息');
                $message.error('错了哦,这是一条错误消息');
                $message({
                    message: h('p', { style: 'line-height: 1; font-size: 14px' }, [
                        h('span', null, '这是一条自定义样式的消息 '),
                        h('i', { style: 'color: teal' }, 'VNode'),
                    ])
                });
            }
        },

        mounted: () => {
            //$message('这是一条普通info消息');

            Http.post('/quartz/listTask', {
                limit: 10,
                page: 1
            })
            .then(function (response) {
                console.log(response);
            })
            .catch(function (error) {
                console.log(error);
            });
        },

        setup() {
            const testNum1 = ref(123456);

            const funB = () => {
                alert('bbb');
            }

            onMounted(() => {
                loading.value = false
            })
            return { testNum1, funB }
        }
    })
    app.use(ElementPlus)
    app.mount("#app")
</script>
</body>
</html>