From 840c54f0dcb1b2a862193b25d7044ceceadddef5 Mon Sep 17 00:00:00 2001 From: "peng.peng" Date: Tue, 7 Mar 2023 14:40:53 +0800 Subject: [PATCH 01/12] =?UTF-8?q?(*)=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/issueHandle/components/isuue-handle-mdal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/client/src/sections/issueHandle/components/isuue-handle-mdal.js b/web/client/src/sections/issueHandle/components/isuue-handle-mdal.js index 09970eb..49c41cb 100644 --- a/web/client/src/sections/issueHandle/components/isuue-handle-mdal.js +++ b/web/client/src/sections/issueHandle/components/isuue-handle-mdal.js @@ -245,7 +245,7 @@ export default (props) => { values.startTime = values?.dateRange[0]; values.endTime = values?.dateRange[1]; values.repairPerson = { id: users?.find(s => s.value == values.repairPerson)?.value, name: users?.find(s => s.id == values.repairPerson)?.label } - values.checkPerson = { id: users?.find(s => s.value == values.checkPerson)?.value, name: users?.find(s => s.id == values.value)?.label } + values.checkPerson = { id: users?.find(s => s.value == values.checkPerson)?.value, name: users?.find(s => s.id == values.checkPerson)?.label } onFinish && await onFinish(values, editData) //message.success('提交成功'); return true; From 0c7c8c68dc491ac51c8faf5db1fe19d1d9be0c15 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Tue, 7 Mar 2023 14:46:37 +0800 Subject: [PATCH 02/12] =?UTF-8?q?fix=20=E5=B0=8F=E7=A8=8B=E5=BA=8F-?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=BC=80=E5=A7=8B/=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=8F=AA=E9=9C=80=E8=A6=81=E5=88=B0=E5=B9=B4?= =?UTF-8?q?=E6=9C=88=E6=97=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/package/troubleshooting/shootingForm/index.js | 8 ++++---- weapp/package/troubleshooting/shootingForm/index.wxml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/weapp/package/troubleshooting/shootingForm/index.js b/weapp/package/troubleshooting/shootingForm/index.js index cd18784..d884f77 100644 --- a/weapp/package/troubleshooting/shootingForm/index.js +++ b/weapp/package/troubleshooting/shootingForm/index.js @@ -103,8 +103,8 @@ Page({ maintenancePersonDepartmentShow: maintenancePersonIndex >= 0 ? focusPerson[maintenancePersonIndex].department.name : '', qualityPersonIndex: focusPerson.findIndex(f => f.id == issue.checkPerson.id), planStartTime: moment(issue.startTime).unix(), - planStartTimeShow: moment(issue.startTime).format('YYYY-MM-DD HH:mm:ss'), - planEndTimeShow: moment(issue.endTime).format('YYYY-MM-DD HH:mm:ss'), + planStartTimeShow: moment(issue.startTime).format('YYYY-MM-DD'), + planEndTimeShow: moment(issue.endTime).format('YYYY-MM-DD'), maintenanceRequirement: issue.repairAsk }) } @@ -165,7 +165,7 @@ Page({ // this.setData({ planStartTime: '' }) } else if (e.target.dataset.option == 'confirmed') { this.setData({ - planStartTimeShow: this.data.planStartTime ? moment(this.data.planStartTime).format('YYYY-MM-DD HH:mm') : '' + planStartTimeShow: this.data.planStartTime ? moment(this.data.planStartTime).format('YYYY-MM-DD') : '' }) } }, @@ -186,7 +186,7 @@ Page({ this.setData({ planEndTimePopupShow: false }) if (e.target.dataset.option == 'confirmed') { this.setData({ - planEndTimeShow: this.data.planEndTime ? moment(this.data.planEndTime).format('YYYY-MM-DD HH:mm') : '' + planEndTimeShow: this.data.planEndTime ? moment(this.data.planEndTime).format('YYYY-MM-DD') : '' }) } }, diff --git a/weapp/package/troubleshooting/shootingForm/index.wxml b/weapp/package/troubleshooting/shootingForm/index.wxml index b11402e..fa3c390 100644 --- a/weapp/package/troubleshooting/shootingForm/index.wxml +++ b/weapp/package/troubleshooting/shootingForm/index.wxml @@ -75,7 +75,7 @@ 确定 - + @@ -93,7 +93,7 @@ 确定 - + From b5bdc63596e51a68efd9cb025da9f5e29d514ae8 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Tue, 7 Mar 2023 15:22:25 +0800 Subject: [PATCH 03/12] =?UTF-8?q?debug=20=E5=B0=8F=E7=A8=8B=E5=BA=8F-?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86-=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=93=8D=E4=BD=9C=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/package/troubleshooting/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/weapp/package/troubleshooting/index.js b/weapp/package/troubleshooting/index.js index afd0a5f..447aa63 100644 --- a/weapp/package/troubleshooting/index.js +++ b/weapp/package/troubleshooting/index.js @@ -130,6 +130,7 @@ Page({ }, onEndTimeChange (event) { const { timeSelectedUnrealFlag, startTime, endTime } = this.data + console.log('结束时间', timeSelectedUnrealFlag, event.detail); if (timeSelectedUnrealFlag && event.detail == 1640966400000) { return } From fa38aa18310a73d05fd9267c3a001bee86a78c3e Mon Sep 17 00:00:00 2001 From: liujiangyong Date: Tue, 7 Mar 2023 15:39:42 +0800 Subject: [PATCH 04/12] =?UTF-8?q?fix=20=20=E5=B7=A1=E6=A3=80=E8=AE=B0?= =?UTF-8?q?=E5=BD=95-=E5=85=B3=E9=94=AE=E5=AD=97=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=90=8E=E7=BF=BB=E9=A1=B5=E5=8F=8A=E9=A1=B5=E9=9D=A2=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E4=BF=AE=E6=94=B9=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/patrolManage/containers/patrolRecord.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/client/src/sections/patrolManage/containers/patrolRecord.js b/web/client/src/sections/patrolManage/containers/patrolRecord.js index aa9c869..f0a76d8 100644 --- a/web/client/src/sections/patrolManage/containers/patrolRecord.js +++ b/web/client/src/sections/patrolManage/containers/patrolRecord.js @@ -182,8 +182,8 @@ const PatrolRecord = (props) => { return {`共${Math.ceil(total / query?.limit)}页,${total}项`} }, onChange: (page, pageSize) => { - setQuery({ limit: pageSize, page: page - 1 }); - record({ limit: pageSize, page: page - 1, ...search, companyId: companyID || search?.companyId }) + setQuery({ limit: pageSize, page: page - 1 }); + record({ limit: pageSize, page: page - 1, ...search, companyId: search?.companyId }) } }} /> From 6665d5d4d2ac02302fe74350cbc1a24b741a83cd Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Tue, 7 Mar 2023 15:49:33 +0800 Subject: [PATCH 05/12] =?UTF-8?q?debug=20=E5=B0=8F=E7=A8=8B=E5=BA=8F-?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86-=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=93=8D=E4=BD=9C=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/package/troubleshooting/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weapp/package/troubleshooting/index.js b/weapp/package/troubleshooting/index.js index 447aa63..ad49b35 100644 --- a/weapp/package/troubleshooting/index.js +++ b/weapp/package/troubleshooting/index.js @@ -130,7 +130,7 @@ Page({ }, onEndTimeChange (event) { const { timeSelectedUnrealFlag, startTime, endTime } = this.data - console.log('结束时间', timeSelectedUnrealFlag, event.detail); + console.log('结束时间', timeSelectedUnrealFlag, event.detail, new Date().getTime()); if (timeSelectedUnrealFlag && event.detail == 1640966400000) { return } From 92586717aa421fc8023e4407a165e09198bd2a0e Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Tue, 7 Mar 2023 16:09:48 +0800 Subject: [PATCH 06/12] =?UTF-8?q?fix=20=E5=B0=8F=E7=A8=8B=E5=BA=8F-?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86-=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=93=8D=E4=BD=9C=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/package/troubleshooting/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/weapp/package/troubleshooting/index.js b/weapp/package/troubleshooting/index.js index ad49b35..257a999 100644 --- a/weapp/package/troubleshooting/index.js +++ b/weapp/package/troubleshooting/index.js @@ -3,6 +3,8 @@ import { getPatrolRecordIssueHandle, getStructuresUsers } from "../../utils/getA import { Request } from "../../common"; const moment = require("../../utils/moment"); +let setFilterStartTime = 0 +let setFilterEndTime = 0 Page({ /** @@ -123,6 +125,10 @@ Page({ if (timeSelectedUnrealFlag && event.detail == 1640966400000) { return } + if(new Date().getTime() - setFilterStartTime < 100){ + return + } + setFilterStartTime = new Date().getTime() this.setData({ startTime: event.detail, endTime: endTime ? endTime : 1640966400000 @@ -134,6 +140,10 @@ Page({ if (timeSelectedUnrealFlag && event.detail == 1640966400000) { return } + if(new Date().getTime() - setFilterEndTime < 100){ + return + } + setFilterEndTime = new Date().getTime() this.setData({ startTime: startTime ? startTime : 1640966400000, endTime: event.detail, From 02627e5f97257cfd559c369e8b672a602f79b3f8 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Tue, 7 Mar 2023 17:30:26 +0800 Subject: [PATCH 07/12] =?UTF-8?q?fix=20=E5=B0=8F=E7=A8=8B=E5=BA=8F-?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=BC=80=E5=A7=8B/=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=8F=AA=E9=9C=80=E8=A6=81=E5=88=B0=E5=B9=B4?= =?UTF-8?q?=E6=9C=88=E6=97=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/package/troubleshooting/index.wxml | 4 ++-- weapp/package/troubleshooting/shootingForm/index.wxml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/weapp/package/troubleshooting/index.wxml b/weapp/package/troubleshooting/index.wxml index b68d4a0..b078981 100644 --- a/weapp/package/troubleshooting/index.wxml +++ b/weapp/package/troubleshooting/index.wxml @@ -42,9 +42,9 @@ - + - + diff --git a/weapp/package/troubleshooting/shootingForm/index.wxml b/weapp/package/troubleshooting/shootingForm/index.wxml index fa3c390..d946ee3 100644 --- a/weapp/package/troubleshooting/shootingForm/index.wxml +++ b/weapp/package/troubleshooting/shootingForm/index.wxml @@ -75,7 +75,7 @@ 确定 - + @@ -93,7 +93,7 @@ 确定 - + From 0ce5681f8d42fe51a3885433d849b4881bdb5109 Mon Sep 17 00:00:00 2001 From: liujiangyong Date: Wed, 8 Mar 2023 08:26:50 +0800 Subject: [PATCH 08/12] =?UTF-8?q?v0.5=E5=B0=8F=E7=A8=8B=E5=BA=8F=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/patrolManage/patrolRecord.js | 5 +- api/app/lib/models/patrol_record.js | 5 + .../1.0.5/schema/2.update_patrol_record.sql | 4 + weapp/app.json | 3 +- weapp/images/circle.png | Bin 0 -> 293 bytes weapp/images/refresh.svg | 1 + .../inspectionInput/inspectionInput.js | 3 +- weapp/package/pointsStatus/pointsStatus.js | 66 ++++++++ weapp/package/pointsStatus/pointsStatus.json | 3 + weapp/package/pointsStatus/pointsStatus.wxml | 2 + weapp/package/pointsStatus/pointsStatus.wxss | 1 + weapp/pages/index/index.js | 159 +++++++----------- weapp/pages/index/index.wxml | 40 ++--- weapp/pages/index/index.wxss | 82 +++------ 14 files changed, 189 insertions(+), 185 deletions(-) create mode 100644 script/1.0.5/schema/2.update_patrol_record.sql create mode 100644 weapp/images/circle.png create mode 100644 weapp/images/refresh.svg create mode 100644 weapp/package/pointsStatus/pointsStatus.js create mode 100644 weapp/package/pointsStatus/pointsStatus.json create mode 100644 weapp/package/pointsStatus/pointsStatus.wxml create mode 100644 weapp/package/pointsStatus/pointsStatus.wxss diff --git a/api/app/lib/controllers/patrolManage/patrolRecord.js b/api/app/lib/controllers/patrolManage/patrolRecord.js index b192a93..185adbd 100644 --- a/api/app/lib/controllers/patrolManage/patrolRecord.js +++ b/api/app/lib/controllers/patrolManage/patrolRecord.js @@ -169,7 +169,7 @@ async function addPatrolRecord (ctx, next) { try { const models = ctx.fs.dc.models; const data = ctx.request.body; - let { patrolPlanId, inspectionTime, points, alarm, pointId } = data + let { patrolPlanId, inspectionTime, points, alarm, pointId, projectId } = data const pointRecord = await models.PatrolRecord.findAll({ where: { pointId: pointId }, order: [['inspectionTime', 'desc']], @@ -185,7 +185,8 @@ async function addPatrolRecord (ctx, next) { inspectionTime, points, alarm, - pointId: pointId + pointId: pointId, + projectId } , { transaction diff --git a/api/app/lib/models/patrol_record.js b/api/app/lib/models/patrol_record.js index a71d7ca..c13af6e 100644 --- a/api/app/lib/models/patrol_record.js +++ b/api/app/lib/models/patrol_record.js @@ -45,6 +45,11 @@ module.exports = dc => { type: DataTypes.INTEGER, allowNull: false, }, + projectId: { + field: "project_id", + type: DataTypes.INTEGER, + allowNull: true, + }, }, { tableName: "patrol_record", comment: "", diff --git a/script/1.0.5/schema/2.update_patrol_record.sql b/script/1.0.5/schema/2.update_patrol_record.sql new file mode 100644 index 0000000..dfe4b62 --- /dev/null +++ b/script/1.0.5/schema/2.update_patrol_record.sql @@ -0,0 +1,4 @@ +ALTER TABLE "public"."patrol_record" + ADD COLUMN "project_id" int4; + +COMMENT ON COLUMN "public"."patrol_record"."project_id" IS '结构物id'; \ No newline at end of file diff --git a/weapp/app.json b/weapp/app.json index c143865..8f0f3f8 100644 --- a/weapp/app.json +++ b/weapp/app.json @@ -16,7 +16,8 @@ "inspectionInput/inspectionInput", "troubleshooting/index", "troubleshooting/shootingForm/index", - "inspectionReport/inspectionReport" + "inspectionReport/inspectionReport", + "pointsStatus/pointsStatus" ] } ], diff --git a/weapp/images/circle.png b/weapp/images/circle.png new file mode 100644 index 0000000000000000000000000000000000000000..108dbd44f0cc8b55dd8132ad82605275dc9d4861 GIT binary patch literal 293 zcmV+=0owkFP)Px#-$_J4R5(wqlRXXrQ51#G$(zh5%m##MB_tX;TcBhK_FyTLN?J=06^)7(u>ce^ z^2Qazh@Y64Jg<1oz2|%9-5(<1c!89(AlzlR`j*D`famMRndp+NKqPyOlQ;;lAUIgt zs{gEc0ptTcB+yE71#rG`R4vYV0181k1EiWPzC{HXZ5^u}xw~H8DeQS+K1Ot+3zzdO)-5x8jpAdeecxy<=eR1BA?#P?)EmCXUSA{u<*Pen9r rW8}hQkm3#)jdBbzTBeW9{9&Ch+oW=lMp{c)00000NkvXXu0mjfoBDRX literal 0 HcmV?d00001 diff --git a/weapp/images/refresh.svg b/weapp/images/refresh.svg new file mode 100644 index 0000000..55c4c77 --- /dev/null +++ b/weapp/images/refresh.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/weapp/package/inspectionInput/inspectionInput.js b/weapp/package/inspectionInput/inspectionInput.js index cdde9f2..fc22884 100644 --- a/weapp/package/inspectionInput/inspectionInput.js +++ b/weapp/package/inspectionInput/inspectionInput.js @@ -356,7 +356,8 @@ Page({ inspectContent, address: address }, - alarm + alarm, + projectId: dataList.project.id } wx.showLoading({ title: '提交中...' }); that.setData({ isCommitting: true }); diff --git a/weapp/package/pointsStatus/pointsStatus.js b/weapp/package/pointsStatus/pointsStatus.js new file mode 100644 index 0000000..358ec28 --- /dev/null +++ b/weapp/package/pointsStatus/pointsStatus.js @@ -0,0 +1,66 @@ +// package/pointsStatus/pointsStatus.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + console.log(options, 'options') + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/weapp/package/pointsStatus/pointsStatus.json b/weapp/package/pointsStatus/pointsStatus.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/weapp/package/pointsStatus/pointsStatus.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/weapp/package/pointsStatus/pointsStatus.wxml b/weapp/package/pointsStatus/pointsStatus.wxml new file mode 100644 index 0000000..c9f4651 --- /dev/null +++ b/weapp/package/pointsStatus/pointsStatus.wxml @@ -0,0 +1,2 @@ + +package/pointsStatus/pointsStatus.wxml diff --git a/weapp/package/pointsStatus/pointsStatus.wxss b/weapp/package/pointsStatus/pointsStatus.wxss new file mode 100644 index 0000000..6d831ae --- /dev/null +++ b/weapp/package/pointsStatus/pointsStatus.wxss @@ -0,0 +1 @@ +/* package/pointsStatus/pointsStatus.wxss */ \ No newline at end of file diff --git a/weapp/pages/index/index.js b/weapp/pages/index/index.js index 5d84a7a..0775da1 100644 --- a/weapp/pages/index/index.js +++ b/weapp/pages/index/index.js @@ -1,78 +1,81 @@ // pages/index/index.js -import { getProjectList } from "../../utils/getApiUrl"; +import { getProjectList, getPatrolRecord } from "../../utils/getApiUrl"; import { Request } from "../../common"; +const moment = require("../../utils/moment"); Page({ + /** * 页面的初始数据 */ data: { - dataList: [], - limit: 10, //条数 - page: 0, //当前页 - count: '', //总条数 - keyName: '', //结构物名称 - hidden: true, - imgUrl: getApp().globalData.imgUrl + project: [], + todayRecord: [], // 今日巡检记录 + markers: [], + isShowCallout: false, }, - // 输入框 - formInp(e) { - let that = this; - that.setData({ - keyName: e.detail.value + setMarkers(project, todayRecord) { + const markers = project.map(p => { + let todayCount = 0; + todayRecord.forEach(r => { + if (r.projectId === p.id) { todayCount += 1 } + }) + return { + id: p.id, + latitude: p.latitude, + longitude: p.longitude, + name: p.name, + iconPath: '/images/circle.png', + width: 15, + height: 15, + callout: { + content: `${p.name}\n今日巡检:${todayCount}次`, + padding: 10, + display: this.data.isShowCallout ? 'ALWAYS' : 'BYCLICK', + }, + } }) + this.setData({ markers }) }, - // 手机键盘点击完成按钮(回车事件) - bindconfirm() { - let that = this; - that.setData({ - page: 0, //当前页 - count: '', //总条数 - dataList: [] + // 获取结构物和今日巡检次数 + getData() { + const that = this; + wx.showLoading({ title: '加载中' }) + const promiseArr = []; + promiseArr.push(Request.get(getProjectList(), {})); + promiseArr.push(Request.get(getPatrolRecord('all', moment().format('YYYY-MM-DD') + ' 00:00:00', moment().format('YYYY-MM-DD') + ' 23:59:59', 'null', 'null'))); + Promise.all(promiseArr).then(res => { + wx.hideLoading() + that.setData({ + project: res[0].rows, + todayRecord: res[1] + }) + that.setMarkers(res[0].rows, res[1]); + // 缩放视野展示所有 markers + const mapCtx = wx.createMapContext('mapDom') + mapCtx.includePoints({ + points: res[0].rows, + padding: [40, 40, 40, 40] + }) }) - that.getProjectList(); }, - // 搜索表单 - goSearch() { - let that = this; - that.setData({ - page: 0, //当前页 - count: '', //总条数 - dataList: [] - }) - that.getProjectList(); + showCallout() { + this.setData( + { isShowCallout: !this.data.isShowCallout }, + () => { this.setMarkers(this.data.markers, this.data.todayRecord); } + ); }, - // 获取巡检总览列表 - getProjectList: function () { - let that = this; - let { page, limit, keyName } = that.data; - let data = keyName ? { limit, page, name: keyName } : { limit, page } - wx.showLoading({ - title: '加载中', - }) - Request.get(getProjectList(), data).then(res => { - if (res.rows.length == 0) { - that.setData({ - dataList: res.rows, - hidden: false - }) - wx.hideLoading() - return; - } - var arr1 = that.data.dataList; //从data获取当前dataList数组 - var arr2 = res.rows; //从此次请求返回的数据中获取新数组 - arr1 = arr1.concat(arr2); //合并数组 - that.setData({ - dataList: arr1, - count: res.count, //总条数 - hidden: true - }) - wx.hideLoading() - }) + onRefresh() { + this.getData(); + }, + + onMarkerTap(e) { + console.log(e.detail.markerId, 'e.detail.markerId') + wx.navigateTo({url: `/package/pointsStatus/pointsStatus?projectId=${e.detail.markerId}`}) }, /** @@ -104,7 +107,7 @@ Page({ url: '/pages/login/login' }); } else { - this.getProjectList(); + this.getData(); } }, @@ -112,60 +115,28 @@ Page({ * 生命周期函数--监听页面隐藏 */ onHide() { - this.setData({ - dataList: [], - keyName: '', - page: 0, //当前页 - count: '', //总条数 - }) + }, /** * 生命周期函数--监听页面卸载 */ onUnload() { - this.setData({ - dataList: [], - keyName: '', - page: 0, //当前页 - count: '', //总条数 - }) + }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { - let that = this; - that.setData({ - dataList: [], - keyName: '', - page: 0, //当前页 - count: '', //总条数 - }) - that.getProjectList() - // 手动控制回弹 - wx.stopPullDownRefresh(); + }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { - let _that = this; - let page = _that.data.page + 1; //获取当前页数并+1 - let { dataList, count } = _that.data; - if (dataList.length == count) { - wx.showToast({ - title: '没有更多数据了...', - icon: 'none', - }) - return; - } - _that.setData({ - page: page, //更新当前页数 - }) - _that.getProjectList() + }, /** diff --git a/weapp/pages/index/index.wxml b/weapp/pages/index/index.wxml index 5200184..347b757 100644 --- a/weapp/pages/index/index.wxml +++ b/weapp/pages/index/index.wxml @@ -1,32 +1,14 @@ - - - - - + + + 数据 + + - - - - - - 暂无图片 - - {{item.name}} - - 今日问题:12 - 未处理问题:12 - 已处理问题:12 - - - - - - - - - \ No newline at end of file + diff --git a/weapp/pages/index/index.wxss b/weapp/pages/index/index.wxss index df854bd..a84fb4a 100644 --- a/weapp/pages/index/index.wxss +++ b/weapp/pages/index/index.wxss @@ -1,70 +1,36 @@ /* pages/index/index.wxss */ -page { - background: #F7F7FA; +.flex-center { + display: flex; + justify-content: center; + align-items: center; } -.searchBoxs { - position: relative; - margin: 20rpx 0rpx; - height: 76rpx; +.map { + width: 100vw; + height: 100vh; } -.searchInps { - background-color: #fff; - width: 542rpx; - height: 76rpx; - border-radius: 8rpx; - padding-left: 32rpx; - padding-right: 144rpx; - border: 1px solid rgba(225, 225, 225, 0.44); - position: absolute; - top: -2rpx; - left: 16rpx; - font-size: 28rpx; +.action-box { + position: absolute; + bottom: 30px; + right: 10px; + width: 46px; + height: 80px; + display: flex; + flex-direction: column; + justify-content: space-evenly; } -.btnSearch { - width: 128rpx; - height: 68rpx; - line-height: 68rpx; - border-radius: 8rpx; - color: #fff; - font-size: 28rpx; - background: linear-gradient(180deg, #1979ff 0%, #1979ff 100%); - position: absolute; - top: 6rpx; - right: 28rpx; - z-index: 10; +.action-box .text { + background-color: white; + height: 30px; } -.searchFixed { - position: fixed; - top: 0; - width: 100%; - background-color: #fff; - box-shadow: 0rpx -4rpx 20rpx #c2c2c2; - z-index: 10; +.action-box .img { + background-color: white; } -.box { - padding: 20rpx; - box-shadow: 0rpx 10rpx 10rpx #ccc; - overflow: hidden; - line-height: 50rpx; - background: #fff; -} - -/* 暂无数据 */ -.noData { - width: 254rpx; - height: 298rpx; - display: block; - margin: 450rpx auto 16rpx; -} - -.noTxt { - font-size: 30rpx; - color: #999; - font-weight: bold; - text-align: center; +.action-box .img image { + width: 30px; + height: 30px; } \ No newline at end of file From fd83a96c06012e905a731f3c9bca2a5767c2cf1b Mon Sep 17 00:00:00 2001 From: liujiangyong Date: Wed, 8 Mar 2023 08:28:30 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E8=B4=A8=E6=A3=80=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=88=90=E6=9C=AC=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/models/patrol_record_issue_handle.js | 9 +++++++++ .../3.update_patrol_record_issue_handle.sql | 4 ++++ .../package/troubleshooting/shootingForm/index.js | 15 +++++++++++++-- .../troubleshooting/shootingForm/index.wxml | 1 + .../issueHandle/components/isuue-handle-mdal.js | 7 +++++++ 5 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 script/1.0.5/schema/3.update_patrol_record_issue_handle.sql diff --git a/api/app/lib/models/patrol_record_issue_handle.js b/api/app/lib/models/patrol_record_issue_handle.js index c0a73ca..f2926ab 100644 --- a/api/app/lib/models/patrol_record_issue_handle.js +++ b/api/app/lib/models/patrol_record_issue_handle.js @@ -204,6 +204,15 @@ module.exports = dc => { field: "isgaojing", autoIncrement: false }, + cost: { + type: DataTypes.DECIMAL(11, 2), + allowNull: true, + defaultValue: null, + comment: '成本', + primaryKey: false, + field: "cost", + autoIncrement: false + }, }, { tableName: "patrol_record_issue_handle", comment: "", diff --git a/script/1.0.5/schema/3.update_patrol_record_issue_handle.sql b/script/1.0.5/schema/3.update_patrol_record_issue_handle.sql new file mode 100644 index 0000000..8f1541a --- /dev/null +++ b/script/1.0.5/schema/3.update_patrol_record_issue_handle.sql @@ -0,0 +1,4 @@ +ALTER TABLE "public"."patrol_record_issue_handle" + ADD COLUMN "cost" decimal(11,2); + +COMMENT ON COLUMN "public"."patrol_record_issue_handle"."cost" IS '成本'; \ No newline at end of file diff --git a/weapp/package/troubleshooting/shootingForm/index.js b/weapp/package/troubleshooting/shootingForm/index.js index d884f77..c75beda 100644 --- a/weapp/package/troubleshooting/shootingForm/index.js +++ b/weapp/package/troubleshooting/shootingForm/index.js @@ -34,6 +34,7 @@ Page({ repair: '', repairImgs: [], checkDesc: '', + cost: '', checkImgs: [], // 表单控制 @@ -124,6 +125,7 @@ Page({ if (issue.state > 4) { this.setData({ checkDesc: issue.checkOpinion, + cost: issue.cost, checkImgs: issue.checkImage || [], }) } @@ -198,8 +200,16 @@ Page({ }, onInputChange (e) { + let value = e.detail.value + if (e.target.dataset.type === 'cost' && !/^(\d?)+(\.\d{0,2})?$/.test(e.detail.value)) { + wx.showToast({ + title: '只能输入两位小数', + icon: 'none' + }) + value = value.substring(0, value.length - 1); + } this.setData({ - [e.target.dataset.type]: e.detail.value + [e.target.dataset.type]: value }) }, @@ -322,7 +332,7 @@ Page({ maintenancePersonIndex, maintenancePersonDepartmentShow, qualityPersonIndex, planStartTime, planEndTime, planStartTimeShow, planEndTimeShow, maintenanceRequirement, userInfo, planApproval, repair, repairImgs, - checkDesc, checkImgs + checkDesc, cost, checkImgs } = this.data let nextState = '' let confirmData = {} @@ -372,6 +382,7 @@ Page({ confirmData = { ...confirmData, checkOpinion: checkDesc, + cost, checkImage: checkImgs, checkPerson: { id: userInfo.id, name: userInfo.name } } diff --git a/weapp/package/troubleshooting/shootingForm/index.wxml b/weapp/package/troubleshooting/shootingForm/index.wxml index d946ee3..3d7ce23 100644 --- a/weapp/package/troubleshooting/shootingForm/index.wxml +++ b/weapp/package/troubleshooting/shootingForm/index.wxml @@ -137,6 +137,7 @@ 质检验收 + 现场图片 diff --git a/web/client/src/sections/issueHandle/components/isuue-handle-mdal.js b/web/client/src/sections/issueHandle/components/isuue-handle-mdal.js index 0b799b6..94c5762 100644 --- a/web/client/src/sections/issueHandle/components/isuue-handle-mdal.js +++ b/web/client/src/sections/issueHandle/components/isuue-handle-mdal.js @@ -178,6 +178,13 @@ export default (props) => { value={editData?.patrolRecordIssueHandles[0]?.checkPerson?.name} /> + + Date: Wed, 8 Mar 2023 08:38:34 +0800 Subject: [PATCH 10/12] =?UTF-8?q?fix=20=E9=AA=8C=E6=94=B6=E5=90=8E?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=E4=BA=BA=E6=94=B9=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/package/troubleshooting/index.js | 3 ++- weapp/package/troubleshooting/index.json | 3 ++- weapp/package/troubleshooting/shootingForm/index.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/weapp/package/troubleshooting/index.js b/weapp/package/troubleshooting/index.js index 257a999..6abd359 100644 --- a/weapp/package/troubleshooting/index.js +++ b/weapp/package/troubleshooting/index.js @@ -136,7 +136,7 @@ Page({ }, onEndTimeChange (event) { const { timeSelectedUnrealFlag, startTime, endTime } = this.data - console.log('结束时间', timeSelectedUnrealFlag, event.detail, new Date().getTime()); + console.log('结束时间', timeSelectedUnrealFlag, event, new Date().getTime()); if (timeSelectedUnrealFlag && event.detail == 1640966400000) { return } @@ -148,6 +148,7 @@ Page({ startTime: startTime ? startTime : 1640966400000, endTime: event.detail, }); + return }, onDropDownClose () { diff --git a/weapp/package/troubleshooting/index.json b/weapp/package/troubleshooting/index.json index d8f06e3..af35bd8 100644 --- a/weapp/package/troubleshooting/index.json +++ b/weapp/package/troubleshooting/index.json @@ -12,6 +12,7 @@ "van-checkbox": "@vant/weapp/checkbox/index", "van-checkbox-group": "@vant/weapp/checkbox-group/index", "van-datetime-picker": "@vant/weapp/datetime-picker/index", - "timePicker": "/components/timePicker/index" + "timePicker": "/components/timePicker/index", + "t-date-time-picker": "tdesign-miniprogram/date-time-picker/date-time-picker" } } \ No newline at end of file diff --git a/weapp/package/troubleshooting/shootingForm/index.js b/weapp/package/troubleshooting/shootingForm/index.js index d884f77..c6537a8 100644 --- a/weapp/package/troubleshooting/shootingForm/index.js +++ b/weapp/package/troubleshooting/shootingForm/index.js @@ -373,7 +373,7 @@ Page({ ...confirmData, checkOpinion: checkDesc, checkImage: checkImgs, - checkPerson: { id: userInfo.id, name: userInfo.name } + // checkPerson: { id: userInfo.id, name: userInfo.name } } if (approve == 'agree') { nextState = 6 From f81561ae171d7b0c2e4e3c62c448fd827746f3d4 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Wed, 8 Mar 2023 08:42:07 +0800 Subject: [PATCH 11/12] =?UTF-8?q?fix=20=E9=AA=8C=E6=94=B6=E5=90=8E?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=E4=BA=BA=E6=94=B9=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/package/troubleshooting/shootingForm/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weapp/package/troubleshooting/shootingForm/index.js b/weapp/package/troubleshooting/shootingForm/index.js index ee6da0a..c75beda 100644 --- a/weapp/package/troubleshooting/shootingForm/index.js +++ b/weapp/package/troubleshooting/shootingForm/index.js @@ -384,7 +384,7 @@ Page({ checkOpinion: checkDesc, cost, checkImage: checkImgs, - // checkPerson: { id: userInfo.id, name: userInfo.name } + checkPerson: { id: userInfo.id, name: userInfo.name } } if (approve == 'agree') { nextState = 6 From 3a533a8a2cd25af2be7d3cc1737a69f3e40c88f7 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Wed, 8 Mar 2023 08:52:52 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E7=AC=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/package/troubleshooting/shootingForm/index.wxml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weapp/package/troubleshooting/shootingForm/index.wxml b/weapp/package/troubleshooting/shootingForm/index.wxml index 3d7ce23..6937e1e 100644 --- a/weapp/package/troubleshooting/shootingForm/index.wxml +++ b/weapp/package/troubleshooting/shootingForm/index.wxml @@ -137,7 +137,7 @@ 质检验收 - + 现场图片