![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/html/libs/absol-full/dist/js/ |
Upload File : |
/*** module: node_modules/absol-vchart/src/ImagesChart.js ***/ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SalaryImgChart = SalaryImgChart; exports.default = void 0; var _VCore = _interopRequireDefault(require("./VCore")); var _salaryimgchart = _interopRequireDefault(require("../template/salaryimgchart.svg")); var _helper = require("./helper"); var _BChart = require("./BChart"); var _ = _VCore.default._; var $ = _VCore.default.$; /** * @deprecated * @constructor */ function SalaryImgChart() {} SalaryImgChart.tag = 'SalaryImgChart'.toLowerCase(); SalaryImgChart.render = function () { return _(_salaryimgchart.default.replace(/(.|[\r\n])+\<svg/, '<svg')).addClass('image-chart').addClass('base-chart'); }; SalaryImgChart.property = {}; SalaryImgChart.prototype.preInit = function () { //this is defaul and can not be change this.bonus = 20; this.distance = 400; this.minDistance = 10; this.colTexts = ['Bậc 1', 'Bậc n -1', 'Bậc n']; this.distText = 'Khoảng cách lương'; this.minDistText = 'Khoảng cách tối thiểu'; this.bonusText = 'Hệ số ưu đãi (20%)'; }; SalaryImgChart.prototype.initComp = function () { this.$ox = _('shape.image-chart-ox').addTo(this); this.$oxDash = _('shape.image-chart-ox[stroke-dasharray="4, 2"]').addTo(this); this.$bases = [_('rect.image-chart-base').addTo(this), _('rect.image-chart-base').addTo(this), _('rect.image-chart-base').addTo(this)]; this.$bonuses = [_('rect.image-chart-bonus').addTo(this), _('rect.image-chart-bonus').addTo(this), _('rect.image-chart-bonus').addTo(this)]; this.$distRange = _('shape.image-chart-range[marker-end="url(#Arrow2Mend)"][marker-start="url(#Arrow2Mstart)"]').addTo(this); this.$minDistRange = _('shape.image-chart-range[marker-end="url(#Arrow1Send)"][marker-start="url(#Arrow1Sstart)"]').addTo(this); this.$bonusRange = _('shape.image-chart-range[marker-end="url(#Arrow1Send)"][marker-start="url(#Arrow1Sstart)"]').addTo(this); this.$distTop = _('shape.image-chart-range-limit[stroke-dasharray="2, 1"]').addTo(this); this.$distBot = _('shape.image-chart-range-limit[stroke-dasharray="2, 1"]').addTo(this); this.$minDistBot = _('shape.image-chart-range-limit[stroke-dasharray="2, 1"]').addTo(this); this.$bonusTop = _('shape.image-chart-range-limit[stroke-dasharray="2, 1"]').addTo(this); this.$bonusBot = _('shape.image-chart-range-limit[stroke-dasharray="2, 1"]').addTo(this); this.$distText = (0, _helper.text)('', 0, 0).addTo(this); this.$minDistText = (0, _helper.text)('', 0, 0).attr('text-anchor', 'end').addTo(this); this.$bonusText = (0, _helper.text)('', 0, 0).addTo(this); this.$lvTexts = [null, null, null].map(function () { return (0, _helper.text)('', 0, 0).attr('text-anchor', 'middle').addTo(this); }.bind(this)); }; SalaryImgChart.prototype.updateComp = function () { var width = 560; var height = 320; var maxColHeight = 288; var _this = this; this.oxY = height - 20; this.colWidth = 40; this.oxSeg = [10, 100, 260, 500]; this.xCols = [37, 272, 373]; this.heightCols = [maxColHeight / (1 + this.distance / 100), maxColHeight / (1 + this.minDistance / 100), maxColHeight]; //<path d="m2.9298 290.03h21.626m43.891 0h51.013" fill="none" stroke="#4472c4" stroke-width=".26458px"/> this.$ox.begin().moveTo(this.oxSeg[0], this.oxY + 1).lineTo(this.oxSeg[1], this.oxY + 1).moveTo(this.oxSeg[2], this.oxY + 1).lineTo(this.oxSeg[3], this.oxY + 1).end(); // <path d="m24.555 290.03h43.891" fill="none" stroke="#4372c4" stroke-dasharray="1.05999993, 0.52999997" stroke-width=".265"/> this.$oxDash.begin().moveTo(this.oxSeg[1], this.oxY + 1).lineTo(this.oxSeg[2], this.oxY + 1).end(); this.heightBase = this.heightCols.map(function (hc) { return (0, _helper.map)(100, 0, 100 + _this.bonus, 0, hc); }); this.heightBonus = this.heightCols.map(function (hc) { return (0, _helper.map)(_this.bonus, 0, 100 + _this.bonus, 0, hc); }); this.$bases.forEach(function (e, i) { var x = _this.xCols[i]; var height = _this.heightBase[i]; e.attr({ x: x, y: _this.oxY - height, width: _this.colWidth, height: height }); }); this.$bonuses.forEach(function (e, i) { var x = _this.xCols[i]; var height = _this.heightBonus[i]; e.attr({ x: x, y: _this.oxY - _this.heightCols[i], width: _this.colWidth, height: height }); }); this.$distRange.begin().moveTo(this.xCols[0] - 13, this.oxY - this.heightBase[2] + 2).lineTo(this.xCols[0] - 13, this.oxY - this.heightBase[0] - 2).end(); this.$minDistRange.begin().moveTo(this.xCols[1] - 38, this.oxY - this.heightBase[2] + 1).lineTo(this.xCols[1] - 38, this.oxY - this.heightBase[1] - 1).end(); this.$bonusRange.begin().moveTo(this.xCols[2] + 13 + this.colWidth, this.oxY - this.heightBase[2] - this.heightBonus[2] + 1).lineTo(this.xCols[2] + 13 + this.colWidth, this.oxY - this.heightBase[2] - 1).end(); this.$distTop.begin().moveTo(this.xCols[0] - 13, this.oxY - this.heightBase[2]).lineTo(this.xCols[2], this.oxY - this.heightBase[2]).end(); this.$distBot.begin().moveTo(this.xCols[0] - 13, this.oxY - this.heightBase[0]).lineTo(this.xCols[0], this.oxY - this.heightBase[0]).end(); this.$minDistBot.begin().moveTo(this.xCols[1] - 38, this.oxY - this.heightBase[1]).lineTo(this.xCols[1], this.oxY - this.heightBase[1]).end(); this.$bonusBot.begin().moveTo(this.xCols[2] + this.colWidth, this.oxY - this.heightBase[2]).lineTo(this.xCols[2] + 13 + this.colWidth, this.oxY - this.heightBase[2]).end(); this.$bonusTop.begin().moveTo(this.xCols[2] + this.colWidth, this.oxY - this.heightBase[2] - this.heightBonus[2]).lineTo(this.xCols[2] + 13 + this.colWidth, this.oxY - this.heightBase[2] - this.heightBonus[2]).end(); this.$distText.innerHTML = this.distText; this.$distText.attr({ x: this.xCols[0] - 7, y: this.oxY - (this.heightBase[2] + this.heightBase[0]) / 2 + 5 }); this.$minDistText.innerHTML = this.minDistText; this.$minDistText.attr({ x: this.xCols[1] - 38 - 6, y: this.oxY - (this.heightBase[2] + this.heightBase[1]) / 2 + 5 }); this.$bonusText.innerHTML = this.bonusText; this.$bonusText.attr({ x: this.xCols[2] + 13 + this.colWidth + 6, y: this.oxY - this.heightBase[2] - this.heightBonus[2] / 2 + 5 }); this.$lvTexts.forEach(function (e, i) { e.innerHTML = _this.colTexts[i]; e.attr({ x: _this.xCols[i] + _this.colWidth / 2, y: _this.oxY + 15 }); }); }; SalaryImgChart.prototype.init = function (props) { this.preInit(); this.super(props); this.initComp(); this.updateComp(); }; _VCore.default.install(SalaryImgChart); var _default = SalaryImgChart; exports.default = _default;