Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_web
check
Commits
13d64db1
Commit
13d64db1
authored
Nov 14, 2022
by
Takumi Imai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修正
parent
310fb42a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
0 deletions
+82
-0
abweb/common/js/constant.js
+19
-0
abweb/js/header/header.js
+63
-0
No files found.
abweb/common/js/constant.js
View file @
13d64db1
...
...
@@ -23,6 +23,25 @@ CONSTANT.PAGE_NAME = {
LOGIN
:
'./login.html'
,
};
CONSTANT
.
URL_TREE_NAME
=
{
OPERATION_LIST
:
'index.html'
,
DASHBOARD
:
'dashboard.html'
,
REPORT_FORM
:
'reportForm.html'
,
REPORT_LIST
:
'reportList.html'
,
MESSAGE_DETAIL
:
'pushMessageDetail.html'
,
MESSAGE_LIST
:
'pushMessageList.html'
,
SEND_MESSAGE
:
'sendMessage.html'
,
SETTING
:
'accountSetting.html'
,
PICKUP
:
'pickup.html'
,
};
CONSTANT
.
URL_TREE_PASS
=
{
1
:
[
CONSTANT
.
URL_TREE_NAME
.
DASHBOARD
,
CONSTANT
.
URL_TREE_NAME
.
PICKUP
,
CONSTANT
.
URL_TREE_NAME
.
REPORT_LIST
,
CONSTANT
.
URL_TREE_NAME
.
REPORT_FORM
],
2
:
[
CONSTANT
.
URL_TREE_NAME
.
DASHBOARD
,
CONSTANT
.
URL_TREE_NAME
.
PICKUP
,
CONSTANT
.
URL_TREE_NAME
.
REPORT_FORM
],
3
:
[
CONSTANT
.
URL_TREE_NAME
.
DASHBOARD
,
CONSTANT
.
URL_TREE_NAME
.
MESSAGE_LIST
,
CONSTANT
.
URL_TREE_NAME
.
MESSAGE_DETAIL
],
4
:
[
CONSTANT
.
URL_TREE_NAME
.
DASHBOARD
,
CONSTANT
.
URL_TREE_NAME
.
SEND_MESSAGE
],
};
CONSTANT
.
PAGE_TAB
=
{
DASHBOARD
:
'dashboard'
,
OPERATION_LIST
:
'operationList'
,
...
...
abweb/js/header/header.js
View file @
13d64db1
...
...
@@ -17,6 +17,69 @@ HEADER.init = function () {
};
/**
* create url tree & show breadcrumbs list
*/
HEADER
.
urlTree
=
function
()
{
const
pathName
=
location
.
pathname
;
const
htmlName
=
pathName
.
substring
(
pathName
.
indexOf
(
'/'
)
+
1
);
//now url tree
let
urlTree
=
session
.
getItem
(
'urlTree'
);
// check auth
let
authFlg
=
false
;
if
((
!
urlTree
&&
htmlName
==
CONSTANT
.
URL_TREE_NAME
.
OPERATION_LIST
)
||
htmlName
==
CONSTANT
.
URL_TREE_NAME
.
DASHBOARD
)
{
authFlg
=
true
;
session
.
removeItem
(
'urlTree'
);
}
urlList
:
for
(
const
i
in
urlTree
)
{
const
urlHtmlName
=
urlTree
[
i
].
substring
(
0
,
pathName
.
indexOf
(
'?'
));
findUrl
:
for
(
const
passList
in
CONSTANT
.
URL_TREE_PASS
)
{
for
(
const
k
in
passList
)
{
if
(
urlHtmlName
==
passList
[
k
])
{
if
(
htmlName
==
passList
[
k
])
{
authFlg
=
true
;
break
urlList
;
}
break
;
}
else
{
break
findUrl
;
}
}
}
}
if
(
authFlg
)
{
session
.
removeItem
(
'urlTree'
);
let
newUrlTree
=
{};
const
urlPath
=
htmlName
+
location
.
search
;
for
(
const
i
in
urlTree
)
{
const
urlHtmlName
=
urlTree
[
i
].
substring
(
0
,
pathName
.
indexOf
(
'?'
));
if
(
urlHtmlName
==
htmlName
)
{
newUrlTree
.
push
(
urlPath
);
}
else
{
newUrlTree
.
push
(
urlTree
[
i
]);
}
}
session
.
setItem
(
'urlTree'
,
newUrlTree
);
//show urlTree
if
(
$
(
'.breadcrumb'
).
length
)
{
for
(
const
i
in
newUrlTree
)
{
const
urlHtmlName
=
newUrlTree
[
i
].
substring
(
0
,
pathName
.
indexOf
(
'?'
));
if
(
urlHtmlName
==
htmlName
)
{
$
(
'.breadcrumb'
).
append
(
'<li class="breadcrumb-item">作業一覧</li>'
);
}
else
{
$
(
'.breadcrumb'
).
append
(
'<li class="breadcrumb-item"><a href="task-list.html" class="text-decoration-none text-underline">作業一覧</a></li>'
);
}
}
}
}
else
{
COMMON
.
avwScreenMove
(
'index.html'
);
}
};
/**
* Direct home page setting
* @param {*} pageId
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment