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
cd4748af
Commit
cd4748af
authored
Nov 02, 2022
by
NGUYEN HOANG SON
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement map response json format
parent
2fa4a9a8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
13 deletions
+52
-13
abvw/html/dashboard-setting.html
+1
-1
abvw/js/dashboard/dashboard.js
+2
-2
abvw/js/dashboardSetting/dashboard-setting.js
+49
-10
No files found.
abvw/html/dashboard-setting.html
View file @
cd4748af
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
</tr>
</tr>
<tr>
<tr>
<th
class=
"fs-9 p-2 text-secondary lang"
lang=
"workWithWarningsTitle"
></th>
<th
class=
"fs-9 p-2 text-secondary lang"
lang=
"workWithWarningsTitle"
></th>
<td
class=
"p-2"
><div
id=
"setting
ReportWarning"
data-key=
"reportWarning
"
class=
"toggle ml-auto"
><input
type=
"checkbox"
name=
"chk-alert"
></div></td>
<td
class=
"p-2"
><div
id=
"setting
WarningReport"
data-key=
"warningReport
"
class=
"toggle ml-auto"
><input
type=
"checkbox"
name=
"chk-alert"
></div></td>
</tr>
</tr>
<tr>
<tr>
<th
class=
"fs-9 p-2 text-secondary lang"
lang=
"makeDashboardAsHome"
></th>
<th
class=
"fs-9 p-2 text-secondary lang"
lang=
"makeDashboardAsHome"
></th>
...
...
abvw/js/dashboard/dashboard.js
View file @
cd4748af
...
@@ -8,7 +8,7 @@ var DASHBOARD = {};
...
@@ -8,7 +8,7 @@ var DASHBOARD = {};
DASHBOARD
.
pickupItems
=
[
DASHBOARD
.
pickupItems
=
[
{
id
:
'newReport'
,
href
:
"javascript:DASHBOARD.goPickup('newReport');"
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'../common/img/dahboard_icon_new.svg'
},
msg
:
'newRegistrationTitle'
},
{
id
:
'newReport'
,
href
:
"javascript:DASHBOARD.goPickup('newReport');"
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'../common/img/dahboard_icon_new.svg'
},
msg
:
'newRegistrationTitle'
},
{
id
:
'continousWork'
,
href
:
"javascript:DASHBOARD.goPickup('continousWork');"
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'../common/img/dahboard_icon_proccess.svg'
},
msg
:
'continousWorkTitle'
},
{
id
:
'continousWork'
,
href
:
"javascript:DASHBOARD.goPickup('continousWork');"
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'../common/img/dahboard_icon_proccess.svg'
},
msg
:
'continousWorkTitle'
},
{
id
:
'
reportWarning
'
,
href
:
"javascript:DASHBOARD.goPickup('reportWarning');"
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'../common/img/dahboard_icon_alert.svg'
},
msg
:
'reportWarningTitle'
},
{
id
:
'
warningReport
'
,
href
:
"javascript:DASHBOARD.goPickup('reportWarning');"
,
count
:
0
,
enabled
:
true
,
img
:
{
src
:
'../common/img/dahboard_icon_alert.svg'
},
msg
:
'reportWarningTitle'
},
];
];
/** comunication dashboard configuration */
/** comunication dashboard configuration */
...
@@ -23,7 +23,7 @@ DASHBOARD.communicationItems = [
...
@@ -23,7 +23,7 @@ DASHBOARD.communicationItems = [
DASHBOARD
.
defaultDashboard
=
{
DASHBOARD
.
defaultDashboard
=
{
newReport
:
0
,
newReport
:
0
,
continousWork
:
0
,
continousWork
:
0
,
reportWarning
:
0
,
warningReport
:
0
,
pushMesage
:
0
,
pushMesage
:
0
,
}
}
...
...
abvw/js/dashboardSetting/dashboard-setting.js
View file @
cd4748af
...
@@ -13,25 +13,51 @@ DashboardSetting.changeSettingCallback = function() {};
...
@@ -13,25 +13,51 @@ DashboardSetting.changeSettingCallback = function() {};
DashboardSetting
.
elementItems
=
{
DashboardSetting
.
elementItems
=
{
newReport
:
{
id
:
'settingNewReport'
,
name
:
'chk-new'
,
enabled
:
true
},
newReport
:
{
id
:
'settingNewReport'
,
name
:
'chk-new'
,
enabled
:
true
},
continousWork
:
{
id
:
'settingContinousWork'
,
name
:
'chk-proccess'
,
enabled
:
true
},
continousWork
:
{
id
:
'settingContinousWork'
,
name
:
'chk-proccess'
,
enabled
:
true
},
reportWarning
:
{
id
:
'settingReportWarning
'
,
name
:
'chk-alert'
,
enabled
:
true
},
warningReport
:
{
id
:
'settingWarningReport
'
,
name
:
'chk-alert'
,
enabled
:
true
},
dashboardHome
:
{
id
:
'settingDashboardHome'
,
name
:
'chk-home'
,
enabled
:
false
},
dashboardHome
:
{
id
:
'settingDashboardHome'
,
name
:
'chk-home'
,
enabled
:
false
},
};
};
DashboardSetting
.
baseApiUrl
=
CONSTANT
.
URL
.
CMS
.
BASE
+
ClientData
.
userInfo_accountPath
()
+
CONSTANT
.
URL
.
CMS
.
API
.
BASE
+
'dashboardSetting/'
;
DashboardSetting
.
baseApiUrl
=
CONSTANT
.
URL
.
CMS
.
BASE
+
ClientData
.
userInfo_accountPath
()
+
CONSTANT
.
URL
.
CMS
.
API
.
BASE
+
'dashboardSetting/'
;
/**
/**
* default setting
JSON
* default setting
*/
*/
DashboardSetting
.
defaultSetting
Json
=
{
DashboardSetting
.
defaultSetting
=
{
newReport
:
1
,
newReport
:
1
,
continousWork
:
1
,
continousWork
:
1
,
reportWarning
:
1
,
warningReport
:
1
,
dashboardHome
:
0
,
dashboardHome
:
0
,
}
}
/** dummy setting json reponse */
DashboardSetting
.
dummySettingJson
=
{
dashboardSettingList
:
[
{
"id"
:
1
,
"settingName"
:
"New Report"
,
"settingValue"
:
1
},
{
"id"
:
2
,
"settingName"
:
"Continous Work"
,
"settingValue"
:
1
},
{
"id"
:
3
,
"settingName"
:
"Warning Report"
,
"settingValue"
:
1
},
{
"id"
:
4
,
"settingName"
:
"Dashboard Home"
,
"settingValue"
:
0
}
],
}
/**
/**
* get setting data from cms
* get setting data from cms
* @param {function} callback
* @param {function} callback
- callback with settings
*/
*/
DashboardSetting
.
getSettingData
=
function
(
callback
)
{
DashboardSetting
.
getSettingData
=
function
(
callback
)
{
let
param
=
{
let
param
=
{
...
@@ -39,14 +65,27 @@ DashboardSetting.getSettingData = function (callback) {
...
@@ -39,14 +65,27 @@ DashboardSetting.getSettingData = function (callback) {
};
};
const
url
=
DashboardSetting
.
baseApiUrl
;
const
url
=
DashboardSetting
.
baseApiUrl
;
COMMON
.
cmsAjax
(
url
,
param
,
false
,
function
(
json
)
{
COMMON
.
cmsAjax
(
url
,
param
,
false
,
function
(
json
)
{
let
settings
=
{};
//map id with key when save setting
const
mapKeys
=
{
1
:
'newReport'
,
2
:
'continousWork'
,
3
:
'warningReport'
,
4
:
'dashboardHome'
};
if
(
json
&&
json
.
dashboardSettingList
)
{
for
(
const
item
of
json
.
dashboardSettingList
)
{
if
(
mapKeys
.
hasOwnProperty
(
item
.
id
))
{
const
settingKey
=
mapKeys
[
item
.
id
];
settings
[
settingKey
]
=
item
.
settingValue
;
}
}
}
if
(
callback
)
{
if
(
callback
)
{
callback
(
json
);
callback
(
settings
);
}
}
},
function
()
{
},
function
()
{
console
.
log
(
'DashboardSetting.getSettingData error'
);
console
.
log
(
'DashboardSetting.getSettingData error'
);
if
(
callback
)
{
callback
(
DashboardSetting
.
defaultSettingJson
);
}
});
});
};
};
...
@@ -81,7 +120,7 @@ DashboardSetting.saveSetting = function () {
...
@@ -81,7 +120,7 @@ DashboardSetting.saveSetting = function () {
param
.
sid
=
COMMON
.
getSid
();
param
.
sid
=
COMMON
.
getSid
();
for
(
const
key
in
DashboardSetting
.
elementItems
)
{
for
(
const
key
in
DashboardSetting
.
elementItems
)
{
const
element
=
DashboardSetting
.
elementItems
[
key
];
const
element
=
DashboardSetting
.
elementItems
[
key
];
param
[
key
]
=
element
.
enabled
;
param
[
key
]
=
element
.
enabled
?
1
:
0
;
}
}
const
url
=
CONSTANT
.
URL
.
CMS
.
BASE
+
ClientData
.
userInfo_accountPath
()
+
CONSTANT
.
URL
.
CMS
.
API
.
BASE
+
'saveDashboardSetting/'
;
const
url
=
CONSTANT
.
URL
.
CMS
.
BASE
+
ClientData
.
userInfo_accountPath
()
+
CONSTANT
.
URL
.
CMS
.
API
.
BASE
+
'saveDashboardSetting/'
;
COMMON
.
cmsAjax
(
url
,
param
,
false
,
function
(
json
)
{
COMMON
.
cmsAjax
(
url
,
param
,
false
,
function
(
json
)
{
...
...
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