(function () {
var COUNT_FRAMERATE, COUNT_MS_PER_FRAME, DIGIT_FORMAT, DIGIT_HTML, DIGIT_SPEEDBOOST, DURATION, FORMAT_MARK_HTML,
FORMAT_PARSER, FRAMERATE, FRAMES_PER_VALUE, MS_PER_FRAME, MutationObserver, Odometer, RIBBON_HTML,
TRANSITION_END_EVENTS, TRANSITION_SUPPORT, VALUE_HTML, addClass, createFromHTML, fractionalPart, now,
removeClass, requestAnimationFrame, round, transitionCheckStyles, trigger, truncate, wrapJQuery, _jQueryWrapped,
_old, _ref, _ref1,
__slice = [].slice;
VALUE_HTML = '';
RIBBON_HTML = '' + VALUE_HTML + '';
DIGIT_HTML = '8' + RIBBON_HTML + '';
FORMAT_MARK_HTML = '';
DIGIT_FORMAT = '(,ddd).dd';
FORMAT_PARSER = /^\(?([^)]*)\)?(?:(.)(d+))?$/;
FRAMERATE = 30;
DURATION = 2000;
COUNT_FRAMERATE = 20;
FRAMES_PER_VALUE = 2;
DIGIT_SPEEDBOOST = .5;
MS_PER_FRAME = 1000 / FRAMERATE;
COUNT_MS_PER_FRAME = 1000 / COUNT_FRAMERATE;
TRANSITION_END_EVENTS = 'transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd';
transitionCheckStyles = document.createElement('div').style;
TRANSITION_SUPPORT = (transitionCheckStyles.transition != null) || (transitionCheckStyles.webkitTransition != null) || (transitionCheckStyles.mozTransition != null) || (transitionCheckStyles.oTransition != null);
requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
createFromHTML = function (html) {
var el;
el = document.createElement('div');
el.innerHTML = html;
return el.children[0];
};
removeClass = function (el, name) {
return el.className = el.className.replace(new RegExp("(^| )" + (name.split(' ').join('|')) + "( |$)", 'gi'), ' ');
};
addClass = function (el, name) {
removeClass(el, name);
return el.className += " " + name;
};
trigger = function (el, name) {
var evt;
if (document.createEvent != null) {
evt = document.createEvent('HTMLEvents');
evt.initEvent(name, true, true);
return el.dispatchEvent(evt);
}
};
now = function () {
var _ref, _ref1;
return (_ref = (_ref1 = window.performance) != null ? typeof _ref1.now === "function" ? _ref1.now() : void 0 : void 0) != null ? _ref : +(new Date);
};
round = function (val, precision) {
if (precision == null) {
precision = 0;
}
if (!precision) {
return Math.round(val);
}
val *= Math.pow(10, precision);
val += 0.5;
val = Math.floor(val);
return val /= Math.pow(10, precision);
};
truncate = function (val) {
if (val < 0) {
return Math.ceil(val);
} else {
return Math.floor(val);
}
};
fractionalPart = function (val) {
return val - round(val);
};
_jQueryWrapped = false;
(wrapJQuery = function () {
var property, _i, _len, _ref, _results;
if (_jQueryWrapped) {
return;
}
if (window.jQuery != null) {
_jQueryWrapped = true;
_ref = ['html', 'text'];
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
property = _ref[_i];
_results.push((function (property) {
var old;
old = window.jQuery.fn[property];
return window.jQuery.fn[property] = function (val) {
var _ref1;
if ((val == null) || (((_ref1 = this[0]) != null ? _ref1.odometer : void 0) == null)) {
return old.apply(this, arguments);
}
return this[0].odometer.update(val);
};
})(property));
}
return _results;
}
})();
setTimeout(wrapJQuery, 0);
Odometer = (function () {
function Odometer(options) {
var e, k, property, v, _base, _i, _len, _ref, _ref1, _ref2,
_this = this;
this.options = options;
this.el = this.options.el;
if (this.el.odometer != null) {
return this.el.odometer;
}
this.el.odometer = this;
_ref = Odometer.options;
for (k in _ref) {
v = _ref[k];
if (this.options[k] == null) {
this.options[k] = v;
}
}
if ((_base = this.options).duration == null) {
_base.duration = DURATION;
}
this.MAX_VALUES = ((this.options.duration / MS_PER_FRAME) / FRAMES_PER_VALUE) | 0;
this.resetFormat();
this.value = this.cleanValue((_ref1 = this.options.value) != null ? _ref1 : '');
this.renderInside();
this.render();
try {
_ref2 = ['innerHTML', 'innerText', 'textContent'];
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
property = _ref2[_i];
if (this.el[property] != null) {
(function (property) {
return Object.defineProperty(_this.el, property, {
get: function () {
var _ref3;
if (property === 'innerHTML') {
return _this.inside.outerHTML;
} else {
return (_ref3 = _this.inside.innerText) != null ? _ref3 : _this.inside.textContent;
}
},
set: function (val) {
return _this.update(val);
}
});
})(property);
}
}
} catch (_error) {
e = _error;
this.watchForMutations();
}
this;
}
Odometer.prototype.renderInside = function () {
this.inside = document.createElement('div');
this.inside.className = 'odometer-inside';
this.el.innerHTML = '';
return this.el.appendChild(this.inside);
};
Odometer.prototype.watchForMutations = function () {
var e,
_this = this;
if (MutationObserver == null) {
return;
}
try {
if (this.observer == null) {
this.observer = new MutationObserver(function (mutations) {
var newVal;
newVal = _this.el.innerText;
_this.renderInside();
_this.render(_this.value);
return _this.update(newVal);
});
}
this.watchMutations = true;
return this.startWatchingMutations();
} catch (_error) {
e = _error;
}
};
Odometer.prototype.startWatchingMutations = function () {
if (this.watchMutations) {
return this.observer.observe(this.el, {
childList: true
});
}
};
Odometer.prototype.stopWatchingMutations = function () {
var _ref;
return (_ref = this.observer) != null ? _ref.disconnect() : void 0;
};
Odometer.prototype.cleanValue = function (val) {
var _ref;
if (typeof val === 'string') {
val = val.replace((_ref = this.format.radix) != null ? _ref : '.', '');
val = val.replace(/[.,]/g, '');
val = val.replace('', '.');
val = parseFloat(val, 10) || 0;
}
return round(val, this.format.precision);
};
Odometer.prototype.bindTransitionEnd = function () {
var event, renderEnqueued, _i, _len, _ref, _results,
_this = this;
if (this.transitionEndBound) {
return;
}
this.transitionEndBound = true;
renderEnqueued = false;
_ref = TRANSITION_END_EVENTS.split(' ');
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
event = _ref[_i];
_results.push(this.el.addEventListener(event, function () {
if (renderEnqueued) {
return true;
}
renderEnqueued = true;
setTimeout(function () {
_this.render();
renderEnqueued = false;
return trigger(_this.el, 'odometerdone');
}, 0);
return true;
}, false));
}
return _results;
};
Odometer.prototype.resetFormat = function () {
var format, fractional, parsed, precision, radix, repeating, _ref, _ref1;
format = (_ref = this.options.format) != null ? _ref : DIGIT_FORMAT;
format || (format = 'd');
parsed = FORMAT_PARSER.exec(format);
if (!parsed) {
throw new Error("Odometer: Unparsable digit format");
}
_ref1 = parsed.slice(1, 4), repeating = _ref1[0], radix = _ref1[1], fractional = _ref1[2];
precision = (fractional != null ? fractional.length : void 0) || 0;
return this.format = {
repeating: repeating,
radix: radix,
precision: precision
};
};
Odometer.prototype.render = function (value) {
var classes, cls, match, newClasses, theme, _i, _len;
if (value == null) {
value = this.value;
}
this.stopWatchingMutations();
this.resetFormat();
this.inside.innerHTML = '';
theme = this.options.theme;
classes = this.el.className.split(' ');
newClasses = [];
for (_i = 0, _len = classes.length; _i < _len; _i++) {
cls = classes[_i];
if (!cls.length) {
continue;
}
if (match = /^odometer-theme-(.+)$/.exec(cls)) {
theme = match[1];
continue;
}
if (/^odometer(-|$)/.test(cls)) {
continue;
}
newClasses.push(cls);
}
newClasses.push('odometer');
if (!TRANSITION_SUPPORT) {
newClasses.push('odometer-no-transitions');
}
if (theme) {
newClasses.push("odometer-theme-" + theme);
} else {
newClasses.push("odometer-auto-theme");
}
this.el.className = newClasses.join(' ');
this.ribbons = {};
this.formatDigits(value);
return this.startWatchingMutations();
};
Odometer.prototype.formatDigits = function (value) {
var digit, valueDigit, valueString, wholePart, _i, _j, _len, _len1, _ref, _ref1;
this.digits = [];
if (this.options.formatFunction) {
valueString = this.options.formatFunction(value);
_ref = valueString.split('').reverse();
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
valueDigit = _ref[_i];
if (valueDigit.match(/0-9/)) {
digit = this.renderDigit();
digit.querySelector('.odometer-value').innerHTML = valueDigit;
this.digits.push(digit);
this.insertDigit(digit);
} else {
this.addSpacer(valueDigit);
}
}
} else {
wholePart = !this.format.precision || !fractionalPart(value) || false;
_ref1 = value.toString().split('').reverse();
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
digit = _ref1[_j];
if (digit === '.') {
wholePart = true;
}
this.addDigit(digit, wholePart);
}
}
};
Odometer.prototype.update = function (newValue) {
var diff,
_this = this;
newValue = this.cleanValue(newValue);
if (!(diff = newValue - this.value)) {
return;
}
removeClass(this.el, 'odometer-animating-up odometer-animating-down odometer-animating');
if (diff > 0) {
addClass(this.el, 'odometer-animating-up');
} else {
addClass(this.el, 'odometer-animating-down');
}
this.stopWatchingMutations();
this.animate(newValue);
this.startWatchingMutations();
setTimeout(function () {
_this.el.offsetHeight;
return addClass(_this.el, 'odometer-animating');
}, 0);
return this.value = newValue;
};
Odometer.prototype.renderDigit = function () {
return createFromHTML(DIGIT_HTML);
};
Odometer.prototype.insertDigit = function (digit, before) {
if (before != null) {
return this.inside.insertBefore(digit, before);
} else if (!this.inside.children.length) {
return this.inside.appendChild(digit);
} else {
return this.inside.insertBefore(digit, this.inside.children[0]);
}
};
Odometer.prototype.addSpacer = function (chr, before, extraClasses) {
var spacer;
spacer = createFromHTML(FORMAT_MARK_HTML);
spacer.innerHTML = chr;
if (extraClasses) {
addClass(spacer, extraClasses);
}
return this.insertDigit(spacer, before);
};
Odometer.prototype.addDigit = function (value, repeating) {
var chr, digit, resetted, _ref;
if (repeating == null) {
repeating = true;
}
if (value === '-') {
return this.addSpacer(value, null, 'odometer-negation-mark');
}
if (value === '.') {
return this.addSpacer((_ref = this.format.radix) != null ? _ref : '.', null, 'odometer-radix-mark');
}
if (repeating) {
resetted = false;
while (true) {
if (!this.format.repeating.length) {
if (resetted) {
throw new Error("Bad odometer format without digits");
}
this.resetFormat();
resetted = true;
}
chr = this.format.repeating[this.format.repeating.length - 1];
this.format.repeating = this.format.repeating.substring(0, this.format.repeating.length - 1);
if (chr === 'd') {
break;
}
this.addSpacer(chr);
}
}
digit = this.renderDigit();
digit.querySelector('.odometer-value').innerHTML = value;
this.digits.push(digit);
return this.insertDigit(digit);
};
Odometer.prototype.animate = function (newValue) {
if (!TRANSITION_SUPPORT || this.options.animation === 'count') {
return this.animateCount(newValue);
} else {
return this.animateSlide(newValue);
}
};
Odometer.prototype.animateCount = function (newValue) {
var cur, diff, last, start, tick,
_this = this;
if (!(diff = +newValue - this.value)) {
return;
}
start = last = now();
cur = this.value;
return (tick = function () {
var delta, dist, fraction;
if ((now() - start) > _this.options.duration) {
_this.value = newValue;
_this.render();
trigger(_this.el, 'odometerdone');
return;
}
delta = now() - last;
if (delta > COUNT_MS_PER_FRAME) {
last = now();
fraction = delta / _this.options.duration;
dist = diff * fraction;
cur += dist;
_this.render(Math.round(cur));
}
if (requestAnimationFrame != null) {
return requestAnimationFrame(tick);
} else {
return setTimeout(tick, COUNT_MS_PER_FRAME);
}
})();
};
Odometer.prototype.getDigitCount = function () {
var i, max, value, values, _i, _len;
values = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
for (i = _i = 0, _len = values.length; _i < _len; i = ++_i) {
value = values[i];
values[i] = Math.abs(value);
}
max = Math.max.apply(Math, values);
return Math.ceil(Math.log(max + 1) / Math.log(10));
};
Odometer.prototype.getFractionalDigitCount = function () {
var i, parser, parts, value, values, _i, _len;
values = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
parser = /^\-?\d*\.(\d*?)0*$/;
for (i = _i = 0, _len = values.length; _i < _len; i = ++_i) {
value = values[i];
values[i] = value.toString();
parts = parser.exec(values[i]);
if (parts == null) {
values[i] = 0;
} else {
values[i] = parts[1].length;
}
}
return Math.max.apply(Math, values);
};
Odometer.prototype.resetDigits = function () {
this.digits = [];
this.ribbons = [];
this.inside.innerHTML = '';
return this.resetFormat();
};
Odometer.prototype.animateSlide = function (newValue) {
var boosted, cur, diff, digitCount, digits, dist, end, fractionalCount, frame, frames, i, incr, j, mark,
numEl, oldValue, start, _base, _i, _j, _k, _l, _len, _len1, _len2, _m, _ref, _results;
oldValue = this.value;
fractionalCount = this.getFractionalDigitCount(oldValue, newValue);
if (fractionalCount) {
newValue = newValue * Math.pow(10, fractionalCount);
oldValue = oldValue * Math.pow(10, fractionalCount);
}
if (!(diff = newValue - oldValue)) {
return;
}
this.bindTransitionEnd();
digitCount = this.getDigitCount(oldValue, newValue);
digits = [];
boosted = 0;
for (i = _i = 0; 0 <= digitCount ? _i < digitCount : _i > digitCount; i = 0 <= digitCount ? ++_i : --_i) {
start = truncate(oldValue / Math.pow(10, digitCount - i - 1));
end = truncate(newValue / Math.pow(10, digitCount - i - 1));
dist = end - start;
if (Math.abs(dist) > this.MAX_VALUES) {
frames = [];
incr = dist / (this.MAX_VALUES + this.MAX_VALUES * boosted * DIGIT_SPEEDBOOST);
cur = start;
while ((dist > 0 && cur < end) || (dist < 0 && cur > end)) {
frames.push(Math.round(cur));
cur += incr;
}
if (frames[frames.length - 1] !== end) {
frames.push(end);
}
boosted++;
} else {
frames = (function () {
_results = [];
for (var _j = start; start <= end ? _j <= end : _j >= end; start <= end ? _j++ : _j--) {
_results.push(_j);
}
return _results;
}).apply(this);
}
for (i = _k = 0, _len = frames.length; _k < _len; i = ++_k) {
frame = frames[i];
frames[i] = Math.abs(frame % 10);
}
digits.push(frames);
}
this.resetDigits();
_ref = digits.reverse();
for (i = _l = 0, _len1 = _ref.length; _l < _len1; i = ++_l) {
frames = _ref[i];
if (!this.digits[i]) {
this.addDigit(' ', i >= fractionalCount);
}
if ((_base = this.ribbons)[i] == null) {
_base[i] = this.digits[i].querySelector('.odometer-ribbon-inner');
}
this.ribbons[i].innerHTML = '';
if (diff < 0) {
frames = frames.reverse();
}
for (j = _m = 0, _len2 = frames.length; _m < _len2; j = ++_m) {
frame = frames[j];
numEl = document.createElement('div');
numEl.className = 'odometer-value';
numEl.innerHTML = frame;
this.ribbons[i].appendChild(numEl);
if (j === frames.length - 1) {
addClass(numEl, 'odometer-last-value');
}
if (j === 0) {
addClass(numEl, 'odometer-first-value');
}
}
}
if (start < 0) {
this.addDigit('-');
}
mark = this.inside.querySelector('.odometer-radix-mark');
if (mark != null) {
mark.parent.removeChild(mark);
}
if (fractionalCount) {
return this.addSpacer(this.format.radix, this.digits[fractionalCount - 1], 'odometer-radix-mark');
}
};
return Odometer;
})();
Odometer.options = (_ref = window.odometerOptions) != null ? _ref : {};
setTimeout(function () {
var k, v, _base, _ref1, _results;
if (window.odometerOptions) {
_ref1 = window.odometerOptions;
_results = [];
for (k in _ref1) {
v = _ref1[k];
_results.push((_base = Odometer.options)[k] != null ? (_base = Odometer.options)[k] : _base[k] = v);
}
return _results;
}
}, 0);
Odometer.init = function () {
var el, elements, _i, _len, _ref1, _results;
if (document.querySelectorAll == null) {
return;
}
elements = document.querySelectorAll(Odometer.options.selector || '.odometer');
_results = [];
for (_i = 0, _len = elements.length; _i < _len; _i++) {
el = elements[_i];
_results.push(el.odometer = new Odometer({
el: el,
value: (_ref1 = el.innerText) != null ? _ref1 : el.textContent
}));
}
return _results;
};
if ((((_ref1 = document.documentElement) != null ? _ref1.doScroll : void 0) != null) && (document.createEventObject != null)) {
_old = document.onreadystatechange;
document.onreadystatechange = function () {
if (document.readyState === 'complete' && Odometer.options.auto !== false) {
Odometer.init();
}
return _old != null ? _old.apply(this, arguments) : void 0;
};
} else {
document.addEventListener('DOMContentLoaded', function () {
if (Odometer.options.auto !== false) {
return Odometer.init();
}
}, false);
}
if (typeof define === 'function' && define.amd) {
define([], function () {
return Odometer;
});
} else if (typeof exports !== "undefined" && exports !== null) {
module.exports = Odometer;
} else {
window.Odometer = Odometer;
}
}).call(this);
//获取停车场
//存放停车场编号的全局变量
var plNos = [];
var plNos1 = [];
var plNos2 = [];
var parkData = [];
var specialAccount = ['10122','10014','10050'];
//specialAccount = [];
(function () {
var fun = {
//停车场下拉框
initSelect: function () {
// window.odometerOptions = {
// format: '(ddd).dd'
// };
// setTimeout(function(){
// $('#parkNum').html(49);
// }, 1000);
var data = [];
debugger
//赤峰账号特殊处理
if((specialAccount.indexOf(fn.getUserId()) >= 0) && fn.getOrgId() ==10003){
data = fn.getParkLot(3);
}else{
data = fn.getParkLot();
}
if(fn.getUserId())
$("#parktype").empty();
var html = '';
for (var i = 0; i < data.length; i++) {
plNos.push(data[i].code);
html += "";
var a = {plNo: data[i].code, plName: data[i].name, allIncome: 0};
parkData.push(a);
}
var plnosStr = JSON.stringify(plNos);
html = '' + html;
$("#parktype").append(html);
$('#parktype').selectpicker('render');
var tempPlno = getQueryString('plNo');
if (undefined != tempPlno && null != tempPlno && tempPlno.length > 1) {
plNos = [tempPlno];
$('#parktype').selectpicker('val', JSON.stringify(plNos));
}
//赤峰账号特殊处理
if((specialAccount.indexOf(fn.getUserId()) >= 0) && fn.getOrgId() ==10003){
data = fn.getParkLotByPlType(1,3);
}else{
data = fn.getParkLotByPlType(1);
}
//获取路侧的停车场
//data = fn.getParkLotByPlType(1);
for (var i = 0; i < data.length; i++) {
plNos1.push(data[i].code);
}
if (plNos1.length < 1) {
plNos1.push(-1);
}
//赤峰账号特殊处理
if((specialAccount.indexOf(fn.getUserId()) >= 0) && fn.getOrgId() ==10003){
data = fn.getParkLotByPlType(2,3);
}else{
data = fn.getParkLotByPlType(2);
}
//获取封闭的停车场
//data = fn.getParkLotByPlType(2);
for (var i = 0; i < data.length; i++) {
plNos2.push(data[i].code);
}
if (plNos2.length < 1) {
plNos2.push(-1);
}
userName();
indexDataRefresh(plNos, plNos1, plNos2);
// timer = setInterval(function(){indexDataRefresh(plNos,plNos1,plNos2);;},60*1000);
},
};
fun.initSelect();
if (fn.getOpImgPath() != '' && fn.getOpImgPath() != undefined && fn.getOpImgPath() != null && fn.getOpImgPath() != "null") {
$('#welcome-pic').css('background-image', "url(" + fn.getOpImgPath() + ")");
} else {
$('#welcome-pic').css('background-image', "url(../../assets/pages/img/user-pic.png)");
}
setInterval(function () {
// incomeecharts.clear();
plNos = [];
plNos1 = [];
plNos2 = [];
fun.initSelect();
}, commonObj.refreshDataTime)
})();
//获取获取和时间状态
function userName() {
$('#welcome-msg').text(fn.getUserName() + ' , ' + welcome())
};
function welcome() {
var date = new Date();
var hour = date.getHours();
if (hour < 6) {
return "凌晨好!"
} else if (hour < 9) {
return "早上好!"
} else if (hour < 12) {
return "上午好!"
} else if (hour < 14) {
return "中午好!"
} else if (hour < 18) {
return "下午好!"
} else if (hour < 22) {
return "晚上好!"
} else {
return "夜里好!"
}
}
//获取请求URL中的参数
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
//首页数据刷新
function indexDataRefresh(plNos, plNos1, plNos2) {
if (undefined == plNos || null == plNos || plNos.length <= 0) {
var selectData = $("#parktype").val();
//如果plNos不传,从下拉框中获取.
plNos = JSON.parse(selectData);
}
//获取停车场数量
getParkNums(plNos, plNos1, plNos2);
//获取泊位数量以及占用率-总的
getBerthNumAndOccupyRate(plNos, 0);
//获取泊位数量以及占用率-路侧
getBerthNumAndOccupyRate(plNos1, 1);
//获取泊位数量以及占用率-封闭
getBerthNumAndOccupyRate(plNos2, 2);
// //获取今日总收入-总的
// getTodayInCome(plNos,0);
// //获取今日总收入-路侧
// getTodayInCome(plNos1,1);
// //获取今日总收入-封闭
// getTodayInCome(plNos2,2);
//获取收费员人数-总的
getChargerNumFromDuty(plNos, 0);
//获取收费员人数-路侧
getChargerNumFromDuty(plNos1, 1);
//获取收费员人数-封闭
getChargerNumFromDuty(plNos2, 2);
//设备数量-总的
// getDeviceNums(null,0);//只查路侧
//设备数量-路侧
// getDeviceNums(null,1);
//设备数量-封闭
// getDeviceNums([-1],2);
//查询停车场实时运行情况数据-收入概况&占用率概况
queryParkRealTimeDatasByPlNos(plNos);
//查询近七日收入
incomeTrendCharts(plNos, 7);
//查询停车场收入
// queryParkIncomeDatas(plNos);
}
//获取停车场数量
function getParkNums(plNos, plNos1, plNos2) {
// $("#parkNum").html(plNos.length);
setTimeout(function () {
$('#parkNum').html(plNos.length);
}, 10);
$("#parkNumLC").html(plNos1.length);
$("#parkNumFB").html(plNos2.length);
if (plNos.indexOf(-1) == 0) {
$("#parkNum").html(0);
}
if (plNos1.indexOf(-1) == 0) {
$("#parkNumLC").html(0);
}
if (plNos2.indexOf(-1) == 0) {
$("#parkNumFB").html(0);
}
}
function moneyFomatter(value) {
if (value == null) {
return "0.00";
} else {
return (value / 100).toFixed(2);
}
}
//今日收入-按路侧、封闭进行区分
function getTodayInCome(plNos, plType) {
var req = {
sysCode: sysComm.sysCode,
plNos: plNos,
};
var inComeAjax = {
method: "post",
url: dataUrl.util.queryChargerIncomeByPlNos(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (res) {
if (res.code == '8888') {
var data = res.data;
if (plType == 0) {
$("#income").html(moneyFomatter(data.allIncome));
} else if (plType == 1) {
$("#incomeLC").html(moneyFomatter(data.allIncome));
} else if (plType == 2) {
$("#incomeFB").html(moneyFomatter(data.allIncome));
}
} else {
console.log(res);
}
}
};
sysAjax(inComeAjax);
};
//收费员人数-按路侧、封闭进行区分
function getChargerNum(plNos, plType) {
var req = {
sysCode: sysComm.sysCode,
chargerType: 0,//收费员
plNos: plNos,
};
var inComeAjax = {
method: "post",
url: dataUrl.util.queryEmployeeNumByPlNo(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (res) {
if (res.code == '8888') {
var data = res.data;
if (plType == 0) {
setTimeout(function () {
$("#chargerNum").html(data);
}, 10);
} else if (plType == 1) {
$("#chargerNumLC").html(data);
} else if (plType == 2) {
$("#chargerNumFB").html(data);
}
} else {
console.log(res);
}
}
};
sysAjax(inComeAjax);
};
//收费员人数-按路侧、封闭进行区分(以排班为准)
function getChargerNumFromDuty(plNos, plType) {
var chargers = fn.getChargers(plNos);
//应武警要求,市政账号 路侧车场加一个收费员
if (fn.getUserId() == '10146') {
if (plType == 0) {
setTimeout(function () {
$("#chargerNum").html(chargers.length + 1);
}, 10);
} else if (plType == 1) {
$("#chargerNumLC").html(chargers.length + 1);
} else if (plType == 2) {
$("#chargerNumFB").html(chargers.length);
}
} else {
if (plType == 0) {
setTimeout(function () {
$("#chargerNum").html(chargers.length);
}, 10);
} else if (plType == 1) {
$("#chargerNumLC").html(chargers.length);
} else if (plType == 2) {
$("#chargerNumFB").html(chargers.length);
}
}
};
//获取泊位数量以及占用率-按路侧、封闭进行区分
function getBerthNumAndOccupyRate(plNos, plType) {
if (fn.getUserId() == '10146') {
getBerthNumForShizhengchu(plType);
return;
}
var req = {
sysCode: sysComm.sysCode,
plNos: plNos,
};
var berthAjax = {
method: "post",
url: dataUrl.util.queryParkRealTimeDatasByPlNos(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (res) {
if (res.code == '8888') {
var data = res.data;
if (plType == 0) {
//空余泊位数
var berthFreeNum = data.berthFreeNum;
//总泊位数
var berthTotalNum = data.berthNum;
if (berthFreeNum == null || berthFreeNum == undefined || berthFreeNum == '') {
berthFreeNum = 0;
}
if (berthTotalNum == null || berthTotalNum == undefined || berthTotalNum == '') {
berthTotalNum = 0;
}
//占用车位数
$("#park_current_berthNum").text(parseInt(berthTotalNum) - parseInt(berthFreeNum));
//总车位数
$("#park_current_berthTotalNum").text(parseInt(berthTotalNum));
$("#berthNum").html(data.berthNum);
$("#turnoverNum").html((data.outCarNum / (data.berthNum < 1 ? 1 : data.berthNum)).toFixed(2));
} else {
var berthNum = data.berthNum;
var berthFreeNum = data.berthFreeNum;
var occupyRate = ((berthNum - berthFreeNum) * 100 / (berthNum < 1 ? 1 : berthNum)).toFixed(2);
if (plType == 1) {
$("#occupyRateLC").html(berthNum);
$("#turnoverNumLC").html((data.outCarNum / (berthNum < 1 ? 1 : berthNum)).toFixed(2));
} else if (plType == 2) {
$("#occupyRateFB").html(berthNum);
$("#turnoverNumFB").html((data.outCarNum / (berthNum < 1 ? 1 : berthNum)).toFixed(2));
}
}
} else {
console.log(res);
}
}
};
sysAjax(berthAjax);
};
//市政处 泊位数特殊处理
function getBerthNumForShizhengchu(plType) {
debugger;
var ziyingplNos = [];
var feiziyingPlNos = [];
var allPlNos = [];
//1:自营,2:非自营,3:全部 默认自营1
var resultParkLot = fn.getParkLot(1);
$.each(resultParkLot, function (index, item) {
if(plType == 0 ||item.type == plType){
ziyingplNos.push(item.code);
}
});
resultParkLot = fn.getParkLot(2);
$.each(resultParkLot, function (index, item) {
if(plType == 0 ||item.type == plType){
feiziyingPlNos.push(item.code);
}
})
resultParkLot = fn.getParkLot(3);
$.each(resultParkLot, function (index, item) {
if(plType == 0 ||item.type == plType){
allPlNos.push(item.code);
}
})
var ziyingData = {};
var feiziyingData = {};
var allData = {};
var req = {
sysCode: sysComm.sysCode,
plNos: ziyingplNos,
};
var berthAjax = {
method: "post",
url: dataUrl.util.queryParkRealTimeDatasByPlNos(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
async: false,
success: function (res) {
if (res.code == '8888') {
ziyingData = res.data;
} else {
console.log(res);
}
}
};
sysAjax(berthAjax);
req = {
sysCode: sysComm.sysCode,
plNos: feiziyingPlNos,
};
berthAjax = {
method: "post",
url: dataUrl.util.queryParkRealTimeDatasByPlNos(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
async: false,
success: function (res) {
if (res.code == '8888') {
feiziyingData = res.data;
} else {
console.log(res);
}
}
};
sysAjax(berthAjax);
req = {
sysCode: sysComm.sysCode,
plNos: allPlNos,
};
berthAjax = {
method: "post",
url: dataUrl.util.queryParkRealTimeDatasByPlNos(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
async: false,
success: function (res) {
if (res.code == '8888') {
allData = res.data;
} else {
console.log(res);
}
}
};
sysAjax(berthAjax);
if (plType == 0) {
//空余泊位数
var berthFreeNum = allData.berthFreeNum;
//总泊位数
var berthTotalNum = allData.berthNum;
if (berthFreeNum == null || berthFreeNum == undefined || berthFreeNum == '') {
berthFreeNum = 0;
}
if (berthTotalNum == null || berthTotalNum == undefined || berthTotalNum == '') {
berthTotalNum = 0;
}
//占用车位数
$("#park_current_berthNum").text(parseInt(berthTotalNum) - parseInt(berthFreeNum));
//总车位数
$("#park_current_berthTotalNum").text(parseInt(berthTotalNum));
$("#berthNum").html(allData.berthNum);
$("#turnoverNum").html((allData.outCarNum / (allData.berthNum < 1 ? 1 : allData.berthNum)).toFixed(2));
} else {
var berthNum = allData.berthNum;
var berthFreeNum = allData.berthFreeNum;
var occupyRate = ((berthNum - berthFreeNum) * 100 / (berthNum < 1 ? 1 : berthNum)).toFixed(2);
var html = (allData.berthNum==undefined?'0':allData.berthNum) +'(运营:'+(ziyingData.berthNum==undefined?'0':ziyingData.berthNum)+";非运营:"+(feiziyingData.berthNum==undefined?'0':feiziyingData.berthNum)+")";
if (plType == 1) {
// var html = '总泊位:'+allData.berthNum +'/运营:'+ziyingData.berthNum+"/非运营:"+feiziyingData.berthNum;
$("#occupyRateLC").html(html);
$("#turnoverNumLC").html((allData.outCarNum / (berthNum < 1 ? 1 : berthNum)).toFixed(2));
} else if (plType == 2) {
$("#occupyRateFB").html(html);
$("#turnoverNumFB").html((allData.outCarNum / (berthNum < 1 ? 1 : berthNum)).toFixed(2));
}
}
}
//获取设备数量以及占用率-按路侧、封闭进行区分
function getDeviceNums(plNos, plType) {
var req = {
sysCode: sysComm.sysCode,
plNos: plNos,
eqpTypes: [-1]
};
var berthAjax = {
method: "post",
url: dataUrl.util.statisticParkLotEqpCountByPlNos(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (res) {
// console.log(res);
var ydata = ['地磁', 'PDA', '视频桩'];
var seriesdata = [0, 0, 0];//在线
var serieserrordata = [0, 0, 0];//掉线
var totalDevice = 0;//总共设备
var onLineDevice = 0;//在线设备
if (res.data != null) {
$("[data-toggle='tooltip']").tooltip({delay: {show: 500, hide: 100},});
for (var i = 0; i < res.data.length; i++) {
totalDevice += Number(res.data[i].eqpNum);
//eqpType 1:地磁 2:POS机
if (res.data[i].eqpType == 1) {//地磁
//eqpState 设备状态:1-掉线,0-在线
if (res.data[i].eqpState == 0) {
seriesdata[0] = res.data[i].eqpNum;
onLineDevice += res.data[i].eqpNum;
} else {
serieserrordata[0] += res.data[i].eqpNum;
}
} else if (res.data[i].eqpType == 9) {//pos机
if (res.data[i].eqpState == 0) {
seriesdata[1] = res.data[i].eqpNum;
onLineDevice += res.data[i].eqpNum;
} else {
serieserrordata[1] += res.data[i].eqpNum;
}
}
}
//填写数据
if (plType == 0) {
setTimeout(function () {
$("#deviceNum").html(totalDevice);
}, 10);
} else {
var occupyRate = ((onLineDevice) * 100 / (totalDevice < 1 ? 1 : totalDevice)).toFixed(2);
if (plType == 1) {
$("#deviceNumLC").html(totalDevice);
$("#deviceNumLCTitle").attr('data-original-title', "地磁" + (seriesdata[0] + serieserrordata[0]) + "个,PDA" + (seriesdata[1] + serieserrordata[1]) + "个");
} else if (plType == 2) {
$("#deviceNumFB").html(totalDevice);
}
}
} else {
console.log(res);
}
}
};
sysAjax(berthAjax);
};
//查询停车场实时运行情况数据-收入概况&占用率概况
function queryParkRealTimeDatasByPlNos(plNos) {
var req = {
sysCode: sysComm.sysCode,
plNos: plNos,
};
var realTimeAjax = {
method: "post",
url: dataUrl.util.queryParkRealTimeDatasByPlNos(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (res) {
if (res.code == '8888') {
var data = res.data;
if (data != null) {
drawIncomeDatas(data.allIncome, data.allCashIncome, data.allWxIncome, data.allAliIncome, data.allBalanceIncome, data.escapeFee);
drawOccupyDatas(data.inCarNum, data.outCarNum, data.parkInsideNum, (data.parkInsideNum) - (data.parkVipInsideNum), data.parkVipInsideNum, data.berthFreeNum, data.berthNum);
}
} else {
console.log(res);
}
}
};
sysAjax(realTimeAjax);
};
//收入概况
function drawIncomeDatas(allIncome, allCashIncome, allWxIncome, allAliIncome, allBalanceIncome, escapeFee) {
// $("#parkCashIncome").html(moneyFomatter(allCashIncome));
// $("#parkWxIncome").html(moneyFomatter(allWxIncome));
// $("#parkAliIncome").html(moneyFomatter(allAliIncome));
// $("#parkBalanceIncome").html(moneyFomatter(allBalanceIncome));
$("#parkIncome").html(moneyFomatter(allIncome));
$("#parkIncome").attr('title', moneyFomatter(allIncome));
$("#escapeFee").html(moneyFomatter(escapeFee));
$("#escapeFee").attr('title', moneyFomatter(escapeFee));
allIncome = (allIncome < 1 ? 1 : allIncome);
var cashRate = (allCashIncome * 100 / allIncome).toFixed(2);
var wxRate = (allWxIncome * 100 / allIncome).toFixed(2);
var aliRate = (allAliIncome * 100 / allIncome).toFixed(2);
var balanceRate = (allBalanceIncome * 100 / allIncome).toFixed(2);
$(".pos-abs.pay-way-scale").eq(0).css("width", wxRate + '%');
$(".pos-abs.pay-way-scale").eq(1).css("width", aliRate + '%');
$(".pos-abs.pay-way-scale").eq(2).css("width", balanceRate + '%');
$(".pos-abs.pay-way-scale").eq(3).css("width", cashRate + '%');
$("#weixin-title").attr('title', moneyFomatter(allWxIncome) + '元');
$("#alipay-title").attr('title', moneyFomatter(allAliIncome) + '元');
$("#yy-title").attr('title', moneyFomatter(allBalanceIncome) + '元');
$("#xj-title").attr('title', moneyFomatter(allCashIncome) + '元');
$("[data-toggle='tooltip']").tooltip({
delay: {show: 500, hide: 100},
});
//逃逸金额
// var escapeRate = (escapeFee*100/(allIncome<1?1:allIncome)).toFixed(2);
// TYJEcharts = echarts.init(document.getElementById('tyje-echarts'));
// var TYJEoption = {
// color:['#0D9BFF','#D7D7D7'],
// title:{
// text:escapeRate+'%',
// textStyle:{
// color:'#4a4a4a',
// fontSize:'24',
// align:'middle',
// verticalAlign:'middle',
// },
// left:'center',
// top:'middle',
// },
// tooltip: {
// trigger: 'item',
// show:false,
// formatter: "{a}
{b}: {c} ({d}%)"
// },
//
// series: [
// {
// name:'访问来源',
// hoverAnimation:false,
// legendHoverLink:false,
// type:'pie',
// radius: ['70%', '88%'],
// avoidLabelOverlap: false,
// label: {
// normal: {
// show: false,
// position: 'center'
// },
// emphasis: {
// show: false,
// textStyle: {
// fontSize: '30',
// fontWeight: 'bold'
// }
// }
// },
// labelLine: {
// normal: {
// show: false
// }
// },
// data:[
// {value:escapeRate, name:'直接访问'},
// {value:100-escapeRate, name:'邮件营销'},
// ]
// }
// ]
// };
// TYJEcharts.setOption(TYJEoption, true);
}
//占用率概况
function drawOccupyDatas(inCarNum, outCarNum, parkInsideNum, parkTmpInsideNum, parkVipInsideNum, berthFreeNum, berthNum) {
$("#inCarNum").html(inCarNum + "(辆)");
$("#outCarNum").html(outCarNum + "(辆)");
// $("#parkInsideNum").html(parkInsideNum);
// $(".park-first").css('width',(parkInsideNum*100/(berthNum<1?1:berthNum))+"%");
// $("#parkTmpInsideNum").html(parkTmpInsideNum);
// $(".park-second").css('width',(parkTmpInsideNum*100/(berthNum<1?1:berthNum))+"%");
// $("#parkVipInsideNum").html(parkVipInsideNum);
// $(".park-three").css('width',(parkVipInsideNum*100/(berthNum<1?1:berthNum))+"%");
var occupyRate = ((berthNum - berthFreeNum) * 100 / (berthNum < 1 ? 1 : berthNum)).toFixed(2);
// var occupyRate = 20;
// dcsboption.title.text = occupyRate+"%";
// dcsboption.series[0].data[0].value = occupyRate;
// dcsboption.series[0].data[1].value = 100-occupyRate;
//
// dcsboption.series[1].data[0].value = occupyRate;
// dcsboption.series[1].data[1].value = 100-occupyRate;
// // dcsboption.series[1].data[2].value = 100;
// dcsbChart.setOption(dcsboption, true);
}
//近几天收入趋势折线图 num为第几天
function incomeTrendCharts(plNos, num) {
var startDate = new Date();
var endDate = new Date();
startDate.setSeconds(0);
startDate.setHours(0);
startDate.setMinutes(0);
startDate.setDate(startDate.getDate() - num);
endDate.setSeconds(59);
endDate.setHours(23);
endDate.setMinutes(59);
endDate.setDate(endDate.getDate() - 1);
var req = {
sysCode: sysComm.sysCode,
plNos: plNos,
startDate: startDate.getTime(),
endDate: endDate.getTime()
}
var inComeAjax = {
method: "post",
url: dataUrl.util.queryIncomeOfDay(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (res) {
if (res.code == '8888') {
var data = res.data;
handelIncomeTrendData(data);
}
}
};
sysAjax(inComeAjax);
}
function handelIncomeTrendData(data) {
var dateArray = [];
var incomeArray = [];
$.each(data, function (index, item) {
dateArray.push(item.dayStr);
incomeArray.push(moneyFomatter(item.inCome));
})
incomeoption.xAxis.data = dateArray;
incomeoption.series[0].data = incomeArray;
incomeecharts.setOption(incomeoption, true);
}
//停车收入排行查询
function queryParkIncomeDatas(plNos) {
var dataList = "";//返回的数据
//条件查询
var req = {
baseRequest: {
pageNum: 1,
pageSize: 1000
},
sysCode: sysComm.sysCode,
plNos: plNos
};
//1.分页查询停车场信息统计和今日收益
var inComeAjax = {
method: "post",
url: dataUrl.util.queryParkRealTimeListByPlNos(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (res) {
if ("8888" == res.code) {
var data = res.data;
if (data != null && data.length > 0) {
handelParkStaticsTic(data);
}
}
}
};
sysAjax(inComeAjax);
}
function handelParkStaticsTic(data) {
$.each(data, function (index, item) {
$.each(parkData, function (_index, _item) {
if (_item.plNo == item.plNo) {
_item.allIncome = item.allIncome;
}
});
});
//排序 收入相同的情况下,按中文排序
parkData.sort(function (a, b) {
if (b.allIncome == a.allIncome) {
return (a.plName).localeCompare(b.plName, 'zh');
} else {
return b.allIncome - a.allIncome;
}
});
var html = "";
console.log(parkData)
$.each(parkData, function (index, item) {
html = html + "" + (index + 1) + "" + item.plName + "" + moneyFomatter(item.allIncome) + "";
});
$(".income-top").html(html);
}
//快捷入口
// (function($){
// $.fn.rollSlide = function(obj){v
// var $self = this,
// orientation = obj.orientation || 'left', //婊氬姩鏂瑰紡
// num = obj.num || 1, //婊氬姩鏁伴噺
// v = (typeof obj.v === 'number') ? obj.v : 0, //婊氬姩閫熷害
// minTime = (typeof obj.space === 'number') ? ((obj.space >= 100) ? obj.space : 100) : 100, //鏈€灏忛棿闅斾负 100 ms 锛�
// space = minTime + v || 5000 + v, //婊氬姩闂撮殧 榛樿 5000ms
// isRoll = obj.isRoll, //鑷姩鎾斁
// isStart = true,
// roll = function(ori, n, v){
// var $ul = $self.find('.roll__list'),
// $item = $ul.find('li'),
// range = 0,
// i,len = $item.length,
// sliceItem = [],
// cloneSliceItem = [],
// startTime = (new Date()).getTime(),
// //瀛樻斁婊氬姩杩囩殑 item
// memory = function(){
// var arr = [];
//
// if(ori === 'left' || ori === 'top'){
// for(i = 0; i < n; i++){
// range += ori === 'left' ? $($item[i]).outerWidth(true) : $($item[i]).outerHeight(true); // left 鍙� width锛宼op 鍙� height
// arr.push($item[i]);
// }
// } else if(ori === 'right' || ori === 'bottom'){
// for(i = len - n; n > 0; n--, i++){
// range += ori === 'right' ? $($item[i]).outerWidth(true) : $($item[i]).outerHeight(true);
// arr.push($item[i]);
// }
// }
// return arr;
// };
//
// isStart = false; //鍏抽棴婊氬姩
// sliceItem = memory();
// cloneSliceItem = $(sliceItem).clone();
// //鍒ゆ柇寰€鍝釜鏂瑰悜绉诲姩
// switch (ori){
// case 'left':
// $ul.append(cloneSliceItem);
// $ul.animate({
// 'left': -range + 'px'
// },v,function(){
// $(this).css({'left': 0});
// $(sliceItem).remove();
// isStart = true; //寮€鍚粴鍔�
// });
// break;
// case 'right':
// $ul.prepend(cloneSliceItem);
// $ul.css('left', -range + 'px');
// $ul.animate({
// 'left': 0
// },v,function(){
// $(sliceItem).remove();
// isStart = true; //寮€鍚粴鍔�
// });
// break;
// case 'top':
// $ul.append(cloneSliceItem);
// $ul.animate({
// 'top': -range + 'px'
// },v,function(){
// $(this).css({'top': 0});
// $(sliceItem).remove();
// isStart = true; //寮€鍚粴鍔�
// });
// break;
// case 'bottom':
// $ul.prepend(cloneSliceItem);
// $ul.css('top', -range + 'px');
// $ul.animate({
// 'top': 0
// },v, function(){
// $(sliceItem).remove();
// isStart = true; //寮€鍚粴鍔�
// });
// break;
// }
// },
// init = function(){
// var $ul = $self.find('.roll__list'),
// $item = $ul.find('li'),
// len = $item.length,
// timer;
//
// num = num <= len ? num : len; //婊氬姩涓暟瓒呰繃鍒楄〃鏁帮紝鍙栧垪琛ㄦ暟
// if(len > 1){
// $self.on('click', '.pre', function(){
// if(isStart){
// //妯悜婊氬姩
// if(orientation === 'left' || orientation === 'right'){
// roll('right', num, v);
// } else{ //绾靛悜婊氬姩
// roll('bottom', num, v);
// }
// }
// }).
// on('click', '.next', function(){
// if(isStart){
// //妯悜婊氬姩
// if(orientation === 'left' || orientation === 'right'){
// roll('left', num, v);
// } else{ //绾靛悜婊氬姩
// roll('top', num, v);
// }
// }
// }).
// hover(function(){
// clearInterval(timer);
// }, function(){
// if(isRoll){
// timer = setInterval(function(){
// roll(orientation, num, v);
// },space);
// }
// }).
// trigger('mouseout');
// }
// };
//
// init();
// };
// $.fn.rollNoInterval = function(){
// var $self = this,
// $ul = $self.find('.roll__list'),
// $item = $ul.find('li'),
// len = $item.length,
// timer,
// left = function(){
// var offset, i,
// range,
// $sliceItem;
//
// $sliceItem = $($item[0]);
// range = $sliceItem.outerWidth(true);
// timer = setInterval(function(){
// offset = $ul.css('left');
// offset = parseInt(offset);
// if(offset > -range){
// i = offset - 1;
// $ul.css('left', i + 'px');
// offset = $ul.css('left');
// } else{
// $sliceItem.detach();
// $ul.css('left', 0);
// $ul.append($sliceItem);
// $sliceItem = $($ul.find('li')[0]);
// range = $sliceItem.outerWidth(true);
// }
// }, 50);
// },
// right = function(){
// var offset, i,
// range,
// $sliceItem;
//
// $sliceItem = $($item[len - 1]);
// range = $sliceItem.outerWidth(true);
// timer = setInterval(function(){
// offset = $ul.css('right');
// offset = parseInt(offset);
// if(offset > -range){
// i = offset - 1;
// $ul.css('right', i + 'px');
// offset = $ul.css('right');
// } else{
// $sliceItem.detach();
// $ul.css('right', 0);
// $ul.prepend($sliceItem);
// $sliceItem = $($ul.find('li')[len - 1]);
// range = $sliceItem.outerWidth(true);
// }
// }, 50);
// },
// top = function(){
// var offset, i,
// range,
// $sliceItem;
//
// $sliceItem = $($item[0]);
// range = $sliceItem.outerHeight(true);
// timer = setInterval(function(){
// offset = $ul.css('top');
// offset = parseInt(offset);
// if(offset > -range){
// i = offset - 1;
// $ul.css('top', i + 'px');
// offset = $ul.css('top');
// } else{
// $sliceItem.detach();
// $ul.css('top', 0);
// $ul.append($sliceItem);
// $sliceItem = $($ul.find('li')[0]);
// range = $sliceItem.outerHeight(true);
// }
// }, 50);
// },
// bottom = function(){
// var offset, i,
// range,
// $sliceItem;
//
// $sliceItem = $($item[len - 1]);
// range = $sliceItem.outerHeight(true);
// timer = setInterval(function(){
// offset = $ul.css('bottom');
// offset = parseInt(offset);
// if(offset > -range){
// i = offset - 1;
// $ul.css('bottom', i + 'px');
// offset = $ul.css('bottom');
// } else{
// $sliceItem.detach();
// $ul.css('bottom', 0);
// $ul.prepend($sliceItem);
// $sliceItem = $($ul.find('li')[len - 1]);
// range = $sliceItem.outerHeight(true);
// }
// }, 50);
// },
// init = function(){
// $self.hover(function(){
// clearInterval(timer);
// }, function(){
//
// });
// };
//
// //init();
// return {
// left: left,
// right: right,
// top: top,
// bottom: bottom
// }
// }
// })(jQuery);
// $('#index-access-wrap').rollSlide({
// orientation: 'right',
// num: 2,
// v: 1500,
// space: 3000,
// isRoll: true
// });
(function (T, h, i, n, k, P, a, g, e) {
g = function () {
P = h.createElement(i);
a = h.getElementsByTagName(i)[0];
P.src = k;
P.charset = "utf-8";
P.async = 1;
a.parentNode.insertBefore(P, a)
};
T["ThinkPageWeatherWidgetObject"] = n;
T[n] || (T[n] = function () {
(T[n].q = T[n].q || []).push(arguments)
});
T[n].l = +new Date();
if (T.attachEvent) {
T.attachEvent("onload", g)
} else {
T.addEventListener("load", g, false)
}
}(window, document, "script", "tpwidget", "//widget.seniverse.com/widget/chameleon.js"))
tpwidget("init", {
"flavor": "slim",
"location": "WX4FBXXFKE4F",
"geolocation": "enabled",
"language": "zh-chs",
"unit": "c",
"theme": "chameleon",
"container": "tp-weather-widget",
"bubble": "disabled",
"alarmType": "circle",
"uid": "U09DCF5ADF",
"hash": "5792c0c80cfc77da7283341fe8f9b809"
});
tpwidget("show");
$('#showNowDate').html(showNowDate());
//上下滚动播报
(function ($) {
$.fn.myScroll = function (options) {
//榛樿閰嶇疆
var defaults = {
speed: 40,
rowHeight: 24 //姣忚鐨勯珮搴�
};
var opts = $.extend({}, defaults, options), intId = [];
function marquee(obj, step) {
obj.find("ul").animate({
marginTop: '-=1'
}, 0, function () {
var s = Math.abs(parseInt($(this).css("margin-top")));
if (s >= step) {
$(this).find("li").slice(0, 1).appendTo($(this));
$(this).css("margin-top", 0);
}
});
}
this.each(function (i) {
var sh = opts["rowHeight"], speed = opts["speed"], _this = $(this);
intId[i] = setInterval(function () {
if (_this.find("ul").height() <= _this.height()) {
clearInterval(intId[i]);
} else {
marquee(_this, sh);
}
}, speed);
_this.hover(function () {
clearInterval(intId[i]);
}, function () {
intId[i] = setInterval(function () {
if (_this.find("ul").height() <= _this.height()) {
clearInterval(intId[i]);
} else {
marquee(_this, sh);
}
}, speed);
});
});
}
})(jQuery);
//首页公告查询
queryNoticeDatas();
//首页公告查询
function queryNoticeDatas() {
var dataList = "";//返回的数据
//条件查询
var req = {
baseRequest: {
pageNum: 1,
pageSize: 20
},
sysCode: sysComm.sysCode,
noticeBigTypes: [200]
};
//1.分页查询停车场信息统计和今日收益
var inComeAjax = {
method: "post",
url: dataUrl.util.queryNoticeForPage(),
data: JSON.stringify(req),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (res) {
console.log(res);
if ("8888" == res.code) {
$("#index-notice-main").empty()
var data = res.data.rows;
var html = '';
if (data != null && data.length > 0) {
data.sort(function (a, b) {
return b.effDate < a.effDate ? 1 : -1
})
for (var index in data) {
var noticeTime = data[index].effDate == null ? "" : DateUtils.long2String(data[index].effDate, 1);
html += '' + data[index].noticeTitle +
'' + noticeTime + '';
}
}
//console.log(html);
$("#index-notice-main").append(html);
$("div.list_lh").myScroll({
speed: 40, //数值越大,速度越慢
rowHeight: 28 //li的高度
});
}
}
};
sysAjax(inComeAjax);
}
$(document).on('click', '#index-notice-main li', function () {
var id = $(this).attr('data-id');
var url = $(this).attr('data-url');
var title = $(this).attr('data-title');
var time = $(this).attr('data-time');
// console.log(id);
// console.log(url);
sessionStorage.setItem('newsid', id);
window.location.href = 'notice.html?url=' + url
});
//近7日收入折线图
var incomeecharts = echarts.init(document.getElementById('income-echarts'));
var incomeoption = {
color: ['#5fe98f'],
tooltip: {
trigger: 'item',
backgroundColor: '#5fe98f',
// extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);',
borderColor: '#5fe98f',
padding: 0,
textStyle: {
color: '#fff',
fontSize: '14px',
fontFamily: '微软雅黑'
},
// extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);',
formatter: function (params) {
var str = '';
//console.log(params)
str += '' + params.data + '元
';
return str;
},
extraCssText: 'border-radius:20px!important;'
},
// legend: {
// top: '0',
// right: '24',
//
// },
grid: {
top: '13%',
left: '1%',
right: '2%',
bottom: '2%',
containLabel: true
},
xAxis: {
type: 'category',
axisLabel: {
show: true,
textStyle: {
color: 'rgba(0,0,0,0.5)',
fontSize: '12px',
fontFamily: '微软雅黑'
}
},
splitLine: {
lineStyle: {
color: 'rgba(0,0,0,0.1)',
}
},
axisLine: {
show: true,
lineStyle: {
color: 'rgba(0,0,0,0.1)',
// width: 1,//这里是为了突出显示加上的
}
},
axisTick: {
show: false
},
data: [1, 2, 3, 4, 5],
},
yAxis: {
type: 'value',
axisLabel: {
show: true,
textStyle: {
color: 'rgba(0,0,0,0.5)',
fontSize: '12px',
fontFamily: '微软雅黑'
}
},
axisLabel: { //调整y轴的lable
textStyle: {
color: 'rgba(0,0,0,0.5)',
}
},
axisTick: {
show: false
},
axisLine: {
lineStyle: {
color: 'rgba(0,0,0,0.1)',
width: 1,//这里是为了突出显示加上的
}
},
splitLine: {
lineStyle: {
// type:'dashed',
color: 'rgba(0,0,0,0.1)',
}
}
},
series: [
{
name: '近7日收入折线图',
type: 'line',
data: [],
symbol: 'circle',
symbolSize: 10,
itemStyle: {
normal: {
lineStyle: {
color: '#f0f0f2',
}
}
},
areaStyle: {
normal: {
color: '#effdf4'
}
},
lineStyle: {
normal: {
color: '#5fe98f',
width: 2,
}
}
},
]
};
incomeecharts.setOption(incomeoption, true);
//实时泊位占用数
// var dcsbChart = echarts.init(document.getElementById('index-zylecharts'));
// var dcsboption = {
// title: {
// text: '80%',
// textStyle:{
// color:'#000',
// fontSize:'18',
// align:'center',
// fontFamily:'微软雅黑'
// },
// top:'65',
// left:'center'
// },
// legendHoverLink: false,
// series: [
// {
// name:'',
// type:'pie',
// radius:'80%',
// center:['50%','50%'],
// legendHoverLink: false,
// avoidLabelOverlap: false,
// startAngle :180,
// hoverAnimation:false,
// label:{normal: {show: false}},
// data:[
// {value:50, name:'',itemStyle:{normal:{color:'#edf7fb'},emphasis:{color:'#edf7fb'}}, label:{normal: {show: false}}},
// {value:50, name:'',itemStyle:{normal:{color:'#edf7fb'},emphasis:{color:'#edf7fb'}}, label:{normal: {show: false}}}
// ]
// },
// {
// name:'具体比例',
// type:'pie',
// radius: ['88%', '98%'],
// center:['50%','50%'],
// legendHoverLink: false,
// avoidLabelOverlap: false,
// hoverAnimation:false,
// // hoverOffset:0,
// startAngle :180,
// color:['#5fe98f','#cccc'],
// label: {
// normal: {
// show: false,
// position: 'inside',
// formatter:'{c}%'
// },
// emphasis: {
// show: false,
// textStyle: {
// fontSize: '30',
// fontWeight: 'bold'
// }
// }
//
// },
// labelLine: {
// normal: {
// show: false
// }
// },
// data:[
//
// {value:2, name:'20~25岁',itemStyle:{normal:{color:'#5fe98f'},emphasis:{color:'#5fe98f'}}, label:{normal: {show: false}}},
// {value:2, name:'25~30岁',itemStyle:{normal:{color:'#cccc'},emphasis:{color:'#cccc'}}, label:{normal: {show: false}}},
// // {value:4, name:'',itemStyle:{normal:{color:'#fff'},emphasis:{color:'#fff'}}, label:{normal: {show: false}}}
// ]
// }
// ]
// };
// dcsbChart.setOption(dcsboption, true);
//自适应
window.onresize = function () {
incomeecharts.resize();
};