yuanyiming 2 gadi atpakaļ
vecāks
revīzija
5001329518

+ 1 - 1
src/views/firm.vue

@@ -157,7 +157,7 @@ export default {
     //展示文件
     checkFile(url) {
       if (
-        url.split(".")[f.split(".").length - 1].toLocaleUpperCase() == "PDF"
+        url.split(".")[url.split(".").length - 1].toLocaleUpperCase() == "PDF"
       ) {
         this.showFileUrl = url;
         this.showFileType = 1;

+ 106 - 19
src/views/projectManage/ProjectManagement4.vue

@@ -64,18 +64,31 @@
         <el-table-column
           prop="operation"
           align="center"
-
           label="操作"
           >
           <template #default="scope">
               <div class="operations">
-                      <el-button type="primary" class="bt1" size="mini" @click="lookDetails(scope.rows.id)" style="background: #477edd">详情查看</el-button>
+                      <el-button type="primary" class="bt1" size="mini" @click="checkFile(scope.row.url)" style="background: #477edd">详情查看</el-button>
               </div>
           </template>
         </el-table-column>
         </el-table>
         <!-- 表格结束 -->
-
+      <!-- 展示文档开始 -->
+      <el-dialog
+            title="展示文件"
+            :visible.sync="showFile"
+            width="80vw"
+            class="addDialog showDialog"
+          >
+      <div class="addDialogLogo">LOGO</div>
+      <div class="showFileArea">
+        <!-- <vpdf v-if="/^\s*$/g.test(showFileUrl)&&showFileUrl.split('.')[showFileUrl.split('.').length-1]=='pdf'" :pdfUrl="showFileUrl"></vpdf> -->
+        <vword v-if="showFileType == 0" :pdfUrl="showFileUrl"></vword>
+        <vpdf v-else :pdfUrl="showFileUrl"></vpdf>
+      </div>
+    </el-dialog>
+    <!-- 展示文档结束 -->
         <!-- 分页 -->
         <el-pagination
             @current-change="handleCurrentChange"
@@ -92,9 +105,10 @@
   
   <script>
   import beUpload from '../../components/tool/beUpload'
-
+  import vpdf from "@/components/vpdf.vue";
+  import vword from "@/components/vword.vue";
       export default {
-        components:{beUpload},
+        components: { beUpload, vpdf, vword },
         data() {
           return {
           accept:".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
@@ -103,10 +117,28 @@
               packageSize:8,
               currentPage:1
             }, 
+            showFile:false,
+            showFileType: 0,
+            showFileUrl: "",
             tableData:[],
           }
         },
         methods:{
+          //展示文件
+          checkFile(url) {
+            console.log(url);
+            if (
+              url.split(".")[url.split(".").length - 1].toLocaleUpperCase() == "PDF"
+            ) {
+              this.showFileUrl = url;
+              this.showFileType = 1;
+            } else {
+              this.showFileUrl =
+                "https://view.officeapps.live.com/op/view.aspx?src=" + url;
+              this.showFileType = 0;
+            }
+            this.showFile = true;
+          },
           getFile(val) {    //上传文件
             this.file = val;
             let oldData = [];
@@ -149,7 +181,7 @@
               this.ajax
                     .get(this.$store.state.api+'/SelectProjectFile',param)
                     .then(res=>{
-                      // console.log(res.data);
+                      // console.log(res.data[0]);
                       let k=[]
                       res.data[0].forEach((e,i) => {
                         // console.log(e);
@@ -157,6 +189,7 @@
                         // console.log(l);
                         k=JSON.parse(l)
                       });
+                      console.log(k);
                       // console.log(k);
                       this.tableData=k
                     },err=>{
@@ -200,22 +233,76 @@
       margin: 20px 55px 10px;
     }
   
-
-   
-    .pm1Tit{
-        display: flex;
-        margin-left: 20px;
-        div{
-          width: 130px;
-          cursor: pointer;
-          font-weight: 550;
+    .addDialog {
+        font-size: 18px;
+        .el-dialog {
+          border-radius: 5px;
+          overflow: hidden;
         }
-        .pr1TitBass{
-          height: 2px;
+        .deleteContent {
           width: 100%;
-          background: #3D67BC;
+          margin: 30px 0;
+          font-size: 22px;
+          color: #000;
         }
-    }
+        .addDialogLogo {
+          width: 60px;
+          height: 30px;
+          line-height: 30px;
+          background: #f2f2f2;
+          position: absolute;
+          display: flex;
+          justify-content: center;
+          left: 20px;
+          top: 15px;
+        }
+        .el-dialog__header {
+          display: flex;
+          justify-content: center;
+          background: #32455b;
+        }
+        .el-dialog__title {
+          color: #fff;
+          font-size: 22px;
+        }
+        .addDialogMid {
+          box-sizing: border-box;
+          padding: 0 60px 0 10px;
+          .addDialogTit {
+            display: flex;
+            span {
+              width: 80px;
+              font-size: 16px;
+              line-height: 40px;
+              text-align: left;
+            }
+          }
+          .addDialogTit1 {
+            display: flex;
+            justify-content: space-between;
+            margin-bottom: 15px;
+          }
+          .addDialogTit2 {
+            margin-top: 10px;
+            font-size: 16px;
+            color: #000;
+            text-indent: 2em;
+          }
+          .addDialogCon {
+            margin-top: 20px;
+          }
+        }
+        .dialog-footer {
+          display: flex;
+          justify-content: center;
+          box-sizing: border-box;
+          .btn5 {
+            font-size: 16px;
+          }
+        }
+      }
+   
+    
     .pmInp{
       width: 100%;
       display: flex;

+ 104 - 5
src/views/projectManage/ProjectManagement5.vue

@@ -70,13 +70,26 @@
           >
           <template #default="scope">
               <div class="operations">
-                      <el-button type="primary"  size="mini" @click="detail(scope.rows.id)" style="background: #477edd">明细查看</el-button>
+                      <el-button type="primary"  size="mini" @click="checkFile(scope.row.url)" style="background: #477edd">明细查看</el-button>
               </div>
           </template>
         </el-table-column>
         </el-table>
 
-
+      <!-- 展示文档开始 -->
+      <el-dialog
+            title="展示文件"
+            :visible.sync="showFile"
+            width="80vw"
+            class="addDialog showDialog"
+          >
+      <div class="addDialogLogo">LOGO</div>
+      <div class="showFileArea">
+        <!-- <vpdf v-if="/^\s*$/g.test(showFileUrl)&&showFileUrl.split('.')[showFileUrl.split('.').length-1]=='pdf'" :pdfUrl="showFileUrl"></vpdf> -->
+        <vword v-if="showFileType == 0" :pdfUrl="showFileUrl"></vword>
+        <vpdf v-else :pdfUrl="showFileUrl"></vpdf>
+      </div>
+    </el-dialog>
       <!-- 分页 -->
       <el-pagination
             @current-change="handleCurrentChange"
@@ -94,9 +107,10 @@
   
   <script>
   import beUpload from '../../components/tool/beUpload'
-
+  import vpdf from "@/components/vpdf.vue";
+  import vword from "@/components/vword.vue";
       export default {
-        components:{beUpload},
+        components: { beUpload, vpdf, vword },
         data() {
           return {
           accept:".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
@@ -105,12 +119,30 @@
               packageSize:8,
               currentPage:1
             }, 
+            showFile:false,
+            showFileType: 0,
+            showFileUrl: "",
             title:"",
             tableData:[],  //附件列表
             file:''
           }
         },
         methods:{
+          //展示文件
+          checkFile(url) {
+              console.log(url);
+              if (
+                url.split(".")[url.split(".").length - 1].toLocaleUpperCase() == "PDF"
+              ) {
+                this.showFileUrl = url;
+                this.showFileType = 1;
+              } else {
+                this.showFileUrl =
+                  "https://view.officeapps.live.com/op/view.aspx?src=" + url;
+                this.showFileType = 0;
+              }
+              this.showFile = true;
+          },
           getFile(val) {    //上传文件
             this.file = val;
             let oldData = [];
@@ -207,7 +239,74 @@
       float: right;
       margin: 20px 55px 10px;
     }
-  
+    .addDialog {
+        font-size: 18px;
+        .el-dialog {
+          border-radius: 5px;
+          overflow: hidden;
+        }
+        .deleteContent {
+          width: 100%;
+          margin: 30px 0;
+          font-size: 22px;
+          color: #000;
+        }
+        .addDialogLogo {
+          width: 60px;
+          height: 30px;
+          line-height: 30px;
+          background: #f2f2f2;
+          position: absolute;
+          display: flex;
+          justify-content: center;
+          left: 20px;
+          top: 15px;
+        }
+        .el-dialog__header {
+          display: flex;
+          justify-content: center;
+          background: #32455b;
+        }
+        .el-dialog__title {
+          color: #fff;
+          font-size: 22px;
+        }
+        .addDialogMid {
+          box-sizing: border-box;
+          padding: 0 60px 0 10px;
+          .addDialogTit {
+            display: flex;
+            span {
+              width: 80px;
+              font-size: 16px;
+              line-height: 40px;
+              text-align: left;
+            }
+          }
+          .addDialogTit1 {
+            display: flex;
+            justify-content: space-between;
+            margin-bottom: 15px;
+          }
+          .addDialogTit2 {
+            margin-top: 10px;
+            font-size: 16px;
+            color: #000;
+            text-indent: 2em;
+          }
+          .addDialogCon {
+            margin-top: 20px;
+          }
+        }
+        .dialog-footer {
+          display: flex;
+          justify-content: center;
+          box-sizing: border-box;
+          .btn5 {
+            font-size: 16px;
+          }
+        }
+      }
 
     .pm5footer{
         float: right;