4 changed files with 644 additions and 0 deletions
@ -0,0 +1,17 @@ |
|||||
|
{ |
||||
|
"groups": [ |
||||
|
{ |
||||
|
"name": "file", |
||||
|
"type": "com.dreamchaser.depository_manage.config.FileConfig", |
||||
|
"sourceType": "com.dreamchaser.depository_manage.config.FileConfig" |
||||
|
} |
||||
|
], |
||||
|
"properties": [ |
||||
|
{ |
||||
|
"name": "file.upload-path", |
||||
|
"type": "java.lang.String", |
||||
|
"sourceType": "com.dreamchaser.depository_manage.config.FileConfig" |
||||
|
} |
||||
|
], |
||||
|
"hints": [] |
||||
|
} |
||||
@ -0,0 +1,230 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html xmlns:th="http://www.w3.org/1999/xhtml"> |
||||
|
<html xmlns:th="http://www.thymeleaf.org"> |
||||
|
<head> |
||||
|
<meta charset="utf-8"> |
||||
|
<title>仓库管理系统</title> |
||||
|
<meta name="keywords" content="layuimini,layui,layui模板,layui后台,后台模板,admin,admin模板,layui mini"> |
||||
|
<meta name="description" |
||||
|
content="layuimini基于layui的轻量级前端后台管理框架,最简洁、易用的后台框架模板,面向所有层次的前后端程序,只需提供一个接口就直接初始化整个框架,无需复杂操作。"> |
||||
|
<meta name="renderer" content="webkit"> |
||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black"> |
||||
|
<meta name="apple-mobile-web-app-capable" content="yes"> |
||||
|
<meta name="format-detection" content="telephone=no"> |
||||
|
<link rel="icon" href="/static/images/favicon.ico"> |
||||
|
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all"> |
||||
|
<link rel="stylesheet" href="/static/css/layuimini.css?v=2.0.4.2" media="all"> |
||||
|
<link rel="stylesheet" href="/static/css/themes/default.css" media="all"> |
||||
|
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all"> |
||||
|
<!--[if lt IE 9]> |
||||
|
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script> |
||||
|
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script> |
||||
|
|
||||
|
|
||||
|
<![endif]--> |
||||
|
<!-- vue相关--> |
||||
|
<script src="../static/js/vue/vue.js"></script> |
||||
|
<script src="../static/js/vue/vue.min.js"></script> |
||||
|
<script src="../static/js/vue/vue-router.js"></script> |
||||
|
<script src="../static/lib/http-vue-loader/src/httpVueLoader.js"></script> |
||||
|
<style id="layuimini-bg-color"> |
||||
|
</style> |
||||
|
</head> |
||||
|
<body class="layui-layout-body layuimini-all"> |
||||
|
<div class="layui-layout layui-layout-admin"> |
||||
|
|
||||
|
<div class="layui-header header"> |
||||
|
<div class="layui-logo layuimini-logo"></div> |
||||
|
|
||||
|
<div class="layuimini-header-content"> |
||||
|
<a> |
||||
|
<div class="layuimini-tool"><i title="展开" class="fa fa-outdent" data-side-fold="1"></i></div> |
||||
|
</a> |
||||
|
|
||||
|
<!--电脑端头部菜单--> |
||||
|
<ul class="layui-nav layui-layout-left layuimini-header-menu layuimini-menu-header-pc layuimini-pc-show"> |
||||
|
</ul> |
||||
|
|
||||
|
|
||||
|
<ul class="layui-nav layui-layout-right"> |
||||
|
<li class="layui-nav-item" lay-unselect> |
||||
|
<a href="javascript:" id="scan"><i class="fa fa-square-o" aria-hidden="true"></i></a> |
||||
|
</li> |
||||
|
<li class="layui-nav-item" lay-unselect> |
||||
|
<a href="javascript:" data-refresh="刷新"><i class="fa fa-refresh"></i></a> |
||||
|
</li> |
||||
|
<li class="layui-nav-item" lay-unselect> |
||||
|
<a href="javascript:" data-clear="清理" class="layuimini-clear"><i class="fa fa-trash-o"></i></a> |
||||
|
</li> |
||||
|
<li class="layui-nav-item mobile layui-hide-xs" lay-unselect> |
||||
|
<a href="javascript:" data-check-screen="full"><i class="fa fa-arrows-alt"></i></a> |
||||
|
</li> |
||||
|
<li class="layui-nav-item layuimini-setting"> |
||||
|
<a href="javascript:" th:text="${user.getName()}"></a> |
||||
|
<div id="uid" th:text="${user.getId()}" style="display: none"></div> |
||||
|
<dl class="layui-nav-child"> |
||||
|
<dd> |
||||
|
<a href="javascript:" layuimini-content-href="/account_look" data-title="基本资料" |
||||
|
data-icon="fa fa-gears">基本资料<span class="layui-badge-dot"></span></a> |
||||
|
</dd> |
||||
|
<dd style="display: none"> |
||||
|
<a href="javascript:" layuimini-content-href="/user_password" data-title="修改密码" |
||||
|
data-icon="fa fa-gears">修改密码</a> |
||||
|
</dd> |
||||
|
<dd> |
||||
|
<hr> |
||||
|
</dd> |
||||
|
<dd> |
||||
|
<a href="javascript:" class="login-out">退出登录</a> |
||||
|
</dd> |
||||
|
</dl> |
||||
|
</li> |
||||
|
<li class="layui-nav-item layuimini-select-bgcolor" lay-unselect> |
||||
|
<a href="javascript:" data-bgcolor="配色方案"><i class="fa fa-ellipsis-v"></i></a> |
||||
|
</li> |
||||
|
</ul> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<!--无限极左侧菜单--> |
||||
|
<div class="layui-side layui-bg-black layuimini-menu-left"> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<!--初始化加载层--> |
||||
|
<div class="layuimini-loader"> |
||||
|
<div class="layuimini-loader-inner"></div> |
||||
|
</div> |
||||
|
|
||||
|
<!--手机端遮罩层--> |
||||
|
<div class="layuimini-make"></div> |
||||
|
|
||||
|
<!-- 移动导航 --> |
||||
|
<div class="layuimini-site-mobile"><i class="layui-icon"></i></div> |
||||
|
|
||||
|
<div class="layui-body"> |
||||
|
|
||||
|
<div class="layuimini-tab layui-tab-rollTool layui-tab" lay-filter="layuiminiTab" lay-allowclose="true"> |
||||
|
<ul class="layui-tab-title"> |
||||
|
<li class="layui-this" id="layuiminiHomeTabId" lay-id=""></li> |
||||
|
</ul> |
||||
|
<div class="layui-tab-control"> |
||||
|
<li class="layuimini-tab-roll-left layui-icon layui-icon-left"></li> |
||||
|
<li class="layuimini-tab-roll-right layui-icon layui-icon-right"></li> |
||||
|
<li class="layui-tab-tool layui-icon layui-icon-down"> |
||||
|
<ul class="layui-nav close-box"> |
||||
|
<li class="layui-nav-item"> |
||||
|
<a href="javascript:"><span class="layui-nav-more"></span></a> |
||||
|
<dl class="layui-nav-child"> |
||||
|
<dd><a href="javascript:" layuimini-tab-close="current">关 闭 当 前</a></dd> |
||||
|
<dd><a href="javascript:" layuimini-tab-close="other">关 闭 其 他</a></dd> |
||||
|
<dd><a href="javascript:" layuimini-tab-close="all">关 闭 全 部</a></dd> |
||||
|
</dl> |
||||
|
</li> |
||||
|
</ul> |
||||
|
</li> |
||||
|
</div> |
||||
|
<div class="layui-tab-content"> |
||||
|
<div id="layuiminiHomeTabIframe" class="layui-tab-item layui-show"></div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script> |
||||
|
<script src="/static/js/lay-config.js?v=2.0.0" charset="utf-8"></script> |
||||
|
<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> |
||||
|
<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
|
||||
|
layui.use(['jquery', 'layer', 'miniAdmin'], function () { |
||||
|
var $ = layui.jquery, |
||||
|
layer = layui.layer, |
||||
|
miniAdmin = layui.miniAdmin; |
||||
|
|
||||
|
|
||||
|
|
||||
|
var dataByConfig; |
||||
|
var uid = $("#uid").text(); |
||||
|
var options = { |
||||
|
clearUrl: "/static/api/clear.json", // 缓存清理接口 |
||||
|
urlHashLocation: true, // 是否打开hash定位 |
||||
|
bgColorDefault: false, // 主题默认配置 |
||||
|
multiModule: true, // 是否开启多模块 |
||||
|
menuChildOpen: false, // 是否默认展开菜单 |
||||
|
loadingTime: 0, // 初始化加载时间 |
||||
|
pageAnim: true, // iframe窗口动画 |
||||
|
maxTabNum: 20, // 最大的tab打开数量 |
||||
|
}; |
||||
|
options.iniUrl = "/index/menus?uid=" + uid; // 初始化接口 |
||||
|
miniAdmin.render(options); |
||||
|
|
||||
|
|
||||
|
$("#scan").on("click", function () { |
||||
|
layer.open({ |
||||
|
type: 2, |
||||
|
title: '扫码', |
||||
|
skin: 'layui-layer-rim', |
||||
|
maxmin: true, |
||||
|
shadeClose: true, //点击遮罩关闭层 |
||||
|
area: ['100%', '100%'], |
||||
|
move: '.layui-layer-title', |
||||
|
fixed: false, |
||||
|
content: '/scanQrCode' |
||||
|
}) |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
$('.login-out').on("click", function () { |
||||
|
$.ajax({ |
||||
|
url: "/loginOut", |
||||
|
type: 'get', |
||||
|
dataType: 'json', |
||||
|
contentType: "application/json;charset=utf-8", |
||||
|
beforeSend: function () { |
||||
|
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
||||
|
}, |
||||
|
success: function (data) { |
||||
|
layer.close(this.layerIndex); |
||||
|
layer.msg(data.statusInfo.message, function () { |
||||
|
window.location = '/login'; |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
let url = window.location.href.split("#")[0]; |
||||
|
var req = {}; |
||||
|
req.url = url; |
||||
|
$.ajax({ |
||||
|
url: "/QyWxSignature", |
||||
|
type: "get", |
||||
|
datatype: "json", |
||||
|
data: (req), |
||||
|
contentType: "application/json;charset=utf-8", |
||||
|
success: function (d) { |
||||
|
var data = d.data; |
||||
|
wx.config({ |
||||
|
beta: true,// 必须这么写,否则wx.invoke调用形式的jsapi会有问题 |
||||
|
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 |
||||
|
appId: data.corpid, // 必填,企业微信的corpID |
||||
|
timestamp: data.timestamp, // 必填,生成签名的时间戳 |
||||
|
nonceStr: data.noncestr, // 必填,生成签名的随机串 |
||||
|
signature: data.jsapi_ticket_enterprises,// 必填,签名,见 附录-JS-SDK使用权限签名算法 |
||||
|
jsApiList: ['invoke','thirdPartyOpenPage','scanQRCode'] // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来 |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,236 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
||||
|
<head> |
||||
|
<meta charset="utf-8"> |
||||
|
<title>首页二</title> |
||||
|
<meta name="renderer" content="webkit"> |
||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
||||
|
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all"> |
||||
|
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all"> |
||||
|
<link rel="stylesheet" href="/static/css/public.css" media="all"> |
||||
|
<style> |
||||
|
.layui-card {border:1px solid #f2f2f2;border-radius:5px;} |
||||
|
.icon {margin-right:10px;color:#1aa094;} |
||||
|
.icon-cray {color:#ffb800!important;} |
||||
|
.icon-blue {color:#1e9fff!important;} |
||||
|
.icon-tip {color:#ff5722!important;} |
||||
|
.layuimini-qiuck-module {text-align:center;margin-top: 10px} |
||||
|
.layuimini-qiuck-module a i {display:inline-block;width:100%;height:60px;line-height:60px;text-align:center;border-radius:2px;font-size:30px;background-color:#F8F8F8;color:#333;transition:all .3s;-webkit-transition:all .3s;} |
||||
|
.layuimini-qiuck-module a cite {position:relative;top:2px;display:block;color:#666;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:14px;} |
||||
|
.welcome-module {width:100%;height:210px;} |
||||
|
.panel {background-color:#fff;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)} |
||||
|
.panel-body {padding:10px} |
||||
|
.panel-title {margin-top:0;margin-bottom:0;font-size:12px;color:inherit} |
||||
|
.label {display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em;margin-top: .3em;} |
||||
|
.layui-red {color:red} |
||||
|
.main_btn > p {height:40px;} |
||||
|
.layui-bg-number {background-color:#F8F8F8;} |
||||
|
.layuimini-notice:hover {background:#f6f6f6;} |
||||
|
.layuimini-notice {padding:7px 16px;clear:both;font-size:12px !important;cursor:pointer;position:relative;transition:background 0.2s ease-in-out;} |
||||
|
.layuimini-notice-title,.layuimini-notice-label { |
||||
|
padding-right: 70px !important;text-overflow:ellipsis!important;overflow:hidden!important;white-space:nowrap!important;} |
||||
|
.layuimini-notice-title {line-height:28px;font-size:14px;} |
||||
|
.layuimini-notice-extra {position:absolute;top:50%;margin-top:-8px;right:16px;display:inline-block;height:16px;color:#999;} |
||||
|
</style> |
||||
|
</head> |
||||
|
<body> |
||||
|
<div class="layuimini-container"> |
||||
|
<div class="layuimini-main"> |
||||
|
<div class="layui-row layui-col-space15"> |
||||
|
<div class="layui-col-md8"> |
||||
|
<div class="layui-row layui-col-space15"> |
||||
|
<div class="layui-col-md6"> |
||||
|
<div class="layui-card"> |
||||
|
<div class="layui-card-header"><i class="fa fa-signal icon"></i>数据统计</div> |
||||
|
<div class="layui-card-body"> |
||||
|
<div class="welcome-module"> |
||||
|
<div class="layui-row layui-col-space10"> |
||||
|
<div class="layui-col-xs6"> |
||||
|
<div class="panel layui-bg-number"> |
||||
|
<div class="panel-body"> |
||||
|
<div class="panel-title"> |
||||
|
<span class="label pull-right layui-bg-blue">实时</span> |
||||
|
<h5>仓库数量</h5> |
||||
|
</div> |
||||
|
<div class="panel-content"> |
||||
|
<h1 class="no-margins" th:text="${depositoryCount}" >4</h1> |
||||
|
<small>当前分类总记录数</small> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-col-xs6"> |
||||
|
<div class="panel layui-bg-number"> |
||||
|
<div class="panel-body"> |
||||
|
<div class="panel-title"> |
||||
|
<span class="label pull-right layui-bg-cyan">实时</span> |
||||
|
<h5>库存金额统计</h5> |
||||
|
</div> |
||||
|
<div class="panel-content"> |
||||
|
<h1 class="no-margins" th:text="${allPrice}" >12032</h1> |
||||
|
<small>当前分类总记录数</small> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-col-xs6"> |
||||
|
<div class="panel layui-bg-number"> |
||||
|
<div class="panel-body"> |
||||
|
<div class="panel-title"> |
||||
|
<span class="label pull-right layui-bg-orange">实时</span> |
||||
|
<h5>物品数</h5> |
||||
|
</div> |
||||
|
<div class="panel-content"> |
||||
|
<h1 class="no-margins" th:text="${allMaterial}"></h1> |
||||
|
<small>当前分类总记录数</small> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-col-xs6"> |
||||
|
<div class="panel layui-bg-number"> |
||||
|
<div class="panel-body"> |
||||
|
<div class="panel-title"> |
||||
|
<span class="label pull-right layui-bg-green">实时</span> |
||||
|
<h5>仓库流水</h5> |
||||
|
</div> |
||||
|
<div class="panel-content"> |
||||
|
<h1 class="no-margins" th:text="${warehouseRecord}"></h1> |
||||
|
<small>当前分类总记录数</small> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-col-md6"> |
||||
|
<div class="layui-card"> |
||||
|
<div class="layui-card-header"><i class="fa fa-credit-card icon icon-blue"></i>快捷入口</div> |
||||
|
<div class="layui-card-body"> |
||||
|
<div class="welcome-module"> |
||||
|
<div class="layui-row layui-col-space10 layuimini-qiuck"> |
||||
|
<div class="layui-col-xs3 layuimini-qiuck-module"> |
||||
|
<a href="javascript:;" layuimini-content-href="/application_in" data-title="入库申请" data-icon="fa fa-window-maximize"> |
||||
|
<i class="layui-icon layui-icon-file-b"></i> |
||||
|
<cite>入库申请</cite> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="layui-col-xs3 layuimini-qiuck-module"> |
||||
|
<a href="javascript:;" layuimini-content-href="/application_out" data-title="出库申请" data-icon="fa fa-gears"> |
||||
|
<i class="fa fa-file-text"></i> |
||||
|
<cite>出库申请</cite> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="layui-col-xs3 layuimini-qiuck-module"> |
||||
|
<a href="javascript:;" layuimini-content-href="/application_transfer" data-title="转移申请" data-icon="fa fa-file-text"> |
||||
|
<i class="fa fa-exchange"></i> |
||||
|
<cite>转移申请</cite> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="layui-col-xs3 layuimini-qiuck-module"> |
||||
|
<a href="javascript:;" layuimini-content-href="/table_in" data-title="入库查询" data-icon="fa fa-dot-circle-o"> |
||||
|
<i class="fa fa-cubes"></i> |
||||
|
<cite>入库查询</cite> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="layui-col-xs3 layuimini-qiuck-module"> |
||||
|
<a href="javascript:;" layuimini-content-href="/table_out" data-title="出库查询" data-icon="fa fa-calendar"> |
||||
|
<i class="fa fa-eye"></i> |
||||
|
<cite>出库查询</cite> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="layui-col-xs3 layuimini-qiuck-module"> |
||||
|
<a href="javascript:;" layuimini-content-href="/table_stock" data-title="库存查询" data-icon="fa fa-hourglass-end"> |
||||
|
<i class="fa fa-binoculars"></i> |
||||
|
<cite>库存查询</cite> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="layui-col-xs3 layuimini-qiuck-module"> |
||||
|
<a href="javascript:;" layuimini-content-href="/my_task" data-title="我的任务" data-icon="fa fa-snowflake-o"> |
||||
|
<i class="fa fa-tasks"></i> |
||||
|
<cite>我的任务</cite> |
||||
|
</a> |
||||
|
</div> |
||||
|
<div class="layui-col-xs3 layuimini-qiuck-module"> |
||||
|
<a href="javascript:;" layuimini-content-href="/my_apply" data-title="我的申请" data-icon="fa fa-search"> |
||||
|
<i class="fa fa-paper-plane"></i> |
||||
|
<cite>我的申请</cite> |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="layui-col-md4"> |
||||
|
|
||||
|
<div class="layui-card"> |
||||
|
<div class="layui-card-header"><i class="fa fa-bullhorn icon icon-tip"></i>系统公告</div> |
||||
|
<div class="layui-card-body layui-text"> |
||||
|
<div class="layuimini-notice" th:each="notice,iterStat:${notices}"> |
||||
|
<div class="layuimini-notice-title" th:text="${notice.getTitle()}">修改选项卡样式</div> |
||||
|
<div class="layuimini-notice-extra" th:text="${notice.getTime()}">2019-07-11 23:06</div> |
||||
|
<div class="layuimini-notice-content layui-hide" th:text="${notice.getContent()}"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script> |
||||
|
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script> |
||||
|
<script> |
||||
|
layui.use(['layer', 'miniTab','echarts'], function () { |
||||
|
var $ = layui.jquery, |
||||
|
layer = layui.layer, |
||||
|
miniTab = layui.miniTab, |
||||
|
echarts = layui.echarts; |
||||
|
|
||||
|
miniTab.listen(); |
||||
|
|
||||
|
/** |
||||
|
* 查看公告信息 |
||||
|
**/ |
||||
|
$('body').on('click', '.layuimini-notice', function () { |
||||
|
var title = $(this).children('.layuimini-notice-title').text(), |
||||
|
noticeTime = $(this).children('.layuimini-notice-extra').text(), |
||||
|
content = $(this).children('.layuimini-notice-content').html(); |
||||
|
var html = '<div style="padding:15px 20px; text-align:justify; line-height: 22px;border-bottom:1px solid #e2e2e2;background-color: #2f4056;color: #ffffff">\n' + |
||||
|
'<div style="text-align: center;margin-bottom: 20px;font-weight: bold;border-bottom:1px solid #718fb5;padding-bottom: 5px"><h4 class="text-danger">' + title + '</h4></div>\n' + |
||||
|
'<div style="font-size: 12px">' + content + '</div>\n' + |
||||
|
'</div>\n'; |
||||
|
parent.layer.open({ |
||||
|
type: 1, |
||||
|
title: '系统公告'+'<span style="float: right;right: 1px;font-size: 12px;color: #b1b3b9;margin-top: 1px">'+noticeTime+'</span>', |
||||
|
area: '300px;', |
||||
|
shade: 0.8, |
||||
|
id: 'layuimini-notice', |
||||
|
btn: ['查看', '取消'], |
||||
|
btnAlign: 'c', |
||||
|
moveType: 1, |
||||
|
content:html, |
||||
|
success: function (layero) { |
||||
|
var btn = layero.find('.layui-layer-btn'); |
||||
|
// btn.find('.layui-layer-btn0').attr({ |
||||
|
// href: 'https://gitee.com/zhongshaofa/layuimini', |
||||
|
// target: '_blank' |
||||
|
// }); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
}); |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,161 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
||||
|
<head> |
||||
|
<meta charset="utf-8"> |
||||
|
<title>layui</title> |
||||
|
<meta name="renderer" content="webkit"> |
||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
||||
|
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all"> |
||||
|
<link rel="stylesheet" href="/static/css/public.css" media="all"> |
||||
|
</head> |
||||
|
<body> |
||||
|
<div id="test2" class="demo-tree"></div> |
||||
|
<input id="mname" name="mname" th:value="${mname}" style="display: none"> |
||||
|
<input id="type" name="type" th:value="${type}" style="display: none"> |
||||
|
<input id="clickObj" name="clickObj" th:value="${clickObj}" style="display: none"> |
||||
|
<input id="placeId" name="placeId" th:value="${placeId}" style="display: none"> |
||||
|
<input id="depositoryId" name="depositoryId" th:value="${depositoryId}" style="display: none"> |
||||
|
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script> |
||||
|
<script> |
||||
|
layui.use(['form', 'layer', 'dropdown', 'tree'], function () { |
||||
|
var $ = layui.jquery, |
||||
|
tree = layui.tree; |
||||
|
var mname = $("#mname").val(); |
||||
|
var type = $("#type").val(); |
||||
|
var clickObj = $("#clickObj").val(); |
||||
|
var placeId = $("#placeId").val(); |
||||
|
var depositoryId = $("#depositoryId").val(); |
||||
|
|
||||
|
|
||||
|
|
||||
|
// 用于暂存当前查询结果 |
||||
|
var tempData = []; |
||||
|
var req = {}; |
||||
|
req.mname = mname; |
||||
|
req.type = type; |
||||
|
if(placeId !== "-1"){ |
||||
|
req.placeId = placeId; |
||||
|
req.depositoryId = depositoryId; |
||||
|
} |
||||
|
var test = tree.render({ |
||||
|
elem: '#test2' |
||||
|
, data: [] |
||||
|
, click: function (obj) { |
||||
|
var state = obj.state; |
||||
|
if (obj.data.children !== undefined) { |
||||
|
if("open" === state){ |
||||
|
var id = obj.data.id; |
||||
|
var param = {}; |
||||
|
param.mtId = id; |
||||
|
param.mname = mname; |
||||
|
param.type = type; |
||||
|
if(placeId !== "-1"){ |
||||
|
param.placeId = placeId; |
||||
|
param.depositoryId = depositoryId; |
||||
|
} |
||||
|
addTreeChildren(param); |
||||
|
}else{ |
||||
|
return false |
||||
|
} |
||||
|
}else{ |
||||
|
var windowParent = $("#"+clickObj,window.parent.document)[0]; |
||||
|
var children = windowParent.childNodes[5]; |
||||
|
var materialItem = children.childNodes[3].childNodes[1].childNodes; |
||||
|
var materialName = materialItem[1]; |
||||
|
var materialId = materialName.parentNode.parentNode.childNodes[3]; |
||||
|
materialName.value = obj.data.title; |
||||
|
materialId.value = obj.data.id; |
||||
|
var index = parent.layer.getFrameIndex(window.name); |
||||
|
parent.layer.close(index); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
$.ajax({ |
||||
|
url: "/material/treeMenus", |
||||
|
data: JSON.stringify(req), |
||||
|
type: 'post', |
||||
|
dataType: 'json', |
||||
|
contentType: "application/json;charset=utf-8", |
||||
|
beforeSend:function () { |
||||
|
this.layerIndex = layer.load(0, { shade: [0.5, '#393D49'] }); |
||||
|
}, |
||||
|
success: function (d) { |
||||
|
layer.close(this.layerIndex); |
||||
|
var data2 = d.data; |
||||
|
tempData = data2; |
||||
|
test.reload({ |
||||
|
data: tempData |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
$("#test2").on("click",".layui-tree-entry",function(event){ |
||||
|
|
||||
|
var target = $(event.target); |
||||
|
var id = this.parentNode.getAttribute("data-id"); |
||||
|
var context = target.context.className; |
||||
|
if(context.includes("layui-tree-main")){ |
||||
|
var childrenName = this.childNodes[0].childNodes[0].childNodes[0].className; |
||||
|
if(childrenName.includes("layui-icon-addition")){ |
||||
|
// console.log("隐藏") |
||||
|
}else if(childrenName.includes("layui-icon-subtraction")){ |
||||
|
var param = {}; |
||||
|
param.mtId = id; |
||||
|
param.mname = mname; |
||||
|
param.type = type; |
||||
|
if(placeId !== "-1"){ |
||||
|
param.placeId = placeId; |
||||
|
param.depositoryId = depositoryId; |
||||
|
} |
||||
|
addTreeChildren(param); |
||||
|
|
||||
|
} |
||||
|
}else if(context.includes("layui-icon")){ |
||||
|
if(context.includes("layui-icon-addition")){ |
||||
|
// console.log("隐藏") |
||||
|
}else if(context.includes("layui-icon-subtraction")){ |
||||
|
var param = {}; |
||||
|
param.mtId = id; |
||||
|
param.mname = mname; |
||||
|
param.type = type; |
||||
|
if(placeId !== "-1"){ |
||||
|
param.placeId = placeId; |
||||
|
param.depositoryId = depositoryId; |
||||
|
} |
||||
|
addTreeChildren(param); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
// 用于添加分支 |
||||
|
addTreeChildren = function(param) { |
||||
|
$.ajax({ |
||||
|
url: "/material/getNewTreeForMtId", |
||||
|
data: JSON.stringify(param), |
||||
|
type: 'post', |
||||
|
dataType: 'json', |
||||
|
contentType: "application/json;charset=utf-8", |
||||
|
beforeSend: function () { |
||||
|
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); |
||||
|
}, |
||||
|
success: function (d) { |
||||
|
layer.close(this.layerIndex); |
||||
|
var data2 = d.data; |
||||
|
tempData = data2; |
||||
|
test.reload({ |
||||
|
data: tempData |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
}) |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
||||
Loading…
Reference in new issue