APPbug反馈修改

This commit is contained in:
仲么了
2023-08-10 09:18:17 +08:00
parent 192bd44c7a
commit f395da8f93
48 changed files with 1420 additions and 480 deletions

10
App.vue
View File

@@ -3,7 +3,7 @@ import { queryDictDataCache } from './common/api/dictionary.js'
import encrypt from './common/js/aes.js'
export default {
onLaunch: function () {
console.log(window);
console.log(window)
// this.connect()
console.log('App Launch')
let devCode = uni.getStorageSync('devCode')
@@ -14,9 +14,11 @@ export default {
},
})
}
},
onShow: function () {
console.log('App Show')
if (!uni.getStorageSync(this.$cacheKey.userInfo)) {
uni.reLaunch({
url: '/pages/login/login',
})
}
queryDictDataCache().then((res) => {
uni.setStorageSync(this.$cacheKey.dictData, res.data)
})

View File

@@ -94,7 +94,7 @@ export const transferDevice = (id) => {
url: '/cs-device-boot/deviceUser/transfer',
method: 'POST',
data: {
eid: id,
ids: id,
},
})
}

View File

@@ -48,3 +48,23 @@ export function deleteEngineering(id) {
},
})
}
// 查询工程配置列表
export function queryAllEnginner(params) {
return request({
url: '/cs-device-boot/csMarketData/queryAllEnginner',
method: 'post',
})
}
// 更新工程配置
export function csMarketDataAdd(params) {
return request({
url: '/cs-device-boot/csMarketData/follow',
method: 'post',
data: params,
header: {
'Content-Type': 'application/json',
},
})
}

View File

@@ -2,25 +2,41 @@ import request from '../js/request'
import config from '../js/config'
export function addAppProject(params, files) {
return uni.uploadFile({
url: config.domain + '/cs-device-boot/project/addAppProject', //仅为示例,非真实的接口地址
files: files,
header: {
Authorization: uni.getStorageSync('access_token'),
},
formData: params,
})
if (files.length === 0) {
return request({
url: '/cs-device-boot/project/addAppProject',
method: 'post',
data: params,
})
} else {
return uni.uploadFile({
url: config.domain + '/cs-device-boot/project/addAppProject', //仅为示例,非真实的接口地址
files: files,
header: {
Authorization: uni.getStorageSync('access_token'),
},
formData: params,
})
}
}
// 修改项目
export function updateAppProject(params, files) {
return uni.uploadFile({
url: config.domain + '/cs-device-boot/project/auditAppProject', //仅为示例,非真实的接口地址
files: files,
header: {
Authorization: uni.getStorageSync('access_token'),
},
formData: params,
})
if (files.length === 0) {
return request({
url: '/cs-device-boot/project/updateAppProject',
method: 'post',
data: params,
})
}else{
return uni.uploadFile({
url: config.domain + '/cs-device-boot/project/auditAppProject', //仅为示例,非真实的接口地址
files: files,
header: {
Authorization: uni.getStorageSync('access_token'),
},
formData: params,
})
}
}
export function getProjectList(params) {
@@ -101,4 +117,3 @@ export function addAppTopologyDiagram(params, filePath) {
),
})
}

View File

@@ -149,22 +149,22 @@ page {
margin: 0 20rpx;
display: grid;
grid-gap: 20rpx;
grid-template-columns: 1fr 1fr 1fr;
grid-template-columns: 1fr 1fr 1fr 1fr;
.header-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 10rpx 10rpx 20rpx;
color: #111;
color: #fff;
font-size: 28rpx;
background: #fff;
background: $uni-theme-color;
border-radius: 12rpx;
.header-item-value {
font-size: 32rpx;
}
.header-item-label{
font-size: 28rpx;
.header-item-label {
font-size: 24rpx;
}
}
}
@@ -182,18 +182,21 @@ page {
z-index: 2;
.nav-menu {
padding: 10rpx 20rpx;
padding: 6rpx 20rpx;
margin-left: 20rpx;
margin-bottom: 20rpx;
font-size: 28rpx;
font-size: 24rpx;
border-radius: 8rpx;
background: #ebeaec;
color: #666;
&-active {
background: #dfe5f7;
color: $uni-theme-color;
}
&-btn {
background: $uni-theme-color;
color: #fff;
}
}
}

View File

@@ -1,23 +1,23 @@
export default {
onPullDownRefresh() {
this.store && this.store.reload();
this.store && this.store.reload()
this.store.loadedCallback = () => {
uni.stopPullDownRefresh();
};
uni.stopPullDownRefresh()
}
},
onReachBottom() {
if (this.store.status != 'noMore') {
this.store.next && this.store.next();
this.store.next && this.store.next()
}
},
data() {
return {
store: {},
};
}
},
methods: {
DataSource(url) {
var me = this;
var me = this
return {
data: [],
status: 'more',
@@ -31,11 +31,11 @@ export default {
pageSize: 20,
},
reload() {
this.data = [];
this.status = 'loading';
this.empty = false;
this.params.pageNum = 1;
this.next();
this.data = []
this.status = 'loading'
this.empty = false
this.params.pageNum = 1
this.next()
},
callBack: null,
firstCallBack: null,
@@ -47,37 +47,35 @@ export default {
header: this.header,
method: 'POST',
}).then((res) => {
console.warn(res);
let resultData =
res.data?.list || res.data?.records || [];
console.warn(res)
let resultData = res.data?.list || res.data?.records || []
if (this.params.pageNum == 1) {
this.data = resultData;
this.data = resultData
if (resultData.length == 0 || resultData == 0) {
this.empty = true;
} else if (
resultData.length < this.params.pageSize
) {
this.status = 'noMore';
this.empty = true
this.status = 'noMore'
} else if (resultData.length < this.params.pageSize) {
this.status = 'noMore'
} else if (res.total == resultData.length) {
this.status = 'noMore';
this.status = 'noMore'
}
} else {
this.data.push(...resultData);
this.data.push(...resultData)
if (resultData.length < this.params.pageSize) {
this.status = 'noMore';
this.status = 'noMore'
}
}
if (this.params.pageNum == 1) {
this.firstCallBack && this.firstCallBack();
this.firstCallBack && this.firstCallBack()
}
this.loadedCallback && this.loadedCallback();
this.params.pageNum++;
this.total = res.total;
this.loading = false;
});
this.loadedCallback && this.loadedCallback()
this.params.pageNum++
this.total = res.total
this.loading = false
})
},
};
}
},
},
};
}

View File

