提交app
This commit is contained in:
@@ -61,33 +61,22 @@
|
||||
</view>
|
||||
<view class="content device" :style="{ minHeight: minHeight }">
|
||||
<Cn-device-card v-for="(item, index) in deviceListFilter" :device="item" :key="index">
|
||||
<template v-slot:title v-if="transfer || share">
|
||||
<template v-slot:title>
|
||||
<!-- 卡片标题 -->
|
||||
<view class="uni-card__header">
|
||||
<view class="uni-card__header-box">
|
||||
<view class="uni-card__header-avatar">
|
||||
<image
|
||||
class="uni-card__header-avatar-image"
|
||||
:src="deviceIcon(item.runStatus)"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
<view class="uni-card__header-content">
|
||||
<text class="uni-card__header-content-title uni-ellipsis">
|
||||
{{ item.equipmentName }}
|
||||
</text>
|
||||
<text class="uni-card__header-content-subtitle uni-ellipsis">
|
||||
{{ item.mac }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="uni-card__header-extra" style="position: relative">
|
||||
<switch
|
||||
:checked="checkList.indexOf(item.equipmentId) > -1"
|
||||
style="transform: scale(0.8); position: relative; left: 20rpx"
|
||||
@change="switchChange(item)"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<switch
|
||||
v-if="transfer || share"
|
||||
:checked="checkList.indexOf(item.equipmentId) > -1"
|
||||
style="transform: scale(0.8); position: relative; left: 20rpx"
|
||||
@change="switchChange(item)"
|
||||
/>
|
||||
<view class="star-icon" v-else @click="toggleStar(item)">
|
||||
<uni-icons
|
||||
custom-prefix="custom-icon"
|
||||
:type="item.isTop == 1 ? 'star-filled' : 'star'"
|
||||
:color="item.isTop == 1 ? '#ffcc00' : ''"
|
||||
size="25"
|
||||
></uni-icons>
|
||||
</view>
|
||||
</template>
|
||||
</Cn-device-card>
|
||||
@@ -102,7 +91,7 @@
|
||||
<script>
|
||||
import { getProjectList } from '@/common/api/project'
|
||||
import { queryDictData } from '@/common/api/dictionary'
|
||||
|
||||
import { engineeringPinToTop } from '@/common/api/device'
|
||||
export default {
|
||||
props: {
|
||||
store: {
|
||||
@@ -133,7 +122,6 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
deviceListFilter() {
|
||||
|
||||
let arr = this.store.data.filter((item) => {
|
||||
if (this.select.projectName && this.select.projectType) {
|
||||
return item.project === this.select.projectName && item.type === this.select.projectType
|
||||
@@ -145,9 +133,8 @@ export default {
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
if (this.transfer || this.share) {
|
||||
|
||||
return arr.filter((item) => {
|
||||
return item.isPrimaryUser === '1' //&& item.process == 4
|
||||
})
|
||||
@@ -161,6 +148,20 @@ export default {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
toggleStar(item) {
|
||||
engineeringPinToTop({
|
||||
targetId: item.equipmentId,
|
||||
targetType: 1,
|
||||
userId: uni.getStorageSync(this.$cacheKey.userInfo).userIndex,
|
||||
}).then((res) => {
|
||||
if (res.code == 'A0000') {
|
||||
this.$util.toast('操作成功!')
|
||||
this.store.search()
|
||||
} else {
|
||||
this.$util.toast(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
selectDevice(type) {
|
||||
if (this.deviceListFilter.findIndex((item) => item.isPrimaryUser === '1') === -1) {
|
||||
this.$util.toast('没有可操作的设备')
|
||||
@@ -184,7 +185,6 @@ export default {
|
||||
return str
|
||||
},
|
||||
switchChange(e) {
|
||||
console.log(e)
|
||||
let index = this.checkList.indexOf(e.equipmentId)
|
||||
if (index > -1) {
|
||||
this.checkList.splice(index, 1)
|
||||
@@ -333,18 +333,22 @@ export default {
|
||||
this.navMenuActive = index
|
||||
},
|
||||
jump(item) {
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/APF/detail?id=' + item.equipmentId + '&isPrimaryUser=' + item.isPrimaryUser+ '&ndid=' + item.ndid,
|
||||
url:
|
||||
'/pages/device/APF/detail?id=' +
|
||||
item.equipmentId +
|
||||
'&isPrimaryUser=' +
|
||||
item.isPrimaryUser +
|
||||
'&ndid=' +
|
||||
item.ndid,
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.index-device{
|
||||
.index-device {
|
||||
.nav-menu {
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user