From f1a8d8c7188b9842f1d4adb2d74609c4ce0f102c Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Tue, 30 Jul 2024 15:25:28 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/investigation/task.vue | 156 ++++++++++++++++++++++++++++++++--- 1 file changed, 145 insertions(+), 11 deletions(-) diff --git a/pages/investigation/task.vue b/pages/investigation/task.vue index c2c82de..99d98ef 100644 --- a/pages/investigation/task.vue +++ b/pages/investigation/task.vue @@ -67,7 +67,7 @@ - {{ formData.roadType }} @@ -136,10 +136,15 @@ - + + + + 交通流量 + + @@ -190,8 +195,35 @@ + + + + 违法情况 + + + 违法数量 + + + 暂无数据 + + 违法占比 + + + 暂无数据 + + + + 事故情况 + + + 事故数量 + + + 暂无数据 + + 重点排查 @@ -419,6 +451,7 @@ }, onReady() { this.getChartsData(); + this.getChartsData2() }, onLoad(e) { this.boxHeight = uni.getSystemInfoSync().windowHeight; @@ -519,10 +552,10 @@ required: true, errorMessage: '请选择道路类型', }, - + ] }, - + }, describe: { bigCategory: "", @@ -535,6 +568,44 @@ chartData: {}, //您可以通过修改 config-ucharts.js 文件中下标为 ['area'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。 opts: { + color: [ + "#1890FF", + "#FAC858", + "#91CB74", + "#EE6666", + "#73C0DE", + "#3CA272", + "#FC8452", + "#9A60B4", + "#ea7ccc", + ], + padding: [0, 15, 15, 15], + enableScroll: false, + legend: { + icon: "rect", + position: "top", + float: "right", + padding: 10, + }, + xAxis: { + disableGrid: true, + }, + yAxis: { + gridType: "dash", + dashLength: 2, + }, + extra: { + area: { + type: "straight", + opacity: 0.2, + addLine: true, + width: 2, + gradient: true, + activeType: "hollow", + }, + }, + }, + opts2: { color: [ "#1890FF", "#FAC858", @@ -552,7 +623,8 @@ icon: "rect", position: "top", float: "right", - padding: 15, + padding: 10, + show: false, }, xAxis: { disableGrid: true, @@ -572,6 +644,39 @@ }, }, }, + chartData2: {}, + opts3: { + color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", + "#ea7ccc" + ], + padding: [5, 5, 5, 5], + enableScroll: false, + legend: { + show: true, + position: "right", + lineHeight: 25 + }, + extra: { + rose: { + type: "radius", + minRadius: 50, + activeOpacity: 0.5, + activeRadius: 10, + offsetAngle: 0, + labelWidth: 15, + border: true, + borderWidth: 2, + borderColor: "#FFFFFF", + linearType: "custom" + } + } + }, + chartData3: { + series: [] + }, + chartData4: { + series: [] + }, showProblem: false, showProblemTreeSelect: false, problemTreeSelect: 0, @@ -1156,9 +1261,8 @@ getChartsData() { //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接 let res = { - categories: ["01", "02", "03", "04", "05", "06","07", "08", "09", "10", "11", "12"], - series: [ - { + categories: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"], + series: [{ name: "总量", legendShape: "line", data: [], @@ -1166,7 +1270,7 @@ { name: "大车", legendShape: "line", - data: [], + data: [], }, { name: "小车", @@ -1177,6 +1281,14 @@ }; this.chartData = JSON.parse(JSON.stringify(res)); }, + getChartsData2() { + //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接 + let res = { + categories: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"], + series: [], + }; + this.chartData2 = JSON.parse(JSON.stringify(res)); + }, // 删除图片 deletePic(event, key) { this[key].splice(event.index, 1); @@ -1241,7 +1353,7 @@ ); } }, - bottomButtonTwo(){ + bottomButtonTwo() { // if(!this.formData.roadType){ // return this.$.toast("请输入道路类型"); // } @@ -1843,6 +1955,7 @@ align-items: center; height: 110rpx; font-size: 30rpx; + font-weight: 600; .border { background-color: #2663BF; @@ -1852,6 +1965,18 @@ } } + .label-box2 { + height: 100rpx; + + + } + + .label-box-small { + font-size: 28rpx; + margin-top: -25rpx; + font-weight: 500; + } + .border-bottom { border-bottom: 1px #eee solid; } @@ -1859,7 +1984,16 @@ .border-top { border-top: 1px #eee solid; } + // .uni-forms-item__labe{ // width: ; // } + .nodata { + width: 100%; + text-align: center; + height: 300rpx; + line-height: 300rpx; + font-size: 28rpx; + color: #ccc; + } \ No newline at end of file From b1a2884fb73e30d5aac580990af913a61cfed5da Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Tue, 30 Jul 2024 15:26:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/investigation/task.vue | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/pages/investigation/task.vue b/pages/investigation/task.vue index 0a35fee..0111a71 100644 --- a/pages/investigation/task.vue +++ b/pages/investigation/task.vue @@ -1389,21 +1389,21 @@ } }, bottomButtonTwo() { - // if(!this.formData.roadType){ - // return this.$.toast("请输入道路类型"); - // } - // if(!this.formData.roadWidth){ - // return this.$.toast("请输入道路宽度"); - // } - // if(!this.formData.laneCount){ - // return this.$.toast("请输入车道数"); - // } - // if(!this.formData.designSpeed){ - // return this.$.toast("请输入设计时速"); - // } - // if(!this.formData.limitSpeed){ - // return this.$.toast("请输入限速"); - // } + if(!this.formData.roadType){ + return this.$.toast("请输入道路类型"); + } + if(!this.formData.roadWidth){ + return this.$.toast("请输入道路宽度"); + } + if(!this.formData.laneCount){ + return this.$.toast("请输入车道数"); + } + if(!this.formData.designSpeed){ + return this.$.toast("请输入设计时速"); + } + if(!this.formData.limitSpeed){ + return this.$.toast("请输入限速"); + } this.isEdit = false; this.active = 2; }, From 804e8edae1494403db2834a9b5fa21439ebcf03c Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Tue, 30 Jul 2024 15:46:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/investigation/task.vue | 130 ++++++++++++++++++++++++++++------- 1 file changed, 105 insertions(+), 25 deletions(-) diff --git a/pages/investigation/task.vue b/pages/investigation/task.vue index 0111a71..36d676d 100644 --- a/pages/investigation/task.vue +++ b/pages/investigation/task.vue @@ -222,17 +222,25 @@ 暂无数据 - + + 事故分布 + + + + 重点排查 - + {{ item.name }} - + + @@ -244,15 +252,15 @@ - + {{ indexData + 1 }}. {{ itemData.length > 0 ? itemData[0].nname : '' }} + activeColor="#2663BF" :name="item.id" @click="showInvestigationTag2(item)" + style="padding: 8px 12px;"> - + @@ -329,8 +337,8 @@ {{ item.hdTermName||item.dangerProblem }} - + []); + const array = Array.from({ + length: this.investigationSelectList.length + }, (_, i) => []); let nidname = this.investigationSelectList.length > 0 ? this.investigationSelectList[0].name : '' let nx = 0 this.troubleshootingData.map(r => { this.investigationSelectList.map(m => { - if(r.nid == m.nid) { + if (r.nid == m.nid) { r.nname = m.name - if(r.nname == nidname){ + if (r.nname == nidname) { array[nx].push(r) } else { nidname = r.nname @@ -778,6 +794,70 @@ } }, methods: { + // 确认授权后,获取用户位置 + getLocationInfo() { + uni.getLocation({ + type: "wgs84", + success: (res) => { + console.log(res); + const coord = wgs84LL2gcjLL2(res.longitude, res.latitude); + this.longitude = coord[0]; //118.787575; + this.latitude = coord[1]; //32.05024; + // this.longitude = 120.38771; + // this.latitude = 36.110146; + + }, + }); + }, + getSystemInfo() { + // #ifdef APP-PLUS + // 在 App 端执行的代码 + // 获取系统信息 + uni.getSystemInfo({ + success: function (res) { + // 判断运行环境是否为 App + // if (res.platform === 'android' || res.platform === 'ios') { + // 在 App 端执行获取定位信息的逻辑 + uni.getLocation({ + success: function (locationRes) { + console.log('已获取定位信息', locationRes); + // 在这里处理定位成功的逻辑 + }, + fail: function (error) { + console.error('获取定位信息失败', error); + if (error.errMsg.indexOf('auth deny') !== -1) { + // 用户拒绝授权定位权限,可以引导用户打开权限设置页面 + uni.showModal({ + title: '提示', + content: '请授权使用您的定位服务', + confirmText: '去授权', + success: function (modalRes) { + if (modalRes.confirm) { + uni.openSetting({ + success: (settingRes) => { + console.log('openSetting success', settingRes.authSetting); + // 在这里可以处理打开设置页面后的逻辑 + this.getLocationInfo(); + }, + fail: (settingError) => { + console.log('openSetting fail', settingError); + // 打开设置页面失败的处理逻辑 + } + }); + } + } + }); + } + } + }); + // } else { + // console.log('当前不在 App 环境中'); + // // 在非 App 环境中的处理逻辑 + // } + } + }); + // #endif + }, showInvestigationTag(v) { console.log(v) this.showInvestigation2 = true; @@ -1389,19 +1469,19 @@ } }, bottomButtonTwo() { - if(!this.formData.roadType){ + if (!this.formData.roadType) { return this.$.toast("请输入道路类型"); } - if(!this.formData.roadWidth){ + if (!this.formData.roadWidth) { return this.$.toast("请输入道路宽度"); } - if(!this.formData.laneCount){ + if (!this.formData.laneCount) { return this.$.toast("请输入车道数"); } - if(!this.formData.designSpeed){ + if (!this.formData.designSpeed) { return this.$.toast("请输入设计时速"); } - if(!this.formData.limitSpeed){ + if (!this.formData.limitSpeed) { return this.$.toast("请输入限速"); } this.isEdit = false; @@ -1658,14 +1738,14 @@ onLongPressZD(item) { this.nidZD = item.nid }, - delZD(){ + delZD() { this.troubleshootingData = this.troubleshootingData.filter(r => { - if(r.nid != this.nidZD){ + if (r.nid != this.nidZD) { return r } }) this.investigationSelectList = this.investigationSelectList.filter(r => { - if(r.nid != this.nidZD){ + if (r.nid != this.nidZD) { return r } }) @@ -1674,9 +1754,9 @@ onLongPressYH(item) { this.nidYH = item.nid }, - delYH(){ + delYH() { this.hiddenDangerList = this.hiddenDangerList.filter(r => { - if(r.nid != this.nidYH){ + if (r.nid != this.nidYH) { return r } }) @@ -2029,7 +2109,7 @@ .label-box2 { height: 100rpx; - + }