Unverified Commit 41a076d0 authored by BojanSovticEngIT's avatar BojanSovticEngIT Committed by GitHub
Browse files

[KNOWAGE-7120]

parent 8b286c1d
......@@ -163,6 +163,21 @@ export default defineComponent({
this.isForEdit()
await this.loadPage(this.docId)
},
activated() {
if (this.propFolderId) {
this.getFunctionalities()
this.getAnalyticalDrivers()
this.getDatasources()
this.getTypes()
this.getEngines()
this.getAttributes()
this.getParTypes()
this.getDateFormats()
this.getSavedTablesByDocumentID()
this.getDataset()
this.getDataSources()
}
},
methods: {
isForEdit() {
if (this.propMode === 'execution') {
......
......@@ -108,7 +108,7 @@
<KnParameterSidebar v-if="parameterSidebarVisible" :filtersData="filtersData" :propDocument="dataset" :userRole="userRole" :propMode="'qbeView'" :propQBEParameters="qbe?.pars" @execute="onExecute" @roleChanged="onRoleChange"></KnParameterSidebar>
</div>
<QBEPreviewDialog v-show="!loading && qbePreviewDialogVisible" :id="uniqueID" :queryPreviewData="queryPreviewData" :pagination="pagination" :entities="entities?.entities" @close="closePreview" @pageChanged="updatePagination($event)"></QBEPreviewDialog>
<QBEPreviewDialog v-show="!loading && qbePreviewDialogVisible" :id="uniqueID" :queryPreviewData="queryPreviewData" :pagination="pagination" :entities="entities?.entities" :selectedQuery="selectedQuery" @close="closePreview" @pageChanged="updatePagination($event)"></QBEPreviewDialog>
<QBEFilterDialog :visible="filterDialogVisible" :filterDialogData="filterDialogData" :id="uniqueID" :entities="entities?.entities" :propParameters="qbe?.pars" :propExpression="selectedQuery?.expression" @close="filterDialogVisible = false" @save="onFiltersSave"></QBEFilterDialog>
<QBESqlDialog :visible="sqlDialogVisible" :sqlData="sqlData" @close="sqlDialogVisible = false" />
<QBERelationDialog :visible="relationDialogVisible" :propEntity="relationEntity" @close="relationDialogVisible = false" />
......
......@@ -51,7 +51,7 @@ import QBEDescriptor from '../../QBEDescriptor.json'
export default defineComponent({
name: 'qbe-preview-dialog',
components: { Column, DataTable },
props: { id: { type: String }, queryPreviewData: { type: Object }, pagination: { type: Object }, entities: { type: Array } },
props: { id: { type: String }, queryPreviewData: { type: Object }, pagination: { type: Object }, entities: { type: Array }, selectedQuery: { type: Object, required: true } },
emits: ['close', 'pageChanged'],
data() {
return {
......@@ -85,15 +85,23 @@ export default defineComponent({
},
setPreviewColumns(data: any) {
this.columns = []
for (let i = 1; i < data.metaData?.fields?.length; i++) {
const tempColumn = data.metaData?.fields[i]
if (['timestamp', 'date'].includes(tempColumn.type)) {
const field = this.findField(tempColumn) as any
if (field) tempColumn.metawebDateFormat = field.format
if (!tempColumn.metawebDateFormat) {
this.setCalculatedFieldDateFormat(tempColumn, i - 1)
}
}
this.columns.push(data.metaData?.fields[i])
}
},
setCalculatedFieldDateFormat(tempColumn: any, index: number) {
if (!this.selectedQuery || !this.selectedQuery.fields) return
if (this.selectedQuery.fields[index]) tempColumn.metawebDateFormat = this.selectedQuery.fields[index].id.format ?? 'L'
},
findField(column: any) {
if (!this.entities) return
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment