diff --git a/app.js b/app.js index 16bf9411fed0a3a94191260c79bb927bf1ed2043..7877600bf9959930cc65c6bcf97b4331cc8985e4 100755 --- a/app.js +++ b/app.js @@ -8,6 +8,7 @@ var indexRouter = require('./routes/index'); var usersRouter = require('./routes/users'); const proxy = require('express-http-proxy'); +const {createProxyMiddleware} = require('http-proxy-middleware'); var app = express(); @@ -30,10 +31,13 @@ let opts = { } - app.use('/callComponent', proxy('http://192.168.100.108:8008', opts)); app.use('/app', proxy('http://192.168.100.108:8008', opts)); - +app.use('/ws', createProxyMiddleware({ + target: 'http://192.168.100.108:8008', + changeOrigin: true, + ws: true +})); // app.use('/callComponent', proxy('http://127.0.0.1:8008', opts)); // app.use('/app', proxy('http://127.0.0.1:8008', opts)); @@ -73,4 +77,4 @@ app.use(function(err, req, res, next) { res.render('error'); }); -module.exports = app; \ No newline at end of file +module.exports = app; diff --git a/public/components/property/indexNotice/indexNotice.js b/public/components/property/indexNotice/indexNotice.js index 8ecf54382dda2b69f40b734a06a3b118e8457503..db1e36516a48e96d456a005e7a9cbfb3fba474b7 100644 --- a/public/components/property/indexNotice/indexNotice.js +++ b/public/components/property/indexNotice/indexNotice.js @@ -28,7 +28,7 @@ param, function (json, res) { let _res = JSON.parse(json); - + $that.indexNoticeInfo.notices = _res.notices; $that.$nextTick(function() { setInterval($that.checkPoolScroll,2000); @@ -36,13 +36,14 @@ }, function (errInfo, error) { console.log('请求失败处理'); - + } ); }, checkPoolScroll: function() { var element = document.getElementById("pool"); + if(!element)return; var clientHeight = element.clientHeight; var scrollHeight = element.scrollHeight; if(scrollHeight > clientHeight){ @@ -56,6 +57,7 @@ }, poolScroll: function() { var element = document.getElementById("pool"); + if(!element)return; var clientHeight = element.clientHeight; var scrollHeight = element.scrollHeight; var canScrollHeight = scrollHeight - clientHeight; @@ -77,4 +79,4 @@ } } }) -})(window.vc); \ No newline at end of file +})(window.vc); diff --git a/public/pages/property/indexContext/indexContext.js b/public/pages/property/indexContext/indexContext.js index 64b308f5c4b263b14d48cb414148144a16f144b1..65c0a35646b00174c1193c0544361408ec869cb5 100755 --- a/public/pages/property/indexContext/indexContext.js +++ b/public/pages/property/indexContext/indexContext.js @@ -38,6 +38,7 @@ var indexData = JSON.parse(json); vc.copyObject(indexData, vc.component.indexContextInfo); let _dom = document.getElementById('ownerCount'); + if(!_dom)return; $that._initCharts2(indexData.ownerCount - indexData.noEnterRoomCount, indexData.noEnterRoomCount, _dom, vc.i18n('业主信息', 'indexContext'), vc.i18n('已入住', 'indexContext'), vc.i18n('未入住', 'indexContext')); _dom = document.getElementById('roomCount'); $that._initCharts2(indexData.roomCount - indexData.freeRoomCount, indexData.freeRoomCount, _dom, vc.i18n('房屋信息', 'indexContext'), vc.i18n('已入住', 'indexContext'), vc.i18n('空闲', 'indexContext')); @@ -158,4 +159,4 @@ } } }) -})(window.vc); \ No newline at end of file +})(window.vc); diff --git a/public/pages/property/propertyIndex/propertyIndex.js b/public/pages/property/propertyIndex/propertyIndex.js index 64b308f5c4b263b14d48cb414148144a16f144b1..65c0a35646b00174c1193c0544361408ec869cb5 100755 --- a/public/pages/property/propertyIndex/propertyIndex.js +++ b/public/pages/property/propertyIndex/propertyIndex.js @@ -38,6 +38,7 @@ var indexData = JSON.parse(json); vc.copyObject(indexData, vc.component.indexContextInfo); let _dom = document.getElementById('ownerCount'); + if(!_dom)return; $that._initCharts2(indexData.ownerCount - indexData.noEnterRoomCount, indexData.noEnterRoomCount, _dom, vc.i18n('业主信息', 'indexContext'), vc.i18n('已入住', 'indexContext'), vc.i18n('未入住', 'indexContext')); _dom = document.getElementById('roomCount'); $that._initCharts2(indexData.roomCount - indexData.freeRoomCount, indexData.freeRoomCount, _dom, vc.i18n('房屋信息', 'indexContext'), vc.i18n('已入住', 'indexContext'), vc.i18n('空闲', 'indexContext')); @@ -158,4 +159,4 @@ } } }) -})(window.vc); \ No newline at end of file +})(window.vc);