123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660 |
- <template>
- <view class="home-container">
- <!-- 环卫 start-->
- <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>
-
- <!-- 动态菜单 start-->
- <template v-for="(item,index) in $store.state.user.dynList">
- <view :key="`dyn${index}`" class="home-munes">
- <view class="sidebar">
- <sidebardyn :children="item.children" :label="item.meta.title" :titleIcon="item.mobileIcon" :himObj="himObj"></sidebardyn>
- </view>
- </view>
- </template>
- <!-- 动态菜单 end-->
- </view>
- </template>
- <!-- 环卫 end-->
- <!-- 企事业 start-->
- <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="icon-fixed-right" v-if="hasHostPlat(['dingH5'])">
- <image v-if="$hasPermi('mobile:index:base:scanCode')" :src="$getImages('/assetsMobile/images/qrcode.png')" class="munes-icon" @click="handleQrCode"></image>
- </view>
-
- <view class="swiper-wrap" v-if="$hasPermi('mobie:index:base:swiper')">
- <u-swiper :list="swiperList" :height="166" :radius="8" indicator indicatorMode="dot"></u-swiper>
- </view>
-
- <view class="data-wrap">
- <view class="data-wrap-item" v-if="$hasPermi('mobie:index:base:realMile')">
- <image :src="$getImages('/assetsMobile/images/enterprises/data/licheng.png')" class="data-wrap-item-bg"></image>
- <view class="data-wrap-item-content">
- <view class="data-wrap-item-title">里程</view>
- <view class="data-wrap-item-label">今日里程</view>
- <view class="data-wrap-item-label">{{todayVehicleMileStats.realMile}}</view>
- </view>
-
- </view>
- <view class="data-wrap-item" v-if="$hasPermi('mobie:index:base:task')">
- <image :src="$getImages('/assetsMobile/images/enterprises/data/renwu.png')" class="data-wrap-item-bg"></image>
- <view class="data-wrap-item-content">
- <view class="data-wrap-item-title">任务</view>
- <view class="data-wrap-item-label">未完成 <text style="margin-left: 20rpx;">{{vehicleTaskStats.beginCount+vehicleTaskStats.unBeginCount}}</text></view>
- <view class="data-wrap-item-label">已完成 <text style="margin-left: 20rpx;">{{vehicleTaskStats.endCount}}</text></view>
- </view>
- </view>
- <view class="data-wrap-item" v-if="$hasPermi('mobie:index:base:vehicle')">
- <image :src="$getImages('/assetsMobile/images/enterprises/data/cheliang.png')" class="data-wrap-item-bg"></image>
- <view class="data-wrap-item-content">
- <view class="data-wrap-item-title">车辆</view>
- <view class="data-wrap-item-label">出车 <text style="margin-left: 20rpx;">{{vehicleDispatchStats.runCount}}</text></view>
- <view class="data-wrap-item-label">空闲 <text style="margin-left: 20rpx;">{{vehicleDispatchStats.freeCount}}</text></view>
- </view>
- </view>
- <view class="data-wrap-item" v-if="$hasPermi('mobie:index:base:driver')">
- <image :src="$getImages('/assetsMobile/images/enterprises/data/siji.png')" class="data-wrap-item-bg"></image>
- <view class="data-wrap-item-content">
- <view class="data-wrap-item-title">司机</view>
- <view class="data-wrap-item-label">出车 <text style="margin-left: 20rpx;">{{driverDispatchStats.runCount}}</text></view>
- <view class="data-wrap-item-label">空闲 <text style="margin-left: 20rpx;">{{driverDispatchStats.freeCount}}</text></view>
- </view>
- </view>
- </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-enterprises">
- <!-- <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> -->
-
- <!-- 动态菜单 start-->
- <template v-for="(item,index) in $store.state.user.dynList">
- <view :key="`dyn${index}`" class="home-munes">
- <view class="sidebar">
- <sidebardyn :children="item.children" :label="item.meta.title" :titleIcon="item.mobileIcon" :himObj="himObj"></sidebardyn>
- </view>
- </view>
- </template>
- <!-- 动态菜单 end-->
- </view>
- </template>
- <!-- 企事业 end-->
- <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 { getMobileRouters,boardDetail,getMessageNum } from "@/api/common/system";
- import Sidebar from '@/components/sidebar'
- import sidebardyn from '@/components/sidebardyn'
- import * as dd from 'dingtalk-jsapi'; // 此方式为整体加载,也可按需进行加载
- import { isExternal } from "@/utils/validate";
- export default {
- components: {
- Sidebar,
- sidebardyn,
- },
- 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:wasteTransport', // 权限
- label: '垃圾收运', // 标题
- icon: this.$getImages('/assetsMobile/images/index/collect-bg.png'), // 图片
- url: '/pagesSanitation/wasteTransport/wasteTransport', // 路径
- },
- {
- permission: 'mobile:index:sanTask:wasteTransfer', // 权限
- label: '垃圾转运', // 标题
- icon: this.$getImages('/assetsMobile/images/index/transport-bg.png'), // 图片
- url: '/pagesSanitation/wasteTransfer/wasteTransfer', // 路径
- },
-
-
- ]
- },
-
- ],
- /* 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', // 路径
- },
- ]
- },
-
- ], */
- 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', // 路径
- },
-
- ]
- },
- {
- 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:'派车流程',
- 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: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', // 路径
- },
- ]
- },
- ],
- // 动态菜单
- dynList: [],
- himObj: {
- 'mobile:index:base:flowtodo': 0, //待办
- 'mobile:index:base:sysMessage': 0, //车务消息
- },
-
- swiperList: [
- this.$getImages('/assetsMobile/images/enterprises/swipe1.png'),
- this.$getImages('/assetsMobile/images/enterprises/swipe2.png'),
- this.$getImages('/assetsMobile/images/enterprises/swipe3.png'),
- this.$getImages('/assetsMobile/images/enterprises/swipe4.png'),
- this.$getImages('/assetsMobile/images/enterprises/swipe5.png'),
- ],
-
- todayVehicleMileStats: {
- realMile: 0,
- },
- vehicleTaskStats: {
- beginCount: 0,
- endCount: 0,
- unBeginCount: 0,
- },
- vehicleDispatchStats: {
- runCount: 0,
- freeCount: 0,
- },
- driverDispatchStats: {
- runCount: 0,
- freeCount: 0,
- },
-
- }
- },
- watch: {
- '$store.state.user.wsMsgNum': {
- handler(newVal) {
- if(this.$store.state.user.wsMsg==='flush_todo_num'){
- this.updatataskCount()
- }
- }
- }
- },
- async created() {
- this.$store.dispatch('GetMobileRouters')
- },
- onLoad() {
- this.updatataskCount()
- },
- onShow() {
- /* 企事业数据看板 */
- if(this.hasPlat(['enterprises'])) {
-
- boardDetail({}).then((res) => {
- let {todayVehicleMileStats,vehicleTaskStats,vehicleDispatchStats,driverDispatchStats} = res.data
-
- this.copyProps(this.todayVehicleMileStats,todayVehicleMileStats)
- this.copyProps(this.vehicleTaskStats,vehicleTaskStats)
- this.copyProps(this.vehicleDispatchStats,vehicleDispatchStats)
- this.copyProps(this.driverDispatchStats,driverDispatchStats)
- })
- }
- },
- methods: {
- updatataskCount(){
- getMessageNum({}).then(res=>{
- this.himObj['mobile:index:base:flowtodo'] = res.data.todoTotalNum
- this.himObj['mobile:index:base:sysMessage'] = res.data.total
- })
- },
- toformTemplate() {
- uni.navigateTo({
- url: '/pages/formTemplate/formTemplate?id=1&name=uniapp'
- });
- },
- allPermission(list){
- return list.map((e) => e.permission)
- },
- handleQrCode() {
-
- if(dd.env.platform == "notInDingTalk") {
-
- uni.showToast({
- icon: 'none',
- title: '请在钉钉应用内使用该功能'
- })
- return
- } else {
- dd.scan({
- type: 'qr',
- success: (res) => {
- const { text } = res;
- if (isExternal(text)) {
- window.location.href= text
- }
- },
- fail: () => {},
- complete: () => {},
- });
- }
- },
- },
- }
- </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;
- }
-
- .icon-fixed-right {
- position: fixed;
- top: 710rpx;
- right: 0;
- z-index: 10000;
- .munes-icon{
- width: 80rpx;
- height: 80rpx;
- &+.munes-icon{
- margin-top: 40rpx;
- }
- }
- }
-
- .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;
- }
- }
-
- .swiper-wrap {
- margin: 16rpx 28rpx 16rpx;
- width: calc(100% - 56rpx);
- border-radius: 16rpx;
- }
-
- .data-wrap {
- display: flex;
- flex-wrap: wrap;
- // gap: 16rpx 18rpx;
- justify-content: space-between;
- margin: 0 28rpx 16rpx;
-
- .data-wrap-item {
- // width: calc(50% - 16rpx);
- width: 338rpx;
- height: 164rpx;
- position: relative;
-
- margin-top: 16rpx;
-
- display: flex;
- flex-direction: column;
- justify-content: space-between;
-
-
- .data-wrap-item-bg {
- position: absolute;
- bottom: 0;
- right: 0;
- width: 100%;
- height: 100%;
- }
- .data-wrap-item-content {
- padding: 10rpx 28rpx;
- z-index: 100;
- height: 100%;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
-
- .data-wrap-item-title {
- font-family: PingFangSC, PingFang SC;
- font-weight: 500;
- font-size: 32rpx;
- color: #FFFFFF;
- line-height: 44rpx;
- text-align: left;
- font-style: normal;
-
- }
- .data-wrap-item-label {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #FFFFFF;
- line-height: 44rpx;
- text-align: left;
- font-style: normal;
- }
- }
-
- }
- }
-
- .page-warp-enterprises{
- /* 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;
- }
- }
-
-
- .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>
|