rename table to insurance

This commit is contained in:
Владислав Чикалкин 2020-09-21 12:05:34 +03:00
parent faf0190c08
commit 246be46626
5 changed files with 45 additions and 16 deletions

View File

@ -23,6 +23,7 @@
"lodash": "^4.17.20",
"mobx": "^5.15.6",
"mobx-react": "^6.3.0",
"mobx-react-lite": "^2.2.2",
"morgan": "^1.10.0",
"mssql": "^6.2.1",
"nodemon": "^2.0.4",

View File

@ -1359,19 +1359,34 @@ export default [
isTable: true,
Component: Table,
props: {
name: 'fruitTable',
name: 'tableInsurance',
features: {
canDeleteRow: true,
},
columns: [
{
name: 'fruit',
title: 'Fruit',
name: 'policyType',
title: 'Тип полиса',
Component: Select,
},
{
name: 'number',
title: 'Number',
name: 'insuranceCompany',
title: 'Страховщик',
Component: Select,
},
{
name: 'insured',
title: 'Страхователь',
Component: Select,
},
{
name: 'cost',
title: 'Стоимость полиса',
Component: InputNumber,
},
{
name: 'insuranceTerm',
title: 'Срок страхования',
Component: InputNumber,
},
],

View File

@ -2,7 +2,7 @@ import { useOptions } from 'client/hooks/useOptions';
import { useStatus, useTableStatus } from 'client/hooks/useStatus';
import { useStoreValue, useTableValue } from 'client/hooks/useValue';
import { useValidation } from 'client/hooks/useValidation';
import { observer, useObserver } from 'mobx-react';
import { observer, useObserver } from 'mobx-react-lite';
import React from 'react';
import { useStores } from 'client/hooks/useStores';
import { useTableOptions } from 'client/hooks/useOptions';

View File

@ -1,20 +1,28 @@
import { IStoreTable } from './../types/tables';
const initialTables: IStoreTable = {
fruitTable: {
tableInsurance: {
values: [
{
fruit: 'apple',
number: '5',
policyType: 'osago',
insuranceCompany: 'РЕСО',
insured: 'МЫ',
cost: 5555,
insuranceTerm: 12,
},
{
fruit: 'orange',
number: '10',
policyType: 'kasko',
insuranceCompany: 'ВСК',
insured: 'ОНИ',
cost: 151515,
insuranceTerm: 36,
},
],
options: {
fruit: [
{ name: 'Apple', value: 'apple' },
{ name: 'Grusha', value: 'grusha' },
policyType: [
{ name: 'ОСАГО', value: 'osago' },
{ name: 'КАСКО', value: 'kasko' },
{ name: 'ДГО', value: 'dgo' },
{ name: 'НС', value: 'nc' },
],
},
},

View File

@ -1,6 +1,11 @@
import { Status } from './statuses';
export type TableNames = 'fruitTable';
export type TableValuesNames = 'fruit' | 'number';
export type TableNames = 'tableInsurance';
export type TableValuesNames =
| 'policyType'
| 'insuranceCompany'
| 'insured'
| 'cost'
| 'insuranceTerm';
export type TableTargets = 'values' | 'options' | 'statuses' | 'filters';
export type TTableValues<T> = {