diff --git a/App.vue b/App.vue
index bf52ac9..c41174a 100644
--- a/App.vue
+++ b/App.vue
@@ -3,7 +3,7 @@ import { queryDictDataCache } from './common/api/dictionary.js'
import encrypt from './common/js/aes.js'
export default {
onLaunch: function () {
- console.log(window);
+ console.log(window)
// this.connect()
console.log('App Launch')
let devCode = uni.getStorageSync('devCode')
@@ -14,9 +14,11 @@ export default {
},
})
}
- },
- onShow: function () {
- console.log('App Show')
+ if (!uni.getStorageSync(this.$cacheKey.userInfo)) {
+ uni.reLaunch({
+ url: '/pages/login/login',
+ })
+ }
queryDictDataCache().then((res) => {
uni.setStorageSync(this.$cacheKey.dictData, res.data)
})
diff --git a/common/api/device.js b/common/api/device.js
index 5b1e4a7..425e0b9 100644
--- a/common/api/device.js
+++ b/common/api/device.js
@@ -94,7 +94,7 @@ export const transferDevice = (id) => {
url: '/cs-device-boot/deviceUser/transfer',
method: 'POST',
data: {
- eid: id,
+ ids: id,
},
})
}
diff --git a/common/api/engineering.js b/common/api/engineering.js
index 9dfa144..02f19c4 100644
--- a/common/api/engineering.js
+++ b/common/api/engineering.js
@@ -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',
+ },
+ })
+}
diff --git a/common/api/project.js b/common/api/project.js
index e059181..09809eb 100644
--- a/common/api/project.js
+++ b/common/api/project.js
@@ -2,25 +2,41 @@ import request from '../js/request'
import config from '../js/config'
export function addAppProject(params, files) {
- return uni.uploadFile({
- url: config.domain + '/cs-device-boot/project/addAppProject', //仅为示例,非真实的接口地址
- files: files,
- header: {
- Authorization: uni.getStorageSync('access_token'),
- },
- formData: params,
- })
+ if (files.length === 0) {
+ return request({
+ url: '/cs-device-boot/project/addAppProject',
+ method: 'post',
+ data: params,
+ })
+ } else {
+ return uni.uploadFile({
+ url: config.domain + '/cs-device-boot/project/addAppProject', //仅为示例,非真实的接口地址
+ files: files,
+ header: {
+ Authorization: uni.getStorageSync('access_token'),
+ },
+ formData: params,
+ })
+ }
}
// 修改项目
export function updateAppProject(params, files) {
- return uni.uploadFile({
- url: config.domain + '/cs-device-boot/project/auditAppProject', //仅为示例,非真实的接口地址
- files: files,
- header: {
- Authorization: uni.getStorageSync('access_token'),
- },
- formData: params,
- })
+ if (files.length === 0) {
+ return request({
+ url: '/cs-device-boot/project/updateAppProject',
+ method: 'post',
+ data: params,
+ })
+ }else{
+ return uni.uploadFile({
+ url: config.domain + '/cs-device-boot/project/auditAppProject', //仅为示例,非真实的接口地址
+ files: files,
+ header: {
+ Authorization: uni.getStorageSync('access_token'),
+ },
+ formData: params,
+ })
+ }
}
export function getProjectList(params) {
@@ -101,4 +117,3 @@ export function addAppTopologyDiagram(params, filePath) {
),
})
}
-
diff --git a/common/css/base.scss b/common/css/base.scss
index 8129090..df08772 100644
--- a/common/css/base.scss
+++ b/common/css/base.scss
@@ -149,22 +149,22 @@ page {
margin: 0 20rpx;
display: grid;
grid-gap: 20rpx;
- grid-template-columns: 1fr 1fr 1fr;
+ grid-template-columns: 1fr 1fr 1fr 1fr;
.header-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 10rpx 10rpx 20rpx;
- color: #111;
+ color: #fff;
font-size: 28rpx;
- background: #fff;
+ background: $uni-theme-color;
border-radius: 12rpx;
.header-item-value {
font-size: 32rpx;
}
- .header-item-label{
- font-size: 28rpx;
+ .header-item-label {
+ font-size: 24rpx;
}
}
}
@@ -182,18 +182,21 @@ page {
z-index: 2;
.nav-menu {
- padding: 10rpx 20rpx;
+ padding: 6rpx 20rpx;
margin-left: 20rpx;
margin-bottom: 20rpx;
- font-size: 28rpx;
+ font-size: 24rpx;
border-radius: 8rpx;
background: #ebeaec;
color: #666;
-
&-active {
background: #dfe5f7;
color: $uni-theme-color;
}
+ &-btn {
+ background: $uni-theme-color;
+ color: #fff;
+ }
}
}
diff --git a/common/js/list.js b/common/js/list.js
index a8ba012..6f9ae1c 100644
--- a/common/js/list.js
+++ b/common/js/list.js
@@ -1,23 +1,23 @@
export default {
onPullDownRefresh() {
- this.store && this.store.reload();
+ this.store && this.store.reload()
this.store.loadedCallback = () => {
- uni.stopPullDownRefresh();
- };
+ uni.stopPullDownRefresh()
+ }
},
onReachBottom() {
if (this.store.status != 'noMore') {
- this.store.next && this.store.next();
+ this.store.next && this.store.next()
}
},
data() {
return {
store: {},
- };
+ }
},
methods: {
DataSource(url) {
- var me = this;
+ var me = this
return {
data: [],
status: 'more',
@@ -31,11 +31,11 @@ export default {
pageSize: 20,
},
reload() {
- this.data = [];
- this.status = 'loading';
- this.empty = false;
- this.params.pageNum = 1;
- this.next();
+ this.data = []
+ this.status = 'loading'
+ this.empty = false
+ this.params.pageNum = 1
+ this.next()
},
callBack: null,
firstCallBack: null,
@@ -47,37 +47,35 @@ export default {
header: this.header,
method: 'POST',
}).then((res) => {
- console.warn(res);
- let resultData =
- res.data?.list || res.data?.records || [];
+ console.warn(res)
+ let resultData = res.data?.list || res.data?.records || []
if (this.params.pageNum == 1) {
- this.data = resultData;
+ this.data = resultData
if (resultData.length == 0 || resultData == 0) {
- this.empty = true;
- } else if (
- resultData.length < this.params.pageSize
- ) {
- this.status = 'noMore';
+ this.empty = true
+ this.status = 'noMore'
+ } else if (resultData.length < this.params.pageSize) {
+ this.status = 'noMore'
} else if (res.total == resultData.length) {
- this.status = 'noMore';
+ this.status = 'noMore'
}
} else {
- this.data.push(...resultData);
+ this.data.push(...resultData)
if (resultData.length < this.params.pageSize) {
- this.status = 'noMore';
+ this.status = 'noMore'
}
}
if (this.params.pageNum == 1) {
- this.firstCallBack && this.firstCallBack();
+ this.firstCallBack && this.firstCallBack()
}
- this.loadedCallback && this.loadedCallback();
- this.params.pageNum++;
- this.total = res.total;
- this.loading = false;
- });
+ this.loadedCallback && this.loadedCallback()
+ this.params.pageNum++
+ this.total = res.total
+ this.loading = false
+ })
},
- };
+ }
},
},
-};
+}
diff --git a/common/js/request.js b/common/js/request.js
index f6b3d3c..cceb302 100644
--- a/common/js/request.js
+++ b/common/js/request.js
@@ -24,6 +24,7 @@ export default (options = {}) => {
}
uni.request({
url,
+ timeout: 5000,
data: {
...options.data,
},
@@ -65,6 +66,7 @@ export default (options = {}) => {
* @param {Number} code 错误码
*/
function errHandler(res) {
+ console.log(res);
switch (res.code) {
case 'A0024':
uni.reLaunch({ url: '/pages/user/login' })
diff --git a/components/Cn-grid-item/Cn-grid-item.vue b/components/Cn-grid-item/Cn-grid-item.vue
index 7542168..b904f3f 100644
--- a/components/Cn-grid-item/Cn-grid-item.vue
+++ b/components/Cn-grid-item/Cn-grid-item.vue
@@ -33,7 +33,7 @@ export default {
position: relative;
width: 80rpx;
height: 80rpx;
- background: $uni-theme-yellow;
+ background: $uni-theme-color;
border-radius: 20rpx;
.grid-card-content-item-icon-2 {
@@ -64,7 +64,7 @@ export default {
text-align: center;
margin-top: 16rpx;
color: #111;
- font-size: 28rpx;
+ font-size: 24rpx;
}
}
\ No newline at end of file
diff --git a/manifest.json b/manifest.json
index e266cde..831b512 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name" : "灿能物联",
"appid" : "__UNI__88BC25B",
"description" : "",
- "versionName" : "1.0.4",
- "versionCode" : 103,
+ "versionName" : "1.0.7",
+ "versionCode" : 107,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
@@ -132,7 +132,7 @@
"/api" : {
"https" : true,
// "target" : "https://china.indpecker.com",
- "target" : "http://192.168.1.13:10215",
+ "target" : "http://192.168.1.139:10215",
"changOrigin" : true,
"pathRewrite" : {
"/api" : ""
diff --git a/pages.json b/pages.json
index 9c15178..656f5ab 100644
--- a/pages.json
+++ b/pages.json
@@ -4,8 +4,23 @@
{
"path": "pages/index/index",
"style": {
- "navigationStyle": "custom",
- "navigationBarTextStyle": "white"
+ "app-plus": {
+ "bounce": "none", //关闭窗口回弹效果
+ "titleNView": {
+ "titleText": "灿能物联", // 窗口的标题
+ "titleAlign": "left",
+ "padding-left": "16rpx",
+ "padding-right": "20rpx",
+ "buttons": [
+ {
+ "text": "请选择工程",
+ "fontSize": "28rpx",
+ "select": true,
+ "width": "auto"
+ }
+ ]
+ }
+ }
}
},
{
@@ -317,6 +332,12 @@
"navigationBarTitleText": "工程详情"
}
},
+ {
+ "path": "pages/engineering/setting",
+ "style": {
+ "navigationBarTitleText": "关注工程配置"
+ }
+ },
{
"path": "pages/user/erweima",
"style": {
diff --git a/pages/device/APF/detail.vue b/pages/device/APF/detail.vue
index 11341dd..7aa16e5 100644
--- a/pages/device/APF/detail.vue
+++ b/pages/device/APF/detail.vue
@@ -137,9 +137,9 @@ export default {
{
text: '功率',
},
- {
- text: '波形',
- },
+ // {
+ // text: '波形',
+ // },
{
text: 'I/O',
},
@@ -238,56 +238,29 @@ export default {
uni.pageScrollTo({ scrollTop: 0, duration: 0 })
},
init() {
- switch (this.userInfo.authorities) {
- case 1:
- this.content.splice(0, 1)
- this.content.splice(
- 0,
- 0,
- {
- iconPath: '/static/version.png',
- text: '版本',
- },
- {
- iconPath: '/static/template.png',
- text: '模版',
- },
- )
- break
- case 2:
- this.content.splice(0, 1)
- break
- case 4:
- this.content.splice(
- 1,
- 0,
- {
- iconPath: '/static/delate.png',
- text: '报表',
- },
-
- {
- iconPath: '/static/feedback.png',
- text: '反馈',
- },
- )
- break
- case 5:
- this.content.splice(
- 2,
- 0,
- {
- iconPath: '/static/table.png',
- text: '报表',
- },
- {
- iconPath: '/static/feedback.png',
- text: '反馈',
- },
- )
- break
- default:
- break
+ if (this.isPrimaryUser == 1) {
+ this.content.splice(
+ 0,
+ 0,
+ {
+ iconPath: '/static/transfer.png',
+ text: '移交',
+ },
+ {
+ iconPath: '/static/feedback.png',
+ text: '编辑',
+ },
+ {
+ iconPath: '/static/delate.png',
+ text: '删除',
+ },
+ )
+ if (this.userInfo.authorities === 'app_vip_user') {
+ this.content.splice(3, 0, {
+ iconPath: '/static/share.png',
+ text: '分享',
+ })
+ }
}
},
renderFinish(e) {
@@ -387,26 +360,7 @@ export default {
this.devId = options.id
this.isPrimaryUser = options.isPrimaryUser
- if (this.isPrimaryUser == 1) {
- this.content.splice(0, 0, {
- iconPath: '/static/delate.png',
- text: '删除',
- })
- this.content.splice(0, 0, {
- iconPath: '/static/feedback.png',
- text: '编辑',
- })
- this.content.splice(0, 0, {
- iconPath: '/static/transfer.png',
- text: '移交',
- })
- if (this.userInfo.authorities !== 'engineering_user') {
- this.content.splice(0, 0, {
- iconPath: '/static/share.png',
- text: '分享',
- })
- }
- }
+
this.init()
queryTopologyDiagram(options.id).then((res) => {
this.deviceInfo = res.data
diff --git a/pages/device/list.vue b/pages/device/list.vue
index 0dc18c6..945c47f 100644
--- a/pages/device/list.vue
+++ b/pages/device/list.vue
@@ -5,7 +5,7 @@
diff --git a/pages/index/comp/device.vue b/pages/index/comp/device.vue
index 82e10d8..c8ca019 100644
--- a/pages/index/comp/device.vue
+++ b/pages/index/comp/device.vue
@@ -16,10 +16,30 @@
+
+
+
+
+
+
+
+
+
+
@@ -31,15 +51,25 @@
v-for="(item, index) in deviceListFilter"
:key="index"
@click="jump(item)"
- thumbnail="/static/device.png"
+ :thumbnail="deviceIcon(item.runStatus)"
>
+
+
+ {{ item.equipmentName }}
+
+
+
-
+
@@ -56,6 +86,9 @@ export default {
data() {
return {
loading: false,
+ transfer: false,
+ share: false,
+ checkList: [],
select: {
projectName: '',
projectNameIndex: 0,
@@ -67,6 +100,7 @@ export default {
projectList: [],
projectType: [],
navHeight: 0,
+ userInfo: {},
}
},
computed: {
@@ -84,39 +118,66 @@ export default {
})
},
},
- mounted() {
- setTimeout(() => {
- // 获取nav高度
- uni.createSelectorQuery()
- .select('.uni-navbar')
- .boundingClientRect((rect1) => {
- this.navHeight = rect1.height
- // 获取nav高度
- uni.createSelectorQuery()
- .select('.nav')
- .boundingClientRect((rect2) => {
- // #ifdef H5
- this.minHeight =
- 'calc(100vh - env(safe-area-inset-bottom) - ' +
- (50 + (rect2.height + rect1.height)) +
- 'px)'
- // #endif
- // #ifdef APP-PLUS
- this.minHeight = 'calc(100vh - ' + (rect2.height + rect1.height) + 'px)'
- // #endif
- })
- .exec()
- })
- .exec()
- }, 1000)
+ created() {
+ this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
},
methods: {
+ deviceIcon(e) {
+ let str = ''
+ switch (e) {
+ case 1:
+ str = '/static/device_bad.png'
+ break
+ case 2:
+ str = '/static/device.png'
+ break
+ default:
+ str = '/static/device.png'
+ break
+ }
+ return str
+ },
+ switchChange(e) {
+ console.log(e)
+ let index = this.checkList.indexOf(e.equipmentId)
+ if (index > -1) {
+ this.checkList.splice(index, 1)
+ } else {
+ this.checkList.push(e.equipmentId)
+ }
+ },
+ submit() {
+ console.log(this.checkList)
+ if (this.transfer) {
+ this.transfer = false
+ uni.navigateTo({ url: '/pages/device/transfer?id=' + this.checkList.join(',') })
+ } else if (this.share) {
+ this.share = false
+ this.$emit('share', this.shareList)
+ }
+ this.checkList = []
+ },
async init() {
this.getProjectList()
this.getDeviceList()
},
getDeviceList() {
this.store.params.pageSize = 999
+ this.store.firstCallBack = () => {
+ // 获取nav高度
+ uni.createSelectorQuery()
+ .select('.nav')
+ .boundingClientRect((rect2) => {
+ if (!rect2) return
+ // #ifdef H5
+ this.minHeight = 'calc(100vh - env(safe-area-inset-bottom) - ' + (50 + rect2.height) + 'px)'
+ // #endif
+ // #ifdef APP-PLUS
+ this.minHeight = 'calc(100vh - ' + rect2.height + 'px)'
+ // #endif
+ })
+ .exec()
+ }
this.store.reload()
},
getProjectList() {
@@ -214,4 +275,14 @@ export default {
},
}
-
+
diff --git a/pages/index/comp/indexGongCheng.vue b/pages/index/comp/indexGongCheng.vue
index 7cc4ecf..273ab8a 100644
--- a/pages/index/comp/indexGongCheng.vue
+++ b/pages/index/comp/indexGongCheng.vue
@@ -1,21 +1,40 @@
-
+ 所有工程统计信息
+
+ 当前工程统计信息
+
+ 常用功能
-
+
@@ -67,22 +86,14 @@ export default {
},
jump(type) {
switch (type) {
- case 'alarmLineDevs':
- uni.navigateTo({
- url:
- '/pages/device/list?type=alarmLineDevs&projectList=' +
- encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
- })
- break
- case 'offLineDevs':
- uni.navigateTo({
- url:
- '/pages/device/list?type=offLineDevs&projectList=' +
- encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
- })
- break
-
default:
+ uni.navigateTo({
+ url:
+ '/pages/device/list?type=' +
+ type +
+ '&projectList=' +
+ encodeURIComponent(JSON.stringify(this.devCount[type])),
+ })
break
}
},
diff --git a/pages/index/comp/indexYouKe.vue b/pages/index/comp/indexYouKe.vue
index 78eb15e..0afb81d 100644
--- a/pages/index/comp/indexYouKe.vue
+++ b/pages/index/comp/indexYouKe.vue
@@ -1,19 +1,37 @@
-
+ 所有工程统计信息
+
+ 当前工程统计信息
+
-
+
diff --git a/pages/index/comp/indexZhuYongHu.vue b/pages/index/comp/indexZhuYongHu.vue
index 0368f18..273ab8a 100644
--- a/pages/index/comp/indexZhuYongHu.vue
+++ b/pages/index/comp/indexZhuYongHu.vue
@@ -1,21 +1,40 @@
-
+ 所有工程统计信息
+
+ 当前工程统计信息
+
+ 常用功能
-
+
@@ -67,22 +86,14 @@ export default {
},
jump(type) {
switch (type) {
- case 'alarmLineDevs':
- uni.navigateTo({
- url:
- '/pages/device/list?type=alarmLineDevs&projectList=' +
- encodeURIComponent(JSON.stringify(this.devCount.alarmLineDevs)),
- })
- break
- case 'offLineDevs':
- uni.navigateTo({
- url:
- '/pages/device/list?type=offLineDevs&projectList=' +
- encodeURIComponent(JSON.stringify(this.devCount.offLineDevs)),
- })
- break
-
default:
+ uni.navigateTo({
+ url:
+ '/pages/device/list?type=' +
+ type +
+ '&projectList=' +
+ encodeURIComponent(JSON.stringify(this.devCount[type])),
+ })
break
}
},
diff --git a/pages/index/comp/indexZhuanZhi.vue b/pages/index/comp/indexZhuanZhi.vue
index 1cd75eb..84139de 100644
--- a/pages/index/comp/indexZhuanZhi.vue
+++ b/pages/index/comp/indexZhuanZhi.vue
@@ -1,67 +1,61 @@
所有工程统计信息
-
+
当前工程统计信息
-
+
-
\ No newline at end of file
+
diff --git a/pages/mine/result.vue b/pages/mine/result.vue
index fc8c0a5..25e4d49 100644
--- a/pages/mine/result.vue
+++ b/pages/mine/result.vue
@@ -6,7 +6,7 @@
{{ text }}
返回
- 查看
+
diff --git a/pages/mine/setup.vue b/pages/mine/setup.vue
index 8aea84d..2aa3a85 100644
--- a/pages/mine/setup.vue
+++ b/pages/mine/setup.vue
@@ -17,6 +17,10 @@
用户协议
+
+ 个人信息保护政策
+
+
系统介绍
@@ -72,7 +76,7 @@ export default {
})
break;
case 'layout':
- uni.navigateTo({
+ uni.reLaunch({
url: `/pages/user/login`
})
break;
diff --git a/pages/mine/setupMessage.vue b/pages/mine/setupMessage.vue
index ada2427..8c64477 100644
--- a/pages/mine/setupMessage.vue
+++ b/pages/mine/setupMessage.vue
@@ -1,50 +1,56 @@
-
- 终端消息
+
+ 稳态越限
-
- 系统消息
+
+ 暂态事件
+
+
+
+ 设备状态
+
+
+
+ 设备消息
-
+
+
diff --git a/uni_modules/uni-search-bar/package.json b/uni_modules/uni-search-bar/package.json
new file mode 100644
index 0000000..ede02ef
--- /dev/null
+++ b/uni_modules/uni-search-bar/package.json
@@ -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"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/uni_modules/uni-search-bar/readme.md b/uni_modules/uni-search-bar/readme.md
new file mode 100644
index 0000000..253092f
--- /dev/null
+++ b/uni_modules/uni-search-bar/readme.md
@@ -0,0 +1,14 @@
+
+
+## SearchBar 搜索栏
+
+> **组件名:uni-search-bar**
+> 代码块: `uSearchBar`
+
+
+搜索栏组件
+
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-search-bar)
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
+
+