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
5175b176
Commit
5175b176
authored
Oct 12, 2022
by
Takumi Imai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'feature/1.0_check_web_dev' into feature/1.0_check_web_dev_imai
# Conflicts: # abvw/common/js/appCommon/constant.js
parent
7284ccb8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
40 deletions
+50
-40
abvw/common/js/appCommon/check-common.js
+12
-10
abvw/common/js/appCommon/constant.js
+0
-10
abvw/js/operationList/operationList.js
+38
-20
No files found.
abvw/common/js/appCommon/check-common.js
View file @
5175b176
...
...
@@ -203,10 +203,9 @@ CHK_Common.getUrlParameter = function () {
* @returns sid
*/
CHK_Common
.
getSid
=
function
()
{
return
ClientData
.
userInfo_sid
();
return
ClientData
.
userInfo_sid
();
};
/**
* cms communication
*
...
...
@@ -216,29 +215,32 @@ CHK_Common.getSid = function () {
* @param {Object} callback
* @param {Object} errorCallback
*/
CHK_Common
.
cmsAjax
=
function
(
url
,
param
,
async
=
true
,
type
,
dataType
,
callback
,
errorCallback
)
{
CHK_Common
.
cmsAjax
=
function
(
url
,
param
,
async
=
true
,
callback
,
errorCallback
)
{
var
sysSettings
=
AVWEB
.
avwSysSetting
();
if
(
url
)
{
$
.
ajax
({
type
:
type
,
type
:
'post'
,
url
:
url
,
data
:
param
,
dataType
:
dataType
,
dataType
:
'json'
,
cache
:
false
,
async
:
async
,
crossDomain
:
true
,
beforeSend
:
function
(
xhr
)
{
beforeSend
:
function
(
xhr
)
{
xhr
.
setRequestHeader
(
'X-AGT-AppId'
,
sysSettings
.
appName
);
xhr
.
setRequestHeader
(
'X-AGT-AppVersion'
,
sysSettings
.
appVersion
);
},
success
:
function
(
result
)
{
if
(
result
.
s
tatus
==
'200'
)
{
if
(
result
.
httpS
tatus
==
'200'
)
{
if
(
callback
)
callback
(
result
);
}
else
if
(
result
.
status
==
'401'
)
{
CHK_Common
.
goUrlWithCurrentParams
(
CHK_CONSTANT
.
PAGE_NAME
.
LOGIN
);
}
else
if
(
errorCallback
)
{
errorCallback
();
}
else
if
(
result
.
httpStatus
==
'401'
)
{
CHK_Common
.
goUrlWithCurrentParams
(
CHK_CONSTANT
.
PAGE_NAME
.
LOGIN
);
}
else
if
(
result
.
httpStatus
==
'403'
)
{
CHK_Common
.
closeLoading
();
CHK_Common
.
displayAlert
(
'errorOccurred'
);
}
else
{
CHK_Common
.
closeLoading
();
CHK_Common
.
displayAlert
(
result
.
message
);
...
...
@@ -299,7 +301,7 @@ CHK_Common.checkAuth = function (async = true) {
params
.
sid
=
CHK_Common
.
getSid
;
var
urlPath
=
ClientData
.
userInfo_accountPath
();
const
url
=
CHK_CONSTANT
.
URL
.
BASE_CMS
+
urlPath
+
CHK_CONSTANT
.
URL
.
BASE_CHECKAPI
+
CHK_CONSTANT
.
URL
.
AUTH_SESSION
;
CHK_Common
.
cmsAjax
(
url
,
params
,
async
,
CONSTANT
.
API_TYPE
.
GET
,
CONSTANT
.
DATA_TYPE
.
TEXT
,
function
()
{
CHK_Common
.
cmsAjax
(
url
,
params
,
async
,
null
,
function
()
{
CHK_Common
.
goUrlWithCurrentParams
(
CHK_CONSTANT
.
PAGE_NAME
.
LOGIN
);
});
};
abvw/common/js/appCommon/constant.js
View file @
5175b176
...
...
@@ -54,16 +54,6 @@ CHK_CONSTANT.URL = {
AUTH_SESSION
:
'getSession/checkAuthUser'
,
};
CONSTANT
.
API_TYPE
=
{
POST
:
'post'
,
GET
:
'get'
}
CONSTANT
.
DATA_TYPE
=
{
TEXT
:
'text'
,
JSON
:
'json'
,
}
CHK_CONSTANT
.
LANG
=
{
SAVE_NAME
:
'lang'
,
JAPAN
:
'ja'
,
...
...
abvw/js/operationList/operationList.js
View file @
5175b176
...
...
@@ -48,20 +48,19 @@ CHK_OL.init = function () {
CHK_OL
.
getAllDataWeb
=
function
(
searchKeyword
,
sortIndex
,
searchStartDate
,
searchEndDate
,
operationGroupMasterId
)
{
let
param
=
{};
param
.
sid
=
CHK_Common
.
getSid
();
param
.
operation
GroupMasterId
=
searchKeyword
;
param
.
operation
Name
=
searchKeyword
;
param
.
sort
=
sortIndex
;
param
.
startDate
=
searchStartDate
;
param
.
endDate
=
searchEndDate
;
param
.
operationGroupMasterId
=
operationGroupMasterId
;
const
url
=
CHK_CONSTANT
.
URL
.
BASE_CMS
+
ClientData
.
userInfo_accountPath
()
+
CHK_CONSTANT
.
URL
.
BASE_CHECKAPI
+
CHK_CONSTANT
.
URL
.
ALL_OPERATION_LIST
;
CHK_Common
.
cmsAjax
(
url
,
param
,
false
,
CONSTANT
.
API_TYPE
.
GET
,
CONSTANT
.
DATA_TYPE
.
JSON
,
function
(
json
)
{
CHK_Common
.
cmsAjax
(
url
,
param
,
false
,
function
(
json
)
{
CHK_OL
.
operationList
=
json
.
operationList
;
CHK_OL
.
operationGroupMaster
=
json
.
operationGroupMasterList
;
CHK_OL
.
isOperationGroupMaster
=
json
.
isOperationGroupMaster
;
CHK_OL
.
operationSearchCriteria
=
json
.
operationSearchCriteria
;
CHK_OL
.
setSearchInfoWeb
();
console
.
log
(
'json.operationList'
,
JSON
.
stringify
(
json
.
operationList
));
});
};
...
...
@@ -173,6 +172,7 @@ CHK_OL.initCategory = function () {
}
$
(
'#operationGroupMasterButton'
).
removeClass
(
'd-none'
);
CHK_OL
.
setCategoryHeight
();
$
(
window
).
resize
(
function
()
{
CHK_OL
.
setCategoryHeight
();
});
...
...
@@ -201,15 +201,14 @@ CHK_OL.createBreadcrumbList = function () {
if
(
typeof
CHK_OL
.
operationGroupMasterId
==
'undefined'
||
CHK_OL
.
operationGroupMasterId
==
0
)
{
$
(
'#groupMasterPath'
).
append
(
'<li class="breadcrumb-item"><a href="#" class="text-decoration-none text-dark">'
+
CHK_Common
.
getMsg
(
'all'
)
+
'</a></li>'
);
}
else
{
const
groupMaster
=
CHK_OL
.
operationGroupMaster
.
filter
(
it
=>
it
.
operationGroupMasterId
==
CHK_OL
.
operationGroupMasterId
)[
0
];
const
groupMasterPathIdlist
=
groupMaster
.
treePath
.
split
(
'/'
);
groupMasterPathIdlist
.
forEach
(
function
(
parentId
)
{
const
pathOperationGroupMaster
=
CHK_OL
.
operationGroupMaster
.
filter
(
it
=>
it
.
operationGroupMasterId
==
parentId
)[
0
];
let
treeList
=
[];
CHK_OL
.
createBreadcrumbTree
(
treeList
,
CHK_OL
.
operationGroupMasterId
);
treeList
.
forEach
(
function
(
operationGroupMaster
)
{
$
(
'#groupMasterPath'
).
append
(
'<li class="breadcrumb-item"><a onclick="CHK_OL.changeOperationGroupMaster('
+
pathO
perationGroupMaster
.
operationGroupMasterId
+
o
perationGroupMaster
.
operationGroupMasterId
+
');" class="text-decoration-none text-dark">'
+
pathO
perationGroupMaster
.
operationGroupMasterName
+
o
perationGroupMaster
.
operationGroupMasterName
+
'</a></li>'
,
);
});
...
...
@@ -217,6 +216,24 @@ CHK_OL.createBreadcrumbList = function () {
};
/**
* create Breadcrumb tree List
*
* @param {list} treeList
* @param {string} operationGroupMasterId
* @returns
*/
CHK_OL
.
createBreadcrumbTree
=
function
(
treeList
,
operationGroupMasterId
)
{
if
(
operationGroupMasterId
==
0
)
{
return
treeList
;
}
const
groupMaster
=
CHK_OL
.
operationGroupMaster
.
filter
(
it
=>
it
.
operationGroupMasterId
==
operationGroupMasterId
)[
0
];
CHK_OL
.
createBreadcrumbTree
(
treeList
,
groupMaster
.
parentOperationGroupMasterId
);
treeList
.
push
(
groupMaster
);
return
treeList
;
};
/**
* create category(operationGroupMaster) structure
*/
CHK_OL
.
createCategoryList
=
function
()
{
...
...
@@ -233,9 +250,7 @@ CHK_OL.createCategoryList = function () {
});
//common
const
noCategory
=
$
(
"<dl id='groupMasterId_0' class='group-category-list'><dt><a onclick='CHK_OL.changeOperationGroupMaster(0);'>"
+
CHK_Common
.
getMsg
(
CHK_CONSTANT
.
MSG_MAP
.
all
)
+
'</a></dt></dl>'
,
);
const
noCategory
=
$
(
"<dl id='groupMasterId_0' class='group-category-list'><dt><a onclick='CHK_OL.changeOperationGroupMaster(0);'>"
+
CHK_Common
.
getMsg
(
'all'
)
+
'</a></dt></dl>'
);
$
(
'#category-menu'
).
append
(
noCategory
);
//create category(operationGroupMaster) structure
...
...
@@ -316,17 +331,19 @@ CHK_OL.changeSortType = function (sortType) {
$
(
'.sort-type'
).
removeClass
(
'active'
);
$
(
sortType
).
addClass
(
'active'
);
CHK_OL
.
sortIndex
=
$
(
sortType
).
attr
(
'data-sort'
);
CHK_OL
.
sortOperationList
(
sortType
);
const
sortStr
=
sortType
.
dataset
.
sort
;
const
sortNumber
=
parseFloat
(
sortStr
);
CHK_OL
.
sortOperationList
(
sortNumber
);
CHK_OL
.
createOperationList
(
CHK_OL
.
operationList
);
};
/**
* sort the operationList
*
* @param {Number} sort
Type
* @param {Number} sort
Number
*/
CHK_OL
.
sortOperationList
=
function
(
sort
Type
)
{
switch
(
sort
Type
)
{
CHK_OL
.
sortOperationList
=
function
(
sort
Number
)
{
switch
(
sort
Number
)
{
case
CHK_CONSTANT
.
SORT_TYPE
.
NAME
:
CHK_OL
.
operationList
.
sort
(
function
(
a
,
b
)
{
if
(
a
.
operationName
>
b
.
operationName
)
return
1
;
...
...
@@ -336,15 +353,15 @@ CHK_OL.sortOperationList = function (sortType) {
break
;
case
CHK_CONSTANT
.
SORT_TYPE
.
START_DATE_DESC
:
CHK_OL
.
operationList
.
sort
(
function
(
a
,
b
)
{
if
(
setOperationDate
(
a
.
operationStartDate
)
<
setOperationDate
(
b
.
operationStartDate
))
return
1
;
if
(
setOperationDate
(
a
.
operationStartDate
)
>
setOperationDate
(
b
.
operationStartDate
))
return
-
1
;
if
(
CHK_OL
.
setOperationDate
(
a
.
operationStartDate
)
<
CHK_OL
.
setOperationDate
(
b
.
operationStartDate
))
return
1
;
if
(
CHK_OL
.
setOperationDate
(
a
.
operationStartDate
)
>
CHK_OL
.
setOperationDate
(
b
.
operationStartDate
))
return
-
1
;
return
0
;
});
break
;
case
CHK_CONSTANT
.
SORT_TYPE
.
START_DATE_ASC
:
CHK_OL
.
operationList
.
sort
(
function
(
a
,
b
)
{
if
(
setOperationDate
(
a
.
operationStartDate
)
>
setOperationDate
(
b
.
operationStartDate
))
return
1
;
if
(
setOperationDate
(
a
.
operationStartDate
)
<
setOperationDate
(
b
.
operationStartDate
))
return
-
1
;
if
(
CHK_OL
.
setOperationDate
(
a
.
operationStartDate
)
>
CHK_OL
.
setOperationDate
(
b
.
operationStartDate
))
return
1
;
if
(
CHK_OL
.
setOperationDate
(
a
.
operationStartDate
)
<
CHK_OL
.
setOperationDate
(
b
.
operationStartDate
))
return
-
1
;
return
0
;
});
break
;
...
...
@@ -389,6 +406,7 @@ CHK_OL.search = function () {
CHK_OL
.
getAllDataWeb
(
searchKeyword
,
CHK_OL
.
sortIndex
,
searchStartDate
,
searchEndDate
,
CHK_OL
.
operationGroupMasterId
);
CHK_OL
.
createOperationList
(
CHK_OL
.
operationList
);
CHK_OL
.
createCategory
();
CHK_Common
.
closeLoading
();
};
...
...
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