Compare commits

..

1 Commits

1020 changed files with 34500 additions and 110149 deletions

1
.gitignore vendored
View File

@ -1,5 +1,4 @@
node_modules node_modules
.idea .idea
.vscode .vscode
.package.json

3685
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +0,0 @@
{
"dependencies": {
"baidu-template-pro": "^1.0.0",
"dom-to-image": "^2.6.0",
"file-saver": "^2.0.5",
"lodash": "^4.17.21",
"orgchart": "^3.1.1",
"rc-org-chart": "^1.0.6",
"react-org-tree": "^1.0.0",
"react-orgchart": "^1.0.5",
"yargs": "^15.0.2"
}
}

View File

@ -0,0 +1,19 @@
import {
WeaTools
} from 'ecCom'
export const getHasRight = (params) => {
return WeaTools.callApi('/api/kq/settings/getHasRight', 'GET', params);
}
export const getRightMenu = (params) => {
return WeaTools.callApi('/api/kq/settings/getRightMenu', 'GET', params);
}
export const getSettingsForm = (params) => {
return WeaTools.callApi('/api/kq/settings/getSettingsForm', 'GET', params);
}
export const saveSettings = (params) => {
return WeaTools.callApi('/api/kq/settings/saveSettings', 'GET', params);
}

View File

@ -0,0 +1,10 @@
import {
WeaTools
} from 'ecCom';
export const getImportForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/schedulesignimport/getImportForm?is_multilang_set=true', 'GET', params)
export const importExternalData = (params = {}) => WeaTools.callApi('/api/hrm/kq/schedulesignimport/saveImport', 'POST', params)
export const getImportFormSet = (params = {}) => WeaTools.callApi('/api/hrm/kq/schedulesignimport/getImportSetForm', 'GET', params)
export const syncData = (params = {}) => WeaTools.callApi('/api/hrm/kq/schedulesignimport/synData', 'POST', params)
export const saveImportSet = (params = {}) => WeaTools.callApi('/api/hrm/kq/schedulesignimport/saveImportSet', 'POST', params)

View File

@ -0,0 +1,31 @@
import {
WeaTools
} from 'ecCom'
export const getHasRight = (params) => {
return WeaTools.callApi('/api/kq/reportshare/getHasRight', 'GET', params);
}
export const getRightMenu = (params) => {
return WeaTools.callApi('/api/kq/reportshare/getRightMenu', 'GET', params);
}
export const getSearchCondition = (params) => {
return WeaTools.callApi('/api/kq/reportshare/getSearchCondition', 'GET', params);
}
export const getSearchList = (params) => {
return WeaTools.callApi('/api/kq/reportshare/getSearchList', 'GET', params);
}
export const getReportShareForm = (params) => {
return WeaTools.callApi('/api/kq/reportshare/getReportShareForm', 'GET', params);
}
export const saveReportShare = (params) => {
return WeaTools.callApi('/api/kq/reportshare/saveReportShare', 'POST', params);
}
export const deleteReportShare = (params) => {
return WeaTools.callApi('/api/kq/reportshare/deleteReportShare', 'POST', params);
}

View File

@ -8,7 +8,7 @@ import {
* @param {Object} params [description] * @param {Object} params [description]
* @return {[type]} [description] * @return {[type]} [description]
*/ */
export const authorized = (moduleName, params = {}, apiMethod = 'getHasRight') => WeaTools.callApi(`/api/${moduleName}/${apiMethod}`, 'POST', params); export const authorized = (moduleName, params = {}, apiMethod = 'getHasRight') => WeaTools.callApi(`/api/hrm/${moduleName}/${apiMethod}`, 'POST', params);
/** /**
* 应用分权 * 应用分权

View File

@ -0,0 +1,69 @@
import {
WeaTools
} from 'ecCom'
export const getRightMenu = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/getRightMenu', 'POST', params);
export const getSearchCondition = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/getSearchCondition', 'GET', params);
export const getSearchList = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/getSearchList', 'POST', params);
export const getBaseForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/getForm', 'GET', {...params, tabKey: 1});
export const getKQTypeForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/getForm', 'GET', {...params, tabKey: 2});
export const saveBaseForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/save', 'POST', {...params, tabKey: 1});
export const saveKQTypeForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/save', 'POST', {...params, tabKey: 2});
export const deleteGroup = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/del', 'POST', params);
export const getShiftCycleForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/getShiftCycleForm', 'GET', params);
export const delShiftCycleForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/delShiftCycleForm', 'POST', params);
export const getTabs = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/getTabs', 'POST', params);
export const init = (params = {}) => Promise.all([getSearchCondition(), getTabs()]);
export const getLocationForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/grouplocation/getForm', 'GET', params);
export const saveLocation = (params = {}) => WeaTools.callApi('/api/hrm/kq/grouplocation/save', 'POST', params);
export const delLocation = (params = {}) => WeaTools.callApi('/api/hrm/kq/grouplocation/del', 'POST', params);
export const getWifiForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/groupwifi/getForm', 'GET', params);
export const saveWifiForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/groupwifi/save', 'POST', params);
export const delWifiForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/groupwifi/del', 'POST', params);
export const getMemberSearchCondition = (params = {}) => WeaTools.callApi('/api/hrm/kq/groupmember/getSearchCondition', 'GET', params);
export const getMemberList = (params = {}) => WeaTools.callApi('/api/hrm/kq/groupmember/getSearchList', 'POST', params);
export const getMemberForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/groupmember/getForm', 'GET', params);
export const saveMemberForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/groupmember/save', 'POST', params);
export const delMemberForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/groupmember/del', 'POST', params);
export const exportExcel = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/exportExcel', 'POST', params);
export const importExcel = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/importExcel', 'POST', params);
// 考勤组查询gropuradio
export const getGroupMemeberCondition = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/getGroupMemeberCondition', 'GET', params);
// 考勤组查询列表
export const getGroupMemberList = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/getGroupMemberList', 'GET', params);
// 获取添加考勤组人员表单
export const getAddMemberCondition = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/getAddMemberCondition', 'GET', params);
//加入考勤组保存
export const saveAddMember = (params = {}) => WeaTools.callApi('/api/hrm/kq/group/saveAddMember', 'POST', params);
export const getGroupLocationList = (params = {}) => WeaTools.callApi('/api/hrm/kq/grouplocation/getGroupLocationList', 'GET', params);
export const getGroupWifiList = (params = {}) => WeaTools.callApi('/api/hrm/kq/groupwifi/getGroupWifiList', 'GET', params);

View File

@ -0,0 +1,51 @@
import {
WeaTools
} from 'ecCom'
export const getHasRight = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getHasRight', 'GET', params);
}
export const getMenus = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getRightMenu', 'GET', params);
}
export const getSearchCondition = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getSearchCondition', 'GET', params);
}
export const getSearchList = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getSearchList', 'GET', params);
}
export const getLeaveRulesForm = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getLeaveRulesForm', 'GET', params);
}
export const addLeaveRules = (params) => {
return WeaTools.callApi('/api/kq/leaverules/addLeaveRules', 'POST', params);
}
export const editLeaveRules = (params) => {
return WeaTools.callApi('/api/kq/leaverules/editLeaveRules', 'POST', params);
}
export const deleteLeaveRules = (params) => {
return WeaTools.callApi('/api/kq/leaverules/deleteLeaveRules', 'POST', params);
}
export const getSyncSettingForm = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getSyncSettingForm', 'GET', params);
}
export const saveSyncSetting = (params) => {
return WeaTools.callApi('/api/kq/leaverules/saveSyncSetting', 'POST', params);
}
export const isNameRepeat = (params) => {
return WeaTools.callApi('/api/kq/leaverules/isNameRepeat', 'GET', params);
}
export const saveDisableLeaveRules = (params) => {
return WeaTools.callApi('/api/kq/leaverules/saveDisableLeaveRules', 'POST', params);
}

View File

@ -0,0 +1,59 @@
import {
WeaTools
} from 'ecCom'
export const getHasRight = (params) => {
return WeaTools.callApi('/api/kq/holidayset/getHasRight', 'GET', params);
}
export const getMenus = (params) => {
return WeaTools.callApi('/api/kq/holidayset/getRightMenu', 'GET', params);
}
export const getSearchCondition = (params) => {
return WeaTools.callApi('/api/kq/holidayset/getSearchCondition', 'GET', params);
}
export const getHolidaySetCalendar = (params) => {
return WeaTools.callApi('/api/kq/holidayset/getHolidaySetCalendar', 'GET', params);
}
export const getHolidayCount = (params) => {
return WeaTools.callApi('/api/kq/holidayset/getHolidayCount', 'GET', params);
}
export const getSearchList = (params) => {
return WeaTools.callApi('/api/kq/holidayset/getSearchList', 'GET', params);
}
export const getHolidaySetForm = (params) => {
return WeaTools.callApi('/api/kq/holidayset/getHolidaySetForm', 'GET', params);
}
export const addHolidaySet = (params) => {
return WeaTools.callApi('/api/kq/holidayset/addHolidaySet', 'POST', params);
}
export const editHolidaySet = (params) => {
return WeaTools.callApi('/api/kq/holidayset/editHolidaySet', 'POST', params);
}
export const deleteHolidaySet = (params) => {
return WeaTools.callApi('/api/kq/holidayset/deleteHolidaySet', 'POST', params);
}
export const initHolidaySet = (params) => {
return WeaTools.callApi('/api/kq/holidayset/initHolidaySet', 'POST', params);
}
export const getSyncForm = (params) => {
return WeaTools.callApi('/api/kq/holidayset/getSyncForm', 'GET', params);
}
export const syncHolidaySet = (params) => {
return WeaTools.callApi('/api/kq/holidayset/syncHolidaySet', 'POST', params);
}
export const hasRepeactData = (params) => {
return WeaTools.callApi('/api/kq/holidayset/hasRepeactData', 'GET', params);
}

View File

@ -0,0 +1,43 @@
import {
WeaTools
} from 'ecCom'
export const getHasRight = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/getHasRight', 'GET', params);
}
export const getRightMenu = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/getRightMenu', 'GET', params);
}
export const getSearchCondition = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/getSearchCondition', 'GET', params);
}
export const getSearchList = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/getSearchList', 'GET', params);
}
export const getLeaveTypesForm = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/getLeaveTypesForm', 'GET', params);
}
export const addLeaveTypes = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/addLeaveTypes', 'POST', params);
}
export const editLeaveTypes = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/editLeaveTypes', 'POST', params);
}
export const deleteLeaveTypes = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/deleteLeaveTypes', 'POST', params);
}
export const isNameRepeat = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/isNameRepeat', 'GET', params);
}
export const saveDisableLeaveRules = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/saveDisableLeaveTypes', 'POST', params);
}

View File

@ -0,0 +1,43 @@
import {
WeaTools
} from 'ecCom'
//获取导入表单
export const getImportForm = (params) => {
const {
importType
} = params;
const str = importType === 'kqScheduleCode' ? 'schedulecode' : 'balanceofleave';
return WeaTools.callApi(`/api/hrm/kq/${str}/getImportForm`, 'GET', params);
}
//导入文件提交
export const saveImport = (params) => {
const {
importType
} = params;
const str = importType === 'kqScheduleCode' ? 'schedulecode' : 'balanceofleave';
return WeaTools.callApi(`/api/hrm/kq/${str}/saveImport`, 'POST', params);
}
//获取导入结果回调数据
export const getImportProcessLog = (params) => {
return WeaTools.callApi(`/api/kq/importlog/getImportProcessLog`, 'GET', params);
}
//获取导入结果
export const getImportResult = (params) => {
return WeaTools.callApi(`/api/kq/importlog/getImportResult`, 'GET', params);
}
//历史导入信息查询
export const getImportHistory = (params) => {
return WeaTools.callApi(`/api/kq/importlog/getImportHistory`, 'GET', params);
}
//导入日志
export const getImportLogDetail = (params) => {
return WeaTools.callApi(`/api/kq/importlog/getImportColResultLog`, 'GET', params);
}
//导入日志 - 高级搜索
export const getImportLogSearchCondition = (params) => {
return WeaTools.callApi(`/api/kq/importlog/getHistorySearchCondition`, 'GET', params);
}

View File

@ -0,0 +1,48 @@
import {
WeaTools
} from 'ecCom'
//获取导入表单
export const getImportForm = (params) => {
const {
importType
} = params;
const str = importType === 'holidaySet' ? 'holidayset' : 'balanceofleave';
let type = 'GET';
if (str == 'balanceofleave') {
type = 'POST';
}
return WeaTools.callApi(`/api/kq/${str}/getImportForm`, type, params);
}
//导入文件提交
export const saveImport = (params) => {
const {
importType
} = params;
const str = importType === 'holidaySet' ? 'holidayset' : 'balanceofleave';
return WeaTools.callApi(`/api/kq/${str}/saveImport`, 'POST', params);
}
//获取导入结果回调数据
export const getImportProcessLog = (params) => {
return WeaTools.callApi(`/api/kq/importlog/getImportProcessLog`, 'GET', params);
}
//获取导入结果
export const getImportResult = (params) => {
return WeaTools.callApi(`/api/kq/importlog/getImportResult`, 'GET', params);
}
//历史导入信息查询
export const getImportHistory = (params) => {
return WeaTools.callApi(`/api/kq/importlog/getImportHistory`, 'GET', params);
}
//导入日志
export const getImportLogDetail = (params) => {
return WeaTools.callApi(`/api/kq/importlog/getImportColResultLog`, 'GET', params);
}
//导入日志 - 高级搜索
export const getImportLogSearchCondition = (params) => {
return WeaTools.callApi(`/api/kq/importlog/getHistorySearchCondition`, 'GET', params);
}

View File

@ -0,0 +1,23 @@
import {
WeaTools
} from 'ecCom'
export const getHasRight = (params) => {
return WeaTools.callApi('/api/kq/setupwizard/getHasRight', 'GET', params);
}
export const getRightMenu = (params) => {
return WeaTools.callApi('/api/kq/setupwizard/getRightMenu', 'GET', params);
}
export const getSetupForm = (params) => {
return WeaTools.callApi('/api/kq/setupwizard/getSetupForm', 'GET', params);
}
export const getSetupSteps = (params) => {
return WeaTools.callApi('/api/kq/setupwizard/getSetupSteps', 'GET', params);
}
export const performInitialization = (params) => {
return WeaTools.callApi('/api/kq/setupwizard/performInitialization', 'GET', params);
}

View File

@ -0,0 +1,24 @@
import {
WeaTools
} from 'ecCom'
const apiAddress = '/api/hrm/kq/reportFieldDefine/';
export const getRightMenu = (params = {}) => WeaTools.callApi(`${apiAddress}getRightMenu`, 'GET', params);
export const getFieldDefineTabs = (params = {}) => WeaTools.callApi(`${apiAddress}getFieldDefineTabs`, 'GET', params);
export const getFieldDefineList = (params = {}) => WeaTools.callApi(`${apiAddress}getFieldDefineList`, 'POST', params);
export const saveFieldDefineList = (params = {}) => WeaTools.callApi(`${apiAddress}saveFieldDefineList`, 'POST', params);
export const getFieldDefineForm = (params = {}) => WeaTools.callApi(`${apiAddress}getFieldDefineForm`, 'POST', params);
export const saveFieldDefine = (params = {}) => WeaTools.callApi(`${apiAddress}saveFieldDefine`, 'POST', params);
export const deleteFieldDefine = (params = {}) => WeaTools.callApi(`${apiAddress}deleteFieldDefine`, 'POST', params);
export const getGroupList = (params = {}) => WeaTools.callApi(`${apiAddress}getGroupList`, 'POST', params);
export const getGroupForm = (params = {}) => WeaTools.callApi(`${apiAddress}getGroupForm`, 'POST', params);
export const saveGroup = (params = {}) => WeaTools.callApi(`${apiAddress}saveGroup`, 'POST', params);
export const deleteGroup = (params = {}) => WeaTools.callApi(`${apiAddress}deleteGroup`, 'POST', params);
export const getConditionMoudleTabs = (params = {}) => WeaTools.callApi(`${apiAddress}getConditionMoudleTabs`, 'POST', params);
export const saveConditionMoudleDefine = (params = {}) => WeaTools.callApi(`${apiAddress}saveConditionMoudleDefine`, 'POST', params);
export const getFieldOrderDefine = (params = {}) => WeaTools.callApi(`${apiAddress}getFieldOrderDefine`, 'POST', params);
export const saveFieldOrderDefine = (params = {}) => WeaTools.callApi(`${apiAddress}saveFieldOrderDefine`, 'POST', params);
export const changeFieldGroup = (params = {}) => WeaTools.callApi(`${apiAddress}changeFieldGroup`, 'POST', params);
export const init = (params = {}) => Promise.all([getRightMenu(), getFieldDefineTabs()]);

View File

@ -0,0 +1,55 @@
import {
WeaTools
} from 'ecCom'
export const getHasRight = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getHasRight', 'GET', params);
}
export const getRightMenu = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getRightMenu', 'GET', params);
}
export const getSearchCondition = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getSearchCondition', 'GET', params);
}
export const getSearchList = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getSearchList', 'GET', params);
}
export const getLeaveRulesForm = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getLeaveRulesForm', 'GET', params);
}
export const addLeaveRules = (params) => {
return WeaTools.callApi('/api/kq/leaverules/addLeaveRules', 'POST', params);
}
export const editLeaveRules = (params) => {
return WeaTools.callApi('/api/kq/leaverules/editLeaveRules', 'POST', params);
}
export const deleteLeaveRules = (params) => {
return WeaTools.callApi('/api/kq/leaverules/deleteLeaveRules', 'POST', params);
}
export const getSyncSettingForm = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getSyncSettingForm', 'GET', params);
}
export const saveSyncSetting = (params) => {
return WeaTools.callApi('/api/kq/leaverules/saveSyncSetting', 'POST', params);
}
export const isNameRepeat = (params) => {
return WeaTools.callApi('/api/kq/leaverules/isNameRepeat', 'GET', params);
}
export const saveDisableLeaveRules = (params) => {
return WeaTools.callApi('/api/kq/leaverules/saveDisableLeaveRules', 'POST', params);
}
export const getUnitName = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getUnitName', 'GET', params);
}

View File

@ -0,0 +1,43 @@
import {
WeaTools
} from 'ecCom'
export const getHasRight = (params) => {
return WeaTools.callApi('/api/kq/overtimerules/getHasRight', 'GET', params);
}
export const getMenus = (params) => {
return WeaTools.callApi('/api/kq/overtimerules/getRightMenu', 'GET', params);
}
export const getSearchList = (params) => {
return WeaTools.callApi('/api/kq/overtimerules/getSearchList', 'GET', params);
}
export const getOvertimeRulesForm = (params) => {
return WeaTools.callApi('/api/kq/overtimerules/getOvertimeRulesForm', 'GET', params);
}
export const addOvertimeRules = (params) => {
return WeaTools.callApi('/api/kq/overtimerules/addOvertimeRules', 'POST', params);
}
export const editOvertimeRules = (params) => {
return WeaTools.callApi('/api/kq/overtimerules/editOvertimeRules', 'POST', params);
}
export const deleteOvertimeRules = (params) => {
return WeaTools.callApi('/api/kq/overtimerules/deleteOvertimeRules', 'POST', params);
}
export const saveDefault = (params) => {
return WeaTools.callApi('/api/kq/overtimerules/saveDefault', 'POST', params);
}
export const getOvertimeUnitForm = (params) => {
return WeaTools.callApi('/api/kq/overtimerules/getOvertimeUnitForm', 'GET', params);
}
export const saveOvertimeUnit = (params) => {
return WeaTools.callApi('/api/kq/overtimerules/saveOvertimeUnit', 'POST', params);
}

View File

@ -0,0 +1,13 @@
import {
WeaTools
} from 'ecCom';
export const getScheduleCodeCondition = (params = {}) => WeaTools.callApi('/api/hrm/kq/schedulecode/getScheduleCodeCondition', 'GET', params);
export const getScheduleCodeList = (params = {}) => WeaTools.callApi('/api/hrm/kq/schedulecode/getScheduleCodeList', 'POST', params);
export const getScheduleCodeForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/schedulecode/getScheduleCodeForm', 'GET', params);
export const saveScheduleCode = (params = {}) => WeaTools.callApi('/api/hrm/kq/schedulecode/saveScheduleCode', 'POST', params);
export const getScheduleDeviceCondition = (params = {}) => WeaTools.callApi('/api/hrm/kq/schedulecode/getScheduleDeviceCondition', 'GET', params);
export const getScheduleDeviceList = (params = {}) => WeaTools.callApi('/api/hrm/kq/schedulecode/getScheduleDeviceList', 'POST', params);
export const getScheduleDeviceForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/schedulecode/getScheduleDeviceForm', 'GET', params);
export const saveScheduleDevice = (params = {}) => WeaTools.callApi('/api/hrm/kq/schedulecode/saveScheduleDevice', 'POST', params);
export const delScheduleDevice = (params = {}) => WeaTools.callApi('/api/hrm/kq/schedulecode/delScheduleDevice', 'POST', params);

View File

@ -0,0 +1,25 @@
import {
WeaTools
} from 'ecCom'
export const getTabs = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftschedulce/getTabs', 'POST', params);
export const getShiftSchedule = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftschedulce/getShiftSchedule', 'POST', params);
export const getSearchCondition = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftschedulce/getSearchCondition', 'POST', params);
export const getBatchShiftScheduleFrom = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftschedulce/getBatchShiftScheduleFrom', 'POST', params);
export const save = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftschedulce/save', 'POST', params);
export const batchDelete = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftschedulce/delete', 'POST', params);
export const batchSave = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftschedulce/batchSave', 'POST', params);
export const importExcel = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftschedulce/importExcel', 'POST', params);
export const getShiftScheduleTotal = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftschedulce/getShiftScheduleTotal', 'POST', params);
export const exportExcel = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftschedulce/exportExcel', 'POST', params);
export const init = (params = {}) => Promise.all([getSearchCondition(params), getTabs()]);

View File

@ -0,0 +1,33 @@
import {
WeaTools
} from 'ecCom'
export const getRightMenu = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftManagement/getRightMenu', 'POST', params);
export const getTabs = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftManagement/getTabs', 'POST', params);
export const getShiftManagementSearchList = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftManagement/getShiftManagementSearchList', 'POST', params);
export const getShiftManagementBaseForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftManagement/getShiftManagementBaseForm', 'POST', params);
export const saveShiftManagementBaseForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftManagement/saveShiftManagementBaseForm', 'POST', params);
export const getShiftManagementPersonalizedForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftManagement/getShiftManagementPersonalizedForm', 'POST', params);
export const saveShiftManagementPersonalizedForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftManagement/saveShiftManagementPersonalizedForm', 'POST', params);
export const delShiftManagementForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftManagement/delShiftManagementForm', 'POST', params);
export const init = (params = {}) => Promise.all([getRightMenu(), getTabs()]);
export const getShiftInfo = (params = {}) => Promise.all([getShiftManagementBaseForm(params), getShiftManagementPersonalizedForm(params)]);
export const getDetachOperatelevel = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftManagement/getDetachOperatelevel', 'POST', params);
export const getEmailRemindForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftManagement/getEmailRemindForm', 'GET', params);
export const getMessageRemindForm = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftManagement/getMessageRemindForm', 'GET', params);
export const saveEmailRemind = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftManagement/saveEmailRemind', 'POST', params);
export const saveMessageRemind = (params = {}) => WeaTools.callApi('/api/hrm/kq/shiftManagement/saveMessageRemind', 'POST', params);

View File

@ -0,0 +1,11 @@
import {
WeaTools
} from 'ecCom'
export const getTimeSelectionForm = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/getTimeSelectionForm', 'POST', params);
}
export const saveTimeSelectionForm = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/saveTimeSelectionForm', 'POST', params);
}

View File

@ -0,0 +1,19 @@
import {
WeaTools
} from 'ecCom'
export const getHasRight = (params) => {
return WeaTools.callApi('/api/kq/travelrules/getHasRight', 'GET', params);
}
export const getMenus = (params) => {
return WeaTools.callApi('/api/kq/travelrules/getRightMenu', 'GET', params);
}
export const getTravelRulesForm = (params) => {
return WeaTools.callApi('/api/kq/travelrules/getTravelRulesForm', 'GET', params);
}
export const saveTravelRules = (params) => {
return WeaTools.callApi('/api/kq/travelrules/saveTravelRules', 'POST', params);
}

View File

@ -0,0 +1,13 @@
import {
WeaTools
} from 'ecCom'
export const getTreeTabs = (params = {}) => WeaTools.callApi('/api/hrm/kq/upgrade/getTreeTabs', 'POST', params);
export const getUpgradeInfo = (params = {}) => WeaTools.callApi(`/api/hrm/kq/upgrade/get${params.type}`, 'POST', params);
export const doUpgrade = (params = {}) => WeaTools.callApi(`/api/hrm/kq/upgrade/do${params.type}`, 'POST', params);
export const getUpgrade12Data = (params = {}) => WeaTools.callApi(`/api/hrm/kq/upgrade/getUpgrade12Data`, 'POST', params);
export const init = (params = {}) => Promise.all([getTreeTabs(), getUpgradeInfo({type: 'Upgrade1'})]);

View File

@ -0,0 +1,35 @@
import {
WeaTools
} from 'ecCom'
export const getHasRight = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/getHasRight', 'GET', params);
}
export const getMenus = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/getRightMenu', 'GET', params);
}
export const getTabs = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/getTabs', 'GET', params);
}
export const getSearchCondition = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/getSearchCondition', 'GET', params);
}
export const getSearchList = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/getSearchList', 'GET', params);
}
export const saveBalanceOfLeave = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/saveBalanceOfLeave', 'POST', params);
}
export const batchProcessing = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/batchProcessing', 'POST', params);
}
export const hasLeaveRules = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/hasLeaveRules', 'POST', params);
}

View File

@ -0,0 +1,51 @@
import {
WeaTools
} from 'ecCom'
export const getHasRight = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/getHasRight', 'GET', params);
}
export const getRightMenu = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/getRightMenu', 'GET', params);
}
export const getTabs = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/getTabs', 'GET', params);
}
export const getSearchCondition = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/getSearchCondition', 'GET', params);
}
export const getSearchList = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/getSearchList', 'POST', params);
}
export const saveBalanceOfLeave = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/saveBalanceOfLeave', 'POST', params);
}
export const batchProcessing = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/batchProcessing', 'POST', params);
}
export const hasLeaveRules = (params) => {
return WeaTools.callApi('/api/kq/balanceofleave/hasLeaveRules', 'POST', params);
}
export const getDetailSearchList = (params) => {
return WeaTools.callApi('/api/kq/balancedetail/getSearchList', 'GET', params);
}
export const getDetailBalanceForm = (params) => {
return WeaTools.callApi('/api/kq/balancedetail/getBalanceForm', 'GET', params);
}
export const editBalance = (params) => {
return WeaTools.callApi('/api/kq/balancedetail/editBalance', 'POST', params);
}
export const deleteBalance = (params) => {
return WeaTools.callApi('/api/kq/balancedetail/deleteBalance', 'POST', params);
}

View File

@ -0,0 +1,43 @@
import {
WeaTools
} from 'ecCom'
export const getHasRight = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getHasRight', 'GET', params);
}
export const getRightMenu = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getRightMenu', 'GET', params);
}
export const getSearchCondition = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getSearchCondition', 'GET', params);
}
export const getSearchList = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getSearchList', 'GET', params);
}
export const getLeaveRulesForm = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getLeaveRulesForm', 'GET', params);
}
export const addLeaveRules = (params) => {
return WeaTools.callApi('/api/kq/leaverules/addLeaveRules', 'POST', params);
}
export const editLeaveRules = (params) => {
return WeaTools.callApi('/api/kq/leaverules/editLeaveRules', 'POST', params);
}
export const deleteLeaveRules = (params) => {
return WeaTools.callApi('/api/kq/leaverules/deleteLeaveRules', 'POST', params);
}
export const getUnitName = (params) => {
return WeaTools.callApi('/api/kq/leaverules/getUnitName', 'GET', params);
}
export const isNameRepeat = (params) => {
return WeaTools.callApi('/api/kq/leaverules/isNameRepeat', 'GET', params);
}

View File

@ -0,0 +1,43 @@
import {
WeaTools
} from 'ecCom'
export const getHasRight = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/getHasRight', 'GET', params);
}
export const getRightMenu = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/getRightMenu', 'GET', params);
}
export const getSearchCondition = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/getSearchCondition', 'GET', params);
}
export const getSearchList = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/getSearchList', 'GET', params);
}
export const getLeaveTypesForm = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/getLeaveTypesForm', 'GET', params);
}
export const addLeaveTypes = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/addLeaveTypes', 'POST', params);
}
export const editLeaveTypes = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/editLeaveTypes', 'POST', params);
}
export const deleteLeaveTypes = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/deleteLeaveTypes', 'POST', params);
}
export const isNameRepeat = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/isNameRepeat', 'GET', params);
}
export const saveDisableLeaveRules = (params) => {
return WeaTools.callApi('/api/kq/leavetypes/saveDisableLeaveTypes', 'POST', params);
}

View File

@ -0,0 +1,45 @@
import {
WeaTools
} from 'ecCom';
export const getFormInfo = (urlParams, params = {}) => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/getStateProcSetFlowForm`, 'POST', params)
export const getFormInfoByWorkflow = (params = {}) => WeaTools.callApi('/api/hrm/stateset/getFormInfo', 'POST', params)
export const getCondition = (urlParams, params = {}) => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/getStateProcSetListSearchCondition`, 'GET', params)
export const multiRemove = (urlParams, params = {}) => WeaTools.callApi(`/api/hrm/statechange/getPermissionToAdjustList`, 'POST', params)
export const getWorkflowList = (urlParams, params = {}) => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/getStateProcSetListSearchList`, 'POST', params)
export const saveWf = (urlParams, params = {}) => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/saveStateProcSetFlow`, 'POST', params)
export const getTab = (urlParams, params = {}) => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/getStateProcSetTabInfo`, 'POST', params)
export const createForm = (urlParams, params = {}) => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/saveStateProcSetCreateForm`, 'POST', params)
export const getField = (urlParams, params = {}) => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/getStateProcSetFlowWfFields`, 'POST', params)
export const saveField = (urlParams, params = {}) => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/saveStateProcSetFlowWfFields`, 'POST', params)
export const getActionSetting = (urlParams, params = {}) => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/getStateProcSetFlowWfSet`, 'POST', params)
export const saveActionSetting = (urlParams, params = {}) => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/saveStateProcSetFlowWfSet`, 'POST', params)
export const changeStatus = (urlParams, params = {}) => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/changeStateProcSetStatus`, 'POST', params)
export const removeWf = (urlParams, params = {}) => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/delStateProcSet`, 'POST', params)
export const initModuleData = (urlParams, params) => Promise.all([getFormInfo(urlParams), getCondition(urlParams)])
export const getProcSetTemplet = (urlParams, params) => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/getProcSetTemplet`, 'POST', params)
export const getStateProcSetFlowCheckRuleList = params => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/getStateProcSetFlowCheckRuleList`, 'POST', params)
export const saveStateProcCheckRule = params => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/saveStateProcCheckRule`, 'POST', params)
export const delStateProcCheckRule = params => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/delStateProcCheckRule`, 'POST', params)
export const getProcSetCheckRule = params => WeaTools.callApi(`/api/kq/wfSetting/statesShedule/getProcSetCheckRule`, 'POST', params)

View File

@ -1,14 +1,15 @@
import { import {
WeaPopoverHrm, WeaPopoverHrm,
WeaLocaleProvider WeaLocaleProvider,
WeaTools
} from 'ecCom'; } from 'ecCom';
import loadjs from 'loadjs';
import { import {
WeaLogView WeaLogView
} from 'comsMobx'; } from 'comsMobx';
import { import {
isEnableMultiLang isEnableMultiLang
} from '../apis/common'; } from '../apis/common';
import loadjs from 'loadjs';
const WeaLogViewComp = WeaLogView.Component; const WeaLogViewComp = WeaLogView.Component;
const { const {
LogStore LogStore
@ -67,9 +68,9 @@ class Home extends React.Component {
render() { render() {
return ( return (
<div style={{height:"100%"}}> <div style={{height:"100%"}}>
<WeaPopoverHrm ecId={`${this && this.props && this.props.ecId || ''}_WeaPopoverHrm@m3tbok`} /> <WeaPopoverHrm ecId={`${this && this.props && this.props.ecId || ''}_WeaPopoverHrm@bvqmtf`} />
<WeaLogViewComp ecId={`${this && this.props && this.props.ecId || ''}_WeaLogViewComp@bhzfu0`} {...this.state} onCancel={this.onCancel}/> <WeaLogViewComp ecId={`${this && this.props && this.props.ecId || ''}_WeaLogViewComp@llhywc`} {...this.state} onCancel={this.onCancel}/>
<WeaLocaleProvider ecId={`${this && this.props && this.props.ecId || ''}_WeaLocaleProvider@dbokoh`}> <WeaLocaleProvider ecId={`${this && this.props && this.props.ecId || ''}_WeaLocaleProvider@qydj45`}>
{/* {this.state.comsLoaded && this.props.children} */} {/* {this.state.comsLoaded && this.props.children} */}
{this.props.children} {this.props.children}
</WeaLocaleProvider> </WeaLocaleProvider>

