Commit 69e2c8ff authored by BojanSovticEngIT's avatar BojanSovticEngIT
Browse files

Doc Exe fix

parent 79ec746a
......@@ -17,16 +17,7 @@
</TabPanel>
</TabView>
<DocumentBrowserTab
v-show="selectedItem && selectedItem.mode"
:item="selectedItem?.item"
:mode="selectedItem?.mode"
:functionalityId="selectedItem?.functionalityId"
@close="closeDocument('current')"
@iframeCreated="onIFrameCreated"
@closeIframe="closeIframe"
@documentSaved="onDocumentSaved"
></DocumentBrowserTab>
<DocumentBrowserTab v-show="selectedItem && selectedItem.mode" :item="selectedItem?.item" :functionalityId="selectedItem?.functionalityId" @close="closeDocument('current')" @iframeCreated="onIFrameCreated" @closeIframe="closeIframe" @documentSaved="onDocumentSaved"></DocumentBrowserTab>
<div v-for="(iframe, index) in iFrameContainers" :key="index">
<iframe v-show="iframe.item?.routerId === selectedItem?.item.routerId" ref="iframe" class="document-browser-cockpit-iframe" :src="iframe.iframe"></iframe>
</div>
......@@ -73,7 +64,14 @@ export default defineComponent({
let tempDocument = {} as any
await this.$http.get(process.env.VUE_APP_RESTFUL_SERVICES_PATH + `2.0/documents/${this.$router.currentRoute.value.params.id}`).then((response: AxiosResponse<any>) => (tempDocument = response.data))
const tempItem = {
item: { name: tempDocument.name, label: this.$router.currentRoute.value.params.id, mode: this.$router.currentRoute.value.params.mode, routerId: crypto.randomBytes(16).toString('hex'), id: this.$router.currentRoute.value.params.id },
item: {
name: tempDocument.name,
label: this.$router.currentRoute.value.params.id,
mode: this.$router.currentRoute.value.params.mode,
routerId: crypto.randomBytes(16).toString('hex'),
id: this.$router.currentRoute.value.params.id,
showMode: this.$router.currentRoute.value.name === 'document-browser-document-execution' ? 'execute' : 'documentDetail'
},
mode: this.$router.currentRoute.value.name === 'document-browser-document-execution' ? 'execute' : 'documentDetail'
}
this.tabs.push(tempItem)
......@@ -116,14 +114,17 @@ export default defineComponent({
if (payload.mode === 'documentDetail') {
const path = payload.functionalityId ? `/document-browser/document-details/new/${payload.functionalityId}` : `/document-browser/document-details/${payload.item.id}`
this.selectedItem.item.showMode = 'documentDetail'
this.$router.push(path)
} else {
const id = payload.item ? payload.item.label : 'new-dashboard'
if (payload.item) {
let routeDocumentType = this.getRouteDocumentType(payload.item)
this.selectedItem.item.showMode = 'execute'
this.$router.push(`/document-browser/${routeDocumentType}/` + id)
} else {
this.selectedItem.item = { routerId: crypto.randomBytes(16).toString('hex') }
this.selectedItem.item.showMode = 'createCockpit'
this.$router.push(`/document-browser/new-dashboard`)
}
}
......@@ -233,7 +234,7 @@ export default defineComponent({
},
loadSavedCockpit(cockpit: any) {
this.closeIframe()
this.selectedItem = { item: { ...cockpit, routerId: crypto.randomBytes(16).toString('hex'), name: cockpit.DOCUMENT_NAME, label: cockpit.DOCUMENT_LABEL, mode: 'document-composite' } }
this.selectedItem = { item: { ...cockpit, routerId: crypto.randomBytes(16).toString('hex'), name: cockpit.DOCUMENT_NAME, label: cockpit.DOCUMENT_LABEL, showMode: 'createCockpit' } }
this.tabs[this.activeIndex - 1] = this.selectedItem
this.$router.push(`/document-browser/document-composite/${cockpit.DOCUMENT_LABEL}`)
},
......
......@@ -32,7 +32,7 @@ export default defineComponent({
DocumentExecution,
DocumentDetails
},
props: { id: { type: String }, functionalityId: { type: String }, item: { type: Object }, parameterValuesMap: { type: Object }, tabKey: { type: String }, propMode: { type: String } },
props: { id: { type: String }, functionalityId: { type: String }, item: { type: Object }, parameterValuesMap: { type: Object }, tabKey: { type: String } },
emits: ['iframeCreated', 'closeIframe', 'parametersChanged', 'closeDetails', 'documentSaved'],
data() {
return {
......@@ -46,9 +46,6 @@ export default defineComponent({
id() {
this.name = this.id as string
this.setMode()
},
propMode() {
this.setMode()
}
},
created() {
......@@ -72,11 +69,13 @@ export default defineComponent({
this.url = process.env.VUE_APP_HOST_URL + `/knowagecockpitengine/api/1.0/pages/edit?NEW_SESSION=TRUE&SBI_LANGUAGE=${language}&user_id=${uniqueID}&SBI_COUNTRY=${country}&SBI_ENVIRONMENT=DOCBROWSER&IS_TECHNICAL_USER=true&documentMode=EDIT&FUNCTIONALITY_ID=${this.functionalityId}`
},
setMode() {
if (this.propMode === 'documentDetail') {
if (!this.item) return
if (this.item.showMode === 'documentDetail') {
this.mode = 'document-detail'
} else if (this.propMode === 'execute') {
} else if (this.item.showMode === 'execute') {
this.mode = 'document-execution'
} else if (this.propMode === 'createCockpit') {
} else if (this.item.showMode === 'createCockpit') {
this.mode = 'cockpit'
this.$emit('iframeCreated', { iframe: this.url, item: this.item })
}
......
......@@ -6,7 +6,6 @@
:item="item"
:parameterValuesMap="parameterValuesMap"
:tabKey="key"
:propMode="mode"
@close="$emit('close', item)"
@parametersChanged="onParametersChange"
@iframeCreated="onIframeCreated"
......@@ -27,7 +26,7 @@ export default defineComponent({
name: 'document-browser-tab',
components: {},
emits: ['close', 'iframeCreated', 'closeIframe', 'documentSaved'],
props: { item: { type: Object }, mode: { type: String }, functionalityId: { type: String } },
props: { item: { type: Object }, functionalityId: { type: String } },
data() {
return {
parameterValuesMap: {} as any
......
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