Przeglądaj źródła

liudongfang 3.14

liu85600613 3 lat temu
rodzic
commit
0588cf18da

+ 1 - 0
master/pom.xml

@@ -60,6 +60,7 @@
 			<scope>test</scope>
 		</dependency>
 
+
 		<!-- SpringBoot 拦截器 -->
 		<dependency>
 			<groupId>org.springframework.boot</groupId>

+ 2 - 0
master/src/main/java/com/ruoyi/project/aspen/controller/TDashboarddataController.java

@@ -1,6 +1,8 @@
 package com.ruoyi.project.aspen.controller;
 
 import java.util.List;
+
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;

+ 12 - 0
master/src/main/java/com/ruoyi/project/system/controller/SysUserNoticeController.java

@@ -2,6 +2,8 @@ package com.ruoyi.project.system.controller;
 
 import java.util.Date;
 import java.util.List;
+
+import com.ruoyi.project.common.domain.TCommonfile;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -97,4 +99,14 @@ public class SysUserNoticeController extends BaseController
     {
         return toAjax(sysUserNoticeService.deleteSysUserNoticeByIds(userIds));
     }*/
+
+//    /**
+//     * 查询通用附件列表
+//     */
+//    @GetMapping("/allFileList")
+//    public List<SysUserNotice> allFileList(SysUserNotice sysUserNotice)
+//    {
+//        List<SysUserNotice> list = sysUserNoticeService.selectAllFileList(sysUserNotice);
+//        return list;
+//    }
 }

+ 5 - 0
master/src/main/java/com/ruoyi/project/system/mapper/SysUserNoticeMapper.java

@@ -60,4 +60,9 @@ public interface SysUserNoticeMapper
      * @return 结果
      */
     public int deleteSysUserNoticeByIds(Long[] userIds);
+
+//    /**
+//     * 查询通用附件列表
+//     */
+//    List<SysUserNotice> selectAllFileList(SysUserNotice sysUserNotice);
 }

+ 7 - 0
master/src/main/java/com/ruoyi/project/system/service/ISysUserNoticeService.java

@@ -1,6 +1,8 @@
 package com.ruoyi.project.system.service;
 
 import java.util.List;
+
+import com.ruoyi.project.common.domain.TCommonfile;
 import com.ruoyi.project.system.domain.SysUserNotice;
 
 /**
@@ -58,4 +60,9 @@ public interface ISysUserNoticeService
      * @return 结果
      */
     public int deleteSysUserNoticeById(Long userId);
+
+//    /**
+//     * 查询通用附件列表
+//     */
+//    List<SysUserNotice> selectAllFileList(SysUserNotice sysUserNotice);
 }

+ 5 - 0
master/src/main/java/com/ruoyi/project/system/service/impl/SysUserNoticeServiceImpl.java

@@ -90,4 +90,9 @@ public class SysUserNoticeServiceImpl implements ISysUserNoticeService
     {
         return sysUserNoticeMapper.deleteSysUserNoticeById(userId);
     }
+
+//    @Override
+//    public List<SysUserNotice> selectAllFileList(SysUserNotice sysUserNotice) {
+//        return sysUserNoticeMapper.selectAllFileList(sysUserNotice);
+//    }
 }

+ 1 - 0
master/src/main/resources/mybatis/system/SysUserNoticeMapper.xml

@@ -46,5 +46,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
     </insert>
 
+
     
 </mapper>

+ 1 - 0
ui/src/api/system/notice.js

@@ -76,3 +76,4 @@ export function delNotice(noticeId) {
     method: 'delete'
   })
 }
+

+ 4 - 4
ui/src/views/ehs/fireapproval/index.vue

