diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 65af0aa..2aee3cf 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -827,7 +827,6 @@ export default { mounted() { Bus.$on('fileSuccess', () => {}) Bus.$on('loadFileFaild', () => { - console.log('loadFileFaild') this.notPreviewDialogVisible = true }) Bus.$on('clickMore', (rows) => { @@ -1735,7 +1734,6 @@ export default { if (newName.indexOf('.') > 0) { const name = newName.substring(0, newName.lastIndexOf('.')) const suffix = newName.substring(newName.lastIndexOf('.')) - console.log('name', name, 'suffix', suffix) newFileName = `${name}${append}${suffix}` } else { newFileName = `${newName}${append}` @@ -1840,6 +1838,7 @@ export default { this.textPreviewRow = res.data this.textPreviewVisible = true break + case 'drawio': case 'docx': case 'xlsx': case 'pptx': @@ -2562,6 +2561,10 @@ export default { this.newCreateFileDialogTitle = "新建文本文件" this.createNewFile('txt') break + case 'createDrawioFile': + this.newCreateFileDialogTitle = "新建流程图" + this.createNewFile('drawio') + break case 'createWordFile': this.newCreateFileDialogTitle = "新建Word文档" this.createNewFile('docx') diff --git a/src/components/office/Drawio.vue b/src/components/office/Drawio.vue index 4937ff8..aeeb92c 100644 --- a/src/components/office/Drawio.vue +++ b/src/components/office/Drawio.vue @@ -84,7 +84,8 @@ export default { xml: '', saveBtnUpdating: false, title: this.file.name, - saved: true + saved: true, + reday: false } }, created() { @@ -120,8 +121,8 @@ export default { path: encodeURI(this.file.path), username: this.$store.state.user.name }).then((res) => { + this.file.path = res.data.path this.xml = res.data.contentText - console.log(this.xml) if (this.bakData === res.data.contentText) { return } @@ -146,6 +147,7 @@ export default { this.saved = true this.title = this.file.name this.update(this.xml) + this.$emit('onEdit', this.saved) }, update(value) { this.saveBtnUpdating = true @@ -171,9 +173,9 @@ export default { return } const payload = $J.jsonParse(event.data) - console.log('handleMessage payload', payload.event, payload) switch (payload.event) { case "init": + this.reday = true this.$emit('onReady') this.updateContent() break @@ -196,7 +198,6 @@ export default { case "save": // save this.save() - this.$emit('onEdit', this.saved) break } } diff --git a/src/components/preview/OfficePreview.vue b/src/components/preview/OfficePreview.vue index db93ca6..f1921e5 100644 --- a/src/components/preview/OfficePreview.vue +++ b/src/components/preview/OfficePreview.vue @@ -17,7 +17,7 @@