Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
szse
Commits
77a7811d
Commit
77a7811d
authored
Dec 28, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量打标签
parent
0e44e45c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
57 deletions
+85
-57
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+10
-1
select-search-properties.jsx
src/view/Manage/Model/Component/select-search-properties.jsx
+0
-1
tag-help.jsx
src/view/Manage/Model/Component/tag-help.jsx
+2
-2
index.jsx
src/view/Manage/Model/index.jsx
+73
-53
No files found.
src/view/Manage/Model/Component/ModelTable.jsx
View file @
77a7811d
...
@@ -135,7 +135,7 @@ const ModelNameColumn = (props) => {
...
@@ -135,7 +135,7 @@ const ModelNameColumn = (props) => {
}
}
const ModelTable = (props) => {
const ModelTable = (props) => {
const { data, onChange, onItemAction, onSelect, onHistory, catalogId, keyword, onAutoCreateTable, offset = null, view, modelState, user, selectModelerIds, visibleColNames, tagSelectOptions } = props;
const { data, onChange, onItemAction, onSelect, onHistory, catalogId, keyword, onAutoCreateTable, offset = null, view, modelState, user, selectModelerIds, visibleColNames, tagSelectOptions
, batchAddTagChange
} = props;
const [ selectedRowKeys, setSelectedRowKeys ] = useState([]);
const [ selectedRowKeys, setSelectedRowKeys ] = useState([]);
const [ expandedSelectedRowKeys, setExpandedSelectedRowKeys ] = useState([]);
const [ expandedSelectedRowKeys, setExpandedSelectedRowKeys ] = useState([]);
...
@@ -145,6 +145,7 @@ const ModelTable = (props) => {
...
@@ -145,6 +145,7 @@ const ModelTable = (props) => {
const expandedDataMapRef = useRef(new Map());
const expandedDataMapRef = useRef(new Map());
const shouldScrollRef = useRef(false);
const shouldScrollRef = useRef(false);
const mountRef = React.useRef(false);
const anchorId = getQueryParam(AnchorId, props?.location?.search);
const anchorId = getQueryParam(AnchorId, props?.location?.search);
const anchorTimestamp = getQueryParam(AnchorTimestamp, props?.location?.search);
const anchorTimestamp = getQueryParam(AnchorTimestamp, props?.location?.search);
...
@@ -326,6 +327,14 @@ const ModelTable = (props) => {
...
@@ -326,6 +327,14 @@ const ModelTable = (props) => {
}, [data])
}, [data])
useEffect(() => {
useEffect(() => {
if (!mountRef.current) {
mountRef.current = true;
} else {
getResourceTag();
}
}, [batchAddTagChange])
useEffect(() => {
window?.addEventListener("storage", modelEventChange);
window?.addEventListener("storage", modelEventChange);
return () => {
return () => {
window?.removeEventListener("storage", modelEventChange);
window?.removeEventListener("storage", modelEventChange);
...
...
src/view/Manage/Model/Component/select-search-properties.jsx
View file @
77a7811d
...
@@ -3,7 +3,6 @@ import { Modal, Button, Select, Space, Input, Tooltip } from 'antd'
...
@@ -3,7 +3,6 @@ import { Modal, Button, Select, Space, Input, Tooltip } from 'antd'
import
produce
from
'immer'
import
produce
from
'immer'
import
{
dispatch
}
from
'../../../../model'
import
{
dispatch
}
from
'../../../../model'
import
{
draft
}
from
'../../../../service/datamodeler'
import
Table
from
'../../../../util/Component/Table'
import
Table
from
'../../../../util/Component/Table'
import
{
showMessage
}
from
'../../../../util'
import
{
showMessage
}
from
'../../../../util'
...
...
src/view/Manage/Model/Component/tag-help.jsx
View file @
77a7811d
...
@@ -282,7 +282,7 @@ export function TagSelect({ options, onChange }) {
...
@@ -282,7 +282,7 @@ export function TagSelect({ options, onChange }) {
)
)
}
}
export
function
TagSelectPopup
({
visible
,
type
,
value
,
items
,
onCancel
,
onChange
})
{
export
function
TagSelectPopup
({
visible
,
type
,
value
,
items
,
onCancel
,
onChange
,
})
{
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
[
selectedRows
,
setSelectedRows
]
=
React
.
useState
([])
const
[
selectedRows
,
setSelectedRows
]
=
React
.
useState
([])
const
[
showDataQuality
,
setShowDataQuality
]
=
React
.
useState
(
false
)
const
[
showDataQuality
,
setShowDataQuality
]
=
React
.
useState
(
false
)
...
@@ -320,7 +320,7 @@ export function TagSelectPopup({ visible, type, value, items, onCancel, onChange
...
@@ -320,7 +320,7 @@ export function TagSelectPopup({ visible, type, value, items, onCancel, onChange
type
,
type
,
catalogId
:
(
items
??[]).
length
>
0
?
items
[
0
].
resourceCatalogId
:
''
,
catalogId
:
(
items
??[]).
length
>
0
?
items
[
0
].
resourceCatalogId
:
''
,
creator
:
app
?.
user
?.
userName
,
creator
:
app
?.
user
?.
userName
,
overrideAll
:
tru
e
,
overrideAll
:
(
items
??[]).
length
===
1
?
true
:
fals
e
,
}
}
},
},
callback
:
()
=>
{
callback
:
()
=>
{
...
...
src/view/Manage/Model/index.jsx
View file @
77a7811d
...
@@ -22,7 +22,7 @@ import DebounceInput from './Component/DebounceInput';
...
@@ -22,7 +22,7 @@ import DebounceInput from './Component/DebounceInput';
import
ColSettingModal
from
'./Component/ColSettingModal'
;
import
ColSettingModal
from
'./Component/ColSettingModal'
;
import
PermissionButton
from
'../../../util/Component/PermissionButton'
;
import
PermissionButton
from
'../../../util/Component/PermissionButton'
;
import
SelectSearchProperties
from
'./Component/select-search-properties'
;
import
SelectSearchProperties
from
'./Component/select-search-properties'
;
import
{
TagSelect
}
from
'./Component/tag-help'
;
import
{
TagSelect
,
TagSelectPopup
}
from
'./Component/tag-help'
;
import
'./index.less'
;
import
'./index.less'
;
...
@@ -70,6 +70,11 @@ class Model extends React.Component {
...
@@ -70,6 +70,11 @@ class Model extends React.Component {
selectSearchPropertiesVisible
:
false
,
selectSearchPropertiesVisible
:
false
,
searchProperties
:
[],
searchProperties
:
[],
tagSelectOptions
:
[],
tagSelectOptions
:
[],
tagSelectPopupParams
:
{
visible
:
false
,
items
:
undefined
},
batchAddTagChange
:
false
,
}
}
}
}
...
@@ -598,63 +603,60 @@ class Model extends React.Component {
...
@@ -598,63 +603,60 @@ class Model extends React.Component {
}}
}}
>
>
<Space>
<Space>
<Space>
<PermissionButton
<PermissionButton
defaultPermission={canAdd}
defaultPermission={canAdd}
onClick={() => { this.setState({ importModalVisible: true }); }}
onClick={() => { this.setState({ importModalVisible: true }); }}
>
>
新建
新建
</PermissionButton>
</PermissionButton>
</Space>
<PermissionButton
defaultPermission={canExport}
<Space>
tip={(selectModelerIds||[]).length===0?'请先选择模型':''}
<PermissionButton
onClick={this.onExportOtherBtnClick}
defaultPermission={canExport}
disabled={(selectModelerIds||[]).length===0}
tip={(selectModelerIds||[]).length===0?'请先选择模型':''}
>
onClick={this.onExportOtherBtnClick}
导出
disabled={(selectModelerIds||[]).length===0}
</PermissionButton>
>
导出
<PermissionButton
</PermissionButton>
defaultPermission={canStartFlow}
</Space>
tip={startFlowTip}
onClick={this.startFlow}
<Space>
disabled={disableStartFlow}
<PermissionButton
>
defaultPermission={canStartFlow}
送审
tip={startFlowTip}
</PermissionButton>
onClick={this.startFlow}
disabled={disableStartFlow}
<PermissionButton
>
defaultPermission={canChangeCatalog}
送审
tip={(selectModelerIds||[]).length===0?'请先选择模型':''}
</PermissionButton>
onClick={this.onRecatalogBtnClick}
</Space>
disabled={(selectModelerIds||[]).length===0}
>
<Space>
变更目录
</PermissionButton>
<Tooltip title={canDelete?((selectModelerIds||[]).length===0?'请先选择模型':''):'暂无权限'}>
<PermissionButton
<PermissionButton
defaultPermission={can
ChangeCatalog
}
defaultPermission={can
Delete
}
tip={(selectModelerIds||[]).length===0?'请先选择模型':''}
tip={(selectModelerIds||[]).length===0?'请先选择模型':''}
onClick={this.on
Recatalog
BtnClick}
onClick={this.on
BatchDelete
BtnClick}
disabled={(selectModelerIds||[]).length===0}
disabled={(selectModelerIds||[]).length===0}
>
>
变更目录
删除
</PermissionButton>
</PermissionButton>
</Space>
</Tooltip>
<Space>
<Button onClick={() => {
<Tooltip title={canDelete?((selectModelerIds||[]).length===0?'请先选择模型':''):'暂无权限'}>
this.setState({
<PermissionButton
tagSelectPopupParams: {
defaultPermission={canDelete}
visible: true,
tip={(selectModelerIds||[]).length===0?'请先选择模型':''}
items: (selectModelerIds??[]).map(item => ({ resourceId: item }))
onClick={this.onBatchDeleteBtnClick}
}
disabled={(selectModelerIds||[]).length===0}
})
>
}}>添加标签</Button>
删除
<Button onClick={this.onVisibleColSettingClick}>可见列设置</Button>
</PermissionButton>
</Tooltip>
</Space>
<Space>
<Button onClick={this.onVisibleColSettingClick}>可见列设置</Button>
</Space>
</Space>
</Space>
<Space>
<Space>
...
@@ -684,6 +686,7 @@ class Model extends React.Component {
...
@@ -684,6 +686,7 @@ class Model extends React.Component {
view={currentView}
view={currentView}
data={filterTableData}
data={filterTableData}
tagSelectOptions={this.state.tagSelectOptions}
tagSelectOptions={this.state.tagSelectOptions}
batchAddTagChange={this.state.batchAddTagChange}
modelState={currentModelState}
modelState={currentModelState}
offset={offset}
offset={offset}
keyword={keyword}
keyword={keyword}
...
@@ -762,6 +765,23 @@ class Model extends React.Component {
...
@@ -762,6 +765,23 @@ class Model extends React.Component {
visible={this.state.selectSearchPropertiesVisible}
visible={this.state.selectSearchPropertiesVisible}
onCancel={this.onSearchPropertiesCancel}
onCancel={this.onSearchPropertiesCancel}
/>
/>
<TagSelectPopup
{...this.state.tagSelectPopupParams}
onCancel={() => {
this.setState({
tagSelectPopupParams: {
visible: false,
items: undefined
}
})
}}
onChange={() => {
this.setState({
batchAddTagChange: !this.state.batchAddTagChange
})
}}
/>
</div>
</div>
}
}
</AppContext.Consumer>
</AppContext.Consumer>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment