设备列表
This commit is contained in:
@@ -227,10 +227,6 @@ page {
|
|||||||
/deep/ .uni-card:first-of-type {
|
/deep/ .uni-card:first-of-type {
|
||||||
margin-top: 0 !important;
|
margin-top: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .uni-card__header {
|
|
||||||
border-bottom: none !important;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default (options = {}) => {
|
|||||||
if (arr.indexOf(options.url) > -1) {
|
if (arr.indexOf(options.url) > -1) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
arr.splice(arr.indexOf(options.url), 1)
|
arr.splice(arr.indexOf(options.url), 1)
|
||||||
}, 1500)
|
}, 500)
|
||||||
}
|
}
|
||||||
if (res.data.resultCode !== 10000 && res.data.code !== 'A0000') {
|
if (res.data.resultCode !== 10000 && res.data.code !== 'A0000') {
|
||||||
errHandler(res.data)
|
errHandler(res.data)
|
||||||
@@ -53,7 +53,7 @@ export default (options = {}) => {
|
|||||||
if (arr.indexOf(options.url) > -1) {
|
if (arr.indexOf(options.url) > -1) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
arr.splice(arr.indexOf(options.url), 1)
|
arr.splice(arr.indexOf(options.url), 1)
|
||||||
}, 1500)
|
}, 500)
|
||||||
}
|
}
|
||||||
reject(err)
|
reject(err)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|||||||
70
components/Cn-device-card/Cn-device-card.vue
Normal file
70
components/Cn-device-card/Cn-device-card.vue
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
<template>
|
||||||
|
<uni-card
|
||||||
|
:title="device.equipmentName"
|
||||||
|
:sub-title="device.mac"
|
||||||
|
:extra="device.isPrimaryUser?'主用户':'子用户'"
|
||||||
|
padding="0"
|
||||||
|
@click="jump(device)"
|
||||||
|
:thumbnail="deviceIcon(device.runStatus)"
|
||||||
|
>
|
||||||
|
<template v-slot:title>
|
||||||
|
<slot name="title"></slot>
|
||||||
|
</template>
|
||||||
|
<view class="device-body">
|
||||||
|
<view class="device-body-item">
|
||||||
|
<text>工程名称</text>
|
||||||
|
<text>{{ device.engineeringName }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="device-body-item mt6">
|
||||||
|
<text>项目名称</text>
|
||||||
|
<text>{{ device.projectName }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-card>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
device: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
deviceIcon(e) {
|
||||||
|
let str = ''
|
||||||
|
switch (e) {
|
||||||
|
case 1:
|
||||||
|
str = '/static/device_bad.png'
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
str = '/static/device.png'
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
str = '/static/device.png'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return str
|
||||||
|
},
|
||||||
|
jump() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/device/APF/detail?id=' + this.device.equipmentId + '&isPrimaryUser=' + this.device.isPrimaryUser,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang='scss'>
|
||||||
|
.device-body {
|
||||||
|
padding: 20rpx;
|
||||||
|
|
||||||
|
.device-body-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
"proxy" : {
|
"proxy" : {
|
||||||
"/api" : {
|
"/api" : {
|
||||||
"https" : true,
|
"https" : true,
|
||||||
"target" : "http://192.168.1.115:10215",
|
"target" : "http://192.168.1.13:10215",
|
||||||
"changOrigin" : true,
|
"changOrigin" : true,
|
||||||
"pathRewrite" : {
|
"pathRewrite" : {
|
||||||
"/api" : ""
|
"/api" : ""
|
||||||
|
|||||||
@@ -1,45 +1,209 @@
|
|||||||
<template>
|
<template>
|
||||||
<Cn-page :loading="loading">
|
<Cn-page :loading="loading">
|
||||||
<view slot="body">
|
<template slot="body">
|
||||||
<view class="device-list device">
|
<view class="device">
|
||||||
<Cn-empty v-if="projectList.length == 0"></Cn-empty>
|
<view class="nav" :style="{ top: navTabHeight + 'px' }">
|
||||||
<template v-else>
|
<view class="nav-menu" :class="{ 'nav-menu-active': select.engineeringName }"
|
||||||
<uni-card
|
@click="selectEngineering"
|
||||||
:title="item.name"
|
>{{ select.engineeringName || '全部工程' }}
|
||||||
:sub-title="item.projectName"
|
<uni-icons
|
||||||
:extra="item.mac"
|
type="bottom"
|
||||||
padding="0"
|
size="14"
|
||||||
v-for="(item, index) in projectList"
|
:color="select.engineeringName ? '#376cf3' : '#666'"
|
||||||
:key="index"
|
></uni-icons>
|
||||||
@click="jump(item)"
|
</view>
|
||||||
:thumbnail="deviceIcon(item.runStatus)"
|
<picker
|
||||||
|
@change="projectNameChange"
|
||||||
|
@cancel="select.selectProject = false"
|
||||||
|
:value="select.projectNameIndex"
|
||||||
|
:range="filterProjectList"
|
||||||
|
range-key="text"
|
||||||
|
v-if="select.engineeringId"
|
||||||
>
|
>
|
||||||
</uni-card>
|
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }"
|
||||||
<uni-load-more status="nomore"></uni-load-more>
|
@click="select.selectProject = true">
|
||||||
|
{{
|
||||||
|
select.projectName
|
||||||
|
? select.projectName.length > 4
|
||||||
|
? select.projectName.substring(0, 4) + '...'
|
||||||
|
: select.projectName
|
||||||
|
: '全部项目'
|
||||||
|
}}
|
||||||
|
<uni-icons
|
||||||
|
type="top"
|
||||||
|
size="14"
|
||||||
|
:color="select.projectName ? '#376cf3' : '#666'"
|
||||||
|
v-if="select.selectProject"
|
||||||
|
></uni-icons>
|
||||||
|
<uni-icons
|
||||||
|
type="bottom"
|
||||||
|
size="14"
|
||||||
|
:color="select.projectName ? '#376cf3' : '#666'"
|
||||||
|
v-else
|
||||||
|
></uni-icons>
|
||||||
|
</view>
|
||||||
|
</picker>
|
||||||
|
<picker
|
||||||
|
@change="runStatusChange"
|
||||||
|
@cancel="select.runStatusSelect = false"
|
||||||
|
:value="select.runStatusIndex"
|
||||||
|
:range="projectType"
|
||||||
|
range-key="text"
|
||||||
|
>
|
||||||
|
<view class="nav-menu" :class="{ 'nav-menu-active': select.runStatusName }"
|
||||||
|
@click="select.runStatusSelect = true">
|
||||||
|
{{
|
||||||
|
select.runStatusName
|
||||||
|
? select.runStatusName.length > 4
|
||||||
|
? select.runStatusName.substring(0, 4) + '...'
|
||||||
|
: select.runStatusName
|
||||||
|
: '全部状态'
|
||||||
|
}}
|
||||||
|
<uni-icons
|
||||||
|
type="top"
|
||||||
|
size="14"
|
||||||
|
:color="select.projectName ? '#376cf3' : '#666'"
|
||||||
|
v-if="select.runStatusSelect"
|
||||||
|
></uni-icons>
|
||||||
|
<uni-icons
|
||||||
|
type="bottom"
|
||||||
|
size="14"
|
||||||
|
:color="select.projectName ? '#376cf3' : '#666'"
|
||||||
|
v-else
|
||||||
|
></uni-icons>
|
||||||
|
</view>
|
||||||
|
</picker>
|
||||||
|
<view style="flex: 1"></view>
|
||||||
|
<!-- <picker @change="runStatusChange" :value="select.projectTypeIndex" :range="projectType" range-key="text">
|
||||||
|
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectType }"
|
||||||
|
>{{ select.projectType || '类型' }}
|
||||||
|
</view>
|
||||||
|
</picker> -->
|
||||||
|
</view>
|
||||||
|
<view class="content device" :style="{ minHeight: minHeight }">
|
||||||
|
<Cn-device-card v-for="(item, index) in store.data" :device="item" :key="index">
|
||||||
|
</Cn-device-card>
|
||||||
|
<uni-load-more
|
||||||
|
v-if="store.status == 'loading' || store.data.length > 0"
|
||||||
|
:status="store.status"
|
||||||
|
></uni-load-more>
|
||||||
|
<Cn-empty v-else></Cn-empty>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</Cn-page>
|
</Cn-page>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import {getProjectList} from '@/common/api/project'
|
||||||
|
import {queryDictData} from '@/common/api/dictionary'
|
||||||
|
import list from "@/common/js/list";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [list],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: true,
|
||||||
current: 0,
|
transfer: false,
|
||||||
items: ['正常', '报警', '离线'],
|
share: false,
|
||||||
styleType: 'text',
|
checkList: [],
|
||||||
activeColor: '#007aff',
|
select: {
|
||||||
content: [
|
projectName: '',
|
||||||
{
|
projectNameIndex: 0,
|
||||||
iconPath: '/static/add.png',
|
projectSelect: false,
|
||||||
text: '添加 ',
|
engineeringName: '',
|
||||||
|
engineeringId: 0,
|
||||||
|
runStatusName: '',
|
||||||
|
runStatusIndex: 0,
|
||||||
|
runStatusSelect: false,
|
||||||
},
|
},
|
||||||
],
|
minHeight: 0,
|
||||||
|
navTabHeight: 0,
|
||||||
|
engineeringList: [],
|
||||||
projectList: [],
|
projectList: [],
|
||||||
|
projectType: [{
|
||||||
|
text: '全部',
|
||||||
|
value: '',
|
||||||
|
}, {
|
||||||
|
text: '离线',
|
||||||
|
value: 1
|
||||||
|
}, {
|
||||||
|
text: '在线',
|
||||||
|
value: 2
|
||||||
|
}],
|
||||||
|
pageOptions: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
select: {
|
||||||
|
handler(val, oldVal) {
|
||||||
|
if (this.loading) return
|
||||||
|
this.store.params.projectId = val.projectNameIndex === 0 ? '' : this.filterProjectList[val.projectNameIndex].value
|
||||||
|
this.store.params.runStatus = val.runStatusIndex === 0 ? '' : this.projectType[val.runStatusIndex].value
|
||||||
|
this.store.params.engineerId = val.engineeringId || ''
|
||||||
|
this.store.reload()
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
filterProjectList() {
|
||||||
|
return this.projectList.filter(item => item.engineeringId === this.select.engineeringId || item.value === '-1')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
let engineering = uni.getStorageSync('engineering')
|
||||||
|
this.pageOptions = options
|
||||||
|
switch (options.type) {
|
||||||
|
case 'onLineDevs':
|
||||||
|
this.select.runStatusIndex = 2
|
||||||
|
this.select.runStatusName = '在线'
|
||||||
|
break
|
||||||
|
case 'offLineDevs':
|
||||||
|
this.select.runStatusIndex = 1
|
||||||
|
this.select.runStatusName = '离线'
|
||||||
|
break
|
||||||
|
case 'currentOnLineDevs':
|
||||||
|
this.select.runStatusIndex = 2
|
||||||
|
this.select.engineeringName = engineering.name
|
||||||
|
this.select.engineeringId = engineering.id
|
||||||
|
this.select.runStatusName = '在线'
|
||||||
|
break
|
||||||
|
case 'currentOffLineDevs':
|
||||||
|
this.select.runStatusIndex = 1
|
||||||
|
this.select.engineeringName = engineering.name
|
||||||
|
this.select.engineeringId = engineering.id
|
||||||
|
this.select.runStatusName = '离线'
|
||||||
|
break
|
||||||
|
case 'allEngineering':
|
||||||
|
this.select.engineeringName = ''
|
||||||
|
this.select.engineeringId = ''
|
||||||
|
break
|
||||||
|
case 'nowEngineering':
|
||||||
|
this.select.engineeringName = engineering.name
|
||||||
|
this.select.engineeringId = engineering.id
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
let engineering = uni.getStorageSync('onceSelectEngineering')
|
||||||
|
if (engineering) {
|
||||||
|
uni.removeStorageSync('onceSelectEngineering')
|
||||||
|
this.select.engineeringId = engineering.id
|
||||||
|
this.select.engineeringName = engineering.name
|
||||||
|
this.select.projectNameIndex = 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
selectEngineering() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/home/selectEngineering?from=once',
|
||||||
|
})
|
||||||
|
},
|
||||||
deviceIcon(e) {
|
deviceIcon(e) {
|
||||||
let str = ''
|
let str = ''
|
||||||
switch (e) {
|
switch (e) {
|
||||||
@@ -55,51 +219,149 @@ export default {
|
|||||||
}
|
}
|
||||||
return str
|
return str
|
||||||
},
|
},
|
||||||
onClickItem(e) {
|
switchChange(e) {
|
||||||
this.current = e.currentIndex
|
console.log(e)
|
||||||
|
let index = this.checkList.indexOf(e.equipmentId)
|
||||||
|
if (index > -1) {
|
||||||
|
this.checkList.splice(index, 1)
|
||||||
|
} else {
|
||||||
|
this.checkList.push(e.equipmentId)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
jump(item) {
|
cancel() {
|
||||||
uni.navigateTo({
|
this.transfer = false
|
||||||
url: '/pages/device/APF/detail?id=' + item.id + '&isPrimaryUser=0',
|
this.share = false
|
||||||
|
this.checkList = []
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
console.log(this.checkList)
|
||||||
|
if (this.checkList.length === 0) {
|
||||||
|
this.$util.toast('请选择设备')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.transfer) {
|
||||||
|
uni.navigateTo({url: '/pages/device/transfer?id=' + this.checkList.join(',')})
|
||||||
|
} else if (this.share) {
|
||||||
|
uni.navigateTo({url: '/pages/device/share?id=' + this.checkList.join(',')})
|
||||||
|
}
|
||||||
|
this.cancel()
|
||||||
|
},
|
||||||
|
async init() {
|
||||||
|
console.warn('init')
|
||||||
|
this.getEngineeringList()
|
||||||
|
this.getProjectList()
|
||||||
|
this.getDeviceList()
|
||||||
|
},
|
||||||
|
getDeviceList() {
|
||||||
|
this.store = this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject')
|
||||||
|
this.store.params.engineerId = this.select.engineeringId
|
||||||
|
this.store.params.runStatus = this.select.runStatusIndex === 0 ? '' : this.projectType[this.select.runStatusIndex].value
|
||||||
|
this.store.params.pageSize = 50
|
||||||
|
this.store.firstCallBack = (res) => {
|
||||||
|
this.loading = false
|
||||||
|
uni.createSelectorQuery()
|
||||||
|
.select('.uni-navbar')
|
||||||
|
.boundingClientRect((rect1) => {
|
||||||
|
if (!rect1) return
|
||||||
|
this.navTabHeight = rect1.height
|
||||||
|
uni.createSelectorQuery()
|
||||||
|
.select('.nav')
|
||||||
|
.boundingClientRect((rect2) => {
|
||||||
|
if (!rect2) return
|
||||||
|
// #ifdef H5
|
||||||
|
this.minHeight = 'calc(100vh - ' + (this.navTabHeight + rect2.height + 50) + 'px)'
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
this.minHeight = 'calc(100vh - ' + (this.navTabHeight + rect2.height) + 'px)'
|
||||||
|
console.log(this.minHeight)
|
||||||
|
// #endif
|
||||||
|
})
|
||||||
|
.exec()
|
||||||
|
})
|
||||||
|
.exec()
|
||||||
|
}
|
||||||
|
this.store.reload()
|
||||||
|
},
|
||||||
|
getProjectList() {
|
||||||
|
this.projectList = uni.getStorageSync('projectList')
|
||||||
|
},
|
||||||
|
getEngineeringList() {
|
||||||
|
this.engineeringList = uni.getStorageSync('engineeringList')
|
||||||
|
},
|
||||||
|
queryDictData() {
|
||||||
|
queryDictData('项目类型').then((res) => {
|
||||||
|
this.projectType = [
|
||||||
|
{
|
||||||
|
text: '全部类型',
|
||||||
|
value: '',
|
||||||
|
},
|
||||||
|
...res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
text: item.anotherName,
|
||||||
|
value: item.id,
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
]
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
trigger(e) {
|
submitFeedBack() {
|
||||||
if (e.index === 0) {
|
uni.navigateTo({url: '/pages/home/feedback'})
|
||||||
|
},
|
||||||
|
runStatusChange(e) {
|
||||||
|
this.select.runStatusSelect = false
|
||||||
|
this.select.runStatusIndex = e.detail.value
|
||||||
|
if (e.detail.value === 0) {
|
||||||
|
this.select.runStatusName = ''
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.select.runStatusName = this.projectType[e.detail.value].text
|
||||||
|
},
|
||||||
|
projectNameChange(e) {
|
||||||
|
this.select.selectProject = false
|
||||||
|
console.log(e)
|
||||||
|
this.select.projectNameIndex = e.detail.value
|
||||||
|
if (e.detail.value === 0) {
|
||||||
|
this.select.projectName = ''
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.select.projectName = this.projectList[e.detail.value].text
|
||||||
|
},
|
||||||
|
registerDevice() {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '请选择设备类型',
|
||||||
|
confirmText: '直连设备',
|
||||||
|
cancelText: '网关接入',
|
||||||
|
cancelColor: '#007aff',
|
||||||
|
success: ({confirm, cancel}) => {
|
||||||
|
if (confirm) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/device/new',
|
url: '/pages/device/new',
|
||||||
})
|
})
|
||||||
|
} else if (cancel) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/gateway/list',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
registerGateway() {
|
||||||
this.projectList = JSON.parse(decodeURIComponent(options.projectList))
|
uni.navigateTo({
|
||||||
console.log(this.projectList);
|
url: '/pages/gateway/new',
|
||||||
switch (options.type) {
|
|
||||||
case 'alarmLineDevs':
|
|
||||||
uni.setNavigationBarTitle({
|
|
||||||
title: '报警设备',
|
|
||||||
})
|
})
|
||||||
break
|
},
|
||||||
case 'offLineDevs':
|
navMenuClick(index) {
|
||||||
uni.setNavigationBarTitle({
|
this.navMenuActive = index
|
||||||
title: '离线设备',
|
},
|
||||||
|
jump(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/device/APF/detail?id=' + item.equipmentId + '&isPrimaryUser=' + item.isPrimaryUser,
|
||||||
})
|
})
|
||||||
break
|
},
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.device-list {
|
|
||||||
padding-top: 20rpx;
|
|
||||||
.header {
|
|
||||||
position: sticky;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: 10;
|
|
||||||
background: #fff;
|
|
||||||
padding: 10rpx 20rpx 20rpx;
|
|
||||||
box-shadow: 0 0 10rpx #eee;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -69,9 +69,9 @@ export default {
|
|||||||
confirm(e) {
|
confirm(e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
let engineering = this.engineeringList.find((item) => item.name === e.item.name)
|
let engineering = this.engineeringList.find((item) => item.name === e.item.name)
|
||||||
if (this.options.from === 'projectNew') {
|
if (this.options.from === 'once') {
|
||||||
// 创建项目的时候选择工程 用完即删
|
// 创建项目的时候选择工程 用完即删
|
||||||
uni.setStorageSync('projectSelectEngineering', engineering)
|
uni.setStorageSync('onceSelectEngineering', engineering)
|
||||||
} else {
|
} else {
|
||||||
uni.setStorageSync('engineering', engineering)
|
uni.setStorageSync('engineering', engineering)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,28 +62,34 @@
|
|||||||
</picker> -->
|
</picker> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="content device" :style="{ minHeight: minHeight }">
|
<view class="content device" :style="{ minHeight: minHeight }">
|
||||||
<uni-card
|
<Cn-device-card v-for="(item, index) in deviceListFilter" :device="item" :key="index">
|
||||||
:title="item.equipmentName"
|
|
||||||
:sub-title="item.projectName"
|
|
||||||
:extra="item.mac"
|
|
||||||
padding="0"
|
|
||||||
v-for="(item, index) in deviceListFilter"
|
|
||||||
:key="index"
|
|
||||||
@click="jump(item)"
|
|
||||||
:thumbnail="deviceIcon(item.runStatus)"
|
|
||||||
>
|
|
||||||
<!-- <text>{{ item.project }} {{ item.type }}</text> -->
|
|
||||||
<template v-slot:title v-if="transfer || share">
|
<template v-slot:title v-if="transfer || share">
|
||||||
<view class="switch-title">
|
<!-- 卡片标题 -->
|
||||||
<view class="switch-title-left">{{ item.equipmentName }}</view>
|
<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
|
<switch
|
||||||
:checked="checkList.indexOf(item.equipmentId) > -1"
|
:checked="checkList.indexOf(item.equipmentId) > -1"
|
||||||
style="transform: scale(0.8)"
|
style="transform: scale(0.8);position: relative;left: 20rpx;"
|
||||||
@change="switchChange(item)"
|
@change="switchChange(item)"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</uni-card>
|
</Cn-device-card>
|
||||||
<uni-load-more
|
<uni-load-more
|
||||||
v-if="store.status == 'loading' || deviceListFilter.length > 0"
|
v-if="store.status == 'loading' || deviceListFilter.length > 0"
|
||||||
:status="store.status"
|
:status="store.status"
|
||||||
@@ -255,6 +261,7 @@ export default {
|
|||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
this.projectList = arr
|
this.projectList = arr
|
||||||
|
uni.setStorageSync('projectList', arr)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
queryDictData() {
|
queryDictData() {
|
||||||
@@ -331,14 +338,5 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
/deep/ .switch-title {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 20rpx 0;
|
|
||||||
|
|
||||||
&-left {
|
|
||||||
flex: 1;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<template v-if="devCount.engineeringListLength > 1">
|
<template v-if="devCount.engineeringListLength > 1">
|
||||||
<view class="canneng-index-title mb20">所有工程设备统计</view>
|
<view class="canneng-index-title mb20">所有工程设备统计</view>
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<view class="header-item">
|
<view class="header-item" @click="jump('allEngineering')">
|
||||||
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
|
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
|
||||||
<view class="header-item-label">设备总数</view>
|
<view class="header-item-label">设备总数</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<view class="canneng-index-title mb20">当前工程设备统计</view>
|
<view class="canneng-index-title mb20">当前工程设备统计</view>
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<view class="header-item">
|
<view class="header-item" @click="jump('nowEngineering')">
|
||||||
<view class="header-item-value">{{
|
<view class="header-item-value">{{
|
||||||
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
|
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
|
||||||
}}
|
}}
|
||||||
@@ -97,17 +97,10 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
jump(type) {
|
jump(type) {
|
||||||
switch (type) {
|
|
||||||
default:
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:
|
url:
|
||||||
'/pages/device/list?type=' +
|
'/pages/device/list?type=' + type
|
||||||
type +
|
|
||||||
'&projectList=' +
|
|
||||||
encodeURIComponent(JSON.stringify(this.devCount[type])),
|
|
||||||
})
|
})
|
||||||
break
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,14 +3,17 @@
|
|||||||
<view class="message-list-item" v-for="(item, index) in store.data" :key="index" @click="jump(item)">
|
<view class="message-list-item" v-for="(item, index) in store.data" :key="index" @click="jump(item)">
|
||||||
<view class="hide-txt message-list-item-title">{{ item.title }}</view>
|
<view class="hide-txt message-list-item-title">{{ item.title }}</view>
|
||||||
<view class="message-list-item-footer">
|
<view class="message-list-item-footer">
|
||||||
<view class="mr20 message-list-item-footer-status message-list-item-footer-status-close" v-if="item.status === '0'">
|
<view class="mr20 message-list-item-footer-status message-list-item-footer-status-over"
|
||||||
已关闭
|
v-if="item.status === '0'">
|
||||||
|
已解决
|
||||||
</view>
|
</view>
|
||||||
<view class="mr20 message-list-item-footer-status message-list-item-footer-status-processing" v-else-if="item.status === '1'">
|
<view class="mr20 message-list-item-footer-status message-list-item-footer-status-processing"
|
||||||
|
v-else-if="item.status === '1'">
|
||||||
待处理
|
待处理
|
||||||
</view>
|
</view>
|
||||||
<view class="mr20 message-list-item-footer-status message-list-item-footer-status-over" v-else-if="item.status === '2'">
|
<view class="mr20 message-list-item-footer-status message-list-item-footer-status-handler"
|
||||||
已解决
|
v-else-if="item.status === '2'">
|
||||||
|
处理中
|
||||||
</view>
|
</view>
|
||||||
<view class="message-list-item-footer-time"> {{ item.createTime }}</view>
|
<view class="message-list-item-footer-time"> {{ item.createTime }}</view>
|
||||||
<uni-badge class="uni-badge-left-margin" :text="item.chatCount"/>
|
<uni-badge class="uni-badge-left-margin" :text="item.chatCount"/>
|
||||||
@@ -55,6 +58,7 @@ export default {
|
|||||||
padding: 28rpx;
|
padding: 28rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-bottom: 1rpx solid #ddd;
|
border-bottom: 1rpx solid #ddd;
|
||||||
|
|
||||||
&-title {
|
&-title {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #3b4144;
|
color: #3b4144;
|
||||||
@@ -64,16 +68,19 @@ export default {
|
|||||||
margin-top: 8rpx;
|
margin-top: 8rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
&-time {
|
&-time {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-status {
|
&-status {
|
||||||
padding: 4rpx 12rpx;
|
padding: 4rpx 12rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
border-radius: 4rpx;
|
border-radius: 4rpx;
|
||||||
|
|
||||||
&-over {
|
&-over {
|
||||||
background-color: #f0f9eb;
|
background-color: #f0f9eb;
|
||||||
border-color: #e1f3d8;
|
border-color: #e1f3d8;
|
||||||
@@ -91,6 +98,12 @@ export default {
|
|||||||
border-color: #faecd8;
|
border-color: #faecd8;
|
||||||
color: #e6a23c;
|
color: #e6a23c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-handler {
|
||||||
|
background-color: #ecf5ff;
|
||||||
|
border-color: #d9ecff;
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,15 +10,15 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="detail-content " style="margin-bottom:0">
|
<view class="detail-content " style="margin-bottom:0">
|
||||||
<view class="detail-content-title ">
|
<view class="detail-content-title ">
|
||||||
<view class="title">消息列表</view>
|
<view class="title">进度</view>
|
||||||
<template v-if="pageData.status === '1'">
|
<!-- <template v-if="pageData.status === '1'">-->
|
||||||
<view class="title-btn mr10" @click="updateFeedBackStatus('2')">解决</view>
|
<!-- <view class="title-btn mr10" @click="updateFeedBackStatus('2')">解决</view>-->
|
||||||
<view class="title-btn mr10" @click="updateFeedBackStatus('0')">关闭</view>
|
<!-- <view class="title-btn mr10" @click="updateFeedBackStatus('0')">关闭</view>-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
<template v-if="pageData.status === '2'">
|
<!-- <template v-if="pageData.status === '2'">-->
|
||||||
<view class="title-btn mr10" @click="updateFeedBackStatus('0')">关闭</view>
|
<!-- <view class="title-btn mr10" @click="updateFeedBackStatus('0')">关闭</view>-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
<view class="title-btn" @click="open">回复</view>
|
<!-- <view class="title-btn" @click="open">回复</view>-->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<uni-list>
|
<uni-list>
|
||||||
@@ -62,11 +62,9 @@ export default {
|
|||||||
onLoad(o) {
|
onLoad(o) {
|
||||||
this.pageOption = o
|
this.pageOption = o
|
||||||
this.init()
|
this.init()
|
||||||
if (o.chatCount > 0) {
|
|
||||||
updateChatStatus({
|
updateChatStatus({
|
||||||
id: o.id,
|
id: o.id,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateFeedBackStatus(status) {
|
updateFeedBackStatus(status) {
|
||||||
|
|||||||
@@ -128,9 +128,9 @@ export default {
|
|||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if (!this.options.project) {
|
if (!this.options.project) {
|
||||||
let engineering = uni.getStorageSync('projectSelectEngineering')
|
let engineering = uni.getStorageSync('onceSelectEngineering')
|
||||||
if (engineering) {
|
if (engineering) {
|
||||||
uni.removeStorageSync('projectSelectEngineering')
|
uni.removeStorageSync('onceSelectEngineering')
|
||||||
this.formData.engineeringId = engineering.id
|
this.formData.engineeringId = engineering.id
|
||||||
this.formData.engineeringName = engineering.name
|
this.formData.engineeringName = engineering.name
|
||||||
}
|
}
|
||||||
@@ -191,7 +191,7 @@ export default {
|
|||||||
console.log(123)
|
console.log(123)
|
||||||
if (this.options.project) return this.$util.toast('项目已经创建,不能修改工程')
|
if (this.options.project) return this.$util.toast('项目已经创建,不能修改工程')
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/home/selectEngineering?from=projectNew',
|
url: '/pages/home/selectEngineering?from=once',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
beforeRemove(e) {
|
beforeRemove(e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user