File tree Expand file tree Collapse file tree 4 files changed +13
-9
lines changed Expand file tree Collapse file tree 4 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ export default {
9393 itemData () {
9494 const result = {}
9595 for (const field of this .fields ) {
96- result[field .column ] = field .value ? field .value : null
96+ result[field .column ] = field .value !== undefined ? field .value : null
9797 }
9898 return result
9999 },
Original file line number Diff line number Diff line change @@ -144,9 +144,11 @@ export default {
144144 items () {
145145 const statusObject = this .itemElements .itemObject
146146 const { columns } = this .itemElements
147+ const connectionKeyName = this .itemElements .connectionKeyName || ' id'
148+ const dictionaryKeyName = this .itemElements .dictionaryKeyName || ' id'
147149 const items = this .itemElements .data .map ((item ) => {
148150 const rItem = {}
149- rItem .id = item . id
151+ rItem .id = item[dictionaryKeyName]
150152 for (const column of columns) {
151153 const prop = column .obj .split (' .' ).reduce ((object , property ) => object[property] || ' ' , item)
152154 rItem[column .name ] = prop
@@ -155,7 +157,7 @@ export default {
155157 if (item[statusObject].length > 0 ) {
156158 rItem .added = ' <span hidden>1</span>Tak'
157159 rItem .filterStatus = 1
158- rItem .connectionId = item[statusObject][0 ]. id
160+ rItem .connectionId = item[statusObject][0 ][connectionKeyName]
159161 } else {
160162 rItem .added = ' <span hidden>0</span>Nie'
161163 rItem .filterStatus = 0
Original file line number Diff line number Diff line change @@ -72,21 +72,21 @@ export default {
7272 this . createChildDialog ( this . childItemName )
7373 } ,
7474 suspend ( id ) {
75+ let obj = { }
76+ obj [ this . activeColumnName ] = 0
7577 this . updateChild ( [
7678 id ,
77- {
78- active : 0
79- } ,
79+ obj ,
8080 this . $t ( 'global.alerts.suspended' ) ,
8181 this . path
8282 ] )
8383 } ,
8484 restore ( id ) {
85+ let obj = { }
86+ obj [ this . activeColumnName ] = 1
8587 this . updateChild ( [
8688 id ,
87- {
88- active : 1
89- } ,
89+ obj ,
9090 this . $t ( 'global.alerts.restored' ) ,
9191 this . path
9292 ] )
Original file line number Diff line number Diff line change @@ -92,6 +92,8 @@ const mutations = {
9292 state . itemElements . itemObject = obj . itemObject
9393 state . itemElements . primaryId = obj . primaryId
9494 state . itemElements . foreignId = obj . foreignId
95+ state . itemElements . connectionKeyName = obj . connectionKeyName
96+ state . itemElements . dictionaryKeyName = obj . dictionaryKeyName
9597 state . itemElements . show = true
9698 } ,
9799 openImageContainer ( state , item ) {
You can’t perform that action at this time.
0 commit comments