Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
design
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abookCheck
design
Commits
77868961
Commit
77868961
authored
Jul 20, 2021
by
Lee Munkyeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
検索機能のJavascript化
parent
6000dac6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
43 deletions
+51
-43
app/index.html
+1
-1
app/script/check.js
+50
-42
No files found.
app/index.html
View file @
77868961
...
...
@@ -113,7 +113,7 @@
<a
class=
"dropdown-item sort-type"
data-sort=
"3"
onclick=
"CHK.changeSortType(this);"
>
報告タイプ順
</a>
<a
class=
"dropdown-item sort-type"
data-sort=
"4"
onclick=
"CHK.changeSortType(this);"
>
閲覧日が新しい順
</a>
</div>
<a
href=
"javascript:CHK
_L.sendAppCommand('resetSearch'
);"
class=
"text-decoration-none py-2 lht-0 d-inline-block ml-3"
>
<a
href=
"javascript:CHK
.resetSearch(
);"
class=
"text-decoration-none py-2 lht-0 d-inline-block ml-3"
>
<i
class=
"fa fa-times text-dark"
></i>
<span
class=
"d-none d-md-inline text-dark fs-10"
>
リセット
...
...
app/script/check.js
View file @
77868961
...
...
@@ -392,10 +392,8 @@ CHK.initReportApp = function (callback) {
// 作業一覧JSONデータ
CHK
.
loadJson
(
CHK
.
jsonPath
.
operationList
,
function
(
json
)
{
CHK
.
operation
=
json
;
if
(
CHK
.
isAndroid
||
CHK
.
isIOS
)
{
$
(
'#operationTable'
).
empty
();
CHK
.
operation
.
searchOperationList
=
json
.
operationList
;
}
$
(
'#operationTable'
).
empty
();
CHK
.
operation
.
searchOperationList
=
json
.
operationList
;
//作業一覧描画
CHK
.
createOperationList
(
CHK
.
operation
.
operationList
);
});
...
...
@@ -409,7 +407,7 @@ CHK.initReportApp = function (callback) {
// 作業・カテゴリー関係JSONデータ
CHK
.
loadJson
(
CHK
.
jsonPath
.
operationGroupMasterRelationList
,
function
(
json
)
{
CHK
.
operationGroupMasterRelation
=
json
;
});
// コミュニケーションデータJSONデータ
...
...
@@ -2744,21 +2742,19 @@ CHK.showWhiteFrame = function() {
*/
CHK
.
createCategory
=
function
(
operationGroupMasterList
)
{
if
(
CHK
.
isAndroid
||
CHK
.
isIOS
)
{
$
(
'.group-category-list'
).
remove
();
$
(
"#groupMasterPath"
).
empty
();
if
(
typeof
CHK
.
operationGroupMasterId
==
'undefined'
||
CHK
.
operationGroupMasterId
==
0
)
{
$
(
"#groupMasterPath"
).
append
(
'<li class="breadcrumb-item"><a href="#" class="text-decoration-none text-dark">'
+
getMsg
(
"all"
)
+
'</a></li>'
);
}
else
{
var
groupMaster
=
operationGroupMasterList
.
filter
(
it
=>
it
.
operationGroupMasterId
==
CHK
.
operationGroupMasterId
)[
0
];
var
groupMasterPathIdlist
=
groupMaster
.
treePath
.
split
(
'/'
);
groupMasterPathIdlist
.
forEach
(
function
(
parentId
){
var
pathOperationGroupMaster
=
operationGroupMasterList
.
filter
(
it
=>
it
.
operationGroupMasterId
==
parentId
)[
0
];
$
(
"#groupMasterPath"
).
append
(
'<li class="breadcrumb-item"><a onclick="CHK.changeOperationGroupMaster('
+
pathOperationGroupMaster
.
operationGroupMasterId
+
');" class="text-decoration-none text-dark">'
+
pathOperationGroupMaster
.
operationGroupMasterName
+
'</a></li>'
);
});
}
$
(
'.group-category-list'
).
remove
();
$
(
"#groupMasterPath"
).
empty
();
if
(
typeof
CHK
.
operationGroupMasterId
==
'undefined'
||
CHK
.
operationGroupMasterId
==
0
)
{
$
(
"#groupMasterPath"
).
append
(
'<li class="breadcrumb-item"><a href="#" class="text-decoration-none text-dark">'
+
getMsg
(
"all"
)
+
'</a></li>'
);
}
else
{
var
groupMaster
=
operationGroupMasterList
.
filter
(
it
=>
it
.
operationGroupMasterId
==
CHK
.
operationGroupMasterId
)[
0
];
var
groupMasterPathIdlist
=
groupMaster
.
treePath
.
split
(
'/'
);
groupMasterPathIdlist
.
forEach
(
function
(
parentId
){
var
pathOperationGroupMaster
=
operationGroupMasterList
.
filter
(
it
=>
it
.
operationGroupMasterId
==
parentId
)[
0
];
$
(
"#groupMasterPath"
).
append
(
'<li class="breadcrumb-item"><a onclick="CHK.changeOperationGroupMaster('
+
pathOperationGroupMaster
.
operationGroupMasterId
+
');" class="text-decoration-none text-dark">'
+
pathOperationGroupMaster
.
operationGroupMasterName
+
'</a></li>'
);
});
}
//サイドメニューカテゴリー構造作成
...
...
@@ -2835,23 +2831,18 @@ CHK.createOperationList = function(operationList, isSearched = false) {
}
switch
(
sortType
)
{
case
CHK_CONSTANT
.
SORT_TYPE
.
NAME
:
console
.
log
(
sortType
);
operationList
.
sort
((
a
,
b
)
=>
(
a
.
operationName
>
b
.
operationName
)
?
1
:
-
1
);
break
;
case
CHK_CONSTANT
.
SORT_TYPE
.
START_DATE_DESC
:
console
.
log
(
sortType
);
operationList
.
sort
((
a
,
b
)
=>
(
setOperationDate
(
a
.
operationStartDate
)
<
setOperationDate
(
b
.
operationStartDate
))
?
1
:
-
1
);
break
;
case
CHK_CONSTANT
.
SORT_TYPE
.
START_DATE_ASC
:
console
.
log
(
sortType
);
operationList
.
sort
((
a
,
b
)
=>
(
setOperationDate
(
a
.
operationStartDate
)
>
setOperationDate
(
b
.
operationStartDate
))
?
1
:
-
1
);
break
;
case
CHK_CONSTANT
.
SORT_TYPE
.
TYPE
:
console
.
log
(
sortType
);
operationList
.
sort
((
a
,
b
)
=>
(
a
.
operationType
<
b
.
operationType
)
?
1
:
-
1
);
break
;
case
CHK_CONSTANT
.
SORT_TYPE
.
LAST_EDIT_DATE
:
console
.
log
(
sortType
);
operationList
.
sort
((
a
,
b
)
=>
(
a
.
lastEditDate
<
b
.
lastEditDate
)
?
1
:
-
1
);
break
;
}
...
...
@@ -2905,24 +2896,33 @@ CHK.search = function() {
var
searchKeyword
=
$
(
"#searchTaskName"
).
val
();
var
searchStartDate
=
$
(
"#searchStartDate"
).
val
();
var
searchEndDate
=
$
(
"#searchEndDate"
).
val
();
var
operationGroupMasterId
=
CHK
.
operationGroupMasterId
;
var
searchResult
;
if
(
CHK
.
isAndroid
)
{
searchResult
=
JSON
.
parse
(
android
.
searchOperationList
(
searchKeyword
,
searchStartDate
,
searchEndDate
,
CHK
.
operationGroupMasterId
));
CHK
.
isSearched
=
true
;
CHK
.
operation
.
searchOperationList
=
searchResult
.
operationList
;
CHK
.
createOperationList
(
searchResult
.
operationList
);
// TODO: カテゴリの保存
}
else
if
(
CHK
.
isIOS
)
{
searchResult
=
CHK_iOS
.
searchOperationList
(
searchKeyword
,
searchStartDate
,
searchEndDate
,
CHK
.
operationGroupMasterId
);
CHK
.
isSearched
=
true
;
CHK
.
operation
.
searchOperationList
=
searchResult
.
operationList
;
CHK
.
createOperationList
(
searchResult
.
operationList
);
webkit
.
messageHandlers
.
saveOperationGroupMaster
.
postMessage
(
CHK
.
operationGroupMasterId
);
let
searchButtonTaped
=
searchKeyword
!=
""
||
searchStartDate
!=
""
||
searchEndDate
!=
""
;
if
(
searchButtonTaped
)
{
webkit
.
messageHandlers
.
showSearchResultToast
.
postMessage
(
searchResult
.
operationList
.
length
);
}
}
searchResult
=
CHK
.
operation
.
operationList
.
filter
(
function
(
operation
)
{
var
result
=
true
;
if
(
searchKeyword
.
length
)
{
result
=
result
*
operation
.
operationName
.
includes
(
searchKeyword
);
}
if
(
searchStartDate
.
length
)
{
result
=
result
*
(
operation
.
operationEndDate
>=
searchStartDate
);
}
if
(
searchEndDate
.
length
)
{
result
=
result
*
(
operation
.
operationStartDate
<=
searchEndDate
);
}
if
(
operationGroupMasterId
!=
0
)
{
var
operationGroupMasterIdList
=
CHK
.
operationGroupMasterRelation
.
operationGroupMasterRelationList
.
filter
(
function
(
operationGroupMasterRelation
)
{
return
operationGroupMasterRelation
.
operationId
==
operation
.
operationId
;
})
result
=
result
*
operationGroupMasterIdList
.
filter
(
function
(
operationGroupMaster
){
return
operationGroupMaster
.
operationGroupMasterId
==
operationGroupMasterId
;
}).
length
;
}
return
result
;
})
CHK
.
isSearched
=
true
;
CHK
.
operation
.
searchOperationList
=
searchResult
;
CHK
.
createOperationList
(
searchResult
,
CHK
.
isSearched
);
};
/**
...
...
@@ -3009,4 +3009,11 @@ CHK.displayAlert = function(msgCode) {
$
(
"#alertMsg"
).
html
(
getMsg
(
msgCode
));
$
(
".alert-overlay"
).
removeClass
(
"d-none"
);
$
(
".alert-area"
).
removeClass
(
"d-none"
);
}
CHK
.
resetSearch
=
function
()
{
$
(
'#searchTaskName'
).
val
(
''
);
$
(
'#searchStartDate'
).
val
(
''
);
$
(
'#searchEndDate'
).
val
(
''
);
CHK
.
changeSortType
(
$
(
'#defaultSort'
));
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment