Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
d14a5db9
Commit
d14a5db9
authored
Sep 01, 2020
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push brw
parent
35a850b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
37 deletions
+63
-37
BalanceSheet.js
src/container/BudgetTahunan/BalanceSheet.js
+63
-37
No files found.
src/container/BudgetTahunan/BalanceSheet.js
View file @
d14a5db9
...
@@ -288,7 +288,7 @@ export default class BalanceSheet extends Component {
...
@@ -288,7 +288,7 @@ export default class BalanceSheet extends Component {
}
else
{
}
else
{
data
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
val
)
data
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
val
)
}
}
this
.
forceUpdate
()
//
this.forceUpdate()
// console.log(this.state.dataTable)
// console.log(this.state.dataTable)
// this.setState({
// this.setState({
// data: a,
// data: a,
...
@@ -296,6 +296,32 @@ export default class BalanceSheet extends Component {
...
@@ -296,6 +296,32 @@ export default class BalanceSheet extends Component {
}
}
render
()
{
render
()
{
let
dataTable2
=
this
.
state
.
dataTable
const
handleChange
=
(
value
,
tableMeta
)
=>
{
let
val
=
String
(
value
).
split
(
","
).
join
(
""
)
// let data = this.state.dataTable2
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
dataTable2
[
tableMeta
.
rowIndex
][
2
])
if
(
indexParent
>
0
)
{
// console.log(indexParent)
let
a
=
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
val
)
let
jagain
=
dataTable2
[
indexParent
][
tableMeta
.
columnIndex
]
a
=
dataTable2
[
indexParent
][
tableMeta
.
columnIndex
]
=
jagain
==
undefined
?
(
0
+
Number
(
val
))
:
(
jagain
+
Number
(
val
))
}
else
{
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
val
)
}
}
const
handleValue
=
(
data
)
=>
{
let
total
=
0
dataTable2
.
map
((
item
,
index
)
=>
{
if
(
data
.
rowData
[
1
]
==
item
[
2
])
{
total
=
item
[
data
.
columnIndex
]
==
undefined
?
(
total
+
0
)
:
(
total
+
item
[
data
.
columnIndex
])
}
})
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
dataTable2
[
data
.
rowIndex
][
2
])
let
a
=
dataTable2
[
data
.
rowIndex
][
data
.
columnIndex
]
=
total
// console.log(indexParent);
return
a
}
const
columns
=
[{
const
columns
=
[{
name
:
""
,
name
:
""
,
options
:
{
options
:
{
...
@@ -367,10 +393,10 @@ export default class BalanceSheet extends Component {
...
@@ -367,10 +393,10 @@ export default class BalanceSheet extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
value
=
{
value
}
value
=
{
value
}
on
Change
=
{
event
=>
{
on
Blur
=
{(
event
)
=>
{
//
console.log(event.target
)
//
updateValue(event.target.value
)
updateValue
(
event
.
target
.
value
)
handleChange
(
event
.
target
.
value
,
tableMeta
)
// this.handleChange(event.target.value, tableMeta
)
console
.
log
(
dataTable2
)
}}
}}
/
>
/
>
}
}
...
@@ -384,7 +410,7 @@ export default class BalanceSheet extends Component {
...
@@ -384,7 +410,7 @@ export default class BalanceSheet extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
this
.
handleValue
(
tableMeta
)}
value
=
{
handleValue
(
tableMeta
)}
/
>
/
>
<
/span
>
<
/span
>
:
:
...
@@ -423,10 +449,10 @@ export default class BalanceSheet extends Component {
...
@@ -423,10 +449,10 @@ export default class BalanceSheet extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
value
=
{
value
}
value
=
{
value
}
on
Change
=
{
event
=>
{
on
Blur
=
{(
event
)
=>
{
//
console.log(event.target
)
//
updateValue(event.target.value
)
updateValue
(
event
.
target
.
value
)
handleChange
(
event
.
target
.
value
,
tableMeta
)
this
.
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
}}
}}
/
>
/
>
}
}
...
@@ -440,7 +466,7 @@ export default class BalanceSheet extends Component {
...
@@ -440,7 +466,7 @@ export default class BalanceSheet extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
this
.
handleValue
(
tableMeta
)}
value
=
{
handleValue
(
tableMeta
)}
/
>
/
>
<
/span
>
<
/span
>
:
:
...
@@ -476,10 +502,10 @@ export default class BalanceSheet extends Component {
...
@@ -476,10 +502,10 @@ export default class BalanceSheet extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
value
=
{
value
}
value
=
{
value
}
on
Change
=
{
event
=>
{
on
Blur
=
{(
event
)
=>
{
//
console.log(event.target
)
//
updateValue(event.target.value
)
updateValue
(
event
.
target
.
value
)
handleChange
(
event
.
target
.
value
,
tableMeta
)
this
.
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
}}
}}
/
>
/
>
}
}
...
@@ -493,7 +519,7 @@ export default class BalanceSheet extends Component {
...
@@ -493,7 +519,7 @@ export default class BalanceSheet extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
this
.
handleValue
(
tableMeta
)}
value
=
{
handleValue
(
tableMeta
)}
/
>
/
>
<
/span
>
<
/span
>
:
:
...
@@ -529,10 +555,10 @@ export default class BalanceSheet extends Component {
...
@@ -529,10 +555,10 @@ export default class BalanceSheet extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
value
=
{
value
}
value
=
{
value
}
on
Change
=
{
event
=>
{
on
Blur
=
{(
event
)
=>
{
//
console.log(event.target
)
//
updateValue(event.target.value
)
updateValue
(
event
.
target
.
value
)
handleChange
(
event
.
target
.
value
,
tableMeta
)
this
.
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
}}
}}
/
>
/
>
}
}
...
@@ -546,7 +572,7 @@ export default class BalanceSheet extends Component {
...
@@ -546,7 +572,7 @@ export default class BalanceSheet extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
this
.
handleValue
(
tableMeta
)}
value
=
{
handleValue
(
tableMeta
)}
/
>
/
>
<
/span
>
<
/span
>
:
:
...
@@ -582,10 +608,10 @@ export default class BalanceSheet extends Component {
...
@@ -582,10 +608,10 @@ export default class BalanceSheet extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
value
=
{
value
}
value
=
{
value
}
on
Change
=
{
event
=>
{
on
Blur
=
{(
event
)
=>
{
//
console.log(event.target
)
//
updateValue(event.target.value
)
updateValue
(
event
.
target
.
value
)
handleChange
(
event
.
target
.
value
,
tableMeta
)
this
.
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
}}
}}
/
>
/
>
}
}
...
@@ -599,7 +625,7 @@ export default class BalanceSheet extends Component {
...
@@ -599,7 +625,7 @@ export default class BalanceSheet extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
this
.
handleValue
(
tableMeta
)}
value
=
{
handleValue
(
tableMeta
)}
/
>
/
>
<
/span
>
<
/span
>
:
:
...
@@ -635,10 +661,10 @@ export default class BalanceSheet extends Component {
...
@@ -635,10 +661,10 @@ export default class BalanceSheet extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
value
=
{
value
}
value
=
{
value
}
on
Change
=
{
event
=>
{
on
Blur
=
{(
event
)
=>
{
//
console.log(event.target
)
//
updateValue(event.target.value
)
updateValue
(
event
.
target
.
value
)
handleChange
(
event
.
target
.
value
,
tableMeta
)
this
.
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
}}
}}
/
>
/
>
}
}
...
@@ -652,7 +678,7 @@ export default class BalanceSheet extends Component {
...
@@ -652,7 +678,7 @@ export default class BalanceSheet extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
this
.
handleValue
(
tableMeta
)}
value
=
{
handleValue
(
tableMeta
)}
/
>
/
>
<
/span
>
<
/span
>
:
:
...
@@ -688,10 +714,10 @@ export default class BalanceSheet extends Component {
...
@@ -688,10 +714,10 @@ export default class BalanceSheet extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
value
=
{
value
}
value
=
{
value
}
on
Change
=
{
event
=>
{
on
Blur
=
{(
event
)
=>
{
//
console.log(event.target
)
//
updateValue(event.target.value
)
updateValue
(
event
.
target
.
value
)
handleChange
(
event
.
target
.
value
,
tableMeta
)
this
.
handleChange
(
event
.
target
.
value
,
tableMeta
)
console
.
log
(
dataTable2
)
}}
}}
/
>
/
>
}
}
...
@@ -705,7 +731,7 @@ export default class BalanceSheet extends Component {
...
@@ -705,7 +731,7 @@ export default class BalanceSheet extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
this
.
handleValue
(
tableMeta
)}
value
=
{
handleValue
(
tableMeta
)}
/
>
/
>
<
/span
>
<
/span
>
:
:
...
@@ -789,7 +815,7 @@ export default class BalanceSheet extends Component {
...
@@ -789,7 +815,7 @@ export default class BalanceSheet extends Component {
<
div
style
=
{{
marginTop
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
marginTop
:
20
,
width
:
'100%'
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
<
MUIDataTable
data
=
{
this
.
state
.
dataTable
}
data
=
{
dataTable2
}
columns
=
{
columns
}
columns
=
{
columns
}
options
=
{
options
}
options
=
{
options
}
/
>
/
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment