From f97351a6f1fdc679f4956030d179dca843bbeb0c Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期四, 27 十一月 2025 14:09:04 +0800
Subject: [PATCH] 审批界面增加pdf,图片预览功能

---
 src/views/wel/gongkong.vue |   76 +++++++++++++++++++++++++++++++++++---
 1 files changed, 70 insertions(+), 6 deletions(-)

diff --git a/src/views/wel/gongkong.vue b/src/views/wel/gongkong.vue
index 1d39320..fc42c9f 100644
--- a/src/views/wel/gongkong.vue
+++ b/src/views/wel/gongkong.vue
@@ -39,12 +39,13 @@
         <el-table-column prop="name" label="鍚嶇О"/>
 		    <el-table-column prop="fileModifyTime" label="鍒涘缓鏃ユ湡"  width="160"/>
         <el-table-column prop="fileModifyTime" label="淇敼鏃ユ湡"   width="160"/>
-        <el-table-column prop="fileSizeDisplay" label="澶у皬" width="80"/>
+        <el-table-column prop="fileSizeDisplay" label="澶у皬" width="100"/>
         <el-table-column fixed="right" label="鎿嶄綔" min-width="110">
           <template #default="scope">
             <el-button link type="primary" size="small" @click="fileView(scope.row)">鏌ョ湅</el-button>
-            <el-button link type="primary" size="small" @click="fileEdit(scope.row)">缂栬緫</el-button>
-            <el-button type="primary" text size="small" @click.stop="viewHistory(scope.row, scope.index)">淇敼璁板綍</el-button>
+            <el-button link type="primary" v-if="scope.row.dirType!='PROGRAM'" size="small" @click="fileEdit(scope.row)">缂栬緫</el-button>
+            <el-button type="primary" v-if="scope.row.dirType!='PROGRAM'" text size="small" @click.stop="viewHistory(scope.row, scope.index)">淇敼璁板綍</el-button>
+            <el-button type="primary" v-if="scope.row.dirType=='SEND'" text size="small" @click.stop="changeName(scope.row)">閲嶅懡鍚�</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -80,12 +81,20 @@
             <code-diff :old-string="this.content1" :new-string="this.content2" output-format="side-by-side" :hideStat="true" :filename="codeDiffFileName1" :newFilename="codeDiffFileName2"/>
         </div>
     </el-drawer>
+
+    <el-dialog title="淇敼鏂囦欢鍚�" width="400" append-to-body v-model="changeNameModel">
+       <avue-form :option="changeNameOption" v-model="changeNameForm" @submit="changeNameSubmit">
+        
+       </avue-form>
+     
+    </el-dialog>
 </template>
 <script>
 import {
   getFileChangeList
 } from '@/api/wel/changehis';
 import { pageHeaderEmits } from 'element-plus';
+import qs from 'qs';
 export default {
   name: 'OrganizationTree',
   components: {},
@@ -96,6 +105,19 @@
       filterData: [], // 杩囨护鍚庣殑鏁版嵁
       activeNode: null,
 
+      changeNameModel:false,
+      changeNameForm : {},
+      changeNameOption:{
+        labelWidth:80,
+        size:'mini',
+        column:[
+          {
+            span:22,
+            label:'鏂囦欢鍚�',
+            prop:"name"
+          }
+        ]
+      },
       defaultKeys: [],
       fileOptionTitle: "",
       fileContent: "",
@@ -209,7 +231,11 @@
     },
     fileView(row) {
       this.fileOptionTitle = "鏌ョ湅";
-      this.getFileContent(row);
+      if(row.dirType != 'PROGRAM'){
+        this.getFileContent(row);
+      }else{
+        this.getProgramDirFileContent(row);
+      }
     },
     fileEdit(row) {
       this.fileOptionTitle = "缂栬緫";
@@ -217,12 +243,36 @@
       this.getFileContent(row);
     },
     viewHistory(row){
-      console.log(row);
       this.viewHisModel = true;
       this.queryHis.machineFileId = row.id;
       this.onLoadHis();
     },
 
+    changeName(row){
+      //alert(row.id)
+      this.changeNameForm.id = row.id;
+      this.changeNameForm.name = row.name;
+      this.changeNameModel = true;
+    },
+    changeNameSubmit(form,done){
+      axios.post('/blade-mdm/gkw/node/change-file-name',qs.stringify(form)).then(res=>{
+          if (res.data.code == 200) {
+            this.$message.success('鎿嶄綔鎴愬姛!姝e湪澶勭悊鏂囦欢锛岃绋嶅悗鍒锋柊鏌ョ湅銆�');
+            this.changeNameModel = false;
+          } else {
+              this.$message({ type: 'error', message: res.data.msg });
+          }
+      }).catch(error => {
+          this.$message.error(res.data.msg );
+      }).finally(() => {
+        // 涓嶇鎴愬姛杩樻槸澶辫触锛岄兘寤惰繜 1 绉掑悗鍒锋柊鍒楄〃
+        setTimeout(() => {
+          this.searchTable(this.TreeNode)
+        }, 5000); // 1000 姣 = 1 绉�
+      });;
+     
+       done();
+    },
     searchChangeHis(params, done) {
       let data = {}
       console.log(params)
@@ -252,7 +302,7 @@
     },
     hisCompare(row){
         //鏂囦欢姣斿
-        this.loading = true;
+      this.loading = true;
       axios({
         url: '/blade-mdm/gkw/node/his-compare',
         method: 'get',
@@ -282,6 +332,20 @@
         }
       );
     },
+    getProgramDirFileContent(row) {
+      this.loading = true;
+      axios({
+        url: '/blade-mdm/ossfile/file-content',
+        method: 'get',
+        params: {ossFileName:row.ossName},
+      }).then(
+        res => {
+          this.loading = false;
+          this.fileDialogVisible = true;
+          this.fileContent = res.data.data;
+        }
+      );
+    },
     onQuery() {
       this.size = 10;
       this.searchTable(this.TreeNode);

--
Gitblit v1.9.3