diff --git a/api/app/lib/controllers/projectRegime/projectSituation.js b/api/app/lib/controllers/projectRegime/projectSituation.js index 375e404..c666f16 100644 --- a/api/app/lib/controllers/projectRegime/projectSituation.js +++ b/api/app/lib/controllers/projectRegime/projectSituation.js @@ -8,9 +8,9 @@ async function projectList (ctx, next) { const { limit, page, name, justStructure } = ctx.query; let options = { - // where: { + where: { - // }, + }, // include: [{ // as: 'company', // model: models.Company, @@ -211,6 +211,36 @@ async function delPosition (ctx, next) { } +async function qrCodeShow (ctx, next) { + try { + const models = ctx.fs.dc.models; + let userInfo = ctx.fs.api.userInfo; + const { projectId, name } = ctx.query; + + let options = { + where: { + qrCode: { $ne: null } + }, + } + if (projectId) { + options.where.projectId = projectId + } + if (name) { + options.where.name = { $like: `%${name}%` } + } + + let res = await models.Point.findAndCountAll(options) + ctx.status = 200; + ctx.body = res + } catch (error) { + ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); + ctx.status = 400; + ctx.body = { + "message": "获取二维码列表失败" + } + } +} + module.exports = { projectList, @@ -219,4 +249,5 @@ module.exports = { addPosition, position, delPosition, + qrCodeShow } \ No newline at end of file diff --git a/api/app/lib/routes/projectRegime/index.js b/api/app/lib/routes/projectRegime/index.js index e551acb..f1db955 100644 --- a/api/app/lib/routes/projectRegime/index.js +++ b/api/app/lib/routes/projectRegime/index.js @@ -22,4 +22,7 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['DEL/delPosition/:id'] = { content: '删除点位', visible: false }; router.del('/delPosition/:id', projectSituation.delPosition); + app.fs.api.logAttr['GET/qrCodeShow'] = { content: '获取二维码列表', visible: false }; + router.get('/qrCodeShow', projectSituation.qrCodeShow); + } \ No newline at end of file diff --git a/api/jenkinsfile b/api/jenkinsfile deleted file mode 100644 index 21ceefe..0000000 --- a/api/jenkinsfile +++ /dev/null @@ -1,18 +0,0 @@ -pipeline { - agent { - node{ - label 'jnlp-slave' - } - } - - stages { - stage('中鼎 api ......') { - steps { - buildName "#${BUILD_NUMBER} ~/smart-site/${JOB_NAME}:${IMAGE_VERSION}" - buildDescription "harbor.anxinyun.cn/smart-site/${JOB_NAME}:${IMAGE_VERSION}" - sh 'nerdctl build -t harbor.anxinyun.cn/smart-site/${JOB_NAME}:${IMAGE_VERSION} ./' - sh 'nerdctl push harbor.anxinyun.cn/smart-site/${JOB_NAME}:${IMAGE_VERSION}' - } - } - } -} \ No newline at end of file diff --git a/api/log/development.log b/api/log/development.log index 981072f..46f17c3 100644 --- a/api/log/development.log +++ b/api/log/development.log @@ -3849,3 +3849,19 @@ notNull Violation: project.describe cannot be null 2023-01-16 20:45:57.174 - debug: [FS-LOGGER] Init. 2023-01-16 20:45:57.417 - info: [FS-ATTACHMENT] Inject attachment mw into router. 2023-01-16 20:45:57.418 - info: [FS-AUTH] Inject auth and api mv into router. +2023-01-17 09:24:14.329 - debug: [FS-LOGGER] Init. +2023-01-17 09:24:15.116 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2023-01-17 09:24:15.117 - info: [FS-AUTH] Inject auth and api mv into router. +2023-01-17 09:26:37.752 - debug: [FS-LOGGER] Init. +2023-01-17 09:26:38.022 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2023-01-17 09:26:38.023 - info: [FS-AUTH] Inject auth and api mv into router. +2023-01-17 10:57:37.126 - error: path: /projectList, error: TypeError: Cannot set property 'name' of undefined +2023-01-17 10:58:25.341 - error: path: /projectList, error: TypeError: Cannot set property 'name' of undefined +2023-01-17 10:58:51.005 - error: path: /projectList, error: TypeError: Cannot set property 'name' of undefined +2023-01-17 10:59:00.752 - error: path: /projectList, error: TypeError: Cannot set property 'name' of undefined +2023-01-17 10:59:06.553 - error: path: /projectList, error: TypeError: Cannot set property 'name' of undefined +2023-01-17 10:59:10.971 - error: path: /projectList, error: TypeError: Cannot set property 'name' of undefined +2023-01-17 10:59:45.469 - error: path: /projectList, error: TypeError: Cannot set property 'name' of undefined +2023-01-17 11:00:49.835 - debug: [FS-LOGGER] Init. +2023-01-17 11:00:50.799 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2023-01-17 11:00:50.799 - info: [FS-AUTH] Inject auth and api mv into router. diff --git a/jenkinsfile_api b/jenkinsfile_api new file mode 100644 index 0000000..ef6c939 --- /dev/null +++ b/jenkinsfile_api @@ -0,0 +1,18 @@ +pipeline { + agent { + node{ + label 'jnlp-slave' + } + } + + stages { + stage('巡检 api ......') { + steps { + buildName "#${BUILD_NUMBER} ~/smartcity/${JOB_NAME}:${IMAGE_VERSION}" + buildDescription "harbor.anxinyun.cn/smartcity/${JOB_NAME}:${IMAGE_VERSION}" + sh 'nerdctl build -t harbor.anxinyun.cn/smartcity/${JOB_NAME}:${IMAGE_VERSION} ./api' + sh 'nerdctl push harbor.anxinyun.cn/smartcity/${JOB_NAME}:${IMAGE_VERSION}' + } + } + } +} \ No newline at end of file diff --git a/jenkinsfile_web b/jenkinsfile_web new file mode 100644 index 0000000..8840491 --- /dev/null +++ b/jenkinsfile_web @@ -0,0 +1,18 @@ +pipeline { + agent { + node{ + label 'jnlp-slave' + } + } + + stages { + stage('巡检 web ......') { + steps { + buildName "#${BUILD_NUMBER} ~/smartcity/${JOB_NAME}:${IMAGE_VERSION}" + buildDescription "harbor.anxinyun.cn/smartcity/${JOB_NAME}:${IMAGE_VERSION}" + sh 'nerdctl build -t harbor.anxinyun.cn/smartcity/${JOB_NAME}:${IMAGE_VERSION} ./web' + sh 'nerdctl push harbor.anxinyun.cn/smartcity/${JOB_NAME}:${IMAGE_VERSION}' + } + } + } +} \ No newline at end of file diff --git a/web/client/src/sections/projectRegime/actions/projectSituation.js b/web/client/src/sections/projectRegime/actions/projectSituation.js index cf5b3be..46fc366 100644 --- a/web/client/src/sections/projectRegime/actions/projectSituation.js +++ b/web/client/src/sections/projectRegime/actions/projectSituation.js @@ -76,3 +76,15 @@ export function delPosition (id) { }); } + +export function qrCodeShow (query) { + return (dispatch) => basicAction({ + type: 'get', + query, + dispatch, + actionType: 'GET_QR_CODE', + url: ApiTable.qrCodeShow, + msg: { error: '获取二维码列表失败', }, + }); +} + diff --git a/web/client/src/sections/projectRegime/components/pointModel.js b/web/client/src/sections/projectRegime/components/pointModel.js new file mode 100644 index 0000000..c28cb36 --- /dev/null +++ b/web/client/src/sections/projectRegime/components/pointModel.js @@ -0,0 +1,91 @@ +import React, { useState } from 'react'; +import { Button, Form, Input, Modal, Select, DatePicker } from 'antd'; +const { TextArea } = Input; +import { connect } from 'react-redux'; +import Uploads from '$components/Uploads'; +import { useEffect } from 'react'; +import moment from 'moment'; + +const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, qrCodeId }) => { + + const { projectRegime } = actions + const [form] = Form.useForm(); + + useEffect(() => { + // console.log(modelData); + + }, []) + + + return ( + { + form.validateFields().then(r => { + dispatch(projectRegime.addPosition({ + ...r, + id: modelData?.id, + projectId: qrCodeId + })).then(res => { + if (res.success) { + success() + } + }) + }) + }} + onCancel={() => { + close() + }} + > +
{ + + }} + > + + + +
+ {/* /^\d+$|^\d*\.\d+$/g */} + + + + ~ + + + +
+ +