perf: 流程图只读模式下的样式
This commit is contained in:
parent
d24b9a5c09
commit
a6994ae467
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="drawio-content">
|
<div class="drawio-content" :style="{'top': readOnly ? '0': '2.5rem'}">
|
||||||
<div class="drawio-title">
|
<div class="drawio-title">
|
||||||
<span class="drawio-title-name" :style="{'color': saved ? '': '#ff8200'}">{{title}}</span>
|
<span class="drawio-title-name" :style="{'color': saved ? '': '#ff8200'}">{{title}}</span>
|
||||||
<span class="drawio-save"><el-button v-if="!saved" @click="save" size="mini" :loading="updating">保存</el-button></span>
|
<span class="drawio-save"><el-button v-if="!saved" @click="save" size="mini" :loading="saveBtnUpdating">保存</el-button></span>
|
||||||
</div>
|
</div>
|
||||||
<iframe ref="myFlow" class="drawio-iframe" :src="url" :title="file.name"></iframe>
|
<iframe ref="myFlow" class="drawio-iframe" :src="url" :title="file.name"></iframe>
|
||||||
</div>
|
</div>
|
||||||
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.drawio-content {
|
.drawio-content {
|
||||||
|
z-index: 999;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 2.5rem;
|
top: 2.5rem;
|
||||||
left: 0;
|
left: 0;
|
||||||
@ -81,6 +82,7 @@ export default {
|
|||||||
url: null,
|
url: null,
|
||||||
bakData: '',
|
bakData: '',
|
||||||
xml: '',
|
xml: '',
|
||||||
|
saveBtnUpdating: false,
|
||||||
title: this.file.name,
|
title: this.file.name,
|
||||||
saved: true
|
saved: true
|
||||||
}
|
}
|
||||||
@ -107,7 +109,11 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.xml = ''
|
this.xml = ''
|
||||||
api.previewText({
|
let request = 'previewText'
|
||||||
|
if(this.readOnly){
|
||||||
|
request = 'sharePreviewText'
|
||||||
|
}
|
||||||
|
api[request]({
|
||||||
shareId: this.shareId,
|
shareId: this.shareId,
|
||||||
fileId: this.file.id,
|
fileId: this.file.id,
|
||||||
id: this.file.id,
|
id: this.file.id,
|
||||||
@ -142,21 +148,21 @@ export default {
|
|||||||
this.update(this.xml)
|
this.update(this.xml)
|
||||||
},
|
},
|
||||||
update(value) {
|
update(value) {
|
||||||
this.updating = true
|
this.saveBtnUpdating = true
|
||||||
txtApi.editMarkdownByPath({
|
txtApi.editMarkdownByPath({
|
||||||
relativePath: encodeURI(this.file.path + this.file.name),
|
relativePath: encodeURI(this.file.path + this.file.name),
|
||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
username: this.$store.state.user.name,
|
username: this.$store.state.user.name,
|
||||||
contentText: value
|
contentText: value
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.updating = false
|
this.saveBtnUpdating = false
|
||||||
this.$message({
|
this.$message({
|
||||||
message: "保存成功",
|
message: "保存成功",
|
||||||
type: 'success',
|
type: 'success',
|
||||||
duration : 1000
|
duration : 1000
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.updating = false
|
this.saveBtnUpdating = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleMessage(event) {
|
handleMessage(event) {
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<pdf-preview v-if="fileType === 'pdf'" :file="file" :shareId="shareId" :file-url="fileUrl" @onReady="onReady"></pdf-preview>
|
<pdf-preview v-if="fileType === 'pdf'" :file="file" :shareId="shareId" :file-url="fileUrl" @onReady="onReady"></pdf-preview>
|
||||||
<drawio v-else-if="fileType === 'drawio'" :file="file" :read-only="readOnly" @onEdit="onEdit" @onReady="onReady"></drawio>
|
<drawio v-else-if="fileType === 'drawio'" :file="file" :shareId="shareId" :read-only="readOnly" @onEdit="onEdit" @onReady="onReady"></drawio>
|
||||||
<only-office-editor ref="officeEditor" v-else :file="file" :file-url="fileUrl" :read-only="readOnly" @onEdit="onEdit" @manualSave="manualSave" @onClose="close" @onReady="onReady"></only-office-editor>
|
<only-office-editor ref="officeEditor" v-else :file="file" :file-url="fileUrl" :read-only="readOnly" @onEdit="onEdit" @manualSave="manualSave" @onClose="close" @onReady="onReady"></only-office-editor>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -248,6 +248,7 @@ export default {
|
|||||||
z-index: 2001;
|
z-index: 2001;
|
||||||
|
|
||||||
.close-bar {
|
.close-bar {
|
||||||
|
z-index: 2000;
|
||||||
background-color: rgba(0,0,0,.5);
|
background-color: rgba(0,0,0,.5);
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -2.5rem;
|
top: -2.5rem;
|
||||||
|
|||||||
@ -936,7 +936,7 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// office文件
|
// office文件
|
||||||
if (row.contentType.indexOf('office') > -1 || row.suffix === 'csv' || row.suffix === 'pdf') {
|
if (row.contentType.indexOf('office') > -1 || ['pdf','csv','drawio'].includes(row.suffix)) {
|
||||||
// office文件
|
// office文件
|
||||||
this.officePreviewVisible = true
|
this.officePreviewVisible = true
|
||||||
this.officePreviewRow = row
|
this.officePreviewRow = row
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user