index.html 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <!DOCTYPE html>
  2. <html lang="en" style="background-color: #f2f2f2;">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>商务局</title>
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  9. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  10. <meta name="apple-mobile-web-app-capable" content="yes">
  11. <meta name="format-detection" content="telephone=no">
  12. <link rel="stylesheet" type="text/css" href="../layui/css/layui.css" />
  13. <link rel="stylesheet" type="text/css" href="css/style.css" />
  14. <link rel="stylesheet" type="text/css" href="../iconfont/iconfont.css" />
  15. <style>
  16. .ui-required:before {
  17. content: "*";
  18. color: red;
  19. vertical-align: middle;
  20. }
  21. </style>
  22. <!--角色模板-->
  23. <script type="text/html" id="mainTpl">
  24. {{# layui.each(d, function(index, item){ }}
  25. <div class="layui-col-xs12 layui-col-sm4 layui-col-md3">
  26. <div class="layui-card">
  27. <a href="{{item.path}}?sysId={{item.sysId}}" target="_blank">
  28. <div class="layui-card-body main-card-body">
  29. <div class="icon-panel {{item.color}}"><i class="iconfont">{{item.icon}}</i></div>
  30. <h4>{{item.sysName}}</h4>
  31. </div>
  32. </a>
  33. </div>
  34. </div>
  35. {{# }); }}
  36. </script>
  37. </head>
  38. <div id="sysSetInfo" style="display: none">
  39. <form class="layui-form" lay-filter="addForm" action="" style="padding: 0 20px 0 0">
  40. <div class="layui-form-item" style="background-color: #f2f2f2; margin-right: -20px;">
  41. <label class="layui-form-label ui-required"><i class="layui-icon layui-icon-face-smile"
  42. style="font-size: 26px; color: #FF5722;"></i></label>
  43. <div class="layui-input-block">
  44. <span style="line-height:40px; color: #666">因为系统尚未完成配置,无法在平台进行操作,请先完成系统配置。</span>
  45. </div>
  46. </div>
  47. <div class="layui-form-item">
  48. <label class="layui-form-label ui-required">单位名称</label>
  49. <div class="layui-input-block">
  50. <input type="text" name="branchName" required lay-verify="required" placeholder="请输入单位名称" autocomplete="off"
  51. class="layui-input">
  52. </div>
  53. </div>
  54. <div id="areaSelect"></div>
  55. <div class="layui-form-item">
  56. <div class="layui-input-block layui-layer-btn" style="position: absolute; bottom: 0; right: 10px;">
  57. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="" lay-filter="formDemo"
  58. style="width: 5rem;">保
  59. 存</button>
  60. </div>
  61. </div>
  62. </form>
  63. </div>
  64. <body>
  65. <div class="main-nav">
  66. <div class="logo"><a href="../../index.html">贵阳市农产品流通大数据信息平台</a></div>
  67. <ul class="layui-nav nav-menu">
  68. <li class="layui-nav-item">
  69. <a href="javascript:;"><img src="img/face.jpg" class="layui-nav-img"><cite id="userName"></cite></a>
  70. <dl class="layui-nav-child">
  71. <dd><a href="javascript:;" id="clickInfo"><i class="layui-icon">&#xe66f;</i>个人资料</a></dd>
  72. <dd><a href="javascript:;" id="clickPwd"><i class="layui-icon">&#xe673;</i>修改密码</a></dd>
  73. <dd><a href="javascript:;" id="dropOut"><i class="iconfont" style="font-size: 16px;">&#xe61d;</i>退出</a></dd>
  74. </dl>
  75. </li>
  76. </ul>
  77. </div>
  78. <div class="layui-fluid">
  79. <div class="layui-row">
  80. <div class="layui-col-md12">
  81. </div>
  82. </div>
  83. <div class="layui-layout layui-main-layout">
  84. <div class="layui-row layui-col-space30" id="mainInfo">
  85. <div class="layui-col-xs12 layui-col-sm4 layui-col-md3">
  86. <div class="layui-card">
  87. <a href="../ncp/index.html">
  88. <div class="layui-card-body main-card-body">
  89. <div class="icon-panel violet-icon"><i class="iconfont">&#xe606;</i></div>
  90. <h4>农产品价格管理系统</h4>
  91. </div>
  92. </a>
  93. </div>
  94. </div>
  95. <div class="layui-col-xs12 layui-col-sm4 layui-col-md3">
  96. <div class="layui-card">
  97. <a href="#">
  98. <div class="layui-card-body main-card-body">
  99. <div class="icon-panel green-icon"><i class="iconfont">&#xe60b;</i></div>
  100. <h4>物流园店面价格监测系统</h4>
  101. </div>
  102. </a>
  103. </div>
  104. </div>
  105. <div class="layui-col-xs12 layui-col-sm4 layui-col-md3">
  106. <div class="layui-card">
  107. <a href="#">
  108. <div class="layui-card-body main-card-body">
  109. <div class="icon-panel pink-icon"><i class="iconfont">&#xe622;</i></div>
  110. <h4>北部价格交易监控系统</h4>
  111. </div>
  112. </a>
  113. </div>
  114. </div>
  115. <div class="layui-col-xs12 layui-col-sm4 layui-col-md3">
  116. <div class="layui-card">
  117. <a href="#">
  118. <div class="layui-card-body main-card-body">
  119. <div class="icon-panel grass-icon"><i class="iconfont">&#xe618;</i></div>
  120. <h4>供应链管理系统</h4>
  121. </div>
  122. </a>
  123. </div>
  124. </div>
  125. <div class="layui-col-xs12 layui-col-sm4 layui-col-md3">
  126. <div class="layui-card">
  127. <a href="../systemSet/index.html">
  128. <div class="layui-card-body main-card-body">
  129. <div class="icon-panel blue-icon"><i class="iconfont">&#xe60f;</i></div>
  130. <h4>系统设置</h4>
  131. </div>
  132. </a>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. <!-- 底部 -->
  139. <div class="layui-footer footer">
  140. <p>Copyright © 2020-present 技术支持
  141. <a href="javascript:void(0);">www.gz-xtd.com 信通达智能科技有限公司</a>
  142. </p>
  143. </div>
  144. <script src="../layui/layui.js" type="text/javascript" charset="utf-8"></script>
  145. <script src="../js/ajaxhook.min.js" type="text/javascript" charset="utf-8"></script>
  146. <script src="../js/config.js" type="text/javascript" charset="utf-8"></script>
  147. <script>
  148. layui.config({
  149. base: "../js/layuiPlugins/"
  150. }).use(['element', 'jquery', 'laytpl', 'layer', 'cascade', "form",], function () {
  151. var element = layui.element,
  152. form = layui.form,
  153. laytpl = layui.laytpl,
  154. layer = layui.layer,
  155. $ = layui.jquery,
  156. cascade = layui.cascade;
  157. var sysInfo = {
  158. areaPort: { //地区,参数名:接口
  159. provinceId: 'getProvince',
  160. cityId: 'getCity',
  161. countyId: 'getCounty'
  162. },
  163. infoSet: localStorage.getItem('sysSet')
  164. }
  165. //初始化
  166. sysInfo.main = function () {
  167. console.log('维护设置', this.infoSet)
  168. //初始化地区
  169. this.areaCascade = cascade.render({
  170. title: "区域",
  171. elem: '#areaSelect',
  172. url: this.areaPort
  173. })
  174. //系统维护信息
  175. if (this.infoSet == 'false') {
  176. layer.open({
  177. type: 1,
  178. title: '系统维护',
  179. skin: 'layui-layer-demo',
  180. area: ['750px', '590px'],
  181. closeBtn: 0,
  182. anim: 0,
  183. content: $('#sysSetInfo')
  184. });
  185. return;
  186. }
  187. };
  188. sysInfo.main();
  189. $('#clickInfo').on('click', function () {
  190. layer.open({
  191. type: 2,
  192. title: '',
  193. skin: 'layui-layer-demo', //样式类名
  194. closeBtn: 1, //不显示关闭按钮
  195. anim: 2,
  196. area: ['600px', '400px'],
  197. content: '../user/userInfo.html'
  198. });
  199. })
  200. $('#clickPwd').on('click', function () {
  201. layer.open({
  202. type: 2,
  203. title: '',
  204. skin: 'layui-layer-demo', //样式类名
  205. closeBtn: 1, //不显示关闭按钮
  206. anim: 2,
  207. area: ['600px', '400px'],
  208. content: '../user/changePwd.html'
  209. });
  210. })
  211. //监听提交
  212. form.on('submit(formDemo)', function (obj) {
  213. $.ajax({
  214. type: this.id ? 'PUT' : 'POST',
  215. url: 'systemFormUrl',
  216. data: JSON.stringify(obj.field),
  217. contentType: 'application/json',
  218. success: function (res) {
  219. if (!(res.code - 0)) {
  220. parent.layer.msg('设置成功,谢谢您的配合', {
  221. icon: 1
  222. });
  223. setTimeout(function () {
  224. layer.closeAll();
  225. localStorage.removeItem("sysSet");
  226. }, 1000)
  227. } else {
  228. layer.msg(res.msg, {
  229. icon: 2
  230. });
  231. }
  232. }
  233. });
  234. return false;
  235. });
  236. //数据模板
  237. var userInfo = layui.sessionData(window.hywa.sessionTable.tableName);
  238. $.ajax({
  239. type: "get",
  240. url: 'mainInfo?id=' + userInfo[window.hywa.sessionTable.userData].userId,
  241. success: function (res) {
  242. if (!(res.code - 0)) {
  243. console.log('sj', res)
  244. let resData = res.data;
  245. var getTpl = mainTpl.innerHTML,
  246. view = document.getElementById('mainInfo');
  247. laytpl(getTpl).render(resData, function (html) {
  248. view.innerHTML = html;
  249. var href = location.href.match(/(\S*)main/)[1];
  250. for (let i = 0; i < resData.length; i++) {
  251. let t = $('#mainInfo').find('a');
  252. if (!resData[i].path) {
  253. $(t[i]).attr('href', '#');
  254. $(t[i]).on('click', function () {
  255. layer.msg('此系统未开通', {
  256. icon: 5
  257. })
  258. $(t[i]).attr('target', '');
  259. })
  260. } else {
  261. $(t[i]).attr('href', href + resData[i].path + '?sysId=' +
  262. resData[i].sysId)
  263. }
  264. }
  265. });
  266. }
  267. }
  268. });
  269. //用户昵称
  270. var userInfo = layui.sessionData(window.hywa.sessionTable.tableName);
  271. $('#userName').html(JSON.stringify(userInfo) != '{}' ? userInfo[window.hywa.sessionTable.userData].name :
  272. '游客用户');
  273. //退出
  274. $('#dropOut').on("click", function () {
  275. layer.msg('注销中……', {
  276. icon: 6,
  277. time: 5000
  278. });
  279. $.ajax({
  280. type: "DELETE",
  281. url: 'loginOut?userId=' + userInfo[window.hywa.sessionTable.userData].userId,
  282. success: function (res) {
  283. if (!(res.code - 0)) {
  284. layui.sessionData(window.hywa.sessionTable.tableName, null);
  285. window.sessionStorage.removeItem("menu");
  286. localStorage.removeItem("sysReps");
  287. location.href = window.hywa.jumpPage.login;
  288. } else {
  289. }
  290. }
  291. });
  292. });
  293. });
  294. if (JSON.stringify(layui.sessionData(window.hywa.sessionTable.tableName)) == "{}") {
  295. layui.sessionData(window.hywa.sessionTable.tableName, null);
  296. top.location.href = window.hywa.jumpPage.login;
  297. }
  298. </script>
  299. </body>
  300. </html>