Browse Source

feat:统计出错,count改成sum

dev
zhaobing 1 year ago
parent
commit
66d7c1424d
  1. 4
      api/app/lib/controllers/data/vehicle.js
  2. 11
      web/client/src/sections/fillion/containers/maintenanceSpotCheck.js

4
api/app/lib/controllers/data/vehicle.js

@ -7,8 +7,8 @@ async function get(ctx) {
const { type } = ctx.request.body;
const { name } = ctx.query;
const sequelize = ctx.fs.dc.orm
const sqlStr = `select count(p.road_marking) 标线,count(p.roadside_ditch) 边沟,
count(p.guardrail) 护栏, count(p.roadside_trees) 行道树,count(p.wrong_lane) 错车道
const sqlStr = `select sum(p.road_marking) 标线,sum(p.roadside_ditch) 边沟,
sum(p.guardrail) 护栏, sum(p.roadside_trees) 行道树,sum(p.wrong_lane) 错车道
from (
select t.*,row_number() over (partition by t.luduan order by t.time desc ) rn from (
select code_road||'-'||road_section_start||'-'||road_section_end luduan,

11
web/client/src/sections/fillion/containers/maintenanceSpotCheck.js

@ -450,7 +450,7 @@ const MaintenanceSpotCheck = (props) => {
<Modal visible={vis} onCancel={cancelHandler} title='养护抽查' onOk={okHandler}>
<Form form={form}>
<Form.Item
label="抽取比例"
label="抽取比例(%)"
// name="percent"
rules={[{ required: true, message: '请填写抽取比例' }]}
>
@ -468,19 +468,18 @@ const MaintenanceSpotCheck = (props) => {
>
<Input style={{ width: '80%' }} placeholder="请输入抽取比例" />
</Form.Item>
<Form.Item
{/* <Form.Item
// name="percentSign"
noStyle
style={{ width: '20%', textAlign: 'center' }}
>
%
</Form.Item>
</Form.Item> */}
</Input.Group>
</Form.Item>
<Form.Item className="ant-row" >
<div style={{ display: 'flex', justifyContent: 'center' }}>
<Button type='primary' onClick={extractHandler}>开始抽取</Button>
</div>
<Button style={{ marginLeft: '40%' }} type='primary' onClick={extractHandler}>开始抽取</Button>
</Form.Item>
<Form.Item label='抽查总数' name='result'>
<Input disabled />

Loading…
Cancel
Save