Skip to content

Commit

Permalink
fix: add operator toolbar overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
baizn committed Sep 20, 2023
1 parent 3a4d735 commit a57a78c
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 66 deletions.
2 changes: 1 addition & 1 deletion packages/gi-assets-basic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/gi-assets-basic",
"version": "2.4.16",
"version": "2.4.20",
"description": "G6VP 基础资产包",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
138 changes: 73 additions & 65 deletions packages/gi-assets-basic/src/components/RichContainer/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const RichContainer = props => {
value: item.id,
label: (
<Space style={{ color: '#363740' }}>
<Icon type={icon}></Icon>
<Icon type={icon} style={{ position: 'relative', top: 3, fontSize: 14 }}></Icon>
{title}
</Space>
),
Expand Down Expand Up @@ -159,72 +159,80 @@ const RichContainer = props => {
suffixIcon={<Icon type='icon-shituxiala' />}
/>
</div>
<div className="toolbar-item">
<Divider type="vertical" />
<span
style={{
marginLeft: 6,
color: '#98989D',
marginRight: 8,
}}
>
查询过滤
</span>
<Button
type={HAS_QUERY_VIEW ? 'primary' : 'text'}
icon={<Icon type={DataArea.icon} />}
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
fontSize: 12,
...(HAS_QUERY_VIEW ? ActiveButtonStyle : {}),
}}
onClick={() => {
if (!HAS_QUERY_VIEW) {
handleChange(DATA_QUERY_ID[0]);
}
}}
>
{$i18n.get({ id: 'basic.components.RichContainer.Component.Query', dm: '查询' })}
</Button>
</div>
<div className="toolbar-item">
<Button
type={HAS_FILTER_VIEW ? 'primary' : 'text'}
icon={<Icon type={FilterArea.icon} />}
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
fontSize: 12,
...(HAS_FILTER_VIEW ? ActiveButtonStyle : {}),
}}
onClick={() => {
if (!HAS_FILTER_VIEW) {
handleChange(DATA_FILTER_ID[0]);
}
}}
>
{$i18n.get({ id: 'basic.components.RichContainer.Component.Filter', dm: '筛选' })}
</Button>
</div>

<Toolbar
value={activeKey}
onChange={handleChange}
title={$i18n.get({ id: 'basic.components.RichContainer.Component.LayoutStyle', dm: '布局样式' })}
options={StylingArea.components}
HAS_GRAPH={HAS_GRAPH}
/>
{
viewMode === 'JSONMode' &&
<div className='operator-toolbar-overlay' />
}

<Toolbar
value={activeKey}
onChange={handleChange}
title={$i18n.get({ id: 'basic.components.RichContainer.Component.CanvasOperation', dm: '画布操作' })}
options={CanvasArea.components}
HAS_GRAPH={HAS_GRAPH}
/>
<div className='toolbar-item' style={{ opacity: viewMode === 'JSONMode' ? 0.25 : 1 }}>
<div className="toolbar-item">
<Divider type="vertical" />
<span
style={{
marginLeft: 6,
color: '#98989D',
marginRight: 8,
}}
>
查询过滤
</span>
<Button
type={HAS_QUERY_VIEW ? 'primary' : 'text'}
icon={<Icon type={DataArea.icon} />}
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
fontSize: 12,
...(HAS_QUERY_VIEW ? ActiveButtonStyle : {}),
}}
onClick={() => {
if (!HAS_QUERY_VIEW) {
handleChange(DATA_QUERY_ID[0]);
}
}}
>
{$i18n.get({ id: 'basic.components.RichContainer.Component.Query', dm: '查询' })}
</Button>
</div>
<div className="toolbar-item">
<Button
type={HAS_FILTER_VIEW ? 'primary' : 'text'}
icon={<Icon type={FilterArea.icon} />}
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
fontSize: 12,
...(HAS_FILTER_VIEW ? ActiveButtonStyle : {}),
}}
onClick={() => {
if (!HAS_FILTER_VIEW) {
handleChange(DATA_FILTER_ID[0]);
}
}}
>
{$i18n.get({ id: 'basic.components.RichContainer.Component.Filter', dm: '筛选' })}
</Button>
</div>

<Toolbar
value={activeKey}
onChange={handleChange}
title={$i18n.get({ id: 'basic.components.RichContainer.Component.LayoutStyle', dm: '布局样式' })}
options={StylingArea.components}
HAS_GRAPH={HAS_GRAPH}
/>

<Toolbar
value={activeKey}
onChange={handleChange}
title={$i18n.get({ id: 'basic.components.RichContainer.Component.CanvasOperation', dm: '画布操作' })}
options={CanvasArea.components}
HAS_GRAPH={HAS_GRAPH}
/>
</div>
</div>

<div className={`gi-rich-container-content ${isSheet ? 'has-sheet' : ''}`}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
justify-content: center;
align-items: center;
}
.operator-toolbar-overlay {
position: absolute;
left: 145px;
width: 85%;
height: 43px;
z-index: 9;
}
}
.gi-rich-container-content {
&.has-sheet {
Expand Down

0 comments on commit a57a78c

Please sign in to comment.