Selaa lähdekoodia

完成文件上传题

wkeyuan 3 vuotta sitten
vanhempi
commit
f71fea304e

+ 1 - 0
config/dev.env.js

@@ -6,4 +6,5 @@ module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
   DW_API_URL: '"http://localhost:8081"',
   DW_WEB_URL: '"http://localhost:8081"',
+  DW_RESOURCE_URL: '"http://localhost:8080"'
 })

+ 1 - 0
config/prod.env.js

@@ -3,4 +3,5 @@ module.exports = {
   NODE_ENV: '"production"',
   DW_API_URL: '"http://localhost:8081"',
   DW_WEB_URL: '"http://localhost:8081"',
+  DW_RESOURCE_URL: '"http://localhost:8080"'
 }

+ 1 - 0
config/test.env.js

@@ -6,4 +6,5 @@ module.exports = merge(devEnv, {
   NODE_ENV: '"testing"',
   DW_API_URL: '"http://localhost:8081"',
   DW_WEB_URL: '"http://localhost:8081"',
+  DW_RESOURCE_URL: '"http://localhost:8080"'
 })

+ 11 - 12
src/components/layouts/LoginLayout.vue

@@ -1,23 +1,22 @@
 <template>
   <div id="dw-layout" style="height: 100vh;" class="dw-layout-body" >
     <el-container>
-    <el-container style="padding: 0px;height: calc(100vh - 80px);">
-      <el-header height="80" style="padding: 0px;" >
-        <dw-header-login></dw-header-login>
-      </el-header>
-      <el-container style="z-index: 1;">
-        <el-container>
-          <el-main style="padding: 20px 0px;" >
-            <router-view></router-view>
-          </el-main>
+      <el-container style="padding: 0px;height: calc(100vh - 80px);">
+        <el-header height="80" style="padding: 0px;" >
+          <dw-header-login></dw-header-login>
+        </el-header>
+        <el-container style="z-index: 1;">
+          <el-container>
+            <el-main style="padding: 20px 0px;" >
+              <router-view></router-view>
+            </el-main>
+          </el-container>
         </el-container>
       </el-container>
-    </el-container>
-    <el-footer height="80" class="dw-footer-container"><dw-footer></dw-footer></el-footer>
+      <el-footer height="80" class="dw-footer-container"><dw-footer></dw-footer></el-footer>
     </el-container>
   </div>
 </template>
-
 <script>
 
 import DwHeader from '@/components/layouts/DwHeader.vue'

+ 0 - 2
src/views/dw-survey/dw-data/DwSurveyAnswerInfo.vue

@@ -176,8 +176,6 @@ export default {
                     break
                   }
                 }
-              }  else if (quType==='UPLOADFILE') {
-
               }
             }
           }

+ 6 - 3
src/views/dw-survey/dw-data/DwSurveyAnswerQuCommon.vue

@@ -38,8 +38,8 @@
             </el-form-item>
           </div>
           <div v-if="question.quType === 'UPLOADFILE'">
-            <div v-for="(item,index) in question.anUplodFiles" :key="item.id" >
-              <a :href="process.env.DW_API_URL+item.filePath">{{item.fileName}}</a>
+            <div v-for="(item) in question.anUplodFiles" :key="item.id" >
+              <a :href="`${dwResourceUrl}${item.filePath}`" target="_blank">{{ item.fileName }}</a>
             </div>
           </div>
         </div>
@@ -96,10 +96,13 @@ export default {
         value: '选项5',
         label: '北京烤鸭'
       }],
-      value: ''
+      value: '',
+      dwResourceUrl: ''
     }
   },
   mounted () {
+    console.debug(process.env.DW_RESOURCE_URL)
+    this.dwResourceUrl = process.env.DW_RESOURCE_URL
   },
   methods: {
     goBack () {

+ 18 - 18
src/views/dw-survey/dw-data/DwsurveyChartsCommon.vue

@@ -5,10 +5,10 @@
       <span v-html="question.quTitle" ></span>
       <span>【{{ question.quTypeName }}】</span>
     </div>
-    <div v-if="question.quType === 'FILLBLANK'" style="padding: 30px;">
+    <div v-if="question.quType === 'FILLBLANK' || question.quType === 'UPLOADFILE'" style="padding: 30px;">
       填写回答:{{ question.anCount }} 份
     </div>
-    <div v-if="question.quType !== 'FILLBLANK'">
+    <div v-if="question.quType !== 'FILLBLANK' && question.quType !== 'UPLOADFILE'">
       <el-table
         :data="question.quStatOptions"
         style="width: 100%">
@@ -52,22 +52,22 @@
           <template slot-scope="scope">{{ scope.row.anCount }} 次</template>
         </el-table-column>
       </el-table>
-    </div>
-    <div v-if="question.quType !=='FILLBLANK'">
-      <el-tabs v-model="activeName" style="width: 100%;" @tab-click="handleClick" >
-        <el-tab-pane label="柱状图" name="bar">
-          <div class="dwsurveyMain" style="width: 100%;height:400px;" ></div>
-        </el-tab-pane>
-        <el-tab-pane label="拆线图" name="line">
-          <div class="dwsurveyMain" style="width: 100%;height:400px;" ></div>
-        </el-tab-pane>
-        <el-tab-pane label="拼状图" name="pie">
-          <div class="dwsurveyMain" style="width: 100%;height:400px;" ></div>
-        </el-tab-pane>
-        <el-tab-pane label="条形图" name="barY">
-          <div class="dwsurveyMain" style="width: 100%;height:400px;" ></div>
-        </el-tab-pane>
-      </el-tabs>
+      <div>
+        <el-tabs v-model="activeName" style="width: 100%;" @tab-click="handleClick" >
+          <el-tab-pane label="柱状图" name="bar">
+            <div class="dwsurveyMain" style="width: 100%;height:400px;" ></div>
+          </el-tab-pane>
+          <el-tab-pane label="拆线图" name="line">
+            <div class="dwsurveyMain" style="width: 100%;height:400px;" ></div>
+          </el-tab-pane>
+          <el-tab-pane label="拼状图" name="pie">
+            <div class="dwsurveyMain" style="width: 100%;height:400px;" ></div>
+          </el-tab-pane>
+          <el-tab-pane label="条形图" name="barY">
+            <div class="dwsurveyMain" style="width: 100%;height:400px;" ></div>
+          </el-tab-pane>
+        </el-tabs>
+      </div>
     </div>
   </div>
 </template>