<template>
  <view class="home-container">
    <template v-if="hasPlat(['sanitation'])">
      <view class="index-title">
        智慧环卫 <view class="dot"></view> 让科技建设城市
      </view>
      <image :src="$getImages('/assetsMobile/images/index/page.png')" class="background-image"></image>
      <view class="page-warp">
        <template v-for="(item,index) in sanitationArr">
          <view v-if="$hasPermiOr(allPermission(item.sidebarList))" :key="index" class="home-munes" :class="index==0?'pd8':''">
              <view class="sidebar">
                  <Sidebar :direction="item.direction" :sidebarList="item.sidebarList" :label="item.label" :titleIcon="item.titleIcon"></Sidebar>
              </view>
          </view>
        </template>
      </view>
    </template>
    <template v-else-if="hasPlat(['enterprises'])">

		<view class="tipfixed" v-if="hasHostPlat(['dingH5']) && $store.state.user.showSts==1">
			<template v-if="!$store.state.user.isModel">
				<div>点击演示按钮后进入演示状态，显示模拟数据</div>
				<u-button type="success" size="mini" 
					:custom-style="{width: '160rpx'}" @click="$store.dispatch('setIsModel',true)">开始演示</u-button>
			</template>
			<template v-else-if="$store.state.user.isModel">
				<div>点击退出演示后退出演示状态，显示真实数据</div>
				<u-button type="error" size="mini" 
					:custom-style="{width: '160rpx'}" @click="$store.dispatch('setIsModel',false)">退出演示</u-button>
			</template>		
		</view>
	
      <view class="index-title">
        精准管理 <view class="dot"></view> 让管车更简单
      </view>
      <image :src="$getImages('/assetsMobile/images/index/page.png')" class="background-image"></image>
      <view class="page-warp">
        <template v-for="(item,index) in enterprisesArr">
          <view v-if="$hasPermiOr(allPermission(item.sidebarList))" :key="index" class="home-munes" :class="index==0?'pd8':''">
              <view class="sidebar">
                  <Sidebar :direction="item.direction" :sidebarList="item.sidebarList" :label="item.label" :titleIcon="item.titleIcon"></Sidebar>
              </view>
          </view>
        </template>
      </view>
    </template>
    <template v-else>
      <view class="page1-warp">
        <template v-for="(item,index) in otherArr">
          <view v-if="$hasPermiOr(allPermission(item.sidebarList))" :key="index" class="home-munes">
              <view class="sidebar">
                <Sidebar :sidebarList="item.sidebarList" :label="item.label"></Sidebar>
              </view>
          </view>
        </template>
      </view>
    </template>
    
  </view>
</template>

