xiangpei
2024-05-17 7c55881bbdbbc6914a242693628c71faa06aa878
文件下载
3个文件已修改
1个文件已删除
55 ■■■■ 已修改文件
src/components/PDF.vue 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/request.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/onlineStudy/file.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/PDF.vue
File was deleted
src/router.js
@@ -113,12 +113,6 @@
        component: () => import('@/views/onlineStudy/file'),
        name: 'File',
        meta: { title: '学习文件', noCache: true }
      },
      {
        path: 'pdf/view',
        component: () => import('@/components/PDF'),
        name: 'PDFView',
        meta: { title: 'PDF查看', noCache: true }
      }
    ]
  },
src/utils/request.js
@@ -137,5 +137,6 @@
  postWithOutLoadTip,
  get,
  form,
  download
  download,
  bestDownload
}
src/views/onlineStudy/file.vue
@@ -43,7 +43,7 @@
      </el-table-column>
      <el-table-column prop="attachment" label="附件">
        <template slot-scope="scope">
          <el-link type="primary" v-for="item in scope.row.attachment">{{ item.name }}</el-link>
          <el-link type="primary" :href="'/api/upload/download?url=' + item.url +'&fileName=' + item.name" v-for="item in scope.row.attachment" :key="item.url">{{ item.name }}</el-link>
        </template>
      </el-table-column>
      <el-table-column fixed="right" label="操作" width="140">
@@ -94,6 +94,10 @@
        <el-button type="primary" @click="handlerSubmit">保 存</el-button>
      </span>
    </el-dialog>
    <el-dialog title="PDF查看" :visible.sync="pdfDialog" width="80%" :before-close="closePdfDialog">
      <vue-office-pdf :src="pdf" @rendered="rendered" />
    </el-dialog>
  </div>
</template>
@@ -103,9 +107,10 @@
import StudyTypeAPI from '@/api/study-type';
import Upload from '@/components/UploadC';
import VueOfficePdf from '@vue-office/pdf';
export default {
  name: 'type',
  components: { Upload, Pagination },
  components: { Upload, Pagination, VueOfficePdf },
  computed: {
    fileContentUrl: () => {
      return this.form ? this.form.contentUrl ? [this.form.contentUrl] : [] : [];
@@ -113,6 +118,7 @@
  },
  data() {
    return {
      pdf: '',
      dialogTitle: '添加学习内容',
      ids: [],
      typeList: [],
@@ -151,11 +157,15 @@
  },
  methods: {
    checkPdf(url) {
      window.open('/#/online/study/pdf/view?pdfUrl=' + url, '_blank')
      this.pdf = url;
      this.pdfDialog = true;
    },
    closePdfDialog() {
      this.pdfDialog = false;
    },
    rendered() {
    },
    fileChange() {
      this.form.contentUrl = [];
    },