APPbug反馈修改
This commit is contained in:
10
App.vue
10
App.vue
@@ -3,7 +3,7 @@ import { queryDictDataCache } from './common/api/dictionary.js'
|
|||||||
import encrypt from './common/js/aes.js'
|
import encrypt from './common/js/aes.js'
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
console.log(window);
|
console.log(window)
|
||||||
// this.connect()
|
// this.connect()
|
||||||
console.log('App Launch')
|
console.log('App Launch')
|
||||||
let devCode = uni.getStorageSync('devCode')
|
let devCode = uni.getStorageSync('devCode')
|
||||||
@@ -14,9 +14,11 @@ export default {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
if (!uni.getStorageSync(this.$cacheKey.userInfo)) {
|
||||||
onShow: function () {
|
uni.reLaunch({
|
||||||
console.log('App Show')
|
url: '/pages/login/login',
|
||||||
|
})
|
||||||
|
}
|
||||||
queryDictDataCache().then((res) => {
|
queryDictDataCache().then((res) => {
|
||||||
uni.setStorageSync(this.$cacheKey.dictData, res.data)
|
uni.setStorageSync(this.$cacheKey.dictData, res.data)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ export const transferDevice = (id) => {
|
|||||||
url: '/cs-device-boot/deviceUser/transfer',
|
url: '/cs-device-boot/deviceUser/transfer',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
eid: id,
|
ids: id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,3 +48,23 @@ export function deleteEngineering(id) {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询工程配置列表
|
||||||
|
export function queryAllEnginner(params) {
|
||||||
|
return request({
|
||||||
|
url: '/cs-device-boot/csMarketData/queryAllEnginner',
|
||||||
|
method: 'post',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新工程配置
|
||||||
|
export function csMarketDataAdd(params) {
|
||||||
|
return request({
|
||||||
|
url: '/cs-device-boot/csMarketData/follow',
|
||||||
|
method: 'post',
|
||||||
|
data: params,
|
||||||
|
header: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,25 +2,41 @@ import request from '../js/request'
|
|||||||
import config from '../js/config'
|
import config from '../js/config'
|
||||||
|
|
||||||
export function addAppProject(params, files) {
|
export function addAppProject(params, files) {
|
||||||
return uni.uploadFile({
|
if (files.length === 0) {
|
||||||
url: config.domain + '/cs-device-boot/project/addAppProject', //仅为示例,非真实的接口地址
|
return request({
|
||||||
files: files,
|
url: '/cs-device-boot/project/addAppProject',
|
||||||
header: {
|
method: 'post',
|
||||||
Authorization: uni.getStorageSync('access_token'),
|
data: params,
|
||||||
},
|
})
|
||||||
formData: params,
|
} else {
|
||||||
})
|
return uni.uploadFile({
|
||||||
|
url: config.domain + '/cs-device-boot/project/addAppProject', //仅为示例,非真实的接口地址
|
||||||
|
files: files,
|
||||||
|
header: {
|
||||||
|
Authorization: uni.getStorageSync('access_token'),
|
||||||
|
},
|
||||||
|
formData: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 修改项目
|
// 修改项目
|
||||||
export function updateAppProject(params, files) {
|
export function updateAppProject(params, files) {
|
||||||
return uni.uploadFile({
|
if (files.length === 0) {
|
||||||
url: config.domain + '/cs-device-boot/project/auditAppProject', //仅为示例,非真实的接口地址
|
return request({
|
||||||
files: files,
|
url: '/cs-device-boot/project/updateAppProject',
|
||||||
header: {
|
method: 'post',
|
||||||
Authorization: uni.getStorageSync('access_token'),
|
data: params,
|
||||||
},
|
})
|
||||||
formData: params,
|
}else{
|
||||||
})
|
return uni.uploadFile({
|
||||||
|
url: config.domain + '/cs-device-boot/project/auditAppProject', //仅为示例,非真实的接口地址
|
||||||
|
files: files,
|
||||||
|
header: {
|
||||||
|
Authorization: uni.getStorageSync('access_token'),
|
||||||
|
},
|
||||||
|
formData: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getProjectList(params) {
|
export function getProjectList(params) {
|
||||||
@@ -101,4 +117,3 @@ export function addAppTopologyDiagram(params, filePath) {
|
|||||||
),
|
),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -149,22 +149,22 @@ page {
|
|||||||
margin: 0 20rpx;
|
margin: 0 20rpx;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-gap: 20rpx;
|
grid-gap: 20rpx;
|
||||||
grid-template-columns: 1fr 1fr 1fr;
|
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||||
.header-item {
|
.header-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 10rpx 10rpx 20rpx;
|
padding: 10rpx 10rpx 20rpx;
|
||||||
color: #111;
|
color: #fff;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
background: #fff;
|
background: $uni-theme-color;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
.header-item-value {
|
.header-item-value {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
}
|
}
|
||||||
.header-item-label{
|
.header-item-label {
|
||||||
font-size: 28rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -182,18 +182,21 @@ page {
|
|||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
|
||||||
.nav-menu {
|
.nav-menu {
|
||||||
padding: 10rpx 20rpx;
|
padding: 6rpx 20rpx;
|
||||||
margin-left: 20rpx;
|
margin-left: 20rpx;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
font-size: 28rpx;
|
font-size: 24rpx;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
background: #ebeaec;
|
background: #ebeaec;
|
||||||
color: #666;
|
color: #666;
|
||||||
|
|
||||||
&-active {
|
&-active {
|
||||||
background: #dfe5f7;
|
background: #dfe5f7;
|
||||||
color: $uni-theme-color;
|
color: $uni-theme-color;
|
||||||
}
|
}
|
||||||
|
&-btn {
|
||||||
|
background: $uni-theme-color;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
export default {
|
export default {
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.store && this.store.reload();
|
this.store && this.store.reload()
|
||||||
this.store.loadedCallback = () => {
|
this.store.loadedCallback = () => {
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh()
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (this.store.status != 'noMore') {
|
if (this.store.status != 'noMore') {
|
||||||
this.store.next && this.store.next();
|
this.store.next && this.store.next()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
store: {},
|
store: {},
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
DataSource(url) {
|
DataSource(url) {
|
||||||
var me = this;
|
var me = this
|
||||||
return {
|
return {
|
||||||
data: [],
|
data: [],
|
||||||
status: 'more',
|
status: 'more',
|
||||||
@@ -31,11 +31,11 @@ export default {
|
|||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
},
|
},
|
||||||
reload() {
|
reload() {
|
||||||
this.data = [];
|
this.data = []
|
||||||
this.status = 'loading';
|
this.status = 'loading'
|
||||||
this.empty = false;
|
this.empty = false
|
||||||
this.params.pageNum = 1;
|
this.params.pageNum = 1
|
||||||
this.next();
|
this.next()
|
||||||
},
|
},
|
||||||
callBack: null,
|
callBack: null,
|
||||||
firstCallBack: null,
|
firstCallBack: null,
|
||||||
@@ -47,37 +47,35 @@ export default {
|
|||||||
header: this.header,
|
header: this.header,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.warn(res);
|
console.warn(res)
|
||||||
let resultData =
|
let resultData = res.data?.list || res.data?.records || []
|
||||||
res.data?.list || res.data?.records || [];
|
|
||||||
if (this.params.pageNum == 1) {
|
if (this.params.pageNum == 1) {
|
||||||
this.data = resultData;
|
this.data = resultData
|
||||||
if (resultData.length == 0 || resultData == 0) {
|
if (resultData.length == 0 || resultData == 0) {
|
||||||
this.empty = true;
|
this.empty = true
|
||||||
} else if (
|
this.status = 'noMore'
|
||||||
resultData.length < this.params.pageSize
|
} else if (resultData.length < this.params.pageSize) {
|
||||||
) {
|
this.status = 'noMore'
|
||||||
this.status = 'noMore';
|
|
||||||
} else if (res.total == resultData.length) {
|
} else if (res.total == resultData.length) {
|
||||||
this.status = 'noMore';
|
this.status = 'noMore'
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.data.push(...resultData);
|
this.data.push(...resultData)
|
||||||
if (resultData.length < this.params.pageSize) {
|
if (resultData.length < this.params.pageSize) {
|
||||||
this.status = 'noMore';
|
this.status = 'noMore'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.params.pageNum == 1) {
|
if (this.params.pageNum == 1) {
|
||||||
this.firstCallBack && this.firstCallBack();
|
this.firstCallBack && this.firstCallBack()
|
||||||
}
|
}
|
||||||
this.loadedCallback && this.loadedCallback();
|
this.loadedCallback && this.loadedCallback()
|
||||||
this.params.pageNum++;
|
this.params.pageNum++
|
||||||
this.total = res.total;
|
this.total = res.total
|
||||||
this.loading = false;
|
this.loading = false
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export default (options = {}) => {
|
|||||||
}
|
}
|
||||||
uni.request({
|
uni.request({
|
||||||
url,
|
url,
|
||||||
|
timeout: 5000,
|
||||||
data: {
|
data: {
|
||||||
...options.data,
|
...options.data,
|
||||||
},
|
},
|
||||||
@@ -65,6 +66,7 @@ export default (options = {}) => {
|
|||||||
* @param {Number} code 错误码
|
* @param {Number} code 错误码
|
||||||
*/
|
*/
|
||||||
function errHandler(res) {
|
function errHandler(res) {
|
||||||
|
console.log(res);
|
||||||
switch (res.code) {
|
switch (res.code) {
|
||||||
case 'A0024':
|
case 'A0024':
|
||||||
uni.reLaunch({ url: '/pages/user/login' })
|
uni.reLaunch({ url: '/pages/user/login' })
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export default {
|
|||||||
position: relative;
|
position: relative;
|
||||||
width: 80rpx;
|
width: 80rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
background: $uni-theme-yellow;
|
background: $uni-theme-color;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
|
|
||||||
.grid-card-content-item-icon-2 {
|
.grid-card-content-item-icon-2 {
|
||||||
@@ -64,7 +64,7 @@ export default {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 16rpx;
|
margin-top: 16rpx;
|
||||||
color: #111;
|
color: #111;
|
||||||
font-size: 28rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
"name" : "灿能物联",
|
"name" : "灿能物联",
|
||||||
"appid" : "__UNI__88BC25B",
|
"appid" : "__UNI__88BC25B",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.4",
|
"versionName" : "1.0.7",
|
||||||
"versionCode" : 103,
|
"versionCode" : 107,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
@@ -132,7 +132,7 @@
|
|||||||
"/api" : {
|
"/api" : {
|
||||||
"https" : true,
|
"https" : true,
|
||||||
// "target" : "https://china.indpecker.com",
|
// "target" : "https://china.indpecker.com",
|
||||||
"target" : "http://192.168.1.13:10215",
|
"target" : "http://192.168.1.139:10215",
|
||||||
"changOrigin" : true,
|
"changOrigin" : true,
|
||||||
"pathRewrite" : {
|
"pathRewrite" : {
|
||||||
"/api" : ""
|
"/api" : ""
|
||||||
|
|||||||
25
pages.json
25
pages.json
@@ -4,8 +4,23 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/index/index",
|
"path": "pages/index/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationStyle": "custom",
|
"app-plus": {
|
||||||
"navigationBarTextStyle": "white"
|
"bounce": "none", //关闭窗口回弹效果
|
||||||
|
"titleNView": {
|
||||||
|
"titleText": "灿能物联", // 窗口的标题
|
||||||
|
"titleAlign": "left",
|
||||||
|
"padding-left": "16rpx",
|
||||||
|
"padding-right": "20rpx",
|
||||||
|
"buttons": [
|
||||||
|
{
|
||||||
|
"text": "请选择工程",
|
||||||
|
"fontSize": "28rpx",
|
||||||
|
"select": true,
|
||||||
|
"width": "auto"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -317,6 +332,12 @@
|
|||||||
"navigationBarTitleText": "工程详情"
|
"navigationBarTitleText": "工程详情"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/engineering/setting",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "关注工程配置"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/user/erweima",
|
"path": "pages/user/erweima",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
@@ -137,9 +137,9 @@ export default {
|
|||||||
{
|
{
|
||||||
text: '功率',
|
text: '功率',
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
text: '波形',
|
// text: '波形',
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
text: 'I/O',
|
text: 'I/O',
|
||||||
},
|
},
|
||||||
@@ -238,56 +238,29 @@ export default {
|
|||||||
uni.pageScrollTo({ scrollTop: 0, duration: 0 })
|
uni.pageScrollTo({ scrollTop: 0, duration: 0 })
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
switch (this.userInfo.authorities) {
|
if (this.isPrimaryUser == 1) {
|
||||||
case 1:
|
this.content.splice(
|
||||||
this.content.splice(0, 1)
|
0,
|
||||||
this.content.splice(
|
0,
|
||||||
0,
|
{
|
||||||
0,
|
iconPath: '/static/transfer.png',
|
||||||
{
|
text: '移交',
|
||||||
iconPath: '/static/version.png',
|
},
|
||||||
text: '版本',
|
{
|
||||||
},
|
iconPath: '/static/feedback.png',
|
||||||
{
|
text: '编辑',
|
||||||
iconPath: '/static/template.png',
|
},
|
||||||
text: '模版',
|
{
|
||||||
},
|
iconPath: '/static/delate.png',
|
||||||
)
|
text: '删除',
|
||||||
break
|
},
|
||||||
case 2:
|
)
|
||||||
this.content.splice(0, 1)
|
if (this.userInfo.authorities === 'app_vip_user') {
|
||||||
break
|
this.content.splice(3, 0, {
|
||||||
case 4:
|
iconPath: '/static/share.png',
|
||||||
this.content.splice(
|
text: '分享',
|
||||||
1,
|
})
|
||||||
0,
|
}
|
||||||
{
|
|
||||||
iconPath: '/static/delate.png',
|
|
||||||
text: '报表',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
iconPath: '/static/feedback.png',
|
|
||||||
text: '反馈',
|
|
||||||
},
|
|
||||||
)
|
|
||||||
break
|
|
||||||
case 5:
|
|
||||||
this.content.splice(
|
|
||||||
2,
|
|
||||||
0,
|
|
||||||
{
|
|
||||||
iconPath: '/static/table.png',
|
|
||||||
text: '报表',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
iconPath: '/static/feedback.png',
|
|
||||||
text: '反馈',
|
|
||||||
},
|
|
||||||
)
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
renderFinish(e) {
|
renderFinish(e) {
|
||||||
@@ -387,26 +360,7 @@ export default {
|
|||||||
|
|
||||||
this.devId = options.id
|
this.devId = options.id
|
||||||
this.isPrimaryUser = options.isPrimaryUser
|
this.isPrimaryUser = options.isPrimaryUser
|
||||||
if (this.isPrimaryUser == 1) {
|
|
||||||
this.content.splice(0, 0, {
|
|
||||||
iconPath: '/static/delate.png',
|
|
||||||
text: '删除',
|
|
||||||
})
|
|
||||||
this.content.splice(0, 0, {
|
|
||||||
iconPath: '/static/feedback.png',
|
|
||||||
text: '编辑',
|
|
||||||
})
|
|
||||||
this.content.splice(0, 0, {
|
|
||||||
iconPath: '/static/transfer.png',
|
|
||||||
text: '移交',
|
|
||||||
})
|
|
||||||
if (this.userInfo.authorities !== 'engineering_user') {
|
|
||||||
this.content.splice(0, 0, {
|
|
||||||
iconPath: '/static/share.png',
|
|
||||||
text: '分享',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.init()
|
this.init()
|
||||||
queryTopologyDiagram(options.id).then((res) => {
|
queryTopologyDiagram(options.id).then((res) => {
|
||||||
this.deviceInfo = res.data
|
this.deviceInfo = res.data
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<Cn-empty v-if="projectList.length == 0"></Cn-empty>
|
<Cn-empty v-if="projectList.length == 0"></Cn-empty>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<uni-card
|
<uni-card
|
||||||
:title="item.equipmentName"
|
:title="item.name"
|
||||||
:sub-title="item.projectName"
|
:sub-title="item.projectName"
|
||||||
:extra="item.projectType"
|
:extra="item.projectType"
|
||||||
padding="0"
|
padding="0"
|
||||||
@@ -76,6 +76,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.device-list {
|
.device-list {
|
||||||
|
padding-top: 20rpx;
|
||||||
.header {
|
.header {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|||||||
@@ -93,14 +93,14 @@ export default {
|
|||||||
// },
|
// },
|
||||||
],
|
],
|
||||||
content: [
|
content: [
|
||||||
{
|
// {
|
||||||
iconPath: '/static/share.png',
|
// iconPath: '/static/share.png',
|
||||||
text: '编辑',
|
// text: '编辑',
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
iconPath: '/static/delate.png',
|
// iconPath: '/static/delate.png',
|
||||||
text: '删除',
|
// text: '删除',
|
||||||
},
|
// },
|
||||||
],
|
],
|
||||||
navHeight: 0,
|
navHeight: 0,
|
||||||
navMenuActive: 0,
|
navMenuActive: 0,
|
||||||
@@ -177,16 +177,17 @@ export default {
|
|||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.engineering = JSON.parse(decodeURIComponent(option.engineering))
|
this.engineering = JSON.parse(decodeURIComponent(option.engineering))
|
||||||
let userInfo = uni.getStorageSync('userInfo')
|
let userInfo = uni.getStorageSync('userInfo')
|
||||||
if (userInfo.authorities == '3') {
|
if (userInfo.authorities == 'engineering_user' || userInfo.authorities == 'app_vip_user') {
|
||||||
this.content.push({
|
this.content.push(
|
||||||
iconPath: '/static/transfer.png',
|
{
|
||||||
text: '移交',
|
iconPath: '/static/share.png',
|
||||||
})
|
text: '编辑',
|
||||||
} else if (userInfo.authorities == '4') {
|
},
|
||||||
this.content.push({
|
{
|
||||||
iconPath: '/static/share.png',
|
iconPath: '/static/delate.png',
|
||||||
text: '分享',
|
text: '删除',
|
||||||
})
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// 获取nav高度
|
// 获取nav高度
|
||||||
|
|||||||
@@ -6,7 +6,11 @@
|
|||||||
:fixed="true"
|
:fixed="true"
|
||||||
status-bar
|
status-bar
|
||||||
left-icon="left"
|
left-icon="left"
|
||||||
:rightIcon="userInfo.authorities == '2' ? '' : 'plusempty'"
|
:rightIcon="
|
||||||
|
userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'
|
||||||
|
? 'plusempty'
|
||||||
|
: ''
|
||||||
|
"
|
||||||
background-color="#fff"
|
background-color="#fff"
|
||||||
color="#111"
|
color="#111"
|
||||||
title="工程管理"
|
title="工程管理"
|
||||||
@@ -50,17 +54,17 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
|
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
this.store = this.DataSource('/cs-device-boot/engineering/queryEngineeringPage')
|
this.store = this.DataSource('/cs-device-boot/engineering/queryEngineeringPage')
|
||||||
this.store.params.userId = uni.getStorageSync('userInfo').id
|
|
||||||
this.store.reload()
|
this.store.reload()
|
||||||
this.store.firstCallBack = (res) => {
|
this.store.firstCallBack = (res) => {
|
||||||
let engineering = uni.getStorageSync('engineering')
|
let engineering = uni.getStorageSync('engineering')
|
||||||
if (!engineering) {
|
if (!engineering) {
|
||||||
uni.setStorageSync('engineering',this.store.data[0])
|
uni.setStorageSync('engineering', this.store.data[0])
|
||||||
}else{
|
} else {
|
||||||
this.store.data.forEach((item) => {
|
this.store.data.forEach((item) => {
|
||||||
if (item.id == engineering.id) {
|
if (item.id == engineering.id) {
|
||||||
uni.setStorageSync('engineering',item)
|
uni.setStorageSync('engineering', item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<view slot="body">
|
<view slot="body">
|
||||||
<view class="new">
|
<view class="new">
|
||||||
<view class="content">
|
<view class="content">
|
||||||
|
<page-meta :page-style="'overflow:'+(show?'hidden':'visible')"></page-meta>
|
||||||
<uni-forms :label-width="80">
|
<uni-forms :label-width="80">
|
||||||
<uni-forms-item label="工程名称">
|
<uni-forms-item label="工程名称">
|
||||||
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入工程名称" />
|
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入工程名称" />
|
||||||
@@ -14,7 +15,7 @@
|
|||||||
<uni-icons type="location" color="#007aff" size="26" class="ml20"
|
<uni-icons type="location" color="#007aff" size="26" class="ml20"
|
||||||
@click="chooseLocation"></uni-icons>
|
@click="chooseLocation"></uni-icons>
|
||||||
</view> -->
|
</view> -->
|
||||||
<uni-data-picker :localdata="localdata" @change="areaChange" v-model="value">
|
<uni-data-picker :localdata="localdata" @change="areaChange" v-model="value" @popupopened="show=true" @popupclosed="show=false">
|
||||||
</uni-data-picker>
|
</uni-data-picker>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="描述">
|
<uni-forms-item label="描述">
|
||||||
@@ -50,6 +51,7 @@ export default {
|
|||||||
province: '',
|
province: '',
|
||||||
},
|
},
|
||||||
engineering: {},
|
engineering: {},
|
||||||
|
show: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
|||||||
201
pages/engineering/setting.vue
Normal file
201
pages/engineering/setting.vue
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
<template>
|
||||||
|
<view :loading="loading">
|
||||||
|
<uni-search-bar v-model="keyWord" bgColor="#fff" placeholder="请输入关键词"></uni-search-bar>
|
||||||
|
<view class="message">
|
||||||
|
<!-- <uni-card
|
||||||
|
:title="item.engineerName"
|
||||||
|
:extra="item.projectType"
|
||||||
|
@click="jump(item)"
|
||||||
|
v-for="(item, index) in list"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<view class="term-list-bottom">
|
||||||
|
<view class="term-list-bottom-item">
|
||||||
|
<view>区域</view>
|
||||||
|
<view>{{ item.provinceName + item.cityName }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="term-list-bottom-item">
|
||||||
|
<view>创建时间</view>
|
||||||
|
<view>{{ item.createTime }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-card> -->
|
||||||
|
<uni-list>
|
||||||
|
<uni-list-item @click="jump(item)" v-for="(item, index) in filterList" :key="index">
|
||||||
|
<template v-slot:header>
|
||||||
|
<view class="slot-box">
|
||||||
|
<view class="slot-box-left hide-txt mr20">{{ item.engineerName }}</view>
|
||||||
|
<switch
|
||||||
|
:checked="selectList.indexOf(item.engineerId) > -1"
|
||||||
|
style="transform: scale(0.8)"
|
||||||
|
@change="switchChange(item)"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</uni-list-item>
|
||||||
|
</uni-list>
|
||||||
|
<uni-load-more v-if="list && list.length > 0" status="nomore"></uni-load-more>
|
||||||
|
<Cn-empty v-else style="padding-top: 300rpx"></Cn-empty>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import list from '../../common/js/list'
|
||||||
|
import { queryAllEnginner, csMarketDataAdd } from '@/common/api/engineering'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: true,
|
||||||
|
userInfo: {},
|
||||||
|
list: [],
|
||||||
|
selectList: [],
|
||||||
|
keyWord: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
filterList() {
|
||||||
|
return this.list.filter((item) => {
|
||||||
|
return item.engineerName.indexOf(this.keyWord) > -1
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
switchChange(e) {
|
||||||
|
console.log(e)
|
||||||
|
let index = this.selectList.indexOf(e.engineerId)
|
||||||
|
if (index > -1) {
|
||||||
|
this.selectList.splice(index, 1)
|
||||||
|
} else {
|
||||||
|
this.selectList.push(e.engineerId)
|
||||||
|
}
|
||||||
|
|
||||||
|
csMarketDataAdd({
|
||||||
|
engineerIds: this.selectList,
|
||||||
|
}).then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
init() {
|
||||||
|
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
|
queryAllEnginner().then((res) => {
|
||||||
|
this.list = res.data
|
||||||
|
console.log(this.list)
|
||||||
|
this.selectList = res.data.filter((item) => item.isSelect === '1').map((item) => item.engineerId)
|
||||||
|
console.log(this.selectList)
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
back() {
|
||||||
|
uni.navigateBack()
|
||||||
|
},
|
||||||
|
add() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/engineering/new`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
upgrade(code) {
|
||||||
|
console.log(code)
|
||||||
|
uni.showToast({
|
||||||
|
title: '升级成功',
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
jump(engineering) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/engineering/detail?engineering=${encodeURIComponent(JSON.stringify(engineering))}`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoad() {
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.message {
|
||||||
|
/deep/ .slot-box {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
&-left {
|
||||||
|
flex: 1;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/deep/ .uni-list-item__content {
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
.message-header {
|
||||||
|
padding: 200rpx 34rpx 34rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
background: $uni-theme-white;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
box-shadow: 0 4rpx 8rpx #e7e7e74c;
|
||||||
|
|
||||||
|
.message-header-head {
|
||||||
|
margin-right: 30rpx;
|
||||||
|
height: 128rpx;
|
||||||
|
width: 128rpx;
|
||||||
|
border-radius: $uni-theme-radius;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message-header-name {
|
||||||
|
margin-right: 30rpx;
|
||||||
|
flex: 1;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #111;
|
||||||
|
font-weight: 700;
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
margin-top: 10rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #aaa;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.message-nav {
|
||||||
|
padding: 34rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
background: $uni-theme-white;
|
||||||
|
border-bottom: 1rpx solid #e8e8e8;
|
||||||
|
|
||||||
|
&-icon {
|
||||||
|
margin-right: 30rpx;
|
||||||
|
height: 44rpx;
|
||||||
|
width: 44rpx;
|
||||||
|
border-radius: $uni-theme-radius;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-label {
|
||||||
|
margin-right: 30rpx;
|
||||||
|
flex: 1;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #111;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.term-list-bottom {
|
||||||
|
.term-list-bottom-item {
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
// view:first-of-type{
|
||||||
|
// color: #111;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
.term-list-bottom-item:last-of-type {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -16,6 +16,26 @@
|
|||||||
<uni-icons type="bottom" size="14" color="#666"></uni-icons>
|
<uni-icons type="bottom" size="14" color="#666"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
|
<view style="flex: 1"></view>
|
||||||
|
<template v-if="deviceListFilter.length">
|
||||||
|
<template v-if="transfer || share">
|
||||||
|
<view class="nav-menu nav-menu-btn" @click="submit">完成 </view>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<view
|
||||||
|
class="nav-menu nav-menu-btn"
|
||||||
|
@click="transfer = true"
|
||||||
|
v-if="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'"
|
||||||
|
>移交
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
class="nav-menu nav-menu-btn"
|
||||||
|
@click="share = true"
|
||||||
|
v-if="userInfo.authorities === 'app_vip_user'"
|
||||||
|
>分享
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
<!-- <picker @change="projectTypeChange" :value="select.projectTypeIndex" :range="projectType" range-key="text">
|
<!-- <picker @change="projectTypeChange" :value="select.projectTypeIndex" :range="projectType" range-key="text">
|
||||||
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectType }"
|
<view class="nav-menu" :class="{ 'nav-menu-active': select.projectType }"
|
||||||
>{{ select.projectType || '类型' }}
|
>{{ select.projectType || '类型' }}
|
||||||
@@ -31,15 +51,25 @@
|
|||||||
v-for="(item, index) in deviceListFilter"
|
v-for="(item, index) in deviceListFilter"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="jump(item)"
|
@click="jump(item)"
|
||||||
thumbnail="/static/device.png"
|
:thumbnail="deviceIcon(item.runStatus)"
|
||||||
>
|
>
|
||||||
<!-- <text>{{ item.project }} {{ item.type }}</text> -->
|
<!-- <text>{{ item.project }} {{ item.type }}</text> -->
|
||||||
|
<template v-slot:title v-if="transfer || share">
|
||||||
|
<view class="switch-title">
|
||||||
|
<view class="switch-title-left">{{ item.equipmentName }}</view>
|
||||||
|
<switch
|
||||||
|
:checked="checkList.indexOf(item.equipmentId) > -1"
|
||||||
|
style="transform: scale(0.8)"
|
||||||
|
@change="switchChange(item)"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
</uni-card>
|
</uni-card>
|
||||||
<Cn-empty v-if="store.empty || deviceListFilter.length == 0"></Cn-empty>
|
|
||||||
<uni-load-more
|
<uni-load-more
|
||||||
v-if="deviceListFilter && deviceListFilter.length > 0"
|
v-if="store.status == 'loading' || deviceListFilter.length > 0"
|
||||||
:status="store.status"
|
:status="store.status"
|
||||||
></uni-load-more>
|
></uni-load-more>
|
||||||
|
<Cn-empty v-else></Cn-empty>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -56,6 +86,9 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
|
transfer: false,
|
||||||
|
share: false,
|
||||||
|
checkList: [],
|
||||||
select: {
|
select: {
|
||||||
projectName: '',
|
projectName: '',
|
||||||
projectNameIndex: 0,
|
projectNameIndex: 0,
|
||||||
@@ -67,6 +100,7 @@ export default {
|
|||||||
projectList: [],
|
projectList: [],
|
||||||
projectType: [],
|
projectType: [],
|
||||||
navHeight: 0,
|
navHeight: 0,
|
||||||
|
userInfo: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -84,39 +118,66 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
setTimeout(() => {
|
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
// 获取nav高度
|
|
||||||
uni.createSelectorQuery()
|
|
||||||
.select('.uni-navbar')
|
|
||||||
.boundingClientRect((rect1) => {
|
|
||||||
this.navHeight = rect1.height
|
|
||||||
// 获取nav高度
|
|
||||||
uni.createSelectorQuery()
|
|
||||||
.select('.nav')
|
|
||||||
.boundingClientRect((rect2) => {
|
|
||||||
// #ifdef H5
|
|
||||||
this.minHeight =
|
|
||||||
'calc(100vh - env(safe-area-inset-bottom) - ' +
|
|
||||||
(50 + (rect2.height + rect1.height)) +
|
|
||||||
'px)'
|
|
||||||
// #endif
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
this.minHeight = 'calc(100vh - ' + (rect2.height + rect1.height) + 'px)'
|
|
||||||
// #endif
|
|
||||||
})
|
|
||||||
.exec()
|
|
||||||
})
|
|
||||||
.exec()
|
|
||||||
}, 1000)
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
deviceIcon(e) {
|
||||||
|
let str = ''
|
||||||
|
switch (e) {
|
||||||
|
case 1:
|
||||||
|
str = '/static/device_bad.png'
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
str = '/static/device.png'
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
str = '/static/device.png'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return str
|
||||||
|
},
|
||||||
|
switchChange(e) {
|
||||||
|
console.log(e)
|
||||||
|
let index = this.checkList.indexOf(e.equipmentId)
|
||||||
|
if (index > -1) {
|
||||||
|
this.checkList.splice(index, 1)
|
||||||
|
} else {
|
||||||
|
this.checkList.push(e.equipmentId)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
console.log(this.checkList)
|
||||||
|
if (this.transfer) {
|
||||||
|
this.transfer = false
|
||||||
|
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.checkList.join(',') })
|
||||||
|
} else if (this.share) {
|
||||||
|
this.share = false
|
||||||
|
this.$emit('share', this.shareList)
|
||||||
|
}
|
||||||
|
this.checkList = []
|
||||||
|
},
|
||||||
async init() {
|
async init() {
|
||||||
this.getProjectList()
|
this.getProjectList()
|
||||||
this.getDeviceList()
|
this.getDeviceList()
|
||||||
},
|
},
|
||||||
getDeviceList() {
|
getDeviceList() {
|
||||||
this.store.params.pageSize = 999
|
this.store.params.pageSize = 999
|
||||||
|
this.store.firstCallBack = () => {
|
||||||
|
// 获取nav高度
|
||||||
|
uni.createSelectorQuery()
|
||||||
|
.select('.nav')
|
||||||
|
.boundingClientRect((rect2) => {
|
||||||
|
if (!rect2) return
|
||||||
|
// #ifdef H5
|
||||||
|
this.minHeight = 'calc(100vh - env(safe-area-inset-bottom) - ' + (50 + rect2.height) + 'px)'
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
this.minHeight = 'calc(100vh - ' + rect2.height + 'px)'
|
||||||
|
// #endif
|
||||||
|
})
|
||||||
|
.exec()
|
||||||
|
}
|
||||||
this.store.reload()
|
this.store.reload()
|
||||||
},
|
},
|
||||||
getProjectList() {
|
getProjectList() {
|
||||||
@@ -214,4 +275,14 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss"></style>
|
<style lang="scss">
|
||||||
|
/deep/ .switch-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
&-left {
|
||||||
|
flex: 1;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,21 +1,40 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="index-zhuyonghu">
|
<view class="index-zhuyonghu">
|
||||||
<div class="header">
|
<view class="canneng-index-title mb20">所有工程统计信息</view>
|
||||||
<div class="header-item">
|
<view class="header">
|
||||||
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
|
<view class="header-item">
|
||||||
<div class="header-item-label">正常设备</div>
|
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
|
||||||
</div>
|
<view class="header-item-label">设备总数</view>
|
||||||
<div class="header-item" @click="jump('alarmLineDevs')">
|
</view>
|
||||||
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
|
<view class="header-item" @click="jump('onLineDevs')">
|
||||||
<div class="header-item-label">报警设备</div>
|
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
|
||||||
</div>
|
<view class="header-item-label">在线设备</view>
|
||||||
<div class="header-item" @click="jump('offLineDevs')">
|
</view>
|
||||||
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
|
<view class="header-item" @click="jump('offLineDevs')">
|
||||||
<div class="header-item-label">离线设备</div>
|
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
|
||||||
</div>
|
<view class="header-item-label">离线设备</view>
|
||||||
</div>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
|
||||||
|
<view class="header">
|
||||||
|
<view class="header-item">
|
||||||
|
<view class="header-item-value">{{
|
||||||
|
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
|
||||||
|
}}</view>
|
||||||
|
<view class="header-item-label">设备总数</view>
|
||||||
|
</view>
|
||||||
|
<view class="header-item" @click="jump('currentOnLineDevs')">
|
||||||
|
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
|
||||||
|
<view class="header-item-label">在线设备</view>
|
||||||
|
</view>
|
||||||
|
<view class="header-item" @click="jump('currentOffLineDevs')">
|
||||||
|
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
|
||||||
|
<view class="header-item-label">离线设备</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="canneng-index-title mt20">常用功能</view>
|
||||||
<view style="padding: 20rpx 20rpx 0">
|
<view style="padding: 20rpx 20rpx 0">
|
||||||
<Cn-grid title="常用功能">
|
<Cn-grid title="">
|
||||||
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
|
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
|
||||||
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
|
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
|
||||||
<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>
|
||||||
@@ -67,22 +86,14 @@ export default {
|
|||||||
},
|
},
|
||||||
jump(type) {
|
jump(type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'alarmLineDevs':
|
|
||||||
uni.navigateTo({
|
|
||||||
url:
|
|
||||||
'/pages/device/list?type=alarmLineDevs&projectList=' +
|
|
||||||
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 'offLineDevs':
|
|
||||||
uni.navigateTo({
|
|
||||||
url:
|
|
||||||
'/pages/device/list?type=offLineDevs&projectList=' +
|
|
||||||
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
|
|
||||||
})
|
|
||||||
break
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
uni.navigateTo({
|
||||||
|
url:
|
||||||
|
'/pages/device/list?type=' +
|
||||||
|
type +
|
||||||
|
'&projectList=' +
|
||||||
|
encodeURIComponent(JSON.stringify(this.devCount[type])),
|
||||||
|
})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,19 +1,37 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="index-zhuyonghu">
|
<view class="index-zhuyonghu">
|
||||||
<div class="header">
|
<view class="canneng-index-title mb20">所有工程统计信息</view>
|
||||||
<div class="header-item">
|
<view class="header">
|
||||||
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
|
<view class="header-item">
|
||||||
<div class="header-item-label">正常设备</div>
|
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
|
||||||
</div>
|
<view class="header-item-label">设备总数</view>
|
||||||
<div class="header-item" @click="jump('alarmLineDevs')">
|
</view>
|
||||||
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
|
<view class="header-item" @click="jump('onLineDevs')">
|
||||||
<div class="header-item-label">报警设备</div>
|
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
|
||||||
</div>
|
<view class="header-item-label">在线设备</view>
|
||||||
<div class="header-item" @click="jump('offLineDevs')">
|
</view>
|
||||||
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
|
<view class="header-item" @click="jump('offLineDevs')">
|
||||||
<div class="header-item-label">离线设备</div>
|
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
|
||||||
</div>
|
<view class="header-item-label">离线设备</view>
|
||||||
</div>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
|
||||||
|
<view class="header">
|
||||||
|
<view class="header-item">
|
||||||
|
<view class="header-item-value">{{
|
||||||
|
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
|
||||||
|
}}</view>
|
||||||
|
<view class="header-item-label">设备总数</view>
|
||||||
|
</view>
|
||||||
|
<view class="header-item" @click="jump('currentOnLineDevs')">
|
||||||
|
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
|
||||||
|
<view class="header-item-label">在线设备</view>
|
||||||
|
</view>
|
||||||
|
<view class="header-item" @click="jump('currentOffLineDevs')">
|
||||||
|
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
|
||||||
|
<view class="header-item-label">离线设备</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -27,22 +45,14 @@ export default {
|
|||||||
methods:{
|
methods:{
|
||||||
jump(type) {
|
jump(type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'alarmLineDevs':
|
|
||||||
uni.navigateTo({
|
|
||||||
url:
|
|
||||||
'/pages/device/list?type=alarmLineDevs&projectList=' +
|
|
||||||
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 'offLineDevs':
|
|
||||||
uni.navigateTo({
|
|
||||||
url:
|
|
||||||
'/pages/device/list?type=offLineDevs&projectList=' +
|
|
||||||
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
|
|
||||||
})
|
|
||||||
break
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
uni.navigateTo({
|
||||||
|
url:
|
||||||
|
'/pages/device/list?type=' +
|
||||||
|
type +
|
||||||
|
'&projectList=' +
|
||||||
|
encodeURIComponent(JSON.stringify(this.devCount[type])),
|
||||||
|
})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,23 +1,70 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="index-zhuyonghu">
|
<view class="index-zhuanzhi">
|
||||||
<div class="header">
|
<view class="canneng-index-title mb20">所有工程统计信息</view>
|
||||||
<div class="header-item">
|
<view class="header">
|
||||||
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
|
<view class="header-item">
|
||||||
<div class="header-item-label">正常设备</div>
|
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
|
||||||
</div>
|
<view class="header-item-label">设备总数</view>
|
||||||
<div class="header-item" @click="jump('alarmLineDevs')">
|
</view>
|
||||||
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
|
<view class="header-item" @click="jump('onLineDevs')">
|
||||||
<div class="header-item-label">报警设备</div>
|
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
|
||||||
</div>
|
<view class="header-item-label">在线设备</view>
|
||||||
<div class="header-item" @click="jump('offLineDevs')">
|
</view>
|
||||||
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
|
<view class="header-item" @click="jump('offLineDevs')">
|
||||||
<div class="header-item-label">离线设备</div>
|
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
|
||||||
</div>
|
<view class="header-item-label">离线设备</view>
|
||||||
</div>
|
</view>
|
||||||
|
<view class="header-item">
|
||||||
|
<view class="header-item-value">{{ devCount.alarmCount || 0 }}</view>
|
||||||
|
<view class="header-item-label">告警数量</view>
|
||||||
|
</view>
|
||||||
|
<view class="header-item">
|
||||||
|
<view class="header-item-value">{{ devCount.eventCount || 0 }}</view>
|
||||||
|
<view class="header-item-label">事件数量</view>
|
||||||
|
</view>
|
||||||
|
<view class="header-item" @click="projectNum">
|
||||||
|
<view class="header-item-value">{{ devCount.projectCount || 0 }}</view>
|
||||||
|
<view class="header-item-label">项目个数</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
|
||||||
|
<view class="header">
|
||||||
|
<view class="header-item">
|
||||||
|
<view class="header-item-value">{{
|
||||||
|
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
|
||||||
|
}}</view>
|
||||||
|
<view class="header-item-label">设备总数</view>
|
||||||
|
</view>
|
||||||
|
<view class="header-item" @click="jump('currentOnLineDevs')">
|
||||||
|
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
|
||||||
|
<view class="header-item-label">在线设备</view>
|
||||||
|
</view>
|
||||||
|
<view class="header-item" @click="jump('currentOffLineDevs')">
|
||||||
|
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
|
||||||
|
<view class="header-item-label">离线设备</view>
|
||||||
|
</view>
|
||||||
|
<view class="header-item">
|
||||||
|
<view class="header-item-value">{{ devCount.currentAlarmCount || 0 }}</view>
|
||||||
|
<view class="header-item-label">告警数量</view>
|
||||||
|
</view>
|
||||||
|
<view class="header-item">
|
||||||
|
<view class="header-item-value">{{ devCount.currentEventCount || 0 }}</view>
|
||||||
|
<view class="header-item-label">事件数量</view>
|
||||||
|
</view>
|
||||||
|
<view class="header-item" @click="projectNum">
|
||||||
|
<view class="header-item-value">{{ devCount.currentProjectCount || 0 }}</view>
|
||||||
|
<view class="header-item-label">项目个数</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
devCount: {
|
devCount: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -25,28 +72,34 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
projectWarning() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/zhuanzhi/warning',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
projectNum() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/project/list',
|
||||||
|
})
|
||||||
|
},
|
||||||
jump(type) {
|
jump(type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'alarmLineDevs':
|
|
||||||
uni.navigateTo({
|
|
||||||
url:
|
|
||||||
'/pages/device/list?type=alarmLineDevs&projectList=' +
|
|
||||||
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 'offLineDevs':
|
|
||||||
uni.navigateTo({
|
|
||||||
url:
|
|
||||||
'/pages/device/list?type=offLineDevs&projectList=' +
|
|
||||||
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
|
|
||||||
})
|
|
||||||
break
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
uni.navigateTo({
|
||||||
|
url:
|
||||||
|
'/pages/device/list?type=' +
|
||||||
|
type +
|
||||||
|
'&projectList=' +
|
||||||
|
encodeURIComponent(JSON.stringify(this.devCount[type])),
|
||||||
|
})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
created() {},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss"></style>
|
<style lang="scss">
|
||||||
|
.index-zhuanzhi {
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,21 +1,40 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="index-zhuyonghu">
|
<view class="index-zhuyonghu">
|
||||||
<div class="header">
|
<view class="canneng-index-title mb20">所有工程统计信息</view>
|
||||||
<div class="header-item">
|
<view class="header">
|
||||||
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
|
<view class="header-item">
|
||||||
<div class="header-item-label">正常设备</div>
|
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
|
||||||
</div>
|
<view class="header-item-label">设备总数</view>
|
||||||
<div class="header-item" @click="jump('alarmLineDevs')">
|
</view>
|
||||||
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
|
<view class="header-item" @click="jump('onLineDevs')">
|
||||||
<div class="header-item-label">报警设备</div>
|
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
|
||||||
</div>
|
<view class="header-item-label">在线设备</view>
|
||||||
<div class="header-item" @click="jump('offLineDevs')">
|
</view>
|
||||||
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
|
<view class="header-item" @click="jump('offLineDevs')">
|
||||||
<div class="header-item-label">离线设备</div>
|
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
|
||||||
</div>
|
<view class="header-item-label">离线设备</view>
|
||||||
</div>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
|
||||||
|
<view class="header">
|
||||||
|
<view class="header-item">
|
||||||
|
<view class="header-item-value">{{
|
||||||
|
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
|
||||||
|
}}</view>
|
||||||
|
<view class="header-item-label">设备总数</view>
|
||||||
|
</view>
|
||||||
|
<view class="header-item" @click="jump('currentOnLineDevs')">
|
||||||
|
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
|
||||||
|
<view class="header-item-label">在线设备</view>
|
||||||
|
</view>
|
||||||
|
<view class="header-item" @click="jump('currentOffLineDevs')">
|
||||||
|
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
|
||||||
|
<view class="header-item-label">离线设备</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="canneng-index-title mt20">常用功能</view>
|
||||||
<view style="padding: 20rpx 20rpx 0">
|
<view style="padding: 20rpx 20rpx 0">
|
||||||
<Cn-grid title="常用功能">
|
<Cn-grid title="">
|
||||||
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
|
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
|
||||||
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
|
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
|
||||||
<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>
|
||||||
@@ -67,22 +86,14 @@ export default {
|
|||||||
},
|
},
|
||||||
jump(type) {
|
jump(type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'alarmLineDevs':
|
|
||||||
uni.navigateTo({
|
|
||||||
url:
|
|
||||||
'/pages/device/list?type=alarmLineDevs&projectList=' +
|
|
||||||
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 'offLineDevs':
|
|
||||||
uni.navigateTo({
|
|
||||||
url:
|
|
||||||
'/pages/device/list?type=offLineDevs&projectList=' +
|
|
||||||
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
|
|
||||||
})
|
|
||||||
break
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
uni.navigateTo({
|
||||||
|
url:
|
||||||
|
'/pages/device/list?type=' +
|
||||||
|
type +
|
||||||
|
'&projectList=' +
|
||||||
|
encodeURIComponent(JSON.stringify(this.devCount[type])),
|
||||||
|
})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,67 +1,61 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="index-zhuanzhi">
|
<view class="index-zhuanzhi">
|
||||||
<view class="canneng-index-title mb20">所有工程统计信息</view>
|
<view class="canneng-index-title mb20">所有工程统计信息</view>
|
||||||
<div class="header">
|
<view class="header">
|
||||||
<div class="header-item">
|
<view class="header-item">
|
||||||
<div class="header-item-value">{{ devCount.allDevCount || 0 }}</div>
|
<view class="header-item-value">{{ devCount.onLineDevCount + devCount.offLineDevCount || 0 }}</view>
|
||||||
<div class="header-item-label">设备总数</div>
|
<view class="header-item-label">设备总数</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="header-item">
|
<view class="header-item" @click="jump('onLineDevs')">
|
||||||
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
|
<view class="header-item-value">{{ devCount.onLineDevCount || 0 }}</view>
|
||||||
<div class="header-item-label">正常设备</div>
|
<view class="header-item-label">在线设备</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="header-item" @click="jump('alarmLineDevs')">
|
<view class="header-item" @click="jump('offLineDevs')">
|
||||||
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
|
<view class="header-item-value">{{ devCount.offLineDevCount || 0 }}</view>
|
||||||
<div class="header-item-label">报警设备</div>
|
<view class="header-item-label">离线设备</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="header-item" @click="jump('offLineDevs')">
|
<view class="header-item">
|
||||||
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
|
<view class="header-item-value">{{ devCount.alarmCount || 0 }}</view>
|
||||||
<div class="header-item-label">离线设备</div>
|
<view class="header-item-label">告警数量</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="header-item">
|
<view class="header-item">
|
||||||
<div class="header-item-value">{{ devCount.alarmEventCount || 0 }}</div>
|
<view class="header-item-value">{{ devCount.eventCount || 0 }}</view>
|
||||||
<div class="header-item-label">告警数量</div>
|
<view class="header-item-label">事件数量</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="header-item">
|
<view class="header-item" @click="projectNum">
|
||||||
<div class="header-item-value">{{ devCount.eventCount || 0 }}</div>
|
<view class="header-item-value">{{ devCount.projectCount || 0 }}</view>
|
||||||
<div class="header-item-label">事件数量</div>
|
<view class="header-item-label">项目个数</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="header-item" @click="projectNum">
|
</view>
|
||||||
<div class="header-item-value">{{ devCount.projectCount || 0 }}</div>
|
|
||||||
<div class="header-item-label">项目个数</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
|
<view class="canneng-index-title mb20 mt20">当前工程统计信息</view>
|
||||||
<div class="header">
|
<view class="header">
|
||||||
<div class="header-item">
|
<view class="header-item">
|
||||||
<div class="header-item-value">{{ devCount.allDevCount || 0 }}</div>
|
<view class="header-item-value">{{
|
||||||
<div class="header-item-label">设备总数</div>
|
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
|
||||||
</div>
|
}}</view>
|
||||||
<div class="header-item">
|
<view class="header-item-label">设备总数</view>
|
||||||
<div class="header-item-value">{{ devCount.onLineCount || 0 }}</div>
|
</view>
|
||||||
<div class="header-item-label">正常设备</div>
|
<view class="header-item" @click="jump('currentOnLineDevs')">
|
||||||
</div>
|
<view class="header-item-value">{{ devCount.currentOnLineDevCount || 0 }}</view>
|
||||||
<div class="header-item" @click="jump('alarmLineDevs')">
|
<view class="header-item-label">在线设备</view>
|
||||||
<div class="header-item-value">{{ devCount.alarmLineCount || 0 }}</div>
|
</view>
|
||||||
<div class="header-item-label">报警设备</div>
|
<view class="header-item" @click="jump('currentOffLineDevs')">
|
||||||
</div>
|
<view class="header-item-value">{{ devCount.currentOffLineDevCount || 0 }}</view>
|
||||||
<div class="header-item" @click="jump('offLineDevs')">
|
<view class="header-item-label">离线设备</view>
|
||||||
<div class="header-item-value">{{ devCount.offLineCount || 0 }}</div>
|
</view>
|
||||||
<div class="header-item-label">离线设备</div>
|
<view class="header-item">
|
||||||
</div>
|
<view class="header-item-value">{{ devCount.currentAlarmCount || 0 }}</view>
|
||||||
<div class="header-item">
|
<view class="header-item-label">告警数量</view>
|
||||||
<div class="header-item-value">{{ devCount.alarmEventCount || 0 }}</div>
|
</view>
|
||||||
<div class="header-item-label">告警数量</div>
|
<view class="header-item">
|
||||||
</div>
|
<view class="header-item-value">{{ devCount.currentEventCount || 0 }}</view>
|
||||||
<div class="header-item">
|
<view class="header-item-label">事件数量</view>
|
||||||
<div class="header-item-value">{{ devCount.eventCount || 0 }}</div>
|
</view>
|
||||||
<div class="header-item-label">事件数量</div>
|
<view class="header-item" @click="projectNum">
|
||||||
</div>
|
<view class="header-item-value">{{ devCount.currentProjectCount || 0 }}</view>
|
||||||
<div class="header-item" @click="projectNum">
|
<view class="header-item-label">项目个数</view>
|
||||||
<div class="header-item-value">{{ devCount.projectCount || 0 }}</div>
|
</view>
|
||||||
<div class="header-item-label">项目个数</div>
|
</view>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -90,22 +84,14 @@ export default {
|
|||||||
},
|
},
|
||||||
jump(type) {
|
jump(type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'alarmLineDevs':
|
|
||||||
uni.navigateTo({
|
|
||||||
url:
|
|
||||||
'/pages/device/list?type=alarmLineDevs&projectList=' +
|
|
||||||
encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 'offLineDevs':
|
|
||||||
uni.navigateTo({
|
|
||||||
url:
|
|
||||||
'/pages/device/list?type=offLineDevs&projectList=' +
|
|
||||||
encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
|
|
||||||
})
|
|
||||||
break
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
uni.navigateTo({
|
||||||
|
url:
|
||||||
|
'/pages/device/list?type=' +
|
||||||
|
type +
|
||||||
|
'&projectList=' +
|
||||||
|
encodeURIComponent(JSON.stringify(this.devCount[type])),
|
||||||
|
})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<Cn-page :loading="loading" noPadding>
|
<Cn-page :loading="loading" noPadding>
|
||||||
<view slot="body" class="canneng-index">
|
<view slot="body" class="canneng-index">
|
||||||
<uni-nav-bar
|
<!-- <uni-nav-bar
|
||||||
rightWidth="300rpx"
|
rightWidth="300rpx"
|
||||||
leftWidth="300rpx"
|
leftWidth="300rpx"
|
||||||
dark
|
dark
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<text class="hide-txt mr5" style="font-size: 28rpx">{{ select.engineeringName }}</text>
|
<text class="hide-txt mr5" style="font-size: 28rpx">{{ select.engineeringName }}</text>
|
||||||
<uni-icons type="bottom" size="16" color="#fff"></uni-icons>
|
<uni-icons type="bottom" size="16" color="#fff"></uni-icons>
|
||||||
</template>
|
</template>
|
||||||
</uni-nav-bar>
|
</uni-nav-bar> -->
|
||||||
<view class="index">
|
<view class="index">
|
||||||
<!-- 运维 -->
|
<!-- 运维 -->
|
||||||
<YunWei :devCount="devCount" v-if="userInfo.authorities === 'operation_manager'" />
|
<YunWei :devCount="devCount" v-if="userInfo.authorities === 'operation_manager'" />
|
||||||
@@ -33,8 +33,6 @@
|
|||||||
<Device ref="device" :store="store" />
|
<Device ref="device" :store="store" />
|
||||||
</view>
|
</view>
|
||||||
<uni-drawer ref="showRight" mode="right" :mask-click="false">
|
<uni-drawer ref="showRight" mode="right" :mask-click="false">
|
||||||
<uni-nav-bar :fixed="true" status-bar title="选择工程" color="#111"> </uni-nav-bar>
|
|
||||||
<view style="height: 200px"></view>
|
|
||||||
<view>
|
<view>
|
||||||
<uni-indexed-list
|
<uni-indexed-list
|
||||||
:options="engineeringListFilter"
|
:options="engineeringListFilter"
|
||||||
@@ -78,6 +76,7 @@ export default {
|
|||||||
engineeringId: '',
|
engineeringId: '',
|
||||||
},
|
},
|
||||||
engineeringList: [],
|
engineeringList: [],
|
||||||
|
drawer: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -101,6 +100,16 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onNavigationBarButtonTap(e) {
|
||||||
|
console.log(e)
|
||||||
|
// e的返回格式为json对象:{"text":"测试","index":0}
|
||||||
|
this.drawer = !this.drawer
|
||||||
|
if (this.drawer) {
|
||||||
|
this.openDrawer()
|
||||||
|
} else {
|
||||||
|
this.closeDrawer()
|
||||||
|
}
|
||||||
|
},
|
||||||
async init() {
|
async init() {
|
||||||
let engineering = uni.getStorageSync('engineering')
|
let engineering = uni.getStorageSync('engineering')
|
||||||
let res = await queryEngineering()
|
let res = await queryEngineering()
|
||||||
@@ -123,12 +132,23 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.store.params.engineerId = this.select.engineeringId
|
this.store.params.engineerId = this.select.engineeringId
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
var webView = this.$mp.page.$getAppWebview()
|
||||||
|
// 修改buttons
|
||||||
|
webView.setTitleNViewButtonStyle(0, {
|
||||||
|
text: this.select.engineeringName,
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
getDevCount(this.select.engineeringId).then((res) => {
|
getDevCount(this.select.engineeringId).then((res) => {
|
||||||
this.devCount = res.data
|
this.devCount = res.data
|
||||||
})
|
})
|
||||||
this.$refs.device && this.$refs.device.init()
|
this.$refs.device && this.$refs.device.init()
|
||||||
},
|
},
|
||||||
closeDrawer(e) {
|
closeDrawer(e) {
|
||||||
|
if (!e) {
|
||||||
|
this.$refs.showRight.close()
|
||||||
|
return
|
||||||
|
}
|
||||||
console.log(e)
|
console.log(e)
|
||||||
this.engineeringList.forEach((item) => {
|
this.engineeringList.forEach((item) => {
|
||||||
if (item.name === e.item.name) {
|
if (item.name === e.item.name) {
|
||||||
@@ -136,10 +156,20 @@ export default {
|
|||||||
this.select.engineeringName = item.name
|
this.select.engineeringName = item.name
|
||||||
this.select.engineeringId = item.id
|
this.select.engineeringId = item.id
|
||||||
this.store.params.engineerId = item.id
|
this.store.params.engineerId = item.id
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
var webView = this.$mp.page.$getAppWebview()
|
||||||
|
// 修改buttons
|
||||||
|
webView.setTitleNViewButtonStyle(0, {
|
||||||
|
text: this.select.engineeringName,
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.$refs.device.select.projectName = ''
|
this.$refs.device.select.projectName = ''
|
||||||
this.$refs.device.select.projectNameIndex = 0
|
this.$refs.device.select.projectNameIndex = 0
|
||||||
|
getDevCount(this.select.engineeringId).then((res) => {
|
||||||
|
this.devCount = res.data
|
||||||
|
})
|
||||||
this.$refs.device.init()
|
this.$refs.device.init()
|
||||||
this.$refs.showRight.close()
|
this.$refs.showRight.close()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
<view class="message">
|
<view class="message">
|
||||||
<view class="message-nav" @click="jump('system')">
|
<view class="message-nav" @click="jump('system')">
|
||||||
<image mode="aspectFill" class="message-nav-icon" src="/static/message3.png" />
|
<image mode="aspectFill" class="message-nav-icon" src="/static/message3.png" />
|
||||||
<view class="message-nav-label">系统</view>
|
<view class="message-nav-label">设备消息</view>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="message-nav" @click="jump('feedback')" v-if="userInfo.authorities === 'app_vip_user'">
|
<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')">
|
<view class="message-nav" @click="jump('report')">
|
||||||
|
|||||||
@@ -20,30 +20,39 @@
|
|||||||
<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.authorities === 'app_vip_user'">
|
<!-- <view class="mine-nav" @click="jump('audit')" v-if="userInfo.authorities === 'app_vip_user'">
|
||||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/server.png" />
|
<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.authorities === 'app_vip_user'">
|
<!-- <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>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="mine-nav" @click="jump('scan')">
|
<view
|
||||||
|
class="mine-nav"
|
||||||
|
@click="jump('scan')"
|
||||||
|
v-if="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'"
|
||||||
|
>
|
||||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/scan.png" />
|
<image mode="aspectFill" class="mine-nav-icon" src="/static/scan.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('engineering')">
|
<view class="mine-nav" @click="jump('engineering')">
|
||||||
<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>
|
||||||
|
</view>
|
||||||
|
<view class="mine-nav" @click="jump('engineering/setting')" v-if="userInfo.authorities === 'engineering_user'">
|
||||||
|
<image mode="aspectFill" class="mine-nav-icon" src="/static/like.png" />
|
||||||
|
<view class="mine-nav-label">关注工程配置</view>
|
||||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="mine-nav" @click="jump('project')">
|
<view class="mine-nav" @click="jump('project')">
|
||||||
<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
|
<!-- <view
|
||||||
@@ -145,9 +154,8 @@ export default {
|
|||||||
let content = JSON.parse(res.result)
|
let content = JSON.parse(res.result)
|
||||||
switch (content.type) {
|
switch (content.type) {
|
||||||
case 'transferDevice':
|
case 'transferDevice':
|
||||||
this.transferDevice(content.id)
|
this.transferDevice(content.id.split(','))
|
||||||
break
|
break
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -182,6 +190,11 @@ export default {
|
|||||||
url: `/pages/engineering/list`,
|
url: `/pages/engineering/list`,
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
|
case 'engineering/setting':
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/engineering/setting`,
|
||||||
|
})
|
||||||
|
break
|
||||||
default:
|
default:
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/mine/${type}`,
|
url: `/pages/mine/${type}`,
|
||||||
|
|||||||
@@ -1,25 +1,53 @@
|
|||||||
<template>
|
<template>
|
||||||
<Cn-page :loading='loading'>
|
<Cn-page :loading="loading">
|
||||||
<view slot='body'>
|
<view slot="body">
|
||||||
<view class='index'>
|
<view class="html-wrap">
|
||||||
隐私政策
|
<view v-html="value"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</Cn-page>
|
</Cn-page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { queryAppInfoByType } from '@/common/api/mine.js'
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false
|
showFlag: 0,
|
||||||
|
pageNameFlag: 1,
|
||||||
|
pageName: '用户协议',
|
||||||
|
loading: true,
|
||||||
|
value: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {},
|
||||||
}
|
created() {
|
||||||
|
let dictData = uni.getStorageSync(this.$cacheKey.dictData)
|
||||||
|
dictData.forEach((item) => {
|
||||||
|
if (item.code === 'appInformationType') {
|
||||||
|
item.children.forEach((item2) => {
|
||||||
|
if (item2.code === 'Personal_Infor_Protect') {
|
||||||
|
queryAppInfoByType(item2.id).then((res) => {
|
||||||
|
this.value = res.data.content
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss'>
|
|
||||||
.index {
|
<style lang="scss">
|
||||||
|
.html-wrap {
|
||||||
|
width: 750rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #666;
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
<view class="name">{{ text }}</view>
|
<view class="name">{{ text }}</view>
|
||||||
<view class="btn-wrap">
|
<view class="btn-wrap">
|
||||||
<navigator open-type="navigateBack" hover-class="none" class="btn"> 返回 </navigator>
|
<navigator open-type="navigateBack" hover-class="none" class="btn"> 返回 </navigator>
|
||||||
<view class="btn ml20" @click="look"> 查看 </view>
|
<!-- <view class="btn ml20" @click="look"> 查看 </view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
<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('policy')" >
|
||||||
|
<view class="mine-nav-label">个人信息保护政策</view>
|
||||||
|
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||||
|
</view>
|
||||||
<view class="mine-nav" @click="jump('system')">
|
<view class="mine-nav" @click="jump('system')">
|
||||||
<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>
|
||||||
@@ -72,7 +76,7 @@ export default {
|
|||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
case 'layout':
|
case 'layout':
|
||||||
uni.navigateTo({
|
uni.reLaunch({
|
||||||
url: `/pages/user/login`
|
url: `/pages/user/login`
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,50 +1,56 @@
|
|||||||
<template>
|
<template>
|
||||||
<view :loading="loading">
|
<view :loading="loading">
|
||||||
<view class="mine">
|
<view class="mine">
|
||||||
<view class="mine-nav" style="margin-top:20rpx;">
|
<view class="mine-nav" style="margin-top: 20rpx">
|
||||||
<view class="mine-nav-label">终端消息</view>
|
<view class="mine-nav-label">稳态越限</view>
|
||||||
<switch color="#376cf3" />
|
<switch color="#376cf3" />
|
||||||
</view>
|
</view>
|
||||||
<view class="mine-nav" style="border-bottom: none; ">
|
<view class="mine-nav" style="border-bottom: none">
|
||||||
<view class="mine-nav-label">系统消息</view>
|
<view class="mine-nav-label">暂态事件</view>
|
||||||
|
<switch color="#376cf3" />
|
||||||
|
</view>
|
||||||
|
<view class="mine-nav" style="border-bottom: none">
|
||||||
|
<view class="mine-nav-label">设备状态</view>
|
||||||
|
<switch color="#376cf3" />
|
||||||
|
</view>
|
||||||
|
<view class="mine-nav" style="border-bottom: none">
|
||||||
|
<view class="mine-nav-label">设备消息</view>
|
||||||
<switch color="#376cf3" />
|
<switch color="#376cf3" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false
|
loading: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init () {
|
init() {},
|
||||||
},
|
jump(type) {
|
||||||
jump (type) {
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'changePwd':
|
case 'changePwd':
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/user/changePwd`
|
url: `/pages/user/changePwd`,
|
||||||
})
|
})
|
||||||
break;
|
break
|
||||||
case 'changePhone':
|
case 'changePhone':
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/user/changePhone`
|
url: `/pages/user/changePhone`,
|
||||||
})
|
})
|
||||||
break;
|
break
|
||||||
default:
|
default:
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/mine/${type}`
|
url: `/pages/mine/${type}`,
|
||||||
})
|
})
|
||||||
break;
|
break
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
onLoad () {
|
onLoad() {
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -52,6 +58,11 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.mine {
|
.mine {
|
||||||
|
.title {
|
||||||
|
padding: 0 20rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
.mine-header {
|
.mine-header {
|
||||||
padding: 200rpx 34rpx 34rpx;
|
padding: 200rpx 34rpx 34rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -78,7 +89,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.mine-nav {
|
.mine-nav {
|
||||||
padding: 34rpx;
|
padding: 34rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background: $uni-theme-white;
|
background: $uni-theme-white;
|
||||||
|
|||||||
@@ -89,6 +89,7 @@
|
|||||||
vertical="bottom"
|
vertical="bottom"
|
||||||
:content="content"
|
:content="content"
|
||||||
@trigger="trigger"
|
@trigger="trigger"
|
||||||
|
v-if="content.length"
|
||||||
/>
|
/>
|
||||||
<uni-popup ref="share" type="share" background-color="#fff">
|
<uni-popup ref="share" type="share" background-color="#fff">
|
||||||
<uni-popup-share title="分享到"></uni-popup-share>
|
<uni-popup-share title="分享到"></uni-popup-share>
|
||||||
@@ -116,7 +117,7 @@ export default {
|
|||||||
text: '设备',
|
text: '设备',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '子用户',
|
text: '用户',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '拓扑图',
|
text: '拓扑图',
|
||||||
@@ -249,24 +250,33 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
let userInfo = uni.getStorageSync('userInfo')
|
let userInfo = uni.getStorageSync('userInfo')
|
||||||
this.content.push({
|
// this.content.push({
|
||||||
iconPath: '/static/share.png',
|
// iconPath: '/static/share.png',
|
||||||
text: '编辑',
|
// text: '编辑',
|
||||||
})
|
// })
|
||||||
this.content.push({
|
// this.content.push({
|
||||||
iconPath: '/static/delate.png',
|
// iconPath: '/static/delate.png',
|
||||||
text: '删除',
|
// text: '删除',
|
||||||
})
|
// })
|
||||||
this.content.push({
|
// this.content.push({
|
||||||
iconPath: '/static/transfer.png',
|
// iconPath: '/static/transfer.png',
|
||||||
text: '移交',
|
// text: '移交',
|
||||||
})
|
// })
|
||||||
this.content.push({
|
// this.content.push({
|
||||||
iconPath: '/static/share.png',
|
// iconPath: '/static/share.png',
|
||||||
text: '分享',
|
// text: '分享',
|
||||||
})
|
// })
|
||||||
if (userInfo.authorities == '3') {
|
if (userInfo.authorities == 'engineering_user' || userInfo.authorities == 'app_vip_user') {
|
||||||
} else if (userInfo.authorities == '4') {
|
this.content.push(
|
||||||
|
{
|
||||||
|
iconPath: '/static/share.png',
|
||||||
|
text: '编辑',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
iconPath: '/static/delate.png',
|
||||||
|
text: '删除',
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// 获取nav高度
|
// 获取nav高度
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
:fixed="true"
|
:fixed="true"
|
||||||
status-bar
|
status-bar
|
||||||
left-icon="left"
|
left-icon="left"
|
||||||
:rightIcon="userInfo.authorities == '2' ? '' : 'plusempty'"
|
:rightIcon="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user' ? 'plusempty' : ''"
|
||||||
background-color="#fff"
|
background-color="#fff"
|
||||||
color="#111"
|
color="#111"
|
||||||
title="项目管理"
|
title="项目管理"
|
||||||
@@ -44,6 +44,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
|
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
this.store = this.DataSource('/cs-device-boot/project/queryProject')
|
this.store = this.DataSource('/cs-device-boot/project/queryProject')
|
||||||
this.store.params.engineeringId = uni.getStorageSync('engineering')?.id
|
this.store.params.engineeringId = uni.getStorageSync('engineering')?.id
|
||||||
this.store.reload()
|
this.store.reload()
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
<uni-easyinput
|
<uni-easyinput
|
||||||
v-model="formData.engineeringName"
|
v-model="formData.engineeringName"
|
||||||
placeholder="请输入项目名称"
|
placeholder="请输入项目名称"
|
||||||
@click.native="showDrawer"
|
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
|
disabled
|
||||||
/>
|
/>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="项目名称">
|
<uni-forms-item label="项目名称">
|
||||||
@@ -122,8 +122,8 @@ export default {
|
|||||||
topoIds: [],
|
topoIds: [],
|
||||||
description: '',
|
description: '',
|
||||||
name: '',
|
name: '',
|
||||||
lat: '2',
|
lat: '',
|
||||||
lng: '3',
|
lng: '',
|
||||||
},
|
},
|
||||||
engineeringList: [],
|
engineeringList: [],
|
||||||
tempList: [],
|
tempList: [],
|
||||||
@@ -162,6 +162,10 @@ export default {
|
|||||||
this.formData[key] = this.project[key]
|
this.formData[key] = this.project[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
let engineering = uni.getStorageSync(this.$cacheKey.engineering)
|
||||||
|
this.formData.engineeringId = engineering.id
|
||||||
|
this.formData.engineeringName = engineering.name
|
||||||
}
|
}
|
||||||
uni.getLocation({
|
uni.getLocation({
|
||||||
type: 'wgs84',
|
type: 'wgs84',
|
||||||
@@ -229,7 +233,9 @@ export default {
|
|||||||
chooseLocation() {
|
chooseLocation() {
|
||||||
uni.chooseLocation({
|
uni.chooseLocation({
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
this.address = res.name
|
this.formData.area = res.name
|
||||||
|
this.formData.lat = res.latitudeame
|
||||||
|
this.formData.lng = res.longitude
|
||||||
console.log('位置名称:' + res.name)
|
console.log('位置名称:' + res.name)
|
||||||
console.log('详细地址:' + res.address)
|
console.log('详细地址:' + res.address)
|
||||||
console.log('纬度:' + res.latitude)
|
console.log('纬度:' + res.latitude)
|
||||||
@@ -268,18 +274,24 @@ export default {
|
|||||||
let data = JSON.parse(JSON.stringify(this.formData))
|
let data = JSON.parse(JSON.stringify(this.formData))
|
||||||
delete data.files
|
delete data.files
|
||||||
let res = {}
|
let res = {}
|
||||||
|
console.warn(data, arr)
|
||||||
if (this.project) {
|
if (this.project) {
|
||||||
data.id = this.project.id
|
data.id = this.project.id
|
||||||
res = await updateAppProject(data, arr)
|
res = await updateAppProject(data, arr)
|
||||||
} else {
|
} else {
|
||||||
res = await addAppProject(data, arr)
|
res = await addAppProject(data, arr)
|
||||||
}
|
}
|
||||||
console.log(res)
|
let result = {}
|
||||||
if (res.length === 1) {
|
if (res.code === 'A0000') {
|
||||||
this.$util.toast(res[0].message)
|
result = res
|
||||||
return
|
} else {
|
||||||
|
console.warn(res)
|
||||||
|
if (res.length === 1) {
|
||||||
|
this.$util.toast(res[0].message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
result = JSON.parse(res[1].data)
|
||||||
}
|
}
|
||||||
let result = JSON.parse(res[1].data)
|
|
||||||
if (result.code === 'A0000') {
|
if (result.code === 'A0000') {
|
||||||
if (this.project) {
|
if (this.project) {
|
||||||
this.$util.toast('项目修改成功')
|
this.$util.toast('项目修改成功')
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item name="code">
|
<uni-forms-item name="code">
|
||||||
<view class="login-box-input">
|
<view class="login-box-input">
|
||||||
<uni-easyinput type="number" v-model="formData.code" placeholder="请输入验证码" />
|
<uni-easyinput type="text" v-model="formData.code" placeholder="请输入验证码" maxlength="6" />
|
||||||
<view
|
<view
|
||||||
class="ml40"
|
class="ml40"
|
||||||
style="
|
style="
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item name="code">
|
<uni-forms-item name="code">
|
||||||
<view class="login-box-input">
|
<view class="login-box-input">
|
||||||
<uni-easyinput type="number" v-model="formData.code2" placeholder="请输入验证码" />
|
<uni-easyinput type="text" v-model="formData.code2" placeholder="请输入验证码" maxlength="6" />
|
||||||
<view
|
<view
|
||||||
class="ml40"
|
class="ml40"
|
||||||
style="
|
style="
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item name="code">
|
<uni-forms-item name="code">
|
||||||
<view class="login-box-input">
|
<view class="login-box-input">
|
||||||
<uni-easyinput type="number" v-model="formData.code" placeholder="请输入验证码" />
|
<uni-easyinput type="text" v-model="formData.code" placeholder="请输入验证码" maxlength="6" />
|
||||||
<view
|
<view
|
||||||
class="ml40"
|
class="ml40"
|
||||||
style="
|
style="
|
||||||
|
|||||||
@@ -2,11 +2,12 @@
|
|||||||
<Cn-page :loading="loading">
|
<Cn-page :loading="loading">
|
||||||
<view slot="body">
|
<view slot="body">
|
||||||
<view class="login">
|
<view class="login">
|
||||||
<view class="login-title">登录</view>
|
<view class="login-title" style="font-size: 36rpx;">欢迎登录</view>
|
||||||
<view class="login-des">灿能物联</view>
|
<!-- <view class="login-des">灿能物联</view> -->
|
||||||
<view class="login-box">
|
<view class="login-box">
|
||||||
<!-- <image class="login-box-logo" mode="widthFix" src="/static/logo.png"></image> -->
|
<!-- <image class="login-box-logo" mode="widthFix" src="/static/logo.png"></image> -->
|
||||||
<image class="login-box-logo" mode="widthFix" src="/static/logo.png"></image>
|
<image class="login-box-logo" mode="widthFix" src="/static/logo.png"></image>
|
||||||
|
<view style="font-size: 40rpx;text-align: center;font-weight: 500;" class="mt20">灿能物联</view>
|
||||||
<template v-if="loginType == 'yzm'">
|
<template v-if="loginType == 'yzm'">
|
||||||
<view class="login-box-input mt100">
|
<view class="login-box-input mt100">
|
||||||
<input
|
<input
|
||||||
@@ -21,7 +22,7 @@
|
|||||||
<view class="login-box-input-img"></view>
|
<view class="login-box-input-img"></view>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="login-box-input mt40">
|
<view class="login-box-input mt40">
|
||||||
<input class="login-box-input-main" v-model="yzmForm.code" placeholder="手机验证码" />
|
<input type="text" class="login-box-input-main" v-model="yzmForm.code" placeholder="手机验证码" maxlength="6" />
|
||||||
<view
|
<view
|
||||||
class="ml40"
|
class="ml40"
|
||||||
style="font-size: 28rpx; color: #666; width: 200rpx; text-align: center"
|
style="font-size: 28rpx; color: #666; width: 200rpx; text-align: center"
|
||||||
@@ -59,13 +60,20 @@
|
|||||||
<view @click="loginType = 'pwd'" v-if="loginType == 'yzm'">账号密码登录</view>
|
<view @click="loginType = 'pwd'" v-if="loginType == 'yzm'">账号密码登录</view>
|
||||||
<view @click="loginType = 'yzm'" v-else>短信验证码登录</view>
|
<view @click="loginType = 'yzm'" v-else>短信验证码登录</view>
|
||||||
<view style="flex: 1"></view>
|
<view style="flex: 1"></view>
|
||||||
<navigator url="/pages/user/forget" hover-class="none">忘记密码</navigator>
|
<template v-if="loginType === 'pwd'">
|
||||||
<view style="margin: 0 10px; color: #999">|</view>
|
<navigator url="/pages/user/forget" hover-class="none">忘记密码</navigator>
|
||||||
|
<view style="margin: 0 10px; color: #999">|</view>
|
||||||
|
</template>
|
||||||
<navigator url="/pages/user/register" hover-class="none">快速注册</navigator>
|
<navigator url="/pages/user/register" hover-class="none">快速注册</navigator>
|
||||||
</view>
|
</view>
|
||||||
<view class="login-box-tips">
|
<view class="login-box-tips">
|
||||||
<view style="color: #999"
|
<view style="color: #999"
|
||||||
><checkbox :checked="checkbox" @click="checkbox = !checkbox" /> 我已阅读并同意</view
|
><checkbox
|
||||||
|
style="transform: scale(0.7)"
|
||||||
|
:checked="checkbox"
|
||||||
|
@click="checkbox = !checkbox"
|
||||||
|
/>
|
||||||
|
我已阅读并同意</view
|
||||||
>
|
>
|
||||||
<navigator url="/pages/mine/agreement" hover-class="none">《用户协议》</navigator>
|
<navigator url="/pages/mine/agreement" hover-class="none">《用户协议》</navigator>
|
||||||
<navigator url="/pages/mine/policy" hover-class="none">《个人信息保护政策》</navigator>
|
<navigator url="/pages/mine/policy" hover-class="none">《个人信息保护政策》</navigator>
|
||||||
@@ -85,14 +93,14 @@ export default {
|
|||||||
return {
|
return {
|
||||||
checkbox: false,
|
checkbox: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
loginType: 'pwd',
|
loginType: 'yzm',
|
||||||
phone: '',
|
phone: '',
|
||||||
pwdForm: {
|
pwdForm: {
|
||||||
pwd: '',
|
pwd: '',
|
||||||
imgCode: '',
|
imgCode: '',
|
||||||
},
|
},
|
||||||
yzmForm: {
|
yzmForm: {
|
||||||
code: '123456789',
|
code: '',
|
||||||
imgCode: '',
|
imgCode: '',
|
||||||
},
|
},
|
||||||
waitTime: 0,
|
waitTime: 0,
|
||||||
@@ -178,6 +186,10 @@ export default {
|
|||||||
onLoad(o) {
|
onLoad(o) {
|
||||||
// 移除所有的缓存
|
// 移除所有的缓存
|
||||||
// uni.clearStorageSync()
|
// uni.clearStorageSync()
|
||||||
|
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||||
|
if (userInfo) {
|
||||||
|
this.phone = userInfo.user_name
|
||||||
|
}
|
||||||
uni.removeStorageSync(this.$cacheKey.access_token)
|
uni.removeStorageSync(this.$cacheKey.access_token)
|
||||||
uni.removeStorageSync(this.$cacheKey.engineering)
|
uni.removeStorageSync(this.$cacheKey.engineering)
|
||||||
},
|
},
|
||||||
@@ -203,7 +215,7 @@ export default {
|
|||||||
.login-box {
|
.login-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin: 60rpx auto 0;
|
margin: 40rpx auto 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 680rpx;
|
width: 680rpx;
|
||||||
padding: 100rpx 40rpx;
|
padding: 100rpx 40rpx;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item name="code">
|
<uni-forms-item name="code">
|
||||||
<view class="login-box-input">
|
<view class="login-box-input">
|
||||||
<uni-easyinput type="number" v-model="formData.code" placeholder="请输入验证码" />
|
<uni-easyinput type="text" v-model="formData.code" placeholder="请输入验证码" maxlength="6" />
|
||||||
<view
|
<view
|
||||||
class="ml40"
|
class="ml40"
|
||||||
style="margin-left: 40rpx; font-size: 28rpx; color: #666; width: 200rpx; text-align: center"
|
style="margin-left: 40rpx; font-size: 28rpx; color: #666; width: 200rpx; text-align: center"
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<button type="default" class="submit-btn" @click="firstSubmit">注册</button>
|
<button type="default" class="submit-btn" @click="firstSubmit">注册</button>
|
||||||
<view class="login-box-tips">
|
<view class="login-box-tips">
|
||||||
<view style="color: #999"
|
<view style="color: #999"
|
||||||
><checkbox :checked="checkbox" @click="checkbox = !checkbox" /> 我已阅读并同意</view
|
><checkbox style="transform: scale(0.7)" :checked="checkbox" @click="checkbox = !checkbox" /> 我已阅读并同意</view
|
||||||
>
|
>
|
||||||
<navigator url="/pages/mine/agreement" hover-class="none">《用户协议》</navigator>
|
<navigator url="/pages/mine/agreement" hover-class="none">《用户协议》</navigator>
|
||||||
<navigator url="/pages/mine/policy" hover-class="none">《个人信息保护政策》</navigator>
|
<navigator url="/pages/mine/policy" hover-class="none">《个人信息保护政策》</navigator>
|
||||||
|
|||||||
BIN
static/device_bad.png
Normal file
BIN
static/device_bad.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
BIN
static/device_ready.png
Normal file
BIN
static/device_ready.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
BIN
static/device_success.png
Normal file
BIN
static/device_success.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
BIN
static/like.png
Normal file
BIN
static/like.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
35
uni_modules/uni-search-bar/changelog.md
Normal file
35
uni_modules/uni-search-bar/changelog.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
## 1.2.4(2023-05-09)
|
||||||
|
- 修复 i18n 国际化不正确的 Bug
|
||||||
|
## 1.2.3(2022-05-24)
|
||||||
|
- 新增 readonly 属性,组件只读
|
||||||
|
## 1.2.2(2022-05-06)
|
||||||
|
- 修复 vue3 input 事件不生效的bug
|
||||||
|
## 1.2.1(2022-05-06)
|
||||||
|
- 修复 多余代码导致的bug
|
||||||
|
## 1.2.0(2021-11-19)
|
||||||
|
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
|
||||||
|
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-search-bar](https://uniapp.dcloud.io/component/uniui/uni-search-bar)
|
||||||
|
## 1.1.2(2021-08-30)
|
||||||
|
- 修复 value 属性与 modelValue 属性不兼容的Bug
|
||||||
|
## 1.1.1(2021-08-24)
|
||||||
|
- 新增 支持国际化
|
||||||
|
## 1.1.0(2021-07-30)
|
||||||
|
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
|
||||||
|
## 1.0.9(2021-05-12)
|
||||||
|
- 新增 项目示例地址
|
||||||
|
## 1.0.8(2021-04-21)
|
||||||
|
- 优化 添加依赖 uni-icons, 导入后自动下载依赖
|
||||||
|
## 1.0.7(2021-04-15)
|
||||||
|
- uni-ui 新增 uni-search-bar 的 focus 事件
|
||||||
|
|
||||||
|
## 1.0.6(2021-02-05)
|
||||||
|
- 优化 组件引用关系,通过uni_modules引用组件
|
||||||
|
|
||||||
|
## 1.0.5(2021-02-05)
|
||||||
|
- 调整为uni_modules目录规范
|
||||||
|
- 新增 支持双向绑定
|
||||||
|
- 更改 input 事件的返回值,e={value:Number} --> e=value
|
||||||
|
- 新增 支持图标插槽
|
||||||
|
- 新增 支持 clear、blur 事件
|
||||||
|
- 新增 支持 focus 属性
|
||||||
|
- 去掉组件背景色
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"uni-search-bar.cancel": "cancel",
|
||||||
|
"uni-search-bar.placeholder": "Search enter content"
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import en from './en.json'
|
||||||
|
import zhHans from './zh-Hans.json'
|
||||||
|
import zhHant from './zh-Hant.json'
|
||||||
|
export default {
|
||||||
|
en,
|
||||||
|
'zh-Hans': zhHans,
|
||||||
|
'zh-Hant': zhHant
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"uni-search-bar.cancel": "取消",
|
||||||
|
"uni-search-bar.placeholder": "请输入搜索内容"
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"uni-search-bar.cancel": "取消",
|
||||||
|
"uni-search-bar.placeholder": "請輸入搜索內容"
|
||||||
|
}
|
||||||
@@ -0,0 +1,298 @@
|
|||||||
|
<template>
|
||||||
|
<view class="uni-searchbar">
|
||||||
|
<view :style="{borderRadius:radius+'px',backgroundColor: bgColor}" class="uni-searchbar__box"
|
||||||
|
@click="searchClick">
|
||||||
|
<view class="uni-searchbar__box-icon-search">
|
||||||
|
<slot name="searchIcon">
|
||||||
|
<uni-icons color="#c0c4cc" size="18" type="search" />
|
||||||
|
</slot>
|
||||||
|
</view>
|
||||||
|
<input v-if="show || searchVal" :focus="showSync" :disabled="readonly" :placeholder="placeholderText" :maxlength="maxlength"
|
||||||
|
class="uni-searchbar__box-search-input" confirm-type="search" type="text" v-model="searchVal"
|
||||||
|
@confirm="confirm" @blur="blur" @focus="emitFocus" />
|
||||||
|
<text v-else class="uni-searchbar__text-placeholder">{{ placeholder }}</text>
|
||||||
|
<view v-if="show && (clearButton==='always'||clearButton==='auto'&&searchVal!=='') &&!readonly"
|
||||||
|
class="uni-searchbar__box-icon-clear" @click="clear">
|
||||||
|
<slot name="clearIcon">
|
||||||
|
<uni-icons color="#c0c4cc" size="20" type="clear" />
|
||||||
|
</slot>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<text @click="cancel" class="uni-searchbar__cancel"
|
||||||
|
v-if="cancelButton ==='always' || show && cancelButton ==='auto'">{{cancelTextI18n}}</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
initVueI18n
|
||||||
|
} from '@dcloudio/uni-i18n'
|
||||||
|
import messages from './i18n/index.js'
|
||||||
|
const {
|
||||||
|
t
|
||||||
|
} = initVueI18n(messages)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SearchBar 搜索栏
|
||||||
|
* @description 搜索栏组件,通常用于搜索商品、文章等
|
||||||
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=866
|
||||||
|
* @property {Number} radius 搜索栏圆角
|
||||||
|
* @property {Number} maxlength 输入最大长度
|
||||||
|
* @property {String} placeholder 搜索栏Placeholder
|
||||||
|
* @property {String} clearButton = [always|auto|none] 是否显示清除按钮
|
||||||
|
* @value always 一直显示
|
||||||
|
* @value auto 输入框不为空时显示
|
||||||
|
* @value none 一直不显示
|
||||||
|
* @property {String} cancelButton = [always|auto|none] 是否显示取消按钮
|
||||||
|
* @value always 一直显示
|
||||||
|
* @value auto 输入框不为空时显示
|
||||||
|
* @value none 一直不显示
|
||||||
|
* @property {String} cancelText 取消按钮的文字
|
||||||
|
* @property {String} bgColor 输入框背景颜色
|
||||||
|
* @property {Boolean} focus 是否自动聚焦
|
||||||
|
* @property {Boolean} readonly 组件只读,不能有任何操作,只做展示
|
||||||
|
* @event {Function} confirm uniSearchBar 的输入框 confirm 事件,返回参数为uniSearchBar的value,e={value:Number}
|
||||||
|
* @event {Function} input uniSearchBar 的 value 改变时触发事件,返回参数为uniSearchBar的value,e=value
|
||||||
|
* @event {Function} cancel 点击取消按钮时触发事件,返回参数为uniSearchBar的value,e={value:Number}
|
||||||
|
* @event {Function} clear 点击清除按钮时触发事件,返回参数为uniSearchBar的value,e={value:Number}
|
||||||
|
* @event {Function} blur input失去焦点时触发事件,返回参数为uniSearchBar的value,e={value:Number}
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "UniSearchBar",
|
||||||
|
emits: ['input', 'update:modelValue', 'clear', 'cancel', 'confirm', 'blur', 'focus'],
|
||||||
|
props: {
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
default: ""
|
||||||
|
},
|
||||||
|
radius: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 5
|
||||||
|
},
|
||||||
|
clearButton: {
|
||||||
|
type: String,
|
||||||
|
default: "auto"
|
||||||
|
},
|
||||||
|
cancelButton: {
|
||||||
|
type: String,
|
||||||
|
default: "auto"
|
||||||
|
},
|
||||||
|
cancelText: {
|
||||||
|
type: String,
|
||||||
|
default: ""
|
||||||
|
},
|
||||||
|
bgColor: {
|
||||||
|
type: String,
|
||||||
|
default: "#F8F8F8"
|
||||||
|
},
|
||||||
|
maxlength: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 100
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: ""
|
||||||
|
},
|
||||||
|
modelValue: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: ""
|
||||||
|
},
|
||||||
|
focus: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
readonly: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: false,
|
||||||
|
showSync: false,
|
||||||
|
searchVal: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
cancelTextI18n() {
|
||||||
|
return this.cancelText || t("uni-search-bar.cancel")
|
||||||
|
},
|
||||||
|
placeholderText() {
|
||||||
|
return this.placeholder || t("uni-search-bar.placeholder")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
// #ifndef VUE3
|
||||||
|
value: {
|
||||||
|
immediate: true,
|
||||||
|
handler(newVal) {
|
||||||
|
this.searchVal = newVal
|
||||||
|
if (newVal) {
|
||||||
|
this.show = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// #endif
|
||||||
|
// #ifdef VUE3
|
||||||
|
modelValue: {
|
||||||
|
immediate: true,
|
||||||
|
handler(newVal) {
|
||||||
|
this.searchVal = newVal
|
||||||
|
if (newVal) {
|
||||||
|
this.show = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// #endif
|
||||||
|
focus: {
|
||||||
|
immediate: true,
|
||||||
|
handler(newVal) {
|
||||||
|
if (newVal) {
|
||||||
|
if(this.readonly) return
|
||||||
|
this.show = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.showSync = true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
searchVal(newVal, oldVal) {
|
||||||
|
this.$emit("input", newVal)
|
||||||
|
// #ifdef VUE3
|
||||||
|
this.$emit("update:modelValue", newVal)
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
searchClick() {
|
||||||
|
if(this.readonly) return
|
||||||
|
if (this.show) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.show = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.showSync = true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
clear() {
|
||||||
|
this.$emit("clear", {
|
||||||
|
value: this.searchVal
|
||||||
|
})
|
||||||
|
this.searchVal = ""
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
if(this.readonly) return
|
||||||
|
this.$emit("cancel", {
|
||||||
|
value: this.searchVal
|
||||||
|
});
|
||||||
|
this.searchVal = ""
|
||||||
|
this.show = false
|
||||||
|
this.showSync = false
|
||||||
|
// #ifndef APP-PLUS
|
||||||
|
uni.hideKeyboard()
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
plus.key.hideSoftKeybord()
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
confirm() {
|
||||||
|
// #ifndef APP-PLUS
|
||||||
|
uni.hideKeyboard();
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
plus.key.hideSoftKeybord()
|
||||||
|
// #endif
|
||||||
|
this.$emit("confirm", {
|
||||||
|
value: this.searchVal
|
||||||
|
})
|
||||||
|
},
|
||||||
|
blur() {
|
||||||
|
// #ifndef APP-PLUS
|
||||||
|
uni.hideKeyboard();
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
plus.key.hideSoftKeybord()
|
||||||
|
// #endif
|
||||||
|
this.$emit("blur", {
|
||||||
|
value: this.searchVal
|
||||||
|
})
|
||||||
|
},
|
||||||
|
emitFocus(e) {
|
||||||
|
this.$emit("focus", e.detail)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
$uni-searchbar-height: 36px;
|
||||||
|
|
||||||
|
.uni-searchbar {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: row;
|
||||||
|
position: relative;
|
||||||
|
padding: 10px;
|
||||||
|
// background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-searchbar__box {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
box-sizing: border-box;
|
||||||
|
/* #endif */
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
flex: 1;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
height: $uni-searchbar-height;
|
||||||
|
padding: 5px 8px 5px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-searchbar__box-icon-search {
|
||||||
|
/* #ifndef APP-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
flex-direction: row;
|
||||||
|
// width: 32px;
|
||||||
|
padding: 0 8px;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
color: #B3B3B3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-searchbar__box-search-input {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-searchbar__box-icon-clear {
|
||||||
|
align-items: center;
|
||||||
|
line-height: 24px;
|
||||||
|
padding-left: 8px;
|
||||||
|
/* #ifdef H5 */
|
||||||
|
cursor: pointer;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-searchbar__text-placeholder {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #B3B3B3;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-searchbar__cancel {
|
||||||
|
padding-left: 10px;
|
||||||
|
line-height: $uni-searchbar-height;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #333333;
|
||||||
|
/* #ifdef H5 */
|
||||||
|
cursor: pointer;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
86
uni_modules/uni-search-bar/package.json
Normal file
86
uni_modules/uni-search-bar/package.json
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
{
|
||||||
|
"id": "uni-search-bar",
|
||||||
|
"displayName": "uni-search-bar 搜索栏",
|
||||||
|
"version": "1.2.4",
|
||||||
|
"description": "搜索栏组件,通常用于搜索商品、文章等",
|
||||||
|
"keywords": [
|
||||||
|
"uni-ui",
|
||||||
|
"uniui",
|
||||||
|
"搜索框",
|
||||||
|
"搜索栏"
|
||||||
|
],
|
||||||
|
"repository": "https://github.com/dcloudio/uni-ui",
|
||||||
|
"engines": {
|
||||||
|
"HBuilderX": ""
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"example": "../../temps/example_temps"
|
||||||
|
},
|
||||||
|
"dcloudext": {
|
||||||
|
"sale": {
|
||||||
|
"regular": {
|
||||||
|
"price": "0.00"
|
||||||
|
},
|
||||||
|
"sourcecode": {
|
||||||
|
"price": "0.00"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contact": {
|
||||||
|
"qq": ""
|
||||||
|
},
|
||||||
|
"declaration": {
|
||||||
|
"ads": "无",
|
||||||
|
"data": "无",
|
||||||
|
"permissions": "无"
|
||||||
|
},
|
||||||
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
|
||||||
|
"type": "component-vue"
|
||||||
|
},
|
||||||
|
"uni_modules": {
|
||||||
|
"dependencies": [
|
||||||
|
"uni-scss",
|
||||||
|
"uni-icons"
|
||||||
|
],
|
||||||
|
"encrypt": [],
|
||||||
|
"platforms": {
|
||||||
|
"cloud": {
|
||||||
|
"tcb": "y",
|
||||||
|
"aliyun": "y"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"App": {
|
||||||
|
"app-vue": "y",
|
||||||
|
"app-nvue": "y"
|
||||||
|
},
|
||||||
|
"H5-mobile": {
|
||||||
|
"Safari": "y",
|
||||||
|
"Android Browser": "y",
|
||||||
|
"微信浏览器(Android)": "y",
|
||||||
|
"QQ浏览器(Android)": "y"
|
||||||
|
},
|
||||||
|
"H5-pc": {
|
||||||
|
"Chrome": "y",
|
||||||
|
"IE": "y",
|
||||||
|
"Edge": "y",
|
||||||
|
"Firefox": "y",
|
||||||
|
"Safari": "y"
|
||||||
|
},
|
||||||
|
"小程序": {
|
||||||
|
"微信": "y",
|
||||||
|
"阿里": "y",
|
||||||
|
"百度": "y",
|
||||||
|
"字节跳动": "y",
|
||||||
|
"QQ": "y"
|
||||||
|
},
|
||||||
|
"快应用": {
|
||||||
|
"华为": "u",
|
||||||
|
"联盟": "u"
|
||||||
|
},
|
||||||
|
"Vue": {
|
||||||
|
"vue2": "y",
|
||||||
|
"vue3": "y"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
14
uni_modules/uni-search-bar/readme.md
Normal file
14
uni_modules/uni-search-bar/readme.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
## SearchBar 搜索栏
|
||||||
|
|
||||||
|
> **组件名:uni-search-bar**
|
||||||
|
> 代码块: `uSearchBar`
|
||||||
|
|
||||||
|
|
||||||
|
搜索栏组件
|
||||||
|
|
||||||
|
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-search-bar)
|
||||||
|
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user