@@ -108,7 +108,7 @@ module.exports = {
108
108
const choice = new Array ( ) ;
109
109
const name = row . childNodes [ 1 ] . firstChild . firstChild . value ;
110
110
const value = row . childNodes [ 2 ] . firstChild . firstChild . value ;
111
- if ( checked ) {
111
+ if ( checked ) {
112
112
if ( name === "" ) return ipcRenderer . send ( 'error' , `Ошибка!` , `Введите имя!` ) ;
113
113
if ( value === "" ) return ipcRenderer . send ( 'error' , `Ошибка!` , `Введите значение!` ) ;
114
114
}
@@ -119,8 +119,8 @@ module.exports = {
119
119
content . push ( `"Choices": { "checked": ${ checked } , "value": [${ choicesArr . join ( ', ' ) } ] }` ) ;
120
120
}
121
121
else {
122
- if ( checked ) {
123
- if ( accordion . value === "" ) return ipcRenderer . send ( 'error' , `Ошибка!` , `Введите число!` ) ;
122
+ if ( checked ) {
123
+ if ( accordion . value === "" ) return ipcRenderer . send ( 'error' , `Ошибка!` , `Введите число!` ) ;
124
124
}
125
125
content . push ( `"${ accordion . id } ": { "checked": ${ checked } , "value": "${ accordion . value } " }` )
126
126
}
@@ -196,7 +196,7 @@ module.exports = {
196
196
const choice = new Array ( ) ;
197
197
const name = row . childNodes [ 1 ] . firstChild . firstChild . value ;
198
198
const value = row . childNodes [ 2 ] . firstChild . firstChild . value ;
199
- if ( checked ) {
199
+ if ( checked ) {
200
200
if ( name === "" ) return ipcRenderer . send ( 'error' , `Ошибка!` , `Введите имя!` ) ;
201
201
if ( value === "" ) return ipcRenderer . send ( 'error' , `Ошибка!` , `Введите значение!` ) ;
202
202
}
@@ -207,8 +207,8 @@ module.exports = {
207
207
content . push ( `"Choices": { "checked": ${ checked } , "value": [${ choicesArr . join ( ', ' ) } ] }` ) ;
208
208
}
209
209
else {
210
- if ( checked ) {
211
- if ( accordion . value === "" ) return ipcRenderer . send ( 'error' , `Ошибка!` , `Введите число!` ) ;
210
+ if ( checked ) {
211
+ if ( accordion . value === "" ) return ipcRenderer . send ( 'error' , `Ошибка!` , `Введите число!` ) ;
212
212
}
213
213
content . push ( `"${ accordion . id } ": { "checked": ${ checked } , "value": "${ accordion . value } " }` )
214
214
}
@@ -270,7 +270,7 @@ module.exports = {
270
270
const choice = new Array ( ) ;
271
271
const name = row . childNodes [ 1 ] . firstChild . firstChild . value ;
272
272
const value = row . childNodes [ 2 ] . firstChild . firstChild . value ;
273
- if ( checked ) {
273
+ if ( checked ) {
274
274
if ( name === "" ) return ipcRenderer . send ( 'error' , `Ошибка!` , `Введите имя!` ) ;
275
275
if ( value === "" ) return ipcRenderer . send ( 'error' , `Ошибка!` , `Введите значение!` ) ;
276
276
}
@@ -292,19 +292,23 @@ module.exports = {
292
292
getUser : ( idx , groupId ) => {
293
293
closeModal ( ) ;
294
294
} ,
295
-
295
+
296
296
setChannelTypes : ( json , content ) => {
297
297
return json . addType ( "ChannelTypes" , `${ JSON . stringify ( content ) } ` ) ;
298
298
} ,
299
-
299
+
300
300
setChoices : ( json , content ) => {
301
- return json . set ( "Choices" , `${ JSON . stringify ( content ) . slice ( 1 , - 1 ) } ` ) ;
301
+ let str = "" ;
302
+ for ( let choice of content ) {
303
+ str += json . addType ( "Choices" , `${ JSON . stringify ( choice ) } ` ) ;
304
+ }
305
+ return str ;
302
306
} ,
303
-
307
+
304
308
setMaxValue : ( json , content ) => {
305
309
return json . set ( "MaxValue" , `${ content } ` ) ;
306
310
} ,
307
-
311
+
308
312
setMinValue : ( json , content ) => {
309
313
return json . set ( "MinValue" , `${ content } ` ) ;
310
314
} ,
0 commit comments