|
@@ -56,9 +56,17 @@ export default {
|
|
* labels: [{
|
|
* labels: [{
|
|
id:'',
|
|
id:'',
|
|
text:'',
|
|
text:'',
|
|
- color: '',
|
|
|
|
- fontSize: '',
|
|
|
|
- backGround:''
|
|
|
|
|
|
+ style:{
|
|
|
|
+ color: '',
|
|
|
|
+ fontSize: '',
|
|
|
|
+ backGround:'',
|
|
|
|
+ fontWeight:1
|
|
|
|
+ },
|
|
|
|
+ //文本的绝对位置
|
|
|
|
+ absolutePosition: {
|
|
|
|
+ x: 1,
|
|
|
|
+ y: 1,
|
|
|
|
+ },
|
|
}]
|
|
}]
|
|
*/
|
|
*/
|
|
labelArr: [],
|
|
labelArr: [],
|
|
@@ -248,13 +256,50 @@ export default {
|
|
*/
|
|
*/
|
|
function parseNode(dataArr, absolutePosition) {
|
|
function parseNode(dataArr, absolutePosition) {
|
|
dataArr.forEach((_dataObj) => {
|
|
dataArr.forEach((_dataObj) => {
|
|
|
|
+ //文本
|
|
|
|
+ if (_dataObj.label && _dataObj.label.content) {
|
|
|
|
+ let _labelObj = _dataObj.label;
|
|
|
|
+ _labelObj.id = _labelObj.id || Math.random().toString();
|
|
|
|
+
|
|
|
|
+ let _style = _labelObj.style || {};
|
|
|
|
+ _style.color =
|
|
|
|
+ _style.color ||
|
|
|
|
+ window.__systemConf.systemGraph.peiDian.text.color;
|
|
|
|
+ _style.fontSize =
|
|
|
|
+ _style.fontSize ||
|
|
|
|
+ window.__systemConf.systemGraph.peiDian.text.size;
|
|
|
|
+ _style.backGround =
|
|
|
|
+ _style.backGround ||
|
|
|
|
+ window.__systemConf.systemGraph.peiDian.text.backGround;
|
|
|
|
+ _style.fontWeight =
|
|
|
|
+ _style.fontWeight ||
|
|
|
|
+ window.__systemConf.systemGraph.peiDian.text.weight;
|
|
|
|
+
|
|
|
|
+ let textNewAbsolutePosition = {
|
|
|
|
+ x: _dataObj.location.x + absolutePosition.x,
|
|
|
|
+ y: _dataObj.location.y + absolutePosition.y,
|
|
|
|
+ };
|
|
|
|
+ labelArr.push({
|
|
|
|
+ id: _labelObj.id,
|
|
|
|
+ text: _labelObj.content,
|
|
|
|
+ style: {
|
|
|
|
+ color: _style.color,
|
|
|
|
+ fontSize: _style.fontSize,
|
|
|
|
+ backGround: _style.backGround,
|
|
|
|
+ fontWeight: _style.fontWeight,
|
|
|
|
+ },
|
|
|
|
+ //文本的绝对位置
|
|
|
|
+ absolutePosition: {
|
|
|
|
+ x: 1,
|
|
|
|
+ y: 1,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
var newAbsolutePosition = {
|
|
var newAbsolutePosition = {
|
|
x: _dataObj.location.x + absolutePosition.x,
|
|
x: _dataObj.location.x + absolutePosition.x,
|
|
y: _dataObj.location.y + absolutePosition.y,
|
|
y: _dataObj.location.y + absolutePosition.y,
|
|
};
|
|
};
|
|
- //文本
|
|
|
|
- if (_dataObj.label) {
|
|
|
|
- }
|
|
|
|
switch (_dataObj.compType) {
|
|
switch (_dataObj.compType) {
|
|
//容器
|
|
//容器
|
|
case "container":
|
|
case "container":
|