whychdw
2022-02-10 5c738cf9f889d2f6da7c2fe1dd5bc143ed3547ae
内容提交
2个文件已添加
6个文件已修改
200 ■■■■■ 已修改文件
src/assets/js/apis/userMager/operationRecord.js 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/config.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/PageHeader.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/myCharts/NormalPie.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataTest/HistoryRealtimeData.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/login.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/userMager/dialog/logAnalyze.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/userMager/operationRecord.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/apis/userMager/operationRecord.js
@@ -14,5 +14,29 @@
            url: 'User_logAction!searchByCondition',
            data: 'json='+JSON.stringify(data)
        });
    },
    /**
     * 容量使用情况
     * @returns {AxiosPromise}
     */
    logUseCount() {
        return axios({
            method: 'post',
            url: 'User_logAction!count',
            data: null
        });
    },
    /**
     * 日志统计
     * @returns {AxiosPromise}
     */
    logAnalyze() {
        return axios({
            method: 'post',
            url: 'User_logAction!analyzeData',
            data: null
        });
    }
}
src/assets/js/config.js
@@ -3,7 +3,7 @@
        label: '平台logo',
        des: '显示平台logo状态',
        fileName: 'gjdw',       // gjdw, nfdw, gjdx, qwh
        value: true,
        value: false,
    },
    uKey: {
        label: 'uKey',
@@ -54,11 +54,11 @@
    messageCode: {
        label: '短信验证码',
        des: '登录是否启用短信验证码',
        value: false,
        value: true,
    },
    autoExit: {
        label: "自动退出",
        des: "长时间不操作自动退出",
        value: false
        value: true
    },
};
src/components/PageHeader.vue
@@ -126,6 +126,10 @@
                content="大屏展示管理"
                @handleClick="goToScreenManage"
              ></progress-state>
              <progress-state
                  icon="el-icon-xinxi"
                  :state="logCountFlag"
                  :content="logCountMsg"></progress-state>
            </div>
<!--            <weather-component-->
<!--              v-if="weatherState"-->
@@ -384,6 +388,9 @@
      },
      value: 0,
      timer: new Timeout(),
      timer2: new Timeout(),
      logCountFlag: 2,
      logCountMsg: "存储容量",
      pwd: {
        show: false,
      },
@@ -439,6 +446,33 @@
          this.$layer.msg("该功能暂未开放!");
          break;
      }
    },
    startLogUseCount() {
      this.timer2.start(()=>{
        this.$axios.all([
            this.logUseCount()
        ]).then(res=>{
          this.timer2.open();
        }).catch(error=>{
          this.timer2.open();
        });
      }, 1000*12);
    },
    logUseCount() {
      this.$apis.userMager.operationRecord.logUseCount().then(res=>{
        let rs = JSON.parse(res.data.result);
        if(rs.data<rs.data2) {
          this.logCountFlag = 1;
          this.logCountMsg = "存储容量健康";
        }else {
          this.logCountFlag = 0;
          this.logCountMsg = "存储容量越线";
        }
        // 设置提示文本
        this.logCountMsg = this.logCountMsg+":"+rs.data+"/"+rs.data2;
      }).catch(error=>{
        console.log(error);
      });
    },
    startSearch() {
      this.timer.start(() => {
@@ -1270,6 +1304,7 @@
  mounted() {
    // 启动请求
    this.startSearch();
    this.startLogUseCount();
    // 查询剩余天数
    this.getLicenseResTime();
@@ -1285,6 +1320,7 @@
  },
  destroyed() {
    this.timer.stop();
    this.timer2.stop();
  },
};
</script>
src/components/myCharts/NormalPie.vue
New file
@@ -0,0 +1,45 @@
<script>
import BaseChart from "./BaseChart";
export default {
  name: "NormalPie",
  extends: BaseChart,
  props: {
    unit: {
      type: String,
      default: "",
    }
  },
  data() {
    return {}
  },
  methods: {
    setData(data) {
      let option = this.getOption(data);
      this.setOption(option);
    },
    getOption(data) {
      let series = data && data.series?data.series:[{
        type: 'pie',
        radius: '65%',
        center: ['50%', '50%'],
        selectedMode: 'single',
        data: []
      }];
      return {
        animation: false,
        tooltip: {
          trigger: 'item',
        },
        legend: {
          bottom: 10,
          left: 'center',
        },
        series: series
      }
    }
  },
  mounted() {
    this.setData();
  }
}
</script>
src/pages/dataTest/HistoryRealtimeData.vue
@@ -284,11 +284,12 @@
            this.progress.value = Math.floor(index/times.length*100);
            // 查询历史实时数据
            searchHistoryRealtimeData(times[index]).then(res=>{
                var rs = JSON.parse(res.data.result);
                var data = [];
                let rs = JSON.parse(res.data.result);
                let data = [];
                if(rs.code == 1) {
                    data = rs.data;
                }
                console.log(data);
                // 初始化加载加载
                if(index == 0 || options.monTmpGraph.series.length == 0) {
                    // 格式化数据
src/pages/login.vue
@@ -479,6 +479,9 @@
      let rs = JSON.parse(res.data.result);
      if (rs.code == 1) {
        this.$message.success("登录成功");
        // 重置登录时间
        this.readSeconds = 0;
        sessionStorage.setItem("readSeconds", "0");
        if(phoneLogin) {
          sessionStorage.setItem("username", rs.msgN);
        }else {
@@ -757,7 +760,7 @@
    // console.log(AES.encrypt("sys_123456"));
    // console.log(encodeURIComponent("B17jjjYoBkbfZChw/fHzcA=="));
    // console.log(decodeURIComponent("B17jjjYoBkbfZChw%2FfHzcA%3D%3D"))
    //console.log(AES.decrypt("8zvkvkmP3SdzKW49GZSSXw=="));
    //console.log(AES.decrypt("BAaiESc qt58gWNITRtXWw=="));
    // console.log(md5("a123456"));
    // console.log(JSON.stringify("5OUaEnC33sVNY+jeXlx3Qg=="));
  },
src/pages/userMager/dialog/logAnalyze.vue
New file
@@ -0,0 +1,65 @@
<template>
  <div class="log-analyze">
    <flex-layout :loading="loading">
      <normal-pie ref="pie"></normal-pie>
    </flex-layout>
  </div>
</template>
<script>
import NormalPie from "@/components/myCharts/NormalPie";
export default {
  name: "logAnalyze",
  components: {
    NormalPie
  },
  data() {
    return {
      loading: false,
    }
  },
  methods: {
    logAnalyze() {
      this.loading = true;
      this.$apis.userMager.operationRecord.logAnalyze().then(res=>{
        this.loading = false;
        let rs = JSON.parse(res.data.result);
        let list = [];
        if(rs.code == 1) {
          let data = rs.data;
          Object.keys(data).forEach(key=>{
            console.log(key);
            list.push({
              value: data[key],
              name: key,
            })
          });
        }
        // 设置数据
        this.$refs.pie.setData({
          series: [{
            type: 'pie',
            radius: '65%',
            center: ['50%', '50%'],
            selectedMode: 'single',
            data: list
          }]
        })
      }).catch(error => {
        this.loading = false;
        console.log(error);
      });
    }
  },
  mounted() {
    this.logAnalyze();
  }
}
</script>
<style scoped>
.log-analyze {
  width: 960px;
  height: 500px;
}
</style>
src/pages/userMager/operationRecord.vue
@@ -53,6 +53,7 @@
            <div class="el-pagination-btns">
                <el-button type="primary" @click="queryData" round size="mini" icon="el-icon-search">查询</el-button>
                <el-button type="primary" round size="mini" icon="el-icon-wallet" @click="exportFile">导出</el-button>
                <el-button type="primary" round size="mini" icon="el-icon-s-marketing" @click="logAnalyzeDialog=true">事件统计</el-button>
            </div>
            <el-pagination size="mini" @size-change="handleSizeChange" @current-change="handleCurrentChange" 
            :current-page="formObj.currentPage" 
@@ -61,6 +62,16 @@
            layout="total, sizes, prev, pager, next, jumper"
            :total="totalNum"></el-pagination>
        </div>
      <el-dialog
        title="审计事件统计"
        width="auto"
        :visible.sync="logAnalyzeDialog"
        :close-on-click-modal="false"
        top="0"
        class="dialog-center no-bg"
        :modal-append-to-body="false">
        <log-analyze v-if="logAnalyzeDialog"></log-analyze>
      </el-dialog>
    </flex-layout>
</template>
@@ -70,6 +81,7 @@
import {
    export_json_to_excel
} from '../../assets/js/excel/Export2Excel.js'
import LogAnalyze from "@/pages/userMager/dialog/logAnalyze";
export default {
    data() {
        let thistime = new Date();
@@ -83,6 +95,7 @@
            userList:[],//列表数据
            czrxmList:[],
            czlxList:[],
            logAnalyzeDialog: false,
            formObj:{
                czrxm:"",
                czlx:0,
@@ -111,6 +124,7 @@
        }
    },
    components:{
      LogAnalyze
        
    },
    created() {