<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/head :: head(links)"/>
<body>
<div class="ok-body" id="app" v-cloak>
    <template>
        <i-form ref="checkForm" :model="notice" :rules="ruleValidate" :label-width="100">
             <form-item prop="content" label="内容：">
                 <i-input maxlength="500" v-model="notice.content" :autosize="{minRows: 5,maxRows: 5}"  type="textarea" placeholder="请输入内容"></i-input>
             </form-item>
        </i-form>
    </template>
</div>
<div th:replace="common/foot :: foot(script)"></div>
<script th:inline="none">
var vm = new Vue({
    el: '#app',
    data:{
        notice:{
            channel:'SPTools'
        },
        ruleValidate : {
                 content: [
                    { required: true, message: '内容不能为空', trigger: 'blur' }
                 ]
		}
    },
    methods: {
        acceptClick : function(dialog){
          vm.$refs.checkForm.validate(function(valid){
            if (valid) {
                layui.use(["okUtils", "okLayer"], function () {
                     okUtils = layui.okUtils;
                     okLayer = layui.okLayer;
                     okUtils.ajaxCloud({
                        url:"/app/notice/save",
                        param : vm.notice,
                        json:true,
                        success : function(result) {
                             okLayer.msg.greenTick(result.msg, function () {
                                  dialog.load();
                             })
                        }
                    });
                });
            }
          });
	    }
    },
    created: function() {

    }
});
</script>
</body>
</html>
