init: 从宝塔同步到 Gitea
@@ -0,0 +1,8 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
Options +FollowSymlinks -Multiviews
|
||||
RewriteEngine On
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
|
||||
</IfModule>
|
||||
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
// [ 应用入口文件 ]
|
||||
|
||||
// 定义应用目录
|
||||
define('APP_PATH', __DIR__ . '/../application/');
|
||||
// 加载框架引导文件
|
||||
require __DIR__ . '/../thinkphp/start.php';
|
||||
@@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow:
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
// $Id$
|
||||
|
||||
if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) {
|
||||
return false;
|
||||
} else {
|
||||
if (!isset($_SERVER['PATH_INFO'])) {
|
||||
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
|
||||
}
|
||||
require __DIR__ . "/index.php";
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
@font-face {
|
||||
font-family: 'iconfont';
|
||||
src: url('../fonts/iconfont.eot');
|
||||
src: url('../fonts/iconfont.eot?#iefix') format('embedded-opentype'),
|
||||
url('../fonts/iconfont.woff') format('woff'),
|
||||
url('../fonts/iconfont.ttf') format('truetype'),
|
||||
url('../fonts/iconfont.svg#iconfont') format('svg');
|
||||
}
|
||||
.iconfont{
|
||||
font-family:"iconfont" !important;
|
||||
font-size:16px;font-style:normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-webkit-text-stroke-width: 0.2px;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,477 @@
|
||||
@charset "utf-8";
|
||||
@import url(../lib/layui/css/layui.css);
|
||||
*{
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
a{
|
||||
text-decoration: none;
|
||||
}
|
||||
html{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-x:hidden;
|
||||
overflow-y:auto;
|
||||
}
|
||||
body{
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
}
|
||||
.login-bg{
|
||||
/*background: #eeeeee url() 0 0 no-repeat;*/
|
||||
background:url(../images/bg.png) no-repeat center;
|
||||
background-size: cover;
|
||||
overflow: hidden;
|
||||
}
|
||||
.login{
|
||||
margin: 120px auto 0 auto;
|
||||
min-height: 420px;
|
||||
max-width: 420px;
|
||||
padding: 40px;
|
||||
background-color: #ffffff;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
border-radius: 4px;
|
||||
/* overflow-x: hidden; */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.login a.logo{
|
||||
display: block;
|
||||
height: 58px;
|
||||
width: 167px;
|
||||
margin: 0 auto 30px auto;
|
||||
background-size: 167px 42px;
|
||||
}
|
||||
.login .message {
|
||||
margin: 10px 0 0 -58px;
|
||||
padding: 18px 10px 18px 60px;
|
||||
background: #189F92;
|
||||
position: relative;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
}
|
||||
.login #darkbannerwrap {
|
||||
background: url(../images/aiwrap.png);
|
||||
width: 18px;
|
||||
height: 10px;
|
||||
margin: 0 0 20px -58px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.login input[type=text],
|
||||
.login input[type=file],
|
||||
.login input[type=password],
|
||||
.login input[type=email], select {
|
||||
border: 1px solid #DCDEE0;
|
||||
vertical-align: middle;
|
||||
border-radius: 3px;
|
||||
height: 50px;
|
||||
padding: 0px 16px;
|
||||
font-size: 14px;
|
||||
color: #555555;
|
||||
outline:none;
|
||||
width:100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.login input[type=text]:focus,
|
||||
.login input[type=file]:focus,
|
||||
.login input[type=password]:focus,
|
||||
.login input[type=email]:focus, select:focus {
|
||||
border: 1px solid #27A9E3;
|
||||
}
|
||||
.login input[type=submit],
|
||||
.login input[type=button]{
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
padding: 12px 24px;
|
||||
margin: 0px;
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
color: #ffffff;
|
||||
background-color: #189F92;
|
||||
border-radius: 3px;
|
||||
border: none;
|
||||
-webkit-appearance: none;
|
||||
outline:none;
|
||||
width:100%;
|
||||
}
|
||||
.login hr {
|
||||
background: #fff url() 0 0 no-repeat;
|
||||
}
|
||||
.login hr.hr15 {
|
||||
height: 15px;
|
||||
border: none;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
.login hr.hr20 {
|
||||
height: 20px;
|
||||
border: none;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
.x-body{
|
||||
padding: 20px;
|
||||
}
|
||||
.x-nav{
|
||||
padding: 0 20px;
|
||||
position: relative;
|
||||
z-index: 99;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
line-height: 39px;
|
||||
height: 39px;
|
||||
overflow: hidden;
|
||||
}
|
||||
xblock{
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
padding: 5px;
|
||||
line-height: 22px;
|
||||
/* border-left: 5px solid #009688; */
|
||||
border-radius: 0 2px 2px 0;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
.x-right{
|
||||
float: right;
|
||||
}
|
||||
.x-so{
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.x-so input.layui-input{
|
||||
width: 190px;
|
||||
}
|
||||
.x-so .layui-form-label{
|
||||
display: inline-block;
|
||||
}
|
||||
.x-so input.layui-input,.x-so input.layui-btn{
|
||||
display: inline-block;
|
||||
}
|
||||
.x-red{
|
||||
color: red;
|
||||
}
|
||||
.pagination{
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
.pagination a{
|
||||
display: inline-block;
|
||||
background: #fff url() 0 0 no-repeat;
|
||||
color: #888;
|
||||
padding: 10px;
|
||||
min-width: 15px;
|
||||
border: 1px solid #E2E2E2;
|
||||
|
||||
}
|
||||
.pagination span{
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
min-width: 15px;
|
||||
border: 1px solid #E2E2E2;
|
||||
}
|
||||
.pagination span.current{
|
||||
display: inline-block;
|
||||
background: #009688 url() 0 0 no-repeat;
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
min-width: 15px;
|
||||
border: 1px solid #009688;
|
||||
}
|
||||
.pagination li{
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
.pagination li.active span{
|
||||
background: #009688 url() 0 0 no-repeat;
|
||||
color: #fff;
|
||||
border: 1px solid #009688;
|
||||
|
||||
}
|
||||
|
||||
/*登录样式*/
|
||||
/*头部*/
|
||||
.container{
|
||||
width: 100%;
|
||||
height: 45px;
|
||||
background-color: #222;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
.container .logo a{
|
||||
float: left;
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
padding-left: 20px;
|
||||
line-height: 45px;
|
||||
width: 200px;
|
||||
}
|
||||
.container .right{
|
||||
background-color:rgba(0,0,0,0);
|
||||
float: right;
|
||||
|
||||
}
|
||||
.container .left_open{
|
||||
height: 45px;
|
||||
float: left;
|
||||
}
|
||||
.container .left_open i{
|
||||
display: block;
|
||||
background: rgba(255,255,255,0.1) url() 0 0 no-repeat;
|
||||
color: #fff;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
border-radius: 3px;
|
||||
text-align: center;
|
||||
margin-top: 7px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.container .left_open i:hover{
|
||||
background: rgba(255,255,255,0.3) url() 0 0 no-repeat;
|
||||
}
|
||||
|
||||
.container .left{
|
||||
background-color:rgba(0,0,0,0);
|
||||
float: left;
|
||||
|
||||
}
|
||||
.container .layui-nav-item{
|
||||
line-height: 45px;
|
||||
}
|
||||
.container .layui-nav-more{
|
||||
top: 20px;
|
||||
}
|
||||
.container .layui-nav-child{
|
||||
top: 50px;
|
||||
}
|
||||
.container .layui-nav-child i{
|
||||
margin-right: 10px;
|
||||
}
|
||||
.layui-nav .layui-nav-item a{
|
||||
color: #fff;
|
||||
}
|
||||
.layui-nav .layui-nav-child a{
|
||||
color: #333;
|
||||
}
|
||||
.left-nav{
|
||||
position: absolute;
|
||||
top: 46px;
|
||||
bottom: 42px;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
padding-top: 10px;
|
||||
background-color: #EEEEEE;
|
||||
width: 220px;
|
||||
max-width: 220px;
|
||||
overflow: auto;
|
||||
overflow-x:hidden;
|
||||
border-right: 1px solid #e5e5e5;
|
||||
|
||||
/*width: 0px;*/
|
||||
}
|
||||
.left-nav #nav li{
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
.left-nav #nav li:hover{
|
||||
/*color: blue;*/
|
||||
}
|
||||
.left-nav #nav .current{
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.left-nav #nav li a{
|
||||
font-size: 14px;
|
||||
padding: 10px 15px 10px 20px;
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
}
|
||||
.left-nav #nav li a cite{
|
||||
font-size: 14px;
|
||||
}
|
||||
.left-nav #nav li a .main-nav{
|
||||
font-size: 15px;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.left-nav #nav li .sub-menu{
|
||||
display: none;
|
||||
}
|
||||
.left-nav #nav li .opened{
|
||||
display: block;
|
||||
}
|
||||
.left-nav #nav li .opened:hover{
|
||||
/*background: #fff url() 0 0 no-repeat;*/
|
||||
}
|
||||
.left-nav #nav li .opened .current{
|
||||
|
||||
}
|
||||
.left-nav #nav li .sub-menu li:hover{
|
||||
/*color: blue;*/
|
||||
/*background: #fff url() 0 0 no-repeat;*/
|
||||
}
|
||||
.left-nav #nav li .sub-menu li a{
|
||||
padding: 12px 15px 12px 30px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.left-nav #nav li .sub-menu li .sub-menu li a{
|
||||
padding-left: 45px;
|
||||
}
|
||||
.left-nav #nav li .sub-menu li a:hover{
|
||||
/*color: #148cf1;*/
|
||||
}
|
||||
.left-nav #nav li .sub-menu li.actived cite{
|
||||
color: #148cf1;
|
||||
}
|
||||
.left-nav #nav li .sub-menu li a i{
|
||||
font-size: 12px;
|
||||
}
|
||||
.left-nav #nav li a i{
|
||||
padding-right: 10px;
|
||||
line-height: 14px;
|
||||
}
|
||||
.left-nav #nav li .nav_right{
|
||||
float: right;
|
||||
font-size: 16px;
|
||||
}
|
||||
.x-slide_left {
|
||||
width: 17px;
|
||||
height: 61px;
|
||||
background: url(../images/icon.png) 0 0 no-repeat;
|
||||
position: absolute;
|
||||
top: 200px;
|
||||
left: 221px;
|
||||
cursor: pointer;
|
||||
z-index: 3;
|
||||
}
|
||||
.page-content{
|
||||
position: absolute;
|
||||
top: 46px;
|
||||
right: 0;
|
||||
bottom: 42px;
|
||||
left: 221px;
|
||||
overflow: hidden;
|
||||
z-index: 1;
|
||||
}
|
||||
.page-content-bg{
|
||||
position: absolute;
|
||||
top: 46px;
|
||||
right: 0;
|
||||
bottom: 42px;
|
||||
left: 221px;
|
||||
background: rgba(0,0,0,0.5); url() 0 0 no-repeat;
|
||||
overflow: hidden;
|
||||
z-index: 100;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.page-content .tab{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background: #EFEEF0 url() 0 0 no-repeat;
|
||||
margin: 0px;
|
||||
}
|
||||
.page-content .layui-tab-title{
|
||||
/*padding-top: 5px;*/
|
||||
height: 35px;
|
||||
background: #EFEEF0 url() 0 0 no-repeat;
|
||||
position: relative;
|
||||
z-index: 100;
|
||||
}
|
||||
.page-content .layui-tab-title li{
|
||||
line-height: 35px;
|
||||
}
|
||||
.page-content .layui-tab-title .layui-this:after{
|
||||
height: 36px;
|
||||
}
|
||||
.page-content .layui-tab-title li .layui-tab-close{
|
||||
border-radius: 50%;
|
||||
}
|
||||
.page-content .layui-tab-title .layui-this{
|
||||
background: #fff url() 0 0 no-repeat;
|
||||
}
|
||||
.page-content .layui-tab-bar{
|
||||
height:34px;
|
||||
line-height: 35px;
|
||||
}
|
||||
.page-content .layui-tab-content{
|
||||
position: absolute;
|
||||
top: 36px;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
background: #fff url() 0 0 no-repeat;
|
||||
padding: 0px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.page-content .layui-tab-content .layui-tab-item{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
.page-content .layui-tab-content .layui-tab-item iframe{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
|
||||
.welcome-footer{padding: 30px 0; line-height: 30px; text-align: center; background-color: #eee; color: #666; font-weight: 300;}
|
||||
body .layui-layout-admin .footer-demo{height: auto; padding: 15px 0; line-height: 26px;}
|
||||
.welcome-footer a{padding: 0 5px;}
|
||||
|
||||
table th, table td {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.footer{
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
background-color: #222;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.2);
|
||||
line-height: 41px;
|
||||
color: #fff;
|
||||
/*padding-left: 10px;*/
|
||||
}
|
||||
.footer .copyright{
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px){
|
||||
.fast-add{
|
||||
display: none;
|
||||
}
|
||||
.layui-nav .to-index{
|
||||
display: none;
|
||||
}
|
||||
.container .logo a{
|
||||
width: 140px;
|
||||
}
|
||||
.container .left_open {
|
||||
/*float: right;*/
|
||||
}
|
||||
.left-nav{
|
||||
left: -221px;
|
||||
}
|
||||
.page-content{
|
||||
left: 0px;
|
||||
}
|
||||
.page-content .layui-tab-content .layui-tab-item{
|
||||
-webkit-overflow-scrolling: touch;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.x-so input.layui-input{
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 315 KiB |
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
@@ -0,0 +1,175 @@
|
||||
|
||||
// 图片上传
|
||||
$(function() {
|
||||
|
||||
// 多图
|
||||
Imgupload(".upload_file",".upload_btn_item","more",1);
|
||||
|
||||
|
||||
});
|
||||
function Imgupload(btn,uploadBox,Type,maxCount){
|
||||
// 允许上传的图片类型
|
||||
var allowTypes = ['image/jpg', 'image/jpeg', 'image/png', 'image/gif'];
|
||||
// 1024KB,也就是 1MB
|
||||
var maxSize = 1024 * (1024*4); //小于4MB
|
||||
// 图片最大宽度
|
||||
var maxWidth = 10000;
|
||||
// 最大上传图片数量
|
||||
var maxCount = maxCount||1;
|
||||
var imgArray=[];
|
||||
$(btn).on('change', function(event) {
|
||||
var files = event.target.files;
|
||||
$(uploadBox).addClass("login-img")
|
||||
// 如果没有选中文件,直接返回
|
||||
if (files.length === 0) {
|
||||
$(uploadBox).removeClass("login-img")
|
||||
return;
|
||||
}
|
||||
if (files.length>maxCount) {
|
||||
$(uploadBox).removeClass("login-img")
|
||||
alert_box('最多只能上传' + maxCount + '张图片');
|
||||
return;
|
||||
};
|
||||
for (var i = 0, len = files.length; i < len; i++) {
|
||||
var file = files[i];
|
||||
|
||||
var reader = new FileReader();
|
||||
// 如果类型不在允许的类型范围内
|
||||
if (allowTypes.indexOf(file.type) === -1) {
|
||||
$(uploadBox).removeClass("login-img")
|
||||
alert_box("该类型不允许上传");
|
||||
continue;
|
||||
}
|
||||
if (file.size > maxSize) {
|
||||
$(uploadBox).removeClass("login-img")
|
||||
alert_box("图片太大,不允许上传");
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($('.item_file').length >= maxCount) {
|
||||
$(uploadBox).removeClass("login-img")
|
||||
alert_box('最多只能上传' + maxCount + '张图片');
|
||||
return;
|
||||
}
|
||||
reader.onload = function(e) {
|
||||
var img = new Image();
|
||||
img.onload = function() {
|
||||
$(uploadBox).removeClass("login-img")
|
||||
// 不要超出最大宽度
|
||||
var w = Math.min(maxWidth, img.width);
|
||||
// 高度按比例计算
|
||||
var h = img.height * (w / img.width);
|
||||
var canvas = document.createElement('canvas');
|
||||
var ctx = canvas.getContext('2d');
|
||||
// 设置 canvas 的宽度和高度
|
||||
canvas.width = w;
|
||||
canvas.height = h;
|
||||
ctx.drawImage(img, 0, 0, w, h);
|
||||
// var base64 = canvas.toDataURL('image/png');
|
||||
|
||||
var base64 =canvas.toDataURL('image/jpeg',0.8);
|
||||
|
||||
// 插入到预览区
|
||||
var progress = 0;
|
||||
// 多图
|
||||
//侦查附件上传情况 ,这个方法大概0.05-0.1秒执行一次
|
||||
function OnProgRess(event) {
|
||||
var event = event || window.event;
|
||||
// console.log("已经上传:"+ event.loaded); //已经上传大小情况(已上传大小,上传完毕后就 等于 附件总大小)
|
||||
|
||||
var loaded = Math.floor(100 * (event.loaded / event.total)); //已经上传的百分比
|
||||
// console.log(loaded+"%");
|
||||
if (Type=="more") {
|
||||
$preview.find('.uploader_num').text(loaded + '%');
|
||||
}else{
|
||||
$(uploadBox).find('.uploader_num').text(loaded + '%');
|
||||
}
|
||||
};
|
||||
if (Type=="more") {
|
||||
var $preview = $('<li class="item_file uploader_bg" ><div class="uploader_num">0%</div></li>');
|
||||
$('.img-box').append($preview);
|
||||
var num = $('.item_file').length;
|
||||
$('.num_counter').text(num + '/' + maxCount);
|
||||
function depositupload(){
|
||||
var data = {};
|
||||
data.base64 = base64;
|
||||
xhr = $.ajaxSettings.xhr();
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url:'/recharge/deposit',
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
data: data,
|
||||
xhr: function() {
|
||||
if(OnProgRess && xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", OnProgRess, false);
|
||||
return xhr;
|
||||
}
|
||||
},
|
||||
success: function(data) {
|
||||
var Url='url(' +data.msg+ ')';
|
||||
$(".save .upload .img-box").find(".error").remove();
|
||||
$preview.css("background-image",Url);
|
||||
$('#img_url').val(data.msg);
|
||||
$preview.append('<i class="iconfont remove_btn">X</i><span class="preview-open"></span>');
|
||||
$preview.removeClass('uploader_bg').find('.uploader_num').remove();
|
||||
|
||||
},
|
||||
error: function(msg) {
|
||||
alert_box("上传失败")
|
||||
$preview.removeClass('uploader_bg').find('.uploader_num').remove();
|
||||
$preview.html('<div class="error"></div>');
|
||||
$(".save .upload .img-box").on("click",".error",function(){
|
||||
return depositupload();
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
depositupload();
|
||||
|
||||
}
|
||||
if (imgArray.length == maxCount) {
|
||||
$(".upload_btn_item").css("display","none");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
img.src = e.target.result;
|
||||
imgArray.push(img.src);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
|
||||
});
|
||||
// 删除图片
|
||||
if (Type=="more") {
|
||||
$(".save .upload .img-box").on("click",".remove_btn",function(){
|
||||
var b= $(this).parents(".item_file").index()
|
||||
imgArray.splice(b,1);
|
||||
var num = $('.item_file').length-1;
|
||||
$('.num_counter').text(num + '/' + maxCount);
|
||||
if (imgArray.length < maxCount) {
|
||||
$(".upload_btn_item").css("display","block");
|
||||
}
|
||||
$(this).parents(".item_file").remove();
|
||||
|
||||
// console.log(imgArray)
|
||||
|
||||
})
|
||||
// 预览
|
||||
$(".save .upload .img-box").on("click",".preview-open",function(){
|
||||
var c= $(this).parents(".item_file").index();
|
||||
// console.log(imgArray[c])
|
||||
$("#preview-img").attr("src",imgArray[c])
|
||||
$(".preview").css("display","block");
|
||||
})
|
||||
$(".close_btn").click(function(){
|
||||
$(".preview").css("display","none");
|
||||
$("#preview-img").attr("src","");
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,236 @@
|
||||
/* @license
|
||||
* jQuery.print, version 1.3.2
|
||||
* (c) Sathvik Ponangi, Doers' Guild
|
||||
* Licence: CC-By (http://creativecommons.org/licenses/by/3.0/)
|
||||
*--------------------------------------------------------------------------*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
// A nice closure for our definitions
|
||||
function getjQueryObject(string) {
|
||||
// Make string a vaild jQuery thing
|
||||
var jqObj = $("");
|
||||
try {
|
||||
jqObj = $(string)
|
||||
.clone();
|
||||
} catch (e) {
|
||||
jqObj = $("<span />")
|
||||
.html(string);
|
||||
}
|
||||
return jqObj;
|
||||
}
|
||||
|
||||
function printFrame(frameWindow) {
|
||||
// Print the selected window/iframe
|
||||
var def = $.Deferred();
|
||||
try {
|
||||
setTimeout(function () {
|
||||
// Fix for IE : Allow it to render the iframe
|
||||
frameWindow.focus();
|
||||
try {
|
||||
// Fix for IE11 - printng the whole page instead of the iframe content
|
||||
if (!frameWindow.document.execCommand('print', false, null)) {
|
||||
// document.execCommand returns false if it failed -http://stackoverflow.com/a/21336448/937891
|
||||
frameWindow.print();
|
||||
}
|
||||
} catch (e) {
|
||||
frameWindow.print();
|
||||
}
|
||||
frameWindow.close();
|
||||
def.resolve();
|
||||
}, 250);
|
||||
} catch (err) {
|
||||
def.reject(err);
|
||||
}
|
||||
return def;
|
||||
}
|
||||
|
||||
function printContentInNewWindow(content) {
|
||||
// Open a new window and print selected content
|
||||
var w = window.open();
|
||||
w.document.write(content);
|
||||
w.document.close();
|
||||
return printFrame(w);
|
||||
}
|
||||
|
||||
function isNode(o) {
|
||||
/* http://stackoverflow.com/a/384380/937891 */
|
||||
return !!(typeof Node === "object" ? o instanceof Node : o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string");
|
||||
}
|
||||
$.print = $.fn.print = function () {
|
||||
// Print a given set of elements
|
||||
var options, $this, self = this;
|
||||
// console.log("Printing", this, arguments);
|
||||
if (self instanceof $) {
|
||||
// Get the node if it is a jQuery object
|
||||
self = self.get(0);
|
||||
}
|
||||
if (isNode(self)) {
|
||||
// If `this` is a HTML element, i.e. for
|
||||
// $(selector).print()
|
||||
$this = $(self);
|
||||
if (arguments.length > 0) {
|
||||
options = arguments[0];
|
||||
}
|
||||
} else {
|
||||
if (arguments.length > 0) {
|
||||
// $.print(selector,options)
|
||||
$this = $(arguments[0]);
|
||||
if (isNode($this[0])) {
|
||||
if (arguments.length > 1) {
|
||||
options = arguments[1];
|
||||
}
|
||||
} else {
|
||||
// $.print(options)
|
||||
options = arguments[0];
|
||||
$this = $("html");
|
||||
}
|
||||
} else {
|
||||
// $.print()
|
||||
$this = $("html");
|
||||
}
|
||||
}
|
||||
// Default options
|
||||
var defaults = {
|
||||
globalStyles: true,
|
||||
mediaPrint: false,
|
||||
stylesheet: null,
|
||||
noPrintSelector: ".no-print",
|
||||
iframe: true,
|
||||
append: null,
|
||||
prepend: null,
|
||||
manuallyCopyFormValues: true,
|
||||
deferred: $.Deferred()
|
||||
};
|
||||
// Merge with user-options
|
||||
options = $.extend({}, defaults, (options || {}));
|
||||
var $styles = $("");
|
||||
if (options.globalStyles) {
|
||||
// Apply the stlyes from the current sheet to the printed page
|
||||
$styles = $("style, link, meta, title");
|
||||
} else if (options.mediaPrint) {
|
||||
// Apply the media-print stylesheet
|
||||
$styles = $("link[media=print]");
|
||||
}
|
||||
if (options.stylesheet) {
|
||||
// Add a custom stylesheet if given
|
||||
$styles = $.merge($styles, $('<link rel="stylesheet" href="' + options.stylesheet + '">'));
|
||||
}
|
||||
// Create a copy of the element to print
|
||||
var copy = $this.clone();
|
||||
// Wrap it in a span to get the HTML markup string
|
||||
copy = $("<span/>")
|
||||
.append(copy);
|
||||
// Remove unwanted elements
|
||||
copy.find(options.noPrintSelector)
|
||||
.remove();
|
||||
// Add in the styles
|
||||
copy.append($styles.clone());
|
||||
// Appedned content
|
||||
copy.append(getjQueryObject(options.append));
|
||||
// Prepended content
|
||||
copy.prepend(getjQueryObject(options.prepend));
|
||||
if (options.manuallyCopyFormValues) {
|
||||
// Manually copy form values into the HTML for printing user-modified input fields
|
||||
// http://stackoverflow.com/a/26707753
|
||||
copy.find("input")
|
||||
.each(function () {
|
||||
var $field = $(this);
|
||||
if ($field.is("[type='radio']") || $field.is("[type='checkbox']")) {
|
||||
if ($field.prop("checked")) {
|
||||
$field.attr("checked", "checked");
|
||||
}
|
||||
} else {
|
||||
$field.attr("value", $field.val());
|
||||
}
|
||||
});
|
||||
copy.find("select").each(function () {
|
||||
var $field = $(this);
|
||||
$field.find(":selected").attr("selected", "selected");
|
||||
});
|
||||
copy.find("textarea").each(function () {
|
||||
// Fix for https://github.com/DoersGuild/jQuery.print/issues/18#issuecomment-96451589
|
||||
var $field = $(this);
|
||||
$field.text($field.val());
|
||||
});
|
||||
}
|
||||
// Get the HTML markup string
|
||||
var content = copy.html();
|
||||
// Notify with generated markup & cloned elements - useful for logging, etc
|
||||
try {
|
||||
options.deferred.notify('generated_markup', content, copy);
|
||||
} catch (err) {
|
||||
console.warn('Error notifying deferred', err);
|
||||
}
|
||||
// Destroy the copy
|
||||
copy.remove();
|
||||
if (options.iframe) {
|
||||
// Use an iframe for printing
|
||||
try {
|
||||
var $iframe = $(options.iframe + "");
|
||||
var iframeCount = $iframe.length;
|
||||
if (iframeCount === 0) {
|
||||
// Create a new iFrame if none is given
|
||||
$iframe = $('<iframe height="0" width="0" border="0" wmode="Opaque"/>')
|
||||
.prependTo('body')
|
||||
.css({
|
||||
"position": "absolute",
|
||||
"top": -999,
|
||||
"left": -999
|
||||
});
|
||||
}
|
||||
var w, wdoc;
|
||||
w = $iframe.get(0);
|
||||
w = w.contentWindow || w.contentDocument || w;
|
||||
wdoc = w.document || w.contentDocument || w;
|
||||
wdoc.open();
|
||||
wdoc.write(content);
|
||||
wdoc.close();
|
||||
printFrame(w)
|
||||
.done(function () {
|
||||
// Success
|
||||
setTimeout(function () {
|
||||
// Wait for IE
|
||||
if (iframeCount === 0) {
|
||||
// Destroy the iframe if created here
|
||||
$iframe.remove();
|
||||
}
|
||||
}, 100);
|
||||
})
|
||||
.fail(function (err) {
|
||||
// Use the pop-up method if iframe fails for some reason
|
||||
console.error("Failed to print from iframe", err);
|
||||
printContentInNewWindow(content);
|
||||
})
|
||||
.always(function () {
|
||||
try {
|
||||
options.deferred.resolve();
|
||||
} catch (err) {
|
||||
console.warn('Error notifying deferred', err);
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
// Use the pop-up method if iframe fails for some reason
|
||||
console.error("Failed to print from iframe", e.stack, e.message);
|
||||
printContentInNewWindow(content)
|
||||
.always(function () {
|
||||
try {
|
||||
options.deferred.resolve();
|
||||
} catch (err) {
|
||||
console.warn('Error notifying deferred', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Use a new window for printing
|
||||
printContentInNewWindow(content)
|
||||
.always(function () {
|
||||
try {
|
||||
options.deferred.resolve();
|
||||
} catch (err) {
|
||||
console.warn('Error notifying deferred', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
return this;
|
||||
};
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,171 @@
|
||||
$(function () {
|
||||
//加载弹出层
|
||||
layui.use(['form','element'],
|
||||
function() {
|
||||
layer = layui.layer;
|
||||
element = layui.element;
|
||||
});
|
||||
|
||||
//触发事件
|
||||
var tab = {
|
||||
tabAdd: function(title,url,id){
|
||||
//新增一个Tab项
|
||||
element.tabAdd('xbs_tab', {
|
||||
title: title
|
||||
,content: '<iframe tab-id="'+id+'" frameborder="0" src="'+url+'" scrolling="yes" class="x-iframe"></iframe>'
|
||||
,id: id
|
||||
})
|
||||
}
|
||||
,tabDelete: function(othis){
|
||||
//删除指定Tab项
|
||||
element.tabDelete('xbs_tab', '44'); //删除:“商品管理”
|
||||
|
||||
|
||||
othis.addClass('layui-btn-disabled');
|
||||
}
|
||||
,tabChange: function(id){
|
||||
//切换到指定Tab项
|
||||
element.tabChange('xbs_tab', id); //切换到:用户管理
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
tableCheck = {
|
||||
init:function () {
|
||||
$(".layui-form-checkbox").click(function(event) {
|
||||
if($(this).hasClass('layui-form-checked')){
|
||||
$(this).removeClass('layui-form-checked');
|
||||
if($(this).hasClass('header')){
|
||||
$(".layui-form-checkbox").removeClass('layui-form-checked');
|
||||
}
|
||||
}else{
|
||||
$(this).addClass('layui-form-checked');
|
||||
if($(this).hasClass('header')){
|
||||
$(".layui-form-checkbox").addClass('layui-form-checked');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
getData:function () {
|
||||
var obj = $(".layui-form-checked").not('.header');
|
||||
var arr=[];
|
||||
obj.each(function(index, el) {
|
||||
arr.push(obj.eq(index).attr('data-id'));
|
||||
});
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
|
||||
//开启表格多选
|
||||
tableCheck.init();
|
||||
|
||||
|
||||
$('.container .left_open i').click(function(event) {
|
||||
if($('.left-nav').css('left')=='0px'){
|
||||
$('.left-nav').animate({left: '-221px'}, 100);
|
||||
$('.page-content').animate({left: '0px'}, 100);
|
||||
$('.page-content-bg').hide();
|
||||
}else{
|
||||
$('.left-nav').animate({left: '0px'}, 100);
|
||||
$('.page-content').animate({left: '221px'}, 100);
|
||||
if($(window).width()<768){
|
||||
$('.page-content-bg').show();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('.page-content-bg').click(function(event) {
|
||||
$('.left-nav').animate({left: '-221px'}, 100);
|
||||
$('.page-content').animate({left: '0px'}, 100);
|
||||
$(this).hide();
|
||||
});
|
||||
|
||||
$('.layui-tab-close').click(function(event) {
|
||||
$('.layui-tab-title li').eq(0).find('i').remove();
|
||||
});
|
||||
|
||||
//左侧菜单效果
|
||||
// $('#content').bind("click",function(event){
|
||||
$('.left-nav #nav li').click(function (event) {
|
||||
|
||||
if($(this).children('.sub-menu').length){
|
||||
if($(this).hasClass('open')){
|
||||
$(this).removeClass('open');
|
||||
$(this).find('.nav_right').html('');
|
||||
$(this).children('.sub-menu').stop().slideUp();
|
||||
$(this).siblings().children('.sub-menu').slideUp();
|
||||
}else{
|
||||
$(this).addClass('open');
|
||||
$(this).children('a').find('.nav_right').html('');
|
||||
$(this).children('.sub-menu').stop().slideDown();
|
||||
$(this).siblings().children('.sub-menu').stop().slideUp();
|
||||
$(this).siblings().find('.nav_right').html('');
|
||||
$(this).siblings().removeClass('open');
|
||||
}
|
||||
}else{
|
||||
|
||||
var url = $(this).children('a').attr('_href');
|
||||
var title = $(this).find('cite').html();
|
||||
var index = $('.left-nav #nav li').index($(this));
|
||||
|
||||
for (var i = 0; i <$('.x-iframe').length; i++) {
|
||||
if($('.x-iframe').eq(i).attr('tab-id')==index+1){
|
||||
tab.tabChange(index+1);
|
||||
event.stopPropagation();
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
tab.tabAdd(title,url,index+1);
|
||||
tab.tabChange(index+1);
|
||||
}
|
||||
|
||||
event.stopPropagation();
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
/*弹出层*/
|
||||
/*
|
||||
参数解释:
|
||||
title 标题
|
||||
url 请求的url
|
||||
id 需要操作的数据id
|
||||
w 弹出层宽度(缺省调默认值)
|
||||
h 弹出层高度(缺省调默认值)
|
||||
*/
|
||||
function x_admin_show(title,url,w,h){
|
||||
if (title == null || title == '') {
|
||||
title=false;
|
||||
};
|
||||
if (url == null || url == '') {
|
||||
url="404.html";
|
||||
};
|
||||
if (w == null || w == '') {
|
||||
w=($(window).width()*0.9);
|
||||
};
|
||||
if (h == null || h == '') {
|
||||
h=($(window).height() - 50);
|
||||
};
|
||||
layer.open({
|
||||
type: 2,
|
||||
area: [w+'px', h +'px'],
|
||||
fix: false, //不固定
|
||||
maxmin: true,
|
||||
shadeClose: true,
|
||||
shade:0.4,
|
||||
title: title,
|
||||
content: url
|
||||
});
|
||||
}
|
||||
|
||||
/*关闭弹出框口*/
|
||||
function x_admin_close(){
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
/** layui-v2.0.2 MIT License By http://www.layui.com */
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}
|
||||
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 701 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 200 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 9.6 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 777 B |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 5.7 KiB |