@@ -24,6 +24,7 @@ export default (options = {}) => {
}
uni.request({
url,
timeout: 5000,
data: {
...options.data,
},
@@ -65,6 +66,7 @@ export default (options = {}) => {
* @param {Number} code 错误码
*/
function errHandler(res) {
console.log(res);
switch (res.code) {
case 'A0024':
uni.reLaunch({ url: '/pages/user/login' })

View File

@@ -33,7 +33,7 @@ export default {
position: relative;
width: 80rpx;
height: 80rpx;
background: $uni-theme-yellow;
background: $uni-theme-color;
border-radius: 20rpx;
.grid-card-content-item-icon-2 {
@@ -64,7 +64,7 @@ export default {
text-align: center;
margin-top: 16rpx;
color: #111;
font-size: 28rpx;
font-size: 24rpx;
}
}
</style>

View File

@@ -2,8 +2,8 @@
"name" : "灿能物联",
"appid" : "__UNI__88BC25B",
"description" : "",
"versionName" : "1.0.4",
"versionCode" : 103,
"versionName" : "1.0.7",
"versionCode" : 107,
"transformPx" : false,
/* 5+App */
"app-plus" : {
@@ -132,7 +132,7 @@
"/api" : {
"https" : true,
// "target" : "https://china.indpecker.com",
"target" : "http://192.168.1.13:10215",
"target" : "http://192.168.1.139:10215",
"changOrigin" : true,
"pathRewrite" : {
"/api" : ""

View File

@@ -4,8 +4,23 @@
{
"path": "pages/index/index",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
"app-plus": {
"bounce": "none", //关闭窗口回弹效果
"titleNView": {
"titleText": "灿能物联", // 窗口的标题
"titleAlign": "left",
"padding-left": "16rpx",
"padding-right": "20rpx",
"buttons": [
{
"text": "请选择工程",
"fontSize": "28rpx",
"select": true,
"width": "auto"
}
]
}
}
}
},
{
@@ -317,6 +332,12 @@
"navigationBarTitleText": "工程详情"
}
},
{
"path": "pages/engineering/setting",
"style": {
"navigationBarTitleText": "关注工程配置"
}
},
{
"path": "pages/user/erweima",
"style": {

View File

@@ -137,9 +137,9 @@ export default {
{
text: '功率',
},
{
text: '波形',
},
// {
// text: '波形',
// },
{
text: 'I/O',
},
@@ -238,56 +238,29 @@ export default {
uni.pageScrollTo({ scrollTop: 0, duration: 0 })
},
init() {
switch (this.userInfo.authorities) {
case 1:
this.content.splice(0, 1)
this.content.splice(
0,
0,
{
iconPath: '/static/version.png',
text: '版本',
},
{
iconPath: '/static/template.png',
text: '模版',
},
)
break
case 2:
this.content.splice(0, 1)
break
case 4:
this.content.splice(
1,
0,
{
iconPath: '/static/delate.png',
text: '报表',
},
{
iconPath: '/static/feedback.png',
text: '反馈',
},
)
break
case 5:
this.content.splice(
2,
0,
{
iconPath: '/static/table.png',
text: '报表',
},
{
iconPath: '/static/feedback.png',
text: '反馈',
},
)
break
default:
break
if (this.isPrimaryUser == 1) {
this.content.splice(
0,
0,
{
iconPath: '/static/transfer.png',
text: '移交',
},
{
iconPath: '/static/feedback.png',
text: '编辑',
},
{
iconPath: '/static/delate.png',
text: '删除',
},
)
if (this.userInfo.authorities === 'app_vip_user') {
this.content.splice(3, 0, {
iconPath: '/static/share.png',
text: '分享',
})
}
}
},
renderFinish(e) {
@@ -387,26 +360,7 @@ export default {
this.devId = options.id
this.isPrimaryUser = options.isPrimaryUser
if (this.isPrimaryUser == 1) {
this.content.splice(0, 0, {
iconPath: '/static/delate.png',
text: '删除',
})
this.content.splice(0, 0, {
iconPath: '/static/feedback.png',
text: '编辑',
})
this.content.splice(0, 0, {
iconPath: '/static/transfer.png',
text: '移交',
})
if (this.userInfo.authorities !== 'engineering_user') {
this.content.splice(0, 0, {
iconPath: '/static/share.png',
text: '分享',
})
}
}
this.init()
queryTopologyDiagram(options.id).then((res) => {
this.deviceInfo = res.data

View File

@@ -5,7 +5,7 @@
<Cn-empty v-if="projectList.length == 0"></Cn-empty>
<template v-else>
<uni-card
:title="item.equipmentName"
:title="item.name"
:sub-title="item.projectName"
:extra="item.projectType"
padding="0"
@@ -76,6 +76,7 @@ export default {
</script>
<style lang="scss">
.device-list {
padding-top: 20rpx;
.header {
position: sticky;
top: 0;

View File

@@ -93,14 +93,14 @@ export default {
// },
],
content: [
{
iconPath: '/static/share.png',
text: '编辑',
},
{
iconPath: '/static/delate.png',
text: '删除',
},
// {
// iconPath: '/static/share.png',
// text: '编辑',
// },
// {
// iconPath: '/static/delate.png',
// text: '删除',
// },
],
navHeight: 0,
navMenuActive: 0,
@@ -177,16 +177,17 @@ export default {
onLoad(option) {
this.engineering = JSON.parse(decodeURIComponent(option.engineering))
let userInfo = uni.getStorageSync('userInfo')
if (userInfo.authorities == '3') {
this.content.push({
iconPath: '/static/transfer.png',
text: '移交',
})
} else if (userInfo.authorities == '4') {
this.content.push({
iconPath: '/static/share.png',
text: '分享',
})
if (userInfo.authorities == 'engineering_user' || userInfo.authorities == 'app_vip_user') {
this.content.push(
{
iconPath: '/static/share.png',
text: '编辑',
},
{
iconPath: '/static/delate.png',
text: '删除',
},
)
}
setTimeout(() => {
// 获取nav高度

View File

@@ -6,7 +6,11 @@
:fixed="true"
status-bar
left-icon="left"
:rightIcon="userInfo.authorities == '2' ? '' : 'plusempty'"
:rightIcon="
userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'
? 'plusempty'
: ''
"
background-color="#fff"
color="#111"
title="工程管理"
@@ -50,17 +54,17 @@ export default {
},
methods: {
init() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
this.store = this.DataSource('/cs-device-boot/engineering/queryEngineeringPage')
this.store.params.userId = uni.getStorageSync('userInfo').id
this.store.reload()
this.store.firstCallBack = (res) => {
let engineering = uni.getStorageSync('engineering')
if (!engineering) {
uni.setStorageSync('engineering',this.store.data[0])
}else{
uni.setStorageSync('engineering', this.store.data[0])
} else {
this.store.data.forEach((item) => {
if (item.id == engineering.id) {
uni.setStorageSync('engineering',item)
uni.setStorageSync('engineering', item)
}
})
}

View File

@@ -3,6 +3,7 @@
<view slot="body">
<view class="new">
<view class="content">
<page-meta :page-style="'overflow:'+(show?'hidden':'visible')"></page-meta>
<uni-forms :label-width="80">
<uni-forms-item label="工程名称">
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入工程名称" />
@@ -14,7 +15,7 @@
<uni-icons type="location" color="#007aff" size="26" class="ml20"
@click="chooseLocation"></uni-icons>
</view> -->
<uni-data-picker :localdata="localdata" @change="areaChange" v-model="value">
<uni-data-picker :localdata="localdata" @change="areaChange" v-model="value" @popupopened="show=true" @popupclosed="show=false">
</uni-data-picker>
</uni-forms-item>
<uni-forms-item label="描述">
@@ -50,6 +51,7 @@ export default {
province: '',
},
engineering: {},
show: false,
}
},
onLoad(options) {

View File

@@ -0,0 +1,201 @@
<template>
<view :loading="loading">
<uni-search-bar v-model="keyWord" bgColor="#fff" placeholder="请输入关键词"></uni-search-bar>
<view class="message">
<!-- <uni-card
:title="item.engineerName"
:extra="item.projectType"
@click="jump(item)"
v-for="(item, index) in list"
:key="index"
>
<view class="term-list-bottom">
<view class="term-list-bottom-item">
<view>区域</view>
<view>{{ item.provinceName + item.cityName }}</view>
</view>
<view class="term-list-bottom-item">
<view>创建时间</view>
<view>{{ item.createTime }}</view>
</view>
</view>
</uni-card> -->
<uni-list>
<uni-list-item @click="jump(item)" v-for="(item, index) in filterList" :key="index">
<template v-slot:header>
<view class="slot-box">
<view class="slot-box-left hide-txt mr20">{{ item.engineerName }}</view>
<switch
:checked="selectList.indexOf(item.engineerId) > -1"
style="transform: scale(0.8)"
@change="switchChange(item)"
/>
</view>
</template>
</uni-list-item>
</uni-list>
<uni-load-more v-if="list && list.length > 0" status="nomore"></uni-load-more>
<Cn-empty v-else style="padding-top: 300rpx"></Cn-empty>
</view>
</view>
</template>
<script>
import list from '../../common/js/list'
import { queryAllEnginner, csMarketDataAdd } from '@/common/api/engineering'
export default {
data() {
return {
loading: true,
userInfo: {},
list: [],
selectList: [],
keyWord: '',
}
},
computed: {
filterList() {
return this.list.filter((item) => {
return item.engineerName.indexOf(this.keyWord) > -1
})
},
},
methods: {
switchChange(e) {
console.log(e)
let index = this.selectList.indexOf(e.engineerId)
if (index > -1) {
this.selectList.splice(index, 1)
} else {
this.selectList.push(e.engineerId)
}
csMarketDataAdd({
engineerIds: this.selectList,
}).then((res) => {
console.log(res)
})
},
init() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
queryAllEnginner().then((res) => {
this.list = res.data
console.log(this.list)
this.selectList = res.data.filter((item) => item.isSelect === '1').map((item) => item.engineerId)
console.log(this.selectList)
this.loading = false
})
},
back() {
uni.navigateBack()
},
add() {
uni.navigateTo({
url: `/pages/engineering/new`,
})
},
upgrade(code) {
console.log(code)
uni.showToast({
title: '升级成功',
icon: 'none',
})
},
jump(engineering) {
uni.navigateTo({
url: `/pages/engineering/detail?engineering=${encodeURIComponent(JSON.stringify(engineering))}`,
})
},
},
onLoad() {
this.init()
},
}
</script>
<style lang="scss">
.message {
/deep/ .slot-box {
width: 100%;
display: flex;
align-items: center;
&-left {
flex: 1;
margin-right: 20rpx;
}
}
/deep/ .uni-list-item__content {
padding-right: 0;
}
.message-header {
padding: 200rpx 34rpx 34rpx;
display: flex;
align-items: center;
background: $uni-theme-white;
margin-bottom: 20rpx;
box-shadow: 0 4rpx 8rpx #e7e7e74c;
.message-header-head {
margin-right: 30rpx;
height: 128rpx;
width: 128rpx;
border-radius: $uni-theme-radius;
overflow: hidden;
}
.message-header-name {
margin-right: 30rpx;
flex: 1;
font-size: 36rpx;
color: #111;
font-weight: 700;
.tag {
margin-top: 10rpx;
font-size: 24rpx;
color: #aaa;
}
}
}
.message-nav {
padding: 34rpx;
display: flex;
align-items: center;
background: $uni-theme-white;
border-bottom: 1rpx solid #e8e8e8;
&-icon {
margin-right: 30rpx;
height: 44rpx;
width: 44rpx;
border-radius: $uni-theme-radius;
overflow: hidden;
}
&-label {
margin-right: 30rpx;
flex: 1;
font-size: 28rpx;
color: #111;
}
}
}
.term-list-bottom {
.term-list-bottom-item {
font-size: 28rpx;
margin-bottom: 20rpx;
display: flex;
justify-content: space-between;
// view:first-of-type{
// color: #111;
// }
}
.term-list-bottom-item:last-of-type {
margin-bottom: 0;
}
}
</style>

View File

@@ -16,6 +16,26 @@
<uni-icons type="bottom" size="14" color="#666"></uni-icons>
</view>
</picker>
<view style="flex: 1"></view>
<template v-if="deviceListFilter.length">
<template v-if="transfer || share">
<view class="nav-menu nav-menu-btn" @click="submit">完成 </view>
</template>
<template v-else>
<view
class="nav-menu nav-menu-btn"
@click="transfer = true"
v-if="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'"
>移交
</view>
<view
class="nav-menu nav-menu-btn"
@click="share = true"
v-if="userInfo.authorities === 'app_vip_user'"
>分享
</view>
</template>
</template>
<!-- <picker @change="projectTypeChange" :value="select.projectTypeIndex" :range="projectType" range-key="text">
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectType }"
>{{ select.projectType || '类型' }}
@@ -31,15 +51,25 @@
v-for="(item, index) in deviceListFilter"
:key="index"
@click="jump(item)"
thumbnail="/static/device.png"
:thumbnail="deviceIcon(item.runStatus)"
>
<!-- <text>{{ item.project }} {{ item.type }}</text> -->
<template v-slot:title v-if="transfer || share">
<view class="switch-title">
<view class="switch-title-left">{{ item.equipmentName }}</view>
<switch
:checked="checkList.indexOf(item.equipmentId) > -1"
style="transform: scale(0.8)"
@change="switchChange(item)"
/>
</view>
</template>
</uni-card>
<Cn-empty v-if="store.empty || deviceListFilter.length == 0"></Cn-empty>
<uni-load-more
v-if="deviceListFilter && deviceListFilter.length > 0"
v-if="store.status == 'loading' || deviceListFilter.length > 0"
:status="store.status"
></uni-load-more>
<Cn-empty v-else></Cn-empty>
</view>
</view>
</template>
@@ -56,6 +86,9 @@ export default {
data() {
return {
loading: false,
transfer: false,
share: false,
checkList: [],
select: {
projectName: '',
projectNameIndex: 0,
@@ -67,6 +100,7 @@ export default {
projectList: [],
projectType: [],
navHeight: 0,
userInfo: {},
}
},
computed: {
@@ -84,39 +118,66 @@ export default {
})
},
},
mounted() {
setTimeout(() => {
// 获取nav高度
uni.createSelectorQuery()
.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)
created() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
},
methods: {
deviceIcon(e) {
let str = ''
switch (e) {
case 1:
str = '/static/device_bad.png'
break
case 2:
str = '/static/device.png'
break
default:
str = '/static/device.png'
break
}
return str
},
switchChange(e) {
console.log(e)
let index = this.checkList.indexOf(e.equipmentId)
if (index > -1) {
this.checkList.splice(index, 1)
} else {
this.checkList.push(e.equipmentId)
}
},
submit() {
console.log(this.checkList)
if (this.transfer) {
this.transfer = false
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.checkList.join(',') })
} else if (this.share) {
this.share = false
this.$emit('share', this.shareList)
}
this.checkList = []
},
async init() {
this.getProjectList()
this.getDeviceList()
},
getDeviceList() {
this.store.params.pageSize = 999
this.store.firstCallBack = () => {
// 获取nav高度
uni.createSelectorQuery()
.select('.nav')
.boundingClientRect((rect2) => {
if (!rect2) return
// #ifdef H5
this.minHeight = 'calc(100vh - env(safe-area-inset-bottom) - ' + (50 + rect2.height) + 'px)'
// #endif
// #ifdef APP-PLUS
this.minHeight = 'calc(100vh - ' + rect2.height + 'px)'
// #endif
})
.exec()
}
this.store.reload()
},
getProjectList() {
@@ -214,4 +275,14 @@ export default {
},
}
</script>
<style lang="scss"></style>
<style lang="scss">
/deep/ .switch-title {
display: flex;
align-items: center;
padding: 20rpx 0;
&-left {
flex: 1;
margin-right: 10px;
}
}
</style>

View File

@@ -1,21 +1,40 @@
<template>
<view class="index-zhuyonghu">
<div class="header">
<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>
</div>
<view class="canneng-index-title mb20">所有工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('onLineDevs')">
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('offLineDevs')">
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
</view>
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
}}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('currentOnLineDevs')">
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('currentOffLineDevs')">
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
</view>
<view class="canneng-index-title mt20">常用功能</view>
<view style="padding: 20rpx 20rpx 0">
<Cn-grid title="常用功能">
<Cn-grid title="">
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
<Cn-grid-item src="/static/feedback2.png" text="提交反馈" @click="submitFeedBack"></Cn-grid-item>
@@ -67,22 +86,14 @@ export default {
},
jump(type) {
switch (type) {
case 'alarmLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=alarmLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
})
break
case 'offLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=offLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
})
break
default:
uni.navigateTo({
url:
'/pages/device/list?type=' +
type +
'&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount[type])),
})
break
}
},

View File

@@ -1,19 +1,37 @@
<template>
<view class="index-zhuyonghu">
<div class="header">
<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>
</div>
<view class="canneng-index-title mb20">所有工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('onLineDevs')">
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('offLineDevs')">
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
</view>
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
}}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('currentOnLineDevs')">
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('currentOffLineDevs')">
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
</view>
</view>
</template>
<script>
@@ -27,22 +45,14 @@ export default {
methods:{
jump(type) {
switch (type) {
case 'alarmLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=alarmLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
})
break
case 'offLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=offLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
})
break
default:
uni.navigateTo({
url:
'/pages/device/list?type=' +
type +
'&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount[type])),
})
break
}
},

View File

@@ -1,23 +1,70 @@
<template>
<view class="index-zhuyonghu">
<div class="header">
<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>
</div>
<view class="index-zhuanzhi">
<view class="canneng-index-title mb20">所有工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('onLineDevs')">
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('offLineDevs')">
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.alarmCount || 0 }}</view>
<view class="header-item-label">告警数量</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.eventCount || 0 }}</view>
<view class="header-item-label">事件数量</view>
</view>
<view class="header-item" @click="projectNum">
<view class="header-item-value">{{ devCount.projectCount || 0 }}</view>
<view class="header-item-label">项目个数</view>
</view>
</view>
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
}}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('currentOnLineDevs')">
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('currentOffLineDevs')">
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.currentAlarmCount || 0 }}</view>
<view class="header-item-label">告警数量</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.currentEventCount || 0 }}</view>
<view class="header-item-label">事件数量</view>
</view>
<view class="header-item" @click="projectNum">
<view class="header-item-value">{{ devCount.currentProjectCount || 0 }}</view>
<view class="header-item-label">项目个数</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
loading: false,
}
},
props: {
devCount: {
type: Object,
@@ -25,28 +72,34 @@ export default {
},
},
methods: {
projectWarning() {
uni.navigateTo({
url: '/pages/zhuanzhi/warning',
})
},
projectNum() {
uni.navigateTo({
url: '/pages/project/list',
})
},
jump(type) {
switch (type) {
case 'alarmLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=alarmLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
})
break
case 'offLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=offLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
})
break
default:
uni.navigateTo({
url:
'/pages/device/list?type=' +
type +
'&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount[type])),
})
break
}
},
},
created() {},
}
</script>
<style lang="scss"></style>
<style lang="scss">
.index-zhuanzhi {
}
</style>

