Commit 75e8a810abb10788bf616e4c6c93349a0bd349a5

Authored by xp.Huang
2 parents 1af9032c 89303202

Merge branch 'main_dev' into 'main'

Main dev

See merge request yunteng/thingskit-app!169
... ... @@ -44,7 +44,8 @@
44 44 <!-- #endif -->
45 45 <view class="bottom-button">
46 46 <view v-if="handleText.includes(alarmDetail[8].value)" class="u-flex button-item">
47   - <u-button @click="handleSubmit" type="primary" shape="circle" :text="$t('alarm.handle')"></u-button>
  47 + <u-button @click="handleSubmit
  48 + " type="primary" shape="circle" :text="$t('alarm.handle')"></u-button>
48 49 </view>
49 50 <view v-if="clearText.includes(alarmDetail[8].value)" class="u-flex button-item">
50 51 <u-button @click="handleRemove" type="error" shape="circle" :text="$t('alarm.cleanUp')"></u-button>
... ... @@ -146,16 +147,16 @@ export default {
146 147 async handleSubmit() {
147 148 if (this.formModel.result == '') return uni.$u.toast(this.$t('alarm.pleaseResult'));
148 149 const res = await api.alarmApi.postAlarmAckApi(this.detailId)
149   - if (res == '') {
  150 + // if (res == '') {
150 151 this.returnPrevPage(this.$t('common.processSuccess'))
151 152 setTimeout(() => {
152 153 useNavigateBack(1)
153 154 }, 500);
154   - }
  155 + // }
155 156 },
156 157 async handleRemove() {
157 158 const res = await api.alarmApi.postAlarmClearApi(this.detailId)
158   - if (res == '') {
  159 + // if (res == '') {
159 160 this.returnPrevPage(this.$t('common.clearSuccess'))
160 161 setTimeout(async () => {
161 162 useNavigateBack(1)
... ... @@ -165,7 +166,7 @@ export default {
165 166 await this.updateBadgeTotal(res.totalAlarm?.activedAlarm);
166 167 }
167 168 }, 500);
168   - }
  169 + // }
169 170 },
170 171 //触发值处理
171 172 formatAlarmValue(e, dataFormat) {
... ...
... ... @@ -27,6 +27,14 @@ const getVisualBoardApi = (params) => {
27 27 return uni.$u.http.get('yt/data_board', params)
28 28 }
29 29
  30 +/**
  31 + *
  32 + * @description 查询大屏分页
  33 + */
  34 +const getLargeScreen = (params) => {
  35 + return uni.$u.http.get('yt/data_view', params)
  36 +}
  37 +
30 38 //获取组织列表
31 39 const getMeOrgListApi = () => {
32 40 return uni.$u.http.get('/yt/organization/me/list')
... ... @@ -38,6 +46,6 @@ export default {
38 46 byCameraIdGetDetailApi,
39 47 getConfigurationApi,
40 48 getMeOrgListApi,
41   - getVisualBoardApi,
  49 + getVisualBoardApi, getLargeScreen,
42 50 getCameraGBTUrl,
43 51 }
... ...
... ... @@ -3,16 +3,24 @@ import { getTabbarHeight } from '@/plugins/utils'
3 3 * 服务端配置项
4 4 * baseUrl 服务端 api地址
5 5 * baseDrawioUrl 组态地址 注意端口
6   - * baseVisualUrl 看板地址
  6 + * baseLargeDesigner 新版看板 注意端口
  7 + * baseVisualUrl 旧版看板地址
7 8 * baseWebSocketUrl 服务端 websocket地址
8 9 * socketPrefix websocket前缀 ((https, wss),( http, ws))
9 10 */
10   -const baseUrl = 'http://localhost:8080/api'
11   -// const baseUrl = 'http://192.168.1.9:8080/api'
12   -const baseVisualUrl = 'http://localhost:9527'
13   -// const baseVisualUrl = "http://192.168.1.4:8083"
14   -const baseDrawioUrl = 'http://localhost:9527/thingskit-scada'
15   -const baseWebSocketUrl = 'localhost:8080'
  11 +// const baseUrl = 'http://222.180.200.114:30427/api'
  12 +const baseUrl = 'http://192.168.1.235:9527/api'
  13 +
  14 +//
  15 +// const baseVisualUrl = 'http://222.180.200.114:30427'
  16 +const baseVisualUrl = 'http://192.168.1.235:9527'
  17 +
  18 +// const baseDrawioUrl = 'http://222.180.200.114:30427/thingskit-scada'
  19 +const baseDrawioUrl = 'http://192.168.1.235:9527/thingskit-scada'
  20 +
  21 +const baseLargeDesigner = 'http://192.168.1.235:9527/large-designer'
  22 +
  23 +const baseWebSocketUrl = '192.168.1.235:9527'
16 24 const socketPrefix = 'ws'
17 25
18 26 let systemInfo = {
... ... @@ -44,6 +52,7 @@ const courtConfig = {
44 52 baseUrl, //服务端地址
45 53 baseVisualUrl, //服务端看板地址
46 54 baseDrawioUrl, //服务端组态地址
  55 + baseLargeDesigner,//服务端大屏地址
47 56 baseWebSocketUrl, //服务端websocket地址
48 57 socketPrefix, //websocket前缀
49 58 systemInfo: systemInfo, //系统信息
... ...
... ... @@ -134,7 +134,7 @@
134 134 return this.deviceDetail.alarmStatus === '0' ? this.$t('common.noText') : this.$t('common.yesText');
135 135 },
136 136 formatLastOnlineTime() {
137   - return formatToDate(Number(this.deviceDetail.lastOnlineTime), 'YYYY-MM-DD HH:mm:ss');
  137 + return this.deviceDetail?.lastOnlineTime && Number(this.deviceDetail?.lastOnlineTime)?formatToDate(Number(this.deviceDetail.lastOnlineTime), 'YYYY-MM-DD HH:mm:ss'):' ';
138 138 }
139 139 },
140 140 beforeCreate() {
... ...
... ... @@ -14,10 +14,13 @@ export default {
14 14 },
15 15 cameraManagement: 'Camera management',
16 16 configuration: 'Configuration',
17   - bulletinBoard: 'Bulletin board',
  17 + bulletinBoard: 'Old notice board',
  18 + largeScreen: 'New notice board',
18 19 cameraNum: 'Number of cameras:',
19 20 configurationNum: 'Number of configurations:',
20 21 pleaseConfigurationname: 'Please enter the configuration name',
21 22 bulletionBoard: "Number of bulletin boards:",
22   - pleaseVisualBoard: 'Please enter the name of the board'
  23 + largeScreenCount: "Large screen count:",
  24 + pleaseVisualBoard: 'Please enter the name of the board',
  25 + pleaselargeScreen: 'Please enter the name of the large screen',
23 26 }
... ...
... ... @@ -8,6 +8,7 @@ export default {
8 8 configurationDetail: 'Configuration details',
9 9 organizationScreening: 'Organizational screening',
10 10 viewBoard: 'View bulletin board',
  11 + viewLargeScreen: 'View large screen',
11 12 boardDetail: 'Bulletin board detail',
12 13 languageSettings: 'Language settings',
13 14 alarmDetail: 'Alarm details',
... ...
... ... @@ -14,10 +14,13 @@ export default {
14 14 },
15 15 cameraManagement: '摄像头管理',
16 16 configuration: '组态',
17   - bulletinBoard: '看板',
  17 + bulletinBoard: '旧版看板',
  18 + largeScreen: '新版看板 ',
18 19 cameraNum: '摄像头数:',
19 20 configurationNum: '组态数:',
20 21 pleaseConfigurationname: '请输入组态名称',
21 22 bulletionBoard: '看板数:',
  23 + largeScreenCount: '大屏数',
22 24 pleaseVisualBoard: '请输入看板名称',
  25 + pleaselargeScreen: '请输入大屏名称',
23 26 }
... ...
... ... @@ -8,6 +8,7 @@ export default {
8 8 configurationDetail: "组态详情",
9 9 organizationScreening: '组织筛选',
10 10 viewBoard: '查看看板',
  11 + viewLargeScreen: '查看大屏',
11 12 boardDetail: '看板详情',
12 13 languageSettings: '语言设置',
13 14 alarmDetail: '告警详情',
... ...
... ... @@ -75,6 +75,18 @@
75 75 }
76 76 },
77 77 {
  78 + "path": "pages/index/components/largeScreen/index",
  79 + "style": {
  80 + "navigationBarTitleText": ""
  81 + }
  82 + },
  83 + {
  84 + "path": "pages/index/components/largeScreen/detail",
  85 + "style": {
  86 + "navigationBarTitleText": ""
  87 + }
  88 + },
  89 + {
78 90 "path": "pages/personal/components/switchLocales",
79 91 "style": {
80 92 "navigationBarTitleText": ""
... ...
... ... @@ -48,4 +48,17 @@ export const createScadaPageLink = (
48 48 const href = `${config.baseDrawioUrl}#${hash}`
49 49
50 50 return href
51   -};
\ No newline at end of file
  51 +};
  52 +
  53 +export const createLargeScreenPageLink = (record) => {
  54 + const userInfo = uni.getStorageSync('userInfo')
  55 + const BackEndLocaleMapping = {
  56 + 'en': 'en_US ',
  57 + 'zhCN': 'zh_CN',
  58 + 'zh-Hans': 'zh_CN'
  59 + };
  60 + const locale = BackEndLocaleMapping[uni.getLocale()] || 'zh_CN'
  61 +
  62 + const href = `${config.baseLargeDesigner}/#/chart/preview/${record?.id}?organizationId=${record.organizationId}&locale=${locale}&userId=${userInfo.userId}&isPhone=Phone`
  63 + return href
  64 +}
... ...
  1 +<template>
  2 + <view class="configuation-detail-page">
  3 + <!-- 公共组件-每个页面必须引入 -->
  4 + <public-module></public-module>
  5 + <web-view :src="largeScreenUrl"></web-view>
  6 + </view>
  7 +</template>
  8 +
  9 +<script>
  10 +import {
  11 + createLargeScreenPageLink
  12 +} from '../config/help.js';
  13 + export default {
  14 + data(){
  15 + return {
  16 + largeScreenUrl:'',
  17 + }
  18 + },
  19 + async onLoad(e){
  20 + // 隐藏原生的tabbar
  21 + uni.hideTabBar();
  22 + this.createShareUrl(e)
  23 + },
  24 + onShow(){
  25 + // this.$nextTick(()=>{
  26 + // uni.setNavigationBarTitle({
  27 + // title:this.$t('menu.boardDetail')
  28 + // })
  29 + // })
  30 + },
  31 + methods:{
  32 + async createShareUrl(record){
  33 + const href = createLargeScreenPageLink(record)
  34 + console.log(href,'url')
  35 + this.largeScreenUrl = href
  36 + }
  37 + }
  38 + }
  39 +</script>
  40 +
  41 +<!-- <style lang="scss" scoped>
  42 + @import '../../static/configuration.scss';
  43 +</style> -->
... ...
  1 +<template>
  2 + <view class="configuation-page">
  3 + <view class="configuation-header">
  4 + <view class="header-gap"></view>
  5 + <view class="search-top">
  6 + <view class="search-main">
  7 + <u--input @change="inputChanged" prefixIcon="search" :placeholder="$t('homePage.pleaseVisualBoard')" border="surround"
  8 + shape="circle"></u--input>
  9 + </view>
  10 + </view>
  11 + <header-org @openOrg="openOrg" :total="total" :title="$t('homePage.bulletionBoard')" :imageSrc="imageSrc"></header-org>
  12 + </view>
  13 + <view style="height:128rpx"></view>
  14 + <!-- 公共组件-每个页面必须引入 -->
  15 + <public-module></public-module>
  16 + <!-- 自带分页组件 -->
  17 + <mescroll-body height="80%" ref="mescrollRef" :up="upOption" @init="mescrollInit" :down="downOption" @down="downCallback"
  18 + @up="upCallback">
  19 + <view class="configuation-container">
  20 + <view class="configuation-item">
  21 + <view @click="openConfigDetail(item)" v-for="(item, index) in list" :key="index" class="item">
  22 + <image class="image" :src="item.icon || defaultConfigImage"></image>
  23 + <text class="name">{{ item.name }}</text>
  24 + </view>
  25 + </view>
  26 + </view>
  27 + <!-- <mescroll-empty v-if="!list.length" /> -->
  28 + </mescroll-body>
  29 + <!-- 自带分页组件 -->
  30 + <view style="height: 60rpx;"></view>
  31 + </view>
  32 +</template>
  33 +
  34 +<script>
  35 + import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js';
  36 + import api from '@/api/index.js'
  37 + import headerOrg from '@/components/common/header-org.vue'
  38 + import {
  39 + useNavigateTo
  40 + } from '@/plugins/utils.js'
  41 + import {
  42 + createLargeScreenPageLink
  43 + } from '../config/help.js';
  44 +
  45 + export default {
  46 + mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件)
  47 + components:{
  48 + headerOrg
  49 + },
  50 + data() {
  51 + return {
  52 + defaultConfigImage: '../../../../static/test.png',
  53 + imageSrc:'/static/visual-board.png',
  54 + page: {
  55 + num: 0,
  56 + size: 10
  57 + },
  58 + downOption: {
  59 + auto: true //是否在初始化后,自动执行downCallback; 默认true
  60 + },
  61 + upOption: {
  62 + auto: false // 不自动加载
  63 + },
  64 + list: [],
  65 + total:0,
  66 + ordId:''
  67 + };
  68 + },
  69 + onLoad() {
  70 + // 隐藏原生的tabbar
  71 + uni.hideTabBar();
  72 + uni.setStorageSync('getConfiguration', {
  73 + isConfiguration: false
  74 + });
  75 + },
  76 + onShow(){
  77 + uni.setNavigationBarTitle({
  78 + title:this.$t('menu.viewBoard')
  79 + })
  80 + if (this.ordId) {
  81 + this.loadData(1,null, this.ordId);
  82 + }
  83 + },
  84 + onHide() {
  85 + this.ordId = '';
  86 + },
  87 + onUnload() {
  88 + uni.setStorageSync('getConfiguration', {
  89 + isConfiguration: false
  90 + });
  91 + uni.removeStorageSync('getConfiguration');
  92 + },
  93 + methods: {
  94 + inputChanged(e) {
  95 + this.page.num = 1;
  96 + this.loadData(1, e);
  97 + },
  98 +
  99 + async openConfigDetail(record) {
  100 + const {id,organizationId} = record || {}
  101 + uni.navigateTo({
  102 + url: `detail?id=${id}&organizationId=${organizationId}`
  103 + });
  104 + },
  105 + /*下拉刷新的回调 */
  106 + downCallback() {
  107 + //联网加载数据
  108 + this.page.num = 1;
  109 + this.loadData(1);
  110 + },
  111 + /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  112 + upCallback() {
  113 + //联网加载数据
  114 + this.page.num += 1;
  115 + this.loadData(this.page.num);
  116 + },
  117 + async loadData(pageNo, name,organizationId) {
  118 + let httpData = {
  119 + page: pageNo,
  120 + pageSize: 10,
  121 + name,
  122 + organizationId,
  123 + template:false,
  124 + visualization: 'DATA_BOARD'
  125 + // platform: 'phone'
  126 + };
  127 + const res = await api.homeApi.getLargeScreen({
  128 + params: httpData,
  129 + custom: {
  130 + load: false
  131 + }
  132 + })
  133 + if (res) {
  134 + uni.stopPullDownRefresh();
  135 + this.mescroll.endBySize(res.items.length, res.total);
  136 + this.total = res.total;
  137 + if(!res.items.length && res.total==0){
  138 + this.mescroll.showEmpty()
  139 + }else{
  140 + this.mescroll.removeEmpty()
  141 + }
  142 + if (pageNo == 1) {
  143 + this.list = res.items;
  144 + } else {
  145 + this.list = this.list.concat(res.items);
  146 + }
  147 + }
  148 + },
  149 + openOrg() {
  150 + useNavigateTo('/pages/organization/organization')
  151 + }
  152 + }
  153 + };
  154 +</script>
  155 +
  156 +<style lang="scss" scoped>
  157 + @import '../../static/configuration.scss';
  158 +</style>
... ...
... ... @@ -13,6 +13,11 @@ const basicGridList = [{
13 13 icon: '/static/visual-board.png',
14 14 text: 'homePage.bulletinBoard'
15 15 },
  16 +{
  17 + event: 'largeScreen',
  18 + icon: '/static/visual-newBoard.png',
  19 + text: 'homePage.largeScreen'
  20 +}
16 21 ]
17 22
18 23 const basicStatistics = [{
... ...
... ... @@ -155,6 +155,9 @@ export default {
155 155 openVisualBoard() {
156 156 useNavigateTo('components/visualBoard/index')
157 157 },
  158 + openLargeScreen(){
  159 + useNavigateTo('components/largeScreen/index')
  160 + },
158 161 handleEvent(event) {
159 162 if (getApp().getBindNot()) {
160 163 uni.$u.toast(this.$t('common.pleaseBindAccount'))
... ... @@ -162,7 +165,8 @@ export default {
162 165 }
163 166 if (event === 'visualBoard') {
164 167 this.openVisualBoard()
165   - } else if (event === 'openCamera') this.openCamera()
  168 + }else if(event==='largeScreen') this.openLargeScreen()
  169 + else if (event === 'openCamera') this.openCamera()
166 170 else {
167 171 this.openConfiguration()
168 172 }
... ...