基础接口对接
This commit is contained in:
@@ -1,48 +1,80 @@
|
||||
<template>
|
||||
<Cn-page :loading='loading' noPadding>
|
||||
<view slot='body'>
|
||||
<view class='detail'>
|
||||
<Cn-page :loading="loading" noPadding>
|
||||
<view slot="body">
|
||||
<view class="detail">
|
||||
<view class="header">
|
||||
<view class="header-title">{{ project }}
|
||||
<view class="header-title-extra">用能</view>
|
||||
<view class="header-title"
|
||||
>{{ project.name }}
|
||||
<!-- <view class="header-title-extra">用能</view> -->
|
||||
</view>
|
||||
<view class="header-des">项目详情。。。。。。。。</view>
|
||||
<view class="header-des">{{ project.description }}</view>
|
||||
</view>
|
||||
<view class="nav">
|
||||
<view class="nav-menu " :class="{ 'nav-menu-active': navMenuActive == index }"
|
||||
v-for="(item, index) in navMenuList" :key="index" @click="navMenuClick(index)">{{ item.text }}
|
||||
<view
|
||||
class="nav-menu"
|
||||
:class="{ 'nav-menu-active': navMenuActive == index }"
|
||||
v-for="(item, index) in navMenuList"
|
||||
:key="index"
|
||||
@click="navMenuClick(index)"
|
||||
>{{ item.text }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="content device" :style="{ minHeight: 'calc(100vh - ' + navHeight + 'px)' }">
|
||||
<view v-show="navMenuActive == 0">
|
||||
<uni-card :title="'设备' + item" :sub-title="project" extra="用能" v-for="item in 2" :key="item"
|
||||
@click="goDevice" padding="0" thumbnail="/static/device.png">
|
||||
<uni-card
|
||||
:title="item.equipmentName"
|
||||
sub-title="创建时间"
|
||||
v-for="item in store.data"
|
||||
:key="item.equipmentId"
|
||||
@click="goDevice"
|
||||
padding="0"
|
||||
thumbnail="/static/device.png"
|
||||
>
|
||||
</uni-card>
|
||||
<Cn-empty v-if="store.empty"></Cn-empty>
|
||||
<uni-load-more v-if="store.data && store.data.length > 0" :status="store.status"></uni-load-more>
|
||||
</view>
|
||||
<view style="padding: 0 20rpx" v-show="navMenuActive == 1">
|
||||
<uni-list>
|
||||
<uni-list-item title="张三" note="2023-02-10 14:55" thumb="/static/head.png" thumb-size="lg">
|
||||
<template v-slot:footer>
|
||||
<view class="footer-btn mt20" style="background:#e47470" @click="del">移除</view>
|
||||
<view class="footer-btn mt20" style="background: #e47470" @click="del">移除</view>
|
||||
<!-- <view class="footer-btn mt20 ml10" @click="goUserDetail">查看</view> -->
|
||||
</template>
|
||||
</uni-list-item>
|
||||
<uni-list-item title="李四" note="2023-02-10 14:55" thumb="/static/head.png" thumb-size="lg">
|
||||
<template v-slot:footer>
|
||||
<view class="footer-btn mt20" style="background:#e47470" @click="del">移除</view>
|
||||
<view class="footer-btn mt20" style="background: #e47470" @click="del">移除</view>
|
||||
<!-- <view class="footer-btn mt20 ml10" @click="goUserDetail">查看</view> -->
|
||||
</template>
|
||||
</uni-list-item>
|
||||
</uni-list>
|
||||
</view>
|
||||
<view style="padding: 0 20rpx" v-show="navMenuActive == 2">
|
||||
<image class="gplot gplot-box" mode="aspectFill" src="/static/test2.pic.png"
|
||||
v-for="(item, key) in 3" :key="key" />
|
||||
<!-- <image
|
||||
class="gplot gplot-box"
|
||||
mode="aspectFill"
|
||||
:src="item.filePath"
|
||||
v-for="(item, key) in topologyDiagramPage"
|
||||
:key="key"
|
||||
/> -->
|
||||
<uni-file-picker
|
||||
v-model="topologyDiagramPage"
|
||||
:sourceType="['album']"
|
||||
@select="addAppTopologyDiagram"
|
||||
@delete="deleteTopologyDiagramPage"
|
||||
></uni-file-picker>
|
||||
</view>
|
||||
<uni-load-more status="nomore"></uni-load-more>
|
||||
</view>
|
||||
<uni-fab ref="fab" direction="vertical" horizontal="right" vertical="bottom" :content="content"
|
||||
@trigger="trigger" v-if="content.length" />
|
||||
<uni-fab
|
||||
ref="fab"
|
||||
direction="vertical"
|
||||
horizontal="right"
|
||||
vertical="bottom"
|
||||
:content="content"
|
||||
@trigger="trigger"
|
||||
v-if="content.length"
|
||||
/>
|
||||
<uni-popup ref="share" type="share" background-color="#fff">
|
||||
<uni-popup-share title="分享到"></uni-popup-share>
|
||||
</uni-popup>
|
||||
@@ -51,44 +83,70 @@
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import list from '../../common/js/list'
|
||||
import { queryTopologyDiagramPage, deleteAppTopologyDiagram, addAppTopologyDiagram } from '../../common/api/project'
|
||||
export default {
|
||||
data () {
|
||||
mixins: [list],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
project: '',
|
||||
navMenuList: [{
|
||||
text: '设备'
|
||||
}, {
|
||||
text: '子用户'
|
||||
}, {
|
||||
text: '拓扑图'
|
||||
}],
|
||||
project: {},
|
||||
navMenuList: [
|
||||
{
|
||||
text: '设备',
|
||||
},
|
||||
{
|
||||
text: '子用户',
|
||||
},
|
||||
{
|
||||
text: '拓扑图',
|
||||
},
|
||||
],
|
||||
content: [],
|
||||
navHeight: 0,
|
||||
navMenuActive: 0
|
||||
navMenuActive: 0,
|
||||
topologyDiagramPage: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
trigger (e) {
|
||||
console.log(this.$refs);
|
||||
addAppTopologyDiagram(e) {
|
||||
console.log(e)
|
||||
addAppTopologyDiagram(
|
||||
{
|
||||
projectId: this.project.id,
|
||||
topologyDiagramName: e.tempFiles[0].name,
|
||||
},
|
||||
e.tempFiles[0].path
|
||||
).then((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
deleteTopologyDiagramPage(e) {
|
||||
console.log(e)
|
||||
deleteAppTopologyDiagram(e.tempFile.id).then((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
trigger(e) {
|
||||
console.log(this.$refs)
|
||||
if (e.item.text == '移交') {
|
||||
uni.navigateTo({
|
||||
url: '/pages/project/transfer'
|
||||
url: '/pages/project/transfer',
|
||||
})
|
||||
} else if (e.item.text == '分享') {
|
||||
this.$refs.share.open()
|
||||
}
|
||||
},
|
||||
navMenuClick (index) {
|
||||
navMenuClick(index) {
|
||||
this.navMenuActive = index
|
||||
},
|
||||
goUserDetail () {
|
||||
goUserDetail() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/mine/userDetail'
|
||||
url: '/pages/mine/userDetail',
|
||||
})
|
||||
},
|
||||
del () {
|
||||
console.log('del');
|
||||
del() {
|
||||
console.log('del')
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要移除该成员吗?',
|
||||
@@ -98,18 +156,35 @@ export default {
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
goDevice () {
|
||||
goDevice() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/APF/detail'
|
||||
url: '/pages/device/APF/detail',
|
||||
})
|
||||
},
|
||||
init() {
|
||||
this.store = this.DataSource('/EquipmentDelivery/queryEquipmentByProject')
|
||||
this.store.params.projectId = this.project.id
|
||||
this.store.reload()
|
||||
|
||||
queryTopologyDiagramPage({
|
||||
projectId: this.project.id,
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
this.topologyDiagramPage = res.data.records.map((item) => {
|
||||
return {
|
||||
name: item.name,
|
||||
extname: 'img',
|
||||
url: item.filePath,
|
||||
...item,
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
onLoad (option) {
|
||||
this.project = option.project
|
||||
onLoad(option) {
|
||||
let userInfo = uni.getStorageSync('userInfo')
|
||||
if (userInfo.role == '3') {
|
||||
this.content.push({
|
||||
@@ -124,15 +199,20 @@ export default {
|
||||
}
|
||||
setTimeout(() => {
|
||||
// 获取nav高度
|
||||
uni.createSelectorQuery().select('.nav').boundingClientRect((rect) => {
|
||||
this.navHeight = rect.height
|
||||
}).exec()
|
||||
}, 1000);
|
||||
uni.createSelectorQuery()
|
||||
.select('.nav')
|
||||
.boundingClientRect((rect) => {
|
||||
this.navHeight = rect.height
|
||||
})
|
||||
.exec()
|
||||
}, 1000)
|
||||
this.project = JSON.parse(option.project)
|
||||
this.init()
|
||||
// uni.setNavigationBarTitle({ title: this.project })
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
<style lang="scss">
|
||||
.detail {
|
||||
.content {
|
||||
box-sizing: border-box;
|
||||
@@ -162,7 +242,6 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.footer-btn {
|
||||
padding: 0 20rpx;
|
||||
height: 50rpx;
|
||||
@@ -173,11 +252,15 @@ export default {
|
||||
line-height: 50rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
/deep/ .is-add {
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.gplot {
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
border: 8rpx solid #ccc;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user