View File

@@ -1,21 +1,40 @@
<template>
<view class="index-zhuyonghu">
<div class="header">
<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>
</div>
<view class="canneng-index-title mb20">所有工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('onLineDevs')">
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('offLineDevs')">
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
</view>
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
<view class="header">
<view class="header-item">
<view class="header-item-value">{{
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
}}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('currentOnLineDevs')">
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('currentOffLineDevs')">
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
</view>
<view class="canneng-index-title mt20">常用功能</view>
<view style="padding: 20rpx 20rpx 0">
<Cn-grid title="常用功能">
<Cn-grid title="">
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
<Cn-grid-item src="/static/feedback2.png" text="提交反馈" @click="submitFeedBack"></Cn-grid-item>
@@ -67,22 +86,14 @@ export default {
},
jump(type) {
switch (type) {
case 'alarmLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=alarmLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
})
break
case 'offLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=offLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
})
break
default:
uni.navigateTo({
url:
'/pages/device/list?type=' +
type +
'&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount[type])),
})
break
}
},

View File

@@ -1,67 +1,61 @@
<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>
<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>
<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="header">
<view class="header-item">
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('onLineDevs')">
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('offLineDevs')">
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.alarmCount || 0 }}</view>
<view class="header-item-label">告警数量</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.eventCount || 0 }}</view>
<view class="header-item-label">事件数量</view>
</view>
<view class="header-item" @click="projectNum">
<view class="header-item-value">{{ devCount.projectCount || 0 }}</view>
<view class="header-item-label">项目个数</view>
</view>
</view>
<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>
<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="header">
<view class="header-item">
<view class="header-item-value">{{
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
}}</view>
<view class="header-item-label">设备总数</view>
</view>
<view class="header-item" @click="jump('currentOnLineDevs')">
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
<view class="header-item-label">在线设备</view>
</view>
<view class="header-item" @click="jump('currentOffLineDevs')">
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
<view class="header-item-label">离线设备</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.currentAlarmCount || 0 }}</view>
<view class="header-item-label">告警数量</view>
</view>
<view class="header-item">
<view class="header-item-value">{{ devCount.currentEventCount || 0 }}</view>
<view class="header-item-label">事件数量</view>
</view>
<view class="header-item" @click="projectNum">
<view class="header-item-value">{{ devCount.currentProjectCount || 0 }}</view>
<view class="header-item-label">项目个数</view>
</view>
</view>
</view>
</template>
<script>
@@ -90,22 +84,14 @@ export default {
},
jump(type) {
switch (type) {
case 'alarmLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=alarmLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
})
break
case 'offLineDevs':
uni.navigateTo({
url:
'/pages/device/list?type=offLineDevs&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
})
break
default:
uni.navigateTo({
url:
'/pages/device/list?type=' +
type +
'&projectList=' +
encodeURIComponent(JSON.stringify(this.devCount[type])),
})
break
}
},

