Calculation/Form: disable elements when LoadKP
This commit is contained in:
parent
4f509aefdf
commit
05ed1b6aef
@ -29,17 +29,20 @@ const Validation = observer(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const FinGAP = observer(() => {
|
const FinGAP = observer(() => {
|
||||||
const { $tables } = useStore();
|
const { $tables, $process } = useStore();
|
||||||
const { fingap } = $tables;
|
const { fingap } = $tables;
|
||||||
|
|
||||||
const dataSource = toJS(fingap.risks);
|
const dataSource = toJS(fingap.risks);
|
||||||
const selectedRowKeys = [...toJS(fingap.selectedKeys)];
|
const selectedRowKeys = [...toJS(fingap.selectedKeys)];
|
||||||
|
|
||||||
|
const disabled = $process.has('LoadKP');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Table
|
<Table
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={dataSource}
|
dataSource={dataSource}
|
||||||
rowSelection={{
|
rowSelection={{
|
||||||
|
getCheckboxProps: () => ({ disabled }),
|
||||||
onChange: (_, selectedRows) => {
|
onChange: (_, selectedRows) => {
|
||||||
const selectedKeys = selectedRows.reduce((acc, row) => {
|
const selectedKeys = selectedRows.reduce((acc, row) => {
|
||||||
acc.push(row.key);
|
acc.push(row.key);
|
||||||
|
|||||||
@ -22,10 +22,14 @@ export default class StatusStore {
|
|||||||
public getStatus(elementName: ElementsActions | ElementsValues) {
|
public getStatus(elementName: ElementsActions | ElementsValues) {
|
||||||
const status = this.overrided[elementName] || this.statuses[elementName];
|
const status = this.overrided[elementName] || this.statuses[elementName];
|
||||||
|
|
||||||
if (this.root.$process.has('Unlimited') && status === 'Disabled') {
|
if (this.root.$process.has('Unlimited')) {
|
||||||
return 'Default';
|
return 'Default';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.root.$process.has('LoadKP')) {
|
||||||
|
return 'Disabled';
|
||||||
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -105,6 +105,8 @@ export default class InsuranceTable {
|
|||||||
getStatus: (valueName: Insurance.Values) => {
|
getStatus: (valueName: Insurance.Values) => {
|
||||||
if (this.root.$process.has('Unlimited')) return 'Default';
|
if (this.root.$process.has('Unlimited')) return 'Default';
|
||||||
|
|
||||||
|
if (this.root.$process.has('LoadKP')) return 'Disabled';
|
||||||
|
|
||||||
return this.statuses[key][valueName];
|
return this.statuses[key][valueName];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -74,6 +74,8 @@ export default class PaymentsTable {
|
|||||||
public getStatus(index: number) {
|
public getStatus(index: number) {
|
||||||
if (this.root.$process.has('Unlimited')) return 'Default';
|
if (this.root.$process.has('Unlimited')) return 'Default';
|
||||||
|
|
||||||
|
if (this.root.$process.has('LoadKP')) return 'Disabled';
|
||||||
|
|
||||||
return this.overridedStatus.get() ?? this.statuses[index];
|
return this.overridedStatus.get() ?? this.statuses[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user