首页标题
This commit is contained in:
@@ -83,7 +83,6 @@ page {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.grid-card {
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 20rpx;
|
||||
@@ -136,7 +135,6 @@ page {
|
||||
grid-template-columns: 1fr 2fr 2fr;
|
||||
}
|
||||
|
||||
|
||||
.grid-card-content-5 {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
@@ -147,33 +145,31 @@ page {
|
||||
}
|
||||
|
||||
.index {
|
||||
|
||||
.header {
|
||||
margin: 0 20rpx;
|
||||
background: $uni-theme-blue;
|
||||
border-radius: 12rpx;
|
||||
padding: 30rpx 10rpx 40rpx;
|
||||
display: grid;
|
||||
grid-gap: 60rpx 0;
|
||||
grid-gap: 20rpx;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
|
||||
.header-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #fff;
|
||||
padding: 10rpx 10rpx 20rpx;
|
||||
color: #111;
|
||||
font-size: 28rpx;
|
||||
|
||||
background: #fff;
|
||||
border-radius: 12rpx;
|
||||
.header-item-value {
|
||||
font-size: 40rpx;
|
||||
margin-bottom: 10rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.header-item-label{
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.nav {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
@@ -196,10 +192,9 @@ page {
|
||||
|
||||
&-active {
|
||||
background: #dfe5f7;
|
||||
color: $uni-theme-blue;
|
||||
color: $uni-theme-color;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.btn {
|
||||
@@ -207,7 +202,7 @@ page {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
@@ -218,7 +213,7 @@ page {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 40rpx;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 60rpx;
|
||||
font-size: 24rpx;
|
||||
@@ -260,7 +255,6 @@ page {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
.popup-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -13,6 +13,7 @@ export default (options = {}) => {
|
||||
reject({
|
||||
code: -1,
|
||||
msg: '请勿重复提交',
|
||||
data:options.url
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
"/api" : {
|
||||
"https" : true,
|
||||
// "target" : "https://china.indpecker.com",
|
||||
"target" : "http://192.168.1.115:10215",
|
||||
"target" : "http://192.168.1.13:10215",
|
||||
"changOrigin" : true,
|
||||
"pathRewrite" : {
|
||||
"/api" : ""
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "灿能电力"
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -200,7 +200,7 @@ export default {
|
||||
|
||||
|
||||
// &-active {
|
||||
// background: $uni-theme-blue;
|
||||
// background: $uni-theme-color;
|
||||
// color: #fff;
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -361,7 +361,7 @@ export default {
|
||||
console.log(res)
|
||||
this.$util.toast('提交成功')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({ delta: 1 })
|
||||
uni.navigateBack({ delta: 2 })
|
||||
}, 1500)
|
||||
})
|
||||
},
|
||||
@@ -378,7 +378,7 @@ export default {
|
||||
justify-content: center;
|
||||
margin: 80rpx auto 0;
|
||||
width: 320rpx;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
@@ -422,7 +422,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
border: 8rpx solid $uni-theme-blue;
|
||||
border: 8rpx solid $uni-theme-color;
|
||||
// background: rgba(3, 3, 3, .5);
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
@@ -372,7 +372,7 @@ export default {
|
||||
justify-content: center;
|
||||
margin: 80rpx auto 0;
|
||||
width: 320rpx;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
@@ -416,7 +416,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
border: 8rpx solid $uni-theme-blue;
|
||||
border: 8rpx solid $uni-theme-color;
|
||||
// background: rgba(3, 3, 3, .5);
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
@@ -70,7 +70,7 @@ export default {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
background-color: $uni-theme-blue;
|
||||
background-color: $uni-theme-color;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
|
||||
@@ -157,7 +157,7 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
@@ -127,7 +127,7 @@ export default {
|
||||
justify-content: center;
|
||||
margin: 80rpx auto 0;
|
||||
width: 320rpx;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
@@ -165,7 +165,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
border: 8rpx solid $uni-theme-blue;
|
||||
border: 8rpx solid $uni-theme-color;
|
||||
// background: rgba(3, 3, 3, .5);
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
@@ -264,7 +264,7 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
@@ -283,7 +283,7 @@ export default {
|
||||
justify-content: center;
|
||||
margin: 80rpx auto 0;
|
||||
width: 320rpx;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
@@ -321,7 +321,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
border: 8rpx solid $uni-theme-blue;
|
||||
border: 8rpx solid $uni-theme-color;
|
||||
// background: rgba(3, 3, 3, .5);
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
@@ -123,7 +123,7 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
@@ -96,7 +96,7 @@ export default {
|
||||
margin-left: 20rpx;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
<template>
|
||||
<view class="device">
|
||||
<view class="nav">
|
||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.engineeringName }" @click="openDrawer"
|
||||
<view class="nav" :style="{ top: navHeight + 'px' }">
|
||||
<!-- <view class="nav-menu" :class="{ 'nav-menu-active': select.engineeringName }" @click="openDrawer"
|
||||
>{{ select.engineeringName || '工程' }}
|
||||
</view>
|
||||
</view> -->
|
||||
<picker
|
||||
@change="projectNameChange"
|
||||
:value="select.projectNameIndex"
|
||||
:range="projectList"
|
||||
range-key="text"
|
||||
v-if="engineeringList.length"
|
||||
v-if="store.params.engineerId"
|
||||
>
|
||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }"
|
||||
>{{ select.projectName || '项目' }}
|
||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }">
|
||||
{{ select.projectName || '项目' }}
|
||||
<uni-icons type="bottom" size="14" color="#666"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
<!-- <picker @change="projectTypeChange" :value="select.projectTypeIndex" :range="projectType" range-key="text">
|
||||
@@ -40,21 +41,11 @@
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
</view>
|
||||
<uni-drawer ref="showRight" mode="right" :mask-click="false" :width="375">
|
||||
<uni-indexed-list
|
||||
:options="engineeringListFilter"
|
||||
:showSelect="false"
|
||||
@click="closeDrawer"
|
||||
></uni-indexed-list>
|
||||
</uni-drawer>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getProjectList } from '@/common/api/project'
|
||||
import { queryDictData } from '@/common/api/dictionary'
|
||||
import { queryEngineering } from '@/common/api/engineering.js'
|
||||
import { pinyin } from 'pinyin-pro'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
store: {
|
||||
@@ -70,35 +61,15 @@ export default {
|
||||
projectNameIndex: 0,
|
||||
projectType: '',
|
||||
projectTypeIndex: 0,
|
||||
engineeringName: '',
|
||||
engineeringId: '',
|
||||
},
|
||||
navHeight: 0,
|
||||
minHeight: '',
|
||||
engineeringList: [],
|
||||
projectList: [],
|
||||
projectType: [],
|
||||
navHeight: 0,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
engineeringListFilter() {
|
||||
let result = []
|
||||
this.engineeringList.forEach((item) => {
|
||||
let arr = pinyin(item.name[0], { toneType: 'none', type: 'array' })
|
||||
let letter = arr[0][0].toUpperCase()
|
||||
console.log(letter)
|
||||
let index = result.findIndex((item) => item.letter === letter)
|
||||
if (index === -1) {
|
||||
result.push({
|
||||
letter,
|
||||
data: [item.name],
|
||||
})
|
||||
} else {
|
||||
result[index].data.push(item.name)
|
||||
}
|
||||
})
|
||||
return result
|
||||
},
|
||||
deviceListFilter() {
|
||||
return this.store.data.filter((item) => {
|
||||
if (this.select.projectName && this.select.projectType) {
|
||||
@@ -113,61 +84,46 @@ export default {
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
// 获取nav高度
|
||||
uni.createSelectorQuery()
|
||||
.select('.nav')
|
||||
.boundingClientRect((rect) => {
|
||||
this.navHeight = rect.height
|
||||
// #ifdef H5
|
||||
this.minHeight = 'calc(100vh - env(safe-area-inset-bottom) - ' + (50 + this.navHeight) + 'px)'
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.minHeight = 'calc(100vh - ' + this.navHeight + 'px)'
|
||||
// #endif
|
||||
.select('.uni-navbar')
|
||||
.boundingClientRect((rect1) => {
|
||||
this.navHeight = rect1.height
|
||||
// 获取nav高度
|
||||
uni.createSelectorQuery()
|
||||
.select('.nav')
|
||||
.boundingClientRect((rect2) => {
|
||||
// #ifdef H5
|
||||
this.minHeight =
|
||||
'calc(100vh - env(safe-area-inset-bottom) - ' +
|
||||
(50 + (rect2.height + rect1.height)) +
|
||||
'px)'
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.minHeight = 'calc(100vh - ' + (rect2.height + rect1.height) + 'px)'
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
})
|
||||
.exec()
|
||||
}, 1000)
|
||||
},
|
||||
methods: {
|
||||
async init() {
|
||||
let engineering = uni.getStorageSync('engineering')
|
||||
let res = await queryEngineering()
|
||||
this.engineeringList = res.data
|
||||
if (this.engineeringList.length === 0) {
|
||||
return
|
||||
}
|
||||
if (!engineering) {
|
||||
uni.setStorageSync('engineering', res.data[0])
|
||||
this.select.engineeringName = res.data[0].name
|
||||
this.select.engineeringId = res.data[0].id
|
||||
} else {
|
||||
if (this.engineeringList.findIndex((item) => item.id === engineering.id) === -1) {
|
||||
uni.setStorageSync('engineering', res.data[0])
|
||||
this.select.engineeringName = res.data[0].name
|
||||
this.select.engineeringId = res.data[0].id
|
||||
}else{
|
||||
this.select.engineeringName = engineering.name
|
||||
this.select.engineeringId = engineering.id
|
||||
}
|
||||
}
|
||||
this.getProjectList()
|
||||
this.getDeviceList()
|
||||
},
|
||||
getDeviceList() {
|
||||
this.store.params.pageSize = 999
|
||||
this.store.params.engineerId = this.select.engineeringId
|
||||
this.store.reload()
|
||||
},
|
||||
getProjectList() {
|
||||
getProjectList({
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
engineeringId: this.select.engineeringId,
|
||||
engineeringId: this.store.params.engineerId,
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
let arr = [
|
||||
@@ -202,37 +158,6 @@ export default {
|
||||
]
|
||||
})
|
||||
},
|
||||
closeDrawer(e) {
|
||||
console.log(e)
|
||||
this.engineeringList.forEach((item) => {
|
||||
if (item.name === e.item.name) {
|
||||
uni.setStorageSync('engineering', item)
|
||||
this.select.engineeringName = item.name
|
||||
this.select.engineeringId = item.id
|
||||
}
|
||||
})
|
||||
this.getDeviceList()
|
||||
this.getProjectList()
|
||||
this.select.projectName = ''
|
||||
this.select.projectNameIndex = 0
|
||||
this.$refs.showRight.close()
|
||||
},
|
||||
openDrawer(item) {
|
||||
if (this.engineeringList.length === 0) {
|
||||
uni.showToast({
|
||||
title: '暂无工程',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
} else if (this.engineeringList.length === 1) {
|
||||
uni.showToast({
|
||||
title: '暂无其他工程',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
this.$refs.showRight.open()
|
||||
},
|
||||
submitFeedBack() {
|
||||
uni.navigateTo({ url: '/pages/home/feedback' })
|
||||
},
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<view class="index-zhuanzhi">
|
||||
<view class="canneng-index-title mb20">所有工程统计信息</view>
|
||||
<div class="header">
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.allDevCount || 0 }}</div>
|
||||
@@ -13,7 +14,38 @@
|
||||
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
|
||||
<div class="header-item-label">报警设备</div>
|
||||
</div>
|
||||
<div class="header-item" @click="jump('offLineDevs')">
|
||||
<div class="header-item" @click="jump('offLineDevs')">
|
||||
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
|
||||
<div class="header-item-label">离线设备</div>
|
||||
</div>
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.alarmEventCount || 0 }}</div>
|
||||
<div class="header-item-label">告警数量</div>
|
||||
</div>
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.eventCount || 0 }}</div>
|
||||
<div class="header-item-label">事件数量</div>
|
||||
</div>
|
||||
<div class="header-item" @click="projectNum">
|
||||
<div class="header-item-value">{{ devCount.projectCount || 0 }}</div>
|
||||
<div class="header-item-label">项目个数</div>
|
||||
</div>
|
||||
</div>
|
||||
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
|
||||
<div class="header">
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.allDevCount || 0 }}</div>
|
||||
<div class="header-item-label">设备总数</div>
|
||||
</div>
|
||||
<div class="header-item">
|
||||
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
|
||||
<div class="header-item-label">正常设备</div>
|
||||
</div>
|
||||
<div class="header-item" @click="jump('alarmLineDevs')">
|
||||
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
|
||||
<div class="header-item-label">报警设备</div>
|
||||
</div>
|
||||
<div class="header-item" @click="jump('offLineDevs')">
|
||||
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
|
||||
<div class="header-item-label">离线设备</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,24 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading" noPadding>
|
||||
<view slot="body">
|
||||
<view slot="body" class="canneng-index">
|
||||
<uni-nav-bar
|
||||
rightWidth="300rpx"
|
||||
leftWidth="300rpx"
|
||||
dark
|
||||
:fixed="true"
|
||||
status-bar
|
||||
background-color="#376cf3"
|
||||
color="#fff"
|
||||
@clickRight="openDrawer"
|
||||
>
|
||||
<template slot="left">
|
||||
<text style="font-size: 32rpx; font-weight: 500">灿能物联</text>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<text class="hide-txt mr5" style="font-size: 28rpx">{{ select.engineeringName }}</text>
|
||||
<uni-icons type="bottom" size="16" color="#fff"></uni-icons>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
<view class="index">
|
||||
<!-- 运维 -->
|
||||
<YunWei :devCount="devCount" v-if="userInfo.authorities === 'operation_manager'" />
|
||||
@@ -11,8 +29,20 @@
|
||||
<!-- 主用户 -->
|
||||
<ZhuYongHu :devCount="devCount" v-if="userInfo.authorities === 'app_vip_user'" />
|
||||
<YouKe :devCount="devCount" v-if="userInfo.authorities === 'tourist'"> </YouKe>
|
||||
<view class="canneng-index-title mt20">设备列表</view>
|
||||
<Device ref="device" :store="store" />
|
||||
</view>
|
||||
<uni-drawer ref="showRight" mode="right" :mask-click="false">
|
||||
<uni-nav-bar :fixed="true" status-bar title="选择工程" color="#111"> </uni-nav-bar>
|
||||
<view style="height: 200px"></view>
|
||||
<view>
|
||||
<uni-indexed-list
|
||||
:options="engineeringListFilter"
|
||||
:showSelect="false"
|
||||
@click="closeDrawer"
|
||||
></uni-indexed-list>
|
||||
</view>
|
||||
</uni-drawer>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
@@ -25,6 +55,9 @@ import YouKe from './comp/indexYouKe.vue'
|
||||
import Device from './comp/device.vue'
|
||||
import list from '../../common/js/list'
|
||||
import { getDevCount } from '../../common/api/device.js'
|
||||
import { queryEngineering } from '@/common/api/engineering.js'
|
||||
import { pinyin } from 'pinyin-pro'
|
||||
|
||||
export default {
|
||||
mixins: [list],
|
||||
components: {
|
||||
@@ -40,9 +73,76 @@ export default {
|
||||
loading: false,
|
||||
userInfo: {},
|
||||
devCount: {},
|
||||
select: {
|
||||
engineeringName: '',
|
||||
engineeringId: '',
|
||||
},
|
||||
engineeringList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
engineeringListFilter() {
|
||||
let result = []
|
||||
this.engineeringList.forEach((item) => {
|
||||
let arr = pinyin(item.name[0], { toneType: 'none', type: 'array' })
|
||||
let letter = arr[0][0].toUpperCase()
|
||||
console.log(letter)
|
||||
let index = result.findIndex((item) => item.letter === letter)
|
||||
if (index === -1) {
|
||||
result.push({
|
||||
letter,
|
||||
data: [item.name],
|
||||
})
|
||||
} else {
|
||||
result[index].data.push(item.name)
|
||||
}
|
||||
})
|
||||
return result
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async init() {
|
||||
let engineering = uni.getStorageSync('engineering')
|
||||
let res = await queryEngineering()
|
||||
this.engineeringList = res.data
|
||||
if (this.engineeringList.length === 0) {
|
||||
return
|
||||
}
|
||||
if (!engineering) {
|
||||
uni.setStorageSync('engineering', res.data[0])
|
||||
this.select.engineeringName = res.data[0].name
|
||||
this.select.engineeringId = res.data[0].id
|
||||
} else {
|
||||
if (this.engineeringList.findIndex((item) => item.id === engineering.id) === -1) {
|
||||
uni.setStorageSync('engineering', res.data[0])
|
||||
this.select.engineeringName = res.data[0].name
|
||||
this.select.engineeringId = res.data[0].id
|
||||
} else {
|
||||
this.select.engineeringName = engineering.name
|
||||
this.select.engineeringId = engineering.id
|
||||
}
|
||||
}
|
||||
this.store.params.engineerId = this.select.engineeringId
|
||||
getDevCount(this.select.engineeringId).then((res) => {
|
||||
this.devCount = res.data
|
||||
})
|
||||
this.$refs.device && this.$refs.device.init()
|
||||
},
|
||||
closeDrawer(e) {
|
||||
console.log(e)
|
||||
this.engineeringList.forEach((item) => {
|
||||
if (item.name === e.item.name) {
|
||||
uni.setStorageSync('engineering', item)
|
||||
this.select.engineeringName = item.name
|
||||
this.select.engineeringId = item.id
|
||||
this.store.params.engineerId = item.id
|
||||
}
|
||||
})
|
||||
this.$refs.device.select.projectName = ''
|
||||
this.$refs.device.select.projectNameIndex = 0
|
||||
this.$refs.device.init()
|
||||
this.$refs.showRight.close()
|
||||
},
|
||||
send() {
|
||||
uni.createPushMessage({
|
||||
title: '灿能',
|
||||
@@ -58,14 +158,25 @@ export default {
|
||||
loadingChange(e) {
|
||||
this.loading = e
|
||||
},
|
||||
openDrawer(item) {
|
||||
if (this.engineeringList.length === 0) {
|
||||
uni.showToast({
|
||||
title: '暂无工程',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
} else if (this.engineeringList.length === 1) {
|
||||
uni.showToast({
|
||||
title: '暂无其他工程',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
this.$refs.showRight.open()
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
this.store = this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject')
|
||||
this.store.firstCallBack = () => {
|
||||
getDevCount(this.store.params.engineerId).then((res) => {
|
||||
this.devCount = res.data
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
@@ -79,16 +190,24 @@ export default {
|
||||
text: '6',
|
||||
})
|
||||
}
|
||||
this.$refs.device && this.$refs.device.init()
|
||||
this.init()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.index {
|
||||
padding: 34rpx 0 0;
|
||||
padding: 20rpx 0 0;
|
||||
}
|
||||
.canneng-index-title {
|
||||
padding: 0 20rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/deep/ .uni-card {
|
||||
background: $uni-theme-white;
|
||||
}
|
||||
|
||||
/deep/ .uni-drawer__content {
|
||||
width: 100vw !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -240,7 +240,7 @@ export default {
|
||||
color: #fff;
|
||||
font-weight: 400;
|
||||
border-radius: 16rpx;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
@@ -35,7 +35,7 @@ export default {
|
||||
padding: 20rpx;
|
||||
|
||||
.submit-btn {
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ export default {
|
||||
.login-box-input-btn {
|
||||
width: 200rpx;
|
||||
margin-left: 40rpx;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
@@ -398,7 +398,7 @@ export default {
|
||||
padding: 4rpx 8rpx;
|
||||
}
|
||||
&-active {
|
||||
border: 4rpx solid $uni-theme-blue;
|
||||
border: 4rpx solid $uni-theme-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ export default {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
background-color: $uni-theme-blue;
|
||||
background-color: $uni-theme-color;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
|
||||
@@ -51,7 +51,7 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
@@ -203,7 +203,7 @@ export default {
|
||||
padding: 20rpx;
|
||||
|
||||
.submit-btn {
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ export default {
|
||||
.login-box-input-btn {
|
||||
width: 200rpx;
|
||||
margin-left: 40rpx;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ export default {
|
||||
padding: 20rpx;
|
||||
|
||||
.submit-btn {
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ export default {
|
||||
.login-box-input-btn {
|
||||
width: 200rpx;
|
||||
margin-left: 40rpx;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ export default {
|
||||
padding: 20rpx;
|
||||
|
||||
.submit-btn {
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ export default {
|
||||
.login-box-input-btn {
|
||||
width: 200rpx;
|
||||
margin-left: 40rpx;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ export default {
|
||||
overflow: hidden;
|
||||
|
||||
.login-box-logo {
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
height: 100rpx;
|
||||
width: 100rpx;
|
||||
margin: 0 auto;
|
||||
@@ -239,7 +239,7 @@ export default {
|
||||
.login-box-input-btn {
|
||||
width: 200rpx;
|
||||
margin-left: 40rpx;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ export default {
|
||||
|
||||
.login-box-switch {
|
||||
margin-top: 60rpx;
|
||||
color: $uni-theme-blue;
|
||||
color: $uni-theme-color;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -264,7 +264,7 @@ export default {
|
||||
justify-content: center;
|
||||
margin-top: 80rpx;
|
||||
width: 100%;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
@@ -274,7 +274,7 @@ export default {
|
||||
display: flex;
|
||||
margin-top: 40rpx;
|
||||
font-size: 28rpx;
|
||||
color: $uni-theme-blue;
|
||||
color: $uni-theme-color;
|
||||
}
|
||||
|
||||
.login-box-tips {
|
||||
|
||||
@@ -180,7 +180,7 @@ export default {
|
||||
padding: 20rpx;
|
||||
|
||||
.submit-btn {
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ export default {
|
||||
.login-box-input-btn {
|
||||
width: 200rpx;
|
||||
margin-left: 40rpx;
|
||||
background: $uni-theme-blue;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user