<!DOCTYPE html>
<html>
<head>
    <title>文章表</title>
		<#include "/header.html">
            <style>
                #cteditor {
                    width: 1024px;
                    height: 50px;
                }
            </style>
</head>
<body>
<div id="cteditor" type="text/plain"></div>
<!--<textarea name="content" id="content" style="width:500px;height: 30px;"></textarea>-->
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
			<#if shiro.hasPermission("sys:rdarticle:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("sys:rdarticle:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("sys:rdarticle:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
					<div class="form-group">
                        <div class="col-sm-2 control-label">栏目</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.siteName" @click="siteTree" readonly="readonly" placeholder="栏目"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">标题</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.title" placeholder="标题"/>
                        </div>
                    </div>
											                    <div class="form-group" style="display: none;">
                        <div class="col-sm-2 control-label">状态，0：隐藏，1：显示</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.status" placeholder="状态，0：隐藏，1：显示"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">排序</div>
                        <div class="col-sm-10">
                            <input type="number" class="form-control" v-model="rdArticle.sort" placeholder="排序"/>
                        </div>
                    </div>
											                    <div class="form-group" style="display: none;">
                        <div class="col-sm-2 control-label">是否推荐，0：否，1：是</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.isRecommend" placeholder="是否推荐，0：否，1：是"/>
                        </div>
                    </div>
											                    <div class="form-group" style="display: none;">
                        <div class="col-sm-2 control-label">是否置顶，0：否，1：是</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.isTop" placeholder="是否置顶，0：否，1：是"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">简介</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.introduction" placeholder="简介"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-2 control-label">内容</div>
                        <div class="col-sm-10">
                            <!--<script id="editor" type="text/plain" style="width:1024px;height:500px;"></script>-->
                            <input type="text" class="form-control" v-model="rdArticle.content" placeholder="内容"/>
                            <!--<ueditor ref="ue" :content="content" :ueconfig="ueconfig" :id="'ueditor-1'" />-->
                        </div>
                    </div>

						<div class="form-group" style="display: none;">
                        <div class="col-sm-2 control-label">点击量</div>
                        <div class="col-sm-10">
                            <input type="number" class="form-control" v-model="rdArticle.clicks" placeholder="点击量"/>
                        </div>
                    </div>
											                    <div class="form-group" style="display: none;">
                        <div class="col-sm-2 control-label">添加时间</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.addTime" placeholder="添加时间"/>
                        </div>
                    </div>
											                    <div class="form-group" style="display: none;">
                        <div class="col-sm-2 control-label">添加IP</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.addIp" placeholder="添加IP"/>
                        </div>
                    </div>
											                    <div class="form-group" style="display: none;">
                        <div class="col-sm-2 control-label">图片路径</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.picPath" placeholder="图片路径"/>
                        </div>
                    </div>
											                    <div class="form-group" style="display: none;">
                        <div class="col-sm-2 control-label">创建人ID</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.userId" placeholder="创建人ID"/>
                        </div>
                    </div>
											                    <div class="form-group" style="display: none;">
                        <div class="col-sm-2 control-label">人员所属部门ID</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.deptId" placeholder="人员所属部门ID"/>
                        </div>
                    </div>
											                    <div class="form-group" style="display: none;">
                        <div class="col-sm-2 control-label">部门</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.deptName" placeholder="部门"/>
                        </div>
                    </div>
											                    <div class="form-group" style="display: none;">
                        <div class="col-sm-2 control-label">创建人</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.creator" placeholder="创建人"/>
                        </div>
                    </div>
											                    <div class="form-group" style="display: none;">
                        <div class="col-sm-2 control-label">更新时间</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.updateTime" placeholder="更新时间"/>
                        </div>
                    </div>
											                    <div class="form-group" style="display: none;">
                        <div class="col-sm-2 control-label">更新人</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.editor" placeholder="更新人"/>
                        </div>
                    </div>
											                    <div class="form-group" style="display: none;">
                        <div class="col-sm-2 control-label">发布时间</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.releaseTime" placeholder="发布时间"/>
                        </div>
                    </div>
											                    <div class="form-group" style="display: none;">
                        <div class="col-sm-2 control-label">发布人</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="rdArticle.releaser" placeholder="发布人"/>
                        </div>
                    </div>
							            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" id="btnSaveOrUpdate" data-loading-text="保存中..." @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>
<!-- 选择栏目-->
<div id="siteLayer" style="display: none;padding:10px;">
    <ul id="siteTree" class="ztree"></ul>
</div>

<template>
    <script
            :id="id"
            type="text/plain"/>
</template>

<script src="${request.contextPath}/statics/js/modules/sys/rdarticle.js?_${.now?long}"></script>
<script src="${request.contextPath}/statics/plugins/ueditor/ueditor.config.js"></script>
<script src="${request.contextPath}/statics/plugins/ueditor/ueditor.all.min.js"></script>
<script src="${request.contextPath}/statics/plugins/ueditor/lang/zh-cn/zh-cn.js"></script>

<script>
    UE.getEditor('cteditor');
</script>
<!--<script src="${request.contextPath}/statics/plugins/ueditor/ueditor.parse.min.js"></script>-->

<!--<script>-->
    <!--export default {-->
        <!--name: "UE",-->
        <!--props: {-->
            <!--content: {-->
                <!--type: String,-->
                <!--default: ""-->
            <!--},-->
            <!--ueconfig: {-->
                <!--type: Object-->
            <!--},-->
            <!--id: {-->
                <!--type: String-->
            <!--}-->
        <!--},-->
        <!--data() {-->
            <!--return {-->
                <!--editor: null-->
            <!--};-->
        <!--},-->
        <!--mounted() {-->
            <!--const _this = this;-->
            <!--_this.editor = UE.getEditor(_this.id, _this.ueconfig); // 初始化UE-->
            <!--_this.editor.addListener("ready", function() {-->
                <!--_this.editor.setContent(_this.content); // 确保UE加载完成后，放入内容。-->
            <!--});-->
        <!--},-->
        <!--destroyed() {-->
            <!--this.editor.destroy();-->
        <!--},-->
        <!--methods: {-->
            <!--getContentTxt() {-->
                <!--// 获取内容方法 原 getContent()-->
                <!--return this.editor.getContentTxt();-->
            <!--}-->
        <!--},-->
    <!--};-->
<!--</script>-->
</body>
</html>