接口对接
This commit is contained in:
8
.prettierrc
Normal file
8
.prettierrc
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "all",
|
||||||
|
"tabWidth": 4,
|
||||||
|
"printWidth": 120,
|
||||||
|
"useTabs": false,
|
||||||
|
"semi": false
|
||||||
|
}
|
||||||
12
App.vue
12
App.vue
@@ -8,7 +8,7 @@ import mqtt from 'mqtt/dist/mqtt.js'
|
|||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
connect () {
|
connect () {
|
||||||
MQTT_OPTIONS.clientId = uni.getStorageSync('cidAES')
|
MQTT_OPTIONS.clientId = uni.getStorageSync('devCode')
|
||||||
var that = this
|
var that = this
|
||||||
let client = mqtt.connect('ws://' + MQTT_IP, MQTT_OPTIONS)
|
let client = mqtt.connect('ws://' + MQTT_IP, MQTT_OPTIONS)
|
||||||
client.on('connect', function () {
|
client.on('connect', function () {
|
||||||
@@ -32,15 +32,15 @@ export default {
|
|||||||
},
|
},
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
// this.connect()
|
// this.connect()
|
||||||
let cidAES = uni.getStorageSync('cidAES') || 'nnvmhMk8626D8QHhJefm+W9rTAJWuBPRxcnRm4+9bWXdSLRIyTnTruoYfLxGK3Oy'
|
let devCode = uni.getStorageSync('devCode') || 'nnvmhMk8626D8QHhJefm+W9rTAJWuBPRxcnRm4+9bWXdSLRIyTnTruoYfLxGK3Oy'
|
||||||
uni.setStorageSync('cidAES', cidAES);
|
uni.setStorageSync('devCode', devCode);
|
||||||
if (!cidAES) {
|
if (!devCode) {
|
||||||
document.addEventListener('plusready', () => {
|
document.addEventListener('plusready', () => {
|
||||||
// 页面加载时触发
|
// 页面加载时触发
|
||||||
let pinf = plus.push.getClientInfo();
|
let pinf = plus.push.getClientInfo();
|
||||||
let cid = pinf.clientid;//客户端标识
|
let cid = pinf.clientid;//客户端标识
|
||||||
cidAES = encrypt.Encrypt(cid, this.$config.key);
|
devCode = encrypt.Encrypt(cid, this.$config.key);
|
||||||
uni.setStorageSync('cidAES', cidAES);
|
uni.setStorageSync('devCode', devCode);
|
||||||
}, false);
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import config from '../js/config';
|
|||||||
// 获取设备
|
// 获取设备
|
||||||
export function getDeviceList(params) {
|
export function getDeviceList(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/EquipmentDelivery/queryEquipmentByProject',
|
url: '/cs-device-boot/EquipmentDelivery/queryEquipmentByProject',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import config from '../js/config';
|
|||||||
|
|
||||||
export function addEngineering(params) {
|
export function addEngineering(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/engineering/addEngineering',
|
url: '/cs-device-boot/engineering/addEngineering',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
header: {
|
header: {
|
||||||
@@ -15,7 +15,7 @@ export function addEngineering(params) {
|
|||||||
|
|
||||||
export function auditEngineering(params) {
|
export function auditEngineering(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/engineering/auditEngineering',
|
url: '/cs-device-boot/engineering/auditEngineering',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
header: {
|
header: {
|
||||||
@@ -26,7 +26,7 @@ export function auditEngineering(params) {
|
|||||||
|
|
||||||
export function queryEngineering(params) {
|
export function queryEngineering(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/engineering/queryEngineering',
|
url: '/cs-device-boot/engineering/queryEngineering',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
header: {
|
header: {
|
||||||
@@ -11,10 +11,10 @@ export function addFeedBack(params) {
|
|||||||
let data = JSON.parse(JSON.stringify(params));
|
let data = JSON.parse(JSON.stringify(params));
|
||||||
delete data.files
|
delete data.files
|
||||||
return uni.uploadFile({
|
return uni.uploadFile({
|
||||||
url: config.domain + '/feedback/addFeedBack', //仅为示例,非真实的接口地址
|
url: config.domain + '/cs-device-boot/feedback/addFeedBack', //仅为示例,非真实的接口地址
|
||||||
files: files,
|
files: files,
|
||||||
header: {
|
header: {
|
||||||
Authorization: '12',
|
Authorization: uni.getStorageSync('access_token'),
|
||||||
},
|
},
|
||||||
formData: data,
|
formData: data,
|
||||||
});
|
});
|
||||||
@@ -27,7 +27,7 @@ export function addFeedBack(params) {
|
|||||||
*/
|
*/
|
||||||
export function queryFeedBackDetail(id) {
|
export function queryFeedBackDetail(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/feedback/queryFeedBackDetail',
|
url: '/cs-device-boot/feedback/queryFeedBackDetail',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
id,
|
id,
|
||||||
@@ -38,7 +38,7 @@ export function queryFeedBackDetail(id) {
|
|||||||
// 问题列表
|
// 问题列表
|
||||||
export function queryFeedBackPage(params) {
|
export function queryFeedBackPage(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/feedback/queryFeedBackPage',
|
url: '/cs-device-boot/feedback/queryFeedBackPage',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@@ -58,7 +58,7 @@ export function queryFeedBackPage(params) {
|
|||||||
*/
|
*/
|
||||||
export function AddFeedbackChat(params) {
|
export function AddFeedbackChat(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/feedbackChat/AddFeedbackChat',
|
url: '/cs-device-boot/feedbackChat/AddFeedbackChat',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
header: {
|
header: {
|
||||||
@@ -77,7 +77,7 @@ export function AddFeedbackChat(params) {
|
|||||||
*/
|
*/
|
||||||
export function updateChatStatus(params) {
|
export function updateChatStatus(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/feedbackChat/updateChatStatus',
|
url: '/cs-device-boot/feedbackChat/updateChatStatus',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
header: {
|
header: {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import request from '../js/request';
|
import request from '../js/request'
|
||||||
import config from '../js/config';
|
import config from '../js/config'
|
||||||
|
|
||||||
export function queryPersonSet() {
|
export function queryPersonSet() {
|
||||||
return request({
|
return request({
|
||||||
url: '/appinfo/queryPersonSet',
|
url: '/appinfo/queryPersonSet',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {},
|
data: {},
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function queryAppInfo(id) {
|
export function queryAppInfo(id) {
|
||||||
@@ -16,5 +16,6 @@ export function queryAppInfo(id) {
|
|||||||
data: {
|
data: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ import config from '../js/config'
|
|||||||
|
|
||||||
export function addAppProject(params, files) {
|
export function addAppProject(params, files) {
|
||||||
return uni.uploadFile({
|
return uni.uploadFile({
|
||||||
url: config.domain + '/project/addAppProject', //仅为示例,非真实的接口地址
|
url: config.domain + '/cs-device-boot/project/addAppProject', //仅为示例,非真实的接口地址
|
||||||
files: files,
|
files: files,
|
||||||
header: {
|
header: {
|
||||||
Authorization: '12',
|
Authorization: uni.getStorageSync('access_token'),
|
||||||
},
|
},
|
||||||
formData: params,
|
formData: params,
|
||||||
})
|
})
|
||||||
@@ -14,7 +14,7 @@ export function addAppProject(params, files) {
|
|||||||
|
|
||||||
export function getProjectList(params) {
|
export function getProjectList(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/project/queryProject',
|
url: '/cs-device-boot/project/queryProject',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
header: {
|
header: {
|
||||||
@@ -36,7 +36,7 @@ export function queryTopologyDiagramPage(params) {
|
|||||||
projectId: '',
|
projectId: '',
|
||||||
searchValue: '',
|
searchValue: '',
|
||||||
},
|
},
|
||||||
params
|
params,
|
||||||
),
|
),
|
||||||
header: {
|
header: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
@@ -67,14 +67,15 @@ export function addAppTopologyDiagram(params, filePath) {
|
|||||||
filePath,
|
filePath,
|
||||||
name: 'file',
|
name: 'file',
|
||||||
header: {
|
header: {
|
||||||
Authorization: '12',
|
Authorization: uni.getStorageSync('access_token'),
|
||||||
},
|
},
|
||||||
formData: Object.assign(
|
formData: Object.assign(
|
||||||
{
|
{
|
||||||
topologyDiagramName: '',
|
topologyDiagramName: '',
|
||||||
projectId: '',
|
projectId: '',
|
||||||
},
|
},
|
||||||
params
|
params,
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export function apiGetYms(params) {
|
|||||||
url: '/user-boot/appUser/authCode',
|
url: '/user-boot/appUser/authCode',
|
||||||
data: {
|
data: {
|
||||||
phone: params.phone,
|
phone: params.phone,
|
||||||
devCode: uni.getStorageSync('cidAES'),
|
devCode: uni.getStorageSync('devCode'),
|
||||||
type: params.type,
|
type: params.type,
|
||||||
},
|
},
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -23,12 +23,12 @@ export function apiGetYms(params) {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function apiLogin(params) {
|
export function apiLogin(params) {
|
||||||
console.log(uni.getStorageSync('cidAES'))
|
console.log(uni.getStorageSync('devCode'))
|
||||||
return request({
|
return request({
|
||||||
url: '/shiningCloud/user/login',
|
url: '/shiningCloud/user/login',
|
||||||
data: {
|
data: {
|
||||||
phone: params.phone,
|
phone: params.phone,
|
||||||
devCode: uni.getStorageSync('cidAES'),
|
devCode: uni.getStorageSync('devCode'),
|
||||||
key: params.key.trim(),
|
key: params.key.trim(),
|
||||||
type: params.type,
|
type: params.type,
|
||||||
},
|
},
|
||||||
@@ -42,9 +42,9 @@ export function apiLogin(params) {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function apiYsmLogin(params) {
|
export function apiYsmLogin(params) {
|
||||||
uni.setStorageSync('token', 'Basic bmpjbmFwcDpuamNucHFz')
|
uni.setStorageSync('access_token', 'Basic bmpjbmFwcDpuamNucHFz')
|
||||||
return request({
|
return request({
|
||||||
url: '/pas-auth/oauth/token',
|
url: '/pqs-auth/oauth/token',
|
||||||
data: {
|
data: {
|
||||||
grant_type: 'sms_code',
|
grant_type: 'sms_code',
|
||||||
phone: params.phone,
|
phone: params.phone,
|
||||||
@@ -64,7 +64,7 @@ export function apiRegister(params) {
|
|||||||
url: '/user-boot/appUser/register',
|
url: '/user-boot/appUser/register',
|
||||||
data: {
|
data: {
|
||||||
phone: params.phone,
|
phone: params.phone,
|
||||||
devCode: uni.getStorageSync('cidAES'),
|
devCode: uni.getStorageSync('devCode'),
|
||||||
code: params.code.trim(),
|
code: params.code.trim(),
|
||||||
},
|
},
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -81,7 +81,7 @@ export function autoLogin(phone) {
|
|||||||
url: '/user-boot/appUser/autoLogin',
|
url: '/user-boot/appUser/autoLogin',
|
||||||
data: {
|
data: {
|
||||||
phone: phone,
|
phone: phone,
|
||||||
devCode: uni.getStorageSync('cidAES'),
|
devCode: uni.getStorageSync('devCode'),
|
||||||
},
|
},
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
})
|
})
|
||||||
@@ -93,7 +93,7 @@ export function apiSetPsd(params) {
|
|||||||
url: '/shiningCloud/user/setPsd',
|
url: '/shiningCloud/user/setPsd',
|
||||||
data: {
|
data: {
|
||||||
userId: uni.getStorageSync('userInfo').userId,
|
userId: uni.getStorageSync('userInfo').userId,
|
||||||
devCode: uni.getStorageSync('cidAES'),
|
devCode: uni.getStorageSync('devCode'),
|
||||||
password: params.password.trim(),
|
password: params.password.trim(),
|
||||||
},
|
},
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -107,7 +107,7 @@ export function apiReSetPsd(params) {
|
|||||||
data: {
|
data: {
|
||||||
phone: params.phone,
|
phone: params.phone,
|
||||||
code: params.code.trim(),
|
code: params.code.trim(),
|
||||||
devCode: uni.getStorageSync('cidAES'),
|
devCode: uni.getStorageSync('devCode'),
|
||||||
password: params.password.trim(),
|
password: params.password.trim(),
|
||||||
},
|
},
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -119,7 +119,7 @@ export function apiComfirmCode(params) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/shiningCloud/user/comfirmCode',
|
url: '/shiningCloud/user/comfirmCode',
|
||||||
data: {
|
data: {
|
||||||
devCode: uni.getStorageSync('cidAES'),
|
devCode: uni.getStorageSync('devCode'),
|
||||||
phone: params.phone,
|
phone: params.phone,
|
||||||
code: params.code.trim(),
|
code: params.code.trim(),
|
||||||
},
|
},
|
||||||
@@ -132,7 +132,7 @@ export function apiRebindPhone(params) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/shiningCloud/user/rebindPhone',
|
url: '/shiningCloud/user/rebindPhone',
|
||||||
data: {
|
data: {
|
||||||
devCode: uni.getStorageSync('cidAES'),
|
devCode: uni.getStorageSync('devCode'),
|
||||||
userId: uni.getStorageSync('userInfo').userId,
|
userId: uni.getStorageSync('userInfo').userId,
|
||||||
phoneNew: params.phone,
|
phoneNew: params.phone,
|
||||||
code: params.code.trim(),
|
code: params.code.trim(),
|
||||||
@@ -140,3 +140,16 @@ export function apiRebindPhone(params) {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 角色升级
|
||||||
|
export function roleUpdate({ userId, referralCode }) {
|
||||||
|
return request({
|
||||||
|
url: '/user-boot/appRole/roleUpdate',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
devCode: uni.getStorageSync('devCode'),
|
||||||
|
referralCode,
|
||||||
|
userId,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
export default {
|
export default {
|
||||||
config: 'config', // 全剧配置
|
config: 'config', // 全剧配置
|
||||||
userInfo: 'userInfo', // 用户信息
|
userInfo: 'userInfo', // 用户信息
|
||||||
|
engineering: 'engineering', // 工程信息
|
||||||
|
access_token: 'access_token', // token
|
||||||
|
refresh_token: 'refresh_token', // 刷新token
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ export default (options = {}) => {
|
|||||||
header: {
|
header: {
|
||||||
// 'Content-Type': 'application/json;charset=UTF-8',
|
// 'Content-Type': 'application/json;charset=UTF-8',
|
||||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||||
Authorization: uni.getStorageSync('token'),
|
Authorization: uni.getStorageSync('access_token'),
|
||||||
...options.header,
|
...options.header,
|
||||||
},
|
},
|
||||||
method: options.method || 'GET',
|
method: options.method || 'GET',
|
||||||
@@ -63,17 +63,22 @@ export default (options = {}) => {
|
|||||||
* @param {Number} code 错误码
|
* @param {Number} code 错误码
|
||||||
*/
|
*/
|
||||||
function errHandler(res) {
|
function errHandler(res) {
|
||||||
switch (res.resultCode) {
|
switch (res.code) {
|
||||||
case '401':
|
case '401':
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
uni.removeStorageSync('Cookie')
|
uni.clearStorageSync()
|
||||||
|
// #endif
|
||||||
|
uni.reLaunch({ url: '/pages/user/login' })
|
||||||
|
break
|
||||||
|
case 'A0202':
|
||||||
|
// #ifdef MP
|
||||||
uni.clearStorageSync()
|
uni.clearStorageSync()
|
||||||
// #endif
|
// #endif
|
||||||
uni.reLaunch({ url: '/pages/user/login' })
|
uni.reLaunch({ url: '/pages/user/login' })
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.message || res.msg || '服务端未知错误',
|
title: res.message || res.msg || '网络异常,请稍后再试',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -298,19 +298,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/gc/new",
|
"path": "pages/engineering/new",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "新增工程"
|
"navigationBarTitleText": "新增工程"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/gc/list",
|
"path": "pages/engineering/list",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "工程列表"
|
"navigationBarTitleText": "工程列表"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/gc/detail",
|
"path": "pages/engineering/detail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "工程详情"
|
"navigationBarTitleText": "工程详情"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -217,8 +217,8 @@ export default {
|
|||||||
},
|
},
|
||||||
init () {
|
init () {
|
||||||
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
console.log(userInfo.role);
|
console.log(userInfo.authorities);
|
||||||
switch (userInfo.role) {
|
switch (userInfo.authorities) {
|
||||||
case 1:
|
case 1:
|
||||||
this.content.splice(0, 1)
|
this.content.splice(0, 1)
|
||||||
this.content.splice(0, 0, {
|
this.content.splice(0, 0, {
|
||||||
|
|||||||
@@ -119,8 +119,8 @@ export default {
|
|||||||
},
|
},
|
||||||
init () {
|
init () {
|
||||||
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
console.log(userInfo.role);
|
console.log(userInfo.authorities);
|
||||||
switch (userInfo.role) {
|
switch (userInfo.authorities) {
|
||||||
case 1:
|
case 1:
|
||||||
this.content.splice(0, 0, {
|
this.content.splice(0, 0, {
|
||||||
iconPath: '/static/version.png',
|
iconPath: '/static/version.png',
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
<view class="detail">
|
<view class="detail">
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<view class="header-title"
|
<view class="header-title"
|
||||||
>{{ gc.name }}
|
>{{ engineering.name }}
|
||||||
<!-- <view class="header-title-extra">用能</view> -->
|
<!-- <view class="header-title-extra">用能</view> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="header-des-mini mb10">{{ gc.provinceName + gc.cityName }} {{ gc.createTime }}</view>
|
<view class="header-des-mini mb10">{{ engineering.provinceName + engineering.cityName }} {{ engineering.createTime }}</view>
|
||||||
<view class="header-des">{{ gc.description }} </view>
|
<view class="header-des">{{ engineering.description }} </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="nav">
|
<view class="nav">
|
||||||
<view
|
<view
|
||||||
@@ -70,7 +70,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
gc: '',
|
engineering: '',
|
||||||
navMenuList: [
|
navMenuList: [
|
||||||
{
|
{
|
||||||
text: '项目',
|
text: '项目',
|
||||||
@@ -128,20 +128,20 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.store = this.DataSource('/project/queryProject')
|
this.store = this.DataSource('/cs-device-boot/project/queryProject')
|
||||||
this.store.params.engineeringId = this.gc.id
|
this.store.params.engineeringId = this.engineering.id
|
||||||
this.store.reload()
|
this.store.reload()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.gc = JSON.parse(option.gc)
|
this.engineering = JSON.parse(option.engineering)
|
||||||
let userInfo = uni.getStorageSync('userInfo')
|
let userInfo = uni.getStorageSync('userInfo')
|
||||||
if (userInfo.role == '3') {
|
if (userInfo.authorities == '3') {
|
||||||
this.content.push({
|
this.content.push({
|
||||||
iconPath: '/static/transfer.png',
|
iconPath: '/static/transfer.png',
|
||||||
text: '移交',
|
text: '移交',
|
||||||
})
|
})
|
||||||
} else if (userInfo.role == '4') {
|
} else if (userInfo.authorities == '4') {
|
||||||
this.content.push({
|
this.content.push({
|
||||||
iconPath: '/static/share.png',
|
iconPath: '/static/share.png',
|
||||||
text: '分享',
|
text: '分享',
|
||||||
@@ -157,7 +157,7 @@ export default {
|
|||||||
.exec()
|
.exec()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
this.init()
|
this.init()
|
||||||
// uni.setNavigationBarTitle({ title: this.gc })
|
// uni.setNavigationBarTitle({ title: this.engineering })
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
:fixed="true"
|
:fixed="true"
|
||||||
status-bar
|
status-bar
|
||||||
left-icon="left"
|
left-icon="left"
|
||||||
:rightIcon="userInfo.role == '2' ? '' : 'plusempty'"
|
:rightIcon="userInfo.authorities == '2' ? '' : 'plusempty'"
|
||||||
background-color="#fff"
|
background-color="#fff"
|
||||||
color="#111"
|
color="#111"
|
||||||
title="工程管理"
|
title="工程管理"
|
||||||
@@ -14,7 +14,13 @@
|
|||||||
@clickRight="add"
|
@clickRight="add"
|
||||||
/>
|
/>
|
||||||
<view class="message">
|
<view class="message">
|
||||||
<uni-card :title="item.name" :extra="item.projectType" @click="jump(item)" v-for="(item, index) in store.data" :key="index">
|
<uni-card
|
||||||
|
:title="item.name"
|
||||||
|
:extra="item.projectType"
|
||||||
|
@click="jump(item)"
|
||||||
|
v-for="(item, index) in store.data"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
<view class="term-list-bottom">
|
<view class="term-list-bottom">
|
||||||
<view class="term-list-bottom-item">
|
<view class="term-list-bottom-item">
|
||||||
<view>区域</view>
|
<view>区域</view>
|
||||||
@@ -44,16 +50,22 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
this.store = this.DataSource('/engineering/queryEngineeringPage')
|
this.store = this.DataSource('/cs-device-boot/engineering/queryEngineeringPage')
|
||||||
this.store.params.userId = uni.getStorageSync('userInfo').id
|
this.store.params.userId = uni.getStorageSync('userInfo').id
|
||||||
this.store.reload()
|
this.store.reload()
|
||||||
|
this.store.firstCallBack = (res) => {
|
||||||
|
let engineering = uni.getStorageSync('engineering')
|
||||||
|
if (!engineering) {
|
||||||
|
uni.setStorageSync('engineering',this.store.data[0])
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
back() {
|
back() {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
},
|
},
|
||||||
add() {
|
add() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/gc/new`,
|
url: `/pages/engineering/new`,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
upgrade(code) {
|
upgrade(code) {
|
||||||
@@ -63,9 +75,9 @@ export default {
|
|||||||
icon: 'none',
|
icon: 'none',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
jump(gc) {
|
jump(engineering) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/gc/detail?gc=${JSON.stringify(gc)}`,
|
url: `/pages/engineering/detail?engineering=${JSON.stringify(engineering)}`,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
</Cn-page>
|
</Cn-page>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { addEngineering } from '../../common/api/gc'
|
import { addEngineering } from '../../common/api/engineering'
|
||||||
import area from '../../common/js/area.json'
|
import area from '../../common/js/area.json'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<text class="ml20">版本号:v1.0.0</text>
|
<text class="ml20">版本号:v1.0.0</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="title mb20 m340">设备列表
|
<view class="title mb20 m340">设备列表
|
||||||
<view class="footer-btn" v-if="userInfo.role != '2' && userInfo.role != '5'" @click="newDevice">注册设备
|
<view class="footer-btn" v-if="userInfo.authorities != '2' && userInfo.authorities != '5'" @click="newDevice">注册设备
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<uni-card :title="'设备' + item" :sub-title="'XXX项目1'" extra="用能" v-for="item in 2" :key="item"
|
<uni-card :title="'设备' + item" :sub-title="'XXX项目1'" extra="用能" v-for="item in 2" :key="item"
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<Cn-page :loading='loading'>
|
<Cn-page :loading='loading'>
|
||||||
<view slot='body'>
|
<view slot='body'>
|
||||||
<view class='index' :class="{ 'device': userInfo.role == '5' || userInfo.role == '2' }">
|
<view class='index' :class="{ 'device': userInfo.authorities == '5' || userInfo.authorities == '2' }">
|
||||||
<uni-card title="监测网关" sub-title="监测" @click="look" thumbnail="/static/gateway.png"
|
<uni-card title="监测网关" sub-title="监测" @click="look" thumbnail="/static/gateway.png"
|
||||||
:padding="userInfo.role == '5' || userInfo.role == '2' ? 0 : '10px'">
|
:padding="userInfo.authorities == '5' || userInfo.authorities == '2' ? 0 : '10px'">
|
||||||
<view class="footer" v-if="userInfo.role != 5 && userInfo.role != 2">
|
<view class="footer" v-if="userInfo.authorities != 5 && userInfo.authorities != 2">
|
||||||
<text style="flex:1"> </text>
|
<text style="flex:1"> </text>
|
||||||
<view class="footer-btn" @click.stop="newDevice">注册设备</view>
|
<view class="footer-btn" @click.stop="newDevice">注册设备</view>
|
||||||
<view class="footer-btn ml20">查看</view>
|
<view class="footer-btn ml20">查看</view>
|
||||||
</view>
|
</view>
|
||||||
</uni-card>
|
</uni-card>
|
||||||
<uni-card title="用能网关" sub-title="用能" @click="look" thumbnail="/static/gateway.png"
|
<uni-card title="用能网关" sub-title="用能" @click="look" thumbnail="/static/gateway.png"
|
||||||
:padding="userInfo.role == '5' || userInfo.role == '2' ? 0 : '10px'">
|
:padding="userInfo.authorities == '5' || userInfo.authorities == '2' ? 0 : '10px'">
|
||||||
<view class="footer" v-if="userInfo.role != 5 && userInfo.role != 2">
|
<view class="footer" v-if="userInfo.authorities != 5 && userInfo.authorities != 2">
|
||||||
<text style="flex:1"> </text>
|
<text style="flex:1"> </text>
|
||||||
<view class="footer-btn" @click.stop="newDevice">注册设备</view>
|
<view class="footer-btn" @click.stop="newDevice">注册设备</view>
|
||||||
<view class="footer-btn ml20">查看</view>
|
<view class="footer-btn ml20">查看</view>
|
||||||
|
|||||||
283
pages/index/comp/device.vue
Normal file
283
pages/index/comp/device.vue
Normal file
@@ -0,0 +1,283 @@
|
|||||||
|
<template>
|
||||||
|
<view class="device">
|
||||||
|
<view class="nav">
|
||||||
|
<view class="nav-menu" :class="{ 'nav-menu-active': select.engineeringName }" @click="openDrawer"
|
||||||
|
>{{ select.engineeringName || '工程' }}
|
||||||
|
</view>
|
||||||
|
<picker @change="projectNameChange" :value="select.projectNameIndex" :range="projectList" range-key="text" v-if="engineeringList.length">
|
||||||
|
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }"
|
||||||
|
>{{ select.projectName || '项目' }}
|
||||||
|
</view>
|
||||||
|
</picker>
|
||||||
|
<!-- <picker @change="projectTypeChange" :value="select.projectTypeIndex" :range="projectType" range-key="text">
|
||||||
|
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectType }"
|
||||||
|
>{{ select.projectType || '类型' }}
|
||||||
|
</view>
|
||||||
|
</picker> -->
|
||||||
|
</view>
|
||||||
|
<view class="content device" :style="{ minHeight: minHeight }">
|
||||||
|
<uni-card
|
||||||
|
:title="item.equipmentName"
|
||||||
|
:sub-title="item.projectName"
|
||||||
|
:extra="item.projectType"
|
||||||
|
padding="0"
|
||||||
|
v-for="(item, index) in deviceListFilter"
|
||||||
|
:key="index"
|
||||||
|
@click="jump(item)"
|
||||||
|
thumbnail="/static/device.png"
|
||||||
|
>
|
||||||
|
<!-- <text>{{ item.project }} {{ item.type }}</text> -->
|
||||||
|
</uni-card>
|
||||||
|
<Cn-empty v-if="store.empty || deviceListFilter.length == 0"></Cn-empty>
|
||||||
|
<uni-load-more
|
||||||
|
v-if="deviceListFilter && deviceListFilter.length > 0"
|
||||||
|
: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: {
|
||||||
|
type: Object,
|
||||||
|
default: {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
select: {
|
||||||
|
projectName: '',
|
||||||
|
projectNameIndex: 0,
|
||||||
|
projectType: '',
|
||||||
|
projectTypeIndex: 0,
|
||||||
|
engineeringName: '',
|
||||||
|
engineeringId: '',
|
||||||
|
},
|
||||||
|
navHeight: 0,
|
||||||
|
minHeight: '',
|
||||||
|
engineeringList: [],
|
||||||
|
projectList: [],
|
||||||
|
projectType: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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) {
|
||||||
|
return item.project === this.select.projectName && item.type === this.select.projectType
|
||||||
|
} else if (this.select.projectName) {
|
||||||
|
return item.projectId === this.projectList[this.select.projectNameIndex].id
|
||||||
|
} else if (this.select.projectType) {
|
||||||
|
return item.projectType === this.projectType[this.select.projectTypeIndex].id
|
||||||
|
} else {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
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
|
||||||
|
})
|
||||||
|
.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 {
|
||||||
|
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()
|
||||||
|
this.store.firstCallBack = () => {
|
||||||
|
console.log(this.store)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getProjectList() {
|
||||||
|
getProjectList({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 9999,
|
||||||
|
engineeringId: this.select.engineeringId,
|
||||||
|
}).then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
let arr = [
|
||||||
|
{
|
||||||
|
text: '全部项目',
|
||||||
|
value: '-1',
|
||||||
|
},
|
||||||
|
...res.data.records.map((item) => {
|
||||||
|
return {
|
||||||
|
text: item.name,
|
||||||
|
value: item.id,
|
||||||
|
...item,
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
this.projectList = arr
|
||||||
|
})
|
||||||
|
},
|
||||||
|
queryDictData() {
|
||||||
|
queryDictData('项目类型').then((res) => {
|
||||||
|
this.projectType = [
|
||||||
|
{
|
||||||
|
text: '全部类型',
|
||||||
|
value: '',
|
||||||
|
},
|
||||||
|
...res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
text: item.anotherName,
|
||||||
|
value: item.id,
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
})
|
||||||
|
},
|
||||||
|
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' })
|
||||||
|
},
|
||||||
|
projectTypeChange(e) {
|
||||||
|
this.select.projectTypeIndex = e.detail.value
|
||||||
|
if (e.detail.value === 0) {
|
||||||
|
this.select.projectType = ''
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.select.projectType = this.projectType[e.detail.value].text
|
||||||
|
},
|
||||||
|
projectNameChange(e) {
|
||||||
|
console.log(e)
|
||||||
|
this.select.projectNameIndex = e.detail.value
|
||||||
|
if (e.detail.value === 0) {
|
||||||
|
this.select.projectName = ''
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.select.projectName = this.projectList[e.detail.value].text
|
||||||
|
},
|
||||||
|
registerDevice() {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '请选择设备类型',
|
||||||
|
confirmText: '直连装置',
|
||||||
|
cancelText: '网关接入',
|
||||||
|
cancelColor: '#007aff',
|
||||||
|
success: ({ confirm, cancel }) => {
|
||||||
|
if (confirm) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/device/new',
|
||||||
|
})
|
||||||
|
} else if (cancel) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/gateway/list',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
registerGateway() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/gateway/new',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
navMenuClick(index) {
|
||||||
|
this.navMenuActive = index
|
||||||
|
},
|
||||||
|
jump(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/device/APF/detail',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss"></style>
|
||||||
@@ -21,179 +21,20 @@
|
|||||||
<Cn-grid-item src="/static/feedback2.png" text="提交反馈" @click="submitFeedBack"></Cn-grid-item>
|
<Cn-grid-item src="/static/feedback2.png" text="提交反馈" @click="submitFeedBack"></Cn-grid-item>
|
||||||
</Cn-grid>
|
</Cn-grid>
|
||||||
</view>
|
</view>
|
||||||
<view class="nav">
|
|
||||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.engineeringName }" @click="showDrawer"
|
|
||||||
>{{ select.engineeringName || '工程' }}
|
|
||||||
</view>
|
|
||||||
<picker @change="projectNameChange" :value="select.projectNameIndex" :range="projectListFilter" range-key="text">
|
|
||||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }">{{ select.projectName || '项目' }} </view>
|
|
||||||
</picker>
|
|
||||||
<picker @change="projectTypeChange" :value="select.projectTypeIndex" :range="projectType" range-key="text">
|
|
||||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectType }">{{ select.projectType || '类型' }} </view>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
<view class="content device" :style="{ minHeight: minHeight }">
|
|
||||||
<uni-card
|
|
||||||
:title="item.equipmentName"
|
|
||||||
:sub-title="item.projectName"
|
|
||||||
:extra="item.projectType"
|
|
||||||
padding="0"
|
|
||||||
v-for="(item, index) in deviceListFilter"
|
|
||||||
:key="index"
|
|
||||||
@click="jump(item)"
|
|
||||||
thumbnail="/static/device.png"
|
|
||||||
>
|
|
||||||
<!-- <text>{{ item.project }} {{ item.type }}</text> -->
|
|
||||||
</uni-card>
|
|
||||||
<Cn-empty v-if="store.empty || deviceListFilter.length == 0"></Cn-empty>
|
|
||||||
<uni-load-more v-if="deviceListFilter && deviceListFilter.length > 0" :status="store.status"></uni-load-more>
|
|
||||||
</view>
|
|
||||||
<uni-drawer ref="showRight" mode="right" :mask-click="false" :width="375">
|
|
||||||
<uni-indexed-list :options="gcListFilter" :showSelect="false" @click="closeDrawer"></uni-indexed-list>
|
|
||||||
</uni-drawer>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { pinyin } from 'pinyin-pro'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'IndexGongCheng',
|
|
||||||
props: {
|
|
||||||
store: {
|
|
||||||
type: Object,
|
|
||||||
default: {},
|
|
||||||
},
|
|
||||||
projectList: {
|
|
||||||
type: Array,
|
|
||||||
default: [],
|
|
||||||
},
|
|
||||||
projectType: {
|
|
||||||
type: Array,
|
|
||||||
default: [],
|
|
||||||
},
|
|
||||||
gcList: {
|
|
||||||
type: Array,
|
|
||||||
default: [],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
userInfo: {},
|
|
||||||
select: {
|
|
||||||
projectName: '',
|
|
||||||
projectNameIndex: 0,
|
|
||||||
projectType: '',
|
|
||||||
projectTypeIndex: 0,
|
|
||||||
engineeringName: '',
|
|
||||||
},
|
|
||||||
navHeight: 0,
|
|
||||||
minHeight: '',
|
|
||||||
deviceList: [
|
|
||||||
{
|
|
||||||
name: '设备APF-1',
|
|
||||||
des: '设备描述1',
|
|
||||||
type: '监测',
|
|
||||||
project: 'XXX项目1',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '设备APF-2',
|
|
||||||
des: '设备描述1',
|
|
||||||
type: '监测',
|
|
||||||
project: 'XXX项目1',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '设备APF-3',
|
|
||||||
des: '设备描述2',
|
|
||||||
type: '用能',
|
|
||||||
project: 'XXX项目2',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '设备DVR-1',
|
|
||||||
des: '设备描述3',
|
|
||||||
type: '监测',
|
|
||||||
project: 'XXX项目3',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
gcListFilter() {
|
|
||||||
let result = []
|
|
||||||
this.gcList.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() {
|
|
||||||
let arr = this.store.data
|
|
||||||
if (this.select.projectName) {
|
|
||||||
arr = arr.filter((item) => item.projectName === this.select.projectName)
|
|
||||||
}
|
|
||||||
if (this.select.projectType) {
|
|
||||||
arr = arr.filter((item) => item.projectType === this.select.projectType)
|
|
||||||
}
|
|
||||||
if (this.select.engineeringName) {
|
|
||||||
arr = arr.filter((item) => item.engineeringName === this.select.engineeringName)
|
|
||||||
}
|
|
||||||
return arr
|
|
||||||
},
|
|
||||||
projectListFilter() {
|
|
||||||
return this.projectList.filter((item) => {
|
|
||||||
if (this.select.engineeringName) {
|
|
||||||
return item.engineeringName === this.select.engineeringName || item.value == -1
|
|
||||||
} else {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
showDrawer() {
|
|
||||||
this.$refs.showRight.open()
|
|
||||||
},
|
|
||||||
closeDrawer(e) {
|
|
||||||
console.log(e)
|
|
||||||
this.select.engineeringName = e.item.name
|
|
||||||
this.select.projectName = ''
|
|
||||||
this.select.projectNameIndex = 0
|
|
||||||
this.$refs.showRight.close()
|
|
||||||
},
|
|
||||||
submitFeedBack() {
|
submitFeedBack() {
|
||||||
uni.navigateTo({ url: '/pages/home/feedback' })
|
uni.navigateTo({ url: '/pages/home/feedback' })
|
||||||
},
|
},
|
||||||
projectTypeChange(e) {
|
|
||||||
this.select.projectTypeIndex = e.detail.value
|
|
||||||
if (e.detail.value === 0) {
|
|
||||||
this.select.projectType = ''
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.select.projectType = this.projectType[e.detail.value].text
|
|
||||||
},
|
|
||||||
projectNameChange(e) {
|
|
||||||
console.log(e)
|
|
||||||
// 重置type
|
|
||||||
this.select.projectType = ''
|
|
||||||
this.select.projectTypeIndex = 0
|
|
||||||
|
|
||||||
this.select.projectNameIndex = e.detail.value
|
|
||||||
if (e.detail.value === 0) {
|
|
||||||
this.select.projectName = ''
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.select.projectName = this.projectList[e.detail.value].text
|
|
||||||
},
|
|
||||||
registerDevice() {
|
registerDevice() {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
@@ -219,34 +60,11 @@ export default {
|
|||||||
url: '/pages/gateway/new',
|
url: '/pages/gateway/new',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
navMenuClick(index) {
|
|
||||||
this.navMenuActive = index
|
|
||||||
},
|
|
||||||
jump(item) {
|
jump(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/device/APF/detail',
|
url: '/pages/device/APF/detail',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
init() {},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.userInfo = uni.getStorageSync('userInfo')
|
|
||||||
setTimeout(() => {
|
|
||||||
this.init()
|
|
||||||
// 获取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
|
|
||||||
})
|
|
||||||
.exec()
|
|
||||||
}, 1000)
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -14,208 +14,11 @@
|
|||||||
<div class="header-item-label">离线设备</div>
|
<div class="header-item-label">离线设备</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<view class="nav">
|
|
||||||
<picker @change="projectNameChange" :value="select.projectNameIndex" :range="projectList" range-key="text">
|
|
||||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }">{{
|
|
||||||
select.projectName || '项目' }} </view>
|
|
||||||
</picker>
|
|
||||||
<picker @change="projectTypeChange" :value="select.projectTypeIndex" :range="projectType" range-key="text">
|
|
||||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectType }">{{
|
|
||||||
select.projectType || '类型' }} </view>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
<view class="content device" :style="{ minHeight: minHeight }">
|
|
||||||
<uni-card :title="item.name" :sub-title="item.project" :extra="item.type" padding="0"
|
|
||||||
v-for="(item, index) in deviceListFilter" :key="index" @click="jump(item)" thumbnail="/static/device.png">
|
|
||||||
<!-- <text>{{ item.project }} {{ item.type }}</text> -->
|
|
||||||
</uni-card>
|
|
||||||
<uni-load-more status="nomore"></uni-load-more>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
loading: false,
|
|
||||||
userInfo: {},
|
|
||||||
select: {
|
|
||||||
projectName: '',
|
|
||||||
projectNameIndex: 0,
|
|
||||||
projectType: '',
|
|
||||||
projectTypeIndex: 0
|
|
||||||
},
|
|
||||||
projectType: [
|
|
||||||
{
|
|
||||||
text: '全部类型',
|
|
||||||
value: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '监测',
|
|
||||||
value: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '用能',
|
|
||||||
value: 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '环境',
|
|
||||||
value: 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '安防',
|
|
||||||
value: 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '其他',
|
|
||||||
value: 5
|
|
||||||
}
|
|
||||||
],
|
|
||||||
projectList: [
|
|
||||||
{
|
|
||||||
text: '全部项目',
|
|
||||||
value: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'XXX项目1',
|
|
||||||
value: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'XXX项目2',
|
|
||||||
value: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'XXX项目3',
|
|
||||||
value: 1
|
|
||||||
},
|
|
||||||
|
|
||||||
],
|
|
||||||
navHeight: 0,
|
|
||||||
minHeight: '',
|
|
||||||
deviceList: [
|
|
||||||
{
|
|
||||||
name: '设备APF-1',
|
|
||||||
des: '设备描述1',
|
|
||||||
type: '监测',
|
|
||||||
project: 'XXX项目1',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '设备APF-2',
|
|
||||||
des: '设备描述1',
|
|
||||||
type: '监测',
|
|
||||||
project: 'XXX项目1',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '设备APF-3',
|
|
||||||
des: '设备描述2',
|
|
||||||
type: '用能',
|
|
||||||
project: 'XXX项目2'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '设备DVR-1',
|
|
||||||
des: '设备描述3',
|
|
||||||
type: '监测',
|
|
||||||
project: 'XXX项目3'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
deviceListFilter () {
|
|
||||||
return this.deviceList.filter(item => {
|
|
||||||
if (this.select.projectName) {
|
|
||||||
return item.project === this.select.projectName
|
|
||||||
} else if (this.select.projectType) {
|
|
||||||
return item.type === this.select.projectType
|
|
||||||
} else {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
projectTypeChange (e) {
|
|
||||||
// 重置name
|
|
||||||
this.select.projectName = ''
|
|
||||||
this.select.projectNameIndex = 0
|
|
||||||
|
|
||||||
this.select.projectTypeIndex = e.detail.value
|
|
||||||
if (e.detail.value === 0) {
|
|
||||||
this.select.projectType = ''
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.select.projectType = this.projectType[e.detail.value].text
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
projectNameChange (e) {
|
|
||||||
console.log(e);
|
|
||||||
// 重置type
|
|
||||||
this.select.projectType = ''
|
|
||||||
this.select.projectTypeIndex = 0
|
|
||||||
|
|
||||||
this.select.projectNameIndex = e.detail.value
|
|
||||||
if (e.detail.value === 0) {
|
|
||||||
this.select.projectName = ''
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.select.projectName = this.projectList[e.detail.value].text
|
|
||||||
},
|
|
||||||
registerDevice () {
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '请选择设备类型',
|
|
||||||
confirmText: '直连装置',
|
|
||||||
cancelText: '网关接入',
|
|
||||||
cancelColor: '#007aff',
|
|
||||||
success: ({ confirm, cancel }) => {
|
|
||||||
if (confirm) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/device/new'
|
|
||||||
})
|
|
||||||
} else if (cancel) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/gateway/list'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
registerGateway () {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/gateway/new'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
navMenuClick (index) {
|
|
||||||
this.navMenuActive = index
|
|
||||||
},
|
|
||||||
jump (item) {
|
|
||||||
if (item.name.indexOf('APF') > -1) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/device/APF/detail'
|
|
||||||
})
|
|
||||||
} else if (item.name.indexOf('DVR') > -1) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/device/DVR/detail'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
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
|
|
||||||
}).exec()
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss'></style>
|
<style lang="scss"></style>
|
||||||
|
|||||||
@@ -14,221 +14,9 @@
|
|||||||
<div class="header-item-label">离线设备</div>
|
<div class="header-item-label">离线设备</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <view style="padding:20rpx 20rpx 0">
|
|
||||||
<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>
|
|
||||||
</view> -->
|
|
||||||
<view class="nav">
|
|
||||||
<picker @change="projectNameChange" :value="select.projectNameIndex" :range="projectList" range-key="text">
|
|
||||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }">{{ select.projectName || '项目' }} </view>
|
|
||||||
</picker>
|
|
||||||
<picker @change="projectTypeChange" :value="select.projectTypeIndex" :range="projectType" range-key="text">
|
|
||||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectType }">{{ select.projectType || '类型' }} </view>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
<view class="content device" :style="{ minHeight: minHeight }">
|
|
||||||
<uni-card
|
|
||||||
:title="item.name"
|
|
||||||
:sub-title="item.project"
|
|
||||||
:extra="item.type"
|
|
||||||
padding="0"
|
|
||||||
v-for="(item, index) in deviceListFilter"
|
|
||||||
:key="index"
|
|
||||||
@click="jump(item)"
|
|
||||||
thumbnail="/static/device.png"
|
|
||||||
>
|
|
||||||
<!-- <text>{{ item.project }} {{ item.type }}</text> -->
|
|
||||||
</uni-card>
|
|
||||||
<uni-load-more status="nomore"></uni-load-more>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {}
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: false,
|
|
||||||
select: {
|
|
||||||
projectName: '',
|
|
||||||
projectNameIndex: 0,
|
|
||||||
projectType: '',
|
|
||||||
projectTypeIndex: 0,
|
|
||||||
},
|
|
||||||
projectType: [
|
|
||||||
{
|
|
||||||
text: '全部类型',
|
|
||||||
value: 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '监测',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '用能',
|
|
||||||
value: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '环境',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '安防',
|
|
||||||
value: 4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '其他',
|
|
||||||
value: 5,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
projectList: [
|
|
||||||
{
|
|
||||||
text: '全部项目',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'XXX项目1',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'XXX项目2',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'XXX项目3',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
navHeight: 0,
|
|
||||||
minHeight: '',
|
|
||||||
deviceList: [
|
|
||||||
{
|
|
||||||
name: '设备APF-1',
|
|
||||||
des: '设备描述1',
|
|
||||||
type: '监测',
|
|
||||||
project: 'XXX项目1',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '设备APF-2',
|
|
||||||
des: '设备描述1',
|
|
||||||
type: '监测',
|
|
||||||
project: 'XXX项目1',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '设备APF-3',
|
|
||||||
des: '设备描述2',
|
|
||||||
type: '用能',
|
|
||||||
project: 'XXX项目2',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '设备DVR-1',
|
|
||||||
des: '设备描述3',
|
|
||||||
type: '监测',
|
|
||||||
project: 'XXX项目3',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
deviceListFilter() {
|
|
||||||
return this.deviceList.filter((item) => {
|
|
||||||
if (this.select.projectName) {
|
|
||||||
return item.project === this.select.projectName
|
|
||||||
} else if (this.select.projectType) {
|
|
||||||
return item.type === this.select.projectType
|
|
||||||
} else {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
submitFeedBack() {
|
|
||||||
uni.navigateTo({ url: '/pages/home/feedback' })
|
|
||||||
},
|
|
||||||
projectTypeChange(e) {
|
|
||||||
// 重置name
|
|
||||||
this.select.projectName = ''
|
|
||||||
this.select.projectNameIndex = 0
|
|
||||||
|
|
||||||
this.select.projectTypeIndex = e.detail.value
|
|
||||||
if (e.detail.value === 0) {
|
|
||||||
this.select.projectType = ''
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.select.projectType = this.projectType[e.detail.value].text
|
|
||||||
},
|
|
||||||
projectNameChange(e) {
|
|
||||||
console.log(e)
|
|
||||||
// 重置type
|
|
||||||
this.select.projectType = ''
|
|
||||||
this.select.projectTypeIndex = 0
|
|
||||||
|
|
||||||
this.select.projectNameIndex = e.detail.value
|
|
||||||
if (e.detail.value === 0) {
|
|
||||||
this.select.projectName = ''
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.select.projectName = this.projectList[e.detail.value].text
|
|
||||||
},
|
|
||||||
registerDevice() {
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '请选择设备类型',
|
|
||||||
confirmText: '直连装置',
|
|
||||||
cancelText: '网关接入',
|
|
||||||
cancelColor: '#007aff',
|
|
||||||
success: ({ confirm, cancel }) => {
|
|
||||||
if (confirm) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/device/new',
|
|
||||||
})
|
|
||||||
} else if (cancel) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/gateway/list',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
registerGateway() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/gateway/new',
|
|
||||||
})
|
|
||||||
},
|
|
||||||
navMenuClick(index) {
|
|
||||||
this.navMenuActive = index
|
|
||||||
},
|
|
||||||
jump(item) {
|
|
||||||
if (item.name.indexOf('APF') > -1) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/device/APF/detail',
|
|
||||||
})
|
|
||||||
} else if (item.name.indexOf('DVR') > -1) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/device/DVR/detail',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
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
|
|
||||||
})
|
|
||||||
.exec()
|
|
||||||
}, 1000)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss"></style>
|
<style lang="scss"></style>
|
||||||
|
|||||||
@@ -21,96 +21,19 @@
|
|||||||
<Cn-grid-item src="/static/feedback2.png" text="提交反馈" @click="submitFeedBack"></Cn-grid-item>
|
<Cn-grid-item src="/static/feedback2.png" text="提交反馈" @click="submitFeedBack"></Cn-grid-item>
|
||||||
</Cn-grid>
|
</Cn-grid>
|
||||||
</view>
|
</view>
|
||||||
<view class="nav">
|
|
||||||
<picker @change="projectNameChange" :value="select.projectNameIndex" :range="projectList" range-key="text">
|
|
||||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }">{{ select.projectName || '项目' }} </view>
|
|
||||||
</picker>
|
|
||||||
<picker @change="projectTypeChange" :value="select.projectTypeIndex" :range="projectType" range-key="text">
|
|
||||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectType }">{{ select.projectType || '类型' }} </view>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
<view class="content device" :style="{ minHeight: minHeight }">
|
|
||||||
<uni-card
|
|
||||||
:title="item.equipmentName"
|
|
||||||
:sub-title="item.projectName"
|
|
||||||
:extra="item.projectType"
|
|
||||||
padding="0"
|
|
||||||
v-for="(item, index) in deviceListFilter"
|
|
||||||
:key="index"
|
|
||||||
@click="jump(item)"
|
|
||||||
thumbnail="/static/device.png"
|
|
||||||
>
|
|
||||||
<!-- <text>{{ item.project }} {{ item.type }}</text> -->
|
|
||||||
</uni-card>
|
|
||||||
<Cn-empty v-if="store.empty || deviceListFilter.length == 0"></Cn-empty>
|
|
||||||
<uni-load-more v-if="deviceListFilter && deviceListFilter.length > 0" :status="store.status"></uni-load-more>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
|
||||||
store: {
|
|
||||||
type: Object,
|
|
||||||
default: {},
|
|
||||||
},
|
|
||||||
projectList: {
|
|
||||||
type: Array,
|
|
||||||
default: [],
|
|
||||||
},
|
|
||||||
projectType: {
|
|
||||||
type: Array,
|
|
||||||
default: [],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
select: {
|
}
|
||||||
projectName: '',
|
|
||||||
projectNameIndex: 0,
|
|
||||||
projectType: '',
|
|
||||||
projectTypeIndex: 0,
|
|
||||||
},
|
|
||||||
navHeight: 0,
|
|
||||||
minHeight: '',
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
deviceListFilter() {
|
|
||||||
return this.store.data.filter((item) => {
|
|
||||||
if (this.select.projectName && this.select.projectType) {
|
|
||||||
return item.project === this.select.projectName && item.type === this.select.projectType;
|
|
||||||
} else if (this.select.projectName) {
|
|
||||||
return item.projectId === this.projectList[this.select.projectNameIndex].id;
|
|
||||||
} else if (this.select.projectType) {
|
|
||||||
return item.projectType === this.projectType[this.select.projectTypeIndex].id;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
submitFeedBack() {
|
submitFeedBack() {
|
||||||
uni.navigateTo({ url: '/pages/home/feedback' });
|
uni.navigateTo({ url: '/pages/home/feedback' })
|
||||||
},
|
|
||||||
projectTypeChange(e) {
|
|
||||||
this.select.projectTypeIndex = e.detail.value;
|
|
||||||
if (e.detail.value === 0) {
|
|
||||||
this.select.projectType = '';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.select.projectType = this.projectType[e.detail.value].text;
|
|
||||||
},
|
|
||||||
projectNameChange(e) {
|
|
||||||
console.log(e);
|
|
||||||
this.select.projectNameIndex = e.detail.value;
|
|
||||||
if (e.detail.value === 0) {
|
|
||||||
this.select.projectName = '';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.select.projectName = this.projectList[e.detail.value].text;
|
|
||||||
},
|
},
|
||||||
registerDevice() {
|
registerDevice() {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
@@ -123,46 +46,26 @@ export default {
|
|||||||
if (confirm) {
|
if (confirm) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/device/new',
|
url: '/pages/device/new',
|
||||||
});
|
})
|
||||||
} else if (cancel) {
|
} else if (cancel) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/gateway/list',
|
url: '/pages/gateway/list',
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
registerGateway() {
|
registerGateway() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/gateway/new',
|
url: '/pages/gateway/new',
|
||||||
});
|
})
|
||||||
},
|
|
||||||
navMenuClick(index) {
|
|
||||||
this.navMenuActive = index;
|
|
||||||
},
|
},
|
||||||
jump(item) {
|
jump(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/device/APF/detail',
|
url: '/pages/device/APF/detail',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
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
|
|
||||||
})
|
|
||||||
.exec();
|
|
||||||
}, 1000);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss"></style>
|
<style lang="scss"></style>
|
||||||
|
|||||||
@@ -1,234 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="index-zhuyonghu">
|
|
||||||
<div class="header">
|
|
||||||
<div class="header-item">
|
|
||||||
<div class="header-item-value">3</div>
|
|
||||||
<div class="header-item-label">正常设备</div>
|
|
||||||
</div>
|
|
||||||
<div class="header-item">
|
|
||||||
<div class="header-item-value">1</div>
|
|
||||||
<div class="header-item-label">报警设备</div>
|
|
||||||
</div>
|
|
||||||
<div class="header-item">
|
|
||||||
<div class="header-item-value">0</div>
|
|
||||||
<div class="header-item-label">离线设备</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<view style="padding: 20rpx 20rpx 0">
|
|
||||||
<Cn-grid title="常用功能">
|
|
||||||
<Cn-grid-item src="/static/feedback2.png" text="提交反馈" @click="submitFeedBack"></Cn-grid-item>
|
|
||||||
</Cn-grid>
|
|
||||||
</view>
|
|
||||||
<view class="nav">
|
|
||||||
<picker @change="projectNameChange" :value="select.projectNameIndex" :range="projectList" range-key="text">
|
|
||||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectName }">{{ select.projectName || '项目' }} </view>
|
|
||||||
</picker>
|
|
||||||
<picker @change="projectTypeChange" :value="select.projectTypeIndex" :range="projectType" range-key="text">
|
|
||||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectType }">{{ select.projectType || '类型' }} </view>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
<view class="content device" :style="{ minHeight: minHeight }">
|
|
||||||
<uni-card
|
|
||||||
:title="item.name"
|
|
||||||
:sub-title="item.project"
|
|
||||||
:extra="item.type"
|
|
||||||
padding="0"
|
|
||||||
v-for="(item, index) in deviceListFilter"
|
|
||||||
:key="index"
|
|
||||||
@click="jump(item)"
|
|
||||||
thumbnail="/static/device.png"
|
|
||||||
>
|
|
||||||
<!-- <text>{{ item.project }} {{ item.type }}</text> -->
|
|
||||||
</uni-card>
|
|
||||||
<uni-load-more status="nomore"></uni-load-more>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: false,
|
|
||||||
userInfo: {},
|
|
||||||
select: {
|
|
||||||
projectName: '',
|
|
||||||
projectNameIndex: 0,
|
|
||||||
projectType: '',
|
|
||||||
projectTypeIndex: 0,
|
|
||||||
},
|
|
||||||
projectType: [
|
|
||||||
{
|
|
||||||
text: '全部类型',
|
|
||||||
value: 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '监测',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '用能',
|
|
||||||
value: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '环境',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '安防',
|
|
||||||
value: 4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '其他',
|
|
||||||
value: 5,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
projectList: [
|
|
||||||
{
|
|
||||||
text: '全部项目',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'XXX项目1',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'XXX项目2',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'XXX项目3',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
navHeight: 0,
|
|
||||||
minHeight: '',
|
|
||||||
deviceList: [
|
|
||||||
{
|
|
||||||
name: '设备APF-1',
|
|
||||||
des: '设备描述1',
|
|
||||||
type: '监测',
|
|
||||||
project: 'XXX项目1',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '设备APF-2',
|
|
||||||
des: '设备描述1',
|
|
||||||
type: '监测',
|
|
||||||
project: 'XXX项目1',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '设备APF-3',
|
|
||||||
des: '设备描述2',
|
|
||||||
type: '用能',
|
|
||||||
project: 'XXX项目2',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '设备DVR-1',
|
|
||||||
des: '设备描述3',
|
|
||||||
type: '监测',
|
|
||||||
project: 'XXX项目3',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
deviceListFilter() {
|
|
||||||
return this.deviceList.filter((item) => {
|
|
||||||
if (this.select.projectName) {
|
|
||||||
return item.project === this.select.projectName
|
|
||||||
} else if (this.select.projectType) {
|
|
||||||
return item.type === this.select.projectType
|
|
||||||
} else {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
submitFeedBack() {
|
|
||||||
uni.navigateTo({ url: '/pages/home/feedback' })
|
|
||||||
},
|
|
||||||
projectTypeChange(e) {
|
|
||||||
// 重置name
|
|
||||||
this.select.projectName = ''
|
|
||||||
this.select.projectNameIndex = 0
|
|
||||||
|
|
||||||
this.select.projectTypeIndex = e.detail.value
|
|
||||||
if (e.detail.value === 0) {
|
|
||||||
this.select.projectType = ''
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.select.projectType = this.projectType[e.detail.value].text
|
|
||||||
},
|
|
||||||
projectNameChange(e) {
|
|
||||||
console.log(e)
|
|
||||||
// 重置type
|
|
||||||
this.select.projectType = ''
|
|
||||||
this.select.projectTypeIndex = 0
|
|
||||||
|
|
||||||
this.select.projectNameIndex = e.detail.value
|
|
||||||
if (e.detail.value === 0) {
|
|
||||||
this.select.projectName = ''
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.select.projectName = this.projectList[e.detail.value].text
|
|
||||||
},
|
|
||||||
registerDevice() {
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '请选择设备类型',
|
|
||||||
confirmText: '直连装置',
|
|
||||||
cancelText: '网关接入',
|
|
||||||
cancelColor: '#007aff',
|
|
||||||
success: ({ confirm, cancel }) => {
|
|
||||||
if (confirm) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/device/new',
|
|
||||||
})
|
|
||||||
} else if (cancel) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/gateway/list',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
registerGateway() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/gateway/new',
|
|
||||||
})
|
|
||||||
},
|
|
||||||
navMenuClick(index) {
|
|
||||||
this.navMenuActive = index
|
|
||||||
},
|
|
||||||
jump(item) {
|
|
||||||
if (item.name.indexOf('APF') > -1) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/device/APF/detail',
|
|
||||||
})
|
|
||||||
} else if (item.name.indexOf('DVR') > -1) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/device/DVR/detail',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
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
|
|
||||||
})
|
|
||||||
.exec()
|
|
||||||
}, 1000)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss"></style>
|
|
||||||
@@ -3,23 +3,15 @@
|
|||||||
<view slot="body">
|
<view slot="body">
|
||||||
<view class="index">
|
<view class="index">
|
||||||
<!-- 运维 -->
|
<!-- 运维 -->
|
||||||
<YunWei v-if="userInfo.role == 1" :store="store" :projectList="projectList" :projectType="projectType" />
|
<YunWei v-if="userInfo.authorities === 'operation_manager'" />
|
||||||
<!-- 专职 -->
|
<!-- 专职 -->
|
||||||
<ZhuanZhi v-if="userInfo.role == 2" :store="store" :projectList="projectList" :projectType="projectType" />
|
<ZhuanZhi v-if="userInfo.authorities === 'market_user'" />
|
||||||
<!-- 工程 -->
|
<!-- 工程 -->
|
||||||
<GongCheng
|
<GongCheng v-if="userInfo.authorities === 'engineering_user'" />
|
||||||
v-if="userInfo.role == 3"
|
|
||||||
:store="store"
|
|
||||||
:gcList="gcList"
|
|
||||||
:projectList="projectList"
|
|
||||||
:projectType="projectType"
|
|
||||||
/>
|
|
||||||
<!-- 主用户 -->
|
<!-- 主用户 -->
|
||||||
<ZhuYongHu v-if="userInfo.role == 4" :store="store" :projectList="projectList" :projectType="projectType" />
|
<ZhuYongHu v-if="userInfo.authorities === 'app_vip_user'" />
|
||||||
<!-- 子用户 -->
|
<YouKe v-if="userInfo.authorities === 'tourist'"> </YouKe>
|
||||||
<ZiYongHu v-if="userInfo.role == 5" :store="store" :projectList="projectList" :projectType="projectType" />
|
<Device ref="device" :store="store" />
|
||||||
<YouKe v-if="userInfo.role == 6"> </YouKe>
|
|
||||||
<uni-fab ref="fab" direction="vertical" horizontal="right" vertical="bottom" :content="content" @trigger="trigger" />
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</Cn-page>
|
</Cn-page>
|
||||||
@@ -28,13 +20,10 @@
|
|||||||
import YunWei from './comp/indexYunWei.vue'
|
import YunWei from './comp/indexYunWei.vue'
|
||||||
import GongCheng from './comp/indexGongCheng.vue'
|
import GongCheng from './comp/indexGongCheng.vue'
|
||||||
import ZhuYongHu from './comp/indexZhuYongHu.vue'
|
import ZhuYongHu from './comp/indexZhuYongHu.vue'
|
||||||
import ZiYongHu from './comp/indexZiYongHu.vue'
|
|
||||||
import ZhuanZhi from './comp/indexZhuanZhi.vue'
|
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 list from '../../common/js/list'
|
import list from '../../common/js/list'
|
||||||
import { getProjectList } from '../../common/api/project'
|
|
||||||
import { queryDictData } from '../../common/api/dictionary'
|
|
||||||
import { queryEngineering } from '@/common/api/gc.js'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [list],
|
mixins: [list],
|
||||||
@@ -42,78 +31,16 @@ export default {
|
|||||||
YunWei,
|
YunWei,
|
||||||
GongCheng,
|
GongCheng,
|
||||||
ZhuYongHu,
|
ZhuYongHu,
|
||||||
ZiYongHu,
|
|
||||||
ZhuanZhi,
|
ZhuanZhi,
|
||||||
YouKe,
|
YouKe,
|
||||||
|
Device,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true,
|
loading: false,
|
||||||
userInfo: {
|
userInfo: {},
|
||||||
role: 4,
|
|
||||||
},
|
|
||||||
projectList: [],
|
|
||||||
gcList: [],
|
|
||||||
projectType: [
|
|
||||||
{
|
|
||||||
text: '全部类型',
|
|
||||||
value: 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '监测',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '用能',
|
|
||||||
value: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '环境',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '安防',
|
|
||||||
value: 4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '其他',
|
|
||||||
value: 5,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
content() {
|
|
||||||
let arr = [1, 3, 4]
|
|
||||||
let content = [
|
|
||||||
{
|
|
||||||
iconPath: '/static/mine3.png',
|
|
||||||
text: '运维管理',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
iconPath: '/static/mine3.png',
|
|
||||||
text: '专职管理',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
iconPath: '/static/mine3.png',
|
|
||||||
text: '工程',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
iconPath: '/static/mine3.png',
|
|
||||||
text: '主用户',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
iconPath: '/static/mine3.png',
|
|
||||||
text: '子用户',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
iconPath: '/static/mine3.png',
|
|
||||||
text: '游客',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
return content
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
send() {
|
send() {
|
||||||
uni.createPushMessage({
|
uni.createPushMessage({
|
||||||
@@ -127,145 +54,26 @@ export default {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
loadingChange(e) {
|
||||||
trigger(e) {
|
this.loading = e
|
||||||
if (e.index === 500) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/device/new',
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.userInfo.role = e.index + 1
|
|
||||||
uni.setStorageSync('userInfo', {
|
|
||||||
role: e.index + 1,
|
|
||||||
id: 1,
|
|
||||||
})
|
|
||||||
let roleName = ''
|
|
||||||
switch (e.index + 1) {
|
|
||||||
case 1:
|
|
||||||
roleName = '运维管理'
|
|
||||||
uni.removeTabBarBadge({
|
|
||||||
index: 1,
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 2:
|
|
||||||
roleName = '专职管理'
|
|
||||||
uni.removeTabBarBadge({
|
|
||||||
index: 1,
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 3:
|
|
||||||
roleName = '工程'
|
|
||||||
uni.removeTabBarBadge({
|
|
||||||
index: 1,
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 4:
|
|
||||||
roleName = '主用户'
|
|
||||||
uni.setTabBarBadge({
|
|
||||||
index: 1,
|
|
||||||
text: '6',
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 5:
|
|
||||||
roleName = '子用户'
|
|
||||||
uni.setTabBarBadge({
|
|
||||||
index: 1,
|
|
||||||
text: '6',
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 6:
|
|
||||||
roleName = '游客'
|
|
||||||
uni.setTabBarBadge({
|
|
||||||
index: 1,
|
|
||||||
text: '6',
|
|
||||||
})
|
|
||||||
break
|
|
||||||
}
|
|
||||||
this.$util.toast(roleName + '角色切换成功')
|
|
||||||
}
|
|
||||||
this.$refs.fab.close()
|
|
||||||
},
|
|
||||||
init() {
|
|
||||||
this.store = this.DataSource('/EquipmentDelivery/queryEquipmentByProject')
|
|
||||||
this.store.reload()
|
|
||||||
this.store.firstCallBack = () => {
|
|
||||||
this.loading = false
|
|
||||||
console.log(this.store)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getProjectList() {
|
|
||||||
getProjectList({
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 9999,
|
|
||||||
}).then((res) => {
|
|
||||||
console.log(res)
|
|
||||||
let arr = [
|
|
||||||
{
|
|
||||||
text: '全部项目',
|
|
||||||
value: '-1',
|
|
||||||
},
|
|
||||||
...res.data.records.map((item) => {
|
|
||||||
return {
|
|
||||||
text: item.name,
|
|
||||||
value: item.id,
|
|
||||||
...item,
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
arr.forEach((item) => {
|
|
||||||
if (this.projectList.findIndex((item2) => item2.value == item.value) === -1) {
|
|
||||||
this.projectList.push(item)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getGcList() {
|
|
||||||
queryEngineering().then((res) => {
|
|
||||||
this.gcList = res.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
queryDictData() {
|
|
||||||
queryDictData('项目类型').then((res) => {
|
|
||||||
this.projectType = [
|
|
||||||
{
|
|
||||||
text: '全部类型',
|
|
||||||
value: '',
|
|
||||||
},
|
|
||||||
...res.data.map((item) => {
|
|
||||||
return {
|
|
||||||
text: item.anotherName,
|
|
||||||
value: item.id,
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.init()
|
this.store = this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject')
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
if (!this.userInfo) {
|
if (
|
||||||
this.userInfo = {
|
this.userInfo.authorities === 'app_vip_user' ||
|
||||||
role: 4,
|
this.userInfo.authorities == 5 ||
|
||||||
id: 1,
|
this.userInfo.authorities === 'tourist'
|
||||||
}
|
) {
|
||||||
uni.setStorageSync('userInfo', {
|
|
||||||
role: 4,
|
|
||||||
id: 1,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (this.userInfo.role == 4 || this.userInfo.role == 5 || this.userInfo.role == 6) {
|
|
||||||
uni.setTabBarBadge({
|
uni.setTabBarBadge({
|
||||||
index: 1,
|
index: 1,
|
||||||
text: '6',
|
text: '6',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.getProjectList()
|
this.$refs.device && this.$refs.device.init()
|
||||||
if (this.userInfo.role == 3) {
|
|
||||||
this.getGcList()
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -6,24 +6,42 @@
|
|||||||
<view class="message-nav-label">系统</view>
|
<view class="message-nav-label">系统</view>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="message-nav" @click="jump('feedback')">
|
<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" />
|
<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>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="message-nav" @click="jump('report')" v-if="userInfo.role == '4' || userInfo.role == '5'|| userInfo.role == '6'">
|
<view
|
||||||
|
class="message-nav"
|
||||||
|
@click="jump('report')"
|
||||||
|
v-if="
|
||||||
|
userInfo.authorities == '4' || userInfo.authorities == '5' || userInfo.authorities == 'tourist'
|
||||||
|
"
|
||||||
|
>
|
||||||
<image mode="aspectFill" class="message-nav-icon" src="/static/report.png" />
|
<image mode="aspectFill" class="message-nav-icon" src="/static/report.png" />
|
||||||
<view class="message-nav-label">稳态越限</view>
|
<view class="message-nav-label">稳态越限</view>
|
||||||
<uni-badge text="3"></uni-badge>
|
<uni-badge text="3"></uni-badge>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="message-nav" @click="jump('incident')" v-if="userInfo.role == '4' || userInfo.role == '5'|| userInfo.role == '6'">
|
<view
|
||||||
|
class="message-nav"
|
||||||
|
@click="jump('incident')"
|
||||||
|
v-if="
|
||||||
|
userInfo.authorities == '4' || userInfo.authorities == '5' || userInfo.authorities == 'tourist'
|
||||||
|
"
|
||||||
|
>
|
||||||
<image mode="aspectFill" class="message-nav-icon" src="/static/incident.png" />
|
<image mode="aspectFill" class="message-nav-icon" src="/static/incident.png" />
|
||||||
<view class="message-nav-label">暂态事件</view>
|
<view class="message-nav-label">暂态事件</view>
|
||||||
<uni-badge text="2"></uni-badge>
|
<uni-badge text="2"></uni-badge>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="message-nav" @click="jump('term')" v-if="userInfo.role == '4' || userInfo.role == '5'|| userInfo.role == '6'">
|
<view
|
||||||
|
class="message-nav"
|
||||||
|
@click="jump('term')"
|
||||||
|
v-if="
|
||||||
|
userInfo.authorities == '4' || userInfo.authorities == '5' || userInfo.authorities == 'tourist'
|
||||||
|
"
|
||||||
|
>
|
||||||
<image mode="aspectFill" class="message-nav-icon" src="/static/term.png" />
|
<image mode="aspectFill" class="message-nav-icon" src="/static/term.png" />
|
||||||
<view class="message-nav-label">终端状态</view>
|
<view class="message-nav-label">终端状态</view>
|
||||||
<uni-badge text="1"></uni-badge>
|
<uni-badge text="1"></uni-badge>
|
||||||
@@ -35,47 +53,47 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
userInfo: {}
|
userInfo: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init () {
|
init() {
|
||||||
this.userInfo = uni.getStorageSync('userInfo')
|
this.userInfo = uni.getStorageSync('userInfo')
|
||||||
},
|
},
|
||||||
upgrade (code) {
|
upgrade(code) {
|
||||||
console.log(code);
|
console.log(code)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '升级成功',
|
title: '升级成功',
|
||||||
icon: 'none'
|
icon: 'none',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
jump (type) {
|
jump(type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'login':
|
case 'login':
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/user/login`
|
url: `/pages/user/login`,
|
||||||
})
|
})
|
||||||
break;
|
break
|
||||||
case 'gateway':
|
case 'gateway':
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/gateway/list`
|
url: `/pages/gateway/list`,
|
||||||
})
|
})
|
||||||
break;
|
break
|
||||||
case 'upgrade':
|
case 'upgrade':
|
||||||
this.$refs.inputDialog.open()
|
this.$refs.inputDialog.open()
|
||||||
break;
|
break
|
||||||
default:
|
default:
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/message/${type}`
|
url: `/pages/message/${type}`,
|
||||||
})
|
})
|
||||||
break;
|
break
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
onShow () {
|
onShow() {
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,25 +4,29 @@
|
|||||||
<view class="mine-header" @click="jump('basic')">
|
<view class="mine-header" @click="jump('basic')">
|
||||||
<image mode="aspectFill" class="mine-header-head" src="/static/head.png" />
|
<image mode="aspectFill" class="mine-header-head" src="/static/head.png" />
|
||||||
<view class="mine-header-name hide-txt">
|
<view class="mine-header-name hide-txt">
|
||||||
<view>灿能物联</view>
|
<view>{{ userInfo.nickname }}</view>
|
||||||
<view class="tag">{{ roleName }}</view>
|
<view></view>
|
||||||
|
<view class="tag">{{ roleName }} </view>
|
||||||
</view>
|
</view>
|
||||||
<image src="/static/erweima.png" style="height: 50rpx;width: 50rpx;border-radius:12rpx"
|
<image
|
||||||
mode="scaleToFill" />
|
src="/static/erweima.png"
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
style="height: 50rpx; width: 50rpx; border-radius: 12rpx"
|
||||||
|
mode="scaleToFill"
|
||||||
|
/>
|
||||||
|
<uni-icons type="forward" color="#aaa" size="16"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="mine-nav" v-if="userInfo.role == 6" @click="jump('upgrade')">
|
<view class="mine-nav" v-if="userInfo.authorities === 'tourist'" @click="jump('upgrade')">
|
||||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/server.png" />
|
<image mode="aspectFill" class="mine-nav-icon" src="/static/server.png" />
|
||||||
<view class="mine-nav-label">角色升级</view>
|
<view class="mine-nav-label">角色升级</view>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="mine-nav" @click="jump('audit')" v-if="userInfo.role == 4">
|
<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" />
|
<image mode="aspectFill" class="mine-nav-icon" src="/static/server.png" />
|
||||||
<view class="mine-nav-label">角色审核</view>
|
<view class="mine-nav-label">角色审核</view>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <view class="mine-nav" @click="jump('user')" v-if="userInfo.role == 4">
|
<!-- <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" />
|
<image mode="aspectFill" class="mine-nav-icon" src="/static/subordinate.png" />
|
||||||
<view class="mine-nav-label">子用户列表</view>
|
<view class="mine-nav-label">子用户列表</view>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
@@ -32,21 +36,35 @@
|
|||||||
<view class="mine-nav-label">扫一扫</view>
|
<view class="mine-nav-label">扫一扫</view>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="mine-nav" @click="jump('gc')"
|
<view class="mine-nav" @click="jump('engineering')" v-if="userInfo.authorities === 'engineering_user'">
|
||||||
v-if=" userInfo.role == 3 ">
|
|
||||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
|
<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>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="mine-nav" @click="jump('project')"
|
<view
|
||||||
v-if="userInfo.role == 4 || userInfo.role == 3 || userInfo.role == 2">
|
class="mine-nav"
|
||||||
|
@click="jump('project')"
|
||||||
|
v-if="
|
||||||
|
userInfo.authorities === 'app_vip_user' ||
|
||||||
|
userInfo.authorities === 'engineering_user' ||
|
||||||
|
userInfo.authorities === 'market_user'
|
||||||
|
"
|
||||||
|
>
|
||||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
|
<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>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="mine-nav" @click="jump('gateway')"
|
<view
|
||||||
v-if="userInfo.role == 4 || userInfo.role == 3 || userInfo.role == 5 || userInfo.role == 2"
|
class="mine-nav"
|
||||||
style="border-bottom: none; box-shadow: 0 4rpx 8rpx #e7e7e74c;">
|
@click="jump('gateway')"
|
||||||
|
v-if="
|
||||||
|
userInfo.authorities === 'app_vip_user' ||
|
||||||
|
userInfo.authorities === 'engineering_user' ||
|
||||||
|
userInfo.authorities == 5 ||
|
||||||
|
userInfo.authorities === 'market_user'
|
||||||
|
"
|
||||||
|
style="border-bottom: none; box-shadow: 0 4rpx 8rpx #e7e7e74c"
|
||||||
|
>
|
||||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/gateway.png" />
|
<image mode="aspectFill" class="mine-nav-icon" src="/static/gateway.png" />
|
||||||
<view class="mine-nav-label">网关列表</view>
|
<view class="mine-nav-label">网关列表</view>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
@@ -56,114 +74,119 @@
|
|||||||
<view class="mine-nav-label">消息配置</view>
|
<view class="mine-nav-label">消息配置</view>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="mine-nav" @click="jump('setup')" style="border-bottom: none; ">
|
<view class="mine-nav" @click="jump('setup')" style="border-bottom: none">
|
||||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/setup.png" />
|
<image mode="aspectFill" class="mine-nav-icon" src="/static/setup.png" />
|
||||||
<view class="mine-nav-label">设置</view>
|
<view class="mine-nav-label">设置</view>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<uni-popup ref="inputDialog" type="dialog">
|
<uni-popup ref="inputDialog" type="dialog">
|
||||||
<uni-popup-dialog ref="inputClose" mode="input" title="角色升级" placeholder="请输入六位邀请码"
|
<uni-popup-dialog
|
||||||
@confirm="upgrade"></uni-popup-dialog>
|
ref="inputClose"
|
||||||
|
mode="input"
|
||||||
|
title="角色升级"
|
||||||
|
placeholder="请输入六位邀请码"
|
||||||
|
@confirm="upgrade"
|
||||||
|
></uni-popup-dialog>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { roleUpdate } from '@/common/api/user'
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true,
|
loading: true,
|
||||||
userInfo: {}
|
userInfo: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
roleName () {
|
roleName() {
|
||||||
let roleName = ''
|
let roleName = ''
|
||||||
switch (this.userInfo.role) {
|
switch (this.userInfo.authorities) {
|
||||||
case 1:
|
case 'tourist':
|
||||||
roleName = '运维管理'
|
|
||||||
break
|
|
||||||
case 2:
|
|
||||||
roleName = '专职管理'
|
|
||||||
break
|
|
||||||
case 3:
|
|
||||||
roleName = '工程'
|
|
||||||
break
|
|
||||||
case 4:
|
|
||||||
roleName = '普通用户'
|
|
||||||
break
|
|
||||||
case 5:
|
|
||||||
roleName = '普通用户'
|
|
||||||
break
|
|
||||||
case 6:
|
|
||||||
roleName = '游客'
|
roleName = '游客'
|
||||||
break
|
break
|
||||||
|
case 'engineering_user':
|
||||||
|
roleName = '工程用户'
|
||||||
|
break
|
||||||
|
case 'app_vip_user':
|
||||||
|
roleName = 'VIP用户'
|
||||||
|
break
|
||||||
}
|
}
|
||||||
return roleName
|
return roleName
|
||||||
|
},
|
||||||
}
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.init()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init () {
|
init() {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
},
|
},
|
||||||
upgrade (code) {
|
upgrade(code) {
|
||||||
console.log(code);
|
console.log(code)
|
||||||
uni.showToast({
|
roleUpdate({
|
||||||
title: '升级成功',
|
referralCode: code,
|
||||||
icon: 'none'
|
userId: this.userInfo.userIndex,
|
||||||
|
}).then((res) => {
|
||||||
|
uni.removeStorage('engineering')
|
||||||
|
uni.showToast({
|
||||||
|
title: '升级成功',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
jump (type) {
|
jump(type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'scan':
|
case 'scan':
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log('条码类型:' + res.scanType);
|
console.log('条码类型:' + res.scanType)
|
||||||
console.log('条码内容:' + res.result);
|
console.log('条码内容:' + res.result)
|
||||||
}
|
},
|
||||||
});
|
})
|
||||||
break;
|
break
|
||||||
case 'login':
|
case 'login':
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/user/login`
|
url: `/pages/user/login`,
|
||||||
})
|
})
|
||||||
break;
|
break
|
||||||
case 'gateway':
|
case 'gateway':
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/gateway/list`
|
url: `/pages/gateway/list`,
|
||||||
})
|
})
|
||||||
break;
|
break
|
||||||
case 'upgrade':
|
case 'upgrade':
|
||||||
this.$refs.inputDialog.open()
|
this.$refs.inputDialog.open()
|
||||||
break;
|
break
|
||||||
case 'basic':
|
case 'basic':
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/user/basic`
|
url: `/pages/user/basic`,
|
||||||
})
|
})
|
||||||
break;
|
break
|
||||||
case 'project':
|
case 'project':
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/project/list`
|
url: `/pages/project/list`,
|
||||||
})
|
})
|
||||||
break;
|
break
|
||||||
case 'gc':
|
case 'engineering':
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/gc/list`
|
url: `/pages/engineering/list`,
|
||||||
})
|
})
|
||||||
break;
|
break
|
||||||
default:
|
default:
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/mine/${type}`
|
url: `/pages/mine/${type}`,
|
||||||
})
|
})
|
||||||
break;
|
break
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
onShow () {
|
onShow() {
|
||||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
|
console.log(this.userInfo)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -194,9 +217,20 @@ export default {
|
|||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
|
|
||||||
.tag {
|
.tag {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
|
.engineering-button {
|
||||||
|
margin-left: 10rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
padding: 5rpx 12rpx;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: 400;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
background: $uni-theme-blue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
this.store = this.DataSource('/feedback/queryFeedBackPage')
|
this.store = this.DataSource('/cs-device-boot/feedback/queryFeedBackPage')
|
||||||
this.store.params.userId = uni.getStorageSync('userInfo').id
|
this.store.params.userId = uni.getStorageSync('userInfo').id
|
||||||
this.store.reload()
|
this.store.reload()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.store = this.DataSource('/EquipmentDelivery/queryEquipmentByProject')
|
this.store = this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject')
|
||||||
this.store.params.projectId = this.project.id
|
this.store.params.projectId = this.project.id
|
||||||
this.store.reload()
|
this.store.reload()
|
||||||
|
|
||||||
@@ -212,12 +212,12 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
let userInfo = uni.getStorageSync('userInfo')
|
let userInfo = uni.getStorageSync('userInfo')
|
||||||
if (userInfo.role == '3') {
|
if (userInfo.authorities == '3') {
|
||||||
this.content.push({
|
this.content.push({
|
||||||
iconPath: '/static/transfer.png',
|
iconPath: '/static/transfer.png',
|
||||||
text: '移交',
|
text: '移交',
|
||||||
})
|
})
|
||||||
} else if (userInfo.role == '4') {
|
} else if (userInfo.authorities == '4') {
|
||||||
this.content.push({
|
this.content.push({
|
||||||
iconPath: '/static/share.png',
|
iconPath: '/static/share.png',
|
||||||
text: '分享',
|
text: '分享',
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
:fixed="true"
|
:fixed="true"
|
||||||
status-bar
|
status-bar
|
||||||
left-icon="left"
|
left-icon="left"
|
||||||
:rightIcon="userInfo.role == '2' ? '' : 'plusempty'"
|
:rightIcon="userInfo.authorities == '2' ? '' : 'plusempty'"
|
||||||
background-color="#fff"
|
background-color="#fff"
|
||||||
color="#111"
|
color="#111"
|
||||||
title="项目管理"
|
title="项目管理"
|
||||||
@@ -44,7 +44,8 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
this.store = this.DataSource('/project/queryProject')
|
this.store = this.DataSource('/cs-device-boot/project/queryProject')
|
||||||
|
this.store.params.engineeringId = uni.getStorageSync('engineering')?.id
|
||||||
this.store.reload()
|
this.store.reload()
|
||||||
},
|
},
|
||||||
back() {
|
back() {
|
||||||
@@ -76,8 +77,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;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { pinyin } from 'pinyin-pro'
|
import { pinyin } from 'pinyin-pro'
|
||||||
import { addAppProject } from '../../common/api/project'
|
import { addAppProject } from '../../common/api/project'
|
||||||
import { queryEngineering } from '@/common/api/gc.js'
|
import { queryEngineering } from '@/common/api/engineering.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<image class="login-box-logo" mode="widthFix" src="/static/logo.png"></image>
|
<image class="login-box-logo" mode="widthFix" src="/static/logo.png"></image>
|
||||||
<template v-if="loginType == 'yzm'">
|
<template v-if="loginType == 'yzm'">
|
||||||
<view class="login-box-input mt100">
|
<view class="login-box-input mt100">
|
||||||
<input class="login-box-input-main" maxlength="11" v-model="yzmForm.phone" placeholder="请输入手机号" />
|
<input class="login-box-input-main" maxlength="11" v-model="yzmForm.phone" placeholder="请输入手机号" />
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="login-box-input mt40">
|
<!-- <view class="login-box-input mt40">
|
||||||
<input class="login-box-input-main" v-model="yzmForm.imgCode" placeholder="图形验证码" />
|
<input class="login-box-input-main" v-model="yzmForm.imgCode" placeholder="图形验证码" />
|
||||||
@@ -143,7 +143,12 @@ export default {
|
|||||||
smsCode: this.yzmForm.code,
|
smsCode: this.yzmForm.code,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
uni.setStorageSync('userInfo', res.data)
|
uni.setStorageSync('access_token', res.data.token_type + ' ' + res.data.access_token)
|
||||||
|
uni.setStorageSync('refresh_token', res.data.refresh_token)
|
||||||
|
let strings = res.data.access_token.split('.') //截取token,获取载体
|
||||||
|
var userInfo = JSON.parse(decodeURIComponent(escape(window.atob(strings[1].replace(/-/g, '+').replace(/_/g, '/')))))
|
||||||
|
userInfo.authorities = userInfo.authorities[0]
|
||||||
|
uni.setStorageSync('userInfo', userInfo)
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/index/index',
|
url: '/pages/index/index',
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user