View File

@@ -1,7 +1,7 @@
<template>
<Cn-page :loading="loading" noPadding>
<view slot="body" class="canneng-index">
<uni-nav-bar
<!-- <uni-nav-bar
rightWidth="300rpx"
leftWidth="300rpx"
dark
@@ -18,7 +18,7 @@
<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>
</uni-nav-bar> -->
<view class="index">
<!-- 运维 -->
<YunWei :devCount="devCount" v-if="userInfo.authorities === 'operation_manager'" />
@@ -33,8 +33,6 @@
<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"
@@ -78,6 +76,7 @@ export default {
engineeringId: '',
},
engineeringList: [],
drawer: false,
}
},
computed: {
@@ -101,6 +100,16 @@ export default {
},
},
methods: {
onNavigationBarButtonTap(e) {
console.log(e)
// e的返回格式为json对象{"text":"测试","index":0}
this.drawer = !this.drawer
if (this.drawer) {
this.openDrawer()
} else {
this.closeDrawer()
}
},
async init() {
let engineering = uni.getStorageSync('engineering')
let res = await queryEngineering()
@@ -123,12 +132,23 @@ export default {
}
}
this.store.params.engineerId = this.select.engineeringId
// #ifdef APP-PLUS
var webView = this.$mp.page.$getAppWebview()
// 修改buttons
webView.setTitleNViewButtonStyle(0, {
text: this.select.engineeringName,
})
// #endif
getDevCount(this.select.engineeringId).then((res) => {
this.devCount = res.data
})
this.$refs.device && this.$refs.device.init()
},
closeDrawer(e) {
if (!e) {
this.$refs.showRight.close()
return
}
console.log(e)
this.engineeringList.forEach((item) => {
if (item.name === e.item.name) {
@@ -136,10 +156,20 @@ export default {
this.select.engineeringName = item.name
this.select.engineeringId = item.id
this.store.params.engineerId = item.id
// #ifdef APP-PLUS
var webView = this.$mp.page.$getAppWebview()
// 修改buttons
webView.setTitleNViewButtonStyle(0, {
text: this.select.engineeringName,
})
// #endif
}
})
this.$refs.device.select.projectName = ''
this.$refs.device.select.projectNameIndex = 0
getDevCount(this.select.engineeringId).then((res) => {
this.devCount = res.data
})
this.$refs.device.init()
this.$refs.showRight.close()
},

View File

@@ -3,12 +3,12 @@
<view class="message">
<view class="message-nav" @click="jump('system')">
<image mode="aspectFill" class="message-nav-icon" src="/static/message3.png" />
<view class="message-nav-label">系统</view>
<view class="message-nav-label">设备消息</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="message-nav" @click="jump('feedback')" v-if="userInfo.authorities === 'app_vip_user'">
<image mode="aspectFill" class="message-nav-icon" src="/static/feedback.png" />
<view class="message-nav-label">反馈</view>
<view class="message-nav-label">反馈回复</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="message-nav" @click="jump('report')">

View File

@@ -20,30 +20,39 @@
<view class="mine-nav-label">角色升级</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="mine-nav" @click="jump('audit')" v-if="userInfo.authorities === 'app_vip_user'">
<!-- <view class="mine-nav" @click="jump('audit')" v-if="userInfo.authorities === 'app_vip_user'">
<image mode="aspectFill" class="mine-nav-icon" src="/static/server.png" />
<view class="mine-nav-label">角色审核</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
</view> -->
<!-- <view class="mine-nav" @click="jump('user')" v-if="userInfo.authorities === 'app_vip_user'">
<image mode="aspectFill" class="mine-nav-icon" src="/static/subordinate.png" />
<view class="mine-nav-label">子用户列表</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view> -->
<view class="mine-nav" @click="jump('scan')">
<view
class="mine-nav"
@click="jump('scan')"
v-if="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'"
>
<image mode="aspectFill" class="mine-nav-icon" src="/static/scan.png" />
<view class="mine-nav-label">扫一扫</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="mine-nav" @click="jump('engineering')">
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
<view class="mine-nav-label">工程管理</view>
<view class="mine-nav-label">工程列表</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="mine-nav" @click="jump('engineering/setting')" v-if="userInfo.authorities === 'engineering_user'">
<image mode="aspectFill" class="mine-nav-icon" src="/static/like.png" />
<view class="mine-nav-label">关注工程配置</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="mine-nav" @click="jump('project')">
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
<view class="mine-nav-label">项目管理</view>
<view class="mine-nav-label">项目列表</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<!-- <view
@@ -145,9 +154,8 @@ export default {
let content = JSON.parse(res.result)
switch (content.type) {
case 'transferDevice':
this.transferDevice(content.id)
this.transferDevice(content.id.split(','))
break
default:
break
}
@@ -182,6 +190,11 @@ export default {
url: `/pages/engineering/list`,
})
break
case 'engineering/setting':
uni.navigateTo({
url: `/pages/engineering/setting`,
})
break
default:
uni.navigateTo({
url: `/pages/mine/${type}`,

View File

@@ -1,25 +1,53 @@
<template>
<Cn-page :loading='loading'>
<view slot='body'>
<view class='index'>
隐私政策
<Cn-page :loading="loading">
<view slot="body">
<view class="html-wrap">
<view v-html="value"></view>
</view>
</view>
</Cn-page>
</template>
<script>
import { queryAppInfoByType } from '@/common/api/mine.js'
export default {
data () {
data() {
return {
loading: false
showFlag: 0,
pageNameFlag: 1,
pageName: '用户协议',
loading: true,
value: '',
}
},
methods: {
}
methods: {},
created() {
let dictData = uni.getStorageSync(this.$cacheKey.dictData)
dictData.forEach((item) => {
if (item.code === 'appInformationType') {
item.children.forEach((item2) => {
if (item2.code === 'Personal_Infor_Protect') {
queryAppInfoByType(item2.id).then((res) => {
this.value = res.data.content
this.loading = false
})
}
})
}
})
},
}
</script>
<style lang='scss'>
.index {
<style lang="scss">
.html-wrap {
width: 750rpx;
box-sizing: border-box;
padding: 20rpx;
font-size: 24rpx;
color: #666;
img {
width: 100%;
}
}
</style>

View File

@@ -6,7 +6,7 @@
<view class="name">{{ text }}</view>
<view class="btn-wrap">
<navigator open-type="navigateBack" hover-class="none" class="btn"> 返回 </navigator>
<view class="btn ml20" @click="look"> 查看 </view>
<!-- <view class="btn ml20" @click="look"> 查看 </view> -->
</view>
</view>
</view>

View File

@@ -17,6 +17,10 @@
<view class="mine-nav-label">用户协议</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="mine-nav" @click="jump('policy')" >
<view class="mine-nav-label">个人信息保护政策</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
</view>
<view class="mine-nav" @click="jump('system')">
<view class="mine-nav-label">系统介绍</view>
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
@@ -72,7 +76,7 @@ export default {
})
break;
case 'layout':
uni.navigateTo({
uni.reLaunch({
url: `/pages/user/login`
})
break;

View File

@@ -1,50 +1,56 @@
<template>
<view :loading="loading">
<view class="mine">
<view class="mine-nav" style="margin-top:20rpx;">
<view class="mine-nav-label">终端消息</view>
<view class="mine-nav" style="margin-top: 20rpx">
<view class="mine-nav-label">稳态越限</view>
<switch color="#376cf3" />
</view>
<view class="mine-nav" style="border-bottom: none; ">
<view class="mine-nav-label">系统消息</view>
<view class="mine-nav" style="border-bottom: none">
<view class="mine-nav-label">暂态事件</view>
<switch color="#376cf3" />
</view>
<view class="mine-nav" style="border-bottom: none">
<view class="mine-nav-label">设备状态</view>
<switch color="#376cf3" />
</view>
<view class="mine-nav" style="border-bottom: none">
<view class="mine-nav-label">设备消息</view>
<switch color="#376cf3" />
</view>
</view>
</view>
</template>
<script>
export default {
data () {
data() {
return {
loading: false
loading: false,
}
},
methods: {
init () {
},
jump (type) {
init() {},
jump(type) {
switch (type) {
case 'changePwd':
uni.navigateTo({
url: `/pages/user/changePwd`
url: `/pages/user/changePwd`,
})
break;
break
case 'changePhone':
uni.navigateTo({
url: `/pages/user/changePhone`
url: `/pages/user/changePhone`,
})
break;
break
default:
uni.navigateTo({
url: `/pages/mine/${type}`
url: `/pages/mine/${type}`,
})
break;
break
}
}
},
},
onLoad () {
onLoad() {
this.init()
},
}
@@ -52,6 +58,11 @@ export default {
<style lang="scss">
.mine {
.title {
padding: 0 20rpx;
font-size: 28rpx;
font-weight: 500;
}
.mine-header {
padding: 200rpx 34rpx 34rpx;
display: flex;
@@ -78,7 +89,7 @@ export default {
}
.mine-nav {
padding: 34rpx;
padding: 34rpx;
display: flex;
align-items: center;
background: $uni-theme-white;

View File

@@ -89,6 +89,7 @@
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>
@@ -116,7 +117,7 @@ export default {
text: '设备',
},
{
text: '用户',
text: '用户',
},
{
text: '拓扑图',
@@ -249,24 +250,33 @@ export default {
},
onLoad(option) {
let userInfo = uni.getStorageSync('userInfo')
this.content.push({
iconPath: '/static/share.png',
text: '编辑',
})
this.content.push({
iconPath: '/static/delate.png',
text: '删除',
})
this.content.push({
iconPath: '/static/transfer.png',
text: '移交',
})
this.content.push({
iconPath: '/static/share.png',
text: '分享',
})
if (userInfo.authorities == '3') {
} else if (userInfo.authorities == '4') {
// this.content.push({
// iconPath: '/static/share.png',
// text: '编辑',
// })
// this.content.push({
// iconPath: '/static/delate.png',
// text: '删除',
// })
// this.content.push({
// iconPath: '/static/transfer.png',
// text: '移交',
// })
// this.content.push({
// iconPath: '/static/share.png',
// text: '分享',
// })
if (userInfo.authorities == 'engineering_user' || userInfo.authorities == 'app_vip_user') {
this.content.push(
{
iconPath: '/static/share.png',
text: '编辑',
},
{
iconPath: '/static/delate.png',
text: '删除',
},
)
}
setTimeout(() => {
// 获取nav高度

View File

@@ -6,7 +6,7 @@
:fixed="true"
status-bar
left-icon="left"
:rightIcon="userInfo.authorities == '2' ? '' : 'plusempty'"
:rightIcon="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user' ? 'plusempty' : ''"
background-color="#fff"
color="#111"
title="项目管理"
@@ -44,6 +44,7 @@ export default {
},
methods: {
init() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
this.store = this.DataSource('/cs-device-boot/project/queryProject')
this.store.params.engineeringId = uni.getStorageSync('engineering')?.id
this.store.reload()

View File

@@ -8,8 +8,8 @@
<uni-easyinput
v-model="formData.engineeringName"
placeholder="请输入项目名称"
@click.native="showDrawer"
:clearable="false"
disabled
/>
</uni-forms-item>
<uni-forms-item label="项目名称">
@@ -122,8 +122,8 @@ export default {
topoIds: [],
description: '',
name: '',
lat: '2',
lng: '3',
lat: '',
lng: '',
},
engineeringList: [],
tempList: [],
@@ -162,6 +162,10 @@ export default {
this.formData[key] = this.project[key]
}
}
} else {
let engineering = uni.getStorageSync(this.$cacheKey.engineering)
this.formData.engineeringId = engineering.id
this.formData.engineeringName = engineering.name
}
uni.getLocation({
type: 'wgs84',
@@ -229,7 +233,9 @@ export default {
chooseLocation() {
uni.chooseLocation({
success: function (res) {
this.address = res.name
this.formData.area = res.name
this.formData.lat = res.latitudeame
this.formData.lng = res.longitude
console.log('位置名称:' + res.name)
console.log('详细地址:' + res.address)
console.log('纬度:' + res.latitude)
@@ -268,18 +274,24 @@ export default {
let data = JSON.parse(JSON.stringify(this.formData))
delete data.files
let res = {}
console.warn(data, arr)
if (this.project) {
data.id = this.project.id
res = await updateAppProject(data, arr)
} else {
res = await addAppProject(data, arr)
}
console.log(res)
if (res.length === 1) {
this.$util.toast(res[0].message)
return
let result = {}
if (res.code === 'A0000') {
result = res
} else {
console.warn(res)
if (res.length === 1) {
this.$util.toast(res[0].message)
return
}
result = JSON.parse(res[1].data)
}
let result = JSON.parse(res[1].data)
if (result.code === 'A0000') {
if (this.project) {
this.$util.toast('项目修改成功')

View File

@@ -15,7 +15,7 @@
</uni-forms-item>
<uni-forms-item name="code">
<view class="login-box-input">
<uni-easyinput type="number" v-model="formData.code" placeholder="请输入验证码" />
<uni-easyinput type="text" v-model="formData.code" placeholder="请输入验证码" maxlength="6" />
<view
class="ml40"
style="
@@ -48,7 +48,7 @@
</uni-forms-item>
<uni-forms-item name="code">
<view class="login-box-input">
<uni-easyinput type="number" v-model="formData.code2" placeholder="请输入验证码" />
<uni-easyinput type="text" v-model="formData.code2" placeholder="请输入验证码" maxlength="6" />
<view
class="ml40"
style="

View File

@@ -13,7 +13,7 @@
</uni-forms-item>
<uni-forms-item name="code">
<view class="login-box-input">
<uni-easyinput type="number" v-model="formData.code" placeholder="请输入验证码" />
<uni-easyinput type="text" v-model="formData.code" placeholder="请输入验证码" maxlength="6" />
<view
class="ml40"
style="

View File

@@ -2,11 +2,12 @@
<Cn-page :loading="loading">
<view slot="body">
<view class="login">
<view class="login-title">登录</view>
<view class="login-des">灿能物联</view>
<view class="login-title" style="font-size: 36rpx;">欢迎登录</view>
<!-- <view class="login-des">灿能物联</view> -->
<view class="login-box">
<!-- <image class="login-box-logo" mode="widthFix" src="/static/logo.png"></image> -->
<image class="login-box-logo" mode="widthFix" src="/static/logo.png"></image>
<view style="font-size: 40rpx;text-align: center;font-weight: 500;" class="mt20">灿能物联</view>
<template v-if="loginType == 'yzm'">
<view class="login-box-input mt100">
<input
@@ -21,7 +22,7 @@
<view class="login-box-input-img"></view>
</view> -->
<view class="login-box-input mt40">
<input class="login-box-input-main" v-model="yzmForm.code" placeholder="手机验证码" />
<input type="text" class="login-box-input-main" v-model="yzmForm.code" placeholder="手机验证码" maxlength="6" />
<view
class="ml40"
style="font-size: 28rpx; color: #666; width: 200rpx; text-align: center"
@@ -59,13 +60,20 @@
<view @click="loginType = 'pwd'" v-if="loginType == 'yzm'">账号密码登录</view>
<view @click="loginType = 'yzm'" v-else>短信验证码登录</view>
<view style="flex: 1"></view>
<navigator url="/pages/user/forget" hover-class="none">忘记密码</navigator>
<view style="margin: 0 10px; color: #999">|</view>
<template v-if="loginType === 'pwd'">
<navigator url="/pages/user/forget" hover-class="none">忘记密码</navigator>
<view style="margin: 0 10px; color: #999">|</view>
</template>
<navigator url="/pages/user/register" hover-class="none">快速注册</navigator>
</view>
<view class="login-box-tips">
<view style="color: #999"
><checkbox :checked="checkbox" @click="checkbox = !checkbox" /> 我已阅读并同意</view
><checkbox
style="transform: scale(0.7)"
:checked="checkbox"
@click="checkbox = !checkbox"
/>
我已阅读并同意</view
>
<navigator url="/pages/mine/agreement" hover-class="none">用户协议</navigator>
<navigator url="/pages/mine/policy" hover-class="none">个人信息保护政策</navigator>
@@ -85,14 +93,14 @@ export default {
return {
checkbox: false,
loading: false,
loginType: 'pwd',
loginType: 'yzm',
phone: '',
pwdForm: {
pwd: '',
imgCode: '',
},
yzmForm: {
code: '123456789',
code: '',
imgCode: '',
},
waitTime: 0,
@@ -178,6 +186,10 @@ export default {
onLoad(o) {
// 移除所有的缓存
// uni.clearStorageSync()
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
if (userInfo) {
this.phone = userInfo.user_name
}
uni.removeStorageSync(this.$cacheKey.access_token)
uni.removeStorageSync(this.$cacheKey.engineering)
},
@@ -203,7 +215,7 @@ export default {
.login-box {
display: flex;
flex-direction: column;
margin: 60rpx auto 0;
margin: 40rpx auto 0;
box-sizing: border-box;
width: 680rpx;
padding: 100rpx 40rpx;

View File

@@ -9,7 +9,7 @@
</uni-forms-item>
<uni-forms-item name="code">
<view class="login-box-input">
<uni-easyinput type="number" v-model="formData.code" placeholder="请输入验证码" />
<uni-easyinput type="text" v-model="formData.code" placeholder="请输入验证码" maxlength="6" />
<view
class="ml40"
style="margin-left: 40rpx; font-size: 28rpx; color: #666; width: 200rpx; text-align: center"
@@ -23,7 +23,7 @@
<button type="default" class="submit-btn" @click="firstSubmit">注册</button>
<view class="login-box-tips">
<view style="color: #999"
><checkbox :checked="checkbox" @click="checkbox = !checkbox" /> 我已阅读并同意</view
><checkbox style="transform: scale(0.7)" :checked="checkbox" @click="checkbox = !checkbox" /> 我已阅读并同意</view
>
<navigator url="/pages/mine/agreement" hover-class="none">用户协议</navigator>
<navigator url="/pages/mine/policy" hover-class="none">个人信息保护政策</navigator>

BIN
static/device_bad.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
static/device_ready.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
static/device_success.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
static/like.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -0,0 +1,35 @@
## 1.2.42023-05-09
- 修复 i18n 国际化不正确的 Bug
## 1.2.32022-05-24
- 新增 readonly 属性,组件只读
## 1.2.22022-05-06
- 修复 vue3 input 事件不生效的bug
## 1.2.12022-05-06
- 修复 多余代码导致的bug
## 1.2.02021-11-19
- 优化 组件UI并提供设计资源详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-search-bar](https://uniapp.dcloud.io/component/uniui/uni-search-bar)
## 1.1.22021-08-30
- 修复 value 属性与 modelValue 属性不兼容的Bug
## 1.1.12021-08-24
- 新增 支持国际化
## 1.1.02021-07-30
- 组件兼容 vue3如何创建vue3项目详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.0.92021-05-12
- 新增 项目示例地址
## 1.0.82021-04-21
- 优化 添加依赖 uni-icons, 导入后自动下载依赖
## 1.0.72021-04-15
- uni-ui 新增 uni-search-bar 的 focus 事件
## 1.0.62021-02-05
- 优化 组件引用关系通过uni_modules引用组件
## 1.0.52021-02-05
- 调整为uni_modules目录规范
- 新增 支持双向绑定
- 更改 input 事件的返回值e={value:Number} --> e=value
- 新增 支持图标插槽
- 新增 支持 clear、blur 事件
- 新增 支持 focus 属性
- 去掉组件背景色

View File

@@ -0,0 +1,4 @@
{
"uni-search-bar.cancel": "cancel",
"uni-search-bar.placeholder": "Search enter content"
}

View File

@@ -0,0 +1,8 @@
import en from './en.json'
import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json'
export default {
en,
'zh-Hans': zhHans,
'zh-Hant': zhHant
}

View File

@@ -0,0 +1,4 @@
{
"uni-search-bar.cancel": "取消",
"uni-search-bar.placeholder": "请输入搜索内容"
}

View File

@@ -0,0 +1,4 @@
{
"uni-search-bar.cancel": "取消",
"uni-search-bar.placeholder": "請輸入搜索內容"
}

View File

@@ -0,0 +1,298 @@
<template>
<view class="uni-searchbar">
<view :style="{borderRadius:radius+'px',backgroundColor: bgColor}" class="uni-searchbar__box"
@click="searchClick">
<view class="uni-searchbar__box-icon-search">
<slot name="searchIcon">
<uni-icons color="#c0c4cc" size="18" type="search" />
</slot>
</view>
<input v-if="show || searchVal" :focus="showSync" :disabled="readonly" :placeholder="placeholderText" :maxlength="maxlength"
class="uni-searchbar__box-search-input" confirm-type="search" type="text" v-model="searchVal"
@confirm="confirm" @blur="blur" @focus="emitFocus" />
<text v-else class="uni-searchbar__text-placeholder">{{ placeholder }}</text>
<view v-if="show && (clearButton==='always'||clearButton==='auto'&&searchVal!=='') &&!readonly"
class="uni-searchbar__box-icon-clear" @click="clear">
<slot name="clearIcon">
<uni-icons color="#c0c4cc" size="20" type="clear" />
</slot>
</view>
</view>
<text @click="cancel" class="uni-searchbar__cancel"
v-if="cancelButton ==='always' || show && cancelButton ==='auto'">{{cancelTextI18n}}</text>
</view>
</template>
<script>
import {
initVueI18n
} from '@dcloudio/uni-i18n'
import messages from './i18n/index.js'
const {
t
} = initVueI18n(messages)
/**
* SearchBar 搜索栏
* @description 搜索栏组件,通常用于搜索商品、文章等
* @tutorial https://ext.dcloud.net.cn/plugin?id=866
* @property {Number} radius 搜索栏圆角
* @property {Number} maxlength 输入最大长度
* @property {String} placeholder 搜索栏Placeholder
* @property {String} clearButton = [always|auto|none] 是否显示清除按钮
* @value always 一直显示
* @value auto 输入框不为空时显示
* @value none 一直不显示
* @property {String} cancelButton = [always|auto|none] 是否显示取消按钮
* @value always 一直显示
* @value auto 输入框不为空时显示
* @value none 一直不显示
* @property {String} cancelText 取消按钮的文字
* @property {String} bgColor 输入框背景颜色
* @property {Boolean} focus 是否自动聚焦
* @property {Boolean} readonly 组件只读,不能有任何操作,只做展示
* @event {Function} confirm uniSearchBar 的输入框 confirm 事件返回参数为uniSearchBar的valuee={value:Number}
* @event {Function} input uniSearchBar 的 value 改变时触发事件返回参数为uniSearchBar的valuee=value
* @event {Function} cancel 点击取消按钮时触发事件返回参数为uniSearchBar的valuee={value:Number}
* @event {Function} clear 点击清除按钮时触发事件返回参数为uniSearchBar的valuee={value:Number}
* @event {Function} blur input失去焦点时触发事件返回参数为uniSearchBar的valuee={value:Number}
*/
export default {
name: "UniSearchBar",
emits: ['input', 'update:modelValue', 'clear', 'cancel', 'confirm', 'blur', 'focus'],
props: {
placeholder: {
type: String,
default: ""
},
radius: {
type: [Number, String],
default: 5
},
clearButton: {
type: String,
default: "auto"
},
cancelButton: {
type: String,
default: "auto"
},
cancelText: {
type: String,
default: ""
},
bgColor: {
type: String,
default: "#F8F8F8"
},
maxlength: {
type: [Number, String],
default: 100
},
value: {
type: [Number, String],
default: ""
},
modelValue: {
type: [Number, String],
default: ""
},
focus: {
type: Boolean,
default: false
},
readonly: {
type: Boolean,
default: false
}
},
data() {
return {
show: false,
showSync: false,
searchVal: ''
}
},
computed: {
cancelTextI18n() {
return this.cancelText || t("uni-search-bar.cancel")
},
placeholderText() {
return this.placeholder || t("uni-search-bar.placeholder")
}
},
watch: {
// #ifndef VUE3
value: {
immediate: true,
handler(newVal) {
this.searchVal = newVal
if (newVal) {
this.show = true
}
}
},
// #endif
// #ifdef VUE3
modelValue: {
immediate: true,
handler(newVal) {
this.searchVal = newVal
if (newVal) {
this.show = true
}
}
},
// #endif
focus: {
immediate: true,
handler(newVal) {
if (newVal) {
if(this.readonly) return
this.show = true;
this.$nextTick(() => {
this.showSync = true
})
}
}
},
searchVal(newVal, oldVal) {
this.$emit("input", newVal)
// #ifdef VUE3
this.$emit("update:modelValue", newVal)
// #endif
}
},
methods: {
searchClick() {
if(this.readonly) return
if (this.show) {
return
}
this.show = true;
this.$nextTick(() => {
this.showSync = true
})
},
clear() {
this.$emit("clear", {
value: this.searchVal
})
this.searchVal = ""
},
cancel() {
if(this.readonly) return
this.$emit("cancel", {
value: this.searchVal
});
this.searchVal = ""
this.show = false
this.showSync = false
// #ifndef APP-PLUS
uni.hideKeyboard()
// #endif
// #ifdef APP-PLUS
plus.key.hideSoftKeybord()
// #endif
},
confirm() {
// #ifndef APP-PLUS
uni.hideKeyboard();
// #endif
// #ifdef APP-PLUS
plus.key.hideSoftKeybord()
// #endif
this.$emit("confirm", {
value: this.searchVal
})
},
blur() {
// #ifndef APP-PLUS
uni.hideKeyboard();
// #endif
// #ifdef APP-PLUS
plus.key.hideSoftKeybord()
// #endif
this.$emit("blur", {
value: this.searchVal
})
},
emitFocus(e) {
this.$emit("focus", e.detail)
}
}
};
</script>
<style lang="scss">
$uni-searchbar-height: 36px;
.uni-searchbar {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
position: relative;
padding: 10px;
// background-color: #fff;
}
.uni-searchbar__box {
/* #ifndef APP-NVUE */
display: flex;
box-sizing: border-box;
/* #endif */
overflow: hidden;
position: relative;
flex: 1;
justify-content: center;
flex-direction: row;
align-items: center;
height: $uni-searchbar-height;
padding: 5px 8px 5px 0px;
}
.uni-searchbar__box-icon-search {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
// width: 32px;
padding: 0 8px;
justify-content: center;
align-items: center;
color: #B3B3B3;
}
.uni-searchbar__box-search-input {
flex: 1;
font-size: 14px;
color: #333;
}
.uni-searchbar__box-icon-clear {
align-items: center;
line-height: 24px;
padding-left: 8px;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.uni-searchbar__text-placeholder {
font-size: 14px;
color: #B3B3B3;
margin-left: 5px;
}
.uni-searchbar__cancel {
padding-left: 10px;
line-height: $uni-searchbar-height;
font-size: 14px;
color: #333333;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
</style>

View File

@@ -0,0 +1,86 @@
{
"id": "uni-search-bar",
"displayName": "uni-search-bar 搜索栏",
"version": "1.2.4",
"description": "搜索栏组件,通常用于搜索商品、文章等",
"keywords": [
"uni-ui",
"uniui",
"搜索框",
"搜索栏"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": [
"uni-scss",
"uni-icons"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

View File

@@ -0,0 +1,14 @@
## SearchBar 搜索栏
> **组件名uni-search-bar**
> 代码块: `uSearchBar`
搜索栏组件
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-search-bar)
#### 如使用过程中有任何问题或者您对uni-ui有一些好的建议欢迎加入 uni-ui 交流群871950839