Commit 5580dec3 authored by 邓晓峰's avatar 邓晓峰

fix: alarm message bug

parent 2c1201d5
Pipeline #24556 skipped with stages
This diff was suppressed by a .gitattributes entry.
/* eslint-disable */
// const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin;
const proxyURL = 'http://192.168.10.150:8777';
const proxyURL = 'https://panda-water.com';
module.exports = {
assetsRoot: process.env.NODE_ENV !== 'production' ? proxyURL : './',
dev: {
......@@ -71,7 +71,7 @@ module.exports = {
},
'/CityTemp': {
// target: 'http://192.168.10.150:8777',
target: 'https://panda-water.cn',
target: proxyURL,
changeOrigin: true,
headers: {
'Access-Control-Allow-Origin': '*',
......
......@@ -41,7 +41,6 @@ const isHttps = document.location.protocol === 'https:';
const { pwa } = defaultSettings;
// eslint-disable-next-line no-restricted-globals
const namespace = `__PANDA_STORE__${location.hostname}`;
debugger
window.createStoreage = new Storeage(namespace);
// eslint-disable-next-line no-underscore-dangle
const initialState = Immutable.Map();
......
......@@ -217,7 +217,7 @@ class NoticeIconView extends Component {
<NoticeIcon.Tab
list={this.state.noticeData}
title={<FormattedMessage id='component.noticeIcon.title'/>}
emptyText={<FormattedMessage id='noticeIocn.allClear'/>}
emptyText={<FormattedMessage id='component.noticeIcon.allClear'/>}
confirmRead={this.notifier.confirmRead}
handlerSysDetail={this.handlerSysDetail}
loadMore={this.notifier.loadMore}
......
......@@ -27,8 +27,8 @@ export class AlarmContent {
const Alarm = ({ message, confirmRead, config }) => {
const alarmContent = (config.mqtt_mess.MessageLevel === "2.0" && isJSON(message.infoContent)) ? JSON.parse(message.infoContent): message.infoContent;
console.log("alarmContent", alarmContent);
const goPath = item => {
debugger
confirmRead(false, [message.id]);
const widgetID = 'widget_city_综合运营_管网监控_实时监控_报警监控';
const webPath = 'product/scada/AlertMonitoring/AlertMonitoring';
......@@ -67,18 +67,12 @@ const Alarm = ({ message, confirmRead, config }) => {
<i>{alarmContent.alarmType}</i>
{alarmTitle}
</p>
<p>{alarmContent.alarmContent}</p>
<p>
<font style={{ color: '#ff0000' }} title="点击查看详情">
{(alarmValue && Array.isArray(alarmValue) && alarmValue.length > 0 &&
alarmValue[0] !== 'undefined' &&
alarmValue[0]) ||
''}
</font>
{`${(alarmValue && Array.isArray(alarmValue) && alarmValue.length > 0 &&
alarmValue[1] !== 'undefined' &&
alarmValue[1]) ||
''} / ${alarmContent && alarmContent.alarmThreshold && alarmContent.alarmThreshold.split(' ').join('')}`}
<p style={{color: '#888'}}>{alarmContent.alarmContent}</p>
<p style={{color: '#888'}} >
{
alarmContent && alarmContent.content.split(",")[1]
}
</p>
<p className={commonStyles.messageTime}>{message.time}</p>
</div>
......
......@@ -479,7 +479,7 @@ class Notifier {
renderPopPlatform(message) {
this.renderPlatformElement =
this.renderPlatform && this.renderPlatform(message);
this.renderPlatform && this.renderPlatorm(message);
}
renderSysNoticePlatform(message) {
......
......@@ -45,7 +45,7 @@ const recentProductStorage = new Storage(
const currentProduct = new Store(
`__global__recent_productIndex__micro_${window.location.hostname}`,
);
Cookies.set('loginMode', 'pdw');
Cookies.set('loginMode', Cookies.get('loginMode') || 'pdw');
export const initialState = fromJS({
globalConfig: {},
globalConfigError: '',
......
......@@ -68,7 +68,7 @@ select:-webkit-autofill {
}
#root {
& /deep/ .@{ant-prefix}-pro-basicLayout-content {
& :global(.ant-pro-basicLayout-content) {
margin: 0 !important;
height: 100%;
}
......@@ -80,143 +80,165 @@ select:-webkit-autofill {
.subapp-container .web4_console_component {
height: 100%;
}
& /deep/ .@{ant-prefix}-pro-sider-menu {
.@{ant-prefix}-pro-menu-item {
font-size: 12px;
overflow: hidden;
text-overflow: ellipsis;
}
&:not(.@{ant-prefix}-menu-inline-collapsed) {
.@{ant-prefix}-pro-menu-item {
width: 80px;
& :global{
.ant-pro-sider-menu {
.ant-pro-menu-item {
// font-size: 12px;
overflow: hidden;
text-overflow: ellipsis;
}
}
// width: 80px;
.@{ant-prefix}-menu-item-only-child {
// a {
// display: flex;
// align-items: center;
// }
span.@{ant-prefix}-pro-menu-item {
margin-left: 8px;
&:not(.ant-menu-inline-collapsed) {
.ant-pro-menu-item {
width: 80px;
}
}
}
.@{ant-prefix}-menu-submenu {
div.@{ant-prefix}-menu-submenu-title {
display: flex;
align-items: center;
img {
margin-right: 8px;
// width: 80px;
.ant-menu-item-only-child {
// a {
// display: flex;
// align-items: center;
// }
span.ant-pro-menu-item {
margin-left: 8px;
}
}
ul.@{ant-prefix}-menu-sub {
li {
.ant-menu-submenu {
div.ant-menu-submenu-title {
display: flex;
align-items: center;
img {
width: 14px !important;
height: 14px !important;
// margin-right: 12px;
margin-right: 8px;
}
.@{ant-prefix}-pro-menu-item {
padding-left: 0 !important;
}
ul.ant-menu-sub {
li {
img {
width: 14px !important;
height: 14px !important;
// margin-right: 12px;
}
.ant-pro-menu-item {
padding-left: 0 !important;
}
}
}
}
.@{ant-prefix}-layout-slider-dark {
box-shadow: rgba(0, 0, 0, 0.6) 0px 1px 4px 0px;
transition: all 0.25s ease-in-out 0s;
}
}
.@{ant-prefix}-layout-slider-dark {
box-shadow: rgba(0, 0, 0, 0.6) 0px 1px 4px 0px;
transition: all 0.25s ease-in-out 0s;
.ant-pro-sider .ant-layout-sider-children ::-webkit-scrollbar {
width: 0;
height: 0;
}
}
& /deep/ .@{ant-prefix}-menu-submenu-popup {
.@{ant-prefix}-menu-item {
img {
width: 14px !important;
height: 14px !important;
margin-right: 12px;
}
.@{ant-prefix}-pro-menu-item {
padding-left: 0;
.@{ant-prefix}-menu-submenu-popup {
.@{ant-prefix}-menu-item {
img {
width: 14px !important;
height: 14px !important;
margin-right: 12px;
}
.@{ant-prefix}-pro-menu-item {
padding-left: 0;
}
}
}
}
& /deep/ .@{ant-prefix}-menu-dark {
.@{ant-prefix}-menu-submenu-selected {
.@{ant-prefix}-menu-item-selected {
// background: rgb(39, 49, 80);
// border-left: 3px solid rgb(23, 160, 242);
.@{ant-prefix}-menu-dark {
.@{ant-prefix}-menu-submenu-selected {
.@{ant-prefix}-menu-item-selected {
// background: rgb(39, 49, 80);
// border-left: 3px solid rgb(23, 160, 242);
}
}
}
}
& /deep/ .@{ant-prefix}-pro-sider {
.@{ant-prefix}-layout-sider-children {
::-webkit-scrollbar-thumb {
border-radius: 0;
}
::-webkit-scrollbar {
width: 0px;
height: 0px;
.@{ant-prefix}-pro-sider {
.@{ant-prefix}-layout-sider-children {
::-webkit-scrollbar-thumb {
border-radius: 0;
}
::-webkit-scrollbar {
width: 0px;
height: 0px;
}
}
}
}
& /deep/ .@{ant-prefix}-pro-sider-logo {
justify-content: center;
}
& /deep/ .@{ant-prefix}-layout-sider-collapsed {
.@{ant-prefix}-pro-sider-logo {
transform: scale(0.7);
justify-content: center;
}
.@{ant-prefix}-menu-submenu-vertical {
.@{ant-prefix}-menu-submenu-title {
display: flex;
align-items: center;
flex-wrap: wrap;
// margin-bottom: 8px;
.@{ant-prefix}-layout-sider-collapsed {
.@{ant-prefix}-pro-sider-logo {
transform: scale(0.7);
}
}
.@{ant-prefix}-menu-dark.@{ant-prefix}-menu-dark:not(.@{ant-prefix}-menu-horizontal) {
.@{ant-prefix}-menu-item-selected {
// border-left: 2px solid #1890ff;
// background-color: #273150;
.@{ant-prefix}-menu-submenu-vertical {
.@{ant-prefix}-menu-submenu-title {
display: flex;
align-items: center;
flex-wrap: wrap;
// margin-bottom: 8px;
}
}
.@{ant-prefix}-menu-dark.@{ant-prefix}-menu-dark:not(.@{ant-prefix}-menu-horizontal) {
.@{ant-prefix}-menu-item-selected {
// border-left: 2px solid #1890ff;
// background-color: #273150;
}
}
}
}
& /deep/ .@{ant-prefix}-pro-global-header-layout-side {
> div {
display: flex;
.@{ant-prefix}-pro-global-header-layout-side {
> div {
display: flex;
}
}
}
& /deep/ .@{ant-prefix}-pro-basicLayout-side {
.@{ant-prefix}-pro-sider-extra {
padding: 0 14px !important;
.@{ant-prefix}-pro-basicLayout-side {
.@{ant-prefix}-pro-sider-extra {
padding: 0 14px !important;
}
}
}
& /deep/ .@{ant-prefix}-pro-fixed-header {
.@{ant-prefix}-pro-global-header-layout-side {
padding: 0 0 0 16px;
.@{ant-prefix}-pro-fixed-header {
.@{ant-prefix}-pro-global-header-layout-side {
padding: 0 0 0 16px;
}
}
}
}
body {
& /deep/ .@{ant-prefix}-menu-submenu-popup {
.@{ant-prefix}-menu-sub {
li {
a {
display: flex;
align-items: center;
.@{ant-prefix}-pro-menu-item {
margin-left: 8px;
:global {
.@{ant-prefix}-menu-submenu-popup {
.@{ant-prefix}-menu-sub {
li {
a {
display: flex;
align-items: center;
.@{ant-prefix}-pro-menu-item {
margin-left: 8px;
}
}
}
}
}
}
& /deep/ .@{ant-prefix}-message-notice-content {
.@{ant-prefix}-message-custom-content {
display: flex;
align-items: center;
.@{ant-prefix}-message-notice-content {
.@{ant-prefix}-message-custom-content {
display: flex;
align-items: center;
}
}
}
//& /deep/ .ant-menu-vertical > .ant-menu-item,
//.ant-menu-vertical-left > .ant-menu-item,
//.ant-menu-vertical-right > .ant-menu-item,
......
export default {
'component.noticeIcon.clear': '清空',
'component.noticeIcon.cleared': '清空了',
'component.noticeIcon.allClear': '暂无新通知',
'component.noticeIcon.empty': '暂无数据',
'component.noticeIcon.view-more': '查看更多',
'component.noticeIcon.title': '通知',
......
......@@ -277,3 +277,4 @@ window.app.define('rc-tree-select', require.context('../node_modules/rc-tree-sel
window.app.define('rc-trigger', require.context('../node_modules/rc-trigger/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('rc-upload', require.context('../node_modules/rc-upload/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('rc-virtual-list', require.context('../node_modules/rc-virtual-list/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
import 'kit_logger';
import { message } from 'antd';
import {
decode,
encode,
} from 'js-base64';
import { decode, encode } from 'js-base64';
import Cookies from 'js-cookie';
import sha1 from 'sha1';
......@@ -456,12 +453,13 @@ class Login {
cacheBust: true,
})
.then(response => {
console.log('sceen wx', response);
if (response.token) {
self.globalConfig.token = response.token;
self.updateConfig && self.updateConfig(this.globalConfig);
self.isSignIn = true;
self.getUserInfoAndConfig();
Logger.log('===getUserInfoAndConfig===');
// Logger.log('===getUserInfoAndConfig===');
} else {
message.error(`登录失败,${response.message}`);
self.events.emit('loginError', response);
......@@ -474,9 +472,9 @@ class Login {
})
.catch(error => {
// eslint-disable-next-line no-undef
message.error(`登录失败,${response.message}`);
message.error(`登录失败,${error.message}`);
// eslint-disable-next-line no-undef
self.events.emit('loginError', response);
self.events.emit('loginError', error);
setTimeout(() => {
self.handleLoginError(() => {
window.location.href = WX_REDIRECT_URI;
......@@ -621,6 +619,7 @@ class Login {
self.writeLogs();
self.getIndustry(flag, token, industry);
} else {
message.error(response.errMsg);
if (self.goLogin()) {
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment