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": [ "args": [
"-p 14000", "-p 14000",
"-f http://localhost:14000", "-f http://localhost:4000",
"-g postgres://postgres:123@10.8.30.32:5432/highways4good", "-g postgres://postgres:123@10.8.30.32:5432/highways4good",
"--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5", "--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5",
"--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa", "--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa",

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

@ -55,6 +55,16 @@ async function dataExport (ctx) {
k: 'busCar', k: 'busCar',
tableName: 'BusCar', tableName: 'BusCar',
}, },
{
n: '巡更记录',
k: 'patrol',
tableName: 'Report',
},
{
n: '养护记录',
k: 'maintenance',
tableName: 'Report',
},
] ]
const modalOption = modalList.find(item => item.k == exp); const modalOption = modalList.find(item => item.k == exp);
@ -79,9 +89,13 @@ async function dataExport (ctx) {
const tableAttributes = models[modalOption.tableName].tableAttributes const tableAttributes = models[modalOption.tableName].tableAttributes
let header = [] let header = []
for (let k in tableAttributes) { 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({ header.push({
title: tableAttributes[k].comment || '-', title: comment || '-',
key: k, key: k,
index: tableAttributes[k].index, index: tableAttributes[k].index,
}) })
@ -90,7 +104,7 @@ async function dataExport (ctx) {
header.sort((a, b) => { return a.index - b.index }) header.sort((a, b) => { return a.index - b.index })
const fileName = `${modalOption.n}_${moment().format('YYYYMMDDHHmmss')}` + '.csv' 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); const fileData = fs.readFileSync(filePath);
ctx.status = 200; ctx.status = 200;

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

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

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

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

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

@ -21,7 +21,7 @@ module.exports = dc => {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: "上报类型 巡查:patrol / 养护:conserve", comment: "上报类型",
primaryKey: false, primaryKey: false,
field: "report_type", field: "report_type",
autoIncrement: false autoIncrement: false
@ -31,7 +31,7 @@ module.exports = dc => {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: "工程类型 道路:road / 桥梁:birdge / 涵洞:culvert", comment: "工程类型",
primaryKey: false, primaryKey: false,
field: "project_type", field: "project_type",
autoIncrement: false autoIncrement: false
@ -41,7 +41,7 @@ module.exports = dc => {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: '所属道路',
primaryKey: false, primaryKey: false,
field: "road", field: "road",
autoIncrement: false autoIncrement: false
@ -51,7 +51,7 @@ module.exports = dc => {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: '开始路段',
primaryKey: false, primaryKey: false,
field: "road_section_start", field: "road_section_start",
autoIncrement: false autoIncrement: false
@ -61,7 +61,7 @@ module.exports = dc => {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: '结束路段',
primaryKey: false, primaryKey: false,
field: "road_section_end", field: "road_section_end",
autoIncrement: false autoIncrement: false
@ -71,7 +71,7 @@ module.exports = dc => {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: '经度',
primaryKey: false, primaryKey: false,
field: "longitude", field: "longitude",
autoIncrement: false autoIncrement: false
@ -81,7 +81,7 @@ module.exports = dc => {
type: DataTypes.DOUBLE, type: DataTypes.DOUBLE,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: '纬度',
primaryKey: false, primaryKey: false,
field: "latitude", field: "latitude",
autoIncrement: false autoIncrement: false
@ -91,7 +91,7 @@ module.exports = dc => {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: '具体内容',
primaryKey: false, primaryKey: false,
field: "content", field: "content",
autoIncrement: false autoIncrement: false
@ -151,7 +151,7 @@ module.exports = dc => {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: null, comment: '创建日期',
primaryKey: false, primaryKey: false,
field: "time", field: "time",
autoIncrement: false autoIncrement: false
@ -161,7 +161,7 @@ module.exports = dc => {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: '具体位置',
primaryKey: false, primaryKey: false,
field: "address", field: "address",
autoIncrement: false 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 FS_UNIAPP_DB = process.env.FS_UNIAPP_DB || flags.pg;
// const LOCAL_SVR_ORIGIN = process.env.LOCAL_SVR_ORIGIN || flags.fileHost; // 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_BUCKET_RESOURCE = process.env.ANXINCLOUD_QINIU_BUCKET_RESOURCE || flags.qnbkt;
const QINIU_AK = process.env.ANXINCLOUD_QINIU_ACCESSKEY || flags.qnak; const QINIU_AK = process.env.ANXINCLOUD_QINIU_ACCESSKEY || flags.qnak;
const QINIU_SK = process.env.ANXINCLOUD_QINIU_SECRETKEY || flags.qnsk; const QINIU_SK = process.env.ANXINCLOUD_QINIU_SECRETKEY || flags.qnsk;
@ -52,7 +52,7 @@ const product = {
accessKey: QINIU_AK, accessKey: QINIU_AK,
secretKey: QINIU_SK secretKey: QINIU_SK
}, },
maxSize: 104857600, // 100M maxSize: 104857600 * 2, // 100M * 2
} }
}, { }, {
entry: require('./app').entry, 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.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-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 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`) const fileDirPath = path.join(__dirname, `../../downloadFiles`)
makeDir(fileDirPath) makeDir(fileDirPath)
const file = new xlsx.File(); const file = new xlsx.File();
@ -57,6 +57,33 @@ async function simpleExcelDown ({ data = [], header = [], fileName = moment().fo
for (let h of header) { for (let h of header) {
const cell = row.addCell(); const cell = row.addCell();
cell.value = data[i][h.key]; 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 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 qiniu = require('qiniu');
const uuidv4 = require('uuid/v4'); 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({ const pool = new Pool({
user: 'postgres', user: 'highwayadmin',
host: '10.8.30.32', host: '10.8.40.223',
database: 'highways4good', database: 'highway4good',
password: '123', password: 'highway123',
port: 5432, port: 5432,
}) })
// 7niu 验证 // 7niu 验证
const accessKey = 'XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5' const accessKey = '5XrM4wEB9YU6RQwT64sPzzE6cYFKZgssdP5Kj3uu'
const secretKey = 'yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa' const secretKey = 'w6j2ixR_i-aelc6I7S3HotKIX-ukMzcKmDfH6-M5'
const bucket = 'dev-highways4good' 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; let DEV = false;
DEV = true; //使用测试环境 // DEV = true; //使用测试环境
const baseConfig = { const baseConfig = {
errorHandle: false, //是否启用全局异常处理‌‍‍‌‍​‌‌‍​‌‌‌‌‌​‌‌‍‌​‍‌‌‌‌​‍‍‍‍‌​‌‍‍‌‍​‌‌‍​‍‍‍‌‌​‍‌‌‌‌​‍‌‍‌​‍‌‌‌O errorHandle: false, //是否启用全局异常处理‌‍‍‌‍​‌‌‍​‌‌‌‌‌​‌‌‍‌​‍‌‌‌‌​‍‍‍‍‌​‌‍‍‌‍​‌‌‍​‍‍‍‌‌​‍‌‌‌‌​‍‌‍‌​‍‌‌‌O
@ -8,20 +8,22 @@ const baseConfig = {
}; };
const development = { const development = {
// baseUrl: 'http://221.230.55.29:31919', baseUrl: 'http://221.230.55.29:31919',
baseUrl: 'https://c5a6-117-90-37-10.ap.ngrok.io', // baseUrl: 'https://d763-117-90-37-10.ap.ngrok.io',
// webUrl: 'https://smartwater.anxinyun.cn', // webUrl: 'https://smartwater.anxinyun.cn',
// pcode: 'fce4afe2-5b6a-408a-ab18-a2afa7fa027c', // 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, //开启异步请求缓存 // requestCache: true, //开启异步请求缓存
...baseConfig ...baseConfig
}; };
const production = { const production = {
baseUrl: 'https://wxapp.free-sun.vip/v1/api', baseUrl: 'https://sihao.anxinyun.cn/_api',
webUrl: 'http://218.3.150.105:8998', // baseUrl: 'https://d763-117-90-37-10.ap.ngrok.io',
pcode: 'b3718361-f7db-4058-98a6-071393d0420c', // webUrl: 'https://smartwater.anxinyun.cn',
imgUrl: 'http://test.resources.anxinyun.cn/', // pcode: 'fce4afe2-5b6a-408a-ab18-a2afa7fa027c',
imgUrl: 'http://resources.anxinyun.cn/',
...baseConfig ...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 { AtButton, AtTextarea, AtImagePicker } from 'taro-ui';
import InputPicker from '../components/inputPicker'; import InputPicker from '../components/inputPicker';
import request from '@/services/request'; 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 './index.scss';
import arrowIcon from '../../static/img/patrol/arrow-down.svg'; import arrowIcon from '../../static/img/patrol/arrow-down.svg';
const { baseUrl, imgUrl } = environment;
const Index = () => { const Index = () => {
const userInfo = Taro.getStorageSync('userInfo') || {}; const userInfo = Taro.getStorageSync('userInfo') || {};
const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false const isSuperAdmin = userInfo && userInfo.username === 'SuperAdmin' ? true : false
@ -30,15 +34,20 @@ const Index = () => {
const [longitude, setLongitude] = useState(0) // const [longitude, setLongitude] = useState(0) //
const [latitude, setLatitude] = 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 [sourceRoadSel, setSourceRoadSel] = useState([])
const [sourceRoadStartSel, setSourceRoadStartSel] = useState([]) const [sourceRoadStartSel, setSourceRoadStartSel] = useState([])
const [sourceRoadEndSel, setSourceRoadEndSel] = useState([]) const [sourceRoadEndSel, setSourceRoadEndSel] = useState([])
const prjType = [ const prjType = [
{ text: '道路', value: 'road'}, { text: '道路', value: 'road' },
{ text: '桥梁', value: 'bridge'}, { text: '桥梁', value: 'bridge' },
{ text: '涵洞', value: 'culvert'}, { text: '涵洞', value: 'culvert' },
{ text: '其他', value: 'other'}, { text: '其他', value: 'other' },
] ]
const prjTypeSelector = ['道路', '桥梁', '涵洞', '其他'] const prjTypeSelector = ['道路', '桥梁', '涵洞', '其他']
const [roadStartSel, setRoadStartSel] = useState([]) const [roadStartSel, setRoadStartSel] = useState([])
@ -80,10 +89,10 @@ const Index = () => {
setRoadSectionEnd(data.roadSectionEnd) setRoadSectionEnd(data.roadSectionEnd)
setAddress(data.address) setAddress(data.address)
setContent(data.content) setContent(data.content)
setScenePic(data.scenePic ? data.scenePic.map(item => ({ url: item })) : []) setScenePic(data.scenePic ? data.scenePic.map(item => ({ url: imgUrl + item })) : [])
setConserveBeforePic(data.conserveBeforePic ? data.conserveBeforePic.map(item => ({ url: item })) : []) setConserveBeforePic(data.conserveBeforePic ? data.conserveBeforePic.map(item => ({ url: imgUrl + item })) : [])
setConserveUnderwayPic(data.conserveUnderwayPic ? data.conserveUnderwayPic.map(item => ({ url: item })) : []) setConserveUnderwayPic(data.conserveUnderwayPic ? data.conserveUnderwayPic.map(item => ({ url: imgUrl + item })) : [])
setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: item })) : []) setConserveAfterPic(data.conserveAfterPic ? data.conserveAfterPic.map(item => ({ url: imgUrl + item })) : [])
} else { } else {
Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' }) Taro.showToast({ title: res.data.message || '请求出错', icon: 'none' })
} }
@ -162,6 +171,10 @@ const Index = () => {
Taro.showToast({ title: '工程类型错误', icon: 'none' }) Taro.showToast({ title: '工程类型错误', icon: 'none' })
return return
} }
if (content.length > 50) {
Taro.showToast({ title: '内容字数不能超过50', icon: 'none' })
return
}
const reportProjectType = prjType[prjTypeSelector.indexOf(projectType)].value const reportProjectType = prjType[prjTypeSelector.indexOf(projectType)].value
let data = { let data = {
@ -176,11 +189,11 @@ const Index = () => {
latitude latitude
} }
if (reportType === 'patrol') { if (reportType === 'patrol') {
data['scenePic'] = scenePic.length > 0 ? scenePic.map(item => item.url) : null data['scenePic'] = sceneImg
} else { } else {
data['conserveBeforePic'] = conserveBeforePic.length > 0 ? conserveBeforePic.map(item => item.url) : null data['conserveBeforePic'] = conserveBeforeImg
data['conserveUnderwayPic'] = conserveUnderwayPic.length > 0 ? conserveUnderwayPic.map(item => item.url) : null data['conserveUnderwayPic'] = conserveUnderwayImg
data['conserveAfterPic'] = conserveAfterPic.length > 0 ? conserveAfterPic.map(item => item.url) : null data['conserveAfterPic'] = conserveAfterImg
} }
Taro.showModal({ Taro.showModal({
@ -272,24 +285,97 @@ const Index = () => {
setReportType(e.detail.value) setReportType(e.detail.value)
} }
function handleImgChange(files, type) { function handleImgChange(files, operationType, index, type) {
switch (type) { if (operationType === 'remove') {
case 'scenePic': setImg(false)
setScenePic(files) }
break; function setImg(isAdd, url) {
case 'conserveBeforePic': switch (type) {
setConserveBeforePic(files) case 'scenePic':
break; let nextImg = sceneImg
case 'conserveUnderwayPic': if (isAdd) {
setConserveUnderwayPic(files) nextImg.push(url)
break; } else {
case 'conserveAfterPic': nextImg.splice(index, 1)
setConserveAfterPic(files) }
break; setSceneImg(nextImg)
default: setScenePic(files)
break; 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) { function handleImgClick(index, file) {
Taro.previewImage({ Taro.previewImage({
urls: [file.url] // http urls: [file.url] // http
@ -397,7 +483,7 @@ const Index = () => {
<AtTextarea <AtTextarea
title='巡查内容:' title='巡查内容:'
placeholder={isView ? '' : '请输入巡查内容'} placeholder={isView ? '' : '请输入具体内容'}
value={content} value={content}
onChange={(v, e) => handleInput(e, 'content')} onChange={(v, e) => handleInput(e, 'content')}
disabled={isView} disabled={isView}
@ -419,7 +505,7 @@ const Index = () => {
count={3 - scenePic.length} count={3 - scenePic.length}
showAddBtn={scenePic.length >= 3 ? false : true} showAddBtn={scenePic.length >= 3 ? false : true}
files={scenePic} files={scenePic}
onChange={files => handleImgChange(files, 'scenePic')} onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'scenePic')}
onImageClick={handleImgClick} onImageClick={handleImgClick}
/> />
} }
@ -442,7 +528,7 @@ const Index = () => {
count={3 - conserveBeforePic.length} count={3 - conserveBeforePic.length}
showAddBtn={conserveBeforePic.length >= 3 ? false : true} showAddBtn={conserveBeforePic.length >= 3 ? false : true}
files={conserveBeforePic} files={conserveBeforePic}
onChange={files => handleImgChange(files, 'conserveBeforePic')} onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'conserveBeforePic')}
onImageClick={handleImgClick} onImageClick={handleImgClick}
/> />
} }
@ -462,7 +548,7 @@ const Index = () => {
count={3 - conserveUnderwayPic.length} count={3 - conserveUnderwayPic.length}
showAddBtn={conserveUnderwayPic.length >= 3 ? false : true} showAddBtn={conserveUnderwayPic.length >= 3 ? false : true}
files={conserveUnderwayPic} files={conserveUnderwayPic}
onChange={files => handleImgChange(files, 'conserveUnderwayPic')} onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'conserveUnderwayPic')}
onImageClick={handleImgClick} onImageClick={handleImgClick}
/> />
} }
@ -483,7 +569,7 @@ const Index = () => {
count={3 - conserveAfterPic.length} count={3 - conserveAfterPic.length}
showAddBtn={conserveAfterPic.length >= 3 ? false : true} showAddBtn={conserveAfterPic.length >= 3 ? false : true}
files={conserveAfterPic} files={conserveAfterPic}
onChange={files => handleImgChange(files, 'conserveAfterPic')} onChange={(files, operationType, index) => handleImgChange(files, operationType, index, 'conserveAfterPic')}
onImageClick={handleImgClick} onImageClick={handleImgClick}
/> />
} }

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

@ -51,13 +51,13 @@ const Index = () => {
{isSuperAdmin ? '查看' : '填报'} {isSuperAdmin ? '查看' : '填报'}
</View> </View>
</View> </View>
{ {/* {
isSuperAdmin && isSuperAdmin &&
<View className='card video'> <View className='card video'>
<View className='title'> </View> <View className='title'> </View>
<View className='btn' onClick={toVideo}>查看</View> <View className='btn' onClick={toVideo}>查看</View>
</View> </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 { logout } from '@/actions/auth';
import { getLogoutUrl } from '@/services/api'; import { getLogoutUrl } from '@/services/api';
import cfg from '../../config'; import cfg from '../../config';
import { getState } from '../../store/globalState';
import './index.scss'; import './index.scss';
import headImg from '../../static/img/my/head.png'; import headImg from '../../static/img/my/head.png';
import moreImg from '../../static/img/my/more.svg'; import moreImg from '../../static/img/my/more.svg';
@ -39,8 +40,9 @@ const Index = ({ ...props }) => {
title: '提示', title: '提示',
content: '确定退出登录吗', content: '确定退出登录吗',
success: function (res) { success: function (res) {
let token = getState('token') || Taro.getStorageSync('token')
if (res.confirm) { if (res.confirm) {
logout(getLogoutUrl()).then(() => { logout(getLogoutUrl(), { token }).then(() => {
Taro.reLaunch({ Taro.reLaunch({
url: '/pages/auth/login/login' url: '/pages/auth/login/login'
}); });

5
weapp/src/services/api.js

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

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

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

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

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

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

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

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

@ -37,6 +37,7 @@ const hightModal = (type, record) => {
dataIndex: 'placeName', dataIndex: 'placeName',
fixed: 'left', fixed: 'left',
width: 120, width: 120,
search: false,
options: 1, options: 1,
backgroundColor: "#ffffff", backgroundColor: "#ffffff",
fieldProps: { fieldProps: {
@ -91,6 +92,9 @@ const hightModal = (type, record) => {
actionRef={ref} actionRef={ref}
scroll={{ x: 800 }} scroll={{ x: 800 }}
options={false} options={false}
form={{
submitter:false
}}
// ref={c => { finishedProductTable = c; }} // ref={c => { finishedProductTable = c; }}
style={{ width: "100% ", overflow: "auto", height: '760px' }} style={{ width: "100% ", overflow: "auto", height: '760px' }}
rowKey='id' 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 VideoUpload = (props) => {
const { dispatch, record, counts, setCounts } = props const { dispatch, record, counts, setCounts } = props
const [form] = Form.useForm(); const [form] = Form.useForm();
@ -20,11 +19,9 @@ const VideoUpload = (props) => {
} }
const showModalEdit = () => { const showModalEdit = () => {
setIsModalVisible(true); setIsModalVisible(true);
}; };
//新增 //新增
const handleOkAdd = () => { const handleOkAdd = () => {
form.validateFields().then((values) => { form.validateFields().then((values) => {
@ -39,6 +36,7 @@ const VideoUpload = (props) => {
setCounts(res.payload.data) setCounts(res.payload.data)
}) })
}) })
form.resetFields()
setIsModalVisible(false); setIsModalVisible(false);
} }
); );
@ -49,24 +47,28 @@ const VideoUpload = (props) => {
form.validateFields().then((values) => { form.validateFields().then((values) => {
const videoname = values.username const videoname = values.username
const id = record.id const id = record.id
const video = record.video const newVideoAddress = values.video.map((item) => {
return item.storageUrl
const data = { publicityId: id, name: videoname, video: video } })
const data = { publicityId: id, name: videoname, video: newVideoAddress }
dispatch(putEditPropagata(data)).then(() => { dispatch(putEditPropagata(data)).then(() => {
dispatch(getPropagata()).then((res) => { dispatch(getPropagata()).then((res) => {
setCounts(res.payload.data) setCounts(res.payload.data)
console.log(data);
}) })
}) })
setIsModalVisible(false);
} }
); );
setIsModalVisible(false);
}; };
const handleCancel = () => { const handleCancel = () => {
setIsModalVisible(false); setIsModalVisible(false);
}; };
const handleCancelEdit = () => {
setIsModalVisible(false);
form.resetFields()
};
const onFinish = (values) => { const onFinish = (values) => {
console.log('Success:', values); console.log('Success:', values);
@ -80,7 +82,7 @@ const VideoUpload = (props) => {
<div > <div >
{ {
props.type_ys ? <div><Button type='primary' onClick={showModal}>新增</Button> 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={form} form={form}
name="basic" name="basic"
@ -123,7 +125,7 @@ const VideoUpload = (props) => {
]} ]}
> >
<Uploads <Uploads
maxFilesNum={10} maxFilesNum={1}
fileTypes={['mp4']} fileTypes={['mp4']}
maxFileSize={200} maxFileSize={200}
/> />
@ -178,9 +180,15 @@ const VideoUpload = (props) => {
<Form.Item <Form.Item
label="选择视频" label="选择视频"
name="video" name="video"
rules={[
{
required: true,
message: '必须上传视频!',
},
]}
> >
<Uploads <Uploads
maxFilesNum={10} maxFilesNum={1}
fileTypes={['mp4']} fileTypes={['mp4']}
maxFileSize={200} maxFileSize={200}
/> />

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

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

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

@ -12,8 +12,9 @@ import moment from 'moment';
const DetailForm = (props) => { const DetailForm = (props) => {
const { visible, data, handleClose, loading } = props; const { visible, data, handleClose, loading } = props;
const [qndmn] = useState(localStorage.getItem('qndmn'));
const keyList = [ const keyList = [
{ key: '编号', name: 'id' }, // { key: '编号', name: 'id' },
{ key: '工程类型', name: 'projectType' }, { key: '工程类型', name: 'projectType' },
{ key: '所在路段', name: 'road' }, { key: '所在路段', name: 'road' },
{ key: '具体位置', name: 'address' }, { key: '具体位置', name: 'address' },
@ -37,7 +38,7 @@ const DetailForm = (props) => {
{ {
data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => { data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
return <div style={{ width: '44%', margin: 6 }}> 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> </div>
}) : '暂无图片' }) : '暂无图片'
} }
@ -90,6 +91,9 @@ const DetailList = (props) => {
} }
} }
let basicDate = null;
let counter = 0;
const columns = [ const columns = [
{ {
title: '编号', title: '编号',
@ -97,7 +101,31 @@ const DetailList = (props) => {
dataIndex: 'id', dataIndex: 'id',
align: 'center', align: 'center',
render: (text, record) => { 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: '所属道路', title: '所属道路',
@ -114,19 +142,19 @@ const DetailList = (props) => {
} }
}, },
{ {
title: '缺陷名称', title: '具体内容',
key: 'content', key: 'content',
dataIndex: 'content', dataIndex: 'content',
align: 'center' align: 'center'
}, },
{ {
title: '巡查人', title: '养护人',
width: 100, width: 100,
key: 'userName', key: 'userName',
dataIndex: 'userName', dataIndex: 'userName',
align: 'center', align: 'center',
render: (text, record) => { render: (text, record) => {
return record.user.name return record?.user?.name
} }
}, { }, {
title: '上报时间', title: '上报时间',
@ -186,10 +214,17 @@ const DetailList = (props) => {
const PatrolNameList = (props) => { const PatrolNameList = (props) => {
const [users, setUsers] = useState([]); const [users, setUsers] = useState([]);
const { onChange, record, userList, loading } = props; 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 = [ const columns = [
{ {
title: '巡更人员', title: '养护人员',
key: 'name', key: 'name',
dataIndex: 'name', dataIndex: 'name',
align: 'center' align: 'center'
@ -225,7 +260,7 @@ const PatrolNameList = (props) => {
loading={loading} loading={loading}
rowKey="name" rowKey="name"
rowClassName={(record) => { rowClassName={(record) => {
return record.patrolName === name ? styles['split-row-select-active'] : ''; return record.id == selectRoad ? 'list-row-actived' : '';
}} }}
toolBarRender={() => [ toolBarRender={() => [
<Input placeholder='输入养护人员名称' onChange={doUserNameSearch} ></Input> <Input placeholder='输入养护人员名称' onChange={doUserNameSearch} ></Input>
@ -237,7 +272,7 @@ const PatrolNameList = (props) => {
return { return {
onClick: () => { onClick: () => {
if (record) { if (record) {
console.log('record:', record) setSelectRoad(record.id);
onChange(record); onChange(record);
} }
}, },
@ -251,7 +286,7 @@ const PatrolNameList = (props) => {
const MaintenanceTable = (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 [record, setRecord] = useState();
const [dateRange, setDateRange] = useState(); const [dateRange, setDateRange] = useState();
const [detailVisible, setDetailVisible] = useState(false) const [detailVisible, setDetailVisible] = useState(false)
@ -268,7 +303,7 @@ const MaintenanceTable = (props) => {
useEffect(() => { useEffect(() => {
if (record) { 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] != '')) { if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss') 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') query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
@ -285,10 +320,17 @@ const MaintenanceTable = (props) => {
} }
const handelRefresh = () => { const handelRefresh = () => {
let query = { userId: record.id, reportType: 'patrol' } let query = { userId: record.id, reportType: 'patrol', asc: true }
dispatch(getReportList(query)); dispatch(getReportList(query));
} }
const handleExport = () => {
if (reportList && reportList instanceof Array && reportList.length) {
let ids = reportList.map(item => item.id);
exports(ids);
}
}
return ( return (
<div className='card-protable'> <div className='card-protable'>
<Card > <Card >
@ -298,7 +340,7 @@ const MaintenanceTable = (props) => {
<div style={{ marginBottom: 20 }}> <div style={{ marginBottom: 20 }}>
<RangePicker onChange={(date, dateString) => { setDateRange(dateString) }} /> <RangePicker onChange={(date, dateString) => { setDateRange(dateString) }} />
<Button style={{ marginLeft: 20 }}>查询</Button> <Button style={{ marginLeft: 20 }}>查询</Button>
<Button style={{ marginLeft: 20 }}>导出</Button> <Button style={{ marginLeft: 20 }} onClick={handleExport}>导出</Button>
</div> </div>
<Card style={{ flex: 1 }}> <Card style={{ flex: 1 }}>
<DetailList reportList={reportList} record={record} loading={reportListLoading} dispatch={dispatch} handleOpen={handleOpen} /> <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 { auth, depMessage, userList, reportList, reportDetail } = state;
const pakData = (dep) => { const pakData = (dep) => {
return dep.map((d) => { return dep.map((d) => {

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

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

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

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

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

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

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

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

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

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

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

@ -22,18 +22,10 @@ const Maintenance = (props) => {
//批量导出 //批量导出
const exports = (ids, counts) => { const exports = (ids, counts) => {
// console.log(user); // console.log(user);
let reportIds = []; let reportIds = ids.toString();
if (ids.length) window.open(
reportIds = ids '/_api/' +
else `data/export?exp=patrol&ids=${reportIds}&token=${user.token}`)
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}`)
})
} }
return ( return (
<> <MaintenanceTable data={data} exports={exports} /> <> <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) => { const exports = (ids, counts) => {
// console.log(user); // console.log(user);
let reportIds = []; let reportIds = ids.toString();
if (ids.length) window.open(
reportIds = ids '/_api/' +
else `data/export?exp=patrol&ids=${reportIds}&token=${user.token}`)
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}`)
})
} }
return ( return (
<> <PatrolTable data={data} exports={exports} /> <> <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() const [data, setData] = useState()
useEffect(() => { useEffect(() => {
// dispatch(getDepMessage()) // dispatch(getDepMessage())
setData(props) setData(props)
}, []); }, []);
//批量导出 //批量导出
const exports = (ids,counts) => { const exports = (ids, rewkeys) => {
console.log(counts); let idas = ids.toString()
let idas=ids.toString() if (rewkeys === 'xianlu') {
window.open( window.open(
'/_api/'+`data/export/?ids=${idas||''}&exp=${'overspeed'}&token=${user.token}`) '/_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 ( return (
<> <PublicTable data={data} exports={exports} /> <> <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 // const
}) })
}, []) }, [])
console.log("1211", nums); // console.log("1211", nums);
const renderBody = () => { const renderBody = () => {
return ( 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) => { const daolus = dispatch(getdaolutongji()).then((res) => {
// console.log("[roads]", res.payload.data.roadType); // console.log("[roads]", res.payload.data.roadType);
setRoads(res.payload.data.townCulvert) setRoads(res.payload.data.townCulvert)
console.log(res.payload.data.townCulvert); // console.log(res.payload.data.townCulvert);
// const // const
}) })
}, []) }, [])
@ -39,7 +39,7 @@ const Right = (props) => {
{ {
list.map((item, index) => { list.map((item, index) => {
console.log(list); // console.log(list);
return ( return (
<li className={index} style={{ <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) => { const daolus = dispatch(getdaolutongji()).then((res) => {
// console.log("[roads]", res.payload.data.roadType); // console.log("[roads]", res.payload.data.roadType);
setRoads(res.payload.data.bridgeSize) setRoads(res.payload.data.bridgeSize)
console.log(res.payload.data.bridgeSize); // console.log(res.payload.data.bridgeSize);
// const // 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); const chartRef = useRef(null);
useEffect(() => { useEffect(() => {
var chartInstance = echarts.init(chartRef.current); 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) // setMass(res.payload.data.index)
// // setspeed(res.payload.data.speed) // // setspeed(res.payload.data.speed)
// }) // })
console.log(mass); // console.log(mass);
var chartInstance = echarts.init(chartRef.current); var chartInstance = echarts.init(chartRef.current);
// var dataArr = mass || 0; // var dataArr = mass || 0;
var names = names() var names = names()

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

@ -70,7 +70,7 @@ const Leftcenter = () => {
</div> </div>
<div style={{ width: "100%", height: "100%", marginTop: "3%" }}> <div style={{ width: "100%", height: "100%", marginTop: "3%" }}>
<div style={{ width: "60%", height: "100%", float: "left", marginLeft: "1%" }}> <div style={{ width: "60%", height: "100%", float: "left", marginLeft: "1%" }}>
{ {/* {
list.map((item, index) => { list.map((item, index) => {
return index + 1 == num ? return index + 1 == num ?
<div style={{ width: "100%", height: "100%", position: "relative" }}> <div style={{ width: "100%", height: "100%", position: "relative" }}>
@ -86,15 +86,15 @@ const Leftcenter = () => {
}) })
} } */}
</div> </div>
<Lunbo {/* <Lunbo
// canScroll={true} // canScroll={true}
content={renderBody()} content={renderBody()}
containerStyle={{ position: "relative", height: "100%", width: "35%", float: "right", marginRight: "2%", marginTop: "1%" }} containerStyle={{ position: "relative", height: "100%", width: "35%", float: "right", marginRight: "2%", marginTop: "1%" }}
divHeight={"100%"} divHeight={"100%"}
divId={"screen-slope-midde-top-jiangxi"} divId={"screen-slope-midde-top-jiangxi"}
/> /> */}
</div> </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 [mass, setMass] = useState()
const [speed, setspeed] = useState() const [speed, setspeed] = useState()
const [traffic, setTraffic] = useState() const [traffic, setTraffic] = useState()
const [tim, setTim] = useState()
const [nums, setNums] = useState()
useEffect(() => { useEffect(() => {
const shuju = dispatch(getGodshuju()).then((res) => { const shuju = dispatch(getGodshuju()).then((res) => {
// console.log(res); // console.log(res);
setMass(res.payload.data.index) setMass(res.payload.data.index)
// setMass(70) // setMass(70)
setspeed(res.payload.data.speed) 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(tim);
// console.log(mass);
return ( return (
<> <>
<Module style={style} title={"道路拥堵指数"} > <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)", fontSize: "14px", fontFamily: "PingFangSC-Regular, PingFang SC", color: "rgba(216,240,255,0.8000)",
position: "absolute", left: "30%", top: "65%" position: "absolute", left: "30%", top: "65%"
}}>预测明日</p> }}>预测明日</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>
</div> </div>

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

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

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

@ -77,13 +77,13 @@ const Righttop = () => {
<Module style={style} title={"路面执法监控"}> <Module style={style} title={"路面执法监控"}>
<div style={{ width: "100%", height: "65%", position: "relative" }}> <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: "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: "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" }}> <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%" }}> <div className='wy-rightTop' style={{ position: "absolute", right: "5%", top: "130%" }}>
<Select {/* <Select
size={size} size={size}
defaultValue="选择路段" defaultValue="选择路段"
onChange={handleChange} onChange={handleChange}
@ -94,14 +94,14 @@ const Righttop = () => {
}} }}
> >
{children} {children}
</Select> </Select> */}
{/* <div>{size}</div> */} {/* <div>{size}</div> */}
</div> </div>
</div> </div>
<div style={{ width: "100%", height: "80%", position: "relative", top: "10%" }}> <div style={{ width: "100%", height: "80%", position: "relative", top: "10%" }}>
<Huadong /> {/* <Huadong /> */}
</div> </div>
</div> </div>
<div style={{ width: "100%", height: "35%" }}> <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" }} /> <img src='/assets/images/leadership/zibiaoti.png' style={{ width: "94%", height: "34px", position: "absolute", top: "8px", left: "35px" }} />
</div> </div>
{/* <Spin tip="Loading..." spinning={num ? true : false} style={{ width: "100%", height: "100%" }}> */} {/* <Spin tip="Loading..." spinning={num ? true : false} style={{ width: "100%", height: "100%" }}> */}
<Lunbo {/* <Lunbo
// canScroll={true} // canScroll={true}
content={renderBody()} content={renderBody()}
containerStyle={{ position: "relative", height: "100%", width: "90%", left: "5%", top: "5%" }} containerStyle={{ position: "relative", height: "100%", width: "90%", left: "5%", top: "5%" }}
divHeight={"100%"} divHeight={"100%"}
divId={"screen-slope"} divId={"screen-slope"}
/> /> */}
{/* </Spin> */} {/* </Spin> */}
</div> </div>

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

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

2
web/config.js

@ -21,7 +21,7 @@ args.option('qndmn', '七牛');
const flags = args.parse(process.argv); const flags = args.parse(process.argv);
const FS_UNIAPP_API = process.env.FS_UNIAPP_API || flags.apiUrl; 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; const API_URL = process.env.API_URL || flags.apiUrl;
if (!FS_UNIAPP_API) { if (!FS_UNIAPP_API) {

2
web/package.json

@ -6,7 +6,7 @@
"scripts": { "scripts": {
"test": "mocha", "test": "mocha",
"start": "cross-env NODE_ENV=development npm run start-params", "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", "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-dev": "export NODE_ENV=development&&webpack --config webpack.config.js",
"build": "export NODE_ENV=production&&webpack --config webpack.config.prod.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 = { module.exports = {
entry: function (app, router, opts) { entry: function (app, router, opts) {
const getApiRoot = async function (ctx) { const getApiRoot = async function (ctx) {
const { apiUrl, qndmn } = opts; try {
ctx.status = 200; const { apiUrl, qndmn } = opts;
ctx.body = { root: apiUrl, qndmn }; ctx.status = 200;
ctx.body = { root: apiUrl, qndmn };
} catch (error) {
console.error('getApiRoot', error)
}
}; };
let upload = async function (ctx, next) { let upload = async function (ctx, next) {
@ -84,7 +88,7 @@ module.exports = {
} }
router.get('/api/root', getApiRoot); router.get('/api/root', getApiRoot);
router.post('/_upload/new', upload); // router.post('/_upload/new', upload);
router.delete('/_upload/cleanup', remove); // router.delete('/_upload/cleanup', remove);
} }
}; };

Loading…
Cancel
Save