Commit c09edecb by zhaochengxiang

资产调整

parent 388bf4c0
......@@ -14,6 +14,7 @@ import IndexCode from './IndexCode';
import { CancelSvg, EditSvg, SaveSvg, FullScreenSvg, CancelFullScreenSvg } from './AssetSvg';
import SelectUser from '../../Model/Component/SelectUsers';
import SelectFilter from '../../Model/Component/SelectFilter';
const AssetAction = (props) => {
const { id, dirId, action, terms, onChange, readOnly = false, form, onMetadataChange, onElementsChange } = props;
......@@ -458,23 +459,16 @@ const AssetAction = (props) => {
type='edit'
loading={loadingUsers}
users={users}
disabled={element.manualMaintain==='否'}
/>
}
if (element.name==='业务责任部门' || element.name?.toLowerCase()==='it责任部门') {
return <Select
allowClear
return <SelectFilter
loading={loadingDepartments}
data={departments}
disabled={element.manualMaintain==='否'}
>
{
departments?.map((department, index) => {
return <Select.Option key={index} value={department}>
{department}
</Select.Option>
})
}
</Select>
/>
}
if (element.selectMode==='单选') {
......
......@@ -805,10 +805,14 @@ const AssetTable = (props) => {
}
});
} else if (id === 'authorization') {
if (contextMenuItem?.metadata?.metadataTableId) {
app?.setGlobalState && app?.setGlobalState({
message: 'data-govern-assets-admit',
data: contextMenuItem
})
} else {
showMessage("warn","该资产没有关联元数据信息");
}
}
}
......
import React, { useState, useMemo, useEffect } from "react"
import {Select} from "antd"
import debounce from 'lodash/debounce';
const {Option} = Select
const FC = ({ value, onChange, data, ...restProps }) => {
const [searchValue, setSearchValue] = useState(undefined)
const debounceFetcher = useMemo(() => {
return debounce((value) => {
setSearchValue(value);
}, 800);
}, []);
const filterData = useMemo(() => {
if (searchValue) {
return data?.filter(item => item.includes(searchValue));
}
return data||[];
}, [data, searchValue])
const change = (value) => {
onChange?.(value)
}
return (
<Select
style={{width:'100%'}}
showSearch
value={value}
onChange={change}
allowClear
filterOption={false}
onSearch={debounceFetcher}
{...restProps}
>
{
filterData?.map((item, index)=>{
return(
<Option value={item} key={index}>{item}</Option>
)
})
}
</Select>
)
}
export default FC
\ No newline at end of file
......@@ -43,7 +43,7 @@ const SelectUser:React.FC=(props)=>{
{
filterUsers?.map((item)=>{
return(
<Option vlaue={item.pernr} key={item.pernr}>{`${item.nachn}(${item.pernr})`}</Option>
<Option value={item.pernr} key={item.pernr}>{`${item.nachn}(${item.pernr})`}</Option>
)
})
}
......
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