Commit 62181255 authored by 田翔's avatar 田翔

fix: 参数修改

parent afe236ae
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "4.5.7", "version": "4.5.8",
"description": "4.5.7 台账列表权限问题", "description": "4.5.8 参数修改",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -17,7 +17,7 @@ const SearchGroup = forwardRef((props, ref) => { ...@@ -17,7 +17,7 @@ const SearchGroup = forwardRef((props, ref) => {
getQueryInfo, getQueryInfo,
})) }))
const { accountName, config, state, checkName, btnsClick } = props const { accountName, config, notUse, checkName, btnsClick } = props
const { enableBatchOperation, enableImportExport, enablePrint, enableQuickSearch, enableTimeFilter } = config const { enableBatchOperation, enableImportExport, enablePrint, enableQuickSearch, enableTimeFilter } = config
const [form] = Form.useForm() const [form] = Form.useForm()
const [dateArray, setDateArray] = useState([]) const [dateArray, setDateArray] = useState([])
...@@ -121,6 +121,43 @@ const SearchGroup = forwardRef((props, ref) => { ...@@ -121,6 +121,43 @@ const SearchGroup = forwardRef((props, ref) => {
}; };
}, []) }, [])
const batchMenu = useMemo(() => {
let array = []
if (!notUse?.includes('edit')) {
array.push({
label: (
<Button
style={{ width: '100%', textAlign: 'left' }}
size='middle'
type='text'
onClick={() => btnsClick({ type: '批量修改' })}
icon={<EditOutlined />}
>
批量修改
</Button>
),
key: '批量修改',
})
}
if (!notUse?.includes('del')) {
array.push({
label: (
<Button
style={{ width: '100%', textAlign: 'left' }}
size='middle'
type='text'
onClick={() => btnsClick({ type: '批量删除' })}
icon={<DeleteOutlined />}
>
批量删除
</Button>
),
key: '批量删除',
})
}
return array
}, [enableBatchOperation, notUse])
const uploadProps = { const uploadProps = {
action: `${window.location.origin}${'/PandaWorkFlow/WorkFlow/AccountManage/ImportAccountData'}`, action: `${window.location.origin}${'/PandaWorkFlow/WorkFlow/AccountManage/ImportAccountData'}`,
multiple: false, multiple: false,
...@@ -227,37 +264,6 @@ const SearchGroup = forwardRef((props, ref) => { ...@@ -227,37 +264,6 @@ const SearchGroup = forwardRef((props, ref) => {
} }
] ]
const batchMenu = [
{
label: (
<Button
style={{ width: '100%', textAlign: 'left' }}
size='middle'
type='text'
onClick={() => btnsClick({ type: '批量删除' })}
icon={<DeleteOutlined />}
>
批量删除
</Button>
),
key: '批量删除',
},
{
label: (
<Button
style={{ width: '100%', textAlign: 'left' }}
size='middle'
type='text'
onClick={() => btnsClick({ type: '批量修改' })}
icon={<EditOutlined />}
>
批量修改
</Button>
),
key: '批量修改',
}
]
const onSearch = e => { const onSearch = e => {
setQueryInfo({ ...queryInfo, info: e }); setQueryInfo({ ...queryInfo, info: e });
getQueryInfo(form.getFieldsValue()); getQueryInfo(form.getFieldsValue());
...@@ -353,7 +359,7 @@ const SearchGroup = forwardRef((props, ref) => { ...@@ -353,7 +359,7 @@ const SearchGroup = forwardRef((props, ref) => {
) : null ) : null
} }
{ {
state?.includes('add') ? ( !notUse?.includes('add') ? (
<Button <Button
type="primary" type="primary"
size="middle" size="middle"
......
...@@ -19,7 +19,7 @@ const TablePack = (props, ref) => { ...@@ -19,7 +19,7 @@ const TablePack = (props, ref) => {
fileColumns, fileColumns,
})) }))
const { parent, state, config, fieldList, loading, dataSource, rowSelection, onRow, tableChange, btnsClick } = props const { parent, notUse, config, fieldList, loading, dataSource, rowSelection, onRow, tableChange, btnsClick } = props
const { accountFieids, webShowFieldGroup, formJson } = config const { accountFieids, webShowFieldGroup, formJson } = config
const [fieldResize, setFieldResize] = useState({}) const [fieldResize, setFieldResize] = useState({})
const [filteredInfo, setFilteredInfo] = useState({}) const [filteredInfo, setFilteredInfo] = useState({})
...@@ -244,17 +244,17 @@ const TablePack = (props, ref) => { ...@@ -244,17 +244,17 @@ const TablePack = (props, ref) => {
const btns = useMemo(() => { const btns = useMemo(() => {
let array = [] let array = []
if (state?.includes('read')) { if (!notUse?.includes('read')) {
array.push({ title: '详情', icon: <IconPack.XiangQing />, }) array.push({ title: '详情', icon: <IconPack.XiangQing />, })
} }
if (state?.includes('edit')) { if (!notUse?.includes('edit')) {
array.push({ title: '编辑', icon: <IconPack.BianJi /> }) array.push({ title: '编辑', icon: <IconPack.BianJi /> })
} }
if (state?.includes('delete')) { if (!notUse?.includes('del')) {
array.push({ title: '删除', icon: <IconPack.ShanChu /> }) array.push({ title: '删除', icon: <IconPack.ShanChu /> })
} }
return array return array
}, [state, parent]) }, [notUse, parent])
const checkChange = (values) => { const checkChange = (values) => {
setChecks(values) setChecks(values)
......
...@@ -37,7 +37,7 @@ const Account = (props, ref) => { ...@@ -37,7 +37,7 @@ const Account = (props, ref) => {
} }
)) ))
const { accountName, parentConfig, state } = props const { accountName, parentConfig, notUse } = props
const userID = window?.globalConfig?.userInfo?.OID || 1 const userID = window?.globalConfig?.userInfo?.OID || 1
const initParams = { const initParams = {
user: userID, user: userID,
...@@ -319,13 +319,13 @@ const Account = (props, ref) => { ...@@ -319,13 +319,13 @@ const Account = (props, ref) => {
btnsClick={btnsClick} btnsClick={btnsClick}
accountName={accountName} accountName={accountName}
config={config} config={config}
state={state} notUse={notUse}
/> />
</div> </div>
<div className={styles.bottom}> <div className={styles.bottom}>
<TablePack <TablePack
loading={loading} loading={loading}
state={state} notUse={notUse}
config={config} config={config}
dataSource={dataSource} dataSource={dataSource}
rowSelection={{ rowSelection={{
......
...@@ -312,7 +312,7 @@ const RelationForm = (props) => { ...@@ -312,7 +312,7 @@ const RelationForm = (props) => {
<TablePack <TablePack
parent='关联表单' parent='关联表单'
loading={loading} loading={loading}
state={disabled ? 'read' : 'read, edit, add, delete'} notUse={disabled ? 'edit,add,del' : ''}
config={config} config={config}
dataSource={dataSource} dataSource={dataSource}
btnsClick={btnsClick} btnsClick={btnsClick}
......
...@@ -190,7 +190,7 @@ const AccountSelector = (props) => { ...@@ -190,7 +190,7 @@ const AccountSelector = (props) => {
<div className={styles.top}> <div className={styles.top}>
<SearchGroup <SearchGroup
onChange={search} onChange={search}
state={'read'} notUse={'edit,add,del'}
btnsClick={btnsClick} btnsClick={btnsClick}
config={config} config={config}
/> />
...@@ -199,7 +199,7 @@ const AccountSelector = (props) => { ...@@ -199,7 +199,7 @@ const AccountSelector = (props) => {
<TablePack <TablePack
ref={tablePackRef} ref={tablePackRef}
loading={loading} loading={loading}
state={'read'} notUse={'edit,add,del'}
config={config} config={config}
dataSource={dataSource} dataSource={dataSource}
btnsClick={btnsClick} btnsClick={btnsClick}
......
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