diff --git a/api/.vscode/launch.json b/api/.vscode/launch.json index 35dd29e4..d82da15e 100644 --- a/api/.vscode/launch.json +++ b/api/.vscode/launch.json @@ -13,7 +13,7 @@ "NODE_ENV": "development" }, "args": [ - "-p 4000", + "-p 14000", "-f http://localhost:4000", "-g postgres://postgres:123@10.8.30.32:5432/highways4good", "--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5", diff --git a/api/app/lib/controllers/data/index.js b/api/app/lib/controllers/data/index.js index ab91d22d..8112a750 100644 --- a/api/app/lib/controllers/data/index.js +++ b/api/app/lib/controllers/data/index.js @@ -104,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/models/report.js b/api/app/lib/models/report.js index 3d1d39c6..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 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..61c68e0c 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 == 'birdge') { + 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/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/web/client/src/sections/fillion/components/infor/videoUpload.js b/web/client/src/sections/fillion/components/infor/videoUpload.js index 2f1a5607..a180ae90 100644 --- a/web/client/src/sections/fillion/components/infor/videoUpload.js +++ b/web/client/src/sections/fillion/components/infor/videoUpload.js @@ -36,6 +36,7 @@ const VideoUpload = (props) => { setCounts(res.payload.data) }) }) + form.resetFields() setIsModalVisible(false); } ); diff --git a/web/client/src/sections/fillion/components/inforTable.js b/web/client/src/sections/fillion/components/inforTable.js index 88738971..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) => { @@ -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) + }} + >