页面接口推介
This commit is contained in:
@@ -113,7 +113,7 @@ export default {
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
mounted() {
|
||||
@@ -134,29 +134,34 @@ export default {
|
||||
}, 1000)
|
||||
},
|
||||
methods: {
|
||||
async init(){
|
||||
let engineering = uni.getStorageSync('engineering')
|
||||
let res = await queryEngineering()
|
||||
this.engineeringList = res.data
|
||||
if (this.engineeringList.length === 0) {
|
||||
return
|
||||
}
|
||||
if (!engineering) {
|
||||
uni.setStorageSync('engineering', res.data[0])
|
||||
this.select.engineeringName = res.data[0].name
|
||||
this.select.engineeringId = res.data[0].id
|
||||
} else {
|
||||
this.select.engineeringName = engineering.name
|
||||
this.select.engineeringId = engineering.id
|
||||
}
|
||||
this.getProjectList()
|
||||
this.getDeviceList()
|
||||
async init() {
|
||||
let engineering = uni.getStorageSync('engineering')
|
||||
let res = await queryEngineering()
|
||||
this.engineeringList = res.data
|
||||
if (this.engineeringList.length === 0) {
|
||||
return
|
||||
}
|
||||
if (!engineering) {
|
||||
uni.setStorageSync('engineering', res.data[0])
|
||||
this.select.engineeringName = res.data[0].name
|
||||
this.select.engineeringId = res.data[0].id
|
||||
} else {
|
||||
if (this.engineeringList.findIndex((item) => item.id === engineering.id) === -1) {
|
||||
uni.setStorageSync('engineering', res.data[0])
|
||||
this.select.engineeringName = res.data[0].name
|
||||
this.select.engineeringId = res.data[0].id
|
||||
}else{
|
||||
this.select.engineeringName = engineering.name
|
||||
this.select.engineeringId = engineering.id
|
||||
}
|
||||
}
|
||||
this.getProjectList()
|
||||
this.getDeviceList()
|
||||
},
|
||||
getDeviceList() {
|
||||
this.store.params.pageSize = 999
|
||||
this.store.params.engineerId = this.select.engineeringId
|
||||
this.store.reload()
|
||||
|
||||
},
|
||||
getProjectList() {
|
||||
getProjectList({
|
||||
@@ -278,7 +283,7 @@ export default {
|
||||
},
|
||||
jump(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/APF/detail?id=' + item.equipmentId
|
||||
url: '/pages/device/APF/detail?id=' + item.equipmentId + '&isPrimaryUser=' + item.isPrimaryUser,
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="header-item-label">正常设备</div>
|
||||
</div>
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
|
||||
<div class="header-item-value" @click="jump('alarmLineDevs')">{{ devCount.alarmLineCount || 0 }}</div>
|
||||
<div class="header-item-label">报警设备</div>
|
||||
</div>
|
||||
<div class="header-item">
|
||||
@@ -65,10 +65,15 @@ export default {
|
||||
url: '/pages/gateway/new',
|
||||
})
|
||||
},
|
||||
jump(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/APF/detail',
|
||||
})
|
||||
jump(type) {
|
||||
switch (key) {
|
||||
case value:
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -11,37 +11,19 @@
|
||||
<view class="message-nav-label">反馈</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view
|
||||
class="message-nav"
|
||||
@click="jump('report')"
|
||||
v-if="
|
||||
userInfo.authorities == '4' || userInfo.authorities == '5' || userInfo.authorities == 'tourist'
|
||||
"
|
||||
>
|
||||
<view class="message-nav" @click="jump('report')">
|
||||
<image mode="aspectFill" class="message-nav-icon" src="/static/report.png" />
|
||||
<view class="message-nav-label">稳态越限</view>
|
||||
<uni-badge text="3"></uni-badge>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view
|
||||
class="message-nav"
|
||||
@click="jump('incident')"
|
||||
v-if="
|
||||
userInfo.authorities == '4' || userInfo.authorities == '5' || userInfo.authorities == 'tourist'
|
||||
"
|
||||
>
|
||||
<view class="message-nav" @click="jump('incident')">
|
||||
<image mode="aspectFill" class="message-nav-icon" src="/static/incident.png" />
|
||||
<view class="message-nav-label">暂态事件</view>
|
||||
<uni-badge text="2"></uni-badge>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view
|
||||
class="message-nav"
|
||||
@click="jump('term')"
|
||||
v-if="
|
||||
userInfo.authorities == '4' || userInfo.authorities == '5' || userInfo.authorities == 'tourist'
|
||||
"
|
||||
>
|
||||
<view class="message-nav" @click="jump('term')">
|
||||
<image mode="aspectFill" class="message-nav-icon" src="/static/term.png" />
|
||||
<view class="message-nav-label">终端状态</view>
|
||||
<uni-badge text="1"></uni-badge>
|
||||
|
||||
@@ -36,20 +36,12 @@
|
||||
<view class="mine-nav-label">扫一扫</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('engineering')" v-if="userInfo.authorities === 'engineering_user' || userInfo.authorities === 'app_vip_user'">
|
||||
<view class="mine-nav" @click="jump('engineering')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
|
||||
<view class="mine-nav-label">工程管理</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view
|
||||
class="mine-nav"
|
||||
@click="jump('project')"
|
||||
v-if="
|
||||
userInfo.authorities === 'app_vip_user' ||
|
||||
userInfo.authorities === 'engineering_user' ||
|
||||
userInfo.authorities === 'market_user'
|
||||
"
|
||||
>
|
||||
<view class="mine-nav" @click="jump('project')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
|
||||
<view class="mine-nav-label">项目管理</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
@@ -57,12 +49,6 @@
|
||||
<view
|
||||
class="mine-nav"
|
||||
@click="jump('gateway')"
|
||||
v-if="
|
||||
userInfo.authorities === 'app_vip_user' ||
|
||||
userInfo.authorities === 'engineering_user' ||
|
||||
userInfo.authorities == 5 ||
|
||||
userInfo.authorities === 'market_user'
|
||||
"
|
||||
style="border-bottom: none; box-shadow: 0 4rpx 8rpx #e7e7e74c"
|
||||
>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/gateway.png" />
|
||||
@@ -94,6 +80,7 @@
|
||||
|
||||
<script>
|
||||
import { roleUpdate } from '@/common/api/user'
|
||||
import { transferDevice } from '@/common/api/device'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -114,6 +101,12 @@ export default {
|
||||
case 'app_vip_user':
|
||||
roleName = 'VIP用户'
|
||||
break
|
||||
case 'market_user':
|
||||
roleName = '营销用户'
|
||||
break
|
||||
case 'operation_manager':
|
||||
roleName = '运维管理员'
|
||||
break
|
||||
}
|
||||
return roleName
|
||||
},
|
||||
@@ -146,9 +139,18 @@ export default {
|
||||
switch (type) {
|
||||
case 'scan':
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
success: (res) => {
|
||||
console.log('条码类型:' + res.scanType)
|
||||
console.log('条码内容:' + res.result)
|
||||
let content = JSON.parse(res.result)
|
||||
switch (content.type) {
|
||||
case 'transferDevice':
|
||||
this.transferDevice(content.id)
|
||||
break
|
||||
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
})
|
||||
break
|
||||
@@ -187,6 +189,11 @@ export default {
|
||||
break
|
||||
}
|
||||
},
|
||||
transferDevice(id) {
|
||||
transferDevice(id).then((res) => {
|
||||
uni.navigateTo({ url: '/pages/mine/result?type=transferDevice&id=' + id })
|
||||
})
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
|
||||
Reference in New Issue
Block a user