zhangqun 11 months ago
commit 75333991e9
  1. 302
      pages/investigation/task.vue

@ -67,7 +67,7 @@
</view> </view>
<uni-forms-item label="道路类型" name="roadType" required label-width="80"> <uni-forms-item label="道路类型" name="roadType" required label-width="80">
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; "> <view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
<input v-if="isEdit" type="text" class="BorderNone Height100 formInput" <input v-if="isEdit" type="text" class="BorderNone Height100 formInput"
v-model="formData.roadType" placeholder="请输入道路类型" @focus="focus" /> v-model="formData.roadType" placeholder="请输入道路类型" @focus="focus" />
<view class="Height100" v-else>{{ formData.roadType }}</view> <view class="Height100" v-else>{{ formData.roadType }}</view>
<view class="Height100"></view> <view class="Height100"></view>
@ -136,10 +136,15 @@
</view> </view>
<u-picker :show="showPicker" :columns="columnsPicker" keyName="label" @cancel="pickerCancel" <u-picker :show="showPicker" :columns="columnsPicker" keyName="label" @cancel="pickerCancel"
@confirm="pickerConfirm"></u-picker> @confirm="pickerConfirm"></u-picker>
<view class="echarts" v-if="active === 2">
<!-- <view class="echarts" v-if="active === 2">
<qiun-data-charts type="area" :opts="opts" :chartData="chartData" /> <qiun-data-charts type="area" :opts="opts" :chartData="chartData" />
</view> </view> -->
<view class="formBox form-step-2" v-if="active === 2"> <view class="formBox form-step-2" v-if="active === 2">
<view class="label-box label-box2">
<view class="border"></view> 交通流量
</view>
<qiun-data-charts type="area" :opts="opts" :chartData="chartData" />
<uni-forms :modelValue="formData" border label-width="120"> <uni-forms :modelValue="formData" border label-width="120">
<uni-forms-item label="最大流量"> <uni-forms-item label="最大流量">
<view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; "> <view class="Height100 Flex Flex_end Flex_C_S-Center" style="line-height: 37px; ">
@ -190,17 +195,52 @@
<view class="Height100"></view> <view class="Height100"></view>
</view> </view>
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
</view> </view>
<view class="formBox form-step-2" v-if="active === 2">
<view class="label-box label-box2">
<view class="border"></view> 违法情况
</view>
<view class="label-box label-box2 label-box-small">
违法数量
</view>
<qiun-data-charts type="area" :opts="opts2" :chartData="chartData2" v-if="chartData2.series.length>0" />
<view v-else class="nodata">暂无数据</view>
<view class="label-box label-box2 label-box-small">
违法占比
</view>
<qiun-data-charts type="rose" :opts="opts3" :chartData="chartData3" v-if="chartData3.series.length>0" />
<view v-else class="nodata">暂无数据</view>
</view>
<view class="formBox form-step-2" v-if="active === 2">
<view class="label-box label-box2">
<view class="border"></view> 事故情况
</view>
<view class="label-box label-box2 label-box-small">
事故数量
</view>
<qiun-data-charts type="area" :opts="opts4" :chartData="chartData4" v-if="chartData4.series.length>0" />
<view v-else class="nodata">暂无数据</view>
<view class="label-box label-box2 label-box-small">
事故分布
</view>
<map id="maps" style="width: 100%; height: 400rpx" :latitude="latitude" :longitude="longitude"
:markers="covers">
</map>
</view>
<view class="formBox form-step-3" v-if="active === 3"> <view class="formBox form-step-3" v-if="active === 3">
<view class="point"> <view class="point">
<view class="title">重点排查</view> <view class="title">重点排查</view>
<view class='row' style="display: flex; flex-wrap: wrap; justify-content: space-between;"> <view class='row' style="display: flex; flex-wrap: wrap; justify-content: space-between;">
<view style="width: 300rpx;" v-for="item in investigationSelectList" :key="item" @longpress="onLongPressZD(item)"> <view style="width: 300rpx;" v-for="item in investigationSelectList" :key="item"
@longpress="onLongPressZD(item)">
<view class="item">{{ item.name }} <view class="item">{{ item.name }}
<image style="width: 30px;height: 30px;margin-left: 10px;" src="../../static/task/3879.png" <image style="width: 30px;height: 30px;margin-left: 10px;"
v-show="nidZD == item.nid" @click.stop="delZD"></image> src="../../static/task/3879.png" v-show="nidZD == item.nid" @click.stop="delZD">
</image>
</view> </view>
</view> </view>
<view style="width: 300rpx;" v-show="type!='view'"> <view style="width: 300rpx;" v-show="type!='view'">
@ -212,15 +252,15 @@
</view> </view>
</view> </view>
<u-checkbox-group v-model="checked" iconPlacement="right" placement="column"> <u-checkbox-group v-model="checked" iconPlacement="right" placement="column">
<view v-for="(itemData,indexData) in reversedTroubleshootingData" :key="indexData"> <view v-for="(itemData,indexData) in reversedTroubleshootingData" :key="indexData">
{{ indexData + 1 }}. {{ indexData + 1 }}.
{{ itemData.length > 0 ? itemData[0].nname : '' }} {{ itemData.length > 0 ? itemData[0].nname : '' }}
<u-checkbox v-for="(item,index) in itemData" :key="index" :label="item.itemname" <u-checkbox v-for="(item,index) in itemData" :key="index" :label="item.itemname"
activeColor="#2663BF" :name="item.id" @click="showInvestigationTag2(item)" activeColor="#2663BF" :name="item.id" @click="showInvestigationTag2(item)"
style="padding: 8px 12px;"></u-checkbox> style="padding: 8px 12px;"></u-checkbox>
</view> </view>
</u-checkbox-group> </u-checkbox-group>
<u-popup :show="showInvestigation" @close="showInvestigation = false"> <u-popup :show="showInvestigation" @close="showInvestigation = false">
<InvestigationItem :type="type" @select="select2"></InvestigationItem> <InvestigationItem :type="type" @select="select2"></InvestigationItem>
@ -297,8 +337,8 @@
<view style="width: 80%;line-height: 30px;"> <view style="width: 80%;line-height: 30px;">
{{ item.hdTermName||item.dangerProblem }} {{ item.hdTermName||item.dangerProblem }}
</view> </view>
<image style="width: 30px;height: 30px;" src="../../static/task/3879.png" <image style="width: 30px;height: 30px;" src="../../static/task/3879.png"
v-show="nidYH == item.nid" @click.stop="delYH"></image> v-show="nidYH == item.nid" @click.stop="delYH"></image>
<view v-show="!(nidYH == item.nid)"> <view v-show="!(nidYH == item.nid)">
<view class="check" @click="onHiddenDangerList(item,index)"> <view class="check" @click="onHiddenDangerList(item,index)">
<image style="width: 10px; height: 16px" <image style="width: 10px; height: 16px"
@ -411,7 +451,7 @@
import BottomButtonTwo from "../../components/bottom-button/index.vue"; import BottomButtonTwo from "../../components/bottom-button/index.vue";
import NoData from "../../components/no-data.vue"; import NoData from "../../components/no-data.vue";
import TopTitle from "../../components/top-title.vue"; import TopTitle from "../../components/top-title.vue";
import { wgs84LL2gcjLL2 } from "../map/c.js";
import InvestigationItem from "./components/investigation-item.vue"; import InvestigationItem from "./components/investigation-item.vue";
import InvestigationItem2 from "./components/investigation-item2.vue"; import InvestigationItem2 from "./components/investigation-item2.vue";
import ProblemTreeItem from "./components/problem-tree-item.vue"; import ProblemTreeItem from "./components/problem-tree-item.vue";
@ -430,6 +470,7 @@
}, },
onReady() { onReady() {
this.getChartsData(); this.getChartsData();
this.getChartsData2()
}, },
onLoad(e) { onLoad(e) {
this.boxHeight = uni.getSystemInfoSync().windowHeight; this.boxHeight = uni.getSystemInfoSync().windowHeight;
@ -443,6 +484,8 @@
this.getBaseData(e.id); this.getBaseData(e.id);
this.getStreetCommunity() this.getStreetCommunity()
} }
this.getLocationInfo();
this.getSystemInfo()
}, },
data() { data() {
return { return {
@ -512,6 +555,7 @@
type: "item", type: "item",
i: 3 i: 3
}, },
], ],
formData: { formData: {
roadType: "", roadType: "",
@ -530,10 +574,10 @@
required: true, required: true,
errorMessage: '请选择道路类型', errorMessage: '请选择道路类型',
}, },
] ]
}, },
}, },
describe: { describe: {
bigCategory: "", bigCategory: "",
@ -543,9 +587,50 @@
hdPic: "", hdPic: "",
hdInfo: "", hdInfo: "",
}, },
latitude: 39.909,
longitude: 116.39742,
covers: [],
chartData: {}, chartData: {},
// config-ucharts.js ['area'] opts opts // config-ucharts.js ['area'] opts 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: [ color: [
"#1890FF", "#1890FF",
"#FAC858", "#FAC858",
@ -563,7 +648,8 @@
icon: "rect", icon: "rect",
position: "top", position: "top",
float: "right", float: "right",
padding: 15, padding: 10,
show: false,
}, },
xAxis: { xAxis: {
disableGrid: true, disableGrid: true,
@ -583,6 +669,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, showProblem: false,
showProblemTreeSelect: false, showProblemTreeSelect: false,
problemTreeSelect: 0, problemTreeSelect: 0,
@ -654,14 +773,16 @@
}, },
computed: { computed: {
reversedTroubleshootingData() { reversedTroubleshootingData() {
const array = Array.from({ length: this.investigationSelectList.length }, (_, i) => []); const array = Array.from({
length: this.investigationSelectList.length
}, (_, i) => []);
let nidname = this.investigationSelectList.length > 0 ? this.investigationSelectList[0].name : '' let nidname = this.investigationSelectList.length > 0 ? this.investigationSelectList[0].name : ''
let nx = 0 let nx = 0
this.troubleshootingData.map(r => { this.troubleshootingData.map(r => {
this.investigationSelectList.map(m => { this.investigationSelectList.map(m => {
if(r.nid == m.nid) { if (r.nid == m.nid) {
r.nname = m.name r.nname = m.name
if(r.nname == nidname){ if (r.nname == nidname) {
array[nx].push(r) array[nx].push(r)
} else { } else {
nidname = r.nname nidname = r.nname
@ -675,6 +796,70 @@
} }
}, },
methods: { 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) { showInvestigationTag(v) {
console.log(v) console.log(v)
this.showInvestigation2 = true; this.showInvestigation2 = true;
@ -1193,9 +1378,8 @@
getChartsData() { getChartsData() {
// //
let res = { let res = {
categories: ["01", "02", "03", "04", "05", "06","07", "08", "09", "10", "11", "12"], categories: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"],
series: [ series: [{
{
name: "总量", name: "总量",
legendShape: "line", legendShape: "line",
data: [], data: [],
@ -1203,7 +1387,7 @@
{ {
name: "大车", name: "大车",
legendShape: "line", legendShape: "line",
data: [], data: [],
}, },
{ {
name: "小车", name: "小车",
@ -1214,6 +1398,14 @@
}; };
this.chartData = JSON.parse(JSON.stringify(res)); 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) { deletePic(event, key) {
this[key].splice(event.index, 1); this[key].splice(event.index, 1);
@ -1278,22 +1470,22 @@
); );
} }
}, },
bottomButtonTwo(){ bottomButtonTwo() {
// if(!this.formData.roadType){ if (!this.formData.roadType) {
// return this.$.toast(""); return this.$.toast("请输入道路类型");
// } }
// if(!this.formData.roadWidth){ if (!this.formData.roadWidth) {
// return this.$.toast(""); return this.$.toast("请输入道路宽度");
// } }
// if(!this.formData.laneCount){ if (!this.formData.laneCount) {
// return this.$.toast(""); return this.$.toast("请输入车道数");
// } }
// if(!this.formData.designSpeed){ if (!this.formData.designSpeed) {
// return this.$.toast(""); return this.$.toast("请输入设计时速");
// } }
// if(!this.formData.limitSpeed){ if (!this.formData.limitSpeed) {
// return this.$.toast(""); return this.$.toast("请输入限速");
// } }
this.isEdit = false; this.isEdit = false;
this.active = 2; this.active = 2;
}, },
@ -1559,14 +1751,14 @@
this.nidZD = item.nid this.nidZD = item.nid
} }
}, },
delZD(){ delZD() {
this.troubleshootingData = this.troubleshootingData.filter(r => { this.troubleshootingData = this.troubleshootingData.filter(r => {
if(r.nid != this.nidZD){ if (r.nid != this.nidZD) {
return r return r
} }
}) })
this.investigationSelectList = this.investigationSelectList.filter(r => { this.investigationSelectList = this.investigationSelectList.filter(r => {
if(r.nid != this.nidZD){ if (r.nid != this.nidZD) {
return r return r
} }
}) })
@ -1587,9 +1779,9 @@
this.nidYH = item.nid this.nidYH = item.nid
} }
}, },
delYH(){ delYH() {
this.hiddenDangerList = this.hiddenDangerList.filter(r => { this.hiddenDangerList = this.hiddenDangerList.filter(r => {
if(r.nid != this.nidYH){ if (r.nid != this.nidYH) {
return r return r
} }
}) })
@ -1930,6 +2122,7 @@
align-items: center; align-items: center;
height: 110rpx; height: 110rpx;
font-size: 30rpx; font-size: 30rpx;
font-weight: 600;
.border { .border {
background-color: #2663BF; background-color: #2663BF;
@ -1939,6 +2132,18 @@
} }
} }
.label-box2 {
height: 100rpx;
}
.label-box-small {
font-size: 28rpx;
margin-top: -25rpx;
font-weight: 500;
}
.border-bottom { .border-bottom {
border-bottom: 1px #eee solid; border-bottom: 1px #eee solid;
} }
@ -1946,7 +2151,16 @@
.border-top { .border-top {
border-top: 1px #eee solid; border-top: 1px #eee solid;
} }
// .uni-forms-item__labe{ // .uni-forms-item__labe{
// width: ; // width: ;
// } // }
.nodata {
width: 100%;
text-align: center;
height: 300rpx;
line-height: 300rpx;
font-size: 28rpx;
color: #ccc;
}
</style> </style>
Loading…
Cancel
Save