|
@@ -52,6 +52,15 @@
|
|
|
<image class="icon" src="/static/images/duty_icon.png"></image>
|
|
|
</view>
|
|
|
</template>
|
|
|
+ <view class="filter-box">
|
|
|
+ <view class="bt lf" @click="changeDate(-1)">
|
|
|
+ <uni-icons type="left" color="#777" size="30"></uni-icons>
|
|
|
+ </view>
|
|
|
+ <view class="time">{{dutyDate}}</view>
|
|
|
+ <view class="bt rt" @click="changeDate(1)">
|
|
|
+ <uni-icons type="right" color="#777" size="30"></uni-icons>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view class="duty-item" v-for="(duty,index) in dutys" :key="duty.accountId">
|
|
|
<view class="avatar">
|
|
|
<image class="icon" src="/static/images/avatar.png" mode=""></image>
|
|
@@ -84,6 +93,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="isEmpty" v-if="dutys.length<1">
|
|
|
+ 暂无数据
|
|
|
+ </view>
|
|
|
</uni-section>
|
|
|
</div>
|
|
|
<div class="item-conatiner">
|
|
@@ -119,7 +131,13 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import StatisticsChart from '@/components/IndexBarChart.vue'
|
|
|
+ import StatisticsChart from '@/components/IndexBarChart.vue'
|
|
|
+ import dutyApi from '@/api/duty.js'
|
|
|
+ import teamApi from '@/api/team.js'
|
|
|
+ import goodsApi from '@/api/goods.js'
|
|
|
+ import industryApi from '@/api/industry.js'
|
|
|
+ import dangerApi from '@/api/danger.js'
|
|
|
+ import {parseTime} from '@/libs/index.js'
|
|
|
export default {
|
|
|
components:{
|
|
|
StatisticsChart
|
|
@@ -128,6 +146,7 @@
|
|
|
return {
|
|
|
dutys: [],
|
|
|
statisticsIdx:0,
|
|
|
+ dutyDate:parseTime(new Date(),'{y}-{m}-{d}'),
|
|
|
statisticsTabs: ['队伍建设', '物资储备', '行业管理', '隐患管理'],
|
|
|
statisticsData:{
|
|
|
name:"救援队",unit:"人数",
|
|
@@ -136,70 +155,100 @@
|
|
|
chartdata:{yData:[],xData:[]}
|
|
|
}
|
|
|
},
|
|
|
- onLoad() {
|
|
|
+ onShow() {
|
|
|
this.init()
|
|
|
},
|
|
|
methods: {
|
|
|
init(){
|
|
|
this.getdutyData();
|
|
|
- this.getStatisticsData()
|
|
|
+ this.getStatisticsData()
|
|
|
+ },
|
|
|
+ changeDate(step){
|
|
|
+ let date=new Date(this.dutyDate)
|
|
|
+ date.setDate(date.getDate()+step)
|
|
|
+ this.dutyDate=parseTime(date,'{y}-{m}-{d}')
|
|
|
+ this.getdutyData()
|
|
|
},
|
|
|
getdutyData(){
|
|
|
- let items=[];
|
|
|
- for(let i=0;i<10;i++){
|
|
|
- items.push({
|
|
|
- "accountId": 1123065 +i,
|
|
|
- "accountName": "王俏",
|
|
|
- "accountPhone":i%2===0?13475197635:'',
|
|
|
- "dutyDate": "2024-11-24 00:00:00",
|
|
|
- "dutyType": 1,
|
|
|
- "groupId": 406283,
|
|
|
- "groupName": "铜川市印台区应急管理局",
|
|
|
- "ocId": 406283,
|
|
|
- "posId": 1122937,
|
|
|
- "posName": "副班人员",
|
|
|
- "positionId": 1123054,
|
|
|
- "positionName": "干部",
|
|
|
- "recordId": 1123081,
|
|
|
- "remark": ""
|
|
|
+ dutyApi.getAllByList({dutyDate:this.dutyDate}).then((res)=>{
|
|
|
+ this.dutys=res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getStatisticsData(){
|
|
|
+ if(this.statisticsIdx===0){
|
|
|
+ teamApi.counterByMember().then((res)=>{
|
|
|
+ let data=res.data;
|
|
|
+ this.statisticsData.items=data.map(item=>{
|
|
|
+ return{
|
|
|
+ name:item.teamName,
|
|
|
+ num:item.count
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ teamApi.counterByCat().then((res)=>{
|
|
|
+ let data=res.data;
|
|
|
+ this.chartdata={
|
|
|
+ yData:data.map(item=>item.count),
|
|
|
+ xData:data.map(item=>item.teamName),
|
|
|
+ name:"队伍建设"
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
- console.log(items)
|
|
|
- this.dutys=items
|
|
|
- },
|
|
|
- getStatisticsData(){
|
|
|
- let data=[
|
|
|
- {
|
|
|
- "goodsCatId": 1122893,
|
|
|
- "goodsCatTitle": "紧急通讯物资",
|
|
|
- "ocId": 406283,
|
|
|
- "total": 1012
|
|
|
- },
|
|
|
- {
|
|
|
- "goodsCatId": 533724,
|
|
|
- "goodsCatTitle": "防火物资",
|
|
|
- "ocId": 406283,
|
|
|
- "total": 127
|
|
|
- },
|
|
|
- {
|
|
|
- "goodsCatId": 540673,
|
|
|
- "goodsCatTitle": "抗洪物资",
|
|
|
- "ocId": 406283,
|
|
|
- "total": 99
|
|
|
- }
|
|
|
- ]
|
|
|
- let names=['队伍建设','数量','企业/单位数目','隐患数目']
|
|
|
- this.statisticsData.items=data.map(item=>{
|
|
|
- return{
|
|
|
- name:item.goodsCatTitle,
|
|
|
- num:item.total
|
|
|
- }
|
|
|
- });
|
|
|
- this.chartdata={
|
|
|
- yData:data.map(item=>item.total),
|
|
|
- xData:data.map(item=>item.goodsCatTitle),
|
|
|
- name:names[this.statisticsIdx]
|
|
|
+ if(this.statisticsIdx===1){
|
|
|
+ goodsApi.totalByCat().then((res)=>{
|
|
|
+ let data=res.data;
|
|
|
+ this.statisticsData.items=data.map(item=>{
|
|
|
+ return{
|
|
|
+ name:item.goodsCatTitle,
|
|
|
+ num:item.total
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.chartdata={
|
|
|
+ yData:data.map(item=>item.total),
|
|
|
+ xData:data.map(item=>item.goodsCatTitle),
|
|
|
+ name:"数量"
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.statisticsIdx===2){
|
|
|
+ industryApi.counterByGroup().then((res)=>{
|
|
|
+ let data=res.data;
|
|
|
+ this.statisticsData.items=data.map(item=>{
|
|
|
+ return{
|
|
|
+ name:item.groupName,
|
|
|
+ num:item.count
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ industryApi.counterByCat().then((res)=>{
|
|
|
+ let data=res.data;
|
|
|
+ this.chartdata={
|
|
|
+ yData:data.map(item=>item.count),
|
|
|
+ xData:data.map(item=>item.entCatTitle),
|
|
|
+ name:"企业/单位数目"
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
+ if(this.statisticsIdx===3){
|
|
|
+ dangerApi.counterByGroup().then((res)=>{
|
|
|
+ let data=res.data;
|
|
|
+ this.statisticsData.items=data.map(item=>{
|
|
|
+ return{
|
|
|
+ name:item.groupName,
|
|
|
+ num:item.count
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ dangerApi.counterByCat().then((res)=>{
|
|
|
+ let data=res.data;
|
|
|
+ this.chartdata={
|
|
|
+ yData:data.map(item=>item.count),
|
|
|
+ xData:data.map(item=>item.dangerCatTitle),
|
|
|
+ name:"隐患数目"
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
linkTo(type){
|
|
|
uni.navigateTo({
|
|
@@ -208,8 +257,7 @@
|
|
|
},
|
|
|
changeStatics({currentIndex}) {
|
|
|
if (this.statisticsIdx !== currentIndex) {
|
|
|
- this.statisticsIdx = currentIndex
|
|
|
-
|
|
|
+ this.statisticsIdx = currentIndex
|
|
|
let ths=[{name:"救援队",unit:"人数"},{name:"物资分类",unit:"数量"},{name:"监管单位",unit:"企业/单位数目"},{name:"监管单位",unit:"隐患数目"}]
|
|
|
this.statisticsData={
|
|
|
name:ths[currentIndex].name,unit:ths[currentIndex].unit,
|
|
@@ -220,19 +268,10 @@
|
|
|
},
|
|
|
callPhone(phoneNumber) {
|
|
|
if(!phoneNumber)return
|
|
|
- uni.makePhoneCall({
|
|
|
- phoneNumber: phoneNumber, // 电话号码
|
|
|
- success: function () {
|
|
|
- console.log('拨打电话成功');
|
|
|
- },
|
|
|
- fail: function () {
|
|
|
- console.log('拨打电话失败');
|
|
|
- }
|
|
|
- });
|
|
|
+ wx.makePhoneCall({
|
|
|
+ phoneNumber
|
|
|
+ })
|
|
|
}
|
|
|
- },
|
|
|
- onPullDownRefresh() {
|
|
|
- alert(1)
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -287,6 +326,33 @@
|
|
|
margin-top: 40rpx;
|
|
|
padding-bottom: 10rpx;
|
|
|
background-color: #fff;
|
|
|
+ .filter-box{
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ padding-bottom: 20rpx;
|
|
|
+ .time{
|
|
|
+ padding:16rpx 20rpx;
|
|
|
+ width: 260rpx;
|
|
|
+ border: 1px solid #ddd;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 6px;
|
|
|
+ margin: 0 40rpx;
|
|
|
+ font-size: 32rpx;
|
|
|
+ line-height: 1;
|
|
|
+ color: #424242;
|
|
|
+ font-weight: 600;
|
|
|
+ box-shadow:0 0 4px rgba(0, 0, 0, 0.2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .isEmpty{
|
|
|
+ text-align: center;
|
|
|
+ font-size: 36rpx;
|
|
|
+ line-height: 1;
|
|
|
+ padding: 36rpx;
|
|
|
+ color: #999999;
|
|
|
+ background-color: #f8f8f8;
|
|
|
+ }
|
|
|
.duty-item{
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|