Browse Source

(*)整理代码格式

master
ww664853070 2 years ago
parent
commit
e5b82a61b3
  1. 34
      api/app/lib/controllers/employeeAssessment/index.js
  2. 4
      web/client/src/sections/humanAffairs/containers/highMonthly.jsx
  3. 4
      web/client/src/sections/humanAffairs/containers/highQuarter.jsx
  4. 4
      web/client/src/sections/humanAffairs/containers/monthlyProcess.jsx
  5. 4
      web/client/src/sections/humanAffairs/containers/quarter.jsx
  6. 2
      web/client/src/sections/humanAffairs/containers/regularKPI.jsx

34
api/app/lib/controllers/employeeAssessment/index.js

@ -11,25 +11,25 @@ const moment = require('moment')
async function getemployeeAssessmentList(ctx) {
try {
const { models } = ctx.fs.dc;
const { limit, page, year,month } = ctx.query;
const { limit, page, year, month } = ctx.query;
const { type } = ctx.params;
let rlst = [];
const findObj = {
order: [["year", "desc"],["month", "desc"]],
where:{}
};
if (Number(limit) > 0 && Number(page) >= 0) {
findObj.limit = Number(limit);
findObj.offset = Number(page) * Number(limit);
}
if (year && month) {
findObj.where.year = year;
findObj.where.month = month;
}
if (type) {
findObj.where.type = type;
}
rlst = await models.PerformanceAll.findAndCountAll(findObj);
const findObj = {
order: [["year", "desc"], ["month", "desc"]],
where: {}
};
if (Number(limit) > 0 && Number(page) >= 0) {
findObj.limit = Number(limit);
findObj.offset = Number(page) * Number(limit);
}
if (year && month) {
findObj.where.year = year;
findObj.where.month = month;
}
if (type) {
findObj.where.type = type;
}
rlst = await models.PerformanceAll.findAndCountAll(findObj);
ctx.status = 200;
ctx.body = rlst;
} catch (err) {

4
web/client/src/sections/humanAffairs/containers/highMonthly.jsx

@ -1,6 +1,6 @@
import React, { useEffect, useState, useMemo } from 'react';
import { connect } from 'react-redux';
import { Table, Pagination, Skeleton, DatePicker,Button } from '@douyinfe/semi-ui';
import { Table, Pagination, Skeleton, DatePicker, Button } from '@douyinfe/semi-ui';
import { SkeletonScreen } from "$components";
import '../style.less'
import moment from 'moment'
@ -19,7 +19,7 @@ const HighMonthly = (props) => {
function getList() {
dispatch(getemployeeAssessmentList(query, 4))
}
function exportReport(url){
function exportReport(url) {
setDownloadUrl(`/_file-server${url}`);
setDownloadKey(Math.random());
}

4
web/client/src/sections/humanAffairs/containers/highQuarter.jsx

@ -1,6 +1,6 @@
import React, { useEffect, useState, useMemo } from 'react';
import { connect } from 'react-redux';
import { Table, Pagination, Skeleton, DatePicker,Button } from '@douyinfe/semi-ui';
import { Table, Pagination, Skeleton, DatePicker, Button } from '@douyinfe/semi-ui';
import { SkeletonScreen } from "$components";
import '../style.less'
import moment from 'moment'
@ -19,7 +19,7 @@ const HighQuarter = (props) => {
function getList() {
dispatch(getemployeeAssessmentList(query, 5))
}
function exportReport(url){
function exportReport(url) {
setDownloadUrl(`/_file-server${url}`);
setDownloadKey(Math.random());
}

4
web/client/src/sections/humanAffairs/containers/monthlyProcess.jsx

@ -1,6 +1,6 @@
import React, { useEffect, useState, useMemo } from 'react';
import { connect } from 'react-redux';
import { Table, Pagination, Skeleton, DatePicker,Button } from '@douyinfe/semi-ui';
import { Table, Pagination, Skeleton, DatePicker, Button } from '@douyinfe/semi-ui';
import { SkeletonScreen } from "$components";
import '../style.less'
import moment from 'moment'
@ -19,7 +19,7 @@ const MonthlyProcess = (props) => {
function getList() {
dispatch(getemployeeAssessmentList(query, 2))
}
function exportReport(url){
function exportReport(url) {
setDownloadUrl(`/_file-server${url}`);
setDownloadKey(Math.random());
}

4
web/client/src/sections/humanAffairs/containers/quarter.jsx

@ -1,6 +1,6 @@
import React, { useEffect, useState, useMemo } from 'react';
import { connect } from 'react-redux';
import { Table, Pagination, Skeleton, DatePicker,Button } from '@douyinfe/semi-ui';
import { Table, Pagination, Skeleton, DatePicker, Button } from '@douyinfe/semi-ui';
import { SkeletonScreen } from "$components";
import '../style.less'
import moment from 'moment'
@ -19,7 +19,7 @@ const Quarter = (props) => {
function getList() {
dispatch(getemployeeAssessmentList(query, 3))
}
function exportReport(url){
function exportReport(url) {
setDownloadUrl(`/_file-server${url}`);
setDownloadKey(Math.random());
}

2
web/client/src/sections/humanAffairs/containers/regularKPI.jsx

@ -19,7 +19,7 @@ const RegularKPI = (props) => {
function getList() {
dispatch(getemployeeAssessmentList(query, 1))
}
function exportReport(url){
function exportReport(url) {
setDownloadUrl(`/_file-server${url}`);
setDownloadKey(Math.random());
}

Loading…
Cancel
Save