Showing
3 changed files
with
86 additions
and
0 deletions
1 | +layui.define(['common', "commonDetail"], function (exports) { | ||
2 | + var $ = layui.$; | ||
3 | + | ||
4 | + var commonDetail = layui.commonDetail; | ||
5 | + let common = layui.common | ||
6 | + | ||
7 | + //对外暴露的接口 | ||
8 | + exports('businessIndex', function () { | ||
9 | + window.addEventListener('message', function (e) { | ||
10 | + let data = e.data; | ||
11 | + let params = data.message; | ||
12 | + let type = data.type; | ||
13 | + switch (type) { | ||
14 | + case 'openDetail': | ||
15 | + // 打开详情页 | ||
16 | + commonDetail.openDetail(params.resId, params.resType); | ||
17 | + break; | ||
18 | + case 'openTopo': | ||
19 | + // 打开拓扑 | ||
20 | + common.viewResTopo(params.resId) | ||
21 | + break; | ||
22 | + case "openLayer": | ||
23 | + // 打开弹框 | ||
24 | + layer.open({ | ||
25 | + type: 2, | ||
26 | + title: params.title, | ||
27 | + area: params.area, | ||
28 | + content: params.content | ||
29 | + }) | ||
30 | + break; | ||
31 | + } | ||
32 | + }); | ||
33 | + }); | ||
34 | +}); |
1 | +<title></title> | ||
2 | + | ||
3 | +<script template type="text/html"> | ||
4 | + {{# | ||
5 | + var router = layui.router(); | ||
6 | + var redirectUrl = router.search.redirectUrl; | ||
7 | + if(redirectUrl){ | ||
8 | + redirectUrl = redirectUrl.replace("$$","#/").replace("$","/") | ||
9 | + } | ||
10 | + var viewURL = sessionStorage.getItem('domainName') + '/' + redirectUrl; | ||
11 | + }} | ||
12 | + <iframe src="{{viewURL}}?accessToken={{localStorage.getItem('access_token')}}" frameborder="0" class="layadmin-iframe" | ||
13 | + style="height: 99.5%!important;"></iframe> | ||
14 | +</script> | ||
15 | +<script> | ||
16 | + layui.use('businessIndex', function (fn) { | ||
17 | + fn(); | ||
18 | + }); | ||
19 | +</script> |
1 | +该目录为插件目录页面访问 | ||
2 | + | ||
3 | +模块文件配置,/src/java/resource/ReadMe.json | ||
4 | +{ | ||
5 | + "gateway":"api-room", | ||
6 | + "module": [ | ||
7 | + { | ||
8 | + "classPackage": "com.honggroup.tools.holiday", | ||
9 | + "desc": "节假日功能", | ||
10 | + "staticPackage": "/src/tools/holiday", | ||
11 | + "router": [ | ||
12 | + { | ||
13 | + "path": "/resourcePool", | ||
14 | + "name": "ResourcePool" | ||
15 | + }, | ||
16 | + { | ||
17 | + "path": "/resourcePool1", | ||
18 | + "name": "ResourcePool1" | ||
19 | + } | ||
20 | + ] | ||
21 | + } | ||
22 | + ] | ||
23 | +} | ||
24 | + | ||
25 | +网关白名单增加配置:,/**/**.html**,/api-room/module/**,/**/**.woff2,/**/**.ttf,/**/**.png,/**/**.json | ||
26 | + | ||
27 | + | ||
28 | +/business/index/redirectUrl=api-room$index.html$$test | ||
29 | +$表示:/ | ||
30 | +$$表示:#/ | ||
31 | +访问地址:/business/index/redirectUrl=${readMe.gateway}$index.html$$${readMe.module[x].router[x].path]} | ||
32 | + | ||
33 | + |
-
Please register or login to post a comment