auswertung finished
This commit is contained in:
parent
0f7fa73734
commit
fe08a2fd2a
BIN
Praktikum3/.DS_Store
vendored
BIN
Praktikum3/.DS_Store
vendored
Binary file not shown.
BIN
Praktikum3/bt/.DS_Store
vendored
BIN
Praktikum3/bt/.DS_Store
vendored
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -261,8 +261,6 @@ class Fehler_cl(object):
|
||||
#-------------------------------------------------------
|
||||
def GET(self, id=None, type=None):
|
||||
#-------------------------------------------------------
|
||||
print(type)
|
||||
print(id)
|
||||
retVal_o = {
|
||||
'data': None
|
||||
}
|
||||
@ -270,7 +268,6 @@ class Fehler_cl(object):
|
||||
# Anforderung der Liste
|
||||
print('true')
|
||||
if type == 'erkannt':
|
||||
print('true')
|
||||
retVal_o['data'] = self.db_o.readErkannt_px()
|
||||
elif type == 'behoben':
|
||||
retVal_o['data'] = self.db_o.readBehoben_px()
|
||||
@ -287,7 +284,6 @@ class Fehler_cl(object):
|
||||
retVal_o['katfehler'] = self.dbKatFehler_o.read_px()
|
||||
retVal_o['katursache'] = self.dbKatUrsache_o.read_px()
|
||||
|
||||
print(retVal_o)
|
||||
return retVal_o
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
@ -3,7 +3,7 @@
|
||||
import json
|
||||
|
||||
import cherrypy
|
||||
#from .database import SourceDatabase_cl, EvaluatedDatabase_cl
|
||||
from .database import FehlerDatabase_cl, ProjektDatabase_cl, KomponenteDatabase_cl, KatfehlerDatabase_cl
|
||||
# Method-Dispatching!
|
||||
|
||||
# Übersicht Anforderungen / Methoden
|
||||
@ -28,12 +28,43 @@ class ProList_cl(object):
|
||||
#-------------------------------------------------------
|
||||
def __init__(self):
|
||||
#-------------------------------------------------------
|
||||
pass
|
||||
self.dbFehler_o = FehlerDatabase_cl()
|
||||
self.dbProjekt_o = ProjektDatabase_cl()
|
||||
self.dbKomponente_o = KomponenteDatabase_cl()
|
||||
|
||||
#-------------------------------------------------------
|
||||
def GET(self):
|
||||
def GET(self, id=None):
|
||||
#-------------------------------------------------------
|
||||
return json.dumps(retVal_o)
|
||||
data_o = {}
|
||||
retVal_o = {}
|
||||
retVal_o['data'] = {}
|
||||
data_o['Fehler'] = self.dbFehler_o.read_px()
|
||||
data_o['Projekt'] = self.dbProjekt_o.read_px()
|
||||
data_o['Komponente'] = self.dbKomponente_o.read_px()
|
||||
|
||||
for projektid in data_o['Projekt']:
|
||||
projekt = data_o['Projekt'][projektid]['name']
|
||||
retVal_o['data'][projekt] = 'None'
|
||||
for komponente in data_o['Komponente']:
|
||||
if retVal_o['data'][projekt] == 'None':
|
||||
retVal_o['data'][projekt] = {}
|
||||
if data_o['Komponente'][komponente]['projektid'] == projektid:
|
||||
for fehler in data_o['Fehler']:
|
||||
retVal_o['data'][projekt][fehler] = 'None'
|
||||
if data_o['Fehler'][fehler]['komponenteid'] == komponente:
|
||||
if retVal_o['data'][projekt][fehler] == 'None':
|
||||
retVal_o['data'][projekt][fehler] = {}
|
||||
retVal_o['data'][projekt][fehler]['fehlername'] = data_o['Fehler'][fehler]['name']
|
||||
retVal_o['data'][projekt][fehler]['projektname'] = data_o['Projekt'][projektid]['name']
|
||||
retVal_o['data'][projekt][fehler]['komponentename'] = data_o['Komponente'][komponente]['name']
|
||||
if data_o['Fehler'][fehler]['status'] != 'geprueft':
|
||||
retVal_o['data'][projekt][fehler]['fehlerstatus'] = 'erkannt'
|
||||
else:
|
||||
retVal_o['data'][projekt][fehler]['fehlerstatus'] = 'beseitigt'
|
||||
return retVal_o
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -49,16 +80,39 @@ class KatList_cl(object):
|
||||
#----------------------------------------------------------
|
||||
|
||||
exposed = True # gilt für alle Methoden
|
||||
|
||||
#-------------------------------------------------------
|
||||
def __init__(self):
|
||||
#-------------------------------------------------------
|
||||
pass
|
||||
self.dbFehler_o = FehlerDatabase_cl()
|
||||
self.dbKatFehler_o = KatfehlerDatabase_cl()
|
||||
|
||||
#-------------------------------------------------------
|
||||
def GET(self):
|
||||
def GET(self, id=None):
|
||||
#-------------------------------------------------------
|
||||
return json.dumps(retVal_o)
|
||||
data_o = {}
|
||||
retVal_o = {}
|
||||
retVal_o['data'] = {}
|
||||
data_o['Fehler'] = self.dbFehler_o.read_px()
|
||||
data_o['Kategorie'] = self.dbKatFehler_o.read_px()
|
||||
|
||||
print(data_o)
|
||||
|
||||
for kategorieid in data_o['Kategorie']:
|
||||
kategorie = data_o['Kategorie'][kategorieid]['name']
|
||||
retVal_o['data'][kategorie] = 'None'
|
||||
for fehler in data_o['Fehler']:
|
||||
if retVal_o['data'][kategorie] == 'None':
|
||||
retVal_o['data'][kategorie] = {}
|
||||
retVal_o['data'][kategorie][fehler] = 'None'
|
||||
if data_o['Fehler'][fehler]['katfehlerid'] == kategorieid:
|
||||
if retVal_o['data'][kategorie][fehler] == 'None':
|
||||
retVal_o['data'][kategorie][fehler] = {}
|
||||
retVal_o['data'][kategorie][fehler]['fehlername'] = data_o['Fehler'][fehler]['name']
|
||||
if data_o['Fehler'][fehler]['status'] != 'geprueft':
|
||||
retVal_o['data'][kategorie][fehler]['fehlerstatus'] = 'erkannt'
|
||||
else:
|
||||
retVal_o['data'][kategorie][fehler]['fehlerstatus'] = 'beseitigt'
|
||||
return retVal_o
|
||||
|
||||
|
||||
# EOF
|
@ -41,7 +41,7 @@ class Navigation_cl(object):
|
||||
{'action': 'katfehler' , 'text': 'Pflege Fehler-Kategorien'},
|
||||
{'action': 'katursache' , 'text': 'Pflege Fehlerursachen-Kategorien'},
|
||||
{'action': 'prolist' , 'text': 'Auswertung Projekte/Fehler'},
|
||||
{'action': 'catlist' , 'text': 'Auswertung Kategorien/Fehler'}
|
||||
{'action': 'katlist' , 'text': 'Auswertung Kategorien/Fehler'}
|
||||
]
|
||||
|
||||
return json.dumps(retVal_o)
|
||||
|
@ -135,6 +135,7 @@ body {
|
||||
border: 1px solid;
|
||||
border-collapse: collapse;
|
||||
margin:auto;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
#idList th {
|
||||
|
@ -45,6 +45,9 @@ APP.Application_cl = class {
|
||||
this.detailFehlerSw_o = new APP.DetailView_cl('fehler', '/fehler/', 'fehlerswdetail.tpl');
|
||||
this.detailFehlerQsp_o = new APP.DetailView_cl('fehler', '/fehler/', 'fehlerqspdetail.tpl');
|
||||
|
||||
this.listPro_o = new APP.ListView_cl('prolist', '/prolist/', 'prolist.tpl');
|
||||
this.listKat_o = new APP.ListView_cl('katlist', '/katlist/', 'katlist.tpl');
|
||||
|
||||
// this.listSources_o = new APP.ListView_cl('source', '/source/', 'sourceslist.tpl');
|
||||
// this.detailSources_o = new APP.SourceDetailView_cl('source', '/source/', 'sourcedetail.tpl');
|
||||
// this.listEvaluated_o = new APP.ListView_cl('evaluated', '/evaluated/', 'evaluatedlist.tpl');
|
||||
@ -154,6 +157,12 @@ APP.Application_cl = class {
|
||||
// Detailformular im Content-Bereich anzeigen
|
||||
self_opl.setContent_p(self_opl.detailFehlerQsp_o, data_apl[1]);
|
||||
break;
|
||||
case 'prolist':
|
||||
self_opl.setContent_p(self_opl.listPro_o, data_apl[1]);
|
||||
break;
|
||||
case 'katlist':
|
||||
self_opl.setContent_p(self_opl.listKat_o, data_apl[1]);
|
||||
break;
|
||||
default:
|
||||
console.warn('[Application_cl] unbekannte app-Notification: '+data_apl[0]);
|
||||
break;
|
||||
|
BIN
Praktikum3/bt/templates/.DS_Store
vendored
BIN
Praktikum3/bt/templates/.DS_Store
vendored
Binary file not shown.
25
Praktikum3/bt/templates/katlist.tpl
Executable file
25
Praktikum3/bt/templates/katlist.tpl
Executable file
@ -0,0 +1,25 @@
|
||||
<!-- Template -->
|
||||
<div id="idListContent" class="clContent">
|
||||
<h2 id="idContentHeader" class="clContentHeader">
|
||||
Auswertung Kategorien
|
||||
</h2>
|
||||
<div id="idContentArea" class="clContentArea">
|
||||
@var rowsKategorie_o = context['data'];@
|
||||
@for var keyKategorie_s in rowsKategorie_o@
|
||||
@var rowsFehler_o = context['data'][keyKategorie_s];@
|
||||
<table id="idList">
|
||||
<caption>#keyKategorie_s#</caption>
|
||||
<tr class="listheader"><th>Name</th><th>Status</th></tr>
|
||||
|
||||
@for var keyFehler_s in rowsFehler_o@
|
||||
@if rowsFehler_o[keyFehler_s] != 'None'@
|
||||
<td>#rowsFehler_o[keyFehler_s]['fehlername']#</td>
|
||||
<td>#rowsFehler_o[keyFehler_s]['fehlerstatus']#</td>
|
||||
@endif@
|
||||
@endfor@
|
||||
</table>
|
||||
@endfor@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- EOF -->
|
26
Praktikum3/bt/templates/prolist.tpl
Executable file
26
Praktikum3/bt/templates/prolist.tpl
Executable file
@ -0,0 +1,26 @@
|
||||
<!-- Template -->
|
||||
<div id="idListContent" class="clContent">
|
||||
<h2 id="idContentHeader" class="clContentHeader">
|
||||
Auswertung Projekte
|
||||
</h2>
|
||||
<div id="idContentArea" class="clContentArea">
|
||||
@var rowsProjekt_o = context['data'];@
|
||||
@for var keyProjekt_s in rowsProjekt_o@
|
||||
@var rowsFehler_o = context['data'][keyProjekt_s];@
|
||||
<table id="idList">
|
||||
<caption>#keyProjekt_s#</caption>
|
||||
<tr class="listheader"><th>Name</th><th>Komponente</th><th>Status</th></tr>
|
||||
|
||||
@for var keyFehler_s in rowsFehler_o@
|
||||
@if rowsFehler_o[keyFehler_s] != 'None'@
|
||||
<td>#rowsFehler_o[keyFehler_s]['fehlername']#</td>
|
||||
<td>#rowsFehler_o[keyFehler_s]['komponentename']#</td>
|
||||
<td>#rowsFehler_o[keyFehler_s]['fehlerstatus']#</td>
|
||||
@endif@
|
||||
@endfor@
|
||||
</table>
|
||||
@endfor@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- EOF -->
|
Loading…
x
Reference in New Issue
Block a user