Commit 2c89c33d by zhaochengxiang

节点增加通透

parent 85a90192
...@@ -88,6 +88,20 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) { ...@@ -88,6 +88,20 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) {
return { innerRaduis, raduis: (innerRaduis+30) }; return { innerRaduis, raduis: (innerRaduis+30) };
} }
const calcOpacity = (node) => {
const nodeLevel = node?.levelId.split('-').length;
if (nodeLevel <=2) return 1.0;
if (nodeLevel === 3) return 0.8;
if (nodeLevel === 4) return 0.6;
if (nodeLevel === 5) return 0.4;
return 0.3;
}
const calcSecondaryNodeColor = (node) => { const calcSecondaryNodeColor = (node) => {
let nodeColor = '', nodeHighlightColor = ''; let nodeColor = '', nodeHighlightColor = '';
...@@ -106,6 +120,7 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) { ...@@ -106,6 +120,7 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) {
const { innerRaduis, raduis } = calcRaduis(cfg); const { innerRaduis, raduis } = calcRaduis(cfg);
const { nodeColor, nodeHighlightColor } = calcSecondaryNodeColor(cfg); const { nodeColor, nodeHighlightColor } = calcSecondaryNodeColor(cfg);
const opacity = calcOpacity(cfg);
const nodeLevel = cfg?.levelId.split('-').length; const nodeLevel = cfg?.levelId.split('-').length;
let chartColor = ''; let chartColor = '';
...@@ -159,6 +174,7 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) { ...@@ -159,6 +174,7 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) {
.style({ .style({
lineWidth: 0, lineWidth: 0,
cursor: 'pointer', cursor: 'pointer',
fillOpacity: opacity,
}) })
.state({ .state({
active: { active: {
...@@ -275,7 +291,7 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) { ...@@ -275,7 +291,7 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) {
r: innerRaduis, r: innerRaduis,
lineWidth: 0, lineWidth: 0,
fill: nodeColor, fill: nodeColor,
fillOpacity: 1.0, fillOpacity: opacity,
stroke: '#fff', stroke: '#fff',
strokeOpacity: 0, strokeOpacity: 0,
cursor: (cfg?.virtual)?'':'pointer', cursor: (cfg?.virtual)?'':'pointer',
......
...@@ -63,26 +63,26 @@ const ConstraintSelect = ({ value = {}, constraints = [], onChange, ...restProps ...@@ -63,26 +63,26 @@ const ConstraintSelect = ({ value = {}, constraints = [], onChange, ...restProps
) )
} }
const TemplateSelect = ({ value = {}, templates = [], onChange, ...restProps }) => { // const TemplateSelect = ({ value = {}, templates = [], onChange, ...restProps }) => {
return ( // return (
<Select // <Select
onChange={onChange} // onChange={onChange}
value={value?.name || ''} // value={value?.name || ''}
placeholder='请选择生成表类型' // placeholder='请选择生成表类型'
allowClear // allowClear
{...restProps} // {...restProps}
> // >
{ // {
(templates||[]) && templates.map((template, index) => { // (templates||[]) && templates.map((template, index) => {
return ( // return (
<Option key={index} value={template.name||''} >{template.cnName||''}</Option> // <Option key={index} value={template.name||''} >{template.cnName||''}</Option>
); // );
}) // })
} // }
</Select> // </Select>
) // )
} // }
const AttributesSelect = ({ value = [], modelerData, onChange, mode = 'multiple', ...restProps }) => { const AttributesSelect = ({ value = [], modelerData, onChange, mode = 'multiple', ...restProps }) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment