4989 形状锚点图标不随着画布放大缩小

This commit is contained in:
446052889@qq.com 2022-09-23 12:26:37 +08:00
parent 9c735dd93e
commit d4cfd08180
42 changed files with 320 additions and 160 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 569 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 893 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 893 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

View File

@ -3985,28 +3985,20 @@ var Designer = {
if (temp.isShowAttrName && attrTypeArray.indexOf(attrType) >= 0 && (cfgContent + '').trim().length > 0) {
cfgContent = "(" + temp.attrName + ")" +cfgContent;
}
if (attrType == "relation" && cfgContent.length == 0) {
cfgContent = "";
} else if (attrType == "relation" && cfgContent.length > 0) {
if (attrType == 'relation' || attrType == 'awsorg') {
var shapeIdAttrId = q.id + "_" + attrId;
var relationData = relationShapeModelObject;
var relationValue = "";
for (var j = 0; j < cfgContent.length; j++) {
if (j == cfgContent.length - 1) {
if (relationData.hasOwnProperty(shapeIdAttrId)) {
var tempRelationValue = relationData[shapeIdAttrId];
relationValue = relationValue + tempRelationValue;
}
} else if (relationData.hasOwnProperty(shapeIdAttrId)) {
var tempRelationValue = relationData[shapeIdAttrId] + "|";
relationValue = relationValue + tempRelationValue;
}
if (relationData[shapeIdAttrId]) {
cfgContent = relationData[shapeIdAttrId].join(",");
} else {
cfgContent = "";
}
cfgContent = relationValue;
if (temp.isShowAttrName) {
cfgContent = "(" + temp.attrName + ")" + cfgContent;
}
}
params.showType = "attr";
params.value = cfgContent;
}
@ -4077,18 +4069,18 @@ var Designer = {
}
}
var key = q.name;
if (specialShapeConfig == undefined) {
if (specialShapeConfig == undefined || specialShapeConfig.length == 0) {
if (commonShapeConfig != undefined && commonShapeConfig[key] != undefined) {
commonShapeConfig = commonShapeConfig[key];
this.handleShapeConfigData(commonShapeConfig, q, attributesJsonArray);
}
} else {
if (commonShapeConfig == undefined) {
if (commonShapeConfig == undefined || commonShapeConfig.length == 0) {
this.handleShapeConfigData(Utils.copy(specialShapeConfig), q, attributesJsonArray);
} else {
commonShapeConfig = commonShapeConfig[key];
var tempCommonShapeConfig = [];
if (commonShapeConfig != undefined) {
if (commonShapeConfig != undefined && commonShapeConfig.length > 0) {
var dataArray = [];
var tempArray = [];
for (i = 0; i < commonShapeConfig.length; i++) {
@ -4521,6 +4513,7 @@ var Designer = {
}
var jj = j.dataShowConfig.value;
if (jj && jj.length > 0) {
for (var n = 0; n < jj.length; n++) {
var jjj = jj[n];
var l = "";
@ -4529,7 +4522,23 @@ var Designer = {
l = j.name + ": "
}
if (jjj.showType == "text" || jjj.showType == "attr") {
l += jjj.value
l += jjj.value;
//判断如果岗位多个数据,...显示 by zhaolei
/* if (jjj.value != "") {
debugger;
var lenth = jjj.value.match(/,/g).length;
if (lenth >= 2) {
var index1 = jjj.value.indexOf(",");
var index2 = jjj.value.indexOf(",", index1 + 1);
l += jjj.value.substr(0, index2) + "...";
} else {
l += jjj.value;
}
}else{
l += jjj.value;
}*/
} else {
if (jjj.showType == "icon") {
o = jjj.icon
@ -4563,6 +4572,143 @@ var Designer = {
m(j, l, o)*/
}
function m(c, y, x) {
if (1+1 == 3) {
// if (c.showType == 'icon' && x.indexOf("&#x") >= 0) {// 图标重构
var h = c.horizontal;
var I = c.vertical;
var icon = x.split("|")[0];
var iconColor = x.split("|")[1];
var H = $("<div id='attr_canvas_" + c.id + "' class='attr_canvas' style='font-size: 20px;'><i id='attr_canvas_icon_" + c.id + "' style='position: relative; left: 0; top: 0;font-size: 1em;color:" + iconColor + "' class='awsui-iconfont'>" + icon + "</i></div>").appendTo($("#" + i.id));
// 图标大小处理
// $('#attr_canvas_' + c.id).css('font-size', Designer.config.scale * 20 + 'px');
$('#attr_canvas_icon_' + c.id).css('font-size', Designer.config.scale + 'em');
debugger;
var D = 0;
var a = 20;
if (x != "") {
D += 20
}
var E, F;
if (h == "mostleft") {// 左外边
E = -D - 2
} else if (h == "leftedge") {// 左线上
E = -D / 2
} else if (h == "left") {// 左内边
E = 2
} else if (h == "center") {// 中间
E = (i.props.w - D) / 2;
} else if (h == "right") {// 右内边
E = i.props.w - D - 2;
} else if (h == "rightedge") {// 右线上
E = i.props.w - D / 2
} else if (h == "mostright"){// 右外边
E = i.props.w + 2
}
if (I == "mosttop") {// 上外边
F = -a
} else if (I == "topedge") {// 上线上
F = -a / 2
} else if (I == "top") {// 上内边
F = 0
} else if (I == "middle") {// 中间
F = (i.props.h - a) / 2
} else if (I == "bottom") {// 下内边
F = i.props.h - a
} else if (I == "bottomedge") {// 下线上
F = i.props.h - a / 2
} else if (I == "mostbottom"){// 下外边
F = i.props.h
}
var g = {
x: E,
y: F,
w: D,
h: a
};
var G = Utils.getRotatedBox(g, i.props.angle, n);
H.attr({
width: G.w.toScale(),
height: G.h.toScale()
});
var d = (G.x + (i.props.x - k.x) + 10).toScale();
var e = (G.y + (i.props.y - k.y) + 10).toScale();
if (h != "mostleft" || h == "left" || h != "right") {
H.css({
left: d,
top: e
});
}
if (D > i.props.w) {
var tempShapeWidth = i.props.w;
if (tempShapeWidth < 100) {
tempShapeWidth = 100;
}
H[0].width = tempShapeWidth + 10;
H[0].height = Math.ceil(D / tempShapeWidth) * 10 + 15;
if (h == "mostleft") {
d = -tempShapeWidth + tempShapeWidth*0.2;
H.css({
left: d,
top: e
});
}
if (h == "left") {
H.css({
left: d,
top: e - 5
});
}
if (h == "left" && I != "bottom") {
H.css({
left: d,
top: e
});
}
if (h == "right") {
d = tempShapeWidth / 4;
H.css({
left: d,
top: e - 5
});
}
if (I == "mosttop" || I == "bottom") {
e = e - Math.ceil(D / tempShapeWidth) * 5;
H.css({
left: d,
top: e
});
}
if (h == "center" && Math.ceil(D / tempShapeWidth) > 1) {
H.css({
left: 15,
top: e
});
}
if (h == "right" && I != "mosttop" && I != "bottom") {
d = tempShapeWidth / 4;
H.css({
left: d,
top: e
});
}
} else {
if (h == "mostleft") {
d = -D;
H.css({
left: d,
top: e
});
}
if (h == "right") {
d = i.props.w - D;
H.css({
left: d,
top: e
});
}
}
return;
}
var h = c.horizontal;
var I = c.vertical;
var H = $("<canvas id='attr_canvas_" + c.id + "' class='attr_canvas'></canvas>").appendTo($("#" + i.id));
@ -4674,10 +4820,10 @@ var Designer = {
var tempL = (v + 1) * tempShapeWidth;
var tempX = 0;
if (c.showType == "text") {
b.fillStyle = "#A1A1A1";
b.fillStyle = "#696969";
}
if (c.showType == "attr") {
b.fillStyle = "#6666FF";
b.fillStyle = "#191970";
}
var tempY = a / 2 + v * 12;
if (tempL < D) {
@ -4750,6 +4896,7 @@ var Designer = {
b.fillText(y, 0, a / 2);
}
if (x != "") {
debugger;
if (x.indexOf("&#x") >= 0) {
var icon = x.split("|")[0];
var iconColor = x.split("|")[1];
@ -6629,11 +6776,11 @@ var Utils = {
if (p && this.isLocked(p.id)) {
Utils.showLockers(p)
} else {
//by bzp 处理富文本显示的按钮
if(p.name == "regulation" && methodId == 'control.policy'){
parent.$("#dock_btn_richtext").show();
}
//by bzp end
//by bzp 处理富文本显示的按钮
if(p.name == "regulation" && methodId == 'control.policy'){
parent.$("#dock_btn_richtext").show();
}
//by bzp end
Utils.showAnchors(p)
}
}

View File

@ -4524,20 +4524,20 @@ var Designer = {
if (jjj.showType == "text" || jjj.showType == "attr") {
l += jjj.value;
//判断如果岗位多个数据,...显示 by zhaolei
/* if (jjj.value != "") {
debugger;
var lenth = jjj.value.match(/,/g).length;
if (lenth >= 2) {
var index1 = jjj.value.indexOf(",");
var index2 = jjj.value.indexOf(",", index1 + 1);
l += jjj.value.substr(0, index2) + "...";
} else {
l += jjj.value;
}
/* if (jjj.value != "") {
debugger;
var lenth = jjj.value.match(/,/g).length;
if (lenth >= 2) {
var index1 = jjj.value.indexOf(",");
var index2 = jjj.value.indexOf(",", index1 + 1);
l += jjj.value.substr(0, index2) + "...";
} else {
l += jjj.value;
}
}else{
l += jjj.value;
}*/
}else{
l += jjj.value;
}*/
} else {
if (jjj.showType == "icon") {
@ -4575,132 +4575,145 @@ var Designer = {
if (c.showType == 'icon' && x.indexOf("&#x") >= 0) {// 图标重构
var h = c.horizontal;
var I = c.vertical;
var H = $("<canvas id='attr_canvas_" + c.id + "' class='attr_canvas'></canvas>").appendTo($("#" + i.id));
var b = H[0].getContext("2d");
var w = "12px ";
var icon = x.split("|")[0];
var iconColor = x.split("|")[1];
var H = $("<div id='attr_canvas_" + c.id + "' class='attr_canvas'><i style='font-size: 20px;color:" + iconColor + "' class='awsui-iconfont'>" + icon + "</i></div>").appendTo($("#" + i.id));
var D = 0;
var a = 20;
if (x != "") {
D += 20
}
var E, F;
if (h == "mostleft") {// 左外边
E = -D - 2
} else if (h == "leftedge") {// 左线上
E = -D / 2
} else if (h == "left") {// 左内边
E = 2
} else if (h == "center") {// 中间
E = (i.props.w - D) / 2;
} else if (h == "right") {// 右内边
E = i.props.w - D - 2;
} else if (h == "rightedge") {// 右线上
E = i.props.w - D / 2
} else if (h == "mostright"){// 右外边
E = i.props.w + 2
}
if (I == "mosttop") {// 上外边
F = -a
} else if (I == "topedge") {// 上线上
F = -a / 2
} else if (I == "top") {// 上内边
F = 0
} else if (I == "middle") {// 中间
F = (i.props.h - a) / 2
} else if (I == "bottom") {// 下内边
F = i.props.h - a
} else if (I == "bottomedge") {// 下线上
F = i.props.h - a / 2
} else if (I == "mostbottom"){// 下外边
F = i.props.h
}
var g = {
x: E,
y: F,
w: D,
h: a
};
var G = Utils.getRotatedBox(g, i.props.angle, n);
H.attr({
width: G.w.toScale(),
height: G.h.toScale()
});
var d = (G.x + (i.props.x - k.x) + 10).toScale();
var e = (G.y + (i.props.y - k.y) + 10).toScale();
if (h != "mostleft" || h == "left" || h != "right") {
H.css({
left: d,
top: e
var image = new Image();
image.src = '../apps/com.actionsoft.apps.coe.pal/img/anchorImg/'+ icon.replace('&#', '').replace(';', '') + '-' + iconColor.replace('#', '') +'.png';
image.onload = function() {
var D = 0;
var a = 20;
if (x != "") {
D += 20
}
var E, F;
if (h == "mostleft") {// 左外边
E = -D - 2
} else if (h == "leftedge") {// 左线上
E = -D / 2
} else if (h == "left") {// 左内边
E = 2
} else if (h == "center") {// 中间
E = (i.props.w - D) / 2;
} else if (h == "right") {// 右内边
E = i.props.w - D - 2;
} else if (h == "rightedge") {// 右线上
E = i.props.w - D / 2
} else if (h == "mostright"){// 右外边
E = i.props.w + 2
}
if (I == "mosttop") {// 上外边
F = -a
} else if (I == "topedge") {// 上线上
F = -a / 2
} else if (I == "top") {// 上内边
F = 0
} else if (I == "middle") {// 中间
F = (i.props.h - a) / 2
} else if (I == "bottom") {// 下内边
F = i.props.h - a
} else if (I == "bottomedge") {// 下线上
F = i.props.h - a / 2
} else if (I == "mostbottom"){// 下外边
F = i.props.h
}
var g = {
x: E,
y: F,
w: D,
h: a
};
var G = Utils.getRotatedBox(g, i.props.angle, n);
H.attr({
width: G.w.toScale(),
height: G.h.toScale()
});
}
if (D > i.props.w) {
var tempShapeWidth = i.props.w;
if (tempShapeWidth < 100) {
tempShapeWidth = 100;
}
H[0].width = tempShapeWidth + 10;
H[0].height = Math.ceil(D / tempShapeWidth) * 10 + 15;
if (h == "mostleft") {
d = -tempShapeWidth + tempShapeWidth*0.2;
var d = (G.x + (i.props.x - k.x) + 10).toScale();
var e = (G.y + (i.props.y - k.y) + 10).toScale();
if (h != "mostleft" || h == "left" || h != "right") {
H.css({
left: d,
top: e
});
}
if (h == "left") {
H.css({
left: d,
top: e - 5
});
}
if (h == "left" && I != "bottom") {
H.css({
left: d,
top: e
});
}
if (h == "right") {
d = tempShapeWidth / 4;
H.css({
left: d,
top: e - 5
});
}
if (I == "mosttop" || I == "bottom") {
e = e - Math.ceil(D / tempShapeWidth) * 5;
H.css({
left: d,
top: e
});
}
if (h == "center" && Math.ceil(D / tempShapeWidth) > 1) {
H.css({
left: 15,
top: e
});
}
if (h == "right" && I != "mosttop" && I != "bottom") {
d = tempShapeWidth / 4;
H.css({
left: d,
top: e
});
}
} else {
if (h == "mostleft") {
d = -D;
H.css({
left: d,
top: e
});
}
if (h == "right") {
d = i.props.w - D;
H.css({
left: d,
top: e
});
b.scale(Designer.config.scale, Designer.config.scale);
b.translate(G.w / 2, G.h / 2);
b.rotate(i.props.angle);
b.translate( - G.w / 2, -G.h / 2);
b.translate((G.w - g.w) / 2, (G.h - g.h) / 2);
b.globalAlpha = i.shapeStyle.alpha;
if (D > i.props.w) {
var tempShapeWidth = i.props.w;
if (tempShapeWidth < 100) {
tempShapeWidth = 100;
}
H[0].width = tempShapeWidth + 10;
H[0].height = Math.ceil(D / tempShapeWidth) * 10 + 15;
if (h == "mostleft") {
d = -tempShapeWidth + tempShapeWidth*0.2;
H.css({
left: d,
top: e
});
}
if (h == "left") {
H.css({
left: d,
top: e - 5
});
}
if (h == "left" && I != "bottom") {
H.css({
left: d,
top: e
});
}
if (h == "right") {
d = tempShapeWidth / 4;
H.css({
left: d,
top: e - 5
});
}
if (I == "mosttop" || I == "bottom") {
e = e - Math.ceil(D / tempShapeWidth) * 5;
H.css({
left: d,
top: e
});
}
if (h == "center" && Math.ceil(D / tempShapeWidth) > 1) {
H.css({
left: 15,
top: e
});
}
if (h == "right" && I != "mosttop" && I != "bottom") {
d = tempShapeWidth / 4;
H.css({
left: d,
top: e
});
}
} else {
if (h == "mostleft") {
d = -D;
H.css({
left: d,
top: e
});
}
if (h == "right") {
d = i.props.w - D;
H.css({
left: d,
top: e
});
}
}
b.drawImage(image, 0, 0);
}
return;
}
@ -6770,11 +6783,11 @@ var Utils = {
if (p && this.isLocked(p.id)) {
Utils.showLockers(p)
} else {
//by bzp 处理富文本显示的按钮
if(p.name == "regulation" && methodId == 'control.policy'){
parent.$("#dock_btn_richtext").show();
}
//by bzp end
//by bzp 处理富文本显示的按钮
if(p.name == "regulation" && methodId == 'control.policy'){
parent.$("#dock_btn_richtext").show();
}
//by bzp end
Utils.showAnchors(p)
}
}