|
@@ -0,0 +1,171 @@
|
|
|
+<!DOCTYPE HTML>
|
|
|
+<html xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-model="http://www.w3.org/1999/xhtml">
|
|
|
+<head>
|
|
|
+ <meta charset="utf-8">
|
|
|
+ <script type="text/javascript">
|
|
|
+ var localObj = window.location;
|
|
|
+ var contextPath = localObj.pathname.split("/")[1];
|
|
|
+ console.log("contextPath "+contextPath);
|
|
|
+
|
|
|
+ if(contextPath!="admin"){
|
|
|
+ window.UEDITOR_SERVER_URL = "/"+contextPath;
|
|
|
+ }else{
|
|
|
+ window.UEDITOR_SERVER_URL = "";
|
|
|
+ }
|
|
|
+ console.log("window.UEDITOR_SERVER_URL "+window.UEDITOR_SERVER_URL );
|
|
|
+ </script>
|
|
|
+ <meta name="renderer" content="webkit|ie-comp|ie-stand">
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
+ <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
|
|
+ <meta http-equiv="Cache-Control" content="no-siteapp" />
|
|
|
+ <LINK rel="Bookmark" href="/favicon.ico" >
|
|
|
+ <LINK rel="Shortcut Icon" href="/favicon.ico" />
|
|
|
+ <link rel="stylesheet" type="text/css" href="../static/admin/manage/h-ui/css/H-ui.min.css" />
|
|
|
+ <link rel="stylesheet" type="text/css" href="../static/admin/manage/h-ui.admin/css/H-ui.admin.css" />
|
|
|
+ <link rel="stylesheet" type="text/css" href="../static/admin/manage/Hui-iconfont/1.0.7/iconfont.css" />
|
|
|
+ <link rel="stylesheet" type="text/css" href="../static/admin/manage/icheck/icheck.css" />
|
|
|
+ <link rel="stylesheet" type="text/css" href="../static/admin/manage/h-ui.admin/skin/default/skin.css" id="skin" />
|
|
|
+ <link rel="stylesheet" type="text/css" href="../static/admin/manage/h-ui.admin/css/style.css" />
|
|
|
+ <link rel="stylesheet" type="text/css" href="../static/admin/css/layui.css" />
|
|
|
+ <title>新增文章 - 资讯管理 - H-ui.admin v2.3</title>
|
|
|
+ <meta name="keywords" content="H-ui.admin v2.3,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
|
|
|
+ <meta name="description" content="H-ui.admin v2.3,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
|
|
|
+
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<nav class="breadcrumb">
|
|
|
+ <i class="Hui-iconfont"></i> 首页
|
|
|
+ <span class="c-gray en">></span> 新闻资讯
|
|
|
+ <span class="c-gray en">></span> 新增新闻
|
|
|
+ <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont"></i></a>
|
|
|
+</nav>
|
|
|
+<article class="page-container" id="app" >
|
|
|
+ <form class="form form-horizontal" action="updatanews" id="addtra" method="post" enctype="multipart/form-data" >
|
|
|
+
|
|
|
+
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-xs-4 col-sm-2">标题:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
+ <input type="text" class="input-text" v-bind:value="news.title" placeholder="请输入标题" id="title" name="title">
|
|
|
+ <input type="hidden" v-bind:value="news.id" name="id">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-xs-4 col-sm-2">概要说明:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
+ <input type="text" class="input-text" v-bind:value="news.outline" value="" placeholder="请输入概要说明" id="outline" name="outline">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-xs-4 col-sm-2">封面图:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
+ <input type="file" class="input-text" value="" placeholder="请输入概要说明" name="fileimg">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-xs-4 col-sm-2">详细信息:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
+ <script id="editor" name="content" type="text/plain" style="width:100%;height:400px;" ></script></div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
|
|
|
+ <input class="btn btn-primary radius" type="submit" value="添加">
|
|
|
+ <a class="btn btn-primary radius" href="newslist.html" >关闭</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+</article>
|
|
|
+ <script type="text/javascript" src="../static/admin/js/jquery-1.7.2.min.js"></script>
|
|
|
+ <script type="text/javascript" src="../static/admin/manage/icheck/jquery.icheck.min.js"></script>
|
|
|
+ <script type="text/javascript" src="../static/admin/manage/h-ui/js/H-ui.js"></script>
|
|
|
+ <script type="text/javascript" src="../static/admin/manage/js/layui.js"></script>
|
|
|
+ <script type="text/javascript" src="../static/admin/manage/h-ui.admin/js/H-ui.admin.js"></script>
|
|
|
+ <script type="text/javascript" src="../static/admin/manage/js/jquery.validate.min.js"></script>
|
|
|
+ <script type="text/javascript" src="../static/admin/manage/js/validate-methods.js"></script>
|
|
|
+ <script type="text/javascript" src="../static/admin/manage/js/messages_zh.min.js"></script>
|
|
|
+ <!-- 百度文本编辑器 引用文件 -->
|
|
|
+ <link href="../static/ue/themes/default/css/ueditor.css" type="text/css" rel="stylesheet">
|
|
|
+ <script src="../static/ue/ueditor.config.js" type="text/javascript"></script>
|
|
|
+ <script src="../static/ue/ueditor.all.js" type="text/javascript"></script>
|
|
|
+ <script type="text/javascript" src="../static/ue/lang/zh-cn/zh-cn.js"></script>
|
|
|
+ <script type="text/javascript" src="../static/js/ajaxfileupload.js"></script>
|
|
|
+<script type="text/javascript" src="../static/admin/js/vue.js"></script>
|
|
|
+ <script type="text/javascript">
|
|
|
+
|
|
|
+ $(function(){
|
|
|
+ $("#addtra").validate({
|
|
|
+ rules:{
|
|
|
+ title:{
|
|
|
+ required:true,
|
|
|
+ },
|
|
|
+ outline:{
|
|
|
+ required:true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ onkeyup:false,
|
|
|
+ focusCleanup:true,
|
|
|
+ success:"valid",
|
|
|
+ submitHandler:function(form){
|
|
|
+ $(form).ajaxSubmit();
|
|
|
+ var index = parent.layer.getFrameIndex(window.name);
|
|
|
+ parent.$('.btn-refresh').click();
|
|
|
+ parent.layer.close(index);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ var ue = UE.getEditor('editor');
|
|
|
+ $(function(){
|
|
|
+ $('.skin-minimal input').iCheck({
|
|
|
+ checkboxClass: 'icheckbox-blue',
|
|
|
+ radioClass: 'iradio-blue',
|
|
|
+ increaseArea: '20%'
|
|
|
+ })});
|
|
|
+ var currentBrowserId;
|
|
|
+ function browserImage(targetId){
|
|
|
+ currentBrowserId = targetId;
|
|
|
+ var weboxTemp = $.webox({
|
|
|
+ height:600,
|
|
|
+ width:1024,
|
|
|
+ bgvisibel:true,
|
|
|
+ title:'图片管理',
|
|
|
+ iframe:'<%=base%>/admin/image/imgbox.html?'+Math.random()
|
|
|
+ });
|
|
|
+ }
|
|
|
+ function setImagepath(imgPath){
|
|
|
+ $('#'+currentBrowserId).val(imgPath);
|
|
|
+ }
|
|
|
+ function closeFrame(){
|
|
|
+ $('#locked .span').click();
|
|
|
+ }
|
|
|
+
|
|
|
+ var app = new Vue({
|
|
|
+ el: "#app",
|
|
|
+ data:{
|
|
|
+ news:""
|
|
|
+ }
|
|
|
+ });
|
|
|
+ function getUrlParam(name) {
|
|
|
+ var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
|
|
+ var r = window.location.search.substr(1).match(reg);
|
|
|
+ if (r != null)
|
|
|
+ return unescape(r[2]);
|
|
|
+ return null; //返回参数值
|
|
|
+ }
|
|
|
+ function init(){
|
|
|
+ var id = getUrlParam("id");
|
|
|
+ $.post("getnewbyid",{id:id},function(news){
|
|
|
+ app.$data.news = news;
|
|
|
+ ue.ready(function(){
|
|
|
+ ue.setContent(news.content)
|
|
|
+ })
|
|
|
+ },"json")
|
|
|
+ }
|
|
|
+ init();
|
|
|
+
|
|
|
+
|
|
|
+ </script>
|
|
|
+
|
|
|
+</body>
|
|
|
+</html>
|