<script>
import { taskCount } from "@/api/wfApi/index";
import Sidebar from '@/components/sidebar'
export default {
    components: {
        Sidebar,
    },
    data() {
        return {
           sanitationArr: [
            {
              // label:'',
              // titleIcon:'',
              direction:'vertical',
              sidebarList:[
                {
                    permission: 'mobile:index:sanTask:machineWorkRecord', // 权限
                    label: '机械作业', // 标题
                    icon: this.$getImages('/assetsMobile/images/index/machine-bg.png'), // 图片
                    url: '/pagesSanitation/machineWorkRecord/machineWorkRecord', // 路径
                },
                {
                    permission: 'mobile:index:sanTask:wasteTransfer', // 权限
                    label: '垃圾转运', // 标题
                    icon: this.$getImages('/assetsMobile/images/index/transport-bg.png'), // 图片
                    url: '/pagesSanitation/wasteTransfer/wasteTransfer', // 路径
                },
                {
                    permission: 'mobile:index:sanTask:wasteTransport', // 权限
                    label: '垃圾收运', // 标题
                    icon: this.$getImages('/assetsMobile/images/index/collect-bg.png'), // 图片
                    url: '/pagesSanitation/wasteTransport/wasteTransport', // 路径
                },
                
                // {
                //     permission: '', // 权限
                //     label: '垃圾分类', // 标题
                //     icon: this.$getImages('/assetsMobile/images/index/classify-bg.png'), // 图片
                //     url: '', // 路径
                // },
                // {
                //     permission: '', // 权限
                //     label: '保洁作业', // 标题
                //     icon: this.$getImages('/assetsMobile/images/index/clean-bg.png'), // 图片
                //     url: '', // 路径
                // },
              ]
            },
            {
              label:'监控中心',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/monitor-icon.png`),
              // direction:'',
              sidebarList:[ // 监控中心
                {
                    permission: 'mobie:index:base:realtimeWatch', // 权限
                    label: '实时定位', // 标题
                    iconbg:'0',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-real-time-position.png'),//`http://tq.5000v.com:8035/assetsMobile/images/index/menu/icon-real-time-position.png`, // 图片
                    url: '/pages/realtimeWatch/realtimeWatch', // 路径
                },
                {
                    permission: 'mobie:index:base:pastRoute', // 权限
                    label: '历史轨迹', // 标题
                    iconbg:'3',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-history-track.png'), // 图片
                    url: '/pagesMap/pastRoute/pastRoute', // 路径
                },
                // {
                //     permission: '*', // 权限
                //     label: '视频回放', // 标题
                //     icon: this.$getImages('/assetsMobile/images/index/historicaltrack.png'), // 图片
                //     url: '/pagesVideo/h5playback/index?deviceId=13306349381', // 路径
                // }
              ]
            },
            {
              label:'报警报表',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/task-icon.png`),
              // direction:'',
              sidebarList:[ // 报警报表
                {
                    permission: 'mobile:index:base:proactiveSecurity', // 权限
                    label: '主动安全报警', // 标题
                    iconbg:'0',// 图标背景
                    icon:  this.$getImages('/assetsMobile/images/index/menu/icon-security.png'), // 图片
                    url: '/alarm/proactiveSecurity/index', // 路径
                },
                {
                    permission: 'mobile:index:base:driverBehavior', // 权限
                    label: '驾驶行为报警', // 标题
                    iconbg:'1',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-behavior.png'), // 图片
                    url: '/alarm/driverBehavior/index', // 路径
                },
                {
                    permission: 'mobile:index:base:blindSpot', // 权限
                    label: '车辆盲点报警', // 标题
                    iconbg:'2',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-blind.png'), // 图片
                    url: '/alarm/blindSpot/index', // 路径
                },
              ]
            },
            {
              label:'派车流程',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/flow-icon.png`),
              // direction:'',
              sidebarList:[
                {
                    permission: 'mobile:index:dispatching:initiate', // 权限
                    label: '发起流程', // 标题
                    iconbg:'3',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-initiate-flow.png'), // 图片
                    url: '/pages/flow/diboot?routes=/workflow/mobile/startFlow&workflowKey=system_flow_veh', // 路径
                },
                {
                    permission: 'mobile:index:dispatching:list', // 权限
                    label: '用车记录', // 标题
                    iconbg:'0',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-vehrecord.png'), // 图片
                    url: '/workflow/vehicleRecord/index', // 路径
                },
             ]
            },
            {
              label:'维保流程',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/flow-icon.png`),
              // direction:'',
              sidebarList:[
                {
                    permission: 'mobile:index:maintenance:initiate', // 权限
                    label: '发起流程', // 标题
                    iconbg:'3',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-initiate-flow.png'), // 图片
                    url: '/pages/flow/diboot?routes=/workflow/mobile/startFlow&workflowKey=system_flow_maintenance', // 路径
                },
                {
                    permission: 'mobile:index:maintenance:list', // 权限
                    label: '车辆维保记录', // 标题
                    iconbg:'1',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-mainrecord.png'), // 图片
                    url: '/workflow/vehicleMaintenanceRecord/index', // 路径
                },
             ]
            },
            {
              label:'费用流程',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/flow-icon.png`),
              // direction:'',
              sidebarList:[
                {
                    permission: 'mobile:index:maintenance:initiate', // 权限
                    label: '发起流程', // 标题
                    iconbg:'3',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-initiate-flow.png'), // 图片
                    url: '/pages/flow/diboot?routes=/workflow/mobile/startFlow&workflowKey=system_cost', // 路径
                },
                {
                    permission: 'mobile:index:maintenance:list', // 权限
                    label: '费用记录', // 标题
                    iconbg:'1',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-mainrecord.png'), // 图片
                    url: '/workflow/recordCost/index', // 路径
                },
             ]
            },
            {
              label:'待办',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/flow-icon.png`),
              // direction:'',
              sidebarList:[
                {
                    permission: 'mobile:index:base:flowstart', // 权限
                    label: '发起流程', // 标题
                    iconbg:'3',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-initiate-flow.png'), // 图片
                    url: '/pages/flow/flow?redirect=/pages/workflowTask/index&type=start', // 路径
                },
                {
                    permission: 'mobile:index:base:flowmyLaunch', // 权限
                    label: '我的申请', // 标题
                    iconbg:'2',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-initiate-it.png'), // 图片
                    url: '/pages/flow/flow?redirect=/pages/workflowTask/index&type=myLaunch', // 路径
                },
                {
                    permission: 'mobile:index:base:flowtodo', // 权限
                    label: '我的待办', // 标题
                    iconbg:'1',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-to-do-list.png'), // 图片
                    url: '/pages/flow/flow?redirect=/pages/workflowTask/index&type=todo', // 路径
                    hint:''
                },
                {
                    permission: 'mobile:index:base:flowdone', // 权限
                    label: '我的已办', // 标题
                    iconbg:'0',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-already-done.png'), // 图片
                    url: '/pages/flow/flow?redirect=/pages/workflowTask/index?type=done', // 路径
                },

              ]
            },
            // {
            //   label:'业务记录',
            //   titleIcon:this.$getImages(`/assetsMobile/images/index/menu/business-records-icon.png`),
            //   // direction:'',
            //   sidebarList:[
            //     // {
            //     //     permission: 'mobile:index:base:vehicleRecord', // 权限
            //     //     label: '用车记录', // 标题
            //     //     iconbg:'0',// 图标背景
            //     //     icon: this.$getImages('/assetsMobile/images/index/menu/icon-vehrecord.png'), // 图片
            //     //     url: '/workflow/vehicleRecord/index', // 路径
            //     // },
            //     // {
            //     //     permission: 'mobile:index:base:vehicleRepairRecord', // 权限
            //     //     label: '车辆维修记录', // 标题
            //     //     icon: this.$getImages('/assetsMobile/images/flow/vehicleRepairRecord.png'), // 图片
            //     //     url: '/workflow/vehicleRepairRecord/index', // 路径
            //     // },
            //     {
            //         permission: 'mobile:index:base:vehicleMaintenanceRecord', // 权限
            //         label: '车辆维保记录', // 标题
            //         iconbg:'1',// 图标背景
            //         icon: this.$getImages('/assetsMobile/images/index/menu/icon-mainrecord.png'), // 图片
            //         url: '/workflow/vehicleMaintenanceRecord/index', // 路径
            //     },
            //   ]
            // },
            // {
            //   label:'司机任务',
            //   titleIcon:this.$getImages(`/assetsMobile/images/index/menu/driver-task-icon.png`),
            //   // direction:'',
            //   sidebarList:[
            //     {
            //         permission: 'mobile:index:base:driverTask', // 权限
            //         label: '任务列表', // 标题
            //         iconbg:'3',// 图标背景
            //         icon: this.$getImages('/assetsMobile/images/index/menu/icon-task-list.png'), // 图片
            //         url: '/workflow/driverTask/index', // 路径
            //     },
            //   ]
            // },
            {
              label:'物品管理',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/item-manage-icon.png`),
              // direction:'',
              sidebarList:[
                {
                    permission: 'mobile:index:material:materialApplication', // 权限
                    label: '物品申领', // 标题
                    iconbg:'3',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-item-application.png'), // 图片
                    url: '/pagesBase/materialApplication/index', // 路径
                }, 
				        {
                    permission: 'mobile:index:material:materialRecord', // 权限
                    label: '申领记录', // 标题
                    iconbg:'2',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-application-record.png'), // 图片
                    url: '/pagesBase/materialRecord/index', // 路径
                },
              ]
            },
			{
			  label:'车队管理',
			  titleIcon:this.$getImages(`/assetsMobile/images/index/menu/chedui.png`),
			  // direction:'',
			  sidebarList:[
			    {
			        permission: 'mobile:index:baseMange:driverManage', // 权限
			        label: '司机管理', // 标题
			        iconbg:'3',// 图标背景
			        icon: this.$getImages('/assetsMobile/images/index/menu/driverManage.png'), // 图片
			        url: '/pagesBase/driverManage/index', // 路径
			    }, 
				{
			        permission: 'mobile:index:baseMange:vehManage', // 权限
			        label: '车辆管理', // 标题
			        iconbg:'2',// 图标背景
			        icon: this.$getImages('/assetsMobile/images/index/menu/vehMange.png'), // 图片
			        url: '/pagesBase/vehManage/index', // 路径
			    },
			  ]
			},
            // {
            //   label:'矿山任务',
            //   titleIcon:'',
            //   // direction:'',
            //   sidebarList:[
            //     {
            //         permission: 'mobile:index:mine:task', // 权限
            //         label: '任务', // 标题
            //         iconbg:'0',// 图标背景
            //         icon: this.$getImages('/assetsMobile/images/flow/driverTask.png'), // 图片
            //         url: '/pagesMine/driverTask/index', // 路径
            //     },
            //   ]
            // },
           ],
           enterprisesArr:[
            {
              // label:'',
              // titleIcon:'',
              direction:'vertical',
              sidebarList:[
                {
                    permission: 'mobie:index:base:realtimeWatch', // 权限
                    label: '实时监控', // 标题
                    icon: this.$getImages('/assetsMobile/images/index/monitor-bg.png'), // 图片
                    url: '/pages/realtimeWatch/realtimeWatch', // 路径
                },
                {
                    permission: 'mobile:index:dispatching:initiate', // 权限
                    label: '用车申请', // 标题
                    icon: this.$getImages('/assetsMobile/images/index/vehApplication-bg.png'), // 图片
                    url: '/pages/flow/diboot?routes=/workflow/mobile/startFlow&workflowKey=system_flow_veh', // 路径
                },
                {
                    permission: 'mobile:index:cost:initiate', // 权限
                    label: '费用申请', // 标题
                    icon: this.$getImages('/assetsMobile/images/index/expApplication-bg.png'), // 图片
                    url: '/pages/flow/diboot?routes=/workflow/mobile/startFlow&workflowKey=system_cost', // 路径
                },
              ]
            },
            {
              label:'监控中心',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/monitor-icon.png`),
              // direction:'',
              sidebarList:[ // 监控中心
                // {
                  // permission: 'mobie:index:base:realtimeWatch', // 权限
                  // label: '实时定位', // 标题
                  // iconbg:'0',// 图标背景
                  // icon: this.$getImages('/assetsMobile/images/index/menu/icon-real-time-position.png'),//`http://tq.5000v.com:8035/assetsMobile/images/index/menu/icon-real-time-position.png`, // 图片
                  // url: '/pages/realtimeWatch/realtimeWatch', // 路径
                // },
                {
                    permission: 'mobie:index:base:pastRoute', // 权限
                    label: '历史轨迹', // 标题
                    iconbg:'3',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-history-track.png'), // 图片
                    url: '/pagesMap/pastRoute/pastRoute', // 路径
                },
                // {
                //     permission: '*', // 权限
                //     label: '视频回放', // 标题
                //     icon: this.$getImages('/assetsMobile/images/index/historicaltrack.png'), // 图片
                //     url: '/pagesVideo/h5playback/index?deviceId=13306349381', // 路径
                // }
              ]
            },
            {
              label:'报警报表',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/task-icon.png`),
              // direction:'',
              sidebarList:[ // 报警报表
                {
                    permission: 'mobile:index:base:proactiveSecurity', // 权限
                    label: '主动安全报警', // 标题
                    iconbg:'0',// 图标背景
                    icon:  this.$getImages('/assetsMobile/images/index/menu/icon-security.png'), // 图片
                    url: '/alarm/proactiveSecurity/index', // 路径
                },
                {
                    permission: 'mobile:index:base:driverBehavior', // 权限
                    label: '驾驶行为报警', // 标题
                    iconbg:'1',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-behavior.png'), // 图片
                    url: '/alarm/driverBehavior/index', // 路径
                },
                {
                    permission: 'mobile:index:base:blindSpot', // 权限
                    label: '车辆盲点报警', // 标题
                    iconbg:'2',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-blind.png'), // 图片
                    url: '/alarm/blindSpot/index', // 路径
                },
              ]
            },
            {
              label:'派车管理',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/vehdispatch-icon.png`),
              // direction:'',
              sidebarList:[ // 
                {
                    permission: 'mobile:index:dispatch:vehInspection', // 权限
                    label: '车辆点检', // 标题
                    iconbg:'2',// 图标背景
                    icon: this.$getImages(`/assetsMobile/images/index/menu/icon-vehinspection.png`), // 图片
                    url: '/pagesVehDispatch/vehInspection/index', // 路径
                },
              
              ]
            },
            {
              label:'派车流程',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/flow-icon.png`),
              // direction:'',
              sidebarList:[
                // {
                //    permission: 'mobile:index:dispatching:initiate', // 权限
                //    label: '发起流程', // 标题
                //    iconbg:'3',// 图标背景
                //    icon: this.$getImages('/assetsMobile/images/index/menu/icon-initiate-flow.png'), // 图片
                //    url: '/pages/flow/diboot?routes=/workflow/mobile/startFlow&workflowKey=system_flow_veh', // 路径
                //},
                {
                    permission: 'mobile:index:dispatching:list', // 权限
                    label: '用车记录', // 标题
                    iconbg:'0',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-vehrecord.png'), // 图片
                    url: '/workflow/vehicleRecord/index', // 路径
                },
             ]
            },
            {
              label:'维保流程',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/flow-icon.png`),
              // direction:'',
              sidebarList:[
                {
                    permission: 'mobile:index:maintenance:initiate', // 权限
                    label: '发起流程', // 标题
                    iconbg:'3',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-initiate-flow.png'), // 图片
                    url: '/pages/flow/diboot?routes=/workflow/mobile/startFlow&workflowKey=system_flow_maintenance', // 路径
                },
                {
                    permission: 'mobile:index:maintenance:list', // 权限
                    label: '车辆维保记录', // 标题
                    iconbg:'1',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-mainrecord.png'), // 图片
                    url: '/workflow/vehicleMaintenanceRecord/index', // 路径
                },
             ]
            },
            {
              label:'费用流程',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/flow-icon.png`),
              // direction:'',
              sidebarList:[
                {
                    permission: 'mobile:index:maintenance:initiate', // 权限
                    label: '发起流程', // 标题
                    iconbg:'3',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-initiate-flow.png'), // 图片
                    url: '/pages/flow/diboot?routes=/workflow/mobile/startFlow&workflowKey=system_cost', // 路径
                },
                {
                    permission: 'mobile:index:maintenance:list', // 权限
                    label: '费用记录', // 标题
                    iconbg:'1',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-mainrecord.png'), // 图片
                    url: '/workflow/recordCost/index', // 路径
                },
             ]
            },
            {
              label:'待办',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/flow-icon.png`),
              // direction:'',
              sidebarList:[
                {
                    permission: 'mobile:index:base:flowstart', // 权限
                    label: '发起流程', // 标题
                    iconbg:'3',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-initiate-flow.png'), // 图片
                    url: '/pages/flow/flow?redirect=/pages/workflowTask/index&type=start', // 路径
                },
                {
                    permission: 'mobile:index:base:flowmyLaunch', // 权限
                    label: '我的申请', // 标题
                    iconbg:'2',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-initiate-it.png'), // 图片
                    url: '/pages/flow/flow?redirect=/pages/workflowTask/index&type=myLaunch', // 路径
                },
                {
                    permission: 'mobile:index:base:flowtodo', // 权限
                    label: '我的待办', // 标题
                    iconbg:'1',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-to-do-list.png'), // 图片
                    url: '/pages/flow/flow?redirect=/pages/workflowTask/index&type=todo', // 路径
                    hint:''
                },
                {
                    permission: 'mobile:index:base:flowdone', // 权限
                    label: '我的已办', // 标题
                    iconbg:'0',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-already-done.png'), // 图片
                    url: '/pages/flow/flow?redirect=/pages/workflowTask/index?type=done', // 路径
                },

              ]
            },
            // {
            //   label:'业务记录',
            //   titleIcon:this.$getImages(`/assetsMobile/images/index/menu/business-records-icon.png`),
            //   // direction:'',
            //   sidebarList:[
            //     {
            //         permission: 'mobile:index:base:vehicleRecord', // 权限
            //         label: '用车记录', // 标题
            //         iconbg:'0',// 图标背景
            //         icon: this.$getImages('/assetsMobile/images/index/menu/icon-vehrecord.png'), // 图片
            //         url: '/workflow/vehicleRecord/index', // 路径
            //     },
            //     // {
            //     //     permission: 'mobile:index:base:vehicleRepairRecord', // 权限
            //     //     label: '车辆维修记录', // 标题
            //     //     icon: this.$getImages('/assetsMobile/images/flow/vehicleRepairRecord.png'), // 图片
            //     //     url: '/workflow/vehicleRepairRecord/index', // 路径
            //     // },
            //     {
            //         permission: 'mobile:index:base:vehicleMaintenanceRecord', // 权限
            //         label: '车辆维保记录', // 标题
            //         iconbg:'1',// 图标背景
            //         icon: this.$getImages('/assetsMobile/images/index/menu/icon-mainrecord.png'), // 图片
            //         url: '/workflow/vehicleMaintenanceRecord/index', // 路径
            //     },
            //   ]
            // },
            {
              label:'司机任务',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/driver-task-icon.png`),
              // direction:'',
              sidebarList:[
                {
                    permission: 'mobile:index:base:driverTask', // 权限
                    label: '任务列表', // 标题
                    iconbg:'3',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-task-list.png'), // 图片
                    url: '/workflow/driverTask/index', // 路径
                },
              ]
            },
            {
              label:'物品管理',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/item-manage-icon.png`),
              // direction:'',
              sidebarList:[
                {
                    permission: 'mobile:index:material:materialApplication', // 权限
                    label: '物品申领', // 标题
                    iconbg:'3',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-item-application.png'), // 图片
                    url: '/pagesBase/materialApplication/index', // 路径
                }, 
				        {
                    permission: 'mobile:index:material:materialRecord', // 权限
                    label: '申领记录', // 标题
                    iconbg:'2',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-application-record.png'), // 图片
                    url: '/pagesBase/materialRecord/index', // 路径
                },
              ]
            },
			{
			  label:'车队管理',
			  titleIcon:this.$getImages(`/assetsMobile/images/index/menu/chedui.png`),
			  // direction:'',
			  sidebarList:[
			    {
			        permission: 'mobile:index:baseMange:driverManage', // 权限
			        label: '司机管理', // 标题
			        iconbg:'3',// 图标背景
			        icon: this.$getImages('/assetsMobile/images/index/menu/driverManage.png'), // 图片
			        url: '/pagesBase/driverManage/index', // 路径
			    }, 
				{
			        permission: 'mobile:index:baseMange:vehManage', // 权限
			        label: '车辆管理', // 标题
			        iconbg:'2',// 图标背景
			        icon: this.$getImages('/assetsMobile/images/index/menu/vehMange.png'), // 图片
			        url: '/pagesBase/vehManage/index', // 路径
			    },
			  ]
			},
			
            // {
            //   label:'矿山任务',
            //   titleIcon:'',
            //   // direction:'',
            //   sidebarList:[
            //     {
            //         permission: 'mobile:index:mine:task', // 权限
            //         label: '任务', // 标题
            //         iconbg:'0',// 图标背景
            //         icon: this.$getImages('/assetsMobile/images/flow/driverTask.png'), // 图片
            //         url: '/pagesMine/driverTask/index', // 路径
            //     },
            //   ]
            // },
           ],
           otherArr:[
            {
              label:'监控中心',
              sidebarList:[ // 监控中心
                {
                    permission: 'mobie:index:base:realtimeWatch', // 权限
                    label: '实时定位', // 标题
                    icon: this.$getImages('/assetsMobile/images/index/realTimePosition.png'),//`https://www.yihaocg.com/mobile/image/indexNew/realTimePosition.png`, // 图片
                    url: '/pages/realtimeWatch/realtimeWatch', // 路径
                },
                {
                    permission: 'mobie:index:base:pastRoute', // 权限
                    label: '历史轨迹', // 标题
                    icon: this.$getImages('/assetsMobile/images/index/historicaltrack.png'),//`https://www.yihaocg.com/mobile/image/indexNew/historicaltrack.png`, // 图片
                    url: '/pagesMap/pastRoute/pastRoute', // 路径
                },
                // {
                //     permission: '*', // 权限
                //     label: '视频回放', // 标题
                //     icon: this.$getImages('/assetsMobile/images/index/historicaltrack.png'),//`https://www.yihaocg.com/mobile/image/indexNew/historicaltrack.png`, // 图片
                //     url: '/pagesVideo/h5playback/index?deviceId=13306349381', // 路径
                // }
            ]
            },
            {
              label:'报警报表',
              sidebarList:[ // 报警报表
                {
                    permission: 'mobile:index:base:proactiveSecurity', // 权限
                    label: '主动安全报警', // 标题
                    icon:  this.$getImages('/assetsMobile/images/index/zhudong.png'),//`https://www.yihaocg.com/mobile/image/alarm/zhudong.png`, // 图片
                    url: '/alarm/proactiveSecurity/index', // 路径
                },
                {
                    permission: 'mobile:index:base:driverBehavior', // 权限
                    label: '驾驶行为报警', // 标题
                    icon: this.$getImages('/assetsMobile/images/index/jiashi.png'),//`https://www.yihaocg.com/mobile/image/indexNew/jiashi.png`, // 图片
                    url: '/alarm/driverBehavior/index', // 路径
                },
                {
                    permission: 'mobile:index:base:blindSpot', // 权限
                    label: '车辆盲点报警', // 标题
                    icon: this.$getImages('/assetsMobile/images/index/blindSpot.png'),//`https://www.yihaocg.com/mobile/image/indexNew/blindSpot.png`, // 图片
                    url: '/alarm/blindSpot/index', // 路径
                },
            ]
            },
		
			
           /* {
              label:'任务情况',
              sidebarList:[
                {
                    permission: 'mobile:index:sanTask:machineWorkRecord', // 权限
                    label: '机械作业', // 标题
                    icon: this.$getImages('/assetsMobile/images/index/jiashi.png'),//`http://tq.5000v.com:8032/assetsMobile/images/flow/start2.png`, // 图片
                    url: '/pagesSanitation/machineWorkRecord/machineWorkRecord', // 路径
                },
                {
                    permission: 'mobile:index:sanTask:wasteTransport', // 权限
                    label: '垃圾收运', // 标题
                    icon: this.$getImages('/assetsMobile/images/index/jiashi.png'),//`http://tq.5000v.com:8032/assetsMobile/images/flow/start2.png`, // 图片
                    url: '/pagesSanitation/wasteTransport/wasteTransport', // 路径
                },
                {
                    permission: 'mobile:index:sanTask:wasteTransfer', // 权限
                    label: '垃圾转运', // 标题
                    icon: this.$getImages('/assetsMobile/images/index/jiashi.png'),//`http://tq.5000v.com:8032/assetsMobile/images/flow/start2.png`, // 图片
                    url: '/pagesSanitation/wasteTransfer/wasteTransfer', // 路径
                },
              ]
            }, */
            {
              label:'派车流程',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/flow-icon.png`),
              // direction:'',
              sidebarList:[
                {
                    permission: 'mobile:index:dispatching:initiate', // 权限
                    label: '发起流程', // 标题
                    iconbg:'3',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-initiate-flow.png'), // 图片
                    url: '/pages/flow/diboot?routes=/workflow/mobile/startFlow&workflowKey=system_flow_veh', // 路径
                },
                {
                    permission: 'mobile:index:dispatching:list', // 权限
                    label: '用车记录', // 标题
                    iconbg:'0',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-vehrecord.png'), // 图片
                    url: '/workflow/vehicleRecord/index', // 路径
                },
             ]
            },
            {
              label:'维保流程',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/flow-icon.png`),
              // direction:'',
              sidebarList:[
                {
                    permission: 'mobile:index:maintenance:initiate', // 权限
                    label: '发起流程', // 标题
                    iconbg:'3',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-initiate-flow.png'), // 图片
                    url: '/pages/flow/diboot?routes=/workflow/mobile/startFlow&workflowKey=system_flow_maintenance', // 路径
                },
                {
                    permission: 'mobile:index:maintenance:list', // 权限
                    label: '车辆维保记录', // 标题
                    iconbg:'1',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-mainrecord.png'), // 图片
                    url: '/workflow/vehicleMaintenanceRecord/index', // 路径
                },
             ]
            },
            {
              label:'费用流程',
              titleIcon:this.$getImages(`/assetsMobile/images/index/menu/flow-icon.png`),
              // direction:'',
              sidebarList:[
                {
                    permission: 'mobile:index:maintenance:initiate', // 权限
                    label: '发起流程', // 标题
                    iconbg:'3',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-initiate-flow.png'), // 图片
                    url: '/pages/flow/diboot?routes=/workflow/mobile/startFlow&workflowKey=system_cost', // 路径
                },
                {
                    permission: 'mobile:index:maintenance:list', // 权限
                    label: '费用记录', // 标题
                    iconbg:'1',// 图标背景
                    icon: this.$getImages('/assetsMobile/images/index/menu/icon-mainrecord.png'), // 图片
                    url: '/workflow/recordCost/index', // 路径
                },
             ]
            },
            {
              label:'待办',
              sidebarList:[
                {
                    permission: 'mobile:index:base:flowstart', // 权限
                    label: '发起流程', // 标题
                    icon: this.$getImages('/assetsMobile/images/flow/start2.png'),//`http://tq.5000v.com:8032/assetsMobile/images/flow/start2.png`, // 图片
                    url: '/pages/flow/flow?redirect=/pages/workflowTask/index&type=start', // 路径
                },
                {
                    permission: 'mobile:index:base:flowmyLaunch', // 权限
                    label: '我发起的', // 标题
                    icon: this.$getImages('/assetsMobile/images/flow/myLanuch2.png'),//`http://tq.5000v.com:8032/assetsMobile/images/flow/myLanuch2.png`, // 图片
                    url: '/pages/flow/flow?redirect=/pages/workflowTask/index&type=myLaunch', // 路径
                },
                {
                    permission: 'mobile:index:base:flowtodo', // 权限
                    label: '我的待办', // 标题
                    icon: this.$getImages('/assetsMobile/images/flow/todo2.png'), // 图片
                    url: '/pages/flow/flow?redirect=/pages/workflowTask/index&type=todo', // 路径
                    hint:''
                },
                {
                    permission: 'mobile:index:base:flowdone', // 权限
                    label: '我的已办', // 标题
                    icon: this.$getImages('/assetsMobile/images/flow/done2.png'),//`http://tq.5000v.com:8032/assetsMobile/images/flow/done2.png`, // 图片
                    url: '/pages/flow/flow?redirect=/pages/workflowTask/index?type=done', // 路径
                },
              ]
            },
            // {
            //   label:'业务记录',
            //   sidebarList:[
            //     {
            //         permission: 'mobile:index:base:vehicleRecord', // 权限
            //         label: '用车记录', // 标题
            //         icon: this.$getImages('/assetsMobile/images/flow/vehicleRecord.png'), // 图片
            //         url: '/workflow/vehicleRecord/index', // 路径
            //     },
            //     // {
            //     //     permission: 'mobile:index:base:vehicleRepairRecord', // 权限
            //     //     label: '车辆维修记录', // 标题
            //     //     icon: this.$getImages('/assetsMobile/images/flow/vehicleRepairRecord.png'), // 图片
            //     //     url: '/workflow/vehicleRepairRecord/index', // 路径
            //     // },
            //     {
            //         permission: 'mobile:index:base:vehicleMaintenanceRecord', // 权限
            //         label: '车辆维保记录', // 标题
            //         icon: this.$getImages('/assetsMobile/images/flow/vehicleMaintenanceRecord.png'), // 图片
            //         url: '/workflow/vehicleMaintenanceRecord/index', // 路径
            //     },
            //   ]
            // },
            {
              label:'司机任务',
              sidebarList:[
                {
                    permission: 'mobile:index:base:driverTask', // 权限
                    label: '任务列表', // 标题
                    icon: this.$getImages('/assetsMobile/images/flow/driverTask.png'), // 图片
                    url: '/workflow/driverTask/index', // 路径
                },
              ]
            },
            {
              label:'物品管理',
              sidebarList:[
                {
                    permission: 'mobile:index:material:materialApplication', // 权限
                    label: '物品申领', // 标题
                    icon: this.$getImages('/assetsMobile/images/flow/vehicleRecord.png'), // 图片
                    url: '/pagesBase/materialApplication/index', // 路径
                }, 
				        {
                    permission: 'mobile:index:material:materialRecord', // 权限
                    label: '申领记录', // 标题
                    icon: this.$getImages('/assetsMobile/images/flow/done2.png'), // 图片
                    url: '/pagesBase/materialRecord/index', // 路径
                },
              ]
            },
            {
              label:'矿山任务',
              sidebarList:[
                {
                  permission: 'mobile:index:mine:task', // 权限
                  label: '任务', // 标题
                  icon: this.$getImages('/assetsMobile/images/flow/driverTask.png'), // 图片
                  url: '/pagesMine/driverTask/index', // 路径
                },
              ]
            },
           ],
            testList: [
                {
                    permission: '*', // 权限
                    label: '测试页面', // 标题
                    icon: this.$getImages('/assetsMobile/images/flow/driverTask.png'), // 图片
                    url: '/pagesMine/testPage/index', // 路径
                },
            ],
            workflowNum:{
                todo:''
            },
			
	
        }
    },
    onLoad() {
        console.log('顶顶顶顶')
        taskCount({}).then(res=>{
          this.setHint('待办',2,res.data.todo)
            // this.flowManageList[2].hint = res.data.todo;
        })
    },
    methods: {
        toformTemplate() {
            uni.navigateTo({
                url: '/pages/formTemplate/formTemplate?id=1&name=uniapp'
            });
        },
        allPermission(list){
          return list.map((e) => e.permission)
        },
        setHint(listLabel,index,data){
          let findArr=[];
          if(this.hasPlat(['sanitation'])){
            findArr = this.sanitationArr.find(item=>item.label==listLabel)
          }else if(this.hasPlat(['enterprises'])){
            findArr = this.enterprisesArr.find(item=>item.label==listLabel)
          }else{
            findArr = this.otherArr.find(item=>item.label==listLabel)
          }
          findArr.sidebarList[index].hint=data
        }
    }
    ,
}
</script>

