diff --git a/api/.vscode/launch.json b/api/.vscode/launch.json index eaa8220c..d82da15e 100644 --- a/api/.vscode/launch.json +++ b/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", diff --git a/api/app/lib/controllers/data/index.js b/api/app/lib/controllers/data/index.js index 4dc8cb25..8112a750 100644 --- a/api/app/lib/controllers/data/index.js +++ b/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; diff --git a/api/app/lib/controllers/organization/department.js b/api/app/lib/controllers/organization/department.js index 9e55dc35..f6e64304 100644 --- a/api/app/lib/controllers/organization/department.js +++ b/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) { diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index bbaf89c6..c098336e 100644 --- a/api/app/lib/controllers/report/index.js +++ b/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; diff --git a/api/app/lib/models/report.js b/api/app/lib/models/report.js index 2eaa09b6..0a49fba5 100644 --- a/api/app/lib/models/report.js +++ b/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 diff --git a/api/config.js b/api/config.js index d922a118..109b5bad 100644 --- a/api/config.js +++ b/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, diff --git a/api/log/development.log b/api/log/development.log index 5c96f980..048eb327 100644 --- a/api/log/development.log +++ b/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. diff --git a/api/utils/xlsxDownload.js b/api/utils/xlsxDownload.js index 08b51045..a8dc0c2f 100644 --- a/api/utils/xlsxDownload.js +++ b/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 } } diff --git a/jenkinsfile_script_init_report_pic_data b/jenkinsfile_script_init_report_pic_data new file mode 100644 index 00000000..340871e8 --- /dev/null +++ b/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}' + } + } + } +} \ No newline at end of file diff --git a/scripts/0.0.1/data/3_init_report_pic_data/Dockerfile b/scripts/0.0.1/data/3_init_report_pic_data/Dockerfile new file mode 100644 index 00000000..d0293a8f --- /dev/null +++ b/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"] \ No newline at end of file diff --git a/scripts/0.0.1/data/3_init_report_pic_data/index.js b/scripts/0.0.1/data/3_init_report_pic_data/index.js index 5ef08acb..20da189b 100644 --- a/scripts/0.0.1/data/3_init_report_pic_data/index.js +++ b/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' diff --git a/scripts/0.0.1/data/4_file_type_data.sql b/scripts/0.0.1/data/4_file_type_data.sql new file mode 100644 index 00000000..b22bbe92 --- /dev/null +++ b/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; diff --git a/weapp/src/config.js b/weapp/src/config.js index d2cb8303..329a027e 100644 --- a/weapp/src/config.js +++ b/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 }; diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx index b4cbdbf5..abe505fc 100644 --- a/weapp/src/packages/patrol/index.jsx +++ b/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 = () => { 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} /> } diff --git a/weapp/src/pages/home/index.jsx b/weapp/src/pages/home/index.jsx index fde2864b..b6a3166c 100644 --- a/weapp/src/pages/home/index.jsx +++ b/weapp/src/pages/home/index.jsx @@ -51,13 +51,13 @@ const Index = () => { {isSuperAdmin ? '查看' : '填报'} - { + {/* { isSuperAdmin && 视 频 监 控 查看 - } + } */} ); } diff --git a/weapp/src/pages/user/index.jsx b/weapp/src/pages/user/index.jsx index 7108d37e..bc96468d 100644 --- a/weapp/src/pages/user/index.jsx +++ b/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' }); diff --git a/weapp/src/services/api.js b/weapp/src/services/api.js index cecf30b2..2bd2ba09 100644 --- a/weapp/src/services/api.js +++ b/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` diff --git a/web/client/src/sections/fillion/actions/infor.js b/web/client/src/sections/fillion/actions/infor.js index 83837a88..b06d0c5f 100644 --- a/web/client/src/sections/fillion/actions/infor.js +++ b/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' } }); } \ No newline at end of file diff --git a/web/client/src/sections/fillion/components/bridgeTable.js b/web/client/src/sections/fillion/components/bridgeTable.js index 770a0e84..1e22bc37 100644 --- a/web/client/src/sections/fillion/components/bridgeTable.js +++ b/web/client/src/sections/fillion/components/bridgeTable.js @@ -1534,13 +1534,13 @@ const BrideTable = (props) => { > 新增 - + */} @@ -1717,13 +1717,13 @@ const BrideTable = (props) => { > 新增 - + */} diff --git a/web/client/src/sections/fillion/components/gis/patrolGis.js b/web/client/src/sections/fillion/components/gis/patrolGis.js index 2d15fbc5..cf422dde 100644 --- a/web/client/src/sections/fillion/components/gis/patrolGis.js +++ b/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) {
{ setDateRange(dateString) }} + defaultValue={dateRange} />
{mapObj ? : ''} diff --git a/web/client/src/sections/fillion/components/highwaysTable.js b/web/client/src/sections/fillion/components/highwaysTable.js index ccb7dd53..cc47a244 100644 --- a/web/client/src/sections/fillion/components/highwaysTable.js +++ b/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' diff --git a/web/client/src/sections/fillion/components/infor/videoUpload.js b/web/client/src/sections/fillion/components/infor/videoUpload.js index 0bfc3c40..a180ae90 100644 --- a/web/client/src/sections/fillion/components/infor/videoUpload.js +++ b/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) => {
{ props.type_ys ?
- +
{ ]} > @@ -178,9 +180,15 @@ const VideoUpload = (props) => { diff --git a/web/client/src/sections/fillion/components/inforTable.js b/web/client/src/sections/fillion/components/inforTable.js index fd616f41..91779539 100644 --- a/web/client/src/sections/fillion/components/inforTable.js +++ b/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) => { > 新增 - + */}
@@ -447,10 +447,13 @@ const InForTable = (props) => { defaultCollapsed: false, optionRender: (searchConfig, formProps, dom) => [ ...dom.reverse(), - { - // console.log(rowSelected) - - props.exports(rowSelected, counts) }}> + { + // console.log(rowSelected) + rowSelected.length === 0 ? null : props.exports(rowSelected, counts) + }} + > - +
@@ -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) => { diff --git a/web/client/src/sections/fillion/components/operationalTable.js b/web/client/src/sections/fillion/components/operationalTable.js index d61da928..79d5fff3 100644 --- a/web/client/src/sections/fillion/components/operationalTable.js +++ b/web/client/src/sections/fillion/components/operationalTable.js @@ -723,7 +723,7 @@ const OperaTionalTable = (props) => { > 新增 - + */} @@ -1356,7 +1356,7 @@ const OperaTionalTable = (props) => { > 新增 - + */} @@ -1826,7 +1826,7 @@ const OperaTionalTable = (props) => { > 新增 - + */} @@ -1848,6 +1848,9 @@ const OperaTionalTable = (props) => {
{ }, { key: 'tab4', label: { - setDifferentiate('business') - setRewkeys('yehu') + setDifferentiate('business') + setRewkeys('yehu') }}>业户{activeKey === 'tab4'}, }, @@ -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) ? { props.exports(rowSelected,differentiate,genre) }}> + ['tab2', 'tab3', 'tab4'].includes(activeKey) ? { props.exports(rowSelected, differentiate, genre) }}> - +
: '' } {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) => { diff --git a/web/client/src/sections/fillion/components/protable.less b/web/client/src/sections/fillion/components/protable.less index 6d66a5df..d8476511 100644 --- a/web/client/src/sections/fillion/components/protable.less +++ b/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 } diff --git a/web/client/src/sections/fillion/components/publicTable.js b/web/client/src/sections/fillion/components/publicTable.js index d8035979..c16271a1 100644 --- a/web/client/src/sections/fillion/components/publicTable.js +++ b/web/client/src/sections/fillion/components/publicTable.js @@ -434,7 +434,7 @@ const PublicTable = (props) => { > 新增 - + */} @@ -1129,7 +1129,7 @@ const PublicTable = (props) => { > 新增 - + */} @@ -1231,7 +1231,7 @@ const PublicTable = (props) => { defaultCollapsed: false, optionRender: (searchConfig, formProps, dom) => [ ...dom.reverse(), - { props.exports(rowSelected, counts) }}> + { props.exports(rowSelected,rewkeys ) }}> - + */} ); }, @@ -2363,7 +2363,7 @@ const TransporTationTable = (props) => { > 新增 - + */} @@ -3519,7 +3519,7 @@ const TransporTationTable = (props) => { > 新增 - + */} @@ -3706,13 +3706,13 @@ const TransporTationTable = (props) => { > 新增 - + */} diff --git a/web/client/src/sections/fillion/containers/maintenance.js b/web/client/src/sections/fillion/containers/maintenance.js index 6c36021e..d08a032d 100644 --- a/web/client/src/sections/fillion/containers/maintenance.js +++ b/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 ( <> diff --git a/web/client/src/sections/fillion/containers/patrol.js b/web/client/src/sections/fillion/containers/patrol.js index 3372ad0a..df84bd81 100644 --- a/web/client/src/sections/fillion/containers/patrol.js +++ b/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 ( <> diff --git a/web/client/src/sections/fillion/containers/public.js b/web/client/src/sections/fillion/containers/public.js index 6d0fcbcd..dde431dc 100644 --- a/web/client/src/sections/fillion/containers/public.js +++ b/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 ( <> diff --git a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js index b731b69d..68919bd9 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js +++ b/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 ( diff --git a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/handong.js b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/handong.js index 1c194233..464ab6a0 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/handong.js +++ b/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 (
  • { 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 }) }, []) diff --git a/web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js b/web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js index 35f776a4..f9520cc5 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js +++ b/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); diff --git a/web/client/src/sections/quanju/containers/footer/leadership/left/echarts/lefttopecharts.js b/web/client/src/sections/quanju/containers/footer/leadership/left/echarts/lefttopecharts.js index 17aeace1..93dfadc3 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/left/echarts/lefttopecharts.js +++ b/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() diff --git a/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js b/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js index 16004033..c6c6bf1c 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js @@ -70,7 +70,7 @@ const Leftcenter = () => {
    - { + {/* { list.map((item, index) => { return index + 1 == num ?
    @@ -86,15 +86,15 @@ const Leftcenter = () => { }) - } + } */}
    - + /> */}
    ) diff --git a/web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js b/web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js index 373f10e0..efcae283 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/left/left-top.js +++ b/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 ( <> @@ -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%" }}>预测明日

    -

    {isNaN((speed + ((Math.random() * (6) - 3))).toFixed(2)) ? "" : (speed + ((Math.random() * (6) - 3))).toFixed(2)}Km/h

    +

    {isNaN(nums) ? "" : (nums)}Km/h

    diff --git a/web/client/src/sections/quanju/containers/footer/leadership/right/hudong.js b/web/client/src/sections/quanju/containers/footer/leadership/right/hudong.js index 98b76ca3..74a61d14 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/right/hudong.js +++ b/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++; diff --git a/web/client/src/sections/quanju/containers/footer/leadership/right/right-top.js b/web/client/src/sections/quanju/containers/footer/leadership/right/right-top.js index 6e126ce4..33f01995 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/right/right-top.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/right/right-top.js @@ -77,13 +77,13 @@ const Righttop = () => {
    -

    监控总数

    129

    -

    在线率

    88.87%

    + {/*

    监控总数

    129

    +

    在线率

    88.87%

    */}
    - + {/* */}
    - + */} {/*
    {size}
    */}
    - + {/* */}
    @@ -112,13 +112,13 @@ const Righttop = () => {
    {/* */} - + /> */} {/* */} diff --git a/web/client/src/sections/quanju/containers/footer/operation/right.js b/web/client/src/sections/quanju/containers/footer/operation/right.js index 05561a68..87407e3a 100644 --- a/web/client/src/sections/quanju/containers/footer/operation/right.js +++ b/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 (
    - {
    )) } - + */}
    diff --git a/web/config.js b/web/config.js index 4acfc2b1..babd0300 100644 --- a/web/config.js +++ b/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) { diff --git a/web/package.json b/web/package.json index b8aaf86a..7cd3d607 100644 --- a/web/package.json +++ b/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", diff --git a/web/routes/attachment/index.js b/web/routes/attachment/index.js index 08b8e007..f539d50f 100644 --- a/web/routes/attachment/index.js +++ b/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); } };