lex-xin 3 年 前
コミット
4d982c6b16

+ 27 - 3
src/components/VueFormMaking/components/GenerateFormItem.vue

@@ -525,13 +525,37 @@ export default {
   methods: {
     // 获取学校列表
     onDownload(item, type) {
-      console.log(item)
       if(type == 'download') {
         window.location.href = item.url
         return
       }
-      this.previewUrl = 'https://view.officeapps.live.com/op/view.aspx?src=' + item.url
-      window.open(this.previewUrl)
+
+      let urlArr = item.url.split('.')
+      let suffix = urlArr[urlArr.length-1]
+      if(suffix != 'pdf') {
+        this.previewUrl = 'https://view.officeapps.live.com/op/view.aspx?src=' + item.url
+        window.open(this.previewUrl)
+        return
+      } else {
+        this.previewUrl = this.validManageUrl() + '/pdf/web/viewer.html?file=' + item.url
+        window.open(this.previewUrl)
+        return
+      }
+    },
+    // 教务地址
+    validManageUrl() {
+      let url = window.location.href
+      let returnUrl = ''
+      if (/dev/.test(url)) { // dev 环境
+        returnUrl = 'http://mandev.dayaedu.com'
+      } else if (/test/.test(url)) { // dev 环境
+        returnUrl = 'http://mantest.dayaedu.com'
+      } else if (/online/.test(url)) { //线上
+        returnUrl = 'https://manonline.dayaedu.com'
+      } else { // 默认dev环境
+        returnUrl = 'http://mandev.dayaedu.com'
+      }
+      return returnUrl
     },
     readWorkbookFromRemoteFile: function (url) {
         var xhr = new XMLHttpRequest()

ファイルの差分が大きいため隠しています
+ 0 - 0
web/index.html


ファイルの差分が大きいため隠しています
+ 0 - 0
web/static/web/js/chunk-0a7ee8d6.6723dd35.js


ファイルの差分が大きいため隠しています
+ 0 - 0
web/static/web/js/chunk-0a7ee8d6.c67b159d.js


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません