From 1772fc5e211f9e9e0ab4cdc6c29b436aac178c2a Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期五, 23 二月 2024 12:19:55 +0800
Subject: [PATCH] 修改

---
 web/src/views/modules/configItemChange/configItemList.vue |   70 ++++++++++++++++++++++++++++++++--
 1 files changed, 65 insertions(+), 5 deletions(-)

diff --git a/web/src/views/modules/configItemChange/configItemList.vue b/web/src/views/modules/configItemChange/configItemList.vue
index 12e6888..ce12b11 100644
--- a/web/src/views/modules/configItemChange/configItemList.vue
+++ b/web/src/views/modules/configItemChange/configItemList.vue
@@ -31,32 +31,51 @@
                           clearable></zt-dict>
               </template>
             </el-table-column>
+            <el-table-column  label="鎿嶄綔" width="120" align="center">
+              <template v-slot="{ row }">
+                <zt-table-button size="small" v-show="isPreview(row)" type="primary"
+                                 @click="preview(row)">棰勮
+                </zt-table-button>
+                <zt-table-button size="small" v-show="isDownload(row)" type="primary"
+                                 @click="download(row)">涓嬭浇
+                </zt-table-button>
+              </template>
+            </el-table-column>
           </el-table>
         </zt-table-wraper>
       </div>
     </el-card>
+    <Preview ref="view" :pageMarkerfun="ConfigItemList"></Preview>
   </zt-dialog>
 </template>
 
 <script>
+  import Preview from "@/views/pages/view.vue";
 export default {
   name: 'configItem-list',
   data() {
     return {
-      pageCode:'',
+      ConfigItemList: 'ConfigItemList',
       dataForm: {
         ids:null,
         projectId:'',
+        pageCode:'',
         configChangeList:[],
-        remarkList:[]
+        remarkList:[],
+        configOutboundList:[]
       }
     }
   },
+  components: {
+    Preview
+  },
   methods: {
-    init(projectId,ids) {
+    init(projectId,param) {
+      console.log(projectId,param,'init projectId,ids,pageCode')
       this.dataForm.projectId = projectId
-       this.dataForm.ids = ids
-      console.log(this.dataForm,'this.dataForm.id')
+      this.dataForm.ids = param.ids
+      this.dataForm.pageCode =param.pageCode
+      console.log(param.pageCode,'init pageCode')
       this.$nextTick(()=>{
         this.$refs.tableObj.query()
       })
@@ -70,13 +89,54 @@
     changeRow(selection){
       this.dataForm.configChangeList = selection
       this.dataForm.remarkList = selection
+      this.dataForm.configOutboundList = selection
       console.log(this.dataForm.configChangeList,'this.dataForm.checkList 閫変腑鐨勫垪琛ㄦ暟鎹�')
+    },
+    isPreview(row) {
+      if (row.files!=null) {
+        if (row.files.groups[0].fields[0].files[0]) {
+          let fileName = row.files.groups[0].fields[0].files[0].name
+          let suffixName = ''
+          if (fileName != null) {
+            let arr = fileName.split('.')
+            suffixName = arr[arr.length - 1].toLowerCase()
+          }
+          if (suffixName == 'pdf' || suffixName == 'doc' || suffixName == 'docx' || suffixName == 'jpg' || suffixName == 'jpeg' || suffixName == 'png' || suffixName == 'xls' || suffixName == 'xlsx') {
+            return true
+          } else {
+            return false
+          }
+        } else {
+          return false
+        }
+      }
+    },
+    isDownload(row) {
+      if (row.files!=null) {
+        if (row.files.groups[0].fields[0].files[0]) {
+          return true
+        } else {
+          return false
+        }
+      }
+    },
+    preview(row) {
+      this.$refs.view.openAccessoryFormatByForm(row)
+    },
+    download(row) {
+      if (row.files!=null) {
+        if (row.files.groups[0].fields[0].files[0]) {
+          let url = row.files.groups[0].fields[0].files[0].url;
+          window.location.href = `${url}`
+        }
+      }
     },
     async formSubmit(){
       console.log(this.dataForm,'this.dataForm')
       this.$emit('getChangeItemList',this.dataForm)
       await this.$tip.success()
       this.$refs.dialog.close()
+      this.$emit('refreshDataList')
     }
   },
 }

--
Gitblit v1.9.1