Iniit
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let DetailWidgets;
|
||||
(function (DetailWidgets) {
|
||||
class CustomDesign extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return ["bundle/index.kpi.js"];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(obj, containerid) {
|
||||
let html = '';
|
||||
if (obj[0].PortletWidgetId == 22501) {
|
||||
html = '<div class="card h-160p"><ul class="h-100 d-flex justify-content-center align-items-center"><li class="d-flex justify-content-center font-34 font-weight-500"><span class="mx-2"><i class="la la-plus-circle"></i></span><span>Custom Design</span></li></ul></div>';
|
||||
}
|
||||
else {
|
||||
html = '<div class="col-12 DynamicHtml_' + containerid + '">' +
|
||||
'</div>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
var instance = this;
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().addCacheFiles(["platform/core/helpers/propertyhelper/propertyhelper.js", "platform/core/helpers/numberhelper/numberhelper.js"]);
|
||||
var Filter = [];
|
||||
var WidgetParameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
for (var w = 0; w < WidgetParameters.length; w++) {
|
||||
var ParameterName = WidgetParameters[w].Key;
|
||||
var ParameterValue = WidgetParameters[w].Value;
|
||||
Filter.push({
|
||||
ParameterName: ParameterName,
|
||||
ParameterValue: ParameterValue,
|
||||
ExpOp: Unibase.Platform.Core.Enums.ExpressionOperator.Equals
|
||||
});
|
||||
}
|
||||
let postdata = {
|
||||
ReportId: id[0].ReportId,
|
||||
page: 0,
|
||||
pageSize: 10,
|
||||
Filter: Filter,
|
||||
IsJson: true
|
||||
};
|
||||
Unibase.Platform.Analytics.Managers.ReportManager.Instance().getReportViewerData(postdata).then(function (res) {
|
||||
var templateScript = Handlebars.compile(id[0].StaticJsPath.replace(/\`/g, ''));
|
||||
var html = "";
|
||||
var data = JSON.parse(JSON.parse(res.result).Data);
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
html += templateScript(data[i]);
|
||||
}
|
||||
$(".DynamicHtml_" + containerid).html(html);
|
||||
});
|
||||
$('.' + containerid).siblings('.line-loader').remove();
|
||||
$('.' + containerid).removeClass('hidden');
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new CustomDesign();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
DetailWidgets.CustomDesign = CustomDesign;
|
||||
})(DetailWidgets = Compact.DetailWidgets || (Compact.DetailWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"customdesign.js","sourceRoot":"","sources":["customdesign.ts"],"names":[],"mappings":"AACA,IAAU,OAAO,CAgFhB;AAhFD,WAAU,OAAO;IACb,IAAiB,MAAM,CA8EtB;IA9ED,WAAiB,MAAM;QACnB,IAAiB,OAAO,CA4EvB;QA5ED,WAAiB,OAAO;YACpB,IAAiB,aAAa,CA0E7B;YA1ED,WAAiB,aAAa;gBAC1B,MAAa,YAAa,SAAQ,QAAA,QAAQ,CAAC,IAAI,CAAC,aAAa;oBASzD,OAAO;wBAEH,OAAO,CAAC,wDAAwD,EAAE,4CAA4C,EAAE,wDAAwD,EAAE,4CAA4C,CAAC,CAAC;oBAC5N,CAAC;oBACD,QAAQ;wBAEJ,OAAO,EAAE,CAAC;oBACd,CAAC;oBAED,IAAI,CAAC,GAAG,EAAE,WAAW;wBACjB,IAAI,IAAI,GAAG,EAAE,CAAC;wBACd,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,IAAI,KAAK,EAAE;4BACj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EtB;AACL,CAAC,EAhFS,OAAO,KAAP,OAAO,QAgFhB"}
|
||||
@@ -0,0 +1,373 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let DetailWidgets;
|
||||
(function (DetailWidgets) {
|
||||
class Default extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName, html = "";
|
||||
if (id[0].PortletWidgetId == 22501) {
|
||||
html = '<div id="widget_details_' + id[0].PortletWidgetId + '" class="card h-160p shadow-hover mb-0">' +
|
||||
'<div class="card-header card-header-action border-bottom-0 px-20">' +
|
||||
'<span class="biz-highlight-bg-color" id="hf-widget-title_' + id[0].PortletWidgetId + '">' + title + '</span>' +
|
||||
'<div class="d-flex align-items-center card-action-wrap" id="div_detail_addnew_' + id[0].PortletWidgetId + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="card-body py-0">' +
|
||||
'<div class="row biz-transparent-text-color">' +
|
||||
'<div class="col-md-6">' +
|
||||
'<ul class="list-group list-group-flush px-30" id="widget_details_' + id[0].PortletWidgetId + '_col1">' +
|
||||
'<li class="list-group-item widget_details_item' + id[0].PortletWidgetId + '_col1 py-1" id="widget_details_item_' + id[0].PortletWidgetId + '_col1"><ul class="list-group list-group-flush"><li class="d-flex justify-content-between align-items-center px-0 py-2" style="border-top: 1px dashed black; font-size: 14px;"><span class="pl-0">Organization</span><span class="text-overflow text-right" title="shanvi">shanvi</span></li><li class="d-flex justify-content-between align-items-center px-0 py-2" style="border-top: 1px dashed black; font-size: 14px;"><span class="pl-0">Cin</span><span class="text-overflow text-right" title="GCIN350">GCIN350</span></li></ul></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'<div class="col-md-6">' +
|
||||
'<ul class="list-group list-group-flush px-30" id="widget_details_' + id[0].PortletWidgetId + '_col2">' +
|
||||
'<li class="list-group-item widget_details_item' + id[0].PortletWidgetId + '_col2 py-1" id="widget_details_item_' + id[0].PortletWidgetId + '_col2"><ul class="list-group list-group-flush"><li class="d-flex justify-content-between align-items-center px-0 py-2" style="border-top: 1px dashed black; font-size: 14px;"><span class="pl-0">Organization</span><span class="text-overflow text-right" title="shanvi">shanvi</span></li><li class="d-flex justify-content-between align-items-center px-0 py-2" style="border-top: 1px dashed black; font-size: 14px;"><span class="pl-0">Cin</span><span class="text-overflow text-right" title="GCIN350">GCIN350</span></li></ul></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
else {
|
||||
html = '<div id="widget_details_' + id[0].PortletWidgetId + '" class="card h-160p shadow-hover mb-0">' +
|
||||
'<div class="card-header card-header-action border-bottom-0 px-20 ml-5">' +
|
||||
'<span class="biz-highlight-bg-color" id="hf-widget-title_' + id[0].PortletWidgetId + '">' + title + '</span>' +
|
||||
'<div class="d-flex align-items-center card-action-wrap" id="div_detail_addnew_' + id[0].PortletWidgetId + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="card-body py-0">' +
|
||||
'<div class="row biz-transparent-text-color">' +
|
||||
'<div class="col-md-6">' +
|
||||
'<ul class="list-group list-group-flush px-0" id="widget_details_' + id[0].PortletWidgetId + '_col1">' +
|
||||
'<li class="list-group-item widget_details_item' + id[0].PortletWidgetId + '_col1 py-1" id="widget_details_item_' + id[0].PortletWidgetId + '_col1"></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'<div class="col-md-6">' +
|
||||
'<ul class="list-group list-group-flush px-0" id="widget_details_' + id[0].PortletWidgetId + '_col2">' +
|
||||
'<li class="list-group-item widget_details_item' + id[0].PortletWidgetId + '_col2 py-1" id="widget_details_item_' + id[0].PortletWidgetId + '_col2"></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters, _portletwidgetid) {
|
||||
let instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getDetailWidgetData(parameters).then(function (response) {
|
||||
if (_portletwidgetid == undefined) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (_portletwidgetid != 0) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(_portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, detailContainer, parameters, IsPreview, response, portletresponse) {
|
||||
let instance = this, list1 = '', list2 = '', count = 0, labelArray1 = [], labelArray2 = [];
|
||||
var result = response.result.Data;
|
||||
var cssproperty;
|
||||
if (portletresponse != undefined) {
|
||||
if (portletresponse != undefined) {
|
||||
if (portletresponse.result.PortletWidgetCss != null && portletresponse.result.PortletWidgetCss != '') {
|
||||
cssproperty = JSON.parse(portletresponse.result.PortletWidgetCss);
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(response.result.CssProperty);
|
||||
}
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(response.result.CssProperty);
|
||||
}
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(response.result.CssProperty);
|
||||
}
|
||||
$("." + detailContainer).find('#widget_details_' + portletwidgetid).removeClass('h-160p').css({ "background-color": cssproperty[0].BackgroundColor, "border": cssproperty[0].DetailsBorderWidth + ' ' + cssproperty[0].DetailsBorderType + ' ' + cssproperty[0].DetailsBorderColor, "border-radius": cssproperty[0].DetailsBorderRadius });
|
||||
let borderTop = cssproperty[0].BorderWidth + ' ' + cssproperty[0].BorderType + ' ' + cssproperty[0].BorderColor;
|
||||
let iconhtml = '';
|
||||
let icon = '';
|
||||
let onlickurl = "";
|
||||
let systemLock = Unibase.Themes.Compact.Components.Details.Instance().isSystemLock;
|
||||
if (!systemLock || (systemLock && response.result.AppConfiguration.ExcludeFromLock)) {
|
||||
if (response.result.AppConfiguration != null && response.result.AppConfiguration.AppConfigurationId != 0) {
|
||||
onlickurl = instance.load_appconfigurations(response.result.AppConfiguration, response.result.Data, portletwidgetid);
|
||||
iconhtml = '<a href="javascript:;" class="btn-icon" onclick="' + onlickurl + '"> <i class="' + response.result.AppConfiguration.Icon + '"></i></a>';
|
||||
$("#div_detail_addnew_" + portletwidgetid).html(iconhtml);
|
||||
}
|
||||
else
|
||||
iconhtml = '<a href="javascript:;" class="btn-icon" onclick="' + onlickurl + '"> <i class="' + icon + '"></i></a>';
|
||||
iconhtml = Unibase.Core.Helpers.PropertyHelper.Instance().replace(iconhtml, response.result.Data[0]);
|
||||
}
|
||||
$("#div_detail_addnew_" + portletwidgetid).html(iconhtml);
|
||||
var properties = response.result.DetailWidgetProperties;
|
||||
var titletoken = "";
|
||||
var tokenarray = [];
|
||||
var labelarray = [];
|
||||
var propertyarray = [];
|
||||
var HyperLink = [];
|
||||
var arraylength = 0;
|
||||
for (var i = 0; i < properties.length; i++) {
|
||||
var model = properties[i];
|
||||
var propertyindex = model.PropertyIndex;
|
||||
if (model.Value != null) {
|
||||
if (model.ConverterType == 2) {
|
||||
var format = model.ConverterValue;
|
||||
if (model.ConverterValue == null || model.ConverterValue == "")
|
||||
format = "DD/MM/YYYY";
|
||||
var token = "Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDate1('" + model.Value + "'," + format + ")";
|
||||
}
|
||||
else if (model.ConverterType == 1) {
|
||||
var format = model.ConverterValue;
|
||||
if (model.ConverterValue == null || model.ConverterValue == "")
|
||||
format = "2";
|
||||
var token = "Unibase.Core.Helpers.NumberHelper.Instance().roundNumber('" + model.Value + "'," + format + ")";
|
||||
}
|
||||
else
|
||||
var token = model.Value;
|
||||
}
|
||||
labelarray.push(model.Label);
|
||||
tokenarray.push(token);
|
||||
propertyarray.push(propertyindex);
|
||||
HyperLink.push(model.HyperLink);
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
if (arraylength % 2 === 0) {
|
||||
arraylength = arraylength;
|
||||
}
|
||||
else {
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
var arrayindex = (arraylength / 2);
|
||||
var slicedarray = tokenarray.splice(0, arrayindex);
|
||||
var labelslice = labelarray.splice(0, arrayindex);
|
||||
var propertyslice = propertyarray.splice(0, arrayindex);
|
||||
for (var k = 0; k < propertyslice.length; k++) {
|
||||
for (var i = k; i <= k; i++) {
|
||||
var model = properties[i];
|
||||
for (var j = i; j <= i; j++) {
|
||||
if (j == 0) {
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid + '_col1 li:not(:first-child)').remove();
|
||||
}
|
||||
var replace = slicedarray[i];
|
||||
var data = null;
|
||||
if (result != null) {
|
||||
data = response.result.Data[0];
|
||||
}
|
||||
let token = Unibase.Core.Helpers.PropertyHelper.Instance().replace(replace, data);
|
||||
if (response.result.Js != null || response.result.Js != "") {
|
||||
eval(response.result.Js);
|
||||
}
|
||||
if (model.ConverterType == 3) {
|
||||
token = moment(token).format('LT');
|
||||
}
|
||||
if (token == "" || token == " " || token == "0 NA" || token == "0NA" || token == "null" || token == "Invalid date" || token == "1900/01/01" || token == "01/01/1900" || token == "01/01/1900 05:21:10" || token == "[object Object]" || token == "01/01/0001" || token == "0001/01/01" || token == "1901/01/01" || token == "01/01/1901" || token == "1901/01/01" || token == "01/01/1901" || token == "01/01/0001 12:01:00" || token == "01/01/0001 12:01" || token == "01/01/0001 00:00" || token == "01/01/0001 12:00:00 AM" || token == "01/01/0001 05:30:00 AM" || token == "0001-01-01T00:00:00") {
|
||||
token = "NA";
|
||||
}
|
||||
if (token == "true") {
|
||||
token = "True";
|
||||
}
|
||||
else if (token == "false") {
|
||||
token = "False";
|
||||
}
|
||||
else if (data == undefined) {
|
||||
token = "NA";
|
||||
}
|
||||
titletoken = token;
|
||||
if (HyperLink[propertyslice[k]] != null && HyperLink[propertyslice[k]] != "") {
|
||||
var HL = Unibase.Core.Helpers.TokenHelper.Instance().replace(HyperLink[propertyslice[k]], data);
|
||||
var href = "javascript:;";
|
||||
var target = "";
|
||||
if (HyperLink[propertyslice[k]].includes('href')) {
|
||||
var target = "target='_blank'";
|
||||
href = HL.replace(/href=/, '');
|
||||
if (href == "NA") {
|
||||
href = "javascript:;";
|
||||
target = "";
|
||||
}
|
||||
HL = '';
|
||||
}
|
||||
token = '<u><a href="' + href + '" ' + target + ' onclick="' + HL + '"><font class="text-ul text-dark">' + token + '</font></a></u>';
|
||||
}
|
||||
if (labelslice[j] != "") {
|
||||
list1 += '<li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-' + propertyslice[k] + ' px-0 py-2 detailProperty_' + portletwidgetid + ' widget_details_item' + portletwidgetid + '_col1"><div class="d-flex justify-content-between align-items-center"><span class="col-5 pl-2 text-light">' + labelslice[j] + '</span><span class="text-overflow text-right d-none d-md-block" title="' + titletoken + '">' + token + '</span><span class="text-overflow text-right col-7 pr-0 d-md-none font-weight-600" title="' + titletoken + '">' + token + '</span></div></li>';
|
||||
}
|
||||
else {
|
||||
labelArray1.push(labelslice[j]);
|
||||
list1 += '<li class="Twocolumn-listgroup-1-item Twocolumn-listgroup-1-addeditem li-' + propertyslice[k] + ' px-0 py-2 detailProperty_' + portletwidgetid + ' widget_details_item' + portletwidgetid + '_col1"><div class="d-flex justify-content-between align-items-center"><span class="text-overflow text-left" title="' + titletoken + '">' + token + '</span></div></li>';
|
||||
}
|
||||
$("." + detailContainer).find(`#widget_details_${portletwidgetid}_col1`).html(list1);
|
||||
$("." + detailContainer).find(`#widget_details_${portletwidgetid}_col2`).empty();
|
||||
if (screen.width < 1198 && (cssproperty[0].FontSize == '14px' || cssproperty[0].FontSize == 14)) {
|
||||
$("." + detailContainer).find('.widget_details_item' + portletwidgetid + '_col1').css({ "border-top": borderTop, "font-size": '11px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
else {
|
||||
$("." + detailContainer).find('.widget_details_item' + portletwidgetid + '_col1').css({ "border-top": borderTop, "font-size": cssproperty[0].FontSize + 'px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
}
|
||||
if (labelArray1.length == j) {
|
||||
$("." + detailContainer).find(`#widget_details_${portletwidgetid}_col1`).removeClass('px-30').addClass('px-10');
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var k = 0; k < propertyarray.length; k++) {
|
||||
for (var i = k; i <= k; i++) {
|
||||
for (var j = i; j <= i; j++) {
|
||||
if (j == 0) {
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid + '_col2 li:not(:first-child)').remove();
|
||||
}
|
||||
var replace = tokenarray[i];
|
||||
data = response.result.Data[0];
|
||||
let token = Unibase.Core.Helpers.PropertyHelper.Instance().replace(replace, data);
|
||||
if (response.result.Js != null || response.result.Js != "") {
|
||||
eval(response.result.Js);
|
||||
}
|
||||
if (token == "" || token == "0 NA" || token == "0NA" || token == "null" || token == "Invalid date" || token == "1900/01/01" || token == "01/01/1900" || token == "01/01/1900 05:21:10" || token == "[object Object]" || token == " " || token == "01/01/0001" || token == "0001/01/01" || token == "1901/01/01" || token == "01/01/1901" || token == "1901/01/01" || token == "01/01/1901" || token == "01/01/0001 12:01:00" || token == "01/01/0001 00:00" || token == "01/01/0001 12:00:00 AM" || token == "01/01/0001 05:30:00 AM") {
|
||||
token = "NA";
|
||||
}
|
||||
if (token == "true") {
|
||||
token = "True";
|
||||
}
|
||||
else if (token == "false") {
|
||||
token = "False";
|
||||
}
|
||||
else if (data == undefined) {
|
||||
token = "NA";
|
||||
}
|
||||
titletoken = token;
|
||||
if (HyperLink[propertyarray[k]] != null && HyperLink[propertyarray[k]] != "") {
|
||||
var HL = Unibase.Core.Helpers.TokenHelper.Instance().replace(HyperLink[propertyarray[k]], data);
|
||||
var href = "javascript:;";
|
||||
var target = "";
|
||||
if (HyperLink[propertyslice[k]].includes('href')) {
|
||||
var target = "target='_blank'";
|
||||
href = HL.replace(/href=/, '');
|
||||
if (href == "NA") {
|
||||
href = "javascript:;";
|
||||
target = "";
|
||||
}
|
||||
HL = '';
|
||||
}
|
||||
token = '<u><a href="' + href + '" ' + target + ' onclick="' + HL + '"><font class="text-ul text-dark">' + token + '</font></a></u>';
|
||||
}
|
||||
if (labelarray[j] != '') {
|
||||
list2 += '<li class="Twocolumn-listgroup-2-item Twocolumn-listgroup-2-addeditem li-' + propertyarray[k] + ' px-0 py-2 detailProperty_' + portletwidgetid + ' widget_details_item' + portletwidgetid + '_col2"> <div class="d-flex justify-content-between align-items-center "> <span class="col-5 pl-2 text-light">' + labelarray[j] + '</span> <span class="text-overflow text-right d-none d-md-block" title="' + titletoken + '">' + token + '</span> <span class="text-overflow text-right col-sm-7 pr-0 d-md-none" title="' + titletoken + '">' + token + '</span> </div></li>';
|
||||
}
|
||||
else {
|
||||
labelArray2.push(labelarray[j]);
|
||||
list2 += '<li class="Twocolumn-listgroup-2-item Twocolumn-listgroup-2-addeditem li-' + propertyarray[k] + ' px-0 py-2 detailProperty_' + portletwidgetid + ' widget_details_item' + portletwidgetid + '_col2"> <div class="d-flex justify-content-between align-items-center "><span class="text-overflow" title="' + titletoken + '">' + token + '</span> </div></li>';
|
||||
}
|
||||
$("." + detailContainer).find(`#widget_details_${portletwidgetid}_col2`).html(list2);
|
||||
if (screen.width < 1198 && (cssproperty[0].FontSize == '14px' || cssproperty[0].FontSize == 14)) {
|
||||
$("." + detailContainer).find('.widget_details_item' + portletwidgetid + '_col2').css({ "border-top": borderTop, "font-size": '11px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
else {
|
||||
$("." + detailContainer).find('.widget_details_item' + portletwidgetid + '_col2').css({ "border-top": borderTop, "font-size": cssproperty[0].FontSize + 'px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
}
|
||||
if (labelArray2.length == j) {
|
||||
$("." + detailContainer).find(`#widget_details_${portletwidgetid}_col2`).removeClass('px-30').addClass('px-10');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cssproperty[0].IsDetailsHeader != undefined && cssproperty[0].IsDetailsHeader == true) {
|
||||
$("#hf-widget-title_" + portletwidgetid).parent('.card-header').remove();
|
||||
}
|
||||
$('.' + detailContainer).siblings('.line-loader').remove();
|
||||
$('.' + detailContainer).removeClass('hidden');
|
||||
$("[title='na' i]").find("a").removeAttr("href");
|
||||
$("[title='na' i]").find("u").css("text-decoration", "none");
|
||||
$("[title='na' i]").find("font").text("NA");
|
||||
}
|
||||
load_appconfigurations(config, data, portletwidgetid) {
|
||||
var instance = this;
|
||||
let settingurltype = config.SettingUrlType;
|
||||
var appconfigurationid = config.AppConfigurationId;
|
||||
var settingUrl = config.SettingUrl;
|
||||
var jsfunction = config.JsFunction;
|
||||
var formid = config.FormId;
|
||||
let editformid;
|
||||
var formpkname = config.FormPrimaryColumn;
|
||||
if (data.length <= 0) {
|
||||
editformid = 0;
|
||||
}
|
||||
else if (formpkname != "" && formpkname != null) {
|
||||
editformid = "{{" + formpkname + "}}";
|
||||
}
|
||||
else
|
||||
editformid = 0;
|
||||
var onclick = "";
|
||||
if (settingurltype == 2) {
|
||||
onclick = "this.fileCacheHelper.loadJsFile('" + config.SettingUrl + "', function () {var html = Unibase.Apps.Components.Stages.Instance().init();NavigationHelper.Instance().loadPopupHtml(html, Helpers.Size.DockLeft, function(containerid) {" + config.JsFunction + " ;});});";
|
||||
}
|
||||
else if (settingurltype == 1) {
|
||||
onclick = 'Unibase.Platform.Helpers.NavigationHelper.Instance().loadForm(' + formid + ', ' + editformid + ',' + appconfigurationid + ',' + portletwidgetid + ' )';
|
||||
}
|
||||
else if (settingurltype == 3) {
|
||||
let variablename = "Widget_" + config.SettingUrl.split(",")[0].split(".")[0].trim();
|
||||
let methodname = config.SettingUrl.split(",")[1];
|
||||
var onclickurl = "Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('widgets/" + config.SettingUrl.split(",")[0] + "', function () { " + variablename + "." + methodname + " });";
|
||||
onclick = onclickurl;
|
||||
}
|
||||
else if (settingurltype == 10) {
|
||||
onclick = "Unibase.Themes.Compact.Components.Nav.Instance().loadDashboard(" + config.LinkDashboardId + ",'" + config.DashboardName + "')";
|
||||
}
|
||||
else if (settingurltype == 11) {
|
||||
onclick = "Unibase.Themes.Compact.Components.Nav.Instance().loadDashboardsInDashboard(" + config.LinkDashboardGroupId + ",0,true)";
|
||||
}
|
||||
return onclick;
|
||||
}
|
||||
static Instance() {
|
||||
this.instance = new Default();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
DetailWidgets.Default = Default;
|
||||
})(DetailWidgets = Compact.DetailWidgets || (Compact.DetailWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,127 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let DetailWidgets;
|
||||
(function (DetailWidgets) {
|
||||
class Detailwidgetsplitcolumn extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
debugger;
|
||||
var title = id[0].WidgetName;
|
||||
let html = '<section id="widget_details_' + id[0].PortletWidgetId + '" class="card shadow-hover mb-0">' +
|
||||
'<div id="hf-widget-title_' + id[0].PortletWidgetId + '" class="card-header"><h6>' + title + '</h6></div>' +
|
||||
'<div class="card-body row mx-0">' +
|
||||
'<div class="col-sm-12">' +
|
||||
'<ul class="list-group no-borders list-group-flush" id="widget_details_' + id[0].PortletWidgetId + '_col1" style="list-style-type:disc">' +
|
||||
'<li class="list-group-item no-borders hidden" id="widget_details_item' + id[0].PortletWidgetId + '_col1"></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</section>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadData(portletwidgetid, detailcontainer, parameters) {
|
||||
debugger;
|
||||
var instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getDetailWidgetData(parameters).then(function (result) {
|
||||
var properties = result.result.DetailWidgetProperties;
|
||||
var tokenarray = [];
|
||||
var propertyarray = [];
|
||||
var HyperLink = [];
|
||||
var arraylength = 0;
|
||||
for (var i = 0; i < properties.length; i++) {
|
||||
var model = properties[i];
|
||||
var propertyindex = model.PropertyIndex;
|
||||
if (model.Value != null) {
|
||||
var token = model.Value.replace(/\s/g, "");
|
||||
}
|
||||
tokenarray.push(token);
|
||||
propertyarray.push(propertyindex);
|
||||
HyperLink.push(model.HyperLink);
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
if (arraylength % 2 === 0) {
|
||||
arraylength = arraylength;
|
||||
}
|
||||
else {
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
var arrayindex = (arraylength);
|
||||
var slicedarray = tokenarray.splice(0, arrayindex);
|
||||
var propertyslice = propertyarray;
|
||||
for (var k = 0; k < propertyarray.length; k++) {
|
||||
var replace = slicedarray[k];
|
||||
var data = result.result.Data[0];
|
||||
var templateScript = Handlebars.compile(replace);
|
||||
let token1 = Unibase.Core.Helpers.PropertyHelper.Instance().replace(replace, data);
|
||||
for (var i = 0; i < token1.split("|").length; i++) {
|
||||
var token2 = token1.split("|")[i];
|
||||
if (token2 == "" || token2 == "null" || token2 == "Invalid date" || token2 == "1900/01/01" || token2 == "01/01/1900" || token2 == "[object Object]" || token2 == " " || token2 == "01/01/0001" || token2 == "0001/01/01" || token2 == "<p><br></p>") {
|
||||
token2 = "NA";
|
||||
}
|
||||
if (result.result.Js != null || result.result.Js != "") {
|
||||
eval(result.result.Js);
|
||||
}
|
||||
if (HyperLink[propertyslice[k]] != null && HyperLink[propertyslice[k]] != "") {
|
||||
var HL = Unibase.Core.Helpers.TokenHelper.Instance().replace(HyperLink[propertyslice[k]], data);
|
||||
var href = "javascript:;";
|
||||
var target = "";
|
||||
if (HyperLink[propertyslice[k]].includes('href')) {
|
||||
var target = "target='_blank'";
|
||||
href = HyperLink[propertyslice[k]].replace(/href=/, '');
|
||||
HL = '';
|
||||
}
|
||||
token2 = '<a href=' + href + ' ' + target + ' onclick="' + HL + '"><font class="text-ul">' + token2 + '</font></a>';
|
||||
}
|
||||
let list1 = `<li class="list-group-item no-borders Singlecolumn-NoBorder-listgroup-item Singlecolumn-NoBorder-listgroup-addeditem m-t-lg p-2 li-${propertyslice[k]}" style="border: none;display:list-item"> ${token2} </div></div></li>`;
|
||||
$('#widget_details_item' + portletwidgetid + '_col1:last').before(list1);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('.' + detailcontainer).siblings('.line-loader').remove();
|
||||
$('.' + detailcontainer).removeClass('hidden');
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Detailwidgetsplitcolumn();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
DetailWidgets.Detailwidgetsplitcolumn = Detailwidgetsplitcolumn;
|
||||
})(DetailWidgets = Compact.DetailWidgets || (Compact.DetailWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,272 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let DetailWidgets;
|
||||
(function (DetailWidgets) {
|
||||
class SingleColumn extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(obj, containerid) {
|
||||
var title = obj[0].WidgetName, html = "";
|
||||
if (obj[0].PortletWidgetId == 22501) {
|
||||
html = '<div id="widget_details_' + obj[0].PortletWidgetId + '" class="card h-160p shadow-hover mb-0">' +
|
||||
'<div class="card-header card-header-action border-bottom-0 px-20">' +
|
||||
'<span id="hf-widget-title_' + obj[0].PortletWidgetId + '" class="biz-highlight-bg-color">' + title + '</span>' +
|
||||
'<div class="d-flex align-items-center card-action-wrap" id="singleColumnEditIcon_' + obj[0].PortletWidgetId + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="card-body pt-5">' +
|
||||
'<div class="row biz-transparent-text-color">' +
|
||||
'<div class="col-sm-12">' +
|
||||
'<ul class="list-group list-group-flush px-3" id="widget_details_' + obj[0].PortletWidgetId + '_col">' +
|
||||
'<li class="list-group-item hidden" id="widget_details_item' + obj[0].PortletWidgetId + '_col"></li>' +
|
||||
'<li class="d-flex justify-content-between align-items-center li-1 p-0 " style="border-top: 1px dashed black; font-size: 14px;"><span>Pan Number</span><span>GYJKL1234W</span></li><li class="d-flex justify-content-between align-items-center li-1 px-0 py-1 border-top" style="border-top: 1px dashed black; font-size: 14px;"><span>Aadhar Number</span><span>2022 5468 3466</span></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
else {
|
||||
html = '<div id="widget_details_' + obj[0].PortletWidgetId + '" class="card h-160p shadow-hover mb-0">' +
|
||||
'<div class="card-header card-header-action border-bottom-0 px-20">' +
|
||||
'<span id="hf-widget-title_' + obj[0].PortletWidgetId + '" class="biz-highlight-bg-color">' + title + '</span>' +
|
||||
'<div class="d-flex align-items-center card-action-wrap" id="singleColumnEditIcon_' + obj[0].PortletWidgetId + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="card-body pt-5">' +
|
||||
'<div class="row biz-transparent-text-color">' +
|
||||
'<div class="col-sm-12">' +
|
||||
'<ul class="list-group list-group-flush " id="widget_details_' + obj[0].PortletWidgetId + '_col">' +
|
||||
'<li class="list-group-item hidden" id="widget_details_item' + obj[0].PortletWidgetId + '_col"></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters, _portletwidgetid) {
|
||||
let instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getDetailWidgetData(parameters).then(function (response) {
|
||||
if (_portletwidgetid == undefined) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (_portletwidgetid != 0) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(_portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, detailContainer, parameters, IsPreview, result, portletresponse) {
|
||||
detailContainer = '.' + detailContainer;
|
||||
var instance = this, list = '', labelArray1 = [];
|
||||
var properties = result.result.DetailWidgetProperties;
|
||||
var cssproperty;
|
||||
if (portletresponse != undefined) {
|
||||
if (portletresponse.result.PortletWidgetCss != null && portletresponse.result.PortletWidgetCss != '') {
|
||||
cssproperty = JSON.parse(portletresponse.result.PortletWidgetCss);
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(result.result.CssProperty);
|
||||
}
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(result.result.CssProperty);
|
||||
}
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid).removeClass('h-160p').css({ "background-color": cssproperty[0].BackgroundColor, "border": cssproperty[0].DetailsBorderWidth + ' ' + cssproperty[0].DetailsBorderType + ' ' + cssproperty[0].DetailsBorderColor, "border-radius": cssproperty[0].DetailsBorderRadius });
|
||||
let borderTop = cssproperty[0].BorderWidth + ' ' + cssproperty[0].BorderType + ' ' + cssproperty[0].BorderColor;
|
||||
let icon = '';
|
||||
let onlickurl = "";
|
||||
let iconhtml = '';
|
||||
if (result.result.AppConfiguration != null && result.result.AppConfiguration.AppConfigurationId != '' && result.result.AppConfiguration.AppConfigurationId != undefined) {
|
||||
if (result.result.AppConfiguration.AppConfigurationId != 0) {
|
||||
onlickurl = instance.load_appconfigurations(result.result.AppConfiguration, result.result.Data, portletwidgetid);
|
||||
iconhtml = '<a href="javascript:;" class="btn-icon" onclick="' + onlickurl + '"> <i class="' + result.result.AppConfiguration.Icon + '"></i></a>';
|
||||
$("#singleColumnEditIcon_" + portletwidgetid).html(iconhtml);
|
||||
}
|
||||
else
|
||||
iconhtml = '<a href="javascript:;" class="btn-icon" onclick="' + onlickurl + '"> <i class="' + icon + '"></i></a>';
|
||||
}
|
||||
iconhtml = Unibase.Core.Helpers.PropertyHelper.Instance().replace(iconhtml, result.result.Data[0]);
|
||||
$("#singleColumnEditIcon_" + portletwidgetid).html(iconhtml);
|
||||
var tokenarray = [];
|
||||
var labelarray = [];
|
||||
var propertyarray = [];
|
||||
var HyperLink = [];
|
||||
var arraylength = 0;
|
||||
for (var i = 0; i < properties.length; i++) {
|
||||
var model = properties[i];
|
||||
var propertyindex = model.PropertyIndex;
|
||||
if (model.Value != null) {
|
||||
if (model.ConverterType == 2) {
|
||||
var format = model.ConverterValue;
|
||||
if (model.ConverterValue == null || model.ConverterValue == "")
|
||||
format = "DD/MM/YYYY";
|
||||
var token = "Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDate1('" + model.Value + "'," + format + ")";
|
||||
}
|
||||
else if (model.ConverterType == 1) {
|
||||
var format = model.ConverterValue;
|
||||
if (model.ConverterValue == null || model.ConverterValue == "")
|
||||
format = "2";
|
||||
var token = "Unibase.Core.Helpers.NumberHelper.Instance().roundNumber('" + model.Value + "'," + format + ")";
|
||||
}
|
||||
else {
|
||||
var token = model.Value;
|
||||
}
|
||||
}
|
||||
labelarray.push(model.Label);
|
||||
tokenarray.push(token);
|
||||
propertyarray.push(propertyindex);
|
||||
HyperLink.push(model.HyperLink);
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
if (arraylength % 2 === 0) {
|
||||
arraylength = arraylength;
|
||||
}
|
||||
else {
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
var arrayindex = (arraylength);
|
||||
var slicedarray = tokenarray.splice(0, arrayindex);
|
||||
var labelslice = labelarray.splice(0, arrayindex);
|
||||
var propertyslice = propertyarray.splice(0, arrayindex);
|
||||
for (var k = 0; k < propertyslice.length; k++) {
|
||||
for (var i = k; i <= k; i++) {
|
||||
var model = properties[i];
|
||||
for (var j = i; j <= i; j++) {
|
||||
var replace = slicedarray[i];
|
||||
var data = result.result.Data[0];
|
||||
let token = Unibase.Core.Helpers.PropertyHelper.Instance().replace(replace, data);
|
||||
if (model.ConverterType == 3) {
|
||||
token = moment(token).format('LT');
|
||||
}
|
||||
if (token == "" || token == "null" || token == "Invalid date" || token == "1900/01/01" || token == "01/01/1900" || token == "[object Object]" || token == " " || token == "01/01/0001" || token == "0001/01/01") {
|
||||
token = "NA";
|
||||
}
|
||||
if (data == undefined) {
|
||||
token = "NA";
|
||||
}
|
||||
if (result.result.Js != null || result.result.Js != "") {
|
||||
eval(result.result.Js);
|
||||
}
|
||||
if (HyperLink[propertyslice[k]] != null && HyperLink[propertyslice[k]] != "") {
|
||||
var HL = Unibase.Core.Helpers.TokenHelper.Instance().replace(HyperLink[propertyslice[k]], data);
|
||||
var href = "javascript:;";
|
||||
var target = "";
|
||||
if (HyperLink[propertyslice[k]].includes('href')) {
|
||||
var target = "target='_blank'";
|
||||
href = HyperLink[propertyslice[k]].replace(/href=/, '').replace('{{url}}', token);
|
||||
HL = '';
|
||||
}
|
||||
token = '<u class="text-primary"><a href=' + href + ' ' + target + ' onclick="' + HL + '"><font class="text-ul">' + token + '</font></a></u>';
|
||||
}
|
||||
if (labelslice[j] != '') {
|
||||
list += '<li class="Singlecolumn-listgroup-item Singlecolumn-listgroup-addeditem li-' + propertyslice[k] + ' px-0 py-2 detailProperty_' + portletwidgetid + '"><div class="d-flex flex-wrap justify-content-between align-items-center"><span class="label_name">' + labelslice[j] + '</span><span class="">' + token + '</span></div></li>';
|
||||
}
|
||||
else {
|
||||
labelArray1.push(labelslice[j]);
|
||||
list += '<li class="Singlecolumn-listgroup-item Singlecolumn-listgroup-addeditem li-' + propertyslice[k] + ' px-0 py-2 detailProperty_' + portletwidgetid + '"><div class="d-flex flex-wrap justify-content-between align-items-center"><span class="pr-0 text-left">' + token + '</span></div></div></li>';
|
||||
}
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col`).html(list);
|
||||
if (screen.width < 1198 && (cssproperty[0].FontSize == '14px' || cssproperty[0].FontSize == 14)) {
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col li`).css({ "border-top": borderTop, "font-size": '11px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col li`).css({ "border-top": borderTop, "font-size": cssproperty[0].FontSize + 'px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
}
|
||||
if (labelArray1.length == j) {
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col`).removeClass('px-3');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cssproperty[0].IsDetailsHeader != undefined && cssproperty[0].IsDetailsHeader == true) {
|
||||
$("#hf-widget-title_" + portletwidgetid).parent('.card-header').remove();
|
||||
}
|
||||
$(detailContainer).siblings('.line-loader').remove();
|
||||
$(detailContainer).removeClass('hidden');
|
||||
}
|
||||
load_appconfigurations(config, data, portletwidgetid) {
|
||||
var instance = this;
|
||||
let settingurltype = config.SettingUrlType;
|
||||
var appconfigurationid = config.AppConfigurationId;
|
||||
var settingUrl = config.SettingUrl;
|
||||
var jsfunction = config.JsFunction;
|
||||
var formid = config.FormId;
|
||||
let editformid;
|
||||
var formpkname = config.FormPrimaryColumn;
|
||||
if (data.length <= 0) {
|
||||
editformid = 0;
|
||||
}
|
||||
else if (formpkname != "" && formpkname != null) {
|
||||
editformid = "{{" + formpkname + "}}";
|
||||
}
|
||||
else
|
||||
editformid = 0;
|
||||
var onclick = "";
|
||||
if (settingurltype == 2) {
|
||||
onclick = "this.fileCacheHelper.loadJsFile('" + config.SettingUrl + "', function () {var html = Unibase.Apps.Components.Stages.Instance().init();NavigationHelper.Instance().loadPopupHtml(html, Helpers.Size.DockLeft, function(containerid) {" + config.JsFunction + " ;});});";
|
||||
}
|
||||
else if (settingurltype == 1) {
|
||||
onclick = 'Unibase.Platform.Helpers.NavigationHelper.Instance().loadForm(' + formid + ', ' + editformid + ',' + appconfigurationid + ',' + portletwidgetid + ' )';
|
||||
}
|
||||
else if (settingurltype == 3) {
|
||||
let variablename = "Widget_" + config.SettingUrl.split(",")[0].split(".")[0].trim();
|
||||
let methodname = config.SettingUrl.split(",")[1];
|
||||
var onclickurl = "Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('Widgets/" + config.SettingUrl.split(",")[0] + "', function () { " + variablename + "." + methodname + " });";
|
||||
onclick = onclickurl;
|
||||
}
|
||||
return onclick;
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new SingleColumn();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
DetailWidgets.SingleColumn = SingleColumn;
|
||||
})(DetailWidgets = Compact.DetailWidgets || (Compact.DetailWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,273 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let DetailWidgets;
|
||||
(function (DetailWidgets) {
|
||||
class SingleColumnNoBorder extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(obj, containerid) {
|
||||
var title = obj[0].WidgetName, html = "";
|
||||
if (obj[0].PortletWidgetId == 22501) {
|
||||
html = '<div id="widget_details_' + obj[0].PortletWidgetId + '" class="card h-160p shadow-hover mb-0">' +
|
||||
'<div class="card-header card-header-action border-bottom-0 px-20">' +
|
||||
'<span id="hf-widget-title_' + obj[0].PortletWidgetId + '" class="biz-highlight-bg-color">' + title + '</span>' +
|
||||
'<div class="d-flex align-items-center card-action-wrap" id="singleColumnEditIcon_' + obj[0].PortletWidgetId + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="card-body pt-5">' +
|
||||
'<div class="row biz-transparent-text-color">' +
|
||||
'<div class="col-sm-12">' +
|
||||
'<ul class="list-group list-group-flush px-3" id="widget_details_' + obj[0].PortletWidgetId + '_col">' +
|
||||
'<li class="list-group-item hidden" id="widget_details_item' + obj[0].PortletWidgetId + '_col"></li>' +
|
||||
'<li class="d-flex flex-column li-1 p-0"><span class="text-light-60 py-1">Pan Number</span><span>GYJKL1234W</span></li><li class="d-flex flex-column li-1 px-0 py-1"><span class="text-light-60 py-1">Aadhar Number</span><span>2022 5468 3466</span></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
else {
|
||||
html = '<div id="widget_details_' + obj[0].PortletWidgetId + '" class="card h-160p shadow-hover mb-0">' +
|
||||
'<div class="card-header card-header-action border-bottom-0 px-20">' +
|
||||
'<span id="hf-widget-title_' + obj[0].PortletWidgetId + '" class="biz-highlight-bg-color">' + title + '</span>' +
|
||||
'<div class="d-flex align-items-center card-action-wrap" id="singleColumnEditIcon_' + obj[0].PortletWidgetId + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="card-body pt-5">' +
|
||||
'<div class="row biz-transparent-text-color">' +
|
||||
'<div class="col-sm-12">' +
|
||||
'<ul class="list-group list-group-flush " id="widget_details_' + obj[0].PortletWidgetId + '_col">' +
|
||||
'<li class="list-group-item hidden" id="widget_details_item' + obj[0].PortletWidgetId + '_col"></li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters, _portletwidgetid) {
|
||||
let instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getDetailWidgetData(parameters).then(function (response) {
|
||||
if (_portletwidgetid == undefined) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (_portletwidgetid != 0) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(_portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, detailContainer, parameters, IsPreview, result, portletresponse) {
|
||||
detailContainer = '.' + detailContainer;
|
||||
var instance = this, list = '', labelArray1 = [];
|
||||
var properties = result.result.DetailWidgetProperties;
|
||||
var cssproperty;
|
||||
if (portletresponse != undefined) {
|
||||
if (portletresponse.result.PortletWidgetCss != null && portletresponse.result.PortletWidgetCss != '') {
|
||||
cssproperty = JSON.parse(portletresponse.result.PortletWidgetCss);
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(result.result.CssProperty);
|
||||
}
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(result.result.CssProperty);
|
||||
}
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid).removeClass('h-160p').css({ "background-color": cssproperty[0].BackgroundColor, "border": cssproperty[0].DetailsBorderWidth + ' ' + cssproperty[0].DetailsBorderType + ' ' + cssproperty[0].DetailsBorderColor, "border-radius": cssproperty[0].DetailsBorderRadius });
|
||||
let borderTop = cssproperty[0].BorderWidth + ' ' + cssproperty[0].BorderType + ' ' + cssproperty[0].BorderColor;
|
||||
let icon = '';
|
||||
let onlickurl = "";
|
||||
let iconhtml = '';
|
||||
if (result.result.AppConfiguration != null && result.result.AppConfiguration.AppConfigurationId != '' && result.result.AppConfiguration.AppConfigurationId != undefined) {
|
||||
if (result.result.AppConfiguration.AppConfigurationId != 0) {
|
||||
onlickurl = instance.load_appconfigurations(result.result.AppConfiguration, result.result.Data, portletwidgetid);
|
||||
iconhtml = '<a href="javascript:;" class="btn-icon" onclick="' + onlickurl + '"> <i class="' + result.result.AppConfiguration.Icon + '"></i></a>';
|
||||
$("#singleColumnEditIcon_" + portletwidgetid).html(iconhtml);
|
||||
}
|
||||
else
|
||||
iconhtml = '<a href="javascript:;" class="btn-icon" onclick="' + onlickurl + '"> <i class="' + icon + '"></i></a>';
|
||||
}
|
||||
iconhtml = Unibase.Core.Helpers.PropertyHelper.Instance().replace(iconhtml, result.result.Data[0]);
|
||||
$("#singleColumnEditIcon_" + portletwidgetid).html(iconhtml);
|
||||
var tokenarray = [];
|
||||
var labelarray = [];
|
||||
var propertyarray = [];
|
||||
var HyperLink = [];
|
||||
var arraylength = 0;
|
||||
for (var i = 0; i < properties.length; i++) {
|
||||
var model = properties[i];
|
||||
var propertyindex = model.PropertyIndex;
|
||||
if (model.Value != null) {
|
||||
if (model.ConverterType == 2) {
|
||||
var format = model.ConverterValue;
|
||||
if (model.ConverterValue == null || model.ConverterValue == "")
|
||||
format = "DD/MM/YYYY";
|
||||
var token = "Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDate1('" + model.Value + "'," + format + ")";
|
||||
}
|
||||
else if (model.ConverterType == 1) {
|
||||
var format = model.ConverterValue;
|
||||
if (model.ConverterValue == null || model.ConverterValue == "")
|
||||
format = "2";
|
||||
var token = "Unibase.Core.Helpers.NumberHelper.Instance().roundNumber('" + model.Value + "'," + format + ")";
|
||||
}
|
||||
else {
|
||||
var token = model.Value;
|
||||
}
|
||||
}
|
||||
labelarray.push(model.Label);
|
||||
tokenarray.push(token);
|
||||
propertyarray.push(propertyindex);
|
||||
HyperLink.push(model.HyperLink);
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
if (arraylength % 2 === 0) {
|
||||
arraylength = arraylength;
|
||||
}
|
||||
else {
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
var arrayindex = (arraylength);
|
||||
var slicedarray = tokenarray.splice(0, arrayindex);
|
||||
var labelslice = labelarray.splice(0, arrayindex);
|
||||
var propertyslice = propertyarray.splice(0, arrayindex);
|
||||
for (var k = 0; k < propertyslice.length; k++) {
|
||||
for (var i = k; i <= k; i++) {
|
||||
var model = properties[i];
|
||||
for (var j = i; j <= i; j++) {
|
||||
var replace = slicedarray[i];
|
||||
var data = result.result.Data[0];
|
||||
let token = HtmlHelper.getHelper().decode(Unibase.Core.Helpers.PropertyHelper.Instance().replace(replace, data));
|
||||
if (token == "" || token == "null" || token == "Invalid date" || token == "1900/01/01" || token == "01/01/1900" || token == "[object Object]" || token == " " || token == "01/01/0001" || token == "0001/01/01") {
|
||||
token = "NA";
|
||||
}
|
||||
if (model.ConverterType == 3) {
|
||||
token = moment(token).format('LT');
|
||||
}
|
||||
if (data == undefined) {
|
||||
token = "NA";
|
||||
}
|
||||
if (result.result.Js != null || result.result.Js != "") {
|
||||
eval(result.result.Js);
|
||||
}
|
||||
if (HyperLink[propertyslice[k]] != null && HyperLink[propertyslice[k]] != "") {
|
||||
var HL = Unibase.Core.Helpers.TokenHelper.Instance().replace(HyperLink[propertyslice[k]], data);
|
||||
var href = "javascript:;";
|
||||
var target = "";
|
||||
if (HyperLink[propertyslice[k]].includes('href')) {
|
||||
var target = "target='_blank'";
|
||||
href = HyperLink[propertyslice[k]].replace(/href=/, '');
|
||||
HL = '';
|
||||
}
|
||||
token = '<u class="text- primary"><a href=' + href + ' ' + target + ' onclick="' + HL + '"><font class="text-ul">' + token + '</font></a></u>';
|
||||
}
|
||||
if (labelslice[j] != '') {
|
||||
list += '<li class="Singlecolumn-listgroup-item Singlecolumn-listgroup-addeditem li-' + propertyslice[k] + ' px-0 py-1 detailProperty_' + portletwidgetid + '"><div class="d-flex flex-column"><span class="text-light-60 py-1">' + labelslice[j] + '</span><span>' + token + '</span></div></div></li>';
|
||||
}
|
||||
else {
|
||||
labelArray1.push(labelslice[j]);
|
||||
list += '<li class="Singlecolumn-listgroup-item Singlecolumn-listgroup-addeditem li-' + propertyslice[k] + ' px-0 py-1 detailProperty_' + portletwidgetid + '"><div class="d-flex flex-column"><span class="pr-0 text-left">' + token + '</span></div></div></li>';
|
||||
}
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col`).html(list);
|
||||
if (screen.width < 1198 && (cssproperty[0].FontSize == '14px' || cssproperty[0].FontSize == 14)) {
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col li`).css({ "border-top": borderTop, "font-size": '11px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col li`).css({ "border-top": borderTop, "font-size": cssproperty[0].FontSize + 'px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor, "list-style-type": cssproperty[0].ListStyleType });
|
||||
}
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col li:first`).css({ "border-top": "0px solid black" });
|
||||
}
|
||||
if (labelArray1.length == j) {
|
||||
$(detailContainer).find(`#widget_details_${portletwidgetid}_col`).removeClass('px-3');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cssproperty[0].IsDetailsHeader != undefined && cssproperty[0].IsDetailsHeader == true) {
|
||||
$("#hf-widget-title_" + portletwidgetid).parent('.card-header').remove();
|
||||
}
|
||||
$(detailContainer).siblings('.line-loader').remove();
|
||||
$(detailContainer).removeClass('hidden');
|
||||
}
|
||||
load_appconfigurations(config, data, portletwidgetid) {
|
||||
var instance = this;
|
||||
let settingurltype = config.SettingUrlType;
|
||||
var appconfigurationid = config.AppConfigurationId;
|
||||
var settingUrl = config.SettingUrl;
|
||||
var jsfunction = config.JsFunction;
|
||||
var formid = config.FormId;
|
||||
let editformid;
|
||||
var formpkname = config.FormPrimaryColumn;
|
||||
if (data.length <= 0) {
|
||||
editformid = 0;
|
||||
}
|
||||
else if (formpkname != "" && formpkname != null) {
|
||||
editformid = "{{" + formpkname + "}}";
|
||||
}
|
||||
else
|
||||
editformid = 0;
|
||||
var onclick = "";
|
||||
if (settingurltype == 2) {
|
||||
onclick = "this.fileCacheHelper.loadJsFile('" + config.SettingUrl + "', function () {var html = Unibase.Apps.Components.Stages.Instance().init();NavigationHelper.Instance().loadPopupHtml(html, Helpers.Size.DockLeft, function(containerid) {" + config.JsFunction + " ;});});";
|
||||
}
|
||||
else if (settingurltype == 1) {
|
||||
onclick = 'Unibase.Platform.Helpers.NavigationHelper.Instance().loadForm(' + formid + ', ' + editformid + ',' + appconfigurationid + ',' + portletwidgetid + ' )';
|
||||
}
|
||||
else if (settingurltype == 3) {
|
||||
let variablename = "Widget_" + config.SettingUrl.split(",")[0].split(".")[0].trim();
|
||||
let methodname = config.SettingUrl.split(",")[1];
|
||||
var onclickurl = "Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('Widgets/" + config.SettingUrl.split(",")[0] + "', function () { " + variablename + "." + methodname + " });";
|
||||
onclick = onclickurl;
|
||||
}
|
||||
return onclick;
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new SingleColumnNoBorder();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
DetailWidgets.SingleColumnNoBorder = SingleColumnNoBorder;
|
||||
})(DetailWidgets = Compact.DetailWidgets || (Compact.DetailWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,224 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let DetailWidgets;
|
||||
(function (DetailWidgets) {
|
||||
class SingleData extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(obj, containerid) {
|
||||
let title = obj[0].WidgetName;
|
||||
let html = '<div id="widget_details_' + obj[0].PortletWidgetId + '" class="card shadow-hover mb-0">' +
|
||||
'<div class="card-header border-0 card-header-action pl-10"><strong><span class="biz-highlight-bg-color" id="hf-widget-title_' + obj[0].PortletWidgetId + '" >' + title + '</span></strong><div class="d-flex align-items-center card-action-wrap"><div class="d-flex" id="div_detail_addnew_' + obj[0].PortletWidgetId + '"></div></div></div>' +
|
||||
'<div class="card-body pt-5 pl-10 ">' +
|
||||
'<div class="row">' +
|
||||
'<div class="col-12 ">' +
|
||||
'<div class="no-borders list-group-flush" id="widget_details_' + obj[0].PortletWidgetId + '_col1" style="border-top: none;">' +
|
||||
'<div class="no-borders hidden" id="widget_details_item' + obj[0].PortletWidgetId + '_col1"></div>' +
|
||||
'<div class="d-flex justify-content-between align-items-center li-undefined px-0 pt-1 pb-2" style="border-top: none;"><div style="width: 100%; overflow-wrap: break-word; border-top: 3px none rgb(102, 64, 178); font-size: 14px;"><span>Single Data</span></div></div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters, _portletwidgetid) {
|
||||
let instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getDetailWidgetData(parameters).then(function (response) {
|
||||
if (_portletwidgetid == undefined) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (_portletwidgetid != 0) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(_portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, detailContainer, parameters, IsPreview, result, portletresponse) {
|
||||
detailContainer = '.' + detailContainer;
|
||||
var instance = this;
|
||||
var properties = result.result.DetailWidgetProperties;
|
||||
var cssproperty;
|
||||
if (portletresponse != undefined) {
|
||||
if (portletresponse.result.PortletWidgetCss != null && portletresponse.result.PortletWidgetCss != '') {
|
||||
cssproperty = JSON.parse(portletresponse.result.PortletWidgetCss);
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(result.result.CssProperty);
|
||||
}
|
||||
}
|
||||
else {
|
||||
cssproperty = JSON.parse(result.result.CssProperty);
|
||||
}
|
||||
var tokenarray = [];
|
||||
var labelarray = [];
|
||||
var propertyarray = [];
|
||||
var HyperLink = [];
|
||||
var arraylength = 0;
|
||||
let borderTop = cssproperty[0].BorderWidth + ' ' + cssproperty[0].BorderType + ' ' + cssproperty[0].BorderColor;
|
||||
for (var i = 0; i < properties.length; i++) {
|
||||
var model = properties[i];
|
||||
var propertyindex = model.PropertyIndex;
|
||||
if (model.Value != null) {
|
||||
var token = model.Value.replace(/\s/g, "");
|
||||
}
|
||||
labelarray.push(model.Label);
|
||||
tokenarray.push(token);
|
||||
propertyarray.push(propertyindex);
|
||||
HyperLink.push(model.HyperLink);
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
if (arraylength % 2 === 0) {
|
||||
arraylength = arraylength;
|
||||
}
|
||||
else {
|
||||
arraylength = arraylength + 1;
|
||||
}
|
||||
var arrayindex = (arraylength);
|
||||
var slicedarray = tokenarray.splice(0, arrayindex);
|
||||
var propertyslice = propertyarray;
|
||||
for (var k = 0; k < propertyarray.length; k++) {
|
||||
for (var i = k; i <= k; i++) {
|
||||
var model = properties[i];
|
||||
for (var j = i; j <= i; j++) {
|
||||
var replace = slicedarray[i];
|
||||
var data = result.result.Data[0];
|
||||
let token = "NA";
|
||||
if (data != undefined) {
|
||||
token = Unibase.Core.Helpers.PropertyHelper.Instance().replace(replace, data);
|
||||
if (model.ConverterType == 3) {
|
||||
token = moment(token).format('LT');
|
||||
}
|
||||
if (token == "" || token == " " || token == "<p><br></p>" || token == "null" || token == "Invalid date" || token == "1900/01/01" || token == "01/01/1900" || token == "[object Object]" || token == " " || token == "01/01/0001" || token == "0001/01/01" || token == undefined) {
|
||||
token = "NA";
|
||||
}
|
||||
if (HyperLink[propertyslice[k]] != null && HyperLink[propertyslice[k]] != "") {
|
||||
var HL = Unibase.Core.Helpers.TokenHelper.Instance().replace(HyperLink[propertyslice[k]], data);
|
||||
token = '<a onclick="' + HL + '"><font class="text-ul">' + token + '</font></a>';
|
||||
}
|
||||
}
|
||||
var text;
|
||||
try {
|
||||
if (token != undefined && token != null && token != "") {
|
||||
text = HtmlHelper.getHelper().decode(token);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
text = token;
|
||||
}
|
||||
let templateData = $('.portletwidget-item[data-widgetname="Template Text"]').length;
|
||||
let ModalHtml;
|
||||
if (templateData == 1) {
|
||||
debugger;
|
||||
if ($(window).width() < 767) {
|
||||
var list1 = '<div class="detailDesciption-listgroup-item detailDesciption-listgroup-addeditem d-flex justify-content-between align-items-center p-0 li-' + tokenarray[i] + '" style="border-top: none;"><div class="w-100 pl-1 py-1 detailProperty_' + portletwidgetid + '" style="word-wrap: break-word;"><span class="template__text p-0"><a class="btn preview_templateText_mobile btn btn-outline-primary"><i class="fa fa-eye" aria-hidden="true"></i></a><a class="Edit_templateText_mobile btn-outline-primary btn mx-2"><i class="fa fa-pencil" aria-hidden="true"></i></a></span></div></div>';
|
||||
ModalHtml = `<div class="modal fade" id="TemplateTextmobile" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog modal-lg modal-dialog-centered " role="document"> <div class="modal-content rounded-10 text-center bg-white"> <div class="modal-header" style="border-style: dashed;"> <h5 class="modal-title ml-auto">Template Text</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true" class="badge badge-soft-danger font-20 rounded-circle pb-2 px-2">×</span> </button> </div><div class="modal-body templatetext_body text-center p-2 pb-30 biz-custom-scrollbar h-100vh"> ` + text + ` </div></div></div></div>`;
|
||||
}
|
||||
else {
|
||||
var list1 = '<div class="detailDesciption-listgroup-item detailDesciption-listgroup-addeditem d-flex justify-content-between align-items-center p-0 li-' + tokenarray[i] + '" style="border-top: none;"><div class="w-100 py-1 detailProperty_' + portletwidgetid + '" style="word-wrap: break-word;"><span class="template__text p-0">' + text + '</span></div></div>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
var list1 = '<div class="detailDesciption-listgroup-item detailDesciption-listgroup-addeditem d-flex justify-content-between align-items-center p-0 li-' + tokenarray[i] + '" style="border-top: none;"><div class="w-100 py-1 detailProperty_' + portletwidgetid + '" style="word-wrap: break-word;"><span>' + text + '</span></div></div>';
|
||||
}
|
||||
$(detailContainer).find('#widget_details_item' + portletwidgetid + '_col1:first').next().remove();
|
||||
$(detailContainer).find('#widget_details_item' + portletwidgetid + '_col1:last').after(list1);
|
||||
$('.preview_templateText_mobile').click(function () {
|
||||
$("#_bizgaze_modal").html(ModalHtml);
|
||||
$('#TemplateTextmobile').modal();
|
||||
$('.templatetext_body *').css('font-size', '12px');
|
||||
});
|
||||
$('.Edit_templateText_mobile').click(function () {
|
||||
$('#btn_EditTemplate').trigger('click');
|
||||
});
|
||||
console.log(cssproperty[0].FontSize);
|
||||
if (screen.width < 1198 && (cssproperty[0].FontSize == '14px' || cssproperty[0].FontSize == 14)) {
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid + '_col1').find('.detailProperty_' + portletwidgetid).css({ "border-top": borderTop, "font-size": '11px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor });
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid + '_col1').find('.detailProperty_' + portletwidgetid).css({ "border-top": borderTop, "font-size": cssproperty[0].FontSize + 'px', "font-family": cssproperty[0].FontStyle, "background-color": cssproperty[0].BackgroundColor });
|
||||
}
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid).css({ "background-color": cssproperty[0].BackgroundColor });
|
||||
$(detailContainer).find('#widget_details_' + portletwidgetid + '_col1').find('.detailDesciption-listgroup-item').css({ "background-color": cssproperty[0].BackgroundColor });
|
||||
$(".detailDesciption-listgroup-item.detailDesciption-listgroup-addeditem").find("img").addClass("descimg img-fluid");
|
||||
$(".descimg").click(function () {
|
||||
if (screen.width < 1198) {
|
||||
let imgsrc = $(this).attr("src");
|
||||
let ModalHtml = ` <div class="modal fade" id="sessionsModal" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered " role="document" >
|
||||
<div class="modal-content rounded-10 text-center bg-white" >
|
||||
<div class="modal-header pa-15">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<div id="cmnDateFilterModalErrMsg" class="form-error-message ml-0 l-0"></div>
|
||||
</div>
|
||||
<div class="modal-body sessiontimeoutmodal text-center pb-30">
|
||||
<img src="` + imgsrc + `" class="img-fluid">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$("#_bizgaze_modal").append(ModalHtml);
|
||||
$('#sessionsModal').modal();
|
||||
$(`#newAccountFormCloseBtns`).off().click(function () {
|
||||
instance.navigationHelper.closePopUp();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
$(detailContainer).siblings('.line-loader').remove();
|
||||
$(detailContainer).removeClass('hidden');
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new SingleData();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
DetailWidgets.SingleData = SingleData;
|
||||
})(DetailWidgets = Compact.DetailWidgets || (Compact.DetailWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,144 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class CarouselSlider extends Unibase.Platform.Core.BaseComponent {
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName;
|
||||
var html = '<div class="card mb-0 card-sm" id="widget_kpis_2" style="height:120px;">' +
|
||||
'<div class="card-body">' +
|
||||
'<div id="sales_slider_' + id[0].PortletWidgetId + '" class="carousel slide" data-ride="carousel">' +
|
||||
'<div class="d-flex justify-content-between align-items-center">' +
|
||||
'<span class="d-block font-14 font-weight-400 text-dark mt-5" id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '">' + title + '</span> ' +
|
||||
'<div class="btn-group border-0 ml-20">' +
|
||||
'<div class="sw-carousel-slider-control">' +
|
||||
'<a class="text-dark carousel-control-prev" href="#sales_slider_' + id[0].PortletWidgetId + '" data-slide="prev">' +
|
||||
'<i class="fa fa-angle-left"></i>' +
|
||||
'</a>' +
|
||||
'<p class="carousel-status" id="CarouselStatus"></p>' +
|
||||
'<a class="text-dark carousel-control-next" href="#sales_slider_' + id[0].PortletWidgetId + '" data-slide="next">' +
|
||||
'<i class="fa fa-angle-right"></i>' +
|
||||
'</a>' +
|
||||
'<span id="config_widget_' + id[0].PortletWidgetId + '"></span>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="carousel-inner"><div class="carousel-item carouselItem_0"><div class="d-block align-items-end justify-content-between"><div class="mt-10"><span class="d-block font-weight-500 text-dark"><span class="text-uppercase font-11 font-weight-500 text-dark">236</span><span class="d-block text-dark font-weight-500 pull-right font-14">Lead</span></span><span class="text-light" style="font-size:10px;margin-top:-10px;"></span></div><div class="pull-right ml-20" style="margin-top:5px"><a href="#" class="pull-right"> <small id="showreport_100020390001754" class="showreport_100020390001754 font-sm-11">Show Report</small></a></div></div></div><div class="carousel-item carouselItem_1"><div class="d-block align-items-end justify-content-between"><div class="mt-10"><span class="d-block font-weight-500 text-dark"><span class="text-uppercase font-11 font-weight-500 text-dark">16</span><span class="d-block text-dark font-weight-500 pull-right font-14">Qualify</span></span><span class="text-light" style="font-size:10px;margin-top:-10px;"></span></div><div class="pull-right ml-20" style="margin-top:5px"><a href="#" class="pull-right"> <small id="showreport_100020390001754" class="showreport_100020390001754 font-sm-11">Show Report</small></a></div></div></div><div class="carousel-item carouselItem_2"><div class="d-block align-items-end justify-content-between"><div class="mt-10"><span class="d-block font-weight-500 text-dark"><span class="text-uppercase font-11 font-weight-500 text-dark">331</span><span class="d-block text-dark font-weight-500 pull-right font-14">Total Customers</span></span><span class="text-light" style="font-size:10px;margin-top:-10px;"></span></div><div class="pull-right ml-20" style="margin-top:5px"><a href="#" class="pull-right"> <small id="showreport_100020390001754" class="showreport_100020390001754 font-sm-11">Show Report</small></a></div></div></div><div class="carousel-item carouselItem_3"><div class="d-block align-items-end justify-content-between"><div class="mt-10"><span class="d-block font-weight-500 text-dark"><span class="text-uppercase font-11 font-weight-500 text-dark">75</span><span class="d-block text-dark font-weight-500 pull-right font-14">Confirmed</span></span><span class="text-light" style="font-size:10px;margin-top:-10px;"></span></div><div class="pull-right ml-20" style="margin-top:5px"><a href="#" class="pull-right"> <small id="showreport_100020390001754" class="showreport_100020390001754 font-sm-11">Show Report</small></a></div></div></div><div class="carousel-item carouselItem_4 active"><div class="d-block align-items-end justify-content-between"><div class="mt-10"><span class="d-block font-weight-500 text-dark"><span class="text-uppercase font-11 font-weight-500 text-dark">3</span><span class="d-block text-dark font-weight-500 pull-right font-14">Rejected</span></span><span class="text-light" style="font-size:10px;margin-top:-10px;"></span></div><div class="pull-right ml-20" style="margin-top:5px"><a href="#" class="pull-right"> <small id="showreport_100020390001754" class="showreport_100020390001754 font-sm-11">Show Report</small></a></div></div></div></div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
return html;
|
||||
}
|
||||
jsFiles() {
|
||||
return ["platform/widgets/managers/interfaces/iwidgetmanager.js",
|
||||
"platform/widgets/managers/widgetmanager.js",
|
||||
"platform/core/helpers/propertyhelper/propertyhelper.js",
|
||||
"platform/core/helpers/token/tokenhelper.js",
|
||||
"platform/core/helpers/numberhelper/numberhelper.js",
|
||||
"platform/analytics/components/reportviewer/reportviewer.js",
|
||||
];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters) {
|
||||
let instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKpiWidgetData(parameters).then(function (response) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, containerid, parameters, IsPreview, response) {
|
||||
containerid = "." + containerid;
|
||||
var instance = this;
|
||||
debugger;
|
||||
if (response.result != null) {
|
||||
var post = response.result;
|
||||
var data = JSON.parse(post.Data);
|
||||
var obj = new Object();
|
||||
var parentobj = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var data_1 = data[i];
|
||||
var j = 1;
|
||||
for (var key in data_1) {
|
||||
obj['Value_' + j] = data_1[key];
|
||||
j++;
|
||||
}
|
||||
parentobj.push({
|
||||
value_1: obj["Value_1"],
|
||||
value_2: obj["Value_2"],
|
||||
value_3: obj["Value_3"]
|
||||
});
|
||||
var margin = "margin-top:-5px";
|
||||
if (parentobj[i].value_3 == undefined || parentobj[i].value_3 == null) {
|
||||
parentobj[i].value_3 = "";
|
||||
margin = "margin-top:5px";
|
||||
}
|
||||
}
|
||||
var html = "";
|
||||
for (var i = 0; i < parentobj.length; i++) {
|
||||
html += '<div class="carousel-item carouselItem_' + i + '">' +
|
||||
'<div class="d-block align-items-end justify-content-between">' +
|
||||
'<div class="mt-10">' +
|
||||
'<span class="d-block font-weight-500 text-dark">' +
|
||||
'<span class="text-uppercase font-11 font-weight-500 text-dark">' + parentobj[i].value_2 + '</span>' +
|
||||
'<span class="d-block text-dark font-weight-500 pull-right font-14">' + parentobj[i].value_1 + '</span>' +
|
||||
'</span>' +
|
||||
'<span class="text-light" style="font-size:10px;margin-top:-10px;">' + parentobj[i].value_3 + '</span>' +
|
||||
'</div>' +
|
||||
'<div class="pull-right ml-20" style="' + margin + '">' +
|
||||
'<a href="#" class="pull-right" > <small id="showreport_' + portletwidgetid + '" class="showreport_' + portletwidgetid + ' font-sm-11">Show Report</small></a>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
$(containerid).find(".carousel-inner").html(html);
|
||||
$(containerid).find(".carouselItem_0").addClass('active');
|
||||
$(containerid).find('#sales_slider_' + portletwidgetid).carousel({
|
||||
interval: 3000
|
||||
});
|
||||
$(containerid).find('#sales_slider_' + portletwidgetid).carousel("cycle");
|
||||
var colors = ["primary", "success", "warning", "danger", "info", "light", "secondary", "dark"];
|
||||
}
|
||||
$(containerid).siblings('.line-loader').remove();
|
||||
$(containerid).removeClass('hidden');
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new CarouselSlider();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.CarouselSlider = CarouselSlider;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,119 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Carouselsliderbgcolor extends Unibase.Platform.Core.BaseComponent {
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName;
|
||||
var html = '<div class="mb-0 card-sm bgcolorset_' + id[0].PortletWidgetId + ' kpi_card_class_' + id[0].PortletWidgetId + '" style="background-color:#feec76; height:120px;border-radius:5px"><div class="card-body border-0 p-0"><div id="sales_slider_' + id[0].PortletWidgetId + '" class="carousel slide" data-ride="carousel"><div class="d-flex font-weight-500 text-dark px-3 py-2" style="border-bottom: 1px dashed black;"><div class="w-95 "> <span class="w-100 font-14 mt-5" id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '">' + title + '</span></div> <span class="w-15 text-right"><a href="javascript:;" class="pull-right reportappend"></a></span></div><div class="bottom-carousel px-3" style="margin-top:-11px"><div class="d-flex flex-row"><div class="carousel-inner w-85"><div class="carousel-item carouselItem_0 active"><div class="mt-10"> <span class="d-flex flex-column font-weight-500 text-dark"> <span class="textPropertyOwl_" style="font-size: 28px;">236</span> <span class="font-14 text-dark">Lead</span> </span></div></div><div class="carousel-item carouselItem_1"><div class="mt-10"> <span class="d-flex flex-column font-weight-500 text-dark"> <span class="textPropertyOwl_" style="font-size: 28px;">3</span> <span class="font-14 text-dark">Rejected</span> </span></div></div></div><div class="btn-group border-0 w-15"><div class="sw-carousel-slider-control mt-50 ml-auto"> <a class="text-dark p-2" href="#sales_slider_' + id[0].PortletWidgetId + '" data-slide="prev"> <i class="font-18 fa fa-angle-double-left"></i> </a><p class="carousel-status" id="CarouselStatus"></p> <a class="text-dark pl-2" href="#sales_slider_' + id[0].PortletWidgetId + '" data-slide="next"> <i class="font-18 fa fa-angle-double-right"></i> </a> <span id="config_widget_' + id[0].PortletWidgetId + '"></span></div></div></div></div></div></div></div>';
|
||||
return html;
|
||||
}
|
||||
jsFiles() {
|
||||
return ["platform/widgets/managers/interfaces/iwidgetmanager.js", "platform/widgets/managers/widgetmanager.js", "platform/core/helpers/propertyhelper/propertyhelper.js", "platform/core/helpers/token/tokenhelper.js", "platform/core/helpers/numberhelper/numberhelper.js", "platform/analytics/components/reportviewer/reportviewer.js"];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters) {
|
||||
let instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKpiWidgetData(parameters).then(function (response) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, containerid, parameters, IsPreview, response) {
|
||||
containerid = "." + containerid;
|
||||
var cssproperty = JSON.parse(response.result.CssProperty);
|
||||
var instance = this;
|
||||
if (response.result != null) {
|
||||
var post = response.result;
|
||||
var data = JSON.parse(post.Data);
|
||||
var obj = new Object();
|
||||
var parentobj = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var data_1 = data[i];
|
||||
var j = 1;
|
||||
for (var key in data_1) {
|
||||
obj['Value_' + j] = data_1[key];
|
||||
j++;
|
||||
}
|
||||
parentobj.push({
|
||||
value_1: obj["Value_1"],
|
||||
value_2: obj["Value_2"],
|
||||
value_3: obj["Value_3"]
|
||||
});
|
||||
var margin = "margin-top:-5px";
|
||||
if (parentobj[i].value_3 == undefined || parentobj[i].value_3 == null) {
|
||||
parentobj[i].value_3 = "";
|
||||
margin = "margin-top:5px";
|
||||
}
|
||||
}
|
||||
var html = "", html2 = "";
|
||||
for (var i = 0; i < parentobj.length; i++) {
|
||||
html += '<div class="carousel-item carouselItem_' + i + '"><div class="mt-20 d-flex flex-row align-items-center"><div class="mr-2 w-55p h-55p div_kpi_icon_' + portletwidgetid + '"><img src="tenants/themes/compact/imgs/img55.png" onerror="ReloadImage(event)" data-dynamic="1" class="img-fluid imageUpload" style="filter: invert(1);"></div><span class="d-flex flex-column h-100 font-weight-500 text-dark" style="margin-top:-10px"> <span class="textPropertyOwl_">' + parentobj[i].value_2 + '</span> <span class="font-14 text-dark">' + parentobj[i].value_1 + '</span> </span></div></div>';
|
||||
html2 = '<small id="showreport_' + portletwidgetid + '" class="showreport_' + portletwidgetid + ' font-sm-11 hidden"><span class="nav-icon-wrap"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small>';
|
||||
}
|
||||
$(containerid).find(".carousel-inner").html(html);
|
||||
$(containerid).find(".reportappend").html(html2);
|
||||
$(containerid).find(".carouselItem_0").addClass('active');
|
||||
$(containerid).find(".bgcolorset_" + portletwidgetid + "").css({ "background-color": cssproperty[0].BackgroundColor, "height": response.result.KpiHeight, "border": cssproperty[0].BorderWidth + ' ' + cssproperty[0].BorderType + ' ' + cssproperty[0].BorderColor });
|
||||
$(containerid).find('.textPropertyOwl_').css({ "font-size": cssproperty[0].FontSize + 'px' });
|
||||
let y = 1;
|
||||
if (cssproperty[0].BackgroundColor.charAt(1) == 'f') {
|
||||
y = 0;
|
||||
}
|
||||
var iconhtml = '<img src="' + response.result.Icon + '" onerror="ReloadImage(event)" data-dynamic="1" class="img-fluid imageUpload" style="filter: invert(' + y + ');">';
|
||||
if (response.result.Icon == "" || response.result.Icon == undefined) { }
|
||||
else {
|
||||
$(containerid).find(".div_kpi_icon_" + portletwidgetid).html(iconhtml);
|
||||
}
|
||||
if (response.result.LinkReportId != 0) {
|
||||
$(containerid).find("#showreport_" + portletwidgetid).removeClass('hidden');
|
||||
}
|
||||
$(containerid).find('#sales_slider_' + portletwidgetid).carousel({
|
||||
interval: 3000
|
||||
});
|
||||
$(containerid).find('#sales_slider_' + portletwidgetid).carousel("cycle");
|
||||
var colors = ["primary", "success", "warning", "danger", "info", "light", "secondary", "dark"];
|
||||
}
|
||||
$(containerid).siblings('.line-loader').remove();
|
||||
$(containerid).removeClass('hidden');
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Carouselsliderbgcolor();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Carouselsliderbgcolor = Carouselsliderbgcolor;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,178 @@
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Comparision extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName;
|
||||
var html = '<div class="card card-sm" id="widget_kpis_Comparision kpi-card">' +
|
||||
'<a href="Javascript:;" class="kpi-link-report" onclick="Unibase.Themes.Compact.KpiWidgets.Comparision.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ',' + "'" + containerid + "'" + ')";><small id="showreport_' + id[0].PortletWidgetId + '" class="font-sm-11"><span class="nav-icon-wrap"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a>' +
|
||||
'<div class="card-body p-2">' +
|
||||
'<span class="d-block font-14 font-weight-400 text-dark mb-10" ><span id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '">' + title + '</span>' +
|
||||
'</span>' +
|
||||
'<span class="d-block align-items-center card-action-wrap pull-right font-11" >' +
|
||||
'<a href="#" class="inline-block full-screen mr-15 hidden" id="kpi_FullScreen_' + id[0].PortletWidgetId + '">' +
|
||||
'<i class="ion ion-md-expand"></i>' +
|
||||
'</a>' +
|
||||
'</span>' +
|
||||
'<span class="d-block text-primary mb-10 pull-right font-11" id="kpi_Percentage_' + id[0].PortletWidgetId + '">0%</span></span>' +
|
||||
'<span id="config_widget_' + id[0].PortletWidgetId + '"></span>' +
|
||||
'<span class="d-block display-5 font-weight-400 text-dark" id="kpi_value_1_' + id[0].PortletWidgetId + '">0000</span>' +
|
||||
'<span class="text-secondary font-12 ml-1" ><span id="kpi_value_2_' + id[0].PortletWidgetId + '"></span>000000</span>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters) {
|
||||
let instance = this;
|
||||
instance.inputParameters = parameters.InputParameters;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKpiWidgetData(parameters).then(function (response) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, detailContainer, parameters, IsPreview, response) {
|
||||
detailContainer = '.' + detailContainer;
|
||||
var post = response.result;
|
||||
if (post != null) {
|
||||
if (post.IsMaximize == true) {
|
||||
$("#kpi_FullScreen_" + portletwidgetid).removeClass("hidden");
|
||||
}
|
||||
if (response != null) {
|
||||
var data = JSON.parse(post.Data)[0];
|
||||
var selected_values = post.Selected_Columns;
|
||||
var sp = selected_values.split(',');
|
||||
var column1 = sp[0];
|
||||
var column2 = sp[1];
|
||||
var column3 = sp[2];
|
||||
var Value_1 = data[column1];
|
||||
var Value_2 = data[column2];
|
||||
var Value_3 = data[column3];
|
||||
if (data == null || data == "" || data == undefined) {
|
||||
Value_1 = 0;
|
||||
Value_2 = 0;
|
||||
}
|
||||
if (Value_2 != 0)
|
||||
var difference = Value_2 - Value_1;
|
||||
if (Value_3 == null || Value_3 == undefined) {
|
||||
var kpi_percentage = Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(((Value_2 - Value_1) / Value_2) * 100, 2);
|
||||
if (difference > 0) {
|
||||
$(detailContainer).find("#kpi_Percentage_" + portletwidgetid).addClass('text-success');
|
||||
kpi_percentage = '+' + kpi_percentage;
|
||||
}
|
||||
else if (difference < 0) {
|
||||
$(detailContainer).find("#kpi_Percentage_" + portletwidgetid).addClass('text-danger');
|
||||
kpi_percentage = '-' + kpi_percentage;
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find("#kpi_Percentage_" + portletwidgetid).removeClass('d-block');
|
||||
$(detailContainer).find("#kpi_Percentage_" + portletwidgetid).addClass('hidden');
|
||||
}
|
||||
}
|
||||
else {
|
||||
var kpi_percentage = Value_3;
|
||||
if (Value_3 > 0) {
|
||||
$(detailContainer).find("#kpi_Percentage_" + portletwidgetid).addClass('text-success');
|
||||
kpi_percentage = '+' + kpi_percentage;
|
||||
}
|
||||
else if (Value_3 < 0) {
|
||||
$(detailContainer).find("#kpi_Percentage_" + portletwidgetid).addClass('text-danger');
|
||||
kpi_percentage = '-' + kpi_percentage;
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find("#kpi_Percentage_" + portletwidgetid).removeClass('d-block');
|
||||
$(detailContainer).find("#kpi_Percentage_" + portletwidgetid).addClass('hidden');
|
||||
}
|
||||
}
|
||||
$(detailContainer).find("#kpi_value_1_" + portletwidgetid).text(Value_1);
|
||||
$(detailContainer).find("#kpi_value_2_" + portletwidgetid).text(Value_2);
|
||||
$(detailContainer).find("#kpi_Percentage_" + portletwidgetid).text(kpi_percentage + '% ');
|
||||
var colors = ["primary", "success", "warning", "danger", "info", "light", "secondary", "dark"];
|
||||
if (response.result.AppConfigurations.length != 0) {
|
||||
var designhtml = "";
|
||||
var appconfig = response.result.AppConfigurations;
|
||||
for (var i = 0; i < appconfig.length; i++) {
|
||||
var onlickurl = "";
|
||||
var sname = appconfig[i].SettingName.replace(/ /g, '');
|
||||
designhtml += ' <span class="mr-10"><a href="javascript:;" id="widgetconfig_' + sname + '" onclick="' + onlickurl + '">' +
|
||||
'<button class="btn btn-sm btn-' + colors[i] + ' pull-right btn-rounded text-white">' + appconfig[i].SettingName + '</button>' +
|
||||
'</a> </span>';
|
||||
}
|
||||
designhtml += "</div>";
|
||||
$(detailContainer).find("#config_widget_" + portletwidgetid).html(designhtml);
|
||||
}
|
||||
if (post.LinkReportId != 0 && post.LinkReportId != null) {
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find("#showreport_" + portletwidgetid).addClass('hidden');
|
||||
}
|
||||
}
|
||||
}
|
||||
$(detailContainer).siblings('.line-loader').remove();
|
||||
$(detailContainer).removeClass('hidden');
|
||||
}
|
||||
linkReport(widgetid, portletwidgetid, containerid) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
var instance = this;
|
||||
yield Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKPIWidget(widgetid).then(function (response) {
|
||||
var res = response.result;
|
||||
if (res != null) {
|
||||
let containerid = "div_kpireport_" + portletwidgetid;
|
||||
instance.navigationHelper.popup(res.LinkReportId, containerid, Unibase.Platform.Analytics.Components.ReportViewer.Instance(), null, Unibase.Platform.Helpers.Size.ExtraLarge);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Comparision();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Comparision = Comparision;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,55 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Comparisionbottombarcolor extends KpiWidgets.Manager.KpiManager {
|
||||
jsFiles() {
|
||||
return ["platform/widgets/managers/interfaces/iwidgetmanager.js", "platform/widgets/managers/widgetmanager.js", "platform/core/helpers/propertyhelper/propertyhelper.js", "platform/core/helpers/token/tokenhelper.js", "platform/core/helpers/numberhelper/numberhelper.js", "platform/analytics/components/reportviewer/reportviewer.js"];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName;
|
||||
var html = '<div class="position-relative kpi_card_class_' + id[0].PortletWidgetId + ' kpi-card" style="background-color:#fff; height:120px; border-radius:5px"><a href="javascript:;" onclick="Unibase.Themes.Compact.KpiWidgets.Manager.KpiManager.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ', ' + containerid + ')" id="showreport_' + id[0].PortletWidgetId + '" class="kpi-link-report"><small id="showreport_' + id[0].PortletWidgetId + '"><span class="nav-icon-wrap"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a><div class="card-body card-body-kpi-CBBC-' + id[0].PortletWidgetId + ' p-2 font-weight-500 text-dark" data-height="height1"><ul class="d-flex justify-content-between h-100 flex-column"><li class="d-flex flex-row justify-content-between my-auto"> <span class="font-weight-400 line-height-10 textProperty_' + id[0].PortletWidgetId + ' kpivalue_1_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-1" style="font-size:32px">3600</span><span class=""><span class="ml-auto pr-3" id="config_widget_' + id[0].PortletWidgetId + '"></span></span></li><li class="d-flex flex-row font-weight-400 font-16 text-right justify-content-between align-items-center"><p class="" id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '" data-kpi="kpi_font">' + title + ' </p><span class="pull-right font-14 font-weight-500 kpivalue_' + id[0].PortletWidgetId + ' kpivalue_2_' + id[0].PortletWidgetId + '" data-valuebind="Value-2">88%</span> </li></ul> </div><div class="border-0 kpivalue_3_' + id[0].PortletWidgetId + ' p-2 d-flex justify-content-between font-weight-400 bgcolorset_' + id[0].PortletWidgetId + ' text-white" data-height="height2" style="background-color:#009b84;"> <p class="my-auto kpivalueLabel_' + id[0].PortletWidgetId + '" data-valueLabelBind="Value-1" data-kpi="kpi_font">Total Credit Customers</p><p class="my-auto kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-3" data-kpi="kpi_font">20,000</p></div></div>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
instance._load(id, containerid, null);
|
||||
}
|
||||
_loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse) {
|
||||
let instance = this;
|
||||
instance.loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse);
|
||||
}
|
||||
_styling(portletwidgetid, Container, response) {
|
||||
let cssproperty = JSON.parse(response.result.CssProperty);
|
||||
let height = response.result.KpiHeight + 'px';
|
||||
let border = cssproperty[0].BorderWidth + ' ' + cssproperty[0].BorderType + ' ' + cssproperty[0].BorderColor;
|
||||
let bottomborder = '0px 0px ' + cssproperty[0].BorderRadius + ' ' + cssproperty[0].BorderRadius;
|
||||
var calheight, calheight1, calheight2;
|
||||
calheight = parseInt(height.replace(/px/g, ''));
|
||||
calheight1 = calheight * 0.66;
|
||||
calheight1 = parseInt(Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(calheight1, 0));
|
||||
calheight2 = calheight - calheight1;
|
||||
$(Container).find('[data-height="height1"]').css('height', calheight1 + 'px');
|
||||
$(Container).find('[data-height="height2"]').css('height', calheight2 + 'px');
|
||||
$(Container).find(".bgcolorset_" + portletwidgetid + "").css({ "background-color": cssproperty[0].BackgroundColor, "border-radius": bottomborder });
|
||||
$(Container).find(".kpi_card_class_" + portletwidgetid + "").css({ "border": border, height: height, "border-radius": cssproperty[0].BorderRadius });
|
||||
$(Container).find(".kpivalue_" + portletwidgetid + '[data-valuebind="Value-1"]').css({ 'font-size': cssproperty[0].FontSize + 'px' });
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Comparisionbottombarcolor();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Comparisionbottombarcolor = Comparisionbottombarcolor;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"comparisionbottombarcolor.js","sourceRoot":"","sources":["comparisionbottombarcolor.ts"],"names":[],"mappings":"AAGA,IAAU,OAAO,CAkEhB;AAlED,WAAU,OAAO;IACb,IAAiB,MAAM,CAgEtB;IAhED,WAAiB,MAAM;QACnB,IAAiB,OAAO,CA8DvB;QA9DD,WAAiB,OAAO;YACpB,IAAiB,UAAU,CA4D1B;YA5DD,WAAiB,UAAU;gBACvB,MAAa,yBAA0B,SAAQ,WAAA,OAAO,CAAC,UAAU;oBAU7D,OAAO;wBAEH,OAAO,CAAC,wDAAwD,EAAE,4CAA4C,EAAE,wDAAwD,EAAE,4CAA4C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;wBACpD,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBA1DY,oCAAyB,4BA0DrC,CAAA;YACL,CAAC,EA5DgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QA4D1B;QACL,CAAC,EA9DgB,OAAO,GAAP,cAAO,KAAP,cAAO,QA8DvB;IACL,CAAC,EAhEgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAgEtB;AACL,CAAC,EAlES,OAAO,KAAP,OAAO,QAkEhB"}
|
||||
@@ -0,0 +1,49 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Comparisionrightbarcolor extends KpiWidgets.Manager.KpiManager {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName;
|
||||
var html = '<ul class="position-relative bg-white text-dark font-weight-500 d-flex kpi_card_class_' + id[0].PortletWidgetId + ' kpi-card" id="widget_kpis_Comparision" style="height:120px;border-radius:5px"><li class="kpi-link-report"><a href="javascript:;" id="showreport_' + id[0].PortletWidgetId + '" onclick="Unibase.Themes.Compact.KpiWidgets.Comparision.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ',' + "'" + containerid + "'" + ')"> <small id="showreport_' + id[0].PortletWidgetId + '" class="font-sm-11"> <span class="nav-icon-wrap"> <i class="font-14 dripicons dripicons-graph-pie text-dark"></i> </span> </small> </a> </li><li class="d-flex flex-column w-65 font-14 font-weight-normal p-2"> <ul class="d-flex justify-content-between my-2 h-100 c-gap-5"> <li class="my-auto kpivalueLabel_' + id[0].PortletWidgetId + ' flex-shrink-0" data-kpi="kpi_font">' + title + '</li><li class="text-dark my-auto text-truncate"> <span class="font-weight-500 textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + '" data-valueBind="Value-1" style="font-size:22px">389</span> </li></ul> <ul class="d-flex justify-content-between my-2 h-100 c-gap-5"> <li class="my-auto kpivalueLabel_' + id[0].PortletWidgetId + ' flex-shrink-0" data-valuelabelbind="Value-1" data-kpi="kpi_font">Label</li><li class="text-dark my-auto text-truncate"> <span class="font-weight-500 textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + ' text-truncate" data-valueBind="Value-2" style="font-size:22px">289</span> </li></ul> </li><li class="w-35 bgcolorset_' + id[0].PortletWidgetId + '" style="background-color:#88c241; border-radius: 0px 5px 5px 0px;"> <ul class="d-flex h-100 justify-content-end "> <li class="d-flex h-100 font-weight-700 text-center"> <p class="my-auto textProperty_' + id[0].PortletWidgetId + '" style="font-size:22px"><span class="font-weight-500 text-white kpivalue_' + id[0].PortletWidgetId + '" data-valueBind="Value-3">85%</span><i class="text-white la la-arrow-up"></i></i></p></li></ul></li></ul>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
instance._load(id, containerid, null);
|
||||
}
|
||||
_loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse) {
|
||||
let instance = this;
|
||||
instance.loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse);
|
||||
}
|
||||
_styling(portletwidgetid, Container, response) {
|
||||
let cssproperty = JSON.parse(response.result.CssProperty);
|
||||
let height = response.result.KpiHeight + 'px';
|
||||
let borderCompRightBar = cssproperty[0].BorderWidth + ' ' + cssproperty[0].BorderType + ' ' + cssproperty[0].BorderColor;
|
||||
$(Container).find(".kpi_card_class_" + portletwidgetid).css({ "border": borderCompRightBar, "border-radius": cssproperty[0].BorderRadius, "height": height });
|
||||
$(Container).find(".bgcolorset_" + portletwidgetid).css({ "background-color": cssproperty[0].BackgroundColor, "border-radius": '0px ' + cssproperty[0].BorderRadius + ' ' + cssproperty[0].BorderRadius + ' 0px' });
|
||||
$(Container).find(".kpivalue_" + portletwidgetid + '[data-valuebind="Value-1"]').css({ "font-size": cssproperty[0].FontSize + 'px', "font-family": cssproperty[0].FontStyle });
|
||||
$(Container).find(".kpivalue_" + portletwidgetid + '[data-valuebind="Value-2"]').css({ "font-size": cssproperty[0].FontSize + 'px', "font-family": cssproperty[0].FontStyle });
|
||||
$(Container).find(".textProperty_" + portletwidgetid).css({ "font-size": cssproperty[0].FontSize + 'px', "font-family": cssproperty[0].FontStyle });
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Comparisionrightbarcolor();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Comparisionrightbarcolor = Comparisionrightbarcolor;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"comparisionrightbarcolor.js","sourceRoot":"","sources":["comparisionrightbarcolor.ts"],"names":[],"mappings":"AAGA,IAAU,OAAO,CA0DhB;AA1DD,WAAU,OAAO;IACb,IAAiB,MAAM,CAwDtB;IAxDD,WAAiB,MAAM;QACnB,IAAiB,OAAO,CAsDvB;QAtDD,WAAiB,OAAO;YACpB,IAAiB,UAAU,CAoD1B;YApDD,WAAiB,UAAU;gBACvB,MAAa,wBAAyB,SAAQ,WAAA,OAAO,CAAC,UAAU;oBAU5D,OAAO;wBAEH,OAAO,CAAC,wDAAwD,EAAE,4CAA4C,EAAE,wDAAwD,EAAE,4CAA4C,EAAE,oDAAoD,EAAC,4DAA4D,CAAC,CAAC;oBAC/U,CAAC;oBACD,QAAQ;wBAEJ,OAAO,EAAE,CAAC;oBACd,CAAC;oBAED,IAAI,CAAC,EAAE,EAAE,WAAW;wBAChB,IAAI,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,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QAAQ,GAAG,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;wBAC9K,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,eAAe,GAAE,4BAA4B,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;wBAC9K,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;oBAExJ,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;4BACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,wBAAwB,EAAE,CAAC;wBACnD,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBAlDY,mCAAwB,2BAkDpC,CAAA;YACL,CAAC,EApDgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAoD1B;QACL,CAAC,EAtDgB,OAAO,GAAP,cAAO,KAAP,cAAO,QAsDvB;IACL,CAAC,EAxDgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAwDtB;AACL,CAAC,EA1DS,OAAO,KAAP,OAAO,QA0DhB"}
|
||||
@@ -0,0 +1,241 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Default extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(obj, containerid) {
|
||||
let title = obj[0].WidgetName;
|
||||
var html = '<div class="card mb-0 card-sm shadow-hover h-90p kpi-card" id="kpi_card_' + obj[0].PortletWidgetId + '">' +
|
||||
'<a href="javascript:;" class="kpi-link-report" onclick="Unibase.Themes.Compact.KpiWidgets.Default.Instance().linkReport(' + obj[0].WidgetId + ',' + obj[0].PortletWidgetId + ',' + "'" + containerid + "'" + ')">' +
|
||||
'<small id = "showreport_' + obj[0].PortletWidgetId + '" class="font-sm-11 mb-5"><span class="nav-icon-wrap"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a>' +
|
||||
'<div class="p-3">' +
|
||||
'<span class="spn_widgetname" data-kpi="kpi_font">' + title + '</span>' +
|
||||
'<span class="d-block align-items-center card-action-wrap pull-right font-11" >' +
|
||||
'<a href="javascript:;" class="inline-block full-screen hidden" id="kpi_FullScreen_' + obj[0].PortletWidgetId + '">' +
|
||||
'<i class="ion ion-md-expand"></i>' +
|
||||
'</a>' +
|
||||
'</span>' +
|
||||
'<div>';
|
||||
html += '<span id="spanlnk_widget_' + obj[0].PortletWidgetId + '" class="mb-10 block text-underline hidden">' +
|
||||
'<input type="hidden" id="hdn_widget_link_' + obj[0].PortletWidgetId + '" />' +
|
||||
'<a href="javascript:;" id="lnk_widget_' + obj[0].PortletWidgetId + '"><span id="value_widget_' + obj[0].PortletWidgetId + '" class="display-5 font-weight-500">0</span></a></span > ' +
|
||||
'<span id="span_widget_' + obj[0].PortletWidgetId + '" class="h4 block mt-20 mb-10"><span class="display-5 font-weight-500 font-25 font-xl-23" id="value_widget_' + obj[0].PortletWidgetId + '">0</span></span>' +
|
||||
'<span id="config_widget_' + obj[0].PortletWidgetId + '"></span>' +
|
||||
'<div class="pull-right"><div id="span_kpi_icon_' + obj[0].PortletWidgetId + '" ></div>' +
|
||||
'</div></div></div></div>';
|
||||
return html;
|
||||
}
|
||||
linkReport(widgetid, PortletWidgetId, containerid) {
|
||||
var instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKPIWidget(widgetid).then(function (response) {
|
||||
var res = response.result;
|
||||
if (res != null) {
|
||||
let containerid = "div_kpireport_" + PortletWidgetId;
|
||||
instance.navigationHelper.popup(res.LinkReportId, containerid, Unibase.Platform.Analytics.Components.ReportViewer.Instance(), null, Unibase.Platform.Helpers.Size.ExtraLarge);
|
||||
}
|
||||
});
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters) {
|
||||
let instance = this;
|
||||
instance.inputParameters = parameters.InputParameters;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKpiWidgetData(parameters).then(function (response) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, detailContainer, parameters, IsPreview, response) {
|
||||
detailContainer = "." + detailContainer;
|
||||
let instance = this;
|
||||
var post = response.result;
|
||||
if (post != null) {
|
||||
let result = JSON.parse(response.result.Data);
|
||||
if (post.IsMaximize == true) {
|
||||
$("#kpi_FullScreen_" + portletwidgetid).removeClass("hidden");
|
||||
}
|
||||
var iconhtml = "";
|
||||
if (post.Icon != "" && post.Icon != null) {
|
||||
iconhtml = '<img id="kpi_icon_' + portletwidgetid + '"src="' + post.Icon + '" style="width:50px;"/>';
|
||||
$("#span_kpi_icon_" + portletwidgetid).html(iconhtml);
|
||||
}
|
||||
var selected_values = post.Selected_Columns;
|
||||
if (selected_values != null) {
|
||||
var sp = selected_values.split(',');
|
||||
var column1 = sp[0];
|
||||
}
|
||||
let kpiresult = JSON.parse(response.result.Data);
|
||||
let data = "";
|
||||
if (kpiresult != null) {
|
||||
if (kpiresult.length != 0) {
|
||||
data = JSON.parse(response.result.Data)[0];
|
||||
post.Data = data[column1];
|
||||
}
|
||||
}
|
||||
else
|
||||
post.Data = "";
|
||||
var color = post.Color;
|
||||
if (color != null) {
|
||||
$(detailContainer).find("#kpi_card_" + portletwidgetid).addClass(color);
|
||||
}
|
||||
if (post.IsFiltarable == true) {
|
||||
$(detailContainer).find(".KpiFilter_" + portletwidgetid + "").removeClass('hidden');
|
||||
}
|
||||
if (post.Data == "0.000" || post.Data == "" || post.Data == null || post.Data == "[]") {
|
||||
post.Data = "0";
|
||||
}
|
||||
if (post.LinkUrl == 'NULL' || post.LinkUrl == null || post.LinkUrl == "") {
|
||||
$(detailContainer).find("#spanlnk_widget_" + portletwidgetid).remove();
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find("#span_widget_" + portletwidgetid).remove();
|
||||
$(detailContainer).find("#spanlnk_widget_" + portletwidgetid).removeClass("hidden");
|
||||
$(detailContainer).find("#hdn_widget_link_" + portletwidgetid).val(post.LinkUrl);
|
||||
$(detailContainer).find("#lnk_widget_" + portletwidgetid).click(function () {
|
||||
if (post.Data == "0" || Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(post.Data, 2) == 0.00) {
|
||||
alert('No data');
|
||||
}
|
||||
else {
|
||||
}
|
||||
});
|
||||
}
|
||||
var l;
|
||||
var m;
|
||||
var n;
|
||||
if (l == true || m == true || n == true)
|
||||
$(detailContainer).find("#value_widget_" + portletwidgetid).text(Unibase.Core.Helpers.NumberHelper.Instance().format(post.Data, 2, ''));
|
||||
else
|
||||
$(detailContainer).find("#value_widget_" + portletwidgetid).text(Unibase.Core.Helpers.NumberHelper.Instance().format(post.Data, 2, ''));
|
||||
if (post.Color != "" && post.Color != null) {
|
||||
$(detailContainer).find("#value_widget_" + portletwidgetid).addClass("text-" + color);
|
||||
}
|
||||
if (post.LinkReportId != 0 && post.LinkReportId != null) {
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find("#showreport_" + portletwidgetid).addClass('hidden');
|
||||
}
|
||||
var colors = ["primary", "success", "warning", "danger", "info", "light", "secondary", "dark"];
|
||||
if (response.result.AppConfigurations != null) {
|
||||
if (response.result.AppConfigurations.length != 0) {
|
||||
var designhtml = "";
|
||||
var statusconditions = "";
|
||||
var widgetconditions = "";
|
||||
var appconfig = response.result.AppConfigurations;
|
||||
for (var i = 0; i < appconfig.length; i++) {
|
||||
var onlickurl = "";
|
||||
var sname = appconfig[i].SettingName.replace(/ /g, '');
|
||||
onlickurl = Default.Instance().load_appconfigurations(appconfig[i], response.result.Data, portletwidgetid);
|
||||
designhtml += ' <span class="mr-10"><a href="javascript:;" id="widgetconfig_' + sname + '" onclick="' + onlickurl + '">' +
|
||||
'<button class="btn btn-sm btn-' + colors[i] + ' pull-right btn-rounded text-white">' + appconfig[i].SettingName + '</button>' +
|
||||
'</a> </span>';
|
||||
if (appconfig[i].JsFunction != null && appconfig[i].JsFunction != "") {
|
||||
if (appconfig[i].JsFunction.indexOf("{{") > -1 || appconfig[i].JsFunction.indexOf("}}") > -1) {
|
||||
statusconditions += appconfig[i].JsFunction + " ";
|
||||
}
|
||||
else {
|
||||
widgetconditions += appconfig[i].JsFunction + " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
designhtml += "</div>";
|
||||
$(detailContainer).find("#config_widget_" + portletwidgetid).html(designhtml);
|
||||
if (widgetconditions != "")
|
||||
widgetconditions = HtmlHelper.getHelper().decode(widgetconditions);
|
||||
let evaljs;
|
||||
for (var h = 0; h < result.length; h++) {
|
||||
var model = result[h];
|
||||
evaljs = Unibase.Core.Helpers.TokenHelper.Instance().replace(widgetconditions, model);
|
||||
}
|
||||
eval(evaljs);
|
||||
if (statusconditions != "") {
|
||||
if (result != null) {
|
||||
for (var i = 0; i < result.length; i++) {
|
||||
var model = result[i];
|
||||
var condition = Unibase.Core.Helpers.TokenHelper.Instance().replace(statusconditions, model);
|
||||
eval(condition);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$(detailContainer).siblings('.line-loader').remove();
|
||||
$(detailContainer).removeClass('hidden');
|
||||
}
|
||||
load_appconfigurations(config, data, portletwidgetid) {
|
||||
var instance = this;
|
||||
let settingurltype = config.SettingUrlType;
|
||||
var appconfigurationid = config.AppConfigurationId;
|
||||
var settingUrl = config.SettingUrl;
|
||||
var jsfunction = config.JsFunction;
|
||||
var formid = config.FormId;
|
||||
let editformid;
|
||||
var formpkname = config.FormPrimaryColumn;
|
||||
if (data.length <= 0) {
|
||||
editformid = 0;
|
||||
}
|
||||
else
|
||||
editformid = 0;
|
||||
var onclick = "";
|
||||
if (settingurltype == 2) {
|
||||
onclick = "this.fileCacheHelper.loadJsFile('" + config.SettingUrl + "', function () {var html = Unibase.Apps.Components.Stages.Instance().init();NavigationHelper.Instance().loadPopupHtml(html, Helpers.Size.DockLeft, function(containerid) {" + config.JsFunction + " ;});});";
|
||||
}
|
||||
else if (settingurltype == 1) {
|
||||
onclick = 'Unibase.Platform.Helpers.NavigationHelper.Instance().loadForm(' + formid + ', ' + editformid + ',' + appconfigurationid + ',' + portletwidgetid + ' )';
|
||||
}
|
||||
else if (settingurltype == 3) {
|
||||
let variablename = "Widget_" + config.SettingUrl.split(",")[0].split(".")[0].trim();
|
||||
let methodname = config.SettingUrl.split(",")[1];
|
||||
var onclickurl = "Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('widgets/" + config.SettingUrl.split(",")[0] + "', function () { " + variablename + "." + methodname + " });";
|
||||
onclick = onclickurl;
|
||||
}
|
||||
else if (settingurltype == 10) {
|
||||
onclick = "Unibase.Themes.Compact.Components.Nav.Instance().loadDashboard(" + config.LinkDashboardId + ",'" + config.DashboardName + "')";
|
||||
}
|
||||
else if (settingurltype == 11) {
|
||||
onclick = "Unibase.Themes.Compact.Components.Nav.Instance().loadDashboardsInDashboard(" + config.LinkDashboardGroupId + ",0,true)";
|
||||
}
|
||||
return onclick;
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Default();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Default = Default;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,175 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Icon extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName;
|
||||
let html = '<div class="card p-2 shadow-hover w-100" id="kpi_card_' + id[0].PortletWidgetId + ' kpi-card">' +
|
||||
'<a href="javascript:;" class="kpi-link-report" onclick="Unibase.Themes.Compact.KpiWidgets.Comparision.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ',' + "'" + containerid + "'" + ')";><small id="showreport_' + id[0].PortletWidgetId + '" class="font-sm-11"><span class="nav-icon-wrap"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a>' +
|
||||
'<div class="row">' +
|
||||
'<div class="col-3 py-0 d-flex justify-content-center px-0" id="div_kpi_icon_' + id[0].PortletWidgetId + '"><img class="avatar-img rounded-circle imageUpload" id="kpi_icon_2250" src="tenants/themes/compact/imgs/avatar.jpg" style="width:75px;">' +
|
||||
'</div>' +
|
||||
'<div class="col-9 pull-right">' +
|
||||
'<span class="font-14 font-weight-400 text-dark">' + title + '</span>' +
|
||||
'<span class="d-block align-items-center card-action-wrap pull-right font-11" >' +
|
||||
'<a href="#" class="inline-block full-screen hidden" id="kpi_FullScreen_' + id[0].PortletWidgetId + '">' +
|
||||
'<i class="ion ion-md-expand"></i>' +
|
||||
'</a>' +
|
||||
'</span>' +
|
||||
'<div>';
|
||||
html += '<span id="spanlnk_widget_' + id[0].PortletWidgetId + '" class="mb-10 block text-underline hidden">' +
|
||||
'<input type="hidden" id="hdn_widget_link_' + id[0].PortletWidgetId + '" />' +
|
||||
'<a href="javascript:;" id="lnk_widget_' + id[0].PortletWidgetId + '"><span id="value_widget_' + id[0].PortletWidgetId + '" class="display-5 font-weight-400 text-dark">0</span></a></span > ' +
|
||||
'<span id="span_widget_' + id[0].PortletWidgetId + '" class="h4 block mt-10 mb-10"><span class="display-5 font-weight-400 text-dark" id="value_widget_' + id[0].PortletWidgetId + '">8854</span></span>' +
|
||||
'<span id="config_widget_' + id[0].PortletWidgetId + '"></span>' +
|
||||
'</div></div></div></div>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters) {
|
||||
let instance = this;
|
||||
instance.inputParameters = parameters.InputParameters;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKpiWidgetData(parameters).then(function (response) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, detailContainer, parameters, IsPreview, response) {
|
||||
detailContainer = '.' + detailContainer;
|
||||
var post = response.result;
|
||||
if (post != null) {
|
||||
if (post.IsMaximize == true) {
|
||||
$("#kpi_FullScreen_" + portletwidgetid).removeClass("hidden");
|
||||
}
|
||||
if (response.result.Icon == "" || response.result.Icon == null) {
|
||||
response.result.Icon = "tenants/themes/compact/imgs/avatar.jpg";
|
||||
}
|
||||
var iconhtml = '<img class ="avatar-img rounded-circle imageUpload" id="kpi_icon_' + portletwidgetid + '"src="' + response.result.Icon + '" style="width:75px;"/>';
|
||||
$("#div_kpi_icon_" + portletwidgetid).html(iconhtml);
|
||||
if (response.result.Data != null) {
|
||||
var data = JSON.parse(response.result.Data)[0];
|
||||
}
|
||||
var selected_values = post.Selected_Columns;
|
||||
if (selected_values != null) {
|
||||
var sp = selected_values.split(',');
|
||||
var column1 = sp[0];
|
||||
post.Data = data[column1];
|
||||
}
|
||||
var color = post.Color;
|
||||
var icon = post.Icon;
|
||||
if (color != null) {
|
||||
$(detailContainer).find("#kpi_card_" + portletwidgetid).addClass(color);
|
||||
}
|
||||
if (post.IsFiltarable == true) {
|
||||
$(detailContainer).find(".KpiFilter_" + portletwidgetid + "").removeClass('hidden');
|
||||
}
|
||||
if (post.Data == "0.000" || post.Data == "" || post.Data == null) {
|
||||
post.Data = "0";
|
||||
}
|
||||
if (post.LinkUrl == 'NULL' || post.LinkUrl == null) {
|
||||
$(detailContainer).find("#spanlnk_widget_" + portletwidgetid).remove();
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find("#span_widget_" + portletwidgetid).remove();
|
||||
$(detailContainer).find("#spanlnk_widget_" + portletwidgetid).removeClass("hidden");
|
||||
$(detailContainer).find("#hdn_widget_link_" + portletwidgetid).val(post.LinkUrl);
|
||||
$(detailContainer).find("#lnk_widget_" + portletwidgetid).click(function () {
|
||||
if (post.Data == "0" || Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(post.Data, 2) == 0.00) {
|
||||
alert('No data');
|
||||
}
|
||||
else {
|
||||
}
|
||||
});
|
||||
}
|
||||
var iconhtml = "";
|
||||
if (icon != null && icon != "") {
|
||||
iconhtml = "<span class='mr-10'>" + icon + "</span>";
|
||||
$(detailContainer).find("#kpi_icon_" + portletwidgetid).html(iconhtml);
|
||||
}
|
||||
var l;
|
||||
var m;
|
||||
var n;
|
||||
if (l == true || m == true || n == true)
|
||||
$(detailContainer).find("#value_widget_" + portletwidgetid).text(Unibase.Core.Helpers.NumberHelper.Instance().format(post.Data, 2, ''));
|
||||
else
|
||||
$(detailContainer).find("#value_widget_" + portletwidgetid).text(Unibase.Core.Helpers.NumberHelper.Instance().format(post.Data, 2, ''));
|
||||
if (post.LinkReportId != 0 && post.LinkReportId != null) {
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find("#showreport_" + portletwidgetid).addClass('hidden');
|
||||
}
|
||||
var colors = ["primary", "success", "warning", "danger", "info", "light", "secondary", "dark"];
|
||||
if (response.result.AppConfigurations != null) {
|
||||
if (response.result.AppConfigurations.length != 0) {
|
||||
var designhtml = "";
|
||||
var appconfig = response.result.AppConfigurations;
|
||||
for (var i = 0; i < appconfig.length; i++) {
|
||||
var onlickurl = "";
|
||||
var sname = appconfig[i].SettingName.replace(/ /g, '');
|
||||
designhtml += ' <span class="mr-10"><a href="javascript:;" id="widgetconfig_' + sname + '" onclick="' + onlickurl + '">' +
|
||||
'<button class="btn btn-sm btn-' + colors[i] + ' pull-right btn-rounded text-white">' + appconfig[i].SettingName + '</button>' +
|
||||
'</a> </span>';
|
||||
}
|
||||
designhtml += "</div>";
|
||||
$(detailContainer).find("#config_widget_" + portletwidgetid).html(designhtml);
|
||||
}
|
||||
}
|
||||
}
|
||||
$(detailContainer).siblings('.line-loader').remove();
|
||||
$(detailContainer).removeClass('hidden');
|
||||
}
|
||||
linkReport(widgetid, portletwidgetid, containerid) {
|
||||
var instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKPIWidget(widgetid).then(function (response) {
|
||||
var res = response.result;
|
||||
if (res != null) {
|
||||
let containerid = "div_kpireport_" + portletwidgetid;
|
||||
var rv_obj = Unibase.Platform.Analytics.Components.ReportViewer.Instance();
|
||||
instance.navigationHelper.popup(res.LinkReportId, containerid, rv_obj, null, Unibase.Platform.Helpers.Size.Large);
|
||||
}
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Icon();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Icon = Icon;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,57 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Iconbgcolor extends KpiWidgets.Manager.KpiManager {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName;
|
||||
let html = '<ul class="position-relative bg-white d-flex p-2 overflow-hide kpi_card_class_' + id[0].PortletWidgetId + ' kpi-card" id="kpi_card_' + id[0].PortletWidgetId + '" style="border-style:none;border-width:1px;border-color:#baf0b0; height":"90px"><li class="px-15 my-auto w-90p w-lg-95p"><div class="d-flex rounded-5"><div class="w-55p h-55p align-content-center color_' + id[0].PortletWidgetId + ' rounded-6 bgcolorset_' + id[0].PortletWidgetId + '" id="div_kpi_icon_' + id[0].PortletWidgetId + '" style="background-color:#baf0b0"><img src="tenants/themes/compact/imgs/img55.png" onerror="ReloadImage(event)" class="img-fluid p-2 imageUpload" data-loaded="1" data-dynamic="1"></div></div></li><li class="color_icon_' + id[0].PortletWidgetId + ' ml-1 d-flex flex-column text-truncate"><p class="" data-kpi="kpi_font"> ' + title + ' </p><span class="textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + ' line-height-10 my-auto text-dark text-truncate" data-valueBind="Value-1" data-value-kpi="kpi_value_font" style="font-size:32px; margin-top:-5px">0</span></li><li class="kpi-link-report"><a href="javascript:void(0);" onclick="Unibase.Themes.Compact.KpiWidgets.Manager.KpiManager.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ',' + "'" + containerid + "'" + ')" ><small class="showreport_' + id[0].PortletWidgetId + '" data-LinkReport="LinkReport" ><span class="nav-icon-wrap LinkReport_' + id[0].PortletWidgetId + '"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a></li></ul>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
instance._load(id, containerid, null);
|
||||
}
|
||||
_loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse) {
|
||||
let instance = this;
|
||||
instance.loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse);
|
||||
}
|
||||
_styling(portletwidgetid, Container, response) {
|
||||
let cssproperty = JSON.parse(response.result.CssProperty);
|
||||
let border = cssproperty[0].BorderWidth + ' ' + cssproperty[0].BorderType + ' ' + cssproperty[0].BorderColor;
|
||||
let height = response.result.KpiHeight + 'px';
|
||||
if (response.result.Icon == "" || response.result.Icon == null) {
|
||||
response.result.Icon = "tenants/themes/compact/imgs/img55.png";
|
||||
}
|
||||
var iconhtml = '<img class="img-fluid p-1 w-55p h-55p imageUpload" data-dynamic="1" id="kpi_icon_' + portletwidgetid + '"src="' + response.result.Icon + '" onerror="ReloadImage(event)">';
|
||||
$("#div_kpi_icon_" + portletwidgetid).html(iconhtml);
|
||||
$("#kpi_card_" + portletwidgetid).css({ "border": border, "border-radius": cssproperty[0].BorderRadius, "height": height });
|
||||
$(".color_" + portletwidgetid + "").css({ "background-color": cssproperty[0].BackgroundColor });
|
||||
if (screen.width < 1198 && cssproperty[0].FontSize == 32) {
|
||||
$(Container).find(".textProperty_" + portletwidgetid).css({ "font-size": "24px", "font-family": cssproperty[0].FontStyle });
|
||||
}
|
||||
else {
|
||||
$(Container).find(".textProperty_" + portletwidgetid).css({ "font-size": cssproperty[0].FontSize + "px", "font-family": cssproperty[0].FontStyle });
|
||||
}
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Iconbgcolor();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Iconbgcolor = Iconbgcolor;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"iconbgcolor.js","sourceRoot":"","sources":["iconbgcolor.ts"],"names":[],"mappings":"AAGA,IAAU,OAAO,CA+DhB;AA/DD,WAAU,OAAO;IACb,IAAiB,MAAM,CA6DtB;IA7DD,WAAiB,MAAM;QACnB,IAAiB,OAAO,CA2DvB;QA3DD,WAAiB,OAAO;YACpB,IAAiB,UAAU,CAyD1B;YAzDD,WAAiB,UAAU;gBACvB,MAAa,WAAY,SAAQ,WAAA,OAAO,CAAC,UAAU;oBAQ/C,OAAO;wBAEH,OAAO,CAAC,wDAAwD,EAAE,4CAA4C,EAAE,wDAAwD,EAAE,4CAA4C,EAAE,oDAAoD,EAAE,4DAA4D,CAAC,CAAC;oBAChV,CAAC;oBACD,QAAQ;wBACJ,OAAO,EAAE,CAAC;oBACd,CAAC;oBAED,IAAI,CAAC,EAAE,EAAE,WAAW;wBAChB,IAAI,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;wBAC7B,IAAI,IAAI,GAAG,gFAAgF,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,GAAG,iBAAiB,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,GAAG,+MAA+M,GAAG,EAAE,CAAC,CAAC,C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C,CAAC,SAAS,EAAE,CAAC,CAAC;yBAC/H;6BACI;4BACD,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;yBACvJ;oBAEL,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;4BACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;wBACtC,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBAvDY,sBAAW,cAuDvB,CAAA;YACL,CAAC,EAzDgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAyD1B;QACL,CAAC,EA3DgB,OAAO,GAAP,cAAO,KAAP,cAAO,QA2DvB;IACL,CAAC,EA7DgB,MAAM,GAAN,cAAM,KAAN,cAAM,QA6DtB;AACL,CAAC,EA/DS,OAAO,KAAP,OAAO,QA+DhB"}
|
||||
@@ -0,0 +1,172 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Iconcolor extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName;
|
||||
let html = '<ul class="bg-white text-dark shadow-green rounded-7 font-weight-normal d-flex px-2 h-120p" id="kpi_card_' + id[0].PortletWidgetId + ' kpi-card">' +
|
||||
'<li class="w-60 my-auto">' +
|
||||
'<div class="d-flex justify-content-center mb-1 rounded-5" id="div_kpi_icon_' + id[0].PortletWidgetId + '"><img class="my-2 w-45p imageUpload" src="tenants/themes/compact/imgs/img55.png" onerror="ReloadImage(event)" data-loaded="1">' +
|
||||
'</div>' +
|
||||
'<p class="text-center font-14" style="margin-top:-10px">' + title + '</p>' +
|
||||
'</li>' +
|
||||
'<li class="my-auto w-25 font-30 font-weight-600 text-center border-left border-light-50" style="color:#99bf4d;">' +
|
||||
'<span id="span_widget_' + id[0].PortletWidgetId + '">' +
|
||||
'<span class="ml-1" id="value_widget_' + id[0].PortletWidgetId + '">88</span></span>' +
|
||||
'</li>' +
|
||||
'<li class="w-15 text-right mr-2 pt-2 kpi-link-report">' +
|
||||
'<a href="javascript:;" onclick="Unibase.Themes.Compact.KpiWidgets.Comparision.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ',' + "'" + containerid + "'" + ')";>' +
|
||||
'<small id = "showreport_' + id[0].PortletWidgetId + '" class="font-sm-11"><span class="nav-icon-wrap"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small>' +
|
||||
'</a>' +
|
||||
'</li>' +
|
||||
'</ul>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters) {
|
||||
let instance = this;
|
||||
instance.inputParameters = parameters.InputParameters;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKpiWidgetData(parameters).then(function (response) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, detailContainer, parameters, IsPreview, response) {
|
||||
detailContainer = '.' + detailContainer;
|
||||
var post = response.result;
|
||||
if (post != null) {
|
||||
if (post.IsMaximize == true) {
|
||||
$("#kpi_FullScreen_" + portletwidgetid).removeClass("hidden");
|
||||
}
|
||||
if (response.result.Icon == "" || response.result.Icon == null) {
|
||||
response.result.Icon = "tenants/themes/compact/imgs/img55.png";
|
||||
}
|
||||
var iconhtml = '<img class="img-fluid p-2 rounded-5 w-65p imageUpload" id="kpi_icon_' + portletwidgetid + '"src="' + response.result.Icon + '" /*style = " filter: invert(1);"*/ >';
|
||||
$("#div_kpi_icon_" + portletwidgetid).html(iconhtml);
|
||||
if (response.result.Data != null) {
|
||||
var data = JSON.parse(response.result.Data)[0];
|
||||
}
|
||||
var selected_values = post.Selected_Columns;
|
||||
if (selected_values != null) {
|
||||
var sp = selected_values.split(',');
|
||||
var column1 = sp[0];
|
||||
post.Data = data[column1];
|
||||
}
|
||||
var color = post.Color;
|
||||
var icon = post.Icon;
|
||||
if (color != null) {
|
||||
$(detailContainer).find("#kpi_card_" + portletwidgetid).addClass(color);
|
||||
}
|
||||
if (post.IsFiltarable == true) {
|
||||
$(detailContainer).find(".KpiFilter_" + portletwidgetid + "").removeClass('hidden');
|
||||
}
|
||||
if (post.Data == "0.000" || post.Data == "" || post.Data == null) {
|
||||
post.Data = "0";
|
||||
}
|
||||
if (post.LinkUrl == 'NULL' || post.LinkUrl == null) {
|
||||
$(detailContainer).find("#spanlnk_widget_" + portletwidgetid).remove();
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find("#span_widget_" + portletwidgetid).remove();
|
||||
$(detailContainer).find("#spanlnk_widget_" + portletwidgetid).removeClass("hidden");
|
||||
$(detailContainer).find("#hdn_widget_link_" + portletwidgetid).val(post.LinkUrl);
|
||||
$(detailContainer).find("#lnk_widget_" + portletwidgetid).click(function () {
|
||||
if (post.Data == "0" || Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(post.Data, 2) == 0.00) {
|
||||
alert('No data');
|
||||
}
|
||||
else {
|
||||
}
|
||||
});
|
||||
}
|
||||
var iconhtml = "";
|
||||
if (icon != null && icon != "") {
|
||||
iconhtml = "<span class='mr-10'>" + icon + "</span>";
|
||||
$(detailContainer).find("#kpi_icon_" + portletwidgetid).html(iconhtml);
|
||||
}
|
||||
var l;
|
||||
var m;
|
||||
var n;
|
||||
if (l == true || m == true || n == true)
|
||||
$(detailContainer).find("#value_widget_" + portletwidgetid).text(Unibase.Core.Helpers.NumberHelper.Instance().format(post.Data, 2, ''));
|
||||
else
|
||||
$(detailContainer).find("#value_widget_" + portletwidgetid).text(Unibase.Core.Helpers.NumberHelper.Instance().format(post.Data, 2, ''));
|
||||
if (post.LinkReportId != 0 && post.LinkReportId != null) {
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find("#showreport_" + portletwidgetid).addClass('hidden');
|
||||
}
|
||||
var colors = ["primary", "success", "warning", "danger", "info", "light", "secondary", "dark"];
|
||||
if (response.result.AppConfigurations != null) {
|
||||
if (response.result.AppConfigurations.length != 0) {
|
||||
var designhtml = "";
|
||||
var appconfig = response.result.AppConfigurations;
|
||||
for (var i = 0; i < appconfig.length; i++) {
|
||||
var onlickurl = "";
|
||||
var sname = appconfig[i].SettingName.replace(/ /g, '');
|
||||
designhtml += ' <span class="mr-10"><a href="javascript:;" id="widgetconfig_' + sname + '" onclick="' + onlickurl + '">' +
|
||||
'<button class="btn btn-sm btn-' + colors[i] + ' pull-right btn-rounded text-white">' + appconfig[i].SettingName + '</button>' +
|
||||
'</a> </span>';
|
||||
}
|
||||
designhtml += "</div>";
|
||||
$(detailContainer).find("#config_widget_" + portletwidgetid).html(designhtml);
|
||||
}
|
||||
}
|
||||
}
|
||||
$(detailContainer).siblings('.line-loader').remove();
|
||||
$(detailContainer).removeClass('hidden');
|
||||
}
|
||||
linkReport(widgetid, portletwidgetid, containerid) {
|
||||
var instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKPIWidget(widgetid).then(function (response) {
|
||||
var res = response.result;
|
||||
if (res != null) {
|
||||
let containerid = "div_kpireport_" + portletwidgetid;
|
||||
var rv_obj = Unibase.Platform.Analytics.Components.ReportViewer.Instance();
|
||||
instance.navigationHelper.popup(res.LinkReportId, containerid, rv_obj, null, Unibase.Platform.Helpers.Size.ExtraLarge);
|
||||
}
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Iconcolor();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Iconcolor = Iconcolor;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,60 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Iconleftbarcolor extends KpiWidgets.Manager.KpiManager {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName;
|
||||
let html = '<ul class="position-relative d-flex overflow-hide kpi_card_class_' + id[0].PortletWidgetId + ' kpi-card" id="kpi_card_' + id[0].PortletWidgetId + '" style="height:90px"><li class="w-130p h-100 d-flex justify-content-center"><div class="w-100 bgcolorset_' + id[0].PortletWidgetId + ' bgcolorset d-flex align-item-center justify-content-center border-right-0 kpi-card-left_' + id[0].PortletWidgetId + '" style="background-color: rgb(253, 227, 53); border-radius: 4px 0px 0px 4px; border: 2px solid rgb(253, 227, 53);"><div class="my-auto d-flex align-item-center" id="div_kpi_icon_' + id[0].PortletWidgetId + '"><img class="img-fluid p-1 rounded-5 w-55p h-55p imageUpload" data-dynamic="1" id="kpi_icon_100020390001696" src="tenants/themes/compact/imgs/img55.png" onerror="ReloadImage(event)" data-loaded="1"></div></div></li><li class="border-left-0 h-100 w-100 text-truncate bg-white kpi-card-right_' + id[0].PortletWidgetId + '" style="border: 1px solid rgb(253 227 53); border-radius: 0px 4px 4px 0px;"><ul class="d-flex flex-row h-100"><li class="d-flex flex-column h-100 p-2 my-auto text-truncate"><p class="text-truncate" data-kpi="kpi_font" id="value_Namewidget_' + id[0].PortletWidgetId + '">' + title + '</p><div class="d-flex justify-content-between my-auto"><span class="text-left text-dark text-truncate mr-2 line-height-10 font-weight-400 textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + '" data-value-kpi="kpi_value_font" data-valueBind="Value-1" style="font-size: 38px;">0</span><span class="my-auto" id="config_widget_' + id[0].PortletWidgetId + '"></span></div></li><li class="kpi-link-report"><a href="javascript:void(0)" onclick="Unibase.Themes.Compact.KpiWidgets.Manager.KpiManager.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ',' + "'" + containerid + "'" + ')";><small class="showreport_' + id[0].PortletWidgetId + '" data-LinkReport="LinkReport"><span class="nav-icon-wrap LinkReport_' + id[0].PortletWidgetId + '"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a></li></ul></li></ul>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
instance._load(id, containerid, null);
|
||||
}
|
||||
_loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse) {
|
||||
let instance = this;
|
||||
instance.loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse);
|
||||
}
|
||||
_styling(portletwidgetid, Container, response) {
|
||||
let cssproperty = JSON.parse(response.result.CssProperty);
|
||||
let border = cssproperty[0].BorderWidth + ' ' + cssproperty[0].BorderType + ' ' + cssproperty[0].BorderColor;
|
||||
let borderLeft = cssproperty[0].BorderRadius + ' 0px 0px ' + cssproperty[0].BorderRadius;
|
||||
let height = response.result.KpiHeight + 'px';
|
||||
if (response.result.Icon == "" || response.result.Icon == null) {
|
||||
response.result.Icon = "tenants/themes/compact/imgs/img55.png";
|
||||
}
|
||||
var iconhtml = '<img class="img-fluid p-1 w-55p h-55p imageUpload" data-dynamic="1" id="kpi_icon_' + portletwidgetid + '"src="' + response.result.Icon + '" onerror="ReloadImage(event)">';
|
||||
$("#div_kpi_icon_" + portletwidgetid).html(iconhtml);
|
||||
$(Container).find(".bgcolorset_" + portletwidgetid).css({ "background-color": cssproperty[0].BackgroundColor, "border-radius": borderLeft });
|
||||
$(Container).find("#kpi_card_" + portletwidgetid).css({ "height": height });
|
||||
$(Container).find(".kpi-card-left_" + portletwidgetid).css({ "border": border, "border-radius": cssproperty[0].BorderRadius + ' 0px 0px ' + cssproperty[0].BorderRadius });
|
||||
$(Container).find(".kpi-card-right_" + portletwidgetid).css({ "border": border, "border-radius": '0px ' + cssproperty[0].BorderRadius + ' ' + cssproperty[0].BorderRadius + ' 0px' });
|
||||
if (screen.width < 1198 && cssproperty[0].FontSize == 32) {
|
||||
$(Container).find(".textProperty_" + portletwidgetid).css({ "font-size": "24px", "font-family": cssproperty[0].FontStyle });
|
||||
}
|
||||
else {
|
||||
$(Container).find(".textProperty_" + portletwidgetid).css({ "font-size": cssproperty[0].FontSize + "px", "font-family": cssproperty[0].FontStyle });
|
||||
}
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Iconleftbarcolor();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Iconleftbarcolor = Iconleftbarcolor;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"iconleftbarcolor.js","sourceRoot":"","sources":["iconleftbarcolor.ts"],"names":[],"mappings":"AAGA,IAAU,OAAO,CAqEhB;AArED,WAAU,OAAO;IACb,IAAiB,MAAM,CAmEtB;IAnED,WAAiB,MAAM;QACnB,IAAiB,OAAO,CAiEvB;QAjED,WAAiB,OAAO;YACpB,IAAiB,UAAU,CA+D1B;YA/DD,WAAiB,UAAU;gBACvB,MAAa,gBAAiB,SAAQ,WAAA,OAAO,CAAC,UAAU;oBAQpD,OAAO;wBAEH,OAAO,CAAC,wDAAwD,EAAE,4CAA4C,EAAE,wDAAwD,EAAE,4CAA4C,EAAE,oDAAoD,EAAE,4DAA4D,CAAC,CAAC;oBAChV,CAAC;oBACD,QAAQ;wBAEJ,OAAO,EAAE,CAAC;oBACd,CAAC;oBAED,IAAI,CAAC,EAAE,EAAE,WAAW;wBAChB,IAAI,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;wBAC7B,IAAI,IAAI,GAAG,mEAAmE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,GAAG,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SAAS;4BACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,EAAE,CAAC;wBAC3C,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBA7DY,2BAAgB,mBA6D5B,CAAA;YACL,CAAC,EA/DgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QA+D1B;QACL,CAAC,EAjEgB,OAAO,GAAP,cAAO,KAAP,cAAO,QAiEvB;IACL,CAAC,EAnEgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAmEtB;AACL,CAAC,EArES,OAAO,KAAP,OAAO,QAqEhB"}
|
||||
@@ -0,0 +1,67 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Kpi_fulfillment extends KpiWidgets.Manager.KpiManager {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName;
|
||||
var html = '';
|
||||
if (id[0].PortletWidgetId == 22501) {
|
||||
html = '<div class="card h-160p"><ul class="h-100 d-flex justify-content-center align-items-center"><li class="d-flex justify-content-center font-34 font-weight-500"><span class="mx-2"><i class="la la-plus-circle"></i></span><span>Custom Design</span></li></ul></div>';
|
||||
}
|
||||
if (id[0].PortletWidgetId == 2250) {
|
||||
html = '<textarea class="border-dark h-80 w-100 " data-kpidesigns="CustomDesign" rows="9" cols="90" style="box-shadow: none;"></textarea>';
|
||||
$('#designsPreviewAppend').parents('#tab_preview').removeClass('px-150 py-50').addClass('px-10');
|
||||
}
|
||||
if (id[0].PortletWidgetId != 22501 && id[0].PortletWidgetId != 2250) {
|
||||
html = '<div class="w-100 DynamicHtml_' + containerid + '">' + id[0].CustomHtml + '</div>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
instance._load(id, containerid, null);
|
||||
}
|
||||
_loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse) {
|
||||
let instance = this;
|
||||
instance.loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse);
|
||||
}
|
||||
_styling(portletwidgetid, Container, response) {
|
||||
let cssproperty = JSON.parse(response.result.CssProperty);
|
||||
let border = cssproperty[0].BorderWidth + ' ' + cssproperty[0].BorderType + ' ' + cssproperty[0].BorderColor;
|
||||
let borderLeft = cssproperty[0].BorderRadius + ' 0px 0px ' + cssproperty[0].BorderRadius;
|
||||
let height = response.result.KpiHeight + 'px';
|
||||
if (response.result.Icon == "" || response.result.Icon == null) {
|
||||
response.result.Icon = "tenants/themes/compact/imgs/img55.png";
|
||||
}
|
||||
if (response.result != null) {
|
||||
if (response.result.CustomHtml != '' && response.result.CustomHtml != null && response.result.CustomHtml != undefined) {
|
||||
if ($('#designsPreviewAppend:visible')) {
|
||||
0;
|
||||
$('#designsPreviewAppend:visible [data-kpidesigns="CustomDesign"]').val(response.result.CustomHtml);
|
||||
}
|
||||
}
|
||||
}
|
||||
$(Container).find(".kpivalue_" + portletwidgetid).css({ "font-size": cssproperty[0].FontSize + "px", "font-family": cssproperty[0].FontStyle });
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Kpi_fulfillment();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Kpi_fulfillment = Kpi_fulfillment;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"kpi_fulfillment.js","sourceRoot":"","sources":["kpi_fulfillment.ts"],"names":[],"mappings":"AAGA,IAAU,OAAO,CA4EhB;AA5ED,WAA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CAAC,MAAM,CAAC,UAAU,IAAI,SAAS,EAAE;gCACnH,IAAI,CAAC,CAAC,+BAA+B,CAAC,EAAE;oCACpC,CAAC,CAAA;oCACD,CAAC,CAAC,gEAAgE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;iCACtG;6BACJ;yBACJ;wBACD,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,eAAe,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;oBACpJ,CAAC;oBAGD,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;4BACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;wBAC1C,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBApEY,0BAAe,kBAoE3B,CAAA;YACL,CAAC,EAtEgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAsE1B;QACL,CAAC,EAxEgB,OAAO,GAAP,cAAO,KAAP,cAAO,QAwEvB;IACL,CAAC,EA1EgB,MAAM,GAAN,cAAM,KAAN,cAAM,QA0EtB;AACL,CAAC,EA5ES,OAAO,KAAP,OAAO,QA4EhB"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ikpimanager.js","sourceRoot":"","sources":["ikpimanager.ts"],"names":[],"mappings":""}
|
||||
@@ -0,0 +1,243 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
let Manager;
|
||||
(function (Manager) {
|
||||
class KpiManager extends Unibase.Platform.Core.BaseComponent {
|
||||
_load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters, _portletwidgetid) {
|
||||
let instance = this;
|
||||
instance.inputParameters = parameters.InputParameters;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKpiWidgetData(parameters).then(function (response) {
|
||||
if (_portletwidgetid == undefined) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (_portletwidgetid != 0) {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getPortletWidget(_portletwidgetid).then(function (portletresponse) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response, portletresponse);
|
||||
});
|
||||
}
|
||||
else {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse) {
|
||||
let instance = this, result, selected_values, split_columns = [];
|
||||
let KpiContainer = '.' + Container;
|
||||
let post = response.result, value = [];
|
||||
let cssproperty;
|
||||
var viewerComponent = eval(response.result.Js);
|
||||
let dataType = [], isRoundOff = [], labelsArray = [];
|
||||
labelsArray = response.result.Selected_Columns_Labels.split(',');
|
||||
if (portletresponse != undefined) {
|
||||
if (portletresponse.result.PortletWidgetCss != null && portletresponse.result.PortletWidgetCss != '') {
|
||||
response.result.CssProperty = portletresponse.result.PortletWidgetCss;
|
||||
cssproperty = JSON.parse(portletresponse.result.PortletWidgetCss);
|
||||
response.result.KpiHeight = portletresponse.result.PortletWidgetHeight;
|
||||
}
|
||||
else {
|
||||
response.result.CssProperty = response.result.CssProperty;
|
||||
cssproperty = JSON.parse(response.result.CssProperty);
|
||||
response.result.KpiHeight = response.result.KpiHeight;
|
||||
}
|
||||
}
|
||||
else {
|
||||
response.result.CssProperty = response.result.CssProperty;
|
||||
cssproperty = JSON.parse(response.result.CssProperty);
|
||||
response.result.KpiHeight = response.result.KpiHeight;
|
||||
}
|
||||
viewerComponent._styling(portletwidgetid, KpiContainer, response);
|
||||
if (post != null) {
|
||||
result = JSON.parse(response.result.Data);
|
||||
selected_values = post.Selected_Columns;
|
||||
if (selected_values != null) {
|
||||
split_columns = selected_values.split(',');
|
||||
for (let i = 0; i < split_columns.length; i++) {
|
||||
if (split_columns[i] != null && split_columns[i] != undefined && split_columns[i] != '' && split_columns[i] != "Select Column") {
|
||||
let column = split_columns[i];
|
||||
if (result.length != 0) {
|
||||
value.push(result[0][column]);
|
||||
}
|
||||
else {
|
||||
value.push(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let kpihidden;
|
||||
if (cssproperty[0].KPI_ValueHidden != '' && cssproperty[0].KPI_ValueHidden != null) {
|
||||
kpihidden = cssproperty[0].KPI_ValueHidden.split(',');
|
||||
for (let i = 0; i < kpihidden.length; i++) {
|
||||
if (kpihidden[i] == 'true' && kpihidden[i] != '' && kpihidden[i] != null && kpihidden[i].length != 0) {
|
||||
$('.kpivalue_' + (i + 1) + '_' + portletwidgetid).attr('data-hidden-check', 'true').addClass('align-items-end').find('div').last().remove();
|
||||
if (i + 1 == 3) {
|
||||
$('.card-body-kpi-CBBC-' + portletwidgetid).removeAttr("style").addClass("h-100");
|
||||
}
|
||||
if (i + 1 == 2) {
|
||||
$('.card-body-kpi-TVBBC-' + portletwidgetid).removeAttr("style").addClass("h-100");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let kpisettingJSON;
|
||||
if (response.result.KpiSetting != undefined)
|
||||
kpisettingJSON = JSON.parse(response.result.KpiSetting);
|
||||
dataType = kpisettingJSON[0].DataType.split(',');
|
||||
isRoundOff = kpisettingJSON[0].IsRoundOff.split(',');
|
||||
let _value, stringBind = [];
|
||||
for (let b = 0; b < value.length; b++) {
|
||||
let e = b + 1;
|
||||
_value = value[b];
|
||||
if (dataType[b] != '' && dataType[b] != null && dataType[b] != undefined) {
|
||||
if (dataType[b] == 'int') {
|
||||
_value = Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(value[b], 0);
|
||||
}
|
||||
if (dataType[b] == 'float') {
|
||||
_value = Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(value[b], 2);
|
||||
}
|
||||
if (dataType[b] == 'char' || dataType[b] == 'varchar') {
|
||||
_value = value[b];
|
||||
}
|
||||
if (dataType[b] == 'INR') {
|
||||
_value = Unibase.Core.Helpers.NumberHelper.Instance().format(value[b], 2, '') + '<span class="pl-2 font-weight-400" style="font-size:20px">INR</span>';
|
||||
}
|
||||
if (dataType[b] == 'percent') {
|
||||
_value = Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(value[b], 0) + '<span>%</span>';
|
||||
$(KpiContainer).find('.kpivalue_' + portletwidgetid + '[role="progressbar"][data-valueBind="Value-' + e + '"]').css("width", Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(value[b], 0) + '%').html('');
|
||||
}
|
||||
}
|
||||
if (isRoundOff[b] != '' && isRoundOff[b] != null && isRoundOff[b] != undefined && isRoundOff[b] == 'true') {
|
||||
_value = Unibase.Core.Helpers.NumberHelper.Instance().format(value[b], 2, '');
|
||||
}
|
||||
$(KpiContainer).find('[data-valueBind="Value-' + e + '"]').html(_value).attr('title', _value).addClass('text-truncate');
|
||||
$(KpiContainer).find('[data-valueLabelBind="Value-' + e + '"]').text(labelsArray[b]);
|
||||
$(KpiContainer).find('.kpivalue_' + portletwidgetid + '[role="progressbar"][data-valueBind="Value-' + e + '"]').html('');
|
||||
}
|
||||
if (post.LinkReportId != 0 && post.LinkReportId != null) {
|
||||
if (cssproperty[0].KPI_LinkReportLabelName != undefined && cssproperty[0].KPI_LinkReportLabelName != null && cssproperty[0].KPI_LinkReportLabelName != '') {
|
||||
$(KpiContainer).find('.LinkReport_' + portletwidgetid + '').html('<span class="btn btn-xs btn-outline-primary rounded-4">' + cssproperty[0].KPI_LinkReportLabelName + '</span>');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$(KpiContainer).find('[data-LinkReport="LinkReport"]').addClass('hidden');
|
||||
}
|
||||
if (response.result.AppConfigurations != null && response.result.AppConfigurations != '[]' && response.result.AppConfigurations != '' && response.result.AppConfigurations != undefined) {
|
||||
instance.appConfiguration(portletwidgetid, KpiContainer, response);
|
||||
}
|
||||
$(KpiContainer).ready(function () {
|
||||
eval(response.result.StaticJsPath.replace(/`/g, ''));
|
||||
});
|
||||
$(KpiContainer).siblings('.line-loader').remove();
|
||||
$(KpiContainer).removeClass('hidden');
|
||||
}
|
||||
}
|
||||
linkReport(widgetid, portletwidgetid, containerid) {
|
||||
var instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKPIWidget(widgetid).then(function (response) {
|
||||
var res = response.result;
|
||||
if (res != null) {
|
||||
let containerid = "div_kpireport_" + portletwidgetid;
|
||||
var rv_obj = Unibase.Platform.Analytics.Components.ReportViewer.Instance();
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().popup(res.LinkReportId, containerid, rv_obj, null, Unibase.Platform.Helpers.Size.ExtraLarge);
|
||||
}
|
||||
});
|
||||
}
|
||||
appConfiguration(portletwidgetid, containerid, response) {
|
||||
let instance = this;
|
||||
if (response.result.AppConfigurations.length != 0) {
|
||||
var designhtml = "";
|
||||
var colors = ["primary", "success", "warning", "danger", "info", "light", "secondary", "dark"];
|
||||
var appconfig = response.result.AppConfigurations;
|
||||
for (var i = 0; i < appconfig.length; i++) {
|
||||
var onlickurl = "";
|
||||
var sname = appconfig[i].SettingName.replace(/ /g, '');
|
||||
onlickurl = instance.loadAppconfigurations(appconfig[i], response.result.Data, portletwidgetid);
|
||||
designhtml += ' <span class="mr-10"><a href="javascript:;" id="widgetconfig_' + sname + '" onclick="' + onlickurl + '">' +
|
||||
'<button class="btn btn-sm btn-' + colors[i] + ' pull-right text-white">' + appconfig[i].SettingName + '</button>' +
|
||||
'</a> </span>';
|
||||
}
|
||||
designhtml += "</div>";
|
||||
$(containerid).find("#config_widget_" + portletwidgetid).html(designhtml);
|
||||
}
|
||||
}
|
||||
loadAppconfigurations(config, data, portletwidgetid) {
|
||||
var instance = this;
|
||||
let settingurltype = config.SettingUrlType;
|
||||
var appconfigurationid = config.AppConfigurationId;
|
||||
var settingUrl = config.SettingUrl;
|
||||
var jsfunction = config.JsFunction;
|
||||
var formid = config.FormId;
|
||||
let editformid;
|
||||
var formpkname = config.FormPrimaryColumn;
|
||||
if (data.length <= 0) {
|
||||
editformid = 0;
|
||||
}
|
||||
else {
|
||||
editformid = 0;
|
||||
}
|
||||
var onclick = "";
|
||||
if (settingurltype == 2) {
|
||||
onclick = "this.fileCacheHelper.loadJsFile('" + config.SettingUrl + "', function () {var html = Unibase.Apps.Components.Stages.Instance().init();NavigationHelper.Instance().loadPopupHtml(html, Helpers.Size.DockLeft, function(containerid) {" + config.JsFunction + " ;});});";
|
||||
}
|
||||
else if (settingurltype == 1) {
|
||||
onclick = 'Unibase.Platform.Helpers.NavigationHelper.Instance().loadForm(' + formid + ', ' + editformid + ',' + appconfigurationid + ',' + portletwidgetid + ' )';
|
||||
}
|
||||
else if (settingurltype == 3) {
|
||||
let variablename = "Widget_" + config.SettingUrl.split(",")[0].split(".")[0].trim();
|
||||
let methodname = config.SettingUrl.split(",")[1];
|
||||
var onclickurl = "Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('Widgets/" + config.SettingUrl.split(",")[0] + "', function () { " + variablename + "." + methodname + " });";
|
||||
onclick = onclickurl;
|
||||
}
|
||||
else if (settingurltype == 10) {
|
||||
onclick = "Unibase.Themes.Compact.Components.Nav.Instance().loadDashboard(" + config.LinkDashboardId + ",'Overview')";
|
||||
}
|
||||
else if (settingurltype == 11) {
|
||||
onclick = "Unibase.Themes.Compact.Components.Nav.Instance().loadDashboardsInDashboard(" + config.LinkDashboardGroupId + ",0,true)";
|
||||
}
|
||||
return onclick;
|
||||
}
|
||||
static Instance() {
|
||||
if (this._instance === undefined)
|
||||
this._instance = new KpiManager();
|
||||
return this._instance;
|
||||
}
|
||||
}
|
||||
Manager.KpiManager = KpiManager;
|
||||
})(Manager = KpiWidgets.Manager || (KpiWidgets.Manager = {}));
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,127 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Owlcarouselslider extends Unibase.Platform.Core.BaseComponent {
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName;
|
||||
var html = '<div class="card mb-0 card-sm bgcolorset_' + id[0].PortletWidgetId + ' kpi_card_class_' + id[0].PortletWidgetId + '"><div class="card-body border-0 p-0"><div id="sales_slider_' + id[0].PortletWidgetId + '" class="carousel slide"><div class="d-flex font-weight-500 text-dark px-3 py-2" ><div class="w-95 "> <span class="w-100 font-16 mt-5" id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '">' + title + '</span></div> <span class="w-15 text-right"><a href="#" class="pull-right reportappend"></a></span></div><div class="bottom-carousel px-0"><div class="d-flex flex-row"><div class="owl-carousel carousel-inner w-100 d-flex"> <div class="item w-25 teal-light-4 carouselItem_0 active"><div class="bg-teal-light-4"> <span class="d-flex flex-column font-weight-500 pb-2 text-dark"> <span class="textProperty_100020390001757" style="font-size: 32px;">236</span> <span class="font-13 font-weight-normal text-dark">Lead</span> </span></div></div><div class="item w-25 neon-light-2 carouselItem_1"><div class="bg-neon-light-2"> <span class="d-flex flex-column font-weight-500 pb-2 text-dark"> <span class="textProperty_100020390001757" style="font-size: 32px;">16</span> <span class="font-13 font-weight-normal text-dark">Qualify</span> </span></div></div><div class="item w-25 yellow-light-2 carouselItem_2"><div class="bg-yellow-light-2"> <span class="d-flex flex-column font-weight-500 pb-2 text-dark"> <span class="textProperty_100020390001757" style="font-size: 32px;">331</span> <span class="font-13 font-weight-normal text-dark">Total Customers</span> </span></div></div><div class="item w-25 pink-light-4 carouselItem_3"><div class="bg-pink-light-4"> <span class="d-flex flex-column font-weight-500 pb-2 text-dark"> <span class="textProperty_100020390001757" style="font-size: 32px;">75</span> <span class="font-13 font-weight-normal text-dark">Confirmed</span> </span></div></div><div class="item w-25 d-none carouselItem_4"><div class="bg-d-none"> <span class="d-flex flex-column font-weight-500 pb-2 text-dark"> <span class="textProperty_100020390001757" style="font-size: 32px;">3</span> <span class="font-13 font-weight-normal text-dark">Rejected</span> </span></div></div> </div></div></div></div></div></div></div>';
|
||||
return html;
|
||||
}
|
||||
jsFiles() {
|
||||
return ["platform/widgets/managers/interfaces/iwidgetmanager.js", "platform/widgets/managers/widgetmanager.js", "platform/core/helpers/propertyhelper/propertyhelper.js", "platform/core/helpers/token/tokenhelper.js", "platform/core/helpers/numberhelper/numberhelper.js", "platform/analytics/components/reportviewer/reportviewer.js", "https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters) {
|
||||
let instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKpiWidgetData(parameters).then(function (response) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, containerid, parameters, IsPreview, response) {
|
||||
containerid = "." + containerid;
|
||||
var instance = this;
|
||||
var cssproperty = JSON.parse(response.result.CssProperty);
|
||||
if (response.result != null) {
|
||||
var post = response.result;
|
||||
var data = JSON.parse(post.Data);
|
||||
var obj = new Object();
|
||||
var parentobj = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var data_1 = data[i];
|
||||
var j = 1;
|
||||
for (var key in data_1) {
|
||||
obj['Value_' + j] = data_1[key];
|
||||
j++;
|
||||
}
|
||||
parentobj.push({
|
||||
value_1: obj["Value_1"],
|
||||
value_2: obj["Value_2"],
|
||||
value_3: obj["Value_3"]
|
||||
});
|
||||
var margin = "margin-top:-5px";
|
||||
if (parentobj[i].value_3 == undefined || parentobj[i].value_3 == null) {
|
||||
parentobj[i].value_3 = "";
|
||||
margin = "margin-top:5px";
|
||||
}
|
||||
}
|
||||
var html = "", html2 = "", bg_color = '';
|
||||
for (var i = 0; i < parentobj.length; i++) {
|
||||
if (i == 0) {
|
||||
bg_color = 'teal-light-4';
|
||||
}
|
||||
if (i == 1) {
|
||||
bg_color = 'neon-light-2';
|
||||
}
|
||||
if (i == 2) {
|
||||
bg_color = 'yellow-light-2';
|
||||
}
|
||||
if (i == 3) {
|
||||
bg_color = 'pink-light-4';
|
||||
}
|
||||
if (i == 4) {
|
||||
bg_color = 'd-none';
|
||||
}
|
||||
html += '<div class="item w-25 ' + bg_color + ' carouselItem_' + i + '"><div class="bg-' + bg_color + '"> <span class="d-flex flex-column font-weight-500 pb-2 text-dark"> <span class="textProperty_' + portletwidgetid + '">' + parentobj[i].value_2 + '</span> <span class="font-13 font-weight-normal text-dark">' + parentobj[i].value_1 + '</span> </span></div></div>';
|
||||
html2 = '<small id="showreport_' + portletwidgetid + '" class="showreport_' + portletwidgetid + ' font-sm-11"><span class="nav-icon-wrap"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small>';
|
||||
}
|
||||
$(".owl-carousel").owlCarousel({
|
||||
items: 3,
|
||||
nav: true,
|
||||
loop: true,
|
||||
autoplay: false
|
||||
});
|
||||
$(containerid).find(".carousel-inner").html(html);
|
||||
$(containerid).find('.textProperty_' + portletwidgetid).css({ "font-size": cssproperty[0].FontSize + 'px' });
|
||||
$(containerid).find(".reportappend").html(html2);
|
||||
$(containerid).find(".carouselItem_0").addClass('active');
|
||||
$(containerid).find('#sales_slider_' + portletwidgetid).carousel({
|
||||
interval: 3000
|
||||
});
|
||||
$(containerid).find('#sales_slider_' + portletwidgetid).carousel("cycle");
|
||||
var colors = ["primary", "success", "warning", "danger", "info", "light", "secondary", "dark"];
|
||||
}
|
||||
$(containerid).siblings('.line-loader').remove();
|
||||
$(containerid).removeClass('hidden');
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Owlcarouselslider();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Owlcarouselslider = Owlcarouselslider;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,55 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Singlevalueborder extends KpiWidgets.Manager.KpiManager {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName, html = '';
|
||||
if (id[0].PortletWidgetId == 22501 || id[0].PortletWidgetId == 2250) {
|
||||
html = '<ul class="text-dark font-weight-500 d-flex flex-column overflow-hide bgcolorset_' + id[0].PortletWidgetId + ' kpi_card_class_' + id[0].PortletWidgetId + ' kpi-card" style="border-width: 1px 1px 12px; border-style: solid; border-color: #8fc06b; border-radius: 4px; height: 90px; background-color:#e4ffd0;"><li class="kpi-link-report"><a href="javascript:;" onclick="Unibase.Themes.Compact.KpiWidgets.Comparision.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ',' + "'" + containerid + "'" + ')";> <small class= "showreport_' + id[0].PortletWidgetId + '" data-LinkReport="LinkReport"><span class="nav-icon-wrap LinkReport_' + id[0].PortletWidgetId + '"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a></li><div class="d-flex p-2 h-100"><div class="d-flex flex-column w-100 font-30 font-weight-400"><div class="d-flex justify-content-between"><span class="textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + ' line-height-10" data-valuebind="Value-1" style="font-size: 32px;">0</span><span class="my-auto" id="config_widget_' + id[0].PortletWidgetId + '"></span></div><span class="text-truncate my-auto labels_' + id[0].PortletWidgetId + '" data-kpi="kpi_font">' + title + '</span></div></div></ul>';
|
||||
}
|
||||
else {
|
||||
html = '<ul class="position-relative text-dark font-weight-500 d-flex flex-column overflow-hide bgcolorset_' + id[0].PortletWidgetId + ' kpi_card_class_' + id[0].PortletWidgetId + ' kpi-card" style="border-width: 1px 1px 12px; border-style: solid; border-color: #fff; border-radius: 4px; height: 90px; background-color:#fff;"><li class="kpi-link-report"><a href="javascript:;" onclick="Unibase.Themes.Compact.KpiWidgets.Comparision.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ',' + "'" + containerid + "'" + ')";> <small class= "showreport_' + id[0].PortletWidgetId + '" data-LinkReport="LinkReport"><span class="nav-icon-wrap LinkReport_' + id[0].PortletWidgetId + '"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small> </a></li><div class="d-flex p-2 h-100"><div class="d-flex flex-column w-100 font-30 font-weight-400"><div class="d-flex justify-content-between"><span class="textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + ' line-height-10" data-valuebind="Value-1" style="font-size: 32px;" data-value-kpi="kpi_value_font">0</span><span class="my-auto" id="config_widget_' + id[0].PortletWidgetId + '"></span></div><span class="text-truncate my-auto labels_' + id[0].PortletWidgetId + '" data-kpi="kpi_font">' + title + '</span></div></div></ul>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
instance._load(id, containerid, null);
|
||||
}
|
||||
_loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse) {
|
||||
let instance = this;
|
||||
instance.loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse);
|
||||
}
|
||||
_styling(portletwidgetid, Container, response) {
|
||||
let cssproperty = JSON.parse(response.result.CssProperty);
|
||||
let height = response.result.KpiHeight + 'px';
|
||||
$(Container).find(".kpi_card_class_" + portletwidgetid).css({ "border-width": cssproperty[0].BorderWidth, "border-style": cssproperty[0].BorderType, "border-color": cssproperty[0].BorderColor, "border-radius": cssproperty[0].BorderRadius, "border-bottom": "12px solid" + cssproperty[0].BorderColor, "height": height, "background-color": cssproperty[0].BackgroundColor });
|
||||
if (screen.width < 1198 && cssproperty[0].FontSize == 32) {
|
||||
$(Container).find(".textProperty_" + portletwidgetid).css({ "font-size": "24px", "font-family": cssproperty[0].FontStyle });
|
||||
}
|
||||
else {
|
||||
$(Container).find(".textProperty_" + portletwidgetid).css({ "font-size": cssproperty[0].FontSize + "px", "font-family": cssproperty[0].FontStyle });
|
||||
}
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Singlevalueborder();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Singlevalueborder = Singlevalueborder;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"singlevalueborder.js","sourceRoot":"","sources":["singlevalueborder.ts"],"names":[],"mappings":"AAGA,IAAU,OAAO,CA6DhB;AA7DD,WAAU,OAAO;IACb,IAAiB,MAAM,CA2DtB;IA3DD,WAAiB,MAAM;QACnB,IAAiB,OAAO,CAyDvB;QAzDD,WAAiB,OAAO;YACpB,IAAiB,UAAU,CAuD1B;YAvDD,WAAiB,UAAU;gBACvB,MAAa,iBAAkB,SAAQ,WAAA,OAAO,CAAC,UAAU;oBASrD,OAAO;wBAEH,OAAO,CAAC,wDAAwD,EAAE,4CAA4C,EAAE,wDAAwD,EAAE,4CAA4C,EAAE,oDAAoD,EAAE,4DAA4D,CAAC,CAAC;oBAChV,CAAC;oBACD,QAAQ;wBAEJ,OAAO,EAAE,CAAC;oBACd,CAAC;oBAED,IAAI,CAAC,EAAE,EAAE,WAAW;wBAChB,IAAI,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,IAAI,GAAE,EAAE,CAAC;wBACvC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,IAAI,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,IAAI,IAAI,EAAE;4BACjE,IAAI,GAAG,mFAAmF,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,GAAG,kBAAkB,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,GAAG,kTAAkT,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,GAAG,YAAY,GAAG,EAAE,CAA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AAI,CAAC,gBAAgB,GAAG,eAAe,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;yBAC/H;6BACI;4BACD,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;yBACvJ;oBACL,CAAC;oBAGD,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;4BACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAC;wBAC5C,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBArDY,4BAAiB,oBAqD7B,CAAA;YACL,CAAC,EAvDgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAuD1B;QACL,CAAC,EAzDgB,OAAO,GAAP,cAAO,KAAP,cAAO,QAyDvB;IACL,CAAC,EA3DgB,MAAM,GAAN,cAAM,KAAN,cAAM,QA2DtB;AACL,CAAC,EA7DS,OAAO,KAAP,OAAO,QA6DhB"}
|
||||
@@ -0,0 +1,75 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Singlevaluepiechart extends KpiWidgets.Manager.KpiManager {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName, html = '';
|
||||
if (id[0].PortletWidgetId == 22501 || id[0].PortletWidgetId == 2250) {
|
||||
html = '<ul class="p-2 card mb-0 d-flex flex-column overflow-hide bgcolorset_' + id[0].PortletWidgetId + ' kpi_card_class_' + id[0].PortletWidgetId + ' kpi-card" style="background-color:#ffeadd;border-width:1px;border-style:solid;border-color:#fcc09b;border-radius:4px; height:180px;"><li class="kpi-link-report"><a href="javascript:void(0);" onclick="Unibase.Themes.Compact.KpiWidgets.Manager.KpiManager.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ',' + containerid + ')"><small class="showreport_' + id[0].PortletWidgetId + '" data-LinkReport="LinkReport"><span class="nav-icon-wrap LinkReport_' + id[0].PortletWidgetId + '"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a></li><div><li class="w-100 d-flex justify-content-center align-items-center"><span class="text-dark"><i class="fa fa-user-plus fa-2x"></i></span><div id="div_kpi_icon_' + id[0].PortletWidgetId + '"><img class="img-fluid p-1 d-none rounded-5 w-55p h-55p imageUpload" data-imageUpload="true" data-dynamic="1" id="kpi_icon_' + id[0].PortletWidgetId + '" src="tenants/themes/compact/imgs/img55.png" onerror="ReloadImage(event)" data-loaded="1"></div></li><li class="w-100 d-flex justify-content-center align-items-center kpivalue_1_' + id[0].PortletWidgetId + '"><span class="w-90 mx-20 text-truncate text-center" id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '" data-kpi="kpi_font">' + title + '</span></li><li class="w-100 d-flex justify-content-center align-items-center kpivalue_1_' + id[0].PortletWidgetId + '"><span class="text-dark textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-1" style="font-size:34px">00000</span></li><li class="w-100 d-flex justify-content-center align-items-center kpivalue_2_' + id[0].PortletWidgetId + '" ><span><span class="pr-1 kpivalueLabel_' + id[0].PortletWidgetId + '" data-valueLabelBind="Value-1" data-kpi="kpi_font">Increases By</span><span class="kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-2">0%</span></span></li></div></ul>';
|
||||
}
|
||||
else {
|
||||
html = '<ul class="position-relative p-2 card mb-0 d-flex flex-column overflow-hide bgcolorset_' + id[0].PortletWidgetId + ' kpi_card_class_' + id[0].PortletWidgetId + ' kpi-card" style="background-color:#fff;border-width:1px;border-style:solid;border-color:#fff;border-radius:4px; height:180px;"><li class="kpi-link-report"><a href="javascript:void(0);" onclick="Unibase.Themes.Compact.KpiWidgets.Manager.KpiManager.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ',' + containerid + ')"><small class="showreport_' + id[0].PortletWidgetId + '" data-LinkReport="LinkReport"><span class="nav-icon-wrap LinkReport_' + id[0].PortletWidgetId + '"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a></li><div class="d-flex flex-column h-100 justify-content-center"><li class="w-100 my-auto d-flex justify-content-center align-items-center" ><span class="text-dark"><i class="fa fa-user-plus fa-2x"></i></span><div id="div_kpi_icon_' + id[0].PortletWidgetId + '"><img class="img-fluid p-1 d-none rounded-5 w-55p h-55p imageUpload" data-imageUpload="true" data-dynamic="1" id="kpi_icon_' + id[0].PortletWidgetId + '" src="tenants/themes/compact/imgs/img55.png" onerror="ReloadImage(event)" data-loaded="1"></div></li><li><ul class="d-flex flex-column"><li class="w-100 d-flex justify-content-center align-items-center kpivalue_1_' + id[0].PortletWidgetId + '"><span class="w-90 mx-20 text-truncate text-center" id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '" data-kpi="kpi_font">' + title + '</span></li><li class="w-100 d-flex justify-content-center align-items-center kpivalue_1_' + id[0].PortletWidgetId + '"><span class="text-dark textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-1" style="font-size:34px">00000</span></li></ul></li><li class="w-100 d-flex justify-content-center align-items-center kpivalue_2_' + id[0].PortletWidgetId + '"><span><span class="pr-1 kpivalueLabel_' + id[0].PortletWidgetId + '" data-valueLabelBind="Value-1" data-kpi="kpi_font">Increases By</span><span class="kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-2">0%</span></span></li></div></ul>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
instance._load(id, containerid, null);
|
||||
}
|
||||
_loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse) {
|
||||
let instance = this;
|
||||
instance.loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse);
|
||||
}
|
||||
_styling(portletwidgetid, Container, response) {
|
||||
let cssproperty = JSON.parse(response.result.CssProperty);
|
||||
let height = response.result.KpiHeight + 'px';
|
||||
var iconhtml = '<img class="img-fluid p-1 w-55p h-55p imageUpload"id="kpi_icon_' + portletwidgetid + '"src="' + response.result.Icon + '" data-dynamic="1" data-loaded="0" onerror="ReloadImage(event)">';
|
||||
if (response.result.Icon != '') {
|
||||
$(Container).find("#div_kpi_icon_" + portletwidgetid).siblings('span').remove();
|
||||
$("#div_kpi_icon_" + portletwidgetid).html(iconhtml);
|
||||
}
|
||||
else {
|
||||
$(Container).find("#div_kpi_icon_" + portletwidgetid).siblings('span').remove();
|
||||
$(Container).find("#div_kpi_icon_" + portletwidgetid).parent().remove();
|
||||
}
|
||||
$(Container).find(".bgcolorset_" + portletwidgetid + "").css({
|
||||
"background-color": cssproperty[0].BackgroundColor, "border-width": cssproperty[0].BorderWidth, "border-style": cssproperty[0].BorderType, "border-color": cssproperty[0].BorderColor, "border-radius": cssproperty[0].BorderColor, "height": height
|
||||
});
|
||||
$(Container).find(".kpivalue_" + portletwidgetid + '[data-valuebind="Value-1"]').css({ "font-size": cssproperty[0].FontSize + "px", "font-family": cssproperty[0].FontStyle });
|
||||
let kpihidden;
|
||||
if (cssproperty[0].KPI_ValueHidden != '' && cssproperty[0].KPI_ValueHidden != null) {
|
||||
kpihidden = cssproperty[0].KPI_ValueHidden.split(',');
|
||||
for (let i = 0; i < kpihidden.length; i++) {
|
||||
$('.kpivalue_2_' + portletwidgetid).addClass("mt-3");
|
||||
if (kpihidden[i] == 'true' && kpihidden[i] != '' && kpihidden[i] != null && kpihidden[i].length != 0) {
|
||||
$('.kpivalue_' + (i + 1) + '_' + portletwidgetid).removeClass('d-flex').addClass('d-none');
|
||||
if (kpihidden[1] == 'true') {
|
||||
$('.kpivalue_2_' + portletwidgetid).css('margin-top', '0px');
|
||||
$('.kpivalue_1_' + portletwidgetid).css('margin-top', '0px');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Singlevaluepiechart();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Singlevaluepiechart = Singlevaluepiechart;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,154 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class TwoValue extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName;
|
||||
let html = '<div class="card mb-0 card-sm kpi-card" id="widget_kpis_TwoValue">' +
|
||||
'<a href="javascript:;" class="kpi-link-report" onclick = "Unibase.Themes.Compact.KpiWidgets.TwoValue.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ',' + "'" + containerid + "'" + ')" style = "margin-top:-20px;" > <small id="showreport_' + id[0].PortletWidgetId + '" class="font-sm-11"><span class="nav-icon-wrap"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a>' +
|
||||
'<div class="card-body p-2">' +
|
||||
'<span class="d-block mb-10" ><span id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '" data-kpi="kpi_font">' + title + '</span>' +
|
||||
'<span class="d-block align-items-center card-action-wrap pull-right font-11" >' +
|
||||
'<a href="#" class="inline-block full-screen mr-15 hidden" id="kpi_FullScreen_' + id[0].PortletWidgetId + '">' +
|
||||
'<i class="ion ion-md-expand"></i>' +
|
||||
'</a>' +
|
||||
'</span>' +
|
||||
'<span id="config_widget_' + id[0].PortletWidgetId + '"></span>' +
|
||||
'</span>' +
|
||||
'<div class="pull-right" style="margin-top:-10px;"><div id="span_kpi_icon_' + id[0].PortletWidgetId + '" ></div></div>' +
|
||||
'<span class="d-block display-7" style="font-weight:400;font-size:20px;" id="kpi_Twovalue_1_' + id[0].PortletWidgetId + '">000000</span>' +
|
||||
'<small id="kpi_Twovalue_2_' + id[0].PortletWidgetId + '">000</small><br>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters) {
|
||||
let instance = this;
|
||||
instance.inputParameters = parameters.InputParameters;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKpiWidgetData(parameters).then(function (response) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, detailcontainer, parameters, IsPreview, response) {
|
||||
detailcontainer = '.' + detailcontainer;
|
||||
var post = response.result;
|
||||
if (post != null) {
|
||||
if (post.IsMaximize == true) {
|
||||
$("#kpi_FullScreen_" + portletwidgetid).removeClass("hidden");
|
||||
}
|
||||
if (post.Data == null || post.Data == "" || post.Data == '[]') {
|
||||
$(detailcontainer).find("#kpi_Twovalue_1_" + portletwidgetid).removeClass('display-6');
|
||||
$(detailcontainer).find("#kpi_Twovalue_1_" + portletwidgetid).addClass('display-8');
|
||||
$(detailcontainer).find("#kpi_Twovalue_1_" + portletwidgetid).text("No Data");
|
||||
}
|
||||
else {
|
||||
var data = JSON.parse(post.Data)[0];
|
||||
var selected_values = post.Selected_Columns;
|
||||
if (selected_values != null) {
|
||||
var sp = selected_values.split(',');
|
||||
var column1 = sp[0];
|
||||
var column2 = sp[1];
|
||||
}
|
||||
var Value_1 = data[column1];
|
||||
var Value_2 = data[column2];
|
||||
if (isNaN(Value_1)) {
|
||||
}
|
||||
else {
|
||||
Value_1 = Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(Value_1, 2);
|
||||
}
|
||||
$(detailcontainer).find("#kpi_Twovalue_1_" + portletwidgetid).text(Value_1);
|
||||
$(detailcontainer).find("#kpi_Twovalue_2_" + portletwidgetid).text(Value_2);
|
||||
if (post.Icon != "" || post.Icon != null) {
|
||||
let iconhtml = '<img id="kpi_icon_' + portletwidgetid + '"src="' + post.Icon + '" style="width:50px;"/>';
|
||||
$("#span_kpi_icon_" + portletwidgetid).html(iconhtml);
|
||||
}
|
||||
}
|
||||
var color = post.Color;
|
||||
if (post.Color != "" && post.Color != null) {
|
||||
$(detailcontainer).find("#kpi_Twovalue_1_" + portletwidgetid).addClass("text-" + color);
|
||||
}
|
||||
var colors = ["primary", "success", "warning", "danger", "info", "light", "secondary", "dark"];
|
||||
if (response.result.AppConfigurations != null) {
|
||||
if (response.result.AppConfigurations.length != 0) {
|
||||
var designhtml = "";
|
||||
var appconfig = response.result.AppConfigurations;
|
||||
for (var i = 0; i < appconfig.length; i++) {
|
||||
var onlickurl = "";
|
||||
var sname = appconfig[i].SettingName.replace(/ /g, '');
|
||||
designhtml += ' <span class="mr-10"><a href="javascript:;" id="widgetconfig_' + sname + '" onclick="' + onlickurl + '">' +
|
||||
'<button class="btn btn-sm btn-' + colors[i] + ' pull-right btn-rounded text-white">' + appconfig[i].SettingName + '</button>' +
|
||||
'</a> </span>';
|
||||
}
|
||||
designhtml += "</div>";
|
||||
$(detailcontainer).find("#config_widget_" + portletwidgetid).html(designhtml);
|
||||
}
|
||||
}
|
||||
if (response.result.ReportId == 0 || response.result.ReportId == null) {
|
||||
$(detailcontainer).find("#showreport_" + portletwidgetid).addClass("hidden");
|
||||
}
|
||||
if (post.LinkReportId != 0 && post.LinkReportId != null) {
|
||||
}
|
||||
else {
|
||||
$(detailcontainer).find("#showreport_" + portletwidgetid).addClass('hidden');
|
||||
}
|
||||
}
|
||||
$(detailcontainer).siblings('.line-loader').remove();
|
||||
$(detailcontainer).removeClass('hidden');
|
||||
}
|
||||
linkReport(widgetid, portletwidgetid, containerid) {
|
||||
var instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKPIWidget(widgetid).then(function (response) {
|
||||
var res = response.result;
|
||||
if (res != null) {
|
||||
let containerid = "div_kpireport_" + portletwidgetid;
|
||||
var rv_obj = Unibase.Platform.Analytics.Components.ReportViewer.Instance();
|
||||
instance.navigationHelper.popup(res.LinkReportId, containerid, rv_obj, null, Unibase.Platform.Helpers.Size.ExtraLarge);
|
||||
}
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new TwoValue();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.TwoValue = TwoValue;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,63 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Twovaluebgcolor extends KpiWidgets.Manager.KpiManager {
|
||||
jsFiles() {
|
||||
return ["platform/widgets/managers/interfaces/iwidgetmanager.js", "platform/widgets/managers/widgetmanager.js", "platform/core/helpers/propertyhelper/propertyhelper.js", "platform/core/helpers/token/tokenhelper.js", "platform/core/helpers/numberhelper/numberhelper.js", "platform/analytics/components/reportviewer/reportviewer.js", "platform/analytics/components/reportviewer/linkreport.js"];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName, html = '';
|
||||
if (id[0].PortletWidgetId == 22501 || id[0].PortletWidgetId == 2250) {
|
||||
html = '<ul class="text-dark color_' + id[0].PortletWidgetId + ' font-weight-500 p-2 d-flex flex-column kpi_card_class_' + id[0].PortletWidgetId + ' bgcolorset_' + id[0].PortletWidgetId + ' kpi-card" id="widget_kpis_TwoValue" style="border-width:1px;border-style:solid;border-color:#d4a192;height:90px;border-radius:4px;background-color:#f0cdc3;"><li class="kpi-link-report"><a href="javascript:void(0);" onclick="Unibase.Themes.Compact.KpiWidgets.Manager.KpiManager.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ', ' + containerid + ')" id="showreport_' + id[0].PortletWidgetId + '" ><small class="showreport_' + id[0].PortletWidgetId + '" data-LinkReport="LinkReport"><span class="nav-icon-wrap LinkReport_' + id[0].PortletWidgetId + '"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a></li><li class="d-flex justify-content-between " data-height="height1" style="height:59px"><div class="d-flex flex-row mr-2 text-truncate align-items-center"><div class="w-45p h-45p mr-2" id="div_kpi_icon_' + id[0].PortletWidgetId + '"><img src="tenants/themes/compact/imgs/img55.png" onerror="ReloadImage(event)" data-dynamic="1" class="img-fluid imageUpload" style="filter: invert(1);"></div><div class="d-flex flex-column text-truncate" style="margin-top:-5px"> <span class="textProperty_' + id[0].PortletWidgetId + ' font-weight-400 text-truncate text-dark kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-1" style="font-size:20px;">00</span> <span id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '" data-kpi="kpi_font">' + title + '</span></div></div><span class="ml-auto pr-3" id="config_widget_' + id[0].PortletWidgetId + '"></span></li><li style="height:3px; border-bottom: 1px dashed green;"></li><li class="d-flex justify-content-between align-items-center my-auto px-3" data-height="height2" data-kpi="kpi_font" style="height:28px"> <span class="kpivalueLabel_' + id[0].PortletWidgetId + '" data-valuelabelbind="Value-1">Total Meetings</span> <span class="text-dark" id="kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-2">0</span></li></ul>';
|
||||
}
|
||||
else {
|
||||
html = '<ul class="position-relative text-dark color_' + id[0].PortletWidgetId + ' font-weight-500 p-2 d-flex flex-column kpi_card_class_' + id[0].PortletWidgetId + ' bgcolorset_' + id[0].PortletWidgetId + ' kpi-card" id="widget_kpis_TwoValue" style="background-color:#f1f4d0;"><li class="kpi-link-report"><a href="javascript:void(0);" onclick="Unibase.Themes.Compact.KpiWidgets.Manager.KpiManager.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ', ' + containerid + ')" class="showreport_' + id[0].PortletWidgetId + '" data-LinkReport="LinkReport"><small id="showreport_' + id[0].PortletWidgetId + '"><span class="nav-icon-wrap LinkReport_' + id[0].PortletWidgetId + '"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a></li><li class="d-flex justify-content-between h-100" data-height="height1"><div class="d-flex flex-row mr-2 text-truncate"><div class="w-55p h-55p mr-2" id="div_kpi_icon_' + id[0].PortletWidgetId + '"><img src="tenants/themes/compact/imgs/img55.png" onerror="ReloadImage(event)" data-dynamic="1" class="img-fluid imageUpload" style="filter: invert(1);"></div><div class="d-flex flex-column text-truncate"> <span class="textProperty_' + id[0].PortletWidgetId + ' font-weight-500 my-auto text-truncate text-dark kpivalue_' + id[0].PortletWidgetId + ' kpivalue_1_' + id[0].PortletWidgetId + '" data-valuebind="Value-1" style="font-size:32px;">0</span> <span id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '" class="mt-auto" data-kpi="kpi_font">' + title + '</span></div></div><span class="ml-auto pr-3" id="config_widget_' + id[0].PortletWidgetId + '"></span></li><li style="height:3px; border-bottom: 1px dashed green;" class=" mb-1 kpivalue_2_' + id[0].PortletWidgetId + '"></li><li class="d-flex justify-content-between align-items-center my-auto kpivalue_2_' + id[0].PortletWidgetId + '" data-height="height2" data-kpi="kpi_font" style="height:28px"> <span class="kpivalueLabel_' + id[0].PortletWidgetId + '" data-kpi="kpi_font" data-valuelabelbind="Value-1">Total Meetings</span> <span class="text-dark kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-2">0</span></li></ul>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
instance._load(id, containerid, null);
|
||||
}
|
||||
_loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse) {
|
||||
let instance = this;
|
||||
instance.loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse);
|
||||
}
|
||||
_styling(portletwidgetid, Container, response) {
|
||||
let cssproperty = JSON.parse(response.result.CssProperty);
|
||||
let height = response.result.KpiHeight + 'px';
|
||||
var calheight, calheight1, calheight2;
|
||||
calheight = parseInt(height.replace(/px/g, ''));
|
||||
calheight1 = calheight * 0.66;
|
||||
calheight1 = parseInt(Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(calheight1, 0));
|
||||
calheight2 = calheight - calheight1 - 3;
|
||||
$(Container).find('[data-height="height1"]').css('height', calheight1 + 'px');
|
||||
$(Container).find(".color_" + portletwidgetid + "").css({ "background-color": cssproperty[0].BackgroundColor, "border-width": cssproperty[0].BorderWidth, "border-style": cssproperty[0].BorderType, "border-color": cssproperty[0].BorderColor, "border-radius": cssproperty[0].BorderRadius, "height": height });
|
||||
$(Container).find('.textProperty_' + portletwidgetid).css({ "font-size": cssproperty[0].FontSize + 'px' });
|
||||
if (response.result.Icon == "" || response.result.Icon == null) {
|
||||
$(Container).find("#div_kpi_icon_" + portletwidgetid).remove();
|
||||
}
|
||||
else {
|
||||
var iconhtml = '<img class="img-fluid p-1 w-55p h-55p imageUpload" data-dynamic="1" id="kpi_icon_' + portletwidgetid + '"src="' + response.result.Icon + '" onerror="ReloadImage(event)">';
|
||||
$(Container).find("#div_kpi_icon_" + portletwidgetid).html(iconhtml);
|
||||
}
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Twovaluebgcolor();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Twovaluebgcolor = Twovaluebgcolor;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Un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AAG,eAAe,GAAG,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,GAAG,iCAAiC,CAAC;4BAC3L,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;yBACxE;oBACL,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;4BACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;wBAC1C,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBA5DY,0BAAe,kBA4D3B,CAAA;YACL,CAAC,EA9DgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QA8D1B;QACL,CAAC,EAhEgB,OAAO,GAAP,cAAO,KAAP,cAAO,QAgEvB;IACL,CAAC,EAlEgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAkEtB;AACL,CAAC,EApES,OAAO,KAAP,OAAO,QAoEhB"}
|
||||
@@ -0,0 +1,63 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Twovaluebottombarcolor extends KpiWidgets.Manager.KpiManager {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName, html = '';
|
||||
if (id[0].PortletWidgetId == 22501 || id[0].PortletWidgetId == 2250) {
|
||||
html = '<div class="bg-white overflow-hide border_color_' + id[0].PortletWidgetId + ' kpi_card_class_' + id[0].PortletWidgetId + ' kpi-card" id="widget_kpis_TwoValue" style="border:1px none #f83f37; border-radius:4px; height:120px"><span class="kpi-link-report"><a href="javascript:;" onclick="Unibase.Themes.Compact.KpiWidgets.Manager.KpiManager.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ', ' + containerid + ')"><small class="showreport_' + id[0].PortletWidgetId + '" data-LinkReport="LinkReport"><span class="nav-icon-wrap LinkReport_' + id[0].PortletWidgetId + '"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a></span><div class="card-body p-2 pb-0 font-weight-Normal text-dark" data-height="height1" style="height:79px"><ul class="d-flex flex-row"><li class="font-weight-500"><p class="ml-2" id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '" data-kpi="kpi_font">' + title + '</p><span class="font-weight-400 ml-2 textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + '" data-valueBind="Value-1" style="font-size:32px;">0</span></li><li class="ml-auto pr-3"id="config_widget_' + id[0].PortletWidgetId + '"></li></ul></div><div class="px-20 py-2 color_' + id[0].PortletWidgetId + ' bgcolorset_' + id[0].PortletWidgetId + ' text-white font-weight-600 d-flex justify-content-between align-items-center" data-height="height2" style="background-color:#fcbf36; height:41px"><p class="kpivalueLabel_' + id[0].PortletWidgetId + '" data-valueLabelBind="Value-1" data-kpi="kpi_font">Label </p><p class="kpivalue_' + id[0].PortletWidgetId + '" data-valueBind="Value-2">0</p></div></div>';
|
||||
}
|
||||
else {
|
||||
html = '<div class="position-relative bg-white overflow-hide border_color_' + id[0].PortletWidgetId + ' kpi_card_class_' + id[0].PortletWidgetId + ' kpi-card" id="widget_kpis_TwoValue" style="border:1px none #f83f37; border-radius:4px; height:120px"><span class="kpi-link-report"><a href="javascript:;" onclick="Unibase.Themes.Compact.KpiWidgets.Manager.KpiManager.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ', ' + containerid + ')"><small class="showreport_' + id[0].PortletWidgetId + '" data-LinkReport="LinkReport"><span class="nav-icon-wrap LinkReport_' + id[0].PortletWidgetId + '"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a></span><div class="card-body p-2 font-weight-Normal text-dark card-body-kpi-TVBBC-' + id[0].PortletWidgetId + '" data-height="height1" style="height:79px"><ul class="d-flex flex-column h-100"><li><ul class="d-flex flex-row"><li class="font-weight-500"><p class="" id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '" data-kpi="kpi_font">' + title + '</p></li><li class="ml-auto pr-3"id="config_widget_' + id[0].PortletWidgetId + '"></li></ul></li><li class="my-auto text-truncate"><span class="font-weight-400 textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + '" data-valueBind="Value-1" style="font-size:32px;">0</span></li></ul></div><div class="p-2 kpivalue_3_' + id[0].PortletWidgetId + ' color_' + id[0].PortletWidgetId + ' bgcolorset_' + id[0].PortletWidgetId + ' text-white font-weight-600 d-flex justify-content-between align-items-center" data-height="height2" style="height:41px"><p class="text-dark kpivalueLabel_' + id[0].PortletWidgetId + '" data-valueLabelBind="Value-1" data-kpi="kpi_font">Label </p><p class = "text-dark kpivalue_' + id[0].PortletWidgetId + '" data-valueBind="Value-2">0</p></div></div>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
instance._load(id, containerid, null);
|
||||
}
|
||||
_loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse) {
|
||||
let instance = this;
|
||||
instance.loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse);
|
||||
}
|
||||
_styling(portletwidgetid, Container, response) {
|
||||
let cssproperty = JSON.parse(response.result.CssProperty);
|
||||
let height = response.result.KpiHeight + 'px';
|
||||
let borderbottom = '0px 0px ' + cssproperty[0].BorderRadius + ' ' + cssproperty[0].BorderRadius;
|
||||
var calheight, calheight1, calheight2;
|
||||
calheight = parseInt(height.replace(/px/g, ''));
|
||||
calheight1 = calheight * 0.66;
|
||||
calheight1 = parseInt(Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(calheight1, 0));
|
||||
calheight2 = calheight - calheight1;
|
||||
$(Container).find(".color_" + portletwidgetid + "").css({ "background-color": cssproperty[0].BackgroundColor, "border": borderbottom });
|
||||
$(Container).find(".border_color_" + portletwidgetid + "").css({
|
||||
"border": cssproperty[0].BorderWidth + " " + cssproperty[0].BorderType + " " + cssproperty[0].BorderColor, "border-radius": cssproperty[0].BorderRadius, "height": calheight
|
||||
});
|
||||
$(".border_color_" + portletwidgetid + "").css({
|
||||
"border": cssproperty[0].BorderWidth + " " + cssproperty[0].BorderType + " " + cssproperty[0].BorderColor, "border-radius": cssproperty[0].BorderRadius, "height": height
|
||||
});
|
||||
$(Container).find('[data-height="height1"]').css('height', calheight1 + 'px');
|
||||
$(Container).find('[data-height="height2"]').css('height', calheight2 + 'px');
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Twovaluebottombarcolor();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Twovaluebottombarcolor = Twovaluebottombarcolor;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"twovaluebottombarcolor.js","sourceRoot":"","sources":["twovaluebottombarcolor.ts"],"names":[],"mappings":"AAKA,IAAU,OAAO,CAqEhB;AArED,WAAU,OAAO;IACb,IAAiB,MAAM,CAmEtB;IAnED,WAAiB,MAAM;QACnB,IAAiB,OAAO,CAiEvB;QAjED,WAAiB,OAAO;YACpB,IAAiB,UAAU,CA+D1B;YA/DD,WAAiB,UAAU;gBACvB,MAAa,sBAAuB,SAAQ,WAAA,OAAO,CAAC,UAAU;oBAS1D,OAAO;wBAEH,OAAO,CAAC,wDAAwD,EAAE,4CAA4C,EAAE,wDAAwD,EAAE,4CAA4C,EAAE,oDAAoD,EAAE,4DAA4D,EAAC,0DAA0D,CA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P,cAAO,KAAP,cAAO,QAiEvB;IACL,CAAC,EAnEgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAmEtB;AACL,CAAC,EArES,OAAO,KAAP,OAAO,QAqEhB"}
|
||||
@@ -0,0 +1,53 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Twovaluecenterline extends KpiWidgets.Manager.KpiManager {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName, html = '';
|
||||
if (id[0].PortletWidgetId == 22501 || id[0].PortletWidgetId == 2250) {
|
||||
html = '<ul class="position-relative p-2 overflow-hide bgcolorset_' + id[0].PortletWidgetId + ' kpi_card_class_' + id[0].PortletWidgetId + ' kpi-card" style="background-color:#d8fcd9;border-color:#b0ecb2;border-style:solid; border-width:1px; height:180px"><li class="kpi-link-report"><a href="javascript:void(0);" onclick="Unibase.Themes.Compact.KpiWidgets.Manager.KpiManager.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ',' + containerid + ')"><small class="showreport_' + id[0].PortletWidgetId + '" data-LinkReport="LinkReport"><span class="nav-icon-wrap LinkReport_' + id[0].PortletWidgetId + '"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a></li><li class="d-flex flex-column kpivalue_1_' + id[0].PortletWidgetId + '"><ul class="d-flex justify-content-between align-items-center"><li><span class="kpivalueLabel_' + id[0].PortletWidgetId + '" data-valuelabelbind="Value-1" data-kpi="kpi_font">Total Meetings</span></li></ul><ul class="d-flex justify-content-between"><li class="text-truncate"><span class="text-dark textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-1" style="font-size:32px">00</span></li><li><span class="my-auto ml-auto pr-3" id="config_widget_' + id[0].PortletWidgetId + '"></span></li></ul></li><li class="d-flex flex-column border border-bottom-0 border-left-0 border-right-0 border-light-40 kpivalue_2_' + id[0].PortletWidgetId + '"><ul class="d-flex justify-content-between"><li><span class="kpivalueLabel_' + id[0].PortletWidgetId + '" data-valuelabelbind="Value-2" data-kpi="kpi_font">Total Participants</span></li></ul><ul class="d-flex justify-content-between"><li class="text-truncate"><span class="text-dark textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + ' text-truncate" data-valuebind="Value-2" style="font-size:32px">00</span></li></ul></li></ul>';
|
||||
}
|
||||
else {
|
||||
html = '<ul class="position-relative p-2 d-flex px-20 flex-column justify-content-between overflow-hide bgcolorset_' + id[0].PortletWidgetId + ' kpi_card_class_' + id[0].PortletWidgetId + ' kpi-card" style="background-color:#fff;"><li class="kpi-link-report"><a href="javascript:void(0);" onclick="Unibase.Themes.Compact.KpiWidgets.Manager.KpiManager.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ',' + containerid + ')"><small class="showreport_' + id[0].PortletWidgetId + '" data-LinkReport="LinkReport"><span class="nav-icon-wrap LinkReport_' + id[0].PortletWidgetId + '"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a></li><li class="d-flex flex-column h-100"><ul class="d-flex justify-content-between align-items-center"><li><span class="kpivalueLabel_' + id[0].PortletWidgetId + '" data-valuelabelbind="Value-1" data-kpi="kpi_font">Total Meetings</span></li></ul><ul class="d-flex justify-content-between my-auto"><li><span class=" line-height-10 text-dark textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-1" style="font-size:26px">00</span></li><li><span class="my-auto ml-auto pr-3" id="config_widget_' + id[0].PortletWidgetId + '"></span></li></ul></li><li style="height:3px;" class="kpivalue_2_' + id[0].PortletWidgetId + ' border border-bottom-0 border-left-0 border-right-0 border-light-40"></li><li class="d-flex flex-column h-100 kpivalue_2_' + id[0].PortletWidgetId + '"><span class="kpivalueLabel_' + id[0].PortletWidgetId + '" data-valuelabelbind="Value-2" data-kpi="kpi_font">Total Participants</span><span class="text-dark my-auto line-height-10 textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-2" style="font-size:26px">00</span></li></ul>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
instance._load(id, containerid, null);
|
||||
}
|
||||
_loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse) {
|
||||
let instance = this;
|
||||
instance.loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse);
|
||||
}
|
||||
_styling(portletwidgetid, Container, response) {
|
||||
let cssproperty = JSON.parse(response.result.CssProperty);
|
||||
let height = response.result.KpiHeight + 'px';
|
||||
$(Container).find('.kpi_card_class_' + portletwidgetid).css({
|
||||
"background-color": cssproperty[0].BackgroundColor, "border-width": cssproperty[0].BorderWidth, "border-style": cssproperty[0].BorderType, "border-color": cssproperty[0].BorderColor, "border-radius": cssproperty[0].BorderRadius, "height": height
|
||||
});
|
||||
$(Container).find(".kpivalue_" + portletwidgetid + '[data-valuebind="Value-1"]').css({ "font-size": cssproperty[0].FontSize + "px", "font-family": cssproperty[0].FontStyle });
|
||||
$(Container).find(".kpivalue_" + portletwidgetid + '[data-valuebind="Value-2"]').css({ "font-size": cssproperty[0].FontSize + "px", "font-family": cssproperty[0].FontStyle });
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Twovaluecenterline();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Twovaluecenterline = Twovaluecenterline;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
@@ -0,0 +1 @@
|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AAC;wBACH,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,eAAe,GAAG,4BAA4B,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;wBAC/K,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,eAAe,GAAG,4BAA4B,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;oBAGnL,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;4BACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,kBAAkB,EAAE,CAAC;wBAC7C,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBAtDY,6BAAkB,qBAsD9B,CAAA;YACL,CAAC,EAxDgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAwD1B;QACL,CAAC,EA1DgB,OAAO,GAAP,cAAO,KAAP,cAAO,QA0DvB;IACL,CAAC,EA5DgB,MAAM,GAAN,cAAM,KAAN,cAAM,QA4DtB;AACL,CAAC,EA9DS,OAAO,KAAP,OAAO,QA8DhB"}
|
||||
@@ -0,0 +1,155 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class ValueWithPercentage extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName;
|
||||
let html = '<div class="card mb-0 card-sm kpi-card" id="widget_kpis_2">' +
|
||||
'<span class="kpi-link-report"><a href="#" onclick="Unibase.Themes.Compact.KpiWidgets.ValueWithPercentage.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ',' + "'" + containerid + "'" + ')" ;=""><small id="showreport_22501" class="font-sm-11"><span class="nav-icon-wrap"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a></span>' +
|
||||
'<div class="pa-10">' +
|
||||
'<span class="d-block font-14 font-weight-400 text-dark"><span id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '">' + title + '</span>' +
|
||||
'</span>' +
|
||||
'<span class="d-block align-items-center card-action-wrap pull-right font-11" >' +
|
||||
'<a href="#" class="inline-block full-screen mr-15 hidden" id="kpi_FullScreen_' + id[0].PortletWidgetId + '">' +
|
||||
'<i class="ion ion-md-expand"></i>' +
|
||||
'</a>' +
|
||||
'</span>' +
|
||||
'<span class="d-block display-5 font-weight-400 text-dark" id="kpi_Comparision_value_' + id[0].PortletWidgetId + '"></span>' +
|
||||
'<span id="config_widget_' + id[0].PortletWidgetId + '"></span>' +
|
||||
'<span class="d-flex justify-content-between align-items-center mt-10" ><span class="h4" id="kpi_Comparing_value_' + id[0].PortletWidgetId + '">000000</span><span id="kpi_Percentage_' + id[0].PortletWidgetId + '" class="ml-5">0%</span></span>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
let fromDate = "", toDate = "";
|
||||
var cf_fromDate = Unibase.Platform.Membership.Infos.Identity.currentUser.fromDate;
|
||||
var cf_toDate = Unibase.Platform.Membership.Infos.Identity.currentUser.toDate;
|
||||
if (cf_fromDate != null && cf_toDate != null) {
|
||||
fromDate = cf_fromDate.toString();
|
||||
toDate = cf_toDate.toString();
|
||||
}
|
||||
else {
|
||||
fromDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
toDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatLocalDateformat(new Date(Unibase.Platform.Helpers.DateTimeHelper.Instance().currentDate()), "YYYY/MM/DD");
|
||||
}
|
||||
var parameters = {
|
||||
WidgetId: id[0].WidgetId,
|
||||
PortletWidgetId: id[0].PortletWidgetId,
|
||||
InstalledAppId: id[0].InstalledAppId,
|
||||
InputParameters: inputparameters,
|
||||
FromDate: fromDate,
|
||||
ToDate: toDate
|
||||
};
|
||||
instance.loadResponseData(id[0].PortletWidgetId, containerid, parameters);
|
||||
}
|
||||
loadResponseData(portletwidgetid, detailContainer, parameters) {
|
||||
let instance = this;
|
||||
instance.inputParameters = parameters.InputParameters;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKpiWidgetData(parameters).then(function (response) {
|
||||
instance.loadData(portletwidgetid, detailContainer, parameters, false, response);
|
||||
});
|
||||
}
|
||||
loadData(portletwidgetid, detailContainer, parameters, IsPreview, response) {
|
||||
detailContainer = '.' + detailContainer;
|
||||
var post = response.result;
|
||||
if (post != null) {
|
||||
if (post.IsMaximize == true) {
|
||||
$("#kpi_FullScreen_" + portletwidgetid).removeClass("hidden");
|
||||
}
|
||||
if (response != null) {
|
||||
var data = JSON.parse(post.Data)[0];
|
||||
var selected_values = post.Selected_Columns;
|
||||
var sp = selected_values.split(',');
|
||||
var column1 = sp[0];
|
||||
var column2 = sp[1];
|
||||
var Value_1 = data[column1];
|
||||
var Value_2 = data[column2];
|
||||
var kpi_percentage;
|
||||
if (Value_2 < Value_1) {
|
||||
var Per = 100 / Value_1;
|
||||
var value = Value_1 - Value_2;
|
||||
kpi_percentage = Unibase.Core.Helpers.NumberHelper.Instance().format(value * Per, 2, '');
|
||||
$(detailContainer).find("#kpi_Percentage_" + portletwidgetid).addClass('text-danger');
|
||||
kpi_percentage = '-' + kpi_percentage;
|
||||
}
|
||||
else {
|
||||
if (Value_2 != 0)
|
||||
var difference = Value_2 - Value_1;
|
||||
if (Value_2 == 0) {
|
||||
kpi_percentage = 0;
|
||||
}
|
||||
else {
|
||||
kpi_percentage = Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(((Value_2 - Value_1) / Value_2) * 100, 1);
|
||||
}
|
||||
if (difference > 0) {
|
||||
$(detailContainer).find("#kpi_Percentage_" + portletwidgetid).addClass('text-success');
|
||||
kpi_percentage = '+' + kpi_percentage;
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find("#kpi_Percentage_" + portletwidgetid).addClass('text-danger');
|
||||
kpi_percentage = ' ' + kpi_percentage;
|
||||
}
|
||||
}
|
||||
$(detailContainer).find("#kpi_Comparing_value_" + portletwidgetid).text(Value_2);
|
||||
$(detailContainer).find("#kpi_comparing_string_" + portletwidgetid).text(Value_1);
|
||||
$(detailContainer).find("#kpi_Percentage_" + portletwidgetid).text(kpi_percentage + '% ');
|
||||
var colors = ["primary", "success", "warning", "danger", "info", "light", "secondary", "dark"];
|
||||
if (response.result.AppConfigurations.length != 0) {
|
||||
var designhtml = "";
|
||||
var appconfig = response.result.AppConfigurations;
|
||||
for (var i = 0; i < appconfig.length; i++) {
|
||||
var onlickurl = "";
|
||||
var sname = appconfig[i].SettingName.replace(/ /g, '');
|
||||
designhtml += ' <span class="mr-10"><a href="javascript:;" id="widgetconfig_' + sname + '" onclick="' + onlickurl + '">' +
|
||||
'<button class="btn btn-sm btn-' + colors[i] + ' pull-right btn-rounded text-white">' + appconfig[i].SettingName + '</button>' +
|
||||
'</a> </span>';
|
||||
}
|
||||
designhtml += "</div>";
|
||||
$(detailContainer).find("#config_widget_" + portletwidgetid).html(designhtml);
|
||||
}
|
||||
if (post.LinkReportId != 0 && post.LinkReportId != null) {
|
||||
}
|
||||
else {
|
||||
$(detailContainer).find("#showreport_" + portletwidgetid).addClass('hidden');
|
||||
}
|
||||
}
|
||||
}
|
||||
$(detailContainer).siblings('.line-loader').remove();
|
||||
$(detailContainer).removeClass('hidden');
|
||||
}
|
||||
linkReport(widgetid, portletwidgetid, containerid) {
|
||||
var instance = this;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getKPIWidget(widgetid).then(function (response) {
|
||||
var res = response.result;
|
||||
if (res != null) {
|
||||
let containerid = "div_kpireport_" + portletwidgetid;
|
||||
var rv_obj = Unibase.Platform.Analytics.Components.ReportViewer.Instance();
|
||||
instance.navigationHelper.popup(res.LinkReportId, containerid, rv_obj, null, Unibase.Platform.Helpers.Size.ExtraLarge);
|
||||
}
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new ValueWithPercentage();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.ValueWithPercentage = ValueWithPercentage;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,58 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Valuewithpercentagebgcolor extends KpiWidgets.Manager.KpiManager {
|
||||
jsFiles() {
|
||||
return ["platform/widgets/managers/interfaces/iwidgetmanager.js", "platform/widgets/managers/widgetmanager.js", "platform/core/helpers/propertyhelper/propertyhelper.js", "platform/core/helpers/token/tokenhelper.js", "platform/core/helpers/numberhelper/numberhelper.js", "platform/analytics/components/reportviewer/reportviewer.js"];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let html = '';
|
||||
const { PortletWidgetId, WidgetName: title, WidgetId } = id[0];
|
||||
if (PortletWidgetId == 2250 || PortletWidgetId == 22501) {
|
||||
html = '<ul class="position-relative p-2 w-100 d-flex flex-column w-25 overflow-hide bgcolorset_' + PortletWidgetId + ' kpi_card_class_' + PortletWidgetId + ' kpi-card" id="widget_kpis_2" style="background-color:#d6d4f6; border-width: 1px; border-style: solid; border-color:#b6b2fc; border-radius: 4px; height: 90px;"><li class="kpi-link-report"><a href="javascript:void(0);" onclick="Unibase.Themes.Compact.KpiWidgets.ValueWithPercentage.Instance().linkReport(' + id[0].WidgetId + ',' + PortletWidgetId + ', ' + containerid + ')"><small class="showreport_' + PortletWidgetId + '" data-LinkReport="LinkReport"><span class="nav-icon-wrap LinkReport_' + PortletWidgetId + '"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i> </span> </small></a></li><li class="d-flex justify-content-between"><div><span class="font-weight-400 text-dark textProperty_' + PortletWidgetId + ' kpivalue_' + PortletWidgetId + '" data-valueBind="Value-1" style="font-size:32px;">3,60,000</span></div></li><li class="d-flex flex-row my-auto justify-content-between"><div><span id="hf_kpi_widgetName_' + PortletWidgetId + '" data-kpi="kpi_font">' + title + '</span></div><div> <span class="my-auto" id="config_widget_' + PortletWidgetId + '"></span></div><div class=""><span class="d-flex flex-row align-items-center font-14"><span class="pr-1 kpivalue_' + PortletWidgetId + '" data-kpi="kpi_font" data-valueBind="Value-2">85%</span><span class="text-success" style="transform: rotate(225deg);"><i class="la la-arrow-circle-up"></i></span></span> </div></li></ul>';
|
||||
}
|
||||
else {
|
||||
html = `<ul class="position-relative p-2 w-100 d-flex flex-column w-25 px-20 overflow-hide bgcolorset_${PortletWidgetId} kpi_card_class_${PortletWidgetId} kpi-card" id="widget_kpis_2" style="background-color:#ffffff;"><li class="kpi-link-report"><a href="javascript:;" onclick="Unibase.Themes.Compact.KpiWidgets.ValueWithPercentage.Instance().linkReport(${WidgetId},${PortletWidgetId},'${containerid}')"><small class="showreport_${PortletWidgetId}" data-LinkReport="LinkReport"><span class="nav-icon-wrap LinkReport_${PortletWidgetId}"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a></li><li class="d-flex justify-content-between my-auto"><div class="text-truncate"><span class="font-weight-400 line-height-10 text-dark textProperty_${PortletWidgetId} kpivalue_${PortletWidgetId} kpivalue_1_${PortletWidgetId}" data-valueBind="Value-1" style="font-size:32px;" data-value-kpi="kpi_value_font">0</span> </div></li><li class="d-flex flex-row mt-auto justify-content-between kpivalue_2_${PortletWidgetId}"><div class="text-truncate"><span id="hf_kpi_widgetName_${PortletWidgetId}" data-kpi="kpi_font" title="${title}">${title}</span></div><div> <span class="my-auto" id="config_widget_${PortletWidgetId}"></span></div><div class=""><span class="d-flex flex-row align-items-center font-14"><span class="pr-1 kpivalue_${PortletWidgetId}" data-valueBind="Value-2" data-kpi="kpi_font"></span></span> </div></li></ul>`;
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
instance._load(id, containerid, null);
|
||||
}
|
||||
_loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse) {
|
||||
let instance = this;
|
||||
instance.loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse);
|
||||
}
|
||||
_styling(portletwidgetid, Container, response) {
|
||||
let cssproperty = JSON.parse(response.result.CssProperty);
|
||||
let height = response.result.KpiHeight + 'px';
|
||||
$(Container).find(".bgcolorset_" + portletwidgetid + "").css({
|
||||
"background-color": cssproperty[0].BackgroundColor, "border-width": cssproperty[0].BorderWidth, "border-style": cssproperty[0].BorderType, "border-color": cssproperty[0].BorderColor, "border-radius": cssproperty[0].BorderRadius, "height": height
|
||||
});
|
||||
if (screen.width < 1198 && cssproperty[0].FontSize == 32) {
|
||||
$(Container).find(".kpivalue_" + portletwidgetid + '[data-valuebind="Value-1"]').css({ "font-size": "24px", "font-family": cssproperty[0].FontStyle });
|
||||
}
|
||||
else {
|
||||
$(Container).find(".kpivalue_" + portletwidgetid + '[data-valuebind="Value-1"]').css({ "font-size": cssproperty[0].FontSize + "px", "font-family": cssproperty[0].FontStyle });
|
||||
}
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Valuewithpercentagebgcolor();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Valuewithpercentagebgcolor = Valuewithpercentagebgcolor;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"valuewithpercentagebgcolor.js","sourceRoot":"","sources":["valuewithpercentagebgcolor.ts"],"names":[],"mappings":"AAGA,IAAU,OAAO,CA+DhB;AA/DD,WAAU,OAAO;IACb,IAAiB,MAAM,CA6DtB;IA7DD,WAAiB,MAAM;QACnB,IAAiB,OAAO,CA2DvB;QA3DD,WAAiB,OAAO;YACpB,IAAiB,UAAU,CAyD1B;YAzDD,WAAiB,UAAU;gBACvB,MAAa,0BAA2B,SAAQ,WAAA,OAAO,CAAC,UAAU;oBAS9D,OAAO;wBAEH,OAAO,CAAC,wDAAwD,EAAE,4CAA4C,EAAE,wDAAwD,EAAE,4CAA4C,EAAE,oDAAoD,EAAC,4DAA4D,CAAC,CAAC;oBAC/U,CAAC;oBACD,QAAQ;wBAEJ,OAAO,EAAE,CAAC;oBACd,CAAC;oBAEF,IAAI,CAAC,EAAE,EAAE,WAAW;wBACf,IAAI,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,IAAI,GAAG,EAAE,CAAC;wBACzC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,IAAI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gB,MAAM,GAAN,cAAM,KAAN,cAAM,QA6DtB;AACL,CAAC,EA/DS,OAAO,KAAP,OAAO,QA+DhB"}
|
||||
@@ -0,0 +1,57 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let KpiWidgets;
|
||||
(function (KpiWidgets) {
|
||||
class Valuewithpercentageprogressbar extends KpiWidgets.Manager.KpiManager {
|
||||
jsFiles() {
|
||||
return [];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let title = id[0].WidgetName, html = '';
|
||||
if (id[0].PortletWidgetId == 2250 || id[0].PortletWidgetId == 22501) {
|
||||
html = '<ul class="p-2 font-weight-500 d-flex flex-column overflow-hide bgcolorset_' + id[0].PortletWidgetId + ' kpi_card_class_' + id[0].PortletWidgetId + ' kpi-card" style="background-color: #bed0f0; border-width: 1px; border-style: solid; border-color: #bed0f0; border-radius: 4px; height: 90px;"><li class="kpi-link-report"><a href="javascript;void(0)" onclick="Unibase.Themes.Compact.KpiWidgets.Manager.KpiManager.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ', ' + containerid + ')"><small class="showreport_' + id[0].PortletWidgetId + '" data-LinkReport="LinkReport"><span class="nav-icon-wrap LinkReport_' + id[0].PortletWidgetId + '"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a></li><li class="d-flex flex-row"> <span class="font-weight-400 line-height-10 text-dark textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-1" style="font-size:24px">00</span><span class="ml-auto pr-3 my-auto" id="config_widget_' + id[0].PortletWidgetId + '"></span></li><li class="d-flex justify-content-between my-auto"> <span class="my-auto" id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '" data-kpi="kpi_font">' + title + '</span> <span class="textProperty_' + id[0].PortletWidgetId + ' font-14 kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-2" data-kpi="kpi_font">50%</span></li><li class="mt-auto"><div class="progress" style="height: 10px;"><div class="progress-bar kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-2" style="width:50%" role="progressbar" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div></div></li></ul>';
|
||||
}
|
||||
else {
|
||||
html = '<ul class="position-relative p-2 font-weight-500 d-flex flex-column overflow-hide bgcolorset_' + id[0].PortletWidgetId + ' kpi_card_class_' + id[0].PortletWidgetId + ' kpi-card" style="background-color: #ffff;"><li class="kpi-link-report"><a href="javascript:;" onclick="Unibase.Themes.Compact.KpiWidgets.Manager.KpiManager.Instance().linkReport(' + id[0].WidgetId + ',' + id[0].PortletWidgetId + ', ' + containerid + ')"><small class="showreport_' + id[0].PortletWidgetId + '" data-LinkReport="LinkReport"><span class="nav-icon-wrap LinkReport_' + id[0].PortletWidgetId + '"><i class="font-14 dripicons dripicons-graph-pie text-dark"></i></span></small></a></li><li class="d-flex flex-row my-auto"> <span class="font-weight-400 line-height-10 text-dark textProperty_' + id[0].PortletWidgetId + ' kpivalue_' + id[0].PortletWidgetId + ' kpivalue_1_' + id[0].PortletWidgetId + '" data-valuebind="Value-1" style="font-size:22px" data-value-kpi="kpi_value_font">00</span><span class="ml-auto pr-3 my-auto" id="config_widget_' + id[0].PortletWidgetId + '"></span></li><li class="d-flex justify-content-between mt-auto"> <span class="my-auto" id="hf_kpi_widgetName_' + id[0].PortletWidgetId + '" data-kpi="kpi_font">' + title + '</span> <span class="textProperty_' + id[0].PortletWidgetId + ' font-14 kpivalue_' + id[0].PortletWidgetId + ' kpivalue_2_' + id[0].PortletWidgetId + '" data-kpi="kpi_font" data-valuebind="Value-2">0%</span></li><li class="mt-auto progress_Bar kpivalue_2_' + id[0].PortletWidgetId + '"><div class="progress" style="height: 10px;"><div class="progress-bar kpivalue_' + id[0].PortletWidgetId + '" data-valuebind="Value-2" style="width:00%" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div></div></li></ul>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let instance = this;
|
||||
instance._load(id, containerid, null);
|
||||
}
|
||||
_loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse) {
|
||||
let instance = this;
|
||||
instance.loadData(portletwidgetid, Container, parameters, IsPreview, response, portletresponse);
|
||||
}
|
||||
_styling(portletwidgetid, Container, response) {
|
||||
let cssproperty = JSON.parse(response.result.CssProperty);
|
||||
let height = response.result.KpiHeight + 'px';
|
||||
$(Container).find(".bgcolorset_" + portletwidgetid + "").css({
|
||||
"background-color": cssproperty[0].BackgroundColor, "border-width": cssproperty[0].BorderWidth, "border-style": cssproperty[0].BorderType, "border-color": cssproperty[0].BorderColor, "border-radius": cssproperty[0].BorderRadius, "height": height
|
||||
});
|
||||
if (screen.width < 1198 && cssproperty[0].FontSize == 32) {
|
||||
$(Container).find(".kpivalue_" + portletwidgetid + '[data-valuebind="Value-1"]').css({ "font-size": "24px", "font-family": cssproperty[0].FontStyle });
|
||||
}
|
||||
else {
|
||||
$(Container).find(".kpivalue_" + portletwidgetid + '[data-valuebind="Value-1"]').css({ "font-size": cssproperty[0].FontSize + "px", "font-family": cssproperty[0].FontStyle });
|
||||
}
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Valuewithpercentageprogressbar();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
KpiWidgets.Valuewithpercentageprogressbar = Valuewithpercentageprogressbar;
|
||||
})(KpiWidgets = Compact.KpiWidgets || (Compact.KpiWidgets = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"valuewithpercentageprogressbar.js","sourceRoot":"","sources":["valuewithpercentageprogressbar.ts"],"names":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AC,CAAC,QAAQ,IAAI,EAAE,EAAE;4BACtD,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,eAAe,GAAG,4BAA4B,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,EAAC,MAAM,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;yBACzJ;6BACI;4BACD,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,eAAe,GAAG,4BAA4B,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;yBAClL;oBACL,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;4BACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,8BAA8B,EAAE,CAAC;wBACzD,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBAvDY,yCAA8B,iCAuD1C,CAAA;YACL,CAAC,EAzDgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAyD1B;QACL,CAAC,EA3DgB,OAAO,GAAP,cAAO,KAAP,cAAO,QA2DvB;IACL,CAAC,EA7DgB,MAAM,GAAN,cAAM,KAAN,cAAM,QA6DtB;AACL,CAAC,EA/DS,OAAO,KAAP,OAAO,QA+DhB"}
|
||||
@@ -0,0 +1,160 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
let ReportWidgets;
|
||||
(function (ReportWidgets) {
|
||||
class Default extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return ["platform/analytics/managers/reportmanager.js"];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(obj, containerid) {
|
||||
let title = obj[0].WidgetName;
|
||||
let html = '<div id="widget_report_' + obj[0].PortletWidgetId + '" class="card shadow-hover mb-0">' +
|
||||
'<div class="card-header card-header-action border-bottom-0">' +
|
||||
'<span id="hf-widget-title_' + obj[0].PortletWidgetId + '">' + title + '</span>' +
|
||||
'<a class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover" id="settingicon_' + obj[0].PortletWidgetId + '"><span class="btn-icon-wrap"><i class="fa fa-cog"></i></span></a>';
|
||||
'<div class="d-flex align-items-center card-action-wrap" id="div_detail_addnew_' + obj[0].PortletWidgetId + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="card-body pt-5">' +
|
||||
'<div class="row">' +
|
||||
'<span>' + title + ' Report</span>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</section>';
|
||||
$("." + containerid).html(html);
|
||||
return null;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let obj = Unibase.Platform.Analytics.Components.ReportViewer.Instance();
|
||||
var instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
instance.getReportWidget(id[0].PortletWidgetId, id[0].WidgetId, containerid, inputparameters, null, Unibase.Themes.Compact.Components.ReportWidgets.Default.Instance(), id[0].InstalledAppId, false);
|
||||
if (id[0].InstalledAppId == 0) {
|
||||
if (inputparameters != null) {
|
||||
for (let i = inputparameters.length - 1; i >= 0; i--) {
|
||||
if (inputparameters[i].Key == "CommonFilter_FromDate" || inputparameters[i].Key == "CommonFilter_ToDate") {
|
||||
inputparameters.splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
saveReportSetting(widgetid) {
|
||||
let postdata = {
|
||||
ReportWidgetId: 0,
|
||||
ReportGroupId: Number($("#select_GroupNames option:selected").val()),
|
||||
ReportId: Number($("#select_ReportNames option:selected").val()),
|
||||
ReportName: $("#select_ReportNames option:selected").text(),
|
||||
ReportTypeId: Number($("#select_ReportType option:selected").val()),
|
||||
DatalistId: 0,
|
||||
WidgetId: widgetid,
|
||||
AppConfigurations: null
|
||||
};
|
||||
this.fileCacheHelper.loadJsFile("platform/widgets/managers/widgetmanager.js", function () {
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().saveReportWidget(postdata).then(function (response) {
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
loaddynamicwidgets(widgetid, primartkey, containerid, appconfigurationid, isConfiguration) {
|
||||
Unibase.Platform.Apps.Managers.AppManager.Instance().getAppConfiguration(appconfigurationid).then(function (response) {
|
||||
var linkwidgetid = response.result.LinkWidgetId;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getWidget(linkwidgetid).then(function (res) {
|
||||
let ReplaceText = [];
|
||||
let split = res.result.Parameter.split(':');
|
||||
ReplaceText.push({
|
||||
Key: split[0],
|
||||
Value: (primartkey).toString(),
|
||||
ExpOp: 1
|
||||
});
|
||||
Unibase.Themes.Compact.Components.ReportWidgets.Default.Instance().getReportWidget(0, linkwidgetid, "", ReplaceText, null, true, Unibase.Themes.Providers.DetailHelper.installedAppId, isConfiguration);
|
||||
});
|
||||
});
|
||||
}
|
||||
getReportWidget(portletwidgetId, widgetid, containerid, inputparameters, dynamicfilters, ispopup, installedappid, isConfiguration) {
|
||||
var instance = this;
|
||||
var helperinstance = this.fileCacheHelper;
|
||||
let InstalledAppId = installedappid;
|
||||
if (InstalledAppId == undefined)
|
||||
InstalledAppId = 0;
|
||||
Unibase.Platform.Analytics.Components.WidgetReportviewer.Instance().PortletWidgetId = portletwidgetId;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getReportWidget(widgetid, InstalledAppId).then(function (response) {
|
||||
Unibase.Platform.Analytics.Reports.ReportBuilder.Instance().reportwidgetdata = response.result;
|
||||
var res = response;
|
||||
let reportid = response.result.Data.ReportId;
|
||||
let jsfiles = response.result.Data.JsPath;
|
||||
if (jsfiles != null && jsfiles != "") {
|
||||
let files = jsfiles.split(',');
|
||||
for (let x = 0; x < files.length; x++) {
|
||||
helperinstance.loadJsFile(files[x], null);
|
||||
}
|
||||
}
|
||||
Default.Instance().reportwidgetid = res.result.Data.ReportWidgetId;
|
||||
let reportInstance;
|
||||
let settings;
|
||||
if (!isConfiguration) {
|
||||
reportInstance = 'Unibase.Platform.Analytics.Components.WidgetReportviewer.Instance()';
|
||||
settings = eval(reportInstance);
|
||||
}
|
||||
else {
|
||||
if (!containerid) {
|
||||
containerid = "_widgetconfiguration_report_" + moment().unix();
|
||||
}
|
||||
settings = Unibase.Platform.Analytics.Components.ReportViewer.Instance();
|
||||
let rv_ins = settings.getReportViewerInstance(containerid);
|
||||
settings.inputParameters = inputparameters;
|
||||
rv_ins.inputParameters = inputparameters;
|
||||
settings.isWidget = true;
|
||||
settings.reportWidgetData = response.result;
|
||||
var _instance = settings.getReportViewerInstance(containerid);
|
||||
let isInstance = false;
|
||||
let reportViewerInstance = Unibase.Platform.Helpers.NavigationHelper.reportViewerInstance;
|
||||
if (reportViewerInstance.length > 0)
|
||||
isInstance = reportViewerInstance.find(rv => rv.childcontainerid == containerid) ? true : false;
|
||||
if (!isInstance) {
|
||||
reportViewerInstance.push({
|
||||
instance: _instance,
|
||||
childcontainerid: containerid,
|
||||
parentcontainerid: "",
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (dynamicfilters != null) {
|
||||
let rv_instance = reportViewerInstance.find(rv => rv.childcontainerid == containerid).instance;
|
||||
rv_instance.dynamicFilters = dynamicfilters;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ispopup == true) {
|
||||
instance.navigationHelper.popup(reportid, containerid, settings, function () {
|
||||
$(`#reportCloseBtn_${containerid}`).removeClass('d-none');
|
||||
$(`#div_pagination_${containerid}`).addClass('hidden');
|
||||
}, Unibase.Platform.Helpers.Size.Large);
|
||||
}
|
||||
else {
|
||||
instance.navigationHelper.popin(response.result, containerid, settings, null);
|
||||
$("._bizgaze_detail_container:last").removeClass("hidden");
|
||||
}
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Default();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
ReportWidgets.Default = Default;
|
||||
})(ReportWidgets = Components.ReportWidgets || (Components.ReportWidgets = {}));
|
||||
})(Components = Compact.Components || (Compact.Components = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,102 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
let ReportWidgets;
|
||||
(function (ReportWidgets) {
|
||||
class Withnoheaderandfooter extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return ["platform/analytics/managers/reportmanager.js"];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(obj, containerid) {
|
||||
let title = obj[0].WidgetName;
|
||||
let html = '<div id="widget_report_' + obj[0].PortletWidgetId + '" class="card shadow-hover mb-0">' +
|
||||
'<div class="card-header card-header-action border-bottom-0">' +
|
||||
'<span id="hf-widget-title_' + obj[0].PortletWidgetId + '">' + title + '</span>' +
|
||||
'<a class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover" id="settingicon_' + obj[0].PortletWidgetId + '"><span class="btn-icon-wrap"><i class="fa fa-cog"></i></span></a>';
|
||||
'<div class="d-flex align-items-center card-action-wrap" id="div_detail_addnew_' + obj[0].PortletWidgetId + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="card-body pt-5">' +
|
||||
'<div class="row">' +
|
||||
'<span>' + title + ' Report</span>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</section>';
|
||||
$("." + containerid).html(html);
|
||||
return null;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
let obj = Unibase.Platform.Analytics.Components.ReportViewer.Instance();
|
||||
var instance = this;
|
||||
let inputparameters = Unibase.Themes.Providers.DashboardHelper.Instance().replaceWidgetParameterValues(id[0].WidgetParameters, id[0].InstalledAppId);
|
||||
instance.getReportWidget(id[0].PortletWidgetId, id[0].WidgetId, containerid, inputparameters, Unibase.Themes.Compact.Components.ReportWidgets.Withnoheaderandfooter.Instance(), id[0].InstalledAppId);
|
||||
}
|
||||
saveReportSetting(widgetid) {
|
||||
let postdata = {
|
||||
ReportWidgetId: 0,
|
||||
ReportGroupId: Number($("#select_GroupNames option:selected").val()),
|
||||
ReportId: Number($("#select_ReportNames option:selected").val()),
|
||||
ReportName: $("#select_ReportNames option:selected").text(),
|
||||
ReportTypeId: Number($("#select_ReportType option:selected").val()),
|
||||
DatalistId: 0,
|
||||
WidgetId: widgetid,
|
||||
AppConfigurations: null
|
||||
};
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().saveReportWidget(postdata).then(function (response) {
|
||||
return response;
|
||||
});
|
||||
}
|
||||
getReportWidget(portletwidgetId, widgetid, containerid, inputparameters, Instance, installedappid) {
|
||||
var instance = this;
|
||||
var helperinstance = this.fileCacheHelper;
|
||||
let InstalledAppId = installedappid;
|
||||
if (InstalledAppId == undefined)
|
||||
InstalledAppId = 0;
|
||||
Unibase.Platform.Analytics.Components.WidgetReportviewer.Instance().PortletWidgetId = portletwidgetId;
|
||||
Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getReportWidget(widgetid, InstalledAppId).then(function (response) {
|
||||
Unibase.Platform.Analytics.Reports.ReportBuilder.Instance().reportwidgetdata = response.result;
|
||||
var res = response;
|
||||
let reportid = response.result.Data.ReportId;
|
||||
let jsfiles = response.result.Data.JsPath;
|
||||
if (jsfiles != null && jsfiles != "") {
|
||||
let files = jsfiles.split(',');
|
||||
for (let x = 0; x < files.length; x++) {
|
||||
helperinstance.loadJsFile(files[x], null);
|
||||
}
|
||||
}
|
||||
Withnoheaderandfooter.Instance().reportwidgetid = res.result.Data.ReportWidgetId;
|
||||
let AutocompleteFilter = [];
|
||||
for (let i = 0; i < inputparameters.length; i++) {
|
||||
AutocompleteFilter.push({
|
||||
ParameterName: inputparameters[i].Key,
|
||||
ParameterValue: inputparameters[i].Value,
|
||||
});
|
||||
}
|
||||
let reportInstance = 'Unibase.Platform.Analytics.Components.WidgetReportviewer.Instance()';
|
||||
let settings = eval(reportInstance);
|
||||
var reportsettings = settings;
|
||||
reportsettings.Filter = AutocompleteFilter;
|
||||
reportsettings.ReportId = reportid;
|
||||
instance.navigationHelper.popin(response.result, containerid, settings, null);
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === null || this.instance === undefined)
|
||||
this.instance = new Withnoheaderandfooter();
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
ReportWidgets.Withnoheaderandfooter = Withnoheaderandfooter;
|
||||
})(ReportWidgets = Components.ReportWidgets || (Components.ReportWidgets = {}));
|
||||
})(Components = Compact.Components || (Compact.Components = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"withnoheaderandfooter.js","sourceRoot":"","sources":["withnoheaderandfooter.ts"],"names":[],"mappings":"AAeA,IAAU,OAAO,CAkIhB;AAlID,WAAU,OAAO;IACb,IAAiB,MAAM,CAgItB;IAhID,WAAiB,MAAM;QACnB,IAAiB,OAAO,CA8HvB;QA9HD,WAAiB,OAAO;YACpB,IAAiB,UAAU,CA4H1B;YA5HD,WAAiB,UAAU;gBACvB,IAAiB,aAAa,CA0H7B;gBA1HD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