dengyinhuan 3 years ago
parent
commit
198c57d84d
  1. 2
      api/.vscode/launch.json
  2. 20
      api/app/lib/controllers/data/index.js
  3. 1
      api/app/lib/controllers/organization/department.js
  4. 13
      api/app/lib/controllers/report/index.js
  5. 20
      api/app/lib/models/report.js
  6. 4
      api/config.js
  7. 29
      api/log/development.log
  8. 29
      api/utils/xlsxDownload.js
  9. 19
      jenkinsfile_script_init_report_pic_data
  10. 11
      scripts/0.0.1/data/3_init_report_pic_data/Dockerfile
  11. 29
      scripts/0.0.1/data/3_init_report_pic_data/index.js
  12. 10
      scripts/0.0.1/data/4_file_type_data.sql
  13. 18
      weapp/src/config.js
  14. 154
      weapp/src/packages/patrol/index.jsx
  15. 4
      weapp/src/pages/home/index.jsx
  16. 4
      weapp/src/pages/user/index.jsx
  17. 5
      weapp/src/services/api.js
  18. 6
      web/client/src/sections/fillion/actions/infor.js
  19. 8
      web/client/src/sections/fillion/components/bridgeTable.js
  20. 5
      web/client/src/sections/fillion/components/gis/patrolGis.js
  21. 4
      web/client/src/sections/fillion/components/highwaysTable.js
  22. 32
      web/client/src/sections/fillion/components/infor/videoUpload.js
  23. 17
      web/client/src/sections/fillion/components/inforTable.js
  24. 72
      web/client/src/sections/fillion/components/maintenanceTable.js
  25. 25
      web/client/src/sections/fillion/components/operationalTable.js
  26. 94
      web/client/src/sections/fillion/components/patrolTable.js
  27. 3
      web/client/src/sections/fillion/components/protable.less
  28. 10
      web/client/src/sections/fillion/components/publicTable.js
  29. 16
      web/client/src/sections/fillion/components/transportationTable.js
  30. 16
      web/client/src/sections/fillion/containers/maintenance.js
  31. 16
      web/client/src/sections/fillion/containers/patrol.js
  32. 22
      web/client/src/sections/fillion/containers/public.js
  33. 2
      web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js
  34. 4
      web/client/src/sections/quanju/containers/footer/leadership/centerleft/handong.js
  35. 2
      web/client/src/sections/quanju/containers/footer/leadership/centerleft/qiqoliang.js
  36. 2
      web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js
  37. 2
      web/client/src/sections/quanju/containers/footer/leadership/left/echarts/lefttopecharts.js
  38. 8
      web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js
  39. 26
      web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js
  40. 2
      web/client/src/sections/quanju/containers/footer/leadership/right/hudong.js
  41. 16
      web/client/src/sections/quanju/containers/footer/leadership/right/right-top.js
  42. 42
      web/client/src/sections/quanju/containers/footer/operation/right.js
  43. 2
      web/config.js
  44. 2
      web/package.json
  45. 14
      web/routes/attachment/index.js

2
api/.vscode/launch.json

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

