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
1d9273f6
Commit
1d9273f6
authored
Oct 20, 2022
by
NGO THI HONG
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dashboard js
parent
0d793319
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
114 additions
and
0 deletions
+114
-0
abvw/js/dashboard/dashboard.js
+114
-0
No files found.
abvw/js/dashboard/dashboard.js
0 → 100644
View file @
1d9273f6
var
DASHBOARD
=
{};
DASHBOARD
.
pickupItems
=
[
{
id
:
'newReport'
,
href
:
"javascript:DASHBOARD.goPickup('newReport');"
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_new.svg'
},
msg
:
'newRegistrationTitle'
},
{
id
:
'continousWork'
,
href
:
"javascript:DASHBOARD.goPickup('continousWork');"
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_proccess.svg'
},
msg
:
'continousWorkTitle'
},
{
id
:
'reportWarning'
,
href
:
"javascript:DASHBOARD.goPickup('reportWarning');"
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_alert.svg'
},
msg
:
'reportWarningTitle'
},
];
DASHBOARD
.
communicationItems
=
[
{
id
:
'messageList'
,
href
:
"javascript:DASHBOARD.goMessageList();"
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_message_lsit.svg'
},
msg
:
'messageListTitle'
},
{
id
:
'sendMessage'
,
href
:
"javascript:DASHBOARD.goSendMessage();"
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_send_message.svg'
},
msg
:
'sendMessageTitle'
},
{
id
:
'distanceSupport'
,
href
:
"javascript:DASHBOARD.goDistanceSupport();"
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'img/icon_remote.svg'
},
msg
:
'distanceSupportTitle'
},
{
id
:
'chat'
,
href
:
"javascript:DASHBOARD.goChat();"
,
count
:
0
,
enabled
:
false
,
img
:
{
src
:
'img/icon_chat.svg'
},
msg
:
'chatTitle'
},
];
//CHK_Dashboard.pickupItemsに設定した情報をhtmlに表示する
DASHBOARD
.
initPickups
=
function
()
{
$
(
"#pickupItems"
).
empty
();
DASHBOARD
.
pickupItems
.
forEach
(
function
(
item
)
{
if
(
item
.
enabled
==
true
)
{
var
html
=
DASHBOARD
.
initHtmlItem
(
item
);
$
(
"#pickupItems"
).
append
(
html
);
}
});
//pickup empty
if
(
$
(
"#pickupItems"
).
children
().
length
>
0
)
{
$
(
"#pickupHeader"
).
removeClass
(
'd-none'
);
}
else
{
$
(
"#pickupHeader"
).
addClass
(
'd-none'
);
}
}
//CHK_Dashboard.communicationItemsに設定した情報をhtmlに表示する
DASHBOARD
.
initCommunications
=
function
()
{
$
(
"#communicationItems"
).
empty
();
DASHBOARD
.
communicationItems
.
forEach
(
function
(
item
)
{
if
(
item
.
enabled
==
true
)
{
var
html
=
DASHBOARD
.
initHtmlItem
(
item
);
$
(
"#communicationItems"
).
append
(
html
);
}
});
}
//設定されている情報からhtmlを表示する
DASHBOARD
.
initHtmlItem
=
function
(
item
)
{
var
countText
=
''
+
item
.
count
;
if
(
item
.
count
>=
100
)
{
countText
=
'99+'
;
}
var
countDClass
=
''
;
if
(
typeof
item
.
count
==
'undefined'
||
item
.
count
<
1
)
{
countDClass
=
' d-none'
;
}
var
countSpan
=
'<span class="count fs-7'
+
countDClass
+
'">'
+
countText
+
'</span>'
;
var
html
=
$
(
'<div class="item" id="'
+
item
.
id
+
'">'
+
'<a href="'
+
item
.
href
+
'" class="d-block text-dark text-decoration-none mb-1 p-3">'
+
'<img src="'
+
item
.
img
.
src
+
'">'
+
'<div class="fs-8 multi-lang" data-msg="'
+
item
.
msg
+
'">'
+
getMsg
(
item
.
msg
)
+
'</div>'
+
countSpan
+
'</a>'
+
'</div>'
);
return
html
;
}
//ダッシュボード画面の初期表示
DASHBOARD
.
init
=
function
()
{
DASHBOARD
.
updateDataPickups
();
DASHBOARD
.
initPickups
();
DASHBOARD
.
updateDataCommunications
();
DASHBOARD
.
initCommunications
();
}
//変数として設定しているガジェットに初期表示で取得したデータを設定
DASHBOARD
.
updateDataPickups
=
function
()
{
DASHBOARD
.
pickupItems
.
forEach
(
function
(
item
)
{
let
enabled
=
CHK
.
dashboardSetting
[
item
.
id
];
if
(
enabled
==
true
||
enabled
==
false
)
{
item
.
enabled
=
enabled
;
}
item
.
count
=
0
;
if
(
CHK
.
dashboardBatch
[
item
.
id
])
{
item
.
count
=
CHK
.
dashboardBatch
[
item
.
id
];
}
});
}
//変数として設定しているコミュニケーションに初期表示で取得したデータを設定
DASHBOARD
.
updateDataCommunications
=
function
()
{
DASHBOARD
.
communicationItems
.
forEach
(
function
(
item
)
{
if
(
item
.
id
==
'messageList'
)
{
item
.
count
=
0
;
if
(
typeof
CHK
.
pushMessageList
!==
'undefined'
)
{
//読んでいないメッセージがあればカウントを +1
CHK
.
pushMessageList
.
forEach
(
function
(
message
)
{
if
(
!
message
.
readingFlg
)
{
item
.
count
+=
1
;
}
});
}
}
else
if
(
item
.
id
==
'chat'
)
{
item
.
enabled
=
CHK
.
isChat
;
}
});
}
//ガジェット画面に移動
DASHBOARD
.
goPickup
=
function
(
pickupId
)
{
CHK
.
goUrlWithCurrentParams
(
'pickup.html'
,
{
pickupActive
:
pickupId
});
}
//コミュニケーション画面に移動
DASHBOARD
.
goMessageList
=
function
()
{
CHK
.
goUrlWithCurrentParams
(
'message-list.html'
,
{});
}
\ No newline at end of file
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