Commit d92728ee4874d9f21fe70b6eb675abec69e1b4a0
Merge branch 'fix/DEFECT-1840' into 'main_dev'
fix: 修改小程序告警和首页看板组态添加组织关系 See merge request yunteng/thingskit-app!127
Showing
9 changed files
with
149 additions
and
63 deletions
@@ -10,8 +10,8 @@ | @@ -10,8 +10,8 @@ | ||
10 | <text class="text-device-muted text-clip alarm-text" | 10 | <text class="text-device-muted text-clip alarm-text" |
11 | :style="{color:hasColor.includes(item.label)?'#DE4437':''}"> | 11 | :style="{color:hasColor.includes(item.label)?'#DE4437':''}"> |
12 | {{item.label===hasColor[0]? setAlarmStatus(item.value):item.label===hasColor[1]?setAlarmSeverity(item.value): | 12 | {{item.label===hasColor[0]? setAlarmStatus(item.value):item.label===hasColor[1]?setAlarmSeverity(item.value): |
13 | - item.label==='告警值:'?formatAlarmValueText:item.label==='告警条件:'?formatAlarmConditionText | ||
14 | - :item.label==='告警设备:'?formatDeviceText:item.value}} | 13 | + item.label==='触发值:'?formatAlarmValueText:item.label==='触发条件:'?formatAlarmConditionText |
14 | + :item.label==='触发属性:'?formatAttrText:item.label==='告警设备:'?formatDeviceText:item.value}} | ||
15 | </text> | 15 | </text> |
16 | </view> | 16 | </view> |
17 | <view class="bottom-line"></view> | 17 | <view class="bottom-line"></view> |
@@ -42,10 +42,10 @@ | @@ -42,10 +42,10 @@ | ||
42 | </view> | 42 | </view> |
43 | <!-- #endif --> | 43 | <!-- #endif --> |
44 | <view class="bottom-button"> | 44 | <view class="bottom-button"> |
45 | - <view v-if="handleText.includes(alarmDetail[7].value)" class="u-flex button-item"> | 45 | + <view v-if="handleText.includes(alarmDetail[8].value)" class="u-flex button-item"> |
46 | <u-button @click="handleSubmit" type="primary" shape="circle" text="处理"></u-button> | 46 | <u-button @click="handleSubmit" type="primary" shape="circle" text="处理"></u-button> |
47 | </view> | 47 | </view> |
48 | - <view v-if="clearText.includes(alarmDetail[7].value)" class="u-flex button-item"> | 48 | + <view v-if="clearText.includes(alarmDetail[8].value)" class="u-flex button-item"> |
49 | <u-button @click="handleRemove" type="error" shape="circle" text="清除"></u-button> | 49 | <u-button @click="handleRemove" type="error" shape="circle" text="清除"></u-button> |
50 | </view> | 50 | </view> |
51 | </view> | 51 | </view> |
@@ -88,18 +88,23 @@ | @@ -88,18 +88,23 @@ | ||
88 | formatDeviceText: '', | 88 | formatDeviceText: '', |
89 | formatAlarmValueText: '', | 89 | formatAlarmValueText: '', |
90 | formatAlarmConditionText: '', | 90 | formatAlarmConditionText: '', |
91 | + formatAttrText:'', | ||
91 | }; | 92 | }; |
92 | }, | 93 | }, |
93 | - onLoad(e) { | 94 | + async onLoad(e) { |
94 | if (e.data !== null) { | 95 | if (e.data !== null) { |
95 | let params = JSON.parse(decodeURIComponent(e.data)); | 96 | let params = JSON.parse(decodeURIComponent(e.data)); |
96 | const {deviceName,severity,organizationName,details,type,createdTime,status,id} = params | 97 | const {deviceName,severity,organizationName,details,type,createdTime,status,id} = params |
97 | 98 | ||
98 | this.detailId = id | 99 | this.detailId = id |
99 | - this.alarmDetail = [{label: '告警场景:',value: type},{label: '告警级别:',value: severity},{label: '所属组织:',value: organizationName},{label: '告警设备:',value: ''},{label: '告警条件:',value: ''},{label: '告警值:',value: ''},{label: '告警时间:',value: createdTime},{label: '告警状态:',value: status},] | ||
100 | - this.formatAlarmDevice(details) | ||
101 | - this.formatAlarmValue(details) | ||
102 | - this.formatAlarmCondition(details) | 100 | + this.alarmDetail = [{label: '告警场景:',value: type},{label: '告警级别:',value: severity},{label: '所属组织:',value: organizationName},{label: '告警设备:',value: ''},{label:'触发属性:',value:''},{label: '触发条件:',value: ''},{label: '触发值:',value: ''},{label: '告警时间:',value: createdTime},{label: '告警状态:',value: status},] |
101 | + | ||
102 | + const keys = Object.keys(details) | ||
103 | + const dataFormat = await this.handleAlarmDetailFormat(keys); | ||
104 | + this.formatAlarmDevice(details,dataFormat) | ||
105 | + this.formatAlarmValue(details,dataFormat) | ||
106 | + this.formatAlarmCondition(details,dataFormat) | ||
107 | + this.formatAttr(details,dataFormat) | ||
103 | } | 108 | } |
104 | // 隐藏原生的tabbar | 109 | // 隐藏原生的tabbar |
105 | uni.hideTabBar(); | 110 | uni.hideTabBar(); |
@@ -143,18 +148,16 @@ | @@ -143,18 +148,16 @@ | ||
143 | }, 500); | 148 | }, 500); |
144 | } | 149 | } |
145 | }, | 150 | }, |
146 | - //告警值处理 | ||
147 | - async formatAlarmValue(e) { | 151 | + //触发值处理 |
152 | + formatAlarmValue(e,dataFormat) { | ||
148 | const keys = Object.keys(e) | 153 | const keys = Object.keys(e) |
149 | - const dataFormat = await this.handleAlarmDetailFormat(keys); | ||
150 | const values = keys.reduce((acc, curr) => { | 154 | const values = keys.reduce((acc, curr) => { |
151 | const items = e[curr]?.triggerData | 155 | const items = e[curr]?.triggerData |
152 | dataFormat.forEach((dataItem => { | 156 | dataFormat.forEach((dataItem => { |
153 | if (dataItem.tbDeviceId === curr) { | 157 | if (dataItem.tbDeviceId === curr) { |
154 | - const findAttribute = dataItem.attribute.find(findItem => findItem.identifier === items?.key) | ||
155 | - if(!items?.realValue && !findAttribute.name) return | 158 | + if(!items?.realValue) return |
156 | acc.push( | 159 | acc.push( |
157 | - `${findAttribute.name}:${items.realValue}${!findAttribute.detail?.dataType?.specs?.unit?.key?'':findAttribute.detail?.dataType?.specs?.unit?.key}` | 160 | + `${items.realValue}` |
158 | ) | 161 | ) |
159 | } | 162 | } |
160 | })) | 163 | })) |
@@ -162,7 +165,7 @@ | @@ -162,7 +165,7 @@ | ||
162 | }, []) | 165 | }, []) |
163 | this.formatAlarmValueText = values.join(',') | 166 | this.formatAlarmValueText = values.join(',') |
164 | }, | 167 | }, |
165 | - //告警条件处理 | 168 | + //触发条件处理 |
166 | formatAlarmCondition(e) { | 169 | formatAlarmCondition(e) { |
167 | const keys = Object.keys(e) | 170 | const keys = Object.keys(e) |
168 | const values = keys.reduce((acc, curr) => { | 171 | const values = keys.reduce((acc, curr) => { |
@@ -179,10 +182,24 @@ | @@ -179,10 +182,24 @@ | ||
179 | }) | 182 | }) |
180 | this.formatAlarmConditionText = format.filter(Boolean).join(',') | 183 | this.formatAlarmConditionText = format.filter(Boolean).join(',') |
181 | }, | 184 | }, |
182 | - //告警设备处理 | ||
183 | - async formatAlarmDevice(e) { | 185 | + // 触发属性 |
186 | + formatAttr(e,dataFormat){ | ||
184 | const keys = Object.keys(e) | 187 | const keys = Object.keys(e) |
185 | - const dataFormat = await this.handleAlarmDetailFormat(keys); | 188 | + const values = keys.reduce((acc, curr) => { |
189 | + const items = e[curr]?.triggerData | ||
190 | + dataFormat.forEach((dataItem => { | ||
191 | + if (dataItem.tbDeviceId === curr) { | ||
192 | + const findAttribute = dataItem.attribute.find(findItem => findItem.identifier === items?.key) | ||
193 | + if(!findAttribute?.name && !items?.key) return | ||
194 | + acc.push(`${findAttribute?.name || items?.key || ' '}`) | ||
195 | + } | ||
196 | + })) | ||
197 | + return acc | ||
198 | + }, []) | ||
199 | + this.formatAttrText = values.join(',') | ||
200 | + }, | ||
201 | + //告警设备处理 | ||
202 | + async formatAlarmDevice(e,dataFormat) { | ||
186 | if (!dataFormat) this.formatDeviceText = '' | 203 | if (!dataFormat) this.formatDeviceText = '' |
187 | if (Array.isArray(dataFormat) && dataFormat.length === 0) this.formatDeviceText = '' | 204 | if (Array.isArray(dataFormat) && dataFormat.length === 0) this.formatDeviceText = '' |
188 | this.formatDeviceText = dataFormat.map(item => item.name).join(',') | 205 | this.formatDeviceText = dataFormat.map(item => item.name).join(',') |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | .alarm-detail-column { | 6 | .alarm-detail-column { |
7 | border-radius: 10px; | 7 | border-radius: 10px; |
8 | width: 688rpx; | 8 | width: 688rpx; |
9 | - height: 688rpx; | 9 | + height: 780rpx; |
10 | background-color: #ffffff; | 10 | background-color: #ffffff; |
11 | .detail-column { | 11 | .detail-column { |
12 | width:750rpx; | 12 | width:750rpx; |
@@ -84,4 +84,4 @@ | @@ -84,4 +84,4 @@ | ||
84 | .button-item{ | 84 | .button-item{ |
85 | width: 260rpx; | 85 | width: 260rpx; |
86 | } | 86 | } |
87 | -} | ||
87 | +} |
1 | <template> | 1 | <template> |
2 | - <view class="header-org"> | ||
3 | - <view @click="$emit('openOrg')" class="org-item"> | 2 | + <view class="header-org" @click="$emit('openOrg')"> |
3 | + <view class="org-item"> | ||
4 | <view class="u-flex org-contact"><text class="text">组织关系</text></view> | 4 | <view class="u-flex org-contact"><text class="text">组织关系</text></view> |
5 | <view class="u-flex org-device"> | 5 | <view class="u-flex org-device"> |
6 | <image class="device-image" :src="imageSrc"></image> | 6 | <image class="device-image" :src="imageSrc"></image> |
7 | - <text class="device-text">摄像头数:{{ total }}</text> | 7 | + <text class="device-text">{{title}} {{ total }}</text> |
8 | </view> | 8 | </view> |
9 | </view> | 9 | </view> |
10 | <view class="org-item"> | 10 | <view class="org-item"> |
@@ -17,7 +17,8 @@ | @@ -17,7 +17,8 @@ | ||
17 | export default { | 17 | export default { |
18 | props: { | 18 | props: { |
19 | total: Number, | 19 | total: Number, |
20 | - imageSrc: String | 20 | + imageSrc: String, |
21 | + title:String | ||
21 | } | 22 | } |
22 | } | 23 | } |
23 | </script> | 24 | </script> |
@@ -32,8 +33,8 @@ | @@ -32,8 +33,8 @@ | ||
32 | flex-direction: row; | 33 | flex-direction: row; |
33 | justify-content: space-between; | 34 | justify-content: space-between; |
34 | position: fixed; | 35 | position: fixed; |
35 | - z-index: 999999; | ||
36 | - top: -1rpx; | 36 | + // z-index: 999999; |
37 | + // top: 75rpx; | ||
37 | 38 | ||
38 | .org-item { | 39 | .org-item { |
39 | width: 350rpx; | 40 | width: 350rpx; |
@@ -78,4 +79,4 @@ | @@ -78,4 +79,4 @@ | ||
78 | } | 79 | } |
79 | } | 80 | } |
80 | } | 81 | } |
81 | -</style> | ||
82 | +</style> |
@@ -62,6 +62,7 @@ | @@ -62,6 +62,7 @@ | ||
62 | }, | 62 | }, |
63 | conditions: {}, | 63 | conditions: {}, |
64 | ordId: '', | 64 | ordId: '', |
65 | + paramsStaus:null | ||
65 | }; | 66 | }; |
66 | }, | 67 | }, |
67 | onShow() { | 68 | onShow() { |
@@ -75,7 +76,11 @@ | @@ -75,7 +76,11 @@ | ||
75 | this.conditions = { | 76 | this.conditions = { |
76 | organizationId: this.ordId | 77 | organizationId: this.ordId |
77 | } | 78 | } |
79 | + return | ||
78 | } | 80 | } |
81 | + this.loadData(1, { | ||
82 | + status:this.paramsStaus | ||
83 | + }); | ||
79 | }, | 84 | }, |
80 | onHide() { | 85 | onHide() { |
81 | this.ordId = '' | 86 | this.ordId = '' |
@@ -85,18 +90,16 @@ | @@ -85,18 +90,16 @@ | ||
85 | this.loadData(1); | 90 | this.loadData(1); |
86 | } else { | 91 | } else { |
87 | let params = JSON.parse(e.type); | 92 | let params = JSON.parse(e.type); |
88 | - let status = null | 93 | + this.parmasStatus = null |
89 | if (Array.isArray(params)) { | 94 | if (Array.isArray(params)) { |
90 | - status = params.join(','); | 95 | + this.paramsStaus = params.join(','); |
91 | } else { | 96 | } else { |
92 | - status = params; | 97 | + this.paramsStaus = params; |
93 | } | 98 | } |
94 | this.conditions = { | 99 | this.conditions = { |
95 | - status | 100 | + status:this.paramsStaus |
96 | } | 101 | } |
97 | - this.loadData(1, { | ||
98 | - status | ||
99 | - }); | 102 | + |
100 | } | 103 | } |
101 | // 隐藏原生的tabbar | 104 | // 隐藏原生的tabbar |
102 | uni.hideTabBar(); | 105 | uni.hideTabBar(); |
@@ -229,4 +232,4 @@ | @@ -229,4 +232,4 @@ | ||
229 | height: 100%; | 232 | height: 100%; |
230 | width: 100%; | 233 | width: 100%; |
231 | } | 234 | } |
232 | -</style> | ||
235 | +</style> |
@@ -6,7 +6,13 @@ | @@ -6,7 +6,13 @@ | ||
6 | <text class="text-bold">{{ item.deviceAlias || item.deviceName || '暂无数据' }}</text> | 6 | <text class="text-bold">{{ item.deviceAlias || item.deviceName || '暂无数据' }}</text> |
7 | </view> | 7 | </view> |
8 | <view class="item-text text-clip"> | 8 | <view class="item-text text-clip"> |
9 | - <text class="text-muted">{{ item.details == null ? '暂无数据' : formatDetailText(item.details) }}</text> | 9 | + <text class="text-muted">{{ item.details == null ? '暂无数据' : getAttrText(item.details) }}</text> |
10 | + </view> | ||
11 | + <view class="item-text text-clip"> | ||
12 | + <text class="text-muted">{{ item.details == null ? '暂无数据' : getConditionText(item.details) }}</text> | ||
13 | + </view> | ||
14 | + <view class="item-text text-clip"> | ||
15 | + <text class="text-muted">{{ item.details == null ? '暂无数据' : getValuesText(item.details) }}</text> | ||
10 | </view> | 16 | </view> |
11 | <view class="item-text"> | 17 | <view class="item-text"> |
12 | <text class="text-muted"> | 18 | <text class="text-muted"> |
@@ -68,13 +74,29 @@ | @@ -68,13 +74,29 @@ | ||
68 | bindImageUrl(e) { | 74 | bindImageUrl(e) { |
69 | return this.alarmSeverity.find(item => item.value === e).icon | 75 | return this.alarmSeverity.find(item => item.value === e).icon |
70 | }, | 76 | }, |
71 | - formatDetailText(details) { | 77 | + |
78 | + getAttrText(details){ | ||
79 | + return this.formatDetailText(details,0) | ||
80 | + }, | ||
81 | + getConditionText(detail){ | ||
82 | + return this.formatDetailText(detail,1) | ||
83 | + }, | ||
84 | + getValuesText(detail){ | ||
85 | + return this.formatDetailText(detail,2) | ||
86 | + }, | ||
87 | + formatDetailText(details,type) { | ||
72 | const deviceIdKeys = Object.keys(details) | 88 | const deviceIdKeys = Object.keys(details) |
73 | if(!deviceIdKeys) return | 89 | if(!deviceIdKeys) return |
74 | const values = deviceIdKeys.reduce((acc, curr) => { | 90 | const values = deviceIdKeys.reduce((acc, curr) => { |
75 | const items = details[curr]?.triggerData | 91 | const items = details[curr]?.triggerData |
76 | if(items?.key && items?.logicValue && items.realValue){ | 92 | if(items?.key && items?.logicValue && items.realValue){ |
77 | - acc.push(`触发属性:${items.key ||'暂无数据'}, 触发条件:${findLogin(items)+items.logicValue || '暂无数据'}, 触发值:${items?.realValue || '暂无数据'} `) | 93 | + if(type==0){ |
94 | + acc.push(`触发属性:${items.key ||'暂无数据'}`) | ||
95 | + }else if (type ==1){ | ||
96 | + acc.push(`触发条件:${findLogin(items)+items.logicValue || '暂无数据'}`) | ||
97 | + }else if(type==2){ | ||
98 | + acc.push(`触发值:${items?.realValue || '暂无数据'}`) | ||
99 | + } | ||
78 | } | 100 | } |
79 | return acc | 101 | return acc |
80 | }, []) | 102 | }, []) |
@@ -93,7 +115,7 @@ | @@ -93,7 +115,7 @@ | ||
93 | 115 | ||
94 | .list-item { | 116 | .list-item { |
95 | width: 713rpx; | 117 | width: 713rpx; |
96 | - height: 233rpx; | 118 | + height: 340rpx; |
97 | background-color: #fff; | 119 | background-color: #fff; |
98 | margin-top: 24rpx; | 120 | margin-top: 24rpx; |
99 | display: flex; | 121 | display: flex; |
@@ -105,7 +127,7 @@ | @@ -105,7 +127,7 @@ | ||
105 | justify-content: flex-start; | 127 | justify-content: flex-start; |
106 | flex-direction: column; | 128 | flex-direction: column; |
107 | align-items: center; | 129 | align-items: center; |
108 | - height: 211rpx; | 130 | + height: 311rpx; |
109 | margin-top: 8rpx; | 131 | margin-top: 8rpx; |
110 | margin-left: 20rpx; | 132 | margin-left: 20rpx; |
111 | 133 |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <view class="camera-page"> | 2 | <view class="camera-page"> |
3 | <!-- 公共组件-每个页面必须引入 --> | 3 | <!-- 公共组件-每个页面必须引入 --> |
4 | <public-module></public-module> | 4 | <public-module></public-module> |
5 | - <header-org @openOrg="openOrg" :total="cameraTotal" :imageSrc="imageSrc"></header-org> | 5 | + <header-org @openOrg="openOrg" :total="cameraTotal" title="摄像头数:" :imageSrc="imageSrc"></header-org> |
6 | <view style="height: 150rpx;"></view> | 6 | <view style="height: 150rpx;"></view> |
7 | <!-- 自带分页组件 --> | 7 | <!-- 自带分页组件 --> |
8 | <mescroll-body ref="mescrollRef" :up="upOption" @init="mescrollInit" :down="downOption" @down="downCallback" | 8 | <mescroll-body ref="mescrollRef" :up="upOption" @init="mescrollInit" :down="downOption" @down="downCallback" |
@@ -8,14 +8,15 @@ | @@ -8,14 +8,15 @@ | ||
8 | shape="circle"></u--input> | 8 | shape="circle"></u--input> |
9 | </view> | 9 | </view> |
10 | </view> | 10 | </view> |
11 | + <header-org @openOrg="openOrg" :total="total" title="组态数:" :imageSrc="imageSrc"></header-org> | ||
11 | </view> | 12 | </view> |
12 | - <view style="height:35rpx"></view> | 13 | + <view style="height:128rpx"></view> |
13 | <!-- 公共组件-每个页面必须引入 --> | 14 | <!-- 公共组件-每个页面必须引入 --> |
14 | <public-module></public-module> | 15 | <public-module></public-module> |
15 | <!-- 自带分页组件 --> | 16 | <!-- 自带分页组件 --> |
16 | <mescroll-body ref="mescrollRef" :up="upOption" @init="mescrollInit" :down="downOption" @down="downCallback" | 17 | <mescroll-body ref="mescrollRef" :up="upOption" @init="mescrollInit" :down="downOption" @down="downCallback" |
17 | @up="upCallback"> | 18 | @up="upCallback"> |
18 | - <view class="configuation-container"> | 19 | + <view class="configuation-container" v-if="list.length"> |
19 | <view class="configuation-item"> | 20 | <view class="configuation-item"> |
20 | <view @click="openConfigDetail(item)" v-for="(item, index) in list" :key="index" class="item"> | 21 | <view @click="openConfigDetail(item)" v-for="(item, index) in list" :key="index" class="item"> |
21 | <image class="image" :src="item.icon || defaultConfigImage"></image> | 22 | <image class="image" :src="item.icon || defaultConfigImage"></image> |
@@ -23,7 +24,7 @@ | @@ -23,7 +24,7 @@ | ||
23 | </view> | 24 | </view> |
24 | </view> | 25 | </view> |
25 | </view> | 26 | </view> |
26 | - <mescroll-empty v-if="!list.length" /> | 27 | + <!-- <mescroll-empty v-if="!list.length" /> --> |
27 | </mescroll-body> | 28 | </mescroll-body> |
28 | <!-- 自带分页组件 --> | 29 | <!-- 自带分页组件 --> |
29 | <view style="height: 60rpx;"></view> | 30 | <view style="height: 60rpx;"></view> |
@@ -36,12 +37,20 @@ | @@ -36,12 +37,20 @@ | ||
36 | import { | 37 | import { |
37 | createScadaPageLink | 38 | createScadaPageLink |
38 | } from '../config/help.js'; | 39 | } from '../config/help.js'; |
40 | + import headerOrg from '@/components/common/header-org.vue' | ||
41 | + import { | ||
42 | + useNavigateTo | ||
43 | + } from '@/plugins/utils.js' | ||
39 | 44 | ||
40 | export default { | 45 | export default { |
41 | mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件) | 46 | mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件) |
47 | + components:{ | ||
48 | + headerOrg | ||
49 | + }, | ||
42 | data() { | 50 | data() { |
43 | return { | 51 | return { |
44 | defaultConfigImage: '../../../../static/test.png', | 52 | defaultConfigImage: '../../../../static/test.png', |
53 | + imageSrc:'/static/status.png', | ||
45 | page: { | 54 | page: { |
46 | num: 0, | 55 | num: 0, |
47 | size: 10 | 56 | size: 10 |
@@ -52,7 +61,9 @@ | @@ -52,7 +61,9 @@ | ||
52 | upOption: { | 61 | upOption: { |
53 | auto: false // 不自动加载 | 62 | auto: false // 不自动加载 |
54 | }, | 63 | }, |
55 | - list: [] | 64 | + list: [], |
65 | + total:0, | ||
66 | + ordId:'' | ||
56 | }; | 67 | }; |
57 | }, | 68 | }, |
58 | onLoad() { | 69 | onLoad() { |
@@ -62,6 +73,14 @@ | @@ -62,6 +73,14 @@ | ||
62 | isConfiguration: false | 73 | isConfiguration: false |
63 | }); | 74 | }); |
64 | }, | 75 | }, |
76 | + onShow() { | ||
77 | + if (this.ordId) { | ||
78 | + this.loadData(1,null, this.ordId); | ||
79 | + } | ||
80 | + }, | ||
81 | + onHide() { | ||
82 | + this.ordId = ''; | ||
83 | + }, | ||
65 | onUnload() { | 84 | onUnload() { |
66 | uni.setStorageSync('getConfiguration', { | 85 | uni.setStorageSync('getConfiguration', { |
67 | isConfiguration: false | 86 | isConfiguration: false |
@@ -91,11 +110,12 @@ | @@ -91,11 +110,12 @@ | ||
91 | this.page.num += 1; | 110 | this.page.num += 1; |
92 | this.loadData(this.page.num); | 111 | this.loadData(this.page.num); |
93 | }, | 112 | }, |
94 | - async loadData(pageNo, organizationV) { | 113 | + async loadData(pageNo, name,organizationId) { |
95 | let httpData = { | 114 | let httpData = { |
96 | page: pageNo, | 115 | page: pageNo, |
97 | pageSize: 10, | 116 | pageSize: 10, |
98 | - name: organizationV, | 117 | + name, |
118 | + organizationId, | ||
99 | platform: 'phone', | 119 | platform: 'phone', |
100 | isTemplate:0 | 120 | isTemplate:0 |
101 | }; | 121 | }; |
@@ -108,13 +128,16 @@ | @@ -108,13 +128,16 @@ | ||
108 | if (res) { | 128 | if (res) { |
109 | uni.stopPullDownRefresh(); | 129 | uni.stopPullDownRefresh(); |
110 | this.mescroll.endByPage(res.items.length, res.total); | 130 | this.mescroll.endByPage(res.items.length, res.total); |
111 | - this.cameraTotal = res.total; | 131 | + this.total = res.total; |
112 | if (pageNo == 1) { | 132 | if (pageNo == 1) { |
113 | this.list = res.items; | 133 | this.list = res.items; |
114 | } else { | 134 | } else { |
115 | this.list = this.list.concat(res.items); | 135 | this.list = this.list.concat(res.items); |
116 | } | 136 | } |
117 | } | 137 | } |
138 | + }, | ||
139 | + openOrg() { | ||
140 | + useNavigateTo('/pages/organization/organization') | ||
118 | } | 141 | } |
119 | } | 142 | } |
120 | }; | 143 | }; |
@@ -122,4 +145,4 @@ | @@ -122,4 +145,4 @@ | ||
122 | 145 | ||
123 | <style lang="scss" scoped> | 146 | <style lang="scss" scoped> |
124 | @import '../../static/configuration.scss'; | 147 | @import '../../static/configuration.scss'; |
125 | -</style> | ||
148 | +</style> |
@@ -8,8 +8,9 @@ | @@ -8,8 +8,9 @@ | ||
8 | shape="circle"></u--input> | 8 | shape="circle"></u--input> |
9 | </view> | 9 | </view> |
10 | </view> | 10 | </view> |
11 | + <header-org @openOrg="openOrg" :total="total" title="看板数:" :imageSrc="imageSrc"></header-org> | ||
11 | </view> | 12 | </view> |
12 | - <view style="height:35rpx"></view> | 13 | + <view style="height:128rpx"></view> |
13 | <!-- 公共组件-每个页面必须引入 --> | 14 | <!-- 公共组件-每个页面必须引入 --> |
14 | <public-module></public-module> | 15 | <public-module></public-module> |
15 | <!-- 自带分页组件 --> | 16 | <!-- 自带分页组件 --> |
@@ -33,15 +34,20 @@ | @@ -33,15 +34,20 @@ | ||
33 | <script> | 34 | <script> |
34 | import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js'; | 35 | import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js'; |
35 | import api from '@/api/index.js' | 36 | import api from '@/api/index.js' |
37 | + import headerOrg from '@/components/common/header-org.vue' | ||
36 | import { | 38 | import { |
37 | - createScadaPageLink | ||
38 | - } from '../config/help.js'; | 39 | + useNavigateTo |
40 | + } from '@/plugins/utils.js' | ||
39 | 41 | ||
40 | export default { | 42 | export default { |
41 | mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件) | 43 | mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件) |
44 | + components:{ | ||
45 | + headerOrg | ||
46 | + }, | ||
42 | data() { | 47 | data() { |
43 | return { | 48 | return { |
44 | defaultConfigImage: '../../../../static/test.png', | 49 | defaultConfigImage: '../../../../static/test.png', |
50 | + imageSrc:'/static/visual-board.png', | ||
45 | page: { | 51 | page: { |
46 | num: 0, | 52 | num: 0, |
47 | size: 10 | 53 | size: 10 |
@@ -52,7 +58,9 @@ | @@ -52,7 +58,9 @@ | ||
52 | upOption: { | 58 | upOption: { |
53 | auto: false // 不自动加载 | 59 | auto: false // 不自动加载 |
54 | }, | 60 | }, |
55 | - list: [] | 61 | + list: [], |
62 | + total:0, | ||
63 | + ordId:'' | ||
56 | }; | 64 | }; |
57 | }, | 65 | }, |
58 | onLoad() { | 66 | onLoad() { |
@@ -62,6 +70,14 @@ | @@ -62,6 +70,14 @@ | ||
62 | isConfiguration: false | 70 | isConfiguration: false |
63 | }); | 71 | }); |
64 | }, | 72 | }, |
73 | + onShow() { | ||
74 | + if (this.ordId) { | ||
75 | + this.loadData(1,null, this.ordId); | ||
76 | + } | ||
77 | + }, | ||
78 | + onHide() { | ||
79 | + this.ordId = ''; | ||
80 | + }, | ||
65 | onUnload() { | 81 | onUnload() { |
66 | uni.setStorageSync('getConfiguration', { | 82 | uni.setStorageSync('getConfiguration', { |
67 | isConfiguration: false | 83 | isConfiguration: false |
@@ -74,7 +90,6 @@ | @@ -74,7 +90,6 @@ | ||
74 | this.loadData(1, e); | 90 | this.loadData(1, e); |
75 | }, | 91 | }, |
76 | openConfigDetail(e) { | 92 | openConfigDetail(e) { |
77 | - console.log(e,'e') | ||
78 | uni.navigateTo({ | 93 | uni.navigateTo({ |
79 | url: 'detail?id=' + e.id | 94 | url: 'detail?id=' + e.id |
80 | }); | 95 | }); |
@@ -91,11 +106,12 @@ | @@ -91,11 +106,12 @@ | ||
91 | this.page.num += 1; | 106 | this.page.num += 1; |
92 | this.loadData(this.page.num); | 107 | this.loadData(this.page.num); |
93 | }, | 108 | }, |
94 | - async loadData(pageNo, name) { | 109 | + async loadData(pageNo, name,organizationId) { |
95 | let httpData = { | 110 | let httpData = { |
96 | page: pageNo, | 111 | page: pageNo, |
97 | pageSize: 10, | 112 | pageSize: 10, |
98 | name, | 113 | name, |
114 | + organizationId, | ||
99 | platform: 'phone' | 115 | platform: 'phone' |
100 | }; | 116 | }; |
101 | const res = await api.homeApi.getVisualBoardApi({ | 117 | const res = await api.homeApi.getVisualBoardApi({ |
@@ -107,13 +123,16 @@ | @@ -107,13 +123,16 @@ | ||
107 | if (res) { | 123 | if (res) { |
108 | uni.stopPullDownRefresh(); | 124 | uni.stopPullDownRefresh(); |
109 | this.mescroll.endByPage(res.items.length, res.total); | 125 | this.mescroll.endByPage(res.items.length, res.total); |
110 | - this.cameraTotal = res.total; | 126 | + this.total = res.total; |
111 | if (pageNo == 1) { | 127 | if (pageNo == 1) { |
112 | this.list = res.items; | 128 | this.list = res.items; |
113 | } else { | 129 | } else { |
114 | this.list = this.list.concat(res.items); | 130 | this.list = this.list.concat(res.items); |
115 | } | 131 | } |
116 | } | 132 | } |
133 | + }, | ||
134 | + openOrg() { | ||
135 | + useNavigateTo('/pages/organization/organization') | ||
117 | } | 136 | } |
118 | } | 137 | } |
119 | }; | 138 | }; |
1 | .configuation-page { | 1 | .configuation-page { |
2 | background: #f8f9fa; | 2 | background: #f8f9fa; |
3 | - padding: 15rpx 15rpx; | ||
4 | min-height: 100vh; | 3 | min-height: 100vh; |
5 | .configuation-header{ | 4 | .configuation-header{ |
6 | - margin-left:15rpx; | ||
7 | - background-color: #f8f9fa; | 5 | + background-color: #fff; |
8 | position:fixed; | 6 | position:fixed; |
9 | top:0rpx; | 7 | top:0rpx; |
10 | z-index: 99999; | 8 | z-index: 99999; |
@@ -16,19 +14,22 @@ | @@ -16,19 +14,22 @@ | ||
16 | justify-content: space-between; | 14 | justify-content: space-between; |
17 | flex-direction: row; | 15 | flex-direction: row; |
18 | .search-main { | 16 | .search-main { |
19 | - width: 700rpx; | 17 | + background: #fff; |
18 | + width: 750rpx; | ||
19 | + padding:0 25rpx; | ||
20 | margin-top: -34rpx; | 20 | margin-top: -34rpx; |
21 | } | 21 | } |
22 | } | 22 | } |
23 | } | 23 | } |
24 | 24 | ||
25 | .configuation-container { | 25 | .configuation-container { |
26 | + padding: 15rpx 15rpx; | ||
26 | .configuation-item { | 27 | .configuation-item { |
27 | width: 750rpx; | 28 | width: 750rpx; |
28 | display: flex; | 29 | display: flex; |
29 | justify-content: space-between; | 30 | justify-content: space-between; |
30 | flex-wrap: wrap; | 31 | flex-wrap: wrap; |
31 | - margin: 58rpx 0rpx 0rpx 6rpx; | 32 | + margin: 128rpx 0rpx 0rpx 6rpx; |
32 | .item { | 33 | .item { |
33 | width: 330rpx; | 34 | width: 330rpx; |
34 | height: 288rpx; | 35 | height: 288rpx; |
@@ -59,4 +60,4 @@ | @@ -59,4 +60,4 @@ | ||
59 | .configuation-detail-page { | 60 | .configuation-detail-page { |
60 | background: #f8f9fa; | 61 | background: #f8f9fa; |
61 | min-height: 100vh; | 62 | min-height: 100vh; |
62 | - } | ||
63 | + } |