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