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

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

parent dd1acdd5
......@@ -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>
</PageHeaderWrapper>
}
......
......@@ -16,6 +16,12 @@ import TabTree from '@/components/TabTree';
import { createFormActions } from '@formily/antd';
import { useTreeTabs } from '@/hooks/useTreeTabs';
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()
......@@ -322,7 +328,55 @@ const CategoryAttributes: React.FC<{}> = () => {
/></div>)
}
</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="关联属性"
visible={roleVisible}
onOk={handleSelectOk}
......@@ -357,7 +411,8 @@ const CategoryAttributes: React.FC<{}> = () => {
}
}}
/>
</Modal>
</Modal> */}
</Row>
</PageHeaderWrapper>
}
......
......@@ -14,6 +14,12 @@ import { ColumnType } from 'antd/lib/table/interface';
import { PublicApi } from '@/services/api';
import { useTreeTabs } from '@/hooks/useTreeTabs';
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()
......@@ -23,9 +29,61 @@ const fetchAttributeTreeData = async (params?) => {
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 ref = useRef<any>({})
const syncRef = useRef<any>({})
const [selectKey, setSelectKey] = useState(undefined)
const [selectNode, setSelectNode] = useState<any>()
const [customExpandkeys, setCustomExpandkeys] = useState<any>()
......@@ -240,7 +298,10 @@ const PropertyValue: React.FC<{}> = () => {
// @ts-ignore
PublicApi.postProductCustomerSyncAttributeValue({idList: selectedRowKeys}).then(res => {
if(res.code === 1000) {
ref?.current?.reload()
if(ref?.current?.reload) {
ref.current.reload()
}
resetMenu()
setSelectedRowKeys([])
}
setSyncVisible(false)
......@@ -252,7 +313,6 @@ const PropertyValue: React.FC<{}> = () => {
}
}
return <PageHeaderWrapper>
<Row gutter={[24, 36]}>
<Col span={8}>
......@@ -333,58 +393,41 @@ const PropertyValue: React.FC<{}> = () => {
</Card>
</Col>
</Row>
<Modal
title="同步平台属性"
<ModalTable
modalTitle='同步平台属性'
confirm={handleAsyncOk}
cancel={() => setSyncVisible(false)}
visible={syncVisible}
onOk={handleAsyncOk}
onCancel={() => setSyncVisible(false)}
okText="确认"
cancelText="取消"
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={{
columns={syncColumns}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchPlatformData(params)}
formilyProps={
{
ctx: {
schema: {
type: 'object',
properties: {
attributeGroupName: {
type: 'string',
'x-component-props': {
placeholder: '属性组名称'
}
},
attributeName: {
type: 'string',
'x-component-props': {
placeholder: '属性名称'
},
},
attributeValue: {
type: 'string',
'x-component-props': {
placeholder: '属性值名称'
},
'x-component': 'Search'
},
}
schema: syncSchema,
components: { ModalSearch: Search, Submit } ,
effects: ($, actions) => {
actions.reset()
useStateFilterSearchLinkageEffect(
$,
actions,
'attributeGroupName',
FORM_FILTER_PATH,
);
}
}
}}
/>
</Modal>
}
}
resetModal={{
destroyOnClose: true,
confirmLoading: syncLoading,
}}
tableProps={{
rowKey: 'id',
}}
/>
</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