Browse Source

POB-3486 主题编辑地方血缘初次不展示模板修复,公共数据血缘节点模板提示信息

master
ezreal 7 months ago
parent
commit
8e009744d5
  1. 3
      plugin.xml
  2. 308
      src/main/resources/com/fr/plugin/bi/mix/web/js/decision/fr.mix.bi.decision.min.js
  3. 92
      src/main/resources/com/fr/plugin/bi/mix/web/js/subject/fr.mix.bi.subject.min.js
  4. 51
      webcode/src/decision/core/front.conf.pack.table.usage.js
  5. 87
      webcode/src/subject/core/front.subject.relationship.pane.js

3
plugin.xml

@ -3,7 +3,7 @@
<id>com.fr.plugin.BI.fusion.front</id>
<name><![CDATA[BI融合方案前端]]></name>
<active>yes</active>
<version>0.0.17</version>
<version>0.0.18</version>
<env-version>11.0~11.0</env-version>
<group>bi</group>
<sync>false</sync>
@ -13,6 +13,7 @@
<sync>false</sync>
<description><![CDATA[BI融合方案前端]]></description>
<change-notes><![CDATA[
[2023-10-13 v0.0.18][POB-3486]修复bug<br/>
[2023-09-21 v0.0.17]修复IP唤起的BUG,增加唤起前再次确认编辑主题<br/>
[2023-09-13 v0.0.16]适配IP唤起<br/>
[2023-09-05 v0.0.15]剥离填报模型代码<br/>

308
src/main/resources/com/fr/plugin/bi/mix/web/js/decision/fr.mix.bi.decision.min.js vendored

@ -362,6 +362,135 @@
});
}();
;
!function () {
BI.Front = BI.Front || {};
BI.Front = BI.extend(BI.Front, {
utils: {
injectionFunc: function injectionFunc(o, configs) {
if (BI.isNotEmptyArray(configs)) {
BI.each(configs, function (index, item) {
var functionName = item.functionName;
if (functionName) {
var oldFunction = o[functionName];
var beforeFunc = item.beforeFunc; //执行前的函数
var afterFunc = item.afterFunc; //执行后函数
var returnValue = item.returnValue; //是否返回值
var replaceFunc = item.replaceFunc; //替换函数,如果不传递那么就会执行下默认的
o[functionName] = function () {
var para = [];
var len = arguments.length;
for (var i = 0; i < len; i++) {
para.push(arguments[i]);
}
if (BI.isFunction(beforeFunc)) {
beforeFunc.apply(o, para);
}
if (returnValue) {
var value = null;
if (BI.isFunction(replaceFunc)) {
value = replaceFunc.apply(o, para);
} else {
value = oldFunction.apply(o, para);
}
if (BI.isFunction(afterFunc)) {
para.unshift(value);
value = afterFunc.apply(o, para);
}
return value;
} else {
if (BI.isFunction(replaceFunc)) {
replaceFunc.apply(o, para);
} else {
oldFunction.apply(o, para);
}
if (BI.isFunction(afterFunc)) {
afterFunc.apply(o, para);
}
}
};
}
});
}
}
}
});
$.extend(BI.Msg, {
/**
* 弹出框然后有个输入确认返回输入的值
* @param title 标题
* @param content 标签
* @param callback 回调函数
* @param validationChecker 文本框的校验
*/
prompt: function prompt(title, content, callback, config, checkFunc) {
// BI.Popovers.removeAll();
var id = BI.UUID();
var textEditor = {
type: "bi.text_editor",
ref: function ref(_ref) {
BI[id] = _ref;
},
width: 200
};
textEditor = BI.extend(textEditor, config ? config : {});
var widget = BI.Popovers.create(id, {
type: "bi.bar_popover",
// String或者是json都行
header: title,
size: "small",
body: {
type: "bi.horizontal",
horizontalAlign: "center",
verticalAlign: "middle",
hgap: 10,
items: [{
type: "bi.label",
text: content
}, textEditor]
},
footer: {
type: "bi.right_vertical_adapt",
lgap: 10,
items: [{
type: "bi.button",
text: "取消",
value: 1,
level: "ignore",
handler: function handler(v) {
BI.Popovers.remove(id);
}
}, {
type: "bi.button",
text: "确定",
value: 0,
handler: function handler(v) {
var value = BI[id].getValue();
if (BI.isFunction(checkFunc) && !checkFunc(value)) {
return;
}
BI.isFunction(callback) && callback(BI[id].getValue());
BI.Popovers.remove(id);
}
}]
}
/* listeners: [{
eventName: "EVENT_CANCEL",
action: function () {
}
}, {
eventName: "EVENT_CONFIRM",
action: function () {
BI.isFunction(callback) && callback(BI[id].getValue());
}
}]*/
});
widget.show(id);
}
});
}();
;
!function () {
var widget = BI.inherit(BI.Widget, {
props: {},
@ -865,10 +994,12 @@
} else {
var token = res.data;
}
var url = window.location.origin + Dec.fineServletURL + "?" + "GWToken" + "?" + token + "?" + self.model.id ;
var url = window.location.origin + Dec.fineServletURL + "?" + "GWToken" + "?" + token + "?" + self.model.id;
url = "finereport://" + encodeURIComponent(url);
try {
BI.CLI.compatible.remoteDesign(url,{web_ip : BI.CLI.info.ip},self.model.subjectInfo.id);
BI.CLI.compatible.remoteDesign(url, {
web_ip: BI.CLI.info.ip
}, self.model.subjectInfo.id);
} catch (e) {
window.open(url);
}
@ -969,135 +1100,6 @@
BI.model("bi.subject.view.extend.report.model", store);
}();
;
!function () {
BI.Front = BI.Front || {};
BI.Front = BI.extend(BI.Front, {
utils: {
injectionFunc: function injectionFunc(o, configs) {
if (BI.isNotEmptyArray(configs)) {
BI.each(configs, function (index, item) {
var functionName = item.functionName;
if (functionName) {
var oldFunction = o[functionName];
var beforeFunc = item.beforeFunc; //执行前的函数
var afterFunc = item.afterFunc; //执行后函数
var returnValue = item.returnValue; //是否返回值
var replaceFunc = item.replaceFunc; //替换函数,如果不传递那么就会执行下默认的
o[functionName] = function () {
var para = [];
var len = arguments.length;
for (var i = 0; i < len; i++) {
para.push(arguments[i]);
}
if (BI.isFunction(beforeFunc)) {
beforeFunc.apply(o, para);
}
if (returnValue) {
var value = null;
if (BI.isFunction(replaceFunc)) {
value = replaceFunc.apply(o, para);
} else {
value = oldFunction.apply(o, para);
}
if (BI.isFunction(afterFunc)) {
para.unshift(value);
value = afterFunc.apply(o, para);
}
return value;
} else {
if (BI.isFunction(replaceFunc)) {
replaceFunc.apply(o, para);
} else {
oldFunction.apply(o, para);
}
if (BI.isFunction(afterFunc)) {
afterFunc.apply(o, para);
}
}
};
}
});
}
}
}
});
$.extend(BI.Msg, {
/**
* 弹出框然后有个输入确认返回输入的值
* @param title 标题
* @param content 标签
* @param callback 回调函数
* @param validationChecker 文本框的校验
*/
prompt: function prompt(title, content, callback, config, checkFunc) {
// BI.Popovers.removeAll();
var id = BI.UUID();
var textEditor = {
type: "bi.text_editor",
ref: function ref(_ref) {
BI[id] = _ref;
},
width: 200
};
textEditor = BI.extend(textEditor, config ? config : {});
var widget = BI.Popovers.create(id, {
type: "bi.bar_popover",
// String或者是json都行
header: title,
size: "small",
body: {
type: "bi.horizontal",
horizontalAlign: "center",
verticalAlign: "middle",
hgap: 10,
items: [{
type: "bi.label",
text: content
}, textEditor]
},
footer: {
type: "bi.right_vertical_adapt",
lgap: 10,
items: [{
type: "bi.button",
text: "取消",
value: 1,
level: "ignore",
handler: function handler(v) {
BI.Popovers.remove(id);
}
}, {
type: "bi.button",
text: "确定",
value: 0,
handler: function handler(v) {
var value = BI[id].getValue();
if (BI.isFunction(checkFunc) && !checkFunc(value)) {
return;
}
BI.isFunction(callback) && callback(BI[id].getValue());
BI.Popovers.remove(id);
}
}]
}
/* listeners: [{
eventName: "EVENT_CANCEL",
action: function () {
}
}, {
eventName: "EVENT_CONFIRM",
action: function () {
BI.isFunction(callback) && callback(BI[id].getValue());
}
}]*/
});
widget.show(id);
}
});
}();
;
!function () {
function importResource(path, type) {
var url = Dec.fineServletURL + "/file?path=" + path;
@ -1195,17 +1197,33 @@
reportMap = self.store.frmMap;
}
if (reportMap[item.id]) {
return BI.extend(self.store.createExtendReportNode(pId, reportMap[item.id], find.typeValue), info);
return BI.extend(self.store.createExtendReportNode(pId, reportMap[item.id], find.typeValue, reportMap), info);
}
return null;
}
return self.store.oldGetNodeByItem(pId, item, direction);
};
self.store.createExtendReportNode = function (pId, report, itemType) {
self.store.createExtendReportNode = function (pId, report, itemType, reportMap) {
return {
text: report.name,
title: function title() {
return report.name;
if (BI.isNotNull(reportMap[report.id].position)) {
return Promise.resolve(getReportDescription(reportMap[report.id]));
}
return getExtendReportInfo(report.id, itemType).then(function (res) {
var _res$data = res.data,
position = _res$data.position,
createBy = _res$data.createBy,
createTime = _res$data.createTime,
lastUpdateTime = _res$data.lastUpdateTime;
reportMap[report.id] = Object.assign(Object.assign({}, report), {
position: position,
createBy: createBy,
createTime: createTime,
lastUpdateTime: lastUpdateTime
});
return getReportDescription(reportMap[report.id]);
});
},
value: Object.assign(Object.assign({}, report), {
moduleType: 2
@ -1215,6 +1233,28 @@
itemType: itemType
};
};
function getExtendReportInfo(id, type) {
var url = "/v5/conf/tables/usage/info";
var data = {
id: id,
type: type
};
return new Promise(function (resolve) {
Dec.reqPost(url, data, function (res) {
resolve(res);
});
});
}
function getReportDescription(report) {
var description = [];
description.push("报表名称:" + report.name);
description.push(BI.i18nText('BI-Conf_Position_With_Colon') + report.position);
description.push(BI.i18nText('BI-Basic_Creator_Colon') + report.createBy);
report.createTime && description.push(BI.i18nText('BI-Basic_Creator_Time_Colon') + BI.print(BI.getDate(report.createTime), '%Y/%X/%d %H:%M:%S'));
report.lastUpdateTime && description.push(BI.i18nText('BI-Conf_Last_Edit_Time') + BI.print(BI.getDate(report.lastUpdateTime), '%Y/%X/%d %H:%M:%S'));
return description.join('\n');
}
/**
* 图标
* @type {function(*=): (*)}

92
src/main/resources/com/fr/plugin/bi/mix/web/js/subject/fr.mix.bi.subject.min.js vendored

@ -865,10 +865,12 @@
} else {
var token = res.data;
}
var url = window.location.origin + Dec.fineServletURL + "?" + "GWToken" + "?" + token + "?" + self.model.id ;
var url = window.location.origin + Dec.fineServletURL + "?" + "GWToken" + "?" + token + "?" + self.model.id;
url = "finereport://" + encodeURIComponent(url);
try {
BI.CLI.compatible.remoteDesign(url,{web_ip : BI.CLI.info.ip},self.model.subjectInfo.id);
BI.CLI.compatible.remoteDesign(url, {
web_ip: BI.CLI.info.ip
}, self.model.subjectInfo.id);
} catch (e) {
window.open(url);
}
@ -1343,53 +1345,53 @@
}
self.store.oldSetLayout();
};
};
});
BI.Plugin.registerObject("bi.subject.relationship.pane", function (object) {
var self = object;
object.populate = function () {
self.loading();
return self.store.initData().then(function () {
BI.each(BI.Front.SUPPORT_REPORT, function (index, item) {
var reportInfo = {};
var reportType = item.type;
var reportItems = [];
if (reportType === "cpt") {
reportItems = self.model.subjectInfo.cptItems.availableReports;
} else if (reportType === "frm") {
reportItems = self.model.subjectInfo.frmItems.availableReports;
} else {
return;
}
BI.each(reportItems, function (i, o) {
reportInfo[o.id] = BI.extend({
available: true
}, o);
var find = BI.find(self.model.itemBeans, function (a, b) {
return b.id === o.id;
});
if (!find) {
//甘老师后台接口没有返回无血缘的数据,所以找不到就也要装进去,父节点为空
self.model.itemBeans.push({
id: o.id,
type: item.typeValue,
fatherItemIds: []
});
self.populate = function () {
self.loading();
return self.store.initData().then(function () {
BI.each(BI.Front.SUPPORT_REPORT, function (index, item) {
var reportInfo = {};
var reportType = item.type;
var reportItems = [];
if (reportType === "cpt") {
reportItems = self.model.subjectInfo.cptItems.availableReports;
} else if (reportType === "frm") {
reportItems = self.model.subjectInfo.frmItems.availableReports;
} else {
return;
}
BI.each(reportItems, function (i, o) {
reportInfo[o.id] = BI.extend({
available: true
}, o);
var find = BI.find(self.model.itemBeans, function (a, b) {
return b.id === o.id;
});
if (!find) {
//甘老师后台接口没有返回无血缘的数据,所以找不到就也要装进去,父节点为空
self.model.itemBeans.push({
id: o.id,
type: item.typeValue,
fatherItemIds: []
});
}
});
self.model.resourceMap[reportType] = reportInfo;
});
self.model.resourceMap[reportType] = reportInfo;
self.store._computedWatchers.shownIdsMap.value = self.store._computedWatchers.shownIdsMap.getter.call(self.store);
self.store._computedWatchers.shownList.value = self.store._computedWatchers.shownList.getter.call(self.store);
self.store._computedWatchers.shownEdges.value = self.store._computedWatchers.shownEdges.getter.call(self.store);
self.store.setLayout();
}).then(function () {
self.loaded();
if (BI.isNotEmptyArray(self.model.relationMapLayout)) {
self.map.initMap();
}
});
self.store._computedWatchers.shownIdsMap.value = self.store._computedWatchers.shownIdsMap.getter.call(self.store);
self.store._computedWatchers.shownList.value = self.store._computedWatchers.shownList.getter.call(self.store);
self.store._computedWatchers.shownEdges.value = self.store._computedWatchers.shownEdges.getter.call(self.store);
self.store.setLayout();
}).then(function () {
self.loaded();
if (BI.isNotEmptyArray(self.model.relationMapLayout)) {
self.map.initMap();
}
});
};
};
});
BI.Plugin.registerObject("bi.subject.relationship.pane", function (object) {
var self = object;
/**
* 血缘关系视图 点击切换tab的方法

51
webcode/src/decision/core/front.conf.pack.table.usage.js

@ -32,7 +32,7 @@
isParent: item.knots > 0,
count: item.knots,
childrenItems: item.usageItemBeans,
direction,
direction: direction,
};
var reportMap = {};
if (find.typeValue === 101) {
@ -41,17 +41,29 @@
reportMap = self.store.frmMap
}
if (reportMap[item.id]) {
return BI.extend(self.store.createExtendReportNode(pId, reportMap[item.id], find.typeValue), info)
return BI.extend(self.store.createExtendReportNode(pId, reportMap[item.id], find.typeValue, reportMap), info)
}
return null;
}
return self.store.oldGetNodeByItem(pId, item, direction);
}
self.store.createExtendReportNode = function (pId, report, itemType) {
self.store.createExtendReportNode = function (pId, report, itemType, reportMap) {
return {
text: report.name,
title: function () {
return report.name
if (BI.isNotNull(reportMap[report.id].position)) {
return Promise.resolve(getReportDescription(reportMap[report.id]));
}
return getExtendReportInfo(report.id, itemType).then(function (res) {
const {position, createBy, createTime, lastUpdateTime} = res.data;
reportMap[report.id] = Object.assign(Object.assign({}, report), {
position: position,
createBy: createBy,
createTime: createTime,
lastUpdateTime: lastUpdateTime
});
return getReportDescription(reportMap[report.id]);
});
},
value: Object.assign(Object.assign({}, report), {moduleType: 2}),
id: BI.UUID(),
@ -59,6 +71,37 @@
itemType: itemType,
}
}
function getExtendReportInfo(id, type) {
var url = "/v5/conf/tables/usage/info";
var data = {
id: id,
type: type
}
return new Promise(function (resolve) {
Dec.reqPost(url, data, function (res) {
resolve(res);
})
})
}
function getReportDescription(report) {
var description = [];
description.push("报表名称:" + report.name);
description.push(BI.i18nText('BI-Conf_Position_With_Colon') + report.position);
description.push(BI.i18nText('BI-Basic_Creator_Colon') + report.createBy);
report.createTime &&
description.push(
BI.i18nText('BI-Basic_Creator_Time_Colon') + BI.print(BI.getDate(report.createTime), '%Y/%X/%d %H:%M:%S')
);
report.lastUpdateTime &&
description.push(
BI.i18nText('BI-Conf_Last_Edit_Time') + BI.print(BI.getDate(report.lastUpdateTime), '%Y/%X/%d %H:%M:%S')
);
return description.join('\n');
}
/**
* 图标
* @type {function(*=): (*)}

87
webcode/src/subject/core/front.subject.relationship.pane.js

@ -22,56 +22,57 @@
}
self.store.oldSetLayout();
}
}
})
BI.Plugin.registerObject("bi.subject.relationship.pane", function (object) {
var self = object;
object.populate = function () {
self.loading();
return self.store.initData().then(function () {
BI.each(BI.Front.SUPPORT_REPORT, function (index, item) {
var reportInfo = {};
var reportType = item.type;
var reportItems = [];
if (reportType === "cpt") {
reportItems = self.model.subjectInfo.cptItems.availableReports
} else if (reportType === "frm") {
reportItems = self.model.subjectInfo.frmItems.availableReports
} else {
return
}
BI.each(reportItems, function (i, o) {
reportInfo[o.id] = BI.extend({
available:true
},o);
var find = BI.find(self.model.itemBeans, function (a, b) {
return b.id === o.id;
})
if (!find) {//甘老师后台接口没有返回无血缘的数据,所以找不到就也要装进去,父节点为空
self.model.itemBeans.push({
id: o.id,
type: item.typeValue,
fatherItemIds: []
})
self.populate = function () {
self.loading();
return self.store.initData().then(function () {
BI.each(BI.Front.SUPPORT_REPORT, function (index, item) {
var reportInfo = {};
var reportType = item.type;
var reportItems = [];
if (reportType === "cpt") {
reportItems = self.model.subjectInfo.cptItems.availableReports
} else if (reportType === "frm") {
reportItems = self.model.subjectInfo.frmItems.availableReports
} else {
return
}
BI.each(reportItems, function (i, o) {
reportInfo[o.id] = BI.extend({
available: true
}, o);
var find = BI.find(self.model.itemBeans, function (a, b) {
return b.id === o.id;
})
if (!find) {//甘老师后台接口没有返回无血缘的数据,所以找不到就也要装进去,父节点为空
self.model.itemBeans.push({
id: o.id,
type: item.typeValue,
fatherItemIds: []
})
}
});
(self.model.resourceMap)[reportType] = reportInfo;
});
(self.model.resourceMap)[reportType] = reportInfo;
self.store._computedWatchers.shownIdsMap.value = self.store._computedWatchers.shownIdsMap.getter.call(self.store);
self.store._computedWatchers.shownList.value = self.store._computedWatchers.shownList.getter.call(self.store);
self.store._computedWatchers.shownEdges.value = self.store._computedWatchers.shownEdges.getter.call(self.store);
self.store.setLayout();
}).then(function () {
self.loaded();
if (BI.isNotEmptyArray(self.model.relationMapLayout)) {
self.map.initMap();
}
});
self.store._computedWatchers.shownIdsMap.value = self.store._computedWatchers.shownIdsMap.getter.call(self.store);
self.store._computedWatchers.shownList.value = self.store._computedWatchers.shownList.getter.call(self.store);
self.store._computedWatchers.shownEdges.value = self.store._computedWatchers.shownEdges.getter.call(self.store);
self.store.setLayout();
}).then(function () {
self.loaded();
if (BI.isNotEmptyArray(self.model.relationMapLayout)) {
self.map.initMap();
}
});
}
}
})
BI.Plugin.registerObject("bi.subject.relationship.pane", function (object) {
var self = object;
/**
* 血缘关系视图 点击切换tab的方法
* @type {object.store.showSelect}

Loading…
Cancel
Save