@@ -451,7 +451,7 @@ import {allFileList, delCommonfile} from "@/api/common/commonfile";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
 
 
 export default {
@@ -873,9 +873,9 @@ export default {
       this.doc.queryParams.pId = row.id
       this.doc.pId = row.id
       this.getFileList()
-      this.$nextTick(() => {
-        this.$refs.doc.clearFiles()
-      })
+      // this.$nextTick(() => {
+      //   this.$refs.doc.clearFiles()
+      // })
     },
     getFileList (){
       allFileList(this.doc.queryParams).then(response => {

+ 17 - 1
ui/src/views/front/bottomRight.vue

@@ -46,10 +46,26 @@ export default {
       }
     };
   },
+  watch:{
+    dashboarddata(dashboarddata){
+      //当a值变化时
+      this.config={
+        ...this.config,data:[
+          ["SS(HS)自产", dashboarddata.ssBcc, dashboarddata.ssSub, dashboarddata.ssEu, dashboarddata.ssPgu],
+          ["HHP", dashboarddata.hhpBcc, dashboarddata.hhpSub, "", ""],
+          ["HS", dashboarddata.hsBcc, dashboarddata.hsSub, dashboarddata.hsEu, dashboarddata.hsPgu],
+          ["MS", dashboarddata.msBcc, "", dashboarddata.msEu, dashboarddata.msPgu],
+          ["LS", dashboarddata.lsBcc, "", dashboarddata.lsEu, dashboarddata.lsPgu],
+          ["TOTAL", dashboarddata.totalBcc, "", dashboarddata.totalEu, ""],
+          ["总消耗", dashboarddata.zongBcc, "", dashboarddata.zongEu, dashboarddata.zongPgu]
+        ]
+      };
+    }
+  },
   components: {
   },
   mounted() {},
-  methods: {}
+  methods: {},
 };
 </script>
 

+ 2 - 1
ui/src/views/front/steamBalance.vue

@@ -52,7 +52,7 @@
 
         <div class="lu2-4">
           <img src="@/assets/steamImg/2.png" style="width:145px;height:35px">
-          <p class="word1-1">H520/230</p>
+          <p class="word1-1">H520/C230</p>
         </div>
 
          <div class="lu2-5">
@@ -208,6 +208,7 @@
           <p class="num">{{ dashboarddata.steamMsoutsctu }}</p>
         </div>
 
+
         <div class="jiantou18">
           <img src="@/assets/steamImg/jiantou3.png" style="width:8px;height:49px">
           <p class="num">{{ dashboarddata.steamMsouteer }}</p>

+ 0 - 1
ui/src/views/monitor/elec/bottomRight.vue

@@ -60,7 +60,6 @@ export default {
     bottomRightChart
   },
   mounted() {
-    console.log('我是周数据',this.weekData);
   },
   methods: {}
 };

+ 0 - 1
ui/src/views/monitor/elec/center.vue

@@ -241,7 +241,6 @@ export default {
   },
   mounted() {
     this.initChart();
-    console.log(150,this.dashboardelecdata.gtg1Lv)
   },
   methods: {
     initChart() {

+ 0 - 1
ui/src/views/monitor/elec/centerLeft1.vue

@@ -119,7 +119,6 @@ export default {
     this.initTwoChart();
     this.initThreeChart();
     this.initFourChart();
-    console.log('aaaa',this.monthData)
   },
   methods: {
     changeTiming() {

+ 0 - 1
ui/src/views/monitor/elec/centerRight1.vue

@@ -38,7 +38,6 @@ export default {
   mounted() {
     this.initBycChart();
     this.initBocChart();
-    console.log('我是49天数据',this.fiftydayData)
   },
   methods: {
     initBycChart() {

+ 14 - 14
ui/src/views/monitor/elec/index.vue

@@ -109,9 +109,10 @@
           <dv-border-box-12 style="width: 438px;height: 260px;">
             <bottom-energy :monthData = 'monthData'/>
           </dv-border-box-12>
-          <dv-border-box-12 style="width: 438px;height: 260px;">
-            <bottom-right :dashboarddata = 'dashboarddata'/>
-          </dv-border-box-12>
+            <dv-border-box-12 style="width: 438px;height: 260px;">
+              <bottom-right :dashboarddata = 'dashboarddata'/>
+            </dv-border-box-12>
+
         </div>
       </div>
     </div>
@@ -301,7 +302,8 @@
           outputBx: null,
           outputAnnual: null,
           instantaneous: null,
-          cumulative: null
+          cumulative: null,
+          steamHsoutklz:null
         },
         monthData: {
           dailyYixi: null,
@@ -349,19 +351,17 @@
       this.getMonthList()
       // 每隔30秒请求一次数据
       window.setInterval(() => {
-        setTimeout(() => {
           ///调取接口获取数据
           this.getList();
-        }, 0)
-      }, 20000)
+      }, 5000)
 
-      // 一天请求一次数据
-      window.setInterval(() => {
-        setTimeout(() => {
-          ///调取接口获取数据
-          this.getMonthList();
-        }, 0)
-      }, 1000 * 10 * 6 * 60 * 6)
+      // // 一天请求一次数据
+      // window.setInterval(() => {
+      //   setTimeout(() => {
+      //     ///调取接口获取数据
+      //     this.getMonthList();
+      //   }, 0)
+      // }, 1000 * 10 * 6 * 60 * 6)
     },
     beforeDestroy(){
       if(this.timer){

+ 205 - 2
ui/src/views/system/notice/index.vue

@@ -104,7 +104,7 @@
         </template>
       </el-table-column>
 
-      <el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
+      <el-table-column :label="$t('操作')" align="center" fixed="right" width="180" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -126,6 +126,13 @@
             @click="handleDelete(scope.row)"
             v-hasPermi="['system:notice:remove']"
           >{{ $t('删除') }}</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-document"
+            @click="handleDoc(scope.row)"
+            v-hasPermi="['system:notice:edit']"
+          >{{ $t('附件') }}</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -224,6 +231,73 @@
         </el-row>
       </el-form>
     </el-dialog>
+
+    <!-- 报告附件对话框 -->
+    <el-dialog v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="700px" append-to-body>
+      <el-upload
+        ref="doc"
+        :limit="50"
+        :headers="doc.headers"
+        :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
+        :disabled="doc.isUploading"
+        :on-progress="handleFileDocProgress"
+        :on-success="handleFileDocSuccess"
+        :auto-upload="true"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          {{ $t('将文件拖到此处,或') }}
+          <em>{{ $t('点击上传') }}</em>
+        </div>
+      </el-upload>
+      <el-table :data="doc.commonfileList" border>
+        <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <a  class="link-type"  @click="handleDownload(scope.row)">
+              <span>{{ scope.row.fileName }}</span>
+            </a>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
+        <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
+        <el-table-column :label="$t('操作')" align="center" width="150" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              v-if="scope.row.fileName.endsWith('pdf')"
+              size="mini"
+              type="text"
+              icon="el-icon-view"
+              @click="handleSee(scope.row)"
+            >{{ $t('预览') }}</el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-download"
+              @click="handleDownload(scope.row)"
+            >{{ $t('下载') }}</el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDeleteDoc(scope.row)"
+            >{{ $t('删除') }}</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-dialog v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px" append-to-body>
+        <div style="margin-top: -60px;float: right;margin-right: 40px;">
+          <el-button size="mini" type="text" @click="openPdf">{{$t('新页面打开PDF')}}</el-button></div>
+        <div style="margin-top: -30px">
+          <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
+        </div>
+      </el-dialog>
+      <div slot="footer" class="dialog-footer">
+        <!--        <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>-->
+        <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -238,6 +312,9 @@ import {
   listByUserId
 } from "@/api/system/notice";
 import Editor from '@/components/Editor';
+import {getToken} from "@/utils/auth";
+import {allFileList, delCommonfile} from "@/api/common/commonfile";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
 export default {
   name: "Notice",
@@ -293,9 +370,65 @@ export default {
           { required: true, message: this.$t('公告类型') + this.$t('不能为空'), trigger: "change" }
         ]
       },
+      // 报告附件参数
+      doc: {
+        file: "",
+        // 是否显示弹出层(报告附件)
+        open: false,
+        // 弹出层标题(报告附件)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 报告附件上传位置编号
+        ids: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
+        commonfileList: null,
+        queryParams: {
+          pId: null,
+          pType: 'notice'
+        },
+        pType: 'notice',
+        pId: null
+      },
+      pdf : {
+        title: '',
+        pdfUrl: '',
+        numPages: null,
+        open: false,
+        pageNum: 1,
+        pageTotalNum: 1,
+        loadedRatio: 0,
+      },
+      upload: {
+        //下载模板请求地址
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        //下载模板类型
+        type: "notice",
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/system/notice/importData"
+      },
     };
   },
   created() {
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = (document.body.clientHeight - 80) * 0.8
+    })
     this.getList();
     this.getDicts("sys_notice_status").then(response => {
       for (let i = 0; i < response.data.length; i++) {
@@ -365,6 +498,10 @@ export default {
       this.single = selection.length!=1
       this.multiple = !selection.length
     },
+    /** 下载模板操作 */
+    importTemplate() {
+      this.$refs['downloadFileForm'].submit()
+    },
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
@@ -432,7 +569,73 @@ export default {
           this.getList();
           this.msgSuccess(this.$t('删除成功'));
         })
-    }
+    },
+    /** 删除按钮操作 */
+    handleDeleteDoc(row) {
+      const ids = row.id || this.ids;
+      this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function() {
+        return delCommonfile(ids);
+      }).then(() => {
+        this.getFileList()
+        this.msgSuccess(this.$t('删除成功'));
+      })
+    },
+    //附件上传中处理
+    handleFileDocProgress(event, file, fileList) {
+      this.doc.file = file;
+      this.doc.isUploading = true;
+    },
+    //附件上传成功处理
+    handleFileDocSuccess(response, file, fileList) {
+      this.doc.isUploading = false;
+      this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
+      this.getFileList()
+    },
+
+    /** 报告附件按钮操作 */
+    handleDoc(row) {
+      this.doc.id = row.id;
+      this.doc.title = row.filename;
+      this.doc.open = true;
+      this.doc.queryParams.pId = row.id
+      this.doc.pId = row.id
+      this.getFileList()
+      this.$nextTick(() => {
+        this.$refs.doc.clearFiles()
+      });
+    },
+
+    // 文件下载处理
+    handleDownload(row) {
+      var name = row.fileName;
+      var url = row.fileUrl;
+      var suffix = url.substring(url.lastIndexOf("."), url.length);
+      const a = document.createElement('a')
+      a.setAttribute('download', name)
+      a.setAttribute('target', '_blank')
+      a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
+      a.click()
+    },
+
+    //pdf预览
+    openPdf(){
+      window.open(this.pdf.pdfUrl);//path是文件的全路径地址
+    },
+    handleSee (row){
+      this.pdf.open =true
+      this.pdf.title = row.fileName
+      this.pdf.pdfUrl = process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
+    },
+
+    getFileList (){
+      allFileList(this.doc.queryParams).then(response => {
+        this.doc.commonfileList = response;
+      });
+    },
   }
 };
 </script>