Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdyServer
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node_server
sdyServer
Commits
f28c4089
Commit
f28c4089
authored
Jun 02, 2023
by
孙香冬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
84371176
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
0 deletions
+66
-0
.gitignore
.gitignore
+10
-0
jhjdData.ts
src/data/interface/jhjdData.ts
+56
-0
No files found.
.gitignore
0 → 100644
View file @
f28c4089
.idea
/out
/node_modules
/test
/public
/logs
/video
*test*
*.log
\ No newline at end of file
src/data/interface/jhjdData.ts
0 → 100644
View file @
f28c4089
import
{
changeListObjectToListByReflect
,
changeObjectKey
,
changeObjectToList
,
designativListKeyAddUnit
,
getDesignativByReflect
}
from
"../../dataPackage/interfaceAnalysis"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
getInterfaceByInterfaceName
}
from
"./cronJob"
;
function
changeDataProcess
(
interfaceName
,
interfaceData
,
config
)
{
let
result
=
{};
for
(
let
dataName
in
config
)
{
let
{
type
,
operationsType
,
reflect
,
unitInfo
}
=
config
[
dataName
];
let
fileData
=
interfaceData
[
dataName
];
let
fileType
=
typeof
fileData
;
let
dataIsArray
=
Array
.
isArray
(
fileData
);
if
(
(
type
==
"array"
&&
!
dataIsArray
)
||
(
type
==
"object"
&&
dataIsArray
)
||
(
type
==
"object"
&&
fileType
!=
"object"
)
||
(
type
!=
"array"
&&
fileType
!=
type
)
)
{
throw
new
BizError
(
`接口
${
interfaceName
}
中的
${
dataName
}
类型错误应该为
${
type
}
现在为
${
fileType
}
`
);
}
let
onceData
;
switch
(
operationsType
)
{
case
"object_ToList"
:
onceData
=
changeObjectToList
(
fileData
,
reflect
);
break
;
case
"object_changeKey"
:
onceData
=
changeObjectKey
(
fileData
,
reflect
);
break
;
case
"list_changeKey"
:
onceData
=
changeListObjectToListByReflect
(
fileData
,
reflect
);
break
;
}
if
(
unitInfo
)
onceData
=
designativListKeyAddUnit
(
onceData
,
unitInfo
);
result
[
dataName
]
=
onceData
;
}
return
result
;
}
function
jhjdInterfaceData
()
{
let
jhjdinterfaceName
=
"计划进度"
;
let
jhjdData
:
any
=
getInterfaceByInterfaceName
(
jhjdinterfaceName
);
/*
zjbl = 证件办理 ;
zjblxxxl = 证件办理详细线路 ;
dq = 动迁 ;
dqxxxl = 动迁详细线路 ;
yj = 移交 ;
yjxxxl = 移交详细线路 ;
*/
let
config
=
{
"zjbl"
:{
"type"
:
"object"
,
"operationsType"
:
"object_ToList"
,
"reflect"
:
""
,
"unitInfo"
:{}},
"zjblxxxl"
:{
"type"
:
"object"
,
"operationsType"
:
"object_ToList"
,
"reflect"
:
""
,
"unitInfo"
:{}},
"dq"
:{
"type"
:
"object"
,
"operationsType"
:
"object_ToList"
,
"reflect"
:
""
,
"unitInfo"
:{}},
"dqxxxl"
:{
"type"
:
"object"
,
"operationsType"
:
"object_ToList"
,
"reflect"
:
""
,
"unitInfo"
:{}},
"yj"
:{
"type"
:
"object"
,
"operationsType"
:
"object_ToList"
,
"reflect"
:
""
,
"unitInfo"
:{}},
"yjxxxl"
:{
"type"
:
"object"
,
"operationsType"
:
"object_ToList"
,
"reflect"
:
""
,
"unitInfo"
:{}}};
let
interfaceData
=
Object
.
assign
({},
jhjdData
);
let
changeData
=
changeDataProcess
(
'计划进度'
,
interfaceData
,
config
);
//todo 剩下的就是将excel定好的数据和interface的数据关联起来了
}
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