forked from Simnation/Main
ed
This commit is contained in:
parent
48a36209b5
commit
884f3df7cf
262 changed files with 223207 additions and 2 deletions
|
@ -0,0 +1,68 @@
|
|||
class InvestigationEntry{
|
||||
constructor(){
|
||||
this.name = "investigationentry";
|
||||
}
|
||||
|
||||
static GetCustomDestination(data, dest){
|
||||
return data.investigation_id > 0 ? "investigation.view" : dest;
|
||||
}
|
||||
static GetCustomDestID(data, destID){
|
||||
return data.investigation_id ?? destID;
|
||||
}
|
||||
|
||||
static TableDataCreate(row, key){
|
||||
if(key == "is_important_entry"){
|
||||
if(row[key]){
|
||||
return `
|
||||
<td class="font-bold">
|
||||
<i class="fa-solid fa-check"></i>
|
||||
</td>`
|
||||
;
|
||||
}
|
||||
else{
|
||||
return "<td></td>"
|
||||
}
|
||||
}
|
||||
else if(key == "creator"){
|
||||
return `<td>${System.buildEmployeeName(row[key])}</td>`;
|
||||
}
|
||||
else{
|
||||
if(row[key].includes(" ")){
|
||||
//todo everywhere
|
||||
return `<td class="whitespace-normal break-normal">${row[key].replace(/\n/g,"<br>")}</td>`;
|
||||
}
|
||||
else{
|
||||
return `<td class="whitespace-normal break-all">${row[key].replace(/\n/g,"<br>")}</td>`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static GetColumns(){
|
||||
return ["creator","content","is_important_entry"]
|
||||
}
|
||||
static GetEdit(data={}){
|
||||
return {
|
||||
"investigation_id": {
|
||||
"val" : data.investigation_id ?? "-1"
|
||||
,"type" : "hidden"
|
||||
,"isRow": true
|
||||
,"mandatory":true
|
||||
},
|
||||
"content": {
|
||||
"val" : data.content ?? ""
|
||||
,"type" : "textarea"
|
||||
,"isRow": true
|
||||
,"mandatory":true
|
||||
,autogrow: true
|
||||
,rows:3
|
||||
}
|
||||
,"is_important_entry": {
|
||||
"val" : data.is_important_entry ?? ""
|
||||
,"type" : "dropdown"
|
||||
,"isRow": true
|
||||
,"mandatory":true
|
||||
,"options":System.GetBooleanOptions()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue