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
f4b02a86
Commit
f4b02a86
authored
Nov 11, 2022
by
Takumi Imai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#49772 ログインチェック追加
parent
e3409ed3
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
836 additions
and
760 deletions
+836
-760
abweb/js/dashboard/dashboard.js
+3
-0
abweb/js/pdfPrint/pdfPrint.js
+17
-15
abweb/js/pickup/pickup.js
+602
-546
abweb/js/pushMessageDetail/pushMessageDetail.js
+35
-27
abweb/js/pushMessageList/pushMessageList.js
+49
-38
abweb/js/reportForm/reportForm.js
+3
-0
abweb/js/reportList/reportList.js
+19
-19
abweb/js/sendMessage/sendMessage.js
+35
-31
abweb/js/setting/settings.js
+36
-44
abweb/js/template/template.js
+37
-40
No files found.
abweb/js/dashboard/dashboard.js
View file @
f4b02a86
...
...
@@ -121,6 +121,9 @@ DASHBOARD.initHtmlItem = function (item) {
/** Initialization dashboard screen */
DASHBOARD
.
init
=
function
()
{
//Check if user is logged in
COMMON
.
checkAuth
(
false
);
sessionStorage
.
activeHomePage
=
CONSTANT
.
PAGE_TAB
.
DASHBOARD
;
DASHBOARD
.
loadCommon
();
DashboardSetting
.
getSettingData
(
function
(
settings
)
{
...
...
abweb/js/pdfPrint/pdfPrint.js
View file @
f4b02a86
...
...
@@ -2,33 +2,36 @@
var
PP
=
{};
PP
.
init
=
function
()
{
console
.
log
(
"PP.init"
);
PP
.
init
=
function
()
{
//Check if user is logged in
COMMON
.
checkAuth
(
false
);
console
.
log
(
'PP.init'
);
PP
.
loadCommon
();
PP
.
initPdfList
();
};
PP
.
loadCommon
=
function
()
{
$
(
"#includedHeader"
).
load
(
"../html/common/header.html"
,
function
()
{
PP
.
loadCommon
=
function
()
{
$
(
'#includedHeader'
).
load
(
'../html/common/header.html'
,
function
()
{
I18N
.
initi18n
();
HEADER
.
init
();
});
$
(
"#includedConfirmModal"
).
load
(
"../html/common/confirmModal.html"
,
function
()
{
});
$
(
'#includedConfirmModal'
).
load
(
'../html/common/confirmModal.html'
,
function
()
{
I18N
.
initi18n
();
});
}
});
}
;
PP
.
initPdfList
=
function
()
{
PP
.
initPdfList
=
function
()
{
if
(
sessionStorage
.
OL_operationId
)
{
let
params
=
{};
params
.
sid
=
COMMON
.
getSid
();
params
.
operationId
=
sessionStorage
.
OL_operationId
;
params
.
returnUrl
=
CONSTANT
.
URL
.
WEB
.
BASE
+
CONSTANT
.
URL
.
WEB
.
OPERATION_LIST
;
let
url
=
COMMON
.
format
(
ClientData
.
conf_checkApiUrl
(),
ClientData
.
userInfo_accountPath
())
+
CONSTANT
.
URL
.
CMS
.
HTML
.
BASE
+
CONSTANT
.
URL
.
CMS
.
HTML
.
QUICK_REPORT_PRINT
;
$
(
"#pdfPrint"
).
load
(
url
,
params
);
$
(
'#pdfPrint'
).
load
(
url
,
params
);
}
else
{
COMMON
.
displayAlert
(
"error"
);
COMMON
.
avwScreenMove
(
"reportList.html"
);
COMMON
.
displayAlert
(
'error'
);
COMMON
.
avwScreenMove
(
'reportList.html'
);
}
}
\ No newline at end of file
};
abweb/js/pickup/pickup.js
View file @
f4b02a86
...
...
@@ -7,45 +7,45 @@ var PICKUP = {};
PICKUP
.
newReportList
;
PICKUP
.
continousWorkReport
;
PICKUP
.
reportWithWarning
;
PICKUP
.
pickupDefault
=
"newReport"
;
PICKUP
.
pickupActive
=
"newReport"
;
PICKUP
.
pickupDefault
=
'newReport'
;
PICKUP
.
pickupActive
=
'newReport'
;
PICKUP
.
countNewReportList
=
0
;
PICKUP
.
countContinousWorkReport
=
0
;
PICKUP
.
countReportWithWarning
=
0
;
PICKUP
.
countReportWithWarning
=
0
;
/**
* Report type
*/
PICKUP
.
REPORT_TYPE
=
{
REPORTONLY
:
0
,
//report only
INSPECT
:
1
,
//rountine
WITHREPLY
:
2
,
// report answer
WORKFLOW
:
3
// continuous
}
REPORTONLY
:
0
,
//report only
INSPECT
:
1
,
//rountine
WITHREPLY
:
2
,
// report answer
WORKFLOW
:
3
,
// continuous
}
;
/**
* operation type
*/
PICKUP
.
OPERATION_TYPE
=
{
LIST
:
"0"
,
DRAWING
:
"1"
,
VTOUR
:
"2"
,
PDF
:
"3"
LIST
:
'0'
,
DRAWING
:
'1'
,
VTOUR
:
'2'
,
PDF
:
'3'
,
};
/**
* task type of report answer
*/
PICKUP
.
REPLYREPORT_TASK_TYPE
=
{
REPORT
:
0
,
ANSWER
:
1
}
REPORT
:
0
,
ANSWER
:
1
,
}
;
/**
* default Pickup List
*/
PICKUP
.
defaultPickupList
=
{
operationList
:
[]
}
operationList
:
[],
}
;
PICKUP
.
baseApiUrl
=
COMMON
.
format
(
ClientData
.
conf_checkApiUrl
(),
ClientData
.
userInfo_accountPath
());
PICKUP
.
getNewReportListApiUrl
=
PICKUP
.
baseApiUrl
+
CONSTANT
.
URL
.
CMS
.
API
.
NEW_REPORT
;
...
...
@@ -53,71 +53,92 @@ PICKUP.getContinuousWorkListApiUrl = PICKUP.baseApiUrl + CONSTANT.URL.CMS.API.WO
PICKUP
.
getReportWithWarningsListApiUrl
=
PICKUP
.
baseApiUrl
+
CONSTANT
.
URL
.
CMS
.
API
.
WARNING_WITH_REPORT
;
/**
* Call get new report list api get data
* Call get new report list api get data
*/
PICKUP
.
getNewreportListData
=
function
(
callback
)
{
PICKUP
.
getNewreportListData
=
function
(
callback
)
{
let
param
=
{
sid
:
COMMON
.
getSid
(),
};
COMMON
.
cmsAjax
(
PICKUP
.
getNewReportListApiUrl
,
param
,
false
,
function
(
json
)
{
if
(
callback
)
{
callback
(
json
);
}
},
function
()
{
console
.
log
(
'DASHBOARD.getNewreportListData error'
);
if
(
callback
)
{
callback
(
PICKUP
.
defaultPickupList
);
}
});
COMMON
.
cmsAjax
(
PICKUP
.
getNewReportListApiUrl
,
param
,
false
,
function
(
json
)
{
if
(
callback
)
{
callback
(
json
);
}
},
function
()
{
console
.
log
(
'DASHBOARD.getNewreportListData error'
);
if
(
callback
)
{
callback
(
PICKUP
.
defaultPickupList
);
}
},
);
};
/**
* Call get Continuous Work list api get data
* @param {*} callback
* Call get Continuous Work list api get data
* @param {*} callback
*/
PICKUP
.
getContinuousWorkListData
=
function
(
callback
)
{
let
param
=
{
sid
:
COMMON
.
getSid
(),
};
COMMON
.
cmsAjax
(
PICKUP
.
getContinuousWorkListApiUrl
,
param
,
false
,
function
(
json
)
{
if
(
callback
)
{
callback
(
json
);
}
},
function
()
{
console
.
log
(
'DASHBOARD.getContinuousWorkListData error'
);
if
(
callback
)
{
callback
(
PICKUP
.
defaultPickupList
);
}
});
COMMON
.
cmsAjax
(
PICKUP
.
getContinuousWorkListApiUrl
,
param
,
false
,
function
(
json
)
{
if
(
callback
)
{
callback
(
json
);
}
},
function
()
{
console
.
log
(
'DASHBOARD.getContinuousWorkListData error'
);
if
(
callback
)
{
callback
(
PICKUP
.
defaultPickupList
);
}
},
);
};
/**
* Call get Report With Warnings list api get data
* @param {*} callback
* Call get Report With Warnings list api get data
* @param {*} callback
*/
PICKUP
.
getReportWithWarningsListData
=
function
(
callback
)
{
let
param
=
{
sid
:
COMMON
.
getSid
(),
};
COMMON
.
cmsAjax
(
PICKUP
.
getReportWithWarningsListApiUrl
,
param
,
false
,
function
(
json
)
{
if
(
callback
)
{
callback
(
json
);
}
},
function
()
{
console
.
log
(
'DASHBOARD.getReportWithWarningListData error'
);
if
(
callback
)
{
callback
(
PICKUP
.
defaultPickupList
);
}
});
COMMON
.
cmsAjax
(
PICKUP
.
getReportWithWarningsListApiUrl
,
param
,
false
,
function
(
json
)
{
if
(
callback
)
{
callback
(
json
);
}
},
function
()
{
console
.
log
(
'DASHBOARD.getReportWithWarningListData error'
);
if
(
callback
)
{
callback
(
PICKUP
.
defaultPickupList
);
}
},
);
};
/**
* Initialization pickup html
* Initialization pickup html
*/
PICKUP
.
init
=
function
()
{
console
.
log
(
"PICKUP.init"
);
sessionStorage
.
activeHomePage
=
CONSTANT
.
PAGE_TAB
.
DASHBOARD
;
TEMPLATE
.
loadHearder
(
"#includedHeader"
);
TEMPLATE
.
loadConfirmModal
(
"#includedConfirmModal"
);
const
navs
=
[
PICKUP
.
init
=
function
()
{
//Check if user is logged in
COMMON
.
checkAuth
(
false
);
console
.
log
(
'PICKUP.init'
);
sessionStorage
.
activeHomePage
=
CONSTANT
.
PAGE_TAB
.
DASHBOARD
;
TEMPLATE
.
loadHearder
(
'#includedHeader'
);
TEMPLATE
.
loadConfirmModal
(
'#includedConfirmModal'
);
const
navs
=
[
{
titleLang
:
'dashboard'
,
href
:
'dashboard.html'
,
...
...
@@ -126,610 +147,645 @@ PICKUP.init = function() {
titleLang
:
'pickup'
,
},
];
TEMPLATE
.
loadMainNavsTitle
(
"#includedMainTitle"
,
"pickup"
,
navs
,
null
);
PICKUP
.
initSettingActivePickup
();
PICKUP
.
settingPickup
();
}
TEMPLATE
.
loadMainNavsTitle
(
'#includedMainTitle'
,
'pickup'
,
navs
,
null
);
PICKUP
.
initSettingActivePickup
();
PICKUP
.
settingPickup
();
}
;
/**
* Setting pickup data
*/
PICKUP
.
settingPickup
=
function
()
{
DashboardSetting
.
getSettingData
(
function
(
settings
)
{
$
(
"#liTabNewReport"
).
addClass
(
'd-none'
);
$
(
"#liTabContinousWork"
).
addClass
(
'd-none'
);
$
(
"#liTabReportWithWarning"
).
addClass
(
'd-none'
);
if
(
settings
.
newReport
)
{
$
(
"#liTabNewReport"
).
removeClass
(
'd-none'
);
PICKUP
.
initNewReportTab
();
}
if
(
settings
.
continousWork
)
{
$
(
"#liTabContinousWork"
).
removeClass
(
'd-none'
);
PICKUP
.
initContinuosWorkTab
();
}
if
(
settings
.
warningReport
)
{
$
(
"#liTabReportWithWarning"
).
removeClass
(
'd-none'
);
PICKUP
.
initReportWithWarningsTab
();
}
PICKUP
.
settingPickup
=
function
()
{
DashboardSetting
.
getSettingData
(
function
(
settings
)
{
$
(
'#liTabNewReport'
).
addClass
(
'd-none'
);
$
(
'#liTabContinousWork'
).
addClass
(
'd-none'
);
$
(
'#liTabReportWithWarning'
).
addClass
(
'd-none'
);
if
(
settings
.
newReport
)
{
$
(
'#liTabNewReport'
).
removeClass
(
'd-none'
);
PICKUP
.
initNewReportTab
();
}
if
(
settings
.
continousWork
)
{
$
(
'#liTabContinousWork'
).
removeClass
(
'd-none'
);
PICKUP
.
initContinuosWorkTab
();
}
if
(
settings
.
warningReport
)
{
$
(
'#liTabReportWithWarning'
).
removeClass
(
'd-none'
);
PICKUP
.
initReportWithWarningsTab
();
}
});
}
}
;
/**
* init Setting Active Pickup
*/
PICKUP
.
initSettingActivePickup
=
function
()
{
var
urlParam
=
COMMON
.
getUrlParameter
();
if
(
urlParam
.
pickupActive
==
undefined
||
urlParam
.
pickupActive
==
''
)
{
urlParam
.
pickupActive
=
PICKUP
.
pickupDefault
;
}
PICKUP
.
pickupActive
=
urlParam
.
pickupActive
;
PICKUP
.
settingActivePickup
(
PICKUP
.
pickupActive
);
}
PICKUP
.
initSettingActivePickup
=
function
()
{
var
urlParam
=
COMMON
.
getUrlParameter
();
if
(
urlParam
.
pickupActive
==
undefined
||
urlParam
.
pickupActive
==
''
)
{
urlParam
.
pickupActive
=
PICKUP
.
pickupDefault
;
}
PICKUP
.
pickupActive
=
urlParam
.
pickupActive
;
PICKUP
.
settingActivePickup
(
PICKUP
.
pickupActive
);
};
/**
* setting Active Pickup
* @param {*} pickupActive
* @returns
* @param {*} pickupActive
* @returns
*/
PICKUP
.
settingActivePickup
=
function
(
pickupActive
)
{
PICKUP
.
pickupActive
=
pickupActive
;
$
(
'#liTabNewReport a'
).
removeClass
(
'active'
);
$
(
'#liTabContinousWork a'
).
removeClass
(
'active'
);
$
(
'#liTabReportWithWarning a'
).
removeClass
(
'active'
);
$
(
'#tab-content-NewReport'
).
removeClass
(
'active show'
);
$
(
'#tab-content-ContinousWork'
).
removeClass
(
'active show'
);
$
(
'#tab-content-ReportWithWarnings'
).
removeClass
(
'active show'
);
if
(
pickupActive
==
"newReport"
)
{
$
(
'#liTabNewReport a'
).
addClass
(
'active'
);
$
(
'#tab-content-NewReport'
).
addClass
(
'active show'
);
return
;
}
if
(
pickupActive
==
"continousWork"
)
{
$
(
'#liTabContinousWork a'
).
addClass
(
'active'
);
$
(
'#tab-content-ContinousWork'
).
addClass
(
'active show'
);
return
;
}
if
(
pickupActive
==
"reportWarning"
)
{
$
(
'#liTabReportWithWarning a'
).
addClass
(
'active'
);
$
(
'#tab-content-ReportWithWarnings'
).
addClass
(
'active show'
);
return
;
}
}
PICKUP
.
settingActivePickup
=
function
(
pickupActive
)
{
PICKUP
.
pickupActive
=
pickupActive
;
$
(
'#liTabNewReport a'
).
removeClass
(
'active'
);
$
(
'#liTabContinousWork a'
).
removeClass
(
'active'
);
$
(
'#liTabReportWithWarning a'
).
removeClass
(
'active'
);
$
(
'#tab-content-NewReport'
).
removeClass
(
'active show'
);
$
(
'#tab-content-ContinousWork'
).
removeClass
(
'active show'
);
$
(
'#tab-content-ReportWithWarnings'
).
removeClass
(
'active show'
);
if
(
pickupActive
==
'newReport'
)
{
$
(
'#liTabNewReport a'
).
addClass
(
'active'
);
$
(
'#tab-content-NewReport'
).
addClass
(
'active show'
);
return
;
}
if
(
pickupActive
==
'continousWork'
)
{
$
(
'#liTabContinousWork a'
).
addClass
(
'active'
);
$
(
'#tab-content-ContinousWork'
).
addClass
(
'active show'
);
return
;
}
if
(
pickupActive
==
'reportWarning'
)
{
$
(
'#liTabReportWithWarning a'
).
addClass
(
'active'
);
$
(
'#tab-content-ReportWithWarnings'
).
addClass
(
'active show'
);
return
;
}
};
/**
* Initialization show not found pickup item html
* @param {*} elementId
* Initialization show not found pickup item html
* @param {*} elementId
*/
PICKUP
.
showNotFoundPickupItem
=
function
(
elementId
)
{
$
(
elementId
).
removeClass
();
$
(
elementId
).
addClass
(
'p-0 mt-3 card-list'
);
let
li
=
$
(
"<li class='card mb-2 not-found'></li>"
);
let
div
=
$
(
"<div class='text-dark mb-1 px-3 py-5 text-center m-auto'></div>"
);
let
imgdiv
=
$
(
"<img src=
\"
../common/img/icon_not_found.svg
\"
alt='"
+
I18N
.
i18nText
(
'msgNotFound'
)
+
"' class='not-found-img mb-2'>"
);
let
childDiv
=
$
(
"<div class='fs-9 text-secondary font-weight-bold'>"
+
I18N
.
i18nText
(
'msgNotFound'
)
+
"</div>"
);
div
.
append
(
imgdiv
);
div
.
append
(
childDiv
);
li
.
append
(
div
);
$
(
elementId
).
append
(
li
);
}
PICKUP
.
showNotFoundPickupItem
=
function
(
elementId
)
{
$
(
elementId
).
removeClass
();
$
(
elementId
).
addClass
(
'p-0 mt-3 card-list'
);
let
li
=
$
(
"<li class='card mb-2 not-found'></li>"
);
let
div
=
$
(
"<div class='text-dark mb-1 px-3 py-5 text-center m-auto'></div>"
);
let
imgdiv
=
$
(
'<img src="../common/img/icon_not_found.svg" alt=
\'
'
+
I18N
.
i18nText
(
'msgNotFound'
)
+
"' class='not-found-img mb-2'>"
);
let
childDiv
=
$
(
"<div class='fs-9 text-secondary font-weight-bold'>"
+
I18N
.
i18nText
(
'msgNotFound'
)
+
'</div>'
);
div
.
append
(
imgdiv
);
div
.
append
(
childDiv
);
li
.
append
(
div
);
$
(
elementId
).
append
(
li
);
}
;
/**
* Initialization view pickup menu html
* @param {*} elementId
* @param {*} count
* Initialization view pickup menu html
* @param {*} elementId
* @param {*} count
*/
PICKUP
.
showCountDisplayPickupItem
=
function
(
elementId
,
count
)
{
let
span
=
$
(
'<span>'
+
I18N
.
i18nText
(
'display'
)
+
'</span>'
);
$
(
elementId
).
append
(
count
);
$
(
elementId
).
append
(
span
);
}
PICKUP
.
showCountDisplayPickupItem
=
function
(
elementId
,
count
)
{
let
span
=
$
(
'<span>'
+
I18N
.
i18nText
(
'display'
)
+
'</span>'
);
$
(
elementId
).
append
(
count
);
$
(
elementId
).
append
(
span
);
}
;
/**
* Initialization new report list html
* Initialization new report list html
*/
PICKUP
.
initNewReportTab
=
function
()
{
PICKUP
.
getNewreportListData
(
function
(
json
)
{
PICKUP
.
createNewReportList
(
json
.
operationList
);
});
}
PICKUP
.
initNewReportTab
=
function
()
{
PICKUP
.
getNewreportListData
(
function
(
json
)
{
PICKUP
.
createNewReportList
(
json
.
operationList
);
});
};
/**
* Initialization continuous work list html
* Initialization continuous work list html
*/
PICKUP
.
initContinuosWorkTab
=
function
()
{
PICKUP
.
getContinuousWorkListData
(
function
(
json
)
{
PICKUP
.
createContinousWorkList
(
json
.
operationList
);
});
}
PICKUP
.
initContinuosWorkTab
=
function
()
{
PICKUP
.
getContinuousWorkListData
(
function
(
json
)
{
PICKUP
.
createContinousWorkList
(
json
.
operationList
);
});
}
;
/**
* Initialization continuous work list html
* Initialization continuous work list html
*/
PICKUP
.
initReportWithWarningsTab
=
function
()
{
PICKUP
.
getReportWithWarningsListData
(
function
(
json
)
{
PICKUP
.
createReportWithWarningList
(
json
.
operationList
);
});
}
PICKUP
.
initReportWithWarningsTab
=
function
()
{
PICKUP
.
getReportWithWarningsListData
(
function
(
json
)
{
PICKUP
.
createReportWithWarningList
(
json
.
operationList
);
});
}
;
/**
* sort New report operation list
* @param {*} operationList
* @returns
* @param {*} operationList
* @returns
*/
PICKUP
.
sortNewReportList
=
function
(
operationList
)
{
operationList
=
operationList
.
sort
(
function
(
a
,
b
)
{
if
(
a
.
operationId
<
b
.
operationId
)
return
1
;
if
(
a
.
operationId
>
b
.
operationId
)
return
-
1
;
return
0
;
});
return
operationList
;
}
PICKUP
.
sortNewReportList
=
function
(
operationList
)
{
operationList
=
operationList
.
sort
(
function
(
a
,
b
)
{
if
(
a
.
operationId
<
b
.
operationId
)
return
1
;
if
(
a
.
operationId
>
b
.
operationId
)
return
-
1
;
return
0
;
});
return
operationList
;
}
;
/**
* Implement new report list html
* @param {*} operationListOld
* @returns
* @param {*} operationListOld
* @returns
*/
PICKUP
.
createNewReportList
=
function
(
operationListOld
)
{
if
(
typeof
operationListOld
===
'undefined'
||
operationListOld
.
length
<
1
)
{
PICKUP
.
showNotFoundPickupItem
(
"#newReport-list"
);
PICKUP
.
createNewReportList
=
function
(
operationListOld
)
{
if
(
typeof
operationListOld
===
'undefined'
||
operationListOld
.
length
<
1
)
{
PICKUP
.
showNotFoundPickupItem
(
'#newReport-list'
);
$
(
'#viewMenuNewReport'
).
addClass
(
'd-none'
);
return
;
}
let
operationList
=
PICKUP
.
sortNewReportList
(
operationListOld
);
$
(
'#viewMenuNewReport'
).
removeClass
(
'd-none'
);
$
(
"#newReport-list"
).
empty
();
PICKUP
.
countNewReportList
=
0
;
let
operationList
=
PICKUP
.
sortNewReportList
(
operationListOld
);
$
(
'#viewMenuNewReport'
).
removeClass
(
'd-none'
);
$
(
'#newReport-list'
).
empty
();
PICKUP
.
countNewReportList
=
0
;
$
(
'#newReport-list'
).
addClass
(
'task-list view-content view-block'
);
let
classIcon
;
for
(
let
i
=
0
;
i
<
operationList
.
length
;
i
++
)
{
switch
(
operationList
[
i
].
reportType
)
{
case
PICKUP
.
REPORT_TYPE
.
REPORTONLY
:
classIcon
=
"report"
;
break
;
case
PICKUP
.
REPORT_TYPE
.
INSPECT
:
classIcon
=
"inspection"
;
break
;
case
PICKUP
.
REPORT_TYPE
.
WITHREPLY
:
classIcon
=
"questionary"
;
break
;
case
PICKUP
.
REPORT_TYPE
.
WORKFLOW
:
classIcon
=
"proccess"
;
break
;
}
let
messageli
=
$
(
"<li class='card mb-2' name = 'operationId_"
+
operationList
[
i
].
operationId
+
"' ></li>"
);
let
ahrefRequiredFlg
=
$
(
"<a href=
\"
javascript:PICKUP.sendReportFormFromNewReport ('"
+
operationList
[
i
].
operationId
+
"');
\"
class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>"
);
let
divIcon
=
$
(
"<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+
"<div class='type-icon'>"
+
"<span class='"
+
classIcon
+
"'></span>"
+
"</div></div>"
)
let
divText
=
$
(
"<div class='pl-5 h-100 d-flex align-items-center'>"
+
"<div class='w-100'>"
+
"<div class='fs-12 text-truncate'>"
+
operationList
[
i
].
operationName
+
"</div>"
+
"</div></div>"
);
ahrefRequiredFlg
.
append
(
divIcon
);
ahrefRequiredFlg
.
append
(
divText
);
messageli
.
append
(
ahrefRequiredFlg
);
$
(
"#newReport-list"
).
append
(
messageli
);
PICKUP
.
countNewReportList
=
PICKUP
.
countNewReportList
+
1
;
}
// show not found if
if
(
PICKUP
.
countNewReportList
==
0
)
{
PICKUP
.
showNotFoundPickupItem
(
"#newReport-list"
);
$
(
'#viewMenuNewReport'
).
addClass
(
'd-none'
);
return
;
let
classIcon
;
for
(
let
i
=
0
;
i
<
operationList
.
length
;
i
++
)
{
switch
(
operationList
[
i
].
reportType
)
{
case
PICKUP
.
REPORT_TYPE
.
REPORTONLY
:
classIcon
=
'report'
;
break
;
case
PICKUP
.
REPORT_TYPE
.
INSPECT
:
classIcon
=
'inspection'
;
break
;
case
PICKUP
.
REPORT_TYPE
.
WITHREPLY
:
classIcon
=
'questionary'
;
break
;
case
PICKUP
.
REPORT_TYPE
.
WORKFLOW
:
classIcon
=
'proccess'
;
break
;
}
let
messageli
=
$
(
"<li class='card mb-2' name = 'operationId_"
+
operationList
[
i
].
operationId
+
"' ></li>"
);
let
ahrefRequiredFlg
=
$
(
'<a href="javascript:PICKUP.sendReportFormFromNewReport (
\'
'
+
operationList
[
i
].
operationId
+
"');
\"
class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>"
,
);
let
divIcon
=
$
(
"<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+
"<div class='type-icon'>"
+
"<span class='"
+
classIcon
+
"'></span>"
+
'</div></div>'
);
let
divText
=
$
(
"<div class='pl-5 h-100 d-flex align-items-center'>"
+
"<div class='w-100'>"
+
"<div class='fs-12 text-truncate'>"
+
operationList
[
i
].
operationName
+
'</div>'
+
'</div></div>'
,
);
ahrefRequiredFlg
.
append
(
divIcon
);
ahrefRequiredFlg
.
append
(
divText
);
messageli
.
append
(
ahrefRequiredFlg
);
$
(
'#newReport-list'
).
append
(
messageli
);
PICKUP
.
countNewReportList
=
PICKUP
.
countNewReportList
+
1
;
}
// show not found if
if
(
PICKUP
.
countNewReportList
==
0
)
{
PICKUP
.
showNotFoundPickupItem
(
'#newReport-list'
);
$
(
'#viewMenuNewReport'
).
addClass
(
'd-none'
);
return
;
}
PICKUP
.
showCountDisplayPickupItem
(
"#count-NewReport"
,
PICKUP
.
countNewReportList
)
}
PICKUP
.
showCountDisplayPickupItem
(
'#count-NewReport'
,
PICKUP
.
countNewReportList
);
};
/**
* sort continuous work operation list
* @param {*} operationList
* @returns
* @param {*} operationList
* @returns
*/
PICKUP
.
sortContinousWorkList
=
function
(
operationList
)
{
PICKUP
.
sortContinousWorkList
=
function
(
operationList
)
{
let
newOperationList
=
[];
for
(
let
i
=
0
;
i
<
operationList
.
length
;
i
++
)
{
if
(
operationList
[
i
].
reportType
===
3
)
{
if
(
typeof
operationList
[
i
].
processList
===
'undefined'
)
continue
;
if
(
operationList
[
i
].
processList
&&
operationList
[
i
].
processList
.
length
!=
0
)
{
for
(
let
j
=
0
;
j
<
operationList
[
i
].
processList
.
length
;
j
++
)
{
if
(
typeof
operationList
[
i
].
processList
[
j
].
phaseList
===
'undefined'
)
continue
;
for
(
let
g
=
0
;
g
<
operationList
[
i
].
processList
[
j
].
phaseList
.
length
;
g
++
)
{
if
(
operationList
[
i
].
processList
[
j
].
phaseList
[
g
].
phaseStatus
!=
999
)
{
let
item
=
{
reportType
:
operationList
[
i
].
reportType
,
operationType
:
operationList
[
i
].
operationType
,
phaseList
:
operationList
[
i
].
processList
[
j
].
phaseList
,
processKey
:
operationList
[
i
].
processList
[
j
].
processKey
,
permitCodeRequiredFlg
:
operationList
[
i
].
permitCodeRequiredFlg
,
operationId
:
operationList
[
i
].
operationId
,
contentId
:
operationList
[
i
].
contentId
,
operationName
:
operationList
[
i
].
operationName
,
taskCode
:
operationList
[
i
].
processList
[
j
].
taskCode
,
taskKey
:
operationList
[
i
].
processList
[
j
].
taskKey
,
taskName
:
operationList
[
i
].
processList
[
j
].
taskName
,
updateDate
:
operationList
[
i
].
processList
[
j
].
phaseList
[
g
].
updateDate
,
phaseNo
:
operationList
[
i
].
processList
[
j
].
phaseList
[
g
].
phaseNo
,
phaseName
:
operationList
[
i
].
processList
[
j
].
phaseList
[
g
].
phaseName
};
for
(
let
i
=
0
;
i
<
operationList
.
length
;
i
++
)
{
if
(
operationList
[
i
].
reportType
===
3
)
{
if
(
typeof
operationList
[
i
].
processList
===
'undefined'
)
continue
;
if
(
operationList
[
i
].
processList
&&
operationList
[
i
].
processList
.
length
!=
0
)
{
for
(
let
j
=
0
;
j
<
operationList
[
i
].
processList
.
length
;
j
++
)
{
if
(
typeof
operationList
[
i
].
processList
[
j
].
phaseList
===
'undefined'
)
continue
;
for
(
let
g
=
0
;
g
<
operationList
[
i
].
processList
[
j
].
phaseList
.
length
;
g
++
)
{
if
(
operationList
[
i
].
processList
[
j
].
phaseList
[
g
].
phaseStatus
!=
999
)
{
let
item
=
{
reportType
:
operationList
[
i
].
reportType
,
operationType
:
operationList
[
i
].
operationType
,
phaseList
:
operationList
[
i
].
processList
[
j
].
phaseList
,
processKey
:
operationList
[
i
].
processList
[
j
].
processKey
,
permitCodeRequiredFlg
:
operationList
[
i
].
permitCodeRequiredFlg
,
operationId
:
operationList
[
i
].
operationId
,
contentId
:
operationList
[
i
].
contentId
,
operationName
:
operationList
[
i
].
operationName
,
taskCode
:
operationList
[
i
].
processList
[
j
].
taskCode
,
taskKey
:
operationList
[
i
].
processList
[
j
].
taskKey
,
taskName
:
operationList
[
i
].
processList
[
j
].
taskName
,
updateDate
:
operationList
[
i
].
processList
[
j
].
phaseList
[
g
].
updateDate
,
phaseNo
:
operationList
[
i
].
processList
[
j
].
phaseList
[
g
].
phaseNo
,
phaseName
:
operationList
[
i
].
processList
[
j
].
phaseList
[
g
].
phaseName
,
};
newOperationList
.
push
(
item
);
}
}
}
}
}
}
newOperationList
=
newOperationList
.
sort
(
function
(
a
,
b
)
{
if
(
!
a
.
updateDate
)
{
a
.
updateDate
=
"1900-01-01 00:00:00"
;
}
if
(
!
b
.
updateDate
)
{
b
.
updateDate
=
"1900-01-01 00:00:00"
;
}
if
(
a
.
updateDate
<
b
.
updateDate
)
return
1
;
if
(
a
.
updateDate
>
b
.
updateDate
)
return
-
1
;
return
0
;
});
//console.log("newOperationList: " + JSON.stringify(newOperationList));
return
newOperationList
;
}
}
}
}
}
}
newOperationList
=
newOperationList
.
sort
(
function
(
a
,
b
)
{
if
(
!
a
.
updateDate
)
{
a
.
updateDate
=
'1900-01-01 00:00:00'
;
}
if
(
!
b
.
updateDate
)
{
b
.
updateDate
=
'1900-01-01 00:00:00'
;
}
if
(
a
.
updateDate
<
b
.
updateDate
)
return
1
;
if
(
a
.
updateDate
>
b
.
updateDate
)
return
-
1
;
return
0
;
});
//console.log("newOperationList: " + JSON.stringify(newOperationList));
return
newOperationList
;
};
/**
* Implement continous work html
* @param {*} operationListOld
* @returns
* @param {*} operationListOld
* @returns
*/
PICKUP
.
createContinousWorkList
=
function
(
operationListOld
)
{
if
(
typeof
operationListOld
===
'undefined'
||
operationListOld
.
length
<
1
)
{
PICKUP
.
showNotFoundPickupItem
(
"#continousWork-list"
);
PICKUP
.
createContinousWorkList
=
function
(
operationListOld
)
{
if
(
typeof
operationListOld
===
'undefined'
||
operationListOld
.
length
<
1
)
{
PICKUP
.
showNotFoundPickupItem
(
'#continousWork-list'
);
$
(
'#viewMenuContinuousWork'
).
addClass
(
'd-none'
);
return
;
}
let
operationList
=
PICKUP
.
sortContinousWorkList
(
operationListOld
);
$
(
'#viewMenuContinuousWork'
).
removeClass
(
'd-none'
);
$
(
"#continousWork-list"
).
empty
();
$
(
'#continousWork-list'
).
empty
();
PICKUP
.
countContinousWorkReport
=
0
;
$
(
'#continousWork-list'
).
addClass
(
'task-list view-content view-block'
);
$
(
'#continousWork-list'
).
addClass
(
'task-list view-content view-block'
);
for
(
let
i
=
0
;
i
<
operationList
.
length
;
i
++
)
{
let
directKey
=
operationList
[
i
].
processKey
;
if
(
operationList
[
i
].
operationType
==
PICKUP
.
OPERATION_TYPE
.
VTOUR
||
operationList
[
i
].
operationType
==
PICKUP
.
OPERATION_TYPE
.
PDF
)
{
directKey
=
operationList
[
i
].
taskKey
;
}
let
messageli
=
$
(
"<li class='card mb-2' id = 'list_"
+
operationList
[
i
].
processKey
+
"$"
+
operationList
[
i
].
phaseNo
+
"'></li>"
)
;
let
ahrefRequiredFlg
;
if
(
operationList
[
i
].
permitCodeRequiredFlg
==
1
)
{
ahrefRequiredFlg
=
$
(
"<a href=
\"
javascript:CHK.displayAlert('onlyRfid');
\"
class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>"
);
let
directKey
=
operationList
[
i
].
processKey
;
if
(
operationList
[
i
].
operationType
==
PICKUP
.
OPERATION_TYPE
.
VTOUR
||
operationList
[
i
].
operationType
==
PICKUP
.
OPERATION_TYPE
.
PDF
)
{
directKey
=
operationList
[
i
].
taskKey
;
}
else
{
ahrefRequiredFlg
=
$
(
"<a href=
\"
javascript:PICKUP.sendReportFormFromContinuousWork ('"
+
operationList
[
i
].
operationId
+
"','"
+
operationList
[
i
].
taskKey
+
"','"
+
operationList
[
i
].
processKey
+
"',"
+
operationList
[
i
].
phaseNo
+
");
\"
class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>"
);
let
messageli
=
$
(
"<li class='card mb-2' id = 'list_"
+
operationList
[
i
].
processKey
+
'$'
+
operationList
[
i
].
phaseNo
+
"'></li>"
);
let
ahrefRequiredFlg
;
if
(
operationList
[
i
].
permitCodeRequiredFlg
==
1
)
{
ahrefRequiredFlg
=
$
(
"<a href=
\"
javascript:CHK.displayAlert('onlyRfid');
\"
class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>"
);
}
else
{
ahrefRequiredFlg
=
$
(
'<a href="javascript:PICKUP.sendReportFormFromContinuousWork (
\'
'
+
operationList
[
i
].
operationId
+
"','"
+
operationList
[
i
].
taskKey
+
"','"
+
operationList
[
i
].
processKey
+
"',"
+
operationList
[
i
].
phaseNo
+
");
\"
class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'></a>"
,
);
}
let
divProccess
=
$
(
"<div class='position-absolute translate-middle top-50 left-0 ml-3'><div class='type-icon'><span class='proccess'></span></div></div>"
);
let
divProccess
=
$
(
"<div class='position-absolute translate-middle top-50 left-0 ml-3'><div class='type-icon'><span class='proccess'></span></div></div>"
);
let
divInfor
=
$
(
"<div class='pl-5 h-100 d-flex align-items-center'></div>"
);
let
divChildInfor
=
$
(
"<div class='w-100'></div>"
);
let
divOperationName
=
$
(
"<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>"
+
operationList
[
i
].
phaseName
+
'</div>'
);
let
divProcessName
=
$
(
"<div class='fs-12 text-truncate'>"
+
operationList
[
i
].
operationName
+
'</div>'
);
let
divReportInfor
=
$
(
"<div class='d-flex justify-content-between align-items-center'></div>"
);
let
divReportName
=
$
(
"<div class='fs-10 text-truncate'>"
+
operationList
[
i
].
taskName
+
'</div>'
);
let
divReportCode
=
$
(
"<div class='fs-8 text-secondary text-truncate'>"
+
operationList
[
i
].
taskCode
+
'</div>'
);
let
divInfor
=
$
(
"<div class='pl-5 h-100 d-flex align-items-center'></div>"
);
let
divChildInfor
=
$
(
"<div class='w-100'></div>"
);
let
divOperationName
=
$
(
"<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>"
+
operationList
[
i
].
phaseName
+
"</div>"
);
let
divProcessName
=
$
(
"<div class='fs-12 text-truncate'>"
+
operationList
[
i
].
operationName
+
"</div>"
);
let
divReportInfor
=
$
(
"<div class='d-flex justify-content-between align-items-center'></div>"
);
let
divReportName
=
$
(
"<div class='fs-10 text-truncate'>"
+
operationList
[
i
].
taskName
+
"</div>"
);
let
divReportCode
=
$
(
"<div class='fs-8 text-secondary text-truncate'>"
+
operationList
[
i
].
taskCode
+
"</div>"
);
divReportInfor
.
append
(
divReportName
);
divReportInfor
.
append
(
divReportCode
);
divReportInfor
.
append
(
divReportName
);
divReportInfor
.
append
(
divReportCode
);
divChildInfor
.
append
(
divOperationName
);
divChildInfor
.
append
(
divProcessName
);
divChildInfor
.
append
(
divReportInfor
);
divChildInfor
.
append
(
divOperationName
);
divChildInfor
.
append
(
divProcessName
);
divChildInfor
.
append
(
divReportInfor
);
divInfor
.
append
(
divChildInfor
);
divInfor
.
append
(
divChildInfor
);
ahrefRequiredFlg
.
append
(
divProccess
);
ahrefRequiredFlg
.
append
(
divInfor
);
messageli
.
append
(
ahrefRequiredFlg
);
ahrefRequiredFlg
.
append
(
divProccess
);
ahrefRequiredFlg
.
append
(
divInfor
);
messageli
.
append
(
ahrefRequiredFlg
);
$
(
"#continousWork-list"
).
append
(
messageli
);
$
(
'#continousWork-list'
).
append
(
messageli
);
PICKUP
.
countContinousWorkReport
=
PICKUP
.
countContinousWorkReport
+
1
;
}
// show not found if
if
(
PICKUP
.
countContinousWorkReport
==
0
)
{
PICKUP
.
showNotFoundPickupItem
(
"#continousWork-list"
);
$
(
'#viewMenuContinuousWork'
).
addClass
(
'd-none'
);
return
;
}
PICKUP
.
showCountDisplayPickupItem
(
"#count-ContinuousWork"
,
PICKUP
.
countContinousWorkReport
)
// show not found if
if
(
PICKUP
.
countContinousWorkReport
==
0
)
{
PICKUP
.
showNotFoundPickupItem
(
'#continousWork-list'
);
$
(
'#viewMenuContinuousWork'
).
addClass
(
'd-none'
);
return
;
}
PICKUP
.
showCountDisplayPickupItem
(
'#count-ContinuousWork'
,
PICKUP
.
countContinousWorkReport
);
};
/**
* sort report with warnings list
* @param {*} operationList
* @returns
* @param {*} operationList
* @returns
*/
PICKUP
.
sortWarningList
=
function
(
operationList
)
{
PICKUP
.
sortWarningList
=
function
(
operationList
)
{
let
newOperationList
=
[];
for
(
let
i
=
0
;
i
<
operationList
.
length
;
i
++
)
{
if
(
typeof
operationList
[
i
].
warningReportList
===
'undefined'
)
continue
;
if
(
operationList
[
i
].
warningReportList
&&
operationList
[
i
].
warningReportList
.
length
!=
0
)
{
for
(
let
j
=
0
;
j
<
operationList
[
i
].
warningReportList
.
length
;
j
++
)
{
let
item
=
{
reportType
:
operationList
[
i
].
reportType
,
operationType
:
operationList
[
i
].
operationType
,
permitCodeRequiredFlg
:
operationList
[
i
].
permitCodeRequiredFlg
,
operationId
:
operationList
[
i
].
operationId
,
contentId
:
operationList
[
i
].
contentId
,
operationName
:
operationList
[
i
].
operationName
,
taskCode
:
operationList
[
i
].
warningReportList
[
j
].
taskCode
,
taskKey
:
operationList
[
i
].
warningReportList
[
j
].
taskKey
,
taskName
:
operationList
[
i
].
warningReportList
[
j
].
taskName
,
taskType
:
operationList
[
i
].
warningReportList
[
j
].
taskType
,
updateDate
:
operationList
[
i
].
warningReportList
[
j
].
updateDate
,
reportStartDateString
:
operationList
[
i
].
warningReportList
[
j
].
reportStartDateString
,
reportEndDateString
:
operationList
[
i
].
warningReportList
[
j
].
reportEndDateString
,
processKey
:
operationList
[
i
].
warningReportList
[
j
].
processKey
,
phaseNo
:
operationList
[
i
].
warningReportList
[
j
].
phaseNo
,
phaseName
:
operationList
[
i
].
warningReportList
[
j
].
phaseName
};
newOperationList
.
push
(
item
);
}
}
}
newOperationList
=
newOperationList
.
sort
(
function
(
a
,
b
)
{
if
(
!
a
.
updateDate
)
{
a
.
updateDate
=
"1900-01-01 00:00:00"
;
}
if
(
!
b
.
updateDate
)
{
b
.
updateDate
=
"1900-01-01 00:00:00"
;
}
if
(
a
.
updateDate
<
b
.
updateDate
)
return
1
;
if
(
a
.
updateDate
>
b
.
updateDate
)
return
-
1
;
return
0
;
});
//console.log("newOperationList: " + JSON.stringify(newOperationList));
return
newOperationList
;
}
for
(
let
i
=
0
;
i
<
operationList
.
length
;
i
++
)
{
if
(
typeof
operationList
[
i
].
warningReportList
===
'undefined'
)
continue
;
if
(
operationList
[
i
].
warningReportList
&&
operationList
[
i
].
warningReportList
.
length
!=
0
)
{
for
(
let
j
=
0
;
j
<
operationList
[
i
].
warningReportList
.
length
;
j
++
)
{
let
item
=
{
reportType
:
operationList
[
i
].
reportType
,
operationType
:
operationList
[
i
].
operationType
,
permitCodeRequiredFlg
:
operationList
[
i
].
permitCodeRequiredFlg
,
operationId
:
operationList
[
i
].
operationId
,
contentId
:
operationList
[
i
].
contentId
,
operationName
:
operationList
[
i
].
operationName
,
taskCode
:
operationList
[
i
].
warningReportList
[
j
].
taskCode
,
taskKey
:
operationList
[
i
].
warningReportList
[
j
].
taskKey
,
taskName
:
operationList
[
i
].
warningReportList
[
j
].
taskName
,
taskType
:
operationList
[
i
].
warningReportList
[
j
].
taskType
,
updateDate
:
operationList
[
i
].
warningReportList
[
j
].
updateDate
,
reportStartDateString
:
operationList
[
i
].
warningReportList
[
j
].
reportStartDateString
,
reportEndDateString
:
operationList
[
i
].
warningReportList
[
j
].
reportEndDateString
,
processKey
:
operationList
[
i
].
warningReportList
[
j
].
processKey
,
phaseNo
:
operationList
[
i
].
warningReportList
[
j
].
phaseNo
,
phaseName
:
operationList
[
i
].
warningReportList
[
j
].
phaseName
,
};
newOperationList
.
push
(
item
);
}
}
}
newOperationList
=
newOperationList
.
sort
(
function
(
a
,
b
)
{
if
(
!
a
.
updateDate
)
{
a
.
updateDate
=
'1900-01-01 00:00:00'
;
}
if
(
!
b
.
updateDate
)
{
b
.
updateDate
=
'1900-01-01 00:00:00'
;
}
if
(
a
.
updateDate
<
b
.
updateDate
)
return
1
;
if
(
a
.
updateDate
>
b
.
updateDate
)
return
-
1
;
return
0
;
});
//console.log("newOperationList: " + JSON.stringify(newOperationList));
return
newOperationList
;
};
/**
* init Warning Report With ReportOnly Type
* @param {*} report
* @returns
* @param {*} report
* @returns
*/
PICKUP
.
initWarningReportWithReportOnlyType
=
function
(
report
)
{
let
ele
=
$
(
"<li class='card mb-2'>"
+
"<a href=
\"
javascript:PICKUP.sendReportFormFromWarningReport ('"
+
report
.
operationId
+
"',"
+
PICKUP
.
REPORT_TYPE
.
REPORTONLY
+
",'"
+
report
.
taskKey
+
"', null,null,null);
\"
class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+
"<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+
"<div class='type-icon'><span class='report'></span></div></div>"
+
"<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+
"<div class='fs-12 text-truncate'>"
+
report
.
operationName
+
"</div>"
+
"<div class='d-flex justify-content-between align-items-center'>"
+
"<div class='fs-10 text-truncate'>"
+
report
.
taskName
+
"</div>"
+
"<div class='fs-8 text-secondary text-truncate'> "
+
report
.
taskCode
+
"</div>"
+
"</div></div></div></a></li>"
);
return
ele
;
}
PICKUP
.
initWarningReportWithInspectType
=
function
(
report
)
{
let
ele
=
$
(
"<li class='card mb-2'>"
+
"<a href=
\"
javascript:PICKUP.sendReportFormFromWarningReport ('"
+
report
.
operationId
+
"',"
+
PICKUP
.
REPORT_TYPE
.
INSPECT
+
",'"
+
report
.
taskKey
+
"', null,null,null);
\"
class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+
"<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+
"<div class='type-icon'><span class='inspection'></span></div></div>"
+
"<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+
"<div class='fs-12 text-truncate'>"
+
report
.
operationName
+
"</div>"
+
"<div class='d-flex justify-content-between align-items-center'>"
+
"<div class='fs-10 text-truncate'></div>"
+
"<div class='fs-8 text-secondary text-truncate'>"
+
PICKUP
.
getInspectDate
(
report
.
reportStartDateString
)
+
" ~ "
+
PICKUP
.
getInspectDate
(
report
.
reportEndDateString
)
+
"</div></div></div></div></a></li>"
);
return
ele
;
}
PICKUP
.
initWarningReportWithReportOnlyType
=
function
(
report
)
{
let
ele
=
$
(
"<li class='card mb-2'>"
+
'<a href="javascript:PICKUP.sendReportFormFromWarningReport (
\'
'
+
report
.
operationId
+
"',"
+
PICKUP
.
REPORT_TYPE
.
REPORTONLY
+
",'"
+
report
.
taskKey
+
"', null,null,null);
\"
class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+
"<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+
"<div class='type-icon'><span class='report'></span></div></div>"
+
"<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+
"<div class='fs-12 text-truncate'>"
+
report
.
operationName
+
'</div>'
+
"<div class='d-flex justify-content-between align-items-center'>"
+
"<div class='fs-10 text-truncate'>"
+
report
.
taskName
+
'</div>'
+
"<div class='fs-8 text-secondary text-truncate'> "
+
report
.
taskCode
+
'</div>'
+
'</div></div></div></a></li>'
,
);
return
ele
;
};
PICKUP
.
initWarningReportWithInspectType
=
function
(
report
)
{
let
ele
=
$
(
"<li class='card mb-2'>"
+
'<a href="javascript:PICKUP.sendReportFormFromWarningReport (
\'
'
+
report
.
operationId
+
"',"
+
PICKUP
.
REPORT_TYPE
.
INSPECT
+
",'"
+
report
.
taskKey
+
"', null,null,null);
\"
class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+
"<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+
"<div class='type-icon'><span class='inspection'></span></div></div>"
+
"<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+
"<div class='fs-12 text-truncate'>"
+
report
.
operationName
+
'</div>'
+
"<div class='d-flex justify-content-between align-items-center'>"
+
"<div class='fs-10 text-truncate'></div>"
+
"<div class='fs-8 text-secondary text-truncate'>"
+
PICKUP
.
getInspectDate
(
report
.
reportStartDateString
)
+
' ~ '
+
PICKUP
.
getInspectDate
(
report
.
reportEndDateString
)
+
'</div></div></div></div></a></li>'
,
);
return
ele
;
};
/**
* init Warning Report With AnswerReport Type
* @param {*} report
* @param {*} reportTypeMsg
* @returns
* @param {*} report
* @param {*} reportTypeMsg
* @returns
*/
PICKUP
.
initWarningReportWithAnswerReportType
=
function
(
report
,
reportTypeMsg
)
{
let
ele
=
$
(
"<li class='card mb-2'>"
+
"<a href=
\"
javascript:PICKUP.sendReportFormFromWarningReport ('"
+
report
.
operationId
+
"',"
+
PICKUP
.
REPORT_TYPE
.
WITHREPLY
+
",null, null,null,"
+
report
.
replyNo
+
");
\"
class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+
"<div class='position-absolute translate-middle top-50 left-0 ml-3'><div class='type-icon'>"
+
"<span class='questionary'></span></div></div><div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+
"<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>"
+
reportTypeMsg
+
"</div>"
+
"<div class='fs-12 text-truncate'>"
+
report
.
operationName
+
"</div>"
+
"<div class='d-flex justify-content-between align-items-center'>"
+
"<div class='fs-10 text-truncate'>"
+
report
.
taskName
+
"</div>"
+
"<div class='fs-8 text-secondary text-truncate'>"
+
report
.
taskCode
+
"</div>"
+
"</div></div></div></a></li>"
);
return
ele
;
}
PICKUP
.
initWarningReportWithAnswerReportType
=
function
(
report
,
reportTypeMsg
)
{
let
ele
=
$
(
"<li class='card mb-2'>"
+
'<a href="javascript:PICKUP.sendReportFormFromWarningReport (
\'
'
+
report
.
operationId
+
"',"
+
PICKUP
.
REPORT_TYPE
.
WITHREPLY
+
',null, null,null,'
+
report
.
replyNo
+
");
\"
class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+
"<div class='position-absolute translate-middle top-50 left-0 ml-3'><div class='type-icon'>"
+
"<span class='questionary'></span></div></div><div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+
"<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>"
+
reportTypeMsg
+
'</div>'
+
"<div class='fs-12 text-truncate'>"
+
report
.
operationName
+
'</div>'
+
"<div class='d-flex justify-content-between align-items-center'>"
+
"<div class='fs-10 text-truncate'>"
+
report
.
taskName
+
'</div>'
+
"<div class='fs-8 text-secondary text-truncate'>"
+
report
.
taskCode
+
'</div>'
+
'</div></div></div></a></li>'
,
);
return
ele
;
};
/**
* init Warning Report With Continuous Report Type
* @param {*} report
* @returns
* @param {*} report
* @returns
*/
PICKUP
.
initWarningReportWithContinuousReportType
=
function
(
report
)
{
let
directKey
=
report
.
processKey
;
if
(
report
.
operationType
==
PICKUP
.
OPERATION_TYPE
.
VTOUR
||
report
.
operationType
==
PICKUP
.
OPERATION_TYPE
.
PDF
)
{
directKey
=
report
.
taskKey
;
if
(
report
.
phaseNo
>
1
)
{
//find taskKey of phaseNo 1
for
(
let
k
=
0
;
k
<
operationList
.
length
;
k
++
)
{
if
(
operationList
[
k
].
phaseNo
==
1
&&
operationList
[
k
].
processKey
==
report
.
processKey
)
{
directKey
=
operationList
[
k
].
taskKey
;
break
;
}
}
}
}
let
ele
=
$
(
"<li class='card mb-2'>"
+
"<a href=
\"
javascript:PICKUP.sendReportFormFromWarningReport ('"
+
report
.
operationId
+
"',"
+
PICKUP
.
REPORT_TYPE
.
WORKFLOW
+
",null,'"
+
report
.
processKey
+
"' ,'"
+
report
.
phaseNo
+
"',null);
\"
class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+
"<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+
"<div class='type-icon'><span class='proccess'></span></div></div>"
+
"<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+
"<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>"
+
report
.
phaseName
+
"</div>"
+
"<div class='fs-12 text-truncate'>"
+
report
.
operationName
+
"</div>"
+
"<div class='d-flex justify-content-between align-items-center'>"
+
"<div class='fs-10 text-truncate'>"
+
report
.
taskName
+
"</div>"
+
"<div class='fs-8 text-secondary text-truncate'>"
+
report
.
taskCode
+
"</div>"
+
"</div></div></div></a></li>"
);
return
ele
;
}
PICKUP
.
initWarningReportWithContinuousReportType
=
function
(
report
)
{
let
directKey
=
report
.
processKey
;
if
(
report
.
operationType
==
PICKUP
.
OPERATION_TYPE
.
VTOUR
||
report
.
operationType
==
PICKUP
.
OPERATION_TYPE
.
PDF
)
{
directKey
=
report
.
taskKey
;
if
(
report
.
phaseNo
>
1
)
{
//find taskKey of phaseNo 1
for
(
let
k
=
0
;
k
<
operationList
.
length
;
k
++
)
{
if
(
operationList
[
k
].
phaseNo
==
1
&&
operationList
[
k
].
processKey
==
report
.
processKey
)
{
directKey
=
operationList
[
k
].
taskKey
;
break
;
}
}
}
}
let
ele
=
$
(
"<li class='card mb-2'>"
+
'<a href="javascript:PICKUP.sendReportFormFromWarningReport (
\'
'
+
report
.
operationId
+
"',"
+
PICKUP
.
REPORT_TYPE
.
WORKFLOW
+
",null,'"
+
report
.
processKey
+
"' ,'"
+
report
.
phaseNo
+
"',null);
\"
class='h-100 d-block px-3 py-2 text-decoration-none text-dark position-relative'>"
+
"<div class='position-absolute translate-middle top-50 left-0 ml-3'>"
+
"<div class='type-icon'><span class='proccess'></span></div></div>"
+
"<div class='pl-5 h-100 d-flex align-items-center'><div class='w-100'>"
+
"<div class='fs-8 bg-dark10 px-2 py-1 mr-2 rounded mb-1 w-fit-content text-truncate mw-100'>"
+
report
.
phaseName
+
'</div>'
+
"<div class='fs-12 text-truncate'>"
+
report
.
operationName
+
'</div>'
+
"<div class='d-flex justify-content-between align-items-center'>"
+
"<div class='fs-10 text-truncate'>"
+
report
.
taskName
+
'</div>'
+
"<div class='fs-8 text-secondary text-truncate'>"
+
report
.
taskCode
+
'</div>'
+
'</div></div></div></a></li>'
,
);
return
ele
;
};
/**
* create Report With Warnings List html
* @param {*} operationListOld
* @returns
* @param {*} operationListOld
* @returns
*/
PICKUP
.
createReportWithWarningList
=
function
(
operationListOld
)
{
PICKUP
.
createReportWithWarningList
=
function
(
operationListOld
)
{
if
(
typeof
operationListOld
===
'undefined'
||
operationListOld
.
length
<
1
)
{
PICKUP
.
showNotFoundPickupItem
(
"#reportWithWarnings-list"
);
PICKUP
.
showNotFoundPickupItem
(
'#reportWithWarnings-list'
);
$
(
'#viewMenuReportWithWarnings'
).
addClass
(
'd-none'
);
return
;
}
let
operationList
=
PICKUP
.
sortWarningList
(
operationListOld
);
$
(
'#viewMenuReportWithWarnings'
).
removeClass
(
'd-none'
);
$
(
"#reportWithWarnings-list"
).
empty
();
PICKUP
.
countReportWithWarning
=
0
;
let
operationList
=
PICKUP
.
sortWarningList
(
operationListOld
);
$
(
'#viewMenuReportWithWarnings'
).
removeClass
(
'd-none'
);
$
(
'#reportWithWarnings-list'
).
empty
();
PICKUP
.
countReportWithWarning
=
0
;
$
(
'#reportWithWarnings-list'
).
addClass
(
'task-list view-content view-block'
);
$
(
'#reportWithWarnings-list'
).
addClass
(
'task-list view-content view-block'
);
const
msgLevelReport
=
I18N
.
i18nText
(
'reportLevelReport'
);
const
msgLevelAnswer
=
I18N
.
i18nText
(
'reportLevelAnswer'
);
const
msgLevelReport
=
I18N
.
i18nText
(
'reportLevelReport'
);
const
msgLevelAnswer
=
I18N
.
i18nText
(
'reportLevelAnswer'
);
for
(
let
i
=
0
;
i
<
operationList
.
length
;
i
++
)
{
let
operationNameLi
;
switch
(
operationList
[
i
].
reportType
)
{
case
PICKUP
.
REPORT_TYPE
.
REPORTONLY
:
operationNameLi
=
PICKUP
.
initWarningReportWithReportOnlyType
(
operationList
[
i
]);
break
;
case
PICKUP
.
REPORT_TYPE
.
INSPECT
:
operationNameLi
=
PICKUP
.
initWarningReportWithInspectType
(
operationList
[
i
]);
break
;
case
PICKUP
.
REPORT_TYPE
.
WITHREPLY
:
// report answer
if
(
operationList
[
i
].
taskType
==
PICKUP
.
REPLYREPORT_TASK_TYPE
.
REPORT
)
{
operationNameLi
=
PICKUP
.
initWarningReportWithAnswerReportType
(
operationList
[
i
],
msgLevelReport
);
}
else
{
operationNameLi
=
PICKUP
.
initWarningReportWithAnswerReportType
(
operationList
[
i
],
msgLevelAnswer
);
}
break
;
case
PICKUP
.
REPORT_TYPE
.
WORKFLOW
:
// continouswork
operationNameLi
=
PICKUP
.
initWarningReportWithContinuousReportType
(
operationList
[
i
]);
break
;
}
$
(
"#reportWithWarnings-list"
).
append
(
operationNameLi
);
PICKUP
.
countReportWithWarning
=
PICKUP
.
countReportWithWarning
+
1
;
}
// show not found if
if
(
PICKUP
.
countReportWithWarning
==
0
)
{
PICKUP
.
showNotFoundPickupItem
(
"#reportWithWarnings-list"
);
$
(
'#viewMenuReportWithWarnings'
).
addClass
(
'd-none'
);
return
;
let
operationNameLi
;
switch
(
operationList
[
i
].
reportType
)
{
case
PICKUP
.
REPORT_TYPE
.
REPORTONLY
:
operationNameLi
=
PICKUP
.
initWarningReportWithReportOnlyType
(
operationList
[
i
]);
break
;
case
PICKUP
.
REPORT_TYPE
.
INSPECT
:
operationNameLi
=
PICKUP
.
initWarningReportWithInspectType
(
operationList
[
i
]);
break
;
case
PICKUP
.
REPORT_TYPE
.
WITHREPLY
:
// report answer
if
(
operationList
[
i
].
taskType
==
PICKUP
.
REPLYREPORT_TASK_TYPE
.
REPORT
)
{
operationNameLi
=
PICKUP
.
initWarningReportWithAnswerReportType
(
operationList
[
i
],
msgLevelReport
);
}
else
{
operationNameLi
=
PICKUP
.
initWarningReportWithAnswerReportType
(
operationList
[
i
],
msgLevelAnswer
);
}
break
;
case
PICKUP
.
REPORT_TYPE
.
WORKFLOW
:
// continouswork
operationNameLi
=
PICKUP
.
initWarningReportWithContinuousReportType
(
operationList
[
i
]);
break
;
}
$
(
'#reportWithWarnings-list'
).
append
(
operationNameLi
);
PICKUP
.
countReportWithWarning
=
PICKUP
.
countReportWithWarning
+
1
;
}
// show not found if
if
(
PICKUP
.
countReportWithWarning
==
0
)
{
PICKUP
.
showNotFoundPickupItem
(
'#reportWithWarnings-list'
);
$
(
'#viewMenuReportWithWarnings'
).
addClass
(
'd-none'
);
return
;
}
PICKUP
.
showCountDisplayPickupItem
(
"#count-ReportWithWarnings"
,
PICKUP
.
countReportWithWarning
)
PICKUP
.
showCountDisplayPickupItem
(
'#count-ReportWithWarnings'
,
PICKUP
.
countReportWithWarning
);
};
/**
* get Inspect Date format
* @param {*} dateString
* @returns
* @param {*} dateString
* @returns
*/
PICKUP
.
getInspectDate
=
function
(
dateString
)
{
let
date
=
new
Date
(
dateString
)
return
date
.
getFullYear
()
+
"/"
+
(
"0"
+
(
date
.
getMonth
()
+
1
)).
slice
(
-
2
)
+
"/"
+
(
"0"
+
date
.
getDate
()).
slice
(
-
2
)
;
}
PICKUP
.
getInspectDate
=
function
(
dateString
)
{
let
date
=
new
Date
(
dateString
);
return
date
.
getFullYear
()
+
'/'
+
(
'0'
+
(
date
.
getMonth
()
+
1
)).
slice
(
-
2
)
+
'/'
+
(
'0'
+
date
.
getDate
()).
slice
(
-
2
)
;
}
;
/**
* send data to open report form from New report pickup
* @returns
* @returns
*/
PICKUP
.
sendReportFormFromNewReport
=
function
(
operationId
)
{
//Transition to the report form or operation list screen
PICKUP
.
sendReportFormFromNewReport
=
function
(
operationId
)
{
//Transition to the report form or operation list screen
let
params
=
{};
params
.
sid
=
COMMON
.
getSid
();
params
.
operationId
=
operationId
;
let
url
=
COMMON
.
format
(
ClientData
.
conf_checkApiUrl
(),
ClientData
.
userInfo_accountPath
())
+
CONSTANT
.
URL
.
CMS
.
HTML
.
BASE
+
CONSTANT
.
URL
.
CMS
.
HTML
.
LIST_REPORT_FORM
;
params
.
sid
=
COMMON
.
getSid
();
params
.
operationId
=
operationId
;
let
url
=
COMMON
.
format
(
ClientData
.
conf_checkApiUrl
(),
ClientData
.
userInfo_accountPath
())
+
CONSTANT
.
URL
.
CMS
.
HTML
.
BASE
+
CONSTANT
.
URL
.
CMS
.
HTML
.
LIST_REPORT_FORM
;
COMMON
.
postCommunication
(
url
,
params
);
}
}
;
/**
* send data to open report form of event click continuous work operation report
* @returns
* @returns
*/
PICKUP
.
sendReportFormFromContinuousWork
=
function
(
operationId
,
taskKey
,
processKey
,
phaseNo
)
{
//Transition to the report form or operation list screen
PICKUP
.
sendReportFormFromContinuousWork
=
function
(
operationId
,
taskKey
,
processKey
,
phaseNo
)
{
//Transition to the report form or operation list screen
let
params
=
{};
params
.
sid
=
COMMON
.
getSid
();
params
.
operationId
=
operationId
;
params
.
processKey
=
processKey
;
params
.
phaseNo
=
phaseNo
;
let
url
=
COMMON
.
format
(
ClientData
.
conf_checkApiUrl
(),
ClientData
.
userInfo_accountPath
())
+
CONSTANT
.
URL
.
CMS
.
HTML
.
BASE
+
CONSTANT
.
URL
.
CMS
.
HTML
.
LIST_REPORT_FORM
;
params
.
sid
=
COMMON
.
getSid
();
params
.
operationId
=
operationId
;
params
.
processKey
=
processKey
;
params
.
phaseNo
=
phaseNo
;
let
url
=
COMMON
.
format
(
ClientData
.
conf_checkApiUrl
(),
ClientData
.
userInfo_accountPath
())
+
CONSTANT
.
URL
.
CMS
.
HTML
.
BASE
+
CONSTANT
.
URL
.
CMS
.
HTML
.
LIST_REPORT_FORM
;
COMMON
.
postCommunication
(
url
,
params
);
}
}
;
/**
* send data to open report form of event click warning operation report
* @returns
* @returns
*/
PICKUP
.
sendReportFormFromWarningReport
=
function
(
operationId
,
reportType
,
taskKey
,
processKey
,
phaseNo
,
replyNo
)
{
//Transition to the report form or operation list screen
PICKUP
.
sendReportFormFromWarningReport
=
function
(
operationId
,
reportType
,
taskKey
,
processKey
,
phaseNo
,
replyNo
)
{
//Transition to the report form or operation list screen
let
params
=
{};
params
.
sid
=
COMMON
.
getSid
();
params
.
operationId
=
operationId
;
switch
(
reportType
)
{
case
PICKUP
.
REPORT_TYPE
.
REPORTONLY
:
params
.
taskKey
=
taskKey
;
break
;
case
PICKUP
.
REPORT_TYPE
.
INSPECT
:
params
.
taskKey
=
taskKey
;
break
;
case
PICKUP
.
REPORT_TYPE
.
WITHREPLY
:
params
.
replyNo
=
replyNo
;
break
;
case
PICKUP
.
REPORT_TYPE
.
WORKFLOW
:
params
.
processKey
=
processKey
;
params
.
phaseNo
=
phaseNo
;
break
;
}
let
url
=
COMMON
.
format
(
ClientData
.
conf_checkApiUrl
(),
ClientData
.
userInfo_accountPath
())
+
CONSTANT
.
URL
.
CMS
.
HTML
.
BASE
+
CONSTANT
.
URL
.
CMS
.
HTML
.
LIST_REPORT_FORM
;
params
.
sid
=
COMMON
.
getSid
();
params
.
operationId
=
operationId
;
switch
(
reportType
)
{
case
PICKUP
.
REPORT_TYPE
.
REPORTONLY
:
params
.
taskKey
=
taskKey
;
break
;
case
PICKUP
.
REPORT_TYPE
.
INSPECT
:
params
.
taskKey
=
taskKey
;
break
;
case
PICKUP
.
REPORT_TYPE
.
WITHREPLY
:
params
.
replyNo
=
replyNo
;
break
;
case
PICKUP
.
REPORT_TYPE
.
WORKFLOW
:
params
.
processKey
=
processKey
;
params
.
phaseNo
=
phaseNo
;
break
;
}
let
url
=
COMMON
.
format
(
ClientData
.
conf_checkApiUrl
(),
ClientData
.
userInfo_accountPath
())
+
CONSTANT
.
URL
.
CMS
.
HTML
.
BASE
+
CONSTANT
.
URL
.
CMS
.
HTML
.
LIST_REPORT_FORM
;
COMMON
.
postCommunication
(
url
,
params
);
}
}
;
abweb/js/pushMessageDetail/pushMessageDetail.js
View file @
f4b02a86
...
...
@@ -7,18 +7,20 @@ PushMessageDetail.baseApiUrl = COMMON.format(ClientData.conf_checkApiUrl(), Clie
*/
PushMessageDetail
.
dummyMessageDetailJson
=
{
pushMessageId
:
1
,
pushMessage
:
"内容が入ります。内容が入ります。内容が入ります。内容が入ります。"
,
pushSendDate
:
"2022/07/06 14:14"
,
operationName
:
"絞り検索"
,
pushSendLoginId
:
"agentec"
}
pushMessage
:
'内容が入ります。内容が入ります。内容が入ります。内容が入ります。'
,
pushSendDate
:
'2022/07/06 14:14'
,
operationName
:
'絞り検索'
,
pushSendLoginId
:
'agentec'
,
}
;
/**
* init when html loaded
*/
PushMessageDetail
.
init
=
function
()
{
PushMessageDetail
.
init
=
function
()
{
//Check if user is logged in
COMMON
.
checkAuth
(
false
);
//load common html
TEMPLATE
.
loadHearder
(
"#includedHeader"
);
TEMPLATE
.
loadHearder
(
'#includedHeader'
);
const
navs
=
[
{
titleLang
:
'dashboard'
,
...
...
@@ -32,44 +34,50 @@ PushMessageDetail.init = function() {
titleLang
:
'messageDetail'
,
},
];
TEMPLATE
.
loadMainNavsTitle
(
"#includedMainTitle"
,
"messageDetail"
,
navs
,
null
);
TEMPLATE
.
loadMainNavsTitle
(
'#includedMainTitle'
,
'messageDetail'
,
navs
,
null
);
//request message detail data
let
urlParam
=
COMMON
.
getUrlParameter
();
if
(
typeof
urlParam
!==
'object'
||
typeof
urlParam
.
pushMessageId
===
'undefined'
)
{
return
;
}
PushMessageDetail
.
getMessageDetail
(
urlParam
.
pushMessageId
,
function
(
message
)
{
return
;
}
PushMessageDetail
.
getMessageDetail
(
urlParam
.
pushMessageId
,
function
(
message
)
{
PushMessageDetail
.
showMessage
(
message
);
});
}
}
;
/**
* request message data
* @param {string} pushMessageId
* @param {object} callback
* @param {string} pushMessageId
* @param {object} callback
*/
PushMessageDetail
.
getMessageDetail
=
function
(
pushMessageId
,
callback
)
{
PushMessageDetail
.
getMessageDetail
=
function
(
pushMessageId
,
callback
)
{
let
param
=
{
sid
:
COMMON
.
getSid
(),
pushMessageId
:
pushMessageId
pushMessageId
:
pushMessageId
,
};
const
url
=
PushMessageDetail
.
baseApiUrl
;
COMMON
.
cmsAjax
(
url
,
param
,
true
,
function
(
json
)
{
if
(
callback
&&
json
&&
json
.
pushMessage
)
{
callback
(
json
.
pushMessage
);
}
},
function
()
{
console
.
log
(
'PushMessageDetail.getMessageDetail error'
);
});
}
COMMON
.
cmsAjax
(
url
,
param
,
true
,
function
(
json
)
{
if
(
callback
&&
json
&&
json
.
pushMessage
)
{
callback
(
json
.
pushMessage
);
}
},
function
()
{
console
.
log
(
'PushMessageDetail.getMessageDetail error'
);
},
);
};
/**
* Show message data
* @param {object} message
* @param {object} message
*/
PushMessageDetail
.
showMessage
=
function
(
message
)
{
PushMessageDetail
.
showMessage
=
function
(
message
)
{
$
(
'#content'
).
text
(
message
.
pushMessage
);
$
(
'#sendDate'
).
text
(
message
.
pushSendDate
);
$
(
'#operationName'
).
text
(
message
.
operationName
);
$
(
'#sender'
).
text
(
message
.
pushSendLoginId
);
}
}
;
abweb/js/pushMessageList/pushMessageList.js
View file @
f4b02a86
...
...
@@ -8,8 +8,10 @@ PushMessageList.baseApiUrl = COMMON.format(ClientData.conf_checkApiUrl(), Client
/**
* Init when html onload
*/
PushMessageList
.
init
=
function
()
{
TEMPLATE
.
loadHearder
(
"#includedHeader"
);
PushMessageList
.
init
=
function
()
{
//Check if user is logged in
COMMON
.
checkAuth
(
false
);
TEMPLATE
.
loadHearder
(
'#includedHeader'
);
const
navs
=
[
{
titleLang
:
'dashboard'
,
...
...
@@ -19,44 +21,50 @@ PushMessageList.init = function() {
titleLang
:
'messageListTitle'
,
},
];
TEMPLATE
.
loadMainNavsTitle
(
"#includedMainTitle"
,
"messageListTitle"
,
navs
,
null
);
PushMessageList
.
getMessageList
(
function
(
messageList
)
{
TEMPLATE
.
loadMainNavsTitle
(
'#includedMainTitle'
,
'messageListTitle'
,
navs
,
null
);
PushMessageList
.
getMessageList
(
function
(
messageList
)
{
PushMessageList
.
generateMessageListHtml
(
messageList
.
pushMessageList
);
});
}
}
;
/**
* get Message List from CMS
* @param {function} callback
* @param {function} callback
*/
PushMessageList
.
getMessageList
=
function
(
callback
)
{
let
param
=
{
sid
:
COMMON
.
getSid
(),
};
const
url
=
PushMessageList
.
baseApiUrl
;
COMMON
.
cmsAjax
(
url
,
param
,
true
,
function
(
json
)
{
if
(
callback
)
{
callback
(
json
);
}
},
function
()
{
console
.
log
(
'PushMessageList.getMessageList error'
);
});
COMMON
.
cmsAjax
(
url
,
param
,
true
,
function
(
json
)
{
if
(
callback
)
{
callback
(
json
);
}
},
function
()
{
console
.
log
(
'PushMessageList.getMessageList error'
);
},
);
};
/**
* handle click message event
* @param {string} pushMessageId
* @param {string} pushMessageId
*/
PushMessageList
.
clickMessage
=
function
(
pushMessageId
)
{
COMMON
.
goUrlWithCurrentParams
(
'pushMessageDetail.html'
,
{
pushMessageId
:
pushMessageId
});
}
PushMessageList
.
clickMessage
=
function
(
pushMessageId
)
{
COMMON
.
goUrlWithCurrentParams
(
'pushMessageDetail.html'
,
{
pushMessageId
:
pushMessageId
});
}
;
/**
* generate message list html
* @param {array} messageList
* @returns
* @param {array} messageList
* @returns
*/
PushMessageList
.
generateMessageListHtml
=
function
(
messageList
)
{
PushMessageList
.
generateMessageListHtml
=
function
(
messageList
)
{
if
(
typeof
messageList
===
'undefined'
||
messageList
.
length
<
1
)
{
//show not found
$
(
'#messageList .not-found'
).
removeClass
(
'd-none'
);
...
...
@@ -69,42 +77,45 @@ PushMessageList.generateMessageListHtml = function(messageList) {
var
mTitle
=
message
.
pushMessage
;
var
mDate
=
message
.
pushSendDate
;
var
mSubtitle
=
message
.
operationName
;
var
messageLi
=
$
(
'<li class="card mb-2" id="pushMessageId_'
+
messageId
+
'"/>'
);
var
messageLi
=
$
(
'<li class="card mb-2" id="pushMessageId_'
+
messageId
+
'"/>'
);
if
(
message
.
readingFlg
)
{
messageLi
.
addClass
(
'read'
);
}
else
{
messageLi
.
addClass
(
'unread'
);
}
var
messageA
=
$
(
'<a class="d-block px-3 py-2 text-decoration-none text-dark"/>'
);
messageA
.
attr
(
'href'
,
"javascript:PushMessageList.clickMessage('"
+
messageId
+
"');"
);
messageA
.
attr
(
'href'
,
"javascript:PushMessageList.clickMessage('"
+
messageId
+
"');"
);
var
titleDiv
=
$
(
'<div class="fs-12 text-truncate">'
+
mTitle
+
'</div>'
);
var
subTitleMainDiv
=
$
(
'<div class="d-flex justify-content-between align-items-center"></div>'
);
var
subTitleDiv
=
$
(
'<div class="fs-10 text-truncate">'
+
mSubtitle
+
'</div>'
);
var
subTitleDiv
=
$
(
'<div class="fs-10 text-truncate">'
+
mSubtitle
+
'</div>'
);
var
dateDiv
=
$
(
'<div class="fs-8 text-secondary text-nowrap">'
+
mDate
+
'</div>'
);
subTitleMainDiv
.
append
(
subTitleDiv
);
subTitleMainDiv
.
append
(
dateDiv
);
messageA
.
append
(
titleDiv
);
messageA
.
append
(
subTitleMainDiv
);
messageLi
.
append
(
messageA
);
$
(
'#messageList'
).
append
(
messageLi
);
}
$
(
'#messageList'
).
append
(
messageLi
);
}
};
/**
* dummy message list JSON for test
*/
PushMessageList
.
dummyMessageListJson
=
{
pushMessageList
:
[{
pushMessageId
:
1
,
pushMessage
:
'メッセージ内容が入ります。'
,
pushSendDate
:
'2022/07/06 14:14'
,
operationName
:
'作業名が入ります。'
,
readingFlg
:
0
,
},
{
pushMessageId
:
2
,
pushMessage
:
'メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。'
,
pushSendDate
:
'xxxxxxxxxxxxxxxxxxxxxxxxxx'
,
operationName
:
'作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。'
,
readingFlg
:
1
,
}]
pushMessageList
:
[
{
pushMessageId
:
1
,
pushMessage
:
'メッセージ内容が入ります。'
,
pushSendDate
:
'2022/07/06 14:14'
,
operationName
:
'作業名が入ります。'
,
readingFlg
:
0
,
},
{
pushMessageId
:
2
,
pushMessage
:
'メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。メッセージ内容が入ります。'
,
pushSendDate
:
'xxxxxxxxxxxxxxxxxxxxxxxxxx'
,
operationName
:
'作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。作業名が入ります。'
,
readingFlg
:
1
,
},
],
};
abweb/js/reportForm/reportForm.js
View file @
f4b02a86
...
...
@@ -3,6 +3,9 @@
var
RF
=
{};
RF
.
init
=
function
()
{
//Check if user is logged in
COMMON
.
checkAuth
(
false
);
RF
.
loadCommon
();
RF
.
initFormView
();
...
...
abweb/js/reportList/reportList.js
View file @
f4b02a86
...
...
@@ -2,39 +2,39 @@
var
RL
=
{};
RL
.
init
=
function
()
{
console
.
log
(
"ReportList init start"
);
// COMMON.checkAuth(true);
RL
.
init
=
function
()
{
//Check if user is logged in
COMMON
.
checkAuth
(
false
);
console
.
log
(
'ReportList init start'
);
RL
.
loadCommon
();
RL
.
initTaskReportList
();
};
RL
.
loadCommon
=
function
()
{
$
(
"#includedHeader"
).
load
(
"../html/common/header.html"
,
function
()
{
RL
.
loadCommon
=
function
()
{
$
(
'#includedHeader'
).
load
(
'../html/common/header.html'
,
function
()
{
I18N
.
initi18n
();
HEADER
.
init
();
});
$
(
"#includedConfirmModal"
).
load
(
"../html/common/confirmModal.html"
,
function
()
{
});
$
(
'#includedConfirmModal'
).
load
(
'../html/common/confirmModal.html'
,
function
()
{
I18N
.
initi18n
();
});
}
});
}
;
RL
.
initTaskReportList
=
function
()
{
RL
.
initTaskReportList
=
function
()
{
if
(
sessionStorage
.
OL_operationId
)
{
let
params
=
{};
params
.
sid
=
COMMON
.
getSid
();
params
.
operationId
=
sessionStorage
.
OL_operationId
;
params
.
returnUrl
=
CONSTANT
.
URL
.
WEB
.
BASE
+
CONSTANT
.
URL
.
WEB
.
OPERATION_LIST
;
let
url
=
COMMON
.
format
(
ClientData
.
conf_checkApiUrl
(),
ClientData
.
userInfo_accountPath
())
+
CONSTANT
.
URL
.
CMS
.
HTML
.
BASE
+
CONSTANT
.
URL
.
CMS
.
HTML
.
TASK_REPORT_LIST
;
$
(
"#reportList"
).
load
(
url
,
params
);
$
(
'#reportList'
).
load
(
url
,
params
);
}
else
{
COMMON
.
displayAlert
(
"error"
);
COMMON
.
avwScreenMove
(
"index.html"
);
COMMON
.
displayAlert
(
'error'
);
COMMON
.
avwScreenMove
(
'index.html'
);
}
}
RL
.
goPdfPrint
=
function
()
{
COMMON
.
avwScreenMove
(
"pdfPrint.html"
);
}
};
RL
.
goPdfPrint
=
function
()
{
COMMON
.
avwScreenMove
(
'pdfPrint.html'
);
};
abweb/js/sendMessage/sendMessage.js
View file @
f4b02a86
...
...
@@ -12,49 +12,49 @@ SendMessage.contentMaxLength = 207;
* Get input content
* @returns string
*/
SendMessage
.
getCurrentMessageContent
=
function
()
{
SendMessage
.
getCurrentMessageContent
=
function
()
{
return
$
(
'#messageContent'
).
val
();
}
}
;
/**
* Get operation id selected
* @returns string
*/
SendMessage
.
getCurrentOperationId
=
function
()
{
SendMessage
.
getCurrentOperationId
=
function
()
{
return
$
(
'#operationSelected'
).
attr
(
'data-operation-id'
);
}
}
;
/**
* Get send type selected
* @returns string
*/
SendMessage
.
getCurrentSendType
=
function
()
{
SendMessage
.
getCurrentSendType
=
function
()
{
return
$
(
'input[name="sendType"]:checked'
).
val
();
}
}
;
/**
* Check data required when send message request to cms
* @returns boolean
*/
SendMessage
.
checkValidation
=
function
()
{
SendMessage
.
checkValidation
=
function
()
{
const
message
=
SendMessage
.
getCurrentMessageContent
();
if
(
!
ValidationUtil
.
CheckRequiredForText
(
message
))
{
alert
(
I18N
.
i18nText
(
'msgContentRequired'
));
return
false
;
}
return
false
;
}
if
(
!
ValidationUtil
.
CheckMaxLengthForByte
(
message
,
SendMessage
.
contentMaxLength
))
{
alert
(
COMMON
.
format
(
I18N
.
i18nText
(
'msgContentInvalidLength'
),
SendMessage
.
contentMaxLength
));
return
false
;
return
false
;
}
const
operationId
=
SendMessage
.
getCurrentOperationId
();
if
(
!
ValidationUtil
.
IsNumber
(
operationId
))
{
alert
(
I18N
.
i18nText
(
'msgOperationRequired'
));
return
false
;
return
false
;
}
const
sendType
=
SendMessage
.
getCurrentSendType
();
if
(
!
ValidationUtil
.
IsNumber
(
sendType
))
{
alert
(
I18N
.
i18nText
(
'msgSendTypeRequired'
));
return
false
;
return
false
;
}
return
true
;
};
...
...
@@ -62,7 +62,7 @@ SendMessage.checkValidation = function() {
/**
* handle click event of send button
*/
SendMessage
.
onClickSend
=
function
()
{
SendMessage
.
onClickSend
=
function
()
{
if
(
!
SendMessage
.
checkValidation
())
{
return
;
}
...
...
@@ -74,39 +74,44 @@ SendMessage.onClickSend = function() {
/**
* post message data to cms
* @param {string} message
* @param {long} operationId
* @param {string} message
* @param {long} operationId
* @param {int} sendType - 0: Group, 1: All
*/
SendMessage
.
postMessage
=
function
(
message
,
operationId
,
sendType
)
{
SendMessage
.
postMessage
=
function
(
message
,
operationId
,
sendType
)
{
let
param
=
{
sid
:
COMMON
.
getSid
(),
message
:
message
,
operationId
:
operationId
,
sendType
:
sendType
sendType
:
sendType
,
};
COMMON
.
cmsAjax
(
SendMessage
.
baseApiUrl
,
param
,
false
,
function
(
json
)
{
},
function
()
{
console
.
log
(
'SendMessage.postMessage error'
);
});
COMMON
.
cmsAjax
(
SendMessage
.
baseApiUrl
,
param
,
false
,
function
(
json
)
{},
function
()
{
console
.
log
(
'SendMessage.postMessage error'
);
},
);
};
SendMessage
.
operationSelectedCallback
=
function
(
operationId
,
operationName
)
{
SendMessage
.
operationSelectedCallback
=
function
(
operationId
,
operationName
)
{
$
(
'#operationSelected'
).
attr
(
'data-operation-id'
,
operationId
);
$
(
'#operationSelected'
).
text
(
operationName
);
}
}
;
SendMessage
.
templateSelectedCallback
=
function
(
template
)
{
SendMessage
.
templateSelectedCallback
=
function
(
template
)
{
$
(
'#messageContent'
).
val
(
template
);
}
}
;
/**
* init data, action when screen onload
*/
SendMessage
.
init
=
function
()
{
TEMPLATE
.
loadHearder
(
"#includedHeader"
);
//Check if user is logged in
COMMON
.
checkAuth
(
false
);
TEMPLATE
.
loadHearder
(
'#includedHeader'
);
const
navs
=
[
{
titleLang
:
'dashboard'
,
...
...
@@ -116,7 +121,7 @@ SendMessage.init = function () {
titleLang
:
'sendMessageTitle'
,
},
];
TEMPLATE
.
loadMainNavsTitle
(
"#includedMainTitle"
,
"sendMessageTitle"
,
navs
,
null
);
TEMPLATE
.
loadMainNavsTitle
(
'#includedMainTitle'
,
'sendMessageTitle'
,
navs
,
null
);
TEMPLATE
.
loadOperationSelect
(
'#includeOperationSelect'
,
SendMessage
.
operationSelectedCallback
);
TEMPLATE
.
loadNotificationSelect
(
'#includeTemplateModal'
,
SendMessage
.
templateSelectedCallback
);
$
(
'#messageContent'
).
attr
(
'maxlength'
,
SendMessage
.
contentMaxLength
);
...
...
@@ -124,4 +129,4 @@ SendMessage.init = function () {
I18N
.
initi18n
();
$
(
"label[for='sendTypeGroup']"
).
append
(
I18N
.
i18nText
(
'labelSendTypeGroup'
));
$
(
"label[for='sendTypeAll']"
).
append
(
I18N
.
i18nText
(
'labelSendTypeAll'
));
};
\ No newline at end of file
};
abweb/js/setting/settings.js
View file @
f4b02a86
...
...
@@ -4,27 +4,27 @@ var SETTINGS = {};
// Init function of page
$
(
document
).
ready
(
function
()
{
//Check if user is logged in
COMMON
.
checkAuth
(
false
);
SETTINGS
.
initScreen
();
$
(
"#dspPwdUpd1"
).
click
(
SETTINGS
.
dspPwdUpd1_Click
);
$
(
'#dspPwdUpd1'
).
click
(
SETTINGS
.
dspPwdUpd1_Click
);
});
// Process changing password
SETTINGS
.
dspPwdUpd1_Click
=
function
(
e
)
{
SETTINGS
.
dspPwdUpd1_Click
=
function
(
e
)
{
e
.
preventDefault
();
var
isOK
=
true
;
var
msgError
=
$
(
'#main-error-message'
);
var
msgError
=
$
(
'#main-error-message'
);
// Check validation
if
(
!
ValidationUtil
.
CheckRequiredForText
(
SETTINGS
.
getCurrentPassword
()))
{
isOK
=
false
;
msgError
.
html
(
COMMON
.
format
(
I18N
.
i18nText
(
'msgEssential'
),
I18N
.
i18nText
(
'txtPwdCurr'
)).
toString
());
msgError
.
show
();
}
else
{
msgError
.
html
(
COMMON
.
format
(
I18N
.
i18nText
(
'msgEssential'
),
I18N
.
i18nText
(
'txtPwdCurr'
)).
toString
());
msgError
.
show
();
}
else
{
if
(
!
ValidationUtil
.
CheckRequiredForText
(
SETTINGS
.
getNewPassword
()))
{
isOK
=
false
;
msgError
.
html
(
COMMON
.
format
(
I18N
.
i18nText
(
'msgEssential'
),
I18N
.
i18nText
(
'txtPwdNew'
)).
toString
());
msgError
.
show
();
msgError
.
html
(
COMMON
.
format
(
I18N
.
i18nText
(
'msgEssential'
),
I18N
.
i18nText
(
'txtPwdNew'
)).
toString
());
msgError
.
show
();
}
else
if
(
!
ValidationUtil
.
CheckRequiredForText
(
SETTINGS
.
getNewPasswordRe
()))
{
isOK
=
false
;
msgError
.
html
(
COMMON
.
format
(
I18N
.
i18nText
(
'msgEssential'
),
I18N
.
i18nText
(
'txtPwdNewRe'
)).
toString
());
...
...
@@ -38,7 +38,6 @@ SETTINGS.dspPwdUpd1_Click = function(e) {
}
}
if
(
isOK
)
{
// Check min length
if
(
!
ValidationUtil
.
CheckMinLengthForByte
(
SETTINGS
.
getNewPassword
(),
6
))
{
isOK
=
false
;
...
...
@@ -53,58 +52,53 @@ SETTINGS.dspPwdUpd1_Click = function(e) {
}
// Check at least 3 consecutive characters
if
(
ValidationUtil
.
HasSeqChar
(
SETTINGS
.
getNewPassword
(),
3
))
{
isOK
=
false
;
isOK
=
false
;
msgError
.
html
(
I18N
.
i18nText
(
'msgHasSeqChar'
));
msgError
.
show
();
}
// Check 4 same characters in before password
if
(
ValidationUtil
.
ContainSameSeqChar
(
SETTINGS
.
getCurrentPassword
(),
SETTINGS
.
getNewPassword
(),
4
))
{
isOK
=
false
;
isOK
=
false
;
msgError
.
html
(
I18N
.
i18nText
(
'msgContainSameSeqChar'
));
msgError
.
show
();
}
}
// Do changing password
if
(
isOK
)
{
var
params
=
{
sid
:
ClientData
.
userInfo_sid
(),
loginId
:
ClientData
.
userInfo_loginId_session
(),
password
:
SETTINGS
.
getCurrentPassword
(),
newPassword
:
SETTINGS
.
getNewPassword
(),
language
:
I18N
.
getCurrentLanguage
(),
appId
:
4
appId
:
4
,
};
const
url
=
COMMON
.
format
(
ClientData
.
conf_checkApiUrl
(),
ClientData
.
userInfo_accountPath
())
+
CONSTANT
.
URL
.
CMS
.
API
.
PASSWORD_CHANGE
;
COMMON
.
cmsAjax
(
url
,
params
,
false
,
SETTINGS
.
avwCmsApi_passwordChange_success
,
SETTINGS
.
avwCmsApi_passwordChange_fail
);
}
else
{
COMMON
.
cmsAjax
(
url
,
params
,
false
,
SETTINGS
.
avwCmsApi_passwordChange_success
,
SETTINGS
.
avwCmsApi_passwordChange_fail
);
}
else
{
//alert('error');
}
};
SETTINGS
.
avwCmsApi_passwordChange_success
=
function
(
data
)
{
SETTINGS
.
avwCmsApi_passwordChange_success
=
function
(
data
)
{
// OK
var
msgError
=
$
(
'#main-error-message'
);
var
msgError
=
$
(
'#main-error-message'
);
if
(
data
.
httpStatus
!=
CONSTANT
.
HTTP_STATUS
.
OK
)
{
msgError
.
html
(
I18N
.
i18nText
(
'msgPwdChangeNG'
));
msgError
.
show
();
}
else
{
}
else
{
msgError
.
html
(
''
);
$
(
"#txtPwdCur"
).
val
(
""
);
$
(
"#txtPwdNew"
).
val
(
""
);
$
(
"#txtPwdNewRe"
).
val
(
""
);
$
(
'#txtPwdCur'
).
val
(
''
);
$
(
'#txtPwdNew'
).
val
(
''
);
$
(
'#txtPwdNewRe'
).
val
(
''
);
/* show messages */
COMMON
.
displayAlert
(
'msgPwdChangeOK'
);
}
};
SETTINGS
.
avwCmsApi_passwordChange_fail
=
function
(
xhr
,
b
,
c
)
{
SETTINGS
.
avwCmsApi_passwordChange_fail
=
function
(
xhr
,
b
,
c
)
{
/* show error messages */
var
msgError
=
$
(
'#main-error-message'
);
if
(
xhr
.
errorMessage
&&
xhr
.
httpStatus
!=
0
)
{
...
...
@@ -115,7 +109,6 @@ SETTINGS.avwCmsApi_passwordChange_fail = function(xhr, b, c) {
msgError
.
show
();
};
/*
----------------------------------------------------------------------------
Event groups [ end ]
...
...
@@ -123,33 +116,32 @@ Event groups [ end ]
*/
// Get input current password
SETTINGS
.
getCurrentPassword
=
function
()
{
return
$
(
"#txtPwdCur"
).
val
();
SETTINGS
.
getCurrentPassword
=
function
()
{
return
$
(
'#txtPwdCur'
).
val
();
};
// Get input new password
SETTINGS
.
getNewPassword
=
function
()
{
return
$
(
"#txtPwdNew"
).
val
();
SETTINGS
.
getNewPassword
=
function
()
{
return
$
(
'#txtPwdNew'
).
val
();
};
// Get input new password
SETTINGS
.
getNewPasswordRe
=
function
()
{
return
$
(
"#txtPwdNewRe"
).
val
();
SETTINGS
.
getNewPasswordRe
=
function
()
{
return
$
(
'#txtPwdNewRe'
).
val
();
};
// Initalize screen
SETTINGS
.
initScreen
=
function
()
{
$
(
"#includedHeader"
).
load
(
"../html/common/header.html"
,
function
()
{
SETTINGS
.
initScreen
=
function
()
{
$
(
'#includedHeader'
).
load
(
'../html/common/header.html'
,
function
()
{
I18N
.
initi18n
();
HEADER
.
init
();
});
$
(
"#includedConfirmModal"
).
load
(
"../html/common/confirmModal.html"
,
function
()
{
});
$
(
'#includedConfirmModal'
).
load
(
'../html/common/confirmModal.html'
,
function
()
{
I18N
.
initi18n
();
});
});
// Login ID
$
(
"#txtLoginId"
).
text
(
ClientData
.
userInfo_loginId_session
());
$
(
'#txtLoginId'
).
text
(
ClientData
.
userInfo_loginId_session
());
// Account Path
$
(
"#txtLoginAccPath"
).
text
(
ClientData
.
userInfo_accountPath_session
());
$
(
'#txtLoginAccPath'
).
text
(
ClientData
.
userInfo_accountPath_session
());
// Recent login date
$
(
"#txtLastLoginTime"
).
text
(
ClientData
.
userInfo_lastLoginTime
());
$
(
'#txtLastLoginTime'
).
text
(
ClientData
.
userInfo_lastLoginTime
());
};
abweb/js/template/template.js
View file @
f4b02a86
/**
* template js
* template js
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var
TEMPLATE
=
{};
/** template load header */
TEMPLATE
.
loadHearder
=
function
(
elmentId
)
{
$
(
elmentId
).
load
(
"../html/common/header.html"
,
function
()
{
$
(
"#iconHomeDashboard"
).
removeClass
(
'active'
);
$
(
"#iconHomeWorkList"
).
removeClass
(
'active'
);
if
(
sessionStorage
.
activeHomePage
==
CONSTANT
.
PAGE_NAME
.
OPERATION_LIST
)
{
$
(
"#iconHomeWorkList"
).
addClass
(
'active'
);
}
else
{
$
(
"#iconHomeDashboard"
).
addClass
(
'active'
);
TEMPLATE
.
loadHearder
=
function
(
elmentId
)
{
$
(
elmentId
).
load
(
'../html/common/header.html'
,
function
()
{
$
(
'#iconHomeDashboard'
).
removeClass
(
'active'
);
$
(
'#iconHomeWorkList'
).
removeClass
(
'active'
);
if
(
sessionStorage
.
activeHomePage
==
CONSTANT
.
PAGE_NAME
.
OPERATION_LIST
)
{
$
(
'#iconHomeWorkList'
).
addClass
(
'active'
);
}
else
{
$
(
'#iconHomeDashboard'
).
addClass
(
'active'
);
}
I18N
.
initi18n
();
});
}
});
}
;
/**
* template load dashboard setting
* template load dashboard setting
* @param {string} elmentId - element to load setting html
* @param {*} changeCallback - callback when setting changed
*/
TEMPLATE
.
loadDashboardSetting
=
function
(
elmentId
,
changeCallback
)
{
$
(
elmentId
).
load
(
"dashboardSetting.html"
,
function
()
{
TEMPLATE
.
loadDashboardSetting
=
function
(
elmentId
,
changeCallback
)
{
$
(
elmentId
).
load
(
'dashboardSetting.html'
,
function
()
{
DashboardSetting
.
init
(
changeCallback
);
I18N
.
initi18n
();
});
}
});
}
;
/** Template load confirm model */
TEMPLATE
.
loadConfirmModal
=
function
(
elmentId
)
{
$
(
elmentId
).
load
(
"../html/common/confirmModal.html"
,
function
()
{
TEMPLATE
.
loadConfirmModal
=
function
(
elmentId
)
{
$
(
elmentId
).
load
(
'../html/common/confirmModal.html'
,
function
()
{
I18N
.
initi18n
();
});
}
});
}
;
/** Template load operation select */
TEMPLATE
.
loadOperationSelect
=
function
(
elmentId
,
selectCallback
)
{
$
(
elmentId
).
load
(
"operationSelect.html"
,
function
()
{
TEMPLATE
.
loadOperationSelect
=
function
(
elmentId
,
selectCallback
)
{
$
(
elmentId
).
load
(
'operationSelect.html'
,
function
()
{
OperationSelect
.
init
(
selectCallback
);
I18N
.
initi18n
();
});
}
});
}
;
/**
* show confirm model
*/
TEMPLATE
.
showModalConfirm
=
function
()
{
$
(
"#showConfirm"
).
click
(
function
()
{
$
(
"#confirm-modal"
).
modal
();
TEMPLATE
.
showModalConfirm
=
function
()
{
$
(
'#showConfirm'
).
click
(
function
()
{
$
(
'#confirm-modal'
).
modal
();
});
};
/** Template load notification content*/
TEMPLATE
.
loadNotificationSelect
=
function
(
elmentId
,
selectCallback
)
{
$
(
elmentId
).
load
(
"notificationContent.html"
,
function
()
{
TEMPLATE
.
loadNotificationSelect
=
function
(
elmentId
,
selectCallback
)
{
$
(
elmentId
).
load
(
'notificationContent.html'
,
function
()
{
NotificationSelect
.
init
(
selectCallback
);
I18N
.
initi18n
();
});
}
});
}
;
/**
* load main navs title html to a element by id
...
...
@@ -71,15 +68,15 @@ TEMPLATE.loadNotificationSelect = function(elmentId, selectCallback) {
* @param {string} titleLang - lang of title
* @param {Array} navs - array nav items (titleLang, href)
*/
TEMPLATE
.
loadMainNavsTitle
=
function
(
elmentId
,
titleLang
,
navs
,
completeCallback
)
{
var
titleHtmlPath
=
'../common/mainTitle.html'
;
TEMPLATE
.
loadMainNavsTitle
=
function
(
elmentId
,
titleLang
,
navs
,
completeCallback
)
{
var
titleHtmlPath
=
'../common/
html/
mainTitle.html'
;
if
(
navs
)
{
titleHtmlPath
=
'../common/mainNavTitle.html'
;
titleHtmlPath
=
'../common/
html/
mainNavTitle.html'
;
}
$
(
elmentId
).
load
(
titleHtmlPath
,
function
(
data
)
{
$
(
elmentId
).
load
(
titleHtmlPath
,
function
(
data
)
{
$
(
elmentId
).
replaceWith
(
data
);
if
(
titleLang
)
{
$
(
'#mainTitleHeader'
).
attr
(
"lang"
,
titleLang
);
$
(
'#mainTitleHeader'
).
attr
(
'lang'
,
titleLang
);
}
if
(
navs
)
{
var
olElm
=
$
(
'#mainTitleNavs ol'
);
...
...
@@ -109,4 +106,4 @@ TEMPLATE.loadNotificationSelect = function(elmentId, selectCallback) {
completeCallback
();
}
});
}
}
;
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