This commit is contained in:
Vce 2024-05-19 16:05:16 +08:00
parent bbe0547499
commit 78cc185a31
2 changed files with 96 additions and 78 deletions

View File

@ -5,17 +5,17 @@
特种作业 特种作业
</view> </view>
</headers> </headers>
<view class="sp-menu" v-if="menuList.length > 0"> <view class="sp-menu">
<view class="menu-item" @click="handleNavigateTo(item.path)" v-for="(item,i) in menuList"> <!-- <view class="sp-menu" v-if="menuList.length > 0"> -->
<!-- <view class="menu-item" @click="handleNavigateTo(item.path)" v-for="(item,i) in menuList">
<view class="item-icon"> <view class="item-icon">
<image :src="'/static/specialOperations/'+item.iconImg"></image> <image :src="'/static/specialOperations/'+item.iconImg"></image>
<!-- <image src="@/static/specialOperations/tempElectricity.png"></image> -->
</view> </view>
<view class="item-text"> <view class="item-text">
<text>{{item.menuName}}</text> <text>{{item.menuName}}</text>
</view> </view>
</view> </view> -->
<!-- <view class="menu-item" @click="handleNavigateTo(1)"> <view class="menu-item" @click="handleNavigateTo(1)">
<view class="item-icon"> <view class="item-icon">
<image src="@/static/specialOperations/fireWork.png"></image> <image src="@/static/specialOperations/fireWork.png"></image>
</view> </view>
@ -78,7 +78,7 @@
<view class="item-text"> <view class="item-text">
<text>断路作业</text> <text>断路作业</text>
</view> </view>
</view> --> </view>
</view> </view>
</view> </view>
</template> </template>
@ -104,42 +104,51 @@
}, },
onLoad() { onLoad() {
uni.showLoading({ // uni.showLoading({
title: "加载中...", // title: "...",
}) // })
setTimeout(() =>{ // setTimeout(() =>{
this.userInfo = JSON.parse(uni.getStorageSync('userInfo')) // this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
this.moduleList = this.userInfo.menuAuthority.moduleList // this.moduleList = this.userInfo.menuAuthority.moduleList
this.moduleList.map(item => { // this.moduleList.map(item => {
if(item.plugin === "specialOperations") this.menuList = item.menuList // if(item.plugin === "specialOperations") this.menuList = item.menuList
}) // })
if(this.menuList.length > 0){ // if(this.menuList.length > 0){
this.menuList.map(item => { // this.menuList.map(item => {
if(item.path === "/project/specialWork/fireWork") item.iconImg = 'fireWork.png' // if(item.path === "/project/specialWork/fireWork") item.iconImg = 'fireWork.png'
if(item.path === "/project/specialWork/confinedSpaceWork") item.iconImg = 'limitSpaceWork.png' // if(item.path === "/project/specialWork/confinedSpaceWork") item.iconImg = 'limitSpaceWork.png'
if(item.path === "/project/specialWork/blindPlugWork") item.iconImg = 'bindPlatePlug.png' // if(item.path === "/project/specialWork/blindPlugWork") item.iconImg = 'bindPlatePlug.png'
if(item.path === "/project/specialWork/towerOverWork") item.iconImg = 'highJob.png' // if(item.path === "/project/specialWork/towerOverWork") item.iconImg = 'highJob.png'
if(item.path === "/project/specialWork/riggingOutWork") item.iconImg = 'hoistSafe.png' // if(item.path === "/project/specialWork/riggingOutWork") item.iconImg = 'hoistSafe.png'
if(item.path === "/project/specialWork/temporaryPowerWork") item.iconImg = 'tempElectricity.png' // if(item.path === "/project/specialWork/temporaryPowerWork") item.iconImg = 'tempElectricity.png'
if(item.path === "/project/specialWork/startBuildingWork") item.iconImg = 'groundSafe.png' // if(item.path === "/project/specialWork/startBuildingWork") item.iconImg = 'groundSafe.png'
if(item.path === "/project/specialWork/disconnectionWork") item.iconImg = 'openCircuit.png' // if(item.path === "/project/specialWork/disconnectionWork") item.iconImg = 'openCircuit.png'
}) // })
} // }
console.log("userInfo=======================",this.userInfo); // console.log("userInfo=======================",this.userInfo);
console.log("moduleList=======================",this.moduleList); // console.log("moduleList=======================",this.moduleList);
},500) // },500)
uni.hideLoading() // uni.hideLoading()
}, },
methods:{ methods:{
handleNavigateTo(val){ handleNavigateTo(val){
if(val === "/project/specialWork/fireWork") uni.navigateTo({ url: "./fireWork/checkList" }) // if(val === "/project/specialWork/fireWork") uni.navigateTo({ url: "./fireWork/work" })
if(val === "/project/specialWork/confinedSpaceWork") uni.navigateTo({ url: "./limitSpaceWork/checkList" }) // if(val === "/project/specialWork/confinedSpaceWork") uni.navigateTo({ url: "./limitSpaceWork/work" })
if(val === "/project/specialWork/blindPlugWork") uni.navigateTo({ url: "./bindPlatePlug/checkList" }) // if(val === "/project/specialWork/blindPlugWork") uni.navigateTo({ url: "./bindPlatePlug/work" })
if(val === "/project/specialWork/towerOverWork") uni.navigateTo({ url: "./highJob/checkList" }) // if(val === "/project/specialWork/towerOverWork") uni.navigateTo({ url: "./highJob/work" })
if(val === "/project/specialWork/riggingOutWork") uni.navigateTo({ url: "./hoistSafe/checkList" }) // if(val === "/project/specialWork/riggingOutWork") uni.navigateTo({ url: "./hoistSafe/work" })
if(val === "/project/specialWork/temporaryPowerWork") uni.navigateTo({ url: "./tempElectricity/checkList" }) // if(val === "/project/specialWork/temporaryPowerWork") uni.navigateTo({ url: "./tempElectricity/work" })
if(val === "/project/specialWork/startBuildingWork") uni.navigateTo({ url: "./groundSafe/checkList" }) // if(val === "/project/specialWork/startBuildingWork") uni.navigateTo({ url: "./groundSafe/work" })
if(val === "/project/specialWork/disconnectionWork") uni.navigateTo({ url: "./openCircuit/checkList" }) // if(val === "/project/specialWork/disconnectionWork") uni.navigateTo({ url: "./openCircuit/work" })
if(val === 1) uni.navigateTo({ url: "./fireWork/checkList" })
if(val === 2) uni.navigateTo({ url: "./limitSpaceWork/checkList" })
if(val === 3) uni.navigateTo({ url: "./bindPlatePlug/checkList" })
if(val === 4) uni.navigateTo({ url: "./highJob/checkList" })
if(val === 5) uni.navigateTo({ url: "./hoistSafe/checkList" })
if(val === 6) uni.navigateTo({ url: "./tempElectricity/checkList" })
if(val === 7) uni.navigateTo({ url: "./groundSafe/checkList" })
if(val === 8) uni.navigateTo({ url: "./openCircuit/checkList" })
} }
} }
} }

