PreView.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <div class="containe">
  3. <div v-if='show' class='qualityManual-container-office'>
  4. <vab-only-office :option='option' />
  5. </div>
  6. </div>
  7. </template>
  8. <script>
  9. import vabOnlyOffice from '@/views/doc/oo/onlyoffice.vue'
  10. export default {
  11. name: 'OoEdit',
  12. components: {
  13. vabOnlyOffice
  14. },
  15. data() {
  16. return {
  17. //参考vabOnlyOffice组件参数配置
  18. option: {
  19. key: '',
  20. url: '', //在线文档地址
  21. isEdit: '', //是否允许编辑
  22. fileType: '', //文件扩展名
  23. title: '', //文件标题
  24. user: {
  25. id: null, //用户ID
  26. name: '' //用户姓名
  27. },
  28. editUrl: '' //回调地址
  29. },
  30. show: true //是否显示
  31. }
  32. },
  33. created() {
  34. this.getFile();
  35. // document.title=111
  36. },
  37. methods: {
  38. getFile() {
  39. //获取当前登录用户名:this.$store.state.user.name
  40. //获取当前登录用户ID:this.$store.state.user.uid
  41. //获取当前登录用户昵称:this.$store.state.user.uname
  42. let row = this.$route.query;
  43. let isEdit = row.isEdit == 'true';
  44. this.show = true;
  45. // getAction('/file/selectById', { id: this.id }).then(res => {
  46. this.option.isEdit = isEdit;
  47. this.option.url = row.docPath;
  48. //'http://192.168.1.26:9300/statics/2023/04/03/产品研发会议纪要20230314_20230403170635A001.doc';
  49. this.option.title = row.docName; //'测试word';
  50. this.option.fileType = row.docType;
  51. this.option.user = {
  52. id: this.$store.state.user.uid,
  53. name: this.$store.state.user.uname
  54. };
  55. this.option.editUrl = 'http://192.168.1.26:8080/doc/only-office/callback?id=' + row.docId +
  56. "&year=" + row.createYear + "&name=" + this.$store.state.user.name;
  57. },
  58. close() {
  59. this.show = false
  60. }
  61. }
  62. }
  63. </script>
  64. <style>
  65. html,
  66. body {
  67. height: '900px';
  68. }
  69. #app {
  70. font-family: Avenir, Helvetica, Arial, sans-serif;
  71. -webkit-font-smoothing: antialiased;
  72. -moz-osx-font-smoothing: grayscale;
  73. text-align: center;
  74. color: #2c3e50;
  75. height: '900px';
  76. }
  77. .qualityManual-container {
  78. padding: 0 !important;
  79. height: '900px';
  80. }
  81. .qualityManual-container-office {
  82. width: 100%;
  83. height: '900px';
  84. }
  85. .fh{
  86. position: absolute;
  87. right: 1%;
  88. top: 8%;
  89. background: #2E8AECFF !important;
  90. color: #fff !important;
  91. border: none;
  92. }
  93. </style>