View File

@ -0,0 +1,61 @@
import React from 'react';
import {
observer,
inject
} from 'mobx-react';
import {
Authority,
Top,
MagicForm,
} from '../../public/valhalla/components/index.js';
import '../../style/applicationSettings.less';
@inject('applicationSettingsStore')
@observer
export default class ApplicationSettings extends React.Component {
componentWillMount() {
this.props.applicationSettingsStore.preMount();
}
componentWillReceiveProps(nextProps) {
if (this.props.location.key !== nextProps.location.key) {
this.init();
}
}
componentDidMount() {
this.init();
}
init = () => {
const {
applicationSettingsStore
} = this.props, {
init
} = applicationSettingsStore;
init();
}
render() {
const {
applicationSettingsStore
} = this.props, {
authorityStore,
topStore,
formStore,
} = applicationSettingsStore;
return (
<div className='hrm-kq-application-settings'>
<Authority ecId={`${this && this.props && this.props.ecId || ''}_Authority@162dpe`} store={authorityStore}>
<Top ecId={`${this && this.props && this.props.ecId || ''}_Top@hlpd9i`} store={topStore}>
<div className='content'>
<MagicForm ecId={`${this && this.props && this.props.ecId || ''}_MagicForm@shp38n`} store={formStore} />
</div>
</Top>
</Authority>
</div>
);
}
}

View File

@ -0,0 +1,61 @@
import {
inject,
observer
} from 'mobx-react';
import {
WeaDialog
} from 'ecCom';
import {
MagicForm
} from '../../public/sweet-form.js';
import {
Loading,
} from '../../public/learn';
@inject('hrmAttendanceRpSharingSetting')
@observer
class Dialog extends React.Component {
constructor(props) {
super(props);
}
getContent = () => {
const {
formConfig,
formElements,
} = this.props.hrmAttendanceRpSharingSetting, {
form,
loading,
} = formElements;
if (loading) {
return <Loading ecId={`${this && this.props && this.props.ecId || ''}_Loading@a1f2nv`} size='sm'/>
} else {
return (
<MagicForm ecId={`${this && this.props && this.props.ecId || ''}_MagicForm@0acryc`}
{...formConfig}
{...formElements}
isFormInit={form.isFormInit}
/>
)
}
}
render() {
const {
dialog,
dialogProps,
} = this.props.hrmAttendanceRpSharingSetting;
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@4esdkq`}
{...dialog}
{...dialogProps}
>
{this.getContent()}
</WeaDialog>
);
}
}
export default Dialog;

View File

@ -0,0 +1,49 @@
import {
inject,
observer
} from 'mobx-react';
import {
WeaTab
} from 'ecCom';
import {
SearchForm
} from '../../public/sweet-form.js';
@inject('hrmAttendanceRpSharingSetting')
@observer
class Tab extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.props.hrmAttendanceRpSharingSetting.getSearchCondition();
}
render() {
const {
tabProps,
tab,
search,
} = this.props.hrmAttendanceRpSharingSetting, {
form
} = search;
return (
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@ek31h8`}
{...tabProps}
{...tab}
searchsAd={<div
onKeyDown={ (e) =>{
if (e.keyCode == 13 && e.target.tagName === "INPUT") {
this.props.hrmAttendanceRpSharingSetting.handleSearch()
}
} }
>{<SearchForm ecId={`${this && this.props && this.props.ecId || ''}_SearchForm@ll9zui`} isFormInit={form.isFormInit} {...search}/>}</div>}
/>
);
}
}
export default Tab;

View File

@ -0,0 +1,33 @@
import {
inject,
observer
} from 'mobx-react';
import {
WeaTableNew
} from 'comsMobx';
const WeaTable = WeaTableNew.WeaTable;
@inject('hrmAttendanceRpSharingSetting')
@observer
class Table extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.props.hrmAttendanceRpSharingSetting.getSearchList();
}
render() {
const {
table,
tableProps
} = this.props.hrmAttendanceRpSharingSetting;
return (
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@bquvfs`} {...table} {...tableProps}/>
);
}
}
export default Table;

View File

@ -0,0 +1,49 @@
import {
inject,
observer
} from 'mobx-react';
import {
WeaTop,
WeaRightMenu,
} from 'ecCom';
import Tab from './Tab';
import Table from './Table';
@inject('hrmAttendanceRpSharingSetting')
@observer
class Top extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.props.hrmAttendanceRpSharingSetting.getRightMenu();
}
render() {
const {
topProps,
toploading,
topButtons,
dropMenuDatas,
} = this.props.hrmAttendanceRpSharingSetting;
return (
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@evcgsg`}
{...topProps}
loading={toploading}
buttons={topButtons}
dropMenuDatas={dropMenuDatas}
>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@r49zwv`} datas={dropMenuDatas}>
<Tab ecId={`${this && this.props && this.props.ecId || ''}_Tab@6fn9wo`} />
<Table ecId={`${this && this.props && this.props.ecId || ''}_Table@b6drwf`} />
</WeaRightMenu>
</WeaTop>
);
}
}
export default Top;

View File

@ -7,49 +7,48 @@ import {
AlertPage, AlertPage,
Loading, Loading,
} from '../../public/learn'; } from '../../public/learn';
import '../../style/report.less';
import Top from './Top'; import Top from './Top';
import Dialog from './Dialog'; import Dialog from './Dialog';
@inject('hrmVacationBalanceReportCopy') @inject('hrmAttendanceRpSharingSetting')
@observer @observer
export default class VacationBalanceReportCopy extends React.Component { export default class AttendanceRpSharingSetting extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
} }
componentWillMount() { componentWillMount() {
this.props.hrmVacationBalanceReportCopy.cwm(); this.props.hrmAttendanceRpSharingSetting.reset();
} }
componentDidMount() { componentDidMount() {
this.props.hrmVacationBalanceReportCopy.getPermissionInfo(); this.props.hrmAttendanceRpSharingSetting.getPermissionInfo();
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
if (this.props.location.key !== nextProps.location.key) { if (this.props.location.key !== nextProps.location.key) {
this.props.hrmVacationBalanceReportCopy.cwr(); this.props.hrmAttendanceRpSharingSetting.refresh();
} }
} }
render() { render() {
const { const {
hrmVacationBalanceReportCopy, hrmAttendanceRpSharingSetting,
} = this.props, { } = this.props, {
pageAccessPermission pageAccessPermission
} = hrmVacationBalanceReportCopy, { } = hrmAttendanceRpSharingSetting, {
hasRight, hasRight,
loading loading
} = pageAccessPermission; } = pageAccessPermission;
if (!hasRight) { if (!hasRight) {
return loading ? <Loading ecId={`${this && this.props && this.props.ecId || ''}_Loading@dj0ofr`} size='lg'/> : <AlertPage ecId={`${this && this.props && this.props.ecId || ''}_AlertPage@cohqtf`} /> return loading ? <Loading ecId={`${this && this.props && this.props.ecId || ''}_Loading@gctjk1`} size='lg'/> : <AlertPage ecId={`${this && this.props && this.props.ecId || ''}_AlertPage@4eqg7l`} />
} else { } else {
return ( return (
<div className='report'> <div>
<Top ecId={`${this && this.props && this.props.ecId || ''}_Top@rr33zq`} /> <Top ecId={`${this && this.props && this.props.ecId || ''}_Top@1o9gd2`} />
<Dialog ecId={`${this && this.props && this.props.ecId || ''}_Dialog@s464sc`} /> <Dialog ecId={`${this && this.props && this.props.ecId || ''}_Dialog@r3bfm5`} />
</div> </div>
) )
} }

View File

@ -0,0 +1,41 @@
import React, {
Component
} from 'react';
import {
observer
} from 'mobx-react';
import {
WeaSearchGroup,
WeaTableEdit
} from 'ecCom';
import {
i18n
} from '../../public/i18n';
@observer
export default class FieldSetting extends Component {
constructor(props) {
super(props);
}
componentDidMount() {}
componentWillReceiveProps(nextProps) {}
render() {
const {
store
} = this.props;
const {
fieldSettingFormCondition,
tableEditConfig,
refreshTableData,
setEditTable
} = store;
return (
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@t0m8ld`} col={1} title={fieldSettingFormCondition.title} showGroup={fieldSettingFormCondition.defaultshow}>
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@m7kmy3`} {...tableEditConfig} ref={(editTable) => setEditTable(editTable, 'fieldDef')}/>
</WeaSearchGroup>
)
}
}

View File

@ -0,0 +1,45 @@
import React, {
Component
} from 'react';
import {
observer
} from 'mobx-react';
import {
WeaSearchGroup,
WeaTableEdit
} from 'ecCom';
import {
i18n
} from '../../public/i18n';
@observer
export default class FieldSettingExplain extends Component {
constructor(props) {
super(props);
}
componentDidMount() {}
componentWillReceiveProps(nextProps) {}
render() {
const {
store
} = this.props;
const {
fieldSettingExplainConditon
} = store;
let items = [],
children = [];
items.push({
com: <div className='explain'>{children}</div>
})
fieldSettingExplainConditon.items.map((item, index) => {
children.push(<div>{`${item.index}. ${item.value}`}</div>)
})
return (
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@939kx9`} col={1} title={fieldSettingExplainConditon.title} showGroup={fieldSettingExplainConditon.defaultshow} items={items}></WeaSearchGroup>
)
}
}

View File

@ -0,0 +1,84 @@
import React, {
Component
} from 'react';
import {
observer
} from 'mobx-react';
import {
WeaSearchGroup,
WeaFormItem,
WeaCheckbox,
WeaRangePicker,
WeaHelpfulTip,
WeaError
} from 'ecCom';
import {
Button
} from 'antd';
import {
i18n
} from '../../public/i18n';
@observer
export default class SyncSetting extends Component {
constructor(props) {
super(props);
}
componentDidMount() {}
componentWillReceiveProps(nextProps) {}
render() {
const {
store
} = this.props;
const {
sync,
syncSettingFormCondition,
setValid,
setSyncDate,
setErrorRef
} = store;
let items = [],
children = [];
items.push({
com: <div className='syncForm'>{children}</div>
})
Object.keys(syncSettingFormCondition).length > 0 && syncSettingFormCondition.items.map((item, index) => {
switch (index) {
case 0:
children.push(
(
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@4lcee3@${index}`} label={i18n.label.checkEnable()} labelCol={{span:8}} wrapperCol={{span:16}}>
<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@i9ofe7@${index}`} value={item.isVaild ? '1' : '0'} display={'switch'} onChange={setValid}/>
<span className='tips'><WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@osmoe9@${index}`} title={item.tips} /></span>
</WeaFormItem>
)
);
break;
case 1:
children.push(
(
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@22vkp6@${index}`} label={i18n.label.syncDateRange()} labelCol={{span:8}} wrapperCol={{span:16}}>
<div className='dateRange'>
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@veklv6@${index}`} error={i18n.message.dataEmpty()} ref={dom => setErrorRef(dom)} tipPosition={'bottom'}>
<WeaRangePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaRangePicker@dv0q66@${index}`} onChange={setSyncDate}/>
</WeaError>
<div className='btnGroup'>
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ouzetz@${index}`} type='primary' onClick={sync}>{i18n.label.immediateSync()}</Button>
<div className='tips'><WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@b7jyt6@${index}`} title={item.tips} /></div>
</div>
</div>
</WeaFormItem>
)
);
break;
}
})
return (
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@katyrj`} col={1} title={syncSettingFormCondition.title} showGroup={syncSettingFormCondition.defaultshow} items={items}></WeaSearchGroup>
)
}
}

View File

@ -0,0 +1,99 @@
import '../../style/attendanceSynSetting.less';
import React, {
Component
} from 'react';
import {
inject,
observer
} from 'mobx-react';
import {Spin} from 'antd';
import {
WeaTop,
WeaAlertPage,
WeaRightMenu,
WeaLocaleProvider
} from 'ecCom';
import SyncSetting from './SyncSetting';
import FieldSetting from './FieldSetting';
import FieldSettingExplain from './FieldSettingExplain';
const getLabel = WeaLocaleProvider.getLabel;
import {
i18n
} from '../../public/i18n';
@inject('hrmAttendanceSyncSetting')
@observer
export default class AttendanceSyncSetting extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.init();
}
componentWillReceiveProps(nextProps) {
if (this.props.location.key !== nextProps.location.key) {
this.init();
}
}
init = () => {
const {
hrmAttendanceSyncSetting: store,
hrmImportResource
} = this.props;
const {
checkAuthorized,
initData
} = store;
checkAuthorized('schedulesignimport', null, initData);
}
render() {
const {
hrmAttendanceSyncSetting: store
} = this.props;
const {
containerInitFinished,
topBtnAndMenu,
searchGroupList,
spinning
// editTableConfig
} = store;
const {
btns,
menus
} = topBtnAndMenu();
return (
<div className="hrm_module_container attendanceSynSetting">
{
containerInitFinished.init && containerInitFinished.authorized &&
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@dbuvx2`} spinning={spinning}>
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@7ce6bq`}
title={getLabel(33740, '数据同步设置')}
icon={<i className='icon-coms-hrm'/>}
iconBgcolor='#217346'
showDropIcon={true}
buttons={btns}
dropMenuDatas={menus}
>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@eo9h6g`} datas={menus}>
<SyncSetting ecId={`${this && this.props && this.props.ecId || ''}_SyncSetting@wirlhl`} store={store} />
<FieldSetting ecId={`${this && this.props && this.props.ecId || ''}_FieldSetting@6hkz5r`} store={store} />
<FieldSettingExplain ecId={`${this && this.props && this.props.ecId || ''}_FieldSettingExplain@szhpph`} store={store} />
</WeaRightMenu>
</WeaTop>
</Spin>
}
{
containerInitFinished.init && !containerInitFinished.authorized &&
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@qdtzgw`}>
<div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
</WeaAlertPage>
}
</div>
)
}
}

View File

@ -0,0 +1,52 @@
import React, { Component } from 'react'
import {observer} from 'mobx-react';
import {toJS} from 'mobx';
import {WeaDialog,WeaFormItem, WeaSearchGroup, WeaLocaleProvider} from 'ecCom';
import {WeaSwitch} from 'comsMobx';
const getLabel = WeaLocaleProvider.getLabel;
@observer
export default class AddToGroup extends Component {
getContent (condition) {
const {store} = this.props;
const {addToGroupForm, chooseGroup} = store;
const {isFormInit} = addToGroupForm;
let group = [];
isFormInit && toJS(condition).map((c, i) =>{
let items = [];
c.items.map((field, index) => {
items.push({
com:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@5ummuk@${index}`}
label={getLabel('515195','选择考勤组')}
labelCol={{span: `${field.labelcol}`}}
ratio1to2
error={addToGroupForm.getError(field)}
tipPosition="bottom"
wrapperCol={{span: `${field.fieldcol}`}}>
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@dy200w@${index}`} fieldConfig={{...field, title:getLabel('515195','选择考勤组')}} form={addToGroupForm} onChange = {(data) => chooseGroup (data)} title='选择考勤组' />
</WeaFormItem>),
})
});
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@wfif9o@${i}`} style={{paddingTop:'15px'}} center = {true} showGroup={c.defaultshow} items={items}/>)
});
return group;
}
render() {
const {store} = this.props;
const {addToGroupCondition,addDialogParams,buttons} = store;
return (
<div>
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@kls7pc`} {...addDialogParams} buttons={buttons} >
{
this.getContent(addToGroupCondition)
}
</WeaDialog>
</div>
)
}
}

View File

@ -0,0 +1,68 @@
import React, {Component} from 'react';
import {observer} from 'mobx-react';
import {WeaRightMenu} from 'ecCom';
import {
WeaTableNew
} from 'comsMobx';
import classnames from 'classnames';
import findIndex from 'lodash/findIndex';
const {
WeaTable
} = WeaTableNew;
@observer
export default class Content extends Component{
doEdit = id => this.props.store.doEdit(id, '1');
doEditBase = this.doEdit;
doEditKQType = id => this.props.store.doEdit(id, '2');
doEditKQMember = id => this.props.store.doEdit(id, '3');
doEditSchedule = (id, record) => this.props.store.doEditSchedule(record);
doDelete = id => this.props.store.doDelete({ids: id});
showLog = id => this.props.store.showLog({logSmallType: this.props.store.logTypeDef.HRM_ENGINE_KQGROUP, targetId: id}); //日志
onOperatesClick = (record, index, operate) => {
const func = operate.href ? operate.href.split(':')[1].split('(')[0] : '';
const id = record.id ? record.id : '';
this[func] && this[func](id, record);
}
renderCol = (cols) => {
['groupname'].map(key => {
const idx = findIndex(cols, item => item.dataIndex === key);
idx != -1 && (cols[idx].render = (text, record) => {
return <a onClick={() => this.doEdit(record.id)} dangerouslySetInnerHTML={{__html:record[`${key}span`]}}></a>
});
})
}
render(){
const {
store
} = this.props;
const className = classnames({
['tabPane']: true,
['tabPane-include']: store.containerInitFinished.detachable
})
return (
<div className={className}>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@p1ezwd`} datas={this.props.rightMenu}>
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@p7h982`}
comsWeaTableStore={store.table}
hasOrder={true}
needScroll={true}
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
getColumns={cols => this.renderCol(cols)}
/>
</WeaRightMenu>
</div>
)
}
}

View File

@ -0,0 +1,59 @@
import React, {Component} from 'react';
import {observer} from 'mobx-react';
import {WeaDialog} from 'ecCom';
import {Button} from 'antd';
import {i18n} from '../../public/i18n';
import Info from './Info';
import BaseInfo from './info/BaseInfo';
@observer
export default class Edit extends Component{
constructor(props){
super(props);
this.state = {
height: 0
}
}
render(){
const {height} = this.state;
const {
store
} = this.props;
const {
dialogParams,
save,
canAdd,
} = store;
const generateDialogParams = () =>{
const props = {...dialogParams};
let buttons = canAdd ? [<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@k8bo3`} type='primary' op='save' onClick={() => save()}>{i18n.label.save()}</Button>] : [];
if(dialogParams.opType === 'create' && canAdd){
buttons.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@esd8bp`} type='primary' op='entry' onClick={() => save(true)}>{i18n.label.saveAndSetting()}</Button>)
}
Object.assign(props, {
buttons,
moreBtn: {datas: store.convertToMenus(buttons)},
// key: new Date().getTime()
})
return props;
}
const getContent = () => {
if(dialogParams.opType == 'create'){
return (
<BaseInfo ecId={`${this && this.props && this.props.ecId || ''}_BaseInfo@3ri22a`} store={store} />
);
}else{
return (
<Info ecId={`${this && this.props && this.props.ecId || ''}_Info@j0kdfv`} store={store} height={height}/>
);
}
}
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@2l5h9w`} {...generateDialogParams()} onChangeHeight={(h) => this.setState({height: h})}>
{getContent()}
</WeaDialog>
)
}
}

View File

@ -0,0 +1,68 @@
import '../../style/groupSetting.less';
import React, {Component} from 'react';
import {inject,observer} from 'mobx-react';
import {WeaTop, WeaAlertPage, WeaDialogFooter} from 'ecCom';
import {i18n} from '../../public/i18n';
import Info from './Info';
@inject('hrmGroupSetting')
@observer
export default class GroupInfo4Coms extends Component{
constructor(props) {
super(props);
}
componentDidMount() {
this.init();
}
componentWillReceiveProps(nextProps) {
this.init();
}
init = () => {
const {
hrmGroupSetting: store,
groupId,
callback
} = this.props;
store.checkAuthorized('kq/group', null, () => store.initSingle(groupId, callback));
}
render(){
const {
hrmGroupSetting: store
} = this.props;
const {
containerInitFinished,
dialogFootButtons,
} = store;
let title = i18n.label['389064']();
const {buttons, menus} = dialogFootButtons;
let children = [
(
<div>
<div style={{height: 680, position: 'relative'}}>
<Info ecId={`${this && this.props && this.props.ecId || ''}_Info@p8cxnm`} store={store} />
</div>
<WeaDialogFooter ecId={`${this && this.props && this.props.ecId || ''}_WeaDialogFooter@eacpnh`} buttons={buttons} moreBtn={{datas: menus}}/>
</div>
)
]
return (
<div className="hrm_module_container">
{
containerInitFinished.init && containerInitFinished.authorized && children
}
{
containerInitFinished.init && !containerInitFinished.authorized &&
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@y9p9d6`}>
<div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
</WeaAlertPage>
}
</div>
)
}
}

View File

@ -0,0 +1,75 @@
import React, { Component } from 'react'
import {toJS} from 'mobx'
import {observer} from 'mobx-react';
import {WeaRadioGroup, WeaTable} from 'ecCom'
import {Spin} from 'antd'
import AddToGroup from './AddToGroup';
import classnames from 'classnames';
import {
i18n
} from '../../public/i18n';
import SearchRadio from './SearchRadio'
@observer
export default class GroupSearch extends Component {
constructor(props) {
super(props);
}
componentDidMount () {
const {
store
} = this.props;
const {
initData,
} = store;
initData();
}
render() {
const {store} = this.props;
const { searchColumns, searchDatas, tableProps, total, pageIndex, pageSize , getPagenitionParams, tableChange} = store;
const pagination = {
total,
current: pageIndex,
pageSize: pageSize,
showQuickJumper: true,
pageSizeOptions: [10, 20, 50, 100],
showSizeChanger: true,
showTotal: (total) => {
return `${i18n.label['18609']()} ${total} ${i18n.label['30690']()}`;
},
onShowSizeChange:(current, pageSize)=>{
getPagenitionParams(1, pageSize)
},
onChange:(current) => {
getPagenitionParams(current)
},
}
const className = classnames({
['tabPane']: true,
['tabPane-include']: store.containerInitFinished.detachable
})
const h = $('#wrap').height() - $('#group').height() - 44 - 90;
return (
<div id = 'wrap' className={className}>
<div id= 'group' >
<SearchRadio ecId={`${this && this.props && this.props.ecId || ''}_SearchRadio@1pa548`} store = {store}/>
</div>
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@9jz6k1`}
columns = {searchColumns}
dataSource = {toJS(searchDatas)}
pagination = {pagination}
style={{padding:'0 10px'}}
scroll={{y: h}}
rowKey = {record => record.id}
onChange = {(pagination, filters, sorter) => tableChange(pagination, filters, sorter)}
{...tableProps}
/>
<AddToGroup ecId={`${this && this.props && this.props.ecId || ''}_AddToGroup@o7tqr1`} store= {store} />
</div>
)
}
}