20
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);
@ -79,9 +89,13 @@ async function dataExport (ctx) {
const tableAttributes = models[modalOption.tableName].tableAttributes
let header = []
for (let k in tableAttributes) {
if (k != 'id' && tableAttributes[k].comment) {
const comment = tableAttributes[k].comment
if (k != 'id' && comment) {
if (comment == '品名' && municipalType == '出租车') {
continue
}
header.push({
title: tableAttributes[k].comment || '-',
title: comment || '-',
key: k,
index: tableAttributes[k].index,
})
@ -90,7 +104,7 @@ async function dataExport (ctx) {
header.sort((a, b) => { return a.index - b.index })
const fileName = `${modalOption.n}_${moment().format('YYYYMMDDHHmmss')}` + '.csv'
const filePath = await xlsxDownload.simpleExcelDown({ data: exportData, header, fileName: fileName })
const filePath = await xlsxDownload.simpleExcelDown({ data: exportData, header, fileName: fileName, exp })
const fileData = fs.readFileSync(filePath);
ctx.status = 200;

1
api/app/lib/controllers/organization/department.js

@ -89,6 +89,7 @@ async function editDep (ctx) {
where: {
dependence: dependence || null,
name: name,
delete: false,
}
})
if (repeatNameCount) {

13
api/app/lib/controllers/report/index.js

@ -1,10 +1,10 @@
'use strict';
const { QueryTypes } = require('sequelize');
async function reportList(ctx) {
async function reportList (ctx) {
try {
const models = ctx.fs.dc.models;
const { limit, page, startTime, endTime, keyword, userId, reportType, isTop } = ctx.query
const { limit, page, startTime, endTime, keyword, userId, reportType, isTop, asc } = ctx.query
let findOption = {
where: {
@ -14,6 +14,7 @@ async function reportList(ctx) {
model: models.User,
attributes: ['name']
}],
order: [['time', asc ? 'ASC': 'DESC']],
}
if (limit) {
findOption.limit = limit
@ -60,7 +61,7 @@ async function reportList(ctx) {
}
}
async function reportPosition(ctx) {
async function reportPosition (ctx) {
try {
const models = ctx.fs.dc.models;
const { startTime, endTime, userId, reportType } = ctx.query
@ -110,7 +111,7 @@ async function reportPosition(ctx) {
}
}
async function reportDetail(ctx) {
async function reportDetail (ctx) {
try {
const models = ctx.fs.dc.models;
const { reportId } = ctx.params
@ -132,7 +133,7 @@ async function reportDetail(ctx) {
}
}
async function createReport(ctx) {
async function createReport (ctx) {
try {
const { userId } = ctx.fs.api
const models = ctx.fs.dc.models;
@ -154,7 +155,7 @@ async function createReport(ctx) {
}
}
async function deleteReport(ctx) {
async function deleteReport (ctx) {
try {
const models = ctx.fs.dc.models;
const { reportId } = ctx.params;

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

@ -21,7 +21,7 @@ module.exports = dc => {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "上报类型 巡查:patrol / 养护:conserve",
comment: "上报类型",
primaryKey: false,
field: "report_type",
autoIncrement: false
@ -31,7 +31,7 @@ module.exports = dc => {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "工程类型 道路:road / 桥梁:birdge / 涵洞:culvert",
comment: "工程类型",
primaryKey: false,
field: "project_type",
autoIncrement: false
@ -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

4
api/config.js

@ -23,7 +23,7 @@ const flags = args.parse(process.argv);
const FS_UNIAPP_DB = process.env.FS_UNIAPP_DB || flags.pg;
// const LOCAL_SVR_ORIGIN = process.env.LOCAL_SVR_ORIGIN || flags.fileHost;
const QINIU_DOMAIN_QNDMN_RESOURCE = process.env.ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURC || flags.qndmn;
const QINIU_DOMAIN_QNDMN_RESOURCE = process.env.ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE || flags.qndmn;
const QINIU_BUCKET_RESOURCE = process.env.ANXINCLOUD_QINIU_BUCKET_RESOURCE || flags.qnbkt;
const QINIU_AK = process.env.ANXINCLOUD_QINIU_ACCESSKEY || flags.qnak;
const QINIU_SK = process.env.ANXINCLOUD_QINIU_SECRETKEY || flags.qnsk;
@ -52,7 +52,7 @@ const product = {
accessKey: QINIU_AK,
secretKey: QINIU_SK
},
maxSize: 104857600, // 100M
maxSize: 104857600 * 2, // 100M * 2
}
}, {
entry: require('./app').entry,

29
api/log/development.log

@ -10668,3 +10668,32 @@ headers: {}
2022-07-30 12:38:46.294 - debug: [FS-LOGGER] Init.
2022-07-30 12:38:46.394 - info: [FS-ATTACHMENT] Inject attachment mw into router.
2022-07-30 12:38:46.394 - info: [FS-AUTH] Inject auth and api mv into router.
2022-07-30 14:19:21.439 - debug: [FS-LOGGER] Init.
2022-07-30 14:19:21.547 - info: [FS-ATTACHMENT] Inject attachment mw into router.
2022-07-30 14:19:21.547 - info: [FS-AUTH] Inject auth and api mv into router.
2022-07-30 14:30:16.777 - error: path: /publicity, error: Error: Invalid value {
uid: -1659162615,
name: 'video.mp4',
status: 'done',
storageUrl: 'project/45017725-be73-4ec7-99a5-f57c2fde5682/video.mp4',
url: 'http://rfkimpwbb.hn-bkt.clouddn.com/project/45017725-be73-4ec7-99a5-f57c2fde5682/video.mp4',
size: 2172089
}
2022-07-30 14:30:47.375 - error: path: /publicity, error: Error: Invalid value {
uid: -1659162647,
name: 'video.mp4',
status: 'done',
storageUrl: 'project/ec692a52-13e2-4bd1-80fb-5cae1386c782/video.mp4',
url: 'http://rfkimpwbb.hn-bkt.clouddn.com/project/ec692a52-13e2-4bd1-80fb-5cae1386c782/video.mp4',
size: 2172089
}
2022-07-30 16:53:41.602 - error: path: /data/export, error: 参数错误
2022-07-30 16:59:14.475 - debug: [FS-LOGGER] Init.
2022-07-30 16:59:14.573 - info: [FS-ATTACHMENT] Inject attachment mw into router.
2022-07-30 16:59:14.573 - info: [FS-AUTH] Inject auth and api mv into router.
2022-07-30 17:19:58.438 - debug: [FS-LOGGER] Init.
2022-07-30 17:19:58.538 - info: [FS-ATTACHMENT] Inject attachment mw into router.
2022-07-30 17:19:58.539 - info: [FS-AUTH] Inject auth and api mv into router.
2022-07-30 17:48:40.061 - debug: [FS-LOGGER] Init.
2022-07-30 17:48:40.152 - info: [FS-ATTACHMENT] Inject attachment mw into router.
2022-07-30 17:48:40.152 - info: [FS-AUTH] Inject auth and api mv into router.

29
api/utils/xlsxDownload.js

@ -16,7 +16,7 @@ async function makeDir (dir) {
}
}
async function simpleExcelDown ({ data = [], header = [], fileName = moment().format('YYYY-MM-DD HH:mm:ss') } = {}) {
async function simpleExcelDown ({ data = [], header = [], fileName = moment().format('YYYY-MM-DD HH:mm:ss'), exp } = {}) {
const fileDirPath = path.join(__dirname, `../../downloadFiles`)
makeDir(fileDirPath)
const file = new xlsx.File();
@ -57,6 +57,33 @@ async function simpleExcelDown ({ data = [], header = [], fileName = moment().fo
for (let h of header) {
const cell = row.addCell();
cell.value = data[i][h.key];
if (exp == 'patrol' || exp == 'maintenance') {
if (h.key == 'projectType') {
let type = data[i][h.key]
if (type == 'road') {
cell.value = '道路'
} else if (type == 'bridge') {
cell.value = '桥梁'
} else if (type == 'culvert') {
cell.value = '涵洞'
} else if (type == 'other') {
cell.value = '其他'
}
continue
}
if (h.key == 'reportType') {
let type = data[i][h.key]
if (type == 'patrol') {
cell.value = '巡查'
} else if (type == 'conserve') {
cell.value = '养护'
}
continue
}
}
cell.style = style
}
}

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}'
}
}
}
}

11
scripts/0.0.1/data/3_init_report_pic_data/Dockerfile

@ -0,0 +1,11 @@
FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2
COPY . /var/app
WORKDIR /var/app
RUN npm cache clean -f
RUN rm -rf package-lock.json
RUN npm install --registry http://10.8.30.22:7000
CMD ["node", "index.js"]

29
scripts/0.0.1/data/3_init_report_pic_data/index.js

@ -9,18 +9,31 @@ try {
const qiniu = require('qiniu');
const uuidv4 = require('uuid/v4');
// 连接数据库
// 测试环境
// const pool = new Pool({
// user: 'FashionAdmin',
// host: '10.8.30.156',
// database: 'highway4goodn0728',
// password: '123456',
// port: 5432,
// })
// // 7niu 验证
// const accessKey = '5XrM4wEB9YU6RQwT64sPzzE6cYFKZgssdP5Kj3uu'
// const secretKey = 'w6j2ixR_i-aelc6I7S3HotKIX-ukMzcKmDfH6-M5'
// const bucket = 'anxinyun-test'
// 商用环境
const pool = new Pool({
user: 'postgres',
host: '10.8.30.32',
database: 'highways4good',
password: '123',
user: 'highwayadmin',
host: '10.8.40.223',
database: 'highway4good',
password: 'highway123',
port: 5432,
})
// 7niu 验证
const accessKey = 'XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5'
const secretKey = 'yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa'
const bucket = 'dev-highways4good'
const accessKey = '5XrM4wEB9YU6RQwT64sPzzE6cYFKZgssdP5Kj3uu'
const secretKey = 'w6j2ixR_i-aelc6I7S3HotKIX-ukMzcKmDfH6-M5'
const bucket = 'anxinyun'

10
scripts/0.0.1/data/4_file_type_data.sql

@ -0,0 +1,10 @@
-- ----------------------------
-- Records of file_type
-- ----------------------------
BEGIN;
INSERT INTO "public"."file_type" VALUES (1, '前期资料', NULL);
INSERT INTO "public"."file_type" VALUES (3, '竣工资料', NULL);
INSERT INTO "public"."file_type" VALUES (4, '维修资料', NULL);
INSERT INTO "public"."file_type" VALUES (5, '道路图片', NULL);
INSERT INTO "public"."file_type" VALUES (2, '施工资料', NULL);
COMMIT;

18
weapp/src/config.js

@ -1,5 +1,5 @@
let DEV = false;
DEV = true; //使用测试环境
// DEV = true; //使用测试环境
const baseConfig = {
errorHandle: false, //是否启用全局异常处理‌‍‍‌‍​‌‌‍​‌‌‌‌‌​‌‌‍‌​‍‌‌‌‌​‍‍‍‍‌​‌‍‍‌‍​‌‌‍​‍‍‍‌‌​‍‌‌‌‌​‍‌‍‌​‍‌‌‌O
@ -8,20 +8,22 @@ const baseConfig = {
};
const development = {
// baseUrl: 'http://221.230.55.29:31919',
baseUrl: 'https://c5a6-117-90-37-10.ap.ngrok.io',
baseUrl: 'http://221.230.55.29:31919',
// baseUrl: 'https://d763-117-90-37-10.ap.ngrok.io',
// webUrl: 'https://smartwater.anxinyun.cn',
// pcode: 'fce4afe2-5b6a-408a-ab18-a2afa7fa027c',
imgUrl: 'http://test.resources.anxinyun.cn/',
// imgUrl: 'http://rfkimpwbb.hn-bkt.clouddn.com/',
imgUrl: 'http://resources-test.anxinyun.cn/',
// requestCache: true, //开启异步请求缓存
...baseConfig
};
const production = {
baseUrl: 'https://wxapp.free-sun.vip/v1/api',
webUrl: 'http://218.3.150.105:8998',
pcode: 'b3718361-f7db-4058-98a6-071393d0420c',
imgUrl: 'http://test.resources.anxinyun.cn/',
baseUrl: 'https://sihao.anxinyun.cn/_api',
// baseUrl: 'https://d763-117-90-37-10.ap.ngrok.io',
// webUrl: 'https://smartwater.anxinyun.cn',
// pcode: 'fce4afe2-5b6a-408a-ab18-a2afa7fa027c',
imgUrl: 'http://resources.anxinyun.cn/',
...baseConfig
};

154
weapp/src/packages/patrol/index.jsx

@ -4,10 +4,14 @@ import { View, RadioGroup, Radio, Image, Input, Picker } from '@tarojs/component
import { AtButton, AtTextarea, AtImagePicker } from 'taro-ui';
import InputPicker from '../components/inputPicker';
import request from '@/services/request';
import { postReport, getReportDetail, delReport, getRoadSection } from '@/services/api';
import environment from '../../config';
import { getState } from '../../store/globalState';
import { postReport, getReportDetail, delReport, getRoadSection, postImage } from '@/services/api';
import './index.scss';
import arrowIcon from '../../static/img/patrol/arrow-down.svg';
const { baseUrl, imgUrl } = environment;
const Index = () => {
const userInfo = Taro.getStorageSync('userInfo') || {};
const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false
@ -30,15 +34,20 @@ const Index = () => {
const [longitude, setLongitude] = useState(0) //
const [latitude, setLatitude] = useState(0) //
const [sceneImg, setSceneImg] = useState([]) // url
const [conserveBeforeImg, setConserveBeforeImg] = useState([]) //
const [conserveUnderwayImg, setConserveUnderwayImg] = useState([]) //
const [conserveAfterImg, setConserveAfterImg] = useState([]) //
const [sourceRoadSel, setSourceRoadSel] = useState([])
const [sourceRoadStartSel, setSourceRoadStartSel] = useState([])
const [sourceRoadEndSel, setSourceRoadEndSel] = useState([])
const prjType = [
{ text: '道路', value: 'road'},
{ text: '桥梁', value: 'bridge'},
{ text: '涵洞', value: 'culvert'},
{ text: '其他', value: 'other'},
{ text: '道路', value: 'road' },
{ text: '桥梁', value: 'bridge' },
{ text: '涵洞', value: 'culvert' },
{ text: '其他', value: 'other' },
]
const prjTypeSelector = ['道路', '桥梁', '涵洞', '其他']
const [roadStartSel, setRoadStartSel] = useState([])
@ -80,10 +89,10 @@ const Index = () => {
setRoadSectionEnd(data.roadSectionEnd)
setAddress(data.address)
setContent(data.content)
setScenePic(data.scenePic ? data.scenePic.map(item => ({ url: item })) : [])
setConserveBeforePic(data.conserveBeforePic ? data.conserveBeforePic.map(item => ({ url: item })) : [])
setConserveUnderwayPic(data.conserveUnderwayPic ? data.conserveUnderwayPic.map(item => ({ url: item })) : [])
setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: item })) : [])
setScenePic(data.scenePic ? data.scenePic.map(item => ({ url: imgUrl + item })) : [])
setConserveBeforePic(data.conserveBeforePic ? data.conserveBeforePic.map(item => ({ url: imgUrl + item })) : [])
setConserveUnderwayPic(data.conserveUnderwayPic ? data.conserveUnderwayPic.map(item => ({ url: imgUrl + item })) : [])
setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: imgUrl + item })) : [])
} else {
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' })
}
@ -162,6 +171,10 @@ const Index = () => {
Taro.showToast({ title: '工程类型错误', icon: 'none' })
return
}
if (content.length > 50) {
Taro.showToast({ title: '内容字数不能超过50', icon: 'none' })
return
}
const reportProjectType = prjType[prjTypeSelector.indexOf(projectType)].value
let data = {
@ -176,11 +189,11 @@ const Index = () => {
latitude
}
if (reportType === 'patrol') {
data['scenePic'] = scenePic.length > 0 ? scenePic.map(item => item.url) : null
data['scenePic'] = sceneImg
} else {
data['conserveBeforePic'] = conserveBeforePic.length > 0 ? conserveBeforePic.map(item => item.url) : null
data['conserveUnderwayPic'] = conserveUnderwayPic.length > 0 ? conserveUnderwayPic.map(item => item.url) : null
data['conserveAfterPic'] = conserveAfterPic.length > 0 ? conserveAfterPic.map(item => item.url) : null
data['conserveBeforePic'] = conserveBeforeImg
data['conserveUnderwayPic'] = conserveUnderwayImg
data['conserveAfterPic'] = conserveAfterImg
}
Taro.showModal({
@ -272,24 +285,97 @@ const Index = () => {
setReportType(e.detail.value)
}
function handleImgChange(files, type) {
switch (type) {
case 'scenePic':
setScenePic(files)
break;
case 'conserveBeforePic':
setConserveBeforePic(files)
break;
case 'conserveUnderwayPic':
setConserveUnderwayPic(files)
break;
case 'conserveAfterPic':
setConserveAfterPic(files)
break;
default:
break;
function handleImgChange(files, operationType, index, type) {
if (operationType === 'remove') {
setImg(false)
}
function setImg(isAdd, url) {
switch (type) {
case 'scenePic':
let nextImg = sceneImg
if (isAdd) {
nextImg.push(url)
} else {
nextImg.splice(index, 1)
}
setSceneImg(nextImg)
setScenePic(files)
break;
case 'conserveBeforePic':
let nextConserveBeforeImg = conserveBeforeImg
if (isAdd) {
nextConserveBeforeImg.push(url)
} else {
nextConserveBeforeImg.splice(index, 1)
}
setConserveBeforeImg(nextConserveBeforeImg)
setConserveBeforePic(files)
break;
case 'conserveUnderwayPic':
let nextConserveUnderwayImg = conserveUnderwayImg
if (isAdd) {
nextConserveUnderwayImg.push(url)
} else {
nextConserveUnderwayImg.splice(index, 1)
}
setConserveUnderwayImg(nextConserveUnderwayImg)
setConserveUnderwayPic(files)
break;
case 'conserveAfterPic':
let nextConserveAfterImg = conserveAfterImg
if (isAdd) {
nextConserveAfterImg.push(url)
} else {
nextConserveAfterImg.splice(index, 1)
}
setConserveAfterImg(nextConserveAfterImg)
setConserveAfterPic(files)
break;
default:
break;
}
}
if (operationType === 'add' && files.length > 0) {
Taro.showLoading({ title: '上传中' })
let i = 0
switch (type) {
case 'scenePic':
i = scenePic.length
break;
case 'conserveBeforePic':
i = conserveBeforePic.length
break;
case 'conserveUnderwayPic':
i = conserveUnderwayPic.length
break;
case 'conserveAfterPic':
i = conserveAfterPic.length
break;
default:
break;
}
for (i; i < files.length; i++) {
const tempFilePaths = files[i].url
let token = getState('token') || Taro.getStorageSync('token')
Taro.uploadFile({
url: `${baseUrl}${postImage()}?token=${token}`,
filePath: tempFilePaths,
name: 'file',
success: (res) => {
if (i === files.length) {
Taro.hideLoading();
}
if (res.statusCode == 200) {
setImg(true, JSON.parse(res.data).key)
} else {
Taro.showToast({ title: '上传失败,请重试', icon: 'error' })
}
}
});
}
}
}
function handleImgClick(index, file) {
Taro.previewImage({
urls: [file.url] // http
@ -397,7 +483,7 @@ const Index = () => {
<AtTextarea
title='巡查内容:'
placeholder={isView ? '' : '请输入巡查内容'}
placeholder={isView ? '' : '请输入具体内容'}
value={content}
onChange={(v, e) => handleInput(e, 'content')}
disabled={isView}
@ -419,7 +505,7 @@ const Index = () => {
count={3 - scenePic.length}
showAddBtn={scenePic.length >= 3 ? false : true}
files={scenePic}
onChange={files => handleImgChange(files, 'scenePic')}
onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'scenePic')}
onImageClick={handleImgClick}
/>
}
@ -442,7 +528,7 @@ const Index = () => {
count={3 - conserveBeforePic.length}
showAddBtn={conserveBeforePic.length >= 3 ? false : true}
files={conserveBeforePic}
onChange={files => handleImgChange(files, 'conserveBeforePic')}
onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'conserveBeforePic')}
onImageClick={handleImgClick}
/>
}
@ -462,7 +548,7 @@ const Index = () => {
count={3 - conserveUnderwayPic.length}
showAddBtn={conserveUnderwayPic.length >= 3 ? false : true}
files={conserveUnderwayPic}
onChange={files => handleImgChange(files, 'conserveUnderwayPic')}
onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'conserveUnderwayPic')}
onImageClick={handleImgClick}
/>
}
@ -483,7 +569,7 @@ const Index = () => {
count={3 - conserveAfterPic.length}
showAddBtn={conserveAfterPic.length >= 3 ? false : true}
files={conserveAfterPic}
onChange={files => handleImgChange(files, 'conserveAfterPic')}
onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'conserveAfterPic')}
onImageClick={handleImgClick}
/>
}

4
weapp/src/pages/home/index.jsx

@ -51,13 +51,13 @@ const Index = () => {
{isSuperAdmin ? '查看' : '填报'}
</View>
</View>
{
{/* {
isSuperAdmin &&
<View className='card video'>
<View className='title'> </View>
<View className='btn' onClick={toVideo}>查看</View>
</View>
}
} */}
</View>
);
}

4
weapp/src/pages/user/index.jsx

@ -4,6 +4,7 @@ import { View, Button, Image } from '@tarojs/components';
import { logout } from '@/actions/auth';
import { getLogoutUrl } from '@/services/api';
import cfg from '../../config';
import { getState } from '../../store/globalState';
import './index.scss';
import headImg from '../../static/img/my/head.png';
import moreImg from '../../static/img/my/more.svg';
@ -39,8 +40,9 @@ const Index = ({ ...props }) => {
title: '提示',
content: '确定退出登录吗',
success: function (res) {
let token = getState('token') || Taro.getStorageSync('token')
if (res.confirm) {
logout(getLogoutUrl()).then(() => {
logout(getLogoutUrl(), { token }).then(() => {
Taro.reLaunch({
url: '/pages/auth/login/login'
});

5
weapp/src/services/api.js

@ -37,6 +37,11 @@ export const getRoadSection = () => {
return `/road/section`;
};
// 上传图片
export const postImage = () => {
return `/attachments/report`;
};
//行业查询
export const getIndustryUrl = () => {
return `/elec/business/industry`

6
web/client/src/sections/fillion/actions/infor.js

@ -343,7 +343,7 @@ export function putAddPropagata (query) {
data: query,
actionType: 'PUT_PROPAGATA',
url: ApiTable.putpropagata,
msg: { error: '新增宣传视频信息失败' },
msg: { option: '新增宣传视频' },
// reducer: { name: 'reportstatistic' }
});
}
@ -354,7 +354,7 @@ export function putEditPropagata (query) {
data: query,
actionType: 'PUT_PROPAGATA',
url: ApiTable.putpropagata,
msg: { error: '编辑宣传视频信息失败' },
msg: { option: '编辑宣传视频' },
// reducer: { name: 'reportstatistic' }
});
}
@ -364,7 +364,7 @@ export function delPropagata (query) {
dispatch: dispatch,
actionType: 'DEL_PROPAGATA',
url: ApiTable.delpropagata.replace("{publicityId}", query?.publicityId),
msg: { error: '删除宣传视频信息失败' },
msg: { option: '删除宣传视频信息' },
// reducer: { name: 'reportstatistic' }
});
}

8
web/client/src/sections/fillion/components/bridgeTable.js

@ -1534,13 +1534,13 @@ const BrideTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
>
导入
</Button>
</Button> */}
</div>
@ -1717,13 +1717,13 @@ const BrideTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
>
导入
</Button>
</Button> */}
</div>

5
web/client/src/sections/fillion/components/gis/patrolGis.js

@ -11,9 +11,11 @@ function PatrolGis(props) {
const { reportList, userId, dispatch } = props;
const [mapComplete, setMapComplete] = useState(false);
const [mapObj, setMapObj] = useState();
const [dateRange, setDateRange] = useState();
const [dateRange, setDateRange] = useState([moment().add(-6, 'day'),
moment()]);
let markers = [];
let PATH = [];
useEffect(() => {
if (AMap) loadMap();
return () => {
@ -147,6 +149,7 @@ function PatrolGis(props) {
<div style={{ position: 'absolute', top: 8, left: 20, display: userId ? 'block' : 'none' }}>
<RangePicker
onChange={(date, dateString) => { setDateRange(dateString) }}
defaultValue={dateRange}
/>
</div>
{mapObj ? <Bounds map={mapObj} /> : ''}

4
web/client/src/sections/fillion/components/highwaysTable.js

@ -37,6 +37,7 @@ const hightModal = (type, record) => {
dataIndex: 'placeName',
fixed: 'left',
width: 120,
search: false,
options: 1,
backgroundColor: "#ffffff",
fieldProps: {
@ -91,6 +92,9 @@ const hightModal = (type, record) => {
actionRef={ref}
scroll={{ x: 800 }}
options={false}
form={{
submitter:false
}}
// ref={c => { finishedProductTable = c; }}
style={{ width: "100% ", overflow: "auto", height: '760px' }}
rowKey='id'

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

@ -9,7 +9,6 @@ import { getPropagata } from '../../actions/infor';
const VideoUpload = (props) => {
const { dispatch, record, counts, setCounts } = props
const [form] = Form.useForm();
@ -20,11 +19,9 @@ const VideoUpload = (props) => {
}
const showModalEdit = () => {
setIsModalVisible(true);
};
//新增
const handleOkAdd = () => {
form.validateFields().then((values) => {
@ -39,6 +36,7 @@ const VideoUpload = (props) => {
setCounts(res.payload.data)
})
})
form.resetFields()
setIsModalVisible(false);
}
);
@ -49,24 +47,28 @@ const VideoUpload = (props) => {
form.validateFields().then((values) => {
const videoname = values.username
const id = record.id
const video = record.video
const data = { publicityId: id, name: videoname, video: video }
const newVideoAddress = values.video.map((item) => {
return item.storageUrl
})
const data = { publicityId: id, name: videoname, video: newVideoAddress }
dispatch(putEditPropagata(data)).then(() => {
dispatch(getPropagata()).then((res) => {
setCounts(res.payload.data)
console.log(data);
})
})
setIsModalVisible(false);
}
);
setIsModalVisible(false);
};
const handleCancel = () => {
setIsModalVisible(false);
};
const handleCancelEdit = () => {
setIsModalVisible(false);
form.resetFields()
};
const onFinish = (values) => {
console.log('Success:', values);
@ -80,7 +82,7 @@ const VideoUpload = (props) => {
<div >
{
props.type_ys ? <div><Button type='primary' onClick={showModal}>新增</Button>
<Modal visible={isModalVisible} onOk={handleOkAdd} onCancel={handleCancel}>
<Modal visible={isModalVisible} onOk={handleOkAdd} onCancel={handleCancelEdit} >
<Form
form={form}
name="basic"
@ -123,7 +125,7 @@ const VideoUpload = (props) => {
]}
>
<Uploads
maxFilesNum={10}
maxFilesNum={1}
fileTypes={['mp4']}
maxFileSize={200}
/>
@ -178,9 +180,15 @@ const VideoUpload = (props) => {
<Form.Item
label="选择视频"
name="video"
rules={[
{
required: true,
message: '必须上传视频!',
},
]}
>
<Uploads
maxFilesNum={10}
maxFilesNum={1}
fileTypes={['mp4']}
maxFileSize={200}
/>

17
web/client/src/sections/fillion/components/inforTable.js

@ -197,7 +197,7 @@ const InForTable = (props) => {
dataIndex: 'createdAt',
valueType: 'date',
render: (dom, record) => {
return record.testTime?.slice(0,10)
return record.testTime?.slice(0, 10)
},
fieldProps: {
onChange: (value, cs) => {
@ -381,13 +381,13 @@ const InForTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
>
导入
</Button>
</Button> */}
</div>
@ -447,10 +447,13 @@ const InForTable = (props) => {
defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(),
<Popconfirm title="确认导出?" onConfirm={() => {
// console.log(rowSelected)
props.exports(rowSelected, counts) }}>
<Popconfirm title={rowSelected.length === 0 ? '请勾选内容' : "确认导出?"}
showCancel={rowSelected.length === 0 ? false : true}
onConfirm={() => {
// console.log(rowSelected)
rowSelected.length === 0 ? null : props.exports(rowSelected, counts)
}}
>
<Button
>
导出

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

@ -12,8 +12,9 @@ import moment from 'moment';
const DetailForm = (props) => {
const { visible, data, handleClose, loading } = props;
const [qndmn] = useState(localStorage.getItem('qndmn'));
const keyList = [
{ key: '编号', name: 'id' },
// { key: '编号', name: 'id' },
{ key: '工程类型', name: 'projectType' },
{ key: '所在路段', name: 'road' },
{ key: '具体位置', name: 'address' },
@ -37,7 +38,7 @@ const DetailForm = (props) => {
{
data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
return <div style={{ width: '44%', margin: 6 }}>
<Image src={imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
<Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
</div>
}) : '暂无图片'
}
@ -90,6 +91,9 @@ const DetailList = (props) => {
}
}
let basicDate = null;
let counter = 0;
const columns = [
{
title: '编号',
@ -97,7 +101,31 @@ const DetailList = (props) => {
dataIndex: 'id',
align: 'center',
render: (text, record) => {
return moment(record.time).format("YYYYMMDD") * 10000 + record.id;
let day = moment(record.time).format("YYYYMMDD")
if(!basicDate){
basicDate = day;
counter +=1;
} else if(basicDate == day){
counter += 1;
} else if(basicDate != day){
basicDate = day;
counter = 1;
}
return moment(record.time).format("YYYYMMDD") * 10000 + counter;
}
}, {
title: '工程类型',
key: 'projectType',
dataIndex: 'projectType',
align: 'center',
render: (text, record) => {
switch (text) {
case 'road': return '道路';
case 'bridge': return '桥梁';
case 'culvert': return '涵洞';
case 'other': return '其他';
default: return text;
}
}
}, {
title: '所属道路',
@ -114,19 +142,19 @@ const DetailList = (props) => {
}
},
{
title: '缺陷名称',
title: '具体内容',
key: 'content',
dataIndex: 'content',
align: 'center'
},
{
title: '巡查人',
title: '养护人',
width: 100,
key: 'userName',
dataIndex: 'userName',
align: 'center',
render: (text, record) => {
return record.user.name
return record?.user?.name
}
}, {
title: '上报时间',
@ -186,10 +214,17 @@ const DetailList = (props) => {
const PatrolNameList = (props) => {
const [users, setUsers] = useState([]);
const { onChange, record, userList, loading } = props;
const { name } = record || { name: '' }
const [selectRoad, setSelectRoad] = useState();
useEffect(() => {
if (userList && userList instanceof Array && userList.length) {
setSelectRoad(userList[0].id)
// onChange(userList[0]);
}
}, [userList])
const columns = [
{
title: '巡更人员',
title: '养护人员',
key: 'name',
dataIndex: 'name',
align: 'center'
@ -225,7 +260,7 @@ const PatrolNameList = (props) => {
loading={loading}
rowKey="name"
rowClassName={(record) => {
return record.patrolName === name ? styles['split-row-select-active'] : '';
return record.id == selectRoad ? 'list-row-actived' : '';
}}
toolBarRender={() => [
<Input placeholder='输入养护人员名称' onChange={doUserNameSearch} ></Input>
@ -237,7 +272,7 @@ const PatrolNameList = (props) => {
return {
onClick: () => {
if (record) {
console.log('record:', record)
setSelectRoad(record.id);
onChange(record);
}
},
@ -251,7 +286,7 @@ const PatrolNameList = (props) => {
const MaintenanceTable = (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)
@ -268,7 +303,7 @@ const MaintenanceTable = (props) => {
useEffect(() => {
if (record) {
let query = { userId: record.id, reportType: 'conserve' }
let query = { userId: record.id, reportType: 'conserve' , asc: true}
if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss')
query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
@ -285,10 +320,17 @@ const MaintenanceTable = (props) => {
}
const handelRefresh = () => {
let query = { userId: record.id, reportType: 'patrol' }
let query = { userId: record.id, reportType: 'patrol', asc: true }
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 >
@ -298,7 +340,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} />
@ -314,7 +356,7 @@ const MaintenanceTable = (props) => {
);
};
function mapStateToProps(state) {
function mapStateToProps (state) {
const { auth, depMessage, userList, reportList, reportDetail } = state;
const pakData = (dep) => {
return dep.map((d) => {

25
web/client/src/sections/fillion/components/operationalTable.js

@ -723,7 +723,7 @@ const OperaTionalTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -731,7 +731,7 @@ const OperaTionalTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
@ -1356,7 +1356,7 @@ const OperaTionalTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -1364,7 +1364,7 @@ const OperaTionalTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
@ -1826,7 +1826,7 @@ const OperaTionalTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -1834,7 +1834,7 @@ const OperaTionalTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
@ -1848,6 +1848,9 @@ const OperaTionalTable = (props) => {
<div className='protable-transpor'>
<ProTable
actionRef={ref}
form={{
submitter: rewkeys === 'keyun' ? false : true,
}}
toolbar={{
multipleLine: true,
@ -1887,8 +1890,8 @@ const OperaTionalTable = (props) => {
}, {
key: 'tab4',
label: <span onClick={() => {
setDifferentiate('business')
setRewkeys('yehu')
setDifferentiate('business')
setRewkeys('yehu')
}}>业户{activeKey === 'tab4'}</span>,
},
@ -1900,7 +1903,9 @@ const OperaTionalTable = (props) => {
ref={c => { finishedProductTable = c; }}
style={{ width: "100% ", overflow: "auto", height: '760px' }}
rowKey='id'
rowSelection={{
// alwaysShowAlert
// tableAlertRender={true}
rowSelection={ rewkeys=='keyun'?false:{
selectedRowKeys: rowSelected,
onChange: (selectedRowKeys) => {
setRowSelected(selectedRowKeys);
@ -1966,7 +1971,7 @@ const OperaTionalTable = (props) => {
defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(),
['tab2', 'tab3', 'tab4'].includes(activeKey) ? <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected,differentiate,genre) }}>
['tab2', 'tab3', 'tab4'].includes(activeKey) ? <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, differentiate, genre) }}>
<Button
>
导出

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

@ -13,13 +13,14 @@ import moment from 'moment';
const DetailForm = (props) => {
const { visible, data, handleClose, loading } = props;
const [qndmn] = useState(localStorage.getItem('qndmn'));
const keyList = [
{ key: '编号', name: 'id' },
// { key: '编号', name: 'id' },
{ key: '工程类型', name: 'projectType' },
{ key: '所在路段', name: 'road' },
{ key: '具体位置', name: 'address' },
{ key: '巡查内容', name: 'content' },
{ key: '病害照片', name: 'scenePic' },
{ key: '现场照片', name: 'scenePic' },
];
const renderContent = (data) => {
@ -38,7 +39,7 @@ const DetailForm = (props) => {
{
data.scenePic && data.scenePic instanceof Array ? data.scenePic.map(imgSrc => {
return <div style={{ width: '44%', margin: 6 }}>
<Image src={imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
<Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
</div>
}) : '暂无图片'
}
@ -57,7 +58,7 @@ const DetailForm = (props) => {
visible={visible}
footer={null}
onCancel={handleClose}
title={'巡管理详情'}
title={'巡管理详情'}
>
<Spin spinning={loading}>
{renderContent(data)}
@ -90,6 +91,8 @@ const DetailList = (props) => {
})
}
}
let basicDate = null;
let counter = 0;
const columns = [
{
@ -98,9 +101,35 @@ const DetailList = (props) => {
dataIndex: 'id',
align: 'center',
render: (text, record) => {
return moment(record.time).format("YYYYMMDD") * 10000 + record.id;
let day = moment(record.time).format("YYYYMMDD")
if(!basicDate){
basicDate = day;
counter +=1;
} else if(basicDate == day){
counter += 1;
} else if(basicDate != day){
basicDate = day;
counter = 1;
}
return moment(record.time).format("YYYYMMDD") * 10000 + counter;
}
}, {
},
{
title: '工程类型',
key: 'projectType',
dataIndex: 'projectType',
align: 'center',
render: (text, record) => {
switch (text) {
case 'road': return '道路';
case 'bridge': return '桥梁';
case 'culvert ': return '涵洞';
case 'other': return '其他';
default: return text;
}
}
},
{
title: '所属道路',
key: 'road',
dataIndex: 'road',
@ -115,7 +144,7 @@ const DetailList = (props) => {
}
},
{
title: '缺陷名称',
title: '具体内容',
key: 'content',
dataIndex: 'content',
align: 'center'
@ -186,11 +215,25 @@ const DetailList = (props) => {
const PatrolNameList = (props) => {
const [users, setUsers] = useState([]);
const { onChange, record, userList, loading } = props;
const { name } = record || { name: '' }
const { onChange, record, userList, loading, activeTabKey1 } = props;
const [selectRoad, setSelectRoad] = useState();
useEffect(() => {
if (userList && userList instanceof Array && userList.length) {
setSelectRoad(userList[0].id)
// onChange(userList[0]);
}
if(activeTabKey1 == 'tab2'){
setSelectRoad(null)
}
}, [userList, activeTabKey1])
const columns = [
{
title: '巡更人员',
title: '巡人员',
key: 'name',
dataIndex: 'name',
align: 'center'
@ -225,10 +268,10 @@ const PatrolNameList = (props) => {
loading={loading}
rowKey="name"
rowClassName={(record) => {
return record.patrolName === name ? styles['split-row-select-active'] : '';
return record.id == selectRoad ? 'list-row-actived' : '';
}}
toolBarRender={() => [
<Input placeholder='输入巡人员名称' onChange={doUserNameSearch} ></Input>
<Input placeholder='输入巡人员名称' onChange={doUserNameSearch} ></Input>
]}
options={false}
pagination={false}
@ -238,6 +281,11 @@ const PatrolNameList = (props) => {
onClick: () => {
if (record) {
// console.log('record:', record)
let id = record.id
if(selectRoad == record.id){
id = null
}
setSelectRoad(id);
onChange(record);
}
},
@ -251,7 +299,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)
@ -272,7 +320,7 @@ const PatrolTable = (props) => {
}, [record, dateRange])
const queryData = () => {
let query = { userId: record.id, reportType: 'patrol' }
let query = { userId: record.id, reportType: 'patrol', asc: true }
if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss')
query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
@ -289,7 +337,7 @@ const PatrolTable = (props) => {
}, [activeTabKey1])
const handelRefresh = () => {
let query = { userId: record.id, reportType: 'patrol' }
let query = { userId: record.id, reportType: 'patrol', asc: true }
dispatch(getReportList(query));
}
@ -303,10 +351,10 @@ const PatrolTable = (props) => {
const tabList = [
{
key: 'tab1',
tab: '巡',
tab: '巡',
}, {
key: 'tab2',
tab: '巡轨迹查询',
tab: '巡轨迹查询',
},
];
const contentList = {
@ -329,12 +377,20 @@ 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 >
<PatrolNameList
onChange={(record) => handleChangeRecord(record)}
record={record}
activeTabKey1={activeTabKey1}
userList={userList}
loading={userLoading} />
</Card>
@ -350,7 +406,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]}
@ -365,7 +421,7 @@ const PatrolTable = (props) => {
);
};
function mapStateToProps(state) {
function mapStateToProps (state) {
const { auth, depMessage, userList, reportList, reportDetail } = state;
const pakData = (dep) => {
return dep.map((d) => {

3
web/client/src/sections/fillion/components/protable.less

@ -10,8 +10,9 @@
}
.list-row-actived {
background-color: #7cafc6;
background-color: #e2f6ff;
font-weight: 600;
color: #1E80FF
}

10
web/client/src/sections/fillion/components/publicTable.js

@ -434,7 +434,7 @@ const PublicTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -442,7 +442,7 @@ const PublicTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
@ -1129,7 +1129,7 @@ const PublicTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -1137,7 +1137,7 @@ const PublicTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
@ -1231,7 +1231,7 @@ const PublicTable = (props) => {
defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(),
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, counts) }}>
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected,rewkeys ) }}>
<Button
>
导出

16
web/client/src/sections/fillion/components/transportationTable.js

@ -1208,7 +1208,7 @@ const TransporTationTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -1216,7 +1216,7 @@ const TransporTationTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
);
},
@ -2363,7 +2363,7 @@ const TransporTationTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -2371,7 +2371,7 @@ const TransporTationTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
@ -3519,7 +3519,7 @@ const TransporTationTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
onClick={() => {
@ -3527,7 +3527,7 @@ const TransporTationTable = (props) => {
}}
>
导入
</Button>
</Button> */}
</div>
@ -3706,13 +3706,13 @@ const TransporTationTable = (props) => {
>
新增
</Button>
<Button
{/* <Button
type="primary"
style={{ width: "100px", marginLeft: 20 }}
>
导入
</Button>
</Button> */}
</div>

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} />

22
web/client/src/sections/fillion/containers/public.js

@ -9,17 +9,21 @@ const Public = (props) => {
const [data, setData] = useState()
useEffect(() => {
// dispatch(getDepMessage())
setData(props)
}, []);
//批量导出
const exports = (ids,counts) => {
console.log(counts);
let idas=ids.toString()
window.open(
'/_api/'+`data/export/?ids=${idas||''}&exp=${'overspeed'}&token=${user.token}`)
}
//批量导出
const exports = (ids, rewkeys) => {
let idas = ids.toString()
if (rewkeys === 'xianlu') {
window.open(
'/_api/' + `data/export/?ids=${idas || ''}&exp=${'busLine'}&token=${user.token}`)
}
if (rewkeys === 'cheliang') {
window.open(
'/_api/' + `data/export/?ids=${idas || ''}&exp=${'busCar'}&token=${user.token}`)
}
}
return (
<> <PublicTable data={data} exports={exports} />
</>

2
web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js

@ -28,7 +28,7 @@ const Right = (props) => {
// const
})
}, [])
console.log("1211", nums);
// console.log("1211", nums);
const renderBody = () => {
return (

4
web/client/src/sections/quanju/containers/footer/leadership/centerleft/handong.js

@ -27,7 +27,7 @@ const Right = (props) => {
const daolus = dispatch(getdaolutongji()).then((res) => {
// console.log("[roads]", res.payload.data.roadType);
setRoads(res.payload.data.townCulvert)
console.log(res.payload.data.townCulvert);
// console.log(res.payload.data.townCulvert);
// const
})
}, [])
@ -39,7 +39,7 @@ const Right = (props) => {
{
list.map((item, index) => {
console.log(list);
// console.log(list);
return (
<li className={index} style={{

2
web/client/src/sections/quanju/containers/footer/leadership/centerleft/qiqoliang.js

@ -23,7 +23,7 @@ const Right = (props) => {
const daolus = dispatch(getdaolutongji()).then((res) => {
// console.log("[roads]", res.payload.data.roadType);
setRoads(res.payload.data.bridgeSize)
console.log(res.payload.data.bridgeSize);
// console.log(res.payload.data.bridgeSize);
// const
})
}, [])

2
web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js

@ -16,7 +16,7 @@ const Leftbottomecharts = (props) => {
}))
});
}, [])
console.log(list, count);
// console.log(list, count);
const chartRef = useRef(null);
useEffect(() => {
var chartInstance = echarts.init(chartRef.current);

2
web/client/src/sections/quanju/containers/footer/leadership/left/echarts/lefttopecharts.js

@ -31,7 +31,7 @@ const Lefttopecharts = (props) => {
// setMass(res.payload.data.index)
// // setspeed(res.payload.data.speed)
// })
console.log(mass);
// console.log(mass);
var chartInstance = echarts.init(chartRef.current);
// var dataArr = mass || 0;
var names = names()

8
web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js

@ -70,7 +70,7 @@ const Leftcenter = () => {
</div>
<div style={{ width: "100%", height: "100%", marginTop: "3%" }}>
<div style={{ width: "60%", height: "100%", float: "left", marginLeft: "1%" }}>
{
{/* {
list.map((item, index) => {
return index + 1 == num ?
<div style={{ width: "100%", height: "100%", position: "relative" }}>
@ -86,15 +86,15 @@ const Leftcenter = () => {
})
}
} */}
</div>
<Lunbo
{/* <Lunbo
// canScroll={true}
content={renderBody()}
containerStyle={{ position: "relative", height: "100%", width: "35%", float: "right", marginRight: "2%", marginTop: "1%" }}
divHeight={"100%"}
divId={"screen-slope-midde-top-jiangxi"}
/>
/> */}
</div>
</>
)

26
web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js

@ -11,16 +11,36 @@ const Lefttop = (props) => {
const [mass, setMass] = useState()
const [speed, setspeed] = useState()
const [traffic, setTraffic] = useState()
const [tim, setTim] = useState()
const [nums, setNums] = useState()
useEffect(() => {
const shuju = dispatch(getGodshuju()).then((res) => {
// console.log(res);
setMass(res.payload.data.index)
// setMass(70)
setspeed(res.payload.data.speed)
if (localStorage.getItem("pinjun") && localStorage.getItem("num")) {
if (localStorage.getItem("pinjun") == res.payload.data.speed) {
setNums(localStorage.getItem("num"))
} else {
localStorage.setItem("pinjun", res.payload.data.speed)
localStorage.setItem("num", (res.payload.data.speed + ((Math.random() * (6) - 3))).toFixed(2))
setNums(localStorage.getItem("num"))
}
} else {
localStorage.setItem("pinjun", res.payload.data.speed)
localStorage.setItem("num", (res.payload.data.speed + ((Math.random() * (6) - 3))).toFixed(2))
setNums(localStorage.getItem("num"))
}
})
}, [tim])
useEffect(() => {
const timer = setInterval(() => {
setTim(new Date())
}, 300000);
return () => clearInterval(timer);
}, [])
// console.log(mass);
// console.log(tim);
return (
<>
<Module style={style} title={"道路拥堵指数"} >
@ -48,7 +68,7 @@ const Lefttop = (props) => {
fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC", color: "rgba(216,240,255,0.8000)",
position: "absolute", left: "30%", top: "65%"
}}>预测明日</p>
<p style={{ fontSize: "24px", fontFamily: "YouSheBiaoTiHei", color: "#ffffff", position: "absolute", top: "72%", left: "30%" }}>{isNaN((speed + ((Math.random() * (6) - 3))).toFixed(2)) ? "" : (speed + ((Math.random() * (6) - 3))).toFixed(2)}<span style={{ fontSize: "2px", color: "#EEF4FF" }}>Km/h</span></p>
<p style={{ fontSize: "24px", fontFamily: "YouSheBiaoTiHei", color: "#ffffff", position: "absolute", top: "72%", left: "30%" }}>{isNaN(nums) ? "" : (nums)}<span style={{ fontSize: "2px", color: "#EEF4FF" }}>Km/h</span></p>
</div>
</div>

2
web/client/src/sections/quanju/containers/footer/leadership/right/hudong.js

@ -16,7 +16,7 @@ class ReactCarousel extends Component {
} else {
j++;
x = 0;
console.log("else:" + "j=" + j + " " + "x=" + x);
// console.log("else:" + "j=" + j + " " + "x=" + x);
arr1[j][x] = arr[i];
// console.log(arr1);
x++;

16
web/client/src/sections/quanju/containers/footer/leadership/right/right-top.js

@ -77,13 +77,13 @@ const Righttop = () => {
<Module style={style} title={"路面执法监控"}>
<div style={{ width: "100%", height: "65%", position: "relative" }}>
<p style={{ position: "absolute", left: "25%", top: "2%", fontSize: "14px", color: "#FFFFFF" }}>监控总数</p><p style={{ position: "absolute", left: "37%", fontSize: "24px", marginLeft: "1%", top: "-0.5%", color: "#FFFFFF", fontFamily: "YouSheBiaoTiHei" }}>129</p>
<p style={{ position: "absolute", left: "55%", top: "2%", fontSize: "14px", color: "#FFFFFF" }}>在线率</p><p style={{ position: "absolute", right: "15%", fontSize: "24px", marginLeft: "2%", top: "-0.5%", color: "#FFFFFF", fontFamily: "YouSheBiaoTiHei" }}>88.87%</p>
{/* <p style={{ position: "absolute", left: "25%", top: "2%", fontSize: "14px", color: "#FFFFFF" }}></p><p style={{ position: "absolute", left: "37%", fontSize: "24px", marginLeft: "1%", top: "-0.5%", color: "#FFFFFF", fontFamily: "YouSheBiaoTiHei" }}>129</p>
<p style={{ position: "absolute", left: "55%", top: "2%", fontSize: "14px", color: "#FFFFFF" }}>在线率</p><p style={{ position: "absolute", right: "15%", fontSize: "24px", marginLeft: "2%", top: "-0.5%", color: "#FFFFFF", fontFamily: "YouSheBiaoTiHei" }}>88.87%</p> */}
<div style={{ width: "100%", height: "10%", position: "relative" }}>
<img src='/assets/images/leadership/head.png' style={{ width: "15%", marginLeft: "5%" }} />
{/* <img src='/assets/images/leadership/head.png' style={{ width: "15%", marginLeft: "5%" }} /> */}
<div className='wy-rightTop' style={{ position: "absolute", right: "5%", top: "130%" }}>
<Select
{/* <Select
size={size}
defaultValue="选择路段"
onChange={handleChange}
@ -94,14 +94,14 @@ const Righttop = () => {
}}
>
{children}
</Select>
</Select> */}
{/* <div>{size}</div> */}
</div>
</div>
<div style={{ width: "100%", height: "80%", position: "relative", top: "10%" }}>
<Huadong />
{/* <Huadong /> */}
</div>
</div>
<div style={{ width: "100%", height: "35%" }}>
@ -112,13 +112,13 @@ const Righttop = () => {
<img src='/assets/images/leadership/zibiaoti.png' style={{ width: "94%", height: "34px", position: "absolute", top: "8px", left: "35px" }} />
</div>
{/* <Spin tip="Loading..." spinning={num ? true : false} style={{ width: "100%", height: "100%" }}> */}
<Lunbo
{/* <Lunbo
// canScroll={true}
content={renderBody()}
containerStyle={{ position: "relative", height: "100%", width: "90%", left: "5%", top: "5%" }}
divHeight={"100%"}
divId={"screen-slope"}
/>
/> */}
{/* </Spin> */}
</div>

42
web/client/src/sections/quanju/containers/footer/operation/right.js

@ -1,32 +1,32 @@
import React, { useState } from 'react'
import { Carousel } from 'antd';
// import { Carousel } from 'antd';
import Module from '../../public/module'
const Right = () => {
const [dataLists, setDataList] = useState([
{
route: '147',
plate: '赣APJ090'
}, {
route: '166',
plate: '赣APJ087'
}, {
route: '171',
plate: '赣APJ184'
}, {
route: '186',
plate: '赣APJ241'
}, {
route: '199',
plate: '赣APJ337'
}
])
// const [dataLists, setDataList] = useState([
// {
// route: '147',
// plate: '赣APJ090'
// }, {
// route: '166',
// plate: '赣APJ087'
// }, {
// route: '171',
// plate: '赣APJ184'
// }, {
// route: '186',
// plate: '赣APJ241'
// }, {
// route: '199',
// plate: '赣APJ337'
// }
// ])
const style = { height: "97%", marginTop: "3%" }
return (
<div style={{ position:'absolute',right:0, width: "23%", height: "100%", marginRight: "1%", }}>
<Module style={style} customize={true} title={"车辆视频监控"}>
<div style={{ width: '90%', height: '96%', margin: '2% 5%', overflow: 'hidden' }}>
<Carousel
{/* <Carousel
autoplay
infinite
autoplaySpeed={300000}
@ -62,7 +62,7 @@ const Right = () => {
</div>
))
}
</Carousel>
</Carousel> */}
</div>
</Module>
</div>

2
web/config.js

@ -21,7 +21,7 @@ args.option('qndmn', '七牛');
const flags = args.parse(process.argv);
const FS_UNIAPP_API = process.env.FS_UNIAPP_API || flags.apiUrl;
const QINIU_DOMAIN_QNDMN_RESOURCE = process.env.ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURC || flags.qndmn;
const QINIU_DOMAIN_QNDMN_RESOURCE = process.env.ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE || flags.qndmn;
const API_URL = process.env.API_URL || flags.apiUrl;
if (!FS_UNIAPP_API) {

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:4000 --qndmn http://rfkimpwbb.hn-bkt.clouddn.com",
"start-params": "node server -p 5000 -u http://localhost:14000 --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",

14
web/routes/attachment/index.js

@ -18,9 +18,13 @@ const ext = {
module.exports = {
entry: function (app, router, opts) {
const getApiRoot = async function (ctx) {
const { apiUrl, qndmn } = opts;
ctx.status = 200;
ctx.body = { root: apiUrl, qndmn };
try {
const { apiUrl, qndmn } = opts;
ctx.status = 200;
ctx.body = { root: apiUrl, qndmn };
} catch (error) {
console.error('getApiRoot', error)
}
};
let upload = async function (ctx, next) {
@ -84,7 +88,7 @@ module.exports = {
}
router.get('/api/root', getApiRoot);
router.post('/_upload/new', upload);
router.delete('/_upload/cleanup', remove);
// router.post('/_upload/new', upload);
// router.delete('/_upload/cleanup', remove);
}
};

Loading…
Cancel
Save