wangyue 2 years ago
parent
commit
a9d12cd869
  1. 4
      api/.vscode/launch.json
  2. 10
      api/app/lib/controllers/data/index.js
  3. 16
      api/app/lib/models/report.js
  4. 19
      jenkinsfile_script_init_report_pic_data
  5. 7
      scripts/0.0.1/data/3_init_report_pic_data/Dockerfile
  6. 1
      web/client/src/sections/fillion/components/infor/videoUpload.js
  7. 11
      web/client/src/sections/fillion/components/maintenanceTable.js
  8. 11
      web/client/src/sections/fillion/components/patrolTable.js
  9. 16
      web/client/src/sections/fillion/containers/maintenance.js
  10. 16
      web/client/src/sections/fillion/containers/patrol.js
  11. 2
      web/package.json

4
api/.vscode/launch.json

@ -13,8 +13,8 @@
"NODE_ENV": "development"
},
"args": [
"-p 14000",
"-f http://localhost:14000",
"-p 4000",
"-f http://localhost:4000",
"-g postgres://postgres:123@10.8.30.32:5432/highways4good",
"--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5",
"--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa",

10
api/app/lib/controllers/data/index.js

@ -55,6 +55,16 @@ async function dataExport (ctx) {
k: 'busCar',
tableName: 'BusCar',
},
{
n: '巡更记录',
k: 'patrol',
tableName: 'Report',
},
{
n: '养护记录',
k: 'maintenance',
tableName: 'Report',
},
]
const modalOption = modalList.find(item => item.k == exp);

16
api/app/lib/models/report.js

