This commit is contained in:
@@ -12,7 +12,7 @@ todo: open ad-hoc type and id from data list idea
|
||||
todo: Administration - History
|
||||
View the history log in full without being for specific items, i.e. data list view
|
||||
|
||||
|
||||
todo: default sort order for default data list views specified? (see eventdatalist for example)
|
||||
|
||||
todo: Administration - Statistics WTF?
|
||||
What is this for? Administration related statistics?
|
||||
|
||||
@@ -83,17 +83,13 @@
|
||||
<!-- TEXT (also maybe openable)-->
|
||||
<template v-if="c.i && c.i != 0">
|
||||
<!-- openable object with an ID -->
|
||||
{{ c }}
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i)"
|
||||
>
|
||||
<a href="javascript:"> {{ c.v }}</a>
|
||||
</div>
|
||||
<!-- <v-btn
|
||||
depressed
|
||||
small
|
||||
@click="gridCellButtonClick(c.key, c.i)"
|
||||
>{{ c.v }}</v-btn> -->
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ c.v }}
|
||||
@@ -126,8 +122,20 @@
|
||||
{{ c.v }}
|
||||
</template>
|
||||
<template v-else-if="c.t == 10">
|
||||
<!-- ENUM (translated to text on getdata) -->
|
||||
{{ c.v }}
|
||||
<!-- ENUM (translated to text on getdata) ALSO MAYBE OPENABLE -->
|
||||
<template v-if="c.i && c.ot">
|
||||
<!-- openable object with an ID -->
|
||||
{{ c }}
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
>
|
||||
<a href="javascript:"> {{ c.v }}</a>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ c.v }}
|
||||
</template>
|
||||
</template>
|
||||
<template v-else-if="c.t == 11">
|
||||
<!-- EMAIL -->
|
||||
@@ -244,12 +252,6 @@
|
||||
>
|
||||
<a href="javascript:"> {{ c.v }}</a>
|
||||
</div>
|
||||
<!-- <span
|
||||
@click="gridCellButtonClick(c.key, c.i)"
|
||||
class="primary--text subtitle-1 font-weight-bold"
|
||||
style="cursor:pointer"
|
||||
>{{ c.v }}
|
||||
</span> -->
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ c.v }}
|
||||
@@ -284,8 +286,20 @@
|
||||
{{ c.v }}
|
||||
</template>
|
||||
<template v-else-if="c.t == 10">
|
||||
<!-- ENUM (translated to text on getdata) -->
|
||||
{{ c.v }}
|
||||
<!-- ENUM (translated to text on getdata) ALSO MAYBE OPENABLE -->
|
||||
<template v-if="c.i && c.ot">
|
||||
<!-- openable object with an ID -->
|
||||
{{ c }}
|
||||
<div
|
||||
class="subtitle-1"
|
||||
@click="gridCellButtonClick(c.key, c.i, c.ot)"
|
||||
>
|
||||
<a href="javascript:"> {{ c.v }}</a>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ c.v }}
|
||||
</template>
|
||||
</template>
|
||||
<template v-else-if="c.t == 11">
|
||||
<!-- EMAIL -->
|
||||
@@ -481,12 +495,17 @@ export default {
|
||||
vm.loading = false;
|
||||
vm.getDataFromApi();
|
||||
},
|
||||
gridCellButtonClick(key, i) {
|
||||
//translate key to actual object type from header data
|
||||
//key format is row-column e.g."500-2"
|
||||
//get the datatype of the column which matches the server columns array index
|
||||
let typeToOpen = this.serverColumns[key.split("-")[1]].ay;
|
||||
|
||||
gridCellButtonClick(key, i, ot) {
|
||||
let typeToOpen = null;
|
||||
//if ot is not null then *that* is the Openable Type otherwise it's in the header data
|
||||
if (ot) {
|
||||
typeToOpen = ot;
|
||||
} else {
|
||||
//translate key to actual object type from header data
|
||||
//key format is row-column e.g."500-2"
|
||||
//get the datatype of the column which matches the server columns array index
|
||||
typeToOpen = this.serverColumns[key.split("-")[1]].ay;
|
||||
}
|
||||
//i is the actual AyaNova index of vm record so we have all we need to open vm object
|
||||
window.$gz.eventBus.$emit("openobject", { type: typeToOpen, id: i });
|
||||
},
|
||||
@@ -619,6 +638,7 @@ function buildRecords(listData, columndefinitions) {
|
||||
|
||||
let dataType = columndefinitions[iColumn].dt;
|
||||
let display = column.v;
|
||||
let openableAyaType = null;
|
||||
/*
|
||||
public enum UiFieldDataType : int
|
||||
{
|
||||
@@ -687,6 +707,21 @@ function buildRecords(listData, columndefinitions) {
|
||||
columndefinitions[iColumn].et,
|
||||
display
|
||||
);
|
||||
//is it an AyaType openable type column like in the EventDataList AyaType column?
|
||||
if (
|
||||
columndefinitions[iColumn].et == "AyaType" &&
|
||||
column.i != null &&
|
||||
column.i != 0
|
||||
) {
|
||||
//yes so provide the ot (openable type) info needed for the grid to make this openable
|
||||
openableAyaType = column.v;
|
||||
}
|
||||
// console.log("gz-data-table:buildRecords:enumtype column is ", column);
|
||||
// //v contains the type number and i contains the id of the record if it's an aytype enum openable
|
||||
// console.log(
|
||||
// "gz-data-table:buildRecords:enumtype column devfinition is ",
|
||||
// columndefinitions[iColumn]
|
||||
// );
|
||||
break;
|
||||
case 14: //MemorySize (file size)
|
||||
display = window.$gz.locale.humanFileSize(
|
||||
@@ -711,6 +746,13 @@ function buildRecords(listData, columndefinitions) {
|
||||
if (column.i) {
|
||||
columnObject["i"] = column.i;
|
||||
}
|
||||
|
||||
//is the source column a special AyaType enum with an id signifying to be openable directly?
|
||||
if (openableAyaType) {
|
||||
//signal to grid to make it an openable link
|
||||
columnObject["ot"] = openableAyaType;
|
||||
}
|
||||
|
||||
o.columns["c" + iColumn.toString()] = columnObject;
|
||||
//Is:
|
||||
//Headers: [ { "text": "Name", "value": "c1" }, { "text": "Serial #", "value": "c2" },
|
||||
|
||||
Reference in New Issue
Block a user