This commit is contained in:
2020-07-24 18:19:29 +00:00
parent dfdcf4e0f6
commit c66019e818
2 changed files with 41 additions and 11 deletions

View File

@@ -479,4 +479,3 @@ async function populateSelectionLists(vm) {
);
}
</script>

View File

@@ -10,15 +10,21 @@
<thead>
<tr>
<th class="text-left">{{ $ay.t("TimeStamp") }}</th>
<th class="text-left">{{ $ay.t("ID") }}</th>
<th class="text-left">{{ $ay.t("Status") }}</th>
<th class="text-left">{{ $ay.t("DeliverAfter") }}</th>
<th class="text-left">{{ $ay.t("NotifyEventType") }}</th>
<th class="text-left">{{ $ay.t("AyaType") }}</th>
<th class="text-left">{{ $ay.t("User") }}</th>
</tr>
</thead>
<tbody>
<tr v-for="item in obj" :key="item.id">
<td>{{ item.created }}</td>
<td>{{ item.jobId }}</td>
<td>{{ item.status }}</td>
<td>{{ item.deliverAfter }}</td>
<td>{{ item.eventType }}</td>
<td>{{ item.ayaType }}</td>
<td>{{ item.name }}</td>
<td>{{ item.user }}</td>
</tr>
</tbody>
</template>
@@ -97,24 +103,39 @@ export default {
} else {
if (res.data) {
vm.rawObj = res.data;
/*{"data":[{"id":6,"created":"2020-07-24T17:52:05.777883Z","eventDate":"2020-07-24T17:52:05.777886Z","deliverAfter":"2021-07-24T17:52:05.777886Z",
"userId":1,"eventType":10,"ayaType":2,"name":"Small Frozen Chicken 117-1"}]} */
let ret = [];
for (let i = 0; i < res.data.length; i++) {
let o = res.data[i];
ret.push({
id: i,
id: o.id,
created: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
o.created,
this.timeZoneName,
this.languageName,
this.hour12
),
status: o.statusText,
jobId:
o.jobId == "00000000-0000-0000-0000-000000000000"
? ""
: o.jobId
eventDate: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
o.eventDate,
this.timeZoneName,
this.languageName,
this.hour12
),
deliverAfter: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
o.deliverAfter,
this.timeZoneName,
this.languageName,
this.hour12
),
eventType: window.$gz.enums.get("NotifyEventType", o.eventType),
ayaType: window.$gz.enums.get("core", o.ayaType),
name: o.name,
userId: o.userId
});
}
vm.obj = ret;
} else {
vm.rawObj = [];
@@ -209,6 +230,7 @@ function clickHandler(menuItem) {
//
async function initForm(vm) {
await fetchTranslatedText(vm);
await cacheEnums(vm);
}
//////////////////////////////////////////////////////////
@@ -218,4 +240,13 @@ async function initForm(vm) {
async function fetchTranslatedText(vm) {
await window.$gz.translation.cacheTranslations([]);
}
//////////////////////
//
//
async function cacheEnums(vm) {
//ensure the enum values required are pre-fetched
await window.$gz.enums.fetchEnumList("NotifyEventType");
await window.$gz.enums.fetchEnumList("core");
}
</script>