用户修改

This commit is contained in:
仲么了
2023-07-06 14:24:03 +08:00
parent 77fd768acf
commit 69063cb241
20 changed files with 331 additions and 154 deletions

51
App.vue
View File

@@ -1,56 +1,29 @@
<script> <script>
import { queryDictDataCache } from './common/api/dictionary.js'
import encrypt from './common/js/aes.js' import encrypt from './common/js/aes.js'
import {
MQTT_IP,
MQTT_OPTIONS
} from './common/js/mqtt.js';
import mqtt from 'mqtt/dist/mqtt.js'
export default { export default {
methods: {
connect () {
MQTT_OPTIONS.clientId = uni.getStorageSync('devCode')
var that = this
let client = mqtt.connect('ws://' + MQTT_IP, MQTT_OPTIONS)
client.on('connect', function () {
console.log('连接成功')
client.subscribe(that.topic, function (err) {
if (!err) {
console.log('订阅成功')
}
})
}).on('reconnect', function (error) {
console.log(error);
console.log('正在重连...', that.topic)
}).on('error', function (error) {
console.log('连接失败...', error)
}).on('end', function () {
console.log('连接断开')
}).on('message', function (topic, message) {
console.log('接收推送信息:', message.toString())
})
}
},
onLaunch: function () { onLaunch: function () {
// this.connect() // this.connect()
let devCode = uni.getStorageSync('devCode') || 'nnvmhMk8626D8QHhJefm+W9rTAJWuBPRxcnRm4+9bWXdSLRIyTnTruoYfLxGK3Oy' console.log('App Launch')
uni.setStorageSync('devCode', devCode); let devCode = uni.getStorageSync('devCode')
if (!devCode) { if (!devCode) {
document.addEventListener('plusready', () => { uni.getSystemInfo({
// 页面加载时触发 success: (result) => {
let pinf = plus.push.getClientInfo(); uni.setStorageSync('devCode', result.deviceId)
let cid = pinf.clientid;//客户端标识 },
devCode = encrypt.Encrypt(cid, this.$config.key); })
uni.setStorageSync('devCode', devCode);
}, false);
} }
queryDictDataCache().then((res) => {
uni.setStorageSync(this.$cacheKey.dictData, res.data)
})
}, },
onShow: function () { onShow: function () {
console.log('App Show') console.log('App Show')
}, },
onHide: function () { onHide: function () {
console.log('App Hide') console.log('App Hide')
} },
} }
</script> </script>

View File

@@ -1,5 +1,5 @@
import request from '../js/request'; import request from '../js/request'
import config from '../js/config'; import config from '../js/config'
// 获取设备 // 获取设备
export function getDeviceList(params) { export function getDeviceList(params) {
@@ -7,5 +7,19 @@ export function getDeviceList(params) {
url: '/cs-device-boot/EquipmentDelivery/queryEquipmentByProject', url: '/cs-device-boot/EquipmentDelivery/queryEquipmentByProject',
method: 'post', method: 'post',
data: params, data: params,
}); })
}
/**
* 设备统计
* @param {*} id 工程id
* @returns
*/
export function getDevCount(id) {
return request({
url: '/cs-device-boot/deviceUser/devCount',
method: 'post',
data: { id },
})
} }

View File

@@ -10,3 +10,10 @@ export function queryDictData(dictTypeName) {
}, },
}); });
} }
export function queryDictDataCache(dictTypeName) {
return request({
url: '/system-boot/dictType/dictDataCache',
method: 'get',
});
}

View File

@@ -19,3 +19,17 @@ export function queryAppInfo(id) {
}) })
} }
/**
* 查询app个人中心信息详情
* @param id
*/
export const queryAppInfoByType = (type) => {
return request({
url: '/cs-system-boot/appinfo/queryAppInfoByType',
method: 'post',
data: {
type,
},
})
}

View File

@@ -4,4 +4,5 @@ export default {
engineering: 'engineering', // 工程信息 engineering: 'engineering', // 工程信息
access_token: 'access_token', // token access_token: 'access_token', // token
refresh_token: 'refresh_token', // 刷新token refresh_token: 'refresh_token', // 刷新token
dictData: 'dictData', // 字典数据
} }

View File

@@ -90,8 +90,6 @@ export default {
<style lang="scss"> <style lang="scss">
.message { .message {
padding-top: 20rpx;
.message-header { .message-header {
padding: 200rpx 34rpx 34rpx; padding: 200rpx 34rpx 34rpx;
display: flex; display: flex;

View File

@@ -150,9 +150,7 @@ export default {
this.store.params.pageSize = 999 this.store.params.pageSize = 999
this.store.params.engineerId = this.select.engineeringId this.store.params.engineerId = this.select.engineeringId
this.store.reload() this.store.reload()
this.store.firstCallBack = () => {
console.log(this.store)
}
}, },
getProjectList() { getProjectList() {
getProjectList({ getProjectList({

View File

@@ -2,15 +2,15 @@
<view class="index-zhuyonghu"> <view class="index-zhuyonghu">
<div class="header"> <div class="header">
<div class="header-item"> <div class="header-item">
<div class="header-item-value">3</div> <div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
<div class="header-item-label">正常设备</div> <div class="header-item-label">正常设备</div>
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-item-value">1</div> <div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
<div class="header-item-label">报警设备</div> <div class="header-item-label">报警设备</div>
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-item-value">0</div> <div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
<div class="header-item-label">离线设备</div> <div class="header-item-label">离线设备</div>
</div> </div>
</div> </div>
@@ -30,7 +30,12 @@ export default {
loading: false, loading: false,
} }
}, },
props: {
devCount: {
type: Object,
default: {},
},
},
methods: { methods: {
submitFeedBack() { submitFeedBack() {
uni.navigateTo({ url: '/pages/home/feedback' }) uni.navigateTo({ url: '/pages/home/feedback' })

View File

@@ -2,15 +2,15 @@
<view class="index-zhuyonghu"> <view class="index-zhuyonghu">
<div class="header"> <div class="header">
<div class="header-item"> <div class="header-item">
<div class="header-item-value">3</div> <div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
<div class="header-item-label">正常设备</div> <div class="header-item-label">正常设备</div>
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-item-value">1</div> <div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
<div class="header-item-label">报警设备</div> <div class="header-item-label">报警设备</div>
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-item-value">0</div> <div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
<div class="header-item-label">离线设备</div> <div class="header-item-label">离线设备</div>
</div> </div>
</div> </div>
@@ -18,7 +18,12 @@
</template> </template>
<script> <script>
export default { export default {
props: {
devCount: {
type: Object,
default: {},
},
},
} }
</script> </script>
<style lang="scss"></style> <style lang="scss"></style>

View File

@@ -2,21 +2,28 @@
<view class="index-zhuyonghu"> <view class="index-zhuyonghu">
<div class="header"> <div class="header">
<div class="header-item"> <div class="header-item">
<div class="header-item-value">3</div> <div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
<div class="header-item-label">正常设备</div> <div class="header-item-label">正常设备</div>
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-item-value">1</div> <div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
<div class="header-item-label">报警设备</div> <div class="header-item-label">报警设备</div>
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-item-value">0</div> <div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
<div class="header-item-label">离线设备</div> <div class="header-item-label">离线设备</div>
</div> </div>
</div> </div>
</view> </view>
</template> </template>
<script> <script>
export default {} export default {
props: {
devCount: {
type: Object,
default: {},
},
},
}
</script> </script>
<style lang="scss"></style> <style lang="scss"></style>

View File

@@ -2,15 +2,15 @@
<view class="index-zhuyonghu"> <view class="index-zhuyonghu">
<div class="header"> <div class="header">
<div class="header-item"> <div class="header-item">
<div class="header-item-value">3</div> <div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
<div class="header-item-label">正常设备</div> <div class="header-item-label">正常设备</div>
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-item-value">1</div> <div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
<div class="header-item-label">报警设备</div> <div class="header-item-label">报警设备</div>
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-item-value">0</div> <div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
<div class="header-item-label">离线设备</div> <div class="header-item-label">离线设备</div>
</div> </div>
</div> </div>
@@ -30,7 +30,12 @@ export default {
loading: false, loading: false,
} }
}, },
props: {
devCount: {
type: Object,
default: {},
},
},
methods: { methods: {
submitFeedBack() { submitFeedBack() {
uni.navigateTo({ url: '/pages/home/feedback' }) uni.navigateTo({ url: '/pages/home/feedback' })

View File

@@ -6,15 +6,15 @@
<div class="header-item-label">设备总数</div> <div class="header-item-label">设备总数</div>
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-item-value">1</div> <div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
<div class="header-item-label">正常设备</div> <div class="header-item-label">正常设备</div>
</div> </div>
<div class="header-item" @click="projectWarning"> <div class="header-item" @click="projectWarning">
<div class="header-item-value">4</div> <div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
<div class="header-item-label">报警设备</div> <div class="header-item-label">报警设备</div>
</div> </div>
<div class="header-item"> <div class="header-item">
<div class="header-item-value">3</div> <div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
<div class="header-item-label">离线设备</div> <div class="header-item-label">离线设备</div>
</div> </div>
<div class="header-item"> <div class="header-item">
@@ -34,38 +34,44 @@
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
loading: false, loading: false,
} }
}, },
props: {
devCount: {
type: Object,
default: {},
},
},
methods: { methods: {
projectWarning () { projectWarning() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/zhuanzhi/warning' url: '/pages/zhuanzhi/warning',
}) })
}, },
projectNum () { projectNum() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/project/list' url: '/pages/project/list',
}) })
}, },
jump (item) { jump(item) {
if (item.name.indexOf('APF') > -1) { if (item.name.indexOf('APF') > -1) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/device/APF/detail' url: '/pages/device/APF/detail',
}) })
} else if (item.name.indexOf('DVR') > -1) { } else if (item.name.indexOf('DVR') > -1) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/device/DVR/detail' url: '/pages/device/DVR/detail',
}) })
} }
}, },
}, },
created(){ created() {},
},
} }
</script> </script>
<style lang='scss'> <style lang="scss">
.index-zhuanzhi {} .index-zhuanzhi {
}
</style> </style>

