设备列表
This commit is contained in:
@@ -227,10 +227,6 @@ page {
|
||||
/deep/ .uni-card:first-of-type {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
/deep/ .uni-card__header {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
|
||||
@@ -40,7 +40,7 @@ export default (options = {}) => {
|
||||
if (arr.indexOf(options.url) > -1) {
|
||||
setTimeout(() => {
|
||||
arr.splice(arr.indexOf(options.url), 1)
|
||||
}, 1500)
|
||||
}, 500)
|
||||
}
|
||||
if (res.data.resultCode !== 10000 && res.data.code !== 'A0000') {
|
||||
errHandler(res.data)
|
||||
@@ -53,7 +53,7 @@ export default (options = {}) => {
|
||||
if (arr.indexOf(options.url) > -1) {
|
||||
setTimeout(() => {
|
||||
arr.splice(arr.indexOf(options.url), 1)
|
||||
}, 1500)
|
||||
}, 500)
|
||||
}
|
||||
reject(err)
|
||||
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" : {
|
||||
"/api" : {
|
||||
"https" : true,
|
||||
"target" : "http://192.168.1.115:10215",
|
||||
"target" : "http://192.168.1.13:10215",
|
||||
"changOrigin" : true,
|
||||
"pathRewrite" : {
|
||||
"/api" : ""
|
||||
|
||||
@@ -1,45 +1,209 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading">
|
||||
<view slot="body">
|
||||
<view class="device-list device">
|
||||
<Cn-empty v-if="projectList.length == 0"></Cn-empty>
|
||||
<template v-else>
|
||||
<uni-card
|
||||
:title="item.name"
|
||||
:sub-title="item.projectName"
|
||||
:extra="item.mac"
|
||||
padding="0"
|
||||
v-for="(item, index) in projectList"
|
||||
:key="index"
|
||||
@click="jump(item)"
|
||||
:thumbnail="deviceIcon(item.runStatus)"
|
||||
<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 || '全部工程' }}
|
||||
<uni-icons
|
||||
type="bottom"
|
||||
size="14"
|
||||
:color="select.engineeringName ? '#376cf3' : '#666'"
|
||||
></uni-icons>
|
||||
</view>
|
||||
<picker
|
||||
@change="projectNameChange"
|
||||
@cancel="select.selectProject = false"
|
||||
:value="select.projectNameIndex"
|
||||
:range="filterProjectList"
|
||||
range-key="text"
|
||||
v-if="select.engineeringId"
|
||||
>
|
||||
</uni-card>
|
||||
<uni-load-more status="nomore"></uni-load-more>
|
||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }"
|
||||
@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>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</Cn-page>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import {getProjectList} from '@/common/api/project'
|
||||
import {queryDictData} from '@/common/api/dictionary'
|
||||
import list from "@/common/js/list";
|
||||
|
||||
export default {
|
||||
mixins: [list],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
current: 0,
|
||||
items: ['正常', '报警', '离线'],
|
||||
styleType: 'text',
|
||||
activeColor: '#007aff',
|
||||
content: [
|
||||
{
|
||||
iconPath: '/static/add.png',
|
||||
text: '添加 ',
|
||||
loading: true,
|
||||
transfer: false,
|
||||
share: false,
|
||||
checkList: [],
|
||||
select: {
|
||||
projectName: '',
|
||||
projectNameIndex: 0,
|
||||
projectSelect: false,
|
||||
engineeringName: '',
|
||||
engineeringId: 0,
|
||||
runStatusName: '',
|
||||
runStatusIndex: 0,
|
||||
runStatusSelect: false,
|
||||
},
|
||||
],
|
||||
minHeight: 0,
|
||||
navTabHeight: 0,
|
||||
engineeringList: [],
|
||||
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: {
|
||||
selectEngineering() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/home/selectEngineering?from=once',
|
||||
})
|
||||
},
|
||||
deviceIcon(e) {
|
||||
let str = ''
|
||||
switch (e) {
|
||||
@@ -55,51 +219,149 @@ export default {
|
||||
}
|
||||
return str
|
||||
},
|
||||
onClickItem(e) {
|
||||
this.current = e.currentIndex
|
||||
switchChange(e) {
|
||||
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) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/APF/detail?id=' + item.id + '&isPrimaryUser=0',
|
||||
cancel() {
|
||||
this.transfer = false
|
||||
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) {
|
||||
if (e.index === 0) {
|
||||
submitFeedBack() {
|
||||
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({
|
||||
url: '/pages/device/new',
|
||||
})
|
||||
} else if (cancel) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/gateway/list',
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
onLoad(options) {
|
||||
this.projectList = JSON.parse(decodeURIComponent(options.projectList))
|
||||
console.log(this.projectList);
|
||||
switch (options.type) {
|
||||
case 'alarmLineDevs':
|
||||
uni.setNavigationBarTitle({
|
||||
title: '报警设备',
|
||||
registerGateway() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/gateway/new',
|
||||
})
|
||||
break
|
||||
case 'offLineDevs':
|
||||
uni.setNavigationBarTitle({
|
||||
title: '离线设备',
|
||||
},
|
||||
navMenuClick(index) {
|
||||
this.navMenuActive = index
|
||||
},
|
||||
jump(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/APF/detail?id=' + item.equipmentId + '&isPrimaryUser=' + item.isPrimaryUser,
|
||||
})
|
||||
break
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<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>
|
||||
|
||||
@@ -69,9 +69,9 @@ export default {
|
||||
confirm(e) {
|
||||
console.log(e)
|
||||
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 {
|
||||
uni.setStorageSync('engineering', engineering)
|
||||
}
|
||||
|
||||
@@ -62,28 +62,34 @@
|
||||
</picker> -->
|
||||
</view>
|
||||
<view class="content device" :style="{ minHeight: minHeight }">
|
||||
<uni-card
|
||||
: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> -->
|
||||
<Cn-device-card v-for="(item, index) in deviceListFilter" :device="item" :key="index">
|
||||
<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
|
||||
:checked="checkList.indexOf(item.equipmentId) > -1"
|
||||
style="transform: scale(0.8)"
|
||||
style="transform: scale(0.8);position: relative;left: 20rpx;"
|
||||
@change="switchChange(item)"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</uni-card>
|
||||
</Cn-device-card>
|
||||
<uni-load-more
|
||||
v-if="store.status == 'loading' || deviceListFilter.length > 0"
|
||||
:status="store.status"
|
||||
@@ -255,6 +261,7 @@ export default {
|
||||
}),
|
||||
]
|
||||
this.projectList = arr
|
||||
uni.setStorageSync('projectList', arr)
|
||||
})
|
||||
},
|
||||
queryDictData() {
|
||||
@@ -331,14 +338,5 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
/deep/ .switch-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
|
||||
&-left {
|
||||
flex: 1;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<template v-if="devCount.engineeringListLength > 1">
|
||||
<view class="canneng-index-title mb20">所有工程设备统计</view>
|
||||
<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-label">设备总数</view>
|
||||
</view>
|
||||
@@ -20,7 +20,7 @@
|
||||
</template>
|
||||
<view class="canneng-index-title mb20">当前工程设备统计</view>
|
||||
<view class="header">
|
||||
<view class="header-item">
|
||||
<view class="header-item" @click="jump('nowEngineering')">
|
||||
<view class="header-item-value">{{
|
||||
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
|
||||
}}
|
||||
@@ -97,17 +97,10 @@ export default {
|
||||
})
|
||||
},
|
||||
jump(type) {
|
||||
switch (type) {
|
||||
default:
|
||||
uni.navigateTo({
|
||||
url:
|
||||
'/pages/device/list?type=' +
|
||||
type +
|
||||
'&projectList=' +
|
||||
encodeURIComponent(JSON.stringify(this.devCount[type])),
|
||||
'/pages/device/list?type=' + 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="hide-txt message-list-item-title">{{ item.title }}</view>
|
||||
<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 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 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 class="message-list-item-footer-time"> {{ item.createTime }}</view>
|
||||
<uni-badge class="uni-badge-left-margin" :text="item.chatCount"/>
|
||||
@@ -55,6 +58,7 @@ export default {
|
||||
padding: 28rpx;
|
||||
background: #fff;
|
||||
border-bottom: 1rpx solid #ddd;
|
||||
|
||||
&-title {
|
||||
font-size: 28rpx;
|
||||
color: #3b4144;
|
||||
@@ -64,16 +68,19 @@ export default {
|
||||
margin-top: 8rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&-time {
|
||||
margin-right: 20rpx;
|
||||
flex: 1;
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
&-status {
|
||||
padding: 4rpx 12rpx;
|
||||
font-size: 24rpx;
|
||||
border-radius: 4rpx;
|
||||
|
||||
&-over {
|
||||
background-color: #f0f9eb;
|
||||
border-color: #e1f3d8;
|
||||
@@ -91,6 +98,12 @@ export default {
|
||||
border-color: #faecd8;
|
||||
color: #e6a23c;
|
||||
}
|
||||
|
||||
&-handler {
|
||||
background-color: #ecf5ff;
|
||||
border-color: #d9ecff;
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
</view>
|
||||
<view class="detail-content " style="margin-bottom:0">
|
||||
<view class="detail-content-title ">
|
||||
<view class="title">消息列表</view>
|
||||
<template v-if="pageData.status === '1'">
|
||||
<view class="title-btn mr10" @click="updateFeedBackStatus('2')">解决</view>
|
||||
<view class="title-btn mr10" @click="updateFeedBackStatus('0')">关闭</view>
|
||||
</template>
|
||||
<template v-if="pageData.status === '2'">
|
||||
<view class="title-btn mr10" @click="updateFeedBackStatus('0')">关闭</view>
|
||||
</template>
|
||||
<view class="title-btn" @click="open">回复</view>
|
||||
<view class="title">进度</view>
|
||||
<!-- <template v-if="pageData.status === '1'">-->
|
||||
<!-- <view class="title-btn mr10" @click="updateFeedBackStatus('2')">解决</view>-->
|
||||
<!-- <view class="title-btn mr10" @click="updateFeedBackStatus('0')">关闭</view>-->
|
||||
<!-- </template>-->
|
||||
<!-- <template v-if="pageData.status === '2'">-->
|
||||
<!-- <view class="title-btn mr10" @click="updateFeedBackStatus('0')">关闭</view>-->
|
||||
<!-- </template>-->
|
||||
<!-- <view class="title-btn" @click="open">回复</view>-->
|
||||
</view>
|
||||
</view>
|
||||
<uni-list>
|
||||
@@ -62,11 +62,9 @@ export default {
|
||||
onLoad(o) {
|
||||
this.pageOption = o
|
||||
this.init()
|
||||
if (o.chatCount > 0) {
|
||||
updateChatStatus({
|
||||
id: o.id,
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateFeedBackStatus(status) {
|
||||
|
||||
@@ -128,9 +128,9 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
if (!this.options.project) {
|
||||
let engineering = uni.getStorageSync('projectSelectEngineering')
|
||||
let engineering = uni.getStorageSync('onceSelectEngineering')
|
||||
if (engineering) {
|
||||
uni.removeStorageSync('projectSelectEngineering')
|
||||
uni.removeStorageSync('onceSelectEngineering')
|
||||
this.formData.engineeringId = engineering.id
|
||||
this.formData.engineeringName = engineering.name
|
||||
}
|
||||
@@ -191,7 +191,7 @@ export default {
|
||||
console.log(123)
|
||||
if (this.options.project) return this.$util.toast('项目已经创建,不能修改工程')
|
||||
uni.navigateTo({
|
||||
url: '/pages/home/selectEngineering?from=projectNew',
|
||||
url: '/pages/home/selectEngineering?from=once',
|
||||
})
|
||||
},
|
||||
beforeRemove(e) {
|
||||
|
||||
Reference in New Issue
Block a user