Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
design
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
abookCheck
design
Commits
f13e027d
Commit
f13e027d
authored
Aug 27, 2022
by
NGUYEN HOANG SON
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#49153 implement save, load dashboard setting json
parent
98e46f5f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
35 deletions
+63
-35
app/index.html
+1
-1
app/script/check-dashboard-setting.js
+20
-23
app/script/check-dashboard.js
+1
-8
app/script/check.js
+41
-3
No files found.
app/index.html
View file @
f13e027d
...
...
@@ -218,7 +218,7 @@
}
else
if
(
location
.
hash
===
'#operationList'
)
{
CHK_Footer
.
goOperationList
();
}
else
{
if
(
CHK
_DashboardSetting
.
isSettingEnabled
(
CHK_Dashboard
.
settingKey
.
dashboardHome
)
)
{
if
(
CHK
.
dashboardSetting
.
dashboardHome
)
{
CHK_Footer
.
goDashboard
();
}
else
{
CHK_Footer
.
goOperationList
();
...
...
app/script/check-dashboard-setting.js
View file @
f13e027d
var
CHK_DashboardSetting
=
{};
CHK_DashboardSetting
.
displayItems
=
[
{
id
:
'
dashboardSettingN
ewReport'
,
name
:
'chk-new'
,
enabled
:
true
,
title
:
'新規報告'
,
msg
:
'dashboardSettingNewRegistrationTitle'
},
{
id
:
'
dashboardSettingC
ontinousWork'
,
name
:
'chk-proccess'
,
enabled
:
true
,
title
:
'工程作業'
,
msg
:
'dashboardSettingContinousWorkTitle'
},
{
id
:
'
dashboardSettingR
eportWarning'
,
name
:
'chk-alert'
,
enabled
:
true
,
title
:
'警告を含む作業'
,
msg
:
'dashboardSettingReportWarningTitle'
},
{
id
:
'dashboard
SettingDashboard
Home'
,
name
:
'chk-home'
,
enabled
:
false
,
title
:
'ダッシュボードをホーム画面にする'
,
msg
:
'dashboardSettingDashboardHomeTitle'
},
{
id
:
'
n
ewReport'
,
name
:
'chk-new'
,
enabled
:
true
,
title
:
'新規報告'
,
msg
:
'dashboardSettingNewRegistrationTitle'
},
{
id
:
'
c
ontinousWork'
,
name
:
'chk-proccess'
,
enabled
:
true
,
title
:
'工程作業'
,
msg
:
'dashboardSettingContinousWorkTitle'
},
{
id
:
'
r
eportWarning'
,
name
:
'chk-alert'
,
enabled
:
true
,
title
:
'警告を含む作業'
,
msg
:
'dashboardSettingReportWarningTitle'
},
{
id
:
'dashboardHome'
,
name
:
'chk-home'
,
enabled
:
false
,
title
:
'ダッシュボードをホーム画面にする'
,
msg
:
'dashboardSettingDashboardHomeTitle'
},
];
CHK_DashboardSetting
.
load
Local
Settings
=
function
()
{
CHK_DashboardSetting
.
loadSettings
=
function
()
{
CHK_DashboardSetting
.
displayItems
.
forEach
(
function
(
item
)
{
let
enabled
=
CHK
_DashboardSetting
.
isSettingEnabled
(
item
.
id
)
;
if
(
enabled
==
true
||
enabled
==
false
)
{
let
enabled
=
CHK
.
dashboardSetting
[
item
.
id
]
;
if
(
typeof
enabled
!==
'undefined'
)
{
item
.
enabled
=
enabled
;
}
});
}
CHK_DashboardSetting
.
saveLocalSetting
=
function
(
key
,
value
)
{
localStorage
.
setItem
(
key
,
value
);
}
CHK_DashboardSetting
.
isSettingEnabled
=
function
(
key
)
{
var
setting
=
localStorage
.
getItem
(
key
);
if
(
setting
==
'1'
)
{
return
true
;
}
else
if
(
setting
==
'0'
)
{
return
false
;
}
return
setting
;
CHK_DashboardSetting
.
saveSetting
=
function
(
key
,
enabled
)
{
CHK_DashboardSetting
.
displayItems
.
forEach
(
function
(
item
)
{
if
(
item
.
id
==
key
)
{
item
.
enabled
=
enabled
;
}
});
CHK
.
saveDashboardSetting
(
key
,
enabled
);
}
CHK_DashboardSetting
.
initDisplays
=
function
()
{
...
...
@@ -55,16 +50,18 @@ CHK_DashboardSetting.bindToggleClick = function() {
$
(
".toggle"
).
on
(
"click"
,
function
()
{
$
(
this
).
toggleClass
(
"checked"
);
var
id
=
$
(
this
).
attr
(
'id'
);
var
enabled
=
false
;
if
(
$
(
this
).
hasClass
(
'checked'
))
{
CHK_DashboardSetting
.
saveLocalSetting
(
id
,
'1'
);
}
else
{
CHK_DashboardSetting
.
saveLocalSetting
(
id
,
'0'
);
enabled
=
true
;
}
CHK_DashboardSetting
.
saveSetting
(
id
,
enabled
);
});
}
CHK_DashboardSetting
.
init
=
function
()
{
CHK_DashboardSetting
.
loadLocalSettings
();
CHK
.
initCommon
();
CHK
.
loadDashboardSetting
();
CHK_DashboardSetting
.
loadSettings
();
CHK_DashboardSetting
.
initDisplays
();
$
(
"#footer"
).
load
(
"main-footer.html"
,
function
()
{
CHK_Footer
.
activeDashboardBottomNav
();
...
...
app/script/check-dashboard.js
View file @
f13e027d
...
...
@@ -12,13 +12,6 @@ CHK_Dashboard.communicationItems = [
{
id
:
'chat'
,
href
:
"javascript:CHK_L.sendAppCommand('goChat');"
,
count
:
0
,
enabled
:
false
,
img
:
{
src
:
'img/icon_chat.svg'
},
msg
:
'chatTitle'
},
];
CHK_Dashboard
.
settingKey
=
{
newReport
:
"dashboardSettingNewReport"
,
continousWork
:
"dashboardSettingContinousWork"
,
reportWarning
:
"dashboardSettingReportWarning"
,
dashboardHome
:
"dashboardSettingDashboardHome"
,
}
CHK_Dashboard
.
initPickups
=
function
()
{
$
(
"#pickupItems"
).
empty
();
CHK_Dashboard
.
pickupItems
.
forEach
(
function
(
item
)
{
...
...
@@ -68,7 +61,7 @@ CHK_Dashboard.init = function() {
CHK_Dashboard
.
updateDataPickups
=
function
()
{
CHK_Dashboard
.
pickupItems
.
forEach
(
function
(
item
)
{
let
enabled
=
CHK
_DashboardSetting
.
isSettingEnabled
(
CHK_Dashboard
.
settingKey
[
item
.
id
])
;
let
enabled
=
CHK
.
dashboardSetting
[
item
.
id
]
;
if
(
enabled
==
true
||
enabled
==
false
)
{
item
.
enabled
=
enabled
;
}
...
...
app/script/check.js
View file @
f13e027d
...
...
@@ -46,6 +46,12 @@ CHK.pushMessageList;
CHK
.
scanResultCode
;
//スキャンしたRFID,バーコード
CHK
.
scanType
;
//スキャン種別(0:バーコード、1:RFID)
CHK
.
isChat
;
CHK
.
dashboardSetting
=
{
newReport
:
true
,
continousWork
:
true
,
reportWarning
:
true
,
dashboardHome
:
false
,
};
var
pageLang
;
// ページ設定言語
var
CATEGORY_HEIGHT
;
//カテゴリー描画用固定値(高さ)
...
...
@@ -186,7 +192,8 @@ CHK.jsonPath = {
operationList
:
"operationList.json"
,
// 作業一覧JSONデータ
operationGroupMasterList
:
"operationGroupMasterList.json"
,
// カテゴリーJSONデータ
operationGroupMasterRelationList
:
"operationGroupMasterRelationList.json"
,
// 作業・カテゴリー関係JSONデータ
pushMessageList
:
"pushMessageList.json"
// コミュニケーションデータJSONデータ
pushMessageList
:
"pushMessageList.json"
,
// コミュニケーションデータJSONデータ
dashboardSetting
:
"dashboardSetting.json"
};
//アプリ送信用コマンド
CHK
.
apiCmd
=
{
...
...
@@ -216,7 +223,8 @@ CHK.apiCmd = {
getGroupTreeInfo
:
"getGroupTreeInfo"
,
//担当グループ参照用 ログインユーザーが所属しているグループ取得
deleteProcess
:
"deleteProcess"
,
changeOperationGroupMaster
:
"changeOperationGroupMaster"
,
actionPushMessage
:
"actionPushMessage"
actionPushMessage
:
"actionPushMessage"
,
saveJson
:
"saveJson"
};
//CMS送信用コマンド
CHK
.
actCmd
=
{
...
...
@@ -435,7 +443,7 @@ CHK.initCommon = function() {
CHK
.
init
=
function
()
{
//共通処理
CHK
.
initCommon
();
CHK
.
loadDashboardSetting
();
//VR設定
krpano
.
call
(
"set(content[def].useVr, false);"
);
...
...
@@ -552,6 +560,27 @@ CHK.initPushMessageList = function() {
});
}
CHK
.
loadDashboardSetting
=
function
()
{
CHK
.
loadJson
(
CHK
.
jsonPath
.
dashboardSetting
,
function
(
json
)
{
if
(
json
)
{
CHK
.
dashboardSetting
=
json
;
}
});
// ios clear localStorage when reopen index page
// var setting = localStorage.getItem('dashboardSetting');
// if (setting) {
// CHK.dashboardSetting = JSON.parse(setting);
// }
}
CHK
.
saveDashboardSetting
=
function
(
key
,
enabled
)
{
if
(
key
)
{
CHK
.
dashboardSetting
[
key
]
=
enabled
;
}
CHK
.
saveJson
(
CHK
.
jsonPath
.
dashboardSetting
,
CHK
.
dashboardSetting
);
//localStorage.setItem('dashboardSetting' , JSON.stringify(CHK.dashboardSetting));
}
/**
* 作業一覧を描画
*/
...
...
@@ -3356,6 +3385,15 @@ CHK.openCategory = function() {
}
}
//save, load json
CHK
.
saveJson
=
function
(
jsonFileName
,
jsonData
)
{
var
param
=
{};
param
.
cmd
=
CHK
.
getCommand
(
"saveJson"
);
param
.
jsonName
=
jsonFileName
;
param
.
jsonData
=
JSON
.
stringify
(
jsonData
);
CHK
.
sendABookCheckApi
(
param
);
}
$
(
document
).
ready
(
function
()
{
var
urlParam
=
CHK
.
getUrlParameter
();
if
(
typeof
urlParam
!==
'undefined'
&&
typeof
urlParam
.
lang
!==
'undefined'
)
{
...
...
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