Commit 62181255 authored by 田翔's avatar 田翔

fix: 参数修改

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