weicd
2023-12-25 5157aa440389882a8010b37e3a87c2afc5113b75
首页图不显示,剩余时间修改
5 files modified
431 ■■■■■ changed files
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceLeaveServiceImpl.java 3 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java 4 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/treatment/service/impl/MeritWageServiceImpl.java 4 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/dashboard/PanelGroup.vue 178 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/home.vue 242 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceLeaveServiceImpl.java
@@ -457,8 +457,7 @@
            for (SysUserLevelOther sysUserLevelOther : sysUserLevelOtherList) {
                // 获取今年
                int year = Calendar.getInstance().get(Calendar.YEAR);
                String df = sysUserLevelOther.getYearMonth().substring(0,4);
                if (sysUserLevelOther.getYearMonth().substring(0,4).equals(String.valueOf(year))) {
                if (!sysUserLevelOther.getYearMonth().isEmpty() && sysUserLevelOther.getYearMonth().substring(0,4).equals(String.valueOf(year))) {
                    //年假总时长
                    Double yearTime = Double.valueOf(sysUserLevelOther.getAnnualLeaveDays() == null ? 0 : sysUserLevelOther.getAnnualLeaveDays() * 8);
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java
@@ -376,7 +376,7 @@
//        c.add(Calendar.MONTH, 0);
//        c.set(Calendar.DAY_OF_MONTH, 1);
//        String todayMonth = df.format(c.getTime());
        String nextMonth_ = df.format(new Date(nextMonth));
        String nextMonth_ = df.format(new Date(nextMonth)).substring(0,7) + "-01";
        Calendar cal = Calendar.getInstance();
        cal.setTime(df.parse(nextMonth_));
        cal.add(Calendar.MONTH, 1);
@@ -384,7 +384,7 @@
        String nextMonthFirstDay = df.format(cal.getTime());
        List<TaskDaliyMongo> daliyMongoList;
        try {
//            daliyMongoList = mongoTemplate.find(Query.query(new Criteria("userId").is(SecurityUtils.getCurrentUserId()).and("fillDate").gte(new SimpleDateFormat("yyyy-MM-dd").parse(todayMonth)).lte(new SimpleDateFormat("yyyy-MM-dd").parse(nextMonth_))), TaskDaliyMongo.class);
//            daliyMongoList = mongoTemplate.find(Query.query(new Criteria("userId").is(SecurityUtils.getCurrentUserId()).and("fillDate").gte(new SimpleDateFormat("yyyy-MM-dd").parse(nextMonth_)).lt(new SimpleDateFormat("yyyy-MM-dd").parse(nextMonthFirstDay))), TaskDaliyMongo.class);
            daliyMongoList = mongoTemplate.find(Query.query(new Criteria("userId").is(SecurityUtils.getCurrentUserId()).and("fillDate").gte(new SimpleDateFormat("yyyy-MM-dd").parse(nextMonth_)).lt(new SimpleDateFormat("yyyy-MM-dd").parse(nextMonthFirstDay))), TaskDaliyMongo.class);
        } catch (ParseException e) {
            throw new RuntimeException(e);
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/treatment/service/impl/MeritWageServiceImpl.java
@@ -189,7 +189,9 @@
        MeritWage meritWage = meritWageRepository.findByLevelId(user.getLevelId());
        List<MeritLevel> meritLevelList = meritLevelRepository.findByMeritWageId(meritWage.getId());
        NewSalaryQueryCriteria newSalaryQueryCriteria = new NewSalaryQueryCriteria();
        newSalaryQueryCriteria.setTargetYearMonth(new SimpleDateFormat("yyyy-MM").format(new Date(Long.parseLong(targetYearMonth))));
//        newSalaryQueryCriteria.setTargetYearMonth(new SimpleDateFormat("yyyy-MM").format(new Date(Long.parseLong(targetYearMonth))));
        newSalaryQueryCriteria.setTargetYearMonth(new SimpleDateFormat("yyyy-MM").format(new Date(Long.parseLong(targetYearMonth))) + "-01");
        newSalaryQueryCriteria.setUserId(user.getId());
        Integer workDays = newSalaryService.queryWorkDays(newSalaryQueryCriteria);
        Map<String, String> map = new HashMap<>();
        for (int i = 0; i < meritLevelList.size(); i++) {
eladmin-web-master/src/views/dashboard/PanelGroup.vue
@@ -9,7 +9,12 @@
          <div class="card-panel-text">
            出勤天数
          </div>
          <count-to :start-val="0" :end-val="userInfo.onDutyDays" :duration="2600" class="card-panel-num" />
          <count-to
            :start-val="0"
            :end-val="userInfo.onDutyDays"
            :duration="2600"
            class="card-panel-num"
          />
        </div>
      </div>
    </el-col>
@@ -22,7 +27,13 @@
          <div class="card-panel-text">
            剩余年假(小时)
          </div>
          <count-to :start-val="0" :end-val="userInfo.annualLeave" :duration="3000" :decimals="2" class="card-panel-num" />
          <count-to
            :start-val="0"
            :end-val="userInfo.annualLeave"
            :duration="3000"
            :decimals="2"
            class="card-panel-num"
          />
        </div>
      </div>
    </el-col>
@@ -35,7 +46,12 @@
          <div class="card-panel-text">
            剩余补卡次数
          </div>
          <count-to :start-val="0" :end-val="userInfo.cardLeft" :duration="3600" class="card-panel-num" />
          <count-to
            :start-val="0"
            :end-val="userInfo.cardLeft"
            :duration="3600"
            class="card-panel-num"
          />
        </div>
      </div>
    </el-col>
@@ -48,9 +64,20 @@
          <div class="card-panel-text">
            当前工作时长
          </div>
          <count-to :start-val="0" :end-val="userInfo.Times" :decimals="2" :duration="3600" class="card-panel-num" />
          <count-to
            :start-val="0"
            :end-val="userInfo.Times"
            :decimals="2"
            :duration="3600"
            class="card-panel-num"
          />
          <span class="card-panel-texts">/</span>
          <count-to :start-val="0" :end-val="userInfo.Time" :duration="3600" class="card-panel-num" />
          <count-to
            :start-val="0"
            :end-val="userInfo.Time"
            :duration="3600"
            class="card-panel-num"
          />
        </div>
      </div>
    </el-col>
@@ -64,9 +91,21 @@
          <div class="card-panel-text">
            当月绩效时长
          </div>
          <count-to :start-val="0" :end-val="userInfo.achievementsTime" :decimals="2" :duration="3600" class="card-panel-num" />
          <count-to
            :start-val="0"
            :end-val="userInfo.achievementsTime"
            :decimals="2"
            :duration="3600"
            class="card-panel-num"
          />
        </div>
        <el-button type="success" style="position: absolute;bottom: 4%;right: 1%;width: 60px;height: 27px;display: flex;background-color: #40c9c6;border-color: #40c9c6;align-items: center;justify-content: center;" round @click="changeVisible">详细绩效</el-button>
        <el-button
          type="success"
          style="position: absolute;bottom: 4%;right: 1%;width: 60px;height: 27px;display: flex;background-color: #40c9c6;border-color: #40c9c6;align-items: center;justify-content: center;"
          round
          @click="changeVisible"
          >详细绩效</el-button
        >
      </div>
      <!-- </el-tooltip> -->
    </el-col>
@@ -94,9 +133,11 @@
            :title="'⏳' + meritWageList[0]"
            suffix="工时"
          />
          <br>
          <br />
          <div style="display: flex;justify-content: center">
            <span v-if="meritWageList[0] !== undefined">完成可获得{{ meritWageList[3] }}💰</span>
            <span v-if="meritWageList[0] !== undefined"
              >完成可获得{{ meritWageList[3] }}💰</span
            >
          </div>
        </div>
        <div style="width: 100%;padding-top: 30px;">
@@ -114,9 +155,9 @@
</template>
<script>
import CountTo from 'vue-count-to'
import crudUser from '@/api/system/user'
import * as echarts from 'echarts'
import CountTo from "vue-count-to";
import crudUser from "@/api/system/user";
import * as echarts from "echarts";
export default {
  components: {
    CountTo
@@ -134,90 +175,103 @@
  data() {
    return {
      centerDialogVisible: false
    }
    };
  },
  methods: {
    handleSetLineChartData(type) {
      this.$emit('handleSetLineChartData', type)
      this.$emit("handleSetLineChartData", type);
    },
    changeVisible() {
      this.centerDialogVisible = true
      this.centerDialogVisible = true;
    },
    showPerformanceDetail() {
      if (this.meritWageList[2] == undefined) {
        setTimeout(() => {
          this.showPerformanceDetailo()
        }, 3500)
          this.showPerformanceDetailo();
        }, 3500);
      } else {
        this.showPerformanceDetailo()
        this.showPerformanceDetailo();
      }
    },
    showPerformanceDetailo() {
      // 查看当前用户这个月参与和完成了那些任务?并且其中那些任务的任务工时是在任务的绩效时间中的,那些超出
      crudUser.getPerformanceDetail(this.meritWageList[2]).then(res => {
        var dom = document.getElementById('container')
        var dom = document.getElementById("container");
        var myChart = echarts.init(dom, null, {
          renderer: 'canvas',
          renderer: "canvas",
          useDirtyRect: false
        })
        var option
        });
        var option;
        option = {
          tooltip: {
            trigger: 'item'
            trigger: "item"
          },
          legend: {
            top: '1%',
            left: 'center'
            top: "1%",
            left: "center"
          },
          series: [
            {
              name: '当月完成工时',
              type: 'pie',
              radius: ['40%', '70%'],
              center: ['50%', '60%'],
              name: "当月完成工时",
              type: "pie",
              radius: ["40%", "70%"],
              center: ["50%", "60%"],
              avoidLabelOverlap: false,
              itemStyle: {
                borderRadius: 10,
                borderColor: '#fff',
                borderColor: "#fff",
                borderWidth: 2
              },
              label: {
                formatter: function(params) {
                  var result = '{a|' + params.name + '}' + '\n{hr|}\n\n'
                  result += '{b|任务总消耗:' + params.value + '工时\t\t}' + '{per|' + params.percent + '%}' + '\n{hr|}\n\n'
                  var result = "{a|" + params.name + "}" + "\n{hr|}\n\n";
                  result +=
                    "{b|任务总消耗:" +
                    params.value +
                    "工时\t\t}" +
                    "{per|" +
                    params.percent +
                    "%}" +
                    "\n{hr|}\n\n";
                  // return params.data.list[0].'任务1';
                  for (let i = 0; i < params.data.list.length; i++) {
                    result += '{b|\t' + Object.keys(params.data.list[i]) + ':\t' + Object.values(params.data.list[i]) + '工时\t}' + '\n{hr|}\n\n'
                    result +=
                      "{b|\t" +
                      Object.keys(params.data.list[i]) +
                      ":\t" +
                      Object.values(params.data.list[i]) +
                      "工时\t}" +
                      "\n{hr|}\n\n";
                  }
                  return result
                  return result;
                },
                show: true,
                position: 'outside',
                backgroundColor: '#F6F8FC',
                borderColor: '#8C8D8E',
                position: "outside",
                backgroundColor: "#F6F8FC",
                borderColor: "#8C8D8E",
                borderWidth: 1,
                borderRadius: 4,
                rich: {
                  a: {
                    color: '#6E7079',
                    color: "#6E7079",
                    lineHeight: 22,
                    align: 'center'
                    align: "center"
                  },
                  hr: {
                    borderColor: '#8C8D8E',
                    width: '100%',
                    borderColor: "#8C8D8E",
                    width: "100%",
                    borderWidth: 1,
                    height: 0
                  },
                  b: {
                    color: '#4C5058',
                    color: "#4C5058",
                    fontSize: 14,
                    fontWeight: 'bold',
                    fontWeight: "bold",
                    lineHeight: 33
                  },
                  per: {
                    color: '#fff',
                    backgroundColor: '#4C5058',
                    color: "#fff",
                    backgroundColor: "#4C5058",
                    padding: [3, 4],
                    borderRadius: 4
                  }
@@ -227,7 +281,7 @@
                label: {
                  show: true,
                  fontSize: 15,
                  fontWeight: 'bold'
                  fontWeight: "bold"
                }
              },
              labelLine: {
@@ -236,18 +290,18 @@
              data: []
            }
          ]
        }
        option.series[0].data = []
        option.series[0].data = res
        if (option && typeof option === 'object') {
          myChart.setOption(option)
        };
        option.series[0].data = [];
        option.series[0].data = res;
        if (option && typeof option === "object") {
          myChart.setOption(option);
        }
        window.addEventListener('resize', myChart.resize)
      })
        window.addEventListener("resize", myChart.resize);
      });
    }
  }
}
};
</script>
<style lang="scss" scoped>
@@ -266,8 +320,8 @@
    overflow: hidden;
    color: #666;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);
    box-shadow: 4px 4px 40px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.05);
    &:hover {
      .card-panel-icon-wrapper {
@@ -283,11 +337,11 @@
      }
      .icon-permission {
        background: #34bfa3
        background: #34bfa3;
      }
      .icon-timings{
        background:#f4516c
      .icon-timings {
        background: #f4516c;
      }
    }
@@ -300,7 +354,7 @@
    }
    .icon-permission {
      color: #34bfa3
      color: #34bfa3;
    }
    .card-panel-icon-wrapper {
@@ -329,8 +383,8 @@
        margin-bottom: 12px;
      }
      .card-panel-texts{
         font-size: 20px;
      .card-panel-texts {
        font-size: 20px;
      }
      .card-panel-num {
eladmin-web-master/src/views/home.vue
@@ -1,7 +1,11 @@
<template>
  <div class="dashboard-container">
    <div class="dashboard-editor-container">
      <panel-group :user-info="userInfo" :merit-wage-list="meritWageList" @handleSetLineChartData="handleSetLineChartData" />
      <panel-group
        :user-info="userInfo"
        :merit-wage-list="meritWageList"
        @handleSetLineChartData="handleSetLineChartData"
      />
      <el-row style="background: #fff; padding: 16px;">
        <FullCalendar ref="fullCalendar" :options="calendarOptions" />
      </el-row>
@@ -10,15 +14,15 @@
</template>
<script>
import crudUser from '@/api/system/user'
import PanelGroup from './dashboard/PanelGroup'
import '@fullcalendar/core/vdom'
import FullCalendar from '@fullcalendar/vue'
import dayGridPlugin from '@fullcalendar/daygrid'
import interactionPlugin from '@fullcalendar/interaction'
import timeGridPlugin from '@fullcalendar/timegrid'
import crudMeritWage from '@/api/treatment/meritWage'
import moment from 'moment'
import crudUser from "@/api/system/user";
import PanelGroup from "./dashboard/PanelGroup";
import "@fullcalendar/core/vdom";
import FullCalendar from "@fullcalendar/vue";
import dayGridPlugin from "@fullcalendar/daygrid";
import interactionPlugin from "@fullcalendar/interaction";
import timeGridPlugin from "@fullcalendar/timegrid";
import crudMeritWage from "@/api/treatment/meritWage";
import moment from "moment";
const lineChartData = {
  // newVisitis: {
@@ -37,10 +41,10 @@
  //   expectedData: [130, 140, 141, 142, 145, 150, 160],
  //   actualData: [120, 82, 91, 154, 162, 140, 130]
  // }
}
};
export default {
  name: 'Dashboard',
  name: "Dashboard",
  components: {
    PanelGroup,
    FullCalendar
@@ -53,43 +57,43 @@
        plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
        // 日历头部按钮位置
        headerToolbar: {
          left: '',
          center: 'title',
          right: 'prev,today,next'
          left: "",
          center: "title",
          right: "prev,today,next"
        },
        // 日历头部按钮中文转换
        buttonText: {
          today: '今天',
          month: '月',
          week: '周',
          day: '天'
          today: "今天",
          month: "月",
          week: "周",
          day: "天"
        },
        initialView: 'dayGridMonth',
        locale: 'zh-ch',
        firstDay: '1',
        weekNumberCalculation: 'ISO',
        eventColor: '#3d8eec',
        timeGridEventMinHeight: '20',
        aspectRatio: '1.5',
        initialView: "dayGridMonth",
        locale: "zh-ch",
        firstDay: "1",
        weekNumberCalculation: "ISO",
        eventColor: "#3d8eec",
        timeGridEventMinHeight: "20",
        aspectRatio: "1.5",
        displayEventTime: false,
        allDaySlot: false,
        eventLimit: true,
        fixedWeekCount: false,
        eventTimeFormat: {
          hour: 'numeric',
          minute: '2-digit',
          hour: "numeric",
          minute: "2-digit",
          hour12: false
        },
        slotLabelFormat: {
          hour: '2-digit',
          minute: '2-digit',
          hour: "2-digit",
          minute: "2-digit",
          meridiem: false,
          hour12: false
        },
        businessHours: {
          dow: [1, 2, 3, 4, 5],
          start: '9:00',
          end: '18:00'
          start: "9:00",
          end: "18:00"
        },
        events: [],
        // 事件
@@ -109,22 +113,22 @@
        eventClick: this.handleEventClick, // 点击日程触发
        eventDrop: this.handleEventDrop,
        eventResize: this.eventResize,
        height: 'auto',
        height: "auto",
        customButtons: {
          prev: {
            click: () => {
              this.monthClick('prev')
              this.monthClick("prev");
            }
          },
          today: {
            text: '今天',
            text: "今天",
            click: () => {
              this.monthClick('')
              this.monthClick("");
            }
          },
          next: {
            click: () => {
              this.monthClick('next')
              this.monthClick("next");
            }
          }
        }
@@ -133,62 +137,78 @@
      meritWageList: [],
      // 年月
      yearMonth: new Date()
    }
    };
  },
  mounted() {
    this.monthClick('')
    this.getUserBaseInfo()
    this.monthClick("");
    this.getUserBaseInfo();
  },
  methods: {
    handleSetLineChartData(type) {
      this.lineChartData = lineChartData[type]
      this.lineChartData = lineChartData[type];
    },
    // 箭头点击事件
    monthClick(type) {
      const calendarApi = this.$refs['fullCalendar'].getApi()
      if (type === 'prev') {
        calendarApi.prev()
      } else if (type === 'next') {
        calendarApi.next()
      const calendarApi = this.$refs["fullCalendar"].getApi();
      if (type === "prev") {
        calendarApi.prev();
      } else if (type === "next") {
        calendarApi.next();
      } else {
        calendarApi.today()
        calendarApi.today();
      }
      // this.calendarOptions.events = [{title: '上班打卡时间', color: 'red',start: '2023-01-28',date: '2023-01-28'}]
      this.yearMonth = moment(calendarApi.view.currentStart).toString()
      console.log('变化变化:' + this.yearMonth)
      this.yearMonthChange()
      this.getUserCalendarInfo(moment(calendarApi.view.currentStart).format('YYYY-MM-DD').toString())
      // this.yearMonth = moment(calendarApi.view.currentStart).toString();
      let date = moment(calendarApi.view.currentStart).toDate();
      date.setMonth(date.getMonth() + 1);
      date.setDate(0);
      date.setHours(23, 59, 59, 999);
      this.yearMonth = date
      console.log("变化变化:" + this.yearMonth);
      this.yearMonthChange();
      this.getUserCalendarInfo(
        moment(calendarApi.view.currentStart)
          .format("YYYY-MM-DD")
          .toString()
      );
    },
    // 获取打卡信息
    getUserCalendarInfo(month) {
      crudUser.getUserCalendarInfo(month).then(res => {
        console.log('res', res)
        this.calendarOptions.events = res.map(function(obj) {
          // obj.start = obj.date
          obj.color = obj.isOk ? 'green' : 'red'
          // obj.date1 = obj.date
          return obj
      crudUser
        .getUserCalendarInfo(month)
        .then(res => {
          console.log("res", res);
          this.calendarOptions.events = res.map(function(obj) {
            // obj.start = obj.date
            obj.color = obj.isOk ? "green" : "red";
            // obj.date1 = obj.date
            return obj;
          });
          setTimeout(() => {
            console.log(this.calendarOptions.events);
          }, 1000);
        })
        setTimeout(() => {
          console.log(this.calendarOptions.events)
        }, 1000)
      }).catch(() => {
        this.calendarOptions.events = []
      })
        .catch(() => {
          this.calendarOptions.events = [];
        });
    },
    // 日期点击
    handleDateClick(selectInfo) {
      console.log('handleDateClick.info:', selectInfo)
      console.log("handleDateClick.info:", selectInfo);
    },
    // 日程点击信息展示
    handleEventClick(info) {
      if (info.event._def.extendedProps.type === 1) {
        this.$router.push({
          path: '/attendance/attendance',
          path: "/attendance/attendance",
          query: { date: info.event._def.extendedProps.date1 }
        })
        });
      } else {
        this.$router.push({ path: '/task/taskDaliy', query: { date: info.event._def.extendedProps.date1 }})
        this.$router.push({
          path: "/task/taskDaliy",
          query: { date: info.event._def.extendedProps.date1 }
        });
      }
    },
    // 获取用户信息
@@ -199,57 +219,63 @@
      // if (dateStart.split('-')[1] > 12) {
      //   dateStart = date.getFullYear() + 1 + '-1-1'
      // }
      var dateObject = new Date(this.yearMonth)
      console.log("this.yearMonthd:" + this.yearMonth)
      var dateObject = new Date(this.yearMonth);
      crudUser.getUserBaseInfo(this.yearMonth).then(res => {
        this.userInfo = res
        this.meritWageList = []
        crudMeritWage.getMeritWageDetail(this.userInfo.achievementsTime, new Date(this.yearMonth).getTime()).then(res => {
          for (var key in res) {
            this.meritWageList.push('距离' + key + '级业绩标准还有:')
            this.meritWageList.push(Number(res[key]))
            this.meritWageList.push(dateObject.getTime())
            this.meritWageList.push(res.money + '元')
          }
        })
      })
        this.userInfo = res;
        this.meritWageList = [];
        crudMeritWage
          .getMeritWageDetail(
            this.userInfo.achievementsTime,
            new Date(this.yearMonth).getTime()
          )
          .then(res => {
            for (var key in res) {
              this.meritWageList.push("距离" + key + "级业绩标准还有:");
              this.meritWageList.push(Number(res[key]));
              this.meritWageList.push(dateObject.getTime());
              this.meritWageList.push(res.money + "元");
            }
          });
      });
    },
    // 年月变更
    yearMonthChange() {
      // 获取用户信息
      this.getUserBaseInfo()
      this.getUserBaseInfo();
    }
  }
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
  .dashboard-editor-container {
    padding: 32px;
    background-color: rgb(240, 242, 245);
    position: relative;
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;
    .github-corner {
      position: absolute;
      top: 0;
      border: 0;
      right: 0;
    }
    .search-wrapper {
      text-align: right;
    }
    .chart-wrapper {
      background: #fff;
      padding: 16px 16px 0;
      margin-bottom: 32px;
      overflow: auto;
    }
  .github-corner {
    position: absolute;
    top: 0;
    border: 0;
    right: 0;
  }
  @media (max-width:1024px) {
    .chart-wrapper {
      padding: 8px;
    }
  .search-wrapper {
    text-align: right;
  }
  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
    overflow: auto;
  }
}
@media (max-width: 1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>