View File

@ -0,0 +1,49 @@
import React, {Component} from 'react';
import {observer} from 'mobx-react';
import BaseInfo from './info/BaseInfo';
import AttendanceType from './info/AttendanceType';
import Member from './info/Member';
// import {Tabs} from 'weaHrmComsPublic';
import {Tabs} from '../../../hrmComsPublic/index';
@observer
export default class Info extends Component{
render(){
// const {Tabs} = window.weaHrmComsPublic;
const {
store
} = this.props;
const {
editTabConfig,
formTarget,
refreshTab,
} = store;
const tabConfig = store.toJS(editTabConfig);
const {
btns,
menus,
tabBtnDef
} = store.btnsAndMenus(tabConfig);
const {memberConditionForm: form, memberConditionFormFields: fields} = formTarget;
const tabProps = {
tabConfig: tabConfig,
tabChangeHandle: tabConfig.tabChangeHandle,
activeTabInfo: {
activeTabKey: tabConfig.activeTabKey,
activeTabIndex: store.getTabIndex(tabConfig.tabs, tabConfig.activeTabKey)
},
store: store,
tabBtnDef: tabBtnDef,
conditionForm: form,
conditionFormFields: fields,
}
return (
<Tabs ecId={`${this && this.props && this.props.ecId || ''}_Tabs@gmfm28`} {...tabProps}>
<BaseInfo ecId={`${this && this.props && this.props.ecId || ''}_BaseInfo@2vj30b`} store={store} tabContent={true}/>
<AttendanceType ecId={`${this && this.props && this.props.ecId || ''}_AttendanceType@odzpjp`} store={store} tabContent={true}/>
<Member ecId={`${this && this.props && this.props.ecId || ''}_Member@ljdq0s`} store={store} height={this.props.height} tabContent={true}/>
</Tabs>
)
}
}

View File

@ -0,0 +1,94 @@
import '../../style/groupSetting.less';
import React, {Component} from 'react';
import {inject,observer} from 'mobx-react';
import {WeaTop, WeaAlertPage, WeaDialogFooter} from 'ecCom';
import {i18n} from '../../public/i18n';
import Info from './Info';
@inject('hrmGroupSetting')
@observer
export default class GroupInfoSingle extends Component{
constructor(props) {
super(props);
}
componentDidMount() {
this.init();
}
componentWillReceiveProps(nextProps) {
if (this.props.location.key !== nextProps.location.key) {
this.init();
}
}
init = () => {
const {
hrmGroupSetting: store,
params,
groupId,
callback
} = this.props;
const {id} = params;
store.checkAuthorized('kq/group', null, () => store.initSingle(groupId || id, callback), null, true);
}
render(){
const {
hrmGroupSetting: store,
location
} = this.props;
const {
single
} = location.query;
const {
containerInitFinished,
getTopProps,
} = store;
let title = i18n.label['389064']();
const {buttons, menus} = getTopProps(true);
const topProps = {
title,
icon: <i className='icon-coms-hrm'/>,
iconBgcolor: '#217346',
showDropIcon: true,
buttons: buttons,
dropMenuDatas: menus
}
let children = [];
if(single === '1')
children.push(
(
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@ijbdlj`} {...topProps}>
<div className='tabPane tabPane-include'>
<Info ecId={`${this && this.props && this.props.ecId || ''}_Info@2wsslx`} store={store} />
</div>
</WeaTop>
)
);
else
children.push(
(
<div>
<Info ecId={`${this && this.props && this.props.ecId || ''}_Info@z7afio`} store={store} />
<WeaDialogFooter ecId={`${this && this.props && this.props.ecId || ''}_WeaDialogFooter@yxagfn`} buttons={buttons} moreBtn={{datas: menus}}/>
</div>
)
)
return (
<div className="hrm_module_container">
{
containerInitFinished.init && containerInitFinished.authorized && children
}
{
containerInitFinished.init && !containerInitFinished.authorized &&
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@7nuggb`}>
<div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
</WeaAlertPage>
}
</div>
)
}
}

View File

@ -0,0 +1,183 @@
import React, { Component } from "react";
import {observer} from 'mobx-react';
import {Row, Col} from 'antd';
import { WeaLocaleProvider, WeaMap, WeaInput, WeaFormItem, WeaCheckbox, WeaInputNumber, WeaError } from "ecCom";
import has from 'lodash/has';
const getLabel = WeaLocaleProvider.getLabel;
import {i18n} from '../../public/i18n';
let map, geolocation, geocoder;
@observer
export default class Map extends Component {
constructor(props) {
super(props);
this.state = {
date: new Date().getTime()
};
}
onMapClickHandle = params => {
const {store: {onPositionSelected}} = this.props;
const {info, location} = params;
const {name, address} = info;
const data = {
locationname: name,
address: address,
longitude: location[0],
latitude: location[1]
}
onPositionSelected && onPositionSelected(data);
// this.setState({selectedPosition: data});
}
onSelectHandle = params => {
const {store: {onPositionSelected}} = this.props;
let locationname = '', address = '', longitude = '', latitude = '';
locationname = params.name;
address = params.address;
const latlng = params.location.split(',');
longitude = latlng[0];
latitude = latlng[1];
const data = {locationname,address,longitude,latitude}
onPositionSelected && onPositionSelected(data);
// this.setState({selectedPosition: data});
}
onMapSwitchHandle = type => {
}
setMapRef = map => this.map = map;
onChangeHandle = (k, v) => {
const {store} = this.props;
const {setRangeParam, rangeParams} = store;
setRangeParam(k, v);
}
gaodeRegeoCallback = (result, info) => {
const {info: rsInfo = '', status} = result || {};
const {name = '', address = ''} = info || {};
if(rsInfo.toLowerCase() == 'ok' && status == '1'){
this.props.store.setRangeParam('address', address);
}
}
googleRegeoCallback = (result, info) => {
const {name = '', address = ''} = info || {};
address != '' && this.props.store.setRangeParam('address', address);
}
render() {
const {store} = this.props;
const {rangeParams} = store;
const mapProps = {showGeolocation: true}
const {longitude, latitude} = rangeParams;
if(/^(\-)?\d+(\.\d+)?$/.test(longitude) && /^(\-)?\d+(\.\d+)?$/.test(latitude)){
Object.assign(mapProps,{position: [rangeParams.longitude, rangeParams.latitude]});
}
return (
<div style={{width: '100%', height: '100%'}}>
<div style={{width: '100%', height: 'calc(100% - 90px)'}}>
<WeaMap key={this.state.date} ecId={`${this && this.props && this.props.ecId || ''}_WeaMap@f7whz1`}
ref={this.setMapRef}
zoom={14}
showInfoWindow={true}
showSearchBar={true}
// showGeolocation={true}
clickToChangePosition={true}
onMapSwitch={this.onMapSwitchHandle}
onMapClick={this.onMapClickHandle}
onSelect={this.onSelectHandle}
onMarkerClick={this.onMapClickHandle}
gaodeRegeoCallback={this.gaodeRegeoCallback}
googleRegeoCallback={this.googleRegeoCallback}
{...mapProps}
/>
</div>
<div style={{height: 90, padding: 10}}>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@zyb531`} gutter={16}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@47jhtn`} span={12}>
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@mdlsvh`} tipPosition='bottom'
style={{width: '100%'}}
ref={d => store.setMapInfoError('locationname', d)}
error={`"${getLabel('388717','考勤地址')}" ${i18n.message.dataEmpty()}`}>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@xplgfl`}
label={getLabel('388717','考勤地址')}
labelCol={{span: 6}}
wrapperCol={{span: 18}}
>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@7vktkk`} gutter={16}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@8mzurw`} span={21}>
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@ibd2pr`} viewAttr='3' value={rangeParams.locationname} onChange={v => this.onChangeHandle('locationname', v)} />
</Col>
</Row>
</WeaFormItem>
</WeaError>
</Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@w0gtgs`} span={12}>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@ikzto2`}
label={getLabel('507863','有效识别半径')}
labelCol={{span: 6}}
wrapperCol={{span: 18}}
>
<div className='hrm_attendance_location_range_setting'>
<div className='location_range_input'>
<WeaInputNumber ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@fpztsz`}
min={100} defaultValue={Number(rangeParams.checkscope)} onChange={v => this.onChangeHandle('checkscope', v || 500)} />
</div>
<div className='location_range_tip text-elli' title={getLabel('515796','不设置默认为500米(最小值为100米)')}>{getLabel('515796','不设置默认为500米')}</div>
</div>
</WeaFormItem>
</Col>
</Row>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@7o4ywo`} gutter={16}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@ti62b3`} span={12}>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@emcsae`}
label={getLabel('389220','详细地址')}
labelCol={{span: 6}}
wrapperCol={{span: 18}}
className='hrm_attendance_location_range_address'
>
<div className='text-elli' style={{lineHeight: '30px'}} title={rangeParams.address}>{rangeParams.address}</div>
</WeaFormItem>
</Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@k7wox8`} span={12}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@lklcn4`} span={12}>
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@h60rgp`} tipPosition='bottom'
style={{width: '100%'}}
ref={d => store.setMapInfoError('longitude', d)}
error={`"${getLabel('801','经度')}" ${i18n.message.dataEmpty()}`}
>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@d543pn`}
label={getLabel('801','经度')}
labelCol={{span: 12}}
wrapperCol={{span: 10}}
>
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@8tro40`} viewAttr='3' value={rangeParams.longitude} onChange={v => this.onChangeHandle('longitude', v)}/>
</WeaFormItem>
</WeaError>
</Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@8rj1w3`} span={11} offset={1}>
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@kpatji`} tipPosition='bottom'
style={{width: '100%'}}
ref={d => store.setMapInfoError('latitude', d)}
error={`"${getLabel('802','纬度')}" ${i18n.message.dataEmpty()}`}
>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@xaq7nz`}
label={getLabel('802','纬度')}
labelCol={{span: 12}}
wrapperCol={{span: 10}}
>
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@5esiei`} viewAttr='3' value={rangeParams.latitude} onChange={v => this.onChangeHandle('latitude', v)}/>
</WeaFormItem>
</WeaError>
</Col>
</Col>
</Row>
</div>
</div>
);
}
}

View File

@ -0,0 +1,18 @@
import React, { Component } from 'react'
import {WeaRadioGroup} from 'ecCom'
import {toJS} from 'mobx'
import {observer} from 'mobx-react';
@observer
export default class SearchRadio extends Component {
render() {
const {store} = this.props;
const {config, radioChange} = store;
return (
<div>
<WeaRadioGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaRadioGroup@d6yf37`} config={toJS(config)} onChange = {(data) => radioChange(data)} border style={{margin:'20px 10px'}}/>
</div>
)
}
}

View File

@ -0,0 +1,64 @@
import React, { Component } from "react";
import { WeaDialog, WeaLocaleProvider, WeaNewScroll, WeaSearchGroup } from "ecCom";
import { inject, observer } from 'mobx-react';
import { Button } from "antd";
// import img1URL from '../../../../../hrm/hrm_e9/image/addattendancegroup1.png';
const getLabel = WeaLocaleProvider.getLabel;
@inject('hrmGroupSetting')
@observer
export default class Illdialog extends Component {
constructor(props) {
super(props);
}
render () {
const { hrmGroupSetting } = this.props;
return (
<div className={'wea-explain'}>
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@jmjjll`}
title={getLabel('529754', '工作时长计算方式说明')}
onCancel={hrmGroupSetting.calmethodcancel}
visible={hrmGroupSetting.illustrateVisible}
icon={'icon-coms-hrm'}
iconBgcolor={'#217346'}
style={{ width: 900, height: 750 }}
hasScroll
button={<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@dcsfmm`}>nih</Button>}
>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@a5bh4b`}
height={700}
><div className={'Computational_Method'}>
<div className={'summation'}>
<div className={'topbar1'}>{getLabel('529755', '打卡时间累加计算说明')}</div>
<p>{getLabel('529756', '1.弹性工时制设置考勤开始时间为7:00工作时长设置为8小时')}</p>
<p>{getLabel('529757', '2.假设当天打卡5次打卡时间点分别为9:00、12:00 、1400 、16:00、18:00.')}</p>
<p>{getLabel('529758', '3.打卡时间累加计算是按照打卡时间一直累加进行计算工作时长,本质上是按照【最晚打卡时间 - 最早打卡时间】计算工作时长 。如下图所示:')}</p>
<div className={'imgExplain1'}>
<span className={'tuli'}>{getLabel('529759', '图例说明')}</span>
<span className={'time'}>{getLabel('16039', '考勤开始时间')}</span>
<span className={'duration'}>{getLabel('529760', '有效工作时长')}</span>
</div>
<div className={'img1'}><img src={'/hrm/hrm_e9/image/addattendancegroup1.png'} /></div>
</div>
<div className={'double_summation'}>
<div className={'topbar2'}>{getLabel('529761', '打卡时间成对计算说明')} </div>
<p>{getLabel('529756', '1.弹性工时制设置考勤开始时间为7:00工作时长设置为8小时')}</p>
<p>{getLabel('529757', '2.假设当天打卡5次打卡时间点分别为9:00、12:00 、1400 、16:00、18:00.')}</p>
<p>{getLabel('529762', '3.打卡时间成对计算即按照【签退-签到】成对进行工作时长的计算,此方式的好处是可以过滤掉午休、晚休时段不计算工作时长 。如下图所示:')}</p>
<div className={'imgExplain2'}>
<span className={'tuli'}>{getLabel('529759', '图例说明')}</span>
<span className={'time'}>{getLabel('16039', '考勤开始时间')}</span>
<span className={'duration'}>{getLabel('529760', '有效工作时长')}</span>
<span className={'rest'}>{getLabel('388417', '休息时间')}</span>
<span className={'nouse'}>{getLabel('529763', '无效工作时长')}</span>
</div>
<div className={'img2'}><img src={"/hrm/hrm_e9/image/addattendancegroup2.png"} /></div>
</div>
</div>
</WeaNewScroll>
</WeaDialog>
</div>
);
}
}

View File

@ -0,0 +1,127 @@
import '../../style/groupSetting.less';
import React, { Component } from 'react';
import { inject, observer } from 'mobx-react';
import { WeaTop, WeaAlertPage, WeaLeftRightLayout, WeaTab, WeaLocaleProvider } from 'ecCom';
import { i18n } from '../../public/i18n';
import { Spin } from 'antd'
import Content from './Content';
import GroupSearch from './GroupSearch';
// import {Tabs, OrganizationTree} from 'weaHrmComsPublic';
import { Tabs, OrganizationTree } from '../../../hrmComsPublic/index';
import IllustrateDialog from './illustrateDialog'
import Edit from './Edit';
const getLabel = WeaLocaleProvider.getLabel;
@inject('hrmGroupSetting')
@observer
export default class ShiftManager extends Component {
constructor(props) {
super(props);
}
componentDidMount () {
this.init();
}
componentWillReceiveProps (nextProps) {
if (this.props.location.key !== nextProps.location.key) {
this.init();
this.refs.orgTree && this.refs.orgTree.refs.tree.fetchData();
}
}
init = () => {
const {
hrmGroupSetting: store
} = this.props;
store.checkAuthorized('kq/group', null, store.init, null, true);
}
render () {
// const {Tabs, OrganizationTree} = window.weaHrmComsPublic;
const {
hrmGroupSetting: store
} = this.props;
const {
containerInitFinished,
selectedSubCompany,
orgTreeProps,
getTopProps,
mainTabConfig,
formTarget,
tableMultiDelete,
tabChangeHandle,
mainActiveTabKey,
getRowKey,
loading,
canAdd,
canCreate,
canDel
} = store;
let title = getLabel('500388', '考勤组管理');
if (selectedSubCompany != null && selectedSubCompany.name)
title = `${title} - ${selectedSubCompany.name}`;
const { buttons, menus } = getTopProps();
const { conditionForm: form, conditionFormFields: fields } = formTarget;
const topProps = {
title,
icon: <i className='icon-coms-hrm' />,
iconBgcolor: '#217346',
showDropIcon: true,
buttons: buttons,
dropMenuDatas: menus
}
const tabProps = {
tabConfig: mainTabConfig,
activeTabInfo: {
activeTabKey: mainTabConfig.activeTabKey,
activeTabIndex: store.getTabIndex(mainTabConfig.tabs, mainTabConfig.activeTabKey)
},
rightMenu: menus,
store: store,
conditionForm: form,
conditionFormFields: fields,
tabChangeHandle: tabChangeHandle
}
return (
<div className="hrm_module_container groupSetting">
{
containerInitFinished.init && containerInitFinished.authorized &&
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@bofvhr`} spinning={loading}>
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@n7yial`} {...topProps}>
{
containerInitFinished.detachable
?
<WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@7ew6a0`}
leftCom={<OrganizationTree ecId={`${this && this.props && this.props.ecId || ''}_OrganizationTree@ag0fzz`} {...orgTreeProps} ref='orgTree' />}
leftWidth={310}
>
<Tabs ecId={`${this && this.props && this.props.ecId || ''}_Tabs@yq1dit`} {...tabProps}>
<Content ecId={`${this && this.props && this.props.ecId || ''}_Content@61tib7`} store={store} />
<GroupSearch ecId={`${this && this.props && this.props.ecId || ''}_GroupSearch@zydq26`} store={store} />
</Tabs>
</WeaLeftRightLayout>
:
<Tabs ecId={`${this && this.props && this.props.ecId || ''}_Tabs@o4zix6`} {...tabProps}>
<Content ecId={`${this && this.props && this.props.ecId || ''}_Content@b3iymc`} store={store} />
<GroupSearch ecId={`${this && this.props && this.props.ecId || ''}_GroupSearch@0gnkq3`} store={store} />
</Tabs>
}
<Edit ecId={`${this && this.props && this.props.ecId || ''}_Edit@d67ad8`} store={store} />
<IllustrateDialog ecId={`${this && this.props && this.props.ecId || ''}_IllustrateDialog@xcu8fb`} />
</WeaTop>
</Spin>
}
{
containerInitFinished.init && !containerInitFinished.authorized &&
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@zob4mz`}>
<div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
</WeaAlertPage>
}
</div>
)
}
}

View File

@ -0,0 +1,54 @@
import React, {Component} from 'react';
import {observer} from 'mobx-react';
import {WeaNewScroll} from 'ecCom';
import classnames from 'classnames';
import LocationEdit from './LocationEdit';
import WifiEdit from './WifiEdit';
// import {FormInfo} from 'weaHrmComsPublic';
import {FormInfo} from '../../../../hrmComsPublic/index';
@observer
export default class AttendanceType extends Component{
render(){
// const {FormInfo} = window.weaHrmComsPublic;
const {
store
} = this.props;
const {
formTarget,
custLabelCol,
itemRender,
childrenComponents,
refreshTab,
locationTableMultiDelete,
wifiTableMultiDelete
} = store;
const {
kqTypeForm: form,
kqTypeFormFields: fields
} = formTarget;
const className = classnames({
['tabPane']: true,
['tabPane-dialog']: true,
})
return (
<div className={className}>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@kffmyy`} height={'100%'}>
<FormInfo ecId={`${this && this.props && this.props.ecId || ''}_FormInfo@1shhry`}
className='formComponent'
center={false}
custLabelCol={custLabelCol}
form={form}
formFields={fields}
itemRender={itemRender}
childrenComponents={childrenComponents()} />
<div id="downloadDiv" style={{display: 'none'}}>
</div>
</WeaNewScroll>
<LocationEdit ecId={`${this && this.props && this.props.ecId || ''}_LocationEdit@u8laa7`} store={store} />
<WifiEdit ecId={`${this && this.props && this.props.ecId || ''}_WifiEdit@x6uhzh`} store={store} />
</div>
)
}
}

View File

@ -0,0 +1,52 @@
import classnames from 'classnames';
import { WeaNewScroll } from 'ecCom';
import { observer } from 'mobx-react';
import React, { Component } from 'react';
import SerialSetting from './SerialSetting';
// import {FormInfo} from 'weaHrmComsPublic';
import {FormInfo} from '../../../../hrmComsPublic/index';
@observer
export default class BaseInfo extends Component{
render(){
// const {FormInfo} = window.weaHrmComsPublic;
const {
store,
tabContent
} = this.props;
const {
formTarget,
custLabelCol,
itemRender,
childrenComponents,
workdaySettingData,
bChange
// refreshTab
} = store;
const {
baseForm: form,
baseFormFields: fields
} = formTarget;
const className = classnames({
['tabPane']: tabContent || false,
['tabPane-dialog']: tabContent || false,
['dCom']: !(tabContent || false)
})
return (
<div className={className}>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@03k6z3`} height={'100%'}>
<FormInfo ecId={`${this && this.props && this.props.ecId || ''}_FormInfo@0q9p46`}
className='formComponent'
center={false}
custLabelCol={custLabelCol}
form={form}
formFields={fields}
itemRender={itemRender}
childrenComponents={childrenComponents()} />
</WeaNewScroll>
<SerialSetting ecId={`${this && this.props && this.props.ecId || ''}_SerialSetting@jukdt3`} store={store} />
</div>
)
}
}

View File

@ -0,0 +1,57 @@
/*
* @Author: sunjun
* @Date: 2020-08-07 15:01:37
* @LastEditTime: 2020-11-18 09:00:06
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /hrmAttendance/components/groupSetting/info/LocationEdit.js
*/
import React, {Component} from 'react';
import {observer} from 'mobx-react';
import {WeaDialog} from 'ecCom';
import {Button} from 'antd';
import {i18n} from '../../../public/i18n';
import Map from '../Map';
@observer
export default class WifiEdit extends Component{
onScale = (evt, state) => {
}
onChangeHeight = height => {
// 高度变化回调
};
render(){
const {
store
} = this.props;
const {locationDialogParams, formTarget} = store;
const {
locationForm: form,
locationFormFields: fields
} = formTarget;
const generateDialogParams = () =>{
const props = {...locationDialogParams};
let buttons = [<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@f6u856`} type='primary' op='create' onClick={() => store.saveLocation()}>{i18n.label.save()}</Button>];
Object.assign(props, {
buttons,
moreBtn: {datas: store.convertToMenus(buttons)},
scalable: true,
onScale: this.onScale,
onChangeHeight: this.onChangeHeight
// key: new Date().getTime()
})
return props;
}
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@586mgu`} {...generateDialogParams()}>
{
locationDialogParams.visible &&
<Map ecId={`${this && this.props && this.props.ecId || ''}_Map@lkdufc`} placeSearch store={store}/>
}
</WeaDialog>
)
}
}

View File

@ -0,0 +1,55 @@
import React, {Component} from 'react';
import {observer} from 'mobx-react';
import {WeaAuth} from 'ecCom';
import classnames from 'classnames';
import {
WeaTableNew
} from 'comsMobx';
const {
WeaTable
} = WeaTableNew;
@observer
export default class Member extends Component{
doDel = id => this.props.store.deleteMember({ids: id});
onOperatesClick = (record, index, operate) => {
const func = operate.href ? operate.href.split(':')[1].split('(')[0] : '';
const id = record.id ? record.id : '';
this[func] && this[func](id);
}
render(){
const {
store
} = this.props;
const {
refreshTab,
memberAuthParams
} = store;
const className = classnames({
['tabPane']: true,
['tabPane-dialog']: true
})
const tableProps = {
scroll: {
y: this.props.height - 130
}
}
return (
<div className={className}>
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@akyh7j`}
comsWeaTableStore={store.memberTable}
hasOrder={true}
needScroll={true}
{...tableProps}
onOperatesClick={(record, index, operate) => this.onOperatesClick(record, index, operate)}
/>
{
memberAuthParams.visible && <WeaAuth ecId={`${this && this.props && this.props.ecId || ''}_WeaAuth@1elfx3`} {...memberAuthParams} />
}
</div>
)
}
}

View File

@ -0,0 +1,51 @@
import React, {Component} from 'react';
import {observer} from 'mobx-react';
import {WeaNewScroll, WeaDialog} from 'ecCom';
import {Button} from 'antd';
import {i18n} from '../../../public/i18n';
// import {FormInfo} from 'weaHrmComsPublic';
import {FormInfo} from '../../../../hrmComsPublic/index';
@observer
export default class SerialSetting extends Component{
render(){
// const {FormInfo} = window.weaHrmComsPublic;
const {
store
} = this.props;
const {
formTarget,
custLabelCol,
itemRender,
childrenComponents,
serialDialogParams
} = store;
const {
shiftSchedulceForm: form,
shiftSchedulceFormFields: fields
} = formTarget;
const generateDialogParams = () =>{
const props = {...serialDialogParams};
let buttons = [<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ia1n1n`} type='primary' op='create' onClick={() => store.saveSerial()}>{i18n.label.save()}</Button>];
Object.assign(props, {
buttons,
moreBtn: {datas: store.convertToMenus(buttons)},
// key: new Date().getTime()
})
return props;
}
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@pe32n6`} {...generateDialogParams()}>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@514we0`} height={'100%'}>
<FormInfo ecId={`${this && this.props && this.props.ecId || ''}_FormInfo@7ncxfc`}
className='formComponent serialSetting'
form={form}
formFields={fields}
itemRender={itemRender}
childrenComponents={childrenComponents()}/>
</WeaNewScroll>
</WeaDialog>
)
}
}

View File

@ -0,0 +1,81 @@
import React, {Component} from 'react';
import {observer} from 'mobx-react';
import {Table} from "antd";
import {WeaLocaleProvider} from 'ecCom';
import uniq from 'lodash/uniq';
import find from 'lodash/find';
const getLabel = WeaLocaleProvider.getLabel;
@observer
export default class SerialTableList extends Component{
render(){
const {
store: {toJS, serialTableProps, getShiftCycleForm, deleteSerial, groupShiftOptions}
} = this.props;
let {
columns,
datas,
} = serialTableProps;
columns = columns.map(c => {
if(c.dataIndex == 'serial'){
return {
...c,
render: (text, record, index) => {
const {serial} = record;
let arr = serial.split(',');
let coms = [];
uniq(arr).map(key => {
if(key != '-1'){
const d = find(toJS(groupShiftOptions), {key});
const showname = (d != null ? d.showname : '');
coms.push(
<div style={{width: 210}} className='text-elli' title={showname}>{showname}</div>
)
}
});
return coms;
}
}
}else if(c.dataIndex == 'operate'){
return {
...c,
render: (text, record) => {
return (
<div>
<span>
<a onClick={() => getShiftCycleForm(record)}>{getLabel('93','编辑')}</a>
</span>
<span style={{marginLeft: '10px'}}>
<a onClick={() => deleteSerial(record)}>{getLabel(131966, '删除')}</a>
</span>
</div>
)
}
}
}else if(c.dataIndex == 'shiftcyclename'){
return {
...c,
render: (text, record) => {
return (
<div className='text-elli' style={{width: 210}} title={record.shiftcyclename}>
{record.shiftcyclename}
</div>
)
}
}
}else
return c;
})
return (
<div className="workdaySetting">
<div className="table">
<Table ecId={`${this && this.props && this.props.ecId || ''}_Table@cccbhs`}
pagination={false}
columns={columns}
dataSource={datas}
/>
</div>
</div>
)
}
}

