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
52572808
Commit
52572808
authored
Oct 21, 2022
by
NGUYEN HOANG SON
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement apply dashboard settings json
parent
5e8b2296
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
32 deletions
+35
-32
abvw/html/dashboard.html
+4
-4
abvw/js/dashboardSetting/dashboard-setting.js
+31
-28
No files found.
abvw/html/dashboard.html
View file @
52572808
...
@@ -134,19 +134,19 @@
...
@@ -134,19 +134,19 @@
<tbody>
<tbody>
<tr>
<tr>
<th
class=
"fs-9 p-2 text-secondary multi-lang"
data-msg=
"dashboardSettingNewReportTitle"
>
新規報告
</th>
<th
class=
"fs-9 p-2 text-secondary multi-lang"
data-msg=
"dashboardSettingNewReportTitle"
>
新規報告
</th>
<td
class=
"p-2"
><div
id=
"newReport"
class=
"toggle ml-auto"
><input
type=
"checkbox"
name=
"chk-new"
></div></td>
<td
class=
"p-2"
><div
id=
"
settingNewReport"
data-key=
"
newReport"
class=
"toggle ml-auto"
><input
type=
"checkbox"
name=
"chk-new"
></div></td>
</tr>
</tr>
<tr>
<tr>
<th
class=
"fs-9 p-2 text-secondary multi-lang"
data-msg=
"dashboardSettingContinousWorkTitle"
>
工程作業
</th>
<th
class=
"fs-9 p-2 text-secondary multi-lang"
data-msg=
"dashboardSettingContinousWorkTitle"
>
工程作業
</th>
<td
class=
"p-2"
><div
id=
"continousWork"
class=
"toggle ml-auto"
><input
type=
"checkbox"
name=
"chk-proccess"
></div></td>
<td
class=
"p-2"
><div
id=
"
settingContinousWork"
data-key=
"
continousWork"
class=
"toggle ml-auto"
><input
type=
"checkbox"
name=
"chk-proccess"
></div></td>
</tr>
</tr>
<tr>
<tr>
<th
class=
"fs-9 p-2 text-secondary multi-lang"
data-msg=
"dashboardSettingReportWarningTitle"
>
警告を含む作業
</th>
<th
class=
"fs-9 p-2 text-secondary multi-lang"
data-msg=
"dashboardSettingReportWarningTitle"
>
警告を含む作業
</th>
<td
class=
"p-2"
><div
id=
"reportWarning"
class=
"toggle ml-auto"
><input
type=
"checkbox"
name=
"chk-alert"
></div></td>
<td
class=
"p-2"
><div
id=
"
settingReportWarning"
data-key=
"
reportWarning"
class=
"toggle ml-auto"
><input
type=
"checkbox"
name=
"chk-alert"
></div></td>
</tr>
</tr>
<tr>
<tr>
<th
class=
"fs-9 p-2 text-secondary multi-lang"
data-msg=
"dashboardSettingDashboardHomeTitle"
>
ダッシュボードをホーム画面にする
</th>
<th
class=
"fs-9 p-2 text-secondary multi-lang"
data-msg=
"dashboardSettingDashboardHomeTitle"
>
ダッシュボードをホーム画面にする
</th>
<td
class=
"p-2"
><div
id=
"dashboardHome"
class=
"toggle ml-auto"
><input
type=
"checkbox"
name=
"chk-home"
></div></td>
<td
class=
"p-2"
><div
id=
"
settingDashboardHome"
data-key=
"
dashboardHome"
class=
"toggle ml-auto"
><input
type=
"checkbox"
name=
"chk-home"
></div></td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
...
...
abvw/js/dashboardSetting/dashboard-setting.js
View file @
52572808
var
DashboardSetting
=
{};
var
DashboardSetting
=
{};
DashboardSetting
.
elementItems
=
[
DashboardSetting
.
elementItems
=
{
{
id
:
'n
ewReport'
,
name
:
'chk-new'
,
enabled
:
true
},
newReport
:
{
id
:
'settingN
ewReport'
,
name
:
'chk-new'
,
enabled
:
true
},
{
id
:
'c
ontinousWork'
,
name
:
'chk-proccess'
,
enabled
:
true
},
continousWork
:
{
id
:
'settingC
ontinousWork'
,
name
:
'chk-proccess'
,
enabled
:
true
},
{
id
:
'r
eportWarning'
,
name
:
'chk-alert'
,
enabled
:
true
},
reportWarning
:
{
id
:
'settingR
eportWarning'
,
name
:
'chk-alert'
,
enabled
:
true
},
{
id
:
'd
ashboardHome'
,
name
:
'chk-home'
,
enabled
:
false
},
dashboardHome
:
{
id
:
'settingD
ashboardHome'
,
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/'
;
DashboardSetting
.
saveSettingApiUrl
=
DashboardSetting
.
baseApiUrl
+
'saveSetting'
;
DashboardSetting
.
saveSettingApiUrl
=
DashboardSetting
.
baseApiUrl
+
'saveSetting'
;
DashboardSetting
.
getSettingApiUrl
=
DashboardSetting
.
baseApiUrl
+
'getAllSettingData'
;
DashboardSetting
.
getSettingApiUrl
=
DashboardSetting
.
baseApiUrl
+
'getAllSettingData'
;
DashboardSetting
.
d
ummy
SettingJson
=
{
DashboardSetting
.
d
efault
SettingJson
=
{
newReport
:
1
,
newReport
:
1
,
continousWork
:
1
,
continousWork
:
1
,
reportWarning
:
1
,
reportWarning
:
1
,
...
@@ -27,31 +27,35 @@ DashboardSetting.getSettingData = function (callback) {
...
@@ -27,31 +27,35 @@ DashboardSetting.getSettingData = function (callback) {
}
}
},
function
()
{
},
function
()
{
console
.
log
(
'DashboardSetting.getSettingData error'
);
console
.
log
(
'DashboardSetting.getSettingData error'
);
if
(
callback
)
{
callback
(
DashboardSetting
.
defaultSettingJson
);
}
});
});
};
};
DashboardSetting
.
applySettings
=
function
(
settings
)
{
DashboardSetting
.
applySettings
=
function
(
settings
)
{
DashboardSetting
.
elementItems
.
forEach
(
function
(
item
)
{
for
(
const
key
in
settings
)
{
let
enabled
=
settings
[
item
.
id
];
const
enabled
=
settings
[
key
];
if
(
typeof
enabled
!==
'undefined'
)
{
if
(
DashboardSetting
.
elementItems
.
hasOwnProperty
(
key
))
{
item
.
enabled
=
enabled
;
const
elementItem
=
DashboardSetting
.
elementItems
[
key
];
let
itemElement
=
$
(
'#'
+
item
.
id
);
elementItem
.
enabled
=
enabled
;
if
(
item
.
enabled
)
{
let
element
=
$
(
'#'
+
elementItem
.
id
);
itemElement
.
addClass
(
'checked'
);
if
(
element
)
{
if
(
enabled
)
{
element
.
addClass
(
'checked'
);
}
else
{
}
else
{
itemElement
.
removeClass
(
'checked'
);
element
.
removeClass
(
'checked'
);
}
}
}
}
}
}
});
};
};
//CHK_DashboardSetting.displayItemsに設定を書き込む
DashboardSetting
.
saveSetting
=
function
(
key
,
enabled
)
{
DashboardSetting
.
saveSetting
=
function
(
key
,
enabled
)
{
DashboardSetting
.
elementItems
.
forEach
(
function
(
item
)
{
if
(
DashboardSetting
.
elementItems
.
hasOwnProperty
(
key
)
)
{
if
(
item
.
id
==
key
)
{
const
elementItem
=
DashboardSetting
.
elementItems
[
key
];
i
tem
.
enabled
=
enabled
;
elementI
tem
.
enabled
=
enabled
;
}
}
});
let
param
=
{};
let
param
=
{};
param
.
sid
=
COMMON
.
getSid
();
param
.
sid
=
COMMON
.
getSid
();
param
[
key
]
=
enabled
;
param
[
key
]
=
enabled
;
...
@@ -61,16 +65,15 @@ DashboardSetting.saveSetting = function (key, enabled) {
...
@@ -61,16 +65,15 @@ DashboardSetting.saveSetting = function (key, enabled) {
};
};
//設定画面でクリックされてた時の処理
//設定画面でクリックされてた時の処理
//
DashboardSetting
.
bindToggleClick
=
function
()
{
DashboardSetting
.
bindToggleClick
=
function
()
{
$
(
'.toggle'
).
on
(
'click'
,
function
()
{
$
(
'.toggle'
).
on
(
'click'
,
function
()
{
$
(
this
).
toggleClass
(
'checked'
);
$
(
this
).
toggleClass
(
'checked'
);
// var id = $(this).attr('id
');
const
key
=
$
(
this
).
attr
(
'data-key
'
);
//
var enabled = false;
var
enabled
=
false
;
//
if ($(this).hasClass('checked')) {
if
(
$
(
this
).
hasClass
(
'checked'
))
{
//
enabled = true;
enabled
=
true
;
//
}
}
// DashboardSetting.saveSetting(id
, enabled);
DashboardSetting
.
saveSetting
(
key
,
enabled
);
});
});
};
};
...
...
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