Commit 2c89c33d by zhaochengxiang

节点增加通透

parent 85a90192
......@@ -88,6 +88,20 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) {
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) => {
let nodeColor = '', nodeHighlightColor = '';
......@@ -106,6 +120,7 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) {
const { innerRaduis, raduis } = calcRaduis(cfg);
const { nodeColor, nodeHighlightColor } = calcSecondaryNodeColor(cfg);
const opacity = calcOpacity(cfg);
const nodeLevel = cfg?.levelId.split('-').length;
let chartColor = '';
......@@ -159,6 +174,7 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) {
.style({
lineWidth: 0,
cursor: 'pointer',
fillOpacity: opacity,
})
.state({
active: {
......@@ -275,7 +291,7 @@ const init = (ctx) => function (container, data, onCenterClick, onExpandClick) {
r: innerRaduis,
lineWidth: 0,
fill: nodeColor,
fillOpacity: 1.0,
fillOpacity: opacity,
stroke: '#fff',
strokeOpacity: 0,
cursor: (cfg?.virtual)?'':'pointer',
......
......@@ -63,26 +63,26 @@ const ConstraintSelect = ({ value = {}, constraints = [], onChange, ...restProps
)
}
const TemplateSelect = ({ value = {}, templates = [], onChange, ...restProps }) => {
return (
<Select
onChange={onChange}
value={value?.name || ''}
placeholder='请选择生成表类型'
allowClear
{...restProps}
>
{
(templates||[]) && templates.map((template, index) => {
return (
<Option key={index} value={template.name||''} >{template.cnName||''}</Option>
);
})
}
</Select>
)
}
// const TemplateSelect = ({ value = {}, templates = [], onChange, ...restProps }) => {
// return (
// <Select
// onChange={onChange}
// value={value?.name || ''}
// placeholder='请选择生成表类型'
// allowClear
// {...restProps}
// >
// {
// (templates||[]) && templates.map((template, index) => {
// return (
// <Option key={index} value={template.name||''} >{template.cnName||''}</Option>
// );
// })
// }
// </Select>
// )
// }
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