Commit bd781fe4 authored by 前端-李俊鑫's avatar 前端-李俊鑫

fix: 规则引擎选择物料筛选条件及分页样式调整

parent 793977c8
......@@ -520,3 +520,56 @@ a {
width: 100%;
}
}
// 定制化迷你分页样式
.use-ant-pagination-mini {
.mini {
color: #909399;
.ant-pagination-total-text {
font-size: 12px;
color: #909399;
}
.ant-pagination-prev,
.ant-pagination-next {
border-radius: 4px;
background-color: #F5F6F7;
margin-right: 6px !important;
.ant-pagination-item-link {
color: rgba(0, 0, 0, 0.6)
}
}
.ant-pagination-item {
font-size: 12px;
background-color: #F5F6F7 !important;
margin-right: 8px !important;
> a {
color: #5C626A !important;
}
}
.ant-pagination-item-active {
color: @primary-color !important;
background-color: #EBF9F6 !important;
> a {
color: @primary-color !important;
}
}
.ant-pagination-options {
margin-left: 0;
.ant-select {
.ant-select-selector {
background-color: #F5F6F7 !important;
.ant-select-selection-item {
font-size: 12px;
color: #909399;
}
}
}
.ant-pagination-options-quick-jumper {
> input {
background-color: #F5F6F7 !important;
}
}
}
}
}
@primary-color: #00B37A;
@primary-color: #00A98F;
// 公共padding变量
@padding-lg: 24px;
......@@ -11,4 +11,4 @@
@margin-md: 16px;
@margin-sm: 12px;
@margin-xs: 8px;
@margin-xss: 4px;
\ No newline at end of file
@margin-xss: 4px;
......@@ -32,6 +32,7 @@ const MaterialDrawer = (props: PropsType, ref) => {
const [selectedRowKeys, setSelectedRowKeys] = useState<any>([])
const [selectedRows, setSelectedRows] = useState<any>([])
const [isQueryAll, setIsQueryAll] = useState<boolean>(false)
const [tabKey, setTabKey] = useState<string>('1')
const tableRef = useRef<any>({})
const drawRef = useRef<HandleType>()
......@@ -56,15 +57,16 @@ const MaterialDrawer = (props: PropsType, ref) => {
onOk?.(selectedRows.map(item => ({ id: item.id, value: item.value })) , selectedRowKeys)
}, [selectedRows, selectedRowKeys, isQueryAll])
const handleShow = useCallback((params: Object) => {
}, [])
const fetchData = (params: any) => {
const materialGroupId = params?.materialGroupId?.length ? params?.materialGroupId[params?.materialGroupId?.length - 1] : ''
const customerCategoryId = params?.customerCategoryId?.length ? params?.customerCategoryId[params?.customerCategoryId?.length - 1] : ''
materialGroupId && (params.materialGroupId = materialGroupId)
customerCategoryId && (params.customerCategoryId = customerCategoryId)
return new Promise((resolve) => {
getProductGoodsGetDoesNotFreezeGoodsList(params).then(({ code, data }) => {
if (code === 1000) {
resolve({
total: data.total,
totalCount: data.totalCount,
data: data.data?.map(item => ({ ...item, value: getRealCodeValue(item) }))
})
}
......@@ -125,6 +127,7 @@ const MaterialDrawer = (props: PropsType, ref) => {
const selectKeys = data?.selectData?.map(item => item.id) || []
setSelectedRowKeys(selectKeys)
setIsQueryAll(data?.isQueryAll || false)
setTabKey(data?.isSeeMore ? '2' : '1')
}
},
setRows(rows: any[]) {
......@@ -156,7 +159,6 @@ const MaterialDrawer = (props: PropsType, ref) => {
width={1000}
destroyOnClose
onOk={handleOk}
onShow={handleShow}
onCancel={(fnClose) => {
if (isValuesChangeRef.current) {
Modal.confirm({
......@@ -179,8 +181,8 @@ const MaterialDrawer = (props: PropsType, ref) => {
所有物料
</Checkbox>
</div>
<Tabs defaultActiveKey='1' onChange={() => {}}>
<Tabs.TabPane tab='可选择' key='1'>
<Tabs activeKey={tabKey} onChange={(key: string) => { setTabKey(key) }}>
<Tabs.TabPane tab='可选择' key='1' className='use-ant-pagination-mini'>
{
!isQueryAll && (
<StandardTable
......@@ -204,7 +206,7 @@ const MaterialDrawer = (props: PropsType, ref) => {
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'code', FORM_FILTER_PATH);
useAsyncCascader('materialGroupId', fetchTreeData)
useAsyncCascader('categoryId', fetchCategoryData)
useAsyncCascader('customerCategoryId', fetchCategoryData)
useAsyncSelect('brandId', fetchBrand, ["name", "id"])
}}
schema={schema}
......
......@@ -68,7 +68,7 @@ export const schema: ISchema = {
fieldNames: { label: 'title', value: 'id', children: 'children' },
}
},
categoryId: {
customerCategoryId: {
type: 'string',
'x-component': 'Cascader',
'x-component-props': {
......
......@@ -53,7 +53,7 @@ const SelectMaterial = (props: PropsType) => {
return (
<>
<WrapSelect
onIconClick={() => { ref?.current?.show(true, {}, { selectData, isQueryAll }) }}
onIconClick={(isSeeMore) => { ref?.current?.show(true, {}, { selectData, isQueryAll, isSeeMore }) }}
onItemDelete={onItemDelete}
data={selectData}
labelKey='value'
......
......@@ -4,7 +4,7 @@ import styles from './index.less'
import { LinkOutlined, CloseOutlined } from '@ant-design/icons'
interface PropsType {
onIconClick?: () => void
onIconClick?: (isSeeMore?: boolean) => void
onItemClick?: (a: any) => void
onItemDelete?: (a: any) => void
data?: any[]
......@@ -40,8 +40,8 @@ const WrapSelect = (props: PropsType) => {
}
{
data.length > 3 && (
<div className={styles['content-item']} onClick={() => onIconClick?.()}>
更多
<div className={styles['content-item']} onClick={() => onIconClick?.(true)}>
更多({data.length - 3})
</div>
)
}
......
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