View File

@ -0,0 +1,54 @@
import React, {Component} from 'react';
import {observer} from 'mobx-react';
import {WeaNewScroll, WeaDialog} from 'ecCom';
import {Button} from 'antd';
import {i18n} from '../../../public/i18n';
// import {FormInfo} from 'weaHrmComsPublic';
import {FormInfo} from '../../../../hrmComsPublic/index';
@observer
export default class WifiEdit extends Component{
render(){
// const {FormInfo} = window.weaHrmComsPublic;
const {
store
} = this.props;
const {
formTarget,
custLabelCol,
itemRender,
wifiDialogParams
} = store;
const {
wifiForm: form,
wifiFormFields: fields
} = formTarget;
const generateDialogParams = () =>{
const props = {...wifiDialogParams};
let buttons = [<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@y01xb8`} type='primary' op='create' onClick={() => store.saveWifi()}>{i18n.label.save()}</Button>];
Object.assign(props, {
buttons,
moreBtn: {datas: store.convertToMenus(buttons)},
// key: new Date().getTime()
})
return props;
}
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@ifctwp`} {...generateDialogParams()}>
{
wifiDialogParams.visible &&
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@nsp6u1`} height={'100%'}>
<FormInfo ecId={`${this && this.props && this.props.ecId || ''}_FormInfo@p297rs`}
className='formComponent'
center={false}
custLabelCol={custLabelCol}
form={form}
formFields={fields}
itemRender={itemRender}/>
</WeaNewScroll>
}
</WeaDialog>
)
}
}

View File

@ -0,0 +1,325 @@
import {
inject,
observer
} from 'mobx-react';
import {
WeaFormItem,
WeaInputNumber,
WeaLocaleProvider,
} from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;
@inject('commonStore')
@inject('hrmHolidayRule')
@observer
class BalanceConversionRules extends React.Component {
constructor(props) {
super(props);
}
handleConversionRulesChange = (index, value) => {
this.props.hrmHolidayRule.changeBalanceConversionRules(index, value);
}
handleDelClick = () => {
this.props.hrmHolidayRule.delBalanceConversionRule();
}
handleAddClick = () => {
this.props.hrmHolidayRule.addBalanceConversionRule();
}
handleTimeIntervalChange = (value) => {
this.props.hrmHolidayRule.setTimeInterval(value);
}
getHeader = (params) => {
const {
distributionMode,
timeInterval
} = params;
return (
<div className='hrm-customized-input' style={{borderBottom: '1px solid #eee',marginBottom: 10,paddingBottom: 10}}>
<span style={{marginRight: 3}}>
<i className='icon-coms-Tile' />
<b style={{marginLeft: 5}}>
{ distributionMode === '2' ? getLabel('505548',"司龄") : getLabel('505549',"工龄")}
{`${getLabel('505550',"区间")} : `}
</b>
</span>
<WeaInputNumber ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@mh11rp`}
min={0}
value={timeInterval}
onChange={this.handleTimeIntervalChange.bind(this)}/>
<span>
<b>{getLabel('505552',"年")}</b>
</span>
</div>
)
}
getBalancePaymentMethods = (params) => {
const {
balanceConversionRules,
distributionMode,
minimumUnit
} = params;
const balancePaymentMethods = [];
balanceConversionRules.map((balanceConversionRule, index) => {
const {
timePoint,
amount
} = balanceConversionRule;
balancePaymentMethods.push(
<div className='hrm-customized-input' style={{position:'relative'}}>
<span>
{ distributionMode === '2' ? getLabel('505548',"司龄") : getLabel('505549',"工龄")}
</span>
<span>
{`${index === 0 ? '<' : '≥'}`}
</span>
<span>
{`${[0,1].includes(index) ? 1 : timePoint}${getLabel('505552',"年")} , ` }
</span>
<span>
{getLabel('505551',"享有")}
</span>
<WeaInputNumber ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@zpqebb@${index}`}
viewAttr={3}
value={amount}
min={0}
onChange={this.handleConversionRulesChange.bind(this,index)}/>
<span>
{`${minimumUnit === '3' ? getLabel('391',"小时") : getLabel('505553',"天")}${getLabel('505554',"假")}`}
</span>
{( (index > 1) && index === (balanceConversionRules.length - 1) ) && <span className='wea-f14' style={{position:'absolute',top:7, marginLeft: 10}} onClick={this.handleDelClick}>
<i className='icon-coms-Clear hrm-del-icon' />
</span>}
</div>
)
})
return balancePaymentMethods;
}
render() {
const {
commonStore,
hrmHolidayRule
} = this.props, {
formElements,
} = commonStore, {
conversionRules,
} = hrmHolidayRule, {
timeInterval,
balanceConversionRules
} = conversionRules, {
form
} = formElements;
const {
distributionMode,
minimumUnit
} = form.getFormParams();
return (<div style={{padding:15, border: '1px solid #D9D9D9'}}>
{this.getHeader({
distributionMode,
timeInterval
})}
{this.getBalancePaymentMethods({
balanceConversionRules,
distributionMode,
minimumUnit,
})}
<span className='holiday-link' onClick={this.handleAddClick}>
<i className='icon-coms-Add-to-o'/>
<span style={{marginLeft: 5}}>{getLabel('505555',"添加规则")}</span>
</span>
</div>)
}
}
@inject('commonStore')
@inject('hrmHolidayRule')
@observer
class MixBalanceConversionRulesNew extends React.Component {
constructor(props) {
super(props);
}
getHeader = () => {
const {
formElements,
} = this.props.commonStore, {
form
} = formElements, {
minimumUnit
} = form.getFormParams();
const labels = [getLabel('505549', "工龄"), getLabel('505548', "司龄"), getLabel('505556', "法定年假"), getLabel('505557', "福利年假")];
return (
<div style={{padding: '12px 0', backgroundColor:'#eee' }}>
{
labels.map( (label,index) => {
let unit;
if([0,1].includes(index)){
unit = getLabel('505552',"年");
}else{
unit = (minimumUnit === '3') ? getLabel('391',"小时") : getLabel('505553',"天");
}
return (
<div className='hrm-over-flow' style={{display:'inline-block', width: [0,1].includes(index) ? 70 : 97,textAlign: 'center' }} title={`${label}(${unit})`}>
<i className='icon-coms-Tile'/>
<span style={{marginLeft: 5}}>{`${label}(${unit})`}</span>
</div>
)
})
}
</div>
)
}
getBalancePaymentMethods = () => {
const {
conversionRules,
changeEntryTime,
changeWorkYear,
changeLegalAmount,
changeWelfareAmount,
delBalanceConversionRule,
} = this.props.hrmHolidayRule, {
mixBalanceConversionRules
} = conversionRules;
const balancePaymentMethods = [];
const ageInputNumber = (params) => {
const {
value,
handleChange
} = params;
return (
<span>
<span><b></b></span>
<span style={{display: 'inline-block',width: 45,marginLeft: 5}}>
<WeaInputNumber ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@9813ys`}
viewAttr={3}
min={0}
value={value}
onChange={val => handleChange(val)}
/>
</span>
</span>
)
}
const balanceInputNumber = (params) => {
const {
value,
handleChange
} = params;
return (
<span style={{display: 'inline-block',width: 75}}>
<WeaInputNumber ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@1rfi21`}
viewAttr={3}
min={0}
value={value}
onChange={val => handleChange(val)}
/>
</span>
)
}
mixBalanceConversionRules.map((mixBalanceConversionRule, outsideIndex) => {
const {
entryTime,
workYear,
legalAmount,
welfareAmount,
} = mixBalanceConversionRule;
balancePaymentMethods.push(
<div style={{lineHeight: '45px',borderBottom: '1px solid #eee',position:'relative' }}>
<span>
{
ageInputNumber({
value: workYear,
handleChange: (val) => changeWorkYear(outsideIndex, val)
})
}
</span>
<span style={{marginLeft: 15}}>
{
ageInputNumber({
value: entryTime,
handleChange: (val) => changeEntryTime(outsideIndex, val)
})
}
</span>
<span style={{marginLeft: 20}}>
{
balanceInputNumber({
value: legalAmount,
handleChange: (val) => changeLegalAmount(outsideIndex, val)
})
}
</span>
<span style={{marginLeft: 23}}>
{
balanceInputNumber({
value: welfareAmount,
handleChange: (val) => changeWelfareAmount(outsideIndex, val)
})
}
</span>
{
(outsideIndex > 0 && outsideIndex === (mixBalanceConversionRules.length - 1) ) && (
<span style={{position: 'absolute',right: -10,top: 2}} className='wea-f14' onClick={() => delBalanceConversionRule({type:'mix'}) }>
<i className='icon-coms-Clear hrm-del-icon' />
</span>
)
}
</div>
)
})
return balancePaymentMethods
}
render() {
const {
hrmHolidayRule
} = this.props, {
addBalanceConversionRule
} = hrmHolidayRule;
return (
<div style={{padding:15, border: '1px solid #D9D9D9'}}>
<div style={{clear:'both',marginTop: 8}}>
{this.getHeader()}
{this.getBalancePaymentMethods()}
<span className='holiday-link' style={{display: 'inline-block', marginTop: 6}} onClick={() => addBalanceConversionRule({type:'mix'})}>
<i className='icon-coms-Add-to-o' />
<span style={{marginLeft: 5}}>
{getLabel('505555',"添加规则")}
</span>
</span>
</div>
</div>
);
}
}
export {
BalanceConversionRules,
MixBalanceConversionRulesNew,
}

View File

@ -0,0 +1,323 @@
import {
inject,
observer
} from 'mobx-react';
import {
WeaDialog,
WeaFormItem,
WeaLocaleProvider,
} from 'ecCom';
import {
WeaSwitch
} from 'comsMobx';
import {
MagicForm,
} from '../../public/sweet-form.js';
import {
Loading,
} from '../../public/learn.js';
import {
getDialogButtons,
confirmation,
} from '../../util/save-time-util.js';
import {
BalanceConversionRules,
MixBalanceConversionRulesNew
} from './BalanceConversionRules.js';
const getLabel = WeaLocaleProvider.getLabel;
@inject('commonStore')
@inject('hrmHolidayRule')
@observer
class Dialog extends React.Component {
constructor(props) {
super(props);
}
handleCancel = () => {
this.props.commonStore.closeDialog();
}
//获取弹框按钮的配置数据
getBtnConfigDatas = () => {
const {
saveFormDatas,
formElements,
table,
dialog
} = this.props.commonStore, {
loading,
} = formElements, {
index
} = table, {
type
} = dialog;
const {
syncVacationRules,
isEnable,
confirmBeforeSave,
} = this.props.hrmHolidayRule;
const name = ['-1', '0'].includes(index) ? getLabel('505564', '保存') : getLabel('19015', "同步");
const saveHoliday = (type === 0) ? saveFormDatas : confirmBeforeSave;
const callBack = ['-1', '0'].includes(index) ? saveHoliday : syncVacationRules;
const btnDatas = [];
if (isEnable === '1') {
btnDatas.push({
name: name,
disabled: loading,
onBtnClick: callBack
});
}
return btnDatas;
}
//获取同一行的表单元素
getTransverseSiblingComponents = (params) => {
const {
items,
form
} = params;
//当没有表单元素传入时,直接返回
if (!items) return
let extendedDays, expirationDay;
items.map((item, index) => {
const {
domkey
} = item;
if (domkey[0] === 'extendedDays') {
//当【允许延长有效期】开关关闭时,什么也不返回
const extensionEnableValue = form.getFormParams().extensionEnable;
if (!parseInt(extensionEnableValue)) return;
//同一行的第二个表单元素
extendedDays = (
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@mmxnti@${index}`}
label={`${getLabel('505558',"超过有效期")}`}
colon={false}
labelCol={{span: 5}}
wrapperCol={{span: 18}}
error={form.getError(item) }
tipPosition='bottom'
style={{float:'right',width:'86%',marginBottom: 0}}
>
<div style={{display: 'inline-block',width: 60,marginRight:13}}>
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@dyqkol@${index}`} fieldConfig={item} form={form} formParams={form.getFormParams()} />
</div>
{`${getLabel('505553',"天")}${getLabel('505559',"内")}${getLabel('505560',"可继续使用")}`}
</WeaFormItem>
)
}
if (domkey[0] === 'expirationDay') {
expirationDay = (
<div style={{marginLeft: 10, display:'inline-block'}}>
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@3s19ez@${index}`} fieldConfig={item} form={form} formParams={form.getFormParams()} />
</div>
)
}
});
const transverseSiblingComponents = {
'extensionEnable': extendedDays,
'expirationMonth': expirationDay
};
return transverseSiblingComponents;
}
//【余额发放方式】开关联动自定义组件
getCustomizedComponent = (params) => {
const {
form
} = params, {
distributionMode
} = form.getFormParams();
if (!['2', '3', '6'].includes(distributionMode)) return
const relationShip = {
'distributionMode': distributionMode !== '6' ? <BalanceConversionRules ecId={`${this && this.props && this.props.ecId || ''}_BalanceConversionRules@farn38`} /> : <MixBalanceConversionRulesNew ecId={`${this && this.props && this.props.ecId || ''}_MixBalanceConversionRulesNew@b6kx3x`} />
}
return relationShip;
}
handleFormChange = (cb) => {
const key = Object.keys(cb)[0];
const value = cb[key].value;
const {
formElements,
} = this.props.commonStore, {
form,
} = formElements;
//切换【应用范围】,重置【分部】浏览按钮
(key === 'scopeType' && value === '0') && ['scopeValue'].map(key => {
form.updateFields({
[key]: []
});
});
//下拉框【请假单位】选中项不为'1','3'项时,或【计算请假时长方式】不为第'1'项时,重置【日折算时长】
((key === 'minimumUnit' && !['1', '3'].includes(value)) || (key === 'computingMode') && value !== '1') && ['hoursToDay'].map(key => {
this.updateFormFields(key, 8);
});
//关闭【启用假期余额】开关后,重置【余额发放方式】、【有效期规则】、【允许延长有效期】和【释放规则】
(key === 'balanceEnable' && value === '0') && ['distributionMode', 'validityRule', 'extensionEnable', 'releaseRule'].map((key, index) => {
const val = [2, 3].includes(index) ? '0' : '1';
this.updateFormFields(key, val);
});
//下拉框【余额发放方式】选中项不为2、3、6项时重置定制化组件数据
(key === 'distributionMode' && !['2', '3', '6'].includes(value)) && ['resetBalanceConversionRules'].map(f => {
this.props.hrmHolidayRule[f]()
});
//下拉框【余额发放方式】选中项不为【每年自动发放固定天数】时,重置【每人发放天数】
(key === 'distributionMode' && value !== '4') && ['annualAmount'].map(key => {
this.updateFormFields(key, 1);
});
//下拉框【有效期规则】选中项不为【自定义次年失效日期】时,重置【失效日期】
(key === 'validityRule' && value !== '3') && ['expirationMonth', 'expirationDay'].map(key => {
this.updateFormFields(key, '1');
});
//关闭【允许延长有效期】开关后重置开关后面的Input框
(key === 'extensionEnable' && value === '0') && ['extendedDays'].map((key, index) => {
this.updateFormFields(key, 90);
});
if (key === 'minimumUnit') {
this.props.hrmHolidayRule.handleMinimumUnitChange(value)
}
}
//更新表单元素的值
updateFormFields = (key, val) => {
const {
formElements,
} = this.props.commonStore, {
form,
} = formElements;
form.updateFields({
[key]: {
value: val
}
});
}
getTransverseSecondComponent = (conditions) => {
if (conditions.length === 0) return;
let transverseSecondComponents = [];
conditions[0].items.map(item => {
const {
domkey
} = item;
if (['extendedDays', 'expirationDay'].includes(domkey[0])) {
transverseSecondComponents.push(item);
}
});
return transverseSecondComponents
}
getLabels = (form) => {
const {
minimumUnit
} = form.getFormParams();
const label = (minimumUnit !== '3') ? getLabel('389334', "每人发放天数") : getLabel('388956', "每人发放小时数");
return {
'annualAmount': label
}
}
render() {
const {
commonStore,
hrmHolidayRule
} = this.props, {
dialog,
dialogStaticProps,
formElements,
table,
} = commonStore, {
style,
formConfig,
dynamicTips,
renderBlacklist,
} = hrmHolidayRule, {
title,
visible,
} = dialog, {
form,
date,
loading,
conditions
} = formElements, {
index
} = table;
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@c49fzl`}
title={title}
visible={visible}
style={style}
buttons={getDialogButtons({datas:this.getBtnConfigDatas()})}
onCancel={this.handleCancel}
{...dialogStaticProps}
>
{
loading
? <Loading ecId={`${this && this.props && this.props.ecId || ''}_Loading@8zomd8`} size='sm' />
: ['-1','0'].includes(index)
? <MagicForm ecId={`${this && this.props && this.props.ecId || ''}_MagicForm@gyari6`}
{...formElements}
{...formConfig}
renderBlacklist={renderBlacklist}
date={date}
isFormInit={form.isFormInit}
dynamicTips={dynamicTips}
labels={this.getLabels(form)}
transverseSiblingComponents={this.getTransverseSiblingComponents({
form,
items: this.getTransverseSecondComponent(conditions),
})}
customizations={this.getCustomizedComponent({
form
})}
onFormElementsChange={this.handleFormChange}
/>
: <MagicForm ecId={`${this && this.props && this.props.ecId || ''}_MagicForm@wcmwb2`}
{...formElements}
date={date}
isFormInit={form.isFormInit}/>
}
</WeaDialog>
)
}
}
export default Dialog

View File

@ -0,0 +1,59 @@
import {
inject,
observer
} from 'mobx-react';
import {
WeaTab,
} from 'ecCom';
@inject('commonStore')
@inject('hrmHolidayRule')
@observer
class Search extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.props.commonStore.getSearchCondition();
}
setShowSearchAd = (bool) => {
this.props.commonStore.changeSearchPanelStatus(bool);
}
handleSearch = () => {
this.props.commonStore.getSearchList();
}
handleSearchChange = (val) => {
this.props.commonStore.changeAdvanceSearchField(val);
}
render() {
const {
search,
searchBaseValue,
searchsAd,
buttonsAd,
advanceHeight
} = this.props.commonStore, {
isPanelShow,
} = search;
return (
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@37tovc`}
searchsBaseValue={searchBaseValue}
searchsAd={searchsAd}
buttonsAd={buttonsAd}
showSearchAd={isPanelShow}
advanceHeight={advanceHeight}
setShowSearchAd={this.setShowSearchAd}
onSearch={this.handleSearch}
onSearchChange={this.handleSearchChange}
hasMask={false}
searchType={['base','advanced']}/>
)
}
}
export default Search

View File

@ -0,0 +1,143 @@
import {
observer,
inject
} from 'mobx-react';
import {
WeaCheckbox,
WeaLocaleProvider,
} from 'ecCom';
import {
WeaTableNew
} from 'comsMobx';
import {
confirmation,
} from '../../util/save-time-util.js';
const WeaTable = WeaTableNew.WeaTable;
const getLabel = WeaLocaleProvider.getLabel;
@inject('commonStore')
@inject('hrmHolidayRule')
@observer
class Table extends React.Component {
constructor(props) {
super(props);
this.editParams = {
title: getLabel('388998', "编辑假期"),
type: 1,
}
}
componentDidMount() {
this.init();
}
init = () => {
this.props.commonStore.getSearchList();
}
componentWillUnmount() {
this.props.commonStore.resetTable();
}
reRenderColumns = (columns) => {
const {
handleCkChange,
collectCheckedId,
} = this.props.hrmHolidayRule;
columns.map(c => {
if (c.dataIndex === 'leaveName') {
c.render = (t, r) => {
const {
leaveNamespan,
randomFieldId
} = r;
return <a onClick={() => ['setSelectedRowId','setSelectedRowIndex' ,'openDialog'].map( (f,i) => {
let params;
if (i === 0) {
params = randomFieldId;
} else if(i === 1){
params = '0';
}else{
params = this.editParams;
};
this.props.commonStore[f](params)
}) }>{leaveNamespan}</a>
}
}
if (c.dataIndex === 'isEnable') {
c.render = (t, r) => {
const {
isEnablespan,
randomFieldId
} = r;
if (isEnablespan === '1') collectCheckedId(randomFieldId)
return <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@5p582y@${c.dataIndex}`} value={isEnablespan} onChange={val => handleCkChange(val,randomFieldId)}/>
}
}
});
}
onOperatesClick = (record, rowIndex, operate) => {
const {
randomFieldId
} = record, {
index
} = operate;
const {
setSelectedRowId,
setSelectedRowIndex,
openDialog,
delTableRows,
} = this.props.commonStore;
//设置选中行的id
setSelectedRowId(randomFieldId);
//设置选中行的索引值
setSelectedRowIndex(index);
//根据索引值,执行相应的函数
switch (index) {
case '0': //编辑
openDialog(this.editParams);
break;
case '1': //删除
confirmation.showDelConfirm({
type: 0, //单个删除
logic: (type) => delTableRows(type),
});
break;
case '3': //同步
openDialog({
title: getLabel('21952', "同步设置"),
type: 0, //同步单个假期
});
break;
}
}
render() {
const {
commonStore,
} = this.props, {
table
} = commonStore, {
tableStore,
} = table;
return (
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@x0ys1i`}
comsWeaTableStore={tableStore}
hasOrder
needScroll
getColumns={columns => this.reRenderColumns(columns)}
onOperatesClick={this.onOperatesClick}/>
)
}
}
export default Table

View File

@ -0,0 +1,66 @@
import {
inject,
observer
} from 'mobx-react';
import {
WeaTop,
WeaRightMenu,
WeaLocaleProvider,
} from 'ecCom';
import {
toJS
} from 'mobx';
import {
AlertPage,
} from '../../public/learn';
const getLabel = WeaLocaleProvider.getLabel;
import Table from './Table';
import Search from './Search';
@inject('commonStore')
@inject('hrmHolidayRule')
@observer
class Top extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.props.commonStore.getMenus();
}
render() {
const {
commonStore,
hrmHolidayRule
} = this.props, {
topTitle,
} = hrmHolidayRule, {
topButtons,
dropMenuDatas,
topComponentStaticProps,
table,
} = commonStore, {
tableStore,
canViewTable
} = table;
return (
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@fbdv8o`}
title={getLabel('505561', "假期规则")}
loading={tableStore.loading}
buttons={topButtons}
dropMenuDatas={dropMenuDatas}
{...topComponentStaticProps}
>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@2f5pr8`} datas={dropMenuDatas}>
<Search ecId={`${this && this.props && this.props.ecId || ''}_Search@nfyk0e`} />
{canViewTable ? <Table ecId={`${this && this.props && this.props.ecId || ''}_Table@7tmvko`} /> : <AlertPage ecId={`${this && this.props && this.props.ecId || ''}_AlertPage@j8lc03`} />}
</WeaRightMenu>
</WeaTop>
)
}
}
export default Top

View File

@ -0,0 +1,70 @@
import React from 'react';
import {
observer,
inject
} from 'mobx-react';
import {
AlertPage,
Loading,
} from '../../public/learn';
import * as asyncFetch from '../../apis/holidayRule';
import Top from './Top';
import Dialog from './Dialog';
@inject('commonStore')
@inject('hrmHolidayRule')
@observer
class HolidayRule extends React.Component {
constructor(props) {
super(props);
}
componentWillMount() {
const {
pageConfig
} = this.props.hrmHolidayRule;
const params = {
...pageConfig,
customizedStore: this.props.hrmHolidayRule,
};
['resetStorePropertys', 'setPageConfig', 'getPermissionInfo'].map((f, i) => {
this.props.commonStore[f](i === 1 && params);
});
}
componentWillReceiveProps(nextProps) {
if (this.props.location.key !== nextProps.location.key) {
this.props.commonStore.refreshPage();
}
}
render() {
const {
commonStore,
} = this.props, {
pageAccessPermission
} = commonStore, {
hasRight,
loading
} = pageAccessPermission;
if (!hasRight) {
return loading ? <Loading ecId={`${this && this.props && this.props.ecId || ''}_Loading@wczjmo`} size='lg'/> : <AlertPage ecId={`${this && this.props && this.props.ecId || ''}_AlertPage@7wai04`} />
} else {
return (
<div>
<Top ecId={`${this && this.props && this.props.ecId || ''}_Top@y19d18`} />
<Dialog ecId={`${this && this.props && this.props.ecId || ''}_Dialog@f3uah2`} />
</div>
)
}
}
}
export default HolidayRule

View File

