设备管理

This commit is contained in:
liuye
2022-06-11 11:42:53 +08:00
parent 575f9a1b57
commit c29304840d
3 changed files with 33 additions and 17 deletions

View File

@@ -17,10 +17,10 @@
<img src="../img/lb@2x.png" alt="" class="voice-img">
<div class="info">
<div class="text">
<p>{{item.deviceName}}</p>
<span>{{item.orgName}}</span>
<p>{{item.name}}</p>
<span>{{item.areaName}}</span>
</div>
<div class="status">{{item.devStatus}}</div>
<div class="status">{{ $dict.getLabel('dlbDevStatus', item.devStatus) }}</div>
</div>
</div>
</div>
@@ -43,7 +43,9 @@ export default {
onLoad() {
this.areaId = this.user.areaId
this.areaName = this.user.areaName
this.getList()
this.$dict.load(['dlbDevStatus']).then(() => {
this.getList()
})
},
methods: {
areaSelect(e) {
@@ -56,7 +58,7 @@ export default {
this.getList()
},
getList() {
this.$http.post(`/app/appdlbquipment/getDlbDeviceList?current=1&size=20&keyword=${this.keyword}`).then((res) => {
this.$http.post(`/app/appdlbquipment/list?current=1&size=20&name=${this.keyword}`).then((res) => {
if (res.code == 0) {
if (this.current > 1) {
this.list = [...this.list, ...res.data.records]
@@ -67,7 +69,7 @@ export default {
})
},
toDetail(item) {
uni.navigateTo({url: `./detail`})
uni.navigateTo({url: `./detail?id=${item.id}`})
}
},
onReachBottom() {

View File

@@ -7,18 +7,18 @@
</AiTopFixed>
<div class="content">
<div class="info-content" v-if="currIndex != 1">
<p>{{info.deviceName}}</p>
<p>{{info.name}}</p>
<div class="info">
<span>设备编号</span>
<span class="color-333">{{info.serialNo}}</span>
</div>
<div class="info">
<span>设备状态</span>
<span style="color: #4E8EEE">{{info.devStatus}}</span>
<span style="color: #4E8EEE">{{ $dict.getLabel('dlbDevStatus', info.devStatus) }}</span>
</div>
<div class="info">
<span>信号强度</span>
<span class="color-333">{{info.network}}</span>
<span class="color-333">{{ $dict.getLabel('dlbDevSignal', info.devSignal) }}</span>
</div>
<div class="info">
<span>音量</span>
@@ -79,15 +79,19 @@ export default {
barStyle: {width: '98px', bottom: '-3px', left: '-38px'},
tab: [{name: '基本信息'}, {name: '播发任务'}],
list: [],
currIndex: 1,
currIndex: 0,
current: 1,
isShow: false,
volume: 10,
info: {}
info: {},
id: ''
}
},
onLoad(query) {
this.id = query.id
this.$dict.load(['dlbDevStatus', 'dlbDevSignal']).then(() => {
this.getDetail()
})
},
onShow() {
@@ -106,12 +110,21 @@ export default {
this.volume = this.info.volume * 10 || 10
},
confirmAdd() {
this.$http.post(`/app/appdlbquipment/volumeControl?deviceId=${this.info.deviceId}&volume=${this.volume}`).then((res) => {
var volume = parseInt(this.volume/10)
this.$http.post(`/app/appdlbquipment/volumeControl?deviceId=${this.info.deviceId}&volume=${volume}`).then((res) => {
if (res.code == 0) {
this.getDetail()
this.isShow = false
this.$u.toast('音量设置成功')
}
})
},
getDetail() {
this.$http.post(`/app/appdlbquipment/queryDetailById?id=${this.id}`).then((res) => {
if (res.code == 0) {
this.info = res.data
}
})
}
},

View File

@@ -41,7 +41,7 @@
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: "AppResourcesManage",
data() {
@@ -62,6 +62,7 @@ export default {
typeList: [{label: '全部', value: '0'}, {label: '我创建的', value: '1'},]
}
},
computed: { ...mapState(['user']) },
onLoad() {
this.getList()
uni.$on('getList', () => {
@@ -117,10 +118,10 @@ export default {
this.$http.post(`/app/appdlbresource/list`, null, {
params: {
...this.search,
type: this.currIndex === 0 ? 1 : 3,
name: this.keyword,
current: this.current,
size: 10
size: 10,
createUserId: this.type == 1 ? this.user.id : ''
}
}).then(res => {
if (res.code == 0) {