diff --git a/api/app/lib/controllers/employeeAssessment/index.js b/api/app/lib/controllers/employeeAssessment/index.js index 6bc420a..b7f42bb 100644 --- a/api/app/lib/controllers/employeeAssessment/index.js +++ b/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) { diff --git a/web/client/src/sections/humanAffairs/containers/highMonthly.jsx b/web/client/src/sections/humanAffairs/containers/highMonthly.jsx index f98992b..388887e 100644 --- a/web/client/src/sections/humanAffairs/containers/highMonthly.jsx +++ b/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()); } diff --git a/web/client/src/sections/humanAffairs/containers/highQuarter.jsx b/web/client/src/sections/humanAffairs/containers/highQuarter.jsx index 560cbd1..6e7803a 100644 --- a/web/client/src/sections/humanAffairs/containers/highQuarter.jsx +++ b/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()); } diff --git a/web/client/src/sections/humanAffairs/containers/monthlyProcess.jsx b/web/client/src/sections/humanAffairs/containers/monthlyProcess.jsx index 332f1ba..469925a 100644 --- a/web/client/src/sections/humanAffairs/containers/monthlyProcess.jsx +++ b/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()); } diff --git a/web/client/src/sections/humanAffairs/containers/quarter.jsx b/web/client/src/sections/humanAffairs/containers/quarter.jsx index d4489fa..baa560c 100644 --- a/web/client/src/sections/humanAffairs/containers/quarter.jsx +++ b/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()); } diff --git a/web/client/src/sections/humanAffairs/containers/regularKPI.jsx b/web/client/src/sections/humanAffairs/containers/regularKPI.jsx index 41d6be9..acdbef4 100644 --- a/web/client/src/sections/humanAffairs/containers/regularKPI.jsx +++ b/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()); }