@ -0,0 +1,69 @@
import {
inject,
observer
} from 'mobx-react';
import {
WeaHelpfulTip,
WeaLocaleProvider,
} from 'ecCom';
import {
Icon
} from '../../public/learn';
const getLabel = WeaLocaleProvider.getLabel;
@inject('hrmHolidySettingNew')
@observer
class Annotation extends React.Component {
constructor(props) {
super(props);
}
render() {
const {
summary,
colorIconProps,
hasHelpfulTip,
helpfulTipProps,
handleIconClick,
} = this.props.hrmHolidySettingNew, {
annotations,
iconStates
} = summary;
return (
<div>{
annotations.map( (annotation,index) => {
const {
changeType,
bgColor,
typeName,
value
} = annotation;
const enhanceIconProps = {
...colorIconProps,
bgColor,
className:`linear-gradient-${index}`,
iconState: iconStates[index],
onIconClick: (value) => handleIconClick(value, index)
}
return (
<div key={changeType} className='hrm-holiday-count-item'>
<div className='hrm-holiday-color-icon'>
<Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@g0evc6@${index}`} {...enhanceIconProps}/>
</div>
<span>
{`${typeName} : `} <b>{value}</b> {`${getLabel('505553',"")}`}
</span>
</div>
)
})
}{
hasHelpfulTip && <WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@zfrt61`} {...helpfulTipProps} />
}</div>
)
}
}
export default Annotation

View File

@ -0,0 +1,74 @@
import {
inject,
observer
} from 'mobx-react';
import {
WeaDatePicker,
WeaInputSearch,
} from 'ecCom';
import Tab from './Tab';
import Annotation from './Annotation';
@inject('hrmHolidySettingNew')
@observer
class ConditionGroup extends React.Component {
constructor(props) {
super(props);
}
getLeftlayout = () => {
const {
datePicker,
datePickerProps
} = this.props.hrmHolidySettingNew;
const leftlayout = (
<div>
<div className='hrm-holiday-tab'>
<Tab ecId={`${this && this.props && this.props.ecId || ''}_Tab@zd0bq8`} />
</div>
<div className='hrm-holiday-tab'>
<WeaDatePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaDatePicker@wlxerf`} {...datePickerProps} {...datePicker}/>
</div>
</div>
)
return leftlayout;
}
getRightlayout = () => {
const {
tab,
inputSearch,
inputSearchProps,
} = this.props.hrmHolidySettingNew, {
selectedKey
} = tab;
let rightlayout;
if (selectedKey === '0') {
return (
<div className='hrm-holiday-count'>
<Annotation ecId={`${this && this.props && this.props.ecId || ''}_Annotation@c9v5qv`} />
</div>
)
} else {
return (
<WeaInputSearch ecId={`${this && this.props && this.props.ecId || ''}_WeaInputSearch@knxtnx`} {...inputSearch} {...inputSearchProps}/>
)
}
}
render() {
return (
<div className='hrm-holiday-condition-group'>
{this.getLeftlayout()}
{this.getRightlayout()}
</div>
);
}
}
export default ConditionGroup;

View File

@ -0,0 +1,68 @@
import {
inject,
observer
} from 'mobx-react';
import {
WeaDialog,
} from 'ecCom';
import {
MagicForm
} from '../../public/sweet-form.js';
import {
Loading,
} from '../../public/learn.js';
@inject('hrmHolidySettingNew')
@observer
class Dialog extends React.Component {
constructor(props) {
super(props);
}
getContent = () => {
const {
hasDialogContentLoaded,
formConfig,
formElements,
dialogType,
} = this.props.hrmHolidySettingNew, {
form
} = formElements;
const filterConfig = !['3', '4'].includes(dialogType) ? formConfig : {};
if (hasDialogContentLoaded) {
return (
<MagicForm ecId={`${this && this.props && this.props.ecId || ''}_MagicForm@pg8mld`}
{...filterConfig}
{...formElements}
isFormInit={form.isFormInit}
/>
)
} else {
return <Loading ecId={`${this && this.props && this.props.ecId || ''}_Loading@lilwep`} size='sm' />
}
}
render() {
const {
dialog,
dialogProps,
dialogTitle,
dialogButtons
} = this.props.hrmHolidySettingNew;
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@ak1ge9`}
{...dialog}
{...dialogProps}
title={dialogTitle}
buttons={dialogButtons}
>
{this.getContent()}
</WeaDialog>
);
}
}
export default Dialog

View File

@ -0,0 +1,58 @@
import {
inject,
observer
} from 'mobx-react';
@inject('hrmHolidySettingNew')
@observer
class Tab extends React.Component {
constructor(props) {
super(props);
}
render() {
const {
tab,
tabProps,
handleTabClick,
} = this.props.hrmHolidySettingNew, {
datas,
} = tabProps, {
selectedKey
} = tab;
return (
<div>{
datas.map( (data,index) => {
const {
key,
title
} = data;
const style = {
cursor: 'pointer'
};
if(key === selectedKey){
Object.assign(style,{
color: '#2DB7F5'
});
}
if(index === 1){
Object.assign(style,{
marginLeft: 10
});
}
return (
<span onClick={() => handleTabClick(key)} style={style}>{title}</span>
)
})
}</div>
);
}
}
export default Tab

View File

@ -0,0 +1,57 @@
import {
inject,
observer
} from 'mobx-react';
import {
WeaTableNew
} from 'comsMobx';
const WeaTable = WeaTableNew.WeaTable;
@inject('hrmHolidySettingNew')
@observer
class Table extends React.Component {
constructor(props) {
super(props);
}
reRenderColumns = (columns) => {
columns.map(c => {
if (c.dataIndex === 'holidayDate') {
c.render = (t, r) => {
const {
holidayDatespan,
randomFieldId
} = r;
return <a onClick={() => this.handleClick(randomFieldId) }>{holidayDatespan}</a>
}
}
});
}
handleClick = (randomFieldId) => {
const funcs = ['setOperatedRowId', 'setDialogType', 'openDialog'],
params = [randomFieldId, '2', ''];
funcs.map((func, index) => {
this.props.hrmHolidySettingNew[func](params[index])
});
}
render() {
const {
table,
tableProps
} = this.props.hrmHolidySettingNew;
return (
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@mwpapv`}
{...table}
{...tableProps}
getColumns={this.reRenderColumns}
/>
);
}
}
export default Table

View File

@ -0,0 +1,101 @@
import {
inject,
observer
} from 'mobx-react';
import {
WeaTop,
WeaRightMenu,
WeaLocaleProvider,
WeaLeftRightLayout
} from 'ecCom';
import {
LeftTree,
NoData,
} from '../../public/learn';
import ConditionGroup from './ConditionGroup';
import Year from './Year';
import Table from './Table';
const getLabel = WeaLocaleProvider.getLabel;
@inject('hrmHolidySettingNew')
@observer
class Top extends React.Component {
constructor(props) {
super(props);
}
componentDidMount () {
this.props.hrmHolidySettingNew.getRightMenu();
}
getRightLayout = () => {
const {
noDataProps,
dropMenuDatas,
hasRightLayout,
} = this.props.hrmHolidySettingNew;
if (hasRightLayout) {
return (
<div style={{ height: '100%' }}>
<ConditionGroup ecId={`${this && this.props && this.props.ecId || ''}_ConditionGroup@qrj8xa`} />
<div className='tabPane' style={{ top: 50 }}>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@t4uag3`} datas={dropMenuDatas}>
{this.getContent()}
</WeaRightMenu>
</div>
</div>
)
} else {
return <NoData ecId={`${this && this.props && this.props.ecId || ''}_NoData@0zwye2`} {...noDataProps} />
}
}
getContent = () => {
const {
tab
} = this.props.hrmHolidySettingNew, {
selectedKey
} = tab;
if (selectedKey === '0') {
return <Year ecId={`${this && this.props && this.props.ecId || ''}_Year@20jmlg`} />
} else {
return <Table ecId={`${this && this.props && this.props.ecId || ''}_Table@yp4i2x`} />
}
}
render () {
const {
topProps,
toploading,
topButtons,
dropMenuDatas,
tree,
treeProps,
} = this.props.hrmHolidySettingNew;
return (
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@ot4tdi`}
title={getLabel('505580', "节假日设置")}
{...topProps}
loading={toploading}
buttons={topButtons}
dropMenuDatas={dropMenuDatas}
>
<WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@agargf`}
isNew={true}
leftCom={<LeftTree ecId={`${this && this.props && this.props.ecId || ''}_LeftTree@pk326c`} {...treeProps} {...tree} />}
resize={true}
leftWidth={320}
>
{this.getRightLayout()}
</WeaLeftRightLayout>
</WeaTop>
);
}
}
export default Top;

View File

@ -0,0 +1,123 @@
import {
observer,
inject
} from 'mobx-react';
import {
toJS
} from 'mobx';
import {
WeaYear,
WeaNewScroll,
WeaLocaleProvider,
} from 'ecCom';
import {
Tooltip,
Spin,
} from 'antd';
import {
Loading,
} from '../../public/learn';
const getLabel = WeaLocaleProvider.getLabel;
@inject('hrmHolidySettingNew')
@observer
class Year extends React.Component {
constructor(props) {
super(props);
}
yearDateCellRender = (_date) => {
const {
calendar
} = this.props.hrmHolidySettingNew;
const year = _date.getYear(),
month = _date.getMonth() + 1,
day = _date.getDayOfMonth();
const item = toJS(calendar)[month - 1][day - 1];
if (!item) {
return null;
}
const {
date,
bgColor,
changeType,
typeName,
fontColor,
desc,
} = item;
const yearOfItem = (date || '').length >= 4 ? date.substring(0,4) : '' ;
if(year != yearOfItem){
return null ;
}
if (bgColor) {
const className = `linear-gradient-${['#00CC66','#FF0000','#0066FF'].findIndex(color => color === bgColor)}`;
const params = {
date,
desc,
typeName
};
return (
<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@ei8y41`} placement="right" title={this.getTooltip(params)}>
<div style={{backgroundColor:bgColor,color:fontColor}} className={className} title=''>
{day}
</div>
</Tooltip>
)
} else {
return (
<div style={{color:fontColor}}>
{day}
</div>
)
}
}
getTooltip = (params) => {
const labels = [getLabel('22823', "日期"), getLabel('25734', "说明"), getLabel('505579', "类型")];
const values = Object.values(params);
return (
<ul>{
labels.map( (label,index) => {
return <li>{`${label}: ${values[index]}`}</li>
})
}</ul>
)
}
render() {
const {
year,
yearProps,
isyearloaded,
} = this.props.hrmHolidySettingNew, {
loading
} = year;
if (isyearloaded) {
return (
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@kr5vfg`} height={'100%'}>
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@xxcmhk`} spinning={loading}>
<WeaYear ecId={`${this && this.props && this.props.ecId || ''}_WeaYear@lo8xaz`}
{...year}
{...yearProps}
dateCellRender={date => this.yearDateCellRender(date)}
/>
</Spin>
</WeaNewScroll>
)
} else {
return <Loading ecId={`${this && this.props && this.props.ecId || ''}_Loading@3oc2iy`} size='mid'/>
}
}
}
export default Year

View File

@ -0,0 +1,77 @@
import React from 'react';
import {
observer,
inject
} from 'mobx-react';
import {
AlertPage,
Loading,
} from '../../public/learn';
import Import from '../importRelatedComponet/index';
import '../../style/holidaySetting.css';
import Top from './Top';
import Dialog from './Dialog';
@inject('hrmImportCommon')
@inject('hrmHolidySettingNew')
@observer
export default class HolidaySettingNew extends React.Component {
constructor(props) {
super(props);
}
componentWillMount () {
this.props.hrmHolidySettingNew.reset();
}
componentDidMount () {
this.init()
}
componentWillReceiveProps (nextProps) {
if (this.props.location.key !== nextProps.location.key) {
this.props.hrmHolidySettingNew.refresh();
}
}
init = () => {
const {
params
} = this.props;
const funcs = ['setAttendanceId', 'getPermissionInfo'];
funcs.map((func, index) => {
this.props.hrmHolidySettingNew[func](index === 0 && params);
});
}
render () {
const {
hrmImportCommon,
hrmHolidySettingNew
} = this.props;
const {
importDialog
} = hrmImportCommon;
const {
pageAccessPermission
} = hrmHolidySettingNew, {
hasRight,
loading
} = pageAccessPermission;
if (!hasRight) {
return loading ? <Loading ecId={`${this && this.props && this.props.ecId || ''}_Loading@6q3cm2`} size='lg' /> : <AlertPage ecId={`${this && this.props && this.props.ecId || ''}_AlertPage@s1mo4g`} />
} else {
return (
<div id='hrmHolidySettingNew'>
<Top ecId={`${this && this.props && this.props.ecId || ''}_Top@2kx7mg`} />
<Dialog ecId={`${this && this.props && this.props.ecId || ''}_Dialog@v0bvku`} />
{importDialog.visible && <Import ecId={`${this && this.props && this.props.ecId || ''}_Import@k20s1s`} />}
</div>
)
}
}
}

View File

@ -0,0 +1,39 @@
import {
observer
} from 'mobx-react';
import {
WeaDialog,
} from 'ecCom';
import {
Loading,
} from '../../public/learn';
import DialogForm from './DialogForm';
@observer
export default class Dialog extends React.Component {
constructor(props) {
super(props);
}
render() {
const {
store
} = this.props, {
DIALOG,
dialog,
dialogButtons,
} = store;
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@czsk0a`}
{...DIALOG}
{...dialog}
buttons={dialogButtons}
>
{
dialog.loading ? <Loading ecId={`${this && this.props && this.props.ecId || ''}_Loading@wibicp`} /> : <DialogForm ecId={`${this && this.props && this.props.ecId || ''}_DialogForm@0gz6yk`} store={store}/>
}
</WeaDialog>
);
}
}

View File

@ -0,0 +1,62 @@
import {
observer
} from 'mobx-react';
import {
MagicForm,
} from '../../public/sweet-form.js';
@observer
export default class DialogForm extends React.Component {
constructor(props) {
super(props);
}
handleFormChange = (data, form) => {
const key = Object.keys(data)[0];
const value = data[key].value;
//清空分部浏览按钮
if (key === 'scopeType' && value === '0') {
form.updateFields({
'scopeValue': []
});
}
//重置日折算时长
if (key === 'computingMode' && value === '1') {
form.updateFields({
'hoursToDay': {
value: 8
}
});
}
if (key === 'minimumUnit') {
this.props.store.onHolidayUnitChange(value);
}
}
render() {
const {
store
} = this.props, {
dialog,
FORMCONFIG,
dynamicTips,
renderBlacklist,
} = store, {
form
} = dialog;
return (
<MagicForm ecId={`${this && this.props && this.props.ecId || ''}_MagicForm@kphltr`}
{...dialog}
{...FORMCONFIG}
isFormInit={form.isFormInit}
dynamicTips={dynamicTips}
renderBlacklist={renderBlacklist}
onFormElementsChange={data => this.handleFormChange(data,form)}
/>
);
}
}

View File

@ -0,0 +1,41 @@
import {
observer
} from 'mobx-react';
import {
WeaTab
} from 'ecCom';
@observer
export default class Search extends React.Component {
constructor(props) {
super(props);
}
render() {
const {
store
} = this.props, {
TAB,
tab,
searchsBaseValue,
} = store, {
form
} = tab;
return (
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@ucu7s1`}
{...TAB}
{...tab}
searchsBaseValue={searchsBaseValue}
searchsAd= {<div
onKeyDown={(e) =>{
if (e.keyCode == 13 && e.target.tagName === "INPUT") {
store.onSearch()
}
}
}
>{form.render()}</div>}
/>
);
}
}

View File

@ -0,0 +1,90 @@
import {
observer
} from 'mobx-react';
import {
WeaTableNew
} from 'comsMobx';
import {
WeaCheckbox
} from 'ecCom';
const WeaTable = WeaTableNew.WeaTable;
@observer
export default class Table extends React.Component {
constructor(props) {
super(props);
}
reRenderColumns = (columns, store) => {
const {
onTableTdClick,
collectChecked,
onCheckBoxChange,
} = store;
columns.map(c => {
if (c.dataIndex === 'leaveName') {
c.render = function(text, record) {
const {
randomFieldId
} = record;
return <a onClick={() => onTableTdClick(randomFieldId)}>{text}</a>
}
}
if (c.dataIndex === 'isEnable') {
c.render = function(text, record) {
const {
randomFieldId
} = record;
(text === '1') && collectChecked(randomFieldId)
return <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@75w5pn@${c.dataIndex}`} value={text} onChange={val => onCheckBoxChange(val,randomFieldId) }/>
}
}
});
}
onOperatesClick = (record, rIndex, operate, store) => {
const {
randomFieldId
} = record, {
index
} = operate;
const {
onTableTdClick,
del,
log,
} = store;
if (index === '0') {
onTableTdClick(randomFieldId);
}
if (index === '1') {
del(randomFieldId);
}
if (index === '2') {
log(randomFieldId, 'table')
}
}
render() {
const {
store
} = this.props, {
TABLE,
table
} = store;
return (
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@bsi0ui`}
{...TABLE}
{...table}
getColumns={columns => this.reRenderColumns(columns,store)}
onOperatesClick={(record, index, operate) => this.onOperatesClick(record,index, operate,store)}
/>
);
}
}

View File

@ -5,7 +5,8 @@ import {
import { import {
observer observer
} from 'mobx-react'; } from 'mobx-react';
import PageContent from './PageContent'; import Table from './Table';
import Search from './Search';
@observer @observer
export default class Top extends React.Component { export default class Top extends React.Component {
@ -19,23 +20,20 @@ export default class Top extends React.Component {
} = this.props, { } = this.props, {
TOP, TOP,
top, top,
pageLoading,
topButtons, topButtons,
dropMenuDatas, dropMenuDatas
breadcrumb,
} = store; } = store;
return ( return (
<WeaTop <WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@8rs7ky`}
{...TOP} {...TOP}
{...top} {...top}
loading={pageLoading}
buttons={topButtons} buttons={topButtons}
breadcrumb={breadcrumb}
dropMenuDatas={dropMenuDatas} dropMenuDatas={dropMenuDatas}
> >
<WeaRightMenu datas={dropMenuDatas}> <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@ohdsk2`} datas={dropMenuDatas}>
<PageContent store={store}/> <Search ecId={`${this && this.props && this.props.ecId || ''}_Search@xys11o`} store={store}/>
<Table ecId={`${this && this.props && this.props.ecId || ''}_Table@t9rsn2`} store={store}/>
</WeaRightMenu> </WeaRightMenu>
</WeaTop> </WeaTop>
); );

View File

@ -0,0 +1,71 @@
import React from 'react';
import {
observer,
inject
} from 'mobx-react';
import {
AlertPage,
Loading,
} from '../../public/learn';
import Top from './Top';
import Dialog from './Dialog';
@inject('hrmHolidayType')
@observer
export default class HolidayType extends React.Component {
constructor(props) {
super(props);
}
componentWillMount() {
const {
hrmHolidayType: store
} = this.props;
store.getPermissionInfo();
}
componentWillReceiveProps(nextProps) {
if (this.props.location.key !== nextProps.location.key) {
this.init();
}
}
componentDidMount() {
this.init();
}
init = () => {
const {
hrmHolidayType: store
} = this.props;
store.getRightMenu();
store.getSearchForm();
store.setShowSearchAd(false);
}
render() {
const {
hrmHolidayType: store
} = this.props, {
permission,
dialog,
} = store, {
hasRight,
loading
} = permission, {
visible
} = dialog;
if (!hasRight) {
return loading ? <Loading ecId={`${this && this.props && this.props.ecId || ''}_Loading@neqbar`} size='lg'/> : <AlertPage ecId={`${this && this.props && this.props.ecId || ''}_AlertPage@6d831k`} />
}
return (
<div>
<Top ecId={`${this && this.props && this.props.ecId || ''}_Top@8fldpk`} store={store}/>
<Dialog ecId={`${this && this.props && this.props.ecId || ''}_Dialog@cxgmn0`} store={store}/>
</div>
);
}
}

View File

@ -0,0 +1,117 @@
import React, {
Component
} from 'react';
import {
inject,
observer
} from 'mobx-react';
import {
WeaTop,
WeaAlertPage,
WeaRightMenu,
WeaSearchGroup,
WeaNewScroll,
WeaLocaleProvider
} from 'ecCom';
import {Spin} from 'antd';
import ImportResource from '../../../hrmengine/components/importresource/Import';
import {
i18n
} from '../../public/i18n';
const getLabel = WeaLocaleProvider.getLabel;
@inject('hrmImportExternalAttendance')
@inject('hrmImportResource')
@observer
export default class ImportExtenalAttendanceData extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.init();
}
componentWillReceiveProps(nextProps) {
if (this.props.location.key !== nextProps.location.key) {
this.init();
}
}
componentWillUnmount() {
const {
hrmImportExternalAttendance: store,
} = this.props;
store.resetImportResource();
}
init = () => {
const {
hrmImportExternalAttendance: store,
hrmImportResource
} = this.props;
const {
checkAuthorized,
initData
} = store;
store.setImportResource(hrmImportResource);
checkAuthorized('schedulesignimport', null, initData);
}
render() {
const {
hrmImportExternalAttendance: store
} = this.props;
const {
containerInitFinished,
topBtnAndMenu,
message,
spinning
} = store;
const {
btns,
menus
} = topBtnAndMenu();
let children = [];
if (message.length > 0) {
message.map(m => {
children.push(<div>{m}</div>)
})
}
const msgCom = <div style={{color: 'red'}}>{children}</div>;
return (
<div className="hrm_module_container">
{
containerInitFinished.init && containerInitFinished.authorized &&
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@6dduhy`} spinning={spinning}>
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@41obf7`}
title={getLabel(33539, '考勤外部数据导入')}
icon={<i className='icon-coms-hrm'/>}
iconBgcolor='#217346'
showDropIcon={true}
buttons={btns}
dropMenuDatas={menus}
>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@7xtqlv`} height={'100%'}>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@jef71e`} datas={menus}>
<ImportResource ecId={`${this && this.props && this.props.ecId || ''}_ImportResource@751eto`}/>
{
message.length > 0 &&
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@1trxhn`} col={1} showGroup={true} title={getLabel(24960, '提示信息')} items={[{com:msgCom}]}/>
}
</WeaRightMenu>
</WeaNewScroll>
</WeaTop>
</Spin>
}
{
containerInitFinished.init && !containerInitFinished.authorized &&
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@6hkmms`}>
<div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
</WeaAlertPage>
}
</div>
)
}
}

View File

@ -15,13 +15,14 @@ import {
} from 'comsMobx'; } from 'comsMobx';
import { import {
jumpToHrmCard jumpToHrmCard
} from '../util/pure-util' } from '../../util/pure-util'
const WeaTable = WeaTableNew.WeaTable; const WeaTable = WeaTableNew.WeaTable;
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
import ImportLog from './ImportLog' import ImportLog from './ImportLog'
import ImportResult from './ImportResult' import ImportResult from './ImportResult'
@inject('hrmImportCommon')
@observer @observer
export default class ImportHistory extends React.Component { export default class ImportHistory extends React.Component {
constructor(props) { constructor(props) {
@ -65,8 +66,8 @@ export default class ImportHistory extends React.Component {
} = recordDialog; } = recordDialog;
return [ return [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@3u5z3l`} type="primary" disabled={loading} onClick={() => queryLog()}>{getLabel(384041, '查看导入日志')}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@r0o7je`} type="primary" disabled={loading} onClick={() => queryLog()}>{getLabel(384041, '查看导入日志')}</Button>),
(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@y6jgcu`} />) (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@f2d43w`} />)
]; ];
} }
@ -89,7 +90,7 @@ export default class ImportHistory extends React.Component {
return ( return (
<div> <div>
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@2wh644`} <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@owktko`}
title={title} title={title}
icon="icon-coms-hrm" icon="icon-coms-hrm"
iconBgcolor="#217346" iconBgcolor="#217346"
@ -100,7 +101,7 @@ export default class ImportHistory extends React.Component {
style={{width: width, height: height}} style={{width: width, height: height}}
onChangeHeight={(h) => this.setState({height: h})} onChangeHeight={(h) => this.setState({height: h})}
> >
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@axofdt`} <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@1oe78s`}
comsWeaTableStore={tableStore} comsWeaTableStore={tableStore}
hasOrder={true} hasOrder={true}
needScroll={true} needScroll={true}
@ -109,7 +110,8 @@ export default class ImportHistory extends React.Component {
getColumns={c => this.reRenderColumns(c)} getColumns={c => this.reRenderColumns(c)}
/> />
</WeaDialog> </WeaDialog>
{logDialog.visible && <ImportLog ecId={`${this && this.props && this.props.ecId || ''}_ImportLog@m9tqlv`} hrmImportCommon={hrmImportCommon}/>} {logDialog.visible && <ImportLog ecId={`${this && this.props && this.props.ecId || ''}_ImportLog@8ihmic`} />}
{resultDialog.visible && <ImportResult ecId={`${this && this.props && this.props.ecId || ''}_ImportResult@bsod1g`} />}
</div> </div>
) )
} }

View File

@ -21,10 +21,11 @@ import {
} from 'comsMobx' } from 'comsMobx'
import { import {
jumpToHrmCard jumpToHrmCard
} from '../util/pure-util' } from '../../util/pure-util'
const WeaTable = WeaTableNew.WeaTable; const WeaTable = WeaTableNew.WeaTable;
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
@inject('hrmImportCommon')
@observer @observer
export default class ImportLog extends React.Component { export default class ImportLog extends React.Component {
constructor(props) { constructor(props) {
@ -54,13 +55,13 @@ export default class ImportLog extends React.Component {
isFormInit && condition.map(c => { isFormInit && condition.map(c => {
c.items.map((field, index) => { c.items.map((field, index) => {
arr.push( arr.push(
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@5b709m@${index}`} span={(index + 1) / 2 == 1 ? 13 : 9} offset={(index + 1) % 2 == 0 ? 1 : 0}> <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@181n34@${index}`} span={(index + 1) / 2 == 1 ? 13 : 9} offset={1}>
<div style={{marginTop: 10}} className='hrm-date-group'> <div style={{marginTop: 10}} className='hrm-date-group'>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@5bh9tc@${index}`} <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@duuy44@${index}`}
label={`${field.label}`} label={`${field.label}`}
labelCol={{span: index == 1 ? 5: `${field.labelcol}`}} labelCol={{span: index == 1 ? 5: `${field.labelcol}`}}
wrapperCol={{span: `${field.fieldcol}`}}> wrapperCol={{span: `${field.fieldcol}`}}>
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@qp4k1y@${index}`} fieldConfig={field} form={form} formParams={form.getFormParams()} />} {<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@1rdbic@${index}`} fieldConfig={field} form={form} formParams={form.getFormParams()} />}
</WeaFormItem> </WeaFormItem>
</div> </div>
</Col> </Col>
@ -68,7 +69,15 @@ export default class ImportLog extends React.Component {
}) })
}) })
return <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@rdtj2l`} spinning={loading}><Row ecId={`${this && this.props && this.props.ecId || ''}_Row@xdh3qs`}>{arr}</Row></Spin> return <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@2df7rh`} spinning={loading}><Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ikkle1`}
onKeyDown={(e) =>{
if (e.keyCode == 13 && e.target.tagName === "INPUT") {
hrmImportCommon.searchLogInfo();
hrmImportCommon.setLogPanelStatus(false)
}
}
}
>{arr}</Row></Spin>
} }
reRenderColumns(c) { reRenderColumns(c) {
@ -88,7 +97,7 @@ export default class ImportLog extends React.Component {
getDialogButtons = () => { getDialogButtons = () => {
const buttons = [ const buttons = [
(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@aowxpv`} />) (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@5ggawe`} />)
]; ];
return buttons return buttons
} }
@ -105,9 +114,9 @@ export default class ImportLog extends React.Component {
} = logDialog; } = logDialog;
return [ return [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@b78v81`} type="primary" onClick={() => {searchLogInfo(); setLogPanelStatus(false)}}>{getLabel(82529, '搜索')}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@s7mlnk`} type="primary" onClick={() => {searchLogInfo(); setLogPanelStatus(false)}}>{getLabel(82529, '搜索')}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ptulq8`} onClick={() => form.reset()}>{getLabel(27088, '重置')}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@r4jyw6`} onClick={() => form.reset()}>{getLabel(27088, '重置')}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@icgrbe`} onClick={() => setLogPanelStatus(false)}>{getLabel(32694, '取消')}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@cqbfst`} onClick={() => setLogPanelStatus(false)}>{getLabel(32694, '取消')}</Button>),
]; ];
} }
@ -130,7 +139,7 @@ export default class ImportLog extends React.Component {
} = this.state; } = this.state;
return ( return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@ziw0jn`} <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@kiapss`}
title={title} title={title}
icon="icon-coms-hrm" icon="icon-coms-hrm"
iconBgcolor="#217346" iconBgcolor="#217346"
@ -141,7 +150,7 @@ export default class ImportLog extends React.Component {
style={{width: width, height: height}} style={{width: width, height: height}}
onChangeHeight={h => this.setState({height: h})} onChangeHeight={h => this.setState({height: h})}
> >
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@dy9l77`} <WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@8b460h`}
searchType={['advanced']} searchType={['advanced']}
showSearchAd={isPanelShow} showSearchAd={isPanelShow}
setShowSearchAd={ bool => setLogPanelStatus(bool) } setShowSearchAd={ bool => setLogPanelStatus(bool) }
@ -151,7 +160,7 @@ export default class ImportLog extends React.Component {
hasMask={false} hasMask={false}
buttonsAd={this.getSearchPanelButtons()} buttonsAd={this.getSearchPanelButtons()}
/> />
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@m1731g`} <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@1jlyt8`}
comsWeaTableStore={tableStore} comsWeaTableStore={tableStore}
hasOrder={true} hasOrder={true}
needScroll={true} needScroll={true}

View File

@ -6,6 +6,7 @@ import {
WeaDialog, WeaDialog,
WeaNewScroll, WeaNewScroll,
WeaMoreButton, WeaMoreButton,
WeaLocaleProvider,
} from 'ecCom' } from 'ecCom'
import { import {
Row, Row,
@ -22,10 +23,8 @@ import {
import { import {
toJS toJS
} from 'mobx'; } from 'mobx';
import {
i18n
} from '../../public/i18nbk';
const WeaTable = WeaTableNew.WeaTable; const WeaTable = WeaTableNew.WeaTable;
const getLabel = WeaLocaleProvider.getLabel;
import ImportLog from './ImportLog' import ImportLog from './ImportLog'
@ -56,12 +55,12 @@ export default class ImportResult extends React.Component {
if (importStatus == 'over' || importStatus == 'error') { if (importStatus == 'over' || importStatus == 'error') {
// if (failnum > 0 && succnum > 0) { // if (failnum > 0 && succnum > 0) {
// buttons.push(<Button type="primary" disabled onClick={() => {}}>{i18n.button.downloadErrorDatas()}</Button>); // buttons.push(<Button type="primary" disabled onClick={() => {}}>{getLabel(384190, '下载错误数据')}</Button>);
// } // }
// buttons.push(<Button type="primary" disabled onClick={() => {}}>{i18n.button.downloadAllDatas()}</Button>); // buttons.push(<Button type="primary" disabled onClick={() => {}}>{getLabel(384191, '下载全部数据')}</Button>);
buttons.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@xjt7px@1`} type="primary" onClick={() => setLogDialogVisible(true)}>{i18n.button.getImportLog()}</Button>); buttons.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@wsctzg`} type="primary" onClick={() => setLogDialogVisible(true)}>{getLabel(24835, '导入日志')}</Button>);
} }
buttons.push(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@u1p339@2`} />); buttons.push(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@o0r45i`} />);
return buttons; return buttons;
} }
@ -87,7 +86,7 @@ export default class ImportResult extends React.Component {
} = resultDialog } = resultDialog
const columns = [{ const columns = [{
"title": i18n.label.confirmInfo(), "title": getLabel(24960, '提示信息'),
"width": "100%", "width": "100%",
"dataIndex": "message", "dataIndex": "message",
render: (text, record, index) => { render: (text, record, index) => {
@ -98,17 +97,15 @@ export default class ImportResult extends React.Component {
const elements = <div style={{ color: '#FF0000' }} className='hrm-import-table-th'> const elements = <div style={{ color: '#FF0000' }} className='hrm-import-table-th'>
<div style={{ margin: '20px 0' }}> <div style={{ margin: '20px 0' }}>
<div className='hrm-import-error-tip'> <div className='hrm-import-error-tip'>
<Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@wyt0r2`} type={'cross'} style={{ color: '#fff',fontSize: 18 }} /> <Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@f0qs1w`} type={'cross'} style={{ color: '#fff', fontSize: 18 }} />
</div> </div>
{errorTip} {errorTip}
</div> </div>
<div style={{padding: '0 30px'}}><Table ecId={`${this && this.props && this.props.ecId || ''}_Table@n5hlge`} dataSource={errorInfo} columns={columns} pagination={false} bordered/></div> <div style={{ padding: '0 30px' }}><Table ecId={`${this && this.props && this.props.ecId || ''}_Table@vn4qxd`} dataSource={errorInfo} columns={columns} pagination={false} bordered /></div>
</div>; </div>;
return elements; return elements;
} }
getRowKey = (record,index) => index
getResultInfo = () => { getResultInfo = () => {
const { const {
hrmImportCommon hrmImportCommon
@ -122,20 +119,20 @@ export default class ImportResult extends React.Component {
height height
} = this.state; } = this.state;
const icon = <div style={{backgroundColor: succnum>0 ? '#54D3A2' : '#FF0000',marginLeft: 270 }} className='hrm-import-error-tip'> const icon = <div style={{ backgroundColor: succnum > 0 ? '#54D3A2' : '#FF0000' }} className='hrm-import-error-tip'>
<Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@4ysuuf`} type={succnum>0 ? 'check' : 'cross'} style={{ color: '#fff',fontSize: 18 }} /> <Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@objefi`} type={succnum > 0 ? 'check' : 'cross'} style={{ color: '#fff', fontSize: 18 }} />
</div>; </div>;
const tip = <span style={{color: succnum > 0 ? '#54D3A2' : '#FF0000'}}>{(succnum > 0 && failnum == 0) ? i18n.label.importResourceResultInfo1().replace('{rownum}',`${succnum+failnum}`) : i18n.label.importResourceResultInfo().replace('{rownum}',`${succnum+failnum}`).replace('{succnum}',`${succnum}`)}</span> const tip = <span style={{ color: succnum > 0 ? '#54D3A2' : '#FF0000' }}>{(succnum > 0 && failnum == 0) ? getLabel(384061, '共{rownum}条数据,全部导入成功!').replace('{rownum}', `${succnum + failnum}`) : getLabel(385324, '共{rownum}条数据,{succnum}条导入成功!').replace('{rownum}', `${succnum + failnum}`).replace('{succnum}', `${succnum}`)}</span>
const resultTable = ((succnum + failnum > 0) && failnum > 0) && <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@frpkmr`} const resultTable = ((succnum + failnum > 0) && failnum > 0) && <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@61xfms`}
comsWeaTableStore={tableStore} comsWeaTableStore={tableStore}
bordered bordered
pagination={true} pagination={true}
rowKey={this.getRowKey} rowKey={(record, index) => index}
getColumns={this.reRenderColumns} getColumns={c => this.reRenderColumns(c)}
/> />
return <div> return <div className='hrm-import-dialog'>
<div style={( (succnum + failnum > 0) && failnum > 0) ? {marginTop: 20} : {marginTop: height/2 -30}}>{icon}{tip}</div> <div style={((succnum + failnum > 0) && failnum > 0) ? { marginTop: 20, textAlign: 'center' } : { marginTop: height / 2 - 30, textAlign: 'center' }}>{icon}{tip}</div>
<div style={{ padding: '10px 20px' }}>{resultTable}</div> <div style={{ padding: '10px 20px' }}>{resultTable}</div>
</div> </div>
} }
@ -151,28 +148,29 @@ export default class ImportResult extends React.Component {
} = resultDialog; } = resultDialog;
const columns = [{ const columns = [{
"title": i18n.label.row(), "title": getLabel(27592, '行'),
"width": "15%", "width": "15%",
"dataIndex": "rownum" "dataIndex": "rownum"
}, { }, {
"title": i18n.label.status(), "title": getLabel(602, '状态'),
"width": "15%", "width": "15%",
"dataIndex": "status", "dataIndex": "status",
render: (text, record, index) => { render: (text, record, index) => {
return <span style={{ color: text=='1'?'#54D3A2':'#FF0000'}}>{text=='1'?i18n.label.success():i18n.label.fail()}</span> return <span style={{ color: text == '1' ? '#54D3A2' : '#FF0000' }}>{text == '1' ? getLabel(15242, '成功') : getLabel(498, '失败')}</span>
} }
}, { }, {
"title": i18n.label.confirmInfo(), "title": getLabel(24960, '提示信息'),
"width": "70%", "width": "70%",
"dataIndex": "message", "dataIndex": "message",
render: (text, record, index) => { render: (text, record, index) => {
return <span style={{ color: '#FF0000' }}>{text}</span> // return <span style={{ color: '#FF0000' }}>{text}</span>
return <span>{text}</span>
} }
}]; }];
const loadingTip = (importStatus !== 'over' || importStatus !== 'error') && <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@x3net9`} tip={i18n.message.serverImportProcessing()}></Spin>; const loadingTip = (importStatus !== 'over' || importStatus !== 'error') && <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@2u84qp`} tip={getLabel(384042, '服务器正在处理数据导入,请稍后……')}></Spin>;
const processTable = <Table ecId={`${this && this.props && this.props.ecId || ''}_Table@muy1kg`} dataSource={toJS(datas)} columns={columns} pagination={false} bordered/> const processTable = <Table ecId={`${this && this.props && this.props.ecId || ''}_Table@jz2fmb`} dataSource={toJS(datas)} columns={columns} pagination={false} bordered />
return <div className='hrm-import-ant-table'> return <div className='hrm-import-ant-table'>
<div style={{ margin: '20px 0', paddingLeft: 260 }} className='hrm-import-loading'>{loadingTip}</div> <div style={{ margin: '20px 0', paddingLeft: 260 }} className='hrm-import-loading'>{loadingTip}</div>
@ -202,7 +200,7 @@ export default class ImportResult extends React.Component {
return ( return (
<div> <div>
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@gd6824`} <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@2tv3lw`}
title={title} title={title}
icon="icon-coms-hrm" icon="icon-coms-hrm"
iconBgcolor="#217346" iconBgcolor="#217346"
@ -213,8 +211,8 @@ export default class ImportResult extends React.Component {
style={{ width: width, height: height }} style={{ width: width, height: height }}
onChangeHeight={(h) => this.setState({ height: h })} onChangeHeight={(h) => this.setState({ height: h })}
> >
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@inu6ic`} spinning={loading}> <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4uq8r0`} spinning={loading}>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@kdauka`} height={height} ref={com => setScoll(com)}> <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@7ezp9r`} height={height} ref={com => setScoll(com)}>
{ {
!loading && (hasErrorInfo(errorInfo) ? this.getErrorInfo(errorInfo) : !loading && (hasErrorInfo(errorInfo) ? this.getErrorInfo(errorInfo) :
(importStatus == 'over' || importStatus == 'error') ? this.getResultInfo() : this.getImportProcessInfo()) (importStatus == 'over' || importStatus == 'error') ? this.getResultInfo() : this.getImportProcessInfo())
@ -222,7 +220,7 @@ export default class ImportResult extends React.Component {
</WeaNewScroll> </WeaNewScroll>
</Spin> </Spin>
</WeaDialog> </WeaDialog>
{logDialog.visible && <ImportLog ecId={`${this && this.props && this.props.ecId || ''}_ImportLog@zr127f`} />} {logDialog.visible && <ImportLog ecId={`${this && this.props && this.props.ecId || ''}_ImportLog@78g1qa`} />}
</div> </div>
) )
} }

View File

@ -17,19 +17,17 @@ import {
Spin, Spin,
Button, Button,
} from 'antd' } from 'antd'
import {
WeaSwitch
} from 'comsMobx';
import { import {
IEVersion IEVersion
} from '../util/pure-util' } from '../../util/pure-util'
import{addContentPath} from '../../../pc4mobx/hrm/util/index.js' import {addContentPath} from '../../util/index.js'
import '../style/import.css' import '../../style/import.css'
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
import ImportResult from './ImportResult' import ImportResult from './ImportResult'
import ImportHistory from './ImportHistory' import ImportHistory from './ImportHistory'
@inject('hrmImportCommon')
@observer @observer
export default class Import extends React.Component { export default class Import extends React.Component {
constructor(props) { constructor(props) {
@ -48,14 +46,11 @@ export default class Import extends React.Component {
} = this.props, { } = this.props, {
importDialog importDialog
} = hrmImportCommon, { } = hrmImportCommon, {
condition, condition
form, } = importDialog;
} = importDialog, {
isFormInit
} = form;
let _arr = []; let _arr = [];
isFormInit && condition.map((c, i) => { condition.map((c, i) => {
let arr = []; let arr = [];
if (i == 0) { //基本信息 if (i == 0) { //基本信息
c.items.map((field, index) => { c.items.map((field, index) => {
@ -63,17 +58,17 @@ export default class Import extends React.Component {
let url = field.value ? field.value : ''; let url = field.value ? field.value : '';
arr.push({ arr.push({
com: ( com: (
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@lqmqqp@${index}`}> <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@bee4ld@${index}`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@s5d1wh@${index}`} span={1} offset={6}> <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@1wldfb@${index}`} span={1} offset={6}>
<div className='hrm-import-circle' style={{paddingLeft: IEVersion() == '-1' ? 6 : 7, marginTop: 15}}> <div className='hrm-import-circle' style={{paddingLeft: IEVersion() == '-1' ? 6 : 7, marginTop: 15}}>
<div style={{paddingTop: (IEVersion() == '11' || IEVersion() == 'edge') ? 5 : 2}}>{index + 1}</div> <div style={{paddingTop: (IEVersion() == '11' || IEVersion() == 'edge') ? 5 : 2}}>{index + 1}</div>
</div> </div>
</Col> </Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@ed7vvh@${index}`} span={14}> <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@r91cj7@${index}`} span={14}>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@6oa9qd@${index}`} style={{marginTop: 15}}> <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@8ojr90@${index}`} style={{marginTop: 15}}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@z1fh07@${index}`} span={field.labelcol}>{field.label.length > 14 ? `${field.label.slice(0, 14)}...` : field.label}:</Col> <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@qbk8xn@${index}`} span={field.labelcol}>{field.label && (field.label.length > 14 ? `${field.label.slice(0, 14)}...` : field.label) }:</Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@unrwmn@${index}`} span={field.fieldcol}> <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@jolw03@${index}`} span={field.fieldcol}>
{this.getElements(key, url,field)} {this.getElements(key, url)}
</Col> </Col>
</Row> </Row>
</Col> </Col>
@ -89,13 +84,13 @@ export default class Import extends React.Component {
let url = field.link ? field.link : ''; let url = field.link ? field.link : '';
arr.push({ arr.push({
com: ( com: (
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@75e1nc@${index}`}> <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@upb61o@${index}`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@3atkon@${index}`} span={1} offset={6} style={{marginTop: 15}}> <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@rgq75z@${index}`} span={1} offset={6} style={{marginTop: 15}}>
<div className='hrm-import-circle' style={{paddingLeft: IEVersion() == '-1' ? 6 : 7, paddingLeft: (index > 8) ? 3 : 6}}> <div className='hrm-import-circle' style={{paddingLeft: IEVersion() == '-1' ? 6 : 7, paddingLeft: (index > 8) ? 3 : 6}}>
<div style={{paddingTop: (IEVersion() == '11' || IEVersion() == 'edge') ? 5 : 2}}>{index + 1}</div> <div style={{paddingTop: (IEVersion() == '11' || IEVersion() == 'edge') ? 5 : 2}}>{index + 1}</div>
</div> </div>
</Col> </Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@1tk1gi@${index}`} span={14} style={{marginTop: 15}}> <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@0fzh6q@${index}`} span={14} style={{marginTop: 15}}>
{this.getImportInstructions(p, url, index)} {this.getImportInstructions(p, url, index)}
</Col> </Col>
</Row> </Row>
@ -104,12 +99,12 @@ export default class Import extends React.Component {
}) })
}) })
} }
_arr.push(<div style={{color: '#484848'}}><WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@7pw6ua@${i}`} needTigger={true} title={c.title} showGroup={c.defaultshow} items={arr} col={1} /></div>) _arr.push(<div style={{color: '#484848'}}><WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@qbff6g@${i}`} needTigger={true} title={c.title} showGroup={c.defaultshow} items={arr} col={1} /></div>)
}); });
return _arr; return _arr;
} }
getElements = (key, url, field) => { getElements = (key, url) => {
const { const {
hrmImportCommon hrmImportCommon
} = this.props, { } = this.props, {
@ -118,20 +113,39 @@ export default class Import extends React.Component {
setSelectedValue setSelectedValue
} = hrmImportCommon, { } = hrmImportCommon, {
templetName, templetName,
selectedValue, selectedValue
form,
} = importDialog, { } = importDialog, {
upStatus, upStatus,
list list
} = this.state; } = this.state;
let dom; let dom;
if (key == 'keyField') {
const options = [{
key: "workcode",
selected: true,
showname: getLabel('714', "编号"),
disabled: false
}, {
key: "loginid",
selected: false,
showname: getLabel(16126, '登录名'),
disabled: false
}];
dom = <WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@5f6m89`}
options={options}
value={selectedValue}
onChange={value => setSelectedValue(value)}
/>
}
if (key == 'templet') { if (key == 'templet') {
dom = this.getTempletElement(url, selectedValue, templetName); dom = this.getTempletElement(url, selectedValue, templetName);
} else if (key == 'excelfile') { }
if (key == 'excelfile') {
dom = (<div> dom = (<div>
<div style={{float: 'left',marginTop: -10}}> <div style={{float: 'left',marginTop: -10}}>
<WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@ocityg`} <WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@g8kzos`}
uploadUrl='/api/doc/upload/uploadFile' uploadUrl='/api/doc/upload/uploadFile'
category='string' category='string'
limitType='xls' limitType='xls'
@ -139,15 +153,13 @@ export default class Import extends React.Component {
onChange={(id, list) => {this.setState({list:list}); setExcelFileNo(id)}} onChange={(id, list) => {this.setState({list:list}); setExcelFileNo(id)}}
onUploading={status => this.handleUploading(status)} onUploading={status => this.handleUploading(status)}
> >
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@p2j232`}>{getLabel(125333, '选择文件')}</Button> <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@3qand6`}>{getLabel(125333, '选择文件')}</Button>
</WeaUpload> </WeaUpload>
</div> </div>
<div style={{float: 'left', paddingLeft: 10}}> <div style={{float: 'left', paddingLeft: 10}}>
{ list.length == 0 ? <p>{getLabel(384040, '未选择任何文件')}</p> : list.map(file => <p>{file.filename}</p>) } { list.length == 0 ? <p>{getLabel(384040, '未选择任何文件')}</p> : list.map(file => <p>{file.filename}</p>) }
</div> </div>
</div>) </div>)
} else {
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@8n7q4y`} fieldConfig={field} form={form} formParams={form.getFormParams()} />
} }
return dom; return dom;
} }
@ -173,17 +185,10 @@ export default class Import extends React.Component {
} }
getTempletElement = (url, selectedValue, templetName) => { getTempletElement = (url, selectedValue, templetName) => {
const {
importDialog
} = this.props.hrmImportCommon, {
form
} = importDialog;
const keyField = form.getFormParams().keyField;
let dom; let dom;
let urlArr = url.split(';'); let urlArr = url.split(';');
if (urlArr.length > 1) { if (urlArr.length > 1) {
if (keyField == 'workcode') { if (selectedValue == 'workcode') {
dom = <a href={addContentPath(urlArr[0]) }>{templetName}</a>; dom = <a href={addContentPath(urlArr[0]) }>{templetName}</a>;
} else { } else {
dom = <a href={addContentPath(urlArr[1]) }>{templetName}</a>; dom = <a href={addContentPath(urlArr[1]) }>{templetName}</a>;
@ -218,9 +223,9 @@ export default class Import extends React.Component {
} = this.state; } = this.state;
return [ return [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@0iqdw4`} type="primary" disabled={upStatus === 'uploaded' ? false : true} onClick={() => submitExcel()}>{ getLabel(615, '提交')}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5vekgs`} type="primary" disabled={upStatus === 'uploaded' ? false : true} onClick={() => submitExcel()}>{ getLabel(615, '提交')}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pedeve`} type="primary" onClick={() => queryRecord()}>{getLabel(24644, '历史导入记录')}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ckyo6w`} type="primary" onClick={() => queryRecord()}>{getLabel(24644, '历史导入记录')}</Button>),
(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@83468s`} />) (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@w70zp6`} />)
]; ];
} }
@ -243,7 +248,7 @@ export default class Import extends React.Component {
return ( return (
<div> <div>
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@rdfgw5`} <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@c15iqf`}
title={title} title={title}
icon="icon-coms-hrm" icon="icon-coms-hrm"
iconBgcolor="#217346" iconBgcolor="#217346"
@ -254,14 +259,14 @@ export default class Import extends React.Component {
style={{width: width, height: height}} style={{width: width, height: height}}
onChangeHeight={(h) => this.setState({height: h})} onChangeHeight={(h) => this.setState({height: h})}
> >
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@anieq7`} spinning={loading}> <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@b8huv1`} spinning={loading}>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@p50dbq`} height={height}> <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@c369yv`} height={height}>
{this.getForm()} {this.getForm()}
</WeaNewScroll> </WeaNewScroll>
</Spin> </Spin>
</WeaDialog> </WeaDialog>
{resultDialog.visible && <ImportResult ecId={`${this && this.props && this.props.ecId || ''}_ImportResult@y4sw0y`} hrmImportCommon={hrmImportCommon}/>} {resultDialog.visible && <ImportResult ecId={`${this && this.props && this.props.ecId || ''}_ImportResult@afheim`} />}
{recordDialog.visible && <ImportHistory ecId={`${this && this.props && this.props.ecId || ''}_ImportHistory@da0na4`} hrmImportCommon={hrmImportCommon}/>} {recordDialog.visible && <ImportHistory ecId={`${this && this.props && this.props.ecId || ''}_ImportHistory@idykbt`} />}
</div> </div>
) )
} }

View File

@ -5,6 +5,7 @@ import {
import { import {
WeaDialog, WeaDialog,
WeaMoreButton, WeaMoreButton,
WeaLocaleProvider,
} from 'ecCom' } from 'ecCom'
import { import {
Button, Button,
@ -14,16 +15,14 @@ import {
} from 'comsMobx'; } from 'comsMobx';
import { import {
jumpToHrmCard jumpToHrmCard
} from '../../public/pulic-func' } from '../../util/pure-util'
import {
i18n
} from '../../public/i18nbk';
const WeaTable = WeaTableNew.WeaTable; const WeaTable = WeaTableNew.WeaTable;
const getLabel = WeaLocaleProvider.getLabel;
import ImportLog from './ImportLog' import ImportLog from './ImportLog'
import ImportResult from './ImportResult' import ImportResult from './ImportResult'
@inject('hrmImportCommon') @inject('importScheduleCode')
@observer @observer
export default class ImportHistory extends React.Component { export default class ImportHistory extends React.Component {
constructor(props) { constructor(props) {
@ -34,12 +33,12 @@ export default class ImportHistory extends React.Component {
} }
} }
reRenderColumns = (c)=> { reRenderColumns(c) {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
jumpToImportResult jumpToImportResult
} = hrmImportCommon; } = importScheduleCode;
c.forEach(item => { c.forEach(item => {
@ -56,33 +55,31 @@ export default class ImportHistory extends React.Component {
}); });
} }
getButtons = () => { getButtons() {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
recordDialog, recordDialog,
queryLog, queryLog,
} = hrmImportCommon, { } = importScheduleCode, {
loading loading
} = recordDialog; } = recordDialog;
return [ return [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@p1bp2b@1`} type="primary" disabled={loading} onClick={() => queryLog()}>{i18n.button.queryImportLog()}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bf2hyd`} type="primary" disabled={loading} onClick={() => queryLog()}>{getLabel(384041, '查看导入日志')}</Button>),
(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@uqammc@2`} />) (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@bnteg1`} />)
]; ];
} }
getRowKey = (record,index) => index
render() { render() {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
recordDialog, recordDialog,
logDialog, logDialog,
resultDialog, resultDialog,
setRecordDialogVisible setRecordDialogVisible
} = hrmImportCommon, { } = importScheduleCode, {
title, title,
visible, visible,
tableStore tableStore
@ -93,7 +90,7 @@ export default class ImportHistory extends React.Component {
return ( return (
<div> <div>
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@p8dp6d`} <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@nsn744`}
title={title} title={title}
icon="icon-coms-hrm" icon="icon-coms-hrm"
iconBgcolor="#217346" iconBgcolor="#217346"
@ -104,17 +101,17 @@ export default class ImportHistory extends React.Component {
style={{width: width, height: height}} style={{width: width, height: height}}
onChangeHeight={(h) => this.setState({height: h})} onChangeHeight={(h) => this.setState({height: h})}
> >
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@6lukxd`} <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@l08g3g`}
comsWeaTableStore={tableStore} comsWeaTableStore={tableStore}
hasOrder={true} hasOrder={true}
needScroll={true} needScroll={true}
scroll={{y: height - 80}} scroll={{y: height - 80}}
rowKey={this.getRowKey} rowKey={(record,index) => index}
getColumns={this.reRenderColumns} getColumns={c => this.reRenderColumns(c)}
/> />
</WeaDialog> </WeaDialog>
{logDialog.visible && <ImportLog ecId={`${this && this.props && this.props.ecId || ''}_ImportLog@hvvkcl`} />} {logDialog.visible && <ImportLog ecId={`${this && this.props && this.props.ecId || ''}_ImportLog@1zdmz4`} />}
{resultDialog.visible && <ImportResult ecId={`${this && this.props && this.props.ecId || ''}_ImportResult@twyqc1`} />} {resultDialog.visible && <ImportResult ecId={`${this && this.props && this.props.ecId || ''}_ImportResult@ahhxyp`} />}
</div> </div>
) )
} }

View File

@ -21,10 +21,11 @@ import {
} from 'comsMobx' } from 'comsMobx'
import { import {
jumpToHrmCard jumpToHrmCard
} from '../util/pure-util' } from '../../util/pure-util'
const WeaTable = WeaTableNew.WeaTable; const WeaTable = WeaTableNew.WeaTable;
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
@inject('importScheduleCode')
@observer @observer
export default class ImportLog extends React.Component { export default class ImportLog extends React.Component {
constructor(props) { constructor(props) {
@ -39,10 +40,10 @@ export default class ImportLog extends React.Component {
getPanelComponents() { getPanelComponents() {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
logDialog logDialog
} = hrmImportCommon, { } = importScheduleCode, {
form, form,
condition, condition,
loading loading
@ -54,13 +55,13 @@ export default class ImportLog extends React.Component {
isFormInit && condition.map(c => { isFormInit && condition.map(c => {
c.items.map((field, index) => { c.items.map((field, index) => {
arr.push( arr.push(
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@5b709m@${index}`} span={(index + 1) / 2 == 1 ? 13 : 9} offset={(index + 1) % 2 == 0 ? 1 : 0}> <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@o7hkaa@${index}`} span={(index + 1) / 2 == 1 ? 13 : 9} offset={1}>
<div style={{marginTop: 10}} className='hrm-date-group'> <div style={{marginTop: 10}} className='hrm-date-group'>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@5bh9tc@${index}`} <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@txl7v5@${index}`}
label={`${field.label}`} label={`${field.label}`}
labelCol={{span: index == 1 ? 5: `${field.labelcol}`}} labelCol={{span: index == 1 ? 5: `${field.labelcol}`}}
wrapperCol={{span: `${field.fieldcol}`}}> wrapperCol={{span: `${field.fieldcol}`}}>
{<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@qp4k1y@${index}`} fieldConfig={field} form={form} formParams={form.getFormParams()} />} {<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@uspdr4@${index}`} fieldConfig={field} form={form} formParams={form.getFormParams()} />}
</WeaFormItem> </WeaFormItem>
</div> </div>
</Col> </Col>
@ -68,7 +69,15 @@ export default class ImportLog extends React.Component {
}) })
}) })
return <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@rdtj2l`} spinning={loading}><Row ecId={`${this && this.props && this.props.ecId || ''}_Row@xdh3qs`}>{arr}</Row></Spin> return <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@b7xcha`} spinning={loading}><Row ecId={`${this && this.props && this.props.ecId || ''}_Row@kglspy`}
onKeyDown={(e) =>{
if (e.keyCode == 13 && e.target.tagName === "INPUT") {
hrmImportCommon.searchLogInfo();
hrmImportCommon.setLogPanelStatus(false)
}
}
}
>{arr}</Row></Spin>
} }
reRenderColumns(c) { reRenderColumns(c) {
@ -88,37 +97,37 @@ export default class ImportLog extends React.Component {
getDialogButtons = () => { getDialogButtons = () => {
const buttons = [ const buttons = [
(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@aowxpv`} />) (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@loofld`} />)
]; ];
return buttons return buttons
} }
getSearchPanelButtons = () => { getSearchPanelButtons = () => {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
searchLogInfo, searchLogInfo,
setLogPanelStatus, setLogPanelStatus,
logDialog, logDialog,
} = hrmImportCommon, { } = importScheduleCode, {
form form
} = logDialog; } = logDialog;
return [ return [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@b78v81`} type="primary" onClick={() => {searchLogInfo(); setLogPanelStatus(false)}}>{getLabel(82529, '搜索')}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ms3dor`} type="primary" onClick={() => {searchLogInfo(); setLogPanelStatus(false)}}>{getLabel(82529, '搜索')}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ptulq8`} onClick={() => form.reset()}>{getLabel(27088, '重置')}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@9jau3u`} onClick={() => form.reset()}>{getLabel(27088, '重置')}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@icgrbe`} onClick={() => setLogPanelStatus(false)}>{getLabel(32694, '取消')}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@kkwwaw`} onClick={() => setLogPanelStatus(false)}>{getLabel(32694, '取消')}</Button>),
]; ];
} }
render() { render() {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
logDialog, logDialog,
setLogDialogVisible, setLogDialogVisible,
setLogPanelStatus, setLogPanelStatus,
} = hrmImportCommon, { } = importScheduleCode, {
title, title,
visible, visible,
isPanelShow, isPanelShow,
@ -130,7 +139,7 @@ export default class ImportLog extends React.Component {
} = this.state; } = this.state;
return ( return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@ziw0jn`} <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@mbwjju`}
title={title} title={title}
icon="icon-coms-hrm" icon="icon-coms-hrm"
iconBgcolor="#217346" iconBgcolor="#217346"
@ -141,7 +150,7 @@ export default class ImportLog extends React.Component {
style={{width: width, height: height}} style={{width: width, height: height}}
onChangeHeight={h => this.setState({height: h})} onChangeHeight={h => this.setState({height: h})}
> >
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@dy9l77`} <WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@zg4ur0`}
searchType={['advanced']} searchType={['advanced']}
showSearchAd={isPanelShow} showSearchAd={isPanelShow}
setShowSearchAd={ bool => setLogPanelStatus(bool) } setShowSearchAd={ bool => setLogPanelStatus(bool) }
@ -151,7 +160,7 @@ export default class ImportLog extends React.Component {
hasMask={false} hasMask={false}
buttonsAd={this.getSearchPanelButtons()} buttonsAd={this.getSearchPanelButtons()}
/> />
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@m1731g`} <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@h8m6sh`}
comsWeaTableStore={tableStore} comsWeaTableStore={tableStore}
hasOrder={true} hasOrder={true}
needScroll={true} needScroll={true}

View File

@ -28,6 +28,7 @@ const getLabel = WeaLocaleProvider.getLabel;
import ImportLog from './ImportLog' import ImportLog from './ImportLog'
@inject('importScheduleCode')
@observer @observer
export default class ImportResult extends React.Component { export default class ImportResult extends React.Component {
constructor(props) { constructor(props) {
@ -40,11 +41,11 @@ export default class ImportResult extends React.Component {
getButtons = () => { getButtons = () => {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
resultDialog, resultDialog,
setLogDialogVisible, setLogDialogVisible,
} = hrmImportCommon, { } = importScheduleCode, {
failnum, failnum,
succnum, succnum,
importStatus importStatus
@ -57,9 +58,9 @@ export default class ImportResult extends React.Component {
// buttons.push(<Button type="primary" disabled onClick={() => {}}>{getLabel(384190, '下载错误数据')}</Button>); // buttons.push(<Button type="primary" disabled onClick={() => {}}>{getLabel(384190, '下载错误数据')}</Button>);
// } // }
// buttons.push(<Button type="primary" disabled onClick={() => {}}>{getLabel(384191, '下载全部数据')}</Button>); // buttons.push(<Button type="primary" disabled onClick={() => {}}>{getLabel(384191, '下载全部数据')}</Button>);
buttons.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@4ksz23`} type="primary" onClick={() => setLogDialogVisible(true)}>{getLabel(24835, '导入日志')}</Button>); buttons.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@see9z5`} type="primary" onClick={() => setLogDialogVisible(true)}>{getLabel(24835, '导入日志')}</Button>);
} }
buttons.push(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@qk0c87`} />); buttons.push(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@0mleqd`} />);
return buttons; return buttons;
} }
@ -76,10 +77,10 @@ export default class ImportResult extends React.Component {
getErrorInfo = () => { getErrorInfo = () => {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
resultDialog resultDialog
} = hrmImportCommon, { } = importScheduleCode, {
errorTip, errorTip,
errorInfo errorInfo
} = resultDialog } = resultDialog
@ -96,21 +97,21 @@ export default class ImportResult extends React.Component {
const elements = <div style={{color: '#FF0000'}} className='hrm-import-table-th'> const elements = <div style={{color: '#FF0000'}} className='hrm-import-table-th'>
<div style={{margin: '20px 0'}}> <div style={{margin: '20px 0'}}>
<div className='hrm-import-error-tip'> <div className='hrm-import-error-tip'>
<Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@j3fwh3`} type={'cross'} style={{ color: '#fff',fontSize: 18 }} /> <Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@h25i2d`} type={'cross'} style={{ color: '#fff',fontSize: 18 }} />
</div> </div>
{errorTip} {errorTip}
</div> </div>
<div style={{padding: '0 30px'}}><Table ecId={`${this && this.props && this.props.ecId || ''}_Table@mzv81b`} dataSource={errorInfo} columns={columns} pagination={false} bordered/></div> <div style={{padding: '0 30px'}}><Table ecId={`${this && this.props && this.props.ecId || ''}_Table@6ceqxo`} dataSource={errorInfo} columns={columns} pagination={false} bordered/></div>
</div>; </div>;
return elements; return elements;
} }
getResultInfo = () => { getResultInfo = () => {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
resultDialog resultDialog
} = hrmImportCommon, { } = importScheduleCode, {
succnum, succnum,
failnum, failnum,
tableStore, tableStore,
@ -119,11 +120,11 @@ export default class ImportResult extends React.Component {
} = this.state; } = this.state;
const icon = <div style={{backgroundColor: succnum>0 ? '#54D3A2' : '#FF0000',marginLeft: 270 }} className='hrm-import-error-tip'> const icon = <div style={{backgroundColor: succnum>0 ? '#54D3A2' : '#FF0000',marginLeft: 270 }} className='hrm-import-error-tip'>
<Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@3azhd5`} type={succnum>0 ? 'check' : 'cross'} style={{ color: '#fff',fontSize: 18 }} /> <Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@rav97c`} type={succnum>0 ? 'check' : 'cross'} style={{ color: '#fff',fontSize: 18 }} />
</div>; </div>;
const tip = <span style={{color: succnum > 0 ? '#54D3A2' : '#FF0000'}}>{(succnum > 0 && failnum == 0) ? getLabel(384061, '共{rownum}条数据,全部导入成功!').replace('{rownum}',`${succnum+failnum}`) : getLabel(384060, '共{rownum}条数据,{succnum}条导入成功!').replace('{rownum}',`${succnum+failnum}`).replace('{succnum}',`${succnum}`)}</span> const tip = <span style={{color: succnum > 0 ? '#54D3A2' : '#FF0000'}}>{(succnum > 0 && failnum == 0) ? getLabel(384061, '共{rownum}条数据,全部导入成功!').replace('{rownum}',`${succnum+failnum}`) : getLabel(384060, '共{rownum}条数据,{succnum}条导入成功!').replace('{rownum}',`${succnum+failnum}`).replace('{succnum}',`${succnum}`)}</span>
const resultTable = ((succnum + failnum > 0) && failnum > 0) && <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@9ckeyn`} const resultTable = ((succnum + failnum > 0) && failnum > 0) && <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@ttyfof`}
comsWeaTableStore={tableStore} comsWeaTableStore={tableStore}
bordered bordered
pagination={true} pagination={true}
@ -138,10 +139,10 @@ export default class ImportResult extends React.Component {
getImportProcessInfo = () => { getImportProcessInfo = () => {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
resultDialog resultDialog
} = hrmImportCommon, { } = importScheduleCode, {
datas, datas,
importStatus importStatus
} = resultDialog; } = resultDialog;
@ -167,9 +168,9 @@ export default class ImportResult extends React.Component {
} }
}]; }];
const loadingTip = (importStatus !== 'over' || importStatus !== 'error') && <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@36k9b8`} tip={getLabel(384042, '服务器正在处理数据导入,请稍后……')}></Spin>; const loadingTip = (importStatus !== 'over' || importStatus !== 'error') && <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@cd01bl`} tip={getLabel(384042, '服务器正在处理数据导入,请稍后……')}></Spin>;
const processTable = <Table ecId={`${this && this.props && this.props.ecId || ''}_Table@1brmw9`} dataSource={toJS(datas)} columns={columns} pagination={false} bordered/> const processTable = <Table ecId={`${this && this.props && this.props.ecId || ''}_Table@9l9yuv`} dataSource={toJS(datas)} columns={columns} pagination={false} bordered/>
return <div className='hrm-import-ant-table'> return <div className='hrm-import-ant-table'>
<div style={{margin: '20px 0',paddingLeft: 260}} className='hrm-import-loading'>{loadingTip}</div> <div style={{margin: '20px 0',paddingLeft: 260}} className='hrm-import-loading'>{loadingTip}</div>
@ -179,14 +180,14 @@ export default class ImportResult extends React.Component {
render() { render() {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
resultDialog, resultDialog,
logDialog, logDialog,
setResultInfoDialogVisible, setResultInfoDialogVisible,
hasErrorInfo, hasErrorInfo,
setScoll setScoll
} = hrmImportCommon, { } = importScheduleCode, {
title, title,
visible, visible,
importStatus, importStatus,
@ -199,7 +200,7 @@ export default class ImportResult extends React.Component {
return ( return (
<div> <div>
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@xq9xj1`} <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@guh7l1`}
title={title} title={title}
icon="icon-coms-hrm" icon="icon-coms-hrm"
iconBgcolor="#217346" iconBgcolor="#217346"
@ -210,8 +211,8 @@ export default class ImportResult extends React.Component {
style={{width: width, height: height}} style={{width: width, height: height}}
onChangeHeight={(h) => this.setState({height: h})} onChangeHeight={(h) => this.setState({height: h})}
> >
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@h9aevl`} spinning={loading}> <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@o2ba18`} spinning={loading}>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@gl3xsc`} height={height} ref={com => setScoll(com)}> <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@uf82q2`} height={height} ref={com => setScoll(com)}>
{ {
!loading && (hasErrorInfo(errorInfo) ? this.getErrorInfo(errorInfo) : !loading && (hasErrorInfo(errorInfo) ? this.getErrorInfo(errorInfo) :
(importStatus == 'over' || importStatus == 'error' ) ? this.getResultInfo() : this.getImportProcessInfo() ) (importStatus == 'over' || importStatus == 'error' ) ? this.getResultInfo() : this.getImportProcessInfo() )
@ -219,7 +220,7 @@ export default class ImportResult extends React.Component {
</WeaNewScroll> </WeaNewScroll>
</Spin> </Spin>
</WeaDialog> </WeaDialog>
{logDialog.visible && <ImportLog ecId={`${this && this.props && this.props.ecId || ''}_ImportLog@v1a84q`} hrmImportCommon={hrmImportCommon}/>} {logDialog.visible && <ImportLog ecId={`${this && this.props && this.props.ecId || ''}_ImportLog@9kb5xi`} />}
</div> </div>
) )
} }

View File

@ -9,10 +9,8 @@ import {
WeaNewScroll, WeaNewScroll,
WeaMoreButton, WeaMoreButton,
WeaSearchGroup, WeaSearchGroup,
WeaLocaleProvider,
} from 'ecCom' } from 'ecCom'
import {
WeaSwitch
} from 'comsMobx';
import { import {
Row, Row,
Col, Col,
@ -21,15 +19,15 @@ import {
} from 'antd' } from 'antd'
import { import {
IEVersion IEVersion
} from '../../public/pulic-func' } from '../../util/pure-util'
import { import {addContentPath} from '../../util/index.js'
i18n import '../../style/import.css'
} from '../../public/i18nbk'; const getLabel = WeaLocaleProvider.getLabel;
import ImportResult from './ImportResult' import ImportResult from './ImportResult'
import ImportHistory from './ImportHistory' import ImportHistory from './ImportHistory'
@inject('hrmImportCommon') @inject('importScheduleCode')
@observer @observer
export default class Import extends React.Component { export default class Import extends React.Component {
constructor(props) { constructor(props) {
@ -44,18 +42,15 @@ export default class Import extends React.Component {
getForm = () => { getForm = () => {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
importDialog importDialog
} = hrmImportCommon, { } = importScheduleCode, {
condition, condition
form, } = importDialog;
} = importDialog, {
isFormInit
} = form;
let _arr = []; let _arr = [];
isFormInit && condition.map((c, i) => { condition.map((c, i) => {
let arr = []; let arr = [];
if (i == 0) { //基本信息 if (i == 0) { //基本信息
c.items.map((field, index) => { c.items.map((field, index) => {
@ -63,17 +58,17 @@ export default class Import extends React.Component {
let url = field.value ? field.value : ''; let url = field.value ? field.value : '';
arr.push({ arr.push({
com: ( com: (
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@u3pg88@${index}`}> <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@mk7epo@${index}`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@d34g4z@${index}`} span={1} offset={6}> <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@app94d@${index}`} span={1} offset={6}>
<div className='hrm-import-circle' style={{paddingLeft: IEVersion() == '-1' ? 6 : 7, marginTop: 15}}> <div className='hrm-import-circle' style={{paddingLeft: IEVersion() == '-1' ? 6 : 7, marginTop: 15}}>
<div style={{paddingTop: (IEVersion() == '11' || IEVersion() == 'edge') ? 5 : 2}}>{index + 1}</div> <div style={{paddingTop: (IEVersion() == '11' || IEVersion() == 'edge') ? 5 : 2}}>{index + 1}</div>
</div> </div>
</Col> </Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@h1ko2g@${index}`} span={14}> <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@gijkzb@${index}`} span={14}>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@3swbr9@${index}`} style={{marginTop: 15}}> <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@8q4j67@${index}`} style={{marginTop: 15}}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@55ag3k@${index}`} span={field.labelcol}>{field.label.length > 14 ? `${field.label.slice(0, 14)}...` : field.label}:</Col> <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@kvda9s@${index}`} span={field.labelcol}>{field.label && (field.label.length > 14 ? `${field.label.slice(0, 14)}...` : field.label) }:</Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@qyfneu@${index}`} span={field.fieldcol}> <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@pgdrxd@${index}`} span={field.fieldcol}>
{this.getElements(key, url, field)} {this.getElements(key, url)}
</Col> </Col>
</Row> </Row>
</Col> </Col>
@ -89,13 +84,13 @@ export default class Import extends React.Component {
let url = field.link ? field.link : ''; let url = field.link ? field.link : '';
arr.push({ arr.push({
com: ( com: (
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@r3k3h0@${index}`}> <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ip6dj4@${index}`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@2yfn9e@${index}`} span={1} offset={6} style={{marginTop: 15}}> <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@rq35bn@${index}`} span={1} offset={6} style={{marginTop: 15}}>
<div className='hrm-import-circle' style={{paddingLeft: IEVersion() == '-1' ? 6 : 7, paddingLeft: (index > 8) ? 3 : 6}}> <div className='hrm-import-circle' style={{paddingLeft: IEVersion() == '-1' ? 6 : 7, paddingLeft: (index > 8) ? 3 : 6}}>
<div style={{paddingTop: (IEVersion() == '11' || IEVersion() == 'edge') ? 5 : 2}}>{index + 1}</div> <div style={{paddingTop: (IEVersion() == '11' || IEVersion() == 'edge') ? 5 : 2}}>{index + 1}</div>
</div> </div>
</Col> </Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@z6k87f@${index}`} span={14} style={{marginTop: 15}}> <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@2dpnya@${index}`} span={14} style={{marginTop: 15}}>
{this.getImportInstructions(p, url, index)} {this.getImportInstructions(p, url, index)}
</Col> </Col>
</Row> </Row>
@ -104,34 +99,53 @@ export default class Import extends React.Component {
}) })
}) })
} }
_arr.push(<div style={{color: '#484848'}}><WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@a3rsv9@${i}`} needTigger={true} title={c.title} showGroup={c.defaultshow} items={arr} col={1} /></div>) _arr.push(<div style={{color: '#484848'}}><WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@16fztc@${i}`} needTigger={true} title={c.title} showGroup={c.defaultshow} items={arr} col={1} /></div>)
}); });
return _arr; return _arr;
} }
getElements = (key, url, field) => { getElements = (key, url) => {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
setExcelFileNo, setExcelFileNo,
importDialog, importDialog,
setSelectedValue setSelectedValue
} = hrmImportCommon, { } = importScheduleCode, {
templetName, templetName,
selectedValue, selectedValue
form,
} = importDialog, { } = importDialog, {
upStatus, upStatus,
list list
} = this.state; } = this.state;
let dom; let dom;
if (key == 'keyField') {
const options = [{
key: "lastname",
selected: true,
showname: getLabel('413', "姓名"),
disabled: false
}, {
key: "workcode",
selected: false,
showname: getLabel('714', "编号"),
disabled: false
}];
dom = <WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@fpxbx8`}
options={options}
value={selectedValue}
onChange={value => setSelectedValue(value)}
/>
}
if (key == 'templet') { if (key == 'templet') {
dom = this.getTempletElement(url, selectedValue, templetName); dom = this.getTempletElement(url, selectedValue, templetName);
} else if (key == 'excelfile') { }
if (key == 'excelfile') {
dom = (<div> dom = (<div>
<div style={{float: 'left',marginTop: -10}}> <div style={{float: 'left',marginTop: -10}}>
<WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@lcyams`} <WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@f8fo2m`}
uploadUrl='/api/doc/upload/uploadFile' uploadUrl='/api/doc/upload/uploadFile'
category='string' category='string'
limitType='xls' limitType='xls'
@ -139,25 +153,23 @@ export default class Import extends React.Component {
onChange={(id, list) => {this.setState({list:list}); setExcelFileNo(id)}} onChange={(id, list) => {this.setState({list:list}); setExcelFileNo(id)}}
onUploading={status => this.handleUploading(status)} onUploading={status => this.handleUploading(status)}
> >
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@hmrzeo`}>{i18n.button.selectFile()}</Button> <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@1zv827`}>{getLabel(125333, '选择文件')}</Button>
</WeaUpload> </WeaUpload>
</div> </div>
<div style={{float: 'left', paddingLeft: 10}}> <div style={{float: 'left', paddingLeft: 10}}>
{ list.length == 0 ? <p>{i18n.label.noFileSelected()}</p> : list.map(file => <p>{file.filename}</p>) } { list.length == 0 ? <p>{getLabel(384040, '未选择任何文件')}</p> : list.map(file => <p>{file.filename}</p>) }
</div> </div>
</div>) </div>)
} else {
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@tsac1c`} fieldConfig={field} form={form} formParams={form.getFormParams()} />
} }
return dom; return dom;
} }
getImportInstructions = (val, url, index) => { getImportInstructions = (val, url, index) => {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
importDialog importDialog
} = hrmImportCommon, { } = importScheduleCode, {
templetName, templetName,
selectedValue, selectedValue,
} = importDialog; } = importDialog;
@ -165,7 +177,7 @@ export default class Import extends React.Component {
let p; let p;
if (index == 0) { if (index == 0) {
let dom = this.getTempletElement(url, selectedValue, templetName); let dom = this.getTempletElement(url, selectedValue, templetName);
p = (<p>{i18n.label.downloadTemplateFirst()}{dom}</p>); p = (<p>{getLabel(383083, '请先下载模板')}{dom}</p>);
} else { } else {
p = (<p>{val}</p>); p = (<p>{val}</p>);
} }
@ -177,12 +189,12 @@ export default class Import extends React.Component {
let urlArr = url.split(';'); let urlArr = url.split(';');
if (urlArr.length > 1) { if (urlArr.length > 1) {
if (selectedValue == 'workcode') { if (selectedValue == 'workcode') {
dom = <a href={urlArr[0]}>{templetName}</a>; dom = <a href={addContentPath(urlArr[0]) }>{templetName}</a>;
} else { } else {
dom = <a href={urlArr[1]}>{templetName}</a>; dom = <a href={addContentPath(urlArr[1]) }>{templetName}</a>;
} }
} else { } else {
dom = <a href={url}>{templetName}</a>; dom = <a href={addContentPath(url)}>{templetName}</a>;
} }
return dom return dom
} }
@ -201,31 +213,31 @@ export default class Import extends React.Component {
getButtons = () => { getButtons = () => {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
submitExcel, submitExcel,
queryRecord, queryRecord,
importDialog, importDialog,
} = hrmImportCommon, { } = importScheduleCode, {
upStatus upStatus
} = this.state; } = this.state;
return [ return [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@2fiagn@1`} type="primary" disabled={upStatus === 'uploaded' ? false : true} onClick={() => submitExcel()}>{i18n.button.submit()}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ccsn0f`} type="primary" disabled={upStatus === 'uploaded' ? false : true} onClick={() => submitExcel()}>{ getLabel(615, '提交')}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@q04w9s@2`} type="primary" onClick={() => queryRecord()}>{i18n.button.importHistoryQuery()}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@heklwl`} type="primary" onClick={() => queryRecord()}>{getLabel(24644, '历史导入记录')}</Button>),
(<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@oizt3r@3`} />) (<WeaMoreButton ecId={`${this && this.props && this.props.ecId || ''}_WeaMoreButton@1qhvkt`} />)
]; ];
} }
render() { render() {
const { const {
hrmImportCommon importScheduleCode
} = this.props, { } = this.props, {
importDialog, importDialog,
resultDialog, resultDialog,
recordDialog, recordDialog,
setImportDialogVisible setImportDialogVisible
} = hrmImportCommon, { } = importScheduleCode, {
visible, visible,
title, title,
loading loading
@ -236,7 +248,7 @@ export default class Import extends React.Component {
return ( return (
<div> <div>
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@79hw9l`} <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@usupz6`}
title={title} title={title}
icon="icon-coms-hrm" icon="icon-coms-hrm"
iconBgcolor="#217346" iconBgcolor="#217346"
@ -247,14 +259,14 @@ export default class Import extends React.Component {
style={{width: width, height: height}} style={{width: width, height: height}}
onChangeHeight={(h) => this.setState({height: h})} onChangeHeight={(h) => this.setState({height: h})}
> >
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@qa42zo`} spinning={loading}> <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@8wqfeo`} spinning={loading}>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@vcz1bi`} height={height}> <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@8j5gqp`} height={height}>
{this.getForm()} {this.getForm()}
</WeaNewScroll> </WeaNewScroll>
</Spin> </Spin>
</WeaDialog> </WeaDialog>
{resultDialog.visible && <ImportResult ecId={`${this && this.props && this.props.ecId || ''}_ImportResult@fd6jt3`} />} {resultDialog.visible && <ImportResult ecId={`${this && this.props && this.props.ecId || ''}_ImportResult@0fagju`} />}
{recordDialog.visible && <ImportHistory ecId={`${this && this.props && this.props.ecId || ''}_ImportHistory@weby4j`} />} {recordDialog.visible && <ImportHistory ecId={`${this && this.props && this.props.ecId || ''}_ImportHistory@mnxd6q`} />}
</div> </div>
) )
} }

View File

@ -0,0 +1,202 @@
import {
observer,
inject
} from 'mobx-react';
import {
toJS
} from 'mobx';
import {
WeaLocaleProvider,
} from 'ecCom';
import {
Icon,
Steps,
Spin,
Button,
Tooltip,
QueueAnim,
} from 'antd';
import {addContentPath} from '../../util/index.js'
const Step = Steps.Step;
const getLabel = WeaLocaleProvider.getLabel;
const InitStatus = props => {
const {
status
} = props;
switch (status) {
case '0':
return <i className='icon-coms-Clear' style={{color: '#FF0000'}}/>
break;
case '1':
return <Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@mwbz2q`} type="check-circle" style={{color: '#00CC00'}}/>
break;
case '2':
return <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4140j1`} />
break;
default:
return null;
}
}
const Detail = props => {
const {
description
} = props;
const translate = (description) => {
return (<ul>{
description.map(d => <li>{d}</li>)
}</ul>)
}
return (
<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@kgagak`} placement="right" title={Array.isArray(description) ? translate(description) : description }>
<span title=''>
<i className='icon-coms-Read' style={{color:'#666'}}/>
<span className='holiday-link' style={{marginLeft: 5}}>{getLabel('505586','详情')}</span>
</span>
</Tooltip>
)
}
const Supply = props => {
const {
description
} = props;
const supply = [];
const insert = (html) => {
supply.push(html);
return supply;
}
if (description) {
insert(<br />).push(<Detail ecId={`${this && this.props && this.props.ecId || ''}_Detail@2jnhw9`} description={description}/>);
}
return supply;
}
const InitSteps = props => {
const {
currentIndex,
items
} = props;
return (
<Steps ecId={`${this && this.props && this.props.ecId || ''}_Steps@ufuli7`} current={currentIndex}>
{
items.map( (item,index) => {
const {
title,
status
} = item;
return (
<Step ecId={`${this && this.props && this.props.ecId || ''}_Step@0mb2d9@${index}`} status={status} description={(currentIndex === index) ? <b>{title}</b> : title}/>
)
})
}
</Steps>
)
}
const Result = props => {
const {
results,
names,
} = props;
return (
<QueueAnim ecId={`${this && this.props && this.props.ecId || ''}_QueueAnim@vk0yt5`} type={['right', 'left']} style={{marginTop: 50}}>
{
results.map( (result,index) => {
const {
name,
status,
sketch,
description,
url,
} = result;
return (<div key={index} className='wea-f14 hrm-init-analysis-item'>
<span className='hrm-init-analysis-item-index'>
<i className={`icon-coms-${index + 1}`} style={{color:'#b2b2b2'}}/>
</span>
<span className='hrm-init-analysis-item-name hrm-over-flow'>
{name}
</span>
<span className='hrm-init-analysis-item-icon'>
<InitStatus ecId={`${this && this.props && this.props.ecId || ''}_InitStatus@pp2wvq@${index}`} status={status} />
</span>
<p className='hrm-init-analysis-item-desc hrm-over-flow wea-f12' style={{color: (status === '0') && '#FF0000',lineHeight:description && '25px' }} title={sketch}>
{ sketch }
{ description && <Supply ecId={`${this && this.props && this.props.ecId || ''}_Supply@7s1nml@${index}`} description={description}/> }
</p>
{
url && (<span className='hrm-init-analysis-item-link wea-f12'>
<i className='icon-coms-link'/>
<a href={addContentPath(url)} target='_blank' className='hrm-init-analysis-item-link-a'>{names[index]}</a>
</span>)
}
</div>)
})
}
</QueueAnim>
)
}
const Back = props => {
const {
back
} = props;
return (
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@dlyq65`} type="primary" icon="left" style={{float:'right',marginTop: 30}} onClick={() => back()}>{getLabel('505587','返回上一步')}</Button>
)
}
@inject('hrmInit')
@observer
export default class AnalysisResult extends React.Component {
constructor(props) {
super(props);
}
render() {
const {
hrmInit
} = this.props, {
currentIndex,
steps,
analysis,
isInitFinish,
hasAnalysisResult,
back,
initItemNames,
} = hrmInit, {
items
} = steps, {
results
} = analysis;
return (
<div className='hrm-init-analysis'>
<div className='wea-f12'>
<InitSteps ecId={`${this && this.props && this.props.ecId || ''}_InitSteps@8h7k0n`}
currentIndex={currentIndex}
items={items}
/>
</div>
<Result ecId={`${this && this.props && this.props.ecId || ''}_Result@7h2mle`} results={toJS(results)} names={initItemNames}/>
{hasAnalysisResult && isInitFinish && <Back ecId={`${this && this.props && this.props.ecId || ''}_Back@29u6g0`} back={() => back()}/>}
</div>
)
}
}

View File

@ -0,0 +1,299 @@
import {
observer,
inject
} from 'mobx-react';
import {
Button,
Popconfirm
} from 'antd';
import {
WeaFormItem,
WeaLocaleProvider,
WeaSlideModal,
} from 'ecCom';
import {
WeaSwitch
} from 'comsMobx';
import {
MagicForm,
} from '../../public/sweet-form.js';
import {
DistanceToPeak,
} from '../../public/learn.js';
const getLabel = WeaLocaleProvider.getLabel;
const InitButton = props => {
const {
handleClick,
confirm,
cancel,
visible,
} = props;
return (
<div className='hrm-init-btnparent'>
<Popconfirm ecId={`${this && this.props && this.props.ecId || ''}_Popconfirm@yvyjv7`} title={getLabel('505588','本次操作将会覆盖上一次初始化的数据,确认覆盖?')}
onConfirm={confirm}
onCancel={cancel}
placement='bottom'
visible={visible}
>
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bn6wcl`}
type="primary"
className='hrm-init-btnparent-button'
onClick={() => handleClick()}
>
{getLabel('505589',"开始初始化")}
</Button>
</Popconfirm>
</div>
)
}
const Guide = props => {
const {
visible,
open,
close,
datas,
top,
} = props;
let width;
if (screen) {
width = (screen.width >= 1920) ? 400 : 300
} else {
width = 400;
}
return (
<div className='guide' style={{right:window.e9_locale.userLanguage === 8 && -170}}>
<div onClick={open} className='wrapper'>
<div className='icon float'>
<i className='icon-coms-investigate' />
</div>
<div className='title wea-f14 float'>{
getLabel('505590','初始化说明')
}</div>
</div>
<WeaSlideModal ecId={`${this && this.props && this.props.ecId || ''}_WeaSlideModal@8uw1rd`}
visible={visible}
top={top}
width={width}
height={100}
direction={'right'}
measureY={'%'}
title={<SlideModalTitle ecId={`${this && this.props && this.props.ecId || ''}_SlideModalTitle@4va3qy`} close={close}/>}
content={<SlideModalContent ecId={`${this && this.props && this.props.ecId || ''}_SlideModalContent@yo3u6c`} datas={datas}/>}
onClose={close}
/>
</div>
)
}
const SlideModalTitle = props => {
const {
close
} = props;
return (
<div className='header-title'>
<span className='header-title-icon' onClick={close}>
<i className='icon-coms-Left'/>
</span>
<span>{getLabel('505590','初始化说明')}</span>
</div>
)
}
const SlideModalContent = props => {
const {
datas
} = props;
return (
<div>
{
datas.map((data, index) => {
const {
title,
desc,
key
} = data;
const len = desc.length;
let c;
if(len > 1){
c = (d,i) => <p>{`${i + 1}. ${d}`}</p>
}else{
c = (d,i) => <p>{d}</p>
}
return (
<div key={key}>
<div className='slide-modal'>
<HorizontalLine ecId={`${this && this.props && this.props.ecId || ''}_HorizontalLine@1mcsvh@${index}`} />
<span className='slide-modal-title'>
<i className='icon-coms-task-list' />
{title}
</span>
</div>
<div className='slide-modal-content'>{
desc.map( (d,i) => c(d,i))
}</div>
</div>
)
})
}
</div>
)
}
const HorizontalLine = props => {
return (
<div className='line'></div>
)
}
@inject('hrmInit')
@observer
export default class InitForm extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.props.hrmInit.getFormMaterial();
}
getTransverseSiblingComponents = (params) => {
const {
form,
items
} = params;
if (!items) return
let timerRanger;
items.map((item, index) => {
const {
domkey
} = item;
if (domkey[0] === 'restTime_start') {
//【排除休息时间】开关的状态值
const excludeRestTime = form.getFormParams().excludeRestTime;
if (excludeRestTime !== '1') return;
timerRanger = (
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@0ru0vo@${index}`}
label={''}
colon={false}
labelCol={{span: 0}}
wrapperCol={{span: 24}}
error={form.getError(item) }
tipPosition='bottom'
style={{position: 'absolute', top: 0 ,left: 58}}
>
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@rar62w@${index}`} fieldConfig={item} form={form} formParams={form.getFormParams()} />
</WeaFormItem>
)
}
});
const transverseSiblingComponents = {
'excludeRestTime': timerRanger,
};
return transverseSiblingComponents;
}
getTransverseSecondComponent = (conditions) => {
if (conditions.length === 0) return;
let transverseSecondComponents = [];
conditions[0].items.map(item => {
const {
domkey
} = item;
if (['restTime_start'].includes(domkey[0])) {
transverseSecondComponents.push(item);
}
});
return transverseSecondComponents
}
getDistanceToPeak = (distance) => {
const {
hrmInit: store
} = this.props;
const {
setDistanceToPeak
} = store;
setDistanceToPeak(distance);
}
render() {
const {
hrmInit
} = this.props, {
formConfig,
formElements,
hasInitButton,
handleInitButtonClick,
errors,
confirm,
cancel,
switchSlideModal,
close,
popConfirmVisible,
slideModalVisible,
slideModalDatas,
slideTop,
} = hrmInit, {
form,
conditions,
} = formElements;
return (
<div className='hrm-init-form'>
<MagicForm ecId={`${this && this.props && this.props.ecId || ''}_MagicForm@ndpw8o`}
{...formElements}
{...formConfig}
transverseSiblingComponents={this.getTransverseSiblingComponents({
form,
items: this.getTransverseSecondComponent(conditions),
})}
wrapperStyle={{padding: 0}}
isFormInit={form.isFormInit}
errors={errors}
/>
{
hasInitButton && <InitButton ecId={`${this && this.props && this.props.ecId || ''}_InitButton@56cdfm`}
handleClick={handleInitButtonClick}
confirm={() => confirm()}
cancel={() => cancel()}
visible={popConfirmVisible}
/>
}
{
hasInitButton && <Guide ecId={`${this && this.props && this.props.ecId || ''}_Guide@u43oq9`}
visible={slideModalVisible}
open={() => switchSlideModal()}
close={() => close()}
datas={slideModalDatas}
top={slideTop}
/>
}
<DistanceToPeak ecId={`${this && this.props && this.props.ecId || ''}_DistanceToPeak@ye3y6n`} requestDistanceToPeak={distance => this.getDistanceToPeak(distance)}/>
</div>
);
}
}

