PreView.vue 2.7 KB

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