longyvfengyun
2022-03-02 3262c2b455860102d40d4ece95b32d95ce676c4d
提交
1个文件已添加
5个文件已修改
179 ■■■■■ 已修改文件
src/assets/js/apis/userMager/operationRecord.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/PageHeader.vue 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/ProcessState.vue 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/singularDrawer.vue 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/login.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/apis/userMager/operationRecord.js
@@ -37,6 +37,29 @@
            url: 'User_logAction!analyzeData',
            data: null
        });
    }
    },
    /**
     * 获取异常事件
     * @returns {AxiosPromise}
     */
    unReadLog() {
        return axios({
            method: 'post',
            url: 'User_logAction!getUnread',
            data: null
        });
    },
    /**
     * 标记已读
     * @param value
     * @returns {AxiosPromise}
     */
    setToRead(value) {
        return axios({
            method: 'post',
            url: 'User_logAction!setToRead',
            data: 'json='+value
        });
    }
}
src/assets/js/config.js
@@ -64,6 +64,6 @@
    logCap: {
        label: "审计容量",
        des: "显示审计容量的健康度",
        value: false
        value: true
    }
};
src/components/PageHeader.vue
@@ -131,6 +131,14 @@
                  icon="el-icon-xinxi"
                  :state="logCountFlag"
                  :content="logCountMsg"></progress-state>
              <progress-state
                  v-if="isAudit"
                  icon="el-icon-icon-sms"
                  :state="0"
                  content="异常通知"
                  :value="singularNum"
                  show-badge
                  @handleClick="showSingularDrawer"></progress-state>
            </div>
<!--            <weather-component-->
<!--              v-if="weatherState"-->
@@ -247,6 +255,13 @@
    >
      <pifu-list></pifu-list>
    </el-drawer>
    <el-drawer
      title="我是标题"
      :visible.sync="showSingular"
      size="640px"
      :with-header="false">
      <singular-drawer v-if="showSingular"></singular-drawer>
    </el-drawer>
    <!-- 密码修改 -->
    <el-dialog
      title="密码修改"
@@ -296,10 +311,12 @@
import WeatherComponent from "@/components/weatherComponent";
import BMapTools from "@/assets/js/tools/BMapTools";
import getScreenUrl from "@/assets/js/tools/getScreenUrl";
import SingularDrawer from "@/components/singularDrawer";
export default {
  bMapTools: new BMapTools(BMap),
  components: {
    SingularDrawer,
    WeatherComponent,
    HdwBadgeBtn,
    ProgressState,
@@ -309,7 +326,10 @@
  },
  data() {
    let platformName = sessionStorage.getItem("platformName");
    let userId = sessionStorage.getItem("userId");
    return {
      userId: userId,
      alarmAlertStatus: false,
      skinActive: "science-blue",
      logoConfig: platform.logo,
@@ -411,6 +431,8 @@
        city: "",
        district: "",
      },
      showSingular: false,
      singularNum: 0,
    };
  },
  methods: {
@@ -462,7 +484,8 @@
      }
      this.timer2.start(()=>{
        this.$axios.all([
            this.logUseCount()
            this.logUseCount(),
            this.unReadLog(),
        ]).then(res=>{
          this.timer2.open();
        }).catch(error=>{
@@ -485,6 +508,14 @@
      }).catch(error=>{
        console.log(error);
      });
    },
    unReadLog(){
      if(this.isAudit) {
        this.$apis.userMager.operationRecord.unReadLog().then(res=>{
          let rs = JSON.parse(res.data.result);
          this.singularNum = rs.data.length;
        }).catch(error => {});
      }
    },
    startSearch() {
      this.timer.start(() => {
@@ -1182,6 +1213,9 @@
        this.$store.dispatch('user/changeRealTabsConfig', []);
      })
    },
    showSingularDrawer() {
      this.showSingular = true;
    }
  },
  computed: {
    processAlarmMsg() {
@@ -1302,6 +1336,14 @@
      }
      return image;
    },
    isAudit() {
      let userId = this.userId;
      if(userId == 2) {
        return true;
      }else {
        return false;
      }
    }
  },
  created() {
    this.skinActive = localStorage.getItem("activeSkin");
src/components/ProcessState.vue
@@ -1,7 +1,10 @@
<template>
    <el-tooltip :class="stateName" effect="dark" :content="content" placement="bottom">
        <div class="statusWarp" @click="handleClick">
            <i class="iconfont" :class="icon"></i>
      <el-badge :value="value" :max="99" class="item" v-if="showBadge">
        <i class="iconfont" :class="icon"></i>
      </el-badge>
      <i class="iconfont" :class="icon" v-else></i>
        </div>
    </el-tooltip>
</template>
@@ -20,13 +23,21 @@
            content: {
                type: String,
                default: '未知'
            }
            },
      showBadge: {
        type: Boolean,
        default: false
      },
      value: {
        type: [String, Number],
        default: 0
      },
        },
        methods: {
            handleClick() {
                this.$emit('handleClick')
            }
        },
    methods: {
        handleClick() {
            this.$emit('handleClick')
        }
    },
        computed: {
            stateName() {
                let result = '';
@@ -42,7 +53,7 @@
                        break;
                }
                return result;
            }
            },
        }
    }
</script>
src/components/singularDrawer.vue
New file
@@ -0,0 +1,77 @@
<template>
  <flex-layout>
    <el-table
        stripe
        size="small"
        :data="list"
        height="100%">
      <el-table-column
          v-for="header in headers"
          :key="header.prop"
          :prop="header.prop"
          :label="header.label"
          :width="header.width"
          :min-width="header.minWidth"
          align="center"
          show-overflow-tooltip
      ></el-table-column>
    </el-table>
  </flex-layout>
</template>
<script>
export default {
  name: "singularDrawer",
  data() {
    return {
      headers: [
        {
          prop: "UName",
          label: "异常来源",
          width: 120,
        },
        {
          prop: "uOprateMsg",
          label: "异常信息",
          minWidth: 220,
        },
        {
          prop: "uOprateDay",
          label: "异常日期",
          width: 180,
        },
      ],
      list: [],
    }
  },
  methods: {
    unReadLog(){
      let loading = this.$layer.loading();
      this.$apis.userMager.operationRecord.unReadLog().then(res=>{
        this.$layer.close(loading);
        let rs = JSON.parse(res.data.result);
        let data = [];
        if(rs.code == 1) {
          data = rs.data.map(item=>{
            return {
              UName: item.uinf.UName,
              uOprateMsg: item.ulog.uOprateMsg,
              uOprateDay: item.ulog.uOprateDay
            };
          });
        }
        this.list = data;
      }).catch(error => {
        this.$layer.close(loading);
      });
    },
  },
  mounted() {
    this.unReadLog();
  }
}
</script>
<style scoped>
</style>
src/pages/login.vue
@@ -787,10 +787,10 @@
        this.init();
      }
    });
    console.log(AES.encrypt("123456"));
    //console.log(AES.encrypt("123456"));
    // console.log(encodeURIComponent("B17jjjYoBkbfZChw/fHzcA=="));
    // console.log(decodeURIComponent("B17jjjYoBkbfZChw%2FfHzcA%3D%3D"))
    console.log(AES.decrypt("AWylOpV7qDVaFsqLE/YXXg=="));
    //console.log(AES.decrypt("AWylOpV7qDVaFsqLE/YXXg=="));
    // console.log(md5("a123456"));
    // console.log(JSON.stringify("5OUaEnC33sVNY+jeXlx3Qg=="));
  },