设备管理

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

View File

@@ -7,18 +7,18 @@
</AiTopFixed> </AiTopFixed>
<div class="content"> <div class="content">
<div class="info-content" v-if="currIndex != 1"> <div class="info-content" v-if="currIndex != 1">
<p>{{info.deviceName}}</p> <p>{{info.name}}</p>
<div class="info"> <div class="info">
<span>设备编号</span> <span>设备编号</span>
<span class="color-333">{{info.serialNo}}</span> <span class="color-333">{{info.serialNo}}</span>
</div> </div>
<div class="info"> <div class="info">
<span>设备状态</span> <span>设备状态</span>
<span style="color: #4E8EEE">{{info.devStatus}}</span> <span style="color: #4E8EEE">{{ $dict.getLabel('dlbDevStatus', info.devStatus) }}</span>
</div> </div>
<div class="info"> <div class="info">
<span>信号强度</span> <span>信号强度</span>
<span class="color-333">{{info.network}}</span> <span class="color-333">{{ $dict.getLabel('dlbDevSignal', info.devSignal) }}</span>
</div> </div>
<div class="info"> <div class="info">
<span>音量</span> <span>音量</span>
@@ -79,15 +79,19 @@ export default {
barStyle: {width: '98px', bottom: '-3px', left: '-38px'}, barStyle: {width: '98px', bottom: '-3px', left: '-38px'},
tab: [{name: '基本信息'}, {name: '播发任务'}], tab: [{name: '基本信息'}, {name: '播发任务'}],
list: [], list: [],
currIndex: 1, currIndex: 0,
current: 1, current: 1,
isShow: false, isShow: false,
volume: 10, volume: 10,
info: {} info: {},
id: ''
} }
}, },
onLoad(query) { onLoad(query) {
this.id = query.id
this.$dict.load(['dlbDevStatus', 'dlbDevSignal']).then(() => {
this.getDetail()
})
}, },
onShow() { onShow() {
@@ -106,12 +110,21 @@ export default {
this.volume = this.info.volume * 10 || 10 this.volume = this.info.volume * 10 || 10
}, },
confirmAdd() { 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) { if (res.code == 0) {
this.getDetail() this.getDetail()
this.isShow = false
this.$u.toast('音量设置成功') 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> </div>
</template> </template>
<script> <script>
import { mapState } from 'vuex'
export default { export default {
name: "AppResourcesManage", name: "AppResourcesManage",
data() { data() {
@@ -62,6 +62,7 @@ export default {
typeList: [{label: '全部', value: '0'}, {label: '我创建的', value: '1'},] typeList: [{label: '全部', value: '0'}, {label: '我创建的', value: '1'},]
} }
}, },
computed: { ...mapState(['user']) },
onLoad() { onLoad() {
this.getList() this.getList()
uni.$on('getList', () => { uni.$on('getList', () => {
@@ -117,10 +118,10 @@ export default {
this.$http.post(`/app/appdlbresource/list`, null, { this.$http.post(`/app/appdlbresource/list`, null, {
params: { params: {
...this.search, name: this.keyword,
type: this.currIndex === 0 ? 1 : 3,
current: this.current, current: this.current,
size: 10 size: 10,
createUserId: this.type == 1 ? this.user.id : ''
} }
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {