用户分享列表
This commit is contained in:
@@ -156,3 +156,23 @@ export const updateDevice = (params) => {
|
|||||||
data: params,
|
data: params,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设备用户列表
|
||||||
|
export const queryDeviceUser = (devId) => {
|
||||||
|
return request({
|
||||||
|
url: '/cs-device-boot/deviceUser/queryUserById',
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
devId
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消分享
|
||||||
|
export const cancelShare = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/cs-device-boot/deviceUser/cancelShare',
|
||||||
|
method: 'POST',
|
||||||
|
data: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
15
components/Cn-img/Cn-img.vue
Normal file
15
components/Cn-img/Cn-img.vue
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<template>
|
||||||
|
<view class='index'>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
methods: {}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang='scss'>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
"name" : "灿能物联",
|
"name" : "灿能物联",
|
||||||
"appid" : "__UNI__88BC25B",
|
"appid" : "__UNI__88BC25B",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.2.6",
|
"versionName" : "1.2.7",
|
||||||
"versionCode" : 126,
|
"versionCode" : 127,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
|||||||
@@ -285,7 +285,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/mine/user",
|
"path": "pages/device/user",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "子用户"
|
"navigationBarTitleText": "子用户"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
<template v-for="(item,index) in IOData">
|
<template v-for="(item,index) in IOData">
|
||||||
<view class="item">{{ item.clDid }}</view>
|
<view class="item">{{ item.clDid }}</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view style="width: 30rpx"> {{ item.value || '-'}}</view>
|
<view style="width: 30rpx"> {{ item.value || '-' }}</view>
|
||||||
<view v-if="item.value"> °C</view>
|
<view v-if="item.value"> °C</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -225,7 +225,7 @@ export default {
|
|||||||
} else if (e.item.text === '反馈') {
|
} else if (e.item.text === '反馈') {
|
||||||
uni.navigateTo({url: '/pages/device/feedback'})
|
uni.navigateTo({url: '/pages/device/feedback'})
|
||||||
} else if (e.item.text === '用户') {
|
} else if (e.item.text === '用户') {
|
||||||
uni.navigateTo({url: '/pages/device/user'})
|
uni.navigateTo({url: '/pages/device/user?id=' + this.devId + '&isPrimaryUser=' + this.isPrimaryUser})
|
||||||
} else if (e.item.text === '报表') {
|
} else if (e.item.text === '报表') {
|
||||||
this.$util.toast('效果是直接打开报表')
|
this.$util.toast('效果是直接打开报表')
|
||||||
} else if (e.item.text === '版本') {
|
} else if (e.item.text === '版本') {
|
||||||
@@ -426,6 +426,13 @@ export default {
|
|||||||
text: '分享',
|
text: '分享',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (this.userInfo.authorities !== 'tourist') {
|
||||||
|
this.content.splice(0, 0, {
|
||||||
|
iconPath: '/static/subordinate.png',
|
||||||
|
text: '用户',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<view class='detail'>
|
<view class='detail'>
|
||||||
<view class="detail-header">
|
<view class="detail-header">
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<image src="http://ruuf2hujc.bkt.clouddn.com/%E7%94%B5%E8%B7%AF%E5%9B%BE.svg" mode="widthFix" style="width: 100%;" />
|
<image src="http://localhost:8088/api/system-boot/image/toStream?bgImage=topology/1aca98ceb22a1fc33b81d9101275ef1.png" mode="widthFix" style="width: 100%;" />
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="des">
|
<!-- <view class="des">
|
||||||
<text>设备基础信息</text>
|
<text>设备基础信息</text>
|
||||||
|
|||||||
@@ -1,32 +1,80 @@
|
|||||||
<template>
|
<template>
|
||||||
<Cn-page :loading='loading'>
|
<Cn-page :loading='loading'>
|
||||||
<view slot='body'>
|
<view slot='body' class='index'>
|
||||||
<view class='index'>
|
|
||||||
<uni-list>
|
<uni-list>
|
||||||
<uni-list-item title="张三" note="2023-02-10 14:55" thumb="/static/head.png" thumb-size="lg">
|
<uni-list-item :title="renderData.masterUser.name" :note="renderData.masterUser.phone"
|
||||||
<template v-slot:footer>
|
:thumb="renderData.masterUser.avatar" thumb-size="lg" rightText="主用户">
|
||||||
<view class="footer-btn mt20" style="background:#e47470">移除</view>
|
|
||||||
</template>
|
|
||||||
</uni-list-item>
|
</uni-list-item>
|
||||||
<uni-list-item title="李四" note="2023-02-10 14:55" thumb="/static/head.png" thumb-size="lg">
|
<uni-list-item :title="item.name" :note="item.phone" :thumb="item.avatar" thumb-size="lg"
|
||||||
<template v-slot:footer>
|
v-for="item in renderData.subUsers" :key="item.id">
|
||||||
<view class="footer-btn mt20" style="background:#e47470">移除</view>
|
<template v-slot:footer v-if="options.isPrimaryUser">
|
||||||
|
<view class="footer-btn mt20" style="background:#e47470" @click="del(item)">移除</view>
|
||||||
</template>
|
</template>
|
||||||
</uni-list-item>
|
</uni-list-item>
|
||||||
</uni-list>
|
</uni-list>
|
||||||
<uni-load-more status="nomore"></uni-load-more>
|
<uni-load-more status="nomore"></uni-load-more>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
</Cn-page>
|
</Cn-page>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import {queryDeviceUser, cancelShare} from '@/common/api/device'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false
|
loading: true,
|
||||||
|
renderData: {
|
||||||
|
masterUser:{},
|
||||||
|
subUsers:[]
|
||||||
|
},
|
||||||
|
options: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
jump() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/mine/userDetail'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
del(e) {
|
||||||
|
console.log(e);
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要移除该成员吗?',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
cancelShare({eid: this.renderData.devId, userId: e.id}).then(res => {
|
||||||
|
console.log(res);
|
||||||
|
uni.showToast({
|
||||||
|
title: '移除成功',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
this.init()
|
||||||
|
|
||||||
|
})
|
||||||
|
console.log('用户点击确定')
|
||||||
|
} else if (res.cancel) {
|
||||||
|
console.log('用户点击取消')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
init() {
|
||||||
|
queryDeviceUser(this.options.id).then(res => {
|
||||||
|
console.log(res);
|
||||||
|
this.renderData = res.data
|
||||||
|
this.renderData.masterUser.avatar = this.renderData.masterUser.headSculpture ? this.$config.staticUrl + this.renderData.masterUser.headSculpture : '/static/head.png'
|
||||||
|
this.renderData.subUsers.forEach(item => {
|
||||||
|
item.avatar = item.headSculpture ? this.$config.staticUrl + item.headSculpture : '/static/head.png'
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.options = options
|
||||||
|
console.log(this.loading)
|
||||||
|
this.init()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user