Commit a08812a0 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:属性属性值区块统一模态框样式

parent dd1acdd5
...@@ -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>
} }
......
...@@ -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>
} }
......
...@@ -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} columns={syncColumns}
onCancel={() => setSyncVisible(false)} rowSelection={rowSelection}
okText="确认" fetchTableData={(params: any) => fetchPlatformData(params)}
cancelText="取消" formilyProps={
width={704} {
destroyOnClose={true}
confirmLoading={syncLoading}
>
<StandardTable
columns={syncColumns}
currentRef={syncRef}
tableProps={{
rowKey: 'id'
}}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchPlatformData(params)}
formilyLayouts={{
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'
},
}
} }
} }
}} }
/> }
</Modal> resetModal={{
destroyOnClose: true,
confirmLoading: syncLoading,
}}
tableProps={{
rowKey: 'id',
}}
/>
</PageHeaderWrapper> </PageHeaderWrapper>
} }
......
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