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
18e25433
Commit
18e25433
authored
Oct 20, 2022
by
NGUYEN HOANG SON
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/1.0_check_web_dev_50266' into feature/1.0_check_web_dev_50265
parents
b463916f
8112496c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
113 additions
and
28 deletions
+113
-28
abvw/html/dashboard-setting.html
+59
-0
abvw/js/dashboardSetting/dashboard-setting.js
+54
-28
No files found.
abvw/html/dashboard-setting.html
0 → 100755
View file @
18e25433
<!DOCTYPE html>
<html
lang=
"ja-JP"
>
<head>
<meta
charset=
"utf-8"
>
<title>
ダッシュボード設定
</title>
<meta
name=
"robots"
content=
"index, follow"
>
<meta
name=
"viewport"
content=
"width=device-width,minimum-scale=1,initial-scale=1"
>
<meta
name=
"description"
content=
"A Book Check"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/abvw/common/css/appCommon/app.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/abvw/common/css/appCommon/fontawesome_relative_path.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/abvw/common/css/appCommon/header.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/abvw/common/css/appCommon/footer.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/abvw/common/css/appCommon/style.css"
>
<script
src=
"/abvw/common/js/jquery/jquery-3.6.0.min.js?__UPDATEID__"
></script>
<script
src=
"/abvw/common/js/jquery/jquery-ui.min.js?__UPDATEID__"
></script>
<script
src=
"/abvw/common/js/constant.js?__UPDATEID__"
></script>
<script
src=
"/abvw/common/js/common.js?__UPDATEID__"
></script>
<script
src=
"/abvw/common/js/footer.js"
></script>
<script
src=
"/abvw/js/dashboardSetting/dashboard-setting.js"
></script>
</head>
<body
id=
"dashboard"
onload=
"DashboardSetting.init();"
>
<header>
<nav
class=
"navbar navbar-dark bg-primary position-fixed fixed-top w-100"
>
<a
href=
"javascript:DashboardSetting.goBack();"
class=
"navbar-brand category-btn lht-0"
>
<i
class=
"fas fa-chevron-left fs-12 p-1"
></i>
<span
class=
"d-none d-md-inline fs-10"
>
戻る
</span>
</a>
<h1
class=
"fs-10 font-weight-bold mb-0 text-white multi-lang"
data-msg=
"dashboardSettingHeaderTitle"
>
ダッシュボード設定
</h1>
<div></div>
</nav>
</header>
<!-- setting -->
<section
class=
"container-fluid main-section"
>
<main>
<h2
class=
"fs-8 font-weight-bold mt-4 pb-2 border-bottom text-dark multi-lang"
data-msg=
"dashboardSettingDisplayHeader"
>
表示切替
</h2>
<div
class=
"setting-table-wrap"
>
<table
id=
"displayItems"
>
<tbody>
<!-- <tr>
<th><div class="font-weight-normal text-dark multi-lang" data-msg="dashboardSettingNewRegistrationTitle">新規報告</div></th>
<td>
<div class="toggle"><input type="checkbox" name="chk-new" /></div>
</td>
</tr> -->
</tbody>
</table>
</div>
</main>
</section>
<div
id=
"footer"
></div>
</body>
</html>
\ No newline at end of file
abvw/js/dashboardSetting/
check-
dashboard-setting.js
→
abvw/js/dashboardSetting/dashboard-setting.js
View file @
18e25433
var
CHK_
DashboardSetting
=
{};
CHK_
DashboardSetting
.
displayItems
=
[
{
id
:
'newReport'
,
name
:
'
chk-new
'
,
enabled
:
true
,
title
:
'新規報告'
,
msg
:
'dashboardSettingNewRegistrationTitle'
},
{
id
:
'continousWork'
,
name
:
'c
hk-proccess
'
,
enabled
:
true
,
title
:
'工程作業'
,
msg
:
'dashboardSettingContinousWorkTitle'
},
{
id
:
'reportWarning'
,
name
:
'
chk-alert
'
,
enabled
:
true
,
title
:
'警告を含む作業'
,
msg
:
'dashboardSettingReportWarningTitle'
},
{
id
:
'dashboardHome'
,
name
:
'
chk-h
ome'
,
enabled
:
false
,
title
:
'ダッシュボードをホーム画面にする'
,
msg
:
'dashboardSettingDashboardHomeTitle'
},
var
DashboardSetting
=
{};
DashboardSetting
.
displayItems
=
[
{
id
:
'newReport'
,
name
:
'
newReport
'
,
enabled
:
true
,
title
:
'新規報告'
,
msg
:
'dashboardSettingNewRegistrationTitle'
},
{
id
:
'continousWork'
,
name
:
'c
ontinousWork
'
,
enabled
:
true
,
title
:
'工程作業'
,
msg
:
'dashboardSettingContinousWorkTitle'
},
{
id
:
'reportWarning'
,
name
:
'
reportWarning
'
,
enabled
:
true
,
title
:
'警告を含む作業'
,
msg
:
'dashboardSettingReportWarningTitle'
},
{
id
:
'dashboardHome'
,
name
:
'
dashboardH
ome'
,
enabled
:
false
,
title
:
'ダッシュボードをホーム画面にする'
,
msg
:
'dashboardSettingDashboardHomeTitle'
},
];
DashboardSetting
.
baseApiUrl
=
CONSTANT
.
URL
.
CMS
.
BASE
+
ClientData
.
userInfo_accountPath
()
+
CONSTANT
.
URL
.
CMS
.
API
.
BASE
+
'dashboardSetting/'
;
DashboardSetting
.
saveSettingApiUrl
=
DashboardSetting
.
baseApiUrl
+
'saveSetting'
;
DashboardSetting
.
getSettingApiUrl
=
DashboardSetting
.
baseApiUrl
+
'getAllSettingData'
;
DashboardSetting
.
dummySettingJson
=
{
newReport
:
1
,
continousWork
:
1
,
reportWarning
:
1
,
dashboardHome
:
0
,
}
DashboardSetting
.
getSettingData
=
function
(
callback
)
{
let
param
=
{
sid
:
COMMON
.
getSid
(),
};
COMMON
.
cmsAjax
(
DashboardSetting
.
getSettingApiUrl
,
param
,
false
,
function
(
json
)
{
if
(
callback
)
{
callback
(
json
);
}
},
function
()
{
console
.
log
(
'DashboardSetting.getSettingData error'
);
});
};
//CHK_DashboardSetting.displayItemsに設定されている情報から✓されている項目をhtml上に設定する
CHK_DashboardSetting
.
loadSettings
=
function
(
)
{
CHK_
DashboardSetting
.
displayItems
.
forEach
(
function
(
item
)
{
let
enabled
=
CHK
.
dashboardSetting
[
item
.
id
];
DashboardSetting
.
loadSettings
=
function
(
settings
)
{
DashboardSetting
.
displayItems
.
forEach
(
function
(
item
)
{
let
enabled
=
settings
[
item
.
id
];
if
(
typeof
enabled
!==
'undefined'
)
{
item
.
enabled
=
enabled
;
let
itemElement
=
$
(
'#'
+
item
.
id
);
...
...
@@ -23,26 +47,31 @@ CHK_DashboardSetting.loadSettings = function () {
};
//CHK_DashboardSetting.displayItemsに設定を書き込む
CHK_
DashboardSetting
.
saveSetting
=
function
(
key
,
enabled
)
{
CHK_
DashboardSetting
.
displayItems
.
forEach
(
function
(
item
)
{
DashboardSetting
.
saveSetting
=
function
(
key
,
enabled
)
{
DashboardSetting
.
displayItems
.
forEach
(
function
(
item
)
{
if
(
item
.
id
==
key
)
{
item
.
enabled
=
enabled
;
}
});
CHK
.
saveDashboardSetting
(
key
,
enabled
);
let
param
=
{};
param
.
sid
=
COMMON
.
getSid
();
param
[
key
]
=
enabled
;
COMMON
.
cmsAjax
(
DashboardSetting
.
saveSettingApiUrl
,
param
,
false
,
function
(
json
)
{
});
};
//CHK_DashboardSetting.displayItemsからhtmlに設定画面を表示する
CHK_
DashboardSetting
.
initDisplays
=
function
()
{
DashboardSetting
.
initDisplays
=
function
()
{
$
(
'#displayItems tbody'
).
empty
();
CHK_
DashboardSetting
.
displayItems
.
forEach
(
function
(
item
)
{
var
html
=
CHK_
DashboardSetting
.
initHtmlItem
(
item
);
DashboardSetting
.
displayItems
.
forEach
(
function
(
item
)
{
var
html
=
DashboardSetting
.
initHtmlItem
(
item
);
$
(
'#displayItems tbody'
).
append
(
html
);
});
};
//設定画面に表示するhtmlを生成する
CHK_
DashboardSetting
.
initHtmlItem
=
function
(
item
)
{
DashboardSetting
.
initHtmlItem
=
function
(
item
)
{
var
titleDiv
=
'<div class="font-weight-normal text-dark multi-lang" data-msg="'
+
item
.
msg
+
'">'
+
item
.
title
+
'</div>'
;
var
toggleClass
=
'toggle'
;
if
(
item
.
enabled
)
{
...
...
@@ -55,7 +84,7 @@ CHK_DashboardSetting.initHtmlItem = function (item) {
//設定画面でクリックされてた時の処理
//
CHK_
DashboardSetting
.
bindToggleClick
=
function
()
{
DashboardSetting
.
bindToggleClick
=
function
()
{
$
(
'.toggle'
).
on
(
'click'
,
function
()
{
$
(
this
).
toggleClass
(
'checked'
);
var
id
=
$
(
this
).
attr
(
'id'
);
...
...
@@ -63,24 +92,21 @@ CHK_DashboardSetting.bindToggleClick = function () {
if
(
$
(
this
).
hasClass
(
'checked'
))
{
enabled
=
true
;
}
CHK_
DashboardSetting
.
saveSetting
(
id
,
enabled
);
DashboardSetting
.
saveSetting
(
id
,
enabled
);
});
};
//設定画面の初期処理
CHK_DashboardSetting
.
init
=
function
()
{
CHK
.
initCommon
();
$
(
'#footer'
).
load
(
'main-footer.html'
,
function
()
{
FOOTER
.
activeDashboardBottomNav
();
});
CHK
.
loadDashboardSetting
(
function
()
{
CHK_DashboardSetting
.
loadSettings
();
CHK_DashboardSetting
.
initDisplays
();
CHK_DashboardSetting
.
bindToggleClick
();
DashboardSetting
.
init
=
function
()
{
FOOTER
.
initFooter
();
DashboardSetting
.
getSettingData
(
function
(
settings
)
{
DashboardSetting
.
loadSettings
(
settings
);
DashboardSetting
.
initDisplays
();
DashboardSetting
.
bindToggleClick
();
});
};
//戻るボタン
CHK_
DashboardSetting
.
goBack
=
function
()
{
DashboardSetting
.
goBack
=
function
()
{
FOOTER
.
goDashboard
();
};
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