onInitNewRow düzenlemesi
This commit is contained in:
parent
e295c6819a
commit
4fd5d8edd2
2 changed files with 47 additions and 57 deletions
|
|
@ -302,15 +302,10 @@ const Grid = (props: GridProps) => {
|
||||||
if (rawFilter) {
|
if (rawFilter) {
|
||||||
const parsed = JSON.parse(rawFilter)
|
const parsed = JSON.parse(rawFilter)
|
||||||
const filters = extractSearchParamsFields(parsed)
|
const filters = extractSearchParamsFields(parsed)
|
||||||
|
const fieldMatch = filters.find(([field]) => field === colFormat.fieldName)
|
||||||
const hasFilter = filters.some(([field, op, val]) => field === colFormat.fieldName)
|
|
||||||
|
|
||||||
if (hasFilter) {
|
|
||||||
const fieldMatch = filters.find(([field, op, val]) => field === colFormat.fieldName)
|
|
||||||
|
|
||||||
if (fieldMatch) {
|
if (fieldMatch) {
|
||||||
const [, , val] = fieldMatch
|
const val = fieldMatch[2] //value
|
||||||
|
|
||||||
const dType = colFormat.dataType as DataType
|
const dType = colFormat.dataType as DataType
|
||||||
|
|
||||||
switch (dType) {
|
switch (dType) {
|
||||||
|
|
@ -337,7 +332,6 @@ const Grid = (props: GridProps) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function onRowInserting(e: DataGridTypes.RowInsertingEvent<any, any>) {
|
function onRowInserting(e: DataGridTypes.RowInsertingEvent<any, any>) {
|
||||||
e.data = setFormEditingExtraItemValues(e.data)
|
e.data = setFormEditingExtraItemValues(e.data)
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@ import { getList } from '@/services/form.service'
|
||||||
import { layoutTypes } from '../admin/listForm/edit/types'
|
import { layoutTypes } from '../admin/listForm/edit/types'
|
||||||
import { useListFormCustomDataSource } from './useListFormCustomDataSource'
|
import { useListFormCustomDataSource } from './useListFormCustomDataSource'
|
||||||
import { useListFormColumns } from './useListFormColumns'
|
import { useListFormColumns } from './useListFormColumns'
|
||||||
|
import { DataType } from 'devextreme/common'
|
||||||
|
|
||||||
interface TreeProps {
|
interface TreeProps {
|
||||||
listFormCode: string
|
listFormCode: string
|
||||||
|
|
@ -313,15 +314,11 @@ const Tree = (props: TreeProps) => {
|
||||||
if (rawFilter) {
|
if (rawFilter) {
|
||||||
const parsed = JSON.parse(rawFilter)
|
const parsed = JSON.parse(rawFilter)
|
||||||
const filters = extractSearchParamsFields(parsed)
|
const filters = extractSearchParamsFields(parsed)
|
||||||
|
const fieldMatch = filters.find(([field]) => field === colFormat.fieldName)
|
||||||
const hasFilter = filters.some(([field, op, val]) => field === colFormat.fieldName)
|
|
||||||
|
|
||||||
if (hasFilter) {
|
|
||||||
const fieldMatch = filters.find(([field, op, val]) => field === colFormat.fieldName)
|
|
||||||
|
|
||||||
if (fieldMatch) {
|
if (fieldMatch) {
|
||||||
const [, , val] = fieldMatch
|
const val = fieldMatch[2] //value
|
||||||
const dType = colFormat.dataType as any
|
const dType = colFormat.dataType as DataType
|
||||||
|
|
||||||
switch (dType) {
|
switch (dType) {
|
||||||
case 'date':
|
case 'date':
|
||||||
|
|
@ -347,7 +344,6 @@ const Tree = (props: TreeProps) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function onRowInserting(e: TreeListTypes.RowInsertingEvent) {
|
function onRowInserting(e: TreeListTypes.RowInsertingEvent) {
|
||||||
e.data = setFormEditingExtraItemValues(e.data)
|
e.data = setFormEditingExtraItemValues(e.data)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue