Jelajahi Sumber

支部园地风采附件、支部园地宣传附件

Wang Zi Wen 1 tahun lalu
induk
melakukan
b904925c4d

+ 111 - 1
ruoyi-ui/src/views/branch/zbfc/demeanor/index.vue

@@ -105,6 +105,17 @@
           </el-button>
         </template>
       </el-table-column>
+      <el-table-column label="附件" align="center" prop="filesId" width="100" fixed="right">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-folder"
+            @click="openFileDialog2(scope.row)"
+          >查看附件
+          </el-button>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" fixed="right" width="240" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -269,6 +280,55 @@
         </el-table-column>
       </el-table>
     </el-dialog>
+    <!-- 附件详情对话框 -->
+    <el-dialog title="附件详情" :visible.sync="file2.open" width="60%" append-to-body>
+      <el-row :gutter="10" class="mb8">
+        <el-col :span="1.5">
+          <el-upload
+            ref="doc2"
+            :headers="doc2.headers"
+            :action="doc2.url+'?tableName=branchDem2&tableId=' + doc2.tableId"
+            :disabled="doc2.isUploading"
+            :on-progress="handleFileDocProgress2"
+            :on-success="handleFileDocSuccess2"
+            :auto-upload="true"
+            :file-list="file2.fileList"
+          >
+            <el-button type="primary"><i class="el-icon-upload"></i> 点击上传</el-button>
+          </el-upload>
+        </el-col>
+      </el-row>
+      <el-table :data="file2.dataList">
+        <el-table-column label="附件名称" align="center">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-document"
+              @click="handleSee(scope.row.url)">
+              {{ scope.row.name }}
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column label="上传人" align="center" prop="creater"/>
+        <el-table-column label="上传时间" align="center" prop="createdate">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDeleteFile2(scope.row.id)"
+            >删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
   </div>
 </template>
 
@@ -287,6 +347,26 @@ export default {
   // components: { Editor },
   data() {
     return {
+      file2: {
+        id: null,
+        open: false,
+        fileList: [],
+        dataList: [],
+      },
+      doc2: {
+        file: "",
+        // 是否显示弹出层(报告附件)
+        open: false,
+        // 弹出层标题(报告附件)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 设置上传的请求头部
+        headers: {Authorization: "Bearer " + getToken()},
+        tableId: 0,
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/branch/file/uploadFile",
+      },
       file: {
         id: null,
         open: false,
@@ -383,6 +463,37 @@ export default {
     this.getTreeselect();
   },
   methods: {
+    //附件上传中处理
+    handleFileDocProgress2(event, file, fileList) {
+      this.doc2.file = file;
+    },
+    //附件上传成功处理
+    handleFileDocSuccess2(response, file, fileList) {
+      this.$modal.msgSuccess("上传成功");
+      this.getFileList2();
+    },
+    openFileDialog2(row) {
+      this.file2.open = true;
+      this.doc2.tableId = row.demeanorId;
+      this.getFileList2();
+    },
+    getFileList2() {
+      listFile({tableId: this.doc2.tableId, tableName: 'branchDem2'}).then(res => {
+        this.file2.dataList = res.data
+      })
+    },
+    handleDeleteFile2(id) {
+      this.$confirm('是否确认删除?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return delFile(id);
+      }).then(() => {
+        this.getFileList2();
+        this.msgSuccess("删除成功");
+      })
+    },
     //附件上传中处理
     handleFileDocProgress(event, file, fileList) {
       this.doc.file = file;
@@ -397,7 +508,6 @@ export default {
       window.open(process.env.VUE_APP_BASE_API + url);
     },
     openFileDialog(row) {
-      console.log(row)
       this.file.open = true;
       this.doc.tableId = row.demeanorId;
       this.getFileList();

+ 112 - 1
ruoyi-ui/src/views/branch/zbfc/publicize/index.vue

@@ -94,7 +94,7 @@
           <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="封面图片" align="center" prop="filesId" width="100">
+      <el-table-column label="封面图片" align="center" prop="filesId" width="100" fixed="right">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -105,6 +105,17 @@
           </el-button>
         </template>
       </el-table-column>
+      <el-table-column label="附件" align="center" prop="filesId" width="100" fixed="right">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-folder"
+            @click="openFileDialog2(scope.row)"
+          >查看附件
+          </el-button>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" fixed="right" width="240" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -269,6 +280,55 @@
         </el-table-column>
       </el-table>
     </el-dialog>
+    <!-- 附件详情对话框 -->
+    <el-dialog title="附件详情" :visible.sync="file2.open" width="60%" append-to-body>
+      <el-row :gutter="10" class="mb8">
+        <el-col :span="1.5">
+          <el-upload
+            ref="doc2"
+            :headers="doc2.headers"
+            :action="doc2.url+'?tableName=branchPub2&tableId=' + doc2.tableId"
+            :disabled="doc2.isUploading"
+            :on-progress="handleFileDocProgress2"
+            :on-success="handleFileDocSuccess2"
+            :auto-upload="true"
+            :file-list="file2.fileList"
+          >
+            <el-button type="primary"><i class="el-icon-upload"></i> 点击上传</el-button>
+          </el-upload>
+        </el-col>
+      </el-row>
+      <el-table :data="file2.dataList">
+        <el-table-column label="附件名称" align="center">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-document"
+              @click="handleSee(scope.row.url)">
+              {{ scope.row.name }}
+            </el-button>
+          </template>
+        </el-table-column>
+        <el-table-column label="上传人" align="center" prop="creater"/>
+        <el-table-column label="上传时间" align="center" prop="createdate">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDeleteFile2(scope.row.id)"
+            >删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
   </div>
 </template>
 
@@ -287,6 +347,26 @@ export default {
   // components: { Editor },
   data() {
     return {
+      file2: {
+        id: null,
+        open: false,
+        fileList: [],
+        dataList: [],
+      },
+      doc2: {
+        file: "",
+        // 是否显示弹出层(报告附件)
+        open: false,
+        // 弹出层标题(报告附件)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 设置上传的请求头部
+        headers: {Authorization: "Bearer " + getToken()},
+        tableId: 0,
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/branch/file/uploadFile",
+      },
       file: {
         id: null,
         open: false,
@@ -383,6 +463,37 @@ export default {
     this.getTreeselect();
   },
   methods: {
+    //附件上传中处理
+    handleFileDocProgress2(event, file, fileList) {
+      this.doc2.file = file;
+    },
+    //附件上传成功处理
+    handleFileDocSuccess2(response, file, fileList) {
+      this.$modal.msgSuccess("上传成功");
+      this.getFileList2();
+    },
+    openFileDialog2(row) {
+      this.file2.open = true;
+      this.doc2.tableId = row.publicizeId;
+      this.getFileList2();
+    },
+    getFileList2() {
+      listFile({tableId: this.doc2.tableId, tableName: 'branchPub2'}).then(res => {
+        this.file2.dataList = res.data
+      })
+    },
+    handleDeleteFile2(id) {
+      this.$confirm('是否确认删除?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return delFile(id);
+      }).then(() => {
+        this.getFileList2();
+        this.msgSuccess("删除成功");
+      })
+    },
     //附件上传中处理
     handleFileDocProgress(event, file, fileList) {
       this.doc.file = file;