mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-13 07:04:21 +08:00
fix: Without title in some view's component. (#436)
* fix: Without title in some view's component. * fix name attribute.
This commit is contained in:
parent
78e2c19468
commit
5259c6c408
@ -1,5 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-container v-if="isLoaded" key="browser-loaded" class="view-base" style="height: 86vh;">
|
<el-container
|
||||||
|
v-if="isLoaded"
|
||||||
|
key="browser-loaded"
|
||||||
|
class="view-base"
|
||||||
|
style="height: 86vh;"
|
||||||
|
>
|
||||||
<modal-dialog
|
<modal-dialog
|
||||||
:container-uuid="browserUuid"
|
:container-uuid="browserUuid"
|
||||||
:panel-type="panelType"
|
:panel-type="panelType"
|
||||||
@ -13,39 +18,32 @@
|
|||||||
<div class="w-33">
|
<div class="w-33">
|
||||||
<div class="center">
|
<div class="center">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="isEmptyValue(browserMetadata.help)"
|
v-popover:helpTitle
|
||||||
slot="reference"
|
|
||||||
type="text"
|
type="text"
|
||||||
:class="cssClassTitle + ' warn-content text-center'"
|
:class="cssClassTitle + ' warn-content text-center'"
|
||||||
>
|
>
|
||||||
{{ browserMetadata.name }}
|
{{ browserTitle }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-popover
|
<el-popover
|
||||||
v-if="!isEmptyValue(browserMetadata.name)"
|
v-if="!isEmptyValue(browserMetadata.help)"
|
||||||
|
ref="helpTitle"
|
||||||
placement="top-start"
|
placement="top-start"
|
||||||
:title="browserMetadata.name"
|
:title="browserTitle"
|
||||||
:class="cssClassHelp"
|
:class="cssClassHelp"
|
||||||
|
width="400"
|
||||||
trigger="hover"
|
trigger="hover"
|
||||||
>
|
>
|
||||||
<div v-html="browserMetadata.help" />
|
<div v-html="browserMetadata.help" />
|
||||||
<div class="w-33">
|
|
||||||
<div class="center">
|
|
||||||
<el-button
|
|
||||||
v-if="isEmptyValue(browserMetadata.help)"
|
|
||||||
slot="reference"
|
|
||||||
type="text"
|
|
||||||
:class="cssClassTitle + 'warn-content text-center'"
|
|
||||||
>
|
|
||||||
{{ browserMetadata.name }}
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main>
|
<el-main>
|
||||||
<el-collapse v-model="activeSearch" class="container-collasep-open" @change="handleChange">
|
<el-collapse
|
||||||
|
v-model="activeSearch"
|
||||||
|
class="container-collasep-open"
|
||||||
|
@change="handleChange"
|
||||||
|
>
|
||||||
<el-collapse-item :title="$t('views.searchCriteria')" name="opened-criteria">
|
<el-collapse-item :title="$t('views.searchCriteria')" name="opened-criteria">
|
||||||
<main-panel
|
<main-panel
|
||||||
:container-uuid="browserUuid"
|
:container-uuid="browserUuid"
|
||||||
@ -108,6 +106,9 @@ export default {
|
|||||||
getterBrowser() {
|
getterBrowser() {
|
||||||
return this.$store.getters.getBrowser(this.browserUuid)
|
return this.$store.getters.getBrowser(this.browserUuid)
|
||||||
},
|
},
|
||||||
|
browserTitle() {
|
||||||
|
return this.browserMetadata.name || this.$route.meta.title
|
||||||
|
},
|
||||||
getDataRecords() {
|
getDataRecords() {
|
||||||
return this.$store.getters.getDataRecordsList(this.browserUuid)
|
return this.$store.getters.getDataRecordsList(this.browserUuid)
|
||||||
},
|
},
|
||||||
@ -161,8 +162,9 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getBrowser() {
|
getBrowser() {
|
||||||
if (this.getterBrowser) {
|
const browser = this.getterBrowser
|
||||||
this.browserMetadata = this.getterBrowser
|
if (browser) {
|
||||||
|
this.browserMetadata = browser
|
||||||
this.isLoaded = true
|
this.isLoaded = true
|
||||||
this.defaultSearch()
|
this.defaultSearch()
|
||||||
return
|
return
|
||||||
@ -172,8 +174,8 @@ export default {
|
|||||||
panelType: this.panelType,
|
panelType: this.panelType,
|
||||||
routeToDelete: this.$route
|
routeToDelete: this.$route
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(browserResponse => {
|
||||||
this.browserMetadata = this.getterBrowser
|
this.browserMetadata = browserResponse
|
||||||
this.defaultSearch()
|
this.defaultSearch()
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-container v-if="isLoadedMetadata" key="process-loaded" class="view-base" style="height: 84vh;">
|
<el-container
|
||||||
|
v-if="isLoadedMetadata"
|
||||||
|
key="process-loaded"
|
||||||
|
class="view-base"
|
||||||
|
style="height: 84vh;"
|
||||||
|
>
|
||||||
<el-header style="height: 39px;">
|
<el-header style="height: 39px;">
|
||||||
<context-menu
|
<context-menu
|
||||||
:menu-parent-uuid="$route.meta.parentUuid"
|
:menu-parent-uuid="$route.meta.parentUuid"
|
||||||
@ -12,20 +17,22 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-card class="content-collapse">
|
<el-card class="content-collapse">
|
||||||
<h3 v-show="!isEmptyValue(processMetadata.name)" class="warn-content text-center">
|
<h3 v-show="!isEmptyValue(processTitle)" class="warn-content text-center">
|
||||||
<el-popover
|
<el-popover
|
||||||
v-if="!isEmptyValue(processMetadata.help)"
|
v-if="!isEmptyValue(processMetadata.help)"
|
||||||
|
ref="helpTitle"
|
||||||
placement="top-start"
|
placement="top-start"
|
||||||
:title="processMetadata.name"
|
:title="processTitle"
|
||||||
width="400"
|
width="400"
|
||||||
trigger="hover"
|
trigger="hover"
|
||||||
>
|
>
|
||||||
<div v-html="processMetadata.help" />
|
<div v-html="processMetadata.help" />
|
||||||
<el-button slot="reference" type="text" class="title">
|
|
||||||
{{ processMetadata.name }}
|
|
||||||
</el-button>
|
|
||||||
</el-popover>
|
</el-popover>
|
||||||
<el-button v-if="isEmptyValue(processMetadata.help)" slot="reference" type="text" class="title text-center">
|
<el-button
|
||||||
|
v-popover:helpTitle
|
||||||
|
type="text"
|
||||||
|
class="title text-center"
|
||||||
|
>
|
||||||
{{ processMetadata.name }}
|
{{ processMetadata.name }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</h3>
|
</h3>
|
||||||
@ -81,6 +88,9 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
getterProcess() {
|
getterProcess() {
|
||||||
return this.$store.getters.getPanel(this.processUuid)
|
return this.$store.getters.getPanel(this.processUuid)
|
||||||
|
},
|
||||||
|
processTitle() {
|
||||||
|
return this.processMetadata.name || this.$route.meta.title
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -88,16 +98,17 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getProcess() {
|
getProcess() {
|
||||||
if (this.getterProcess) {
|
const process = this.getterProcess
|
||||||
this.processMetadata = this.getterProcess
|
if (process) {
|
||||||
|
this.processMetadata = process
|
||||||
this.isLoadedMetadata = true
|
this.isLoadedMetadata = true
|
||||||
} else {
|
} else {
|
||||||
this.$store.dispatch('getPanelAndFields', {
|
this.$store.dispatch('getPanelAndFields', {
|
||||||
containerUuid: this.processUuid,
|
containerUuid: this.processUuid,
|
||||||
panelType: this.panelType,
|
panelType: this.panelType,
|
||||||
routeToDelete: this.$route
|
routeToDelete: this.$route
|
||||||
}).then(() => {
|
}).then(processResponse => {
|
||||||
this.processMetadata = this.getterProcess
|
this.processMetadata = processResponse
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.isLoadedMetadata = true
|
this.isLoadedMetadata = true
|
||||||
})
|
})
|
||||||
|
@ -13,16 +13,21 @@
|
|||||||
<h3 class="text-center" style="margin: 0 !important;">
|
<h3 class="text-center" style="margin: 0 !important;">
|
||||||
<el-popover
|
<el-popover
|
||||||
v-if="!isEmptyValue(processMetadata.help)"
|
v-if="!isEmptyValue(processMetadata.help)"
|
||||||
|
ref="helpTitle"
|
||||||
placement="top-start"
|
placement="top-start"
|
||||||
:title="processMetadata.name"
|
:title="reportTitle"
|
||||||
width="400"
|
width="400"
|
||||||
trigger="hover"
|
trigger="hover"
|
||||||
>
|
>
|
||||||
<div v-html="processMetadata.help" />
|
<div v-html="processMetadata.help" />
|
||||||
<el-button slot="reference" type="text" class="title">
|
|
||||||
{{ processMetadata.name }}
|
|
||||||
</el-button>
|
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
<el-button
|
||||||
|
v-popover:helpTitle
|
||||||
|
type="text"
|
||||||
|
class="title"
|
||||||
|
>
|
||||||
|
{{ reportTitle }}
|
||||||
|
</el-button>
|
||||||
</h3>
|
</h3>
|
||||||
<iframe
|
<iframe
|
||||||
v-if="reportFormat === 'pdf'"
|
v-if="reportFormat === 'pdf'"
|
||||||
@ -87,7 +92,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
panelType: 'process',
|
panelType: 'process',
|
||||||
name: [],
|
processMetadata: {},
|
||||||
reportFormat: '',
|
reportFormat: '',
|
||||||
collectionReportFormat: [
|
collectionReportFormat: [
|
||||||
'ps',
|
'ps',
|
||||||
@ -101,16 +106,18 @@ export default {
|
|||||||
'arxml'
|
'arxml'
|
||||||
],
|
],
|
||||||
reportContent: '',
|
reportContent: '',
|
||||||
reportHeader: '',
|
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
reportResult: {}
|
reportResult: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// TODO: Add get metadata from server to open report view from link
|
// TODO: Add get metadata from server to open report view from link
|
||||||
processMetadata() {
|
getterProcess() {
|
||||||
return this.$store.getters.getProcessById(this.$route.params.processId)
|
return this.$store.getters.getProcessById(this.$route.params.processId)
|
||||||
},
|
},
|
||||||
|
reportTitle() {
|
||||||
|
return this.processMetadata.name || this.$route.meta.title
|
||||||
|
},
|
||||||
url() {
|
url() {
|
||||||
return this.$store.getters.getProcessResult.url
|
return this.$store.getters.getProcessResult.url
|
||||||
},
|
},
|
||||||
@ -118,6 +125,9 @@ export default {
|
|||||||
return this.$store.getters.getCachedReport(this.$route.params.instanceUuid)
|
return this.$store.getters.getCachedReport(this.$route.params.instanceUuid)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.processMetadata = this.getterProcess
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getCachedReport()
|
this.getCachedReport()
|
||||||
this.$route.meta.reportFormat = this.reportFormat
|
this.$route.meta.reportFormat = this.reportFormat
|
||||||
@ -126,10 +136,10 @@ export default {
|
|||||||
showNotification,
|
showNotification,
|
||||||
displayReport(reportResult) {
|
displayReport(reportResult) {
|
||||||
if (!reportResult.isError) {
|
if (!reportResult.isError) {
|
||||||
this.reportFormat = this.isEmptyValue(reportResult.output.reportType) ? reportResult.reportType : reportResult.output.reportType
|
const { output } = reportResult
|
||||||
this.reportContent = this.isEmptyValue(reportResult.output.output) ? reportResult.output : reportResult.output.output
|
this.reportFormat = this.isEmptyValue(output.reportType) ? reportResult.reportType : output.reportType
|
||||||
this.reportHeader = this.isEmptyValue(reportResult.output.name) ? reportResult.processName : reportResult.output.name
|
this.reportContent = this.isEmptyValue(output.output) ? reportResult.output : output.output
|
||||||
this.name = this.isEmptyValue(reportResult.output.fileName) ? reportResult.fileName : reportResult.output.fileName
|
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user