@@ -232,6 +232,7 @@ class MQEkNotlar extends MQSayacliOrtak {
232
232
static get table ( ) { return 'meseknotlar' } static get tableAlias ( ) { return 'eknot' } static get sayacSaha ( ) { return 'kaysayac' }
233
233
static get tanimUISinif ( ) { return ModelTanimPart } static get secimSinif ( ) { return MQCogul . secimSinif }
234
234
static get tanimlanabilirmi ( ) { return true } static get silinebilirmi ( ) { return true } static get urlCount ( ) { return 3 }
235
+ static get urlCount ( ) { return 3 }
235
236
static pTanimDuzenle ( e ) {
236
237
super . pTanimDuzenle ( e ) ; const { pTanim} = e ; $ . extend ( pTanim , {
237
238
kayitTarih : new PInstDateNow ( 'kayittarih' ) , kayitZaman : new PInstStr ( { rowAttr : 'kayitzaman' , init : e => timeToString ( now ( ) ) } ) ,
@@ -240,6 +241,10 @@ class MQEkNotlar extends MQSayacliOrtak {
240
241
} ) ;
241
242
for ( let i = 1 ; i <= this . urlCount ; i ++ ) { pTanim [ `url${ i } ` ] = new PInstStr ( `url${ i } ` ) }
242
243
}
244
+ static rootFormBuilderDuzenle_listeEkrani ( e ) {
245
+ super . rootFormBuilderDuzenle_listeEkrani ( e ) ; const rfb = e . rootBuilder ;
246
+ this . fbd_listeEkrani_addButton ( rfb , { id : 'dokumanGoster' , text : 'Döküman Göster' , handler : e => this . dokumanGosterIstendi ( e ) } )
247
+ }
243
248
static rootFormBuilderDuzenle ( e ) {
244
249
super . rootFormBuilderDuzenle ( e ) ; const rfb = e . rootBuilder , tanimForm = e . tanimFormBuilder ;
245
250
let form = tanimForm . addFormWithParent ( ) . yanYana ( 3 ) ;
@@ -251,7 +256,7 @@ class MQEkNotlar extends MQSayacliOrtak {
251
256
form . addModelKullan ( 'hatKod' , 'Hat' ) . setMFSinif ( MQHat ) . comboBox ( ) . setVisibleKosulu ( e => { let value = e . builder . altInst . tip ; value = value ?. char ?? value ; return value == 'HT' ? true : 'jqx-hidden' } ) ;
252
257
form . addModelKullan ( 'tezgahKod' , 'Tezgah' ) . setMFSinif ( MQTezgah ) . comboBox ( ) . setVisibleKosulu ( e => { let value = e . builder . altInst . tip ; value = value ?. char ?? value ; return value == 'TZ' ? true : 'jqx-hidden' } ) ; ;
253
258
form = tanimForm . addFormWithParent ( ) . yanYana ( ) . addStyle ( e => `$elementCSS { margin-top: 10px }` ) ;
254
- form . addTextInput ( 'url1' , 'Doküman URL 1' ) ; form . addTextInput ( 'url2' , 'Doküman URL 2' ) ; form . addTextInput ( 'url3' , ' Doküman URL 3' ) ;
259
+ for ( let i = 1 ; i <= this . urlCount ; i ++ ) { form . addTextInput ( `url ${ i } ` , ` Doküman URL ${ i } ` ) }
255
260
form = tanimForm . addFormWithParent ( ) . yanYana ( ) . addStyle ( e => `$elementCSS { margin-top: 10px }` ) ;
256
261
form . addTextArea ( 'notlar' , 'Notlar' ) . setRows ( 20 )
257
262
}
@@ -275,27 +280,53 @@ class MQEkNotlar extends MQSayacliOrtak {
275
280
wh . ozellik ( sec . tezgahAdi , 'tez.aciklama' )
276
281
} )
277
282
}
283
+ static orjBaslikListesi_argsDuzenle ( e ) { super . orjBaslikListesi_argsDuzenle ( e ) ; const { args} = e ; $ . extend ( args , { rowsHeight : 180 } ) }
278
284
static ekCSSDuzenle ( e ) {
279
285
super . ekCSSDuzenle ( e ) ; const { rec, result} = e , belirtec = e . belirtec ?? e . dataField ?? e . datafield , { tip} = rec ;
280
286
if ( belirtec == 'tipText' ) { result . push ( 'bold' ) ; switch ( tip ) { case 'HT' : result . push ( 'bg-lightgreen' ) ; break ; case 'TZ' : result . push ( 'bg-lightred' ) ; break } }
281
287
}
288
+ static standartGorunumListesiDuzenle ( e ) {
289
+ super . standartGorunumListesiDuzenle ( e ) ; let { liste} = e , _liste = liste . filter ( colDef => ! colDef ?. startsWith ( 'url' ) ) ;
290
+ liste = e . liste = _liste
291
+ }
282
292
static orjBaslikListesiDuzenle ( e ) {
283
- super . orjBaslikListesiDuzenle ( e ) ; const { liste} = e , alias = e . alias ?? this . tableAlias ; liste . push ( ...[
293
+ super . orjBaslikListesiDuzenle ( e ) ; const { liste} = e , alias = e . alias ?? this . tableAlias , { urlCount} = this ;
294
+ liste . push ( ...[
284
295
new GridKolon ( { belirtec : 'tipText' , text : 'Tip' , genislikCh : 8 , sql : HatTezgah . getClause ( `${ alias } .tip` ) } ) ,
285
296
new GridKolon ( { belirtec : 'hatkod' , text : 'Hat' , genislikCh : 8 } ) ,
286
297
new GridKolon ( { belirtec : 'hatadi' , text : 'Hat Adı' , genislikCh : 15 , sql : 'hat.aciklama' } ) ,
287
298
new GridKolon ( { belirtec : 'tezgahkod' , text : 'Tezgah' , genislikCh : 16 } ) ,
288
- new GridKolon ( { belirtec : 'tezgahadi' , text : 'Tezgah Adı' , genislikCh : 30 , sql : 'tez.aciklama' } ) ,
289
- new GridKolon ( { belirtec : 'url1' , text : 'Dokuman URL 1' } ) ,
290
- new GridKolon ( { belirtec : 'url2' , text : 'Dokuman URL 2' } ) ,
291
- new GridKolon ( { belirtec : 'url3' , text : 'Dokuman URL 3' } ) ,
292
- new GridKolon ( { belirtec : 'notlar' , text : 'Ek Notlar' } )
293
- ] )
299
+ new GridKolon ( { belirtec : 'tezgahadi' , text : 'Tezgah Adı' , genislikCh : 30 , sql : 'tez.aciklama' } )
300
+ ] ) ;
301
+ for ( let i = 1 ; i <= urlCount ; i ++ ) { liste . push ( new GridKolon ( { belirtec : `url${ i } ` , text : `Dokuman URL ${ i } ` } ) ) }
302
+ for ( let i = 1 ; i <= urlCount ; i ++ ) {
303
+ liste . push ( new GridKolon ( {
304
+ belirtec : `resim${ i } ` , text : `Dokuman Resim ${ i } ` , genislikCh : 20 , cellsRenderer : ( colDef , rowIndex , belirtec , _value , html , jqxCol , rec ) => {
305
+ let i = asInteger ( belirtec . slice ( 'resim' . length ) ) , value = rec [ `url${ i } ` ] ;
306
+ if ( value ) { html = `<div class="full-wh" style="background-repeat: no-repeat; background-size: contain; background-image: url(${ value } )"*>` }
307
+ return html
308
+ }
309
+ } ) . noSql ( ) )
310
+ }
311
+ liste . push ( new GridKolon ( { belirtec : 'notlar' , text : 'Ek Notlar' , genislikCh : 150 } ) )
294
312
}
295
313
static loadServerData_queryDuzenle ( e ) {
296
314
super . loadServerData_queryDuzenle ( e ) ; const { sent} = e , alias = e . alias ?? this . tableAlias ;
297
315
sent . fromIliski ( 'ismerkezi hat' , `${ alias } .hatkod = hat.kod` ) ;
298
316
sent . fromIliski ( 'tekilmakina tez' , `${ alias } .tezgahkod = tez.kod` ) ;
299
- sent . sahalar . add ( `${ alias } .tip` )
317
+ sent . sahalar . add ( `${ alias } .tip` ) ; for ( let i = 1 ; i <= this . urlCount ; i ++ ) { sent . sahalar . add ( `${ alias } .url${ i } ` ) }
318
+ }
319
+ static orjBaslikListesi_satirTiklandi ( e ) {
320
+ e = e || { } ; const gridPart = e . gridPart ?? e . sender , gridWidget = e ?. event ?. args ?. owner ?? gridPart . gridWidget , belirtec = e . belirtec ?? gridWidget ?. _clickedcolumn ;
321
+ if ( belirtec ?. startsWith ( 'resim' ) ) { this . dokumanGosterIstendi ( e ) }
322
+ }
323
+ static dokumanGosterIstendi ( e ) {
324
+ e = e || { } ; const islemAdi = 'Döküman Göster' ; try {
325
+ const { builder} = e , gridPart = e . gridPart ?? builder ?. rootPart ?? e . sender ?? app . activeWndPart , recs = gridPart . selectedRecs , { urlCount} = this ;
326
+ const urlListe = [ ] ; for ( const rec of recs ) { for ( let i = 1 ; i <= urlCount ; i ++ ) { let value = rec [ `url${ i } ` ] ; if ( value ?. includes ( '://' ) ) { urlListe . push ( value . trim ( ) ) } } }
327
+ if ( ! urlListe . length ) { hConfirm ( 'Gösterilecek Döküman bulunamadı' , islemAdi ) ; return }
328
+ new MESDokumanWindowPart ( { urlListe } ) . run ( )
329
+ }
330
+ catch ( ex ) { hConfirm ( getErrorText ( ex ) , islemAdi ) ; throw ex }
300
331
}
301
332
}
0 commit comments