View File

@@ -3,14 +3,14 @@
<view slot="body"> <view slot="body">
<view class="index"> <view class="index">
<!-- 运维 --> <!-- 运维 -->
<YunWei v-if="userInfo.authorities === 'operation_manager'" /> <YunWei :devCount="devCount" v-if="userInfo.authorities === 'operation_manager'" />
<!-- 专职 --> <!-- 专职 -->
<ZhuanZhi v-if="userInfo.authorities === 'market_user'" /> <ZhuanZhi :devCount="devCount" v-if="userInfo.authorities === 'market_user'" />
<!-- 工程 --> <!-- 工程 -->
<GongCheng v-if="userInfo.authorities === 'engineering_user'" /> <GongCheng :devCount="devCount" v-if="userInfo.authorities === 'engineering_user'" />
<!-- 主用户 --> <!-- 主用户 -->
<ZhuYongHu v-if="userInfo.authorities === 'app_vip_user'" /> <ZhuYongHu :devCount="devCount" v-if="userInfo.authorities === 'app_vip_user'" />
<YouKe v-if="userInfo.authorities === 'tourist'"> </YouKe> <YouKe :devCount="devCount" v-if="userInfo.authorities === 'tourist'"> </YouKe>
<Device ref="device" :store="store" /> <Device ref="device" :store="store" />
</view> </view>
</view> </view>
@@ -24,7 +24,7 @@ import ZhuanZhi from './comp/indexZhuanZhi.vue'
import YouKe from './comp/indexYouKe.vue' import YouKe from './comp/indexYouKe.vue'
import Device from './comp/device.vue' import Device from './comp/device.vue'
import list from '../../common/js/list' import list from '../../common/js/list'
import { getDevCount } from '../../common/api/device.js'
export default { export default {
mixins: [list], mixins: [list],
components: { components: {
@@ -39,6 +39,7 @@ export default {
return { return {
loading: false, loading: false,
userInfo: {}, userInfo: {},
devCount: {},
} }
}, },
methods: { methods: {
@@ -60,6 +61,11 @@ export default {
}, },
onLoad() { onLoad() {
this.store = this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject') this.store = this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject')
this.store.firstCallBack = () => {
getDevCount(this.store.params.engineerId).then((res) => {
this.devCount = res.data
})
}
}, },
onShow() { onShow() {
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo) this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)

View File

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

View File

@@ -1,25 +1,53 @@
<template> <template>
<Cn-page :loading='loading'> <Cn-page :loading="loading">
<view slot='body'> <view slot="body">
<view class='index'> <view class="html-wrap">
说明书pdf <view v-html="value"></view>
</view> </view>
</view> </view>
</Cn-page> </Cn-page>
</template> </template>
<script> <script>
import { queryAppInfoByType } from '@/common/api/mine.js'
export default { export default {
data () { data() {
return { 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 === 'User_Manual') {
queryAppInfoByType(item2.id).then((res) => {
this.value = res.data.content
this.loading = false
})
}
})
}
})
},
} }
</script> </script>
<style lang='scss'>
.index { <style lang="scss">
padding: 34rpx; .html-wrap {
width: 750rpx;
box-sizing: border-box;
padding: 20rpx;
font-size: 24rpx;
color: #666;
img {
width: 100%;
}
} }
</style> </style>

