列表优化
This commit is contained in:
@@ -3,9 +3,11 @@
|
||||
<template slot="body">
|
||||
<view class="device">
|
||||
<view class="nav" :style="{ top: navTabHeight + 'px' }">
|
||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.engineeringName }"
|
||||
@click="selectEngineering"
|
||||
>{{ select.engineeringName || '全部工程' }}
|
||||
<view
|
||||
class="nav-menu"
|
||||
:class="{ 'nav-menu-active': select.engineeringName }"
|
||||
@click="selectEngineering"
|
||||
>{{ select.engineeringName || '全部工程' }}
|
||||
<uni-icons
|
||||
type="bottom"
|
||||
size="14"
|
||||
@@ -20,8 +22,11 @@
|
||||
range-key="text"
|
||||
v-if="select.engineeringId"
|
||||
>
|
||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }"
|
||||
@click="select.selectProject = true">
|
||||
<view
|
||||
class="nav-menu"
|
||||
:class="{ 'nav-menu-active': select.projectName }"
|
||||
@click="select.selectProject = true"
|
||||
>
|
||||
{{
|
||||
select.projectName
|
||||
? select.projectName.length > 6
|
||||
@@ -50,8 +55,11 @@
|
||||
:range="projectType"
|
||||
range-key="text"
|
||||
>
|
||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.runStatusName }"
|
||||
@click="select.runStatusSelect = true">
|
||||
<view
|
||||
class="nav-menu"
|
||||
:class="{ 'nav-menu-active': select.runStatusName }"
|
||||
@click="select.runStatusSelect = true"
|
||||
>
|
||||
{{
|
||||
select.runStatusName
|
||||
? select.runStatusName.length > 4
|
||||
@@ -81,24 +89,21 @@
|
||||
</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>
|
||||
<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"
|
||||
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
<Cn-empty v-else></Cn-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
</Cn-page>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import {getProjectList} from '@/common/api/project'
|
||||
import {queryDictData} from '@/common/api/dictionary'
|
||||
import list from "@/common/js/list";
|
||||
import { getProjectList } from '@/common/api/project'
|
||||
import { queryDictData } from '@/common/api/dictionary'
|
||||
import list from '@/common/js/list'
|
||||
|
||||
export default {
|
||||
mixins: [list],
|
||||
@@ -122,24 +127,29 @@ export default {
|
||||
navTabHeight: 0,
|
||||
engineeringList: [],
|
||||
projectList: [],
|
||||
projectType: [{
|
||||
text: '全部',
|
||||
value: '',
|
||||
}, {
|
||||
text: '离线',
|
||||
value: 1
|
||||
}, {
|
||||
text: '在线',
|
||||
value: 2
|
||||
}],
|
||||
pageOptions: {}
|
||||
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.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()
|
||||
@@ -149,8 +159,10 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
filterProjectList() {
|
||||
return this.projectList.filter(item => item.engineeringId === this.select.engineeringId || item.value === '-1')
|
||||
}
|
||||
return this.projectList.filter(
|
||||
(item) => item.engineeringId === this.select.engineeringId || item.value === '-1',
|
||||
)
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
let engineering = uni.getStorageSync('engineering')
|
||||
@@ -240,9 +252,9 @@ export default {
|
||||
return
|
||||
}
|
||||
if (this.transfer) {
|
||||
uni.navigateTo({url: '/pages/device/transfer?id=' + this.checkList.join(',')})
|
||||
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.checkList.join(',') })
|
||||
} else if (this.share) {
|
||||
uni.navigateTo({url: '/pages/device/share?id=' + this.checkList.join(',')})
|
||||
uni.navigateTo({ url: '/pages/device/share?id=' + this.checkList.join(',') })
|
||||
}
|
||||
this.cancel()
|
||||
},
|
||||
@@ -255,7 +267,8 @@ export default {
|
||||
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.runStatus =
|
||||
this.select.runStatusIndex === 0 ? '' : this.projectType[this.select.runStatusIndex].value
|
||||
this.store.params.pageSize = 50
|
||||
this.store.firstCallBack = (res) => {
|
||||
this.loading = false
|
||||
@@ -305,7 +318,7 @@ export default {
|
||||
})
|
||||
},
|
||||
submitFeedBack() {
|
||||
uni.navigateTo({url: '/pages/home/feedback'})
|
||||
uni.navigateTo({ url: '/pages/home/feedback' })
|
||||
},
|
||||
runStatusChange(e) {
|
||||
this.select.runStatusSelect = false
|
||||
@@ -333,7 +346,7 @@ export default {
|
||||
confirmText: '直连设备',
|
||||
cancelText: '网关接入',
|
||||
cancelColor: '#007aff',
|
||||
success: ({confirm, cancel}) => {
|
||||
success: ({ confirm, cancel }) => {
|
||||
if (confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/new',
|
||||
@@ -362,6 +375,4 @@ export default {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
</style>
|
||||
<style lang="scss"></style>
|
||||
|
||||
Reference in New Issue
Block a user