Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
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
shenshaokai
jinfa-platform
Commits
a08812a0
Commit
a08812a0
authored
Jan 11, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:属性属性值区块统一模态框样式
parent
dd1acdd5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
144 additions
and
127 deletions
+144
-127
addAttribute.tsx
src/pages/classAndProperty/attribute/addAttribute.tsx
+0
-81
index.tsx
src/pages/classAndProperty/categoryAttributes/index.tsx
+57
-2
index.tsx
src/pages/classAndProperty/propertyValue/index.tsx
+87
-44
No files found.
src/pages/classAndProperty/attribute/addAttribute.tsx
View file @
a08812a0
...
@@ -457,87 +457,6 @@ const AddAtttribute: React.FC<{}> = () => {
...
@@ -457,87 +457,6 @@ const AddAtttribute: React.FC<{}> = () => {
}
}
}
}
/>
/>
{
/* <Modal
title="关联平台属性"
visible={roleVisible}
onOk={handleSelectOk}
onCancel={() => setRoleVisible(false)}
okText="确认"
cancelText="取消"
width={704}
destroyOnClose={true}
>
<StandardTable
columns={columns}
currentRef={ref}
tableProps={{
rowKey: 'id'
}}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'groupName',
FORM_FILTER_PATH,
)
}}
components={{
ModalSearch: Search,
Submit
}}
schema={{
type: 'object',
properties: {
groupName: {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '属性组名称',
align: 'flex-left',
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
justifyContent: "left",
},
colStyle: {
marginRight: 20,
},
},
properties: {
name: {
type: 'string',
'x-component-props': {
placeholder: '属性名称'
},
},
submit: {
"x-component": 'Submit',
"x-mega-props": {
span: 1
},
"x-component-props": {
children: '查询'
}
}
}
}
}
}}
onSubmit={values => ref.current.reload(values)}
/>
}
/>
</Modal> */
}
</
Card
>
</
Card
>
</
PageHeaderWrapper
>
</
PageHeaderWrapper
>
}
}
...
...
src/pages/classAndProperty/categoryAttributes/index.tsx
View file @
a08812a0
...
@@ -16,6 +16,12 @@ import TabTree from '@/components/TabTree';
...
@@ -16,6 +16,12 @@ import TabTree from '@/components/TabTree';
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
useTreeTabs
}
from
'@/hooks/useTreeTabs'
;
import
{
useTreeTabs
}
from
'@/hooks/useTreeTabs'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
;
import
ModalTable
from
'@/components/ModalTable'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
Search
from
'@/components/NiceForm/components/Search'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
{
ISchema
}
from
'@formily/antd'
;
const
formActions
=
createFormActions
()
const
formActions
=
createFormActions
()
...
@@ -322,7 +328,55 @@ const CategoryAttributes: React.FC<{}> = () => {
...
@@ -322,7 +328,55 @@ const CategoryAttributes: React.FC<{}> = () => {
/></
div
>)
/></
div
>)
}
}
</
Col
>
</
Col
>
<
Modal
<
ModalTable
modalTitle=
'关联属性'
confirm=
{
handleSelectOk
}
cancel=
{
handleSelectCancel
}
visible=
{
roleVisible
}
columns=
{
columnsLink
}
rowSelection=
{
rowSelection
}
fetchTableData=
{
(
params
:
any
)
=>
fetchAttributeData
(
params
)
}
formilyProps=
{
{
ctx
:
{
schema
:
{
type
:
'object'
,
properties
:
{
name
:
{
type
:
'string'
,
'x-component'
:
'ModalSearch'
,
'x-component-props'
:
{
placeholder
:
'属性名称'
,
align
:
'flex-left'
,
advanced
:
false
,
},
},
}
},
components
:
{
ModalSearch
:
Search
,
Submit
}
,
effects
:
(
$
,
actions
)
=>
{
actions
.
reset
()
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'attributeGroupName'
,
FORM_FILTER_PATH
,
);
}
}
}
}
resetModal=
{
{
destroyOnClose
:
true
,
// confirmLoading: syncLoading,
}
}
tableProps=
{
{
rowKey
:
'id'
,
}
}
/>
{
/* <Modal
title="关联属性"
title="关联属性"
visible={roleVisible}
visible={roleVisible}
onOk={handleSelectOk}
onOk={handleSelectOk}
...
@@ -357,7 +411,8 @@ const CategoryAttributes: React.FC<{}> = () => {
...
@@ -357,7 +411,8 @@ const CategoryAttributes: React.FC<{}> = () => {
}
}
}}
}}
/>
/>
</
Modal
>
</Modal> */
}
</
Row
>
</
Row
>
</
PageHeaderWrapper
>
</
PageHeaderWrapper
>
}
}
...
...
src/pages/classAndProperty/propertyValue/index.tsx
View file @
a08812a0
...
@@ -14,6 +14,12 @@ import { ColumnType } from 'antd/lib/table/interface';
...
@@ -14,6 +14,12 @@ import { ColumnType } from 'antd/lib/table/interface';
import
{
PublicApi
}
from
'@/services/api'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
useTreeTabs
}
from
'@/hooks/useTreeTabs'
;
import
{
useTreeTabs
}
from
'@/hooks/useTreeTabs'
;
import
TabTree
,
{
createTreeActions
}
from
'@/components/TabTree'
;
import
TabTree
,
{
createTreeActions
}
from
'@/components/TabTree'
;
import
ModalTable
from
'@/components/ModalTable'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
Search
from
'@/components/NiceForm/components/Search'
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
import
Submit
from
'@/components/NiceForm/components/Submit'
import
{
ISchema
}
from
'@formily/antd'
;
const
treeActions
=
createTreeActions
()
const
treeActions
=
createTreeActions
()
...
@@ -23,9 +29,61 @@ const fetchAttributeTreeData = async (params?) => {
...
@@ -23,9 +29,61 @@ const fetchAttributeTreeData = async (params?) => {
return
res
return
res
}
}
const
syncSchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
attributeGroupName
:
{
type
:
'string'
,
'x-component'
:
'ModalSearch'
,
'x-component-props'
:
{
placeholder
:
'属性组名称'
,
align
:
'flex-left'
,
},
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
'x-component'
:
'flex-layout'
,
'x-component-props'
:
{
rowStyle
:
{
flexWrap
:
'nowrap'
,
style
:
{
marginRight
:
0
}
},
colStyle
:
{
marginTop
:
20
,
},
},
properties
:
{
attributeName
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'属性名称'
},
},
attributeValue
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'属性值名称'
},
'x-component'
:
'Search'
},
submit
:
{
"x-component"
:
'Submit'
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
'查询'
}
}
}
}
}
}
const
PropertyValue
:
React
.
FC
<
{}
>
=
()
=>
{
const
PropertyValue
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
<
any
>
({})
const
ref
=
useRef
<
any
>
({})
const
syncRef
=
useRef
<
any
>
({})
const
[
selectKey
,
setSelectKey
]
=
useState
(
undefined
)
const
[
selectKey
,
setSelectKey
]
=
useState
(
undefined
)
const
[
selectNode
,
setSelectNode
]
=
useState
<
any
>
()
const
[
selectNode
,
setSelectNode
]
=
useState
<
any
>
()
const
[
customExpandkeys
,
setCustomExpandkeys
]
=
useState
<
any
>
()
const
[
customExpandkeys
,
setCustomExpandkeys
]
=
useState
<
any
>
()
...
@@ -240,7 +298,10 @@ const PropertyValue: React.FC<{}> = () => {
...
@@ -240,7 +298,10 @@ const PropertyValue: React.FC<{}> = () => {
// @ts-ignore
// @ts-ignore
PublicApi
.
postProductCustomerSyncAttributeValue
({
idList
:
selectedRowKeys
}).
then
(
res
=>
{
PublicApi
.
postProductCustomerSyncAttributeValue
({
idList
:
selectedRowKeys
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
ref
?.
current
?.
reload
()
if
(
ref
?.
current
?.
reload
)
{
ref
.
current
.
reload
()
}
resetMenu
()
setSelectedRowKeys
([])
setSelectedRowKeys
([])
}
}
setSyncVisible
(
false
)
setSyncVisible
(
false
)
...
@@ -252,7 +313,6 @@ const PropertyValue: React.FC<{}> = () => {
...
@@ -252,7 +313,6 @@ const PropertyValue: React.FC<{}> = () => {
}
}
}
}
return
<
PageHeaderWrapper
>
return
<
PageHeaderWrapper
>
<
Row
gutter=
{
[
24
,
36
]
}
>
<
Row
gutter=
{
[
24
,
36
]
}
>
<
Col
span=
{
8
}
>
<
Col
span=
{
8
}
>
...
@@ -333,58 +393,41 @@ const PropertyValue: React.FC<{}> = () => {
...
@@ -333,58 +393,41 @@ const PropertyValue: React.FC<{}> = () => {
</
Card
>
</
Card
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
<
Modal
title=
"同步平台属性"
<
ModalTable
modalTitle=
'同步平台属性'
confirm=
{
handleAsyncOk
}
cancel=
{
()
=>
setSyncVisible
(
false
)
}
visible=
{
syncVisible
}
visible=
{
syncVisible
}
onOk=
{
handleAsyncOk
}
onCancel=
{
()
=>
setSyncVisible
(
false
)
}
okText=
"确认"
cancelText=
"取消"
width=
{
704
}
destroyOnClose=
{
true
}
confirmLoading=
{
syncLoading
}
>
<
StandardTable
columns=
{
syncColumns
}
columns=
{
syncColumns
}
currentRef=
{
syncRef
}
tableProps=
{
{
rowKey
:
'id'
}
}
rowSelection=
{
rowSelection
}
rowSelection=
{
rowSelection
}
fetchTableData=
{
(
params
:
any
)
=>
fetchPlatformData
(
params
)
}
fetchTableData=
{
(
params
:
any
)
=>
fetchPlatformData
(
params
)
}
formilyLayouts=
{
{
formilyProps=
{
justify
:
'space-between'
{
}
}
formilyProps=
{
{
ctx
:
{
ctx
:
{
schema
:
{
schema
:
syncSchema
,
type
:
'object'
,
components
:
{
ModalSearch
:
Search
,
Submit
}
,
properties
:
{
effects
:
(
$
,
actions
)
=>
{
attributeGroupName
:
{
actions
.
reset
()
type
:
'string'
,
useStateFilterSearchLinkageEffect
(
'x-component-props'
:
{
$
,
placeholder
:
'属性组名称'
actions
,
'attributeGroupName'
,
FORM_FILTER_PATH
,
);
}
}
},
attributeName
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'属性名称'
},
},
attributeValue
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'属性值名称'
},
'x-component'
:
'Search'
},
}
}
}
}
}
}
resetModal=
{
{
destroyOnClose
:
true
,
confirmLoading
:
syncLoading
,
}
}
tableProps=
{
{
rowKey
:
'id'
,
}
}
}
}
/>
/>
</
Modal
>
</
PageHeaderWrapper
>
</
PageHeaderWrapper
>
}
}
...
...
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