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) { async function getemployeeAssessmentList(ctx) {
try { try {
const { models } = ctx.fs.dc; const { models } = ctx.fs.dc;
const { limit, page, year,month } = ctx.query; const { limit, page, year, month } = ctx.query;
const { type } = ctx.params; const { type } = ctx.params;
let rlst = []; let rlst = [];
const findObj = { const findObj = {
order: [["year", "desc"],["month", "desc"]], order: [["year", "desc"], ["month", "desc"]],
where:{} where: {}
}; };
if (Number(limit) > 0 && Number(page) >= 0) { if (Number(limit) > 0 && Number(page) >= 0) {
findObj.limit = Number(limit); findObj.limit = Number(limit);
findObj.offset = Number(page) * Number(limit); findObj.offset = Number(page) * Number(limit);
} }
if (year && month) { if (year && month) {
findObj.where.year = year; findObj.where.year = year;
findObj.where.month = month; findObj.where.month = month;
} }
if (type) { if (type) {
findObj.where.type = type; findObj.where.type = type;
} }
rlst = await models.PerformanceAll.findAndCountAll(findObj); rlst = await models.PerformanceAll.findAndCountAll(findObj);
ctx.status = 200; ctx.status = 200;
ctx.body = rlst; ctx.body = rlst;
} catch (err) { } catch (err) {

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save