@ -41,7 +41,7 @@ module.exports = dc => {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
comment: '所属道路',
primaryKey: false,
field: "road",
autoIncrement: false
@ -51,7 +51,7 @@ module.exports = dc => {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
comment: '开始路段',
primaryKey: false,
field: "road_section_start",
autoIncrement: false
@ -61,7 +61,7 @@ module.exports = dc => {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
comment: '结束路段',
primaryKey: false,
field: "road_section_end",
autoIncrement: false
@ -71,7 +71,7 @@ module.exports = dc => {
type: DataTypes.DOUBLE,
allowNull: true,
defaultValue: null,
comment: null,
comment: '经度',
primaryKey: false,
field: "longitude",
autoIncrement: false
@ -81,7 +81,7 @@ module.exports = dc => {
type: DataTypes.DOUBLE,
allowNull: true,
defaultValue: null,
comment: null,
comment: '纬度',
primaryKey: false,
field: "latitude",
autoIncrement: false
@ -91,7 +91,7 @@ module.exports = dc => {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
comment: '具体内容',
primaryKey: false,
field: "content",
autoIncrement: false
@ -151,7 +151,7 @@ module.exports = dc => {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
comment: null,
comment: '创建日期',
primaryKey: false,
field: "time",
autoIncrement: false
@ -161,7 +161,7 @@ module.exports = dc => {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
comment: '具体位置',
primaryKey: false,
field: "address",
autoIncrement: false

19
jenkinsfile_script_init_report_pic_data

@ -0,0 +1,19 @@
pipeline {
agent {
node{
label 'jnlp-slave'
}
}
stages {
stage('Highways4Good Api ......') {
steps {
sh 'switch-auth.sh anxinyun'
buildName "#${BUILD_NUMBER} ~/fs-cloud/${JOB_NAME}:${IMAGE_VERSION}"
buildDescription "registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}"
sh 'docker build -t registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION} ./scripts/0.0.1/data/3_init_report_pic_data'
sh 'docker push registry.cn-hangzhou.aliyuncs.com/${CLOUD}/${JOB_NAME}:${IMAGE_VERSION}'
}
}
}
}

7
scripts/0.0.1/data/3_init_report_pic_data/Dockerfile

@ -0,0 +1,7 @@
FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2
COPY . /var/app
WORKDIR /var/app
CMD ["node", "index.js"]

1
web/client/src/sections/fillion/components/infor/videoUpload.js

@ -36,6 +36,7 @@ const VideoUpload = (props) => {
setCounts(res.payload.data)
})
})
form.resetFields()
setIsModalVisible(false);
}
);

11
web/client/src/sections/fillion/components/maintenanceTable.js

@ -201,7 +201,7 @@ const PatrolNameList = (props) => {
}, [userList])
const columns = [
{
title: '巡更人员',
title: '养护人员',
key: 'name',
dataIndex: 'name',
align: 'center'
@ -301,6 +301,13 @@ const MaintenanceTable = (props) => {
dispatch(getReportList(query));
}
const handleExport = () => {
if (reportList && reportList instanceof Array && reportList.length) {
let ids = reportList.map(item => item.id);
exports(ids);
}
}
return (
<div className='card-protable'>
<Card >
@ -310,7 +317,7 @@ const MaintenanceTable = (props) => {
<div style={{ marginBottom: 20 }}>
<RangePicker onChange={(date, dateString) => { setDateRange(dateString) }} />
<Button style={{ marginLeft: 20 }}>查询</Button>
<Button style={{ marginLeft: 20 }}>导出</Button>
<Button style={{ marginLeft: 20 }} onClick={handleExport}>导出</Button>
</div>
<Card style={{ flex: 1 }}>
<DetailList reportList={reportList} record={record} loading={reportListLoading} dispatch={dispatch} handleOpen={handleOpen} />

11
web/client/src/sections/fillion/components/patrolTable.js

@ -267,7 +267,7 @@ const PatrolNameList = (props) => {
const PatrolTable = (props) => {
const { userList, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading } = props;
const { userList, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports } = props;
const [record, setRecord] = useState();
const [dateRange, setDateRange] = useState();
const [detailVisible, setDetailVisible] = useState(false)
@ -345,6 +345,13 @@ const PatrolTable = (props) => {
setRecord(target);
}
const handleExport = () => {
if (reportList && reportList instanceof Array && reportList.length) {
let ids = reportList.map(item => item.id);
exports(ids);
}
}
return (
<div className='card-protable'>
<Card >
@ -366,7 +373,7 @@ const PatrolTable = (props) => {
activeTabKey1 == 'tab1' ? <div style={{ marginBottom: 20 }}>
<RangePicker onChange={(date, dateString) => { setDateRange(dateString) }} />
<Button style={{ marginLeft: 20 }}>查询</Button>
<Button style={{ marginLeft: 20 }}>导出</Button>
<Button style={{ marginLeft: 20 }} onClick={handleExport} >导出</Button>
</div> : ''
}
{contentList[activeTabKey1]}

16
web/client/src/sections/fillion/containers/maintenance.js

@ -22,18 +22,10 @@ const Maintenance = (props) => {
//批量导出
const exports = (ids, counts) => {
// console.log(user);
let reportIds = [];
if (ids.length)
reportIds = ids
else
reportIds = (counts || {}).ids || [];
superagent.post('/_report/http')
.send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
const resTextIs = res.text.split('/').pop()
window.open(
'/_api/' +
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
})
let reportIds = ids.toString();
window.open(
'/_api/' +
`data/export?exp=patrol&ids=${reportIds}&token=${user.token}`)
}
return (
<> <MaintenanceTable data={data} exports={exports} />

16
web/client/src/sections/fillion/containers/patrol.js

@ -20,18 +20,10 @@ const patrol = (props) => {
//批量导出
const exports = (ids, counts) => {
// console.log(user);
let reportIds = [];
if (ids.length)
reportIds = ids
else
reportIds = (counts || {}).ids || [];
superagent.post('/_report/http')
.send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
const resTextIs = res.text.split('/').pop()
window.open(
'/_api/' +
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
})
let reportIds = ids.toString();
window.open(
'/_api/' +
`data/export?exp=patrol&ids=${reportIds}&token=${user.token}`)
}
return (
<> <PatrolTable data={data} exports={exports} />

2
web/package.json

@ -6,7 +6,7 @@
"scripts": {
"test": "mocha",
"start": "cross-env NODE_ENV=development npm run start-params",
"start-params": "node server -p 5000 -u http://localhost:14000 --qndmn http://rfkimpwbb.hn-bkt.clouddn.com",
"start-params": "node server -p 5000 -u http://localhost:4000 --qndmn http://rfkimpwbb.hn-bkt.clouddn.com",
"deploy": "export NODE_ENV=production&&npm run color && npm run build && node server",
"build-dev": "export NODE_ENV=development&&webpack --config webpack.config.js",
"build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js",

Loading…
Cancel
Save