View File

@@ -1,25 +1,53 @@
<template> <template>
<Cn-page :loading='loading'> <Cn-page :loading="loading">
<view slot='body'> <view slot="body">
<view class='index'> <view class="html-wrap">
公司介绍 <view v-html="value"></view>
</view> </view>
</view> </view>
</Cn-page> </Cn-page>
</template> </template>
<script> <script>
import { queryAppInfoByType } from '@/common/api/mine.js'
export default { export default {
data () { data() {
return { 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 === 'Company_Profile') {
queryAppInfoByType(item2.id).then((res) => {
this.value = res.data.content
this.loading = false
})
}
})
}
})
},
} }
</script> </script>
<style lang='scss'>
.index { <style lang="scss">
.html-wrap {
width: 750rpx;
box-sizing: border-box;
padding: 20rpx; padding: 20rpx;
font-size: 24rpx;
color: #666;
img {
width: 100%;
}
} }
</style> </style>

View File

@@ -1,25 +1,53 @@
<template> <template>
<Cn-page :loading='loading'> <Cn-page :loading="loading">
<view slot='body'> <view slot="body">
<view class='index'> <view class="html-wrap">
数据库pdf <view v-html="value"></view>
</view> </view>
</view> </view>
</Cn-page> </Cn-page>
</template> </template>
<script> <script>
import { queryAppInfoByType } from '@/common/api/mine.js'
export default { export default {
data () { data() {
return { 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 === 'Data_base') {
queryAppInfoByType(item2.id).then((res) => {
this.value = res.data.content
this.loading = false
})
}
})
}
})
},
} }
</script> </script>
<style lang='scss'>
.index { <style lang="scss">
padding: 34rpx; .html-wrap {
width: 750rpx;
box-sizing: border-box;
padding: 20rpx;
font-size: 24rpx;
color: #666;
img {
width: 100%;
}
} }
</style> </style>

View File

@@ -58,8 +58,6 @@ export default {
}, },
methods: { methods: {
async init() { async init() {
const res = await queryPersonSet()
console.log(res);
}, },
jump(type) { jump(type) {
switch (type) { switch (type) {

View File

@@ -1,25 +1,53 @@
<template> <template>
<Cn-page :loading='loading'> <Cn-page :loading="loading">
<view slot='body'> <view slot="body">
<view class='index'> <view class="html-wrap">
系统介绍 <view v-html="value"></view>
</view> </view>
</view> </view>
</Cn-page> </Cn-page>
</template> </template>
<script> <script>
import { queryAppInfoByType } from '@/common/api/mine.js'
export default { export default {
data () { data() {
return { 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 === 'introduction') {
queryAppInfoByType(item2.id).then((res) => {
this.value = res.data.content
this.loading = false
})
}
})
}
})
},
} }
</script> </script>
<style lang='scss'>
.index { <style lang="scss">
.html-wrap {
width: 750rpx;
box-sizing: border-box;
padding: 20rpx; padding: 20rpx;
font-size: 24rpx;
color: #666;
img {
width: 100%;
}
} }
</style> </style>

View File

@@ -155,7 +155,9 @@ export default {
}) })
}, },
}, },
onLoad(o) {}, onLoad(o) {
uni.removeStorageSync('engineering')
},
} }
</script> </script>
<style lang="scss"> <style lang="scss">