View File

@ -5,17 +5,17 @@
特种作业 特种作业
</view> </view>
</headers> </headers>
<view class="sp-menu" v-if="menuList.length > 0"> <view class="sp-menu">
<view class="menu-item" @click="handleNavigateTo(item.path)" v-for="(item,i) in menuList"> <!-- <view class="sp-menu" v-if="menuList.length > 0"> -->
<!-- <view class="menu-item" @click="handleNavigateTo(item.path)" v-for="(item,i) in menuList">
<view class="item-icon"> <view class="item-icon">
<image :src="'/static/specialOperations/'+item.iconImg"></image> <image :src="'/static/specialOperations/'+item.iconImg"></image>
<!-- <image src="@/static/specialOperations/tempElectricity.png"></image> -->
</view> </view>
<view class="item-text"> <view class="item-text">
<text>{{item.menuName}}</text> <text>{{item.menuName}}</text>
</view> </view>
</view> </view> -->
<!-- <view class="menu-item" @click="handleNavigateTo(1)"> <view class="menu-item" @click="handleNavigateTo(1)">
<view class="item-icon"> <view class="item-icon">
<image src="@/static/specialOperations/fireWork.png"></image> <image src="@/static/specialOperations/fireWork.png"></image>
</view> </view>
@ -78,7 +78,7 @@
<view class="item-text"> <view class="item-text">
<text>断路作业</text> <text>断路作业</text>
</view> </view>
</view> --> </view>
</view> </view>
</view> </view>
</template> </template>
@ -104,42 +104,51 @@
}, },
onLoad() { onLoad() {
uni.showLoading({ // uni.showLoading({
title: "加载中...", // title: "...",
}) // })
setTimeout(() =>{ // setTimeout(() =>{
this.userInfo = JSON.parse(uni.getStorageSync('userInfo')) // this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
this.moduleList = this.userInfo.menuAuthority.moduleList // this.moduleList = this.userInfo.menuAuthority.moduleList
this.moduleList.map(item => { // this.moduleList.map(item => {
if(item.plugin === "specialOperations") this.menuList = item.menuList // if(item.plugin === "specialOperations") this.menuList = item.menuList
}) // })
if(this.menuList.length > 0){ // if(this.menuList.length > 0){
this.menuList.map(item => { // this.menuList.map(item => {
if(item.path === "/project/specialWork/fireWork") item.iconImg = 'fireWork.png' // if(item.path === "/project/specialWork/fireWork") item.iconImg = 'fireWork.png'
if(item.path === "/project/specialWork/confinedSpaceWork") item.iconImg = 'limitSpaceWork.png' // if(item.path === "/project/specialWork/confinedSpaceWork") item.iconImg = 'limitSpaceWork.png'
if(item.path === "/project/specialWork/blindPlugWork") item.iconImg = 'bindPlatePlug.png' // if(item.path === "/project/specialWork/blindPlugWork") item.iconImg = 'bindPlatePlug.png'
if(item.path === "/project/specialWork/towerOverWork") item.iconImg = 'highJob.png' // if(item.path === "/project/specialWork/towerOverWork") item.iconImg = 'highJob.png'
if(item.path === "/project/specialWork/riggingOutWork") item.iconImg = 'hoistSafe.png' // if(item.path === "/project/specialWork/riggingOutWork") item.iconImg = 'hoistSafe.png'
if(item.path === "/project/specialWork/temporaryPowerWork") item.iconImg = 'tempElectricity.png' // if(item.path === "/project/specialWork/temporaryPowerWork") item.iconImg = 'tempElectricity.png'
if(item.path === "/project/specialWork/startBuildingWork") item.iconImg = 'groundSafe.png' // if(item.path === "/project/specialWork/startBuildingWork") item.iconImg = 'groundSafe.png'
if(item.path === "/project/specialWork/disconnectionWork") item.iconImg = 'openCircuit.png' // if(item.path === "/project/specialWork/disconnectionWork") item.iconImg = 'openCircuit.png'
}) // })
} // }
console.log("userInfo=======================",this.userInfo); // console.log("userInfo=======================",this.userInfo);
console.log("moduleList=======================",this.moduleList); // console.log("moduleList=======================",this.moduleList);
},500) // },500)
uni.hideLoading() // uni.hideLoading()
}, },
methods:{ methods:{
handleNavigateTo(val){ handleNavigateTo(val){
if(val === "/project/specialWork/fireWork") uni.navigateTo({ url: "./fireWork/work" }) // if(val === "/project/specialWork/fireWork") uni.navigateTo({ url: "./fireWork/work" })
if(val === "/project/specialWork/confinedSpaceWork") uni.navigateTo({ url: "./limitSpaceWork/work" }) // if(val === "/project/specialWork/confinedSpaceWork") uni.navigateTo({ url: "./limitSpaceWork/work" })
if(val === "/project/specialWork/blindPlugWork") uni.navigateTo({ url: "./bindPlatePlug/work" }) // if(val === "/project/specialWork/blindPlugWork") uni.navigateTo({ url: "./bindPlatePlug/work" })
if(val === "/project/specialWork/towerOverWork") uni.navigateTo({ url: "./highJob/work" }) // if(val === "/project/specialWork/towerOverWork") uni.navigateTo({ url: "./highJob/work" })
if(val === "/project/specialWork/riggingOutWork") uni.navigateTo({ url: "./hoistSafe/work" }) // if(val === "/project/specialWork/riggingOutWork") uni.navigateTo({ url: "./hoistSafe/work" })
if(val === "/project/specialWork/temporaryPowerWork") uni.navigateTo({ url: "./tempElectricity/work" }) // if(val === "/project/specialWork/temporaryPowerWork") uni.navigateTo({ url: "./tempElectricity/work" })
if(val === "/project/specialWork/startBuildingWork") uni.navigateTo({ url: "./groundSafe/work" }) // if(val === "/project/specialWork/startBuildingWork") uni.navigateTo({ url: "./groundSafe/work" })
if(val === "/project/specialWork/disconnectionWork") uni.navigateTo({ url: "./openCircuit/work" }) // if(val === "/project/specialWork/disconnectionWork") uni.navigateTo({ url: "./openCircuit/work" })
if(val === 1) uni.navigateTo({ url: "./fireWork/work" })
if(val === 2) uni.navigateTo({ url: "./limitSpaceWork/work" })
if(val === 3) uni.navigateTo({ url: "./bindPlatePlug/work" })
if(val === 4) uni.navigateTo({ url: "./highJob/work" })
if(val === 5) uni.navigateTo({ url: "./hoistSafe/work" })
if(val === 6) uni.navigateTo({ url: "./tempElectricity/work" })
if(val === 7) uni.navigateTo({ url: "./groundSafe/work" })
if(val === 8) uni.navigateTo({ url: "./openCircuit/work" })
} }
} }
} }