Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zjntServer
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
zjntServer
Commits
8d8d899c
Commit
8d8d899c
authored
Dec 29, 2024
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
e91e5d9f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
+33
-4
cyszhgl.ts
src/biz/cyszhgl.ts
+31
-4
router.ts
src/routers/router.ts
+2
-0
No files found.
src/biz/cyszhgl.ts
View file @
8d8d899c
...
...
@@ -137,14 +137,40 @@ export function getData(req, res) {
}
/**
* 种植种类
* 种植种类
/种植分布
*/
export
async
function
zzzl
(
req
,
res
)
{
let
{
type
}
=
req
.
body
;
let
excelData
=
cyszhglTableData
();
let
ret
:
any
=
{};
let
zzzlTableData
=
tablePackage
(
excelData
[
"种植种类"
].
headerList
[
0
],
excelData
[
"种植种类"
].
bodyList
);
ret
[
'zzzl'
]
=
getTableOut
(
'种植种类'
,
zzzlTableData
);
let
config
=
{
"叶菜类"
:{
"菠菜"
:
1
,
"芹菜"
:
1
,
"油菜(青菜)"
:
1
,
"大白菜"
:
1
,
"黄瓜"
:
1
,
"白萝卜"
:
1
,
"胡萝卜"
:
1
,
"土豆"
:
1
},
"茄果类"
:{
"茄子"
:
1
,
"西红柿"
:
1
,
"青椒(甜椒)"
:
1
,
"辣椒"
:
1
},
"花卉类"
:{
"多肉植物"
:
1
,
"蝴蝶兰"
:
1
,
"仙客来"
:
1
,
"绣球"
:
1
,
"四季草花"
:
1
,
"幸福树"
:
1
,
"发财树"
:
1
}
}
let
zzzlAllTableData
:
any
=
tablePackage
(
excelData
[
"种植种类"
].
headerList
[
0
],
excelData
[
"种植种类"
].
bodyList
);
// ret['zzzl'] = getTableOut( '种植种类', zzzlTableData);
let
keyMap
=
config
[
type
]
||
{};
let
zzzlTableDataList
=
[];
zzzlAllTableData
.
valueList
.
forEach
(
subList
=>
{
let
name
=
subList
[
0
]
if
(
keyMap
[
name
])
{
zzzlTableDataList
.
push
({
key
:
name
,
value
:
subList
[
1
]
||
"0株"
,
rate
:
subList
[
2
]
||
"0%"
});
}
});
ret
[
"zzzl"
]
=
zzzlTableDataList
;
res
.
send
(
ret
);
}
\ No newline at end of file
src/routers/router.ts
View file @
8d8d899c
...
...
@@ -38,6 +38,7 @@ export function setRouter(httpServer){
httpServer
.
get
(
'/weather'
,
asyncHandler
(
leftBiz
.
getData
));
httpServer
.
post
(
'/cyszhgl'
,
asyncHandler
(
cyszhglBiz
.
getData
));
httpServer
.
post
(
'/cyszhgl/zzzl'
,
asyncHandler
(
cyszhglBiz
.
zzzl
));
httpServer
.
post
(
'/gfny'
,
asyncHandler
(
gfnyBiz
.
getData
));
...
...
@@ -58,6 +59,7 @@ export function setRouter(httpServer){
//======get
httpServer
.
get
(
'/cyszhgl'
,
asyncHandler
(
cyszhglBiz
.
getData
));
httpServer
.
get
(
'/cyszhgl/zzzl'
,
asyncHandler
(
cyszhglBiz
.
zzzl
));
httpServer
.
get
(
'/gfny'
,
asyncHandler
(
gfnyBiz
.
getData
));
...
...
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