<style lang="scss" scoped>
.home-container {
  
  background: #F7F8FA;
  position: relative;
  
  .tipfixed {
  	position: fixed;
  	top: 0;
  	left: 0;
  	padding: 20rpx;
  	width: 100%;
  	background: rgba(0, 0, 0, 0.3);
  	z-index: 100;
  	color: #FFFFFF;
  	font-size: 24rpx;
  	
  	display: flex;
  	justify-content: flex-start;
  	align-items: center;
  }
  
  .background-image{
    width: 100%;
    height: 362rpx;
  }
  .index-title{
    width: 100%;
    font-family: PangMenZhengDao;
    font-size: 26px;
    color: #FFFFFF;
    position: absolute;
    top: 110rpx;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    .dot{
      width: 10rpx;
      height: 10rpx;
      border-radius: 10rpx;
      background-color: #fff;
      margin: 0 22rpx;
    }
  }
  .page-warp{
    position: absolute;
    top:240rpx;
    margin: 0 28rpx;
    width: calc(100% - 56rpx);
    overflow-y: auto;
    padding-bottom: 120rpx;
    .home-munes {
      padding: 20rpx;
      border-radius: 16rpx;
      background: #fff;
      margin-bottom: 16rpx;
    }
    .pd8{
      padding: 16rpx;
    }
  }
  .page1-warp{
    top:26rpx;
    padding-bottom: 120rpx;
    .home-munes {
      padding: 20rpx;
      background: #fff;
    }
  }
  
}
</style>