forked from ddrilling/asb_cloud_front
Убран вызов метода получения списка категорий из дочернего компонента
на странице "Операции".
This commit is contained in:
parent
8d6f5ac1a5
commit
c0b5f82ad2
@ -4,7 +4,7 @@ import { Button, Modal } from 'antd'
|
||||
import { useWell } from '@asb/context'
|
||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||
import { EditableTable, makeGroupColumn, makeNumericColumn, makeNumericRender, makeSelectColumn } from '@components/Table'
|
||||
import { DetectedOperationService, OperationValueService } from '@api'
|
||||
import { OperationValueService } from '@api'
|
||||
import { arrayOrDefault } from '@utils'
|
||||
|
||||
const columnOptions = {
|
||||
@ -14,7 +14,7 @@ const columnOptions = {
|
||||
const scroll = { y: '75vh', scrollToFirstRowOnChange: true }
|
||||
const numericRender = makeNumericRender(2)
|
||||
|
||||
export const TargetEditor = memo(({ loading, onChange }) => {
|
||||
export const TargetEditor = memo(({ loading, onChange, options }) => {
|
||||
const [targets, setTargets] = useState([])
|
||||
const [showModal, setShowModal] = useState(false)
|
||||
const [showLoader, setShowLoader] = useState(false)
|
||||
@ -62,9 +62,6 @@ export const TargetEditor = memo(({ loading, onChange }) => {
|
||||
useEffect(() => {
|
||||
invokeWebApiWrapperAsync(
|
||||
async () => {
|
||||
const categories = arrayOrDefault(await DetectedOperationService.getCategories())
|
||||
const options = categories.map(({ id, name }) => ({ value: id, label: name }))
|
||||
|
||||
setTargetColumns([
|
||||
makeSelectColumn('Название', 'idOperationCategory', options, undefined, { ...columnOptions, width: 200 }, {
|
||||
showSearch: true,
|
||||
|
@ -142,8 +142,8 @@ const Operations = memo(() => {
|
||||
<DrillerList drillers={drillers} loading={drillersLoader} onChange={updateDrillers} />
|
||||
</>
|
||||
)}
|
||||
{permissions.detectedOperation.get && permissions.operationValue.get && (
|
||||
<TargetEditor onChange={updateData} />
|
||||
{permissions.detectedOperation.get && permissions.operationValue.get && categories && (
|
||||
<TargetEditor onChange={updateData} options={categories} />
|
||||
)}
|
||||
</div>
|
||||
<LoaderPortal show={isLoading}>
|
||||
|
Loading…
Reference in New Issue
Block a user