View File

@ -0,0 +1,51 @@
import {
inject,
observer
} from 'mobx-react';
import {
WeaTop,
WeaRightMenu,
} from 'ecCom';
import InitForm from './InitForm';
import AnalysisResult from './AnalysisResult';
@inject('hrmInit')
@observer
class Top extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.props.hrmInit.getRightMenu();
}
render() {
const {
topProps,
toploading,
topButtons,
dropMenuDatas,
hasInit,
} = this.props.hrmInit;
return (
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@ff4n4w`}
{...topProps}
loading={toploading}
buttons={topButtons}
dropMenuDatas={dropMenuDatas}
>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@g1rp54`} datas={dropMenuDatas}>
{
hasInit ? <AnalysisResult ecId={`${this && this.props && this.props.ecId || ''}_AnalysisResult@zfqlrg`} /> : <InitForm ecId={`${this && this.props && this.props.ecId || ''}_InitForm@yq1l4h`} />
}
</WeaRightMenu>
</WeaTop>
);
}
}
export default Top;

View File

@ -0,0 +1,102 @@
import React ,{
Component
}from 'react';
import {
WeaTools,
WeaDialog,
WeaLocaleProvider
} from 'ecCom';
import {
Button,
message
} from 'antd';
import ReactDOM from 'react-dom';
const getLabel = WeaLocaleProvider.getLabel;
const check = (params) => {
return WeaTools.callApi('/api/kq/setupwizard/checkNeedInit', 'GET', params);
}
export const checkNeedInit = (onOk) => {
check().then(datas => {
const {
status,
message,
} = datas;
if (status === "2") {
const div = document.createElement("div");
document.body.appendChild(div);
ReactDOM.render(<UpgrageConfirm ecId={`${this && this.props && this.props.ecId || ''}_UpgrageConfirm@c8klle`} message={message} onOk={onOk}/>, div);
} else {
onOk();
}
}).catch(() => {
message.warning();
})
}
class UpgrageConfirm extends Component{
constructor(props){
super(props);
this.state = {
visible:false
}
}
componentDidMount() {
this.setState({visible:true});
}
handleOk = () => {
this.props.onOk && this.props.onOk();
this.handleCancel();
}
handleCancel = () => {
this.setState({visible:false});
}
getButtons = () => {
return[
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@7ef8ou`} onClick={this.handleOk} type="primary">{getLabel(33703, '确定')}</Button>,
]
}
render() {
const {
visible
} = this.state, {
message
} = this.props;
const pstyle = {
display: "table-cell",
verticalAlign: "middle",
padding: "0 15px"
}
if (!visible) {
return null;
}
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@a5c9nv`}
hasScroll
title={getLabel(131329, '信息确认')}
icon="icon-coms02-Warning"
iconBgcolor="#ff9900"
visible={visible}
style={{width:380,height:100}}
onCancel={this.handleCancel}
buttons={this.getButtons()}
>
<div style={{height:"100%",display: "table",margin: "0 auto"}}>
<p style={pstyle} dangerouslySetInnerHTML={{__html: message}} />
</div>
</WeaDialog>
);
}
}

View File

@ -0,0 +1,53 @@
import React from 'react';
import {
observer,
inject
} from 'mobx-react';
import {
AlertPage,
Loading,
} from '../../public/learn';
import '../../style/init.less'
import Top from './Top';
@inject('hrmInit')
@observer
export default class Init extends React.Component {
constructor(props) {
super(props);
}
componentWillMount() {
this.props.hrmInit.refresh((domain) => domain.newForm());
}
componentDidMount() {
this.props.hrmInit.getPermissionInfo();
}
componentWillReceiveProps(nextProps) {
if (this.props.location.key !== nextProps.location.key) {
this.props.hrmInit.refresh((domain) => domain.resetForm());
}
}
render() {
const {
hrmInit,
} = this.props, {
pageAccessPermission
} = hrmInit, {
hasRight,
loading
} = pageAccessPermission;
if (!hasRight) {
return loading ? <Loading ecId={`${this && this.props && this.props.ecId || ''}_Loading@t4gws4`} size='lg'/> : <AlertPage ecId={`${this && this.props && this.props.ecId || ''}_AlertPage@87vbbn`} />
} else {
return (
<Top ecId={`${this && this.props && this.props.ecId || ''}_Top@p6rcho`} />
)
}
}
}

View File

@ -0,0 +1,32 @@
import React, {Component} from 'react';
import {observer} from 'mobx-react';
import {WeaDialog, WeaNewScroll} from 'ecCom';
import {FormInfo} from '../../../hrmComsPublic/index';
@observer
export default class CreateGroup extends Component{
render(){
const {
store
} = this.props;
const {createFieldDefineDialogProps, formTarget, feildDefineFormItemRender} = store;
const {
createFieldDefineForm: form,
createFieldDefineFormFields: fields
} = formTarget;
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@8v63w6`} {...createFieldDefineDialogProps} key={new Date().getTime()}>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@541rr8`} height={'100%'}>
<FormInfo ecId={`${this && this.props && this.props.ecId || ''}_FormInfo@g0ptvy`}
className='formComponent'
center={false}
form={form}
formFields={fields}
itemRender={feildDefineFormItemRender}/>
</WeaNewScroll>
</WeaDialog>
)
}
}

View File

@ -1,25 +1,25 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {observer} from 'mobx-react'; import {observer} from 'mobx-react';
import {WeaDialog, WeaNewScroll} from 'ecCom'; import {WeaDialog, WeaNewScroll} from 'ecCom';
import {FormInfo} from '../../../../../pc4backstage/hrmComsPublic/index'; import {FormInfo} from '../../../hrmComsPublic/index';
@observer @observer
export default class CreateTemplate extends Component{ export default class CreateGroup extends Component{
render(){ render(){
const { const {
store store
} = this.props; } = this.props;
const {createTemplateDialogProps, formTarget} = store; const {createGroupDialogProps, formTarget} = store;
const { const {
createTemplateForm: form, createGroupForm: form,
createTemplateFormFields: fields createGroupFormFields: fields
} = formTarget; } = formTarget;
return ( return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@eqwjfx`} {...createTemplateDialogProps}> <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@tg3428`} {...createGroupDialogProps} key={new Date().getTime()}>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@reph85`} height={'100%'}> <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@tj6hyx`} height={'100%'}>
<FormInfo ecId={`${this && this.props && this.props.ecId || ''}_FormInfo@w7am1a`} <FormInfo ecId={`${this && this.props && this.props.ecId || ''}_FormInfo@4137i7`}
className='formComponent' className='formComponent'
center={false} center={false}
form={form} form={form}

View File

@ -0,0 +1,53 @@
import React, {Component} from 'react';
import {observer} from 'mobx-react';
import {WeaRightMenu, WeaTableEditable} from 'ecCom';
@observer
export default class FieldDataList extends Component{
constructor(props) {
super(props);
this.state = {
resize: new Date().getTime()
}
}
componentDidMount() {
window.addEventListener('resize', this.resizeHandle);
}
componentWillUnmount() {
window.removeEventListener('resize', this.resizeHandle);
}
resizeHandle = (e) => {
this.setState({
resize: new Date().getTime()
})
}
render(){
const {resize} = this.state;
const {
rightMenu,
store
} = this.props;
const {fieldListTableProps} = store;
let tableProps = {};
if (this.tabDom) {
tableProps = {
scroll: {
y: this.tabDom.offsetHeight - 40,
}
}
}
return (
<div className="tabPane" ref={dom => {this.tabDom = dom}}>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@nv7532`} datas={rightMenu}>
<WeaTableEditable ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEditable@cfv3an`} {...fieldListTableProps} tableProps={tableProps}/>
</WeaRightMenu>
</div>
)
}
}

View File

@ -0,0 +1,22 @@
import React, {Component} from 'react';
import {observer} from 'mobx-react';
import {Tabs} from '../../../hrmComsPublic/index';
import FieldDataList from './FieldDataList.js';
@observer
export default class FieldTabs extends Component{
render(){
const {
store
} = this.props;
const {mainTabProps} = store;
return (
<div>
<Tabs ecId={`${this && this.props && this.props.ecId || ''}_Tabs@vwdm59`} {...mainTabProps}>
<FieldDataList ecId={`${this && this.props && this.props.ecId || ''}_FieldDataList@qitkvh`} />
</Tabs>
</div>
)
}
}

View File

@ -0,0 +1,19 @@
import React, {Component} from 'react';
import {observer} from 'mobx-react';
import {WeaDialog, WeaTableEditable} from 'ecCom';
@observer
export default class GroupListSetting extends Component{
render(){
const {
store
} = this.props;
const {groupListSettingDialogProps, groupListTableProps} = store;
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@h1w7s0`} {...groupListSettingDialogProps}>
<WeaTableEditable ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEditable@q1ppvf`} {...groupListTableProps}/>
</WeaDialog>
)
}
}

View File

@ -0,0 +1,64 @@
import '../../style/kqMonthReportSetting.less';
import React, {Component} from 'react';
import {inject,observer} from 'mobx-react';
import {WeaTop, WeaAlertPage} from 'ecCom';
import {i18n} from '../../public/i18n';
import {Spin} from 'antd'
import FieldTabs from './FieldTabs.js';
import CreateFieldDefine from './CreateFieldDefine.js';
import CreateGroup from './CreateGroup.js';
import GroupListSetting from './GroupListSetting.js';
@inject('kqMonthReportSetting')
@observer
export default class KQMonthReportSetting extends Component{
componentDidMount() {
this.init();
}
componentWillReceiveProps(nextProps) {
if (this.props.location.key !== nextProps.location.key) {
this.init();
}
}
init = () => {
const {
kqMonthReportSetting: store
} = this.props;
store.checkAuthorized('kq/reportFieldDefine', null, store.init, null, false);
}
render(){
const {
kqMonthReportSetting: store
} = this.props;
const {
containerInitFinished,
loading,
topProps
} = store;
return (
<div className="hrm_module_container kqMonthReportSetting">
{
containerInitFinished.init && containerInitFinished.authorized &&
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@4h8le8`} spinning = {loading}>
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@u7retr`} {...topProps}>
<FieldTabs ecId={`${this && this.props && this.props.ecId || ''}_FieldTabs@79s71v`} store={store} />
<CreateFieldDefine ecId={`${this && this.props && this.props.ecId || ''}_CreateFieldDefine@dizbxs`} store={store} />
<CreateGroup ecId={`${this && this.props && this.props.ecId || ''}_CreateGroup@em7d7j`} store={store} />
<GroupListSetting ecId={`${this && this.props && this.props.ecId || ''}_GroupListSetting@n4v9ye`} store={store} />
</WeaTop>
</Spin>
}
{
containerInitFinished.init && !containerInitFinished.authorized &&
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@pwskl5`}>
<div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
</WeaAlertPage>
}
</div>
)
}
}

View File

@ -0,0 +1,364 @@
import {
observer
} from 'mobx-react';
import {
WeaFormItem,
WeaInputNumber,
WeaLocaleProvider,
} from 'ecCom';
import {i18n} from '../../public/i18n.js'
const getLabel = WeaLocaleProvider.getLabel;
@observer
class BalanceConversionRules extends React.Component {
constructor(props) {
super(props);
}
//头部
getHeader = () => {
const {
store
} = this.props, {
conversionRules,
dialog,
setTimeInterval,
} = store, {
timeInterval
} = conversionRules, {
form,
isEnable
} = dialog;
const {
distributionMode, //余额发放方式
} = form.getFormParams();
return (
<div className='hrm-customized-input' style={{borderBottom: '1px solid #eee',marginBottom: 10,paddingBottom: 10}}>
<span style={{marginRight: 3}}>
<i className='icon-coms-Tile' />
<b style={{marginLeft: 5}}>
{ distributionMode === '2' ? i18n.label['527582'] : getLabel('505549',"工龄")}
{`${getLabel('505550',"区间")} : `}
</b>
</span>
<WeaInputNumber ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@ty2szd`}
min={0}
disabled={isEnable === '0' ? true :false}
value={timeInterval}
onChange={val => setTimeInterval(val)}/>
<span>
<b>{i18n.label['527583']}</b>
</span>
</div>
)
}
getBalancePaymentMethods = () => {
const {
store
} = this.props, {
conversionRules,
dialog,
changeBalanceConversionRules,
delBalanceConversionRule,
} = store, {
balanceConversionRules,
unit
} = conversionRules, {
form,
isEnable,
} = dialog;
const {
distributionMode, //余额发放方式
} = form.getFormParams();
const balancePaymentMethods = [];
balanceConversionRules.map((balanceConversionRule, index) => {
const {
timePoint,
amount
} = balanceConversionRule;
balancePaymentMethods.push(
<div className='hrm-customized-input' style={{position:'relative'}}>
<span>
{ distributionMode === '2' ? getLabel('505548',"司龄") : getLabel('505549',"工龄")}
</span>
<span>
{`${index === 0 ? '<' : '≥'}`}
</span>
<span>
{`${[0,1].includes(index) ? 1 : timePoint}${getLabel('505552',"年")} , ` }
</span>
<span>
{getLabel('505551',"享有")}
</span>
<WeaInputNumber ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@jmr30e@${index}`}
viewAttr={3}
value={amount}
min={0}
disabled={isEnable === '0' ? true :false}
onChange={val => changeBalanceConversionRules(index, val)}/>
<span>
{`${unit ? unit : getLabel(505553,'天')}${window.e9_locale.userLanguage == '7'? '' : ' '}${i18n.label['527585']}`}
</span>
{( (isEnable === '1') && (index > 1) && index === (balanceConversionRules.length - 1) ) && <span className='wea-f14' style={{position:'absolute',top:7, marginLeft: 10}} onClick={() =>delBalanceConversionRule()}>
<i className='icon-coms-Clear hrm-del-icon' />
</span>}
</div>
)
})
return balancePaymentMethods;
}
addRule = () => {
const {
store
} = this.props, {
addBalanceConversionRule,
dialog
} = store, {
isEnable
} = dialog;
if (isEnable === '0') {
return null;
}
return (
<span className='holiday-link' onClick={addBalanceConversionRule}>
<i className='icon-coms-Add-to-o'/>
<span style={{marginLeft: 5}}>{getLabel('505555',"添加规则")}</span>
</span>
)
}
render() {
return (<div style={{padding:15, border: '1px solid #D9D9D9'}}>
{
this.getHeader()
}
{
this.getBalancePaymentMethods()
}
{
this.addRule()
}
</div>)
}
}
@observer
class MixBalanceConversionRulesNew extends React.Component {
constructor(props) {
super(props);
}
getHeader = () => {
const {
store
} = this.props, {
dialog,
conversionRules
} = store, {
form
} = dialog, {
unit: ut
} = conversionRules;
const labels = [getLabel('505549', "工龄"), getLabel('505548', "司龄"), getLabel('505556', "法定年假"), getLabel('505557', "福利年假")];
return (
<div style={{padding: '12px 0', backgroundColor:'#eee' }}>
{
labels.map( (label,index) => {
let unit;
if([0,1].includes(index)){
unit = getLabel('505552',"年");
}else{
unit = ut ? ut : getLabel(505553,'天');
}
return (
<div className='hrm-over-flow' style={{display:'inline-block', width: [0,1].includes(index) ? 70 : 97,textAlign: 'center' }} title={`${label}(${unit})`}>
<i className='icon-coms-Tile'/>
<span style={{marginLeft: 5}}>{`${label}(${unit})`}</span>
</div>
)
})
}
</div>
)
}
getBalancePaymentMethods = () => {
const {
conversionRules,
changeEntryTime, //司龄输入框事件
changeWorkYear, //工龄输入框事件
changeLegalAmount, //法定年假输入框事件
changeWelfareAmount, //福利年假输入框事件
delBalanceConversionRule,
dialog
} = this.props.store, {
mixBalanceConversionRules, //工龄+司龄余额发放规则
} = conversionRules, {
isEnable
} = dialog;
const balancePaymentMethods = [];
//工龄、司龄列
const ageInputNumber = (params) => {
const {
value,
handleChange
} = params;
return (
<span>
<span><b></b></span>
<span style={{display: 'inline-block',width: 45,marginLeft: 5}}>
<WeaInputNumber ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@5vrbtr`}
viewAttr={3}
min={0}
disabled={isEnable === '0' ? true :false}
value={value}
onChange={val => handleChange(val)}
/>
</span>
</span>
)
}
//法定年假、福利年假列
const balanceInputNumber = (params) => {
const {
value,
handleChange
} = params;
return (
<span style={{display: 'inline-block',width: 75}}>
<WeaInputNumber ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@3gpcmo`}
viewAttr={3}
min={0}
disabled={isEnable === '0' ? true :false}
value={value}
onChange={val => handleChange(val)}
/>
</span>
)
}
//遍历混合余额发放规则
mixBalanceConversionRules.map((mixBalanceConversionRule, outsideIndex) => {
const {
entryTime, //司龄
workYear, //工龄
legalAmount, //法定年假
welfareAmount, //福利年假
} = mixBalanceConversionRule;
//outsideIndex: 行索引值
balancePaymentMethods.push(
<div style={{lineHeight: '45px',borderBottom: '1px solid #eee',position:'relative' }}>
<span>
{
ageInputNumber({
value: workYear,
handleChange: (val) => changeWorkYear(outsideIndex, val)
})
}
</span>
<span style={{marginLeft: 15}}>
{
ageInputNumber({
value: entryTime,
handleChange: (val) => changeEntryTime(outsideIndex, val)
})
}
</span>
<span style={{marginLeft: 20}}>
{
balanceInputNumber({
value: legalAmount,
handleChange: (val) => changeLegalAmount(outsideIndex, val)
})
}
</span>
<span style={{marginLeft: 23}}>
{
balanceInputNumber({
value: welfareAmount,
handleChange: (val) => changeWelfareAmount(outsideIndex, val)
})
}
</span>
{
(isEnable === '1' && outsideIndex > 0 && outsideIndex === (mixBalanceConversionRules.length - 1) ) && (
<span style={{position: 'absolute',right: -10,top: 2}} className='wea-f14' onClick={() => delBalanceConversionRule({type:'mix'}) }>
<i className='icon-coms-Clear hrm-del-icon' />
</span>
)
}
</div>
)
})
return balancePaymentMethods
}
addRule = () => {
const {
store
} = this.props, {
addBalanceConversionRule,
dialog
} = store, {
isEnable
} = dialog;
if (isEnable === '0') {
return null;
}
return (
<span className='holiday-link' style={{display: 'inline-block', marginTop: 6}} onClick={() => addBalanceConversionRule({type:'mix'})}>
<i className='icon-coms-Add-to-o' />
<span style={{marginLeft: 5}}>
{getLabel('505555',"添加规则")}
</span>
</span>
)
}
render() {
return (
<div style={{padding:15, border: '1px solid #D9D9D9'}}>
<div style={{clear:'both',marginTop: 8}}>
{
this.getHeader()
}
{
this.getBalancePaymentMethods()
}
{
this.addRule()
}
</div>
</div>
);
}
}
export {
BalanceConversionRules,
MixBalanceConversionRulesNew,
}

View File

@ -7,7 +7,7 @@ import {
import { import {
Loading, Loading,
} from '../../public/learn'; } from '../../public/learn';
import DialogContent from './DialogContent'; import DialogForm from './DialogForm';
@observer @observer
export default class Dialog extends React.Component { export default class Dialog extends React.Component {
@ -21,26 +21,18 @@ export default class Dialog extends React.Component {
} = this.props, { } = this.props, {
DIALOG, DIALOG,
dialog, dialog,
dialogStyle,
dialogButtons, dialogButtons,
moreBtn,
icon,
iconBgcolor,
dialogLoading,
} = store; } = store;
return ( return (
<WeaDialog <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@pw7kkv`}
{...DIALOG} {...DIALOG}
{...dialog} {...dialog}
style={dialogStyle}
buttons={dialogButtons} buttons={dialogButtons}
moreBtn={moreBtn}
icon={icon}
iconBgcolor={iconBgcolor}
loading={dialogLoading}
> >
<DialogContent store={store}/> {
dialog.loading ? <Loading ecId={`${this && this.props && this.props.ecId || ''}_Loading@odnwvu`} /> : <DialogForm ecId={`${this && this.props && this.props.ecId || ''}_DialogForm@x1kv8p`} store={store}/>
}
</WeaDialog> </WeaDialog>
); );
} }

Some files were not shown because too many files have changed in this diff Show More