|
@@ -21,6 +21,20 @@ import { useDispatch, useSelector } from 'react-redux'
|
|
|
import { D2_APIgetList } from '@/store/action/D2storSet'
|
|
|
import { RootState } from '@/store'
|
|
|
|
|
|
+// 藏品权限
|
|
|
+const goodsPower1 = [
|
|
|
+ { name: '藏品信息', key: 'goodsPage1' },
|
|
|
+ { name: '库存信息', key: 'goodsPage2' },
|
|
|
+ { name: '藏品附件', key: 'goodsPage3' },
|
|
|
+ { name: '藏品日志', key: 'goodsPage4' }
|
|
|
+]
|
|
|
+const goodsPower2 = [
|
|
|
+ { name: '导出藏品档案', key: 'goodsBtn1' },
|
|
|
+ { name: '档案管理', key: 'goodsBtn2' },
|
|
|
+ { name: '分库管理', key: 'goodsBtn3' },
|
|
|
+ { name: '保管管理', key: 'goodsBtn4' }
|
|
|
+]
|
|
|
+
|
|
|
type Props = {
|
|
|
sId: number
|
|
|
closeFu: () => void
|
|
@@ -29,6 +43,8 @@ type Props = {
|
|
|
}
|
|
|
|
|
|
function Z5edit({ sId, closeFu, addTableFu, editTableFu }: Props) {
|
|
|
+ const [goodsIdArr, setGoodsIdArr] = useState<string[]>([])
|
|
|
+
|
|
|
// 设置表单ref
|
|
|
const FormBoxRef = useRef<FormInstance>(null)
|
|
|
|
|
@@ -46,6 +62,11 @@ function Z5edit({ sId, closeFu, addTableFu, editTableFu }: Props) {
|
|
|
setScopeStorage(data.role.scopeStorage)
|
|
|
if (data.role.scopeStorageIds)
|
|
|
setScopeStorageIds(data.role.scopeStorageIds.split(',').map((v: string) => Number(v)))
|
|
|
+
|
|
|
+ // 后面加的藏品权限
|
|
|
+ if (data.role.scopeGoods) {
|
|
|
+ setGoodsIdArr(data.role.scopeGoods.split(','))
|
|
|
+ }
|
|
|
}
|
|
|
}, [])
|
|
|
|
|
@@ -147,7 +168,8 @@ function Z5edit({ sId, closeFu, addTableFu, editTableFu }: Props) {
|
|
|
scopeGoodsFile,
|
|
|
scopeGoodsFileDownload,
|
|
|
scopeStorage,
|
|
|
- scopeStorageIds: scopeStorageIds.join(',')
|
|
|
+ scopeStorageIds: scopeStorageIds.join(','),
|
|
|
+ scopeGoods: goodsIdArr.join(',')
|
|
|
}
|
|
|
|
|
|
const res = await Z5_APIsave(obj)
|
|
@@ -163,6 +185,7 @@ function Z5edit({ sId, closeFu, addTableFu, editTableFu }: Props) {
|
|
|
checkIds,
|
|
|
closeFu,
|
|
|
editTableFu,
|
|
|
+ goodsIdArr,
|
|
|
sId,
|
|
|
scopeGoodsFile,
|
|
|
scopeGoodsFileDownload,
|
|
@@ -244,6 +267,45 @@ function Z5edit({ sId, closeFu, addTableFu, editTableFu }: Props) {
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div className='Z5ebox'>
|
|
|
+ <div className='Z5eboxll'>藏品权限:</div>
|
|
|
+ <div className='Z5eboxrr Z5eboxrr2'>
|
|
|
+ {goodsPower1.map(v => (
|
|
|
+ <Checkbox
|
|
|
+ key={v.name}
|
|
|
+ checked={goodsIdArr.includes(v.key)}
|
|
|
+ onChange={e => {
|
|
|
+ if (goodsIdArr.includes(v.key))
|
|
|
+ setGoodsIdArr(goodsIdArr.filter(c => c !== v.key))
|
|
|
+ else setGoodsIdArr([...goodsIdArr, v.key])
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {v.name}
|
|
|
+ </Checkbox>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className='Z5ebox'>
|
|
|
+ <div className='Z5eboxll'></div>
|
|
|
+ <div className='Z5eboxrr Z5eboxrr2'>
|
|
|
+ {goodsPower2.map(v => (
|
|
|
+ <Checkbox
|
|
|
+ key={v.name}
|
|
|
+ checked={goodsIdArr.includes(v.key)}
|
|
|
+ onChange={e => {
|
|
|
+ if (goodsIdArr.includes(v.key))
|
|
|
+ setGoodsIdArr(goodsIdArr.filter(c => c !== v.key))
|
|
|
+ else setGoodsIdArr([...goodsIdArr, v.key])
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {v.name}
|
|
|
+ </Checkbox>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <br />
|
|
|
<br />
|
|
|
<Form.Item
|
|
|
className='Z5ebox0'
|