Blame view

pages/work/index.vue 4.27 KB
46b6767c   刘淇   init 提交到库
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
  <template>
  	<view class="container">
  		<view class="fs-bg__primary fs-pt160 fs-pb120 fs-pl30 fs-color__white">
  			{{config.weather}} / {{config.city}} {{config.temperature}}°C
  		</view>
  		<view class="fs-pl30 fs-pr30 fs-mt-60">
  			<view class="fs-py36 fs-px30 fs-bg__white fs-radius__sm">
  				<tui-list-cell unlined padding="0" :size="30" color="#000" :hover="false">日常管理</tui-list-cell>
  				<view class="fs-flex fs-mt30 fs-size__h4">
  					<view v-if="inspectionRoles.includes(userInfo.postId)" class="fs-flex__column fs-items__center item" @click="href('/pages/work/daily/inspection/list')">
  						<image class="fs-mb10 icon" src="/static/images/work/itmeHome7.png"></image>
  						<text>巡查计划</text>
  					</view>
  					<view v-if="maintainRoles.includes(userInfo.postId)" class="fs-flex__column fs-items__center item" @click="href('/pages/work/daily/maintain/list')">
  						<image class="fs-mb10 icon" src="/static/images/work/itmeHome26.png"></image>
  						<text>养护计划</text>
  					</view>
  					<view class="fs-flex__column fs-items__center item" @click="href('/pages/work/daily/reporting')">
  						<image class="fs-mb10 icon" src="/static/images/work/itmeHome10.png"></image>
  						<text>问题上报</text>
  					</view>
  					<view class="fs-flex__column fs-items__center item" @click="href('/pages/work/daily/history')">
  						<image class="fs-mb10 icon" src="/static/images/work/itmeHome6.png"></image>
  						<text>历史记录</text>
  					</view>
  				</view>
  			</view>
  			<view class="fs-mt30 fs-py36 fs-px30 fs-bg__white fs-radius__sm">
  				<tui-list-cell unlined padding="0" :size="30" color="#000" :hover="false">问题管理</tui-list-cell>
  				<view class="fs-flex fs-mt30 fs-size__h4">
  					<view v-if="manageRoles.includes(userInfo.postId)" class="fs-flex__column fs-items__center item" @click="href('/pages/work/case/manage')">
  						<image class="fs-mb10 icon" src="/static/images/work/itmeHome18.png"></image>
  						<text>问题管理</text>
  					</view>
  					<view v-else class="fs-flex__column fs-items__center item" @click="href('/pages/work/case/maintain')">
  						<image class="fs-mb10 icon" src="/static/images/work/itmeHome18.png"></image>
  						<text>问题管理</text>
  					</view>
  					<view v-if="manageRoles.includes(userInfo.postId)" class="fs-flex__column fs-items__center item" @click="href('/pages/work/case/distribution')">
  						<image class="fs-mb10 icon" src="/static/images/work/itmeHome4.png"></image>
  						<text>任务分配</text>
  					</view>
  				</view>
  			</view>
  			<view class="fs-mt30 fs-py36 fs-px30 fs-bg__white fs-radius__sm">
  				<tui-list-cell unlined padding="0" :size="30" color="#000" :hover="false">数据管理</tui-list-cell>
  				<view class="fs-flex fs-mt30 fs-size__h4">
  					<view class="fs-flex__column fs-items__center item" @click="href('/pages/work/data/base')">
  						<image class="fs-mb10 icon" src="/static/images/work/itmeHome1.png"></image>
  						<text>基础数据</text>
  					</view>
  					<view class="fs-flex__column fs-items__center item" @click="href('/pages/work/data/worker')">
  						<image class="fs-mb10 icon" src="/static/images/work/itmeHome34.png"></image>
  						<text>人员轨迹</text>
  					</view>
  					<view class="fs-flex__column fs-items__center item" @click="href('/pages/work/data/personnel')">
  						<image class="fs-mb10 icon" src="/static/images/work/itmeHome9.png"></image>
  						<text>人员管理</text>
  					</view>
            <view class="fs-flex__column fs-items__center item" @click="href('/subPackages/treePage/treeFiles')">
              <image class="fs-mb10 icon" src="/static/images/work/itmeHome9.png"></image>
              <text>一树一档案</text>
            </view>
  				</view>
  			</view>
  		</view>
  	</view>
  </template>
  
  <script>
  import { apiSetUserGps } from '@/api/work'
  export default {
  	data() {
  		return {
  			inspectionRoles: [9],
  			maintainRoles: [10],
  			manageRoles: [5,6,7,11,12]
  		}
  	},
  	onLoad() {
  		// 获取实时位置
  		// uni.startLocationUpdate({
  		// 	type: 'gcj02',
  		// 	success: () => {
  		// 		uni.onLocationChange(res => {
  		// 			apiSetUserGps({data:{type:1, lat:res.latitude, lon:res.longitude}})
  		// 		})
  		// 	}
  		// })
  	},
  	methods: {
  		// 页面跳转
  		href(url) {
  			uni.$tui.href(url)
  		}
  	}
  }
  </script>
  
  <style lang="scss" scoped>
  .item {
  	width: 25%;
  }
  .icon {
  	width: 60rpx;
  	height: 60rpx;
  }
  </style>